Register | Login
Views: 19364387
Main | Memberlist | Active users | ACS | Commons | Calendar | Online users
Ranks | FAQ | Color Chart | Photo album | IRC Chat
11-02-05 12:59 PM
1 user currently in Rom Hacking: hukka | 2 guests
Acmlm's Board - I2 Archive - Rom Hacking - 65816 code problem. | |
Add to favorites | "RSS" Feed | Next newer thread | Next older thread
User Post
bleempan
Newcomer
Level: 3

Posts: 2/4
EXP: 119
For next: 9

Since: 03-25-05

Since last post: 139 days
Last activity: 130 days
Posted on 06-12-05 07:20 AM Link | Quote
---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.



(edited by bleempan on 06-11-05 11:31 PM)
HyperLamer
<||bass> and this was the soloution i thought of that was guarinteed to piss off the greatest amount of people

Sesshomaru
Tamaranian

Level: 118

Posts: 4931/8210
EXP: 18171887
For next: 211027

Since: 03-15-04
From: Canada, w00t!
LOL FAD

Since last post: 2 hours
Last activity: 2 hours
Posted on 06-12-05 07:34 AM Link | Quote
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.
beneficii

Lakitu
Level: 36

Posts: 121/567
EXP: 299656
For next: 8454

Since: 06-27-04
From: Cordova, TN, USA

Since last post: 14 hours
Last activity: 6 hours
Posted on 06-12-05 07:38 AM Link | Quote
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.

bleempan
Newcomer
Level: 3

Posts: 3/4
EXP: 119
For next: 9

Since: 03-25-05

Since last post: 139 days
Last activity: 130 days
Posted on 06-12-05 07:39 AM Link | Quote
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





(edited by bleempan on 06-11-05 02:39 PM)
(edited by bleempan on 06-11-05 02:46 PM)
(edited by bleempan on 06-11-05 02:47 PM)
(edited by bleempan on 06-11-05 03:00 PM)
(edited by bleempan on 06-11-05 03:06 PM)
(edited by bleempan on 06-11-05 03:07 PM)
beneficii

Lakitu
Level: 36

Posts: 122/567
EXP: 299656
For next: 8454

Since: 06-27-04
From: Cordova, TN, USA

Since last post: 14 hours
Last activity: 6 hours
Posted on 06-12-05 07:51 AM Link | Quote
bleempan,

GIF in an SF/SNES game? And what is this L0?
MathOnNapkins

Math n' Hacks
Level: 67

Posts: 1973/2189
EXP: 2495887
For next: 96985

Since: 03-18-04
From: Base Tourian

Since last post: 1 hour
Last activity: 32 min.
Posted on 06-12-05 10:18 AM Link | Quote
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.
neviksti

Goomba
Level: 8

Posts: 4/25
EXP: 1510
For next: 677

Since: 06-09-05

Since last post: 36 days
Last activity: 30 days
Posted on 06-13-05 03:18 AM Link | Quote
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.)


(edited by neviksti on 06-12-05 10:21 AM)
bleempan
Newcomer
Level: 3

Posts: 4/4
EXP: 119
For next: 9

Since: 03-25-05

Since last post: 139 days
Last activity: 130 days
Posted on 06-15-05 07:59 PM Link | Quote
Thanks every one.
I fixed It.
Super Sleuth is a useful tool.
Add to favorites | "RSS" Feed | Next newer thread | Next older thread
Acmlm's Board - I2 Archive - Rom Hacking - 65816 code problem. | |


ABII


AcmlmBoard vl.ol (11-01-05)
© 2000-2005 Acmlm, Emuz, et al



Page rendered in 0.013 seconds.