diff options
Diffstat (limited to 'src/uxn/devices/ppu.h')
-rw-r--r-- | src/uxn/devices/ppu.h | 36 |
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 | /* | ||
8 | Copyright (c) 2021 Devine Lu Linvega | ||
9 | Copyright (c) 2021 Andrew Alderwick | ||
10 | |||
11 | Permission to use, copy, modify, and distribute this software for any | ||
12 | purpose with or without fee is hereby granted, provided that the above | ||
13 | copyright notice and this permission notice appear in all copies. | ||
14 | |||
15 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
16 | WITH REGARD TO THIS SOFTWARE. | ||
17 | */ | ||
18 | |||
19 | typedef unsigned char Uint8; | ||
20 | typedef unsigned short Uint16; | ||
21 | typedef unsigned int Uint32; | ||
22 | |||
23 | typedef struct Ppu { | ||
24 | Uint8 *bg, *fg; | ||
25 | Uint16 hor, ver, pad, width, height; | ||
26 | Uint16 *output, colors[4]; | ||
27 | } Ppu; | ||
28 | |||
29 | int initppu(Ppu *p, Uint8 hor, Uint8 ver, Uint8 pad); | ||
30 | void putcolors(Ppu *p, Uint8 *addr); | ||
31 | void putpixel(Ppu *p, Uint8 *layer, Uint16 x, Uint16 y, Uint8 color); | ||
32 | void puticn(Ppu *p, Uint8 *layer, Uint16 x, Uint16 y, Uint8 *sprite, Uint8 color, Uint8 flipx, Uint8 flipy); | ||
33 | void putchr(Ppu *p, Uint8 *layer, Uint16 x, Uint16 y, Uint8 *sprite, Uint8 color, Uint8 flipx, Uint8 flipy); | ||
34 | void drawppu(Ppu *p); | ||
35 | void drawdebugger(Ppu *p, Uint8 *stack, Uint8 ptr); | ||
36 | #endif // UXNGBA_PPU_H | ||