Skip to content

Instantly share code, notes, and snippets.

@psxdev
Created August 21, 2024 17:22
Show Gist options
  • Save psxdev/2f07a15d0b6c7c610c97e74bc4ff6c4e to your computer and use it in GitHub Desktop.
Save psxdev/2f07a15d0b6c7c610c97e74bc4ff6c4e to your computer and use it in GitHub Desktop.
playstation development on apple silicon
toolchain config
----------------------
- binutils 2.40
../binutils-2.40/configure --prefix=/usr/local/psxdev/mipsel-none-elf --target=mipsel-none-elf --disable-docs --disable-nls --disable-werror --with-float=soft
- gcc 14.1.0
../gcc-14.1.0/configure --prefix=/usr/local/psxdev/mipsel-none-elf --target=mipsel-none-elf --disable-docs --disable-nls --disable-werror --disable-libada --disable-libssp --disable-libquadmath --disable-threads --disable-libgomp --disable-libstdcxx-pch --disable-hosted-libstdcxx --enable-languages=c,c++ --without-isl --without-headers --with-float=soft --with-gnu-as --with-gnu-ld
ps1transfer
-----------
generate makefile from cbp using cbptomake first.
I am using macport so install sudo port install libftdi1
Change these variables in makefile to use the path for macport for libraries and in includes
INC = -I/opt/local/include/libftdi1/
LIBDIR = -L /opt/local/lib
psn00bsdk
---------
change in PSn00bSDK/libpsn00b/lzp/compress.c to avoid error for no function definition for malloc and free
#include <string.h>
#ifdef LZP_USE_MALLOC
#include <stdlib.h>
#else
void *malloc(size_t size);
void free(void *ptr);
#endif
build sample balls
------------------
% pwd
/usr/local/psxdev/share/psn00bsdk/examples/graphics/balls
% cmake --preset default .
Preset CMake variables:
CMAKE_BUILD_TYPE="Debug"
CMAKE_TOOLCHAIN_FILE:FILEPATH="/usr/local/psxdev/lib/libpsn00b/cmake/sdk.cmake"
PSN00BSDK_TARGET="mipsel-none-elf"
PSN00BSDK_TC=""
-- The C compiler identification is GNU 14.1.0
-- The ASM compiler identification is GNU
-- Found assembler: /usr/local/psxdev/mipsel-none-elf/bin/mipsel-none-elf-gcc
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/local/psxdev/mipsel-none-elf/bin/mipsel-none-elf-gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Configuring done (0.1s)
-- Generating done (0.0s)
-- Build files have been written to: /usr/local/psxdev/share/psn00bsdk/examples/graphics/balls/build
bigboss@siliconmini balls % cmake --build ./build
[3/3] Linking C executable balls.elf
load exe with ps1transfer
-------------------------
% ps1transfer -c -e -f build/balls.exe
PS1USB Transfer tool v1.0 by OrionSoft [2024]
Uploading 12288 bytes to 0x80010000...
2048 bytes remaining....
Executing...
Init GPU... psxgpu: setup done, default mode is NTSC
Done.
Set video mode... Done.
Upload texture... Done.
Calculating balls... Done.
Entering loop...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment