+  RHDN Forum Archive
|-+  Romhacking
| |-+  ROM Hacking Discussion
| | |-+  sms/gg asm hacking
Pages: [1]
Author Topic: sms/gg asm hacking  (Read 2 times)
Malias
Guest
« on: July 20, 2008, 01:34:48 am »

This is kind of newbish, but I need some help.  I'm trying to do an asm hack for a game gear game and am not sure what the best way to go about it is.  I've traced through to the code I want to edit using MEKA's debugger and I can find the what I'm trying to edit in its memory editor, but the program won't let me directly edit the asm.  Is it possible to directly edit the game like this a la fceuxd sp?  Or is there a way to determine where exactly in the rom the code is so it can be edited that way?

If it can't be done that way, then could someone help me use WLA DX properly?  I'm using a disassembler called smsexamine which generates code for wla dx, but every time I try to assemble the mess, all I get is a file with the instructions on how to use the program.  As this is my first asm hack I'm very lost and would appreciate any guidance.
KingMike
Guest
« Reply #1 on: July 20, 2008, 08:29:05 am »

I have used wla before to do some ASM hacks with Deep Dungeon for MSX (as I know, SMS/GG should be quite similar as far as ASM is concerned)
I use a command line like this:
Code:
wla-z80 -o input.asm ouput.bin
Note that this will replace the output file, so it will need to be copy and pasted into the ROM later.

Then I put this junk at the top of the ASM file:
Code:
.MEMORYMAP
SLOTSIZE $4000  ;use 16KB ROM banks. From what I've read, SMS/GG ROM banks are always 16KB.
DEFAULTSLOT 0    ;startup ROM bank?
SLOT 0 $0000       ;CPU address of each bank
SLOT 1 $4000
SLOT 2 $8000
SLOT 3 $C000
.ENDME

.ROMBANKMAP
BANKSTOTAL 2       ;number of ROM banks
BANKSIZE $4000    ;size of each ROM bank
BANKS 2
.ENDRO

.BANK 1 SLOT 1
.ORGA $4000     ;this is the CPU address of the ROM bank I am editing

.org $1920        ;this is the ROM address I want the code inserted at.

As for finding the code in the ROM (I'm guessing you found it in the memory viewer?) you could just search for a string of hex values in a hex editor.
Though the version I'm using seems to seperate ROM and RAM.
Malias
Guest
« Reply #2 on: July 22, 2008, 12:59:55 pm »

Thanks for the info.  I think I finally understand how to work wladx.  I was just making it too complicated is all.  However, the compilable file that I had generated isn't compiling at all.  It's just as well.  The hack I'm doing is pretty small and I really don't need a compiler for it.  I found the rom bank with code I want to edit so I'll edit it directly.

Hopefully, this does just turn out to be a small hack.  I already tried messing with the code and got half of what I wanted.  Now, I just need to see if I can work out the other (and more important) half.
Malias
Guest
« Reply #3 on: July 23, 2008, 05:58:55 pm »

Yay, it worked Smiley.
All I had to do was change two different values and I got exactly what I wanted.  Here's what I did:

before:


after:


You can kind of tell by the pic, but all of those extra spaces used to be above the actual text and it was written that way in the rom.  I just doubled the amount of space I get to work with!
Gideon Zhi
Guest
« Reply #4 on: July 24, 2008, 12:31:21 am »

You mean like this?



I'm just waiting for a script on this one :| I've got all the same hacks done, too :|
Malias
Guest
« Reply #5 on: July 24, 2008, 02:10:39 am »

Hmm, I don't recall that being on your long list of current projects...
<looks on gideon's website>
ah, there it is.

Well, since I really don't feel like duplicating someone else's work, I think I'll call this good asm practice and leave it at that.  Good luck getting that script.  I look forward to playing it. :thumbsup:
tc
Guest
« Reply #6 on: July 24, 2008, 08:11:49 am »

Is that the last untranslated Shining Force on GG?
KingMike
Guest
« Reply #7 on: July 24, 2008, 09:35:17 am »

Royal Stone.
Pages: [1]  


Powered by SMF 1.1.4 | SMF © 2006-2007, Simple Machines LLC