It is currently Wed Oct 18, 2017 12:44 am

All times are UTC - 7 hours



Forum rules


Related:



Post new topic Reply to topic  [ 10 posts ] 
Author Message
PostPosted: Sun Dec 18, 2016 1:15 pm 
Offline

Joined: Sun Dec 18, 2016 1:11 pm
Posts: 22
I want to disassemble an SNES game. I understand the basics of ASM. Thing is, this game hasn't ever been fully disassembled and commented unfortunately. All I'd like to do is understand what's going on behind the scenes when certain things happen in the game. What I'm looking for is a way to view what code is running, I just want to find, for example, where the code for when the player jumps is, so I can try and figure things out from there. Said game has a RAM detailed map include the addresses for the player's current state, his velocities etc., not sure if that would be helpful for this purpose or not, though, since that's a RAM map not a ROM map. Where should I start?


Top
 Profile  
 
PostPosted: Sun Dec 18, 2016 1:22 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19093
Location: NE Indiana, USA (NTSC)
If you have a RAM map, set write breakpoints on relevant addresses. That'll lead you to the vicinity of the code that updates those areas.


Top
 Profile  
 
PostPosted: Sun Dec 18, 2016 1:28 pm 
Offline

Joined: Sun Dec 18, 2016 1:11 pm
Posts: 22
Right... what programs should I be using to do this? I haven't actually "gotten started" yet. Right now all I have is the rom and snes9x-rr with a lua script that shows me the values but that's it. No idea how to actually properly decompile and use said code to set breakpoints or anything.


Top
 Profile  
 
PostPosted: Sun Dec 18, 2016 2:05 pm 
Offline
User avatar

Joined: Thu Dec 25, 2014 10:26 pm
Posts: 309
Location: Canada
There's lots of ways to go about it. What worked for me was using Bizhawk, a bsnes-based emulator used mostly by people in the TAS community. It allows you to view and search RAM as well as trace logs. When I was trying to find particular bits of code myself that way, I'd usually start with a RAM search to find a value doing what I'd expect (increasing/decreasing/staying the same), then try messing with it to see what happens. When you find the right one you can search for that address in the trace of a frame or two.

That's what worked for me anyway


Top
 Profile  
 
PostPosted: Sun Dec 18, 2016 2:24 pm 
Offline

Joined: Sun Dec 18, 2016 1:11 pm
Posts: 22
So you're saying Bizhawk disassembles the entire game while it's emulating or what? Since I want to see the actual disassembled asm not just what values are changing.


Top
 Profile  
 
PostPosted: Sun Dec 18, 2016 3:29 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19093
Location: NE Indiana, USA (NTSC)
Several debugging emulators disassemble the immediate area around the program counter whenever they hit a breakpoint.


Top
 Profile  
 
PostPosted: Sun Dec 18, 2016 3:42 pm 
Offline

Joined: Thu Aug 28, 2008 1:17 am
Posts: 591
ittyBittyByte wrote:
So you're saying Bizhawk disassembles the entire game while it's emulating or what? Since I want to see the actual disassembled asm not just what values are changing.

If it has a CDL option, it can. The more you play, the more the CDL file gets updated, the more you know exactly which memory address is the start of an opcode.

_________________
__________________________
http://pcedev.wordpress.com


Top
 Profile  
 
PostPosted: Sun Dec 18, 2016 5:04 pm 
Offline
User avatar

Joined: Thu Dec 25, 2014 10:26 pm
Posts: 309
Location: Canada
ittyBittyByte wrote:
So you're saying Bizhawk disassembles the entire game while it's emulating or what? Since I want to see the actual disassembled asm not just what values are changing.

SNES disassembly can be difficult... I tried running a rom through a disassembler but unlike NES a disassembler doesn't necessarily know which register size you're using at the time, and so trying to guess which length of instruction can be almost impossible, throwing off the interpretation of the whole thing.

The trace logs are where I spent most of my time. It shows you a full printout of everything the processor does in a frame, so you can search for the parts you're interested in if you know some key addresses and watch what it does. It'll also tell you the location in ROM the program that's running is at, so you can dig through the ROM file and read that directly too.

That's the best I got, really. I only halfway took apart one game, I haven't fully mapped one or anything.


Top
 Profile  
 
PostPosted: Sun Dec 18, 2016 5:43 pm 
Offline
User avatar

Joined: Mon Sep 15, 2014 4:35 pm
Posts: 3071
Location: Nacogdoches, Texas
Khaz wrote:
I only halfway took apart one game

Might I ask what game? Oh, and I'm glad you're back, from wherever. :) We definitely don't need any SNES developers leaving... :lol:


Top
 Profile  
 
PostPosted: Sun Dec 18, 2016 5:59 pm 
Offline
User avatar

Joined: Thu Dec 25, 2014 10:26 pm
Posts: 309
Location: Canada
Dragon View for SNES, when I was working on TASing it. Taking that game apart taught me a lot. Sorry I haven't been active, just got stalled on my game for the last year or so. Trying to get back into it.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: Google [Bot] and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group