aboutsummaryrefslogtreecommitdiff
path: root/examples/system
diff options
context:
space:
mode:
authorspicyjpeg <thatspicyjpeg@gmail.com>2022-08-12 11:27:55 +0200
committerspicyjpeg <thatspicyjpeg@gmail.com>2022-08-12 11:27:55 +0200
commitedb967394d22420c9aaad529862a670c016cc2c7 (patch)
treea18b6062eedda22d2c1aabb852d2c633199cce2c /examples/system
parent7abb3b78727c8d4672197951e62b1c5916b3a54a (diff)
downloadpsn00bsdk-edb967394d22420c9aaad529862a670c016cc2c7.tar.gz
Replace ball16c.h headers in examples with .TIM files
Diffstat (limited to 'examples/system')
-rw-r--r--examples/system/childexec/CMakeLists.txt1
-rw-r--r--examples/system/childexec/ball16c.h16
-rw-r--r--examples/system/childexec/ball16c.timbin0 -> 192 bytes
-rw-r--r--examples/system/childexec/child/child.c10
-rw-r--r--examples/system/childexec/parent.c10
-rw-r--r--examples/system/console/CMakeLists.txt4
-rw-r--r--examples/system/console/ball16c.h16
-rw-r--r--examples/system/console/ball16c.timbin0 -> 192 bytes
-rw-r--r--examples/system/console/main.c16
-rw-r--r--examples/system/dynlink/CMakeLists.txt4
-rw-r--r--examples/system/dynlink/library/ball16c.h16
-rw-r--r--examples/system/dynlink/library/ball16c.timbin0 -> 192 bytes
-rw-r--r--examples/system/dynlink/library/balls.c5
13 files changed, 28 insertions, 70 deletions
diff --git a/examples/system/childexec/CMakeLists.txt b/examples/system/childexec/CMakeLists.txt
index b781dea..7e91589 100644
--- a/examples/system/childexec/CMakeLists.txt
+++ b/examples/system/childexec/CMakeLists.txt
@@ -17,6 +17,7 @@ psn00bsdk_add_executable(parent STATIC ${_sources})
psn00bsdk_add_executable(child STATIC ${_child_sources})
#psn00bsdk_add_cd_image(childexec_iso childexec iso.xml DEPENDS parent)
+psn00bsdk_target_incbin(parent PRIVATE ball16c ball16c.tim)
psn00bsdk_target_incbin(
parent PRIVATE child_exe
${PROJECT_BINARY_DIR}/child.exe
diff --git a/examples/system/childexec/ball16c.h b/examples/system/childexec/ball16c.h
deleted file mode 100644
index c79f273..0000000
--- a/examples/system/childexec/ball16c.h
+++ /dev/null
@@ -1,16 +0,0 @@
-unsigned int ball16c_size=192;
-unsigned char ball16c[] = {
-0x10,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x2c,0x00,0x00,0x00,0xc0,0x03,0x10,
-0x01,0x10,0x00,0x01,0x00,0x00,0x00,0x31,0xc6,0x73,0xce,0x94,0xd2,0x07,0x9d,
-0xd6,0xda,0x38,0xe3,0xef,0xbd,0x9b,0xef,0x8c,0xb1,0xc6,0x98,0xde,0xfb,0x4a,
-0xa9,0xa4,0x90,0xad,0xb5,0x00,0x00,0x8c,0x00,0x00,0x00,0xc0,0x03,0x00,0x01,
-0x04,0x00,0x10,0x00,0x00,0x00,0x10,0x22,0x12,0x02,0x00,0x00,0x00,0x10,0x32,
-0x33,0x23,0x11,0x04,0x00,0x00,0x23,0x55,0x66,0x35,0x72,0x47,0x00,0x20,0x52,
-0x86,0x68,0x36,0x12,0x97,0x0a,0x20,0x65,0xbb,0x8b,0x36,0x12,0x91,0x04,0x31,
-0x85,0xbb,0x68,0x35,0x12,0x97,0xdc,0x32,0x86,0x8b,0x56,0x35,0x73,0x97,0xa4,
-0x32,0x66,0x68,0x55,0x23,0x71,0x9e,0xac,0x32,0x65,0x56,0x33,0x13,0x71,0xce,
-0xa4,0x21,0x33,0x33,0x23,0x11,0xe7,0xc9,0xd4,0x12,0x22,0x22,0x13,0x71,0xe7,
-0xc9,0xda,0x10,0x17,0x11,0x77,0x77,0x9e,0x4c,0x0d,0x40,0x77,0x71,0xe7,0x9e,
-0xc9,0xd4,0x0d,0x00,0x94,0x99,0x99,0xcc,0x4c,0xda,0x00,0x00,0xa0,0xc4,0xc4,
-0x44,0xda,0x0d,0x00,0x00,0x00,0xd0,0xaa,0xda,0x0d,0x00,0x00
-};
diff --git a/examples/system/childexec/ball16c.tim b/examples/system/childexec/ball16c.tim
new file mode 100644
index 0000000..e2a5d17
--- /dev/null
+++ b/examples/system/childexec/ball16c.tim
Binary files differ
diff --git a/examples/system/childexec/child/child.c b/examples/system/childexec/child/child.c
index 2ddfa73..bd17440 100644
--- a/examples/system/childexec/child/child.c
+++ b/examples/system/childexec/child/child.c
@@ -1,4 +1,4 @@
-#include <sys/types.h>
+#include <stdint.h>
#include <stdio.h>
#include <psxapi.h>
#include <psxgpu.h>
@@ -21,10 +21,10 @@
/* Double buffer structure */
typedef struct {
- DISPENV disp; /* Display environment */
- DRAWENV draw; /* Drawing environment */
- u_long ot[OT_LEN]; /* Ordering table */
- char p[PACKET_LEN]; /* Packet buffer */
+ DISPENV disp; /* Display environment */
+ DRAWENV draw; /* Drawing environment */
+ uint32_t ot[OT_LEN]; /* Ordering table */
+ char p[PACKET_LEN]; /* Packet buffer */
} DB;
/* Double buffer variables */
diff --git a/examples/system/childexec/parent.c b/examples/system/childexec/parent.c
index 58f03f7..3e7d218 100644
--- a/examples/system/childexec/parent.c
+++ b/examples/system/childexec/parent.c
@@ -20,7 +20,7 @@
*
*/
-#include <sys/types.h>
+#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
@@ -29,8 +29,6 @@
#include <psxgte.h>
#include <psxgpu.h>
#include <psxpad.h>
-#include "ball16c.h"
-
#define MAX_BALLS 1024
@@ -48,7 +46,7 @@ DISPENV disp;
DRAWENV draw;
char pribuff[2][65536]; /* Primitive packet buffers */
-u_long ot[2][OT_LEN]; /* Ordering tables */
+uint32_t ot[2][OT_LEN]; /* Ordering tables */
char *nextpri; /* Pointer to next packet buffer offset */
int db = 0; /* Double buffer index */
@@ -62,6 +60,8 @@ typedef struct {
BALL_TYPE balls[MAX_BALLS];
+/* Ball texture reference */
+extern const uint32_t ball16c[];
/* TIM image parameters for loading the ball texture and drawing sprites */
TIM_IMAGE tim;
@@ -103,7 +103,7 @@ void init() {
/* Upload the ball texture */
printf("Upload texture... ");
- GetTimInfo( (u_long*)ball16c, &tim ); /* Get TIM parameters */
+ GetTimInfo( ball16c, &tim ); /* Get TIM parameters */
LoadImage( tim.prect, tim.paddr ); /* Upload texture to VRAM */
if( tim.mode & 0x8 ) {
diff --git a/examples/system/console/CMakeLists.txt b/examples/system/console/CMakeLists.txt
index d58f212..eeb8e62 100644
--- a/examples/system/console/CMakeLists.txt
+++ b/examples/system/console/CMakeLists.txt
@@ -5,7 +5,7 @@ cmake_minimum_required(VERSION 3.20)
project(
console
- LANGUAGES C
+ LANGUAGES C ASM
VERSION 1.0.0
DESCRIPTION "PSn00bSDK stdio console example"
HOMEPAGE_URL "http://lameguy64.net/?page=psn00bsdk"
@@ -15,4 +15,6 @@ file(GLOB _sources *.c)
psn00bsdk_add_executable(console STATIC ${_sources})
#psn00bsdk_add_cd_image(console_iso console iso.xml DEPENDS console)
+psn00bsdk_target_incbin(console PRIVATE ball16c ball16c.tim)
+
install(FILES ${PROJECT_BINARY_DIR}/console.exe TYPE BIN)
diff --git a/examples/system/console/ball16c.h b/examples/system/console/ball16c.h
deleted file mode 100644
index c79f273..0000000
--- a/examples/system/console/ball16c.h
+++ /dev/null
@@ -1,16 +0,0 @@
-unsigned int ball16c_size=192;
-unsigned char ball16c[] = {
-0x10,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x2c,0x00,0x00,0x00,0xc0,0x03,0x10,
-0x01,0x10,0x00,0x01,0x00,0x00,0x00,0x31,0xc6,0x73,0xce,0x94,0xd2,0x07,0x9d,
-0xd6,0xda,0x38,0xe3,0xef,0xbd,0x9b,0xef,0x8c,0xb1,0xc6,0x98,0xde,0xfb,0x4a,
-0xa9,0xa4,0x90,0xad,0xb5,0x00,0x00,0x8c,0x00,0x00,0x00,0xc0,0x03,0x00,0x01,
-0x04,0x00,0x10,0x00,0x00,0x00,0x10,0x22,0x12,0x02,0x00,0x00,0x00,0x10,0x32,
-0x33,0x23,0x11,0x04,0x00,0x00,0x23,0x55,0x66,0x35,0x72,0x47,0x00,0x20,0x52,
-0x86,0x68,0x36,0x12,0x97,0x0a,0x20,0x65,0xbb,0x8b,0x36,0x12,0x91,0x04,0x31,
-0x85,0xbb,0x68,0x35,0x12,0x97,0xdc,0x32,0x86,0x8b,0x56,0x35,0x73,0x97,0xa4,
-0x32,0x66,0x68,0x55,0x23,0x71,0x9e,0xac,0x32,0x65,0x56,0x33,0x13,0x71,0xce,
-0xa4,0x21,0x33,0x33,0x23,0x11,0xe7,0xc9,0xd4,0x12,0x22,0x22,0x13,0x71,0xe7,
-0xc9,0xda,0x10,0x17,0x11,0x77,0x77,0x9e,0x4c,0x0d,0x40,0x77,0x71,0xe7,0x9e,
-0xc9,0xd4,0x0d,0x00,0x94,0x99,0x99,0xcc,0x4c,0xda,0x00,0x00,0xa0,0xc4,0xc4,
-0x44,0xda,0x0d,0x00,0x00,0x00,0xd0,0xaa,0xda,0x0d,0x00,0x00
-};
diff --git a/examples/system/console/ball16c.tim b/examples/system/console/ball16c.tim
new file mode 100644
index 0000000..e2a5d17
--- /dev/null
+++ b/examples/system/console/ball16c.tim
Binary files differ
diff --git a/examples/system/console/main.c b/examples/system/console/main.c
index 92df0a8..b4f91b4 100644
--- a/examples/system/console/main.c
+++ b/examples/system/console/main.c
@@ -21,7 +21,7 @@
*
*/
-#include <sys/types.h>
+#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -32,8 +32,6 @@
#include <psxgte.h>
#include <psxgpu.h>
#include <psxsio.h>
-#include "ball16c.h"
-
#define MAX_BALLS 1024
@@ -50,10 +48,10 @@
DISPENV disp;
DRAWENV draw;
-char pribuff[2][65536]; /* Primitive packet buffers */
-u_long ot[2][OT_LEN]; /* Ordering tables */
-char *nextpri; /* Pointer to next packet buffer offset */
-int db = 0; /* Double buffer index */
+char pribuff[2][65536]; /* Primitive packet buffers */
+uint32_t ot[2][OT_LEN]; /* Ordering tables */
+char *nextpri; /* Pointer to next packet buffer offset */
+int db = 0; /* Double buffer index */
/* Ball struct and array */
@@ -65,6 +63,8 @@ typedef struct {
BALL_TYPE balls[MAX_BALLS];
+/* Ball texture reference */
+extern const uint32_t ball16c[];
/* TIM image parameters for loading the ball texture and drawing sprites */
TIM_IMAGE tim;
@@ -104,7 +104,7 @@ void init() {
/* Upload the ball texture */
printf("Upload texture... ");
- GetTimInfo( (u_long*)ball16c, &tim ); /* Get TIM parameters */
+ GetTimInfo( ball16c, &tim ); /* Get TIM parameters */
LoadImage( tim.prect, tim.paddr ); /* Upload texture to VRAM */
if( tim.mode & 0x8 ) {
diff --git a/examples/system/dynlink/CMakeLists.txt b/examples/system/dynlink/CMakeLists.txt
index aae3bb3..f5f4ea8 100644
--- a/examples/system/dynlink/CMakeLists.txt
+++ b/examples/system/dynlink/CMakeLists.txt
@@ -5,7 +5,7 @@ cmake_minimum_required(VERSION 3.20)
project(
dynlink
- LANGUAGES C
+ LANGUAGES C ASM
VERSION 1.0.0
DESCRIPTION "PSn00bSDK dynamic linker example"
HOMEPAGE_URL "http://lameguy64.net/?page=psn00bsdk"
@@ -20,6 +20,8 @@ psn00bsdk_add_cd_image(
DEPENDS dynlink_main dynlink_cube dynlink_balls
)
+psn00bsdk_target_incbin(dynlink_balls PRIVATE ball16c library/ball16c.tim)
+
install(
FILES
${PROJECT_BINARY_DIR}/dynlink.bin
diff --git a/examples/system/dynlink/library/ball16c.h b/examples/system/dynlink/library/ball16c.h
deleted file mode 100644
index c79f273..0000000
--- a/examples/system/dynlink/library/ball16c.h
+++ /dev/null
@@ -1,16 +0,0 @@
-unsigned int ball16c_size=192;
-unsigned char ball16c[] = {
-0x10,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x2c,0x00,0x00,0x00,0xc0,0x03,0x10,
-0x01,0x10,0x00,0x01,0x00,0x00,0x00,0x31,0xc6,0x73,0xce,0x94,0xd2,0x07,0x9d,
-0xd6,0xda,0x38,0xe3,0xef,0xbd,0x9b,0xef,0x8c,0xb1,0xc6,0x98,0xde,0xfb,0x4a,
-0xa9,0xa4,0x90,0xad,0xb5,0x00,0x00,0x8c,0x00,0x00,0x00,0xc0,0x03,0x00,0x01,
-0x04,0x00,0x10,0x00,0x00,0x00,0x10,0x22,0x12,0x02,0x00,0x00,0x00,0x10,0x32,
-0x33,0x23,0x11,0x04,0x00,0x00,0x23,0x55,0x66,0x35,0x72,0x47,0x00,0x20,0x52,
-0x86,0x68,0x36,0x12,0x97,0x0a,0x20,0x65,0xbb,0x8b,0x36,0x12,0x91,0x04,0x31,
-0x85,0xbb,0x68,0x35,0x12,0x97,0xdc,0x32,0x86,0x8b,0x56,0x35,0x73,0x97,0xa4,
-0x32,0x66,0x68,0x55,0x23,0x71,0x9e,0xac,0x32,0x65,0x56,0x33,0x13,0x71,0xce,
-0xa4,0x21,0x33,0x33,0x23,0x11,0xe7,0xc9,0xd4,0x12,0x22,0x22,0x13,0x71,0xe7,
-0xc9,0xda,0x10,0x17,0x11,0x77,0x77,0x9e,0x4c,0x0d,0x40,0x77,0x71,0xe7,0x9e,
-0xc9,0xd4,0x0d,0x00,0x94,0x99,0x99,0xcc,0x4c,0xda,0x00,0x00,0xa0,0xc4,0xc4,
-0x44,0xda,0x0d,0x00,0x00,0x00,0xd0,0xaa,0xda,0x0d,0x00,0x00
-};
diff --git a/examples/system/dynlink/library/ball16c.tim b/examples/system/dynlink/library/ball16c.tim
new file mode 100644
index 0000000..e2a5d17
--- /dev/null
+++ b/examples/system/dynlink/library/ball16c.tim
Binary files differ
diff --git a/examples/system/dynlink/library/balls.c b/examples/system/dynlink/library/balls.c
index cfc7f58..c537167 100644
--- a/examples/system/dynlink/library/balls.c
+++ b/examples/system/dynlink/library/balls.c
@@ -12,7 +12,8 @@
#include <inline_c.h>
#include "dll_common.h"
-#include "ball16c.h"
+
+extern const uint32_t ball16c[];
/* Balls data */
@@ -38,7 +39,7 @@ static BALL_TYPE balls[MAX_BALLS];
static TIM_IMAGE ball_tim;
void init(CONTEXT *ctx) {
- GetTimInfo((const uint32_t *) ball16c, &ball_tim);
+ GetTimInfo(ball16c, &ball_tim);
LoadImage(ball_tim.prect, ball_tim.paddr);
if (ball_tim.mode & 8)