+  RHDN Forum Archive
|-+  Romhacking
| |-+  ROM Hacking Discussion
| | |-+  How to Find Unused RAM Regions of a PSX Game?
Pages: [1]
Author Topic: How to Find Unused RAM Regions of a PSX Game?  (Read 1 times)
Magil
Guest
« on: April 15, 2010, 09:44:11 pm »

Maybe the question is too general, let me give some examples.

1. When you want to insert custom code changes, where do you put them?
2. Where to put custom resources like fonts, for example?
3. Does psx games use function like the c function alloc?
Markliujy
Guest
« Reply #1 on: April 16, 2010, 10:23:13 am »

With the game I'm currently hacking, it keeps the SLPS file in RAM pretty much all the time. And that SLPS file has the entire font table, graphics and all. Clearing that out for an English font table freed up some few hundred bytes, and that's where I'm putting pretty much everything.

I'm not too sure how you'd go around looking for ram that doesn't break things otherwise, but I think you just need to observe the RAM alot, or something.
slowbeef
Guest
« Reply #2 on: April 18, 2010, 10:05:46 pm »

For Policenauts, I used the font file as well.  It stayed static in memory the whole time, so I just overwrote the end of it with my new assembly.  In my case, the font was in a separate file than the SLPS file, so it was very easy.
Sephiroth 1311
Guest
« Reply #3 on: April 19, 2010, 11:39:08 am »

PSX exes are usually full of useless ASCII text (remainders from the debug, I think?) which can be easily overwritten. If you need just a few bytes, you can usually place your hacks there.

Also, many games keep the debug font inside their executables, and that too can be overwritten without problems.

Anyway, I suppose that you'll be working on a JAP2ENG patch, so I guess the most logical solution would be to follow Markliujy and slowbeef's suggestions. Wink
KC
Guest
« Reply #4 on: April 19, 2010, 12:26:40 pm »

If that's not possible (ie, the game uploads the font to VRAM and forgets about it and doesn't have lots of useless stuff either), there are also some methods that need a bit more work.
A PSX game is like any normal program, it allocates and frees memory as it needs to. Where these functions are is up to the game though. If you can't overwrite/extend some other file in RAM, you could also just load a completely new file. Most games probably have a function that loads a file/subfile to RAM and returns a pointer to it. If you do that right at the beginning, you can load your code and it will be at that space without taking much away from the available RAM.
You'd have to find that function yourself though, and you'd also need a small area to save your loader.
Magil
Guest
« Reply #5 on: April 20, 2010, 01:46:14 am »

@KC
Hmm, that sounds good. Is there any document about file/subfile that you would like to recommend me?

BTW, I'm currently investigating Dragon Quest VII (not a JAP2ENG hack though). I'll need 7-8kb more free RAM for my custom font.
But I'll wait for a while until I find the menu font set (which I thought to use same font set as the dialogue) to see whether I can merge them.

Thanks for all of your replies. :laugh:
Pages: [1]  


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