git @ Cat's Eye Technologies linapple / 2011863
Global formatting: replace tabs with two spaces. ghedger 4 years ago
57 changed file(s) with 38706 addition(s) and 38706 deletion(s). Raw diff Collapse all Expand all
33
44 typedef struct _STWriteHandler
55 {
6 void* objTo;
7 mem_write_handler func;
6 void* objTo;
7 mem_write_handler func;
88 } STWriteHandler;
99
1010 //
1111
12 #define PIA_DDRA 0
13 #define PIA_CTLA 1
14 #define PIA_DDRB 2
15 #define PIA_CTLB 3
12 #define PIA_DDRA 0
13 #define PIA_CTLA 1
14 #define PIA_DDRB 2
15 #define PIA_CTLB 3
1616
1717 class C6821
1818 {
1919 public:
20 C6821();
21 virtual ~C6821();
20 C6821();
21 virtual ~C6821();
2222
23 BYTE GetPB();
24 BYTE GetPA();
25 void SetPB(BYTE byData);
26 void SetPA(BYTE byData);
27 void SetCA1( BYTE byData );
28 void SetCA2( BYTE byData );
29 void SetCB1( BYTE byData );
30 void SetCB2( BYTE byData );
31 void Reset();
32 BYTE Read( BYTE byRS );
33 void Write( BYTE byRS, BYTE byData );
23 BYTE GetPB();
24 BYTE GetPA();
25 void SetPB(BYTE byData);
26 void SetPA(BYTE byData);
27 void SetCA1( BYTE byData );
28 void SetCA2( BYTE byData );
29 void SetCB1( BYTE byData );
30 void SetCB2( BYTE byData );
31 void Reset();
32 BYTE Read( BYTE byRS );
33 void Write( BYTE byRS, BYTE byData );
3434
35 void UpdateInterrupts();
35 void UpdateInterrupts();
3636
37 void SetListenerA( void *objTo, mem_write_handler func );
38 void SetListenerB( void *objTo, mem_write_handler func );
39 void SetListenerCA2( void *objTo, mem_write_handler func );
40 void SetListenerCB2( void *objTo, mem_write_handler func );
37 void SetListenerA( void *objTo, mem_write_handler func );
38 void SetListenerB( void *objTo, mem_write_handler func );
39 void SetListenerCA2( void *objTo, mem_write_handler func );
40 void SetListenerCB2( void *objTo, mem_write_handler func );
4141
4242 protected:
43 BYTE m_byIA;
44 BYTE m_byCA1;
45 BYTE m_byICA2;
46 BYTE m_byOA;
47 BYTE m_byOCA2;
48 BYTE m_byDDRA;
49 BYTE m_byCTLA;
50 BYTE m_byIRQAState;
43 BYTE m_byIA;
44 BYTE m_byCA1;
45 BYTE m_byICA2;
46 BYTE m_byOA;
47 BYTE m_byOCA2;
48 BYTE m_byDDRA;
49 BYTE m_byCTLA;
50 BYTE m_byIRQAState;
5151
52 BYTE m_byIB;
53 BYTE m_byCB1;
54 BYTE m_byICB2;
55 BYTE m_byOB;
56 BYTE m_byOCB2;
57 BYTE m_byDDRB;
58 BYTE m_byCTLB;
59 BYTE m_byIRQBState;
52 BYTE m_byIB;
53 BYTE m_byCB1;
54 BYTE m_byICB2;
55 BYTE m_byOB;
56 BYTE m_byOCB2;
57 BYTE m_byDDRB;
58 BYTE m_byCTLB;
59 BYTE m_byIRQBState;
6060
61 STWriteHandler m_stOutA;
62 STWriteHandler m_stOutB;
63 STWriteHandler m_stOutCA2;
64 STWriteHandler m_stOutCB2;
65 STWriteHandler m_stOutIRQA;
66 STWriteHandler m_stOutIRQB;
61 STWriteHandler m_stOutA;
62 STWriteHandler m_stOutB;
63 STWriteHandler m_stOutCA2;
64 STWriteHandler m_stOutCB2;
65 STWriteHandler m_stOutIRQA;
66 STWriteHandler m_stOutIRQB;
6767 };
00 #pragma once
11
22 #ifdef _WIN32
3 #define FILE_SEPARATOR TEXT('\\')
3 #define FILE_SEPARATOR TEXT('\\')
44 #else
5 #define FILE_SEPARATOR TEXT('/')
5 #define FILE_SEPARATOR TEXT('/')
66 #endif
77
8 #define FTP_SEPARATOR TEXT('/')
8 #define FTP_SEPARATOR TEXT('/')
99
1010 // let it be our second version!
11 #define LINAPPLE_VERSION 2
11 #define LINAPPLE_VERSION 2
1212
1313 #include <curl/curl.h>
1414
1515 extern FILE * spMono,*spStereo;
1616
17 extern char VERSIONSTRING[]; // Contructed in WinMain()
17 extern char VERSIONSTRING[]; // Contructed in WinMain()
1818
1919 extern TCHAR *g_pAppTitle;
2020
21 extern eApple2Type g_Apple2Type;
21 extern eApple2Type g_Apple2Type;
2222
2323 extern BOOL behind;
2424 extern DWORD cumulativecycles;
5050 //extern TCHAR g_sFTPPass[256]; // password
5151 extern TCHAR g_sFTPUserPass[512]; // full login line
5252
53 extern CURL * g_curl;
53 extern CURL * g_curl;
5454
5555
5656 extern bool g_bResetTiming;
6262 extern int g_nCpuCyclesFeedback;
6363 extern DWORD g_dwCyclesThisFrame;
6464
65 extern FILE* g_fh; // Filehandle for log file
66 extern bool g_bDisableDirectSound; // Cmd line switch: don't init DS (so no MB support)
65 extern FILE* g_fh; // Filehandle for log file
66 extern bool g_bDisableDirectSound; // Cmd line switch: don't init DS (so no MB support)
6767
68 extern UINT g_Slot4; // Mockingboard or Mouse in slot4
68 extern UINT g_Slot4; // Mockingboard or Mouse in slot4
6969
7070 void SetCurrentCLK6502();
1818 ULONG CpuGetCyclesThisFrame(ULONG nExecutedCycles);
1919 void CpuInitialize ();
2020 void CpuSetupBenchmark ();
21 void CpuIrqReset();
22 void CpuIrqAssert(eIRQSRC Device);
23 void CpuIrqDeassert(eIRQSRC Device);
24 void CpuNmiReset();
25 void CpuNmiAssert(eIRQSRC Device);
26 void CpuNmiDeassert(eIRQSRC Device);
21 void CpuIrqReset();
22 void CpuIrqAssert(eIRQSRC Device);
23 void CpuIrqDeassert(eIRQSRC Device);
24 void CpuNmiReset();
25 void CpuNmiAssert(eIRQSRC Device);
26 void CpuNmiDeassert(eIRQSRC Device);
2727 void CpuReset ();
2828 DWORD CpuGetSnapshot(SS_CPU6502* pSS);
2929 DWORD CpuSetSnapshot(SS_CPU6502* pSS);
33
44 const double _M14 = (157500000.0 / 11.0); // 14.3181818... * 10^6
55 const double CLK_6502 = ((_M14 * 65.0) / 912.0); // 65 cycles per 912 14M clocks
6 //const double CLK_6502 = 23 * 44100; // 1014300
6 //const double CLK_6502 = 23 * 44100; // 1014300
77
88 // The effective Z-80 clock rate is 2.041MHz
99 // See: http://www.apple2info.net/hardware/softcard/SC-SWHW_a2in.pdf
1010 const double CLK_Z80 = (CLK_6502 * 2);
1111
12 const UINT uCyclesPerLine = 65; // 25 cycles of HBL & 40 cycles of HBL'
13 const UINT uVisibleLinesPerFrame = 64*3; // 192
14 const UINT uLinesPerFrame = 262; // 64 in each third of the screen & 70 in VBL
15 const DWORD dwClksPerFrame = uCyclesPerLine * uLinesPerFrame; // 17030
12 const UINT uCyclesPerLine = 65; // 25 cycles of HBL & 40 cycles of HBL'
13 const UINT uVisibleLinesPerFrame = 64*3; // 192
14 const UINT uLinesPerFrame = 262; // 64 in each third of the screen & 70 in VBL
15 const DWORD dwClksPerFrame = uCyclesPerLine * uLinesPerFrame; // 17030
1616
1717 #define NUM_SLOTS 8
1818
1919 #define MAX(a,b) (((a) > (b)) ? (a) : (b))
2020 #define MIN(a,b) (((a) < (b)) ? (a) : (b))
2121
22 #define RAMWORKS // 8MB RamWorks III support
22 #define RAMWORKS // 8MB RamWorks III support
2323
24 #define MOCKINGBOARD // Mockingboard support
24 #define MOCKINGBOARD // Mockingboard support
2525 //#define MB_SPEECH
2626
2727 // Use a base freq so that DirectX (or sound h/w) doesn't have to up/down-sample
2828 // Assume base freqs are 44.1KHz & 48KHz
29 const DWORD SPKR_SAMPLE_RATE = 44100; // that is for Apple][ speakers
30 const DWORD SAMPLE_RATE = 44100; // that is for Phasor/Mockingboard?
29 const DWORD SPKR_SAMPLE_RATE = 44100; // that is for Apple][ speakers
30 const DWORD SAMPLE_RATE = 44100; // that is for Phasor/Mockingboard?
3131
3232 enum AppMode_e
3333 {
34 MODE_LOGO = 0
35 , MODE_PAUSED
36 , MODE_RUNNING // 6502 is running at normal speed (Debugger breakpoints may or may not be active)
37 , MODE_DEBUG // 6502 is paused
38 , MODE_STEPPING // 6502 is running at full speed (Debugger breakpoints always active)
34 MODE_LOGO = 0
35 , MODE_PAUSED
36 , MODE_RUNNING // 6502 is running at normal speed (Debugger breakpoints may or may not be active)
37 , MODE_DEBUG // 6502 is paused
38 , MODE_STEPPING // 6502 is running at full speed (Debugger breakpoints always active)
3939 };
4040
4141 #define SPEED_MIN 0
6161 #define BTN_SAVEST 10
6262 #define BTN_LOADST 9
6363
64 //#define MAXIMAGES 16
64 //#define MAXIMAGES 16
6565
6666 // TODO: Move to StringTable.h
67 #define TITLE_APPLE_2 ("Apple ][ Emulator")
68 #define TITLE_APPLE_2_PLUS TEXT("Apple ][+ Emulator")
69 #define TITLE_APPLE_2E TEXT("Apple //e Emulator")
70 #define TITLE_APPLE_2E_ENHANCED TEXT("Enhanced Apple //e Emulator")
67 #define TITLE_APPLE_2 ("Apple ][ Emulator")
68 #define TITLE_APPLE_2_PLUS TEXT("Apple ][+ Emulator")
69 #define TITLE_APPLE_2E TEXT("Apple //e Emulator")
70 #define TITLE_APPLE_2E_ENHANCED TEXT("Enhanced Apple //e Emulator")
7171
7272 #define TITLE_PAUSED TEXT(" Paused ")
7373 #define TITLE_STEPPING TEXT("Stepping")
112112 //#define REGVALUE_FTP_USER TEXT("FTP User")
113113 //#define REGVALUE_FTP_PASS TEXT("FTP Pass")
114114
115 #define WM_USER_BENCHMARK WM_USER+1
116 #define WM_USER_RESTART WM_USER+2
117 #define WM_USER_SAVESTATE WM_USER+3
118 #define WM_USER_LOADSTATE WM_USER+4
115 #define WM_USER_BENCHMARK WM_USER+1
116 #define WM_USER_RESTART WM_USER+2
117 #define WM_USER_SAVESTATE WM_USER+3
118 #define WM_USER_LOADSTATE WM_USER+4
119119
120 enum eSOUNDCARDTYPE {SC_UNINIT=0, SC_NONE, SC_MOCKINGBOARD, SC_PHASOR}; // Apple soundcard type
120 enum eSOUNDCARDTYPE {SC_UNINIT=0, SC_NONE, SC_MOCKINGBOARD, SC_PHASOR}; // Apple soundcard type
121121
122122 typedef BYTE (*iofunction)(WORD nPC, WORD nAddr, BYTE nWriteFlag, BYTE nWriteValue, ULONG nCyclesLeft);
123123
127127
128128 //
129129
130 #define APPLE2E_MASK 0x10
131 #define APPLE2C_MASK 0x20
130 #define APPLE2E_MASK 0x10
131 #define APPLE2C_MASK 0x20
132132
133 #define IS_APPLE2 ((g_Apple2Type & (APPLE2E_MASK|APPLE2C_MASK)) == 0)
134 #define IS_APPLE2E (g_Apple2Type & APPLE2E_MASK)
135 #define IS_APPLE2C (g_Apple2Type & APPLE2C_MASK)
133 #define IS_APPLE2 ((g_Apple2Type & (APPLE2E_MASK|APPLE2C_MASK)) == 0)
134 #define IS_APPLE2E (g_Apple2Type & APPLE2E_MASK)
135 #define IS_APPLE2C (g_Apple2Type & APPLE2C_MASK)
136136
137137 // NB. These get persisted to the Registry, so don't change the values for these enums!
138138 enum eApple2Type {
139 A2TYPE_APPLE2=0,
140 A2TYPE_APPLE2PLUS,
141 A2TYPE_APPLE2E=APPLE2E_MASK,
142 A2TYPE_APPLE2EEHANCED,
143 // A2TYPE_APPLE2C=APPLE2C_MASK, // Placeholder
144 A2TYPE_MAX
145 };
139 A2TYPE_APPLE2=0,
140 A2TYPE_APPLE2PLUS,
141 A2TYPE_APPLE2E=APPLE2E_MASK,
142 A2TYPE_APPLE2EEHANCED,
143 // A2TYPE_APPLE2C=APPLE2C_MASK, // Placeholder
144 A2TYPE_MAX
145 };
146146
147147 enum eBUTTON {BUTTON0=0, BUTTON1};
148148 enum eBUTTONSTATE {BUTTON_UP=0, BUTTON_DOWN};
149149
150150 // sizes of status panel
151 #define STATUS_PANEL_W 100
152 #define STATUS_PANEL_H 48
151 #define STATUS_PANEL_W 100
152 #define STATUS_PANEL_H 48
1616 // Globals __________________________________________________________________
1717
1818 // Benchmarking
19 extern DWORD extbench;
19 extern DWORD extbench;
2020
2121 // Bookmarks
22 extern int g_nBookmarks;
23 extern Bookmark_t g_aBookmarks[ MAX_BOOKMARKS ];
24 // extern vector<int> g_aBookmarks;
22 extern int g_nBookmarks;
23 extern Bookmark_t g_aBookmarks[ MAX_BOOKMARKS ];
24 // extern vector<int> g_aBookmarks;
2525
2626 // Breakpoints
27 extern int g_nBreakpoints;
28 extern Breakpoint_t g_aBreakpoints[ MAX_BREAKPOINTS ];
27 extern int g_nBreakpoints;
28 extern Breakpoint_t g_aBreakpoints[ MAX_BREAKPOINTS ];
2929
30 extern const char *g_aBreakpointSource [ NUM_BREAKPOINT_SOURCES ];
31 extern const TCHAR *g_aBreakpointSymbols[ NUM_BREAKPOINT_OPERATORS ];
30 extern const char *g_aBreakpointSource [ NUM_BREAKPOINT_SOURCES ];
31 extern const TCHAR *g_aBreakpointSymbols[ NUM_BREAKPOINT_OPERATORS ];
3232
33 // Full-Speed debugging
34 extern int g_nDebugOnBreakInvalid;
35 extern int g_iDebugOnOpcode ;
36 extern bool g_bDebugDelayBreakCheck;
33 // Full-Speed debugging
34 extern int g_nDebugOnBreakInvalid;
35 extern int g_iDebugOnOpcode ;
36 extern bool g_bDebugDelayBreakCheck;
3737
3838 // Commands
39 extern const int NUM_COMMANDS_WITH_ALIASES; // = sizeof(g_aCommands) / sizeof (Command_t); // Determined at compile-time ;-)
40 extern int g_iCommand; // last command
39 extern const int NUM_COMMANDS_WITH_ALIASES; // = sizeof(g_aCommands) / sizeof (Command_t); // Determined at compile-time ;-)
40 extern int g_iCommand; // last command
4141
42 extern Command_t g_aCommands[];
43 extern Command_t g_aParameters[];
42 extern Command_t g_aCommands[];
43 extern Command_t g_aParameters[];
4444
4545 // Config - FileName
46 extern char g_sFileNameConfig[];
46 extern char g_sFileNameConfig[];
4747
4848 // Cursor
49 extern WORD g_nDisasmTopAddress ;
50 extern WORD g_nDisasmBotAddress ;
51 extern WORD g_nDisasmCurAddress ;
49 extern WORD g_nDisasmTopAddress ;
50 extern WORD g_nDisasmBotAddress ;
51 extern WORD g_nDisasmCurAddress ;
5252
53 extern bool g_bDisasmCurBad ;
54 extern int g_nDisasmCurLine ; // Aligned to Top or Center
53 extern bool g_bDisasmCurBad ;
54 extern int g_nDisasmCurLine ; // Aligned to Top or Center
5555 extern int g_iDisasmCurState ;
5656
57 extern int g_nDisasmWinHeight;
57 extern int g_nDisasmWinHeight;
5858
59 extern const int WINDOW_DATA_BYTES_PER_LINE;
59 extern const int WINDOW_DATA_BYTES_PER_LINE;
6060
6161 // Config - Disassembly
62 extern bool g_bConfigDisasmAddressColon ;
63 extern bool g_bConfigDisasmOpcodesView ;
64 extern bool g_bConfigDisasmOpcodeSpaces ;
65 extern int g_iConfigDisasmTargets ;
66 extern int g_iConfigDisasmBranchType ;
67 extern int g_bConfigDisasmImmediateChar;
62 extern bool g_bConfigDisasmAddressColon ;
63 extern bool g_bConfigDisasmOpcodesView ;
64 extern bool g_bConfigDisasmOpcodeSpaces ;
65 extern int g_iConfigDisasmTargets ;
66 extern int g_iConfigDisasmBranchType ;
67 extern int g_bConfigDisasmImmediateChar;
6868 // Config - Info
69 extern bool g_bConfigInfoTargetPointer ;
69 extern bool g_bConfigInfoTargetPointer ;
7070
7171 // Disassembly
72 // extern int g_aDisasmTargets[ MAX_DISPLAY_LINES ];
72 // extern int g_aDisasmTargets[ MAX_DISPLAY_LINES ];
7373
7474 // Display
75 extern bool g_bDebuggerViewingAppleOutput;
75 extern bool g_bDebuggerViewingAppleOutput;
7676
7777 // Font
78 extern int g_nFontHeight;
79 extern int g_iFontSpacing;
78 extern int g_nFontHeight;
79 extern int g_iFontSpacing;
8080
8181 // Memory
82 extern MemoryDump_t g_aMemDump[ NUM_MEM_DUMPS ];
82 extern MemoryDump_t g_aMemDump[ NUM_MEM_DUMPS ];
8383
84 // extern MemorySearchArray_t g_vMemSearchMatches;
85 extern vector<int> g_vMemorySearchResults;
84 // extern MemorySearchArray_t g_vMemSearchMatches;
85 extern vector<int> g_vMemorySearchResults;
8686
8787 // Source Level Debugging
88 extern TCHAR g_aSourceFileName[ MAX_PATH ];
89 // extern MemoryTextFile_t g_AssemblerSourceBuffer;
88 extern TCHAR g_aSourceFileName[ MAX_PATH ];
89 // extern MemoryTextFile_t g_AssemblerSourceBuffer;
9090
91 extern int g_iSourceDisplayStart ;
92 extern int g_nSourceAssembleBytes ;
93 extern int g_nSourceAssemblySymbols;
91 extern int g_iSourceDisplayStart ;
92 extern int g_nSourceAssembleBytes ;
93 extern int g_nSourceAssemblySymbols;
9494
9595 // Version
96 extern const int DEBUGGER_VERSION;
96 extern const int DEBUGGER_VERSION;
9797
9898 // Watches
99 extern int g_nWatches;
100 extern Watches_t g_aWatches[ MAX_WATCHES ];
99 extern int g_nWatches;
100 extern Watches_t g_aWatches[ MAX_WATCHES ];
101101
102102 // Window
103 extern int g_iWindowLast;
104 extern int g_iWindowThis;
105 extern WindowSplit_t g_aWindowConfig[ NUM_WINDOWS ];
103 extern int g_iWindowLast;
104 extern int g_iWindowThis;
105 extern WindowSplit_t g_aWindowConfig[ NUM_WINDOWS ];
106106
107107 // Zero Page
108 extern int g_nZeroPagePointers;
109 extern ZeroPagePointers_t g_aZeroPagePointers[ MAX_ZEROPAGE_POINTERS ]; // TODO: use vector<> ?
108 extern int g_nZeroPagePointers;
109 extern ZeroPagePointers_t g_aZeroPagePointers[ MAX_ZEROPAGE_POINTERS ]; // TODO: use vector<> ?
110110
111111 // Prototypes _______________________________________________________________
112112
113113 // Bookmarks
114 bool Bookmark_Find( const WORD nAddress );
114 bool Bookmark_Find( const WORD nAddress );
115115
116116 // Breakpoints
117 bool GetBreakpointInfo ( WORD nOffset, bool & bBreakpointActive_, bool & bBreakpointEnable_ );
117 bool GetBreakpointInfo ( WORD nOffset, bool & bBreakpointActive_, bool & bBreakpointEnable_ );
118118
119 // 0 = Brk, 1 = Invalid1, .. 3 = Invalid 3
120 inline bool IsDebugBreakOnInvalid( int iOpcodeType )
121 {
122 bool bActive = (g_nDebugOnBreakInvalid >> iOpcodeType) & 1;
123 return bActive;
124 }
119 // 0 = Brk, 1 = Invalid1, .. 3 = Invalid 3
120 inline bool IsDebugBreakOnInvalid( int iOpcodeType )
121 {
122 bool bActive = (g_nDebugOnBreakInvalid >> iOpcodeType) & 1;
123 return bActive;
124 }
125125
126 inline void SetDebugBreakOnInvalid( int iOpcodeType, int nValue )
127 {
128 if (iOpcodeType <= AM_3)
129 {
130 g_nDebugOnBreakInvalid &= ~ ( 1 << iOpcodeType);
131 g_nDebugOnBreakInvalid |= ((nValue & 1) << iOpcodeType);
132 }
133 }
126 inline void SetDebugBreakOnInvalid( int iOpcodeType, int nValue )
127 {
128 if (iOpcodeType <= AM_3)
129 {
130 g_nDebugOnBreakInvalid &= ~ ( 1 << iOpcodeType);
131 g_nDebugOnBreakInvalid |= ((nValue & 1) << iOpcodeType);
132 }
133 }
134134
135135 // Color
136 inline COLORREF DebuggerGetColor( int iColor );
136 inline COLORREF DebuggerGetColor( int iColor );
137137
138138 // Source Level Debugging
139 int FindSourceLine( WORD nAddress );
140 LPCTSTR FormatAddress( WORD nAddress, int nBytes );
139 int FindSourceLine( WORD nAddress );
140 LPCTSTR FormatAddress( WORD nAddress, int nBytes );
141141
142142 // Symbol Table / Memory
143 bool FindAddressFromSymbol( LPCSTR pSymbol, WORD * pAddress_ = NULL, int * iTable_ = NULL );
144 WORD GetAddressFromSymbol (LPCTSTR symbol); // HACK: returns 0 if symbol not found
145 void SymbolUpdate( Symbols_e eSymbolTable, char *pSymbolName, WORD nAddrss, bool bRemoveSymbol, bool bUpdateSymbol );
143 bool FindAddressFromSymbol( LPCSTR pSymbol, WORD * pAddress_ = NULL, int * iTable_ = NULL );
144 WORD GetAddressFromSymbol (LPCTSTR symbol); // HACK: returns 0 if symbol not found
145 void SymbolUpdate( Symbols_e eSymbolTable, char *pSymbolName, WORD nAddrss, bool bRemoveSymbol, bool bUpdateSymbol );
146146
147 LPCTSTR FindSymbolFromAddress (WORD nAdress, int * iTable_ = NULL );
148 LPCTSTR GetSymbol (WORD nAddress, int nBytes);
147 LPCTSTR FindSymbolFromAddress (WORD nAdress, int * iTable_ = NULL );
148 LPCTSTR GetSymbol (WORD nAddress, int nBytes);
149149
150 Update_t DebuggerProcessCommand( const bool bEchoConsoleInput );
150 Update_t DebuggerProcessCommand( const bool bEchoConsoleInput );
151151
152152 // Prototypes _______________________________________________________________
153153
154 enum
155 {
156 DEBUG_EXIT_KEY = 0x1B, // Escape
157 DEBUG_TOGGLE_KEY = SDLK_F1 + BTN_DEBUG
158 };
154 enum
155 {
156 DEBUG_EXIT_KEY = 0x1B, // Escape
157 DEBUG_TOGGLE_KEY = SDLK_F1 + BTN_DEBUG
158 };
159159
160 void DebugBegin ();
161 void DebugContinueStepping ();
162 void DebugDestroy ();
163 void DebugDisplay (BOOL);
164 void DebugEnd ();
165 void DebugInitialize ();
166 // void DebugProcessChar (TCHAR);
167 void DebuggerInputConsoleChar( TCHAR ch );
168 // void DebugProcessCommand (int);
169 void DebuggerProcessKey( int keycode );
160 void DebugBegin ();
161 void DebugContinueStepping ();
162 void DebugDestroy ();
163 void DebugDisplay (BOOL);
164 void DebugEnd ();
165 void DebugInitialize ();
166 // void DebugProcessChar (TCHAR);
167 void DebuggerInputConsoleChar( TCHAR ch );
168 // void DebugProcessCommand (int);
169 void DebuggerProcessKey( int keycode );
170170
171 void DebuggerUpdate();
172 void DebuggerCursorNext();
171 void DebuggerUpdate();
172 void DebuggerCursorNext();
173173
174 void DebuggerMouseClick( int x, int y );
174 void DebuggerMouseClick( int x, int y );
22
33 // Addressing _____________________________________________________________________________________
44
5 enum
6 {
7 // MAX_ADDRESSING_MODE_LEN = 12
8
9 MAX_OPMODE_FORMAT = 12,
10 MAX_OPMODE_NAME = 32
11
12 , NO_6502_TARGET = -1
13 , _6502_NUM_FLAGS = 8
14 };
15
16 enum RangeType_t
17 {
18 RANGE_MISSING_ARG_2 = 0, // error
19 RANGE_HAS_LEN , // valid case 1
20 RANGE_HAS_END , // valid case 2
21 };
22
23 struct AddressingMode_t
24 {
25 char m_sFormat[ MAX_OPMODE_FORMAT ];
26 int m_nBytes;
27 char m_sName [ MAX_OPMODE_NAME ];
28 };
29
30 /*
5 enum
6 {
7 // MAX_ADDRESSING_MODE_LEN = 12
8
9 MAX_OPMODE_FORMAT = 12,
10 MAX_OPMODE_NAME = 32
11
12 , NO_6502_TARGET = -1
13 , _6502_NUM_FLAGS = 8
14 };
15
16 enum RangeType_t
17 {
18 RANGE_MISSING_ARG_2 = 0, // error
19 RANGE_HAS_LEN , // valid case 1
20 RANGE_HAS_END , // valid case 2
21 };
22
23 struct AddressingMode_t
24 {
25 char m_sFormat[ MAX_OPMODE_FORMAT ];
26 int m_nBytes;
27 char m_sName [ MAX_OPMODE_NAME ];
28 };
29
30 /*
3131 +---------------------+--------------------------+
3232 | Opmode e | assembler format |
3333 +=====================+==========================+
4747 +---------------------+--------------------------+
4848 (Table 2-3. _6502 Software Design_, Scanlon, 1980)
4949
50 Opcode: opc aaa od
51 opc...od = Mnemonic / Opcode
52 ...aaa.. = Addressing g_nAppMode
53 od = 00
54 000 #Immediate
55 001 Zero page
56 011 Absolute
57 101 Zero page,X
58 111 Absolute,X
59 od = 01
60 000 (Zero page,X)
61 001 Zero page
62 010 #Immediate
63 011 Absolute
64 100 (Zero page),Y
65 101 Zero page,X
66 110 Absolute,Y
67 111 Absolute,X
68 od = 10
69 000 #Immediate
70 001 Zero page
71 010 Accumulator
72 011 Absolute
73 101 Zero page,X
74 111 Absolute,X
75 */
76 /*
77 Legend:
78 A = Absolute (fortunately Accumulator is implicit, leaving us to use 'A')
79 I = Indexed ( would of been X, but need reg X)
80 M = iMmediate
81 N = iNdirect
82 R = Relative
83 X = Offset X Register
84 Y = Offset Y Register
85 Z = Zeropage
86 */
87 enum AddressingMode_e // ADDRESSING_MODES_e
88 {
89 AM_IMPLIED // Note: SetDebugBreakOnInvalid() assumes this order of first 4 entries
90 , AM_1 // Invalid 1 Byte
91 , AM_2 // Invalid 2 Bytes
92 , AM_3 // Invalid 3 Bytes
93 , AM_M // 4 #Immediate
94 , AM_A // 5 $Absolute
95 , AM_Z // 6 Zeropage
96 , AM_AX // 7 Absolute, X
97 , AM_AY // 8 Absolute, Y
98 , AM_ZX // 9 Zeropage, X
99 , AM_ZY // 10 Zeropage, Y
100 , AM_R // 11 Relative
101 , AM_IZX // 12 Indexed (Zeropage Indirect, X)
102 , AM_IAX // 13 Indexed (Absolute Indirect, X)
103 , AM_NZY // 14 Indirect (Zeropage) Indexed, Y
104 , AM_NZ // 15 Indirect (Zeropage)
105 , AM_NA // 16 Indirect (Absolute) i.e. JMP
106
107 , NUM_ADDRESSING_MODES
108 , NUM_OPMODES = NUM_ADDRESSING_MODES
109 , AM_I = NUM_ADDRESSING_MODES, // for assemler
110
111 // Deprecated
112 /*
113 ADDR_INVALID1 = 1,
114 ADDR_INVALID2 = 2,
115 ADDR_INVALID3 = 3,
116 ADDR_IMM = 4, // Immediate
117 ADDR_ABS = 5, // Absolute
118 ADDR_ZP = 6, // Zeropage
119 ADDR_ABSX = 7, // Absolute + X
120 ADDR_ABSY = 8, // Absolute + Y
121 ADDR_ZP_X = 9, // Zeropage + X
122 ADDR_ZP_Y = 10, // Zeropage + Y
123 ADDR_REL = 11, // Relative
124 ADDR_INDX = 12, // Indexed (Zeropage) Indirect
125 ADDR_ABSIINDX = 13, // Indexed (Absolute) Indirect
126 ADDR_INDY = 14, // Indirect (Zeropage) Indexed
127 ADDR_IZPG = 15, // Indirect (Zeropage)
128 ADDR_IABS = 16, // Indirect Absolute (i.e. JMP)
129 */
130 };
50 Opcode: opc aaa od
51 opc...od = Mnemonic / Opcode
52 ...aaa.. = Addressing g_nAppMode
53 od = 00
54 000 #Immediate
55 001 Zero page
56 011 Absolute
57 101 Zero page,X
58 111 Absolute,X
59 od = 01
60 000 (Zero page,X)
61 001 Zero page
62 010 #Immediate
63 011 Absolute
64 100 (Zero page),Y
65 101 Zero page,X
66 110 Absolute,Y
67 111 Absolute,X
68 od = 10
69 000 #Immediate
70 001 Zero page
71 010 Accumulator
72 011 Absolute
73 101 Zero page,X
74 111 Absolute,X
75 */
76 /*
77 Legend:
78 A = Absolute (fortunately Accumulator is implicit, leaving us to use 'A')
79 I = Indexed ( would of been X, but need reg X)
80 M = iMmediate
81 N = iNdirect
82 R = Relative
83 X = Offset X Register
84 Y = Offset Y Register
85 Z = Zeropage
86 */
87 enum AddressingMode_e // ADDRESSING_MODES_e
88 {
89 AM_IMPLIED // Note: SetDebugBreakOnInvalid() assumes this order of first 4 entries
90 , AM_1 // Invalid 1 Byte
91 , AM_2 // Invalid 2 Bytes
92 , AM_3 // Invalid 3 Bytes
93 , AM_M // 4 #Immediate
94 , AM_A // 5 $Absolute
95 , AM_Z // 6 Zeropage
96 , AM_AX // 7 Absolute, X
97 , AM_AY // 8 Absolute, Y
98 , AM_ZX // 9 Zeropage, X
99 , AM_ZY // 10 Zeropage, Y
100 , AM_R // 11 Relative
101 , AM_IZX // 12 Indexed (Zeropage Indirect, X)
102 , AM_IAX // 13 Indexed (Absolute Indirect, X)
103 , AM_NZY // 14 Indirect (Zeropage) Indexed, Y
104 , AM_NZ // 15 Indirect (Zeropage)
105 , AM_NA // 16 Indirect (Absolute) i.e. JMP
106
107 , NUM_ADDRESSING_MODES
108 , NUM_OPMODES = NUM_ADDRESSING_MODES
109 , AM_I = NUM_ADDRESSING_MODES, // for assemler
110
111 // Deprecated
112 /*
113 ADDR_INVALID1 = 1,
114 ADDR_INVALID2 = 2,
115 ADDR_INVALID3 = 3,
116 ADDR_IMM = 4, // Immediate
117 ADDR_ABS = 5, // Absolute
118 ADDR_ZP = 6, // Zeropage
119 ADDR_ABSX = 7, // Absolute + X
120 ADDR_ABSY = 8, // Absolute + Y
121 ADDR_ZP_X = 9, // Zeropage + X
122 ADDR_ZP_Y = 10, // Zeropage + Y
123 ADDR_REL = 11, // Relative
124 ADDR_INDX = 12, // Indexed (Zeropage) Indirect
125 ADDR_ABSIINDX = 13, // Indexed (Absolute) Indirect
126 ADDR_INDY = 14, // Indirect (Zeropage) Indexed
127 ADDR_IZPG = 15, // Indirect (Zeropage)
128 ADDR_IABS = 16, // Indirect Absolute (i.e. JMP)
129 */
130 };
131131
132132
133133 // Assembler ______________________________________________________________________________________
134134
135 enum Prompt_e
136 {
137 PROMPT_COMMAND,
138 PROMPT_ASSEMBLER,
139 NUM_PROMPTS
140 };
135 enum Prompt_e
136 {
137 PROMPT_COMMAND,
138 PROMPT_ASSEMBLER,
139 NUM_PROMPTS
140 };
141141
142142
143143 // Bookmarks ______________________________________________________________________________________
144144
145 enum
146 {
147 MAX_BOOKMARKS = 10
148 };
145 enum
146 {
147 MAX_BOOKMARKS = 10
148 };
149149
150150 // Breakpoints ____________________________________________________________________________________
151151
152 enum
153 {
154 MAX_BREAKPOINTS = 16
155 };
156
157 /*
158 Breakpoints are now in a tri-state.
159 This allows one to set a bunch of breakpoints, and re-enable the ones you want
160 without having to remember which addresses you previously added. :-)
161
162 The difference between Set and Enabled breakpoints:
163
164 Set Enabled Break?
165 x x yes, listed as full brightness
166 x - no, listed as dimmed
167 - ? no, not listed
168 */
169 // NOTE: Order must match _PARAM_REGS_*
170 // NOTE: Order must match Breakpoint_Source_t
171 // NOTE: Order must match g_aBreakpointSource
172 enum BreakpointSource_t
173 {
174 BP_SRC_REG_A ,
175 BP_SRC_REG_X ,
176 BP_SRC_REG_Y ,
177
178 BP_SRC_REG_PC, // Program Counter
179 BP_SRC_REG_S , // Stack Counter
180
181 BP_SRC_REG_P , // Processor Status
182 BP_SRC_FLAG_C, // Carry
183 BP_SRC_FLAG_Z, // Zero
184 BP_SRC_FLAG_I, // Interrupt
185 BP_SRC_FLAG_D, // Decimal
186 BP_SRC_FLAG_B, // Break
187 BP_SRC_FLAG_R, // Reserved
188 BP_SRC_FLAG_V, // Overflow
189 BP_SRC_FLAG_N, // Sign
190
191 BP_SRC_OPCODE,
192 BP_SRC_MEM_1 ,
193
194 NUM_BREAKPOINT_SOURCES
195 };
196
197 // Note: Order must match Breakpoint_Operator_t
198 // Note: Order must much _PARAM_BREAKPOINT_*
199 // Note: Order must match g_aBreakpointSymbols
200 enum BreakpointOperator_t
201 {
202 BP_OP_LESS_EQUAL , // <= REG
203 BP_OP_LESS_THAN , // < REG
204 BP_OP_EQUAL , // = REG
205 BP_OP_NOT_EQUAL , // != REG
206 // BP_OP_NOT_EQUAL_1 , // ! REG
207 BP_OP_GREATER_THAN , // > REG
208 BP_OP_GREATER_EQUAL, // >= REG
209 BP_OP_READ , // @ MEM @ ? *
210 BP_OP_WRITE , // * MEM @ ? *
211 BP_OP_READ_WRITE , // ? MEM @ ? *
212 NUM_BREAKPOINT_OPERATORS
213 };
214
215 struct Breakpoint_t
216 {
217 WORD nAddress; // for registers, functions as nValue
218 WORD nLength ;
219 BreakpointSource_t eSource;
220 BreakpointOperator_t eOperator;
221 bool bSet ; // used to be called enabled pre 2.0
222 bool bEnabled;
223 };
224
225 typedef Breakpoint_t Bookmark_t;
226 typedef Breakpoint_t Watches_t;
227 typedef Breakpoint_t ZeroPagePointers_t;
152 enum
153 {
154 MAX_BREAKPOINTS = 16
155 };
156
157 /*
158 Breakpoints are now in a tri-state.
159 This allows one to set a bunch of breakpoints, and re-enable the ones you want
160 without having to remember which addresses you previously added. :-)
161
162 The difference between Set and Enabled breakpoints:
163
164 Set Enabled Break?
165 x x yes, listed as full brightness
166 x - no, listed as dimmed
167 - ? no, not listed
168 */
169 // NOTE: Order must match _PARAM_REGS_*
170 // NOTE: Order must match Breakpoint_Source_t
171 // NOTE: Order must match g_aBreakpointSource
172 enum BreakpointSource_t
173 {
174 BP_SRC_REG_A ,
175 BP_SRC_REG_X ,
176 BP_SRC_REG_Y ,
177
178 BP_SRC_REG_PC, // Program Counter
179 BP_SRC_REG_S , // Stack Counter
180
181 BP_SRC_REG_P , // Processor Status
182 BP_SRC_FLAG_C, // Carry
183 BP_SRC_FLAG_Z, // Zero
184 BP_SRC_FLAG_I, // Interrupt
185 BP_SRC_FLAG_D, // Decimal
186 BP_SRC_FLAG_B, // Break
187 BP_SRC_FLAG_R, // Reserved
188 BP_SRC_FLAG_V, // Overflow
189 BP_SRC_FLAG_N, // Sign
190
191 BP_SRC_OPCODE,
192 BP_SRC_MEM_1 ,
193
194 NUM_BREAKPOINT_SOURCES
195 };
196
197 // Note: Order must match Breakpoint_Operator_t
198 // Note: Order must much _PARAM_BREAKPOINT_*
199 // Note: Order must match g_aBreakpointSymbols
200 enum BreakpointOperator_t
201 {
202 BP_OP_LESS_EQUAL , // <= REG
203 BP_OP_LESS_THAN , // < REG
204 BP_OP_EQUAL , // = REG
205 BP_OP_NOT_EQUAL , // != REG
206 // BP_OP_NOT_EQUAL_1 , // ! REG
207 BP_OP_GREATER_THAN , // > REG
208 BP_OP_GREATER_EQUAL, // >= REG
209 BP_OP_READ , // @ MEM @ ? *
210 BP_OP_WRITE , // * MEM @ ? *
211 BP_OP_READ_WRITE , // ? MEM @ ? *
212 NUM_BREAKPOINT_OPERATORS
213 };
214
215 struct Breakpoint_t
216 {
217 WORD nAddress; // for registers, functions as nValue
218 WORD nLength ;
219 BreakpointSource_t eSource;
220 BreakpointOperator_t eOperator;
221 bool bSet ; // used to be called enabled pre 2.0
222 bool bEnabled;
223 };
224
225 typedef Breakpoint_t Bookmark_t;
226 typedef Breakpoint_t Watches_t;
227 typedef Breakpoint_t ZeroPagePointers_t;
228228
229229
230230 // Colors ___________________________________________________________________
231231
232 enum Color_Schemes_e
233 {
234 SCHEME_COLOR, // NOTE: MUST match order in CMD_WINDOW_COLOR
235 SCHEME_MONO , // NOTE: MUST match order in CMD_WINDOW_MONOCHROME
236 SCHEME_BW , // NOTE: MUST match order in CMD_WINDOW_BW
237 // SCHEME_CUSTOM
238 NUM_COLOR_SCHEMES
239 };
240
241 // Named, since they are easier to remember.
242 // Ok, maybe RGB + CYMK is a little "too" cute. But what the hell, it works out nicely.
243 enum DebugPalette_e
244 {
245 // mipmap level: 8 7 6 5 4 3 2 1 0
246 // color depth: 256 224 192 160 128 96 64 32 0
247 // +32 +32 +32 +32 +32 +32 +32 +32
248 // NOTE: Levels of black are redundant.
249 // // BGR
250 K0, // --- K
251 R8, R7, R6, R5, R4, R3, R2, R1, // --1 R Red
252 G8, G7, G6, G5, G4, G3, G2, G1, // -1- G Green
253 Y8, Y7, Y6, Y5, Y4, Y3, Y2, Y1, // -11 Y Yellow
254 B8, B7, B6, B5, B4, B3, B2, B1, // 1-- B Blue
255 M8, M7, M6, M5, M4, M3, M2, M1, // 1-1 M Magenta
256 C8, C7, C6, C5, C4, C3, C2, C1, // 11- C Cyan
257 W8, W7, W6, W5, W4, W3, W2, W1, // 111 W White / Gray / Black
258
259 COLOR_CUSTOM_01, COLOR_CUSTOM_02, COLOR_CUSTOM_03, COLOR_CUSTOM_04,
260 COLOR_CUSTOM_05, COLOR_CUSTOM_06, COLOR_CUSTOM_07, COLOR_CUSTOM_08,
261 COLOR_CUSTOM_09, COLOR_CUSTOM_11, CUSTOM_COLOR_11, COLOR_CUSTOM_12,
262 COLOR_CUSTOM_13, COLOR_CUSTOM_14, COLOR_CUSTOM_15, COLOR_CUSTOM_16,
263
264 NUM_PALETTE,
265
266 // Gray Aliases
267 G000 = K0,
268 G032 = W1,
269 G064 = W2,
270 G096 = W3,
271 G128 = W4,
272 G160 = W5,
273 G192 = W6,
274 G224 = W7,
275 G256 = W8
276 };
277
278 // Yeah, this was a PITA to organize.
279 enum DebugColors_e
280 {
281 BG_CONSOLE_OUTPUT // Black Window
282 , FG_CONSOLE_OUTPUT // White
283 , BG_CONSOLE_INPUT // Black Window
284 , FG_CONSOLE_INPUT // Light Blue
285
286 , BG_DISASM_1 // Blue* Odd address
287 , BG_DISASM_2 // Blue* Even address
288
289 , BG_DISASM_BP_S_C // Red Breakpoint Set (cursor)
290 , FG_DISASM_BP_S_C // White Breakpoint Set&Ena (cursor)
291
292 // Note: redundant BG_DISASM_BP_0_C = BG_DISASM_BP_S_C
293 , BG_DISASM_BP_0_C // DimRed Breakpoint Disabled (cursor)
294 , FG_DISASM_BP_0_C // Gray192 Breakpoint Disabled (cursor)
295
296 , FG_DISASM_BP_S_X // Red Set (not cursor)
297 , FG_DISASM_BP_0_X // White Disabled (not cursor)
298
299 , BG_DISASM_C // White (Cursor)
300 , FG_DISASM_C // Blue (Cursor)
301
302 , BG_DISASM_PC_C // Yellow (not cursor)
303 , FG_DISASM_PC_C // White (not cursor)
304
305 , BG_DISASM_PC_X // Dim Yellow (not cursor)
306 , FG_DISASM_PC_X // White (not cursor)
307
308 , BG_DISASM_BOOKMARK // Lite Blue (always)
309 , FG_DISASM_BOOKMARK // White addr (always)
310
311 , FG_DISASM_ADDRESS // White addr
312 , FG_DISASM_OPERATOR // Gray192 : $ (also around instruction addressing g_nAppMode)
313 , FG_DISASM_OPCODE // Yellow xx xx xx
314 , FG_DISASM_MNEMONIC // White LDA
315 , FG_DISASM_TARGET // Orange FAC8
316 , FG_DISASM_SYMBOL // Purple HOME
317 , FG_DISASM_CHAR // Cyan 'c'
318 , FG_DISASM_BRANCH // Green ^ = v
319
320 , BG_INFO // Cyan Regs/Stack/BP/Watch/ZP
321 , FG_INFO_TITLE // White Regs/Stack/BP/Watch/ZP
322 , FG_INFO_BULLET // 1
323 , FG_INFO_OPERATOR // Gray192 : -
324 , FG_INFO_ADDRESS // Orange FA62 FA63 (Yellow -> Orange)
325 , FG_INFO_OPCODE // Yellow xx
326 , FG_INFO_REG // Orange (Breakpoints)
327 , BG_INFO_INVERSE // White
328 , FG_INFO_INVERSE // Cyan
329 , BG_INFO_CHAR // mid Cyan
330 , FG_INFO_CHAR_HI // White
331 , FG_INFO_CHAR_LO // Yellow
332
333 , BG_INFO_IO_BYTE // Orange (high bit)
334 , FG_INFO_IO_BYTE // Orange (non-high bit)
335
336 , BG_DATA_1 // Cyan* Window
337 , BG_DATA_2 // Cyan*
338 , FG_DATA_BYTE // default same as FG_DISASM_OPCODE
339 , FG_DATA_TEXT // default same as FG_DISASM_NMEMONIC
340
341 , BG_SYMBOLS_1 // window
342 , BG_SYMBOLS_2
343 , FG_SYMBOLS_ADDRESS // default same as FG_DISASM_ADDRESS
344 , FG_SYMBOLS_NAME // default same as FG_DISASM_SYMBOL
345
346 , BG_SOURCE_TITLE
347 , FG_SOURCE_TITLE
348 , BG_SOURCE_1 // odd
349 , BG_SOURCE_2 // even
350 , FG_SOURCE
351
352 , NUM_COLORS
353 };
232 enum Color_Schemes_e
233 {
234 SCHEME_COLOR, // NOTE: MUST match order in CMD_WINDOW_COLOR
235 SCHEME_MONO , // NOTE: MUST match order in CMD_WINDOW_MONOCHROME
236 SCHEME_BW , // NOTE: MUST match order in CMD_WINDOW_BW
237 // SCHEME_CUSTOM
238 NUM_COLOR_SCHEMES
239 };
240
241 // Named, since they are easier to remember.
242 // Ok, maybe RGB + CYMK is a little "too" cute. But what the hell, it works out nicely.
243 enum DebugPalette_e
244 {
245 // mipmap level: 8 7 6 5 4 3 2 1 0
246 // color depth: 256 224 192 160 128 96 64 32 0
247 // +32 +32 +32 +32 +32 +32 +32 +32
248 // NOTE: Levels of black are redundant.
249 // // BGR
250 K0, // --- K
251 R8, R7, R6, R5, R4, R3, R2, R1, // --1 R Red
252 G8, G7, G6, G5, G4, G3, G2, G1, // -1- G Green
253 Y8, Y7, Y6, Y5, Y4, Y3, Y2, Y1, // -11 Y Yellow
254 B8, B7, B6, B5, B4, B3, B2, B1, // 1-- B Blue
255 M8, M7, M6, M5, M4, M3, M2, M1, // 1-1 M Magenta
256 C8, C7, C6, C5, C4, C3, C2, C1, // 11- C Cyan
257 W8, W7, W6, W5, W4, W3, W2, W1, // 111 W White / Gray / Black
258
259 COLOR_CUSTOM_01, COLOR_CUSTOM_02, COLOR_CUSTOM_03, COLOR_CUSTOM_04,
260 COLOR_CUSTOM_05, COLOR_CUSTOM_06, COLOR_CUSTOM_07, COLOR_CUSTOM_08,
261 COLOR_CUSTOM_09, COLOR_CUSTOM_11, CUSTOM_COLOR_11, COLOR_CUSTOM_12,
262 COLOR_CUSTOM_13, COLOR_CUSTOM_14, COLOR_CUSTOM_15, COLOR_CUSTOM_16,
263
264 NUM_PALETTE,
265
266 // Gray Aliases
267 G000 = K0,
268 G032 = W1,
269 G064 = W2,
270 G096 = W3,
271 G128 = W4,
272 G160 = W5,
273 G192 = W6,
274 G224 = W7,
275 G256 = W8
276 };
277
278 // Yeah, this was a PITA to organize.
279 enum DebugColors_e
280 {
281 BG_CONSOLE_OUTPUT // Black Window
282 , FG_CONSOLE_OUTPUT // White
283 , BG_CONSOLE_INPUT // Black Window
284 , FG_CONSOLE_INPUT // Light Blue
285
286 , BG_DISASM_1 // Blue* Odd address
287 , BG_DISASM_2 // Blue* Even address
288
289 , BG_DISASM_BP_S_C // Red Breakpoint Set (cursor)
290 , FG_DISASM_BP_S_C // White Breakpoint Set&Ena (cursor)
291
292 // Note: redundant BG_DISASM_BP_0_C = BG_DISASM_BP_S_C
293 , BG_DISASM_BP_0_C // DimRed Breakpoint Disabled (cursor)
294 , FG_DISASM_BP_0_C // Gray192 Breakpoint Disabled (cursor)
295
296 , FG_DISASM_BP_S_X // Red Set (not cursor)
297 , FG_DISASM_BP_0_X // White Disabled (not cursor)
298
299 , BG_DISASM_C // White (Cursor)
300 , FG_DISASM_C // Blue (Cursor)
301
302 , BG_DISASM_PC_C // Yellow (not cursor)
303 , FG_DISASM_PC_C // White (not cursor)
304
305 , BG_DISASM_PC_X // Dim Yellow (not cursor)
306 , FG_DISASM_PC_X // White (not cursor)
307
308 , BG_DISASM_BOOKMARK // Lite Blue (always)
309 , FG_DISASM_BOOKMARK // White addr (always)
310
311 , FG_DISASM_ADDRESS // White addr
312 , FG_DISASM_OPERATOR // Gray192 : $ (also around instruction addressing g_nAppMode)
313 , FG_DISASM_OPCODE // Yellow xx xx xx
314 , FG_DISASM_MNEMONIC // White LDA
315 , FG_DISASM_TARGET // Orange FAC8
316 , FG_DISASM_SYMBOL // Purple HOME
317 , FG_DISASM_CHAR // Cyan 'c'
318 , FG_DISASM_BRANCH // Green ^ = v
319
320 , BG_INFO // Cyan Regs/Stack/BP/Watch/ZP
321 , FG_INFO_TITLE // White Regs/Stack/BP/Watch/ZP
322 , FG_INFO_BULLET // 1
323 , FG_INFO_OPERATOR // Gray192 : -
324 , FG_INFO_ADDRESS // Orange FA62 FA63 (Yellow -> Orange)
325 , FG_INFO_OPCODE // Yellow xx
326 , FG_INFO_REG // Orange (Breakpoints)
327 , BG_INFO_INVERSE // White
328 , FG_INFO_INVERSE // Cyan
329 , BG_INFO_CHAR // mid Cyan
330 , FG_INFO_CHAR_HI // White
331 , FG_INFO_CHAR_LO // Yellow
332
333 , BG_INFO_IO_BYTE // Orange (high bit)
334 , FG_INFO_IO_BYTE // Orange (non-high bit)
335
336 , BG_DATA_1 // Cyan* Window
337 , BG_DATA_2 // Cyan*
338 , FG_DATA_BYTE // default same as FG_DISASM_OPCODE
339 , FG_DATA_TEXT // default same as FG_DISASM_NMEMONIC
340
341 , BG_SYMBOLS_1 // window
342 , BG_SYMBOLS_2
343 , FG_SYMBOLS_ADDRESS // default same as FG_DISASM_ADDRESS
344 , FG_SYMBOLS_NAME // default same as FG_DISASM_SYMBOL
345
346 , BG_SOURCE_TITLE
347 , FG_SOURCE_TITLE
348 , BG_SOURCE_1 // odd
349 , BG_SOURCE_2 // even
350 , FG_SOURCE
351
352 , NUM_COLORS
353 };
354354
355355 // Config _________________________________________________________________________________________
356356
357 enum ConfigSave_t
358 {
359 CONFIG_SAVE_FILE_CREATE,
360 CONFIG_SAVE_FILE_APPEND
361 };
357 enum ConfigSave_t
358 {
359 CONFIG_SAVE_FILE_CREATE,
360 CONFIG_SAVE_FILE_APPEND
361 };
362362
363363 // Commands _______________________________________________________________________________________
364364
365 enum Update_e
366 {
367 UPDATE_NOTHING,
368 UPDATE_BACKGROUND = (1 << 0),
369 UPDATE_BREAKPOINTS = (1 << 1),
370 UPDATE_CONSOLE_DISPLAY = (1 << 2),
371 UPDATE_CONSOLE_INPUT = (1 << 3),
372 UPDATE_DISASM = (1 << 4),
373 UPDATE_FLAGS = (1 << 5),
374 UPDATE_MEM_DUMP = (1 << 6),
375 UPDATE_REGS = (1 << 7),
376 UPDATE_STACK = (1 << 8),
377 UPDATE_SYMBOLS = (1 << 9),
378 UPDATE_TARGETS = (1 << 10),
379 UPDATE_WATCH = (1 << 11),
380 UPDATE_ZERO_PAGE = (1 << 12),
381
382 UPDATE_ALL = -1
383 };
384
385 typedef int Update_t;
386
387 enum
388 {
389 MAX_COMMAND_LEN = 12,
390
391 MAX_ARGS = 32, // was 40
392 ARG_SYNTAX_ERROR= -1,
393 MAX_ARG_LEN = 56, // was 12, extended to allow font names
394 };
395
396 // NOTE: All Commands return flags of what needs to be redrawn
397 typedef Update_t (*CmdFuncPtr_t)(int);
398
399 struct Command_t
400 {
401 char m_sName[ MAX_COMMAND_LEN ];
402 CmdFuncPtr_t pFunction;
403 int iCommand; // offset (enum) for direct command name lookup
404 char *pHelpSummary; // 1 line help summary
405 // Hash_t m_nHash; // TODO
406 };
407
408 // Commands sorted by Category
409 // NOTE: Commands_e and g_aCommands[] order _MUST_ match !!! Aliases are listed at the end
410 enum Commands_e
411 {
365 enum Update_e
366 {
367 UPDATE_NOTHING,
368 UPDATE_BACKGROUND = (1 << 0),
369 UPDATE_BREAKPOINTS = (1 << 1),
370 UPDATE_CONSOLE_DISPLAY = (1 << 2),
371 UPDATE_CONSOLE_INPUT = (1 << 3),
372 UPDATE_DISASM = (1 << 4),
373 UPDATE_FLAGS = (1 << 5),
374 UPDATE_MEM_DUMP = (1 << 6),
375 UPDATE_REGS = (1 << 7),
376 UPDATE_STACK = (1 << 8),
377 UPDATE_SYMBOLS = (1 << 9),
378 UPDATE_TARGETS = (1 << 10),
379 UPDATE_WATCH = (1 << 11),
380 UPDATE_ZERO_PAGE = (1 << 12),
381
382 UPDATE_ALL = -1
383 };
384
385 typedef int Update_t;
386
387 enum
388 {
389 MAX_COMMAND_LEN = 12,
390
391 MAX_ARGS = 32, // was 40
392 ARG_SYNTAX_ERROR= -1,
393 MAX_ARG_LEN = 56, // was 12, extended to allow font names
394 };
395
396 // NOTE: All Commands return flags of what needs to be redrawn
397 typedef Update_t (*CmdFuncPtr_t)(int);
398
399 struct Command_t
400 {
401 char m_sName[ MAX_COMMAND_LEN ];
402 CmdFuncPtr_t pFunction;
403 int iCommand; // offset (enum) for direct command name lookup
404 char *pHelpSummary; // 1 line help summary
405 // Hash_t m_nHash; // TODO
406 };
407
408 // Commands sorted by Category
409 // NOTE: Commands_e and g_aCommands[] order _MUST_ match !!! Aliases are listed at the end
410 enum Commands_e
411 {
412412 // CPU
413 CMD_CURSOR_JUMP_PC // Shift
414 , CMD_CURSOR_SET_PC // Ctrl
415 , CMD_ASSEMBLE
416 , CMD_BREAK_INVALID
417 , CMD_BREAK_OPCODE
418 , CMD_GO
419 , CMD_IN
420 , CMD_INPUT_KEY
421 , CMD_JSR
422 , CMD_NOP
423 , CMD_OUT
413 CMD_CURSOR_JUMP_PC // Shift
414 , CMD_CURSOR_SET_PC // Ctrl
415 , CMD_ASSEMBLE
416 , CMD_BREAK_INVALID
417 , CMD_BREAK_OPCODE
418 , CMD_GO
419 , CMD_IN
420 , CMD_INPUT_KEY
421 , CMD_JSR
422 , CMD_NOP
423 , CMD_OUT
424424 // CPU - Meta Info
425 , CMD_PROFILE
426 , CMD_REGISTER_SET
425 , CMD_PROFILE
426 , CMD_REGISTER_SET
427427 // CPU - Stack
428 // , CMD_STACK_LIST
429 , CMD_STACK_POP
430 , CMD_STACK_POP_PSEUDO
431 , CMD_STACK_PUSH
432 // , CMD_STACK_RETURN
433 , CMD_STEP_OVER
434 , CMD_STEP_OUT
428 // , CMD_STACK_LIST
429 , CMD_STACK_POP
430 , CMD_STACK_POP_PSEUDO
431 , CMD_STACK_PUSH
432 // , CMD_STACK_RETURN
433 , CMD_STEP_OVER
434 , CMD_STEP_OUT
435435 // CPU - Meta Info
436 , CMD_TRACE
437 , CMD_TRACE_FILE
438 , CMD_TRACE_LINE
439 , CMD_UNASSEMBLE
436 , CMD_TRACE
437 , CMD_TRACE_FILE
438 , CMD_TRACE_LINE
439 , CMD_UNASSEMBLE
440440 // Bookmarks
441 , CMD_BOOKMARK
442 , CMD_BOOKMARK_ADD
443 , CMD_BOOKMARK_CLEAR
444 , CMD_BOOKMARK_LIST
445 // , CMD_BOOKMARK_LOAD
446 , CMD_BOOKMARK_GOTO
447 , CMD_BOOKMARK_SAVE
441 , CMD_BOOKMARK
442 , CMD_BOOKMARK_ADD
443 , CMD_BOOKMARK_CLEAR
444 , CMD_BOOKMARK_LIST
445 // , CMD_BOOKMARK_LOAD
446 , CMD_BOOKMARK_GOTO
447 , CMD_BOOKMARK_SAVE
448448 // Breakpoints
449 , CMD_BREAKPOINT
450 , CMD_BREAKPOINT_ADD_SMART // smart breakpoint
451 , CMD_BREAKPOINT_ADD_REG // break on: PC == Address (fetch/execute)
452 , CMD_BREAKPOINT_ADD_PC // alias BPX = BA
453 // , CMD_BREAKPOINT_SET = CMD_BREAKPOINT_ADD_ADDR // alias
454 // , CMD_BREAKPOINT_EXEC = CMD_BREAKPOINT_ADD_ADDR // alias
455 , CMD_BREAKPOINT_ADD_IO // break on: [$C000-$C7FF] Load/Store
456 , CMD_BREAKPOINT_ADD_MEM // break on: [$0000-$FFFF], excluding IO
457
458 , CMD_BREAKPOINT_CLEAR
459 // , CMD_BREAKPOINT_REMOVE = CMD_BREAKPOINT_CLEAR // alias
460 , CMD_BREAKPOINT_DISABLE
461 , CMD_BREAKPOINT_EDIT
462 , CMD_BREAKPOINT_ENABLE
463 , CMD_BREAKPOINT_LIST
464 // , CMD_BREAKPOINT_LOAD
465 , CMD_BREAKPOINT_SAVE
449 , CMD_BREAKPOINT
450 , CMD_BREAKPOINT_ADD_SMART // smart breakpoint
451 , CMD_BREAKPOINT_ADD_REG // break on: PC == Address (fetch/execute)
452 , CMD_BREAKPOINT_ADD_PC // alias BPX = BA
453 // , CMD_BREAKPOINT_SET = CMD_BREAKPOINT_ADD_ADDR // alias
454 // , CMD_BREAKPOINT_EXEC = CMD_BREAKPOINT_ADD_ADDR // alias
455 , CMD_BREAKPOINT_ADD_IO // break on: [$C000-$C7FF] Load/Store
456 , CMD_BREAKPOINT_ADD_MEM // break on: [$0000-$FFFF], excluding IO
457
458 , CMD_BREAKPOINT_CLEAR
459 // , CMD_BREAKPOINT_REMOVE = CMD_BREAKPOINT_CLEAR // alias
460 , CMD_BREAKPOINT_DISABLE
461 , CMD_BREAKPOINT_EDIT
462 , CMD_BREAKPOINT_ENABLE
463 , CMD_BREAKPOINT_LIST
464 // , CMD_BREAKPOINT_LOAD
465 , CMD_BREAKPOINT_SAVE
466466 // Benchmark / Timing
467 // , CMD_BENCHMARK_START
468 // , CMD_BENCHMARK_STOP
469 // , CMD_PROFILE_START
470 // , CMD_PROFILE_STOP
467 // , CMD_BENCHMARK_START
468 // , CMD_BENCHMARK_STOP
469 // , CMD_PROFILE_START
470 // , CMD_PROFILE_STOP
471471 // Config (debugger settings)
472 , CMD_BENCHMARK
473 , CMD_CONFIG_BW // BW # rr gg bb
474 , CMD_CONFIG_COLOR // COLOR # rr gg bb
475
476 , CMD_CONFIG_DISASM
477 // , CMD_CONFIG_DISASM_BRANCH
478 // , CMD_CONFIG_DISASM_COLON
479 // , CMD_CONFIG_DISASM_OPCODE
480 // , CMD_CONFIG_DISASM_SPACES
481
482 , CMD_CONFIG_FONT
483 // , CMD_CONFIG_FONT2 // PARAM_FONT_DISASM PARAM_FONT_INFO PARAM_FONT_SOURCE
484 , CMD_CONFIG_HCOLOR // TODO Video :: SETFRAMECOLOR(#,R,G,B)
485 , CMD_CONFIG_LOAD
486 , CMD_CONFIG_MONOCHROME // MONO # rr gg bb
487 , CMD_CONFIG_SAVE
472 , CMD_BENCHMARK
473 , CMD_CONFIG_BW // BW # rr gg bb
474 , CMD_CONFIG_COLOR // COLOR # rr gg bb
475
476 , CMD_CONFIG_DISASM
477 // , CMD_CONFIG_DISASM_BRANCH
478 // , CMD_CONFIG_DISASM_COLON
479 // , CMD_CONFIG_DISASM_OPCODE
480 // , CMD_CONFIG_DISASM_SPACES
481
482 , CMD_CONFIG_FONT
483 // , CMD_CONFIG_FONT2 // PARAM_FONT_DISASM PARAM_FONT_INFO PARAM_FONT_SOURCE
484 , CMD_CONFIG_HCOLOR // TODO Video :: SETFRAMECOLOR(#,R,G,B)
485 , CMD_CONFIG_LOAD
486 , CMD_CONFIG_MONOCHROME // MONO # rr gg bb
487 , CMD_CONFIG_SAVE
488488 // Cursor
489 , CMD_CURSOR_JUMP_RET_ADDR
490 , CMD_CURSOR_LINE_UP // Smart Line Up
491 , CMD_CURSOR_LINE_UP_1 // Shift
492 , CMD_CURSOR_LINE_DOWN // Smart Line Down
493 , CMD_CURSOR_LINE_DOWN_1 // Shift
494 // , CMD_CURSOR_PAGE_UP
495 // , CMD_CURSOR_PAGE_DOWN
496 , CMD_CURSOR_PAGE_UP
497 , CMD_CURSOR_PAGE_UP_256 // up to nearest page boundary
498 , CMD_CURSOR_PAGE_UP_4K // Up to nearest 4K boundary
499
500 , CMD_CURSOR_PAGE_DOWN
501 , CMD_CURSOR_PAGE_DOWN_256 // Down to nearest page boundary
502 , CMD_CURSOR_PAGE_DOWN_4K // Down to nearest 4K boundary
489 , CMD_CURSOR_JUMP_RET_ADDR
490 , CMD_CURSOR_LINE_UP // Smart Line Up
491 , CMD_CURSOR_LINE_UP_1 // Shift
492 , CMD_CURSOR_LINE_DOWN // Smart Line Down
493 , CMD_CURSOR_LINE_DOWN_1 // Shift
494 // , CMD_CURSOR_PAGE_UP
495 // , CMD_CURSOR_PAGE_DOWN
496 , CMD_CURSOR_PAGE_UP
497 , CMD_CURSOR_PAGE_UP_256 // up to nearest page boundary
498 , CMD_CURSOR_PAGE_UP_4K // Up to nearest 4K boundary
499
500 , CMD_CURSOR_PAGE_DOWN
501 , CMD_CURSOR_PAGE_DOWN_256 // Down to nearest page boundary
502 , CMD_CURSOR_PAGE_DOWN_4K // Down to nearest 4K boundary
503503 // Disk
504 , CMD_DISK
504 , CMD_DISK
505505 // Flags - CPU
506 , CMD_FLAG_CLEAR // Flag order must match g_aFlagNames CZIDBRVN
507 , CMD_FLAG_CLR_C // 8
508 , CMD_FLAG_CLR_Z // 7
509 , CMD_FLAG_CLR_I // 6
510 , CMD_FLAG_CLR_D // 5
511 , CMD_FLAG_CLR_B // 4
512 , CMD_FLAG_CLR_R // 3
513 , CMD_FLAG_CLR_V // 2
514 , CMD_FLAG_CLR_N // 1
515
516 , CMD_FLAG_SET // Flag order must match g_aFlagNames CZIDBRVN
517 , CMD_FLAG_SET_C // 8
518 , CMD_FLAG_SET_Z // 7
519 , CMD_FLAG_SET_I // 6
520 , CMD_FLAG_SET_D // 5
521 , CMD_FLAG_SET_B // 4
522 , CMD_FLAG_SET_R // 3
523 , CMD_FLAG_SET_V // 2
524 , CMD_FLAG_SET_N // 1
506 , CMD_FLAG_CLEAR // Flag order must match g_aFlagNames CZIDBRVN
507 , CMD_FLAG_CLR_C // 8
508 , CMD_FLAG_CLR_Z // 7
509 , CMD_FLAG_CLR_I // 6
510 , CMD_FLAG_CLR_D // 5
511 , CMD_FLAG_CLR_B // 4
512 , CMD_FLAG_CLR_R // 3
513 , CMD_FLAG_CLR_V // 2
514 , CMD_FLAG_CLR_N // 1
515
516 , CMD_FLAG_SET // Flag order must match g_aFlagNames CZIDBRVN
517 , CMD_FLAG_SET_C // 8
518 , CMD_FLAG_SET_Z // 7
519 , CMD_FLAG_SET_I // 6
520 , CMD_FLAG_SET_D // 5
521 , CMD_FLAG_SET_B // 4
522 , CMD_FLAG_SET_R // 3
523 , CMD_FLAG_SET_V // 2
524 , CMD_FLAG_SET_N // 1
525525 // Help
526 , CMD_HELP_LIST
527 , CMD_HELP_SPECIFIC
528 , CMD_VERSION
529 , CMD_MOTD // Message of the Day
526 , CMD_HELP_LIST
527 , CMD_HELP_SPECIFIC
528 , CMD_VERSION
529 , CMD_MOTD // Message of the Day
530530 // Memory
531 , CMD_MEMORY_COMPARE
532
533 , _CMD_MEM_MINI_DUMP_HEX_1_1 // alias MD
534 , _CMD_MEM_MINI_DUMP_HEX_1_2 // alias MD = D
535 , CMD_MEM_MINI_DUMP_HEX_1
536 , CMD_MEM_MINI_DUMP_HEX_2
537 , _CMD_MEM_MINI_DUMP_HEX_1_3 // alias M1
538 , _CMD_MEM_MINI_DUMP_HEX_2_1 // alias M2
539
540 , CMD_MEM_MINI_DUMP_ASCII_1 // ASCII
541 , CMD_MEM_MINI_DUMP_ASCII_2
542 , CMD_MEM_MINI_DUMP_APPLE_1 // Low-Bit inverse, High-Bit normal
543 , CMD_MEM_MINI_DUMP_APPLE_2
544 // , CMD_MEM_MINI_DUMP_TXT_LO_1 // ASCII (Controls Chars)
545 // , CMD_MEM_MINI_DUMP_TXT_LO_2
546 // , CMD_MEM_MINI_DUMP_TXT_HI_1 // ASCII (High Bit)
547 // , CMD_MEM_MINI_DUMP_TXT_HI_2
548
549 // , CMD_MEMORY_DUMP = CMD_MEM_MINI_DUMP_HEX_1
550 , CMD_MEMORY_EDIT
551 , CMD_MEMORY_ENTER_BYTE
552 , CMD_MEMORY_ENTER_WORD
553 , CMD_MEMORY_LOAD
554 , CMD_MEMORY_MOVE
555 , CMD_MEMORY_SAVE
556 , CMD_MEMORY_SEARCH
557 // , CMD_MEMORY_SEARCH_ASCII // Ascii Text
558 // , CMD_MEMORY_SEARCH_APPLE // Flashing Chars, Hi-Bit Set
559 , CMD_MEMORY_SEARCH_HEX
560 , CMD_MEMORY_FILL
531 , CMD_MEMORY_COMPARE
532
533 , _CMD_MEM_MINI_DUMP_HEX_1_1 // alias MD
534 , _CMD_MEM_MINI_DUMP_HEX_1_2 // alias MD = D
535 , CMD_MEM_MINI_DUMP_HEX_1
536 , CMD_MEM_MINI_DUMP_HEX_2
537 , _CMD_MEM_MINI_DUMP_HEX_1_3 // alias M1
538 , _CMD_MEM_MINI_DUMP_HEX_2_1 // alias M2
539
540 , CMD_MEM_MINI_DUMP_ASCII_1 // ASCII
541 , CMD_MEM_MINI_DUMP_ASCII_2
542 , CMD_MEM_MINI_DUMP_APPLE_1 // Low-Bit inverse, High-Bit normal
543 , CMD_MEM_MINI_DUMP_APPLE_2
544 // , CMD_MEM_MINI_DUMP_TXT_LO_1 // ASCII (Controls Chars)
545 // , CMD_MEM_MINI_DUMP_TXT_LO_2
546 // , CMD_MEM_MINI_DUMP_TXT_HI_1 // ASCII (High Bit)
547 // , CMD_MEM_MINI_DUMP_TXT_HI_2
548
549 // , CMD_MEMORY_DUMP = CMD_MEM_MINI_DUMP_HEX_1
550 , CMD_MEMORY_EDIT
551 , CMD_MEMORY_ENTER_BYTE
552 , CMD_MEMORY_ENTER_WORD
553 , CMD_MEMORY_LOAD
554 , CMD_MEMORY_MOVE
555 , CMD_MEMORY_SAVE
556 , CMD_MEMORY_SEARCH
557 // , CMD_MEMORY_SEARCH_ASCII // Ascii Text
558 // , CMD_MEMORY_SEARCH_APPLE // Flashing Chars, Hi-Bit Set
559 , CMD_MEMORY_SEARCH_HEX
560 , CMD_MEMORY_FILL
561561 // Output
562 , CMD_OUTPUT_CALC
563 , CMD_OUTPUT_ECHO
564 , CMD_OUTPUT_PRINT
565 , CMD_OUTPUT_PRINTF
566 , CMD_OUTPUT_RUN
562 , CMD_OUTPUT_CALC
563 , CMD_OUTPUT_ECHO
564 , CMD_OUTPUT_PRINT
565 , CMD_OUTPUT_PRINTF
566 , CMD_OUTPUT_RUN
567567 // Source Level Debugging
568 , CMD_SOURCE
569 , CMD_SYNC
568 , CMD_SOURCE
569 , CMD_SYNC
570570 // Symbols
571 , CMD_SYMBOLS_LOOKUP
572 // , CMD_SYMBOLS
573 , CMD_SYMBOLS_MAIN
574 , CMD_SYMBOLS_USER
575 , CMD_SYMBOLS_SRC
576 // , CMD_SYMBOLS_FIND
577 // , CMD_SYMBOLS_CLEAR
578 , CMD_SYMBOLS_INFO
579 , CMD_SYMBOLS_LIST
580 // , CMD_SYMBOLS_LOAD_1
581 // , CMD_SYMBOLS_LOAD_2
582 // , CMD_SYMBOLS_SAVE
571 , CMD_SYMBOLS_LOOKUP
572 // , CMD_SYMBOLS
573 , CMD_SYMBOLS_MAIN
574 , CMD_SYMBOLS_USER
575 , CMD_SYMBOLS_SRC
576 // , CMD_SYMBOLS_FIND
577 // , CMD_SYMBOLS_CLEAR
578 , CMD_SYMBOLS_INFO
579 , CMD_SYMBOLS_LIST
580 // , CMD_SYMBOLS_LOAD_1
581 // , CMD_SYMBOLS_LOAD_2
582 // , CMD_SYMBOLS_SAVE
583583 // Watch
584 , CMD_WATCH
585 , CMD_WATCH_ADD
586 , CMD_WATCH_CLEAR
587 , CMD_WATCH_DISABLE
588 , CMD_WATCH_ENABLE
589 , CMD_WATCH_LIST
590 // , CMD_WATCH_LOAD
591 , CMD_WATCH_SAVE
584 , CMD_WATCH
585 , CMD_WATCH_ADD
586 , CMD_WATCH_CLEAR
587 , CMD_WATCH_DISABLE
588 , CMD_WATCH_ENABLE
589 , CMD_WATCH_LIST
590 // , CMD_WATCH_LOAD
591 , CMD_WATCH_SAVE
592592 // Window
593 // , CMD_WINDOW_COLOR_CUSTOM
594 , CMD_WINDOW
595
596 , CMD_WINDOW_CODE
597 , CMD_WINDOW_CODE_1
598 , CMD_WINDOW_CODE_2
599
600 , CMD_WINDOW_CONSOLE
601
602 , CMD_WINDOW_DATA
603 , CMD_WINDOW_DATA_1
604 , CMD_WINDOW_DATA_2
605
606 // SOURCE is reserved for source level debugging
607 , CMD_WINDOW_SOURCE_1
608 , CMD_WINDOW_SOURCE_2
609
610 // , CMD_WINDOW_STACK_1
611 // , CMD_WINDOW_STACK_2
612
613 // SYMBOLS is reserved for symbols lookup/commands
614 // , CMD_WINDOW_SYMBOLS_1
615 // , CMD_WINDOW_SYMBOLS_2
616
617 // , CMD_WINDOW_ZEROPAGE_1
618 // , CMD_WINDOW_ZEROPAGE_2
619
620 , CMD_WINDOW_OUTPUT
621 // , CMD_WINDOW_SOURCE
593 // , CMD_WINDOW_COLOR_CUSTOM
594 , CMD_WINDOW
595
596 , CMD_WINDOW_CODE
597 , CMD_WINDOW_CODE_1
598 , CMD_WINDOW_CODE_2
599
600 , CMD_WINDOW_CONSOLE
601
602 , CMD_WINDOW_DATA
603 , CMD_WINDOW_DATA_1
604 , CMD_WINDOW_DATA_2
605
606 // SOURCE is reserved for source level debugging
607 , CMD_WINDOW_SOURCE_1
608 , CMD_WINDOW_SOURCE_2
609
610 // , CMD_WINDOW_STACK_1
611 // , CMD_WINDOW_STACK_2
612
613 // SYMBOLS is reserved for symbols lookup/commands
614 // , CMD_WINDOW_SYMBOLS_1
615 // , CMD_WINDOW_SYMBOLS_2
616
617 // , CMD_WINDOW_ZEROPAGE_1
618 // , CMD_WINDOW_ZEROPAGE_2
619
620 , CMD_WINDOW_OUTPUT
621 // , CMD_WINDOW_SOURCE
622622 // ZeroPage
623 , CMD_ZEROPAGE_POINTER
624 , CMD_ZEROPAGE_POINTER_0
625 , CMD_ZEROPAGE_POINTER_1
626 , CMD_ZEROPAGE_POINTER_2
627 , CMD_ZEROPAGE_POINTER_3
628 , CMD_ZEROPAGE_POINTER_4
629 , CMD_ZEROPAGE_POINTER_5
630 , CMD_ZEROPAGE_POINTER_6
631 , CMD_ZEROPAGE_POINTER_7
632 , CMD_ZEROPAGE_POINTER_ADD
633 , CMD_ZEROPAGE_POINTER_CLEAR
634 , CMD_ZEROPAGE_POINTER_DISABLE
635 , CMD_ZEROPAGE_POINTER_ENABLE
636 , CMD_ZEROPAGE_POINTER_LIST
637 // , CMD_ZEROPAGE_POINTER_LOAD
638 , CMD_ZEROPAGE_POINTER_SAVE
639
640 , NUM_COMMANDS
641 };
623 , CMD_ZEROPAGE_POINTER
624 , CMD_ZEROPAGE_POINTER_0
625 , CMD_ZEROPAGE_POINTER_1
626 , CMD_ZEROPAGE_POINTER_2
627 , CMD_ZEROPAGE_POINTER_3
628 , CMD_ZEROPAGE_POINTER_4
629 , CMD_ZEROPAGE_POINTER_5
630 , CMD_ZEROPAGE_POINTER_6
631 , CMD_ZEROPAGE_POINTER_7
632 , CMD_ZEROPAGE_POINTER_ADD
633 , CMD_ZEROPAGE_POINTER_CLEAR
634 , CMD_ZEROPAGE_POINTER_DISABLE
635 , CMD_ZEROPAGE_POINTER_ENABLE
636 , CMD_ZEROPAGE_POINTER_LIST
637 // , CMD_ZEROPAGE_POINTER_LOAD
638 , CMD_ZEROPAGE_POINTER_SAVE
639
640 , NUM_COMMANDS
641 };
642642
643643
644644 // CPU
645 Update_t CmdCursorJumpPC(int nArgs);
646 Update_t CmdCursorSetPC (int nArgs);
647 Update_t CmdAssemble (int nArgs);
648 Update_t CmdBreakInvalid(int nArgs); // Breakpoint IFF Full-speed!
649 Update_t CmdBreakOpcode (int nArgs); // Breakpoint IFF Full-speed!
650 Update_t CmdGo (int nArgs);
651 Update_t CmdIn (int nArgs);
652 Update_t CmdKey (int nArgs);
653 Update_t CmdJSR (int nArgs);
654 Update_t CmdNOP (int nArgs);
655 Update_t CmdOut (int nArgs);
656 Update_t CmdStepOver (int nArgs);
657 Update_t CmdStepOut (int nArgs);
658 Update_t CmdTrace (int nArgs); // alias for CmdStepIn
659 Update_t CmdTraceFile (int nArgs);
660 Update_t CmdTraceLine (int nArgs);
661 Update_t CmdUnassemble (int nArgs); // code dump, aka, Unassemble
645 Update_t CmdCursorJumpPC(int nArgs);
646 Update_t CmdCursorSetPC (int nArgs);
647 Update_t CmdAssemble (int nArgs);
648 Update_t CmdBreakInvalid(int nArgs); // Breakpoint IFF Full-speed!
649 Update_t CmdBreakOpcode (int nArgs); // Breakpoint IFF Full-speed!
650 Update_t CmdGo (int nArgs);
651 Update_t CmdIn (int nArgs);
652 Update_t CmdKey (int nArgs);
653 Update_t CmdJSR (int nArgs);
654 Update_t CmdNOP (int nArgs);
655 Update_t CmdOut (int nArgs);
656 Update_t CmdStepOver (int nArgs);
657 Update_t CmdStepOut (int nArgs);
658 Update_t CmdTrace (int nArgs); // alias for CmdStepIn
659 Update_t CmdTraceFile (int nArgs);
660 Update_t CmdTraceLine (int nArgs);
661 Update_t CmdUnassemble (int nArgs); // code dump, aka, Unassemble
662662 // Bookmarks
663 Update_t CmdBookmark (int nArgs);
664 Update_t CmdBookmarkAdd (int nArgs);
665 Update_t CmdBookmarkClear (int nArgs);
666 Update_t CmdBookmarkList (int nArgs);
667 Update_t CmdBookmarkGoto (int nArgs);
668 // Update_t CmdBookmarkLoad (int nArgs);
669 Update_t CmdBookmarkSave (int nArgs);
663 Update_t CmdBookmark (int nArgs);
664 Update_t CmdBookmarkAdd (int nArgs);
665 Update_t CmdBookmarkClear (int nArgs);
666 Update_t CmdBookmarkList (int nArgs);
667 Update_t CmdBookmarkGoto (int nArgs);
668 // Update_t CmdBookmarkLoad (int nArgs);
669 Update_t CmdBookmarkSave (int nArgs);
670670 // Breakpoints
671 Update_t CmdBreakpoint (int nArgs);
672 Update_t CmdBreakpointAddSmart(int nArgs);
673 Update_t CmdBreakpointAddReg (int nArgs);
674 Update_t CmdBreakpointAddPC (int nArgs);
675 Update_t CmdBreakpointAddIO (int nArgs);
676 Update_t CmdBreakpointAddMem (int nArgs);
677 Update_t CmdBreakpointClear (int nArgs);
678 Update_t CmdBreakpointDisable (int nArgs);
679 Update_t CmdBreakpointEdit (int nArgs);
680 Update_t CmdBreakpointEnable (int nArgs);
681 Update_t CmdBreakpointList (int nArgs);
682 // Update_t CmdBreakpointLoad (int nArgs);
683 Update_t CmdBreakpointSave (int nArgs);
671 Update_t CmdBreakpoint (int nArgs);
672 Update_t CmdBreakpointAddSmart(int nArgs);
673 Update_t CmdBreakpointAddReg (int nArgs);
674 Update_t CmdBreakpointAddPC (int nArgs);
675 Update_t CmdBreakpointAddIO (int nArgs);
676 Update_t CmdBreakpointAddMem (int nArgs);
677 Update_t CmdBreakpointClear (int nArgs);
678 Update_t CmdBreakpointDisable (int nArgs);
679 Update_t CmdBreakpointEdit (int nArgs);
680 Update_t CmdBreakpointEnable (int nArgs);
681 Update_t CmdBreakpointList (int nArgs);
682 // Update_t CmdBreakpointLoad (int nArgs);
683 Update_t CmdBreakpointSave (int nArgs);
684684 // Benchmark
685 Update_t CmdBenchmark (int nArgs);
686 Update_t CmdBenchmarkStart (int nArgs); //Update_t CmdSetupBenchmark (int nArgs);
687 Update_t CmdBenchmarkStop (int nArgs); //Update_t CmdExtBenchmark (int nArgs);
688 Update_t CmdProfile (int nArgs);
689 Update_t CmdProfileStart (int nArgs);
690 Update_t CmdProfileStop (int nArgs);
685 Update_t CmdBenchmark (int nArgs);
686 Update_t CmdBenchmarkStart (int nArgs); //Update_t CmdSetupBenchmark (int nArgs);
687 Update_t CmdBenchmarkStop (int nArgs); //Update_t CmdExtBenchmark (int nArgs);
688 Update_t CmdProfile (int nArgs);
689 Update_t CmdProfileStart (int nArgs);
690 Update_t CmdProfileStop (int nArgs);
691691 // Config
692 // Update_t CmdConfigMenu (int nArgs);
693 // Update_t CmdConfigBase (int nArgs);
694 // Update_t CmdConfigBaseHex (int nArgs);
695 // Update_t CmdConfigBaseDec (int nArgs);
696 Update_t CmdConfigColorMono (int nArgs);
697 Update_t CmdConfigDisasm (int nArgs);
698 Update_t CmdConfigFont (int nArgs);
699 Update_t CmdConfigHColor (int nArgs);
700 Update_t CmdConfigLoad (int nArgs);
701 Update_t CmdConfigSave (int nArgs);
702 Update_t CmdConfigSetFont (int nArgs);
703 Update_t CmdConfigGetFont (int nArgs);
692 // Update_t CmdConfigMenu (int nArgs);
693 // Update_t CmdConfigBase (int nArgs);
694 // Update_t CmdConfigBaseHex (int nArgs);
695 // Update_t CmdConfigBaseDec (int nArgs);
696 Update_t CmdConfigColorMono (int nArgs);
697 Update_t CmdConfigDisasm (int nArgs);
698 Update_t CmdConfigFont (int nArgs);
699 Update_t CmdConfigHColor (int nArgs);
700 Update_t CmdConfigLoad (int nArgs);
701 Update_t CmdConfigSave (int nArgs);
702 Update_t CmdConfigSetFont (int nArgs);
703 Update_t CmdConfigGetFont (int nArgs);
704704 // Cursor
705 Update_t CmdCursorFollowTarget(int nArgs);
706 Update_t CmdCursorLineDown (int nArgs);
707 Update_t CmdCursorLineUp (int nArgs);
708 Update_t CmdCursorJumpRetAddr (int nArgs);
709 Update_t CmdCursorRunUntil (int nArgs);
710 Update_t CmdCursorPageDown (int nArgs);
711 Update_t CmdCursorPageDown256 (int nArgs);
712 Update_t CmdCursorPageDown4K (int nArgs);
713 Update_t CmdCursorPageUp (int nArgs);
714 Update_t CmdCursorPageUp256 (int nArgs);
715 Update_t CmdCursorPageUp4K (int nArgs);
705 Update_t CmdCursorFollowTarget(int nArgs);
706 Update_t CmdCursorLineDown (int nArgs);
707 Update_t CmdCursorLineUp (int nArgs);
708 Update_t CmdCursorJumpRetAddr (int nArgs);
709 Update_t CmdCursorRunUntil (int nArgs);
710 Update_t CmdCursorPageDown (int nArgs);
711 Update_t CmdCursorPageDown256 (int nArgs);
712 Update_t CmdCursorPageDown4K (int nArgs);
713 Update_t CmdCursorPageUp (int nArgs);
714 Update_t CmdCursorPageUp256 (int nArgs);
715 Update_t CmdCursorPageUp4K (int nArgs);
716716 // Disk
717 Update_t CmdDisk (int nArgs);
717 Update_t CmdDisk (int nArgs);
718718 // Help
719 Update_t CmdHelpList (int nArgs);
720 Update_t CmdHelpSpecific (int Argss);
721 Update_t CmdVersion (int nArgs);
722 Update_t CmdMOTD (int nArgs);
719 Update_t CmdHelpList (int nArgs);
720 Update_t CmdHelpSpecific (int Argss);
721 Update_t CmdVersion (int nArgs);
722 Update_t CmdMOTD (int nArgs);
723723 // Flags
724 Update_t CmdFlag (int nArgs);
725 Update_t CmdFlagClear (int nArgs);
726 Update_t CmdFlagSet (int nArgs);
724 Update_t CmdFlag (int nArgs);
725 Update_t CmdFlagClear (int nArgs);
726 Update_t CmdFlagSet (int nArgs);
727727 // Memory (Data)
728 Update_t CmdMemoryCompare (int nArgs);
729 Update_t CmdMemoryMiniDumpHex (int nArgs);
730 Update_t CmdMemoryMiniDumpAscii(int nArgs);
731 Update_t CmdMemoryMiniDumpApple(int nArgs);
732 // Update_t CmdMemoryMiniDumpLow (int nArgs);
733 // Update_t CmdMemoryMiniDumpHigh (int nArgs);
734
735 Update_t CmdMemoryEdit (int nArgs);
736 Update_t CmdMemoryEnterByte (int nArgs);
737 Update_t CmdMemoryEnterWord (int nArgs);
738 Update_t CmdMemoryFill (int nArgs);
739 Update_t CmdMemoryLoad (int nArgs);
740 Update_t CmdMemoryMove (int nArgs);
741 Update_t CmdMemorySave (int nArgs);
742 Update_t CmdMemorySearch (int nArgs);
743 // Update_t CmdMemorySearchLowBit (int nArgs);
744 // Update_t CmdMemorySearchHiBit (int nArgs);
745 Update_t CmdMemorySearchAscii (int nArgs);
746 Update_t CmdMemorySearchApple (int nArgs);
747 Update_t CmdMemorySearchHex (int nArgs);
728 Update_t CmdMemoryCompare (int nArgs);
729 Update_t CmdMemoryMiniDumpHex (int nArgs);
730 Update_t CmdMemoryMiniDumpAscii(int nArgs);
731 Update_t CmdMemoryMiniDumpApple(int nArgs);
732 // Update_t CmdMemoryMiniDumpLow (int nArgs);
733 // Update_t CmdMemoryMiniDumpHigh (int nArgs);
734
735 Update_t CmdMemoryEdit (int nArgs);
736 Update_t CmdMemoryEnterByte (int nArgs);
737 Update_t CmdMemoryEnterWord (int nArgs);
738 Update_t CmdMemoryFill (int nArgs);
739 Update_t CmdMemoryLoad (int nArgs);
740 Update_t CmdMemoryMove (int nArgs);
741 Update_t CmdMemorySave (int nArgs);
742 Update_t CmdMemorySearch (int nArgs);
743 // Update_t CmdMemorySearchLowBit (int nArgs);
744 // Update_t CmdMemorySearchHiBit (int nArgs);
745 Update_t CmdMemorySearchAscii (int nArgs);
746 Update_t CmdMemorySearchApple (int nArgs);
747 Update_t CmdMemorySearchHex (int nArgs);
748748 // Output/Scripts
749 Update_t CmdOutputCalc (int nArgs);
750 Update_t CmdOutputEcho (int nArgs);
751 Update_t CmdOutputPrint (int nArgs);
752 Update_t CmdOutputPrintf (int nArgs);
753 Update_t CmdOutputRun (int nArgs);
749 Update_t CmdOutputCalc (int nArgs);
750 Update_t CmdOutputEcho (int nArgs);
751 Update_t CmdOutputPrint (int nArgs);
752 Update_t CmdOutputPrintf (int nArgs);
753 Update_t CmdOutputRun (int nArgs);
754754 // Registers
755 Update_t CmdRegisterSet (int nArgs);
755 Update_t CmdRegisterSet (int nArgs);
756756 // Source Level Debugging
757 Update_t CmdSource (int nArgs);
758 Update_t CmdSync (int nArgs);
757 Update_t CmdSource (int nArgs);
758 Update_t CmdSync (int nArgs);
759759 // Stack
760 Update_t CmdStackPush (int nArgs);
761 Update_t CmdStackPop (int nArgs);
762 Update_t CmdStackPopPseudo (int nArgs);
763 Update_t CmdStackReturn (int nArgs);
760 Update_t CmdStackPush (int nArgs);
761 Update_t CmdStackPop (int nArgs);
762 Update_t CmdStackPopPseudo (int nArgs);
763 Update_t CmdStackReturn (int nArgs);
764764 // Symbols
765 Update_t CmdSymbols (int nArgs);
766 Update_t CmdSymbolsClear (int nArgs);
767 Update_t CmdSymbolsList (int nArgs);
768 Update_t CmdSymbolsLoad (int nArgs);
769 Update_t CmdSymbolsInfo (int nArgs);
770 Update_t CmdSymbolsMain (int nArgs);
771 Update_t CmdSymbolsUser (int nArgs);
772 Update_t CmdSymbolsSave (int nArgs);
773 Update_t CmdSymbolsSource (int nArgs);
765 Update_t CmdSymbols (int nArgs);
766 Update_t CmdSymbolsClear (int nArgs);
767 Update_t CmdSymbolsList (int nArgs);
768 Update_t CmdSymbolsLoad (int nArgs);
769 Update_t CmdSymbolsInfo (int nArgs);
770 Update_t CmdSymbolsMain (int nArgs);
771 Update_t CmdSymbolsUser (int nArgs);
772 Update_t CmdSymbolsSave (int nArgs);
773 Update_t CmdSymbolsSource (int nArgs);
774774 // Watch
775 Update_t CmdWatch (int nArgs);
776 Update_t CmdWatchAdd (int nArgs);
777 Update_t CmdWatchClear (int nArgs);
778 Update_t CmdWatchDisable (int nArgs);
779 Update_t CmdWatchEnable (int nArgs);
780 Update_t CmdWatchList (int nArgs);
781 // Update_t CmdWatchLoad (int nArgs);
782 Update_t CmdWatchSave (int nArgs);
775 Update_t CmdWatch (int nArgs);
776 Update_t CmdWatchAdd (int nArgs);
777 Update_t CmdWatchClear (int nArgs);
778 Update_t CmdWatchDisable (int nArgs);
779 Update_t CmdWatchEnable (int nArgs);
780 Update_t CmdWatchList (int nArgs);
781 // Update_t CmdWatchLoad (int nArgs);
782 Update_t CmdWatchSave (int nArgs);
783783 // Window
784 Update_t CmdWindow (int nArgs);
785 Update_t CmdWindowCycleNext (int nArgs);
786 Update_t CmdWindowCyclePrev (int nArgs);
787 Update_t CmdWindowLast (int nArgs);
788
789 Update_t CmdWindowShowCode (int nArgs);
790 Update_t CmdWindowShowCode1 (int nArgs);
791 Update_t CmdWindowShowCode2 (int nArgs);
792 Update_t CmdWindowShowData (int nArgs);
793 Update_t CmdWindowShowData1 (int nArgs);
794 Update_t CmdWindowShowData2 (int nArgs);
795 Update_t CmdWindowShowSymbols1(int nArgs);
796 Update_t CmdWindowShowSymbols2(int nArgs);
797 Update_t CmdWindowShowSource (int nArgs);
798 Update_t CmdWindowShowSource1 (int nArgs);
799 Update_t CmdWindowShowSource2 (int nArgs);
800
801 Update_t CmdWindowViewCode (int nArgs);
802 Update_t CmdWindowViewConsole (int nArgs);
803 Update_t CmdWindowViewData (int nArgs);
804 Update_t CmdWindowViewOutput (int nArgs);
805 Update_t CmdWindowViewSource (int nArgs);
806 Update_t CmdWindowViewSymbols (int nArgs);
807
808 Update_t CmdWindowWidthToggle (int nArgs);
809
810 // Update_t CmdZeroPageShow (int nArgs);
811 // Update_t CmdZeroPageHide (int nArgs);
812 // Update_t CmdZeroPageToggle (int nArgs);
784 Update_t CmdWindow (int nArgs);
785 Update_t CmdWindowCycleNext (int nArgs);
786 Update_t CmdWindowCyclePrev (int nArgs);
787 Update_t CmdWindowLast (int nArgs);
788
789 Update_t CmdWindowShowCode (int nArgs);
790 Update_t CmdWindowShowCode1 (int nArgs);
791 Update_t CmdWindowShowCode2 (int nArgs);
792 Update_t CmdWindowShowData (int nArgs);
793 Update_t CmdWindowShowData1 (int nArgs);
794 Update_t CmdWindowShowData2 (int nArgs);
795 Update_t CmdWindowShowSymbols1(int nArgs);
796 Update_t CmdWindowShowSymbols2(int nArgs);
797 Update_t CmdWindowShowSource (int nArgs);
798 Update_t CmdWindowShowSource1 (int nArgs);
799 Update_t CmdWindowShowSource2 (int nArgs);
800
801 Update_t CmdWindowViewCode (int nArgs);
802 Update_t CmdWindowViewConsole (int nArgs);
803 Update_t CmdWindowViewData (int nArgs);
804 Update_t CmdWindowViewOutput (int nArgs);
805 Update_t CmdWindowViewSource (int nArgs);
806 Update_t CmdWindowViewSymbols (int nArgs);
807
808 Update_t CmdWindowWidthToggle (int nArgs);
809
810 // Update_t CmdZeroPageShow (int nArgs);
811 // Update_t CmdZeroPageHide (int nArgs);
812 // Update_t CmdZeroPageToggle (int nArgs);
813813
814814 // ZeroPage
815 Update_t CmdZeroPage (int nArgs);
816 Update_t CmdZeroPageAdd (int nArgs);
817 Update_t CmdZeroPageClear (int nArgs);
818 Update_t CmdZeroPageDisable (int nArgs);
819 Update_t CmdZeroPageEnable (int nArgs);
820 Update_t CmdZeroPageList (int nArgs);
821 // Update_t CmdZeroPageLoad (int nArgs);
822 Update_t CmdZeroPageSave (int nArgs);
823 Update_t CmdZeroPagePointer (int nArgs);
815 Update_t CmdZeroPage (int nArgs);
816 Update_t CmdZeroPageAdd (int nArgs);
817 Update_t CmdZeroPageClear (int nArgs);
818 Update_t CmdZeroPageDisable (int nArgs);
819 Update_t CmdZeroPageEnable (int nArgs);
820 Update_t CmdZeroPageList (int nArgs);
821 // Update_t CmdZeroPageLoad (int nArgs);
822 Update_t CmdZeroPageSave (int nArgs);
823 Update_t CmdZeroPagePointer (int nArgs);
824824
825825
826826 // Cursor _________________________________________________________________________________________
827 enum Cursor_Align_e
828 {
829 CURSOR_ALIGN_TOP,
830 CURSOR_ALIGN_CENTER
831 };
832
833 enum CursorHiLightState_e
834 {
835 CURSOR_NORMAL , // White
836 CURSOR_CPU_PC , // Yellow
837 CURSOR_BREAKPOINT, // Red
838 };
827 enum Cursor_Align_e
828 {
829 CURSOR_ALIGN_TOP,
830 CURSOR_ALIGN_CENTER
831 };
832
833 enum CursorHiLightState_e
834 {
835 CURSOR_NORMAL , // White
836 CURSOR_CPU_PC , // Yellow
837 CURSOR_BREAKPOINT, // Red
838 };
839839
840840
841841 // Disassembly ____________________________________________________________________________________
842842
843 enum DisasmBranch_e
844 {
845 DISASM_BRANCH_OFF = 0
846 , DISASM_BRANCH_PLAIN
847 , DISASM_BRANCH_FANCY
848 , NUM_DISASM_BRANCH_TYPES
849 };
850
851 enum DisasmFormat_e
852 {
853 DISASM_FORMAT_CHAR = (1 << 0),
854 DISASM_FORMAT_SYMBOL = (1 << 1),
855 DISASM_FORMAT_OFFSET = (1 << 2),
856 DISASM_FORMAT_BRANCH = (1 << 3),
857 DISASM_FORMAT_TARGET_POINTER = (1 << 4),
858 DISASM_FORMAT_TARGET_VALUE = (1 << 5),
859 };
860
861 enum DisasmImmediate_e
862 {
863 DISASM_IMMED_OFF = 0
864 , DISASM_IMMED_TARGET
865 , DISASM_IMMED_MODE
866 , DISASM_IMMED_BOTH
867 , NUM_DISASM_IMMED_TYPES
868 };
869
870 enum DisasmTargets_e
871 {
872 DISASM_TARGET_OFF = 0
873 , DISASM_TARGET_VAL // Note: Also treated as bit flag !!
874 , DISASM_TARGET_ADDR // Note: Also treated as bit flag !!
875 , DISASM_TARGET_BOTH // Note: Also treated as bit flag !!
876 , NUM_DISASM_TARGET_TYPES
877 };
878
879 enum DisasmText_e
880 {
881 nMaxAddressLen = 40,
882 nMaxOpcodes = 3,
883 CHARS_FOR_ADDRESS = 8, // 4 digits plus null
884 };
885
886 struct DisasmLine_t
887 {
888 int iOpcode;
889 int iOpmode;
890 int nOpbyte;
891
892 char sAddress [ CHARS_FOR_ADDRESS ];
893 char sOpCodes [(nMaxOpcodes*3)+1];
894
895 int nTarget;
896 char sTarget [nMaxAddressLen];
897
898 char sTargetOffset[ CHARS_FOR_ADDRESS ]; // +/- 255, realistically +/-1
899 int nTargetOffset;
900
901 char sTargetPointer[ CHARS_FOR_ADDRESS ];
902 char sTargetValue [ CHARS_FOR_ADDRESS ];
903 // char sTargetAddress[ CHARS_FOR_ADDRESS ];
904
905 char sImmediate[ 4 ]; // 'c'
906 char nImmediate;
907 char sBranch [ 4 ]; // ^
908
909 bool bTargetImmediate;
910 bool bTargetIndirect;
911 bool bTargetIndexed ;
912 bool bTargetRelative;
913 bool bTargetX ;
914 bool bTargetY ;
915 bool bTargetValue ;
916
917 void Clear()
918 {
919 sAddress [ 0 ] = 0;
920 sOpCodes [ 0 ] = 0;
921
922 nTarget = 0;
923 sTarget [ 0 ] = 0;
924
925 sTargetOffset[ 0 ] = 0;
926 nTargetOffset = 0;
927
928 sTargetPointer[ 0 ] = 0;
929 sTargetValue [ 0 ] = 0;
930
931 sImmediate[ 0 ] = 0;
932 nImmediate = 0;
933
934 sBranch [ 0 ] = 0;
935
936 bTargetImmediate = false;
937 bTargetIndexed = false;
938 bTargetIndirect = false;
939 // bTargetInside = false;
940 // bTargetOutside = false;
941 bTargetRelative = false;
942 bTargetX = false;
943 bTargetY = false; // need to dislay ",Y"
944 bTargetValue = false;
945 }
946 };
843 enum DisasmBranch_e
844 {
845 DISASM_BRANCH_OFF = 0
846 , DISASM_BRANCH_PLAIN
847 , DISASM_BRANCH_FANCY
848 , NUM_DISASM_BRANCH_TYPES
849 };
850
851 enum DisasmFormat_e
852 {
853 DISASM_FORMAT_CHAR = (1 << 0),
854 DISASM_FORMAT_SYMBOL = (1 << 1),
855 DISASM_FORMAT_OFFSET = (1 << 2),
856 DISASM_FORMAT_BRANCH = (1 << 3),
857 DISASM_FORMAT_TARGET_POINTER = (1 << 4),
858 DISASM_FORMAT_TARGET_VALUE = (1 << 5),
859 };
860
861 enum DisasmImmediate_e
862 {
863 DISASM_IMMED_OFF = 0
864 , DISASM_IMMED_TARGET
865 , DISASM_IMMED_MODE
866 , DISASM_IMMED_BOTH
867 , NUM_DISASM_IMMED_TYPES
868 };
869
870 enum DisasmTargets_e
871 {
872 DISASM_TARGET_OFF = 0
873 , DISASM_TARGET_VAL // Note: Also treated as bit flag !!
874 , DISASM_TARGET_ADDR // Note: Also treated as bit flag !!
875 , DISASM_TARGET_BOTH // Note: Also treated as bit flag !!
876 , NUM_DISASM_TARGET_TYPES
877 };
878
879 enum DisasmText_e
880 {
881 nMaxAddressLen = 40,
882 nMaxOpcodes = 3,
883 CHARS_FOR_ADDRESS = 8, // 4 digits plus null
884 };
885
886 struct DisasmLine_t
887 {
888 int iOpcode;
889 int iOpmode;
890 int nOpbyte;
891
892 char sAddress [ CHARS_FOR_ADDRESS ];
893 char sOpCodes [(nMaxOpcodes*3)+1];
894
895 int nTarget;
896 char sTarget [nMaxAddressLen];
897
898 char sTargetOffset[ CHARS_FOR_ADDRESS ]; // +/- 255, realistically +/-1
899 int nTargetOffset;
900
901 char sTargetPointer[ CHARS_FOR_ADDRESS ];
902 char sTargetValue [ CHARS_FOR_ADDRESS ];
903 // char sTargetAddress[ CHARS_FOR_ADDRESS ];
904
905 char sImmediate[ 4 ]; // 'c'
906 char nImmediate;
907 char sBranch [ 4 ]; // ^
908
909 bool bTargetImmediate;
910 bool bTargetIndirect;
911 bool bTargetIndexed ;
912 bool bTargetRelative;
913 bool bTargetX ;
914 bool bTargetY ;
915 bool bTargetValue ;
916
917 void Clear()
918 {
919 sAddress [ 0 ] = 0;
920 sOpCodes [ 0 ] = 0;
921
922 nTarget = 0;
923 sTarget [ 0 ] = 0;
924
925 sTargetOffset[ 0 ] = 0;
926 nTargetOffset = 0;
927
928 sTargetPointer[ 0 ] = 0;
929 sTargetValue [ 0 ] = 0;
930
931 sImmediate[ 0 ] = 0;
932 nImmediate = 0;
933
934 sBranch [ 0 ] = 0;
935
936 bTargetImmediate = false;
937 bTargetIndexed = false;
938 bTargetIndirect = false;
939 // bTargetInside = false;
940 // bTargetOutside = false;
941 bTargetRelative = false;
942 bTargetX = false;
943 bTargetY = false; // need to dislay ",Y"
944 bTargetValue = false;
945 }
946 };
947947
948948 // Font ___________________________________________________________________________________________
949 enum FontType_e
950 {
951 // FONT_DEFAULT
952 FONT_INFO
953 , FONT_CONSOLE
954 , FONT_DISASM_DEFAULT
955 , FONT_DISASM_BRANCH
956 // , FONT_SOURCE
957 , NUM_FONTS
958 };
959
960 enum
961 {
962 MAX_FONT_NAME = MAX_ARG_LEN // was 64
963 };
964
965 enum FontSpacing_e
966 {
967 FONT_SPACING_CLASSIC , // least lines (most spacing)
968 FONT_SPACING_CLEAN , // more lines (minimal spacing)
969 FONT_SPACING_COMPRESSED, // max lines (least spacing)
970 NUM_FONT_SPACING
971 };
972
973 struct FontConfig_t
974 {
975 char _sFontName[ MAX_FONT_NAME ];
976 // HFONT _hFont;
977 // int _iFontType;
978 int _nFontWidthAvg;
979 int _nFontWidthMax;
980 int _nFontHeight;
981 int _nLineHeight; // may or may not include spacer
982 };
949 enum FontType_e
950 {
951 // FONT_DEFAULT
952 FONT_INFO
953 , FONT_CONSOLE
954 , FONT_DISASM_DEFAULT
955 , FONT_DISASM_BRANCH
956 // , FONT_SOURCE
957 , NUM_FONTS
958 };
959
960 enum
961 {
962 MAX_FONT_NAME = MAX_ARG_LEN // was 64
963 };
964
965 enum FontSpacing_e
966 {
967 FONT_SPACING_CLASSIC , // least lines (most spacing)
968 FONT_SPACING_CLEAN , // more lines (minimal spacing)
969 FONT_SPACING_COMPRESSED, // max lines (least spacing)
970 NUM_FONT_SPACING
971 };
972
973 struct FontConfig_t
974 {
975 char _sFontName[ MAX_FONT_NAME ];
976 // HFONT _hFont;
977 // int _iFontType;
978 int _nFontWidthAvg;
979 int _nFontWidthMax;
980 int _nFontHeight;
981 int _nLineHeight; // may or may not include spacer
982 };
983983
984984
985985 // Instructions / Opcodes _________________________________________________________________________
986986
987 //#define SUPPORT_Z80_EMU
988 #ifdef SUPPORT_Z80_EMU
989 #define OUTPUT_Z80_REGS
990 #define REG_AF 0xF0
991 #define REG_BC 0xF2
992 #define REG_DE 0xF4
993 #define REG_HL 0xF6
994 #define REG_IX 0xF8
995 #endif
996
997 enum MemoryAccess_e
998 {
999 MEM_R = (1 << 0), // Read
1000 MEM_W = (1 << 1), // Write
1001 MEM_RI = (1 << 2), // Read Implicit (Implied)
1002 MEM_WI = (1 << 3), // Write Implicit (Implied)
1003 MEM_S = (1 << 4), // Stack (Read/Write)
1004 MEM_IM = (1 << 5), // Immediate - Technically reads target byte
1005
1006 NUM_MEM_ACCESS,
1007
1008 // Alias
1009 MEM_READ = (1 << 0),
1010 MEM_WRITE = (1 << 1),
1011 };
1012
1013 enum
1014 {
1015 NUM_OPCODES = 256,
1016 MAX_MNEMONIC_LEN = 3,
1017 };
1018
1019 struct Opcodes_t
1020 {
1021 char sMnemonic[ MAX_MNEMONIC_LEN+1 ];
1022 // int16 for structure 8-byte alignment
1023 short nAddressMode; // TODO/FIX: nOpmode
1024 short nMemoryAccess;
1025 };
1026
1027 struct Instruction2_t
1028 {
1029 char sMnemonic[MAX_MNEMONIC_LEN+1];
1030 int nAddressMode;
1031 int iMemoryAccess;
1032 };
1033
1034 enum Opcode_e
1035 {
1036 OPCODE_BRA = 0x80,
1037
1038 OPCODE_JSR = 0x20,
1039 OPCODE_JMP_A = 0x4C, // Absolute
1040 OPCODE_JMP_NA = 0x6C, // Indirect Absolute
1041 OPCODE_JMP_IAX = 0x7C, // Indexed (Absolute Indirect, X)
1042 };
1043
1044 // Note: "int" causes overflow when profiling for any amount of time.
1045 // typedef unsigned int Profile_t;
1046 // i.e.
1047 // double nPercent = static_cast<double>(100 * tProfileOpcode.uProfile) / nOpcodeTotal; // overflow
1048 typedef double Profile_t;
1049
1050 struct ProfileOpcode_t
1051 {
1052 int m_iOpcode;
1053 Profile_t m_nCount; // Histogram
1054
1055 // functor
1056 bool operator () (const ProfileOpcode_t & rLHS, const ProfileOpcode_t & rRHS) const
1057 {
1058 bool bGreater = (rLHS.m_nCount > rRHS.m_nCount);
1059 return bGreater;
1060 }
1061 };
1062
1063 struct ProfileOpmode_t
1064 {
1065 int m_iOpmode;
1066 Profile_t m_nCount; // Histogram
1067
1068 // functor
1069 bool operator () (const ProfileOpmode_t & rLHS, const ProfileOpmode_t & rRHS) const
1070 {
1071 bool bGreater = (rLHS.m_nCount > rRHS.m_nCount);
1072 return bGreater;
1073 }
1074 };
1075
1076 enum ProfileFormat_e
1077 {
1078 PROFILE_FORMAT_SPACE,
1079 PROFILE_FORMAT_TAB,
1080 PROFILE_FORMAT_COMMA,
1081 };
987 //#define SUPPORT_Z80_EMU
988 #ifdef SUPPORT_Z80_EMU
989 #define OUTPUT_Z80_REGS
990 #define REG_AF 0xF0
991 #define REG_BC 0xF2
992 #define REG_DE 0xF4
993 #define REG_HL 0xF6
994 #define REG_IX 0xF8
995 #endif
996
997 enum MemoryAccess_e
998 {
999 MEM_R = (1 << 0), // Read
1000 MEM_W = (1 << 1), // Write
1001 MEM_RI = (1 << 2), // Read Implicit (Implied)
1002 MEM_WI = (1 << 3), // Write Implicit (Implied)
1003 MEM_S = (1 << 4), // Stack (Read/Write)
1004 MEM_IM = (1 << 5), // Immediate - Technically reads target byte
1005
1006 NUM_MEM_ACCESS,
1007
1008 // Alias
1009 MEM_READ = (1 << 0),
1010 MEM_WRITE = (1 << 1),
1011 };
1012
1013 enum
1014 {
1015 NUM_OPCODES = 256,
1016 MAX_MNEMONIC_LEN = 3,
1017 };
1018
1019 struct Opcodes_t
1020 {
1021 char sMnemonic[ MAX_MNEMONIC_LEN+1 ];
1022 // int16 for structure 8-byte alignment
1023 short nAddressMode; // TODO/FIX: nOpmode
1024 short nMemoryAccess;
1025 };
1026
1027 struct Instruction2_t
1028 {
1029 char sMnemonic[MAX_MNEMONIC_LEN+1];
1030 int nAddressMode;
1031 int iMemoryAccess;
1032 };
1033
1034 enum Opcode_e
1035 {
1036 OPCODE_BRA = 0x80,
1037
1038 OPCODE_JSR = 0x20,
1039 OPCODE_JMP_A = 0x4C, // Absolute
1040 OPCODE_JMP_NA = 0x6C, // Indirect Absolute
1041 OPCODE_JMP_IAX = 0x7C, // Indexed (Absolute Indirect, X)
1042 };
1043
1044 // Note: "int" causes overflow when profiling for any amount of time.
1045 // typedef unsigned int Profile_t;
1046 // i.e.
1047 // double nPercent = static_cast<double>(100 * tProfileOpcode.uProfile) / nOpcodeTotal; // overflow
1048 typedef double Profile_t;
1049
1050 struct ProfileOpcode_t
1051 {
1052 int m_iOpcode;
1053 Profile_t m_nCount; // Histogram
1054
1055 // functor
1056 bool operator () (const ProfileOpcode_t & rLHS, const ProfileOpcode_t & rRHS) const
1057 {
1058 bool bGreater = (rLHS.m_nCount > rRHS.m_nCount);
1059 return bGreater;
1060 }
1061 };
1062
1063 struct ProfileOpmode_t
1064 {
1065 int m_iOpmode;
1066 Profile_t m_nCount; // Histogram
1067
1068 // functor
1069 bool operator () (const ProfileOpmode_t & rLHS, const ProfileOpmode_t & rRHS) const
1070 {
1071 bool bGreater = (rLHS.m_nCount > rRHS.m_nCount);
1072 return bGreater;
1073 }
1074 };
1075
1076 enum ProfileFormat_e
1077 {
1078 PROFILE_FORMAT_SPACE,
1079 PROFILE_FORMAT_TAB,
1080 PROFILE_FORMAT_COMMA,
1081 };
10821082
10831083 // Memory _________________________________________________________________________________________
10841084
1085 extern const int _6502_BRANCH_POS ;//= +127
1086 extern const int _6502_BRANCH_NEG ;//= -128
1087 extern const unsigned int _6502_ZEROPAGE_END ;//= 0x00FF;
1088 extern const unsigned int _6502_STACK_END ;//= 0x01FF;
1089 extern const unsigned int _6502_IO_BEGIN ;//= 0xC000;
1090 extern const unsigned int _6502_IO_END ;//= 0xC0FF;
1091 extern const unsigned int _6502_MEM_BEGIN ;//= 0x0000;
1092 extern const unsigned int _6502_MEM_END ;//= 0xFFFF;
1093
1094
1095 enum DEVICE_e
1096 {
1097 DEV_MEMORY,
1098 DEV_DISK2 ,
1099 DEV_SY6522,
1100 DEV_AY8910,
1101 NUM_DEVICES
1102 };
1103
1104 enum MemoryView_e
1105 {
1106 MEM_VIEW_HEX ,
1107
1108 // 0x00 .. 0x1F Ctrl (Inverse)
1109 // 0x20 .. 0x7F Flash / MouseText (Cyan)
1110 // 0x80 .. 0x9F Hi-Bit Ctrl (Yellow)
1111 // 0xA0 .. 0xFF Hi-Bit Normal (White)
1112 MEM_VIEW_ASCII ,
1113 MEM_VIEW_APPLE , // Low-Bit ASCII (Colorized Background)
1114 // MEM_VIEW_TXT_LO, // Ctrl Chars mapped to visible range, and inverse
1115 // MEM_VIEW_TXT_HI, // High Bit Ascii
1116 NUM_MEM_VIEWS
1117 };
1118
1119 struct MemoryDump_t
1120 {
1121 bool bActive;
1122 WORD nAddress; // nAddressMemDump; // was USHORT
1123 DEVICE_e eDevice;
1124 MemoryView_e eView;
1125 };
1126
1127 enum MemoryDump_e
1128 {
1129 MEM_DUMP_1,
1130 MEM_DUMP_2,
1131 NUM_MEM_DUMPS
1132 };
1133
1134 enum MemoryMiniDump_e
1135 {
1136 NUM_MEM_MINI_DUMPS = 2
1137 };
1138
1139 enum MemorySearch_e
1140 {
1141 MEM_SEARCH_BYTE_EXACT , // xx
1142 MEM_SEARCH_NIB_LOW_EXACT , // ?x
1143 MEM_SEARCH_NIB_HIGH_EXACT, // x?
1144 MEM_SEARCH_BYTE_1_WILD , // ?
1145 MEM_SEARCH_BYTE_N_WILD , // ??
1146
1147 MEM_SEARCH_TYPE_MASK = (1 << 16) - 1,
1148 MEM_SEARCH_FOUND = (1 << 16)
1149 };
1150
1151 struct MemorySearch_t
1152 {
1153 BYTE m_nValue ; // search value
1154 MemorySearch_e m_iType ; //
1155 bool m_bFound ; //
1156 };
1157
1158 typedef vector<MemorySearch_t> MemorySearchValues_t;
1159 typedef vector<int> MemorySearchResults_t;
1085 extern const int _6502_BRANCH_POS ;//= +127
1086 extern const int _6502_BRANCH_NEG ;//= -128
1087 extern const unsigned int _6502_ZEROPAGE_END ;//= 0x00FF;
1088 extern const unsigned int _6502_STACK_END ;//= 0x01FF;
1089 extern const unsigned int _6502_IO_BEGIN ;//= 0xC000;
1090 extern const unsigned int _6502_IO_END ;//= 0xC0FF;
1091 extern const unsigned int _6502_MEM_BEGIN ;//= 0x0000;
1092 extern const unsigned int _6502_MEM_END ;//= 0xFFFF;
1093
1094
1095 enum DEVICE_e
1096 {
1097 DEV_MEMORY,
1098 DEV_DISK2 ,
1099 DEV_SY6522,
1100 DEV_AY8910,
1101 NUM_DEVICES
1102 };
1103
1104 enum MemoryView_e
1105 {
1106 MEM_VIEW_HEX ,
1107
1108 // 0x00 .. 0x1F Ctrl (Inverse)
1109 // 0x20 .. 0x7F Flash / MouseText (Cyan)
1110 // 0x80 .. 0x9F Hi-Bit Ctrl (Yellow)
1111 // 0xA0 .. 0xFF Hi-Bit Normal (White)
1112 MEM_VIEW_ASCII ,
1113 MEM_VIEW_APPLE , // Low-Bit ASCII (Colorized Background)
1114 // MEM_VIEW_TXT_LO, // Ctrl Chars mapped to visible range, and inverse
1115 // MEM_VIEW_TXT_HI, // High Bit Ascii
1116 NUM_MEM_VIEWS
1117 };
1118
1119 struct MemoryDump_t
1120 {
1121 bool bActive;
1122 WORD nAddress; // nAddressMemDump; // was USHORT
1123 DEVICE_e eDevice;
1124 MemoryView_e eView;
1125 };
1126
1127 enum MemoryDump_e
1128 {
1129 MEM_DUMP_1,
1130 MEM_DUMP_2,
1131 NUM_MEM_DUMPS
1132 };
1133
1134 enum MemoryMiniDump_e
1135 {
1136 NUM_MEM_MINI_DUMPS = 2
1137 };
1138
1139 enum MemorySearch_e
1140 {
1141 MEM_SEARCH_BYTE_EXACT , // xx
1142 MEM_SEARCH_NIB_LOW_EXACT , // ?x
1143 MEM_SEARCH_NIB_HIGH_EXACT, // x?
1144 MEM_SEARCH_BYTE_1_WILD , // ?
1145 MEM_SEARCH_BYTE_N_WILD , // ??
1146
1147 MEM_SEARCH_TYPE_MASK = (1 << 16) - 1,
1148 MEM_SEARCH_FOUND = (1 << 16)
1149 };
1150
1151 struct MemorySearch_t
1152 {
1153 BYTE m_nValue ; // search value
1154 MemorySearch_e m_iType ; //
1155 bool m_bFound ; //
1156 };
1157
1158 typedef vector<MemorySearch_t> MemorySearchValues_t;
1159 typedef vector<int> MemorySearchResults_t;
11601160
11611161 // Parameters _____________________________________________________________________________________
11621162
1163 /* i.e.
1164 SYM LOAD = $C600 (1) type: string, nVal1 = symlookup; (2) type: operator, token: EQUAL; (3) type: address, token:DOLLAR
1165 BP LOAD type:
1166 BP $LOAD type: (1) = symbol, val=1adress
1167 */
1168 enum ArgToken_e // Arg Token Type
1169 {
1170 // Single Char Tokens must come first
1171 TOKEN_ALPHANUMERIC //
1172 , TOKEN_AMPERSAND // &
1173 , TOKEN_AT // @ results dereference. i.e. S 0,FFFF C030; L @1
1174 , TOKEN_BRACE_L // {
1175 , TOKEN_BRACE_R // }
1176 , TOKEN_BRACKET_L // [
1177 , TOKEN_BRACKET_R // ]
1178 , TOKEN_BSLASH // \xx Hex Literal
1179 , TOKEN_CARET // ^
1180 // , TOKEN_CHAR
1181 , TOKEN_COLON // : Range
1182 , TOKEN_COMMA // , Length
1183 // , TOKEN_DIGIT
1184 , TOKEN_DOLLAR // $ Address (symbol lookup forced)
1185 , TOKEN_EQUAL // = Assign Argment.n2 = Argument2
1186 , TOKEN_EXCLAMATION // !
1187 , TOKEN_FSLASH // /
1188 , TOKEN_GREATER_THAN // >
1189 , TOKEN_HASH // # Value no symbol lookup
1190 , TOKEN_LESS_THAN // <
1191 , TOKEN_MINUS // - Delta Argument1 -= Argument2
1192 , TOKEN_PAREN_L // (
1193 , TOKEN_PAREN_R // )
1194 , TOKEN_PERCENT // %
1195 , TOKEN_PIPE // |
1196 , TOKEN_PLUS // + Delta Argument1 += Argument2
1197 , TOKEN_QUOTE_SINGLE // '
1198 , TOKEN_QUOTE_DOUBLE // "
1199 , TOKEN_SEMI // ; Command Seperator
1200 , TOKEN_SPACE // Token Delimiter
1201 , TOKEN_STAR // *
1202 // , TOKEN_TAB // '\t'
1203 , TOKEN_TILDE // ~
1204
1205 // Multi char tokens come last
1206 , TOKEN_COMMENT_EOL // //
1207 ,_TOKEN_FLAG_MULTI = TOKEN_COMMENT_EOL
1208 , TOKEN_GREATER_EQUAL// >=
1209 , TOKEN_LESS_EQUAL // <=
1210 , TOKEN_NOT_EQUAL // !=
1211 // , TOKEN_COMMENT_1 // /*
1212 // , TOKEN_COMMENT_2 // */
1213
1214 , NUM_TOKENS // signal none, or bad
1215 , NO_TOKEN = NUM_TOKENS
1216 };
1217
1218 enum ArgType_e
1219 {
1220 TYPE_ADDRESS = (1 << 0) // $#### or $symbolname
1221 , TYPE_OPERATOR = (1 << 1)
1222 , TYPE_QUOTED_1 = (1 << 2)
1223 , TYPE_QUOTED_2 = (1 << 3) // "..."
1224 , TYPE_STRING = (1 << 4) // LOAD
1225 , TYPE_RANGE = (1 << 5)
1226 , TYPE_LENGTH = (1 << 6)
1227 , TYPE_VALUE = (1 << 7)
1228 , TYPE_NO_REG = (1 << 8) // Don't do register value -> Argument.nValue
1229 , TYPE_NO_SYM = (1 << 9) // Don't do symbol lookup -> Argument.nValue
1230 };
1231
1232 struct TokenTable_t
1233 {
1234 ArgToken_e eToken;
1235 ArgType_e eType ;
1236 char sToken[4];
1237 };
1238
1239 struct Arg_t
1240 {
1241 char sArg[ MAX_ARG_LEN ]; // Array chars comes first, for alignment
1242 int nArgLen; // Needed for TextSearch "ABC\x00"
1243 WORD nValue ; // 2
1244 // WORD nVal1 ; // 2
1245 // WORD nVal2 ; // 2 If we have a Len (,)
1246 // Enums and Bools should come last for alignment
1247 ArgToken_e eToken ; // 1/2/4
1248 int bType ; // 1/2/4 // Flags of ArgType_e
1249 DEVICE_e eDevice; // 1/2/4
1250 bool bSymbol; // 1
1251 };
1252
1253 // NOTE: Order MUST match g_aParameters[] !!!
1254 enum Parameters_e
1255 {
1256 // Note: Order must match Breakpoint_Operator_t
1257 // Note: Order must much _PARAM_BREAKPOINT_*
1258 // Note: Order must match g_aBreakpointSymbols
1259 _PARAM_BREAKPOINT_BEGIN
1260 , PARAM_BP_LESS_EQUAL = _PARAM_BREAKPOINT_BEGIN // <=
1261 , PARAM_BP_LESS_THAN // <
1262 , PARAM_BP_EQUAL // =
1263 , PARAM_BP_NOT_EQUAL // !=
1264 , PARAM_BP_NOT_EQUAL_1 // !
1265 , PARAM_BP_GREATER_THAN // >
1266 , PARAM_BP_GREATER_EQUAL // >=
1267 , PARAM_BP_READ // R
1268 ,_PARAM_BP_READ // ? alias READ
1269 , PARAM_BP_WRITE // W
1270 ,_PARAM_BP_WRITE // @ alias write
1271 , PARAM_BP_READ_WRITE // * alias READ WRITE
1272 , _PARAM_BREAKPOINT_END
1273 , PARAM_BREAKPOINT_NUM = _PARAM_BREAKPOINT_END - _PARAM_BREAKPOINT_BEGIN
1274
1275 // , PARAM_SIZE // TODO: used by FONT SIZE
1276
1277 // Note: Order must match Breakpoint_Source_t
1278 , _PARAM_REGS_BEGIN = _PARAM_BREAKPOINT_END // Daisy Chain
1163 /* i.e.
1164 SYM LOAD = $C600 (1) type: string, nVal1 = symlookup; (2) type: operator, token: EQUAL; (3) type: address, token:DOLLAR
1165 BP LOAD type:
1166 BP $LOAD type: (1) = symbol, val=1adress
1167 */
1168 enum ArgToken_e // Arg Token Type
1169 {
1170 // Single Char Tokens must come first
1171 TOKEN_ALPHANUMERIC //
1172 , TOKEN_AMPERSAND // &
1173 , TOKEN_AT // @ results dereference. i.e. S 0,FFFF C030; L @1
1174 , TOKEN_BRACE_L // {
1175 , TOKEN_BRACE_R // }
1176 , TOKEN_BRACKET_L // [
1177 , TOKEN_BRACKET_R // ]
1178 , TOKEN_BSLASH // \xx Hex Literal
1179 , TOKEN_CARET // ^
1180 // , TOKEN_CHAR
1181 , TOKEN_COLON // : Range
1182 , TOKEN_COMMA // , Length
1183 // , TOKEN_DIGIT
1184 , TOKEN_DOLLAR // $ Address (symbol lookup forced)
1185 , TOKEN_EQUAL // = Assign Argment.n2 = Argument2
1186 , TOKEN_EXCLAMATION // !
1187 , TOKEN_FSLASH // /
1188 , TOKEN_GREATER_THAN // >
1189 , TOKEN_HASH // # Value no symbol lookup
1190 , TOKEN_LESS_THAN // <
1191 , TOKEN_MINUS // - Delta Argument1 -= Argument2
1192 , TOKEN_PAREN_L // (
1193 , TOKEN_PAREN_R // )
1194 , TOKEN_PERCENT // %
1195 , TOKEN_PIPE // |
1196 , TOKEN_PLUS // + Delta Argument1 += Argument2
1197 , TOKEN_QUOTE_SINGLE // '
1198 , TOKEN_QUOTE_DOUBLE // "
1199 , TOKEN_SEMI // ; Command Seperator
1200 , TOKEN_SPACE // Token Delimiter
1201 , TOKEN_STAR // *
1202 // , TOKEN_TAB // '\t'
1203 , TOKEN_TILDE // ~
1204
1205 // Multi char tokens come last
1206 , TOKEN_COMMENT_EOL // //
1207 ,_TOKEN_FLAG_MULTI = TOKEN_COMMENT_EOL
1208 , TOKEN_GREATER_EQUAL// >=
1209 , TOKEN_LESS_EQUAL // <=
1210 , TOKEN_NOT_EQUAL // !=
1211 // , TOKEN_COMMENT_1 // /*
1212 // , TOKEN_COMMENT_2 // */
1213
1214 , NUM_TOKENS // signal none, or bad
1215 , NO_TOKEN = NUM_TOKENS
1216 };
1217
1218 enum ArgType_e
1219 {
1220 TYPE_ADDRESS = (1 << 0) // $#### or $symbolname
1221 , TYPE_OPERATOR = (1 << 1)
1222 , TYPE_QUOTED_1 = (1 << 2)
1223 , TYPE_QUOTED_2 = (1 << 3) // "..."
1224 , TYPE_STRING = (1 << 4) // LOAD
1225 , TYPE_RANGE = (1 << 5)
1226 , TYPE_LENGTH = (1 << 6)
1227 , TYPE_VALUE = (1 << 7)
1228 , TYPE_NO_REG = (1 << 8) // Don't do register value -> Argument.nValue
1229 , TYPE_NO_SYM = (1 << 9) // Don't do symbol lookup -> Argument.nValue
1230 };
1231
1232 struct TokenTable_t
1233 {
1234 ArgToken_e eToken;
1235 ArgType_e eType ;
1236 char sToken[4];
1237 };
1238
1239 struct Arg_t
1240 {
1241 char sArg[ MAX_ARG_LEN ]; // Array chars comes first, for alignment
1242 int nArgLen; // Needed for TextSearch "ABC\x00"
1243 WORD nValue ; // 2
1244 // WORD nVal1 ; // 2
1245 // WORD nVal2 ; // 2 If we have a Len (,)
1246 // Enums and Bools should come last for alignment
1247 ArgToken_e eToken ; // 1/2/4
1248 int bType ; // 1/2/4 // Flags of ArgType_e
1249 DEVICE_e eDevice; // 1/2/4
1250 bool bSymbol; // 1
1251 };
1252
1253 // NOTE: Order MUST match g_aParameters[] !!!
1254 enum Parameters_e
1255 {
1256 // Note: Order must match Breakpoint_Operator_t
1257 // Note: Order must much _PARAM_BREAKPOINT_*
1258 // Note: Order must match g_aBreakpointSymbols
1259 _PARAM_BREAKPOINT_BEGIN
1260 , PARAM_BP_LESS_EQUAL = _PARAM_BREAKPOINT_BEGIN // <=
1261 , PARAM_BP_LESS_THAN // <
1262 , PARAM_BP_EQUAL // =
1263 , PARAM_BP_NOT_EQUAL // !=
1264 , PARAM_BP_NOT_EQUAL_1 // !
1265 , PARAM_BP_GREATER_THAN // >
1266 , PARAM_BP_GREATER_EQUAL // >=
1267 , PARAM_BP_READ // R
1268 ,_PARAM_BP_READ // ? alias READ
1269 , PARAM_BP_WRITE // W
1270 ,_PARAM_BP_WRITE // @ alias write
1271 , PARAM_BP_READ_WRITE // * alias READ WRITE
1272 , _PARAM_BREAKPOINT_END
1273 , PARAM_BREAKPOINT_NUM = _PARAM_BREAKPOINT_END - _PARAM_BREAKPOINT_BEGIN
1274
1275 // , PARAM_SIZE // TODO: used by FONT SIZE
1276
1277 // Note: Order must match Breakpoint_Source_t
1278 , _PARAM_REGS_BEGIN = _PARAM_BREAKPOINT_END // Daisy Chain
12791279 // Regs
1280 , PARAM_REG_A = _PARAM_REGS_BEGIN
1281 , PARAM_REG_X
1282 , PARAM_REG_Y
1283 , PARAM_REG_PC // Program Counter
1284 , PARAM_REG_SP // Stack Pointer
1280 , PARAM_REG_A = _PARAM_REGS_BEGIN
1281 , PARAM_REG_X
1282 , PARAM_REG_Y
1283 , PARAM_REG_PC // Program Counter
1284 , PARAM_REG_SP // Stack Pointer
12851285 // Flags
1286 , PARAM_FLAGS // Processor Status
1287 , PARAM_FLAG_C // Carry
1288 , PARAM_FLAG_Z // Zero
1289 , PARAM_FLAG_I // Interrupt
1290 , PARAM_FLAG_D // Decimal
1291 , PARAM_FLAG_B // Break
1292 , PARAM_FLAG_R // Reserved
1293 , PARAM_FLAG_V // Overflow
1294 , PARAM_FLAG_N // Sign
1295 , _PARAM_REGS_END
1296 , PARAM_REGS_NUM = _PARAM_REGS_END - _PARAM_REGS_BEGIN
1286 , PARAM_FLAGS // Processor Status
1287 , PARAM_FLAG_C // Carry
1288 , PARAM_FLAG_Z // Zero
1289 , PARAM_FLAG_I // Interrupt
1290 , PARAM_FLAG_D // Decimal
1291 , PARAM_FLAG_B // Break
1292 , PARAM_FLAG_R // Reserved
1293 , PARAM_FLAG_V // Overflow
1294 , PARAM_FLAG_N // Sign
1295 , _PARAM_REGS_END
1296 , PARAM_REGS_NUM = _PARAM_REGS_END - _PARAM_REGS_BEGIN
12971297
12981298 // Disasm
1299 , _PARAM_CONFIG_BEGIN = _PARAM_REGS_END // Daisy Chain
1300 , PARAM_CONFIG_BRANCH = _PARAM_CONFIG_BEGIN // g_iConfigDisasmBranchType [0|1|2]
1301 , PARAM_CONFIG_COLON // g_bConfigDisasmAddressColon [0|1]
1302 , PARAM_CONFIG_OPCODE // g_bConfigDisasmOpcodesView [0|1]
1303 , PARAM_CONFIG_POINTER // g_bConfigInfoTargetPointer [0|1]
1304 , PARAM_CONFIG_SPACES // g_bConfigDisasmOpcodeSpaces [0|1]
1305 , PARAM_CONFIG_TARGET // g_iConfigDisasmTargets [0|1|2]
1306 , _PARAM_CONFIG_END
1307 , PARAM_CONFIG_NUM = _PARAM_CONFIG_END - _PARAM_CONFIG_BEGIN
1299 , _PARAM_CONFIG_BEGIN = _PARAM_REGS_END // Daisy Chain
1300 , PARAM_CONFIG_BRANCH = _PARAM_CONFIG_BEGIN // g_iConfigDisasmBranchType [0|1|2]
1301 , PARAM_CONFIG_COLON // g_bConfigDisasmAddressColon [0|1]
1302 , PARAM_CONFIG_OPCODE // g_bConfigDisasmOpcodesView [0|1]
1303 , PARAM_CONFIG_POINTER // g_bConfigInfoTargetPointer [0|1]
1304 , PARAM_CONFIG_SPACES // g_bConfigDisasmOpcodeSpaces [0|1]
1305 , PARAM_CONFIG_TARGET // g_iConfigDisasmTargets [0|1|2]
1306 , _PARAM_CONFIG_END
1307 , PARAM_CONFIG_NUM = _PARAM_CONFIG_END - _PARAM_CONFIG_BEGIN
13081308
13091309 // Disk
1310 , _PARAM_DISK_BEGIN = _PARAM_CONFIG_END // Daisy Chain
1311 , PARAM_DISK_EJECT = _PARAM_DISK_BEGIN // DISK 1 EJECT
1312 , PARAM_DISK_PROTECT // DISK 1 PROTECT
1313 , PARAM_DISK_READ // DISK 1 READ Track Sector NumSectors MemAddress
1314 , _PARAM_DISK_END
1315 , PARAM_DISK_NUM = _PARAM_DISK_END - _PARAM_DISK_BEGIN
1316
1317 , _PARAM_FONT_BEGIN = _PARAM_DISK_END // Daisy Chain
1318 , PARAM_FONT_MODE = _PARAM_FONT_BEGIN
1319 , _PARAM_FONT_END
1320 , PARAM_FONT_NUM = _PARAM_FONT_END - _PARAM_FONT_BEGIN
1321
1322 , _PARAM_GENERAL_BEGIN = _PARAM_FONT_END // Daisy Chain
1323 , PARAM_FIND = _PARAM_GENERAL_BEGIN
1324 , PARAM_BRANCH
1325 , PARAM_CATEGORY
1326 , PARAM_CLEAR
1327 , PARAM_LOAD
1328 , PARAM_LIST
1329 , PARAM_OFF
1330 , PARAM_ON
1331 , PARAM_RESET
1332 , PARAM_SAVE
1333 , PARAM_START
1334 , PARAM_STOP
1335 , _PARAM_GENERAL_END
1336 , PARAM_GENERAL_NUM = _PARAM_GENERAL_END - _PARAM_GENERAL_BEGIN
1337
1338 , _PARAM_HELPCATEGORIES_BEGIN = _PARAM_GENERAL_END // Daisy Chain
1339 , PARAM_WILDSTAR = _PARAM_HELPCATEGORIES_BEGIN
1340 , PARAM_CAT_BOOKMARKS
1341 , PARAM_CAT_BREAKPOINTS
1342 , PARAM_CAT_CONFIG
1343 , PARAM_CAT_CPU
1344 // , PARAM_CAT_EXPRESSION
1345 , PARAM_CAT_FLAGS
1346 , PARAM_CAT_HELP
1347 , PARAM_CAT_KEYBOARD
1348 , PARAM_CAT_MEMORY
1349 , PARAM_CAT_OUTPUT
1350 , PARAM_CAT_OPERATORS
1351 , PARAM_CAT_RANGE
1352 // , PARAM_CAT_REGISTERS
1353 , PARAM_CAT_SYMBOLS
1354 , PARAM_CAT_WATCHES
1355 , PARAM_CAT_WINDOW
1356 , PARAM_CAT_ZEROPAGE
1357 , _PARAM_HELPCATEGORIES_END
1358 , PARAM_HELPCATEGORIES_NUM = _PARAM_HELPCATEGORIES_END - _PARAM_HELPCATEGORIES_BEGIN
1359
1360 , _PARAM_MEM_SEARCH_BEGIN = _PARAM_HELPCATEGORIES_END // Daisy Chain
1361 , PARAM_MEM_SEARCH_WILD = _PARAM_MEM_SEARCH_BEGIN
1362 // , PARAM_MEM_SEARCH_BYTE
1363 , _PARAM_MEM_SEARCH_END
1364 , PARAM_MEM_SEARCH_NUM = _PARAM_MEM_SEARCH_END - _PARAM_MEM_SEARCH_BEGIN
1365
1366 , _PARAM_SOURCE_BEGIN = _PARAM_MEM_SEARCH_END // Daisy Chain
1367 , PARAM_SRC_MEMORY = _PARAM_SOURCE_BEGIN
1368 ,_PARAM_SRC_MEMORY // alias MEM = MEMORY
1369 , PARAM_SRC_SYMBOLS
1370 ,_PARAM_SRC_SYMBOLS // alias SYM = SYMBOLS
1371 , PARAM_SRC_MERLIN
1372 , PARAM_SRC_ORCA
1373 , _PARAM_SOURCE_END
1374 , PARAM_SOURCE_NUM = _PARAM_SOURCE_END - _PARAM_SOURCE_BEGIN
1375
1376 , _PARAM_WINDOW_BEGIN = _PARAM_SOURCE_END // Daisy Chain
1377 // These are the "full screen" "windows" / Panels / Tab sheets
1378 , PARAM_CODE = _PARAM_WINDOW_BEGIN // disasm
1379 // , PARAM_CODE_1 // disasm top // removed, since can't set top window for code/data
1380 , PARAM_CODE_2 // disasm bot
1381 , PARAM_CONSOLE
1382 , PARAM_DATA // data all
1383 // , PARAM_DATA_1 // data top // removed, since can't set top window for code/data
1384 , PARAM_DATA_2 // data bot
1385 , PARAM_DISASM
1386 , PARAM_INFO // Togle INFO on/off
1387 , PARAM_SOURCE
1388 , _PARAM_SRC // alias SRC = SOURCE
1389 // , PARAM_SOURCE_1 // source top // removed, since can't set top window for code/data
1390 , PARAM_SOURCE_2 // source bot
1391 , PARAM_SYMBOLS
1392 , _PARAM_SYM // alias SYM = SYMBOLS
1393 // , PARAM_SYMBOL_1 // symbols top // removed, since can't set top window for code/data
1394 , PARAM_SYMBOL_2 // symbols bot
1395 , _PARAM_WINDOW_END
1396 , PARAM_WINDOW_NUM = _PARAM_WINDOW_END - _PARAM_WINDOW_BEGIN
1397
1398 , NUM_PARAMS = _PARAM_WINDOW_END // Daisy Chain
1310 , _PARAM_DISK_BEGIN = _PARAM_CONFIG_END // Daisy Chain
1311 , PARAM_DISK_EJECT = _PARAM_DISK_BEGIN // DISK 1 EJECT
1312 , PARAM_DISK_PROTECT // DISK 1 PROTECT
1313 , PARAM_DISK_READ // DISK 1 READ Track Sector NumSectors MemAddress
1314 , _PARAM_DISK_END
1315 , PARAM_DISK_NUM = _PARAM_DISK_END - _PARAM_DISK_BEGIN
1316
1317 , _PARAM_FONT_BEGIN = _PARAM_DISK_END // Daisy Chain
1318 , PARAM_FONT_MODE = _PARAM_FONT_BEGIN
1319 , _PARAM_FONT_END
1320 , PARAM_FONT_NUM = _PARAM_FONT_END - _PARAM_FONT_BEGIN
1321
1322 , _PARAM_GENERAL_BEGIN = _PARAM_FONT_END // Daisy Chain
1323 , PARAM_FIND = _PARAM_GENERAL_BEGIN
1324 , PARAM_BRANCH
1325 , PARAM_CATEGORY
1326 , PARAM_CLEAR
1327 , PARAM_LOAD
1328 , PARAM_LIST
1329 , PARAM_OFF
1330 , PARAM_ON
1331 , PARAM_RESET
1332 , PARAM_SAVE
1333 , PARAM_START
1334 , PARAM_STOP
1335 , _PARAM_GENERAL_END
1336 , PARAM_GENERAL_NUM = _PARAM_GENERAL_END - _PARAM_GENERAL_BEGIN
1337
1338 , _PARAM_HELPCATEGORIES_BEGIN = _PARAM_GENERAL_END // Daisy Chain
1339 , PARAM_WILDSTAR = _PARAM_HELPCATEGORIES_BEGIN
1340 , PARAM_CAT_BOOKMARKS
1341 , PARAM_CAT_BREAKPOINTS
1342 , PARAM_CAT_CONFIG
1343 , PARAM_CAT_CPU
1344 // , PARAM_CAT_EXPRESSION
1345 , PARAM_CAT_FLAGS
1346 , PARAM_CAT_HELP
1347 , PARAM_CAT_KEYBOARD
1348 , PARAM_CAT_MEMORY
1349 , PARAM_CAT_OUTPUT
1350 , PARAM_CAT_OPERATORS
1351 , PARAM_CAT_RANGE
1352 // , PARAM_CAT_REGISTERS
1353 , PARAM_CAT_SYMBOLS
1354 , PARAM_CAT_WATCHES
1355 , PARAM_CAT_WINDOW
1356 , PARAM_CAT_ZEROPAGE
1357 , _PARAM_HELPCATEGORIES_END
1358 , PARAM_HELPCATEGORIES_NUM = _PARAM_HELPCATEGORIES_END - _PARAM_HELPCATEGORIES_BEGIN
1359
1360 , _PARAM_MEM_SEARCH_BEGIN = _PARAM_HELPCATEGORIES_END // Daisy Chain
1361 , PARAM_MEM_SEARCH_WILD = _PARAM_MEM_SEARCH_BEGIN
1362 // , PARAM_MEM_SEARCH_BYTE
1363 , _PARAM_MEM_SEARCH_END
1364 , PARAM_MEM_SEARCH_NUM = _PARAM_MEM_SEARCH_END - _PARAM_MEM_SEARCH_BEGIN
1365
1366 , _PARAM_SOURCE_BEGIN = _PARAM_MEM_SEARCH_END // Daisy Chain
1367 , PARAM_SRC_MEMORY = _PARAM_SOURCE_BEGIN
1368 ,_PARAM_SRC_MEMORY // alias MEM = MEMORY
1369 , PARAM_SRC_SYMBOLS
1370 ,_PARAM_SRC_SYMBOLS // alias SYM = SYMBOLS
1371 , PARAM_SRC_MERLIN
1372 , PARAM_SRC_ORCA
1373 , _PARAM_SOURCE_END
1374 , PARAM_SOURCE_NUM = _PARAM_SOURCE_END - _PARAM_SOURCE_BEGIN
1375
1376 , _PARAM_WINDOW_BEGIN = _PARAM_SOURCE_END // Daisy Chain
1377 // These are the "full screen" "windows" / Panels / Tab sheets
1378 , PARAM_CODE = _PARAM_WINDOW_BEGIN // disasm
1379 // , PARAM_CODE_1 // disasm top // removed, since can't set top window for code/data
1380 , PARAM_CODE_2 // disasm bot
1381 , PARAM_CONSOLE
1382 , PARAM_DATA // data all
1383 // , PARAM_DATA_1 // data top // removed, since can't set top window for code/data
1384 , PARAM_DATA_2 // data bot
1385 , PARAM_DISASM
1386 , PARAM_INFO // Togle INFO on/off
1387 , PARAM_SOURCE
1388 , _PARAM_SRC // alias SRC = SOURCE
1389 // , PARAM_SOURCE_1 // source top // removed, since can't set top window for code/data
1390 , PARAM_SOURCE_2 // source bot
1391 , PARAM_SYMBOLS
1392 , _PARAM_SYM // alias SYM = SYMBOLS
1393 // , PARAM_SYMBOL_1 // symbols top // removed, since can't set top window for code/data
1394 , PARAM_SYMBOL_2 // symbols bot
1395 , _PARAM_WINDOW_END
1396 , PARAM_WINDOW_NUM = _PARAM_WINDOW_END - _PARAM_WINDOW_BEGIN
1397
1398 , NUM_PARAMS = _PARAM_WINDOW_END // Daisy Chain
13991399
14001400 // Aliases (actuall names)
1401 // ,PARAM_DISASM = PARAM_CODE_1
1402 // , PARAM_BREAKPOINT_READ = PARAM_READ
1403 // , PARAM_BREAKPOINT_WRITE = PARAM_WRITE
1404 };
1401 // ,PARAM_DISASM = PARAM_CODE_1
1402 // , PARAM_BREAKPOINT_READ = PARAM_READ
1403 // , PARAM_BREAKPOINT_WRITE = PARAM_WRITE
1404 };
14051405
14061406
14071407 // Source Level Debugging _________________________________________________________________________
14081408
1409 enum
1410 {
1411 NO_SOURCE_LINE = -1
1412 };
1413
1414 typedef map<WORD, int> SourceAssembly_t; // Address -> Line # & FileName
1409 enum
1410 {
1411 NO_SOURCE_LINE = -1
1412 };
1413
1414 typedef map<WORD, int> SourceAssembly_t; // Address -> Line # & FileName
14151415
14161416
14171417 // Symbols ________________________________________________________________________________________
14181418
1419 enum
1420 {
1421 MAX_SYMBOLS_LEN = 13
1422 };
1423
1424 // ****************************************
1425 // WARNING: This is the simple enumeration.
1426 // See: g_aSymbols[]
1427 // ****************************************
1428 enum Symbols_e
1429 {
1430 SYMBOLS_MAIN,
1431 SYMBOLS_USER,
1432 SYMBOLS_SRC ,
1433 NUM_SYMBOL_TABLES = 3
1434 };
1435
1436 // ****************************************
1437 // WARNING: This is the bit-flags to select which table.
1438 // See: CmdSymbolsListTable()
1439 // ****************************************
1440 enum SymbolTable_e
1441 {
1442 SYMBOL_TABLE_MAIN = (1 << 0),
1443 SYMBOL_TABLE_USER = (1 << 1),
1444 SYMBOL_TABLE_SRC = (1 << 2),
1445 };
1446
1447 typedef map<WORD, string> SymbolTable_t;
1419 enum
1420 {
1421 MAX_SYMBOLS_LEN = 13
1422 };
1423
1424 // ****************************************
1425 // WARNING: This is the simple enumeration.
1426 // See: g_aSymbols[]
1427 // ****************************************
1428 enum Symbols_e
1429 {
1430 SYMBOLS_MAIN,
1431 SYMBOLS_USER,
1432 SYMBOLS_SRC ,
1433 NUM_SYMBOL_TABLES = 3
1434 };
1435
1436 // ****************************************
1437 // WARNING: This is the bit-flags to select which table.
1438 // See: CmdSymbolsListTable()
1439 // ****************************************
1440 enum SymbolTable_e
1441 {
1442 SYMBOL_TABLE_MAIN = (1 << 0),
1443 SYMBOL_TABLE_USER = (1 << 1),
1444 SYMBOL_TABLE_SRC = (1 << 2),
1445 };
1446
1447 typedef map<WORD, string> SymbolTable_t;
14481448
14491449
14501450 // Watches ________________________________________________________________________________________
14511451
1452 enum
1453 {
1454 MAX_WATCHES = 16
1455 };
1452 enum
1453 {
1454 MAX_WATCHES = 16
1455 };
14561456
14571457
14581458 // Window _________________________________________________________________________________________
14591459
1460 enum Window_e
1461 {
1462 WINDOW_CODE ,
1463 WINDOW_DATA ,
1464 WINDOW_CONSOLE ,
1465 NUM_WINDOWS ,
1460 enum Window_e
1461 {
1462 WINDOW_CODE ,
1463 WINDOW_DATA ,
1464 WINDOW_CONSOLE ,
1465 NUM_WINDOWS ,
14661466 // Not implemented yet
1467 WINDOW_IO , // soft switches $addr name state
1468 WINDOW_SYMBOLS ,
1469 WINDOW_ZEROPAGE,
1470 WINDOW_SOURCE ,
1471 };
1472
1473 struct WindowSplit_t
1474 {
1475 bool bSplit;
1476 Window_e eTop;
1477 Window_e eBot;
1478 // TODO: nTopHeight
1479 // TODO: nBotHeight
1480 };
1467 WINDOW_IO , // soft switches $addr name state
1468 WINDOW_SYMBOLS ,
1469 WINDOW_ZEROPAGE,
1470 WINDOW_SOURCE ,
1471 };
1472
1473 struct WindowSplit_t
1474 {
1475 bool bSplit;
1476 Window_e eTop;
1477 Window_e eBot;
1478 // TODO: nTopHeight
1479 // TODO: nBotHeight
1480 };
14811481
14821482
14831483 // Zero Page ______________________________________________________________________________________
14841484
1485 enum
1486 {
1487 MAX_ZEROPAGE_POINTERS = 8
1488 };
1489
1485 enum
1486 {
1487 MAX_ZEROPAGE_POINTERS = 8
1488 };
1489
1717
1818 enum Disk_Status_e
1919 {
20 DISK_STATUS_OFF ,
21 DISK_STATUS_READ ,
22 DISK_STATUS_WRITE,
23 DISK_STATUS_PROT ,
24 NUM_DISK_STATUS
20 DISK_STATUS_OFF ,
21 DISK_STATUS_READ ,
22 DISK_STATUS_WRITE,
23 DISK_STATUS_PROT ,
24 NUM_DISK_STATUS
2525 };
2626 void DiskGetLightStatus (int *pDisk1Status_,int *pDisk2Status_);
2727
3333 bool DiskGetProtect( const int iDrive );
3434 void DiskSetProtect( const int iDrive, const bool bWriteProtect );
3535 void DiskSelect (int);
36 void Disk_FTP_SelectImage (int);
36 void Disk_FTP_SelectImage (int);
3737 void DiskUpdatePosition (DWORD);
3838 bool DiskDriveSwap();
3939 void DiskLoadRom(LPBYTE pCxRomPeripheral, UINT uSlot);
00 #pragma once
11
2 extern TCHAR g_sFTPDirListing[512]; // name for FTP-directory listing
2 extern TCHAR g_sFTPDirListing[512]; // name for FTP-directory listing
33 /* Choose an image using FTP */
44 bool ChooseAnImageFTP(int sx,int sy, char *ftp_dir, int slot, char **filename, bool *isdir, int *index_file);
55
<
1010
1111 enum ImageError_e
1212 {
13 IMAGE_ERROR_BAD_POINTER =-1,
14 IMAGE_ERROR_NONE = 0,
15 IMAGE_ERROR_UNABLE_TO_OPEN = 1,