aboutsummaryrefslogtreecommitdiff
path: root/src/system/ps1
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi.dcr@tutanota.com>2021-07-03 00:49:03 +0200
committerXavier Del Campo Romero <xavi.dcr@tutanota.com>2022-03-30 08:20:20 +0200
commit6b9f686913efc3725b2690033cd4f398e07076ba (patch)
treee9aa91a6b9f617d78123ebe7ad272fc42a60d306 /src/system/ps1
parentc9e6ae44a9aeb89b3f48f3443d6baa80103f7445 (diff)
downloadjancity-6b9f686913efc3725b2690033cd4f398e07076ba.tar.gz
Add project source code
Diffstat (limited to 'src/system/ps1')
-rw-r--r--src/system/ps1/inc/system/port.h17
-rw-r--r--src/system/ps1/src/init.c32
2 files changed, 49 insertions, 0 deletions
diff --git a/src/system/ps1/inc/system/port.h b/src/system/ps1/inc/system/port.h
new file mode 100644
index 0000000..395097e
--- /dev/null
+++ b/src/system/ps1/inc/system/port.h
@@ -0,0 +1,17 @@
+#ifndef INIT_PS1_H
+#define INIT_PS1_H
+
+#include <stdbool.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+extern volatile bool vblank_set;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* INIT_PS1_H */
diff --git a/src/system/ps1/src/init.c b/src/system/ps1/src/init.c
new file mode 100644
index 0000000..a644e47
--- /dev/null
+++ b/src/system/ps1/src/init.c
@@ -0,0 +1,32 @@
+#include <gfx.h>
+#include <sfx.h>
+#include <system.h>
+#include <psx.h>
+#include <stdbool.h>
+
+volatile bool vblank_set;
+
+static void vblank(void *const arg)
+{
+ vblank_set = true;
+}
+
+void system_deinit(void)
+{
+ gfx_deinit();
+ sfx_deinit();
+}
+
+int system_init(void)
+{
+ SetVBlankHandler(vblank);
+
+ if (gfx_init() || sfx_init())
+ return -1;
+
+ return 0;
+}
+
+void system_loop(void)
+{
+}