WORKSHOP CODING INTROS & DEMOS for Play Station 1

General Programming help in C, C++ or ASM, Compiling / Debugging, and R3000A Central Processing Unit (CPU) information
Z3R0X
Interested PSXDEV User
Interested PSXDEV User
Posts: 8
Joined: Jul 31, 2018

Post by Z3R0X » September 8th, 2023, 2:44 am

This is one of the best threads ever, thank you lightforce for all your knowledge. I learned a lot form you and PSXDev.
The only suggestions I can think of it is to divide/struct the code into smaller files with typical C project struct like the include, lib, src folders. Because if everything is in one file MAIN.C can be difficult to read for the newbies.

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, 9:23 am

This isn't the only way to make a cracktro/preloader, but it may in fact be superior to what me and MottZilla have done. With the https://alex-free.github.io/tocperfect patcher instead of modifying the PS-EXE itself you can simply append another separate EXE as the last file in the data track (to not mess with any LBAs) and then either add a SYSTEM.CNF file to the image (also at the end) if it is an early Japanese PSX.EXE game like Ridge Racer Japan that doesn't have one, or edit the BOOT line on the existing SYSTEM.CNF (which also doesn't change the amount of sectors it takes up).

Something else I've thought about, is how 'correct' does the disc image really need to be at the beginning sectors for it to still boot on the PSX? SCPH-1000, all USA consoles, and all PAL consoles up to 102 don't even need a valid license sector, so in theory sectors 0-15 could have data for a file in them. Sector 16 needs to be the directory, but that is 30720 bytes for free without appending any files on the end of the disc (but still needing a SYSTEM.CNF to point to it). If we take needing a valid sector 4 into account, we still have 20480 bytes for free if we start at sector 5-15.

I'm still not exactly sure how cracktros work. Are you modifying the PS-EXE (using the header zero bytes somehow) to jump lower then user ram 80100000 to unused kernel RAM that then contains the cracktro? Or are you modifying the entire exe to load higher or lower then 80100000 (or whatever start address the executable is linked for) and then @8010000 is the actual cracktro? Something else?

I need to see the downloads available already to figure that out (hopefully there is source code). It would be nice to automate this into a CLI on Linux as well so I don't need to use wine. If source is available that should be pretty easy.

Anyways, excellent thread, really cool to meet someone from the scene here at psxdev. I wonder what you think of https://alex-free.github.io/aprip ? The anti-piracy patch (not the libcrypt ones) in that while only working on stock consoles without a modchip, has worked with every titles I've tried it with and it's something I discovered only last year. I figured that out when I realized that the original Japanese launch consoles can never trip anti-piracy detection (not the libcrypt protection) since they lack the readtoc command in the CDROM controller C0A/C0B versions and games had to ensure those consoles would function normally. So with a correct TOC and no modchip every game (including spyro YOTD USA) works without any patching on those early consoles. That behavior is easily emulated on other consoles which do contain the readtoc command in their newer CDROM controller firmwares with gameshark codes (100% success rate not including Spyro YOTD USA because of memory scanning) and depending on weather or not the game obfuscated it, the ISO itself sometimes.

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, 11:42 am

So I tried the idea, can you fit a cracktro/pre-loader in the sectors before the volume descriptor (16)? The answer is surprisingly yes, but this isn't as great as it might seem.

Sectors 0, 1, 2, 3 are zero-filled so they are fine to use.

4 is the license data, which depending on what console it is has to match the region. Some consoles must have this matching so it can't be used for additional data.

5-11 are the logo data, which is the real issue. By having some of the PS-EXE data where the logo data is, the console never gets past the white sony screen (tested on SCPH-1000 and SCPH-5501, both don't care about sector 4 data so this is the actual issue.

12, 13, 14, 15 are 'reserved' zero-filled sectors as well. Besides sector 12 being abused for EDC-based detection in some of the late Japanese games, these are fine as well to use.

So how do I know this technically works? I'm using sectors 0-13 to fit a PS-EXE and it does actually work just fine with a soft-mod (Tonyhax International with SCPH-1000).
adding-file.png
cdmage.png
So realistically, if your executable is 2048*4=8192 (0x2000) bytes or lower you can put it at LBA 0-3 and it completely works.

Possible fixes:

1) If you can somehow place an unsigned char array of sector 4-11 user data at 0x2001 to whatever in the middle of the executable and have it end up in the exact sectors 4-11 that need that data, you might be able to continue to use sectors 12-15 for the rest of the exe?

2) If you did 2 files, stage 1 is 0-3 and stage 2 is 12-15.

Again the problem is nothing but issues after sector 4, because even if you do one of the above solutions those EDC protected games will not work correctly because they lock up the game if sector 12 EDC checksum is non-zero (which it would be after writing the PS-EXE, and if it's not, then it would corrupt the user data of the sector by trying to 'fix' the user data it thinks is corrupted).

An idea with this would maybe be even to put a small bit of assembly at sectors 0-3 which just reads a PS-EXE too large for just 4 sectors off of a memory card and runs that as a stage 2. Again you do have 0x2000 bytes to work with that causes zero issues.

Don't mean to clutter up this thread but I've never seen anyone try anything similar. This is a 3rd possible way to do a cracktro that is somewhat realistic.
You do not have the required permissions to view the files attached to this post.

Z3R0X
Interested PSXDEV User
Interested PSXDEV User
Posts: 8
Joined: Jul 31, 2018

Post by Z3R0X » September 12th, 2023, 7:27 pm

@Alexfree Very interesting idea, thanks for sharing your knowledge! :clap

User avatar
inc^lightforce
Verified
Psy-Q Enthusiast
Psy-Q Enthusiast
Posts: 266
Joined: Mar 07, 2013
I am a: Programmer Windows+PS1, GFX Artist
PlayStation Model: Black
Location: Germany

Post by inc^lightforce » September 21st, 2023, 5:07 am

alexfree wrote: September 8th, 2023, 11:42 am Don't mean to clutter up this thread but I've never seen anyone try anything similar. This is a 3rd possible way to do a cracktro that is somewhat realistic.
No need to do that. We worked it out in 1997 and until its Consoles end, it worked each and everytime.

Shouts

User avatar
inc^lightforce
Verified
Psy-Q Enthusiast
Psy-Q Enthusiast
Posts: 266
Joined: Mar 07, 2013
I am a: Programmer Windows+PS1, GFX Artist
PlayStation Model: Black
Location: Germany

Post by inc^lightforce » August 8th, 2024, 4:23 pm

YOU NEED HELP?

ASK....

I've SEEN, MY SCREENSHOT PROVIDER HAS CLOSED ITS DOORS :crying :(

SCREEN SHOTS NEEDED ? ... or SOMETHING ELSE ... ? ... LEAVE A MESSAGE
Shouts to all Coders these dayz

User avatar
masterg0r0
Active PSXDEV User
Active PSXDEV User
Posts: 66
Joined: Jul 18, 2021
I am a: Programmer
Motto: They see me rollin'
PlayStation Model: 7502

Post by masterg0r0 » August 10th, 2024, 5:40 am

inc^lightforce wrote: August 8th, 2024, 4:23 pm YOU NEED HELP?

ASK....

I've SEEN, MY SCREENSHOT PROVIDER HAS CLOSED ITS DOORS :crying :(

SCREEN SHOTS NEEDED ? ... or SOMETHING ELSE ... ? ... LEAVE A MESSAGE
Shouts to all Coders these dayz
Dang, that's a shame. You could always use alternatives like Imgur or ImgBB to upload screenshots.
PSX Dev. Console: SCPH-7502 (PAL), MM3, Xplorer with Caetla 0.38.

ienien32X
What is PSXDEV?
What is PSXDEV?
Posts: 1
Joined: Oct 31, 2023
PlayStation Model: SCPH-1002
Location: France

Post by ienien32X » February 23rd, 2025, 10:27 am

Hello, could we have a trainer version that is less complex than Alien Resurrection for beginners? I would really like to create a simple trainer to start with, that would be nice. Thanks!

User avatar
RokRacekSK
Curious PSXDEV User
Curious PSXDEV User
Posts: 18
Joined: Feb 01, 2025

Post by RokRacekSK » March 3rd, 2025, 6:03 am

inc^lightforce wrote: August 8th, 2024, 4:23 pm YOU NEED HELP?

ASK....

I've SEEN, MY SCREENSHOT PROVIDER HAS CLOSED ITS DOORS :crying :(

SCREEN SHOTS NEEDED ? ... or SOMETHING ELSE ... ? ... LEAVE A MESSAGE
Shouts to all Coders these dayz
why when i convert music with your tool (the tool from mod to obj) it doesnt create a file (Windows 7-bit) (and i tried windows 10 32-bit virtually but its the same

User avatar
inc^lightforce
Verified
Psy-Q Enthusiast
Psy-Q Enthusiast
Posts: 266
Joined: Mar 07, 2013
I am a: Programmer Windows+PS1, GFX Artist
PlayStation Model: Black
Location: Germany

Post by inc^lightforce » March 10th, 2025, 4:47 am

RokRacekSK wrote: March 3rd, 2025, 6:03 am
inc^lightforce wrote: August 8th, 2024, 4:23 pm YOU NEED HELP?

ASK....

I've SEEN, MY SCREENSHOT PROVIDER HAS CLOSED ITS DOORS :crying :(

SCREEN SHOTS NEEDED ? ... or SOMETHING ELSE ... ? ... LEAVE A MESSAGE
Shouts to all Coders these dayz
why when i convert music with your tool (the tool from mod to obj) it doesnt create a file (Windows 7-bit) (and i tried windows 10 32-bit virtually but its the same
please test with a real 32 bit system. I'm trying to recode that tool to get it work properly on all systems.

- start the tool
- load a real 4 channel *.mod
- now the converter play the modfile that you can listen to the file
- hit convert button and wait
- when finished: find the music.obj next to the tool's exe file

Reports welcome

User avatar
RokRacekSK
Curious PSXDEV User
Curious PSXDEV User
Posts: 18
Joined: Feb 01, 2025

Post by RokRacekSK » March 10th, 2025, 6:29 pm

inc^lightforce wrote: March 10th, 2025, 4:47 am
RokRacekSK wrote: March 3rd, 2025, 6:03 am
inc^lightforce wrote: August 8th, 2024, 4:23 pm YOU NEED HELP?

ASK....

I've SEEN, MY SCREENSHOT PROVIDER HAS CLOSED ITS DOORS :crying :(

SCREEN SHOTS NEEDED ? ... or SOMETHING ELSE ... ? ... LEAVE A MESSAGE
Shouts to all Coders these dayz
why when i convert music with your tool (the tool from mod to obj) it doesnt create a file (Windows 7-bit) (and i tried windows 10 32-bit virtually but its the same
please test with a real 32 bit system. I'm trying to recode that tool to get it work properly on all systems.

- start the tool
- load a real 4 channel *.mod
- now the converter play the modfile that you can listen to the file
- hit convert button and wait
- when finished: find the music.obj next to the tool's exe file

Reports welcome
"please test with a real 32 bit system" yes i tested it on the windows 7 32-bit (Real not VM) (already said) and it didnt do anything

User avatar
MasterLink
Serious PSXDEV User
Serious PSXDEV User
Posts: 83
Joined: Jul 20, 2024
I am a: Electronics repair, music and art.
Motto: Try it anyway, it might work.
PlayStation Model: DTL-H1001H
Location: USA

Post by MasterLink » March 11th, 2025, 4:18 am

RokRacekSK wrote: March 10th, 2025, 6:29 pm "please test with a real 32 bit system" yes i tested it on the windows 7 32-bit (Real not VM) (already said) and it didnt do anything
Well actually, you said "Windows 7-bit" and didn't specify 32 or 64 bit, then said Windows 10 32-bit in a VM. Not once did you actually properly type what you meant.
Screenshot 2025-03-10 131945.png
Please next time before saying "already said", that you did indeed, already say that.
You do not have the required permissions to view the files attached to this post.
PSXDev has a bot problem. If you see a random post with a stray pixel, don't click that pixel, it might be a hidden URL. REPORT it and be absolutely sure to mention where and how you found the hidden URL. Sometimes it's not in their sig, but hidden in quoted posts. If the report is declined, push back if you are 100% sure.

User avatar
RokRacekSK
Curious PSXDEV User
Curious PSXDEV User
Posts: 18
Joined: Feb 01, 2025

Post by RokRacekSK » March 11th, 2025, 5:11 am

MasterLink wrote: March 11th, 2025, 4:18 am
RokRacekSK wrote: March 10th, 2025, 6:29 pm "please test with a real 32 bit system" yes i tested it on the windows 7 32-bit (Real not VM) (already said) and it didnt do anything
Well actually, you said "Windows 7-bit" and didn't specify 32 or 64 bit, then said Windows 10 32-bit in a VM. Not once did you actually properly type what you meant.

Screenshot 2025-03-10 131945.png

Please next time before saying "already said", that you did indeed, already say that.
ok, yes im sorry i didnt see that i typed "Windows 7-32Bit" without the 32

User avatar
MasterLink
Serious PSXDEV User
Serious PSXDEV User
Posts: 83
Joined: Jul 20, 2024
I am a: Electronics repair, music and art.
Motto: Try it anyway, it might work.
PlayStation Model: DTL-H1001H
Location: USA

Post by MasterLink » March 11th, 2025, 5:41 am

RokRacekSK wrote: March 11th, 2025, 5:11 am ok, yes im sorry i didnt see that i typed "Windows 7-32Bit" without the 32
What CPU does the PC have? While I haven't used this utility nor do I know why it's having issues, considering they said test with a real 32-bit system, this infers a 32-bit only CPU as well perhaps (as Protected Mode on some 64-bit Long Mode x86/x64 CPU's may not run things the same as a true 32-bit x86).

Either way, is the .mod a four channel mod, or does it have more channels than four? Be sure to check all of their bullet points as they are crucial as well.

Are you still working with her3.mod? That is indeed a 4 channel mod.
Screenshot 2025-03-10 145828.png
You do not have the required permissions to view the files attached to this post.
PSXDev has a bot problem. If you see a random post with a stray pixel, don't click that pixel, it might be a hidden URL. REPORT it and be absolutely sure to mention where and how you found the hidden URL. Sometimes it's not in their sig, but hidden in quoted posts. If the report is declined, push back if you are 100% sure.

User avatar
RokRacekSK
Curious PSXDEV User
Curious PSXDEV User
Posts: 18
Joined: Feb 01, 2025

Post by RokRacekSK » March 11th, 2025, 6:33 am

MasterLink wrote: March 11th, 2025, 5:41 am
RokRacekSK wrote: March 11th, 2025, 5:11 am ok, yes im sorry i didnt see that i typed "Windows 7-32Bit" without the 32
What CPU does the PC have? While I haven't used this utility nor do I know why it's having issues, considering they said test with a real 32-bit system, this infers a 32-bit only CPU as well perhaps (as Protected Mode on some 64-bit Long Mode x86/x64 CPU's may not run things the same as a true 32-bit x86).

Either way, is the .mod a four channel mod, or does it have more channels than four? Be sure to check all of their bullet points as they are crucial as well.

Are you still working with her3.mod? That is indeed a 4 channel mod.
Screenshot 2025-03-10 145828.png
yes, still working on her3.mod and processor is Intel core 2 CPU T5500 1.66GHz
and i dont know if you saw it but i have this problem: viewtopic.php?f=75&t=3938&start=120 (and i dont know if it is by some "compilation" in the program itself (the program on the forum i gave url) or the conversion between .mod to .hit and .obj) (and i think .obj is for 3D models? so i dont understand it much but this isnt the main problem)

User avatar
MasterLink
Serious PSXDEV User
Serious PSXDEV User
Posts: 83
Joined: Jul 20, 2024
I am a: Electronics repair, music and art.
Motto: Try it anyway, it might work.
PlayStation Model: DTL-H1001H
Location: USA

Post by MasterLink » March 11th, 2025, 6:42 am

Intel Core 2 is a 64-bit CPU. (The original Core is 32-bit however). I honestly don't know to be honest with you beyond what's been said, I didn't write the tool.

.obj is an object file, organized machine code. Not always related to a 3D model. Take care not to confuse the two.
PSXDev has a bot problem. If you see a random post with a stray pixel, don't click that pixel, it might be a hidden URL. REPORT it and be absolutely sure to mention where and how you found the hidden URL. Sometimes it's not in their sig, but hidden in quoted posts. If the report is declined, push back if you are 100% sure.

User avatar
RokRacekSK
Curious PSXDEV User
Curious PSXDEV User
Posts: 18
Joined: Feb 01, 2025

Post by RokRacekSK » March 11th, 2025, 7:39 am

MasterLink wrote: March 11th, 2025, 6:42 am Intel Core 2 is a 64-bit CPU. (The original Core is 32-bit however). I honestly don't know to be honest with you beyond what's been said, I didn't write the tool.

.obj is an object file, organized machine code. Not always related to a 3D model. Take care not to confuse the two.
Did you look at the link? if yes do you have any idea why is it happening?

User avatar
inc^lightforce
Verified
Psy-Q Enthusiast
Psy-Q Enthusiast
Posts: 266
Joined: Mar 07, 2013
I am a: Programmer Windows+PS1, GFX Artist
PlayStation Model: Black
Location: Germany

Post by inc^lightforce » March 15th, 2025, 9:12 am

please let's discuss further here :arrow: :
https://www.psxdev.net/forum/viewtopic.php?f=75&t=4037

i just recode the tool for x64 Systems. See details here:
https://www.psxdev.net/forum/viewtopic.php?f=52&t=4297

I will run a test on my real Windows 7 x86 System this weekend and check some issues. Sometimes not all 4 Can MOD Files work with the PlayStation 1 Modplayer / Converter. Try other *.mod Files to check it out. If all is compatible, and PSYQ.ini correctly set, you will find the music.obj next to the Tool's exe.

so far, please head over to the Sound Converter Topic to discuss anything.
This is the Workshop and i wanna have it clean as possible. 👍

Thanks.

User avatar
inc^lightforce
Verified
Psy-Q Enthusiast
Psy-Q Enthusiast
Posts: 266
Joined: Mar 07, 2013
I am a: Programmer Windows+PS1, GFX Artist
PlayStation Model: Black
Location: Germany

Post by inc^lightforce » March 15th, 2025, 9:20 am

RokRacekSK wrote: March 11th, 2025, 6:33 am ... her3.mod ...but this isnt the main problem)
Please send over the: her3.mod file.

I will test it here...

Do not forget :!: , the tool does only convert 4 Channel Amiga SOUND FILES *.mod to a compatible Hitmod Player Sound File Object.

If you need Information and Examples for 3D objects, then keep in mind, this is another chapter.

I can post / will post Code examples near future in this workshop

User avatar
RokRacekSK
Curious PSXDEV User
Curious PSXDEV User
Posts: 18
Joined: Feb 01, 2025

Post by RokRacekSK » March 24th, 2025, 11:56 pm

inc^lightforce wrote: March 15th, 2025, 9:20 am
RokRacekSK wrote: March 11th, 2025, 6:33 am ... her3.mod ...but this isnt the main problem)
Please send over the: her3.mod file.

I will test it here...

Do not forget :!: , the tool does only convert 4 Channel Amiga SOUND FILES *.mod to a compatible Hitmod Player Sound File Object.

If you need Information and Examples for 3D objects, then keep in mind, this is another chapter.

I can post / will post Code examples near future in this workshop
i posted it on the other "forum": viewtopic.php?f=75&t=4037

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests