diff options
Diffstat (limited to 'agbx/include-private')
-rw-r--r-- | agbx/include-private/ax/priv.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/agbx/include-private/ax/priv.h b/agbx/include-private/ax/priv.h index 382a7ee..677d77f 100644 --- a/agbx/include-private/ax/priv.h +++ b/agbx/include-private/ax/priv.h @@ -9,6 +9,10 @@ #include <ax/bs.h> +#if defined(__cplusplus) +extern "C" { +#endif + #define __ax_get10(_addr) (*(ax_i01 volatile *)_addr) #define __ax_get20(_addr) (*(ax_i02 volatile *)_addr) @@ -21,9 +25,22 @@ #define __ax_set8(_addr,_val) ((void)(*(ax_i8 volatile *)_addr = _val)) -#define __ax_setpx2(_vaddr,_px,_col) { \ +#define __ax_plot2(_vaddr,_px,_col) { \ ax_i02 const addr = _vaddr + _px * 0x2u; /* We multiply it by two as each pixel takes up two bytes. */ \ __ax_set10(addr,_col); \ } +#if defined(__cplusplus) +} +#endif + +#if defined(__cplusplus) + +template<typename _ltyp,typename _rtyp> struct __ax_typeqimpl {constexpr static bool eq = false;}; +template<typename _typ> struct __ax_typeqimpl<_typ,_typ> {constexpr static bool eq = true;}; + +template<typename _ltyp,typename _rtyp> constexpr bool __ax_typeq = ::__ax_typeqimpl<_ltyp,_rtyp>::eq; + +#endif + #endif |