Acmlm's Board - I2 Archive - Rom Hacking - 65816 code problem.
User | Post |
bleempan
Posts: 4/4 |
Thanks every one. I fixed It. Super Sleuth is a useful tool. |
neviksti
Posts: 4/25 |
First of all, I suggest using a nice debugger, as these problems can be quickly figured out that way.
Lately, I really like Super Sleuth, http://users.tpg.com.au/trauma/spx/ It has nice breakpoint features, and you can single step through your code. Rarely, I still use zsnes (dos with debugger), since it still has other helpful features.
That being said, I can probably guess what the problem is here. Your code is basically:
wait till auto-joyread has completed check button presses if anything pressed, start game else go back and wait again
(Your original post was fine, I'm not sure where all the confusion is coming from.)
Anyway, the problem is that auto-joyread isn't always enabled. You need to request the system to do this task (set bit0, reg $4200 ... you only need to do this once, unless other code clears it). This is because some games use the manual read method, and if the system was trying read the joypads at the same time ... well, obviously both reads would fail.
Also, a long time ago, I remember some emulators having a problem with auto-joyread not working unless NMI was also enabled. I checked it out on the real system ... but my memory is really bad, and I can't remember the result. I think the real system didn't need the NMI enabled for auto-joyread. Regardless, I suggest testing your hack out on the real system before you get too much farther. (I or others can do that for you if you don't have the equipment.) |
MathOnNapkins
Posts: 1973/2189 |
I assume the GIF has been converted to a proper format, and he's just trying to get an intro to work. As for the reason it doesn't work, it's possible the NMI routine for the game, or some other code, clears those registers before bleempan's code gets there. Look for other reads of $4218-9 and see if they're buffered in other memory locations. Try reading those instead. Make sure you interpret the data correctly though. I'd have to review some technical docs before being certain though. |
beneficii
Posts: 122/567 |
bleempan,
GIF in an SF/SNES game? And what is this L0? |
bleempan
Posts: 3/4 |
this game is Dragon Quest III Reprise (J)
chinese patch download http://bbs.emu-zone.org/showthread.php?t=293792
//game original code 00FF9C JMP $C004A4
//edited 00FF9C JMP $C9F820
//$C9F820 //ROM:9FA20 JSL $C9F840 //show logo, and wait press key JMP $C004A4 //start game
//$:C9F840 //ROM:9FA40 ... show gif ...
************* address:L0 ************** SEP #$20 LDA $4212 AND #$01 CMP #$01 BEQ #$04 JMP ->L0
LDA $4218 AND #$F0 BNE #$0B
LDA $4219 AND #$FF BNE #$04 JMP ->L0
RTL
|
beneficii
Posts: 121/567 |
Originally posted by bleempan
SEP #$20 LDA $4212 AND #$01 CMP #$01 BEQ #$04 JMP ->L0
LDA $4218 AND #$F0 BNE #$0B
LDA $4219 AND #$FF BNE #$04 JMP ->L0
JMP ->game start
Yeah, we need more information and addresses. code in zsnes is right but in snes9x is error (press any key can't start game)
please give me a hand , thanks.
|
HyperLamer
Posts: 4931/8210 |
This doesn't help much if we don't know what game you're hacking, what the code is supposed to do, and what L0 is. |
bleempan
Posts: 2/4 |
---L0: SEP #$20 LDA $4212 AND #$01 CMP #$01 BEQ #$04 JMP ->L0
LDA $4218 AND #$F0 BNE #$0B
LDA $4219 AND #$FF BNE #$04 JMP ->L0
JMP ->game start
code in zsnes is right but in snes9x is error (press any key can't start game)
please give me a hand , thanks.
|
|