2024-03-20 07:41:14 +01:00
|
|
|
/*
|
|
|
|
* Emu48.h
|
|
|
|
*
|
|
|
|
* This file is part of Emu48
|
|
|
|
*
|
|
|
|
* Copyright (C) 1995 Sebastien Carlier
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
#include "types.h"
|
|
|
|
|
2024-03-20 07:46:29 +01:00
|
|
|
#define _KB(a) ((a)*2*1024)
|
|
|
|
|
2024-03-20 07:41:14 +01:00
|
|
|
#define HARDWARE "Yorke" // emulator hardware
|
|
|
|
#define MODELS "26AEGPQSX" // valid calculator models
|
2024-03-20 07:46:28 +01:00
|
|
|
#define APPLEHARD "2PQ" // Apple platform calculator models
|
2024-03-20 07:41:14 +01:00
|
|
|
|
|
|
|
#define ARRAYSIZEOF(a) (sizeof(a) / sizeof(a[0]))
|
|
|
|
|
|
|
|
// cards status
|
|
|
|
#define PORT1_PRESENT ((cCurrentRomType=='S')?P1C:P2C)
|
|
|
|
#define PORT1_WRITE ((cCurrentRomType=='S')?P1W:P2W)
|
|
|
|
#define PORT2_PRESENT ((cCurrentRomType=='S')?P2C:P1C)
|
|
|
|
#define PORT2_WRITE ((cCurrentRomType=='S')?P2W:P1W)
|
|
|
|
|
2024-03-20 07:46:28 +01:00
|
|
|
#define BINARYHEADER48 "HPHP48-W"
|
|
|
|
#define BINARYHEADER49 "HPHP49-W"
|
2024-03-20 07:41:14 +01:00
|
|
|
|
2024-03-20 07:46:27 +01:00
|
|
|
#define BIN_FILTER "Port Data File (*.BIN)\0*.BIN\0All Files (*.*)\0*.*\0"
|
|
|
|
#define HP_FILTER "HP Binary Object (*.HP;*.LIB)\0*.HP;*.LIB\0All Files (*.*)\0*.*\0"
|
|
|
|
|
2024-03-20 07:41:14 +01:00
|
|
|
#define CF_HPOBJ "CF_HPOBJ" // clipboard format for DDE
|
|
|
|
|
|
|
|
#define SM_RUN 0 // states of cpu emulation thread
|
|
|
|
#define SM_INVALID 1
|
|
|
|
#define SM_RETURN 2
|
|
|
|
#define SM_SLEEP 3
|
|
|
|
|
2024-03-20 07:46:28 +01:00
|
|
|
#define S_ERR_NO 0 // stack errorcodes
|
2024-03-20 07:46:27 +01:00
|
|
|
#define S_ERR_OBJECT 1
|
2024-03-20 07:46:28 +01:00
|
|
|
#define S_ERR_BINARY 2
|
|
|
|
#define S_ERR_ASCII 3
|
2024-03-20 07:46:27 +01:00
|
|
|
|
|
|
|
#define BAD_OB (0xFFFFFFFF) // bad object
|
2024-03-20 07:41:14 +01:00
|
|
|
|
2024-03-20 07:46:28 +01:00
|
|
|
#define NO_SERIAL "disabled" // port not open
|
2024-03-20 07:41:14 +01:00
|
|
|
|
|
|
|
#define HP_MNEMONICS FALSE // disassembler mnenomics mode
|
|
|
|
#define CLASS_MNEMONICS TRUE
|
|
|
|
|
|
|
|
#define MACRO_OFF 0 // macro recorder off
|
|
|
|
#define MACRO_NEW 1
|
|
|
|
#define MACRO_PLAY 2
|
|
|
|
|
|
|
|
#define DISP_POINTER 0x01 // defines for display area
|
|
|
|
#define DISP_MAIN 0x02
|
|
|
|
#define DISP_MENUE 0x04
|
|
|
|
|
2024-03-20 07:46:28 +01:00
|
|
|
#define ROMPAGESIZE (1<<12) // ROM dirty page size in nibbles
|
|
|
|
|
2024-03-20 07:46:28 +01:00
|
|
|
// window styles
|
|
|
|
#define STYLE_TITLE (WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX|WS_OVERLAPPED)
|
2024-03-20 07:46:28 +01:00
|
|
|
#define STYLE_NOTITLE (WS_POPUP|WS_SYSMENU|WS_MINIMIZEBOX|WS_CLIPSIBLINGS)
|
2024-03-20 07:46:28 +01:00
|
|
|
|
2024-03-20 07:46:28 +01:00
|
|
|
// WM_COPYDATA identifier
|
|
|
|
#define CDID_FILENAME 1 // send file name
|
|
|
|
|
2024-03-20 07:41:14 +01:00
|
|
|
// macro to check for valid calculator model
|
|
|
|
#define isModelValid(m) (m != 0 && strchr(MODELS,m) != NULL)
|
2024-03-20 07:46:28 +01:00
|
|
|
#define isModelApple(m) (m != 0 && strchr(APPLEHARD,m) != NULL)
|
2024-03-20 07:41:14 +01:00
|
|
|
|
|
|
|
// values for mapping area
|
|
|
|
enum MMUMAP { M_IO, M_ROM, M_RAM, M_P1, M_P2, M_BS };
|
|
|
|
|
2024-03-20 07:46:28 +01:00
|
|
|
// values for disassembler memory mapping modes
|
|
|
|
enum MEM_MAPPING { MEM_MMU, MEM_NCE1, MEM_NCE2, MEM_CE1, MEM_CE2, MEM_NCE3 };
|
|
|
|
|
2024-03-20 07:46:29 +01:00
|
|
|
// Kermit CRC calculation
|
|
|
|
static __inline WORD UpCRC(WORD wCRC, BYTE nib) { return (wCRC >> 4) ^ (((wCRC ^ nib) & 0xf) * 0x1081); }
|
|
|
|
|
2024-03-20 07:41:14 +01:00
|
|
|
// Emu48.c
|
|
|
|
extern HPALETTE hPalette;
|
|
|
|
extern HPALETTE hOldPalette;
|
|
|
|
extern HANDLE hEventShutdn;
|
|
|
|
extern LPTSTR szAppName;
|
|
|
|
extern LPTSTR szTopic;
|
|
|
|
extern LPTSTR szTitle;
|
|
|
|
extern CRITICAL_SECTION csGDILock;
|
|
|
|
extern CRITICAL_SECTION csLcdLock;
|
|
|
|
extern CRITICAL_SECTION csKeyLock;
|
|
|
|
extern CRITICAL_SECTION csIOLock;
|
|
|
|
extern CRITICAL_SECTION csT1Lock;
|
|
|
|
extern CRITICAL_SECTION csT2Lock;
|
|
|
|
extern CRITICAL_SECTION csTxdLock;
|
|
|
|
extern CRITICAL_SECTION csRecvLock;
|
|
|
|
extern CRITICAL_SECTION csSlowLock;
|
2024-03-20 07:46:28 +01:00
|
|
|
extern CRITICAL_SECTION csDbgLock;
|
2024-03-20 07:41:14 +01:00
|
|
|
extern INT nArgc;
|
|
|
|
extern LPCTSTR *ppArgv;
|
|
|
|
extern LARGE_INTEGER lFreq;
|
|
|
|
extern LARGE_INTEGER lAppStart;
|
|
|
|
extern DWORD idDdeInst;
|
|
|
|
extern UINT uCF_HpObj;
|
|
|
|
extern HINSTANCE hApp;
|
|
|
|
extern HWND hWnd;
|
|
|
|
extern HWND hDlgDebug;
|
2024-03-20 07:46:28 +01:00
|
|
|
extern HWND hDlgFind;
|
|
|
|
extern HWND hDlgProfile;
|
2024-03-20 07:46:28 +01:00
|
|
|
extern HWND hDlgRplObjView;
|
2024-03-20 07:41:14 +01:00
|
|
|
extern HDC hWindowDC;
|
2024-03-20 07:46:28 +01:00
|
|
|
extern DWORD dwTColor;
|
|
|
|
extern DWORD dwTColorTol;
|
|
|
|
extern HRGN hRgn;
|
2024-03-20 07:46:28 +01:00
|
|
|
extern HCURSOR hCursorArrow;
|
|
|
|
extern HCURSOR hCursorHand;
|
|
|
|
extern UINT uWaveDevId;
|
2024-03-20 07:46:28 +01:00
|
|
|
extern DWORD dwWakeupDelay;
|
2024-03-20 07:41:14 +01:00
|
|
|
extern BOOL bAutoSave;
|
|
|
|
extern BOOL bAutoSaveOnExit;
|
|
|
|
extern BOOL bSaveDefConfirm;
|
2024-03-20 07:46:27 +01:00
|
|
|
extern BOOL bStartupBackup;
|
2024-03-20 07:41:14 +01:00
|
|
|
extern BOOL bAlwaysDisplayLog;
|
|
|
|
extern BOOL bLoadObjectWarning;
|
2024-03-20 07:46:28 +01:00
|
|
|
extern BOOL bShowTitle;
|
|
|
|
extern BOOL bShowMenu;
|
2024-03-20 07:46:27 +01:00
|
|
|
extern BOOL bAlwaysOnTop;
|
|
|
|
extern BOOL bActFollowsMouse;
|
2024-03-20 07:46:28 +01:00
|
|
|
extern BOOL bClientWinMove;
|
2024-03-20 07:46:28 +01:00
|
|
|
extern BOOL bSingleInstance;
|
2024-03-20 07:41:14 +01:00
|
|
|
extern HANDLE hThread;
|
|
|
|
extern VOID SetWindowTitle(LPCTSTR szString);
|
2024-03-20 07:46:27 +01:00
|
|
|
extern VOID ForceForegroundWindow(HWND hWnd);
|
2024-03-20 07:46:28 +01:00
|
|
|
extern VOID CopyItemsToClipboard(HWND hWnd);
|
2024-03-20 07:41:14 +01:00
|
|
|
|
2024-03-20 07:46:28 +01:00
|
|
|
// mru.c
|
2024-03-20 07:46:28 +01:00
|
|
|
extern BOOL MruInit(UINT nNum);
|
2024-03-20 07:46:28 +01:00
|
|
|
extern VOID MruCleanup(VOID);
|
|
|
|
extern VOID MruAdd(LPCTSTR lpszEntry);
|
2024-03-20 07:46:28 +01:00
|
|
|
extern VOID MruRemove(UINT nIndex);
|
|
|
|
extern VOID MruMoveTop(UINT nIndex);
|
|
|
|
extern UINT MruEntries(VOID);
|
2024-03-20 07:46:29 +01:00
|
|
|
extern UINT MruID(LPCTSTR lpszEntry);
|
|
|
|
extern VOID MruFilename(UINT nIndex, LPTSTR szFilename, UINT nBuffersize);
|
2024-03-20 07:46:28 +01:00
|
|
|
extern VOID MruUpdateMenu(HMENU hMenu);
|
2024-03-20 07:46:28 +01:00
|
|
|
extern VOID MruWriteList(VOID);
|
|
|
|
extern VOID MruReadList(VOID);
|
|
|
|
|
2024-03-20 07:41:14 +01:00
|
|
|
// Settings.c
|
|
|
|
extern VOID ReadSettings(VOID);
|
|
|
|
extern VOID WriteSettings(VOID);
|
|
|
|
extern VOID ReadLastDocument(LPTSTR szFileName, DWORD nSize);
|
|
|
|
extern VOID WriteLastDocument(LPCTSTR szFilename);
|
2024-03-20 07:46:27 +01:00
|
|
|
extern VOID ReadSettingsString(LPCTSTR lpszSection, LPCTSTR lpszEntry, LPCTSTR lpDefault, LPTSTR lpData, DWORD dwSize);
|
|
|
|
extern VOID WriteSettingsString(LPCTSTR lpszSection, LPCTSTR lpszEntry, LPTSTR lpData);
|
|
|
|
extern INT ReadSettingsInt(LPCTSTR lpszSection, LPCTSTR lpszEntry, INT nDefault);
|
|
|
|
extern VOID WriteSettingsInt(LPCTSTR lpszSection, LPCTSTR lpszEntry, INT nValue);
|
|
|
|
extern VOID DelSettingsKey(LPCTSTR lpszSection, LPCTSTR lpszEntry);
|
2024-03-20 07:41:14 +01:00
|
|
|
|
|
|
|
// Display.c
|
2024-03-20 07:46:28 +01:00
|
|
|
extern BOOL bGrayscale;
|
|
|
|
extern UINT nBackgroundX;
|
|
|
|
extern UINT nBackgroundY;
|
|
|
|
extern UINT nBackgroundW;
|
|
|
|
extern UINT nBackgroundH;
|
|
|
|
extern UINT nLcdX;
|
|
|
|
extern UINT nLcdY;
|
|
|
|
extern UINT nLcdZoom;
|
|
|
|
extern UINT nGdiXZoom;
|
|
|
|
extern UINT nGdiYZoom;
|
|
|
|
extern HDC hLcdDC;
|
|
|
|
extern HDC hMainDC;
|
|
|
|
extern HDC hAnnunDC;
|
|
|
|
extern BYTE (*GetLineCounter)(VOID);
|
|
|
|
extern VOID (*StartDisplay)(BYTE byInitial);
|
|
|
|
extern VOID (*StopDisplay)(VOID);
|
|
|
|
extern VOID UpdateContrast(BYTE byContrast);
|
|
|
|
extern VOID SetLcdColor(UINT nId, UINT nRed, UINT nGreen, UINT nBlue);
|
|
|
|
extern VOID SetLcdMode(BOOL bMode);
|
|
|
|
extern VOID CreateLcdBitmap(VOID);
|
|
|
|
extern VOID DestroyLcdBitmap(VOID);
|
|
|
|
extern BOOL CreateMainBitmap(LPCTSTR szFilename);
|
|
|
|
extern VOID DestroyMainBitmap(VOID);
|
|
|
|
extern BOOL CreateAnnunBitmap(LPCTSTR szFilename);
|
|
|
|
extern VOID DestroyAnnunBitmap(VOID);
|
|
|
|
extern VOID UpdateDisplayPointers(VOID);
|
|
|
|
extern VOID UpdateMainDisplay(VOID);
|
|
|
|
extern VOID UpdateMenuDisplay(VOID);
|
|
|
|
extern VOID RefreshDisp0(); // CdB for HP: add apples display management
|
|
|
|
extern VOID WriteToMainDisplay(LPBYTE a, DWORD d, UINT s);
|
|
|
|
extern VOID WriteToMenuDisplay(LPBYTE a, DWORD d, UINT s);
|
2024-03-20 07:46:28 +01:00
|
|
|
extern VOID UpdateAnnunciators(DWORD dwUpdateMask);
|
2024-03-20 07:46:28 +01:00
|
|
|
extern VOID ResizeWindow(VOID);
|
2024-03-20 07:41:14 +01:00
|
|
|
|
|
|
|
// Engine.c
|
|
|
|
extern BOOL bInterrupt;
|
|
|
|
extern UINT nState;
|
|
|
|
extern UINT nNextState;
|
2024-03-20 07:46:28 +01:00
|
|
|
extern BOOL bEnableSlow;
|
2024-03-20 07:41:14 +01:00
|
|
|
extern BOOL bRealSpeed;
|
|
|
|
extern BOOL bKeySlow;
|
2024-03-20 07:46:28 +01:00
|
|
|
extern BOOL bSoundSlow;
|
2024-03-20 07:46:28 +01:00
|
|
|
extern UINT nOpcSlow;
|
2024-03-20 07:41:14 +01:00
|
|
|
extern CHIPSET Chipset;
|
|
|
|
extern TCHAR szSerialWire[16];
|
|
|
|
extern TCHAR szSerialIr[16];
|
|
|
|
extern DWORD dwSXCycles;
|
|
|
|
extern DWORD dwGXCycles;
|
|
|
|
extern DWORD dwGPCycles; // CdB for HP: add apples speed
|
|
|
|
extern DWORD dwG2Cycles; // CdB for HP: add apples speed
|
2024-03-20 07:46:28 +01:00
|
|
|
extern DWORD dwT2Cycles;
|
2024-03-20 07:41:14 +01:00
|
|
|
extern HANDLE hEventDebug;
|
|
|
|
extern BOOL bDbgAutoStateCtrl;
|
|
|
|
extern INT nDbgState;
|
|
|
|
extern BOOL bDbgNOP3;
|
|
|
|
extern BOOL bDbgCode;
|
|
|
|
extern BOOL bDbgRPL;
|
|
|
|
extern BOOL bDbgSkipInt;
|
|
|
|
extern DWORD dwDbgStopPC;
|
|
|
|
extern DWORD dwDbgRplPC;
|
|
|
|
extern DWORD dwDbgRstkp;
|
|
|
|
extern DWORD dwDbgRstk;
|
|
|
|
extern DWORD *pdwInstrArray;
|
|
|
|
extern WORD wInstrSize;
|
|
|
|
extern WORD wInstrWp;
|
|
|
|
extern WORD wInstrRp;
|
2024-03-20 07:46:28 +01:00
|
|
|
extern VOID (*fnOutTrace)(VOID);
|
2024-03-20 07:41:14 +01:00
|
|
|
extern VOID SuspendDebugger(VOID);
|
|
|
|
extern VOID ResumeDebugger(VOID);
|
|
|
|
extern VOID CheckSerial(VOID);
|
2024-03-20 07:46:28 +01:00
|
|
|
extern VOID InitAdjustSpeed(VOID);
|
2024-03-20 07:41:14 +01:00
|
|
|
extern VOID AdjKeySpeed(VOID);
|
|
|
|
extern VOID SetSpeed(BOOL bAdjust);
|
|
|
|
extern VOID UpdateKdnBit(VOID);
|
|
|
|
extern BOOL WaitForSleepState(VOID);
|
|
|
|
extern UINT SwitchToState(UINT nNewState);
|
|
|
|
extern UINT WorkerThread(LPVOID pParam);
|
|
|
|
|
|
|
|
// Fetch.c
|
|
|
|
extern VOID EvalOpcode(LPBYTE I);
|
|
|
|
|
|
|
|
// Files.c
|
|
|
|
extern TCHAR szEmuDirectory[MAX_PATH];
|
2024-03-20 07:46:27 +01:00
|
|
|
extern TCHAR szRomDirectory[MAX_PATH];
|
2024-03-20 07:41:14 +01:00
|
|
|
extern TCHAR szCurrentDirectory[MAX_PATH];
|
|
|
|
extern TCHAR szCurrentKml[MAX_PATH];
|
|
|
|
extern TCHAR szBackupKml[MAX_PATH];
|
|
|
|
extern TCHAR szCurrentFilename[MAX_PATH];
|
|
|
|
extern TCHAR szBackupFilename[MAX_PATH];
|
|
|
|
extern TCHAR szBufferFilename[MAX_PATH];
|
|
|
|
extern TCHAR szPort2Filename[MAX_PATH];
|
2024-03-20 07:46:28 +01:00
|
|
|
extern BOOL bDocumentAvail;
|
2024-03-20 07:41:14 +01:00
|
|
|
extern BYTE cCurrentRomType;
|
|
|
|
extern UINT nCurrentClass;
|
2024-03-20 07:46:28 +01:00
|
|
|
extern LPBYTE Port0;
|
|
|
|
extern LPBYTE Port1;
|
|
|
|
extern LPBYTE Port2;
|
2024-03-20 07:46:27 +01:00
|
|
|
extern LPBYTE pbyRom;
|
2024-03-20 07:41:14 +01:00
|
|
|
extern BOOL bRomWriteable;
|
2024-03-20 07:46:27 +01:00
|
|
|
extern DWORD dwRomSize;
|
2024-03-20 07:46:28 +01:00
|
|
|
extern LPBYTE pbyRomDirtyPage;
|
|
|
|
extern DWORD dwRomDirtyPageSize;
|
2024-03-20 07:46:27 +01:00
|
|
|
extern WORD wRomCrc;
|
2024-03-20 07:46:29 +01:00
|
|
|
extern BOOL bRomCrcCorrection;
|
2024-03-20 07:41:14 +01:00
|
|
|
extern LPBYTE pbyPort2;
|
|
|
|
extern BOOL bPort2Writeable;
|
|
|
|
extern BOOL bPort2IsShared;
|
|
|
|
extern DWORD dwPort2Size;
|
|
|
|
extern DWORD dwPort2Mask;
|
2024-03-20 07:46:27 +01:00
|
|
|
extern WORD wPort2Crc;
|
2024-03-20 07:41:14 +01:00
|
|
|
extern BOOL bBackup;
|
|
|
|
extern VOID SetWindowLocation(HWND hWnd,INT nPosX,INT nPosY);
|
|
|
|
extern DWORD GetCutPathName(LPCTSTR szFileName,LPTSTR szBuffer,DWORD dwBufferLength,INT nCutLength);
|
|
|
|
extern VOID SetWindowPathTitle(LPCTSTR szFileName);
|
2024-03-20 07:46:28 +01:00
|
|
|
extern BOOL CheckForBeepPatch(VOID);
|
2024-03-20 07:46:29 +01:00
|
|
|
extern BOOL PatchNibble(DWORD dwAddress, BYTE byPatch);
|
2024-03-20 07:41:14 +01:00
|
|
|
extern VOID UpdatePatches(BOOL bPatch);
|
|
|
|
extern BOOL PatchRom(LPCTSTR szFilename);
|
2024-03-20 07:46:27 +01:00
|
|
|
extern BOOL CrcRom(WORD *pwChk);
|
2024-03-20 07:41:14 +01:00
|
|
|
extern BOOL MapRom(LPCTSTR szFilename);
|
|
|
|
extern VOID UnmapRom(VOID);
|
|
|
|
extern BOOL MapPort2(LPCTSTR szFilename);
|
|
|
|
extern VOID UnmapPort2(VOID);
|
|
|
|
extern VOID ResetDocument(VOID);
|
|
|
|
extern BOOL NewDocument(VOID);
|
|
|
|
extern BOOL OpenDocument(LPCTSTR szFilename);
|
|
|
|
extern BOOL SaveDocument(VOID);
|
|
|
|
extern BOOL SaveDocumentAs(LPCTSTR szFilename);
|
|
|
|
extern BOOL SaveBackup(VOID);
|
|
|
|
extern BOOL RestoreBackup(VOID);
|
|
|
|
extern BOOL ResetBackup(VOID);
|
|
|
|
extern BOOL GetOpenFilename(VOID);
|
|
|
|
extern BOOL GetSaveAsFilename(VOID);
|
2024-03-20 07:46:27 +01:00
|
|
|
extern BOOL GetLoadObjectFilename(LPCTSTR lpstrFilter,LPCTSTR lpstrDefExt);
|
|
|
|
extern BOOL GetSaveObjectFilename(LPCTSTR lpstrFilter,LPCTSTR lpstrDefExt);
|
2024-03-20 07:41:14 +01:00
|
|
|
extern WORD WriteStack(UINT nStkLevel,LPBYTE lpBuf,DWORD dwSize);
|
|
|
|
extern BOOL LoadObject(LPCTSTR szFilename);
|
|
|
|
extern BOOL SaveObject(LPCTSTR szFilename);
|
2024-03-20 07:46:28 +01:00
|
|
|
extern BOOL LoadIconFromFile(LPCTSTR szFilename);
|
|
|
|
extern VOID LoadIconDefault(VOID);
|
2024-03-20 07:46:28 +01:00
|
|
|
extern HBITMAP LoadBitmapFile(LPCTSTR szFilename,BOOL bPalette);
|
2024-03-20 07:46:28 +01:00
|
|
|
extern HRGN CreateRgnFromBitmap(HBITMAP hBmp,COLORREF color,DWORD dwTol);
|
2024-03-20 07:41:14 +01:00
|
|
|
|
2024-03-20 07:46:29 +01:00
|
|
|
// Romcrc.c
|
|
|
|
extern VOID RebuildRomCrc(VOID);
|
|
|
|
|
2024-03-20 07:41:14 +01:00
|
|
|
// Timer.c
|
|
|
|
extern VOID SetHP48Time(VOID);
|
|
|
|
extern VOID StartTimers(VOID);
|
|
|
|
extern VOID StopTimers(VOID);
|
|
|
|
extern DWORD ReadT2(VOID);
|
|
|
|
extern VOID SetT2(DWORD dwValue);
|
|
|
|
extern BYTE ReadT1(VOID);
|
|
|
|
extern VOID SetT1(BYTE byValue);
|
|
|
|
|
|
|
|
// Mops.c
|
|
|
|
extern BOOL bFlashRomArray;
|
|
|
|
extern BYTE disp;
|
|
|
|
extern LPBYTE RMap[256];
|
|
|
|
extern LPBYTE WMap[256];
|
2024-03-20 07:46:27 +01:00
|
|
|
extern DWORD FlashROMAddr(DWORD d);
|
2024-03-20 07:41:14 +01:00
|
|
|
extern VOID Map(BYTE a, BYTE b);
|
|
|
|
extern VOID RomSwitch(DWORD adr);
|
|
|
|
extern VOID Config(VOID);
|
|
|
|
extern VOID Uncnfg(VOID);
|
|
|
|
extern VOID Reset(VOID);
|
|
|
|
extern VOID C_Eq_Id(VOID);
|
|
|
|
extern enum MMUMAP MapData(DWORD d);
|
|
|
|
extern VOID CpuReset(VOID);
|
|
|
|
extern VOID Npeek(BYTE *a, DWORD d, UINT s);
|
|
|
|
extern VOID Nread(BYTE *a, DWORD d, UINT s);
|
|
|
|
extern VOID Nwrite(BYTE *a, DWORD d, UINT s);
|
|
|
|
extern BYTE Read2(DWORD d);
|
|
|
|
extern DWORD Read5(DWORD d);
|
|
|
|
extern VOID Write5(DWORD d, DWORD n);
|
|
|
|
extern VOID Write2(DWORD d, BYTE n);
|
|
|
|
extern VOID IOBit(DWORD d, BYTE b, BOOL s);
|
|
|
|
extern VOID ReadIO(BYTE *a, DWORD b, DWORD s, BOOL bUpdate);
|
|
|
|
extern VOID WriteIO(BYTE *a, DWORD b, DWORD s);
|
|
|
|
|
2024-03-20 07:46:28 +01:00
|
|
|
// Lowbat.c
|
|
|
|
extern BOOL bLowBatDisable;
|
|
|
|
extern VOID StartBatMeasure(VOID);
|
|
|
|
extern VOID StopBatMeasure(VOID);
|
|
|
|
extern VOID GetBatteryState(BOOL *pbLBI, BOOL *pbVLBI);
|
|
|
|
|
2024-03-20 07:41:14 +01:00
|
|
|
// Keyboard.c
|
2024-03-20 07:46:28 +01:00
|
|
|
extern DWORD dwKeyMinDelay;
|
2024-03-20 07:46:28 +01:00
|
|
|
extern VOID ScanKeyboard(BOOL bActive, BOOL bReset);
|
|
|
|
extern VOID KeyboardEvent(BOOL bPress, UINT out, UINT in);
|
2024-03-20 07:41:14 +01:00
|
|
|
|
|
|
|
// Keymacro.c
|
|
|
|
extern INT nMacroState;
|
|
|
|
extern INT nMacroTimeout;
|
|
|
|
extern BOOL bMacroRealSpeed;
|
2024-03-20 07:46:28 +01:00
|
|
|
extern DWORD dwMacroMinDelay;
|
2024-03-20 07:41:14 +01:00
|
|
|
extern VOID KeyMacroRecord(BOOL bPress, UINT out, UINT in);
|
|
|
|
extern LRESULT OnToolMacroNew(VOID);
|
|
|
|
extern LRESULT OnToolMacroPlay(VOID);
|
|
|
|
extern LRESULT OnToolMacroStop(VOID);
|
|
|
|
extern LRESULT OnToolMacroSettings(VOID);
|
|
|
|
|
2024-03-20 07:46:28 +01:00
|
|
|
// Redeye.c
|
2024-03-20 07:46:28 +01:00
|
|
|
extern VOID IrPrinter(BYTE c);
|
|
|
|
|
2024-03-20 07:46:28 +01:00
|
|
|
// Udp.c
|
2024-03-20 07:46:28 +01:00
|
|
|
extern TCHAR szUdpServer[1024];
|
|
|
|
extern WORD wUdpPort;
|
|
|
|
extern VOID ResetUdp(VOID);
|
|
|
|
extern BOOL SendByteUdp(BYTE byData);
|
|
|
|
|
2024-03-20 07:41:14 +01:00
|
|
|
// Stack.c
|
2024-03-20 07:46:28 +01:00
|
|
|
extern BOOL bDetectClpObject;
|
2024-03-20 07:41:14 +01:00
|
|
|
extern LRESULT OnStackCopy(VOID);
|
|
|
|
extern LRESULT OnStackPaste(VOID);
|
|
|
|
|
|
|
|
// RPL.c
|
|
|
|
extern BOOL RPL_GetSystemFlag(INT nFlag);
|
|
|
|
extern DWORD RPL_SkipOb(DWORD d);
|
2024-03-20 07:46:27 +01:00
|
|
|
extern DWORD RPL_ObjectSize(BYTE *o,DWORD s);
|
|
|
|
extern DWORD RPL_CreateTemp(DWORD l,BOOL bGarbageCol);
|
2024-03-20 07:41:14 +01:00
|
|
|
extern UINT RPL_Depth(VOID);
|
|
|
|
extern DWORD RPL_Pick(UINT l);
|
|
|
|
extern VOID RPL_Replace(DWORD n);
|
|
|
|
extern VOID RPL_Push(UINT l,DWORD n);
|
|
|
|
|
2024-03-20 07:46:28 +01:00
|
|
|
// SndEnum.c
|
|
|
|
extern VOID SetSoundDeviceList(HWND hWnd,UINT uDeviceID);
|
2024-03-20 07:41:14 +01:00
|
|
|
|
2024-03-20 07:46:28 +01:00
|
|
|
// Sound.c
|
2024-03-20 07:46:28 +01:00
|
|
|
extern DWORD dwWaveVol;
|
|
|
|
extern DWORD dwWaveTime;
|
|
|
|
extern BOOL SoundAvailable(UINT uDeviceID);
|
|
|
|
extern BOOL SoundGetDeviceID(UINT *puDeviceID);
|
|
|
|
extern BOOL SoundOpen(UINT uDeviceID);
|
|
|
|
extern VOID SoundClose(VOID);
|
|
|
|
extern VOID SoundOut(CHIPSET* w, WORD wOut);
|
|
|
|
extern VOID SoundBeep(DWORD dwFrequency, DWORD dwDuration);
|
2024-03-20 07:46:28 +01:00
|
|
|
|
2024-03-20 07:41:14 +01:00
|
|
|
// DDEserv.c
|
|
|
|
extern HDDEDATA CALLBACK DdeCallback(UINT, UINT, HCONV, HSZ, HSZ, HDDEDATA, DWORD, DWORD);
|
|
|
|
|
2024-03-20 07:46:28 +01:00
|
|
|
// Dismem.c
|
|
|
|
extern BOOL SetMemRomType(BYTE cCurrentRomType);
|
|
|
|
extern BOOL SetMemMapType(enum MEM_MAPPING eType);
|
|
|
|
extern enum MEM_MAPPING GetMemMapType(VOID);
|
|
|
|
extern BOOL GetMemAvail(enum MEM_MAPPING eType);
|
|
|
|
extern DWORD GetMemDataSize(VOID);
|
|
|
|
extern DWORD GetMemDataMask(VOID);
|
|
|
|
extern BYTE GetMemNib(DWORD *p);
|
|
|
|
extern VOID GetMemPeek(BYTE *a, DWORD d, UINT s);
|
|
|
|
|
2024-03-20 07:41:14 +01:00
|
|
|
// Disasm.c
|
|
|
|
extern BOOL disassembler_mode;
|
2024-03-20 07:46:28 +01:00
|
|
|
extern BOOL disassembler_symb;
|
|
|
|
extern DWORD disassemble(DWORD addr, LPTSTR out);
|
|
|
|
|
|
|
|
// Symbfile.c
|
2024-03-20 07:46:28 +01:00
|
|
|
extern BOOL RplTableEmpty(VOID);
|
|
|
|
extern BOOL RplLoadTable(LPCTSTR lpszFilename);
|
|
|
|
extern VOID RplDeleteTable(VOID);
|
|
|
|
extern LPCTSTR RplGetName(DWORD dwAddr);
|
|
|
|
extern BOOL RplGetAddr(LPCTSTR lpszName, DWORD *pdwAddr);
|
2024-03-20 07:41:14 +01:00
|
|
|
|
|
|
|
// Serial.c
|
2024-03-20 07:46:29 +01:00
|
|
|
extern BOOL CommIsOpen(VOID);
|
2024-03-20 07:41:14 +01:00
|
|
|
extern BOOL CommOpen(LPTSTR strWirePort,LPTSTR strIrPort);
|
|
|
|
extern VOID CommClose(VOID);
|
|
|
|
extern VOID CommSetBaud(VOID);
|
|
|
|
extern BOOL UpdateUSRQ(VOID);
|
|
|
|
extern VOID CommTxBRK(VOID);
|
|
|
|
extern VOID CommTransmit(VOID);
|
|
|
|
extern VOID CommReceive(VOID);
|
|
|
|
|
|
|
|
// Cursor.c
|
|
|
|
extern HCURSOR CreateHandCursor(VOID);
|
|
|
|
|
2024-03-20 07:46:28 +01:00
|
|
|
#if defined _USRDLL // DLL version
|
2024-03-20 07:41:14 +01:00
|
|
|
// Emu48dll.c
|
|
|
|
extern VOID (CALLBACK *pEmuDocumentNotify)(LPCTSTR lpszFilename);
|
|
|
|
extern BOOL DLLCreateWnd(LPCTSTR lpszFilename, LPCTSTR lpszPort2Name);
|
|
|
|
extern BOOL DLLDestroyWnd(VOID);
|
2024-03-20 07:46:28 +01:00
|
|
|
|
|
|
|
// Symbfile.c
|
|
|
|
#define RplGetName(a) NULL // for linking
|
2024-03-20 07:41:14 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
// Message Boxes
|
|
|
|
static __inline int InfoMessage(LPCTSTR szMessage) {return MessageBox(hWnd, szMessage, szTitle, MB_APPLMODAL|MB_OK|MB_ICONINFORMATION|MB_SETFOREGROUND);}
|
|
|
|
static __inline int AbortMessage(LPCTSTR szMessage) {return MessageBox(hWnd, szMessage, szTitle, MB_APPLMODAL|MB_OK|MB_ICONSTOP|MB_SETFOREGROUND);}
|
|
|
|
static __inline int YesNoMessage(LPCTSTR szMessage) {return MessageBox(hWnd, szMessage, szTitle, MB_APPLMODAL|MB_YESNO|MB_ICONEXCLAMATION|MB_SETFOREGROUND);}
|
|
|
|
static __inline int YesNoCancelMessage(LPCTSTR szMessage,UINT uStyle) {return MessageBox(hWnd, szMessage, szTitle, MB_APPLMODAL|MB_YESNOCANCEL|MB_ICONEXCLAMATION|MB_SETFOREGROUND|uStyle);}
|
|
|
|
|
|
|
|
// Missing Win32 API calls
|
|
|
|
static __inline LPTSTR DuplicateString(LPCTSTR szString)
|
|
|
|
{
|
|
|
|
UINT uLength = lstrlen(szString) + 1;
|
2024-03-20 07:46:28 +01:00
|
|
|
LPTSTR szDup = (LPTSTR) malloc(uLength*sizeof(szDup[0]));
|
2024-03-20 07:41:14 +01:00
|
|
|
lstrcpy(szDup,szString);
|
|
|
|
return szDup;
|
|
|
|
}
|
|
|
|
|
|
|
|
#define SCREENHEIGHT (cCurrentRomType=='Q' ? 80 : 64) // CdB for HP: add apples display management
|
|
|
|
#define SCREENHEIGHTREAL ((cCurrentRomType=='Q') ? (80-Chipset.d0size) : 64)
|
|
|
|
#define MAINSCREENHEIGHT (((Chipset.lcounter) == 0) ? SCREENHEIGHTREAL : SCREENHEIGHTREAL-64+((Chipset.lcounter)+1))
|
|
|
|
#define MENUHEIGHT (Chipset.lcounter==0?0:64-(Chipset.lcounter+1))
|