Monorepo for Aesthetic.Computer
aesthetic.computer
1// Generated by kidlisp-to-pd.mjs
2// Do not edit - regenerate from source
3
4#include <stdio.h>
5#include <stdlib.h>
6#include "pd_api.h"
7#include "kidlisp.h"
8
9// Temp string buffer for number display
10static char temp_str[32];
11
12// Source code label
13static const char* source_name = "bop";
14static const char* source_lines[] = {
15 "ink black, line, scroll 1 -1, blur 5"
16};
17static const int source_line_count = 1;
18
19// Forward declarations
20static int update(void* userdata);
21
22// === Variables ===
23
24// === Main Loop ===
25static void kidlisp_main(void) {
26 kl_ink(KL_BLACK);
27 kl_line_random();
28 kl_scroll(1, -1);
29 kl_blur(5);
30}
31
32// Draw source code HUD directly with outlined text (after effects)
33static void draw_source_hud(void) {
34 // Draw source lines (compact, 8px spacing)
35 for (int i = 0; i < source_line_count && i < 5; i++) {
36 kl_write_outlined(source_lines[i], 5, 4 + i * 8);
37 }
38
39 // Draw QR code in bottom right
40 kl_draw_qr();
41}
42
43// Playdate event handler
44#ifdef _WINDLL
45__declspec(dllexport)
46#endif
47int eventHandler(PlaydateAPI* pd, PDSystemEvent event, uint32_t arg) {
48 (void)arg;
49
50 if (event == kEventInit) {
51 kl_init(pd);
52 pd->system->setUpdateCallback(update, pd);
53 }
54
55 return 0;
56}
57
58// Frame update
59static int update(void* userdata) {
60 (void)userdata;
61 kl_update();
62 kidlisp_main();
63 draw_source_hud();
64 return 1;
65}