Points of Required Attention™
Please chime in on a proposed restructuring of the ROM hacking sections.
Views: 88,512,616
Main | FAQ | Uploader | IRC chat | Radio | Memberlist | Active users | Latest posts | Calendar | Stats | Online users | Search 05-02-24 01:16 PM
Guest: Register | Login

Main - Posts by ggabriel


ggabriel
Posted on 06-11-09 12:31 PM, in New to ASM hacking. Halp! (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: 5437 days
Last view: 5436 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.)

ggabriel
Posted on 06-12-09 03:11 AM, in New to ASM hacking. Halp! Link | Quote | ID: 108504

Newcomer
Level: 5

Posts: 2/3
EXP: 383
Next: 146

Since: 06-11-09

Last post: 5437 days
Last view: 5436 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).

ggabriel
Posted on 06-13-09 06:58 AM, in New to ASM hacking. Halp! Link | Quote | ID: 108608

Newcomer
Level: 5

Posts: 3/3
EXP: 383
Next: 146

Since: 06-11-09

Last post: 5437 days
Last view: 5436 days
Makes sense I guess. Thanks!

Main - Posts by ggabriel

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

Page rendered in 0.224 seconds. (329KB of memory used)
MySQL - queries: 41, rows: 56/56, time: 0.221 seconds.