From 65e93275c17c14eea06d495958ed77fe569ce8f1 Mon Sep 17 00:00:00 2001 From: alekseiplusplus Date: Mon, 1 May 2023 14:16:00 +1000 Subject: changed directory structure, and other minor stuff --- src/apple.h | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 src/apple.h (limited to 'src/apple.h') diff --git a/src/apple.h b/src/apple.h new file mode 100644 index 0000000..5946374 --- /dev/null +++ b/src/apple.h @@ -0,0 +1,39 @@ +#define MEMORY_SIZE 4096 + +#define XAML 0x24 +#define XAMH 0x25 +#define STL 0x26 +#define STH 0x27 +#define L 0x28 +#define H 0x29 +#define YSAV 0x2A +#define MODE 0x2B + +#define KBD 0xD010 +#define KBD_CR 0xD011 +#define DSP 0xD012 +#define DSP_CR 0xD013 + + +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; +} + -- cgit v1.2.3