diff options
Diffstat (limited to 'demo/source')
-rw-r--r-- | demo/source/chgcol.c | 8 | ||||
-rw-r--r-- | demo/source/chkkeys.c | 54 | ||||
-rw-r--r-- | demo/source/initdat.c | 4 | ||||
-rw-r--r-- | demo/source/initgfx.c | 26 | ||||
-rw-r--r-- | demo/source/loop.c | 20 | ||||
-rw-r--r-- | demo/source/main.c | 22 |
6 files changed, 67 insertions, 67 deletions
diff --git a/demo/source/chgcol.c b/demo/source/chgcol.c index cbd653e..554c2d3 100644 --- a/demo/source/chgcol.c +++ b/demo/source/chgcol.c @@ -1,10 +1,10 @@ #include <agbx-demo.h> -#include <agbx/gfx.h> +#include <ax/gfx.h> -void agbxd_chgcol(agbxd_dat * _dat,agbx_i8 const _dir) { - constexpr agbx_i8 maxcol = 0x7u; - agbx_i8 col = _dat->col; +void axd_chgcol(axd_dat * _dat,ax_i8 const _dir) { + constexpr ax_i8 maxcol = 0x7u; + ax_i8 col = _dat->col; if (!_dir) { if (!col) {col = maxcol;} else {--col;} diff --git a/demo/source/chkkeys.c b/demo/source/chkkeys.c index f117d09..394495c 100644 --- a/demo/source/chkkeys.c +++ b/demo/source/chkkeys.c @@ -1,64 +1,64 @@ #include <agbx-demo.h> -#include <agbx/key.h> -#include <agbx/gfx.h> +#include <ax/key.h> +#include <ax/gfx.h> -#define agbxd_chk(_key) \ +#define axd_chk(_key) \ curkey = _key; \ - if (agbx_chkkey(keymap,_key)) + if (ax_chkkey(keymap,_key)) -#define agbxd_wait() \ - while (agbx_chkkey(agbx_getkeymap(),curkey)) {} +#define axd_wait() \ + while (ax_chkkey(ax_getkeymap(),curkey)) {} -agbxd_upd agbxd_chkkeys(agbxd_dat * _dat) { - agbxd_upd upd = {}; - agbx_keymap const keymap = agbx_getkeymap(); - agbx_key curkey; - agbxd_chk(agbx_key_sel) { +axd_upd axd_chkkeys(axd_dat * _dat) { + axd_upd upd = {}; + ax_keymap const keymap = ax_getkeymap(); + ax_key curkey; + axd_chk(ax_key_sel) { upd.done = true; upd.err = true; return upd; } - agbxd_chk(agbx_key_start) { + axd_chk(ax_key_start) { upd.done = true; return upd; } - agbxd_chk(agbx_key_l) { - agbxd_chgcol(_dat,0x0u); - agbxd_wait(); + axd_chk(ax_key_l) { + axd_chgcol(_dat,0x0u); + axd_wait() } - agbxd_chk(agbx_key_r) { - agbxd_chgcol(_dat,0x1u); - agbxd_wait(); + axd_chk(ax_key_r) { + axd_chgcol(_dat,0x1u); + axd_wait() } - agbxd_chk(agbx_key_pade) { + axd_chk(ax_key_pade) { if (_dat->pos.x != 0xEFu) { upd.mv = true; ++_dat->pos.x; - agbxd_wait(); + axd_wait() } } - agbxd_chk(agbx_key_padn) { + axd_chk(ax_key_padn) { if (_dat->pos.y != 0x0u) { upd.mv = true; --_dat->pos.y; - agbxd_wait(); + axd_wait() } } - agbxd_chk(agbx_key_pads) { + axd_chk(ax_key_pads) { if (_dat->pos.y != 0x9Fu) { upd.mv = true; ++_dat->pos.y; - agbxd_wait(); + axd_wait() } } - agbxd_chk(agbx_key_padw) { + axd_chk(ax_key_padw) { if (_dat->pos.x != 0x0u) { upd.mv = true; --_dat->pos.x; - agbxd_wait(); + axd_wait() } } - agbxd_chk(agbx_key_a) {upd.drw = true;} + axd_chk(ax_key_a) {upd.drw = true;} return upd; } diff --git a/demo/source/initdat.c b/demo/source/initdat.c index c9bb7af..86f0e6b 100644 --- a/demo/source/initdat.c +++ b/demo/source/initdat.c @@ -1,8 +1,8 @@ #include <agbx-demo.h> -#include <agbx/gfx.h> +#include <ax/gfx.h> -void agbxd_initdat(agbxd_dat * const _dat) { +void axd_initdat(axd_dat * const _dat) { _dat->col = 0x2u; _dat->pos.x = 0x0u; _dat->pos.y = 0x0u; diff --git a/demo/source/initgfx.c b/demo/source/initgfx.c index 474d5cd..e2f75d4 100644 --- a/demo/source/initgfx.c +++ b/demo/source/initgfx.c @@ -1,17 +1,17 @@ #include <agbx-demo.h> -#include <agbx/gfx.h> +#include <ax/gfx.h> -void agbxd_initgfx(void) { - agbx_set10(0x500'0000u,0b0u); - agbx_set10(0x500'0002u,0b111111111111111u); - agbx_set10(0x500'0004u,0b11111u); - agbx_set10(0x500'0006u,0b1111111111u); - agbx_set10(0x500'0008u,0b1111100000u); - agbx_set10(0x500'000Au,0b111111111100000u); - agbx_set10(0x500'000Cu,0b111110000000000u); - agbx_set10(0x500'000Eu,0b111110000011111u); - agbx_set10(0x400'0000u,0x404u); - agbx_clrscrn4(0x600'0000u,0x0u); - agbx_clrscrn4(0x600'A000u,0x0u); +void axd_initgfx(void) { + ax_set10(0x500'0000u,0b0u); + ax_set10(0x500'0002u,0b111111111111111u); + ax_set10(0x500'0004u,0b11111u); + ax_set10(0x500'0006u,0b1111111111u); + ax_set10(0x500'0008u,0b1111100000u); + ax_set10(0x500'000Au,0b111111111100000u); + ax_set10(0x500'000Cu,0b111110000000000u); + ax_set10(0x500'000Eu,0b111110000011111u); + ax_set10(0x400'0000u,0x404u); + ax_clrscrn4(0x600'0000u,0x0u); + ax_clrscrn4(0x600'A000u,0x0u); } diff --git a/demo/source/loop.c b/demo/source/loop.c index 003ac61..e57cafb 100644 --- a/demo/source/loop.c +++ b/demo/source/loop.c @@ -1,28 +1,28 @@ #include <agbx-demo.h> -#include <agbx/key.h> -#include <agbx/gfx.h> +#include <ax/key.h> +#include <ax/gfx.h> -bool agbxd_loop(agbxd_dat * const _dat) { +bool axd_loop(axd_dat * const _dat) { bool err = false; _dat->prevcol = 0x0u; - agbx_plot4(_dat->vaddr,_dat->pos.x,_dat->pos.y,0x1u); + ax_plot4(_dat->vaddr,_dat->pos.x,_dat->pos.y,0x1u); for (;;) { _dat->prevpos = _dat->pos; - agbxd_upd const upd = agbxd_chkkeys(_dat); + axd_upd const upd = axd_chkkeys(_dat); if (upd.done) { err = upd.err; break; } - agbx_vsync(); + ax_vsync(); if (upd.drw) { _dat->prevcol = _dat->col; - if (upd.mv) {agbx_plot4(_dat->vaddr,_dat->pos.x,_dat->pos.y,_dat->col);} + if (upd.mv) {ax_plot4(_dat->vaddr,_dat->pos.x,_dat->pos.y,_dat->col);} } if (upd.mv) { - agbx_plot4(_dat->vaddr,_dat->prevpos.x,_dat->prevpos.y,_dat->prevcol); - _dat->prevcol = agbx_rd4(_dat->vaddr,_dat->pos.x,_dat->pos.y); - agbx_plot4(_dat->vaddr,_dat->pos.x,_dat->pos.y,0x1u); + ax_plot4(_dat->vaddr,_dat->prevpos.x,_dat->prevpos.y,_dat->prevcol); + _dat->prevcol = ax_rd4(_dat->vaddr,_dat->pos.x,_dat->pos.y); + ax_plot4(_dat->vaddr,_dat->pos.x,_dat->pos.y,0x1u); } } return err; diff --git a/demo/source/main.c b/demo/source/main.c index fe75179..4c838a6 100644 --- a/demo/source/main.c +++ b/demo/source/main.c @@ -1,18 +1,18 @@ #include <agbx-demo.h> -#include <agbx/key.h> -#include <agbx/gfx.h> +#include <ax/key.h> +#include <ax/gfx.h> -agbx_err agbx_main(void) { - agbxd_dat dat; - agbxd_initdat(&dat); - agbxd_initgfx(); - bool const err = agbxd_loop(&dat); +ax_err ax_main(void) { + axd_dat dat; + axd_initdat(&dat); + axd_initgfx(); + bool const err = axd_loop(&dat); if (err) { - for (agbx_i10 px = 0x0u;px != 0x9600u;++px) { - agbx_setpx1(dat.vaddr,px,dat.col); - agbxd_chgcol(&dat,0x1u); + for (ax_i10 px = 0x0u;px != 0x9600u;++px) { + ax_setpx1(dat.vaddr,px,dat.col); + axd_chgcol(&dat,0x1u); } } - return err ? agbx_err_max : agbx_err_ok; + return err ? ax_err_max : ax_err_ok; } |