Points of Required Attention™
Smaghetti, a new Super Mario Advance 4 editor, is currently in development! Check out the thread HERE!

Please chime in on a proposed restructuring of the ROM hacking sections.
Views: 88,314,163
Main | FAQ | Uploader | IRC chat | Radio | Memberlist | Active users | Latest posts | Calendar | Stats | Online users | Search 03-28-24 08:49 PM
Guest: Register | Login

0 users currently in ROM Hacking | 6 guests | 2 bots

Main - ROM Hacking - SNES Disassembly New thread | New reply


Trax
Posted on 12-01-10 04:40 AM Link | Quote | ID: 138276


Yellow Stalfos
Level: 71

Posts: 1101/1145
EXP: 3028730
Next: 138384

Since: 07-06-07
From: Québec

Last post: 3598 days
Last view: 2850 days
Okay, some time ago, I was somewhat interested into hacking SNES games, so I fiddled through various documentation about the 65816 processor and other SNES specs. Since I already know the 6502 quite well, it seems like the 65816 is not that much complicated...

Yet, one thing caught my attention...

Apparently, there are two modes of operation: "native" 65816 mode and 6502 "emulation" mode. These modes make A or X,Y either 8-bit or 16-bit. So if I'm not mistaken, it means there is absolutely NO WAY to automate SNES code disassembly without errors, unless you can pause an actual emulation of it...

My modus operandi is to diassemble a ROM to find stuff. If I can't do that, then SNES hacking is out of the question...

blackhole89
Posted on 12-01-10 04:46 AM Link | Quote | ID: 138277


The Guardian
Moloch whose eyes are a thousand blind windows!
Level: 124

Posts: 3450/4196
EXP: 21483918
Next: 352683

Since: 02-19-07
From: Ithaca, NY, US

Last post: 443 days
Last view: 55 days



Hold it. Hold it.

6502 emulation mode and 8/16 bit registers are distinct aspects of 65c816. The former is toggled by setting the emulation flag from the carry flag (XCE), while the latter is controlled by the $20 and $10 processor flags for the accumulator's and the index registers' 8bittiness (on=8bit, off=16bit) respectively.

But yes, both of those essentially mean that you can't produce a coherent disassembly without either assumptions and heuristics or control flow analysis.

Still, SNES ROM hackers have been dealing with it just fine. In practice, the garbage that results from you disassembling a piece of code with wrong bittiness is all too easy to recognize (and a good disassembler would do at least a partial job at autodetecting it), and I've yet to see an SNES game actually use 6502 emulation mode for relevant code.

____________________



Trax
Posted on 12-01-10 06:50 AM Link | Quote | ID: 138280


Yellow Stalfos
Level: 71

Posts: 1102/1145
EXP: 3028730
Next: 138384

Since: 07-06-07
From: Québec

Last post: 3598 days
Last view: 2850 days
Hmmm, okay, there's some hope, then...

Main - ROM Hacking - SNES Disassembly New thread | New reply

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

Page rendered in 0.026 seconds. (339KB of memory used)
MySQL - queries: 42, rows: 65/65, time: 0.016 seconds.