+  RHDN Forum Archive
|-+  Romhacking
| |-+  ROM Hacking Discussion
| | |-+  Checking available RAM on PSX?
Pages: [1]
Author Topic: Checking available RAM on PSX?  (Read 1 times)
Magil
Guest
« on: December 23, 2010, 08:33:08 pm »

So is there a way?

And can anyone give me an example of how to call the system function such as malloc?
Gemini
Guest
« Reply #1 on: December 23, 2010, 08:53:23 pm »

Not many games actually use malloc. Most of the times you'll see custom allocation methods (both dynamic and static), so it's kinda hard to find out how much memory is available for extra data. A few games, like mine, use the malloc3 set from the SDK, but don't expect to count too much on this one.
Magil
Guest
« Reply #2 on: December 23, 2010, 09:12:30 pm »

I see. 
And it seems few games leave free memory space (SoTN, IIRC, someone metioned before), that's the reason why I want a dynamic method.
Gemini
Guest
« Reply #3 on: December 23, 2010, 09:36:02 pm »

SotN uses static allocation, along with other anal routines of evilness.
Magil
Guest
« Reply #4 on: January 04, 2011, 04:05:12 am »

 

Just tried Dewprism. I appended 90kb extra bytes after a file and it was loaded without a problem.
So hopefully I can remove the whole bios font thing into RAM.
Well, anyway, it needs a lot of test among different maps...
Gemini
Guest
« Reply #5 on: January 04, 2011, 04:54:54 am »

Removing the BIOS font mapping is just a matter of hacking "KromToAddr" (and similar functions) to force it using actual RAM instead of BIOS ROM. Or you can just crush it all and rewrite the whole upscale+rendering routines, which will look a lot better in the end and should give you much more control.
Magil
Guest
« Reply #6 on: January 04, 2011, 09:28:18 am »

Yeah, I checked the output result and converted it to RAM address if certain condition was met (the laziest way I guess).
Just trying to avoid bios hacking.

Another question, is RAM region around 8000b0bc safe to use?
It is the starting position of the psx exe, followed by a lot of zeros.

Gemini
Guest
« Reply #7 on: January 04, 2011, 12:53:26 pm »

Yes, it is safe to use, but you have to write code/data/whatever you need there AFTER the game is booted. In other words, if you store something there directly from the EXE it's not gonna work on real hardware and it will have 100% possibilities of freezing on a PS2. Instead, memcpy makes it work like a charm.
Magil
Guest
« Reply #8 on: January 04, 2011, 07:08:06 pm »

Ah, thank you. I think I need to move the code to somewhere else.
Gemini
Guest
« Reply #9 on: January 04, 2011, 07:23:52 pm »

If the BSS segment is big enough you can store your additional code there and then copy it to the desidered destination before the BSS reset routine is executed. I did that with the mdec subtitles for FFVII International and with several intros.
Pages: [1]  


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