summaryrefslogtreecommitdiff
path: root/agbx/include/ax/gfx.h
blob: 56405f1aa9fb1daab17e2390cd4b37f6bdb6a8aa (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*
	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_gfx)
#define __ax_hdr_gfx

#include <ax/bs.h>

#if defined(__cplusplus)
extern "C" {
#endif

constexpr ax_i8 ax_scrnw3 = 0xF0u;
constexpr ax_i8 ax_scrnw5 = 0xA0u;
constexpr ax_i8 ax_scrnh3 = 0xA0u;
constexpr ax_i8 ax_scrnh5 = 0x80u;

#define ax_coord(_scrnw,_x,_y) ((ax_i01)((ax_i01)(_y) * (ax_i01)(_scrnw) + (ax_i01)(_x)))

#define ax_col(_r,_g,_b) ((ax_i01)(((ax_i01)(_r) | (ax_i01)(_g) << 0x5u | (ax_i01)(_b) << 0xAu) & 0b000000111111111111111))

ax_i02 ax_flip(   void);
ax_i02 ax_getvbnk(void);
void   ax_vsync(  void);

void ax_clrscrn1(ax_i02 vaddr,ax_i8  col);
void ax_clrscrn2(ax_i02 vaddr,ax_i01 col);

void ax_plot1(ax_i02 vaddr,ax_i01 px, ax_i8  col);
void ax_plot2(ax_i02 vaddr,ax_i01 px, ax_i01 col);

void ax_plottex1(ax_i02 vaddr,ax_i8 scrnw,ax_i8 const *  tex,ax_i01 px,ax_i8 w,ax_i8 h);
void ax_plottex2(ax_i02 vaddr,ax_i8 scrnw,ax_i01 const * tex,ax_i01 px,ax_i8 w,ax_i8 h);

ax_i8  ax_rd1(ax_i02 vaddr,ax_i01 px);
ax_i01 ax_rd2(ax_i02 vaddr,ax_i01 px);

void ax_cir1(ax_i02 vaddr,ax_i8 scrnw,ax_i01 px,ax_i8 r,ax_i8  col);
void ax_cir2(ax_i02 vaddr,ax_i8 scrnw,ax_i01 px,ax_i8 r,ax_i01 col);

#if defined(__cplusplus)
}
#endif

#endif