tuxanci2-engine
Game engine for tuxanci2
Log | Files | Refs | README | LICENSE
commit 1ab919054d645f987fcc904e143868f13712dfec
parent d977753b558eb4a9c563ff40b67ad033d331e55c
Author: Connor Thomson <connor@gnufault.org>
Date: Sun, 25 Oct 2026 18:44:24 -0700
Add ps1 logo on bootup
Diffstat:
4 files changed, 29 insertions(+), 2 deletions(-)
diff --git a/platforms/ps1/Makefile b/platforms/ps1/Makefile
@@ -19,7 +19,7 @@ PSXLICENSEDUMP ?= psxlicensedump
PS1_REGION ?= US
PS1_TEXT ?=
-PS1_TMD ?=
+PS1_TMD ?= logo.tmd
PS1_BUILD ?= build/ps1
PS1_BUILD_DIR := $(ROOT_DIR)/$(PS1_BUILD)
diff --git a/platforms/ps1/logo.tmd b/platforms/ps1/logo.tmd
Binary files differ.
diff --git a/platforms/ps1/ps1.c b/platforms/ps1/ps1.c
@@ -1,3 +1,4 @@
+#include <stddef.h>
#include "ta_api.h"
#include "common/hardware/hwregs.h"
#include "common/hardware/irq.h"
@@ -163,6 +164,26 @@ void *ta_realloc(void *ptr, ta_size new_size) {
return fresh;
}
+ta_fs_file ta_read_file(const char *path) {
+ ta_fs_file file = {
+ .data = NULL,
+ .size = 0
+ };
+
+ (void)path;
+
+ return file;
+}
+
+void ta_close_file(ta_fs_file *file) {
+ if (!file) {
+ return;
+ }
+
+ file->data = NULL;
+ file->size = 0;
+}
+
void ta_exit(int status) {
(void)status;
diff --git a/src/ta_mod.c b/src/ta_mod.c
@@ -36,7 +36,12 @@ static ta_vm_status mod_ecall(ta_vm *machine, void *user) {
ta_bool ta_mod_load(const ta_uint8 *binary, ta_size size) {
ta_mod_unload();
- if (!binary || size == 0 || size > TA_MOD_RAM_SIZE) {
+ if (!binary || size < 4 || size > TA_MOD_RAM_SIZE) {
+ return ta_false;
+ }
+
+ if (binary[0] != 0x54 || binary[1] != 0x41 ||
+ binary[2] != 0x42 || binary[3] != 0x43) {
return ta_false;
}
@@ -51,6 +56,7 @@ ta_bool ta_mod_load(const ta_uint8 *binary, ta_size size) {
}
ta_vm_init(&vm, ram, TA_MOD_RAM_SIZE, mod_ecall, TA_NULL);
+ vm.pc = 4;
status = TA_VM_RUNNING;
exit_code = 0;
loaded = ta_true;