(Link to AcmlmWiki) Offline: thank ||bass
Register | Login
Views: 13,040,846
Main | Memberlist | Active users | Calendar | Chat | Online users
Ranks | FAQ | ACS | Stats | Color Chart | Search | Photo album
04-29-24 04:49 AM
0 users currently in ROM Hacking.
Acmlm's Board - I3 Archive - ROM Hacking - What do I need? New poll | |
Pages: 1 2Add to favorites | Next newer thread | Next older thread
User Post
never-obsolete

Paragoomba








Since: 05-14-06
From: AZ

Last post: 6281 days
Last view: 6281 days
Posted on 06-17-06 07:49 AM Link | Quote

nes prg-rom space is:

bank0 - $8000 to $BFFF
bank1 - $C000 to $FFFF

smaller switchable banks are possible, just depends on the mapper. ram is
located at $0000 to $07FF and is thus mirrored after that up to $2000. all
code/data is loaded into those 2 banks of prg-rom, though thats not there actual
offset in the rom. the value will be stored in ram when needed but will first need
to be loaded from rom. you need to find where in rom it is loaded from by using a
breakpoint set to when that location in ram is written to. and ram will be written to
like so:

lda #n
sta $g

where n = the value of health and g = offset in ram. though it might be tricky
because indirect or indexed addressing might be used or they will use the X or Y
register instead of the accumulator (A register). so you might get something like:

lda ($nn), Y
or
lda ($nn, X)

which are the two forms of indirect addressing (X and Y are 6502 registers, nn =
zero page address). or you might also get one of these:

lda $nn, X
lda $nnnn, X
lda $nnnn, Y

which are forms of indexed addressing. ($nn = zero page address and $nnnn =
non-zero page address) when the game stores the value into ram it may also use
indirect/indexed addressing rather than absolute.
the_icepenguin

Bit








Since: 05-28-06

Last post: 6279 days
Last view: 6279 days
Posted on 06-17-06 11:32 AM Link | Quote
That actually kind of made sense.(I think)

Now i have more questions, but i dont know which ones to ask or how to ask them.

When trying to locate where the enemy HP (or anything) is coming from in the ROM, i use breakpoints in the RAM, correct? or almost correct?

I noticed that there were a few different kinds of breakpoints.

writeable

executable

....and one more, i forgot.

arg! so much info! ....................

HyperHacker

Star Mario
Finally being paid to code in VB! If only I still enjoyed that. <_<
Wii #7182 6487 4198 1828


 





Since: 11-18-05
From: Canada, w00t!
My computer's specs, if anyone gives a damn.
STOP TRUNCATING THIS >8^(

Last post: 6279 days
Last view: 6279 days
Posted on 06-17-06 06:18 PM Link | Quote
Yes, you would use a breakpoint on writes to whatever RAM address the health is stored at.
the_icepenguin

Bit








Since: 05-28-06

Last post: 6279 days
Last view: 6279 days
Posted on 06-17-06 11:53 PM Link | Quote
Alright. Im gonna go try to figure this out.

Since i dont know what the outcome will be, ill ask my question now.

when i put the write break point (?)on the enemy HP in the RAM, will i be able to see(somehow) where it is in the ROM? so i can change it.

like will it give me an offset of some kind?
never-obsolete

Paragoomba








Since: 05-14-06
From: AZ

Last post: 6281 days
Last view: 6281 days
Posted on 06-18-06 01:08 AM Link | Quote
the debugger will snap where an instruction writes to the ram address. you will need to back track from there a line (or possibly more) to see where the value written is read from in rom.
the_icepenguin

Bit








Since: 05-28-06

Last post: 6279 days
Last view: 6279 days
Posted on 06-18-06 02:57 AM Link | Quote
is there a way of knowing which one it loads from?

i mean when i back track in the debugger. or do i just guess. or something.

...
...
...

i did do something, when i just tried. i made every monster in the game have infinite health.

i dont know exactly how i got there, but i can remember.(Zelda 2 by the way)

the RAM offset is: E66D

basically i figured out how to make every monster stronger. the offset was originally
at 02. i changed it to 08 to see if it would take 8 hits to kill the bot instaed of 2.

it actually made it weaker. so i changed it to 01 and it took 3 hits to kill, making it stronger.

i then changed it to 00 and every monster had infinite health.

...
Ryusui

Red Paragoomba








Since: 06-15-06

Last post: 6398 days
Last view: 6293 days
Posted on 06-18-06 03:51 AM Link | Quote
Sounds like you didn't find an "Infinite Health" code for monsters as much as a "Zero ATK" code.

If a higher number means a weaker monster, then the obvious conclusion is that it's not how much HP the monster has, but how much damage is being done to it. If a monster has 3 HP, then 2 ATK will kill it in two hits. 8 ATK is enough to kill it nearly three times over, and 1 ATK makes it take three hits. And 0 ATK means your attacks do nothing and never will.

Check the value again after a level-up (make sure you increase Attack power!) and see if it increases.

Anyways, about your first question. Once the value's been written to, backtrack in the code as directed until you come upon the LDA instruction that loads the value from the ROM. I know little about the details of NES ASM, though I've worked with SNES and GBA and much of the concepts are similar. The offset that's being loaded from might be given as part of the instruction; if not, set a code breakpoint there and when it breaks, note the values of the registers. Check them for a ROM address; if there's one in there, that's what you're looking for.
the_icepenguin

Bit








Since: 05-28-06

Last post: 6279 days
Last view: 6279 days
Posted on 06-18-06 04:35 AM Link | Quote
wow, this stuff is harder than i thought!

im getting it though. and what you said about the"Zero ATK"

that makes sense. i didnt think of that.

anyway, i messed around with the game some more and this is what happened.

when i changed the "Zero ATK" code, it messed up the game. like the first cave to the first palace didnt have that crawley monster. it has a worm thing from the deserts. and in the first castle, it loaded a boss fight that i couldnt fight so i was stuck.

all i did was change the offset E66D from 02 to 01.

anyways, here is my main question.

seeing that Zelda 2 has been hacked before, is there a list of some kind that someone made giving RAM/ROM addresses for stuff in the game? if so, can i have the link? im not good at google.......ing...
Ryusui

Red Paragoomba








Since: 06-15-06

Last post: 6398 days
Last view: 6293 days
Posted on 06-18-06 04:56 AM Link | Quote
By any chance, when you tweak memory values like that in FCEUXD, does the memory value merely change to what you specify, or is it permanently set to that value?

If it sets it permanently to that value, that might have the side effects you're talking about if other parts of the game code use that value for different purposes.

If it only changes it temporarily, then we may very well have a larger problem on our hands: the value isn't merely an ATK value; it handles other stuff that the game can't run properly without. Do what you did the first time and see if it has a consistent effect in a fight: higher values mean monsters die quicker, lower values mean monsters die slower. And double-check to see if our "ATK value" hypothesis is right to begin with by seeing if it changes on its own when you increase ATK on level-up. Heck, make sure you didn't change the wrong value by mistake by double-checking to see if the castle errors crop up again.

Romhacking is mostly experimentation: try something, see if it works, and if it doesn't, try something else. Even experts have to take the rinse, lather, repeat approach more often than not. The scientific method applies readily to this line of work: if you think you've found your miracle, the first thing you do is not trumpet it to the world, but see if you can get it to happen again, and consistently. Same thing goes for glitches. Nothing bugs (no pun intended) a programmer of any description more than a glitch that only happens sometimes.

As for your question, I looked on Romhacking.net, but no dice. Google is your friend...learn how to shake him down for every cent he's worth.


(edited by Ryusui on 06-18-06 03:57 AM)
the_icepenguin

Bit








Since: 05-28-06

Last post: 6279 days
Last view: 6279 days
Posted on 06-18-06 07:07 PM Link | Quote
Alright this is what Ive got.

I got a clean Zelda 2.

I leveled up my sword from lvl1 to lvl2......and the offset E66D didnt change.

Then i tried this.

I started over again. I changed offset E66D from 02 to 01.

This made my ATK Power at level 1 decrease making all monsters harder to kill.

i then leveled up my sword to level 2 and everything went back to normal.

so this is my theory.

offset E66D is the ATK Power for Link's level 1 Sword.

and every sword level has a different offset.
Pages: 1 2Add to favorites | Next newer thread | Next older thread
Acmlm's Board - I3 Archive - ROM Hacking - What do I need? |


ABII

Acmlmboard 1.92.999, 9/17/2006
©2000-2006 Acmlm, Emuz, Blades, Xkeeper

Page rendered in 0.017 seconds; used 397.57 kB (max 489.62 kB)