diff options
Diffstat (limited to 'agbx/include')
-rw-r--r-- | agbx/include/agbx/bs.h | 39 | ||||
-rw-r--r-- | agbx/include/agbx/gfx.h | 19 |
2 files changed, 58 insertions, 0 deletions
diff --git a/agbx/include/agbx/bs.h b/agbx/include/agbx/bs.h new file mode 100644 index 0000000..630c50b --- /dev/null +++ b/agbx/include/agbx/bs.h @@ -0,0 +1,39 @@ +/* + 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 !defined(__agbx_hdr_base) +#define __agbx_hdr_base + +/* C23 compatibility: */ +#define constexpr static const +#define nullptr ((void *)0x0u) + +typedef unsigned short agbx_i10; +typedef unsigned int agbx_i20; +typedef unsigned long long agbx_i40; +typedef unsigned char agbx_i8; + +typedef enum { + agbx_err_badmd, + agbx_err_misc, + agbx_err_ok, + agbx_err_pos2big, + agbx_err_px2big, +} agbx_err; + +constexpr agbx_i40 agbx_ver = 0x0u; + +[[noreturn]] void agbx_done(agbx_err err); + +agbx_i10 agbx_get10(agbx_i20 addr); +agbx_i20 agbx_get20(agbx_i20 addr); +agbx_i8 agbx_get8( agbx_i20 addr); + +void agbx_set10(agbx_i20 addr,agbx_i10 val); +void agbx_set20(agbx_i20 addr,agbx_i20 val); +void agbx_set8( agbx_i20 addr,agbx_i8 val); + +#endif diff --git a/agbx/include/agbx/gfx.h b/agbx/include/agbx/gfx.h new file mode 100644 index 0000000..31c3778 --- /dev/null +++ b/agbx/include/agbx/gfx.h @@ -0,0 +1,19 @@ +/* + 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 !defined(__agbx_hdr_gfx) +#define __agbx_hdr_gfx + +#include <agbx/bs.h> + +void agbx_setpx1(agbx_i10 px,agbx_i8 col); +void agbx_setpx2(agbx_i10 px,agbx_i10 col); + +agbx_i10 agbx_plot3(agbx_i8 x, agbx_i8 y,agbx_i10 col); +agbx_i10 agbx_plot4(agbx_i8 x, agbx_i8 y,agbx_i8 col); +agbx_i10 agbx_plot5(agbx_i8 x, agbx_i8 y,agbx_i10 col); + +#endif |