News:

11 March 2016 - Forum Rules

Main Menu

What's wrong with this Atlas script

Started by Guadozoku, May 19, 2014, 12:37:33 PM

Previous topic - Next topic

Guadozoku

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

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

#2
Quote from: Pennywise on May 19, 2014, 01:39:46 PM
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 ;)

Pennywise

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

Also don't forget Atlas requires hex numbers to be in all caps, so "$37E0a" is not a valid number.