aboutsummaryrefslogtreecommitdiffstats
path: root/src/ppu.h
blob: b5eb250a71ab4dfd83526d460a854d98941cb069 (plain)
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
#ifndef UXNGBA_PPU_H
#define UXNGBA_PPU_H

#include <stdio.h>
#include <stdlib.h>

/*
Copyright (c) 2021 Devine Lu Linvega
Copyright (c) 2021 Andrew Alderwick
Copyright (c) 2021 Bad Diode

Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE.
*/

typedef struct Ppu {
	u32 *bg, *fg;
	u16 hor, ver, pad, width, height;
} Ppu;

int initppu(Ppu *p, u8 hor, u8 ver, u8 pad);
void putcolors(u8 *addr);
void ppu_pixel(u32 *layer, u16 x, u16 y, u8 color);
void ppu_1bpp(u32 *layer, u16 x, u16 y, u8 *sprite, u8 color, u8 flipx, u8 flipy);
void ppu_2bpp(u32 *layer, u16 x, u16 y, u8 *sprite, u8 color, u8 flipx, u8 flipy);
#endif // UXNGBA_PPU_H