2006-02-25 20:50:29 +00:00
|
|
|
#pragma once
|
|
|
|
|
2006-06-11 15:49:38 +00:00
|
|
|
const double _M14 = (157500000.0 / 11.0); // 14.3181818... * 10^6
|
|
|
|
const double CLK_6502 = ((_M14 * 65.0) / 912.0); // 65 cycles per 912 14M clocks
|
2006-05-02 21:56:28 +00:00
|
|
|
//const double CLK_6502 = 23 * 44100; // 1014300
|
2006-02-25 20:50:29 +00:00
|
|
|
|
2008-08-19 21:36:31 +00:00
|
|
|
// The effective Z-80 clock rate is 2.041MHz
|
|
|
|
// See: http://www.apple2info.net/hardware/softcard/SC-SWHW_a2in.pdf
|
2008-09-09 21:07:14 +00:00
|
|
|
const double CLK_Z80 = (CLK_6502 * 2);
|
2008-08-19 21:36:31 +00:00
|
|
|
|
2006-02-25 20:50:29 +00:00
|
|
|
const UINT uCyclesPerLine = 65; // 25 cycles of HBL & 40 cycles of HBL'
|
|
|
|
const UINT uVisibleLinesPerFrame = 64*3; // 192
|
|
|
|
const UINT uLinesPerFrame = 262; // 64 in each third of the screen & 70 in VBL
|
|
|
|
const DWORD dwClksPerFrame = uCyclesPerLine * uLinesPerFrame; // 17030
|
|
|
|
|
2007-05-28 11:16:42 +00:00
|
|
|
#define NUM_SLOTS 8
|
|
|
|
|
2006-02-25 20:50:29 +00:00
|
|
|
#define MAX(a,b) (((a) > (b)) ? (a) : (b))
|
|
|
|
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
|
|
|
|
|
|
|
|
#define RAMWORKS // 8MB RamWorks III support
|
|
|
|
|
|
|
|
// Use a base freq so that DirectX (or sound h/w) doesn't have to up/down-sample
|
|
|
|
// Assume base freqs are 44.1KHz & 48KHz
|
|
|
|
const DWORD SPKR_SAMPLE_RATE = 44100;
|
|
|
|
|
2006-06-12 22:06:50 +00:00
|
|
|
enum AppMode_e
|
|
|
|
{
|
|
|
|
MODE_LOGO = 0
|
|
|
|
, MODE_PAUSED
|
2011-02-21 23:54:09 +00:00
|
|
|
, MODE_RUNNING // 6502 is running at normal speed (Debugger breakpoints may or may not be active)
|
|
|
|
, MODE_DEBUG // 6502 is paused
|
|
|
|
, MODE_STEPPING // 6502 is running at full speed (Debugger breakpoints always active)
|
2006-06-12 22:06:50 +00:00
|
|
|
};
|
|
|
|
|
2006-02-25 20:50:29 +00:00
|
|
|
#define SPEED_MIN 0
|
|
|
|
#define SPEED_NORMAL 10
|
|
|
|
#define SPEED_MAX 40
|
|
|
|
|
2014-07-29 14:56:55 +00:00
|
|
|
#define DRAW_BACKGROUND (1 << 0)
|
|
|
|
#define DRAW_LEDS (1 << 1)
|
|
|
|
#define DRAW_TITLE (1 << 2)
|
|
|
|
#define DRAW_BUTTON_DRIVES (1 << 3)
|
|
|
|
#define DRAW_DISK_STATUS (1 << 4)
|
2006-02-25 20:50:29 +00:00
|
|
|
|
|
|
|
#define BTN_HELP 0
|
|
|
|
#define BTN_RUN 1
|
|
|
|
#define BTN_DRIVE1 2
|
|
|
|
#define BTN_DRIVE2 3
|
|
|
|
#define BTN_DRIVESWAP 4
|
|
|
|
#define BTN_FULLSCR 5
|
|
|
|
#define BTN_DEBUG 6
|
|
|
|
#define BTN_SETUP 7
|
2007-05-28 11:16:42 +00:00
|
|
|
|
2006-06-26 16:59:48 +00:00
|
|
|
// TODO: Move to StringTable.h
|
2007-05-28 11:16:42 +00:00
|
|
|
#define TITLE_APPLE_2 TEXT("Apple ][ Emulator")
|
|
|
|
#define TITLE_APPLE_2_PLUS TEXT("Apple ][+ Emulator")
|
|
|
|
#define TITLE_APPLE_2E TEXT("Apple //e Emulator")
|
|
|
|
#define TITLE_APPLE_2E_ENHANCED TEXT("Enhanced Apple //e Emulator")
|
2010-12-14 18:00:10 +00:00
|
|
|
#define TITLE_APPLE_2C TEXT("Apple //e Emulator")
|
|
|
|
#define TITLE_APPLE_2D TEXT("Apple )(d Virtual Debug Hardware")
|
2008-06-20 23:47:25 +00:00
|
|
|
#define TITLE_PRAVETS_82 TEXT("Pravets 82 Emulator")
|
2009-01-09 21:59:22 +00:00
|
|
|
#define TITLE_PRAVETS_8M TEXT("Pravets 8M Emulator")
|
2008-06-20 23:47:25 +00:00
|
|
|
#define TITLE_PRAVETS_8A TEXT("Pravets 8A Emulator")
|
2006-06-27 02:34:46 +00:00
|
|
|
|
2009-02-18 16:03:10 +00:00
|
|
|
#define TITLE_PAUSED TEXT("* PAUSED *")
|
2006-06-26 16:59:48 +00:00
|
|
|
#define TITLE_STEPPING TEXT("Stepping")
|
2006-02-25 20:50:29 +00:00
|
|
|
|
2006-06-25 03:41:52 +00:00
|
|
|
// Configuration
|
2009-01-06 22:02:31 +00:00
|
|
|
#define REG_CONFIG "Configuration"
|
2007-05-28 11:16:42 +00:00
|
|
|
#define REGVALUE_APPLE2_TYPE "Apple2 Type"
|
2014-07-27 21:31:00 +00:00
|
|
|
#define REGVALUE_OLD_APPLE2_TYPE "Computer Emulation" // Deprecated
|
|
|
|
#define REGVALUE_CONFIRM_REBOOT "Confirm Reboot" // Added at 1.24.1 PageConfig
|
2006-06-26 16:59:48 +00:00
|
|
|
#define REGVALUE_SPKR_VOLUME "Speaker Volume"
|
|
|
|
#define REGVALUE_MB_VOLUME "Mockingboard Volume"
|
2006-02-25 20:50:29 +00:00
|
|
|
#define REGVALUE_SAVESTATE_FILENAME "Save State Filename"
|
|
|
|
#define REGVALUE_SAVE_STATE_ON_EXIT "Save State On Exit"
|
2006-06-26 16:59:48 +00:00
|
|
|
#define REGVALUE_HDD_ENABLED "Harddisk Enable"
|
2013-12-31 22:40:10 +00:00
|
|
|
#define REGVALUE_JOYSTICK0_EMU_TYPE "Joystick0 Emu Type" // Added at 1.24.0 (previously was "Joystick 0 Emulation")
|
|
|
|
#define REGVALUE_JOYSTICK1_EMU_TYPE "Joystick1 Emu Type" // Added at 1.24.0 (previously was "Joystick 1 Emulation")
|
|
|
|
#define REGVALUE_OLD_JOYSTICK0_EMU_TYPE "Joystick 0 Emulation" // Deprecated from 1.24.0
|
|
|
|
#define REGVALUE_OLD_JOYSTICK1_EMU_TYPE "Joystick 1 Emulation" // Deprecated from 1.24.0
|
2006-06-26 16:59:48 +00:00
|
|
|
#define REGVALUE_PDL_XTRIM "PDL X-Trim"
|
|
|
|
#define REGVALUE_PDL_YTRIM "PDL Y-Trim"
|
2007-08-06 21:38:35 +00:00
|
|
|
#define REGVALUE_SCROLLLOCK_TOGGLE "ScrollLock Toggle"
|
2013-12-31 22:40:10 +00:00
|
|
|
#define REGVALUE_CURSOR_CONTROL "Joystick Cursor Control"
|
|
|
|
#define REGVALUE_CENTERING_CONTROL "Joystick Centering Control"
|
2013-12-06 21:10:41 +00:00
|
|
|
#define REGVALUE_AUTOFIRE "Autofire"
|
2008-05-17 23:20:33 +00:00
|
|
|
#define REGVALUE_MOUSE_CROSSHAIR "Mouse crosshair"
|
2008-05-18 18:23:25 +00:00
|
|
|
#define REGVALUE_MOUSE_RESTRICT_TO_WINDOW "Mouse restrict to window"
|
2008-02-22 21:28:35 +00:00
|
|
|
#define REGVALUE_THE_FREEZES_F8_ROM "The Freeze's F8 Rom"
|
2008-06-20 23:47:25 +00:00
|
|
|
#define REGVALUE_CIDERPRESSLOC "CiderPress Location"
|
2012-01-22 13:46:36 +00:00
|
|
|
#define REGVALUE_CPM_CONFIG "CPM Config"
|
2009-01-09 21:59:22 +00:00
|
|
|
#define REGVALUE_DUMP_TO_PRINTER "Dump to printer"
|
|
|
|
#define REGVALUE_CONVERT_ENCODING "Convert printer encoding for clones"
|
|
|
|
#define REGVALUE_FILTER_UNPRINTABLE "Filter unprintable characters"
|
|
|
|
#define REGVALUE_PRINTER_FILENAME "Printer Filename"
|
|
|
|
#define REGVALUE_PRINTER_APPEND "Append to printer file"
|
|
|
|
#define REGVALUE_PRINTER_IDLE_LIMIT "Printer idle limit"
|
2009-02-14 03:32:24 +00:00
|
|
|
#define REGVALUE_VIDEO_MODE "Video Emulation"
|
|
|
|
#define REGVALUE_VIDEO_HALF_SCAN_LINES "Half Scan Lines"
|
|
|
|
#define REGVALUE_VIDEO_MONO_COLOR "Monochrome Color"
|
2009-10-07 21:38:42 +00:00
|
|
|
#define REGVALUE_SERIAL_PORT_NAME "Serial Port Name"
|
2010-01-17 18:43:06 +00:00
|
|
|
#define REGVALUE_ENHANCE_DISK_SPEED "Enhance Disk Speed"
|
2012-03-20 23:17:06 +00:00
|
|
|
#define REGVALUE_CUSTOM_SPEED "Custom Speed"
|
|
|
|
#define REGVALUE_EMULATION_SPEED "Emulation Speed"
|
2012-12-29 14:53:52 +00:00
|
|
|
#define REGVALUE_WINDOW_SCALE "Window Scale"
|
2012-03-20 23:17:06 +00:00
|
|
|
#define REGVALUE_SLOT1 "Slot 1"
|
|
|
|
#define REGVALUE_SLOT2 "Slot 2"
|
|
|
|
#define REGVALUE_SLOT3 "Slot 3"
|
|
|
|
#define REGVALUE_SLOT4 "Slot 4"
|
|
|
|
#define REGVALUE_SLOT5 "Slot 5"
|
|
|
|
#define REGVALUE_SLOT6 "Slot 6"
|
|
|
|
#define REGVALUE_SLOT7 "Slot 7"
|
|
|
|
#define REGVALUE_SLOTAUX "Slot Auxilary"
|
2013-08-08 21:13:31 +00:00
|
|
|
#define REGVALUE_VERSION "Version"
|
2006-02-25 20:50:29 +00:00
|
|
|
|
2006-06-25 03:41:52 +00:00
|
|
|
// Preferences
|
2010-01-17 18:43:06 +00:00
|
|
|
#define REG_PREFS "Preferences"
|
2008-06-20 23:47:25 +00:00
|
|
|
#define REGVALUE_PREF_START_DIR "Starting Directory"
|
2009-01-06 22:02:31 +00:00
|
|
|
#define REGVALUE_PREF_LAST_DISK_1 "Last Disk Image 1"
|
|
|
|
#define REGVALUE_PREF_LAST_DISK_2 "Last Disk Image 2"
|
2010-01-17 18:43:06 +00:00
|
|
|
#define REGVALUE_PREF_WINDOW_X_POS "Window X-Position"
|
|
|
|
#define REGVALUE_PREF_WINDOW_Y_POS "Window Y-Position"
|
|
|
|
#define REGVALUE_PREF_HDV_START_DIR "HDV Starting Directory"
|
|
|
|
#define REGVALUE_PREF_LAST_HARDDISK_1 "Last Harddisk Image 1"
|
|
|
|
#define REGVALUE_PREF_LAST_HARDDISK_2 "Last Harddisk Image 2"
|
2006-06-25 03:41:52 +00:00
|
|
|
|
2006-02-25 20:50:29 +00:00
|
|
|
#define WM_USER_BENCHMARK WM_USER+1
|
|
|
|
#define WM_USER_RESTART WM_USER+2
|
|
|
|
#define WM_USER_SAVESTATE WM_USER+3
|
|
|
|
#define WM_USER_LOADSTATE WM_USER+4
|
2014-08-25 15:35:43 +00:00
|
|
|
#define VK_SNAPSHOT_560 WM_USER+5 // PrintScreen
|
|
|
|
#define VK_SNAPSHOT_280 WM_USER+6 // PrintScreen+Shift
|
2009-01-26 15:24:40 +00:00
|
|
|
#define WM_USER_TCP_SERIAL WM_USER+7
|
2010-01-17 18:43:06 +00:00
|
|
|
#define WM_USER_BOOT WM_USER+8
|
2012-12-29 14:53:52 +00:00
|
|
|
#define WM_USER_FULLSCREEN WM_USER+9
|
2014-08-25 15:35:43 +00:00
|
|
|
#define VK_SNAPSHOT_TEXT WM_USER+10 // PrintScreen+Ctrl
|
2008-06-20 23:47:25 +00:00
|
|
|
|
2014-02-16 14:39:26 +00:00
|
|
|
// TODO-TC: Refactor codebase by renaming /nCyclesLeft/ to /uExecutedCycles/
|
2007-05-28 11:16:42 +00:00
|
|
|
typedef BYTE (__stdcall *iofunction)(WORD nPC, WORD nAddr, BYTE nWriteFlag, BYTE nWriteValue, ULONG nCyclesLeft);
|
2006-02-25 20:50:29 +00:00
|
|
|
|
2010-01-03 18:43:08 +00:00
|
|
|
typedef struct _IMAGE__ { int unused; } *HIMAGE; // DiskImage's /ImageInfo/ is hidden behind HIMAGE
|
2006-02-25 20:50:29 +00:00
|
|
|
|
2007-08-06 21:38:35 +00:00
|
|
|
enum eIRQSRC {IS_6522=0, IS_SPEECH, IS_SSC, IS_MOUSE};
|
2007-05-28 11:16:42 +00:00
|
|
|
|
|
|
|
//
|
2010-12-14 18:00:10 +00:00
|
|
|
#define APPLE2P_MASK 0x01
|
|
|
|
/*
|
|
|
|
][ 0
|
|
|
|
][+ 1
|
|
|
|
//e 10
|
|
|
|
//e+ 11
|
|
|
|
//c 20
|
|
|
|
//d 40
|
|
|
|
*/
|
2007-05-28 11:16:42 +00:00
|
|
|
#define APPLE2E_MASK 0x10
|
|
|
|
#define APPLE2C_MASK 0x20
|
2010-12-14 18:00:10 +00:00
|
|
|
#define APPLE2D_MASK 0x40
|
2008-06-20 23:47:25 +00:00
|
|
|
#define APPLECLONE_MASK 0x100
|
2007-05-28 11:16:42 +00:00
|
|
|
|
|
|
|
#define IS_APPLE2 ((g_Apple2Type & (APPLE2E_MASK|APPLE2C_MASK)) == 0)
|
|
|
|
#define IS_APPLE2E (g_Apple2Type & APPLE2E_MASK)
|
|
|
|
#define IS_APPLE2C (g_Apple2Type & APPLE2C_MASK)
|
2012-03-20 23:17:06 +00:00
|
|
|
#define IS_CLONE() (g_Apple2Type & APPLECLONE_MASK)
|
2007-05-28 11:16:42 +00:00
|
|
|
|
|
|
|
// NB. These get persisted to the Registry, so don't change the values for these enums!
|
|
|
|
enum eApple2Type {
|
|
|
|
A2TYPE_APPLE2=0,
|
|
|
|
A2TYPE_APPLE2PLUS,
|
|
|
|
A2TYPE_APPLE2E=APPLE2E_MASK,
|
2012-09-16 21:53:07 +00:00
|
|
|
A2TYPE_APPLE2EENHANCED,
|
2008-06-20 23:47:25 +00:00
|
|
|
A2TYPE_UNDEFINED,
|
2010-12-14 18:00:10 +00:00
|
|
|
A2TYPE_APPLE2C=APPLE2C_MASK,
|
|
|
|
A2TYPE_APPLE2D=APPLE2D_MASK,
|
2008-06-20 23:47:25 +00:00
|
|
|
//
|
|
|
|
// Clones start here:
|
|
|
|
A2TYPE_CLONE=APPLECLONE_MASK,
|
2012-03-20 23:17:06 +00:00
|
|
|
A2TYPE_PRAVETS=APPLECLONE_MASK|APPLE2E_MASK,
|
|
|
|
A2TYPE_PRAVETS82=A2TYPE_PRAVETS,
|
2009-01-09 21:59:22 +00:00
|
|
|
A2TYPE_PRAVETS8M,
|
2008-06-20 23:47:25 +00:00
|
|
|
A2TYPE_PRAVETS8A,
|
2007-05-28 11:16:42 +00:00
|
|
|
A2TYPE_MAX
|
2007-08-06 21:38:35 +00:00
|
|
|
};
|
|
|
|
|
2012-05-06 22:14:03 +00:00
|
|
|
inline bool IsApple2(eApple2Type type)
|
|
|
|
{
|
|
|
|
return (type & (APPLE2E_MASK|APPLE2C_MASK)) == 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline bool IsClone(eApple2Type type)
|
|
|
|
{
|
|
|
|
return (type & APPLECLONE_MASK) != 0;
|
|
|
|
}
|
|
|
|
|
2012-09-16 21:53:07 +00:00
|
|
|
extern eApple2Type g_Apple2Type;
|
|
|
|
inline bool IsOriginal2E(void)
|
|
|
|
{
|
|
|
|
return (g_Apple2Type == A2TYPE_APPLE2E);
|
|
|
|
}
|
|
|
|
|
2007-08-06 21:38:35 +00:00
|
|
|
enum eBUTTON {BUTTON0=0, BUTTON1};
|
2008-06-20 23:47:25 +00:00
|
|
|
|
2007-08-06 21:38:35 +00:00
|
|
|
enum eBUTTONSTATE {BUTTON_UP=0, BUTTON_DOWN};
|