summaryrefslogtreecommitdiff
path: root/agbx/include
diff options
context:
space:
mode:
Diffstat (limited to 'agbx/include')
-rw-r--r--agbx/include/ax/algo.h4
-rw-r--r--agbx/include/ax/bs.h23
-rw-r--r--agbx/include/ax/gfx.h40
-rw-r--r--agbx/include/ax/key.h6
4 files changed, 38 insertions, 35 deletions
diff --git a/agbx/include/ax/algo.h b/agbx/include/ax/algo.h
index e7c7549..8ea344c 100644
--- a/agbx/include/ax/algo.h
+++ b/agbx/include/ax/algo.h
@@ -1,7 +1,7 @@
/*
Copyright 2022 Gabriel Jensen.
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
- If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
+ If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>.
*/
#if !defined(__ax_hdr_algo)
@@ -9,6 +9,6 @@
#include <ax/bs.h>
-void ax_cp(void const * src,ax_i20 num,void * dest);
+void ax_cp(void const * src,ax_i02 num,void * dest);
#endif
diff --git a/agbx/include/ax/bs.h b/agbx/include/ax/bs.h
index 9fb851a..9f27d8f 100644
--- a/agbx/include/ax/bs.h
+++ b/agbx/include/ax/bs.h
@@ -1,7 +1,7 @@
/*
Copyright 2022 Gabriel Jensen.
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
- If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
+ If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>.
*/
#if !defined(__ax_hdr_bs)
@@ -9,11 +9,10 @@
/* C23 compatibility: */
#define constexpr static const
-#define typeof __typeof__
-typedef unsigned short ax_i10;
-typedef unsigned int ax_i20;
-typedef unsigned long long ax_i40;
+typedef unsigned short ax_i01;
+typedef unsigned int ax_i02;
+typedef unsigned long long ax_i04;
typedef unsigned char ax_i8;
typedef enum {
@@ -27,16 +26,16 @@ typedef enum {
ax_err_max = 0xFFu,
} ax_err;
-constexpr ax_i40 ax_ver = 0x6u;
+constexpr ax_i04 ax_ver = 0x7u;
[[noreturn]] void ax_done(ax_err err);
-[[nodiscard]] ax_i10 ax_get10(ax_i20 addr);
-[[nodiscard]] ax_i20 ax_get20(ax_i20 addr);
-[[nodiscard]] ax_i8 ax_get8( ax_i20 addr);
+[[nodiscard]] ax_i01 ax_get10(ax_i02 addr);
+[[nodiscard]] ax_i02 ax_get20(ax_i02 addr);
+[[nodiscard]] ax_i8 ax_get8( ax_i02 addr);
-void ax_set10(ax_i20 addr,ax_i10 val);
-void ax_set20(ax_i20 addr,ax_i20 val);
-void ax_set8( ax_i20 addr,ax_i8 val);
+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);
#endif
diff --git a/agbx/include/ax/gfx.h b/agbx/include/ax/gfx.h
index d534806..b3830d6 100644
--- a/agbx/include/ax/gfx.h
+++ b/agbx/include/ax/gfx.h
@@ -1,7 +1,7 @@
/*
Copyright 2022 Gabriel Jensen.
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
- If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
+ If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>.
*/
#if !defined(__ax_hdr_gfx)
@@ -9,30 +9,34 @@
#include <ax/bs.h>
-ax_i20 ax_flip( void);
-ax_i20 ax_getvbnk(void);
+ax_i02 ax_flip( void);
+ax_i02 ax_getvbnk(void);
void ax_vsync( void);
-void ax_setpx1(ax_i20 vaddr,ax_i10 px,ax_i8 col);
-void ax_setpx2(ax_i20 vaddr,ax_i10 px,ax_i10 col);
+void ax_setpx1(ax_i02 vaddr,ax_i01 px,ax_i8 col);
+void ax_setpx2(ax_i02 vaddr,ax_i01 px,ax_i01 col);
-ax_i8 ax_getpx1(ax_i20 vaddr,ax_i10 px);
-ax_i10 ax_getpx2(ax_i20 vaddr,ax_i10 px);
+ax_i8 ax_getpx1(ax_i02 vaddr,ax_i01 px);
+ax_i01 ax_getpx2(ax_i02 vaddr,ax_i01 px);
-void ax_clrscrn3(ax_i10 col);
-void ax_clrscrn4(ax_i20 vaddr,ax_i8 col);
-void ax_clrscrn5(ax_i20 vaddr,ax_i10 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_plot3(ax_i8 x, ax_i8 y,ax_i10 col);
-void ax_plot4(ax_i20 vaddr,ax_i8 x,ax_i8 y, ax_i8 col);
-void ax_plot5(ax_i20 vaddr,ax_i8 x,ax_i8 y, ax_i10 col);
+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_i10 ax_rd3(ax_i8 x, ax_i8 y);
-ax_i8 ax_rd4(ax_i20 vaddr,ax_i8 x,ax_i8 y);
-ax_i10 ax_rd5(ax_i20 vaddr,ax_i8 x,ax_i8 y);
+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);
+
+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_i20 vaddr,ax_i8 x,ax_i8 y,ax_i8 r);
-void ax_cir5(ax_i20 vaddr,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);
#endif
diff --git a/agbx/include/ax/key.h b/agbx/include/ax/key.h
index 76517f7..3cff7d6 100644
--- a/agbx/include/ax/key.h
+++ b/agbx/include/ax/key.h
@@ -1,7 +1,7 @@
/*
Copyright 2022 Gabriel Jensen.
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
- If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
+ If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>.
*/
#if !defined(__ax_hdr_key)
@@ -23,10 +23,10 @@ typedef enum {
} ax_key;
typedef struct {
- ax_i10 _keys;
+ ax_i01 _keys;
} ax_keymap;
-#define ax_chkkey(_map,_key) (!(bool)(_map._keys >> (ax_i10)_key & 0x1u))
+#define ax_chkkey(_map,_key) (!(bool)(_map._keys >> (ax_i01)_key & 0x1u))
ax_keymap ax_getkeymap(void);