summaryrefslogtreecommitdiff
path: root/src/cpu/core.h
diff options
context:
space:
mode:
authoralekseiplusplus <alekseijeaves@protonmail.com>2023-12-08 06:52:14 +1100
committeralekseiplusplus <alekseijeaves@protonmail.com>2023-12-08 06:52:14 +1100
commitd28ad56810b43cb3ea5d11e5e32042f69ee04562 (patch)
tree0d0fd8976b253bf6aafed6e1449a1d4e69f658ab /src/cpu/core.h
parent5012497d6e59d787195d177d02faa55242bf7e40 (diff)
major refactor of cpu code
Diffstat (limited to 'src/cpu/core.h')
-rw-r--r--src/cpu/core.h31
1 files changed, 9 insertions, 22 deletions
diff --git a/src/cpu/core.h b/src/cpu/core.h
index 7c0f284..f83002f 100644
--- a/src/cpu/core.h
+++ b/src/cpu/core.h
@@ -1,12 +1,9 @@
#pragma once
-typedef
-unsigned char
-byte;
+#include <stdint.h>
-typedef
-unsigned short
-address;
+typedef uint8_t byte;
+typedef uint16_t address;
extern byte acc;
extern byte X;
@@ -17,7 +14,6 @@ extern address PC;
extern byte* Memory;
extern byte ROM[];
-
enum Addressing
{
eImmediate,
@@ -34,28 +30,19 @@ enum Addressing
eIndirectAbsolute,
eRelative
};
+
typedef
int
Addressing;
-typedef
-struct AddData
+struct State
{
int cycles;
int length;
- address add;
+ address address;
byte value;
-}
-AddData;
-
-
-
-// GetMemory and SetMemory are declared here, but defined in apple.c
-// This is because memory access of particular memory locations is influenced by the Apple I's specific setup, not by the CPU alone.
-byte GetMemory(address x);
-void SetMemory(address x, byte y);
+};
-extern void *current_instruction;
-extern AddData idata;
-extern void (*func)(Addressing);
+extern struct State state;
+extern void (*Instruction)(Addressing);