Points of Required Attention™
Please chime in on a proposed restructuring of the ROM hacking sections.
Views: 88,487,075
Main | FAQ | Uploader | IRC chat | Radio | Memberlist | Active users | Latest posts | Calendar | Stats | Online users | Search 04-26-24 11:21 AM
Guest: Register | Login

0 users currently in ROM Hacking | 6 guests

Main - ROM Hacking - New to ASM hacking. Halp! New thread | New reply


ggabriel
Posted on 06-11-09 12:31 PM (rev. 2 of 06-11-09 12:37 PM) Link | Quote | ID: 108467

Newcomer
Level: 5

Posts: 1/3
EXP: 383
Next: 146

Since: 06-11-09

Last post: 5431 days
Last view: 5430 days
Okay, I am not completely unfamiliar with computer programming, but I know pretty much jack all about working with assembly language. I'm trying to figure out some things in Ogre Battle for SNES so I ran it through TRaCER and started poking around in the disassembled output mostly at random. I've found a few useful bits so far and although I'm slow as heck deciphering this stuff I'm looking at some code that looks like it might be some of the stuff I'm looking for.

The problem is that I keep seeing lots of JSR $1199 commands everywhere, but from my meager understanding of SNES memory this is in LoROM mode and everything should be in $8000-$FFFF of each bank, so all these JSR $1199 are too much for my fragile mind to comprehend. What do they mean?! Are aliens trying to communicate with me through an ASM dump of Ogre Battle? Do these sinister glyphs possibly foretell the return of the Great Old Ones from beyond space and time? Help!

(Doh, just realized I had posted this in the wrong forum, sorry; I was browsing this at the same time as the general ROM Hacking forum and put the thread in the wrong one.)

MathOnNapkins
Posted on 06-11-09 03:51 PM (rev. 2 of 06-11-09 03:51 PM) Link | Quote | ID: 108472


Super Koopa
Level: 62

Posts: 671/842
EXP: 1935512
Next: 49174

Since: 02-19-07
From: durff

Last post: 4488 days
Last view: 4011 days
Perhaps you could post more of the trace log to have some proper context?

Also, if it is in fact LoROM, don't forget that it's possible to execute code from the work RAM (WRAM), that is, bank $7E and bank $7F. Execution of code in RAM is not unknown among SNES games. FFVI in particular I know uses it.

____________________
Zelda Hacking Forum
hobbies: delectatio morosa

ggabriel
Posted on 06-12-09 03:11 AM Link | Quote | ID: 108504

Newcomer
Level: 5

Posts: 2/3
EXP: 383
Next: 146

Since: 06-11-09

Last post: 5431 days
Last view: 5430 days
Basically I'm looking through a long list of this:

09/9C0F: C9 9B        CMP #$9B
09/9C11: D0 08 BNE $9C1B
09/9C13: 20 99 11 JSR $1199
09/9C16: FF 97 06 80 SBC $800697,X
09/9C1A: 18 CLC
09/9C1B: C9 9C CMP #$9C
09/9C1D: D0 08 BNE $9C27
09/9C1F: 20 99 11 JSR $1199


and so on. There's a big list of CMP branches like this.

The first two instructions are easy enough: look at the accumulator and if it doesn't equal 9B then skip ahead 8 bytes to $9C1B, check to see if it equals 9C and if not skip ahead, and so on down the line.

When it does equal 9B, though, that's where I get lost. I can follow the BNE to $9C1B, but where does a JSR to $1199 even go? The disassembled code only covers $8000-$FFFF of each bank and from what I've read that's all that it's supposed to cover.

Looking at the rest of that section it looks like it might be possible the disassembler misinterpreted something as I've got no idea what that SBC is supposed to accomplish and I'm kind of suspicious about that FF, but I've got no clue what it could possibly mean instead. It could be that this whole section is off-kilter, but the general structure is one that makes sense--the values I'm seeing in these CMPs correspond to the values I would expect it to be checking against (they all correspond to usable items, and before this series of CMPs it loads the accumulator with a memory byte corresponding to the item type held in a given slot).

Cellar Dweller
Posted on 06-12-09 03:53 AM Link | Quote | ID: 108513


Snifit
Level: 39

Posts: 160/287
EXP: 385187
Next: 19584

Since: 02-19-07
From: Arkansas

Last post: 4052 days
Last view: 3219 days
At some point after the game was started, the instructions must have been put into RAM. If you use an emulator with a debugger, you may be able to use breakpoints to either break when that address($091199) is called, or when that address is written to. In the former case you can disassemble the subroutine at that address, and in the latter case you can locate the code that puts the subroutine into RAM.

ggabriel
Posted on 06-13-09 06:58 AM Link | Quote | ID: 108608

Newcomer
Level: 5

Posts: 3/3
EXP: 383
Next: 146

Since: 06-11-09

Last post: 5431 days
Last view: 5430 days
Makes sense I guess. Thanks!

Main - ROM Hacking - New to ASM hacking. Halp! New thread | New reply

Acmlmboard 2.1+4δ (2023-01-15)
© 2005-2023 Acmlm, blackhole89, Xkeeper et al.

Page rendered in 0.020 seconds. (341KB of memory used)
MySQL - queries: 57, rows: 81/82, time: 0.016 seconds.