everything8215 / ff6tools

Browser-based editor for Final Fantasy ROMs
GNU General Public License v3.0
36 stars 7 forks source link

FF4j Map Editor breaking maps #12

Closed scr-trees closed 2 years ago

scr-trees commented 2 years ago

Hi, everything8215,

Truly an impressive project you got goin on over here. I couldn't really find any other tools that would work for editing FF4J roms. Basically all I'm trying to do is add a save point to the 3rd Floor of the Lunar Core (the same place the easy type rom has it https://tcrf.net/File:FF4-LunarCoreEasy.png). But adding this tile to either a 1.0 or 1.1 Japanese rom breaks the maps several areas before (basically where I can resume my save from) with a bunch of repeated tiles coming in from both sides of the screen on v1.1. On v1.0, the area just goes pitch black once I take a single step outside of the save room. I'm guessing the editor's not getting the offset right, or not redoing the pointers--not sure. FF4kster works to put a save point there, but I don't think it works with the Japanese rom. Any ideas?

everything8215 commented 2 years ago

Hi scr-trees,

Thanks for the kind words, and thanks for letting me know about this bug. It was using some addresses from the English version when saving the Japanese version, which caused some code to get corrupted. It should be fixed now if you load up a fresh ROM. Let me know if this solves the issue.

scr-trees commented 2 years ago

Nice, works like a charm now!

scr-trees commented 2 years ago

Sorry if this isn't the best place for this, but I was wondering if you knew about how to manipulate the battle command menu WIDTH for FF4j. I looked through your disassembly, but couldn't find it in the battle folder.

everything8215 commented 2 years ago

It's in the btlgfx folder (battle graphics). Look for MenuWindowTbl in btlgfx_data.asm. I think the ROM address is 16/FE5A.

scr-trees commented 2 years ago

Hey thanks for the info. I got the MenuWindowTbl line set to the value I want now. I also changed the value in MenuTextUpdateTbl, but it seems I'm still missing something. The window is the right width, and the text wraps around at the appropriate line length, but it still seems to be allotting the same amount of characters per battle command. So the second command down for Kain, for instance, starts after 2 spaces, and his third command starts after 4 spaces. (My main goal is shortening the 10-letter commands the J2e fan translation had to 8-letter commands).

Btw did you disassemble all the games yourself??

everything8215 commented 2 years ago

You might need to modify the subroutine DrawCmdName in btlgfx/menu.asm. All of the menu text is buffered in RAM, so you might also need to play around with the buffers. Those can be found in the RAM map in the notes directory.

I've made disassemblies for the first six FF games. I've gotten a lot of info from the romhacking community but all of the comments and notes are my own. Btw, since you're looking at the FF4 disassembly, you might want to check out my new repo called "FFTools". It's just like FF6Tools but instead of modifying the ROM directly it modifies the game data in the file ff4-en-data.json, which gets encoded and assembled when you build a ROM from the disassembly.

scr-trees commented 2 years ago

That's crazy. Such a massive contribution to the community. Thank you for your work! So I've already tried messing with every relevant subroutine I could find, and so I had a feeling it would be due to those text buffers. If it says $7E/3303 and $7E/8CB2 in the RAM map—those are the ROM addresses correct?

everything8215 commented 2 years ago

Those are RAM addresses. Banks 7E and 7F are RAM in the SNES.

Try changing lda #$05 below to something else. I think $ef54 is the number of letters in one row of text.

@9cd0:  ldx     #$74fd      ; text buffer
        stx     $ef50
        lda     #$05
        sta     $ef54
scr-trees commented 2 years ago

Oh no... lol... Yes changing that value seems to do what I need in the untouched rom, but seems to do nothing in the fan translation which makes me think they repointed either part of the subroutine or just that value somehow, but I've spent about an hour searching for various things in the code and can't seem to find an "A9 0A" that corresponds to what I need. 0A because the fan translation uses a 10-character length command name. Anyway thanks again for your help up to this point. I'll need to take a break until another bright idea pops up.