diff options
author | alekseiplusplus <alekseijeaves@protonmail.com> | 2023-05-01 11:00:25 +1000 |
---|---|---|
committer | alekseiplusplus <alekseijeaves@protonmail.com> | 2023-05-01 11:00:25 +1000 |
commit | 8f09f4249cec8ccc187b3f9ee5094fb3080900a9 (patch) | |
tree | fef74c955ebba3c7815e2981857a07c95b1a97c9 /headers/6502.h | |
parent | 138bb8eeb4b67ab17a6d77e7afa9cd265759da0d (diff) |
memory access thru function; will be vital later.
Diffstat (limited to 'headers/6502.h')
-rw-r--r-- | headers/6502.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/headers/6502.h b/headers/6502.h index 0835f36..3a48edc 100644 --- a/headers/6502.h +++ b/headers/6502.h @@ -1,8 +1,11 @@ // 6502.h // Core elements of the 6502 CPU -typedef unsigned char byte; -typedef unsigned short address; +typedef unsigned char\ + byte; +typedef unsigned short\ + address; + byte acc, X, Y, P, S = 0x00; address PC = 0x0000; byte* Memory; // TO DO. Add expansion capability to memory. @@ -106,8 +109,15 @@ void setFlagZ(int x){ }*/ +// Memory Manipulation +//need to add special conditions for D0 and FF +byte getMemory(address x){ + return Memory[x]; +} - +void setMemory(address x, byte y){ + Memory[x] = y; +} |