Once you have picked your SDK of choice, you will want to set up your development environment according to the SDK of your choice. Most people will recommend using Visual Studio Code or its libre variant, VSCodium (some extensions are not available on VSCodium).
If you are using either of these editors, then you should also consider these extensions:
Native Debug - Required - Allows GDB debugging of MIPS software on your development machine.
PSX.dev - Recommended - This extension sets up an entire development chain all within your code editor! It allows you to select your SDK and it will create a functional development and debugging environment for you.
clangd - Recommended - Requires clang to be installed and in your path. Is a much more efficient compiler and allows for much faster auto-completion results.
MIPS Support - Optional - Allows for basic MIPS colorization and snippets support when looking at MIPS assembly.
CMake Tools - Optional - Requires CMake to be installed and in your path. Adds integrated CMake support and automatic configuration of your build process, should you wish. CMake is used by some folk and not by others. It is recommended to use CMake Tools if you are using a project that is built with CMake.
Clang-Format - Optional - Requires Clang-Format to be installed and in your path. A clean code base is a happy code base. Can be configured to auto format documents to follow with code tidiness conventions.
psioniq File Header - Optional - If you want to have a configurable header that includes items like creation date, last modification date, author of the editor, or perhaps you just want each new file to have your chosen license file blurb in the header, this can be of use.
Once that is all sorted, read the following Do's and Don't's of PSX development!
Below is a few quick points about PlayStation 1 development you may want to be aware of before you start!
Let's start off with a few statements:
Psy-Q is the official SDK for the PlayStation 1 by Psygnosis and Sony. It is also incredibly buggy and badly designed. The SDK was made in a rush and is not made to a good standard. Many users will start off fine with Psy-Q and then hit a major problem and not understand what is wrong. Sure enough, the problem is within the SDK itself! It has a notorious reputation for being buggy and the only reason it continued to be used was because as a PS1 development licensee, you were required to build your software with Psy-Q.
If you use Psy-Q, you will run into troubles, and you will be told "you were warned"! You will likely need to write your own routines in any case so there's little reason since you can absolutely make a better driver!
With all of these reasons, it's strongly discouraged to use Psy-Q for a new project.
Much like the SDK, the BIOS is problematic. At best, the code resides on an 8-bit ROM so it runs slowly (takes 4 read cycles per instruction), now this could be mitigated by using the shadow copy of the kernel loaded into RAM by the kernel, however; at worst, functions are completely broken. Sony would "fix" these issues with BIOS kernels by including patches with Psy-Q that were loaded at runtime and ran instead. The only reason you might want to use the BIOS routines is for compatibility with the PS2 backwards compatibility¹.
Seriously, you don't need to! And in fact, unless you want to experience the period accurate experience (read pain and frustration, add a deadline to complete the experience). There is no need to use the original tools, and chances are that if you are not planning to use the original ISA/PCI dev kits, you are just trading convenience away.
Still not convinced? Most people do not use Psy-Q or old equipment, so your support will be limited! This option should be only taken if you really understand what you are doing.
The current recommended SDK to use is PSYQo which is modern, re-written in C++ 20 and is currently maintained. There's also psx-splash which is Unity driven. The benefits of these two is that they are currently supported by the maintainers and are designed to be more developer friendly. They also work on Windows, macOS and Linux! They run on any computer made within the last decade.
All of these emulators are far from accurate to the PlayStation and once you have made a game and it works fine on these emulators, you might find that it will not run on a real PlayStation! Emulators generally do not enforce restrictions except in case it would break existing games. These lack of restrictions mean that when you code around them, you are not considering them! Use an accurate emulator like DuckStation which does enforce these restrictions and always test on real hardware before releasing your game! In fact...
Testing on real hardware is an essential step any developer should take. You can test on real hardware using two main approaches:
Using a mod chipped PlayStation and running a CD-ROM with your game on it.²
Using a Parallel IO cartridge (Xploder or similar, sub-9000 models) which has been flashed with Unirom to it and then you can use NOPS to upload from the dev PC to PlayStation 1 over Serial I/O (SIO1). You can make your own interface cable for this: https://unirom.github.io/serial_psx_cable/
If you need extra assets, then you need to either bundle them into your PS-EXE at build time or you need to have an asset CD-ROM which contains your files. Read the hardware bullet points if you are going to make any CD!
Do what now? Yes, really! The PlayStation can be (and arguably should be) treated like an embedded system with a GPU attached. How come? The system architecture is "raw". There is a "kernel" and a BIOS, but outside of C stdlib functions and a handful of drivers for the CD-ROM drive and controller bus, there is no operating system. But even more so, you are talking to hardware almost directly. Imagine an Arduino UNO and attaching an SSD1306 screen and you'd not be far from how the PS1 works. It also is starved of CPU power like a ATmega328 based Arduino so you want things to run fast and efficiently!
Unlike an Arduino UNO, the MIPS R3000 based CPU in the PlayStation has hardware support for debugging CPU code. This means that instead of using a serial port and logs, you can directly step into the program and stop execution, read memory and set watch/breakpoints. This is incredibly useful for development and should not be ignored. This can be achieved by using Unirom and Serial I/O (SIO1) to USB cable.
When debugging incremental updates, it is generally recommended to use PCSX-Redux for GDB debugging the main core of code and DuckStation for everything else. DuckStation is the most accurate emulator, whilst PCSX-Redux has a great GDB server. Once your main program loop is working how you expect, you should do testing on DuckStation to make sure things like your audio is playing correctly and how you expect, as PCSX-Redux currently is not as fully featured.
Sony infamously hid a lot of the hardware details and did not document them in their official programming manuals, instead insisting that you used Psy-Q to access the hardware. Nowadays, it is instead recommended to read through https://psx-spx.consoledev.net/ for hardware documentation.
Sound is ADPCM and red book CD Audio only. You can use XA-ADPCM but there are some things to note
Textures are usually in TIM but this is just an indexed 4/8-bit bitmap image with metadata
The GPU has no built in geometry transformation stages, that's implemented using the GTE of the CPU to accelerate the maths involved
Video is 16-bit max in most cases. GPU can do 24-bit but you're pretty much software rendering by that point.
CD-ROM is slow and really screwy to use - container archives and low file count is recommended.
The BIOS only reads the first 2048-byte sector of each directory, so it sees about 30 files per directory at most - use subfolders.
That limit applies to subfolders too, so pack files into archives where you can.
Unless you are needing XA-ADPCM, you can get away with a standard ISO9660 file for testing, but you need 2352 sector bin/cue images when using XA-ADPCM. You also should embed the logo and license data into the header which can be done with mkpsxiso
PS1 executables must be named PSX.EXE and be in the root of the disc or you need to specify a SYSTEM.CNF file to relocate and rename the binary (https://problemkaputt.de/psxspx-cdrom-file-playstation-exe-and-system-cnf.htm)
The PlayStation 2 famously included backwards compatibility support for the PlayStation 1, and you'll often see it said that this is hardware compatible. "Excellent!" you might say.
Be warned, at best this is misleading, at worst, its a myth!
"W... Wha?" - Yes. The only two parts included in the PlayStation 2 were the MIPS R3000 CPU+GTE core, which acts as the PlayStation 2's IOP (I/O Processor), and the PlayStation SPU - by way of an upgraded module essentially consisting of two SPU's glued together. Ok, not literally.
Where's the GPU? It's emulated! Where's the BIOS? It's also been rewritten to handle this compatibility mode! What does it mean for you? Well, your game might run perfectly fine on the PlayStation 1 but fail to run or run properly on the PlayStation 2. This is completely fine and normal. Not even all original PlayStation 1 games will run correctly on the PlayStation 2!
But wait, it gets worse! Later PlayStation 2 Slim (Deckard) models replace the MIPS R3000 based CPU with a PowerPC core and emulate the MIPS CPU on the PowerPC core for both PlayStation 2 and PlayStation 1 software, and as you might expect, this breaks things even more. Not even some PlayStation 2 games work correctly with this model!
This was documented by Sony in these technical notes which you can find here.
Naturally you'd expect the PlayStation 1 to be fine with CD-ROMs. And you'd be mostly right. However CD-Recordables have always been a sore spot for the PlayStation 1. Due to the cost cutting design of the PlayStation 1, the CD-ROM drive is much less sensitive to changes in the CD-ROM media when reading and thus it is more prone to dust, weak lasers or even CD-Rs. Because of this, you can end up in situations where:
You cannot read a particular brand of CD-R.
You cannot read any CD-Rs.
You can read CD-Rs but not PlayStation format discs.
You can read some PlayStation format discs and some CD-Rs.
You can read both media types.
You can't read any media types.
As covered in Commercial Homebrew, you can adjust the laser pickup to account for this and this will sometimes help, but it is always a tradeoff where you might trade-off from reading PlayStation format discs and be able to read CD-Rs, but this will always be at risk of significantly reducing the life span of the laser diode. For development, an Optical Drive Emulator (ODE) might be more beneficial for testing with, or using another tech like PC-Drive or perhaps streaming data from a CH375 attached to the Parallel I/O port.