-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathsys_processor.h
More file actions
53 lines (43 loc) · 2.07 KB
/
sys_processor.h
File metadata and controls
53 lines (43 loc) · 2.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// *******************************************************************************************************************************
// *******************************************************************************************************************************
//
// Name: sys_processor.h
// Purpose: Processor Emulation (header)
// Created: 29th June 2022
// Author: Paul Robson ([email protected])
//
// *******************************************************************************************************************************
// *******************************************************************************************************************************
#ifndef _PROCESSOR_H
#define _PROCESSOR_H
#define MEMSIZE (0x100000) // 1Mb of Memory.
#define PAGE_MONITOR (MONITOR_ADDRESS >> 13) // Page the boot ROM is loaded into.
#define PAGE_BASIC (BASIC_ADDRESS >> 13) // Page(s) the basic ROM is loaded into.
#define PAGE_SOURCE (SOURCE_ADDRESS >> 13) // Page the source is loaded into.
#define PAGE_SPRITES (SPRITE_ADDRESS >> 13) // Page the sprites are loaded into.
typedef unsigned short WORD16; // 8 and 16 bit types.
typedef unsigned char BYTE8;
typedef unsigned int LONG32; // 32 bit type.
#define DEFAULT_BUS_VALUE (0xFF) // What's on the bus if it's not memory.
#define AKEY_BACKSPACE (0x5F) // Apple Backspace
void CPUReset(void);
BYTE8 CPUExecuteInstruction(void);
BYTE8 CPUWriteKeyboard(BYTE8 pattern);
BYTE8 CPUReadMemory(WORD16 address);
BYTE8 *CPUAccessMemory(void);
void CPUInterruptMaskable(void);
typedef struct __CPUSTATUS {
int a,x,y,sp,pc;
int carry,zero,sign,interruptDisable,decimal,brk,overflow,status;
int cycles;
int mapping[8];
} CPUSTATUS;
CPUSTATUS *CPUGetStatus(void);
BYTE8 CPUExecute(WORD16 breakPoint1,WORD16 breakPoint2);
WORD16 CPUGetStepOverBreakpoint(void);
void CPUWriteMemory(WORD16 address,BYTE8 data);
void CPUEndRun(void);
void CPULoadBinary(char *fileName);
void CPUExit(void);
void CPUSaveArguments(int argc,char *argv[]);
#endif