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)
-   -   Info: Codeanalyse (https://www.schachcomputer.info/forum/showthread.php?t=5611)

Tibono 21.11.2023 14:12

AW: Re: AW: Re: Codeanalyse
 
Zitieren:

Zitat von Moonshine (Beitrag 121436)
Hello Cordially, (...)
Hannes

Hi Hannes,
at end of a letter or post, 'cordially' (or 'cordially yours') is an alternative to e.g. 'best regards'. Not a nickname ;)

Schönen Gruß,
Eric

Moonshine 21.11.2023 17:24

AW: Codeanalyse
 
Hello Tibono,

thanks for the tip. I didn't know that!

Hannes

user_2141 22.11.2023 11:05

AW: Codeanalyse
 
Hallo Hannes,
Meine frühere Nachricht dazu ging offenbar verloren.
Ich habe bemerkt, dass CB-Emu eine vollständige Debugger-Umgebung enthält. Ich werde das mal ausprobieren.
Hans

Moonshine 22.11.2023 18:37

AW: Codeanalyse
 
Zitieren:

Zitat von Hans21 (Beitrag 121473)
Hallo Hannes,
Ich habe bemerkt, dass CB-Emu eine vollständige Debugger-Umgebung enthält. Ich werde das mal ausprobieren.
Hans

Hallo Hans,

kannst Du mir bitte Näheres zu dieser Debugger-Umgebung sagen? Das würde mich auch sehr interessieren.
Danke und Lg

Hannes

Mychess 22.11.2023 19:03

Re: Codeanalyse
 
Hello,

About the sensory 9 opening library :

- Subroutine F291 looks for a next move in the library and tests whether it is the same one that has been played.
If so, finish, if not, then test its brothers.
If they are all different or no brothers, end library.
Code:

                                                                                                               
F291 :  jsr    LF2D5    ; F2D5 search for next move and detect brother move and/or end of variant.
F294 :  cmp    X009B                                                                                               
F296 :  beq    LF2A2                                                                                               
F298 :  jsr    LF2F2    ; F2F2 brother processing, and in some cases #$Cx jump over x bytes, x from 0 to 7.
F29B :  bcc    LF291    ; another brother                                                                                           
F29D :  lda    #$FF      ; out of library                                                                                         
F29F :  sta    X009A      ; in flag                                                                                         
F2A1 :  rts

- F2A2 browses the library.
Check that you are not already out of the library.
If code #$C4, no hit and end of library.
If code #$C2, it is a jump, 2 following bytes are the address (if null address, end of library).
Otherwise normal move.

The Sensory 9 has a special mode (F5) that allows this library to be extended to less good moves.



Cordially.

user_2141 22.11.2023 19:31

AW: Codeanalyse
 
Hallo Hannes,

Ich öffne auf meiner Linux-Maschine eine Kommandozeile und gehe ins Verzeichnis wo "CB-Emu.exe" liegt.

Dort gebe ich den Befehl
"wine CB-Emu.exe -debug fscc9a1"
ein.

"fscc1a" ist in der letzen CB-Emu-Version der Name für das Sensory 9-1.6MHz-Gerät.

Auf einer Windows-Machine sollte es ähnlich gehen, einfach ohne "wine", also:
"CB-Emu.exe -debug fscc9a1"

Du siehst dann neben dem Brett eine Debug-Konsole. Die Anleitung dazu steht in "https://docs.mamedev.org/" unter "Mame Debugger".

Man kann sich dann z.B. auch in Echtzeit den RAM-Inhalt anzeigen lassen.
Allerdings habe ich mir bis jetzt noch keinen Reim darauf machen können, wie das Brett und die Figuren kodiert sind. Vielleicht findest du das raus.

Hans

Zitieren:

Zitat von Moonshine (Beitrag 121507)
Hallo Hans,

kannst Du mir bitte Näheres zu dieser Debugger-Umgebung sagen? Das würde mich auch sehr interessieren.
Danke und Lg

Hannes


user_2141 22.11.2023 19:45

AW: Re: Codeanalyse
 
Zitieren:

Zitat von Mychess (Beitrag 121508)
Hello,

About the sensory 9 opening library :

- Subroutine F291 looks for a next move in the library and tests whether it is the same one that has been played.
If so, finish, if not, then test its brothers.
If they are all different or no brothers, end library.
Code:

                                                                                                               
F291 :  jsr    LF2D5    ; F2D5 search for next move and detect brother move and/or end of variant.
F294 :  cmp    X009B                                                                                               
F296 :  beq    LF2A2                                                                                               
F298 :  jsr    LF2F2    ; F2F2 brother processing, and in some cases #$Cx jump over x bytes, x from 0 to 7.
F29B :  bcc    LF291    ; another brother                                                                                           
F29D :  lda    #$FF      ; out of library                                                                                         
F29F :  sta    X009A      ; in flag                                                                                         
F2A1 :  rts

- F2A2 browses the library.
Check that you are not already out of the library.
If code #$C4, no hit and end of library.
If code #$C2, it is a jump, 2 following bytes are the address (if null address, end of library).
Otherwise normal move.

The Sensory 9 has a special mode (F5) that allows this library to be extended to less good moves.



Cordially.

Hello Mychess,

Great. Thanks a lot!

In Ghidra, as well an in the CB-Emu-Debugger I have the Sensory 9-1.6 MHz-ROM. There I have found it, but at a higher address, namely

LAB_f346 XREF[1]: f350(j)
f346 20 8a f3 JSR FUN_f38a undefined FUN_f38a()
f349 c5 9b CMP DAT_009b
f34b f0 0a BEQ LAB_f357
f34d 20 a7 f3 JSR FUN_f3a7 undefined FUN_f3a7()
f350 90 f4 BCC LAB_f346
f352 a9 ff LDA #0xff
f354 85 9a STA DAT_009a
f356 60 RTS

I guess it is the same.
Am I right?

Best regards

Hans

Mychess 22.11.2023 19:52

Re: AW: Codeanalyse
 
Zitieren:

Zitat von Hans21 (Beitrag 121511)
Hallo Hannes,

Allerdings habe ich mir bis jetzt noch keinen Reim darauf machen können, wie das Brett und die Figuren kodiert sind. Vielleicht findest du das raus.

Hans

Hello Hans,
Code:

0x0060 : 10 11 12 13 14 15 16 17  white pawns
0x0068 : 01 06 02 05 00 07 03 04  white pieces
0x0070 : 60 61 62 63 64 65 66 67  black pawns
0x0078 : 71 76 72 75 70 77 73 74  black pieces
                               
        00 01 02 03 04 05 06 07
0x0080 : 0c 08 0a 0e 0f 0b 09 0d
0x0090 : 00 01 02 03 04 05 06 07
0x00A0 : 00 00 00 00 00 00 00 00
0x00B0 : 00 00 00 00 00 00 00 00
0x00C0 : 00 00 00 00 00 00 00 00
0x00D0 : 00 00 00 00 00 00 00 00
0x00E0 : 10 11 12 13 14 15 16 17
0x00F0 : 1c 18 1a 1e 1f 1b 19 1d

In 0x80, 0c (0x80 + 00)
In 0x60+0c, 00

Perhaps you need :

0x0320 : 00 00 00 00 00 00 00 00 white pawn type
0x0328 : 02 02 0a 0a 08 08 06 04 white piece type
0x0330 : 01 01 01 01 01 01 01 01 black ...
0x0338 : 03 03 0b 0b 09 09 07 05 black ...


Cordially

user_2141 22.11.2023 21:58

AW: Codeanalyse
 
Great. Now I see it (see below). Thanks, Hans

CB-Emu-debugger-memory-dump of "fscc9a1" in start position:

0000: 00 00 70 FF 20 00 00 00 00 00 34 14 00 00 FF FF ..p. .....4.....
0010: 0C 64 44 01 00 00 0C 20 00 00 E4 00 00 00 00 00 .dD.... ........
0020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0060: 10 11 12 13 14 15 16 17 01 06 02 05 00 07 03 04 ................
0070: 60 61 62 63 64 65 66 67 71 76 72 75 70 77 73 74 `abcdefgqvrupwst
0080: 0C 08 0A 0E 0F 0B 09 0D 00 80 10 00 01 00 00 00 ................
0090: 00 01 02 03 04 05 06 07 00 00 00 0C 20 00 00 FF ............ ...
00A0: 80 80 80 80 80 80 80 80 00 70 00 08 10 08 68 C2 .........p....h.
00B0: 80 80 80 80 80 80 80 80 88 02 0B 20 00 00 00 00 ........... ....
00C0: 80 80 80 80 80 80 80 80 00 00 00 00 00 00 01 00 ................
00D0: 80 80 80 80 80 80 80 80 00 00 00 00 00 00 00 00 ................
00E0: 10 11 12 13 14 15 16 17 14 34 00 00 14 34 00 00 .........4...4..
00F0: 1C 18 1A 1E 1F 1B 19 1D 00 00 00 00 00 00 00 00 ................

Moonshine 22.11.2023 22:22

AW: Codeanalyse
 
Zitieren:

Zitat von Hans21 (Beitrag 121511)
Hallo Hannes,

Ich öffne auf meiner Linux-Maschine eine Kommandozeile und gehe ins Verzeichnis wo "CB-Emu.exe" liegt.

Dort gebe ich den Befehl
"wine CB-Emu.exe -debug fscc9a1"
ein.

Hans

Hallo Hans,

danke, das funktioniert wunderbar! Werde mich damit mal ein wenig beschäftigen.
Wie das Brett dargestellt wird, hat Mychess schon beantwortet. Das sehe ich im Simulator auch sehr schön. Aber dieser Debug-Modus von CB-Emu ist wahrscheinlich brauchbarer.

Lg

Hannes


Alle Zeitangaben in WEZ +2. Es ist jetzt 14:35 Uhr.

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