summaryrefslogtreecommitdiff
path: root/agbx/include
diff options
context:
space:
mode:
Diffstat (limited to 'agbx/include')
-rw-r--r--agbx/include/ax/bs.h17
-rw-r--r--agbx/include/ax/gfx.h40
2 files changed, 36 insertions, 21 deletions
diff --git a/agbx/include/ax/bs.h b/agbx/include/ax/bs.h
index 9f27d8f..88c632a 100644
--- a/agbx/include/ax/bs.h
+++ b/agbx/include/ax/bs.h
@@ -7,8 +7,14 @@
#if !defined(__ax_hdr_bs)
#define __ax_hdr_bs
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+#if !defined(__cplusplus)
/* C23 compatibility: */
#define constexpr static const
+#endif
typedef unsigned short ax_i01;
typedef unsigned int ax_i02;
@@ -26,7 +32,12 @@ typedef enum {
ax_err_max = 0xFFu,
} ax_err;
-constexpr ax_i04 ax_ver = 0x7u;
+constexpr ax_i04 ax_ver = 0x8u;
+
+constexpr ax_i8 ax_scrnw3 = 0xF0u;
+constexpr ax_i8 ax_scrnw5 = 0xA0u;
+constexpr ax_i8 ax_scrnh3 = 0xA0u;
+constexpr ax_i8 ax_scrnh5 = 0x80u;
[[noreturn]] void ax_done(ax_err err);
@@ -38,4 +49,8 @@ void ax_set10(ax_i02 addr,ax_i01 val);
void ax_set20(ax_i02 addr,ax_i02 val);
void ax_set8( ax_i02 addr,ax_i8 val);
+#if defined(__cplusplus)
+}
+#endif
+
#endif
diff --git a/agbx/include/ax/gfx.h b/agbx/include/ax/gfx.h
index b3830d6..d9fa1b7 100644
--- a/agbx/include/ax/gfx.h
+++ b/agbx/include/ax/gfx.h
@@ -9,34 +9,34 @@
#include <ax/bs.h>
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+#define ax_coord3(_x,_y) ((ax_i01)_y * ax_scrnw3 + (ax_i01)_x)
+#define ax_coord5(_x,_y) ((ax_i01)_y * ax_scrnw5 + (ax_i01)_x)
+
ax_i02 ax_flip( void);
ax_i02 ax_getvbnk(void);
void ax_vsync( void);
-void ax_setpx1(ax_i02 vaddr,ax_i01 px,ax_i8 col);
-void ax_setpx2(ax_i02 vaddr,ax_i01 px,ax_i01 col);
+void ax_clrscrn1(ax_i02 vaddr,ax_i8 col);
+void ax_clrscrn2(ax_i02 vaddr,ax_i01 col);
-ax_i8 ax_getpx1(ax_i02 vaddr,ax_i01 px);
-ax_i01 ax_getpx2(ax_i02 vaddr,ax_i01 px);
+void ax_plot1(ax_i02 vaddr,ax_i01 px, ax_i8 col);
+void ax_plot2(ax_i02 vaddr,ax_i01 px, ax_i01 col);
-void ax_clrscrn3(ax_i01 col);
-void ax_clrscrn4(ax_i02 vaddr,ax_i8 col);
-void ax_clrscrn5(ax_i02 vaddr,ax_i01 col);
+void ax_plottex1(ax_i02 vaddr,ax_i8 scrnw,ax_i8 const * tex,ax_i01 px,ax_i8 w,ax_i8 h);
+void ax_plottex2(ax_i02 vaddr,ax_i8 scrnw,ax_i01 const * tex,ax_i01 px,ax_i8 w,ax_i8 h);
-void ax_plot3(ax_i8 x, ax_i8 y,ax_i01 col);
-void ax_plot4(ax_i02 vaddr,ax_i8 x,ax_i8 y, ax_i8 col);
-void ax_plot5(ax_i02 vaddr,ax_i8 x,ax_i8 y, ax_i01 col);
+ax_i8 ax_rd1(ax_i02 vaddr,ax_i01 px);
+ax_i01 ax_rd2(ax_i02 vaddr,ax_i01 px);
-void ax_plottex3(ax_i01 const * tex, ax_i8 x, ax_i8 y,ax_i8 w,ax_i8 h);
-void ax_plottex4(ax_i02 vaddr,ax_i8 const * tex,ax_i8 x,ax_i8 y,ax_i8 w,ax_i8 h);
-void ax_plottex5(ax_i02 vaddr,ax_i01 const * tex,ax_i8 x,ax_i8 y,ax_i8 w,ax_i8 h);
+void ax_cir1(ax_i02 vaddr,ax_i8 scrnw,ax_i01 px,ax_i8 r,ax_i8 col);
+void ax_cir2(ax_i02 vaddr,ax_i8 scrnw,ax_i01 px,ax_i8 r,ax_i01 col);
-ax_i01 ax_rd3(ax_i8 x, ax_i8 y);
-ax_i8 ax_rd4(ax_i02 vaddr,ax_i8 x,ax_i8 y);
-ax_i01 ax_rd5(ax_i02 vaddr,ax_i8 x,ax_i8 y);
-
-void ax_cir3(ax_i8 x, ax_i8 y,ax_i8 r);
-void ax_cir4(ax_i02 vaddr,ax_i8 x,ax_i8 y,ax_i8 r);
-void ax_cir5(ax_i02 vaddr,ax_i8 x,ax_i8 y,ax_i8 r);
+#if defined(__cplusplus)
+}
+#endif
#endif