-
-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathgameboy.h
More file actions
43 lines (32 loc) · 616 Bytes
/
gameboy.h
File metadata and controls
43 lines (32 loc) · 616 Bytes
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
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#define CYCLES 70224
#define HEIGHT 144
#define WIDTH 160
typedef enum KeypadKey {
Right,
Left,
Up,
Down,
A,
B,
Select,
Start,
} KeypadKey;
typedef struct ImageBuffer {
int32_t len;
const uint8_t *data;
} ImageBuffer;
/**
* # Safety
*
* This function is not safe due to from_raw_parts.
*/
void load(const unsigned char *bytes, uintptr_t bytes_length);
void frame(void);
void keydown(enum KeypadKey key);
void keyup(enum KeypadKey key);
struct ImageBuffer image(void);
const char *image_base64(void);