Schachcomputer.info Community

Schachcomputer.info Community (https://www.schachcomputer.info/forum/index.php)
-   Die ganze Welt der Schachcomputer / World of chess computers (https://www.schachcomputer.info/forum/forumdisplay.php?f=2)
-   -   Idee: Novag Delta-1 code (https://www.schachcomputer.info/forum/showthread.php?t=6034)

Tibono 17.10.2019 23:24

Novag Delta-1 code
 
Hi,
I first apologize not being able to write a quite long post in German.

I will soon add a Delta-1 to my collection ("ordered" it as a birthday gift) and wanted to dig into the authorship mystery.

As it is now easy to browse ROM data files dumped for emulation purpose, I compared the Delta ROM with some candidates, all F8-3850 or F8-3870 based:
- Novag CC MK I, 1978, 2Kb ROM, 256b RAM (D. Goodrich)
- Boris, 1978, 2.5Kb ROM, 256b RAM (D. Lindsay)
- Boris Diplomat, 1979, 2.5Kb ROM, 256b RAM (D. Lindsay)
- Novag Pocket Chess/Chess Traveller, 1980, 2Kb ROM, 64b RAM (M. Johnson)
- Novag Delta-1, 1980, 4Kb ROM, 312b RAM (to be identified)

Of course I could not perform such a comparison with 6502 based devices, such as CC MK II or MK III. Anyway Mike Johnson is present with the Pocket Chess; and Peter Jennings indeed lacking.

But let's step forward with the ones that can be compared on a byte to byte basis:
- I could find no similarities between Delta-1 code and CC MK I nor Pocket Chess
- on the other hand, I found significant identical blocks of bytes between Delta-1 and whichever Boris/Boris Diplomat. And comparing Boris/BorisD to each other, I found roughly the same amount of similarities.

Let's get a bit more accurate: I considered identical blocks showing at least 8 consecutive very same bytes (same positions of course); longer blocks being as well added to the count if all bytes but very few were same, and same position in the block. The few non corresponding bytes were of course removed from the count.

Example: s = same byte; - = different byte
----ssssssss--- value +8 (minimum block)
---ss-ssssssss-sss--- value +13 (extended block & >minimum)
---ssssss--s---sssss--- no value, so 0 (minimum not reached)

Consecutive 00 or FF were not considered.

I so found :
- 800 bytes in identical blocks comparing Delta-1 to Boris
- 808 bytes in identical blocks comparing Delta-1 to Boris Diplomat
- 871 bytes in identical blocks comparing Boris to Boris Diplomat.

Total bytes ROM count being 2006 for BorisD, 2831 for Boris, and 4096 for Delta-1:
- the Delta-1 shares 20% of its code with any of both Boris
- Boris shares 28% of its code with Delta-1, and 31% with Boris Diplomat
- The most impressive ratio is the one based on the smallest Boris Diplomat, sharing 40% of its code with the Delta-1, and 43% with the Boris.

That is common DNA, isn't it?

But a question remains pending: why is the Delta-1 so weak? (despite larger ROM, larger RAM, faster clock and later birth...)

Viele Grüße
Eric

hap 18.10.2019 10:18

Re: Novag Delta-1 code
 
Yes, when doing a hex compare between Delta-1 and Boris, you can see many similarities. But be aware that this alone is not 100% proof that the chess engine was written by the same person.

for example:
person A: programmed user interface for Boris/Boris D
person B: chess engine for Boris
person A: user interface for Delta-1
person C: chess engine for Delta-1

Tibono 24.11.2019 11:28

AW: Novag Delta-1 code
 
Hi,

I just spotted another similarity which to my opinion is quite convincing, as it is about a visible feature (and a documented one, in either user's manuals for Delta-1, Boris and Boris Diplomat).

Not about the level setting being same, based on a timer - same indeed but quite unsignificant (used as well in Mike Johnson's Chess Champion Super System III, as an example).

It is about the intimate logical board update: the computer's last move is not updated unless the next player's move is entered. This is true regarding either both Boris or the Delta-1, and is quite an uncommon way to manage the board update. The user's manuals explain this in the part about taking back a wrong move. I personally don't know about any other device handling like that (please let me know, should I miss some).

I much doubt a that small, early and basic program would split board representation and chess engine, and the feature is quite structuring for both user interface and chess engine. So I stick to the idea the Delta-1 is a Lindsay based device (legal copyright or maybe not!).

Grüße
Eric

mclane 24.11.2019 20:31

AW: Novag Delta-1 code
 
And mike johnson would be mkIII and mkIV.

So the question still remains: why is delta 1 so weak although having the best hardware from all the other clones.

bataais 06.05.2020 11:28

AW: Novag Delta-1 code
 
I had a look again at Delta-1 chess, I know now what it is:

They (some Scisys engineers) took the rom of Boris Master (rev. 1) and tried to rewrite it for a 4x 7-Segment LED, unfortunately they botched the hack job,
the timer interrupt calls the new display routine much more frequently and so looses time for chess calculations; and more weird stuff is going on.

No wonder it plays so weak.

In the Delta-1 ROM is even some fragmented code remaining of the message:

0878:BORIS AWAITS YOUR MOVE
01 CD 7E 53 09 37 AE 50 (BC FD 59 C0 86 0)
(snipped from Sean Riddle's disassembly of Boris rev. 1)

mclane 06.05.2020 11:41

AW: Novag Delta-1 code
 
Unglaublich eigentlich,

hap 06.05.2020 11:52

Re: Novag Delta-1 code
 
Nice =) There's no way excusing the remaining Boris message. Caught them red handed(whoever the programmers were that modified it).

bataais 06.05.2020 13:14

AW: Novag Delta-1 code
 
These programmers also tried to preserve the original Boris timer interrupt value,
if pin 5 of F8 3850 chip (IO-03) would be HIGH instead of GND.
Code:

Interrupt Routine

5924: 5E      LR  (IS--),A
5925: 20 98    LI  $98                        ;<- faster timer interrupt value ( F8 table: 91)
5927: BF      OUTS $0F
5928: 4B      LR  A,HL
5929: 5E      LR  (IS--),A
592A: 4A      LR  A,HU
592B: 5E      LR  (IS--),A
592C: 49      LR  A,J
592D: 5C      LR  (IS),A
592E: 1E      LR  J,W
592F: 0A      LR  A,IS
5930: 13      SL  1
5931: 13      SL  1
5932: E9      XS  J
5933: 59      LR  J,A
5934: 62      LISU $02
5935: A0      INS  $00                        ;<- get in/out port 0 (port is inverted)
5936: 21 08    NI  $08                        ;<- AND 8 (bit 3)
5938: 94 04    BNZ  $593D                ;Branch if not ZERO
593A: 20 4F    LI  $4F                        ;<- original Boris rev1 timer value (F8 table: 183)
593C: BF      OUTS $0F                        ;<- to 3853 chip
593D: A0      INS  $00
593E: 1F      INC
593F: 21 07    NI  $07
5941: 5B      LR  HL,A
5942: 2C      XDC
5943: 29 5D E6 JMP  $5DE6
.
.


I tried it with a modified Delta-1 ROM in MAME, but it only blinks slower, still same weak game.

bataais 07.05.2020 14:45

AW: Novag Delta-1 code
 
1 Anhang/Anhänge
I think I have found one major oversight by the hackers of Delta-1.

Boris rev1 is accessing a table for evaluation at the end of the ROM, just before the RAM is starting. (DCO gets added a negative value). With Delta-1, it's not accessing the table (which is missing in RAM and not located at the End of ROM), but the uninitialized junk RAM.

So I just copied the table to the RAM, also made one other change where the programmers thought it would be a computed goto, and voilà:

My hacked Delta-1 ROM is now (almost) playing like Boris rev.1, around half the speed because of the more frequent interrupt calls, but makes none of those stupid moves anymore.

Here my changes to Delta-1 ROM: (Adresses in ROM start not at 5000 but 0000)
Code:

5000 JMP $5EC0                29 5E C0        ; was        29 59 00

506F AI  $FD                24 FD                ; was        24 FE

5EC0 DCI $EBC0                2A EB C0        ; New copy table routine
5EC3 XDC                2C
5EC4 DCI $5880                2A 58 80
5EC7 LI $40                20 40
5EC9 LR 0,A                50
5ECA LM                        16                ; Loop
5ECB XDC                2C
5ECC ST                        17
5ECD XDC                2C
5ECE DS 0                30
5ECF BNZ $5ECA                94 FA
5ED1 JMP $5900                29 59 00

For those who want to try it in CB-EMU, just rename the original cc1delta.zip to e.g. cc1delta_orig.zip and add my hacked version (in the roms folder of MessExtra AND MessChess..)

Maybe I will modify my own Delta-1 with an updated eprom.

Pirated and double-hacked Regards,
bataais

Tibono 07.05.2020 18:02

AW: Novag Delta-1 code
 
Congrats for the zap! :respekt:
So, the relevant evaluation data is present in the Delta-1 ROM (80 bytes starting from offset 880, if I read you correctly), and actually not used? :lol:

They really screwed up... :doh:

Next step: patch the evaluation data itself, to setup personnalities... A credible alternative to The King program! :D

Kind regards,
Eric

bataais 07.05.2020 18:27

AW: Novag Delta-1 code
 
I actually burned an eprom and tried it in my real Delta-1, but didn't succeed.
Found out the both CHIP ENABLE's are somewhat different than standard mask-roms. ROM dump was the same as ma_winke_y1d.

And I believe the real Delta-1 does indeed access the table, because it's doing something with these chip enables. So the error should be in the MAME emulation, and I did only correct it for MAME.

When I let Delta-1 (original) start as white, it shows the same moves as Boris rev1, but on the emulation it's plays very differently.

hap 07.05.2020 18:52

Re: Novag Delta-1 code
 
Nothing strange there:

Delta-1 2332 ROM
_CE1 = A13
CE 2 = RD

Tibono 07.05.2020 19:10

AW: Novag Delta-1 code
 
Hi,
I let Arena play two games (15s/move) between both versions.

As black, Bataais' hacked version cleaned up material, reaching an overwhelming king + 2 rooks, 1 bishop, 2 knights and 4 pawn against genuine Delta-1's isolated king - but the game ended in a draw (3-fold rep).
As white, the hacked version won by checkmate with a large material advantage (king + 1 queen, 1 rook, 1 bishop, 1 knight, 4 pawns against king + 1 rook, 1 bishop, 1 pawn).

How to play both: surely many ways, this one is quite simple
- in MessChess, I created a hacked_roms new directory containing Bataais' ROM
- in Arena, I duplicated my Delta-1 engine and updated each with command line parameters:
ccdelta1 -rompath roms
ccdelta1 -rompath hacked_roms
You need to specify both, as without -rompath parameter the default is used from ccdelta1.ini file, where the latest used configuration is memorized. So better force it, or you will end using the hacked one anyway.

Of course, on hacked engine start, you need to manually skip the warning about the unexpected ROM.

Have fun,
Eric

Mike 07.05.2020 22:38

Re: Novag Delta-1 code
 
Congratulations on the work unravelling the Delta-1 puzzle.

It seems like a further chess programming scandal has been revealed this time 40 years after the event. When Data Cash Systems lost their court case and appeal it looks like Novag/SciSys took another liberty and pirated a second chess program for use in one of their models. This time Boris for the Delta-1.


I have updated my webpage on the Delta-1.

http://www.chesscomputeruk.com/html/...n_delta-1.html


Pirate regards
Mike

bataais 08.05.2020 09:57

AW: Novag Delta-1 code
 
2 Anhang/Anhänge
Thanks, Mike!

I finally managed to get the eprom working in my Delta-1!

Only had to invert the CE2 signal. Luckily there was a NOR 4001 already present which inverted it for the RAM 2111 chips. (Chip Selects are always confusing when replacing mask-roms with eproms..)

Sorry if I rushed into wrong conclusions about MAME, really nothing wrong there, except I was bewildered by the different moves compared to the real Delta-1. (I haven't played much on the original, since I got it only yesterday ;) ) I believe the uninitialized (randomized) RAM in MAME lets it play other moves.

Some pictures for those who want to replicate my hack. Be careful with the screws, I broke the plastic holders.

Now I will play some games..

EDIT: After playing some games, there's still something wrong, pieces get lost or appear in RAM.. Ich muss nochmals über die Bücher ;)

hap 08.05.2020 11:15

Re: Novag Delta-1 code
 
Right, MAME fills the RAM with rand() which will be different to a real Delta-1. I don't think an SRAM chip will be 100% random at power-on, it will have a pattern. Maybe some of the bits are truly 'random' (with parameters: temperature, magnetic field, slight voltage differences, ...)

This addressing thing won't work on the real chesscomputer, it will put the ROM table before RAM:

remove:
map(0x2000, 0x20ff).mirror(0x1f00).ram(); // A13

add:
map(0x2bc0, 0x2bff).rom().region("maincpu", 0x0880);
map(0x2c00, 0x2cff).ram();

bataais 08.05.2020 15:52

AW: Novag Delta-1 code
 
hap, I thought this adressing scheme should work on the real machine.

RAM gets adressed from EC00 to ECFF (in fact only bit 13 toggles RAM or ROM access, and RAM uses only 8 bits).

So if I place the 64-bytes table in RAM at 20C0 or EBC0 or ECC0 should result in the same thing.

Now if the DCO (Data counter) accesses the RAM at EC00, then decrements to EBFF, that should still access RAM at 2xFF or EBFF..

(The table HAS to be before RAM start, on the wrap-around.)

Am I wrong somewhere?

hap 08.05.2020 17:38

Re: Novag Delta-1 code
 
What the code above does, it places a part of the ROM at ebc0-ebff, so the reads from uninitialized RAM are now from the table at 0x5880.

hap 08.05.2020 22:05

Re: Novag Delta-1 code
 
Did you get good at F8 asm? :D

You know, it is possible to make a testrom for finding out the initial SRAM contents to see if there is a specific pattern that can be imitated on MAME. Delta-1 has 4 digits. You could read from RAM and show it on the display(2 digits for address, 2 for data) with half a second delay after each read, do this in a loop 256 times.

bataais 09.05.2020 09:33

AW: Novag Delta-1 code
 
Funny idea!

I didn't do much F8-assembly besides the copy table routine, but learned some when on-the-fly disassembling Boris / Delta-1.

I worked more on the soldering side. Tried all possible Chip Select combinations for the EPROM, but the strange RAM behavior still happens.

These are the two most logical connections, they work for a while, but then pieces get lost or appear in RAM (Version 2), the display begins to flicker and gets garbled (Version 1). I also tried tying one of the CE's to GND.
I believe my EPROM's aren't either fast enough or that /OE (Vpp) pin isn't TTL compatible.

Code:

Original Mask-ROM Version
(A-11 of 2332 Mask-ROM is pin 18!)

F8-3853                       

A13        ------------>        /CE1 of 2332 Mask ROM (pin 20)
(pin 30) |
        |  |\
        ---| |o---->  /CE1 of 2111 RAM (pin 15)
            |/


CPU
READ        ------------>        CE2 of 2332 Mask ROM (pin 21)
(pin 34) |
        |  |\
        ---| |o---->  Out Disable of 2111 RAM (pin 9)
            |/




Eprom-Version 1
(A-11 of 2732 Eprom is pin 21!)


F8-3853                       

A13        ------------>        /E of 2732 Eprom (pin 18)
(pin 30) |
        |  |\
        |--| |o---->  /CE1 of 2111 RAM (pin 15)
            |/


                  |->  /OE (Vpp) of 2732 Eprom (pin 20)
                  |
CPU            |\    |
READ        ---| |o---->  Out Disable of 2111 RAM (pin 9)
(pin 34)    |/



Eprom-Version 2

F8-3853                       

A13        ------------>        /OE (Vpp) of 2732 Eprom (pin 20)
(pin 30) |
        |  |\
        |--| |o---->  /CE1 of 2111 RAM (pin 15)
            |/


                  |->  /E of 2732 Eprom (pin 18)
                  |
CPU            |\    |
READ        ----| |o---->  Out Disable of 2111 RAM (pin 9)
(pin 34)    |/


hap 09.05.2020 11:46

Re: Novag Delta-1 code
 
Did you try with an unmodified EPROM to make sure it's not caused by one of the program modifications?

bataais 09.05.2020 14:42

AW: Novag Delta-1 code
 
hap, you're right, I thought of that too. And I did, with another new EPROM, and everything worked (Version 2 of CE's connection, same as in the pictures).

Then I slightly modified my hack, like this:

Code:

2nd Version

5000 JMP $5ED0                29 5E D0        ; was        29 59 00, moved copy routine to 5ED0

5ED0 DCI $ECC0                2A EC C0        ; New copy table routine, changed address
5ED3 XDC                2C
5ED4 DCI $5880                2A 58 80
5ED7 LI $40                20 40
5ED9 LR 0,A                50
5EDA LM                        16                ; Loop
5EDB XDC                2C
5EDC ST                        17
5EDD XDC                2C
5EDE DS 0                30
5EDF BNZ $5EDA                94 FA
5EE1 JMP $5900                29 59 00

..and burned it again on a new EPROM, and it worked, no more lost or added pieces in RAM. I can't explain codewise why it didn't work the first time, so I suspect a faulty EPROM.

Now testing if it really plays a better game..

bataais 10.05.2020 11:48

AW: Novag Delta-1 code
 
1 Anhang/Anhänge
After playing some games I can now confirm that my modified Delta-1 is playing Boris-style, as it (maybe) was intended 1979. It won both matches against Portachess II. Will do some more tests with Mini Chess, as Delta-1 didn't win any games of the 11 listed in the Aktivschach_Elo_Liste_2020.
The final hack-version here: ;)

bataais 10.05.2020 13:13

AW: Novag Delta-1 code
 
1 Anhang/Anhänge
Besides, this 'missing' table is in fact the starting position (high nibble) combined with a positional bonus for the evaluation (low nibble), I assume.

It shows up in every Boris version, and interestingly, Ron Nelson used this same scheme too, beginning with CC7 up to Voice Sensory. He changed it a little bit in the years. (See the hex comparison attached.)

So it would indeed be possible to get a different playing behaviour by modifying that table, as Tibono suggested.

Have a look here for more about these inards:
http://www.hiarcs.net/forums/viewtopic.php?t=9497

fhub 10.05.2020 13:40

AW: Novag Delta-1 code
 
Zitieren:

Zitat von bataais (Beitrag 90476)
The final hack-version here: ;)

Well, if this version does indeed play better, then I could of course add it to CB-Emu, e.g. as 'Delta-1 (modified)'.

But before doing it, I'd have to know the correct address mapping:
Is it (as for the original ROM)
map(0x2000, 0x20ff).mirror(0x1f00).ram(); // A13
or (like 'hap' posted for your 1st hack)
map(0x2bc0, 0x2bff).rom().region("maincpu", 0x0880);
map(0x2c00, 0x2cff).ram();
(or again something else, since you've changed the ROM once more)?

Regards,
Franz


Alle Zeitangaben in WEZ +2. Es ist jetzt 09:30 Uhr.

Powered by vBulletin (Deutsch)
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
©Schachcomputer.info