TOCPerfect - Modify PSX Games To Have Perfect TOC/CD Audio And Multi-Disc Game Support After Audio Menu Swap Trick

General homebrew games, programs and PlayStation PS-EXE's
Post Reply
alexfree
Verified
Extreme PSXDEV User
Extreme PSXDEV User
Posts: 221
Joined: Oct 21, 2021
I am a: Programmer, Gamer
PlayStation Model: SCPH-1000
Location: USA
Contact:

TOCPerfect - Modify PSX Games To Have Perfect TOC/CD Audio And Multi-Disc Game Support After Audio Menu Swap Trick

Post by alexfree » November 4th, 2021, 8:00 am

https://alex-free.github.io/tocperfect

TOCPerfect takes an existing PSX game's data track 1 .bin file and modifies it to automatically re-read TOC data and unlock the Playstation's drive before booting the original game executable. The reason to do this, is to gain perfect TOC compatibility/CD audio and to enable the use of multi disc games while using the Audio Menu Swap Trick.

This means the real Playstation game you start with to do the Audio Menu Swap Trick doesn't matter. As long as your desired backup is a TOCPerfect compatibile game your TOCPerfect modified backup will always have correct working CD audio when using any swap trick.

User avatar
MottZilla
Verified
Serious PSXDEV User
Serious PSXDEV User
Posts: 89
Joined: Jul 04, 2015
Location: North America

Post by MottZilla » February 21st, 2022, 12:22 pm

You mention on your page that some games like Tomb Raider don't work and that it might be expecting file data at an exact LBA. You may be able to get around this.

Replace the original game executable in the ISO image with your TonyHax.exe, that is easy enough to do. Then you need to add some sectors to track 1 to put the original game executable in. Then modify the TonyHax executable to load the original game executable from those sectors. This way you haven't moved any files from their original LBA, other than the main game executable. The audio tracks will be pushed back but the TOC takes care of that and I imagine most games that use CDDA don't try to verify the TOC to be accurate.

It seems like it might work to me.

One way you could help TonyHax's loader find the original executable at the end of the data track could be to expand the original SYSTEM.CNF file. The file is very small but it occupies an entire sector so adding another line to the SYSTEM.CNF is no problem. You could add multiple lines to describe the LBA of the original executable and the size.

You could also consider adding another entry to the root directory for the tonyhax.exe, and tacking it onto the end of the data track. That may be the best way to do it. Then no data moves LBA on the disc and only the audio gets moved back slightly. Then alter the SYSTEM.CNF to make tonyhax.exe boot, and add another line for tonyhax.exe to read the original boot executable.

Edit: I was looking at your source code and it should be as simple as changing the loader to read a different line than BOOT for the executable name, and reading SYSTEM.CNF rather than SYSTEM2.CNF

I might try out the idea and let you know how it works.

R3k
Interested PSXDEV User
Interested PSXDEV User
Posts: 7
Joined: Jan 02, 2022

Post by R3k » February 23rd, 2022, 3:10 am

No, no. Tomb Raider hangs, because it does use GetlocP and subchannel Q data to seek the CD Audio tracks precisely.

User avatar
MottZilla
Verified
Serious PSXDEV User
Serious PSXDEV User
Posts: 89
Joined: Jul 04, 2015
Location: North America

Post by MottZilla » February 24th, 2022, 9:45 am

I looked into this since my first post. There is a way to do it where Tomb Raider should work. The process prevents any data from moving as well as prevents audio tracks from moving. I might look into making a tool to automate the process.

User avatar
MottZilla
Verified
Serious PSXDEV User
Serious PSXDEV User
Posts: 89
Joined: Jul 04, 2015
Location: North America

Post by MottZilla » March 1st, 2022, 8:41 am

I have made a patch program that has a different primary purpose but it also implements your TOCPerfect idea. Tomb Raider when patched with it is functional.
You do not have the required permissions to view the files attached to this post.

alexfree
Verified
Extreme PSXDEV User
Extreme PSXDEV User
Posts: 221
Joined: Oct 21, 2021
I am a: Programmer, Gamer
PlayStation Model: SCPH-1000
Location: USA
Contact:

Post by alexfree » March 6th, 2022, 6:54 am

MottZilla wrote: March 1st, 2022, 8:41 am I have made a patch program that has a different primary purpose but it also implements your TOCPerfect idea. Tomb Raider when patched with it is functional.
Great work! This is so interesting, thanks for your brilliant advancement on this method. Any chance for source code of your demo program so this can be compiled for other operating systems and expanded by others as well? I also would like to see how your doing it exactly in the code.

User avatar
MottZilla
Verified
Serious PSXDEV User
Serious PSXDEV User
Posts: 89
Joined: Jul 04, 2015
Location: North America

Post by MottZilla » March 6th, 2022, 9:35 am

I'm not ready to release my source code, I'd like to clean it up before that. But if you'd like to see it I will send it to you so you can see exactly what is being done.

alexfree
Verified
Extreme PSXDEV User
Extreme PSXDEV User
Posts: 221
Joined: Oct 21, 2021
I am a: Programmer, Gamer
PlayStation Model: SCPH-1000
Location: USA
Contact:

Post by alexfree » March 15th, 2022, 1:43 am

Me and MottZilla proudly present PS1 DemoSwap Patcher v1.0.1! I have ported it to work on Mac OS X and Linux.

https://alex-free.github.io/ps1demoswap

alexfree
Verified
Extreme PSXDEV User
Extreme PSXDEV User
Posts: 221
Joined: Oct 21, 2021
I am a: Programmer, Gamer
PlayStation Model: SCPH-1000
Location: USA
Contact:

Post by alexfree » September 2nd, 2023, 6:28 pm

An insane update years later to the original TOCPerfect patch is now available:
https://alex-free.github.io/tocperfect/
Changes:

Fixes absolute LBA addressing in-game issues.

Added support for patching games with .DA files that only reference a CD Audio track and that do not contain any audio data (such as Tekken 3).

Updated mkpsxiso to v2.0.3, and now usesdumpsxiso+binmerge to rip which significantly increases patching compatibility.

Should now be just as powerful as the TOCPerfect patch mode found in PS1 DemoSwap Patcher.

Windows release is now completely self-contained and portable, MSYS2 being installed is no longer required.

Portable Linux releases now available.

Switched from my original modified tonyhax v1.4.3 to my Tonyhax International v1.3.8 fork. This adds support for Japanese consoles at long last.

Added support for early launch Japanese PSX.EXE games which don’t have a SYSTEM.CNF.

Supports EDC protected games (burn them in RAW mode like described in Tonyhax International).

alexfree
Verified
Extreme PSXDEV User
Extreme PSXDEV User
Posts: 221
Joined: Oct 21, 2021
I am a: Programmer, Gamer
PlayStation Model: SCPH-1000
Location: USA
Contact:

Post by alexfree » September 3rd, 2023, 1:33 pm

Version 1.1.1 (9/2/2023)

Changes:

Updated Tonyhax International to version 1.3.9.

alexfree
Verified
Extreme PSXDEV User
Extreme PSXDEV User
Posts: 221
Joined: Oct 21, 2021
I am a: Programmer, Gamer
PlayStation Model: SCPH-1000
Location: USA
Contact:

Post by alexfree » September 8th, 2023, 8:12 am

Version 1.1.2 (9/7/2023)

tocperfect-v1.1.2-windows-x86_64 For Windows 10 64-bit or newer

tocperfect-v1.1.2-linux-x86_64 For x86_64 Linux Distributions

Changes:

Games which contain CDDA audio tracks not referenced by the data track filesystem (such as Ridge Racer Japan) now work on real hardware and not just emulators. This issue was caused by mkpsxiso not putting in dummy sectors in this case (which may be a bug in that software?).

Patcher now shows the edited xml used in the final build during patching.

Updated EDCRE to version 1.0.3.

Updated Tonyhax International to version 1.4.0.

alexfree
Verified
Extreme PSXDEV User
Extreme PSXDEV User
Posts: 221
Joined: Oct 21, 2021
I am a: Programmer, Gamer
PlayStation Model: SCPH-1000
Location: USA
Contact:

Post by alexfree » September 16th, 2023, 4:54 am

Version 1.1.3 (9/15/2023)
Linux
Windows

Changes:

Updated MKPSXISO to latest commit (for Linux build).

Updated Tonyhax International to version 1.4.1.

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests