aboutsummaryrefslogtreecommitdiff
path: root/examples/io
diff options
context:
space:
mode:
authorJohn "Lameguy" Wilbert Villamor <lameguy64@gmail.com>2022-10-19 17:57:06 +0800
committerGitHub <noreply@github.com>2022-10-19 17:57:06 +0800
commite08a3d9366f8ca14a76b3dd569dac1fb9f569748 (patch)
tree33654513b0b184c27f8035dbc405640fcbeb44ab /examples/io
parentc4a2533d21dfd05cde841ea48c67b05e0e6a853f (diff)
parent9b2ffc6078a850b7d354855cca7622090b41f30c (diff)
downloadpsn00bsdk-e08a3d9366f8ca14a76b3dd569dac1fb9f569748.tar.gz
Merge pull request #59 from spicyjpeg/psxmdec
IRQ handler fix, .STR playback example, multiple library builds (v0.21)
Diffstat (limited to 'examples/io')
-rw-r--r--examples/io/pads/CMakeLists.txt4
-rw-r--r--examples/io/pads/main.c22
-rw-r--r--examples/io/pads/spi.c6
-rw-r--r--examples/io/system573/CMakeLists.txt4
-rw-r--r--examples/io/system573/iso.xml2
-rw-r--r--examples/io/system573/main.c22
6 files changed, 29 insertions, 31 deletions
diff --git a/examples/io/pads/CMakeLists.txt b/examples/io/pads/CMakeLists.txt
index cf5f817..618b696 100644
--- a/examples/io/pads/CMakeLists.txt
+++ b/examples/io/pads/CMakeLists.txt
@@ -1,7 +1,7 @@
# PSn00bSDK example CMake script
# (C) 2021 spicyjpeg - MPL licensed
-cmake_minimum_required(VERSION 3.20)
+cmake_minimum_required(VERSION 3.21)
project(
pads
@@ -12,7 +12,7 @@ project(
)
file(GLOB _sources *.c *.s)
-psn00bsdk_add_executable(pads STATIC ${_sources})
+psn00bsdk_add_executable(pads GPREL ${_sources})
#psn00bsdk_add_cd_image(pads_iso pads iso.xml DEPENDS pads)
install(FILES ${PROJECT_BINARY_DIR}/pads.exe TYPE BIN)
diff --git a/examples/io/pads/main.c b/examples/io/pads/main.c
index 17bf331..29bb527 100644
--- a/examples/io/pads/main.c
+++ b/examples/io/pads/main.c
@@ -62,17 +62,17 @@ static const char *const PAD_TYPEIDS[] = {
#define BGCOLOR_B 0
typedef struct {
- DISPENV disp;
- DRAWENV draw;
-} DB;
+ DISPENV disp;
+ DRAWENV draw;
+} Framebuffer;
typedef struct {
- DB db[2];
- uint32_t db_active;
-} CONTEXT;
+ Framebuffer db[2];
+ int db_active;
+} RenderContext;
-void init_context(CONTEXT *ctx) {
- DB *db;
+void init_context(RenderContext *ctx) {
+ Framebuffer *db;
ResetGraph(0);
ctx->db_active = 0;
@@ -99,8 +99,8 @@ void init_context(CONTEXT *ctx) {
FntOpen(8, 16, 304, 208, 2, 512);
}
-void display(CONTEXT *ctx) {
- DB *db;
+void display(RenderContext *ctx) {
+ Framebuffer *db;
DrawSync(0);
VSync(0);
@@ -227,7 +227,7 @@ void poll_cb(uint32_t port, const volatile uint8_t *buff, size_t rx_len) {
/* Main */
-static CONTEXT ctx;
+static RenderContext ctx;
int main(int argc, const char* argv[]) {
init_context(&ctx);
diff --git a/examples/io/pads/spi.c b/examples/io/pads/spi.c
index 133782c..292e682 100644
--- a/examples/io/pads/spi.c
+++ b/examples/io/pads/spi.c
@@ -46,9 +46,9 @@ typedef struct _SPI_Context {
SPI_Callback callback;
} SPI_Context;
-static volatile SPI_Context _context;
-static volatile SPI_Request volatile *_current_req;
-static volatile SPI_Callback _default_cb;
+static volatile SPI_Context _context;
+static volatile SPI_Request *_current_req;
+static volatile SPI_Callback _default_cb;
/* Request queue management */
diff --git a/examples/io/system573/CMakeLists.txt b/examples/io/system573/CMakeLists.txt
index 2a362e8..34b0d69 100644
--- a/examples/io/system573/CMakeLists.txt
+++ b/examples/io/system573/CMakeLists.txt
@@ -1,7 +1,7 @@
# PSn00bSDK example CMake script
# (C) 2021 spicyjpeg - MPL licensed
-cmake_minimum_required(VERSION 3.20)
+cmake_minimum_required(VERSION 3.21)
project(
system573
@@ -12,7 +12,7 @@ project(
)
file(GLOB _sources *.c *.s)
-psn00bsdk_add_executable(system573 STATIC ${_sources})
+psn00bsdk_add_executable(system573 GPREL ${_sources})
psn00bsdk_add_cd_image(system573_iso system573 iso.xml DEPENDS system573)
install(
diff --git a/examples/io/system573/iso.xml b/examples/io/system573/iso.xml
index 0bb84d5..2226089 100644
--- a/examples/io/system573/iso.xml
+++ b/examples/io/system573/iso.xml
@@ -30,8 +30,6 @@
-->
<!--<file name="SYSTEM.CNF" type="data" source="${PROJECT_SOURCE_DIR}/system.cnf" />-->
<file name="PSX.EXE" type="data" source="system573.exe" />
- <file name="PSX.MAP" type="data" source="system573.map" />
-
<file name="QSY.DXD" type="data" source="system573.exe" />
<file name="SSW.BXF" type="data" source="system573.exe" />
<file name="TSV.AXG" type="data" source="system573.exe" />
diff --git a/examples/io/system573/main.c b/examples/io/system573/main.c
index 3404ee4..39ddb64 100644
--- a/examples/io/system573/main.c
+++ b/examples/io/system573/main.c
@@ -83,17 +83,17 @@ const char *const IO_BOARD_TYPES[] = {
#define BGCOLOR_B 0
typedef struct {
- DISPENV disp;
- DRAWENV draw;
-} DB;
+ DISPENV disp;
+ DRAWENV draw;
+} Framebuffer;
typedef struct {
- DB db[2];
- uint32_t db_active;
-} CONTEXT;
+ Framebuffer db[2];
+ int db_active;
+} RenderContext;
-void init_context(CONTEXT *ctx) {
- DB *db;
+void init_context(RenderContext *ctx) {
+ Framebuffer *db;
ResetGraph(0);
ctx->db_active = 0;
@@ -120,8 +120,8 @@ void init_context(CONTEXT *ctx) {
FntOpen(8, 16, 304, 208, 2, 512);
}
-void display(CONTEXT *ctx) {
- DB *db;
+void display(RenderContext *ctx) {
+ Framebuffer *db;
DrawSync(0);
VSync(0);
@@ -135,7 +135,7 @@ void display(CONTEXT *ctx) {
/* Main */
-static CONTEXT ctx;
+static RenderContext ctx;
#define SHOW_STATUS(...) { FntPrint(-1, __VA_ARGS__); FntFlush(-1); display(&ctx); }
#define SHOW_ERROR(...) { SHOW_STATUS(__VA_ARGS__); while (1) __asm__("nop"); }