summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi.dcr@tutanota.com>2020-11-07 16:30:41 +0100
committerXavier Del Campo Romero <xavi.dcr@tutanota.com>2020-11-07 16:31:06 +0100
commit468468633e2b07e39d3edeb169a1924d4c4ce773 (patch)
tree3799951520ecb7415a4fd277800b0ee844bd7c43
First commit
-rw-r--r--.gitignore2
-rw-r--r--CMakeLists.txt30
-rw-r--r--cdimg/system.cnf4
-rw-r--r--src/main.c6
4 files changed, 42 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..6f31401
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+build/
+.vscode/
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..3c98b7c
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,30 @@
+cmake_minimum_required(VERSION 3.0)
+
+if("$ENV{PSXSDK_PATH}" STREQUAL "")
+ message(FATAL_ERROR "Please set PSXSDK_PATH env variable first")
+endif()
+
+set(CMAKE_C_COMPILER psx-gcc)
+set(CMAKE_CXX_COMPILER psx-g++)
+set(CMAKE_SYSTEM_NAME Generic)
+set(CMAKE_CROSSCOMPILING 1)
+
+project(pinboid C)
+
+add_executable(${PROJECT_NAME}
+ "src/main.c"
+)
+target_link_directories(${PROJECT_NAME} PUBLIC $ENV{PSXSDK_PATH}/lib)
+target_compile_options(${PROJECT_NAME} PUBLIC -DFIXMATH_FAST_SIN -D_PAL_MODE_
+ -DPSXSDK_DEBUG -DNO_CDDA -DNO_INTRO -Wall -g3 -Og)
+target_link_libraries(${PROJECT_NAME} PUBLIC -lpsx -lfixmath)
+target_include_directories(${PROJECT_NAME} PRIVATE . $ENV{PSXSDK_PATH}/include)
+set(cdroot cdimg)
+add_custom_target(exe ALL elf2exe ${PROJECT_NAME}
+ ${cdroot}/${PROJECT_NAME}.exe -mark="A homebrew game created with PSXSDK"
+ DEPENDS ${PROJECT_NAME})
+add_custom_target(iso ALL mkisofs -o ${PROJECT_NAME}.iso -V ${PROJECT_NAME}
+ -sysid PLAYSTATION ${cdroot} DEPENDS exe)
+set(license $ENV{PSXSDK_PATH}/share/licenses/infoeur.dat)
+add_custom_target(bin_cue ALL mkpsxiso ${PROJECT_NAME}.iso ${PROJECT_NAME}.bin
+ ${license} -s DEPENDS iso)
diff --git a/cdimg/system.cnf b/cdimg/system.cnf
new file mode 100644
index 0000000..8780f94
--- /dev/null
+++ b/cdimg/system.cnf
@@ -0,0 +1,4 @@
+BOOT = cdrom:\pinboid.exe;1
+TCB = 4
+EVENT = 8
+STACK = 801FF800
diff --git a/src/main.c b/src/main.c
new file mode 100644
index 0000000..974ac09
--- /dev/null
+++ b/src/main.c
@@ -0,0 +1,6 @@
+#include <stdlib.h>
+
+int main(void)
+{
+ return 0;
+}