diff options
Diffstat (limited to 'agbx/include')
-rw-r--r-- | agbx/include/agbx/bs.h | 1 | ||||
-rw-r--r-- | agbx/include/agbx/gfx.h | 19 |
2 files changed, 19 insertions, 1 deletions
diff --git a/agbx/include/agbx/bs.h b/agbx/include/agbx/bs.h index a9869fa..7d38d73 100644 --- a/agbx/include/agbx/bs.h +++ b/agbx/include/agbx/bs.h @@ -9,7 +9,6 @@ /* C23 compatibility: */ #define constexpr static const -#define nullptr ((void *)0x0u) #define typeof __typeof__ typedef unsigned short agbx_i10; diff --git a/agbx/include/agbx/gfx.h b/agbx/include/agbx/gfx.h index beec93b..07e74e6 100644 --- a/agbx/include/agbx/gfx.h +++ b/agbx/include/agbx/gfx.h @@ -31,4 +31,23 @@ agbx_i10 agbx_rd3(agbx_i8 x, agbx_i8 y); agbx_i8 agbx_rd4(agbx_i20 vaddr,agbx_i8 x,agbx_i8 y); agbx_i10 agbx_rd5(agbx_i20 vaddr,agbx_i8 x,agbx_i8 y); +void agbx_cir3(agbx_i8 x, agbx_i8 y,agbx_i8 r); +void agbx_cir4(agbx_i20 vaddr,agbx_i8 x,agbx_i8 y,agbx_i8 r); +void agbx_cir5(agbx_i20 vaddr,agbx_i8 x,agbx_i8 y,agbx_i8 r); + +#if false +void agbx_setpx1(agbx_i20 const _vaddr,agbx_i10 const _px,agbx_i8 const _col) { + /* We can only write halfwords to VRAM, so we need to load the adjacent pixel value and combine it into a halfword. */ + agbx_i20 const addr = _vaddr + _px - (_px & 0x1u) * 0x1u; + agbx_i10 col; + if (_px & 0x1u) {col = (agbx_i10)agbx_get8(addr) | (agbx_i10)_col << 0x8u;} + else {col = (agbx_i10)agbx_get8(addr + 0x1u) << 0x8u | (agbx_i10)_col;} + __agbx_set10(addr,col); +} + +void agbx_setpx2(agbx_i20 const _vaddr,agbx_i10 const _px,agbx_i10 const _col) { + __agbx_setpx2(_vaddr,_px,_col) +} +#endif + #endif |