Thanks a lot Mychess.
I worked hard (a dozen hours
), but achieved spotting the RAM location and encoding for the score.
The score is located at &h0222 and &h0223 of the maincpu memory.
&h0223 is the heavy byte of the score word.
The heavy bit of the heavy byte acts as the sign (1=positive score, 0=negative score). The score is always the computer's one.
To convert the hex word into a decimal value:
- add &h8000 to the hex score which is concat RAM(&h0223);RAM(&h0222)
(you can get the same result with Xor'ing the score and &h8000)
- convert the above result into decimal
- divide this decimal value by 256, you got it!
examples from Mychess' data
move 2. ... D6-D3 RAM(&h0222)=48, RAM(&h0223)=84
score is &h8448
+ &h8000 = &h0448 = 1096
1096 / 256 = 4,28
move 4. G4-G5 RAM(&h0222)=4A, RAM(&h0223)=7B
score is &h7B4A
+ &h8000 = &hFB4A = -1206
-1206 / 256 = -4,71
Beware the score is computed continuously, this means you need to use the latest value displayed just before the move is announced, as this triggers a new computation (the pondering phase starts).
Worth pointing out: the printed value (using the printer, I mean) is truncated after the second decimal (not rounded).
The formula can easily be entered in a worksheet in order to provide the decimal score from the two bytes input.
Specific values are used to announce "mate in" (based on distance to mate, in half-moves)
8. ... G5-G6 score is &hF800 (printed as 97) = mate in 3
9. ... F5-F6 score is &hFA00 (printed as 98) = mate in 2
10. ... F6-F7 score is &hFC00 (printed as 99) = mate in 1
11. ... G6-H6++ score is &h0001 (printed as checkmate)
Now I can run the Khmelnitsky test!
A guide on how to get the RAM values:
- run MessExtra.exe from the MessExtra sub-directory (don't use CB-Emu.exe from the parent directory)
- from the GUI, open the Properties menu for the Novag Constellation Expert device
- on the Debug tab, enable Activate Integrated Debugger
- run the device as usual, an additional "Debug" window should appear
- use the Debug menu to run the emulation (or F5 from the Debug window)
- use the Debug menu to open a new memory window (or Ctrl-M from the Debug window). You may either let the default drop-down memory area (named Rockwell R65C02 ':maincpu' program space memory) or select memory/:maincpu/0/00000000-0000ffff. The data we are interested in is present in both options, at the very same offset.
- input 222 in the top/left blank area, and hit enter. This will shift the display to the RAM address we want to observe. You can reduce the window size, as only a couple of bytes are useful on display.
Have fun!
MfG,
Eric