News: 11 March 2016 - Forum Rules

Author Topic: Expanded data past 3FFFFF: jumps & pointers  (Read 2891 times)

Gi Nattak

  • Full Member
  • ***
  • Posts: 157
    • View Profile
    • http://ff6hacking.com/
Expanded data past 3FFFFF: jumps & pointers
« on: June 06, 2014, 01:48:18 pm »
I expanded my FFVI ROM to 6mb and am trying to point some data (song pointers, jump commands in events, LDA jumps, sprite sheets, anything) to point to this new expanded data, and it is not working. I have data at 400000, so I point my pointer to 00 00 40 (400000), and this is not working. I can't seem to get anything to jump to this new data, but I've seen it done in other hacks that go to 400000 + past FF/FFFF.

Is there something else that I need to do in order to allow the game to recognize pointers & jumps to expanded data after 3FFFFF?

I've heard thus far from asking around the FFVI hacking circle that I would need to change some code to load from the extra banks, and it might have to do with the "rom mapper" and/or the internal header, but aside from this info I am not sure what to do or where to find these things to edit and was hoping the knowledgeable hackers here might know.

justin3009

  • Hero Member
  • *****
  • Posts: 1659
  • Welp
    • View Profile
Re: Expanded data past 3FFFFF: jumps & pointers
« Reply #1 on: June 06, 2014, 04:38:07 pm »
It may be that the code actually loads from 40:8000 instead of 40:0000.  I'm not sure on FF6 but it's possible that it's setup that way.
'We have to find some way to incorporate the general civilians in the plot.'

'We'll kill off children in the Juuban district with an infection where they cough up blood and are found hanging themselves from cherry blossom trees.'

Gi Nattak

  • Full Member
  • ***
  • Posts: 157
    • View Profile
    • http://ff6hacking.com/
Re: Expanded data past 3FFFFF: jumps & pointers
« Reply #2 on: June 06, 2014, 06:32:09 pm »
It's definitely supposed to be the address directly, after 3FFFFF (pointer = FFFF35), like:

(ex)
5C 00 00 5D JMP $5D0000
BF 20 05 5D LDA $5D0520,X

Using an expanded Japanese hack here to test that allows it, I change a song pointer to
00 00 40 and place song data there at 400000 and sure enough it plays. Same with an event I tested - the ROM seems integrated somehow to work and do it, while mine, and the original ROM (both U & J) does not.  :-\ I've been told to trace that ROM hack where it is working and go from there, but I'm not sure where to start or what to look for.
« Last Edit: June 06, 2014, 06:47:34 pm by Gi Nattak »

Nightcrawler

  • Hero Member
  • *****
  • Posts: 5791
    • View Profile
    • Nightcrawler's Translation Corporation
Re: Expanded data past 3FFFFF: jumps & pointers
« Reply #3 on: June 06, 2014, 07:31:43 pm »
The FF6 cart is mapped via Mode 21 (traditional HiROM) and cannot be expanded beyond 4M. Banks $40-$7D actually mirror banks $C0-$FF.

You must change the cart mapping to something else. How you go about that depends on what you expect it to run on (certain emulators, flashcarts, real carts etc). I would indeed take a look at the hack you have and see what it has done for starters. If it already works on common emulators, it's probably just mimicking the Tales of Phantasia map or something like that. Take a look at the internal header.

EDIT: You're right Revenant, post corrected. Thanks. :)
« Last Edit: June 06, 2014, 08:34:09 pm by Nightcrawler »
TransCorp - Over 20 years of community dedication.
Dual Orb 2, Wozz, Emerald Dragon, Tenshi No Uta, Glory of Heracles IV SFC/SNES Translations

Revenant

  • Full Member
  • ***
  • Posts: 206
    • View Profile
Re: Expanded data past 3FFFFF: jumps & pointers
« Reply #4 on: June 06, 2014, 08:17:50 pm »
Small correction: HiROM (almost always) maps banks $C0-$FF and mirrors to $40-$7D, although obviously that same size limitation still applies.

ExHiROM (aka the Tales of Phantasia way) is probably the best/easiest solution - keep banks $C0-$FF at the beginning of the ROM file like normal, then expand the ROM to add more 64kb banks that will be mapped as bank $40 and up.

You'll also have to relocate the header from offset 00FFC0 to 40FFC0 in the ROM file, since the ROM portion of bank $00 is mirrored from bank $40, not bank $C0.

Gi Nattak

  • Full Member
  • ***
  • Posts: 157
    • View Profile
    • http://ff6hacking.com/
Re: Expanded data past 3FFFFF: jumps & pointers
« Reply #5 on: June 06, 2014, 09:01:05 pm »
Thank you very much for the info guys, I will report back how it goes. Trying to replace just the internal header from ToP yielded no immediate results, as the Japanese hack did not either, but I will try relocating it as you suggested Revenant.