aboutsummaryrefslogtreecommitdiff
path: root/examples/system/dynlink
diff options
context:
space:
mode:
authorJohn "Lameguy" Wilbert Villamor <lameguy64@gmail.com>2022-09-26 16:49:56 +0800
committerGitHub <noreply@github.com>2022-09-26 16:49:56 +0800
commitc4a2533d21dfd05cde841ea48c67b05e0e6a853f (patch)
treec7ef61653b157b69fb0956709366996ddbc4ecfa /examples/system/dynlink
parenta8b404b3400c3ebd8e0b923dcaefcc49ea563e36 (diff)
parent86f0064afb8200e60dd80827535cac30d0eab028 (diff)
downloadpsn00bsdk-c4a2533d21dfd05cde841ea48c67b05e0e6a853f.tar.gz
Merge pull request #55 from spicyjpeg/psxmdec
Full MDEC support, C library refactors, cleanups and bugfixes (v0.20)
Diffstat (limited to 'examples/system/dynlink')
-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
-rw-r--r--examples/system/dynlink/main.c8
5 files changed, 10 insertions, 23 deletions
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 ef6993e..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((u_long *) ball16c, &ball_tim);
+ GetTimInfo(ball16c, &ball_tim);
LoadImage(ball_tim.prect, ball_tim.paddr);
if (ball_tim.mode & 8)
diff --git a/examples/system/dynlink/main.c b/examples/system/dynlink/main.c
index 9b94b30..fff7aa5 100644
--- a/examples/system/dynlink/main.c
+++ b/examples/system/dynlink/main.c
@@ -108,13 +108,13 @@ void init_context(CONTEXT *ctx) {
// Set up the ordering tables and primitive buffers.
db = &(ctx->db[0]);
ctx->db_nextpri = db->p;
- ClearOTagR((u_long *) db->ot, OT_LEN);
+ ClearOTagR(db->ot, OT_LEN);
PutDrawEnv(&(db->draw));
//PutDispEnv(&(db->disp));
db = &(ctx->db[1]);
- ClearOTagR((u_long *) db->ot, OT_LEN);
+ ClearOTagR(db->ot, OT_LEN);
// Create a text stream at the top of the screen.
FntLoad(960, 0);
@@ -130,14 +130,14 @@ void display(CONTEXT *ctx) {
db = &(ctx->db[ctx->db_active]);
ctx->db_nextpri = db->p;
- ClearOTagR((u_long *) db->ot, OT_LEN);
+ ClearOTagR(db->ot, OT_LEN);
PutDrawEnv(&(db->draw));
PutDispEnv(&(db->disp));
SetDispMask(1);
db = &(ctx->db[!ctx->db_active]);
- DrawOTag((u_long *) &(db->ot[OT_LEN - 1]));
+ DrawOTag(&(db->ot[OT_LEN - 1]));
}
/* Symbol overriding example */