Page 1 of 2

PSn00bSDK - Open Source PS1 SDK That Doesn't Suck

Posted: May 14th, 2019, 12:12 pm
by LameGuy64
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

Re: PSn00bSDK - My very own PS1 SDK project

Posted: May 17th, 2019, 9:54 am
by mrhaboobi
watching with interest

Re: PSn00bSDK - My very own PS1 SDK project

Posted: May 18th, 2019, 11:28 am
by LameGuy64
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.

Re: PSn00bSDK - My very own PS1 SDK project

Posted: May 19th, 2019, 7:14 am
by jype
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?

Re: PSn00bSDK - My very own PS1 SDK project

Posted: May 20th, 2019, 12:12 am
by LameGuy64
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.

Re: PSn00bSDK - My very own PS1 SDK project

Posted: May 20th, 2019, 1:14 am
by jype
You were right, all examples worked on pcsxr when not using the HLE bios. Nice!

Re: PSn00bSDK - My very own PS1 SDK project

Posted: May 24th, 2019, 11:42 am
by LameGuy64
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).

Re: PSn00bSDK - My very own PS1 SDK project

Posted: June 6th, 2019, 9:52 am
by paulm
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!

Re: PSn00bSDK - My very own PS1 SDK project

Posted: June 6th, 2019, 5:17 pm
by LameGuy64
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.

Re: PSn00bSDK - My very own PS1 SDK project

Posted: June 14th, 2019, 8:10 pm
by LameGuy64
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.

Re: PSn00bSDK - My very own PS1 SDK project

Posted: June 16th, 2019, 4:07 am
by paulm
Nice work - even if it takes years to complete it will be pretty nice to have a modern api level PSYQ replacement!

Re: PSn00bSDK - My very own PS1 SDK project

Posted: July 1st, 2019, 3:13 pm
by LameGuy64
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.

Re: PSn00bSDK - My very own PS1 SDK project

Posted: July 1st, 2019, 10:45 pm
by Misscelan
Great job! Hoping I have some time to fiddle with it soon :)

Re: PSn00bSDK - My very own PS1 SDK project

Posted: July 15th, 2019, 8:51 pm
by LameGuy64
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.

Re: PSn00bSDK - My very own PS1 SDK project

Posted: July 16th, 2019, 9:41 am
by mrhaboobi
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?

Re: PSn00bSDK - My very own PS1 SDK project

Posted: July 17th, 2019, 4:48 am
by paulm
The compiler is GCC so unless you can some how transpile some C# to C it ain't gonna work.

Re: PSn00bSDK - My very own PS1 SDK project

Posted: July 18th, 2019, 11:21 am
by LameGuy64
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.

Re: PSn00bSDK - My very own PS1 SDK project

Posted: August 25th, 2019, 2:25 pm
by Punch
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!

Re: PSn00bSDK - My very own PS1 SDK project

Posted: October 11th, 2019, 9:44 pm
by LameGuy64
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.

Re: PSn00bSDK - My very own PS1 SDK project

Posted: November 18th, 2019, 12:15 pm
by LameGuy64
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