Also. Title screen! My first one ever, so I'm happy with it! Ended up using Tile Molester instead. Worked much better for me.
Since I'm hoping this thread can serve as a resource for future DW hacks, would you mind giving me a quick rundown as to how you find these values? Namely stuff like Spell and Monster Name length? When I get to DW2 and 3, I'd love to be able to find simple values like that myself as to save a little time and trouble from the more adept romhackers such as yourself.
FCEUX's Debugger and/or Trace Logger tells all
. I wrote up a description of tracking down the item list and its pointer in the Dragon Warrior 1 Spanish Translation
thread; the same principles apply here, but since we already know where the spell list is located, we can start with a read breakpoint there and skip the whole "trace from the PPU back to the ROM" process. For the spell list length, setting a read breakpoint on e.g. $BE56 for HEAL and then casting that spell shows
01:A866:A0 00 LDY #$00
01:A868:AE E2 64 LDX $64E2 = #$09
>01:A86B:B1 A1 LDA ($A1),Y @ $BE56 = #$2B
01:A86D:C9 FF CMP #$FF
01:A86F:F0 07 BEQ $A878
01:A871:9D C9 64 STA $64C9,X @ $64D2 = #$5F
01:A876:D0 F3 BNE $A86B
01:A878:60 RTS -----------------------------------------
so the game stops reading from ($A1),Y once it reads #$FF (end of list item) or when X reaches #$00; X comes from $64E2, so setting a write breakpoint there and casting the spell again eventually leads us to
01:B7D8:A9 09 LDA #$09
>01:B7DA:8D E2 64 STA $64E2 = #$01
as the last time the game writes to $64E2 before reading the spell name. The game actually uses $64E2 for a lot of other things before it gets to reading the spell name, so you can either throw in some "Forbid" breakpoints to weed out false positives or generate a trace log and start searching backwards. You can follow the same process when tracking down pretty much anything, although it gets harder to do when the way in which the game's code uses the data is complicated.
I wanted to do a quick little Title Screen text change. Add a 2018 Square Enix credit (it IS their translation technically speaking and it gives it a nice "Official" feel which is what I'm going for with this hack). But also change the Nintendo license line to Hack by Choppasmith and drop the trademark line for space. I saw in the translation thread there's basically no room before the palette data. I was really careful to make sure I dumped and edited the text before 3FC5. But I can't seem to avoid glitches
It looks like there is a bit of free space immediately following the end of the title screen data at 0x3DFA, so you could use that if you wanted to, but the original data is also kind of inefficient, so you could free up an extra $44 bytes by combining adjacent RLEs of the same byte (e.g. the original has <$F7><$20
><$5F><$FC> immediately followed by <$F7><$20
><$5F><$FC>, but <$F7><$40
><$5F><$FC> does the exact same thing [i.e. print two rows of spaces] in 4 fewer bytes) and taking out all of the useless <$FC> control codes (the last <$FC> is the only one that matters). 68 bytes is more than enough space for a couple of text changes on this screen even without dropping the "TM TRADEMARK TO NINTENDO".
The title screen display code basically works by reading a continuous stream of bytes starting from RAM $BDCB (ROM 0x3DDB), expanding RLE sequences (control code <$F7>) as necessary, and writing them to the PPU starting from $2000 (Name Table #0; tilemap data) until it reaches PPU $2400 (Name Table #1); along the way, it'll also fill up Attribute Table #0 (palette data) starting at PPU $23C0. Control code <$FC> is a "maybe end" token - it checks to see whether the next PPU address to write to is $24?? and exits the title screen display code when it is, otherwise it does nothing. So there's nothing special about 0x3FC5, that's just the point where the PPU writing process happens to reach PPU $23C0.
Each screen line is 32 tiles wide, but on the "HACK BY CHOPPASMITH" line, you're writing 6 spaces + 19 letters + 11 spaces = 36 tiles, which is 4 tiles too many, so try reducing 0x3F9D from $0B to $07. Where things really start going sideways, though, is 0x3FAE. At that point you write the final (off-screen, but you can see it in FCEUX's Name Table Viewer) row of tilemap data using $FF (one of the Dragonlord's tiles) instead of $5F (space) and then start writing a bunch of $FFs to the palette data. You should have a mostly pink screen at that point, but your screenshot shows a bunch of splotches, so something else is going on somewhere. I'd recommend grabbing my title screen insert script from the Dragon Warrior 1 Spanish Translation
thread and either adapting that to Pointer Tables or switch to Atlas for inserting; if you use Atlas, you'll need to tell it what table file to use with e.g.