#ifndef CORE_H_ #define CORE_H_ #include "bang.h" #include "dev.h" typedef struct { u8 mem[256]; u8 p; } Stack; typedef struct { bool alive; // True when program is not halted bool awake; // True when program is not asleep u8 mem[65536]; // Program memory u16 ip; // Instruction pointer Stack wst, rst; // Working and return stacks DeviceBus dev; // Device bus } Bedrock; // Methods. void br_reset(Bedrock *br); void br_load(Bedrock *br, u8 program[], int size); void br_rouse(Bedrock *br); void br_run(Bedrock *br); #endif