1#ifndef COTTON_H
2#define COTTON_H
3
4#include <stdint.h>
5
6#define MEMORY_SIZE (64 * 1024)
7#define VIDEO_WIDTH 250
8#define VIDEO_HEIGHT 200
9
10#define COTTOLETTE_SIZE 8
11
12#define VARS 32 // i think this is enough,, not like cot programs can be that complex rn anyway :P
13#define VAR_NAME_LEN 16
14#define VAR_VAL_LEN 32
15
16static const uint32_t
17COTTOLETTE[COTTOLETTE_SIZE] = {
18 0xFF1C1C1C, // 0 - blabla
19 0xFFFAFAFA, // 1 - whie
20 0xFFECE3FF, // 2 - lav
21 0xFFE4D8FD, // 3 - wink
22 0xFFD4C5F5, // 4 - sink
23 0xFFA9A0CF, // 5 - wist
24 0xFFFFFBDA, // 6 - yebow (random kid)
25 0xFFD0F0C0 // 7 - geen (the (first) dude nobody invited)
26};
27
28typedef struct
29{
30 char name[VAR_NAME_LEN];
31 char value[VAR_VAL_LEN];
32} CotVar;
33
34typedef struct
35{
36 uint8_t memory[MEMORY_SIZE];
37 uint32_t video[VIDEO_WIDTH * VIDEO_HEIGHT];
38
39 // i cant come up with a better name that gets straight to the point than
40 // "cursor" so ig it will stay this way for now,,
41 int cursor_x;
42 int cursor_y;
43
44 uint32_t ticktock;
45 uint32_t c_cottolette; // id write "current_cottolete" but that would be
46 // alot to type and im lazyyyyyyy bwaaaaaa
47
48 CotVar vars[VARS];
49 int var_count;
50
51 int stack[32];
52 int stack_p;
53
54} Cotton;
55
56void cotton_init
57(Cotton *c);
58void cotton_store_var
59(Cotton *cotton, const char *name, const char *value);
60
61#endif
62