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

Author Topic: What's wrong with this Atlas script  (Read 2115 times)

Guadozoku

  • Sr. Member
  • ****
  • Posts: 257
    • View Profile
What's wrong with this Atlas script
« on: May 19, 2014, 12:37:33 pm »
Here it is, but it says I need a JMP command... help

#VAR(tbl, TABLE)
#ADDTBL(tbl, "oni3e.tbl")
#ACTIVETBL(tbl)
#JMP($37E02)
Party
#JMP($37E0a)
Arte
#JMP($37E10)
Use

Pennywise

  • Hero Member
  • *****
  • Posts: 2257
  • I'm curious
    • View Profile
    • Yojimbo's Translations
Re: What's wrong with this Atlas script
« Reply #1 on: May 19, 2014, 01:39:46 pm »
So I take it you have a text block. Here's what mine usually look like.

Quote
#VAR(Table, TABLE)

#ADDTBL("eng.tbl", Table)
#ACTIVETBL(Table)

#VAR(Block1, CUSTOMPOINTER)
#CREATEPTR(Block1, "LINEAR", $0000, 16)

#JMP($387DE, $39635)

//POINTER #0 @ $385DE - STRING #0 @ $387DE

#WRITE(Block1, $385DE)

JMP sets the area where you want to insert. WRITE writes the individual pointer values to the ROM offset. So you usually end up with one JMP and many WRITES for each piece of text. This allows us to automatically adjust the position of the text within the ROM.

Btw, if you're translating Oni 3 for the GB, I have the scripts for 2 available. PM if you're interested.

Guadozoku

  • Sr. Member
  • ****
  • Posts: 257
    • View Profile
Re: What's wrong with this Atlas script
« Reply #2 on: May 20, 2014, 02:43:05 am »
So I take it you have a text block. Here's what mine usually look like.

JMP sets the area where you want to insert. WRITE writes the individual pointer values to the ROM offset. So you usually end up with one JMP and many WRITES for each piece of text. This allows us to automatically adjust the position of the text within the ROM.

Btw, if you're translating Oni 3 for the GB, I have the scripts for 2 available. PM if you're interested.
I don't actually HAVE pointers, so I'm just writing raw while looking through the rom for whatever's after every 5b (the string terminator) and translating from a script dump then going to a script dump and making sure the new string is shorter than the original which is kinda dumb, but my knowledge of how to find pointers begins and ends with "find the hex addresses backwards one after another."

If you could help a total n00b like me find the pointers, I'd appreciate that. Though, I'll admit I do kind of like this in a sort of "this is exactly what translators back in the day must've went through" sort of way ;)

I'll take a look at 2 also. I played that a few years back and enjoyed it as well, thanks ;)
« Last Edit: May 20, 2014, 10:29:01 am by Guadozoku »

Pennywise

  • Hero Member
  • *****
  • Posts: 2257
  • I'm curious
    • View Profile
    • Yojimbo's Translations
Re: What's wrong with this Atlas script
« Reply #3 on: May 20, 2014, 10:35:28 pm »
There's no shame in being a noob at this stuff especially if you're more or less a translator. I give you props for trying your hand at this "complicated hacking stuff" :)

Ok, let me just give you a general rundown of pointer crap. GB pointers just point to an address space within the GB's CPU. Pointer values range from 0000-7FFF. That's 32kb of space the GB can handle at once. GB ROM banks are 16kb each, so that means only 2 banks can be loaded into the CPU at the same time. One starting at 0000 and the other at 4000. Now the first bank in every GB ROM is fixed to the first slot. So that leaves the second half being swapped in and out with various banks. This means that text is usually loaded into the 4000-7FFF range in the CPU. So the pointer values for your text are 7E02 and since GB pointers are little endian, you reverse the bytes to get your pointer values. So search for 027E and that's your pointer for the one piece of text. Rinse and repeat.

furrykef

  • Full Member
  • ***
  • Posts: 132
    • View Profile
Re: What's wrong with this Atlas script
« Reply #4 on: May 21, 2014, 06:28:34 am »
Also don't forget Atlas requires hex numbers to be in all caps, so "$37E0a" is not a valid number.