aboutsummaryrefslogtreecommitdiffstats
path: root/src/uxn/devices/ppu.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/uxn/devices/ppu.h')
-rw-r--r--src/uxn/devices/ppu.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/uxn/devices/ppu.h b/src/uxn/devices/ppu.h
new file mode 100644
index 0000000..187d364
--- /dev/null
+++ b/src/uxn/devices/ppu.h
@@ -0,0 +1,36 @@
1#ifndef UXNGBA_PPU_H
2#define UXNGBA_PPU_H
3
4#include <stdio.h>
5#include <stdlib.h>
6
7/*
8Copyright (c) 2021 Devine Lu Linvega
9Copyright (c) 2021 Andrew Alderwick
10
11Permission to use, copy, modify, and distribute this software for any
12purpose with or without fee is hereby granted, provided that the above
13copyright notice and this permission notice appear in all copies.
14
15THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
16WITH REGARD TO THIS SOFTWARE.
17*/
18
19typedef unsigned char Uint8;
20typedef unsigned short Uint16;
21typedef unsigned int Uint32;
22
23typedef struct Ppu {
24 Uint8 *bg, *fg;
25 Uint16 hor, ver, pad, width, height;
26 Uint16 *output, colors[4];
27} Ppu;
28
29int initppu(Ppu *p, Uint8 hor, Uint8 ver, Uint8 pad);
30void putcolors(Ppu *p, Uint8 *addr);
31void putpixel(Ppu *p, Uint8 *layer, Uint16 x, Uint16 y, Uint8 color);
32void puticn(Ppu *p, Uint8 *layer, Uint16 x, Uint16 y, Uint8 *sprite, Uint8 color, Uint8 flipx, Uint8 flipy);
33void putchr(Ppu *p, Uint8 *layer, Uint16 x, Uint16 y, Uint8 *sprite, Uint8 color, Uint8 flipx, Uint8 flipy);
34void drawppu(Ppu *p);
35void drawdebugger(Ppu *p, Uint8 *stack, Uint8 ptr);
36#endif // UXNGBA_PPU_H