News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: How to add dialogs in FF3us / FF6 in another offset range?,out of D0200h-EF200h.  (Read 695 times)

RodMerida

  • Jr. Member
  • **
  • Posts: 10
    • View Profile
Hello. I have an expanded ROM of Final Fantasy III us with translated dialogs. When the town dialogs pass the limit of D0200-EF200 offsets, they go on since 300200 and beyond, inside an extra megabyte that is added at the end of the ROM. I want to de-expand my ROM, passing it from 4MB back to 3MB. I have found many areas of unused bytes throughout the whole ROM, one of those big enough to contain the remaining dialogs that pass EF200h offset, and are located beyond 300200h. How could I move this part of extra dialogs to one of these areas and say to the game that it must go on searching these dialogs in a different segment of the ROM?

If someone knows it, and can help and tell me, I will be very thankfull.
« Last Edit: April 05, 2020, 10:04:49 am by RodMerida »

Madsiur

  • RHDN Patreon Supporter!
  • Full Member
  • *****
  • Posts: 178
  • FF6 hacker
    • View Profile
You could convert your script and use Atlas. Moving the expanded dialogs will break FF3usME dialog editor compatibility anyway so you'll need to use another utility for insertion and modification, Atlas is one. There is one named Kruptar also but I've never used it.

Edit: Note that to use Atlas you might need to expand dialog pointers to 3 bytes, this is what was done for RotDS but in our case the concern was to add more dialog space than the existing FF3usME expansion bank.

RodMerida

  • Jr. Member
  • **
  • Posts: 10
    • View Profile
There is no problem with breaking compatibility with ff3usME, I considere this project finished, except for passing it from 4MB back yo 3MB, and anyway I have been this far using Kousei's Ff3edit (specially ff3ed-2) all the time, and Hexposure (or Hexpose, an hex editor) for Battle/Menu dialogs editing and event synchronization with PAL of the opera and ending, and others. Also I'm using a patch for reverting the minimap to the original every time. If I needed to add new modifications to the town dialogs I would do it either with hex editor or from the 4MB version and repeating whatever further process.

So Atlas allows me to change dialogs banks addresses?

Anyway my only intention is finding the exact possition of a FF3us ROM expanded from 3MB to 4MB by saving changes with Kousei's FF3edit, where it decides a certain dialog must be read in a memory bank other than 0D (or CD) and 0E (or ED), like for example, the 30h bank (or F0) where FF3edit saves those dialogs that don't fit in the original size of the ROM.

I have found this code:
https://datacrystal.romhacking.net/wiki/Final_Fantasy_VI:ROM_map/Assembly_C07#C0.2F7FBF_load_dialogue
It's the machine / assembly code of the routine of FF3us that loads a certain dialog. Here is the routine that initializes the initial memory bank where dialogs start: https://datacrystal.romhacking.net/wiki/Final_Fantasy_VI:ROM_map/Assembly_C07#C0.2F7F64_initialize_dialogs_for_current_map
The routine in the first link also recognizes if the dialog that is being loaded is not inside the initial memory bank and if such a bank number needs to be increased to 1 more, from 0D to 0E.

But I have not found the assembly code of such a routine when modified by FF3edit. Anyway it's this one that appears in this snapshop below. My only problem right now is that I'm not familiar with 65c816 machine / assembly code and that I need time to find all the mnemonic equivalence to each hexadecimal machine code in a list and to decipher the whole algorithm until I find the exact character that I must modify, but at least I already have a clear idea of where I must look.
 

April 05, 2020, 08:08:41 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
Solved!

It's these three characters!
The third one, is the one. I just have to change F0 (= 30h bank in the ROM) by C3 (= 03 bank), and I will be able to place the extra dialogs in the unused space in 3F000-3FFFFh, ^_^. Mission completed!

At the end I've found it out myself, so I share it here so it can serve to others in a future.
« Last Edit: April 05, 2020, 08:08:41 pm by RodMerida »