+  RHDN Forum Archive
|-+  Romhacking
| |-+  ROM Hacking Discussion
| | |-+  I'm having a bit of pointer trouble for Ganbare Goemon 2
Pages: [1]
Author Topic: I'm having a bit of pointer trouble for Ganbare Goemon 2  (Read 2 times)
Kagemusha
Guest
« on: October 25, 2008, 01:30:40 pm »

After the title screen there's a screen in Ganbare Goemon 2 where you select the number of players, but the two strings aren't like the other text in the game. First off, they have some control codes that precede them that deal with the position of the text, where the dakuten will appear and what tile to be loaded for the dakuten. I'd like to find the pointers for the strings, but I don't know the RAM address for them. The thing is the bank the strings are in isn't swapped in the PRG ROM. Instead I've found them in RAM multiple times from $0700-$2000. There currently isn't enough space for the translations to fit. Any ideas as to what I should do?
Ryusui
Guest
« Reply #1 on: October 25, 2008, 02:37:46 pm »

Simple: if the pointers are in RAM, they had to be written from somewhere. Set a write breakpoint to the locations and you should be able to find out where they're stored in the ROM.
KingMike
Guest
« Reply #2 on: October 25, 2008, 09:53:58 pm »

Quote from: Pennywise on October 25, 2008, 01:30:40 pm
Instead I've found them in RAM multiple times from $0700-$2000.
RAM is only $0000 to $07FF. $0800-1FFF are just mirrors and you generally should just ignore that space.
Kagemusha
Guest
« Reply #3 on: October 26, 2008, 06:07:23 pm »

Yeah, I realized that, but I wasn't sure of what it's called or what it is. What about $2000-$8000?

Incidently, I can't relocate the text to free space because the free space is swapped out for the two strings. I'm thinking my next best option is to disable a few control codes I don't have any use for, which are dakuten related, and making the game not recognize them so I can use them for a little extra space. I don't know how hard that would be, but I've made a little headway by possibly finding the place in RAM where the dakuten tile is stored/loaded, which is $06. I then found some related ASM and tried NOPing it, but it didn't break the game and didn't have any effect on the control codes.
KingMike
Guest
« Reply #4 on: October 27, 2008, 12:22:26 am »

$2000-2007 is used for PPU control/access.
$4000-4017 is sound/sprite DMA/controller.
$4020-403? is FDS.
$6000-7FFF is usually cartridge RAM if present.

Some mapper might use the $4xxx and $5xxx areas (and a few use $6xxx, which means no expansion RAM), but generally the rest of the address range is unmapped.
Malias
Guest
« Reply #5 on: October 27, 2008, 02:52:24 pm »

Don't worry about trying to find the pointers.  You have enough room as it is.  When the dakuten are being called, the control codes used to call them aren't specific to the dakuten.  On the screen, it is being treated like any other character.

That being said, the control codes are pretty simple.  At the beginning of the string, one indicates when a string starts and the other indicates where it is being positioned on the screen.  For instance, the two bytes before the first dakuten are 21 6B.  If you change that 6B to 8B, you're now writing on the same line that the rest of the text appears on.  There are two more control codes and they are also simple.  FE denotes the end of the string and FD seems to be used just for the dakuten but does the same thing as FE. 

Knowing this, you could rewrite the page without the dakuten altogether.  This saves you space by only having to write to two lines instead of four, and the extra space which was used for the control codes and the dakuten is now yours.  You shouldn't need to mess with anything else.
Kagemusha
Guest
« Reply #6 on: October 27, 2008, 03:06:32 pm »

Thanks, that's actually really easy and simple. As soon as I got that part figured out, I was going to release a teaser patch, but first I have come up with something for the intro. I have multiple translations for it and they are all different and it's been confusing me for a while.
Pages: [1]  


Powered by SMF 1.1.4 | SMF © 2006-2007, Simple Machines LLC