aboutsummaryrefslogtreecommitdiff
path: root/src/env.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/env.h')
-rw-r--r--src/env.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/env.h b/src/env.h
index 53e4191..3cd23e8 100644
--- a/src/env.h
+++ b/src/env.h
@@ -7,6 +7,8 @@
#include "pico8.h"
#include "wasmrt.h"
+#define PW_ENV_GPIO_SIZE 128
+
/**
* A host execution context.
*
@@ -30,15 +32,26 @@ struct w2c_env {
struct wasm_rt_memory_t memory;
struct wasm_rt_funcref_table_t table;
struct pw_env_ctx context;
+
struct pw_env_data {
uint32_t dynamictop;
uint32_t tablebase;
uint32_t mainloop;
uint32_t errstr;
uint32_t tempret;
+ uint32_t cartpos;
+ struct {
+ uint32_t index;
+ uint32_t pos;
+ } cartname;
uint32_t command;
uint32_t commandp;
- bool exit;
+ struct {
+ bool pointerlock;
+ volatile bool shutdown;
+ } state;
+ uint32_t btn;
+ uint8_t gpio[PW_ENV_GPIO_SIZE];
} data;
};