Romhacking.net

Romhacking => ROM Hacking Discussion => Topic started by: lowena on July 04, 2013, 03:19:00 PM

Title: Issues with SNES ROMS and assembly
Post by: lowena on July 04, 2013, 03:19:00 PM
So here's the problem. The only functioning debugger i can find, no$sns, won't let me edit instructions. I enter completely valid instructions (like one shown in the debugger for example) and it says "Unknown command" or "Parameter fail". So I can't edit the ASM with that. So I try using asmdev, and the addresses are completely different. And if I try searching for any instruction found in the debugger, it takes me to something completely different. So, I try disassembling the ROM. The addresses are different again (starting at C00000 instead of 000000) and this time the instructions can't be found at all.

I know the instruction exists (in this case the sanity check for Secret of Evermore, which I found in the SRAM doc for it) and I can find it in the debugger just fine. However, neither in asmdev nor in a disassembly with dispel does it exist. What am I doing wrong? Why can't I edit it with no$sns, and why don't asmdev and dispel give a complete disassembly?

EDIT: I've read here (http://www.videogamesource.com/genie/gg/gghandbk/p12.html) that hirom games start usually at 0xC00000, and lorom at 0x808000. When I load up Secret of Evermore in no$sns, the addresses are all around 0x808000, whereas in asmdev and with dispel, the game starts at 0xC00000. Clearly Secret of Evermore is a hirom game (or at least that's what no$sns reports, and what people on the internet say), so why is the code in the area that is usually associated with lorom games?
Title: Re: Issues with SNES ROMS and assembly
Post by: STARWIN on July 04, 2013, 07:54:55 PM
I have used http://www.romhacking.net/utilities/241/ as a SNES debugger, so it should be a functioning alternative.

I have edited the ROMs with a hex editor directly, to change the assembly instructions. Perhaps it is too tedious for you, but it works for small changes and at least acts as a sanity check. (searching for opcode sequences helps you understand the mapping between logical and ROM offsets as it gives you the ROM offset)
Title: Re: Issues with SNES ROMS and assembly
Post by: lowena on July 04, 2013, 10:02:33 PM
Yeah, I guess I will just have to use a hex editor. Unfortunately that build you linked terribly scrambles the graphics of Secret of Evermore for some reason.
Title: Re: Issues with SNES ROMS and assembly
Post by: LostTemplar on July 05, 2013, 12:11:54 AM
For any larger changes you should use an assembler (e.g. xkas, bass) anyway.

Even in HiROM games $808000~$bfffff (where the last 16 bits >= $8000; < $8000 is RAM and hardware registers) is still a mirror of $c00000~$dfffff. I suggest reading documents about SNES memory mapping, for instance http://www.romhacking.net/documents/173/.
Title: Re: Issues with SNES ROMS and assembly
Post by: Utopia on July 05, 2013, 03:24:06 PM
Interesting that Evermore functions like that, If you mind me asking what are you trying to edit with SoE?
Title: Re: Issues with SNES ROMS and assembly
Post by: lowena on July 05, 2013, 04:33:24 PM
Nothing in particular. I've been getting into some reverse engineering, and saw a thread here about some guy wanting to edit the maps of Secret of Evermore, and just wanted to see if I could figure anything out for the game. But it turns out that the ROM uses DTE, and I have no idea how to make a text table for that, so I gave up. :)
Title: Re: Issues with SNES ROMS and assembly
Post by: neagix on November 09, 2014, 04:28:50 PM
Quote from: lowena on July 05, 2013, 04:33:24 PM
Nothing in particular. I've been getting into some reverse engineering, and saw a thread here about some guy wanting to edit the maps of Secret of Evermore, and just wanted to see if I could figure anything out for the game. But it turns out that the ROM uses DTE, and I have no idea how to make a text table for that, so I gave up. :)

How far did you get? I would like to approach the same, and I am interested in finding other maps (http://tcrf.net/Talk:Secret_of_Evermore) or possibly decoding the compiled SIGIL scripts that must be there