aboutsummaryrefslogtreecommitdiff
path: root/examples/io
diff options
context:
space:
mode:
authorspicyjpeg <thatspicyjpeg@gmail.com>2022-10-15 10:02:35 +0200
committerspicyjpeg <thatspicyjpeg@gmail.com>2022-10-15 10:02:35 +0200
commit6eabb5aa549254c2272cedee26d4245f31f2dc7a (patch)
tree1962581a2ea36f421718aad7bf90b1a37cc4c530 /examples/io
parentb458ea70700739bf8a64217af369c7ace08fc954 (diff)
downloadpsn00bsdk-6eabb5aa549254c2272cedee26d4245f31f2dc7a.tar.gz
Update sound/spustream, clean up other examples
Diffstat (limited to 'examples/io')
-rw-r--r--examples/io/pads/main.c22
-rw-r--r--examples/io/system573/iso.xml2
-rw-r--r--examples/io/system573/main.c22
3 files changed, 22 insertions, 24 deletions
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/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"); }