Thema: Info: Codeanalyse
Einzelnen Beitrag anzeigen
  #37  
Alt 22.11.2023, 19:45
user_2141
Gast
 
Beiträge: n/a
Aktivitäten Langlebigkeit
0/20 0/20
Heute Beiträge
sssssssss
AW: Re: Codeanalyse

 Zitat von Mychess Beitrag anzeigen
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
Mit Zitat antworten
Folgender Benutzer sagt Danke zu für den nützlichen Beitrag:
kamoj (22.11.2023)