Thursday, February 28, 2008

Willow Hack News

I'm using a cross assembler for the SNES, but since the 65816 processor mostly extends the 6502, getting it to work for this project was easy.

Well, mostly.

I spent most of the morning trying to get the assembler to produce a valid IPS file, but I'm glad I did.

The samples I downloaded for compiling SNES patches from asm files had scripts for checking addresses when creating patch files.

I was getting symbol not found errors when trying to subtract a hex address from a variable, but had no problems adding (or any other operation, I suppose).

The error went away when I decided to use base 10 to represent the value I was trying to subtract.

So, instead of



@STEP2 = @STEP1 - $C000


It was



@STEP2 = @STEP1 - 49152


I decided to hijack the password routine and copy a bit of code from the "new game" routine. For now I just loaded up the SRAM with some default values.

It almost worked.

I had a black screen with Willow in it. Switching to inventory and back brought the screen colors to life but the palette seems messed up, though I think I have some idea of how to fix this.

With the code analysis practically complete and most critical variables identified, I can now focus on writing code. The assembler/patcher toolchain makes things much easier as all I have to do is edit the assembly code and re-run my compiler script.

Already I'm halfway to my goal of a Proof-of-concept hack, with a full hack not too far off.

Although state-saves have all but made this hack useless, it's been a fun ride. Maybe I'll put a little how-to together, for the sake of posterity.

No comments: