From a11980fe90fe62588fdf8103d9ef418283b3fd27 Mon Sep 17 00:00:00 2001 From: alekseiplusplus Date: Sat, 5 Aug 2023 05:32:54 +1000 Subject: major refactor; doesn't compile (see ToDo) --- src/apple.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/apple.c (limited to 'src/apple.c') diff --git a/src/apple.c b/src/apple.c new file mode 100644 index 0000000..9886d2c --- /dev/null +++ b/src/apple.c @@ -0,0 +1,23 @@ +#include"apple.h" + + +void AppleOn(){ + Memory = calloc(MEMORY_SIZE, sizeof(byte)); + initInstructionTable(); +} + +void AppleReset(){ + acc = 0; X = 0; Y = 0; P = 0; S = 0; + idata.cycles = 0; idata.length = 0; idata.add = 0; idata.value = 0; + free(Memory); + Memory = calloc(MEMORY_SIZE, sizeof(byte)); +} + + +byte getMemory(address x){ + return Memory[x]; +} + +void setMemory(address x, byte y){ + Memory[x] = y; +} \ No newline at end of file -- cgit v1.2.3