Page 1 of 1

PSX BIOS from PSP 6.60 optimised to play games more smoothly - but in what way?

Posted: July 15th, 2018, 8:07 am
by gingerbeardman
Hi all!

As you know it's possible to buy and download PS1 games from Sony's PSN service. This selection of PS1 games are playable on up to three platforms: PSP, PSVita and PS3 (which platforms exactly depends on the individual game release).

I recently read several mentions on various forums about the PSX BIOS that is included with PS1 on PSP game downloads allowing games to run more smoothly. This sounded crazy to me, but I have an open mind, so I decided to check for myself. It's possible to extract the PSX BIOS using a hacked PSP running 6.60 CFW.

Anyway, I extracted this strange BIOS and... the claims are true! :shock:

So far I've tried the BIOS using the following emulators:
• POPS on PS2
• RetroArch on SNES Classic Mini
• RetroArch on Raspberry Pi 3

Games run more smoothly using it. :clap

There are definite frame rate improvements, such as removal of stuttering in some games. Other more demanding games can be run in hi-res mode when using RetroArch, whereas they could not using a traditional PSX BIOS. Some games that refuse to run at all when using traditional BIOS run just fine using the enhanced BIOS.

The enhanced BIOS seems to be based, at least in part, on the "final" PSone BIOS (v4.5) judging by the plain text it contains.

So I am wondering, how has this enhanced BIOS been optimised and modified to improve performance?

Any thoughts appreciated!

Cheers,
matt
PSXONPSP660.BIN

Re: PSX BIOS from PSP 6.60 optimised to play games more smoothly - but in what way?

Posted: July 15th, 2018, 6:10 pm
by Shadow
Honestly, the only bug that might have fixed is the infamous 'malloc' bug. As for improvement, they probably added their own custom addressing to take advantage of some registers in the PSP for data store and loading. They probably have also rewritten some assembler functions to take advantage of the PSP hardware better (sort of like register redirection), but the only way to know for sure is by doing a full disassembly in IDA and comparing it with a retail BIOS (which would be a lot of work).

It'd be so nice to get the original source code to the PlayStation BIOS.

Re: PSX BIOS from PSP 6.60 optimised to play games more smoothly - but in what way?

Posted: July 15th, 2018, 8:09 pm
by gingerbeardman
I had dismissed them adding PSP specific functions/hooks, because the BIOS works outside of PSP. Such as in all the emulators I tried.

IDA Pro crashes when trying to open as a PSX BIOS, so I guess it's quite different in some way? I can open and disassemble as regular MIPS code though.

edit: 17 July 2018: I reported the IDA bug, apparently fixed same day, will see if/when it comes to a release version

Re: PSX BIOS from PSP 6.60 optimised to play games more smoothly - but in what way?

Posted: July 18th, 2018, 5:08 am
by gingerbeardman
Looking at no$cash BIOS analysis, there is much room for improvement in:
• memory handling
• GPU access
• BIOS access caching

https://problemkaputt.de/psx-spx.htm#kernelbios

So it would be a fair guess that they improved the BIOS in those ways so as to squeeze extra performance out of the PSP.

Re: PSX BIOS from PSP 6.60 optimised to play games more smoothly - but in what way?

Posted: July 18th, 2018, 8:24 pm
by gingerbeardman
I also read that the Memory Card manager and CD Player have been stripped out.

https://www.ngemu.com/threads/bios-used ... psp.92778/

Re: PSX BIOS from PSP 6.60 optimised to play games more smoothly - but in what way?

Posted: August 5th, 2018, 10:04 am
by djimenez
This is very interesting stuff, gingerbreadman.

I hope you could provide a few more links to the discussions regarding this elsewhere in the web.

It's amazing it improves game performance in al sorts of emulators, I wonder if it breaks any games... I could never get pops to run sheep dog and wolf properly (lags heavily when you run), so I think I'll try that one in retroarch on pc and see how that fares.

Re: PSX BIOS from PSP 6.60 optimised to play games more smoothly - but in what way?

Posted: August 7th, 2018, 2:31 am
by gingerbeardman
The benefits will not help with games that suffer large issues, such as the slowdown in Sheep Dog 'n' Wolf (love that game). At least using POPS on PS2 it's still choppy when there's a lot of transparencies.

But for other games that have occasional slowdown, such as PANEKIT, it improves the experience a great deal. If the slowdown is minor/infrequent, this will help; if the slowdown is major/frequent, this will likely not help.

The main discussion and discovery is through the POPS scene - the official PSX emulator on PS2 that was extracted from a Japanese downloadable game. In this scene, it's been known since 2007(!) that this PSXonPSP BIOS has increased compatibility and improved speed and this is documented in the POPS and POPStarter compatibility lists.

I wrote more about it here:

You'll also find more about it:
https://assemblergames.com/threads/ps2- ... ter.45347/
http://psx-scene.com/forums/
http://www.ps2-home.com/forum/viewtopic.php?t=173
https://bitbucket.org/ShaolinAssassin/p ... /wiki/Home

Re: PSX BIOS from PSP 6.60 optimised to play games more smoothly - but in what way?

Posted: August 14th, 2018, 7:33 am
by kHn
2013: the benefits became clear

The benefits of PSXonPSP BIOS were first noticed in 2013 by users of the newly released POPS (Sony's PS1 emulator on PS2; ripped from a 2010 Japan-only PSBB downloadable PS1 game demo; hacked to run any PS1 game from HDD/USB/SMB). It was favoured by POPS users due to its higher compatibility than traditional PSX BIOS, some games that would not run under POPS without it. This is how I first heard about it.
BIOS from PSP was used because :
1) Embedded BIOS was region locked
2) Early POPStarter builds messed up the BIOS Charset
3) Issues with parsing SYSTEM.CNF
4) "Retail" BIOS PS logo screen is glitchy

PSP 6.60 BIOS and SLBB BIOS have the same kernel. The OSD code isn't the same. See attached file.

Also, it isn't recommended to use the PSP BIOS as default POPStarter BIOS, since it would disable critical compatibility fixes. Only use an external BIOS.BIN file when it's somehow needed for running a specific game.

On a sidenote, the official release date of SLBB-00001 was 2002/05/29. $ONY took it down after HDLoader came out :lol: .

Re: PSX BIOS from PSP 6.60 optimised to play games more smoothly - but in what way?

Posted: August 26th, 2018, 10:18 pm
by gingerbeardman
Thanks for the insights! So why does using PSP 6.60 BIOS run games better than the POPS BIOS?

The difference is very noticeable, I'll make a video soon.

Re: PSX BIOS from PSP 6.60 optimised to play games more smoothly - but in what way?

Posted: October 26th, 2022, 4:30 pm
by nocash
I think you are only dreaming those enhancements. See here http://problemkaputt.de/psxspx-bios-memory-map.htm for the basic memory map. Then use "FC /B file1 file2 >diff.txt" at command prompt. The "optimized" 4.5J kernel (=the first 18000h bytes) is exactly same as the normal 4.5E and 4.5A retail versions (apart from unused areas being either 00 or FF filled).

The self-decompressing GUI is apparently smaller in 4.5J, supposedly because it's only showing the boot logos, without memory card manager. And the charset region seems to contain some different bytes. Theretically those changed bytes might result in unintended effects, or the GUI code might contain intended kernel patches, or there might be pyramids on the backside of the moon, it's quite unlikely.

Other ideas: The "J" in the version string might result in some games to accidentally run in PAL or NTSC mode, which might feel "smoother" in some cases. Or the emulator doesn't recognize the .BIN file as BIOS image at all (and switches to some kind of BIOS clone or high-level emulation mode with faster timings) (eg. no$psx would accept it only if you rename it to .ROM instead .BIN).
Shadow wrote: July 15th, 2018, 6:10 pm Honestly, the only bug that might have fixed is the infamous 'malloc' bug.
What is a infamous malloc bug? Never heard about that, and I didn't notice any such bug when disassembling the kernel.

Re: PSX BIOS from PSP 6.60 optimised to play games more smoothly - but in what way?

Posted: October 27th, 2022, 2:42 am
by Shadow
nocash wrote: October 26th, 2022, 4:30 pm
Shadow wrote: July 15th, 2018, 6:10 pm Honestly, the only bug that might have fixed is the infamous 'malloc' bug.
What is a infamous malloc bug? Never heard about that, and I didn't notice any such bug when disassembling the kernel.
Sony's malloc function in the kernel had a problem where the memory wasn't free'd correctly. It's mentioned in their Psy-Q documentation. That's why they then introduced malloc2 and malloc3 in their library (and before it was part of the library, you had to use MMGMNEW.OBJ linked during compilation to use the new malloc functions which was SN Systems' quick and dirty fix for developers to use).

Re: PSX BIOS from PSP 6.60 optimised to play games more smoothly - but in what way?

Posted: October 27th, 2022, 11:08 pm
by nocash
Ah, I see. This thread viewtopic.php?t=447 seems to be related - I'll post more questions there.