PSn00bSDK - Open Source PS1 SDK That Doesn't Suck

Start a work log and update it occasionally with your projects progress
User avatar
LameGuy64
Verified
Psy-Q Enthusiast
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:

PSn00bSDK - Open Source PS1 SDK That Doesn't Suck

Post by LameGuy64 » May 14th, 2019, 12:12 pm

Image

As the name suggests, this is an amateur PS1 SDK project of my very own creation. I guess I've gotten so good at programming the PS1 that I ended up making my own SDK for the console :).

Unlike other open source SDK projects for the PS1 that have come and gone, the main goal of the PSn00bSDK project is to develop a 100% open source SDK for the PS1 that tries to be on-par to the official SDK in terms of hardware support as possible. While PSn00bSDK is still a work in progress, earlier iterations of it it was fit enough to create n00bdemo as it already has the best graphics and 3D support compared to other SDK projects that I'm aware of.

Other components such as SPU, MDEC, and better CD-ROM support have yet to be implemented so proper homebrew games that utilize the hardware properly can be made with this SDK. But after several updates, it should be fit enough to make some interesting things with this SDK now that controllers and basic CD-ROM support have since been implemented.

Another neat thing about PSn00bSDK is that it follows the same library syntax as the official SDK as closely as possible not only for familiarity reasons but also to make it easier to port existing homebrew over to PSn00bSDK with little to no modifications, provided the functions it depends on have been implemented.

Screenshot of n00bdemo taken from pSX/psxfin:
Image

Video on PSn00bSDK focusing on the early development process of this project:


Webpage (has a precompiled Win32 build of the GNU GCC 7.4.0 compiler and internal SVN repository):
http://lameguy64.net/?page=psn00bsdk

Github repo (has more info and build instructions):
https://github.com/Lameguy64/PSn00bSDK
You do not have the required permissions to view the files attached to this post.
Last edited by LameGuy64 on November 18th, 2019, 12:27 pm, edited 3 times in total.
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.

mrhaboobi
Active PSXDEV User
Active PSXDEV User
Posts: 59
Joined: Nov 18, 2012

Post by mrhaboobi » May 17th, 2019, 9:54 am

watching with interest

User avatar
LameGuy64
Verified
Psy-Q Enthusiast
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:

Post by LameGuy64 » May 18th, 2019, 11:28 am

I just got controllers working using BIOS controller functions which are implemented as _PadInit(), _PadStart() and _PadStop() in the psxapi library. The advantage of using this is it automatically polls the controller data on every vsync but the downside is you can't send data to the controller yet to activating analog mode on the controllers in software or controlling the vibrators. But you can read controller data from pretty much any controller (except the justifier) with it.

The implementation is up on my SVN repo along with a prototype program to demonstrate it working. I haven't put it up on my github repo yet as I need to do some testing first.

EDIT: Seems my crappy RPi based server has gone read only mode again, preventing me from committing the latest code. I'll get this sorted out and it should hopefully be up by tomorrow for good measure.
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.

jype
Interested PSXDEV User
Interested PSXDEV User
Posts: 8
Joined: May 19, 2019

Post by jype » May 19th, 2019, 7:14 am

Wow, awesome! I've wished for a better open-source alternative to PSYQ and PSXSDK.

I built the PSn00bSDK and tried out examples on an emulator, n00bdemo was really cool.
The demos worked with epsxe, but hang in ResetGraph with pcsxr. Any idea why this happens?

User avatar
LameGuy64
Verified
Psy-Q Enthusiast
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:

Post by LameGuy64 » May 20th, 2019, 12:12 am

Likely has something to do with how I'm currently hooking the VSync handler using the PS1 kernel's event system which is not exactly a good way of dealing with VSync IRQs as acknowledging the interrupt there breaks things like BIOS controller support which depends on the VBlank IRQ. PCSXR's high level BIOS clone likely doesn't emulate the VBlank event properly but I've recently got a new handling scheme working that's exactly the same as that used in the official SDK.

Though it would take me a bit of time to have it implemented in the main branch on Github but you can get early access to it via my SVN branch albeit a bit messy.
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.

jype
Interested PSXDEV User
Interested PSXDEV User
Posts: 8
Joined: May 19, 2019

Post by jype » May 20th, 2019, 1:14 am

You were right, all examples worked on pcsxr when not using the HLE bios. Nice!

User avatar
LameGuy64
Verified
Psy-Q Enthusiast
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:

Post by LameGuy64 » May 24th, 2019, 11:42 am

Just pushed an update to the main Github repository that adds controller and CD-ROM support using BIOS functions.
Relevant functions for controllers are _PadInit(), _PadStart() and _PadStop() and relevant functions for controllers and _InitCd() is for CD-ROM which basically wraps _96_init() with some additional code that prevents the function from clearing other DMA settings. An RGB24 and bare metal cartridge ROM examples have also been added.

To access files from CD using the BIOS CD-ROM driver use open(), read() and close() with a path name leading with cdrom: (ie. cdrom:/myfile.dat).
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.

paulm
Curious PSXDEV User
Curious PSXDEV User
Posts: 18
Joined: Jun 06, 2019
Location: milkyway

Post by paulm » June 6th, 2019, 9:52 am

My only issue with these projects is that many open SDK projects just never get finished because its such a huge task. I think using the same API as PSYQ is a very good idea as people can just recompile with your SDK to use fully open code.

I wish you luck!

User avatar
LameGuy64
Verified
Psy-Q Enthusiast
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:

Post by LameGuy64 » June 6th, 2019, 5:17 pm

I'll try my best to keep working on this SDK for as long as I can. I want to make this SDK at least functional enough to make some interesting things with such as getting low-level CD-ROM and better SPU support working.
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.

User avatar
LameGuy64
Verified
Psy-Q Enthusiast
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:

Post by LameGuy64 » June 14th, 2019, 8:10 pm

Lately, I've managed to implement a global interrupt service routine handler that makes handling interrupts a lot easier and Serial I/O support onto PSn00bSDK. Hopefully, I'll be releasing these updates by next week.

You can find more details about it here.
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.

paulm
Curious PSXDEV User
Curious PSXDEV User
Posts: 18
Joined: Jun 06, 2019
Location: milkyway

Post by paulm » June 16th, 2019, 4:07 am

Nice work - even if it takes years to complete it will be pretty nice to have a modern api level PSYQ replacement!

User avatar
LameGuy64
Verified
Psy-Q Enthusiast
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:

Post by LameGuy64 » July 1st, 2019, 3:13 pm

I pushed an update last week that adds the aforementioned features to PSn00bSDK. The Serial I/O support also includes a SIOCONS tty driver replacement for not outputting printf messages to serial but also to receive tty input from serial using a serial terminal and gets() and getchar() functions.

I've been working on implementing C++ support lately but I'd only go as far as implementing support for classes and dynamically creating and deleting class objects just like the official SDK. I don't plan to implement stdc++ stuff as those would be too bloated to be on the PS1.

I also managed to port over my LITELOAD loader to PSn00bSDK. I only had to do a few modifications to it but the serial receive logic worked right off the bat.
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.

Misscelan
Curious PSXDEV User
Curious PSXDEV User
Posts: 21
Joined: Dec 11, 2016

Post by Misscelan » July 1st, 2019, 10:45 pm

Great job! Hoping I have some time to fiddle with it soon :)

User avatar
LameGuy64
Verified
Psy-Q Enthusiast
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:

Post by LameGuy64 » July 15th, 2019, 8:51 pm

I've made quite a bit of progress on PSn00bSDK as of late, mainly C++ support which I'm going to push out in the next commit, along with a few bug fixes which I've ran into after further testing on real hardware. I've also done a bit of restructuring to make it a bit more convenient to compile and updated the build instructions for MSys2 to those using my SDK in Windows.

The biggest bit of progress I've made by far however is figuring out getting direct CD-ROM control working, and I've managed to play CD Audio tracks with it. The prototype implementation is pretty bare bones at the moment so its going to take awhile for it to become available in PSn00bSDK, but at least I've made some progress in getting direct CD-ROM stuff working so CD and XA Audio playback would be possible.
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.

mrhaboobi
Active PSXDEV User
Active PSXDEV User
Posts: 59
Joined: Nov 18, 2012

Post by mrhaboobi » July 16th, 2019, 9:41 am

You will love this request. Can you port it to .net :) lol.. im going to have to get back up to speed with c.. as ive been dabbling with XNA/monogame more than yaroze/psx. is your compiler windows native? eg not having to run a linux shell?

paulm
Curious PSXDEV User
Curious PSXDEV User
Posts: 18
Joined: Jun 06, 2019
Location: milkyway

Post by paulm » July 17th, 2019, 4:48 am

The compiler is GCC so unless you can some how transpile some C# to C it ain't gonna work.

User avatar
LameGuy64
Verified
Psy-Q Enthusiast
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:

Post by LameGuy64 » July 18th, 2019, 11:21 am

I do not have any plans on adding C# support into my SDK, and I don't have much experience in C# to get a Mono to target the PS1. I don't see the point of supporting it since C/C++ is generally preferred on PS1 development.

Meanwhile, I finally published a commit yesterday that adds the long awaited basic C++ support along with a bunch of useful fixes. The CD-ROM stuff is still in very basic prototype form and is not available in the main repo. Prototype code can be found in the SVN repo on my website for anyone who wants to get CD stuff working on their own.

Edit: I've just thrown in a new FPS example to my SDK, which should solve most 3D graphics questions on the PS1 right off the bat when using my SDK. Also has some analog controller stuff as well.
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.

User avatar
Punch
Interested PSXDEV User
Interested PSXDEV User
Posts: 8
Joined: Aug 25, 2019

Post by Punch » August 25th, 2019, 2:25 pm

Hi guys, first post here. Just found out about your SDK, it's wonderful that someone is actually working in a fully featured replacement to Sony's stuff which was always a turn off for myself (it IS illegal to use it, let's not kid ourselves here).

Information is a little bit hard to find since it's not consolidated everywhere but I'm picking up stuff here and there. Managed to setup the SDK and compile the examples on Windows, can't wait to start digging into code. I'll probably try to port my NES game or do something else, but needless to say I'm very thankful for your work. Keep at it!

User avatar
LameGuy64
Verified
Psy-Q Enthusiast
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:

Post by LameGuy64 » October 11th, 2019, 9:44 pm

Just pushed out an update that adds FntOpen(), FntPrint() and FntFlush() functions and a bunch of small fixes today. I recommend reading the changelog in the repo for more details.

Development on this SDK is still going so far, despite this project being mostly quiet.
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.

User avatar
LameGuy64
Verified
Psy-Q Enthusiast
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:

Post by LameGuy64 » November 18th, 2019, 12:15 pm

Been working semi full-force on the long awaited CD-ROM library for PSn00bSDK that doesn't just use the limited BIOS routines. I managed to get CD IRQ handling and command processing down pat that I got CD track querying and CD audio playback working very reliably. I've also got CD data read stuff working as well so once I've polished things enough and implemented ISO file system support, PSn00bSDK can make full use of the CD-ROM subsystem.

Data streaming with XA audio should be possible with libpsxcd by writing your own stream handling routines which shouldn't be too difficult as the library will provide the necessary callbacks and functions for handling and fetching incoming data sectors. You'll have to devise your own streaming data format however in the meantime as I haven't decided on a format yet and priority is on being able to read files off CD and play CD-DA or CD-XA tracks. FMVs won't be supported for awhile as I need to get MDEC stuff working first to be able to accomplish that.

Post on my website
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.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests