nesdev.com
http://forums.nesdev.com/

Where to start and Stop looking in the debugger output
http://forums.nesdev.com/viewtopic.php?f=2&t=18143
Page 1 of 1

Author:  gukingofheart [ Sun Dec 16, 2018 4:05 am ]
Post subject:  Where to start and Stop looking in the debugger output

I got a simple question (hopefully)...

In Super Mario Bros, there's an infinite life address of 075A.. and when you debug it, you get the address 90DC.. and on this line is STA.
To create this game genie code, you have to go up one line to the LDA.


viewtopic.php?f=2&t=18140
In this thread, I'm getting the advice of scroll down, not up.. so what do I scroll down to? (Or what place do I absolutely need to stop)
Do I keep messing with every line til I reach RTS? (that be 12 or more lines to experiment with)

Are there certain lines that you most likely will never mess with like BPL.
Should you always scroll up to a LDA, and then work down??

I'm trying to at least narrow things down.
PS. I know things like LDA/RTS/STA are just hex values.

Author:  nesrocks [ Sun Dec 16, 2018 4:19 am ]
Post subject:  Re: Where to start and Stop looking in the debugger output

There's no rule about where to scroll to. It's a series of instructions and you have to really understand what you're reading. LDA loads a number to the accumulator A (LDA loads a direct value like #80 or an indirect value stored in a memory location like a value stored on $80) and then A can be manipulated and generally a result is stored on an address with STA or the A result can be compared to another number.

I don't understand what this is: "there's an infinite life address of 075A"

Author:  tepples [ Sun Dec 16, 2018 5:57 am ]
Post subject:  Re: Where to start and Stop looking in the debugger output

It means "Super Mario Bros. uses address $075A in CPU RAM in such a way that if a given Game Genie code modifies the value that is written to that address, the player will have infinite lives."

Author:  nesrocks [ Sun Dec 16, 2018 7:20 am ]
Post subject:  Re: Where to start and Stop looking in the debugger output

Ok so what is the goal the OP is trying to achieve? To understand exactly what the GG code changes or to simply achieve the same effect?

To clarify: this address doesn't hold infinite lives, it probably holds current lives. The gg code is changing how this address is manipulated.

Author:  tepples [ Sun Dec 16, 2018 7:23 am ]
Post subject:  Re: Where to start and Stop looking in the debugger output

nesrocks wrote:
Ok so what is the goal the OP is trying to achieve? To understand exactly what the GG code changes or to simply achieve the same effect?

To understand how Game Genie codes in general do their work, if I correctly understand this post by the same user with respect to a code that manipulates acceleration in Excitebike.
gukingofheart wrote:
(I'm also writing all this info down.. and will be asking questions for different games in the future... and will try to find a pattern of what to try, and what would be a total waste of time).

Author:  rainwarrior [ Sun Dec 16, 2018 3:45 pm ]
Post subject:  Re: Where to start and Stop looking in the debugger output

gukingofheart wrote:
In this thread, I'm getting the advice of scroll down, not up.. so what do I scroll down to? (Or what place do I absolutely need to stop)
Do I keep messing with every line til I reach RTS? (that be 12 or more lines to experiment with)

Are there certain lines that you most likely will never mess with like BPL.
Should you always scroll up to a LDA, and then work down??

Most code runs line by line, so scrolling up or down does show you what happens before and after the current instruction.

However, code can jump around too. JMP, JSR, RTS, Bxx, and some other instructions will go to a new location, so the previous line was not necessarily the one directly above. If you want to be sure of where you came from, use the trace logging feature (another thing in the debug menu) which will keep a big text log, line by line, of every executed instruction as it happens.

Mesen makes it even easier with a "step back" button, so really that's even better.

I can't tell you which instructions are important or not. Really almost all of them will be important in the vicinity of the thing you're working on. Just look them up as you come across them, and eventually you'll know them all. Here's a good reference:
http://www.obelisk.me.uk/6502/reference.html

Author:  gukingofheart [ Sun Dec 16, 2018 4:08 pm ]
Post subject:  Re: Where to start and Stop looking in the debugger output

Welp, either way I got some new info to work with.. so that's a start.
My next plan is to look at a bunch of different NES game speed gamegenie codes to see if there's a similar style in any way.

Author:  Bavi_H [ Sun Dec 16, 2018 5:13 pm ]
Post subject:  Re: Where to start and Stop looking in the debugger output

Perhaps gukingofheart is referring to "RAM freezing" cheat ability of FCEUX when saying 075A is an "infinite life address".

In FCEUX, you can freeze a RAM address to have a constant value that never changes. In Super Mario Bros., the address 075A stores the current lives. (See this RAM map for Super Mario Bros. from the romhacking.net Data Crystal wiki.) So if you freeze address 075A to a non-zero value, you will effectively have inifinite lives, because the lives value will never change. (When the game tries to change it, the emulator keeps it frozen at the value you specified.)

Gukingofheart, just to make sure you're aware, you can't create a Game Genie code to "freeze" a RAM address like you can in the FCEUX Cheat menu. Details: On the NES, the RAM is at CPU addresses 0000 to 07FF. However, a Game Genie can only modify the values at CPU addresses 8000 to FFFF. So to make a Game Genie code affect a RAM address, you have to find something in addresses 8000 to FFFF that affects that RAM address, then change that.

Page 1 of 1 All times are UTC - 7 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/