-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.h
55 lines (43 loc) · 799 Bytes
/
main.h
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
49
50
51
52
53
54
#ifndef MAIN_H
#define MAIN_H
#include <stdint.h>
#include "vm.h"
#ifndef TARGET_HZ
#define TARGET_HZ 60
#endif
#ifndef FRAME_LIM
#define FRAME_LIM -1
#endif
#define GETCH_HZ 15
typedef enum
{
V_NCURSES,
V_SDL
} video_t;
typedef enum
{
A_PULSE,
A_SDL
} audio_t;
typedef enum
{
EXIT_OK = 0,
EXIT_BAD_FILE,
EXIT_BAD_MALLOC,
EXIT_BAD_FREAD,
EXIT_BAD_PULSE,
EXIT_VM_ERROR,
EXIT_BAD_ARGS,
EXIT_BAD_OPTION
} exit_t;
void save(uint8_t *registers, int x);
void load(uint8_t *registers, int x);
int8_t input();
int8_t blockinginput();
void showinp(int inp);
void pabeep();
uint8_t randint();
void memdump(vm_t *vm);
uint8_t itocoord(int i, int *x, int *y, int width, int size);
uint8_t coordtoi(int *i, int x, int y, int width, int height);
#endif