Repository navigation
Releases
v0.9.2
A matching decompilation of the PlayStation BIOS: one source tree that builds all 25 known BIOS images byte for byte, from the DTL-H2000 development board to the PS one's v4.5, with the compiler Sony built them with (MIPS compilers 2.11 from Sony NEWS-OS 4.2.1R, recompiled natively by newscc). No ROM is needed to build; each image is checked against its SHA1.
What's new since 0.9.1
- 97.0% of functions match across all 25 images (was 95.7%). The shell is 95.3% matching (was 93.0%), the ROM code 99.3% and the kernel 100%. 76 distinct functions are left NON_MATCHING across all builds.
- Newly matching, among others: the GTE rotations (
RotMatrixX/Y/Z,gte_matrix_orthonormalize), libspu_spu_writeandspu_mem_dump, the disc check (disc_check_license,disc_poll_status,disc_read_sector),menu_setup_screenin 13 images,ring_make_slice,bmp_median9,tim_parse_header,bg_draw_random_gradient_quads,ptr_init_cursor_sprites, libmcrd_mcrd_result, and on the DTL-H2000boot_main,bp_cmd,install_bpsandremove_bps. - Shell code that had never had a focused pass: much of the v4.x sound scope (
scope.c), the v4.1 and PS one pad poller, display-buffer setup and card header loader, and the European grid and card icon code. docs/codegen-patterns.mdgained the source forms behind these: skip-with-continueloops, constants shared only between uses of the same type, reusing a local after its value is dead, one colour macro per source line, and more.- Every
--non-matchingdraft build still links, for all 25 images.
Build
psx-bios-decomp-v0.9.2.zip is the source plus newscc (a submodule in git) and newscc's prebuilt toolchains for macOS arm64, Linux x86-64 and Linux arm64, so nothing else needs fetching:
unzip psx-bios-decomp-v0.9.2.zip && cd psx-bios-decomp-v0.9.2
python3 -m venv .venv && .venv/bin/pip install pyyaml rabbitizer
./configure.py && ninja # -> build/scph5501.bin: OK
tools/buildall.sh # all 25GitHub's automatic "Source code" archives don't include the newscc submodule or the toolchains; use the ZIP above.
Known issues: on Linux, don't build under /tmp (newscc's compilers can't read sources there); a checkout path longer than about 100 characters breaks the build (the compiler's line numbers go wrong).
v0.9.1
A matching decompilation of the PlayStation BIOS: one source tree that builds all 25 known BIOS images byte for byte, from the DTL-H2000 development board to the PS one's v4.5, with the compiler Sony built them with (MIPS compilers 2.11 from Sony NEWS-OS 4.2.1R, recompiled natively by newscc). No ROM is needed to build; each image is checked against its SHA1.
What's new since 0.9.0
- 95.7% of functions match across all 25 images (was 94.7%). The ROM code is 99.3% matching (was 96.6%), and the kernel stays 100%. In the retail BIOSes' ROM code, one function (
cdfs_read_pvd) is left; the rest of the ROM's remainder is development-board code. - Nine ROM functions (
atoi,card_mount,card_check_chain,dev_card_open,dev_card_undelete,qsort_sub,heap_resize,cd_toc_gettn,cd_toc_gettd) match in every build thanks to the source forms in shoui520's matching decompilation of the PSP's PS1 BIOS (psp2), built with the same compiler and shared in #4. What they taught us is indocs/codegen-patterns.md. - First outside contribution: garrettjwilke's #3 (five shell and library functions matched, plus many documented dead ends).
- More matches in the shells:
ptr_poll_pad(every shell up to v4.0),menu_poll_card_status(v1.0J), andobj_init_from_packed_image(v1.1J, US v2.0), which had missing#ifdefs rather than codegen problems. - Every
--non-matchingbuild links, for all 25 images: the C drafts of the functions that don't match yet are built in place of the original code, for testing them. Newtools/nmfit.pychecks before each link that the drafts fit the ROM's layout and names any that grew. Drafts that outgrew the original were shrunk; missing draft-only symbols were placed from each shell's own code. SCPH-5501's draft build boots identically to the original in DuckStation. - Fixes: SCPH-5501's
SetDefDrawEnv/SetDefDispEnvsymbols were swapped; US v2.0'sdisc_license_textpointed at a CD player buffer.
Build
psx-bios-decomp-v0.9.1.zip is the source plus newscc (a submodule in git) and newscc's prebuilt toolchains for macOS arm64, Linux x86-64 and Linux arm64, so nothing else needs fetching:
unzip psx-bios-decomp-v0.9.1.zip && cd psx-bios-decomp-v0.9.1
python3 -m venv .venv && .venv/bin/pip install pyyaml rabbitizer
./configure.py && ninja # -> build/scph5501.bin: OK
tools/buildall.sh # all 25GitHub's automatic "Source code" archives don't include the newscc submodule or the toolchains; use the ZIP above.
Known issues: on Linux, don't build under /tmp (newscc's compilers can't read sources there); a checkout path longer than about 100 characters breaks the build (the compiler's line numbers go wrong).
v0.9.0
A matching decompilation of the PlayStation BIOS: one source tree that builds all 25 known BIOS images byte for byte, from the DTL-H2000 development board to the PS one's v4.5, with the compiler Sony built them with (MIPS compilers 2.11 from Sony NEWS-OS 4.2.1R, recompiled natively by newscc). No ROM is needed to build; each image is checked against its SHA1.
- 94.7% of functions match across all 25 images; the kernel is 100% matching C in every image. The rest are C drafts (
NON_MATCHING) whose original code the build splices in, each a self-contained task (tools/nmstatus.py). - Code that Sony didn't build with this toolchain (the PsyQ-built sound scope graphics of the v4.x shells, SCPH-5903's Video CD module) is committed as data.
psx-bios-decomp-v0.9.0.zip is the source plus newscc (a submodule in git) and newscc's prebuilt toolchains for macOS arm64, Linux x86-64 and Linux arm64, so nothing else needs fetching:
unzip psx-bios-decomp-v0.9.0.zip && cd psx-bios-decomp-v0.9.0
python3 -m venv .venv && .venv/bin/pip install pyyaml rabbitizer
./configure.py && ninja # -> build/scph5501.bin: OK
tools/buildall.sh # all 25GitHub's automatic "Source code" archives don't include the newscc submodule or the toolchains; use the ZIP above.