Hello there,
I was looking at Nocash PSX documentation and I noticed about the use of multi-threading in PSX games. I certainly know what multi-threading is and what advantages and disadvantages it brings, but... are there any known PSX commercial/homebrew game or app out there which actually made use of this?
Also, I was feeling curious about implementing some kind of multi-threading support on PSXSDK libs for some interesting purposes.
Multi-threading in PSX
for example you can run the game in a thread while you pay the audio track in another thread. Load assets while you playing a level for the next one, etc etc.
-
LameGuy64 Verified
- Psy-Q Enthusiast
- Posts: 388
- Joined: Apr 10, 2013
- I am a: Hobbyist Game Developer
- Motto: Commercial or not, play it!
- PlayStation Model: H2000/7000
- Location: Philippines
- Contact:
If I remember correctly, multi-threading on the PSX works kinda similar to how multi-threading works on modern platforms. You basically create a thread but you must switch to the thread you created with ChangeTh() in your main loop or a mini loop that switches between all the threads you've created.
I haven't tried multi-threading on the PSX much myself so I'm not sure what advantages it would bring as most of the stuff to perform things like playing streaming music in the background or executing a musical sequence is all done by the hardware or can be done with interrupts. It might be useful for doing things like animated loading screens or routines that need to be run in the background but are too complex to be run on interrupts.
If you want to see how multi-threading is done with the PsyQ or Programmer's Tool SDKs, look at the THREAD example included with the development kits.
I haven't tried multi-threading on the PSX much myself so I'm not sure what advantages it would bring as most of the stuff to perform things like playing streaming music in the background or executing a musical sequence is all done by the hardware or can be done with interrupts. It might be useful for doing things like animated loading screens or routines that need to be run in the background but are too complex to be run on interrupts.
If you want to see how multi-threading is done with the PsyQ or Programmer's Tool SDKs, look at the THREAD example included with the development kits.
Please don't forget to include my name if you share my work around. Credit where it is due.
Dev. Console: SCPH-7000 with SCPH-7501 ROM, MM3, PAL color fix, Direct AV ports, DB-9 port for Serial I/O, and a Xplorer FX with Caetla 0.35.
DTL-H2000 PC: Dell Optiplex GX110, Windows 98SE & Windows XP, Pentium III 933MHz, 384MB SDRAM, ATI Radeon 7000 VE 64MB, Soundblaster Audigy, 40GB Seagate HDD, Hitachi Lite-on CD-RW Drive, ZIP 250 and 3.5" Floppy.
Dev. Console: SCPH-7000 with SCPH-7501 ROM, MM3, PAL color fix, Direct AV ports, DB-9 port for Serial I/O, and a Xplorer FX with Caetla 0.35.
DTL-H2000 PC: Dell Optiplex GX110, Windows 98SE & Windows XP, Pentium III 933MHz, 384MB SDRAM, ATI Radeon 7000 VE 64MB, Soundblaster Audigy, 40GB Seagate HDD, Hitachi Lite-on CD-RW Drive, ZIP 250 and 3.5" Floppy.
-
Verified
- C Programming Expert
- Posts: 161
- Joined: Oct 06, 2012
- PlayStation Model: SCPH-5502
- Contact:
Sorry for reviving this, but I didn't realize this topic actually got responses.
In the case of animated loading screens, that's pretty much what my video game "Airport" is actually doing. Despite not creating a thread on its own, I'm abusing VBlank ISR so that, during loading screens, sprites are being sent to the GPU while the main loop is handling file data.
Not the most polite solution, but pretty quick to set up and works. However, it looks like fopen() doesn't like being interrupted, so the ISR must take this into account. Same thing when GPU is busy or a DMA transfer is being made.
In the case of animated loading screens, that's pretty much what my video game "Airport" is actually doing. Despite not creating a thread on its own, I'm abusing VBlank ISR so that, during loading screens, sprites are being sent to the GPU while the main loop is handling file data.
Not the most polite solution, but pretty quick to set up and works. However, it looks like fopen() doesn't like being interrupted, so the ISR must take this into account. Same thing when GPU is busy or a DMA transfer is being made.
I believe Glain et al. documented some stuff on multithreading at the FFHacktics wiki.
Who is online
Users browsing this forum: No registered users and 5 guests