git @ Cat's Eye Technologies linapple / 644a4c1
Merge branch 'ghedger' into merge This took a bit of doing and will require some testing to make sure I didn't accidentally revert anything I shouldn't have, but I think I did okay. Testing wanted before I merge it into linappleii/linapple. T. Joseph Carter 3 years ago
146 changed file(s) with 41623 addition(s) and 40241 deletion(s). Raw diff Collapse all Expand all
0 /linapple
1 /src/linapple
2 *.o
0 bin
1 obj
32 *.pcm
0 LinApple version 2.1
1 28 November 2017
2
3 !! Keyboard: Fixed caps lock bug.
4
5 !! Display: Set higher default host screen resolution in windowed mode.
6
7 !! Audio: Eliminated decoupling capacitor simulation.
8
9 !! Audio: Fixed choppy Mockingboard sound due to incorrect cycle caculation between IRQs.
10
011 For LinApple version 2b has been made:
112 !! Fixed gcc version 4.8.4 <unistd.h> includes
213 !! Some cleanup on Makefile, INSTALL, README and some others
0 # Installation
1 # Build modernization by Greg Hedger, November 2017
2 # Ubuntu 16.04
3
4 make
5 cd bin
6 ./linapple
7
8 # Prerequisites
9 sudo apt-get install libzip-dev libzip4 libcurl3 libcurl-ocaml-dev
10
11
12 # Historical INSTALL
13 Linapple - crossplatfom emulator of Apple][ (Apple2, Apple 2) series computer for Linux or other OSes with SDL support.
14
15
16 [INSTALL]
17
18 You need SDL, cURL, zlib and libzip:
19
20 For Debian/Ubuntu their names are:
21
22 libsdl1.2-dev - Simple Direct Media crossplatform library for video,audio, events etc.
23 libcurl4 - openssl-dev - cURL net functions
24 zlib1g-dev - access .gz files
25 libzip-dev - access .zip files
26
27 All these libraries are available for free around the world.
28
29 For example for Debian/Ubuntu to install:
30
31 $sudo apt-get install libsdl1.2-dev libcurl4-openssl-dev zlib1g-dev libzip-dev
32
33
34 After being SDL, zlib, cURL and libzip installed you will be able to compile linapple from sources:
35
36 Untar the package (in .bz2 format):
37
38 $ tar xjf linapple-src_2a.tar.bz2
39
40
41 Then go to src directory and compile.
42
43 $ make
44
45 If there was no errors, you may install it if you wish:
46
47 $ cd bin
48 $ ./linapple
49
50 It will be install in /usr/local/linapple folder, whre you can find linapple.conf file for changing some linapple settings,
51 and empty `images` and `ftp` folders, where Apple 2 images files and downloaded through FTP images are meant to be in.
52
53 But of course you are free to choose any directories of your choice.
54 Note: you should read/write permissions of these folders, or linapple could not work properly.
55
56 For linaaple ability to unpack .zip and .gz files on the fly (either from local disks or from FTP) you also need read/write access for linapple working
57 folder (which by default is /usr/local/linapple), for linapple unpacks these files as drive0.dsk and drive1.dsk for drive 1 and 2 respectively.
58
59
60 OK.
61 If you installed it, you are able to run emulator from any place, just run it like this:
62
63 $ linapple
64
65
66 If you have chosen not to install it, go to the upper directory then and run the beast:
67
68 $ cd ..
69
70 $ ./linapple
71
72
73 If all files are on their places, you should see an X-Window with splash screen.
74 Press F2 (or F3 before to choose some disk image in drive 1), and go to work.
75
76 Note: linapple needs some files in its current working directory for proper working.
77
78 These files are:
79
80 splash.bmp - splash screen
81 charset40.bmp - charset for Apple][ (Apple 2e, etc.) text modes.
82 font.bmp - font for Help screen and Disk Select screens.
83 icon.bmp - nice icon, logo of Apple][ computer.
84 linapple.conf - configuration file.
85 Master.dsk - disk image with Applesoft(tm) DOS 3.3 inside. See Apple license (on apple.com) for details.
86
87 Essentials are font.bmp and charset40.bmp, others can be omitted peacefully.
88
89 P.S. You may play with some options in Makefile in src directory, if you know what you are to do. :)
90
91 Note: See README file for more detailed instructions on using linapple.
92
93
94 [UNINSTALL]
95
96 To uninstall previously installed linapple (by `sudo make install` command) you may write this:
97
98 $ sudo make uninstall
99
100 This will remove by default entire `/usr/local/linapple` folder and `/usr/local/bin/linapple` script.
101
102
103 Also there is possible command for cleaning compiled binaries in src directory:
104
105 $ make clean
106
107 Note: `linapple` executable in upper directory will remain intact.
108
109
110
111 [CONTACT]
112
113 I will be glad to see your comments, suggestions and so on on my email: beotiger@gmail.com
114
115 Sincerely Yours,
116 Krez beom beotiger, December 2007 AD - March 2012 AD
117
118 beotiger@mail.ru
119 beotiger@gmail.com
120
121 Let Apple 2 live forever!
122
0 #Compiler and Linker
1 CC := g++
2
3 #The Target Binary Program
4 TARGET := linapple
5
6 #The Directories, Source, Includes, Objects, Binary and Resources
7 SRCDIR := src
8 INCDIR := inc
9 BUILDDIR := obj
10 TARGETDIR := bin
11 RESDIR := res
12 SRCEXT := cpp
13 DEPEXT := d
14 OBJEXT := o
15
16 VERSION := 2.1
17 PKG := linapple
18
19 INSTDIR = /usr/local/bin/$(EXE)
20 CONFDIR = ~/$(TARGET)
21
22 #Flags, Libraries and Includes
23
24 SDL_CONFIG ?= sdl-config
25 SDL_CFLAGS = $(shell $(SDL_CONFIG) --cflags)
26 SDL_LIBS = $(shell $(SDL_CONFIG) --libs)
27
28 CURL_CONFIG ?= curl-config
29 CURL_CFLAGS = $(shell $(CURL_CONFIG) --cflags)
30 CURL_LIBS = $(shell $(CURL_CONFIG) --libs)
31
32 #PROFILING
33 #CFLAGS := -Wall -O0 -pg -ggdb -ansi -c
34 #LFLAGS := -pg
35 #DEBUGGING
36 #CFLAGS := -Wall -O0 -ggdb -ansi -c -finstrument-functions
37 #OPTIMIZED
38 CFLAGS := -Wall -O3 -ansi -c
39 CFLAGS += $(SDL_CFLAGS)
40 CFLAGS += $(CURL_CFLAGS)
41
42 LIB := $(SDL_LIBS) $(CURL_LIBS) -lz -lzip
43 INC := -I$(INCDIR) -I/usr/local/include
44 INCDEP := -I$(INCDIR)
45
46 #---------------------------------------------------------------------------------
47 #DO NOT EDIT BELOW THIS LINE
48 #---------------------------------------------------------------------------------
49 SOURCES := $(shell find $(SRCDIR) -type f -name *.$(SRCEXT))
50 OBJECTS := $(patsubst $(SRCDIR)/%,$(BUILDDIR)/%,$(SOURCES:.$(SRCEXT)=.$(OBJEXT)))
51
52 #Defauilt Make
53 all: resources $(TARGET)
54
55 #Remake
56 remake: cleaner all
57
58 #Copy Resources from Resources Directory to Target Directory
59 resources: directories
60 @cp $(RESDIR)/* $(TARGETDIR)/
61
62 #Make the Directories
63 directories:
64 @mkdir -p $(TARGETDIR)
65 @mkdir -p $(BUILDDIR)
66
67 package: all
68 @echo " Building a package"
69 mkdir -p "pkg/$(PKG)/$(PKG)-$(VERSION)/etc/$(PKG)"
70 mkdir -p "pkg/$(PKG)/$(PKG)-$(VERSION)/usr/bin/"
71 @cp -rf $(RESDIR)/* "pkg/$(PKG)/$(PKG)-$(VERSION)/etc/$(PKG)"
72 @cp $(TARGETDIR)/$(TARGET) "pkg/$(PKG)/$(PKG)-$(VERSION)/usr/bin/$(TARGET)"
73 chown -R root:root "pkg/$(PKG)"
74 dpkg --build "pkg/$(PKG)/$(PKG)-$(VERSION)"
75 mv "pkg/$(PKG)/$(PKG)-$(VERSION).deb" .
76
77 install: all
78 @echo " o Creating install directory '$(INSTDIR)'"
79 mkdir -p "$(INSTDIR)"
80 chmod 777 "$(INSTDIR)"
81 @echo " o Creating additional directories 'conf' and 'ftp' in '$(INSTDIR)'"
82 mkdir "$(CONFDIR)/conf"
83 mkdir -p "$(CONFDIR)/sound"
84
85 #Clean only Objecst
86 clean:
87 @$(RM) -rf $(BUILDDIR)
88 @$(RM) -rf $(TARGETDIR)
89
90 #Full Clean, Objects and Binaries
91 cleaner: clean
92 @$(RM) -rf $(TARGETDIR)
93 @$(RM) $(TARGET)-$(VERSION).deb
94
95 #Pull in dependency info for *existing* .o files
96 -include $(OBJECTS:.$(OBJEXT)=.$(DEPEXT))
97
98 #Link
99
100 $(TARGET): $(OBJECTS)
101 $(CC) $(LFLAGS) -o $(TARGETDIR)/$(TARGET) $^ $(LIB)
102
103 #Compile
104 $(BUILDDIR)/%.$(OBJEXT): $(SRCDIR)/%.$(SRCEXT)
105 @mkdir -p $(dir $@)
106 $(CC) $(CFLAGS) $(INC) -c -o $@ $<
107 @$(CC) $(CFLAGS) $(INCDEP) -MM $(SRCDIR)/$*.$(SRCEXT) > $(BUILDDIR)/$*.$(DEPEXT)
108 @cp -f $(BUILDDIR)/$*.$(DEPEXT) $(BUILDDIR)/$*.$(DEPEXT).tmp
109 @sed -e 's|.*:|$(BUILDDIR)/$*.$(OBJEXT):|' < $(BUILDDIR)/$*.$(DEPEXT).tmp > $(BUILDDIR)/$*.$(DEPEXT)
110 @sed -e 's/.*://' -e 's/\\$$//' < $(BUILDDIR)/$*.$(DEPEXT).tmp | fmt -1 | sed -e 's/^ *//' -e 's/$$/:/' >> $(BUILDDIR)/$*.$(DEPEXT)
111 @rm -f $(BUILDDIR)/$*.$(DEPEXT).tmp
112
113 #Non-File Targets
114 .PHONY: all remake clean cleaner resources
115
Master.dsk less more
Binary diff not shown
+0
-0
Printer.txt less more
(Empty file)
0 A modified build system was contributed by Greg Hedger along with other
1 changes and fixes:
02
3 [INSTALL]
4
5 make
6 sudo make package
7 sudo dpkg -i linapple-2.1.deb
8
9 [PREREQUISITES]
10
11 On Debianish systems at least, you ought to be able to do this:
12
13 sudo apt-get libsdl1.2-dev libsdl-mixer1.2-dev libzip4 libcurl3 libcurl4-gnutls-dev
14
15 Thanks Greg!
16
17 =====================================================================
118
219 The following changes were made by Cat's Eye Technologies' version of
320 linapple to make it more "properly unixy":
1936
2037 *** LINAPPLE 2b***
2138
39 Copyright (C) 1994-1996, Michael O'Brien
40 Copyright (C) 1999-2001, Oliver Schmidt
41 Copyright (C) 2002-2005, Tom Charlesworth
42 Copyright (C) 2006-2007, Tom Charlesworth, Michael Pohoreski
43 Copyright (C) 2015,2017, Greg Hedger
44
2245 [INTRO]
2346 What is linapple?
2447 It is an emulator of Apple2 (Apple][, Apple 2, Apple 2e etc.) computer series for Linux or other OSes with SDL support.
3457
3558 [INSTALL]
3659
60 make
61 cd bin
62 ./linapple
63
64
3765 I will show brief instructions for compiling and installing linapple here.
3866 Please, see INSTALL file for comprehensive installing tips.
3967 After SDL1.2, zlib, libcurl and libzip (development versions with -dev or -devel suffixes) are installed in your system, you can build sources.
4068
41 Unpack downloaded linapple archive and go to src directory:
42 $ cd src
43
44 Then run:
45 $ make
46
47 or
48 $ sudo make install
49
50 If there is no errors, run:
51 $ linapple
52
53 or without being installed:
54 $ cd ..
55 $ ./linapple
56
57 If all files are on their places, you should see an X-Window with splash screen.
69 If all files are on their places, you should see an X-Window with splash screen.
5870
5971 Press F2 (or F3 or Alt+F3) before to choose some disk image in drive 1), and go to work.
6072
61 It works as well as AppleWin, although it needs testing and supporting.
62 Where to install? Anywhere you feel fit, just let linapple be with some files it needs for comprehenceive working.
63
64 These files are:
6573 splash.bmp - splash screen
6674 charset40.bmp - charset for Apple][ (Apple 2e, etc.) text modes.
6775 font.bmp - font for Help screen and Disk Select screens.
charset40.bmp less more
Binary diff not shown
font.bmp less more
Binary diff not shown
icon.bmp less more
Binary diff not shown
Binary diff not shown
Binary diff not shown
0 // Motorola MC6821 PIA
1
2 typedef void (*mem_write_handler) (void* objFrom, void* objTo, int nAddr, BYTE byData);
3
4 typedef struct _STWriteHandler
5 {
6 void* objTo;
7 mem_write_handler func;
8 } STWriteHandler;
9
10 //
11
12 #define PIA_DDRA 0
13 #define PIA_CTLA 1
14 #define PIA_DDRB 2
15 #define PIA_CTLB 3
16
17 class C6821
18 {
19 public:
20 C6821();
21 virtual ~C6821();
22
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 );
34
35 void UpdateInterrupts();
36
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 );
41
42 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;
51
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;
60
61 STWriteHandler m_stOutA;
62 STWriteHandler m_stOutB;
63 STWriteHandler m_stOutCA2;
64 STWriteHandler m_stOutCB2;
65 STWriteHandler m_stOutIRQA;
66 STWriteHandler m_stOutIRQB;
67 };
0 #ifndef AY8910_H
1 #define AY8910_H
2
3 #define MAX_8910 4
4
5 void _AYWriteReg(int n, int r, int v);
6 void AY8910_write_ym(int chip, int addr, int data);
7 void AY8910_reset(int chip);
8 void AY8910Update(int chip,INT16 **buffer,int length);
9
10 void AY8910_InitAll(int nClock, int nSampleRate);
11 void AY8910_InitClock(int nClock);
12 BYTE* AY8910_GetRegsPtr(UINT nAyNum);
13
14 #endif
0 #pragma once
1
2 #ifdef _WIN32
3 #define FILE_SEPARATOR TEXT('\\')
4 #else
5 #define FILE_SEPARATOR TEXT('/')
6 #endif
7
8 #define FTP_SEPARATOR TEXT('/')
9
10 // let it be our second version!
11 #define LINAPPLE_VERSION 2
12
13 #include <curl/curl.h>
14
15 extern FILE * spMono,*spStereo;
16
17 extern char VERSIONSTRING[]; // Contructed in WinMain()
18
19 extern TCHAR *g_pAppTitle;
20
21 extern eApple2Type g_Apple2Type;
22
23 extern BOOL behind;
24 extern DWORD cumulativecycles;
25 extern DWORD cyclenum;
26 extern DWORD emulmsec;
27 extern bool g_bFullSpeed;
28
29 // Win32
30 //extern HINSTANCE g_hInstance;
31
32
33 extern AppMode_e g_nAppMode;
34
35 extern UINT g_ScreenWidth;
36 extern UINT g_ScreenHeight;
37
38 extern DWORD needsprecision;
39 //extern TCHAR g_sProgramDir[MAX_PATH];
40 extern TCHAR g_sCurrentDir[MAX_PATH];
41 extern TCHAR g_sHDDDir[MAX_PATH];
42 extern TCHAR g_sSaveStateDir[MAX_PATH];
43 extern TCHAR g_sParallelPrinterFile[MAX_PATH];
44 // FTP vars
45 extern TCHAR g_sFTPLocalDir[MAX_PATH]; // FTP Local Dir, see linapple.conf for details
46 extern TCHAR g_sFTPServer[MAX_PATH]; // full path to default FTP server
47 extern TCHAR g_sFTPServerHDD[MAX_PATH]; // full path to default FTP server
48
49 //extern TCHAR g_sFTPUser[256]; // user name
50 //extern TCHAR g_sFTPPass[256]; // password
51 extern TCHAR g_sFTPUserPass[512]; // full login line
52
53 extern CURL * g_curl;
54
55
56 extern bool g_bResetTiming;
57 extern BOOL restart;
58
59 extern DWORD g_dwSpeed;
60 extern double g_fCurrentCLK6502;
61
62 extern int g_nCpuCyclesFeedback;
63 extern DWORD g_dwCyclesThisFrame;
64
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)
67
68 extern UINT g_Slot4; // Mockingboard or Mouse in slot4
69
70 void SetCurrentCLK6502();
0 #pragma once
1
2 typedef struct _regsrec {
3 BYTE a; // accumulator
4 BYTE x; // index X
5 BYTE y; // index Y
6 BYTE ps; // processor status
7 WORD pc; // program counter
8 WORD sp; // stack pointer
9 BYTE bJammed; // CPU has crashed (NMOS 6502 only)
10 } regsrec, *regsptr;
11
12 extern regsrec regs;
13 extern unsigned __int64 g_nCumulativeCycles;
14
15 void CpuDestroy ();
16 void CpuCalcCycles(ULONG nExecutedCycles);
17 DWORD CpuExecute (DWORD);
18 ULONG CpuGetCyclesThisFrame(ULONG nExecutedCycles);
19 void CpuInitialize ();
20 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);
27 void CpuReset ();
28 DWORD CpuGetSnapshot(SS_CPU6502* pSS);
29 DWORD CpuSetSnapshot(SS_CPU6502* pSS);
0 #pragma once
1
2 #define USE_SPEECH_API
3
4 const double _M14 = (157500000.0 / 11.0); // 14.3181818... * 10^6
5 const double CLK_6502 = ((_M14 * 65.0) / 912.0); // 65 cycles per 912 14M clocks
6 //const double CLK_6502 = 23 * 44100; // 1014300
7
8 // The effective Z-80 clock rate is 2.041MHz
9 // See: http://www.apple2info.net/hardware/softcard/SC-SWHW_a2in.pdf
10 const double CLK_Z80 = (CLK_6502 * 2);
11
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
16
17 #define NUM_SLOTS 8
18
19 #define MAX(a,b) (((a) > (b)) ? (a) : (b))
20 #define MIN(a,b) (((a) < (b)) ? (a) : (b))
21
22 #define RAMWORKS // 8MB RamWorks III support
23
24 #define MOCKINGBOARD // Mockingboard support
25 //#define MB_SPEECH
26
27 // Use a base freq so that DirectX (or sound h/w) doesn't have to up/down-sample
28 // 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?
31
32 enum AppMode_e
33 {
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)
39 };
40
41 #define SPEED_MIN 0
42 #define SPEED_NORMAL 10
43 #define SPEED_MAX 40
44
45 #define DRAW_BACKGROUND 1
46 #define DRAW_LEDS 2
47 #define DRAW_TITLE 4
48 #define DRAW_BUTTON_DRIVES 8
49
50 // Function Keys F1..F12
51 #define BTN_HELP 0
52 #define BTN_RUN 1
53 #define BTN_DRIVE1 2
54 #define BTN_DRIVE2 3
55 #define BTN_DRIVESWAP 4
56 #define BTN_FULLSCR 5
57 #define BTN_DEBUG 6
58 #define BTN_SETUP 7
59 #define BTN_CYCLE 8
60 #define BTN_QUIT 11
61 #define BTN_SAVEST 10
62 #define BTN_LOADST 9
63
64 //#define MAXIMAGES 16
65
66 // 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")
71
72 #define TITLE_PAUSED TEXT(" Paused ")
73 #define TITLE_STEPPING TEXT("Stepping")
74
75 #define LOAD(a,b) RegLoadValue(TEXT("Configuration"),a,1,b)
76 #define SAVE(a,b) RegSaveValue(TEXT("Configuration"),a,1,b)
77
78 // Configuration
79 #define REGVALUE_APPLE2_TYPE "Apple2 Type"
80 #define REGVALUE_SPKR_VOLUME "Speaker Volume"
81 #define REGVALUE_MB_VOLUME "Mockingboard Volume"
82 #define REGVALUE_SOUNDCARD_TYPE "Soundcard Type"
83 #define REGVALUE_KEYB_BUFFER_ENABLE "Keyboard Buffer Enable"
84 #define REGVALUE_SAVESTATE_FILENAME "Save State Filename"
85 #define REGVALUE_SAVE_STATE_ON_EXIT "Save State On Exit"
86 #define REGVALUE_HDD_ENABLED "Harddisk Enable"
87 #define REGVALUE_HDD_IMAGE1 "Harddisk Image 1"
88 #define REGVALUE_HDD_IMAGE2 "Harddisk Image 2"
89 #define REGVALUE_DISK_IMAGE1 "Disk Image 1"
90 #define REGVALUE_DISK_IMAGE2 "Disk Image 2"
91
92 #define REGVALUE_PPRINTER_FILENAME "Parallel Printer Filename"
93
94 #define REGVALUE_PDL_XTRIM "PDL X-Trim"
95 #define REGVALUE_PDL_YTRIM "PDL Y-Trim"
96 #define REGVALUE_SCROLLLOCK_TOGGLE "ScrollLock Toggle"
97 #define REGVALUE_MOUSE_IN_SLOT4 "Mouse in slot 4"
98
99 // Preferences
100 #define REGVALUE_PREF_START_DIR TEXT("Slot 6 Directory")
101 #define REGVALUE_PREF_HDD_START_DIR TEXT("HDV Starting Directory")
102 #define REGVALUE_PREF_SAVESTATE_DIR TEXT("Save State Directory")
103
104 #define REGVALUE_SHOW_LEDS TEXT("Show Leds")
105
106 // For FTP access
107 #define REGVALUE_FTP_DIR TEXT("FTP Server")
108 #define REGVALUE_FTP_HDD_DIR TEXT("FTP ServerHDD")
109
110 #define REGVALUE_FTP_LOCAL_DIR TEXT("FTP Local Dir")
111 #define REGVALUE_FTP_USERPASS TEXT("FTP UserPass")
112 //#define REGVALUE_FTP_USER TEXT("FTP User")
113 //#define REGVALUE_FTP_PASS TEXT("FTP Pass")
114
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
119
120 enum eSOUNDCARDTYPE {SC_UNINIT=0, SC_NONE, SC_MOCKINGBOARD, SC_PHASOR}; // Apple soundcard type
121
122 typedef BYTE (*iofunction)(WORD nPC, WORD nAddr, BYTE nWriteFlag, BYTE nWriteValue, ULONG nCyclesLeft);
123
124 typedef struct _IMAGE__ { int unused; } *HIMAGE;
125
126 enum eIRQSRC {IS_6522=0, IS_SPEECH, IS_SSC, IS_MOUSE};
127
128 //
129
130 #define APPLE2E_MASK 0x10
131 #define APPLE2C_MASK 0x20
132
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)
136
137 // NB. These get persisted to the Registry, so don't change the values for these enums!
138 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 };
146
147 enum eBUTTON {BUTTON0=0, BUTTON1};
148 enum eBUTTONSTATE {BUTTON_UP=0, BUTTON_DOWN};
149
150 // sizes of status panel
151 #define STATUS_PANEL_W 100
152 #define STATUS_PANEL_H 48
0 #pragma once
1
2 #include <vector>
3 #include <algorithm> // sort
4 #include <map>
5 #include <string>
6 using namespace std;
7
8 #include "Debugger_Types.h"
9 // #include "Debugger_Parser.h"
10 // #include "Debugger_Console.h"
11 // #include "Debugger_Assembler.h"
12 // #include "Debugger_Help.h"
13 // #include "Debugger_Display.h"
14 // #include "Util_MemoryTextFile.h"
15
16 // Globals __________________________________________________________________
17
18 // Benchmarking
19 extern DWORD extbench;
20
21 // Bookmarks
22 extern int g_nBookmarks;
23 extern Bookmark_t g_aBookmarks[ MAX_BOOKMARKS ];
24 // extern vector<int> g_aBookmarks;
25
26 // Breakpoints
27 extern int g_nBreakpoints;
28 extern Breakpoint_t g_aBreakpoints[ MAX_BREAKPOINTS ];
29
30 extern const char *g_aBreakpointSource [ NUM_BREAKPOINT_SOURCES ];
31 extern const TCHAR *g_aBreakpointSymbols[ NUM_BREAKPOINT_OPERATORS ];
32
33 // Full-Speed debugging
34 extern int g_nDebugOnBreakInvalid;
35 extern int g_iDebugOnOpcode ;
36 extern bool g_bDebugDelayBreakCheck;
37
38 // 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
41
42 extern Command_t g_aCommands[];
43 extern Command_t g_aParameters[];
44
45 // Config - FileName
46 extern char g_sFileNameConfig[];
47
48 // Cursor
49 extern WORD g_nDisasmTopAddress ;
50 extern WORD g_nDisasmBotAddress ;
51 extern WORD g_nDisasmCurAddress ;
52
53 extern bool g_bDisasmCurBad ;
54 extern int g_nDisasmCurLine ; // Aligned to Top or Center
55 extern int g_iDisasmCurState ;
56
57 extern int g_nDisasmWinHeight;
58
59 extern const int WINDOW_DATA_BYTES_PER_LINE;
60
61 // 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;
68 // Config - Info
69 extern bool g_bConfigInfoTargetPointer ;
70
71 // Disassembly
72 // extern int g_aDisasmTargets[ MAX_DISPLAY_LINES ];
73
74 // Display
75 extern bool g_bDebuggerViewingAppleOutput;
76
77 // Font
78 extern int g_nFontHeight;
79 extern int g_iFontSpacing;
80
81 // Memory
82 extern MemoryDump_t g_aMemDump[ NUM_MEM_DUMPS ];
83
84 // extern MemorySearchArray_t g_vMemSearchMatches;
85 extern vector<int> g_vMemorySearchResults;
86
87 // Source Level Debugging
88 extern TCHAR g_aSourceFileName[ MAX_PATH ];
89 // extern MemoryTextFile_t g_AssemblerSourceBuffer;
90
91 extern int g_iSourceDisplayStart ;
92 extern int g_nSourceAssembleBytes ;
93 extern int g_nSourceAssemblySymbols;
94
95 // Version
96 extern const int DEBUGGER_VERSION;
97
98 // Watches
99 extern int g_nWatches;
100 extern Watches_t g_aWatches[ MAX_WATCHES ];
101
102 // Window
103 extern int g_iWindowLast;
104 extern int g_iWindowThis;
105 extern WindowSplit_t g_aWindowConfig[ NUM_WINDOWS ];
106
107 // Zero Page
108 extern int g_nZeroPagePointers;
109 extern ZeroPagePointers_t g_aZeroPagePointers[ MAX_ZEROPAGE_POINTERS ]; // TODO: use vector<> ?
110
111 // Prototypes _______________________________________________________________
112
113 // Bookmarks
114 bool Bookmark_Find( const WORD nAddress );
115
116 // Breakpoints
117 bool GetBreakpointInfo ( WORD nOffset, bool & bBreakpointActive_, bool & bBreakpointEnable_ );
118
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 }
125
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 }
134
135 // Color
136 inline COLORREF DebuggerGetColor( int iColor );
137
138 // Source Level Debugging
139 int FindSourceLine( WORD nAddress );
140 LPCTSTR FormatAddress( WORD nAddress, int nBytes );
141
142 // 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 );
146
147 LPCTSTR FindSymbolFromAddress (WORD nAdress, int * iTable_ = NULL );
148 LPCTSTR GetSymbol (WORD nAddress, int nBytes);
149
150 Update_t DebuggerProcessCommand( const bool bEchoConsoleInput );
151
152 // Prototypes _______________________________________________________________
153
154 enum
155 {
156 DEBUG_EXIT_KEY = 0x1B, // Escape
157 DEBUG_TOGGLE_KEY = SDLK_F1 + BTN_DEBUG
158 };
159
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 );
170
171 void DebuggerUpdate();
172 void DebuggerCursorNext();
173
174 void DebuggerMouseClick( int x, int y );
0 #pragma once
1
2
3 // Addressing _____________________________________________________________________________________
4
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 /*
31 +---------------------+--------------------------+
32 | Opmode e | assembler format |
33 +=====================+==========================+
34 | Immediate | #aa |
35 | Absolute | aaaa |
36 | Zero Page | aa | Note:
37 | Implied | |
38 | Indirect Absolute | (aaaa) | aa = 2 hex digits
39 | Absolute Indexed,X | aaaa,X | as $FF
40 | Absolute Indexed,Y | aaaa,Y |
41 | Zero Page Indexed,X | aa,X | aaaa = 4 hex
42 | Zero Page Indexed,Y | aa,Y | digits as
43 | Indexed Indirect | (aa,X) | $FFFF
44 | Indirect Indexed | (aa),Y |
45 | Relative | aaaa | Can also be
46 | Accumulator | A | assembler labels
47 +---------------------+--------------------------+
48 (Table 2-3. _6502 Software Design_, Scanlon, 1980)
49
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 };
131
132
133 // Assembler ______________________________________________________________________________________
134
135 enum Prompt_e
136 {
137 PROMPT_COMMAND,
138 PROMPT_ASSEMBLER,
139 NUM_PROMPTS
140 };
141
142
143 // Bookmarks ______________________________________________________________________________________
144
145 enum
146 {
147 MAX_BOOKMARKS = 10
148 };
149
150 // Breakpoints ____________________________________________________________________________________
151
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;
228
229
230 // Colors ___________________________________________________________________
231
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 };
354
355 // Config _________________________________________________________________________________________
356
357 enum ConfigSave_t
358 {
359 CONFIG_SAVE_FILE_CREATE,
360 CONFIG_SAVE_FILE_APPEND
361 };
362
363 // Commands _______________________________________________________________________________________
364
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 {
412 // 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
424 // CPU - Meta Info
425 , CMD_PROFILE
426 , CMD_REGISTER_SET
427 // 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
435 // CPU - Meta Info
436 , CMD_TRACE
437 , CMD_TRACE_FILE
438 , CMD_TRACE_LINE
439 , CMD_UNASSEMBLE
440 // 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
448 // 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
466 // Benchmark / Timing
467 // , CMD_BENCHMARK_START
468 // , CMD_BENCHMARK_STOP
469 // , CMD_PROFILE_START
470 // , CMD_PROFILE_STOP
471 // 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
488 // 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
503 // Disk
504 , CMD_DISK
505 // 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
525 // Help
526 , CMD_HELP_LIST
527 , CMD_HELP_SPECIFIC
528 , CMD_VERSION
529 , CMD_MOTD // Message of the Day
530 // 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
561 // Output
562 , CMD_OUTPUT_CALC
563 , CMD_OUTPUT_ECHO
564 , CMD_OUTPUT_PRINT
565 , CMD_OUTPUT_PRINTF
566 , CMD_OUTPUT_RUN
567 // Source Level Debugging
568 , CMD_SOURCE
569 , CMD_SYNC
570 // 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
583 // 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
592 // 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
622 // 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 };
642
643
644 // 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
662 // 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);
670 // 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);
684 // 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);
691 // 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);
704 // 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);
716 // Disk
717 Update_t CmdDisk (int nArgs);
718 // 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);
723 // Flags
724 Update_t CmdFlag (int nArgs);
725 Update_t CmdFlagClear (int nArgs);
726 Update_t CmdFlagSet (int nArgs);
727 // 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);
748 // 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);
754 // Registers
755 Update_t CmdRegisterSet (int nArgs);
756 // Source Level Debugging
757 Update_t CmdSource (int nArgs);
758 Update_t CmdSync (int nArgs);
759 // 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);
764 // 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);
774 // 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);
783 // 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);
813
814 // 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);
824
825
826 // 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 };
839
840
841 // Disassembly ____________________________________________________________________________________
842
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 };
947
948 // 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 };
983
984
985 // Instructions / Opcodes _________________________________________________________________________
986
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 };
1082
1083 // Memory _________________________________________________________________________________________
1084
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;
1160
1161 // Parameters _____________________________________________________________________________________
1162
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
1279 // 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
1285 // 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
1297
1298 // 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
1308
1309 // 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
1399
1400 // Aliases (actuall names)
1401 // ,PARAM_DISASM = PARAM_CODE_1
1402 // , PARAM_BREAKPOINT_READ = PARAM_READ
1403 // , PARAM_BREAKPOINT_WRITE = PARAM_WRITE
1404 };
1405
1406
1407 // Source Level Debugging _________________________________________________________________________
1408
1409 enum
1410 {
1411 NO_SOURCE_LINE = -1
1412 };
1413
1414 typedef map<WORD, int> SourceAssembly_t; // Address -> Line # & FileName
1415
1416
1417 // Symbols ________________________________________________________________________________________
1418
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;
1448
1449
1450 // Watches ________________________________________________________________________________________
1451
1452 enum
1453 {
1454 MAX_WATCHES = 16
1455 };
1456
1457
1458 // Window _________________________________________________________________________________________
1459
1460 enum Window_e
1461 {
1462 WINDOW_CODE ,
1463 WINDOW_DATA ,
1464 WINDOW_CONSOLE ,
1465 NUM_WINDOWS ,
1466 // 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 };
1481
1482
1483 // Zero Page ______________________________________________________________________________________
1484
1485 enum
1486 {
1487 MAX_ZEROPAGE_POINTERS = 8
1488 };
1489
0 #pragma once
1
2 #define DRIVE_1 0
3 #define DRIVE_2 1
4
5 #define DRIVES 2
6 #define TRACKS 35
7
8 extern BOOL enhancedisk;
9
10 void DiskInitialize (); // DiskManagerStartup()
11 void DiskDestroy (); // no, doesn't "destroy" the disk image. DiskManagerShutdown()
12
13 void DiskBoot ();
14 void DiskEject( const int iDrive );
15 LPCTSTR DiskGetFullName (int);
16
17
18 enum Disk_Status_e
19 {
20 DISK_STATUS_OFF ,
21 DISK_STATUS_READ ,
22 DISK_STATUS_WRITE,
23 DISK_STATUS_PROT ,
24 NUM_DISK_STATUS
25 };
26 void DiskGetLightStatus (int *pDisk1Status_,int *pDisk2Status_);
27
28 LPCTSTR DiskGetName (int);
29 int DiskInsert (int,LPCTSTR,BOOL,BOOL);
30 BOOL DiskIsSpinning ();
31 void DiskNotifyInvalidImage (LPCTSTR,int);
32 void DiskReset ();
33 bool DiskGetProtect( const int iDrive );
34 void DiskSetProtect( const int iDrive, const bool bWriteProtect );
35 void DiskSelect (int);
36 void Disk_FTP_SelectImage (int);
37 void DiskUpdatePosition (DWORD);
38 bool DiskDriveSwap();
39 void DiskLoadRom(LPBYTE pCxRomPeripheral, UINT uSlot);
40 DWORD DiskGetSnapshot(SS_CARD_DISK2* pSS, DWORD dwSlot);
41 DWORD DiskSetSnapshot(SS_CARD_DISK2* pSS, DWORD dwSlot);
0 #pragma once
1
2 bool ChooseAnImage(int sx,int sy, char *incoming_dir, int slot, char **filename, bool *isdir, int *index_file);
3
0 #pragma once
1
2 extern TCHAR g_sFTPDirListing[512]; // name for FTP-directory listing
3 /* Choose an image using FTP */
4 bool ChooseAnImageFTP(int sx,int sy, char *ftp_dir, int slot, char **filename, bool *isdir, int *index_file);
5
0 #pragma once
1
2 #define TRACKS 35
3 #define IMAGETYPES 7
4 #define NIBBLES 6656
5
6 BOOL ImageBoot (HIMAGE);
7 void ImageClose (HIMAGE);
8 void ImageDestroy ();
9 void ImageInitialize ();
10
11 enum ImageError_e
12 {
13 IMAGE_ERROR_BAD_POINTER =-1,
14 IMAGE_ERROR_NONE = 0,
15 IMAGE_ERROR_UNABLE_TO_OPEN = 1,
16 IMAGE_ERROR_BAD_SIZE = 2
17 };
18
19 //int ImageOpen (LPCTSTR,HIMAGE *,BOOL *,BOOL);
20 int ImageOpen (LPCTSTR imagefilename, HIMAGE *hDiskImage_, BOOL *pWriteProtected_, BOOL bCreateIfNecessary );
21
22 void ImageReadTrack (HIMAGE,int,int,LPBYTE,int *);
23 void ImageWriteTrack (HIMAGE,int,int,LPBYTE,int);
0 #pragma once
1
2 enum {NOT_ASCII=0, ASCII};
3
4 // 3D Border (do not iuse for now? --bb)
5 #define VIEWPORTX 5
6 #define VIEWPORTY 5
7
8
9 // if you gonna change these values, consider changing some values in Video.cpp --bb
10 #define SCREEN_WIDTH 560
11 #define SCREEN_HEIGHT 384
12 #define SCREEN_BPP 8
13 extern SDL_Surface * screen;
14
15 #define SHOW_CYCLES 15
16
17 // Win32
18 //extern HWND g_hFrameWindow;
19 //extern HDC g_hFrameDC;
20
21 extern BOOL fullscreen;
22 extern BOOL g_WindowResized;
23
24 extern SDL_Rect origRect;
25 extern SDL_Rect newRect;
26
27 int InitSDL();
28 int FrameCreateWindow ();
29 //HDC FrameGetDC ();
30 //HDC FrameGetVideoDC (LPBYTE *,LONG *);
31 void FrameRefreshStatus (int);
32 void FrameRegisterClass ();
33 void FrameReleaseDC ();
34 void FrameReleaseVideoDC ();
35
36 void DrawFrameWindow (); // draw it!
37 void FrameDispatchMessage(SDL_Event * e); // replacement for FrameWndProc.
38 /*LRESULT CALLBACK FrameWndProc (
39 HWND window,
40 UINT message,
41 WPARAM wparam,
42 LPARAM lparam );*/
43
44 void SetUsingCursor (BOOL);
45
46 void SetFullScreenMode ();
47 void SetNormalMode ();
48
49
50 extern bool g_bScrollLock_FullSpeed;
51
0 #pragma once
1
2 extern bool g_bHD_Enabled;
3
4 bool HD_CardIsEnabled();
5 void HD_SetEnabled(bool bEnabled);
6 LPCTSTR HD_GetFullName (int drive);
7 VOID HD_Load_Rom(LPBYTE pCxRomPeripheral, UINT uSlot);
8 VOID HD_Cleanup();
9 BOOL HD_InsertDisk2(int nDrive, LPCTSTR pszFilename);
10 BOOL HD_InsertDisk(int nDrive, LPCTSTR imagefilename);
11
12 void HD_Select(int nDrive);
13 void HD_FTP_Select(int nDrive);
14
15 int HD_GetStatus(void);
16 void HD_ResetStatus(void);
0 #pragma once
1
2 enum JOYNUM {JN_JOYSTICK0=0, JN_JOYSTICK1};
3
4 extern DWORD joytype[2];
5
6 void JoyInitialize ();
7 void JoyShutDown();
8
9 BOOL JoyProcessKey (int,BOOL,BOOL,BOOL);
10 void JoyReset ();
11 void JoySetButton (eBUTTON,eBUTTONSTATE);
12 BOOL JoySetEmulationType (/*HWND,*/DWORD,int);
13 void JoySetPosition (int,int,int,int);
14 void JoyUpdatePosition ();
15 BOOL JoyUsingMouse ();
16 void JoySetTrim(short nValue, bool bAxisX);
17 short JoyGetTrim(bool bAxisX);
18 DWORD JoyGetSnapshot(SS_IO_Joystick* pSS);
19 DWORD JoySetSnapshot(SS_IO_Joystick* pSS);
20
21 BYTE JoyReadButton (WORD pc, WORD addr, BYTE bWrite, BYTE d, ULONG nCyclesLeft);
22 BYTE JoyReadPosition (WORD pc, WORD addr, BYTE bWrite, BYTE d, ULONG nCyclesLeft);
23 BYTE JoyResetPosition (WORD pc, WORD addr, BYTE bWrite, BYTE d, ULONG nCyclesLeft);
0 #pragma once
1
2 extern bool g_bShiftKey;
3 extern bool g_bCtrlKey;
4 extern bool g_bAltKey;
5 //extern bool g_bCapsLock;
6
7 void ClipboardInitiatePaste();
8
9 void KeybReset();
10 bool KeybGetAltStatus();
11 bool KeybGetCapsStatus();
12 bool KeybGetCtrlStatus();
13 bool KeybGetShiftStatus();
14 void KeybUpdateCtrlShiftStatus();
15 BYTE KeybGetKeycode ();
16 DWORD KeybGetNumQueries ();
17 void KeybQueueKeypress (int,BOOL);
18 void KeybToggleCapsLock ();
19 DWORD KeybGetSnapshot(SS_IO_Keyboard* pSS);
20 DWORD KeybSetSnapshot(SS_IO_Keyboard* pSS);
21
22 BYTE KeybReadData (WORD pc, WORD addr, BYTE bWrite, BYTE d, ULONG nCyclesLeft);
23 BYTE KeybReadFlag (WORD pc, WORD addr, BYTE bWrite, BYTE d, ULONG nCyclesLeft);
0 #pragma once
1
2 #ifndef _VC71 // __VA_ARGS__ not supported on MSVC++ .NET 7.x
3 #ifdef _DEBUG
4 #define LOG(format, ...) LogOutput(format, __VA_ARGS__)
5 #else
6 #define LOG(...)
7 #endif
8 #endif
9
10 extern void LogOutput(LPCTSTR format, ...);
0 #pragma once
1
2 enum MemoryInitPattern_e
3 {
4 MIP_ZERO
5 , MIP_FF_FF_00_00
6
7 , NUM_MIP
8 };
9 extern MemoryInitPattern_e g_eMemoryInitPattern;
10
11 extern iofunction IORead[256];
12 extern iofunction IOWrite[256];
13 extern LPBYTE memwrite[0x100];
14 extern LPBYTE mem;
15 extern LPBYTE memdirty;
16
17 #ifdef RAMWORKS
18 extern UINT g_uMaxExPages; // user requested ram pages (from cmd line)
19 #endif
20
21 void RegisterIoHandler(UINT uSlot, iofunction IOReadC0, iofunction IOWriteC0, iofunction IOReadCx, iofunction IOWriteCx, LPVOID lpSlotParameter, BYTE* pExpansionRom);
22
23 void MemDestroy ();
24 bool MemGet80Store();
25 bool MemCheckSLOTCXROM();
26 LPBYTE MemGetAuxPtr (WORD);
27 LPBYTE MemGetMainPtr (WORD);
28 LPBYTE MemGetCxRomPeripheral();
29 void MemPreInitialize ();
30 int MemInitialize ();
31 BYTE MemReadFloatingBus(const ULONG uExecutedCycles);
32 BYTE MemReadFloatingBus(const BYTE highbit, const ULONG uExecutedCycles);
33 void MemReset ();
34 void MemResetPaging ();
35 BYTE MemReturnRandomData (BYTE highbit);
36 void MemSetFastPaging (BOOL);
37 void MemTrimImages ();
38 LPVOID MemGetSlotParameters (UINT uSlot);
39 DWORD MemGetSnapshot(SS_BaseMemory* pSS);
40 DWORD MemSetSnapshot(SS_BaseMemory* pSS);
41
42 BYTE IO_Null(WORD programcounter, WORD address, BYTE write, BYTE value, ULONG nCycles);
43
44 BYTE MemCheckPaging (WORD pc, WORD addr, BYTE bWrite, BYTE d, ULONG nCyclesLeft);
45 BYTE MemSetPaging(WORD pc, WORD addr, BYTE bWrite, BYTE d, ULONG nCyclesLeft);
0 #pragma once
1
2 extern bool g_bMBTimerIrqActive;
3 extern UINT32 g_uTimer1IrqCount; // DEBUG
4
5 void MB_Initialize();
6 void MB_Reinitialize();
7 void MB_Destroy();
8 void MB_Reset();
9 void MB_Mute();
10 void MB_Demute();
11 void MB_StartOfCpuExecute();
12 void MB_EndOfVideoFrame();
13 void MB_CheckIRQ();
14 void MB_UpdateCycles(ULONG uExecutedCycles);
15 void MB_Update();
16 eSOUNDCARDTYPE MB_GetSoundcardType();
17 void MB_SetSoundcardType(eSOUNDCARDTYPE NewSoundcardType);
18 double MB_GetFramePeriod();
19 bool MB_IsActive();
20 DWORD MB_GetVolume();
21 void MB_SetVolume(DWORD dwVolume, DWORD dwVolumeMax);
22 DWORD MB_GetSnapshot(SS_CARD_MOCKINGBOARD* pSS, DWORD dwSlot);
23 DWORD MB_SetSnapshot(SS_CARD_MOCKINGBOARD* pSS, DWORD dwSlot);
24
25 extern short * pDSMockBuf; // Mockingboard data buffer (in size of g_dwDSMockBufferSize samples?)
26 extern UINT nDSMockWCur; // write cursor
27 extern UINT nDSMockRCur; // read cursor
28 //extern DWORD g_dwDSMockBufferSize; // size of low-level buffer
29
0 #include "6821.h"
1 #include "Common.h"
2
3 #define WRITE_HANDLER(func) void func( void* objFrom, void* objTo, int nAddr, BYTE byData )
4 #define CALLBACK_HANDLER(func) void func( void* objFrom, void* objTo, LPARAM lParam )
5
6 extern class CMouseInterface sg_Mouse;
7
8 class CMouseInterface
9 {
10 public:
11 CMouseInterface();
12 virtual ~CMouseInterface();
13
14 void Initialize(LPBYTE pCxRomPeripheral, UINT uSlot);
15 void Uninitialize(){ m_bActive = false; }
16 void SetSlotRom();
17 static BYTE IORead(WORD PC, WORD uAddr, BYTE bWrite, BYTE uValue, ULONG nCyclesLeft);
18 static BYTE IOWrite(WORD PC, WORD uAddr, BYTE bWrite, BYTE uValue, ULONG nCyclesLeft);
19
20 void SetPosition(int xvalue, int xrange, int yvalue, int yrange);
21 void SetButton(eBUTTON Button, eBUTTONSTATE State);
22 bool Active() { return m_bActive; }
23 void SetVBlank(bool bVBL);
24
25 protected:
26 void On6821_A(BYTE byData);
27 void On6821_B(BYTE byData);
28 void OnCommand();
29 void OnWrite();
30 void OnMouseEvent();
31 void Reset();
32
33 friend WRITE_HANDLER( M6821_Listener_A );
34 friend WRITE_HANDLER( M6821_Listener_B );
35 //friend CALLBACK_HANDLER( MouseHandler );
36
37 void SetPosition(int xvalue, int yvalue);
38 void ClampX(int iMinX, int iMaxX);
39 void ClampY(int iMinY, int iMaxY);
40
41
42 C6821 m_6821;
43
44 int m_nDataLen;
45 BYTE m_byMode;
46
47 BYTE m_by6821B;
48 BYTE m_by6821A;
49 BYTE m_byBuff[8]; // m_byBuff[0] is mode byte
50 int m_nBuffPos;
51
52 BYTE m_byState;
53 int m_nX;
54 int m_nY;
55 BOOL m_bBtn0;
56 BOOL m_bBtn1;
57
58 bool m_bVBL;
59
60 //
61
62 UINT m_iX;
63 UINT m_iRangeX;
64 UINT m_iMinX;
65 UINT m_iMaxX;
66 UINT m_iY;
67 UINT m_iRangeY;
68 UINT m_iMinY;
69 UINT m_iMaxY;
70
71 BOOL m_bButtons[2];
72
73 //
74
75 bool m_bActive;
76 LPBYTE m_pSlotRom;
77 UINT m_uSlot;
78 };
0 #pragma once
1
2 void PrintDestroy();
3 void PrintLoadRom(LPBYTE pCxRomPeripheral, UINT uSlot);
4 void PrintReset();
5 void PrintUpdate(DWORD);
0 #pragma once
1
2 // configuration file
3 #define REGISTRY "linapple.conf"
4 extern FILE * registry; // our opened file
5
6 BOOL RegLoadString (LPCTSTR,LPCTSTR,BOOL,char**,DWORD);
7 BOOL RegLoadValue (LPCTSTR,LPCTSTR,BOOL,DWORD *);
8 BOOL RegLoadBool(LPCTSTR,LPCTSTR,BOOL,BOOL *);
9
10 void RegSaveString (LPCTSTR,LPCTSTR,BOOL,LPCTSTR);
11 void RegSaveValue (LPCTSTR,LPCTSTR,BOOL,DWORD);
12 void RegSaveBool (LPCTSTR,LPCTSTR,BOOL,BOOL);
13
14 char *php_trim(char *c, int len); // trimming string like PHP function trim does!
15
0 #pragma once
1
2 int RiffInitWriteFile(char* pszFile, unsigned int sample_rate, unsigned int NumChannels);
3 int RiffFinishWriteFile();
4 int RiffPutSamples(short* buf, unsigned int uSamples);
0 typedef struct
1 {
2 unsigned int nOffset;
3 unsigned int nLength;
4 } PHONEME_INFO, *PPHONEME_INFO;
5
6 static const PHONEME_INFO g_nPhonemeInfo[62] =
7 {
8 {0x00000000,0x00000A60},{0x00000A60,0x00000A4C},
9 {0x000014AC,0x00000A22},{0x00001ECE,0x00000A93},
10 {0x00002961,0x00000ABA},{0x0000341B,0x00000A46},
11 {0x00003E61,0x00000A54},{0x000048B5,0x00000C83},
12 {0x00005538,0x00000A4F},{0x00005F87,0x00000A95},
13 {0x00006A1C,0x00000A21},{0x0000743D,0x00000A11},
14 {0x00007E4E,0x000009F4},{0x00008842,0x00000A91},
15 {0x000092D3,0x00000A3C},{0x00009D0F,0x00000A5F},
16 {0x0000A76E,0x00000AAB},{0x0000B219,0x00000A4F},
17 {0x0000BC68,0x00000AAF},{0x0000C717,0x00000A74},
18 {0x0000D18B,0x00000A2E},{0x0000DBB9,0x00000A49},
19 {0x0000E602,0x00000A72},{0x0000F074,0x00000A5D},
20 {0x0000FAD1,0x000009FB},{0x000104CC,0x00000A12},
21 {0x00010EDE,0x00000A4B},{0x00011929,0x00000A5A},
22 {0x00012383,0x00000A67},{0x00012DEA,0x00000A23},
23 {0x0001380D,0x000009D0},{0x000141DD,0x00000A61},
24 {0x00014C3E,0x00000A3A},{0x00015678,0x00000A31},
25 {0x000160A9,0x000003F4},{0x0001649D,0x00000383},
26 {0x00016820,0x00000A83},{0x000172A3,0x00000380},
27 {0x00017623,0x00000370},{0x00017993,0x00000389},
28 {0x00017D1C,0x00000A0F},{0x0001872B,0x00000C7F},
29 {0x000193AA,0x00000A37},{0x00019DE1,0x00000D2D},
30 {0x0001AB0E,0x000009EB},{0x0001B4F9,0x00000A3A},
31 {0x0001BF33,0x00000A2B},{0x0001C95E,0x00000A58},
32 {0x0001D3B6,0x00000A52},{0x0001DE08,0x00000A28},
33 {0x0001E830,0x00000A60},{0x0001F290,0x00000A0E},
34 {0x0001FC9E,0x00000AA0},{0x0002073E,0x00000A65},
35 {0x000211A3,0x00000A4E},{0x00021BF1,0x00000AAB},
36 {0x0002269C,0x00000A53},{0x000230EF,0x00000A22},
37 {0x00023B11,0x00000A18},{0x00024529,0x00000A53},
38 {0x00024F7C,0x00000A04},{0x00025980,0x00000A16},
39 };
40
41 static const unsigned short g_nPhonemeData[156566] =
42 {
43 0xFE64,0xFE8A,0xFD76,0xFCAF,0xFCBA,0xFCF5,0xFD5F,0xFD8C,
44 0xFDE2,0xFDBF,0xFDCE,0xFD1A,0xFCB4,0xFCCD,0xFD67,0xFDC8,
45 0xFE24,0xFE37,0xFE1E,0xFDC7,0xFD49,0xFD59,0xFD92,0xFDFB,
46 0xFE30,0xFE41,0xFDC7,0xFD87,0xFD75,0xFD6F,0xFD43,0xFDDC,
47 0xFE1E,0xFE39,0xFDE3,0xFD96,0xFD85,0xFD61,0xFD85,0xFE01,
48 0xFE42,0xFE31,0xFE52,0xFE18,0xFD8A,0xFD71,0xFDF0,0xFE49,
49 0xFE8A,0xFE7C,0xFE0B,0xFD9E,0xFD76,0xFDB0,0xFE3E,0xFE2F,
50 0xFE39,0xFE7D,0xFEA1,0xFE31,0xFE2B,0xFED8,0xFFF0,0x0065,
51 0x02D7,0x01F1,0x005B,0x014E,0x0202,0x0319,0x0443,0x054D,
52 0x05EE,0x0751,0x08A7,0x091B,0x07EC,0x0701,0x0681,0x069A,
53 0x06C5,0x06D5,0x0679,0x057E,0x04F2,0x049E,0x04A6,0x0515,
54 0x0638,0x0666,0x05AA,0x0506,0x0554,0x063F,0x065A,0x0673,
55 0x06F3,0x07E8,0x0910,0x09AE,0x09E3,0x0A35,0x0A6B,0x0B1B,
56 0x0C4C,0x0D7D,0x0E89,0x0ED6,0x0E66,0x0E60,0x0F12,0x1027,
57 0x10B1,0x10A8,0x106F,0x11DF,0x1356,0x1472,0x148F,0x1400,
58 0x13A0,0x1341,0x13E7,0x15AF,0x1756,0x1799,0x16E7,0x154A,
59 0x1324,0x12E0,0x13AC,0x1438,0x153C,0x1623,0x15D4,0x14E2,
60 0x13E9,0x13B5,0x1427,0x14C9,0x1593,0x15AE,0x14C0,0x1451,
61 0x1342,0x131F,0x1445,0x149C,0x14EF,0x1573,0x146E,0x1294,
62 0x1163,0x118B,0x12CF,0x13C7,0x13FD,0x1347,0x128B,0x119F,
63 0x10AA,0x0FB1,0x0F20,0x0FC2,0x114E,0x1256,0x11D0,0x0F89,
64 0x0D8B,0x0C34,0x0C62,0x0F0C,0x0F87,0x0ECF,0x0E17,0x0C94,
65 0x0AE3,0x0A5F,0x0A70,0x0AA7,0x0AE1,0x0ADE,0x0AEC,0x0B6F,
66 0x0B3C,0x0A08,0x092E,0x0852,0x0802,0x0855,0x08F4,0x0914,
67 0x084F,0x06EA,0x0527,0x041A,0x0432,0x0459,0x048D,0x03DC,
68 0x0317,0x0340,0x032F,0x02AE,0x0044,0xFCAC,0xF6E4,0xF020,
69 0xE768,0xDD48,0xD48B,0xD1C0,0xD8D8,0xE8ED,0xF9F8,0x0177,
70 0xF8AB,0xE3B0,0xCF3D,0xC837,0xD3CE,0xEDA5,0x0916,0x19A9,
71 0x1A87,0x0E3F,0xFD82,0xF0F1,0xEF06,0xFAD0,0x0ED8,0x2332,
72 0x2F87,0x2F6E,0x22F6,0x11CF,0x04C3,0x016F,0x0883,0x1464,
73 0x1BFA,0x1C21,0x158C,0x0C12,0x0298,0xFA88,0xF5CA,0xF399,
74 0xF11C,0xEF77,0xF069,0xEE90,0xED50,0xEB1F,0xE74D,0xE27E,
75 0xDDA9,0xD9BB,0xD73E,0xD88A,0xDE49,0xE684,0xEDBE,0xEFEB,
76 0xEC01,0xE465,0xDDE7,0xDE22,0xE62F,0xF282,0xFE8E,0x04D4,
77 0x04AB,0xFF6E,0xF95A,0xF5BE,0xF695,0xFB0D,0x02C4,0x0A76,
78 0x0EC6,0x0DDD,0x06B3,0xFD54,0xF6A4,0xF51C,0xF782,0xFB4E,
79 0xFDC8,0xFC78,0xF778,0xF161,0xECC8,0xEA32,0xE770,0xE52D,
80 0xE30F,0xE28A,0xE392,0xE4B3,0xE4F6,0xE309,0xE029,0xDDA5,
81 0xDCF1,0xDE50,0xE124,0xE412,0xE6C0,0xE986,0xEE1C,0xF064,
82 0xF000,0xEF0E,0xEE0E,0xEEF9,0xF24F,0xF7FA,0xFD84,0x0074,
83 0xFFB9,0xFCD2,0xFA42,0xF9C9,0xFA80,0xFBF5,0xFD65,0xFEE1,
84 0xFFB1,0xFE97,0xFBD6,0xF866,0xF42A,0xF136,0xF0ED,0xF249,
85 0xF33C,0xF233,0xEEDA,0xEB64,0xE924,0xE850,0xE7E4,0xE775,
86 0xE6C6,0xE727,0xE771,0xE7B1,0xE8AF,0xE9CA,0xEA62,0xE978,
87 0xE842,0xE92D,0xEB9F,0xED78,0xEFC9,0xF329,0xF56E,0xF621,
88 0xF4E7,0xF3EF,0xF444,0xF6B2,0xF984,0xFBDF,0xFC84,0xFC47,
89 0xFB14,0xF8A6,0xF66C,0xF6F5,0xF892,0xFA8A,0xFAE8,0xF97D,
90 0xF6E3,0xF405,0xF274,0xF2C2,0xF335,0xF2EB,0xF1E5,0xF09A,
91 0xEF7C,0xEF2A,0xEEB8,0xED9D,0xECF0,0xEDA7,0xEEE4,0xEF00,
92 0xEE34,0xEDF1,0xEE35,0xEE7E,0xEF8A,0xF1A6,0xF3C5,0xF407,
93 0xF2C2,0xF221,0xF3F2,0xF74C,0xF97A,0xFA3A,0xFA4E,0xFA86,
94 0xFB6E,0xFBED,0xFC59,0xFC92,0xFD04,0xFDB5,0xFEA6,0xFF18,
95 0xFEDC,0xFD30,0xFABA,0xF9BC,0xFAF6,0xFCA5,0xFD04,0xFA89,
96 0xF6FA,0xF50A,0xF54C,0xF664,0xF7D2,0xF86A,0xF6F2,0xF571,
97 0xF511,0xF21A,0xF36F,0xF4EA,0xF573,0xF62F,0xF6D7,0xF706,
98 0xF683,0xF57A,0xF5AE,0xF79A,0xFA38,0xFB4E,0xFA68,0xF9E9,
99 0xF8B6,0xF464,0xEB03,0xD941,0xC424,0xBF0A,0xC00D,0xC021,
100 0xC0C3,0xDCEE,0x027D,0x0AC3,0xEDCA,0xC500,0xBFF6,0xC260,
101 0xC0F4,0xEF2E,0x2FA5,0x3DAF,0x3CCC,0x25B3,0xF9C7,0xE25A,
102 0xE889,0x0E86,0x3899,0x3F57,0x3EC7,0x3EB3,0x3F3D,0x2C1D,
103 0x1486,0x1878,0x30DA,0x401A,0x3E8F,0x3F4F,0x3CED,0x285C,
104 0x15AA,0x0BFB,0x059F,0xFEDB,0xF760,0xF1B5,0xF06D,0xF263,
105 0xF2EB,0xF0CA,0xE7D5,0xD860,0xC6C7,0xBF8F,0xBF5D,0xC562,
106 0xDC31,0xF39C,0x0046,0xFCA8,0xEAA8,0xD4DC,0xC933,0xD229,
107 0xEE3B,0x10CB,0x29FA,0x3199,0x2A13,0x192F,0x081B,0x0197,
108 0x09A6,0x1CFB,0x3331,0x3F0C,0x3F30,0x3999,0x279F,0x1632,
109 0x0C6E,0x0D48,0x14B5,0x1B87,0x1C31,0x15FE,0x0C85,0x02AD,
110 0xF9E7,0xF226,0xEB44,0xE69D,0xE256,0xE08E,0xE2B1,0xE6EA,
111 0xEA1C,0xE90A,0xE3A1,0xDC29,0xD54D,0xD2FA,0xD7DF,0xE396,
112 0xF1D3,0xFDB9,0x034E,0x009C,0xF884,0xF15C,0xF01A,0xF800,
113 0x06C2,0x168F,0x2155,0x24B6,0x1FFA,0x164B,0x0D5C,0x09DB,
114 0x0D5B,0x15BB,0x1F93,0x2529,0x23FC,0x1BC0,0x1030,0x0556,
115 0xFF7B,0xFEA0,0x005D,0x02A5,0x0331,0x008D,0xFB18,0xF4C7,
116 0xEE1E,0xE94F,0xE692,0xE547,0xE654,0xE8C2,0xEB68,0xED42,
117 0xEDEB,0xED8C,0xECB2,0xEB2B,0xEA03,0xEB36,0xEFD8,0xF779,
118 0xFFBA,0x05AC,0x08BF,0x07AC,0x0486,0x01AA,0x01CA,0x065A,
119 0x0E04,0x150D,0x1966,0x1988,0x156B,0x105E,0x0C60,0x0A8A,
120 0x0931,0x0D28,0x0F96,0x0F89,0x0E38,0x0965,0x02FF,0xFD25,
121 0xF9C3,0xF8E6,0xF912,0xF8C0,0xF7D7,0xF63A,0xF4B4,0xF2D9,
122 0xF0B9,0xEE77,0xED00,0xEC62,0xED95,0xF015,0xF2EB,0xF514,
123 0xF668,0xF70B,0xF718,0xF77C,0xF854,0xFA16,0xFD2B,0x00D1,
124 0x0472,0x07C5,0x0918,0x0873,0x071D,0x06E6,0x07E1,0x096E,
125 0x0BAC,0x0D6D,0x0DD5,0x0BFD,0x0A54,0x08E9,0x078C,0x0656,
126 0x049B,0x0313,0x0254,0x0204,0x00A7,0xFE66,0xFC25,0xFA64,
127 0xF901,0xF85E,0xF81D,0xF70E,0xF580,0xF584,0xF7F1,0xF98F,
128 0xFA6F,0xF9A0,0xF731,0xF52A,0xF55F,0xF7FC,0xFBA2,0xFED3,
129 0xFFC1,0xFFC6,0xFF89,0xFD33,0xF660,0xE8DB,0xD296,0xC0EA,
130 0xBFD7,0xC02B,0xC00A,0xC821,0xF044,0x0F75,0x0DCC,0xE4EC,
131 0xBFBF,0xC217,0xC05E,0xC939,0x0F60,0x3DFF,0x3B71,0x3CDA,
132 0x1F12,0xF248,0xE254,0xF529,0x2531,0x3F95,0x3DD3,0x3E89,
133 0x3DF1,0x3EB6,0x2AED,0x1639,0x20A4,0x3949,0x3F89,0x3E62,
134 0x3EED,0x3C4F,0x283B,0x15AD,0x0B00,0x02C6,0xFA01,0xF24D,
135 0xEE84,0xF0DB,0xF6F8,0xFA12,0xF331,0xE2E3,0xCC92,0xBE79,
136 0xBF1F,0xBF67,0xCF55,0xE901,0xFC51,0x01FE,0xF79C,0xE26C,
137 0xCEDA,0xC94F,0xDA1E,0xFC9E,0x208A,0x3631,0x3731,0x266D,
138 0x0FF1,0x0249,0x03D0,0x1406,0x2AA8,0x3BA8,0x3DE2,0x3D6B,
139 0x3285,0x2144,0x13F3,0x0D8A,0x0E6F,0x1376,0x180E,0x17FA,
140 0x126E,0x0923,0xFEFB,0xF5D5,0xED47,0xE51F,0xDF14,0xDBD0,
141 0xDC79,0xE16A,0xE6AC,0xE961,0xE5E6,0xDCFB,0xD265,0xCB98,
142 0xCCF8,0xD7EC,0xE866,0xF82B,0x010B,0x007C,0xF85A,0xF065,
143 0xEBAE,0xF009,0xFF96,0x1078,0x1DF1,0x2428,0x221D,0x19F4,
144 0x1114,0x0B80,0x0D01,0x13FE,0x1D41,0x23DF,0x2478,0x1F36,
145 0x15A7,0x0C12,0x0508,0x0192,0x0103,0x0112,0x0048,0xFF25,
146 0xFCA1,0xF87D,0xF2C4,0xEC29,0xE67D,0xE34E,0xE2B9,0xE3BB,
147 0xE6C9,0xEA73,0xED39,0xED85,0xEB62,0xE880,0xE6F5,0xE7F6,
148 0xEC31,0xF31C,0xFB87,0x02E4,0x060F,0x05D5,0x03E6,0x02BA,
149 0x0374,0x063A,0x0AE1,0x1133,0x1657,0x1895,0x1754,0x140D,
150 0x1041,0x0CD6,0x0B70,0x0C0A,0x0DD4,0x0F07,0x0EC0,0x0A8D,
151 0x05A0,0x0113,0xFBD4,0xF713,0xF457,0xF47F,0xF6B6,0xF7F6,
152 0xF6EB,0xF419,0xF03E,0xEC9E,0xEA41,0xE957,0xEAAC,0xEE3B,
153 0xF1F3,0xF583,0xF6C5,0xF6FA,0xF71C,0xF662,0xF630,0xF8D4,
154 0xFD2A,0x0142,0x0540,0x084F,0x0985,0x0A25,0x0A57,0x09A5,
155 0x09E6,0x0AAC,0x0C8D,0x0EC5,0x1094,0x10F3,0x0F77,0x0CC5,
156 0x0A30,0x086F,0x0853,0x07DC,0x0526,0x0370,0x0310,0x0364,
157 0x0309,0xFFC7,0xFAAA,0xF5BD,0xF35B,0xF487,0xF85A,0xFB90,
158 0xFBE8,0xFA84,0xF838,0xF661,0xF453,0xF381,0xF546,0xF8E7,
159 0xFCE6,0x0062,0x01C2,0x0195,0x0014,0xFE58,0xFDBC,0xFBF9,
160 0xF67B,0xE9A7,0xD294,0xC151,0xC0B0,0xC17C,0xC07B,0xCC46,
161 0xF785,0x1440,0x0B2C,0xDBD0,0xBFA3,0xC3BB,0xC03D,0xD224,
162 0x1E13,0x3F60,0x3CF4,0x39B5,0x1164,0xEA6E,0xE337,0xFD51,
163 0x2D21,0x4096,0x3ED1,0x3F5F,0x3F90,0x3CB4,0x2291,0x16A3,
164 0x286E,0x3E97,0x3FCA,0x3F12,0x4035,0x38A5,0x227E,0x145E,
165 0x0B93,0x02E4,0xFA8E,0xF401,0xF20F,0xF492,0xF977,0xF869,
166 0xF030,0xE23A,0xCD9D,0xC0FB,0xC06E,0xC26C,0xD42F,0xECBD,
167 0xFF83,0x03C9,0xF6CA,0xE049,0xCDB1,0xCCB5,0xE14E,0x034C,
168 0x245B,0x3753,0x369A,0x25C0,0x1018,0x02EF,0x0520,0x15EA,
169 0x2E78,0x3E06,0x3EB8,0x3E26,0x316C,0x1D3C,0x1041,0x0D20,
170 0x1263,0x19ED,0x1D05,0x1A40,0x12D2,0x08BD,0xFEC1,0xF5C0,
171 0xEDEE,0xE6DF,0xE08E,0xDDB9,0xE01C,0xE59B,0xE99E,0xE93D,
172 0xE2C6,0xD9D2,0xD209,0xCEEB,0xD246,0xDCB0,0xEB04,0xF7D2,
173 0xFEB7,0xFDCA,0xF848,0xF07A,0xEE31,0xF5A5,0x02C9,0x12E7,
174 0x2077,0x25AA,0x2129,0x17FA,0x0F84,0x0C58,0x0F91,0x1700,
175 0x1E3D,0x21E5,0x20D6,0x1BCC,0x1355,0x0AAA,0x047B,0x00C2,
176 0xFF4C,0xFE85,0xFEB7,0xFD80,0xFA4B,0xF58B,0xF05B,0xEA68,
177 0xE576,0xE136,0xDEB1,0xDF78,0xE317,0xE815,0xEC13,0xEC71,
178 0xE957,0xE38C,0xDFF6,0xE1F9,0xE8B6,0xF1D3,0xFA71,0x000A,
179 0x0228,0x00D8,0xFD49,0xFB11,0xFD1C,0x01F8,0x09ED,0x1201,
180 0x1702,0x16CB,0x1288,0x0CFB,0x096A,0x0844,0x0990,0x0BCB,
181 0x0D0B,0x0BFE,0x0A0E,0x05A7,0xFFF6,0xFB68,0xF889,0xF70D,
182 0xF68A,0xF5AC,0xF398,0xF0AD,0xEF35,0xEEC1,0xEE72,0xEC94,
183 0xE9F2,0xE7BB,0xE7F3,0xEAB3,0xEE9A,0xF1E1,0xF367,0xF3B1,
184 0xF365,0xF32D,0xF45E,0xF6FC,0xFA6D,0xFEAD,0x029B,0x0607,
185 0x077E,0x06F8,0x05BC,0x05BA,0x069B,0x0928,0x0BF4,0x0DA2,
186 0x0DF5,0x0D1D,0x0C22,0x0A3D,0x0765,0x0486,0x02EA,0x029B,
187 0x0392,0x03C3,0x027B,0xFFDD,0xFC51,0xF82B,0xF5A4,0xF516,
188 0xF62C,0xF6D1,0xF5D9,0xF53F,0xF556,0xF510,0xF491,0xF465,
189 0xF08D,0xF20D,0xF5FF,0xF97D,0xFB0D,0xFC49,0xFC01,0xFBE8,
190 0xFC17,0xFCE6,0xFD96,0xFAF0,0xF270,0xE1E8,0xC937,0xBED5,
191 0xBFFD,0xC077,0xBF64,0xD77B,0x045E,0x1640,0xFFBC,0xCEC5,
192 0xBF4A,0xC32E,0xBF2F,0xE4A2,0x2E0E,0x3DC5,0x3D59,0x3351,
193 0x065E,0xE74E,0xE7D2,0x0941,0x3646,0x3FAC,0x3EB4,0x3ED6,
194 0x3FD1,0x3861,0x1E14,0x1827,0x2CF2,0x3F27,0x3F3D,0x3EC0,
195 0x3FD3,0x32AC,0x1E50,0x1360,0x0ACC,0x014B,0xF793,0xF0A4,
196 0xEFE5,0xF4D2,0xF9E5,0xF971,0xEFAB,0xDDFF,0xC921,0xBE8D,
197 0xBF08,0xC215,0xD6FC,0xF07D,0x00CA,0x00C6,0xF0B7,0xD948,
198 0xC976,0xCE4D,0xE869,0x0C97,0x2ACF,0x3702,0x2FF3,0x1D66,
199 0x0BD7,0x042B,0x0A2E,0x1C55,0x327D,0x3E50,0x3ECF,0x3D3D,
200 0x2E93,0x1C39,0x10BF,0x0F3B,0x14C2,0x1B2A,0x1CD1,0x190A,
201 0x110B,0x0760,0xFE29,0xF5D8,0xEDAB,0xE66C,0xE151,0xDF88,
202 0xE1A1,0xE66D,0xEBC6,0xEAAA,0xE431,0xDBD6,0xD42A,0xD079,
203 0xD444,0xDEFD,0xEDBD,0xFBEB,0x037F,0x02AD,0xFA57,0xF1F1,
204 0xF02B,0xF751,0x0619,0x174F,0x23DC,0x26F8,0x21F4,0x19A5,
205 0x12BA,0x0FC4,0x124A,0x18EA,0x1F8C,0x240A,0x2362,0x1D57,
206 0x14A5,0x0B92,0x04DA,0x00FE,0xFF7A,0xFFC7,0x004A,0xFFB5,
207 0xFD09,0xF887,0xF225,0xEBA6,0xE60A,0xE291,0xE2E3,0xE59D,
208 0xE9E6,0xEDD0,0xEF11,0xEE39,0xEB29,0xE84C,0xE72F,0xE8D9,
209 0xEE01,0xF673,0xFF8C,0x0643,0x0845,0x055E,0x01C2,0xFFF1,
210 0x01D8,0x0737,0x0EB6,0x153A,0x184E,0x17E5,0x147E,0x1021,
211 0x0C5C,0x0A4E,0x0A23,0x0B84,0x0D17,0x0E81,0x0D97,0x0804,
212 0x037C,0xFDF7,0xF8C8,0xF6D6,0xF693,0xF6D9,0xF602,0xF48A,
213 0xF315,0xF181,0xF09C,0xEECF,0xEBE4,0xE916,0xE925,0xECCC,
214 0xF244,0xF635,0xF796,0xF6C5,0xF5B2,0xF4B3,0xF55D,0xF7C2,
215 0xFC57,0x0243,0x06EE,0x0909,0x0999,0x08F6,0x06A4,0x0451,
216 0x0518,0x0A38,0x0FB4,0x128F,0x114B,0x0D57,0x094D,0x066B,
217 0x0591,0x05FB,0x0701,0x064F,0x0468,0x0262,0x00AF,0xFF37,
218 0xFCAE,0xF9E2,0xF750,0xF662,0xF72F,0xF7E6,0xF6CD,0xF58D,
219 0xF4E1,0xF453,0xF48D,0xF4E0,0xF65A,0xF7E7,0xF779,0xFA22,
220 0xFDF4,0x00A5,0x012E,0xFF64,0xFD21,0xFB1A,0xF6DE,0xED2E,
221 0xDABC,0xC4CB,0xBFBB,0xC07A,0xC0A5,0xC2A7,0xE3E1,0x0B3D,
222 0x124E,0xF175,0xC59D,0xC081,0xC208,0xC2B8,0xFCCD,0x3960,
223 0x3C5B,0x3DBA,0x2761,0xF88B,0xE29B,0xEF2C,0x1A51,0x3CDA,
224 0x3E47,0x3E83,0x3E1C,0x3F34,0x308B,0x18F6,0x1C7E,0x3473,
225 0x3F6F,0x3DB7,0x3DAD,0x3D79,0x2BCB,0x1866,0x0D33,0x0518,
226 0xFCC3,0xF3E5,0xEE2A,0xEED0,0xF4A1,0xF8BA,0xF53B,0xE88A,
227 0xD3DB,0xC157,0xBEE6,0xBEB2,0xC780,0xE148,0xF91C,0x0397,
228 0xFC67,0xE783,0xD0B2,0xC72A,0xD3B9,0xF29E,0x170C,0x3167,
229 0x37E3,0x2AA1,0x1494,0x0457,0x02AC,0x0EDC,0x2306,0x373A,
230 0x3E26,0x3E03,0x36CD,0x240D,0x147B,0x0C8C,0x0D23,0x1320,
231 0x191C,0x19FA,0x13C9,0x08AF,0xFD5A,0xF466,0xEDF3,0xE78F,
232 0xE138,0xDC65,0xDAC8,0xDD93,0xE30C,0xE766,0xE5F1,0xDE8B,
233 0xD45F,0xCC33,0xCBA4,0xD391,0xE221,0xF150,0xFC36,0xFF42,
234 0xFB1F,0xF230,0xEBC7,0xED39,0xF794,0x07FB,0x1B2A,0x24D0,
235 0x232B,0x1B27,0x1037,0x09BC,0x0A3B,0x10D7,0x19D5,0x20BF,
236 0x220B,0x1D38,0x1478,0x0BA6,0x04E2,0x0095,0xFF56,0xFF5D,
237 0xFF42,0xFDBA,0xFAAB,0xF635,0xF145,0xEBBF,0xE6CC,0xE3C4,
238 0xE259,0xE192,0xE20C,0xE517,0xE91B,0xEBAE,0xEB54,0xE93D,
239 0xE6B4,0xE58A,0xE6F2,0xEC82,0xF4FB,0xFDEB,0x0451,0x0629,
240 0x0398,0x0003,0xFE7D,0x0036,0x055E,0x0D07,0x13A8,0x1784,
241 0x16EC,0x1212,0x0C45,0x0914,0x0827,0x0988,0x0B93,0x0D5F,
242 0x0D23,0x09FE,0x0592,0x001B,0xFAA0,0xF534,0xF0ED,0xF076,
243 0xF35A,0xF4E8,0xF479,0xF188,0xECD5,0xE8A2,0xE662,0xE675,
244 0xE94A,0xED57,0xF06A,0xF25E,0xF227,0xF152,0xF110,0xF25A,
245 0xF465,0xF5E9,0xF92D,0xFE25,0x0229,0x045F,0x0592,0x0598,
246 0x05AC,0x060E,0x073F,0x08AE,0x0AE9,0x0CAC,0x0E28,0x0DA3,
247 0x0C71,0x0AF2,0x08F4,0x06D1,0x04C8,0x0417,0x0432,0x0421,
248 0x0256,0x016A,0x00DC,0xFD29,0xF953,0xF5A8,0xF363,0xF397,
249 0xF5CA,0xF7FC,0xF8AC,0xF77B,0xF50E,0xF2B0,0xF1C4,0xF38A,
250 0xF744,0xFA91,0xFC9A,0xFDCB,0xFE30,0xFEDE,0xFEBE,0xFE24,
251 0xFE65,0xFD9C,0xF91F,0xEDC5,0xD7C7,0xC2BB,0xC0BE,0xC1D0,
252 0xC0FF,0xC8C4,0xF405,0x1587,0x1125,0xE4D6,0xC187,0xC2F4,
253 0xC1BC,0xC99E,0x0FB2,0x3E27,0x3CAA,0x3DF7,0x1D52,0xEFA8,
254 0xE0F2,0xF476,0x24D4,0x4002,0x3EE8,0x3F80,0x3F12,0x3F12,
255 0x2997,0x16AB,0x2150,0x39EA,0x4030,0x3F19,0x3FC8,0x3D3D,
256 0x2882,0x164B,0x0BCD,0x03D0,0xFBFC,0xF504,0xF12E,0xF33E,
257 0xF84A,0xFA5A,0xF3E9,0xE44E,0xD09D,0xC282,0xC053,0xC0B9,
258 0xD0F9,0xE855,0xFB92,0x02B8,0xFA0D,0xE669,0xD2FB,0xCCC1,
259 0xDB95,0xFB02,0x1D8F,0x342E,0x3785,0x2A00,0x1627,0x07D5,
260 0x0661,0x12EE,0x284D,0x3B2B,0x3F03,0x3F29,0x3947,0x2718,
261 0x1710,0x0DB4,0x0DC4,0x14B9,0x1C06,0x1D29,0x1795,0x0D55,
262 0x0227,0xF806,0xEEA9,0xE6B2,0xE064,0xDE0B,0xE077,0xE65C,
263 0xEC05,0xECCC,0xE6E0,0xDC54,0xD23B,0xCE16,0xD163,0xDBD0,
264 0xE9FF,0xF6FE,0xFE9D,0xFEC8,0xF90E,0xF168,0xECB2,0xEF7F,
265 0xFB47,0x0D5E,0x1E63,0x2703,0x2641,0x1BC3,0x0F3D,0x092E,
266 0x0BBA,0x144B,0x1D9C,0x2366,0x233E,0x1DD2,0x151D,0x0B23,
267 0x0371,0xFF54,0xFEBB,0x000C,0x00DD,0xFF62,0xFC10,0xF6CA,
268 0xF12C,0xEC8C,0xE755,0xE2A5,0xE022,0xE057,0xE40C,0xEA45,
269 0xEEFB,0xEEBF,0xEA2F,0xE499,0xE1D5,0xE373,0xE90A,0xF1A3,
270 0xFA9A,0x0176,0x03EE,0x029D,0xFFE7,0xFD46,0xFCA8,0x0080,
271 0x0858,0x104E,0x169B,0x188F,0x14B4,0x0E5E,0x096E,0x07B6,
272 0x08FC,0x0BEE,0x0E8E,0x0E0C,0x0ABE,0x061F,0x0133,0xFCDA,
273 0xF855,0xF5D2,0xF453,0xF347,0xF28D,0xF224,0xF18F,0xEFBF,
274 0xECA7,0xE9FC,0xE7B2,0xE6C6,0xE772,0xEA02,0xEDDC,0xF0ED,
275 0xF1F9,0xF168,0xF105,0xF174,0xF2C2,0xF4C9,0xF865,0xFCD8,
276 0x016F,0x04B7,0x0690,0x05BE,0x0402,0x02F1,0x0364,0x05BD,
277 0x096B,0x0C9B,0x0D5D,0x0C8D,0x0A26,0x07B1,0x050D,0x0379,
278 0x02D8,0x0316,0x03A1,0x036B,0x01AA,0xFEEE,0xFC29,0xF8F4,
279 0xF677,0xF4B2,0xF4B7,0xF597,0xF621,0xF557,0xF42A,0xF43A,
280 0xF4F5,0xF45E,0xF363,0xF3BB,0xF3E5,0xF614,0xFA2B,0xFAA6,
281 0xFC98,0xFCF7,0xFBB8,0xFB91,0xFC48,0xFB63,0xF658,0xEAA1,
282 0xD884,0xC3A9,0xBF18,0xC083,0xC00E,0xD7B2,0xFD1D,0x1032,
283 0x0582,0xDF65,0xC1A6,0xC226,0xBFA3,0xDAD0,0x1A7A,0x3B18,
284 0x3DAF,0x3127,0x0AA7,0xEDCC,0xE928,0xFE25,0x272E,0x3F03,
285 0x3E4A,0x3EAB,0x3F7F,0x32E1,0x182C,0x10AB,0x1D57,0x3442,
286 0x3F71,0x3EC4,0x3DA4,0x2C0B,0x199B,0x0E86,0x07ED,0x0155,
287 0xFAF3,0xF618,0xF506,0xF749,0xFA88,0xFACF,0xF438,0xE6BC,
288 0xD6EF,0xCB1A,0xC836,0xD049,0xE090,0xF297,0xFE00,0xFFE3,
289 0xF5F1,0xE432,0xD698,0xD70A,0xE811,0x0383,0x1D58,0x2B26,
290 0x288F,0x1A30,0x0925,0xFF49,0x0307,0x1234,0x24DC,0x3316,
291 0x3755,0x3131,0x2544,0x16ED,0x0C16,0x08EC,0x0D14,0x1400,
292 0x17AD,0x15EF,0x0F0E,0x0596,0xFD47,0xF6BA,0xF1F9,0xEE1A,
293 0xEA70,0xE7E2,0xE7A3,0xEA6A,0xEECA,0xF01B,0xECA0,0xE54B,
294 0xDD94,0xDB44,0xDE80,0xE650,0xF149,0xFAAC,0xFFEC,0xFFEA,
295 0xFB2B,0xF5B7,0xF400,0xF811,0x01BE,0x0DD7,0x185B,0x1E3E,
296 0x1DAD,0x1707,0x0F22,0x0B02,0x0BD3,0x1116,0x17EE,0x1D27,
297 0x1E98,0x1A4F,0x11F1,0x09D3,0x0463,0x01C2,0x0120,0x0200,
298 0x0252,0x0124,0xFF05,0xFAFD,0xF613,0xF05D,0xEB72,0xE873,
299 0xE8BC,0xEB10,0xEE30,0xF0CC,0xF248,0xF22F,0xEFAC,0xECFD,
300 0xEB0A,0xEC24,0xEFE0,0xF5DB,0xFD09,0x02C8,0x04F1,0x02D7,
301 0xFF24,0xFCFF,0xFE02,0x0270,0x093B,0x0F22,0x122A,0x1157,
302 0x0DD3,0x0A20,0x07D8,0x06CD,0x0763,0x0850,0x0995,0x09A2,
303 0x087A,0x05F3,0x01F1,0xFE2B,0xFACE,0xF885,0xF64E,0xF81D,
304 0xF868,0xF68F,0xF58E,0xF4C0,0xF34E,0xF065,0xEDA4,0xEC40,
305 0xED49,0xEFFD,0xF392,0xF6EF,0xF85F,0xF7CA,0xF60B,0xF4AE,
306 0xF5D5,0xF875,0xFC72,0xFF7C,0x02A7,0x059A,0x06F1,0x053A,
307 0x0272,0x01AA,0x037D,0x06F3,0x0A39,0x0B69,0x0A7F,0x085B,
308 0x0612,0x04F9,0x04DB,0x04EC,0x0458,0x0292,0x0137,0x007B,
309 0x000D,0xFEB1,0xFC4E,0xF9F8,0xF884,0xF77B,0xF6BD,0xF673,
310 0xF562,0xF476,0xF45E,0xF65A,0xF815,0xF85B,0xF667,0xF3B1,
311 0xF209,0xF36C,0xF7E1,0xFD92,0x0175,0x009F,0xFEEC,0xFD2C,
312 0xFB06,0xF7C6,0xF42D,0xF02D,0xEBF1,0xE861,0xE7BA,0xECDF,
313 0xF764,0x0227,0x069B,0x010F,0xF467,0xE792,0xE226,0xE885,
314 0xFABE,0x0F3F,0x1AFB,0x19A1,0x0E66,0x001F,0xF720,0xF7E9,
315 0x0234,0x1100,0x1D72,0x232D,0x1F82,0x15AA,0x0AF4,0x0393,
316 0x0280,0x07CD,0x0FE5,0x1622,0x167E,0x10C3,0x092B,0x0365,
317 0xFF51,0xFD8B,0xFE47,0xFDF4,0xFC3F,0xFB34,0xFB40,0xFC4D,
318 0xFCA6,0xFB42,0xF7B2,0xF269,0xEDB3,0xEC39,0xEFA3,0xF588,
319 0xFC52,0x00B0,0x00BF,0xFC0C,0xF4A7,0xEF24,0xF030,0xF832,
320 0x0376,0x0C8C,0x0F2A,0x0AB1,0x031A,0xFCEA,0xFB6C,0xFF65,
321 0x0706,0x0DAF,0x1062,0x0E6D,0x0AE4,0x06F9,0x0303,0x0036,
322 0xFF13,0x0109,0x03E3,0x054A,0x0339,0xFF07,0xFB3A,0xF9E1,
323 0xFA00,0xFA9D,0xF920,0xF66F,0xF435,0xF37D,0xF4A5,0xF6C8,
324 0xF7C2,0xF5C5,0xF2AF,0xF012,0xEEBE,0xEF05,0xEFBA,0xF088,
325 0xF0A9,0xF0DB,0xF0A5,0xF025,0xEF42,0xEE5D,0xEF2E,0xF3E4,
326 0xF9DE,0xFED4,0x0071,0xFDE1,0xF948,0xF8DC,0xF7BB,0xF8ED,
327 0xFD26,0xFEC4,0xFEE2,0xFE5C,0xFD0A,0xFBE4,0xFB17,0xFA12,
328 0xF97F,0xF8A1,0xF7E5,0xF74D,0xF687,0xF580,0xF3E9,0xF32E,
329 0xF281,0xF25C,0xF1C1,0xF159,0xF017,0xEF56,0xEE9C,0xEE53,
330 0xEE38,0xED6F,0xECCF,0xEC85,0xEBE8,0xEB9E,0xEB41,0xEAA9,
331 0xEAE0,0xEA7D,0xEAA1,0xEA52,0xEA2D,0xEA12,0xE98C,0xE945,
332 0xE96A,0xE96A,0xE9AE,0xEA12,0xE9B6,0xE920,0xE8F5,0xE90A,
333 0xE90B,0xE981,0xE97F,0xE987,0xE9A