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 7 // would be 6 but due to high demand we invited green into the mix because green is cool <3
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
16// i might work on better names another time xP
17static const uint32_t
18COTTOLETTE[COTTOLETTE_SIZE] = {
19 0xFF000000, // 0 - black
20 0xFFFFFFFF, // 1 - white
21 0xFF28262C, // 2 - rey
22 0xFFA9A0CF, // 3 - wist
23 0xFFE4D8FD, // 4 - wink
24 0xFFF9F5FF, // 5 - laven
25 0xFFD0F0C0, // 6 - the dude nobody invited (geen)
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} Cotton;
52
53void cotton_init
54(Cotton *c);
55void cotton_store_var
56(Cotton *cotton, const char *name, const char *value);
57
58#endif