News: 11 March 2016 - Forum Rules

Author Topic: Akagawa Jirou no Yuurei Ressha NES dakuten  (Read 2288 times)

Pikachumanson

  • Hero Member
  • *****
  • Posts: 607
    • View Profile
Akagawa Jirou no Yuurei Ressha NES dakuten
« on: November 20, 2012, 02:37:39 pm »
Ok, I've now narrowed down the dakuten routine the 0XD000 section of the code and I think I've found it. I was wondering if anyone could take a quick look at this and confirm for me before I start writing over it not knowing what I'm writing over. Not versed in 6502 at all, still in the middle of that 408 page doc on 6502 they got here on this site.

Anyway, here is the suspected code I took from the FCEUX debugger:

0F:D331:B1 95     LDA ($95),Y @ $00FB = #$73
0F:D333:C9 81     CMP #$81
0F:D335:D0 06     BNE $D33D
0F:D337:DE BD 00  DEC $00BD,X @ $00BD = #$00
0F:D33A:4C 7F D3  JMP $D37F
0F:D33D:C9 80     CMP #$80
0F:D33F:D0 08     BNE $D349

and I compared it to what KingMike told me what dakuten code would look like.
ldy #$00
 lda ($20),y       ;say the text pointer was stored at $20-21
 cmp #$A0
 bcc NotDakuten   ;less than
 cmp #$E0
 bcs NotDakuten
;do stuff here with dakuten/handakuten
NotDakuten:
;other stuff


In the trace logger it looks a lot like KingMike's code and I would have posted that but, the thing goes so damn fast it's hard to do it! Anyway I am looking at lines D331 and D335 since they say CMP in the code. Any feedback would be much appreciated!