diff options
Diffstat (limited to 'agbx/include-private')
-rw-r--r-- | agbx/include-private/agbx/priv.h | 29 | ||||
-rw-r--r-- | agbx/include-private/ax/priv.h | 29 |
2 files changed, 29 insertions, 29 deletions
diff --git a/agbx/include-private/agbx/priv.h b/agbx/include-private/agbx/priv.h deleted file mode 100644 index 1534ff3..0000000 --- a/agbx/include-private/agbx/priv.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - 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_priv) -#define __agbx_hdr_priv - -#include <agbx/bs.h> - -#define __agbx_get10(_addr) (*(agbx_i10 volatile *)_addr) - -#define __agbx_get20(_addr) (*(agbx_i20 volatile *)_addr) - -#define __agbx_get8(_addr) (*(agbx_i8 volatile *)_addr) - -#define __agbx_set10(_addr,_val) ((void)(*(agbx_i10 volatile *)_addr = _val)) - -#define __agbx_set20(_addr,_val) ((void)(*(agbx_i20 volatile *)_addr = _val)) - -#define __agbx_set8(_addr,_val) ((void)(*(agbx_i8 volatile *)_addr = _val)) - -#define __agbx_setpx2(_vaddr,_px,_col) { \ - agbx_i20 const addr = _vaddr + _px * 0x2u; /* We multiply it by two as each pixel takes up two bytes. */ \ - __agbx_set10(addr,_col); \ -} - -#endif diff --git a/agbx/include-private/ax/priv.h b/agbx/include-private/ax/priv.h new file mode 100644 index 0000000..fdbf18b --- /dev/null +++ b/agbx/include-private/ax/priv.h @@ -0,0 +1,29 @@ +/* + 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(__ax_hdr_priv) +#define __ax_hdr_priv + +#include <ax/bs.h> + +#define __ax_get10(_addr) (*(ax_i10 volatile *)_addr) + +#define __ax_get20(_addr) (*(ax_i20 volatile *)_addr) + +#define __ax_get8(_addr) (*(ax_i8 volatile *)_addr) + +#define __ax_set10(_addr,_val) ((void)(*(ax_i10 volatile *)_addr = _val)) + +#define __ax_set20(_addr,_val) ((void)(*(ax_i20 volatile *)_addr = _val)) + +#define __ax_set8(_addr,_val) ((void)(*(ax_i8 volatile *)_addr = _val)) + +#define __ax_setpx2(_vaddr,_px,_col) { \ + ax_i20 const addr = _vaddr + _px * 0x2u; /* We multiply it by two as each pixel takes up two bytes. */ \ + __ax_set10(addr,_col); \ +} + +#endif |