It is currently Sun Sep 15, 2019 7:31 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Wed Jan 16, 2019 4:37 am 
Offline
User avatar

Joined: Tue Jan 15, 2019 10:13 pm
Posts: 2
Location: Sydney, Australia
G'day everyone

So I have been mucking about with a Homebrew game called 田雞 (Frog) and I tried making the protagonist start the game with 5 lives rather than 3. I could do this by freezing a RAM Value and restarting FCEUX. I wanted to make this change apart of the ROM and I have spent hours trying to figure out the solution. Here are the steps that I have been taking:

1 Get RAM Address 0x0507 (Frog's starting amount of lives, I have checked this value) and
make a write breakpont using FCEUX Debugger

2 Run the debugger and reset the game, getting seemingly random values such as "CE 07 05" as seen in the image above

Have I made a mistake trying to locate these values? Do they direct me to the specific byte (02)? I would appreciate if somebody could lend a hand.

Cheers


Attachments:
File comment: This is the debugger showing me the values "CE 07 05" which I don't understand
Foto del gioco della rana.PNG
Foto del gioco della rana.PNG [ 95.28 KiB | Viewed 3050 times ]
Top
 Profile  
 
PostPosted: Wed Jan 16, 2019 5:08 am 
Offline

Joined: Tue Feb 07, 2017 2:03 am
Posts: 757
That is not random at all. that is code to decrement the life counter. DEC ( DECrement by 1 ) 07 05 6502 stores address LO HI so that is $0507 which is the address you found. That is the code that "takes a life away" you are looking for something like a9 03 8d 07 05


Top
 Profile  
 
PostPosted: Wed Jan 16, 2019 5:29 am 
Offline
User avatar

Joined: Tue Jan 15, 2019 10:13 pm
Posts: 2
Location: Sydney, Australia
Thanks a tonne, I figured from what you said about DECrement that the debugger was triggered as I killed myself. In response, I left the debugger running as I restarted the game and it triggered with the STA Instruction, which I figured is Storage/Accumulation Data. Thanks again for the help, but how did you predict "A9 03 8D 07 05" (03 was actually 02, because 00 counts as 1) so accurately?


Top
 Profile  
 
PostPosted: Wed Jan 16, 2019 5:52 am 
Offline

Joined: Tue Feb 07, 2017 2:03 am
Posts: 757
there are only so many ways to init a memory location in 6502
LDA #2
STA $0507
would be the number 1 way
having an array of numbers that it loads in with something like
ldx #7
lda XXXX,x
sta $0500,x
dex
bpl $XX
would be the 2nd

LDX #2
STX $0507 and
LDY #2
STY $0507
possible but very rare chance.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group