From 35f176e4d8a95c816ef9bf0dde528728b9ef93eb Mon Sep 17 00:00:00 2001 From: Andrea Date: Sat, 21 Dec 2024 12:32:00 +0000 Subject: [PATCH] Replace DWORD -> uint32_t. (PR #1350) Some have been left where tightly coupled with the Win32 API. --- source/CPU.cpp | 8 +-- source/CPU.h | 2 +- source/CPU/cpu6502.h | 2 +- source/CPU/cpu65C02.h | 2 +- source/Common.h | 2 +- source/Configuration/IPropertySheet.h | 2 +- source/Configuration/PageAdvanced.cpp | 4 +- source/Configuration/PageAdvanced.h | 2 +- source/Configuration/PageConfig.cpp | 10 ++-- source/Configuration/PageConfig.h | 2 +- source/Configuration/PageDisk.cpp | 16 +++--- source/Configuration/PageInput.cpp | 10 ++-- source/Configuration/PageSound.cpp | 8 +-- source/Configuration/PageSound.h | 2 +- source/Configuration/PropertySheet.cpp | 2 +- source/Configuration/PropertySheet.h | 2 +- source/Core.cpp | 10 ++-- source/Core.h | 4 +- source/Debugger/Debug.cpp | 22 ++++----- source/Debugger/Debug.h | 2 +- source/Debugger/Debugger_Assembler.cpp | 2 +- source/Debugger/Debugger_Color.cpp | 2 +- source/Debugger/Debugger_Disassembler.cpp | 4 +- source/Debugger/Debugger_Display.cpp | 4 +- source/Debugger/Debugger_Symbols.cpp | 2 +- source/Debugger/Debugger_Types.h | 2 +- source/Disk.h | 4 +- source/DiskImage.cpp | 2 +- source/DiskImageHelper.cpp | 60 +++++++++++------------ source/DiskImageHelper.h | 40 +++++++-------- source/FrameBase.cpp | 6 +-- source/FrameBase.h | 8 +-- source/Harddisk.cpp | 2 +- source/Joystick.cpp | 18 +++---- source/Joystick.h | 6 +-- source/Memory.cpp | 16 +++--- source/Memory.h | 4 +- source/Mockingboard.cpp | 2 +- source/Mockingboard.h | 4 +- source/MockingboardCardManager.cpp | 10 ++-- source/MockingboardCardManager.h | 12 ++--- source/NTSC.cpp | 8 +-- source/NTSC.h | 4 +- source/ParallelPrinter.cpp | 4 +- source/ParallelPrinter.h | 2 +- source/RGBMonitor.cpp | 20 ++++---- source/Registry.cpp | 16 +++--- source/Registry.h | 10 ++-- source/SSI263.cpp | 14 +++--- source/SSI263.h | 8 +-- source/SoundCore.cpp | 14 +++--- source/SoundCore.h | 14 +++--- source/Speaker.cpp | 38 +++++++------- source/Speaker.h | 6 +-- source/StdAfx.h | 2 + source/Tfe/tfearch.cpp | 2 +- source/Tfe/tfearch.h | 2 +- source/Uthernet1.cpp | 2 +- source/Uthernet1.h | 2 +- source/Uthernet2.cpp | 2 +- source/Utilities.cpp | 20 ++++---- source/Video.cpp | 22 ++++----- source/Video.h | 8 +-- source/Windows/AppleWin.cpp | 6 +-- source/Windows/Win32Frame.cpp | 18 +++---- source/Windows/Win32Frame.h | 2 +- source/Windows/WinFrame.cpp | 8 +-- source/YamlHelper.cpp | 2 +- test/TestCPU6502/TestCPU6502.cpp | 56 ++++++++++----------- 69 files changed, 319 insertions(+), 317 deletions(-) diff --git a/source/CPU.cpp b/source/CPU.cpp index 5e4d5a54..588e4a81 100644 --- a/source/CPU.cpp +++ b/source/CPU.cpp @@ -235,7 +235,7 @@ static UINT g_nMin = 0xFFFFFFFF; static UINT g_nMax = 0; #endif -static __forceinline void DoIrqProfiling(DWORD uCycles) +static __forceinline void DoIrqProfiling(uint32_t uCycles) { #ifdef _DEBUG if(regs.ps & AF_INTERRUPT) @@ -513,7 +513,7 @@ static __forceinline bool IRQ(ULONG& uExecutedCycles, BOOL& flagc, BOOL& flagn, //=========================================================================== -static DWORD InternalCpuExecute(const DWORD uTotalCycles, const bool bVideoUpdate) +static uint32_t InternalCpuExecute(const uint32_t uTotalCycles, const bool bVideoUpdate) { if (g_nAppMode == MODE_RUNNING || g_nAppMode == MODE_BENCHMARK) { @@ -607,7 +607,7 @@ ULONG CpuGetCyclesThisVideoFrame(const ULONG nExecutedCycles) //=========================================================================== -DWORD CpuExecute(const DWORD uCycles, const bool bVideoUpdate) +uint32_t CpuExecute(const uint32_t uCycles, const bool bVideoUpdate) { #ifdef LOG_PERF_TIMINGS extern UINT64 g_timeCpu; @@ -624,7 +624,7 @@ DWORD CpuExecute(const DWORD uCycles, const bool bVideoUpdate) // uCycles: // =0 : Do single step // >0 : Do multi-opcode emulation - const DWORD uExecutedCycles = InternalCpuExecute(uCycles, bVideoUpdate); + const uint32_t uExecutedCycles = InternalCpuExecute(uCycles, bVideoUpdate); // Update 6522s (NB. Do this before updating g_nCumulativeCycles below) // . Ensures that 6522 regs are up-to-date for any potential save-state diff --git a/source/CPU.h b/source/CPU.h index f0bac764..02059da7 100644 --- a/source/CPU.h +++ b/source/CPU.h @@ -30,7 +30,7 @@ extern unsigned __int64 g_nCumulativeCycles; void CpuDestroy (); void CpuCalcCycles(ULONG nExecutedCycles); -DWORD CpuExecute(const DWORD uCycles, const bool bVideoUpdate); +uint32_t CpuExecute(const uint32_t uCycles, const bool bVideoUpdate); ULONG CpuGetCyclesThisVideoFrame(ULONG nExecutedCycles); void CpuCreateCriticalSection(void); void CpuInitialize(void); diff --git a/source/CPU/cpu6502.h b/source/CPU/cpu6502.h index a4bca6fb..ad8bb048 100644 --- a/source/CPU/cpu6502.h +++ b/source/CPU/cpu6502.h @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //=========================================================================== -static DWORD Cpu6502(DWORD uTotalCycles, const bool bVideoUpdate) +static uint32_t Cpu6502(uint32_t uTotalCycles, const bool bVideoUpdate) { WORD addr; BOOL flagc; // must always be 0 or 1, no other values allowed diff --git a/source/CPU/cpu65C02.h b/source/CPU/cpu65C02.h index 09acbfd1..c573de77 100644 --- a/source/CPU/cpu65C02.h +++ b/source/CPU/cpu65C02.h @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //=========================================================================== -static DWORD Cpu65C02(DWORD uTotalCycles, const bool bVideoUpdate) +static uint32_t Cpu65C02(uint32_t uTotalCycles, const bool bVideoUpdate) { WORD addr; BOOL flagc; // must always be 0 or 1, no other values allowed diff --git a/source/Common.h b/source/Common.h index 1e3b6fba..a2c324ad 100644 --- a/source/Common.h +++ b/source/Common.h @@ -13,7 +13,7 @@ const double CLK_6502_PAL = (_14M_PAL * 65.0) / (65.0*14.0+2.0); // 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; +const uint32_t SPKR_SAMPLE_RATE = 44100; enum AppMode_e { diff --git a/source/Configuration/IPropertySheet.h b/source/Configuration/IPropertySheet.h index 5320a7cf..7d4e0b7d 100644 --- a/source/Configuration/IPropertySheet.h +++ b/source/Configuration/IPropertySheet.h @@ -8,7 +8,7 @@ class IPropertySheet { public: virtual void Init(void) = 0; - virtual DWORD GetVolumeMax(void) = 0; // TODO:TC: Move out of here + virtual uint32_t GetVolumeMax(void) = 0; // TODO:TC: Move out of here virtual bool SaveStateSelectImage(HWND hWindow, bool bSave) = 0; // TODO:TC: Move out of here virtual void ApplyNewConfig(const CConfigNeedingRestart& ConfigNew, const CConfigNeedingRestart& ConfigOld) = 0; virtual void ApplyNewConfigFromSnapshot(const CConfigNeedingRestart& ConfigNew) = 0; diff --git a/source/Configuration/PageAdvanced.cpp b/source/Configuration/PageAdvanced.cpp index 5a0c3372..d460a061 100644 --- a/source/Configuration/PageAdvanced.cpp +++ b/source/Configuration/PageAdvanced.cpp @@ -128,7 +128,7 @@ INT_PTR CPageAdvanced::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, L case IDC_CLONETYPE: if(HIWORD(wparam) == CBN_SELCHANGE) { - const DWORD NewCloneMenuItem = (DWORD) SendDlgItemMessage(hWnd, IDC_CLONETYPE, CB_GETCURSEL, 0, 0); + const uint32_t NewCloneMenuItem = (uint32_t) SendDlgItemMessage(hWnd, IDC_CLONETYPE, CB_GETCURSEL, 0, 0); const eApple2Type NewCloneType = GetCloneType(NewCloneMenuItem); m_PropertySheetHelper.GetConfigNew().m_Apple2Type = NewCloneType; m_PropertySheetHelper.GetConfigNew().m_CpuType = ProbeMainCpuDefault(NewCloneType); @@ -242,7 +242,7 @@ void CPageAdvanced::InitOptions(HWND hWnd) } // Advanced->Clone: Menu item to eApple2Type -eApple2Type CPageAdvanced::GetCloneType(DWORD NewMenuItem) +eApple2Type CPageAdvanced::GetCloneType(uint32_t NewMenuItem) { switch (NewMenuItem) { diff --git a/source/Configuration/PageAdvanced.h b/source/Configuration/PageAdvanced.h index e4b28ba0..89f388bc 100644 --- a/source/Configuration/PageAdvanced.h +++ b/source/Configuration/PageAdvanced.h @@ -31,7 +31,7 @@ protected: private: void InitOptions(HWND hWnd); - eApple2Type GetCloneType(DWORD NewMenuItem); + eApple2Type GetCloneType(uint32_t NewMenuItem); int GetCloneMenuItem(void); void InitFreezeDlgButton(HWND hWnd); void InitCloneDropdownMenu(HWND hWnd); diff --git a/source/Configuration/PageConfig.cpp b/source/Configuration/PageConfig.cpp index e5add898..016457c6 100644 --- a/source/Configuration/PageConfig.cpp +++ b/source/Configuration/PageConfig.cpp @@ -71,7 +71,7 @@ INT_PTR CPageConfig::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPA case PSN_KILLACTIVE: // About to stop being active page { - DWORD NewComputerMenuItem = (DWORD) SendDlgItemMessage(hWnd, IDC_COMPUTER, CB_GETCURSEL, 0, 0); + uint32_t NewComputerMenuItem = (uint32_t) SendDlgItemMessage(hWnd, IDC_COMPUTER, CB_GETCURSEL, 0, 0); SetWindowLongPtr(hWnd, DWLP_MSGRESULT, FALSE); // Changes are valid } break; @@ -145,7 +145,7 @@ INT_PTR CPageConfig::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPA case IDC_COMPUTER: if(HIWORD(wparam) == CBN_SELCHANGE) { - const DWORD NewComputerMenuItem = (DWORD) SendDlgItemMessage(hWnd, IDC_COMPUTER, CB_GETCURSEL, 0, 0); + const uint32_t NewComputerMenuItem = (uint32_t) SendDlgItemMessage(hWnd, IDC_COMPUTER, CB_GETCURSEL, 0, 0); const eApple2Type NewApple2Type = GetApple2Type(NewComputerMenuItem); m_PropertySheetHelper.GetConfigNew().m_Apple2Type = NewApple2Type; if (NewApple2Type != A2TYPE_CLONE) @@ -245,7 +245,7 @@ INT_PTR CPageConfig::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPA BOOL bCustom = TRUE; if (g_dwSpeed == SPEED_NORMAL) { - DWORD dwCustomSpeed; + uint32_t dwCustomSpeed; REGLOAD_DEFAULT(TEXT(REGVALUE_CUSTOM_SPEED), &dwCustomSpeed, 0); bCustom = dwCustomSpeed ? TRUE : FALSE; } @@ -374,7 +374,7 @@ void CPageConfig::DlgOK(HWND hWnd) if (GetCardMgr().IsSSCInstalled()) { - const DWORD uNewSerialPort = (DWORD) SendDlgItemMessage(hWnd, IDC_SERIALPORT, CB_GETCURSEL, 0, 0); + const uint32_t uNewSerialPort = (uint32_t) SendDlgItemMessage(hWnd, IDC_SERIALPORT, CB_GETCURSEL, 0, 0); GetCardMgr().GetSSC()->CommSetSerialPort(uNewSerialPort); } @@ -406,7 +406,7 @@ void CPageConfig::InitOptions(HWND hWnd) } // Config->Computer: Menu item to eApple2Type -eApple2Type CPageConfig::GetApple2Type(DWORD NewMenuItem) +eApple2Type CPageConfig::GetApple2Type(uint32_t NewMenuItem) { switch (NewMenuItem) { diff --git a/source/Configuration/PageConfig.h b/source/Configuration/PageConfig.h index db4ea699..fb50411c 100644 --- a/source/Configuration/PageConfig.h +++ b/source/Configuration/PageConfig.h @@ -28,7 +28,7 @@ protected: private: void InitOptions(HWND hWnd); - eApple2Type GetApple2Type(DWORD NewMenuItem); + eApple2Type GetApple2Type(uint32_t NewMenuItem); void EnableTrackbar(HWND hWnd, BOOL enable); void ui_tfe_settings_dialog(HWND hwnd); bool IsOkToBenchmark(HWND hWnd, const bool bConfigChanged); diff --git a/source/Configuration/PageDisk.cpp b/source/Configuration/PageDisk.cpp index 52f2f693..834d88fb 100644 --- a/source/Configuration/PageDisk.cpp +++ b/source/Configuration/PageDisk.cpp @@ -278,7 +278,7 @@ void CPageDisk::DlgOK(HWND hWnd) if (bNewEnhanceDisk != GetCardMgr().GetDisk2CardMgr().GetEnhanceDisk()) { GetCardMgr().GetDisk2CardMgr().SetEnhanceDisk(bNewEnhanceDisk); - REGSAVE(TEXT(REGVALUE_ENHANCE_DISK_SPEED), (DWORD)bNewEnhanceDisk); + REGSAVE(TEXT(REGVALUE_ENHANCE_DISK_SPEED), (uint32_t)bNewEnhanceDisk); } Win32Frame& win32Frame = Win32Frame::GetWin32Frame(); @@ -350,8 +350,8 @@ void CPageDisk::HandleHDDCombo(HWND hWnd, UINT driveSelected, UINT comboSelected HarddiskInterfaceCard& card = dynamic_cast(GetCardMgr().GetRef(SLOT7)); // Search from "select hard drive" - DWORD dwOpenDialogIndex = (DWORD)SendDlgItemMessage(hWnd, comboSelected, CB_FINDSTRINGEXACT, -1, (LPARAM)&m_defaultHDDOptions[0]); - DWORD dwComboSelection = (DWORD)SendDlgItemMessage(hWnd, comboSelected, CB_GETCURSEL, 0, 0); + uint32_t dwOpenDialogIndex = (uint32_t)SendDlgItemMessage(hWnd, comboSelected, CB_FINDSTRINGEXACT, -1, (LPARAM)&m_defaultHDDOptions[0]); + uint32_t dwComboSelection = (uint32_t)SendDlgItemMessage(hWnd, comboSelected, CB_GETCURSEL, 0, 0); SendDlgItemMessage(hWnd, comboSelected, CB_SETCURSEL, -1, 0); // Set to "empty" item @@ -379,9 +379,9 @@ void CPageDisk::HandleHDDCombo(HWND hWnd, UINT driveSelected, UINT comboSelected SendDlgItemMessage(hWnd, comboSelected, CB_SETCURSEL, 0, 0); // If the HD was in the other combo, remove now - DWORD comboOther = (comboSelected == IDC_COMBO_HDD1) ? IDC_COMBO_HDD2 : IDC_COMBO_HDD1; + uint32_t comboOther = (comboSelected == IDC_COMBO_HDD1) ? IDC_COMBO_HDD2 : IDC_COMBO_HDD1; - DWORD duplicated = (DWORD)SendDlgItemMessage(hWnd, comboOther, CB_FINDSTRINGEXACT, -1, (LPARAM)card.GetFullName(driveSelected).c_str()); + uint32_t duplicated = (uint32_t)SendDlgItemMessage(hWnd, comboOther, CB_FINDSTRINGEXACT, -1, (LPARAM)card.GetFullName(driveSelected).c_str()); if (duplicated != CB_ERR) { SendDlgItemMessage(hWnd, comboOther, CB_DELETESTRING, duplicated, 0); @@ -420,8 +420,8 @@ void CPageDisk::HandleFloppyDriveCombo(HWND hWnd, UINT driveSelected, UINT combo Disk2InterfaceCard& disk2Card = dynamic_cast(GetCardMgr().GetRef(slot)); // Search from "select floppy drive" - DWORD dwOpenDialogIndex = (DWORD)SendDlgItemMessage(hWnd, comboSelected, CB_FINDSTRINGEXACT, -1, (LPARAM)&m_defaultDiskOptions[0]); - DWORD dwComboSelection = (DWORD)SendDlgItemMessage(hWnd, comboSelected, CB_GETCURSEL, 0, 0); + uint32_t dwOpenDialogIndex = (uint32_t)SendDlgItemMessage(hWnd, comboSelected, CB_FINDSTRINGEXACT, -1, (LPARAM)&m_defaultDiskOptions[0]); + uint32_t dwComboSelection = (uint32_t)SendDlgItemMessage(hWnd, comboSelected, CB_GETCURSEL, 0, 0); SendDlgItemMessage(hWnd, comboSelected, CB_SETCURSEL, -1, 0); // Set to "empty" item @@ -450,7 +450,7 @@ void CPageDisk::HandleFloppyDriveCombo(HWND hWnd, UINT driveSelected, UINT combo SendDlgItemMessage(hWnd, comboSelected, CB_SETCURSEL, 0, 0); // If the FD was in the other combo, remove now - DWORD duplicated = (DWORD)SendDlgItemMessage(hWnd, comboOther, CB_FINDSTRINGEXACT, -1, (LPARAM)fullname.c_str()); + uint32_t duplicated = (uint32_t)SendDlgItemMessage(hWnd, comboOther, CB_FINDSTRINGEXACT, -1, (LPARAM)fullname.c_str()); if (duplicated != CB_ERR) { SendDlgItemMessage(hWnd, comboOther, CB_DELETESTRING, duplicated, 0); diff --git a/source/Configuration/PageInput.cpp b/source/Configuration/PageInput.cpp index 49b4f7c2..d2b3b88d 100644 --- a/source/Configuration/PageInput.cpp +++ b/source/Configuration/PageInput.cpp @@ -136,7 +136,7 @@ INT_PTR CPageInput::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPAR case IDC_JOYSTICK0: if (HIWORD(wparam) == CBN_SELCHANGE) { - DWORD dwNewJoyType = (DWORD)SendDlgItemMessage(hWnd, IDC_JOYSTICK0, CB_GETCURSEL, 0, 0); + uint32_t dwNewJoyType = (uint32_t)SendDlgItemMessage(hWnd, IDC_JOYSTICK0, CB_GETCURSEL, 0, 0); const bool bIsSlot4Mouse = m_PropertySheetHelper.GetConfigNew().m_Slot[SLOT4] == CT_MouseInterface; JoySetEmulationType(hWnd, m_nJoy0ChoiceTranlationTbl[dwNewJoyType], JN_JOYSTICK0, bIsSlot4Mouse); InitOptions(hWnd); @@ -146,7 +146,7 @@ INT_PTR CPageInput::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPAR case IDC_JOYSTICK1: if (HIWORD(wparam) == CBN_SELCHANGE) { - DWORD dwNewJoyType = (DWORD)SendDlgItemMessage(hWnd, IDC_JOYSTICK1, CB_GETCURSEL, 0, 0); + uint32_t dwNewJoyType = (uint32_t)SendDlgItemMessage(hWnd, IDC_JOYSTICK1, CB_GETCURSEL, 0, 0); const bool bIsSlot4Mouse = m_PropertySheetHelper.GetConfigNew().m_Slot[SLOT4] == CT_MouseInterface; JoySetEmulationType(hWnd, m_nJoy1ChoiceTranlationTbl[dwNewJoyType], JN_JOYSTICK1, bIsSlot4Mouse); InitOptions(hWnd); @@ -169,7 +169,7 @@ INT_PTR CPageInput::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPAR case IDC_CPM_CONFIG: if (HIWORD(wparam) == CBN_SELCHANGE) { - const DWORD NewCPMChoiceItem = (DWORD) SendDlgItemMessage(hWnd, IDC_CPM_CONFIG, CB_GETCURSEL, 0, 0); + const uint32_t NewCPMChoiceItem = (uint32_t) SendDlgItemMessage(hWnd, IDC_CPM_CONFIG, CB_GETCURSEL, 0, 0); const CPMCHOICE NewCPMChoice = m_CPMComboItemToChoice[NewCPMChoiceItem]; if (NewCPMChoice == m_CPMChoice) break; @@ -195,7 +195,7 @@ INT_PTR CPageInput::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPAR case IDC_FOURPLAY_CONFIG: if (HIWORD(wparam) == CBN_SELCHANGE) { - const DWORD NewFourPlayChoiceItem = (DWORD) SendDlgItemMessage(hWnd, IDC_FOURPLAY_CONFIG, CB_GETCURSEL, 0, 0); + const uint32_t NewFourPlayChoiceItem = (uint32_t) SendDlgItemMessage(hWnd, IDC_FOURPLAY_CONFIG, CB_GETCURSEL, 0, 0); const FOURPLAYCHOICE NewFourPlayChoice = m_FourPlayComboItemToChoice[NewFourPlayChoiceItem]; if (NewFourPlayChoice == m_FourPlayChoice) break; @@ -226,7 +226,7 @@ INT_PTR CPageInput::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPAR case IDC_SNESMAX_CONFIG: if (HIWORD(wparam) == CBN_SELCHANGE) { - const DWORD NewSNESMAXChoiceItem = (DWORD) SendDlgItemMessage(hWnd, IDC_SNESMAX_CONFIG, CB_GETCURSEL, 0, 0); + const uint32_t NewSNESMAXChoiceItem = (uint32_t) SendDlgItemMessage(hWnd, IDC_SNESMAX_CONFIG, CB_GETCURSEL, 0, 0); const SNESMAXCHOICE NewSNESMAXChoice = m_SNESMAXComboItemToChoice[NewSNESMAXChoiceItem]; if (NewSNESMAXChoice == m_SNESMAXChoice) break; diff --git a/source/Configuration/PageSound.cpp b/source/Configuration/PageSound.cpp index 39f71633..04158e6a 100644 --- a/source/Configuration/PageSound.cpp +++ b/source/Configuration/PageSound.cpp @@ -107,7 +107,7 @@ INT_PTR CPageSound::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPAR if (HIWORD(wparam) == CBN_SELCHANGE) { UINT slot = (LOWORD(wparam) == IDC_SOUNDCARD_SLOT4) ? SLOT4 : SLOT5; - DWORD newChoiceItem = (DWORD)SendDlgItemMessage(hWnd, LOWORD(wparam), CB_GETCURSEL, 0, 0); + uint32_t newChoiceItem = (uint32_t)SendDlgItemMessage(hWnd, LOWORD(wparam), CB_GETCURSEL, 0, 0); SS_CARDTYPE newCard = CT_Empty; switch (newChoiceItem) @@ -154,11 +154,11 @@ void CPageSound::DlgOK(HWND hWnd) { const SoundType_e newSoundType = (SoundType_e) SendDlgItemMessage(hWnd, IDC_SOUNDTYPE, CB_GETCURSEL, 0, 0); - const DWORD dwSpkrVolume = SendDlgItemMessage(hWnd, IDC_SPKR_VOLUME, TBM_GETPOS, 0, 0); - const DWORD dwMBVolume = SendDlgItemMessage(hWnd, IDC_MB_VOLUME, TBM_GETPOS, 0, 0); + const uint32_t dwSpkrVolume = SendDlgItemMessage(hWnd, IDC_SPKR_VOLUME, TBM_GETPOS, 0, 0); + const uint32_t dwMBVolume = SendDlgItemMessage(hWnd, IDC_MB_VOLUME, TBM_GETPOS, 0, 0); SpkrSetEmulationType(newSoundType); - DWORD dwSoundType = (soundtype == SOUND_NONE) ? REG_SOUNDTYPE_NONE : REG_SOUNDTYPE_WAVE; + uint32_t dwSoundType = (soundtype == SOUND_NONE) ? REG_SOUNDTYPE_NONE : REG_SOUNDTYPE_WAVE; REGSAVE(TEXT(REGVALUE_SOUND_EMULATION), dwSoundType); // NB. Volume: 0=Loudest, VOLUME_MAX=Silence diff --git a/source/Configuration/PageSound.h b/source/Configuration/PageSound.h index 6c6bf1df..0aa9a7f1 100644 --- a/source/Configuration/PageSound.h +++ b/source/Configuration/PageSound.h @@ -19,7 +19,7 @@ public: static INT_PTR CALLBACK DlgProc(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam); - DWORD GetVolumeMax(void){ return VOLUME_MAX; } + uint32_t GetVolumeMax(void){ return VOLUME_MAX; } protected: // IPropertySheetPage diff --git a/source/Configuration/PropertySheet.cpp b/source/Configuration/PropertySheet.cpp index 8f5a7ab1..32163725 100644 --- a/source/Configuration/PropertySheet.cpp +++ b/source/Configuration/PropertySheet.cpp @@ -85,7 +85,7 @@ void CPropertySheet::Init(void) INT_PTR nRes = PropertySheet(&PropSheetHeader); // Result: 0=Cancel, 1=OK } -DWORD CPropertySheet::GetVolumeMax() +uint32_t CPropertySheet::GetVolumeMax() { return m_PageSound.GetVolumeMax(); } diff --git a/source/Configuration/PropertySheet.h b/source/Configuration/PropertySheet.h index a5e37537..6487fc7c 100644 --- a/source/Configuration/PropertySheet.h +++ b/source/Configuration/PropertySheet.h @@ -22,7 +22,7 @@ public: virtual ~CPropertySheet(){} virtual void Init(void); - virtual DWORD GetVolumeMax(void); // TODO:TC: Move out of here + virtual uint32_t GetVolumeMax(void); // TODO:TC: Move out of here virtual bool SaveStateSelectImage(HWND hWindow, bool bSave); // TODO:TC: Move out of here void ApplyNewConfig(const CConfigNeedingRestart& ConfigNew, const CConfigNeedingRestart& ConfigOld) { diff --git a/source/Core.cpp b/source/Core.cpp index 9def69c0..ca7e9242 100644 --- a/source/Core.cpp +++ b/source/Core.cpp @@ -69,12 +69,12 @@ bool g_bDisableDirectInput = false; bool g_bDisableDirectSound = false; bool g_bDisableDirectSoundMockingboard = false; -DWORD g_dwSpeed = SPEED_NORMAL; // Affected by Config dialog's speed slider bar +uint32_t g_dwSpeed = SPEED_NORMAL; // Affected by Config dialog's speed slider bar double g_fCurrentCLK6502 = CLK_6502_NTSC; // Affected by Config dialog's speed slider bar static double g_fMHz = 1.0; // Affected by Config dialog's speed slider bar int g_nCpuCyclesFeedback = 0; -DWORD g_dwCyclesThisFrame = 0; +uint32_t g_dwCyclesThisFrame = 0; int g_nMemoryClearType = MIP_FF_FF_00_00; // Note: -1 = random MIP in Memory.cpp MemReset() @@ -128,7 +128,7 @@ void LogPerfTimings(void) //=========================================================================== -static DWORD dwLogKeyReadTickStart; +static uint32_t dwLogKeyReadTickStart; static bool bLogKeyReadDone = false; void LogFileTimeUntilFirstKeyReadReset(void) @@ -160,7 +160,7 @@ void LogFileTimeUntilFirstKeyRead(void) ) return; - DWORD dwTime = GetTickCount() - dwLogKeyReadTickStart; + uint32_t dwTime = GetTickCount() - dwLogKeyReadTickStart; LogFileOutput("Time from emulation reboot until first $C000 access: %d msec\n", dwTime); @@ -200,7 +200,7 @@ double Get6502BaseClock(void) void SetCurrentCLK6502(void) { - static DWORD dwPrevSpeed = (DWORD) -1; + static uint32_t dwPrevSpeed = (uint32_t) -1; static VideoRefreshRate_e prevVideoRefreshRate = VR_NONE; if (dwPrevSpeed == g_dwSpeed && GetVideo().GetVideoRefreshRate() == prevVideoRefreshRate) diff --git a/source/Core.h b/source/Core.h index a5bc6be9..42caf9ae 100644 --- a/source/Core.h +++ b/source/Core.h @@ -45,11 +45,11 @@ bool SetCurrentImageDir(const std::string& pszImageDir); extern bool g_bRestart; -extern DWORD g_dwSpeed; +extern uint32_t g_dwSpeed; extern double g_fCurrentCLK6502; extern int g_nCpuCyclesFeedback; -extern DWORD g_dwCyclesThisFrame; +extern uint32_t g_dwCyclesThisFrame; extern int g_nMemoryClearType; // Cmd line switch: use specific MIP (Memory Initialization Pattern) diff --git a/source/Debugger/Debug.cpp b/source/Debugger/Debug.cpp index 31447d41..a867273f 100644 --- a/source/Debugger/Debug.cpp +++ b/source/Debugger/Debug.cpp @@ -341,7 +341,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA static BOOL g_bProfiling = 0; static int g_nDebugSteps = 0; - static DWORD g_nDebugStepCycles = 0; + static uint32_t g_nDebugStepCycles = 0; static int g_nDebugStepStart = 0; static int g_nDebugStepUntil = -1; // HACK: MAGIC # @@ -352,7 +352,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA static bool g_bTraceHeader = false; // semaphore, flag header to be printed static bool g_bTraceFileWithVideoScanner = false; - DWORD extbench = 0; + uint32_t extbench = 0; static bool g_bIgnoreNextKey = false; @@ -783,7 +783,7 @@ Update_t CmdBenchmarkStop (int nArgs) GetFrame().FrameRefreshStatus(DRAW_TITLE | DRAW_DISK_STATUS); GetFrame().VideoRedrawScreen(); - DWORD currtime = GetTickCount(); + uint32_t currtime = GetTickCount(); while ((extbench = GetTickCount()) != currtime) ; // intentional busy-waiting KeybQueueKeypress(TEXT(' ') ,ASCII); @@ -2800,7 +2800,7 @@ Update_t CmdConfigSave (int nArgs) { void *pSrc; int nLen; - DWORD nPut; + uint32_t nPut; // FIXME: Should be saving in Text format, not binary! @@ -6522,14 +6522,14 @@ bool ParseAssemblyListing ( bool bBytesToMemory, bool bAddSymbols ) g_nSourceAssembleBytes = 0; g_nSourceAssemblySymbols = 0; - const DWORD INVALID_ADDRESS = _6502_MEM_END + 1; + const uint32_t INVALID_ADDRESS = _6502_MEM_END + 1; int nLines = g_AssemblerSourceBuffer.GetNumLines(); for ( int iLine = 0; iLine < nLines; iLine++ ) { g_AssemblerSourceBuffer.GetLine( iLine, sText, MAX_LINE - 1 ); - DWORD nAddress = INVALID_ADDRESS; + uint32_t nAddress = INVALID_ADDRESS; _tcscpy( sLine, sText ); char *p = sLine; @@ -6620,7 +6620,7 @@ bool ParseAssemblyListing ( bool bBytesToMemory, bool bAddSymbols ) if (pAddress) { char *pAddressEnd; - nAddress = (DWORD) strtol( pAddress, &pAddressEnd, 16 ); + nAddress = (uint32_t) strtol( pAddress, &pAddressEnd, 16 ); g_aSymbols[ SYMBOLS_SRC_2 ][ (WORD) nAddress] = sName; g_nSourceAssemblySymbols++; } @@ -8852,7 +8852,7 @@ void DebugInitialize () AssemblerOff(); // update prompt #if _DEBUG - DWORD nError = 0; + uint32_t nError = 0; #endif #if _DEBUG @@ -9595,9 +9595,9 @@ void DebuggerCursorUpdate () return; const int nUpdatesPerSecond = 4; - const DWORD nUpdateInternal_ms = 1000 / nUpdatesPerSecond; - static DWORD nBeg = GetTickCount(); // timeGetTime(); - DWORD nNow = GetTickCount(); // timeGetTime(); + const uint32_t nUpdateInternal_ms = 1000 / nUpdatesPerSecond; + static uint32_t nBeg = GetTickCount(); // timeGetTime(); + uint32_t nNow = GetTickCount(); // timeGetTime(); if (((nNow - nBeg) >= nUpdateInternal_ms) && !DebugVideoMode::Instance().IsSet()) { diff --git a/source/Debugger/Debug.h b/source/Debugger/Debug.h index 2f6228fc..db22cf1f 100644 --- a/source/Debugger/Debug.h +++ b/source/Debugger/Debug.h @@ -20,7 +20,7 @@ extern bool g_bDebuggerEatKey; // Benchmarking - extern DWORD extbench; + extern uint32_t extbench; // Bookmarks extern int g_nBookmarks; diff --git a/source/Debugger/Debugger_Assembler.cpp b/source/Debugger/Debugger_Assembler.cpp index 39c43763..9c5286d1 100644 --- a/source/Debugger/Debugger_Assembler.cpp +++ b/source/Debugger/Debugger_Assembler.cpp @@ -553,7 +553,7 @@ int _6502_GetOpmodeOpbyte ( const int nBaseAddress, int & iOpmode_, int & nOpby if ( pData_ ) *pData_ = pData; - const DWORD nEndAddress = pData->nEndAddress; + const uint32_t nEndAddress = pData->nEndAddress; const int nDisplayLen = nEndAddress - nBaseAddress + 1; // *inclusive* KEEP IN SYNC: _CmdDefineByteRange() CmdDisasmDataList() _6502_GetOpmodeOpbyte() FormatNopcodeBytes() nSlack = nDisplayLen; diff --git a/source/Debugger/Debugger_Color.cpp b/source/Debugger/Debugger_Color.cpp index 8b10d8de..667cc05a 100644 --- a/source/Debugger/Debugger_Color.cpp +++ b/source/Debugger/Debugger_Color.cpp @@ -203,7 +203,7 @@ static void _SetupColorRamp(const int iPrimary, int & iColor_) int nR = bR ? nC : 0; int nG = bG ? nC : 0; int nB = bB ? nC : 0; - DWORD nColor = RGB(nR, nG, nB); + uint32_t nColor = RGB(nR, nG, nB); g_aColorPalette[iColor_] = nColor; #if DEBUG_COLOR_RAMP strRamp += StrFormat("RGB(%3d,%3d,%3d), ", nR, nG, nB); diff --git a/source/Debugger/Debugger_Disassembler.cpp b/source/Debugger/Debugger_Disassembler.cpp index 37a74867..fb9ccd71 100644 --- a/source/Debugger/Debugger_Disassembler.cpp +++ b/source/Debugger/Debugger_Disassembler.cpp @@ -517,8 +517,8 @@ void FormatNopcodeBytes(WORD nBaseAddress, DisasmLine_t& line_) // TODO: One day, line_.sTarget should become a std::string and things would be much simpler. char* pDst = line_.sTarget; const char* const pEnd = pDst + sizeof(line_.sTarget); - const DWORD nStartAddress = line_.pDisasmData->nStartAddress; - const DWORD nEndAddress = line_.pDisasmData->nEndAddress; + const uint32_t nStartAddress = line_.pDisasmData->nStartAddress; + const uint32_t nEndAddress = line_.pDisasmData->nEndAddress; const int nDisplayLen = nEndAddress - nBaseAddress + 1; // *inclusive* KEEP IN SYNC: _CmdDefineByteRange() CmdDisasmDataList() _6502_GetOpmodeOpbyte() FormatNopcodeBytes() for (int iByte = 0; iByte < line_.nOpbyte; ) diff --git a/source/Debugger/Debugger_Display.cpp b/source/Debugger/Debugger_Display.cpp index caaeb8b4..f23ed4d2 100644 --- a/source/Debugger/Debugger_Display.cpp +++ b/source/Debugger/Debugger_Display.cpp @@ -231,7 +231,7 @@ enum WinROP4_e */ #if DEBUG_FONT_ROP -const DWORD aROP4[ 256 ] = +const uint32_t aROP4[ 256 ] = { 0x00000042, // BLACKNESS 0x00010289, // DPSoon @@ -647,7 +647,7 @@ void StretchBltMemToFrameDC(void) GetDebuggerMemDC(), // HDC hdcSrc, 0, 0, // int nXOriginSrc, int nYOriginSrc, GetVideo().GetFrameBufferBorderlessWidth(), GetVideo().GetFrameBufferBorderlessHeight(), // int nWidthSrc, int nHeightSrc, - SRCCOPY // DWORD dwRop + SRCCOPY // uint32_t dwRop ); } diff --git a/source/Debugger/Debugger_Symbols.cpp b/source/Debugger/Debugger_Symbols.cpp index f1125163..2afb02ea 100644 --- a/source/Debugger/Debugger_Symbols.cpp +++ b/source/Debugger/Debugger_Symbols.cpp @@ -575,7 +575,7 @@ int ParseSymbolTable(const std::string & pPathFileName, SymbolTable_Index_e eSym // . SYMBOL =$0000; Comment // . SYMBOL =$FFFF; Comment // - DWORD nAddress = _6502_MEM_END + 1; // default to invalid address + uint32_t nAddress = _6502_MEM_END + 1; // default to invalid address char sName[ MAX_SYMBOLS_LEN+1 ] = ""; const int MAX_LINE = 256; diff --git a/source/Debugger/Debugger_Types.h b/source/Debugger/Debugger_Types.h index 1eb36094..969d62ae 100644 --- a/source/Debugger/Debugger_Types.h +++ b/source/Debugger/Debugger_Types.h @@ -218,7 +218,7 @@ bool bTemp ; // If true then remove BP when hit or stepping cancelled (eg. G xxxx) bool bHit ; // true when the breakpoint has just been hit bool bStop ; // true if the debugger stops when it is hit - DWORD nHitCount; // number of times the breakpoint was hit + uint32_t nHitCount; // number of times the breakpoint was hit }; typedef Breakpoint_t Bookmark_t; diff --git a/source/Disk.h b/source/Disk.h index bc08d218..6f5ae9d3 100644 --- a/source/Disk.h +++ b/source/Disk.h @@ -126,8 +126,8 @@ public: unsigned __int64 m_lastStepperCycle; unsigned __int64 m_motorOnCycle; BYTE m_headWindow; - DWORD m_spinning; - DWORD m_writelight; + uint32_t m_spinning; + uint32_t m_writelight; FloppyDisk m_disk; }; diff --git a/source/DiskImage.cpp b/source/DiskImage.cpp index 4bf1033b..5c26ff21 100644 --- a/source/DiskImage.cpp +++ b/source/DiskImage.cpp @@ -166,7 +166,7 @@ void ImageWriteTrack( ImageInfo* const pImageInfo, eImageType imageType = pImageInfo->pImageType->GetType(); if (imageType == eImageWOZ1 || imageType == eImageWOZ2) { - DWORD dummy; + uint32_t dummy; bool res = sg_DiskImageHelper.WOZUpdateInfo(pImageInfo, dummy); _ASSERT(res); } diff --git a/source/DiskImageHelper.cpp b/source/DiskImageHelper.cpp index 7d59c76f..011081a0 100644 --- a/source/DiskImageHelper.cpp +++ b/source/DiskImageHelper.cpp @@ -505,7 +505,7 @@ void CImageBase::DenibblizeTrack(LPBYTE trackimage, SectorOrder_e SectorOrder, i //------------------------------------- -DWORD CImageBase::NibblizeTrack(LPBYTE trackimagebuffer, SectorOrder_e SectorOrder, int track) +uint32_t CImageBase::NibblizeTrack(LPBYTE trackimagebuffer, SectorOrder_e SectorOrder, int track) { memset(m_pWorkBuffer+TRACK_DENIBBLIZED_SIZE, 0, TRACK_DENIBBLIZED_SIZE); LPBYTE imageptr = trackimagebuffer; @@ -583,7 +583,7 @@ void CImageBase::SkewTrack(const int nTrack, const int nNumNibbles, const LPBYTE //------------------------------------- -bool CImageBase::IsValidImageSize(const DWORD uImageSize) +bool CImageBase::IsValidImageSize(const uint32_t uImageSize) { m_uNumTracksInImage = 0; @@ -622,7 +622,7 @@ public: CDoImage(void) {} virtual ~CDoImage(void) {} - virtual eDetectResult Detect(const LPBYTE pImage, const DWORD dwImageSize, const TCHAR* pszExt) + virtual eDetectResult Detect(const LPBYTE pImage, const uint32_t dwImageSize, const TCHAR* pszExt) { if (!IsValidImageSize(dwImageSize)) return eMismatch; @@ -690,7 +690,7 @@ public: CPoImage(void) {} virtual ~CPoImage(void) {} - virtual eDetectResult Detect(const LPBYTE pImage, const DWORD dwImageSize, const TCHAR* pszExt) + virtual eDetectResult Detect(const LPBYTE pImage, const uint32_t dwImageSize, const TCHAR* pszExt) { if (!IsValidImageSize(dwImageSize)) return eMismatch; @@ -757,7 +757,7 @@ public: static const UINT NIB1_TRACK_SIZE = NIBBLES_PER_TRACK_NIB; - virtual eDetectResult Detect(const LPBYTE pImage, const DWORD dwImageSize, const TCHAR* pszExt) + virtual eDetectResult Detect(const LPBYTE pImage, const uint32_t dwImageSize, const TCHAR* pszExt) { if (dwImageSize < NIB1_TRACK_SIZE*TRACKS_STANDARD || dwImageSize % NIB1_TRACK_SIZE != 0 || dwImageSize > NIB1_TRACK_SIZE*TRACKS_MAX) return eMismatch; @@ -824,7 +824,7 @@ public: static const UINT NIB2_TRACK_SIZE = 6384; - virtual eDetectResult Detect(const LPBYTE pImage, const DWORD dwImageSize, const TCHAR* pszExt) + virtual eDetectResult Detect(const LPBYTE pImage, const uint32_t dwImageSize, const TCHAR* pszExt) { if (dwImageSize != NIB2_TRACK_SIZE*TRACKS_STANDARD) return eMismatch; @@ -861,7 +861,7 @@ public: CHDVImage(void) {} virtual ~CHDVImage(void) {} - virtual eDetectResult Detect(const LPBYTE pImage, const DWORD dwImageSize, const TCHAR* pszExt) + virtual eDetectResult Detect(const LPBYTE pImage, const uint32_t dwImageSize, const TCHAR* pszExt) { m_uNumTracksInImage = dwImageSize / TRACK_DENIBBLIZED_SIZE; // Set to non-zero @@ -902,7 +902,7 @@ public: CIIeImage(void) : m_pHeader(NULL) {} virtual ~CIIeImage(void) { delete [] m_pHeader; } - virtual eDetectResult Detect(const LPBYTE pImage, const DWORD dwImageSize, const TCHAR* pszExt) + virtual eDetectResult Detect(const LPBYTE pImage, const uint32_t dwImageSize, const TCHAR* pszExt) { if (strncmp((const char *)pImage, "SIMSYSTEM_IIE", 13) || (*(pImage+13) > 3)) return eMismatch; @@ -1016,9 +1016,9 @@ public: return true; } - virtual eDetectResult Detect(const LPBYTE pImage, const DWORD dwImageSize, const TCHAR* pszExt) + virtual eDetectResult Detect(const LPBYTE pImage, const uint32_t dwImageSize, const TCHAR* pszExt) { - DWORD dwLength = *(LPWORD)(pImage+2); + uint32_t dwLength = *(LPWORD)(pImage+2); bool bRes = (((dwLength+4) == dwImageSize) || ((dwLength+4+((256-((dwLength+4) & 255)) & 255)) == dwImageSize)); @@ -1071,7 +1071,7 @@ public: return true; } - virtual eDetectResult Detect(const LPBYTE pImage, const DWORD dwImageSize, const TCHAR* pszExt) + virtual eDetectResult Detect(const LPBYTE pImage, const uint32_t dwImageSize, const TCHAR* pszExt) { return (*(LPDWORD)pImage == 0x214C470A) ? eMatch : eMismatch; // "!LG\x0A" } @@ -1135,7 +1135,7 @@ public: CWOZ1Image(void) {} virtual ~CWOZ1Image(void) {} - virtual eDetectResult Detect(const LPBYTE pImage, const DWORD dwImageSize, const TCHAR* pszExt) + virtual eDetectResult Detect(const LPBYTE pImage, const uint32_t dwImageSize, const TCHAR* pszExt) { CWOZHelper::WOZHeader* pWozHdr = (CWOZHelper::WOZHeader*) pImage; @@ -1256,7 +1256,7 @@ public: CWOZ2Image(void) {} virtual ~CWOZ2Image(void) {} - virtual eDetectResult Detect(const LPBYTE pImage, const DWORD dwImageSize, const TCHAR* pszExt) + virtual eDetectResult Detect(const LPBYTE pImage, const uint32_t dwImageSize, const TCHAR* pszExt) { CWOZHelper::WOZHeader* pWozHdr = (CWOZHelper::WOZHeader*) pImage; @@ -1385,7 +1385,7 @@ public: //----------------------------------------------------------------------------- -eDetectResult CMacBinaryHelper::DetectHdr(LPBYTE& pImage, DWORD& dwImageSize, DWORD& dwOffset) +eDetectResult CMacBinaryHelper::DetectHdr(LPBYTE& pImage, uint32_t& dwImageSize, uint32_t& dwOffset) { // DETERMINE WHETHER THE FILE HAS A 128-BYTE MACBINARY HEADER if ((dwImageSize > uMacBinHdrSize) && @@ -1406,7 +1406,7 @@ eDetectResult CMacBinaryHelper::DetectHdr(LPBYTE& pImage, DWORD& dwImageSize, DW //----------------------------------------------------------------------------- -eDetectResult C2IMGHelper::DetectHdr(LPBYTE& pImage, DWORD& dwImageSize, DWORD& dwOffset) +eDetectResult C2IMGHelper::DetectHdr(LPBYTE& pImage, uint32_t& dwImageSize, uint32_t& dwOffset) { Header2IMG* pHdr = (Header2IMG*) pImage; @@ -1485,7 +1485,7 @@ bool C2IMGHelper::IsLocked(void) //----------------------------------------------------------------------------- // Pre: already matched the WOZ header -eDetectResult CWOZHelper::ProcessChunks(ImageInfo* pImageInfo, DWORD& dwOffset) +eDetectResult CWOZHelper::ProcessChunks(ImageInfo* pImageInfo, uint32_t& dwOffset) { UINT32* pImage32 = (uint32_t*) (pImageInfo->pImageBuffer + sizeof(WOZHeader)); int imageSizeRemaining = pImageInfo->uImageSize - sizeof(WOZHeader); @@ -1617,8 +1617,8 @@ ImageError_e CImageHelperBase::CheckGZipFile(LPCTSTR pszImageFilename, ImageInfo TCHAR szExt[_MAX_EXT] = ""; GetCharLowerExt2(szExt, pszImageFilename, _MAX_EXT); - DWORD dwSize = nLen; - DWORD dwOffset = 0; + uint32_t dwSize = nLen; + uint32_t dwOffset = 0; CImageBase* pImageType = Detect(pImageInfo->pImageBuffer, dwSize, szExt, dwOffset, pImageInfo); if (!pImageType) @@ -1703,8 +1703,8 @@ ImageError_e CImageHelperBase::CheckZipFile(LPCTSTR pszImageFilename, ImageInfo* TCHAR szExt[_MAX_EXT] = ""; GetCharLowerExt(szExt, szFilename, _MAX_EXT); - DWORD dwSize = nLen; - DWORD dwOffset = 0; + uint32_t dwSize = nLen; + uint32_t dwOffset = 0; ImageInfo*& pImageInfoForDetect = !pImageInfo2 ? pImageInfo : pImageInfo2; pImageInfoForDetect->pImageBuffer = pImageBuffer; @@ -1829,8 +1829,8 @@ ImageError_e CImageHelperBase::CheckNormalFile(LPCTSTR pszImageFilename, ImageIn TCHAR szExt[_MAX_EXT] = ""; GetCharLowerExt(szExt, pszImageFilename, _MAX_EXT); - DWORD dwSize = GetFileSize(hFile, NULL); - DWORD dwOffset = 0; + uint32_t dwSize = GetFileSize(hFile, NULL); + uint32_t dwOffset = 0; CImageBase* pImageType = NULL; if (dwSize > 0) @@ -1921,7 +1921,7 @@ ImageError_e CImageHelperBase::CheckNormalFile(LPCTSTR pszImageFilename, ImageIn //------------------------------------- -void CImageHelperBase::SetImageInfo(ImageInfo* pImageInfo, FileType_e fileType, DWORD dwOffset, CImageBase* pImageType, DWORD dwSize) +void CImageHelperBase::SetImageInfo(ImageInfo* pImageInfo, FileType_e fileType, uint32_t dwOffset, CImageBase* pImageType, uint32_t dwSize) { pImageInfo->FileType = fileType; pImageInfo->uOffset = dwOffset; @@ -1988,7 +1988,7 @@ void CImageHelperBase::Close(ImageInfo* pImageInfo) //------------------------------------- -bool CImageHelperBase::WOZUpdateInfo(ImageInfo* pImageInfo, DWORD& dwOffset) +bool CImageHelperBase::WOZUpdateInfo(ImageInfo* pImageInfo, uint32_t& dwOffset) { if (m_WOZHelper.ProcessChunks(pImageInfo, dwOffset) != eMatch) { @@ -2024,7 +2024,7 @@ CDiskImageHelper::CDiskImageHelper(void) : m_vecImageTypes.push_back( new CPrgImage ); } -CImageBase* CDiskImageHelper::Detect(LPBYTE pImage, DWORD dwSize, const TCHAR* pszExt, DWORD& dwOffset, ImageInfo* pImageInfo) +CImageBase* CDiskImageHelper::Detect(LPBYTE pImage, uint32_t dwSize, const TCHAR* pszExt, uint32_t& dwOffset, ImageInfo* pImageInfo) { dwOffset = 0; m_MacBinaryHelper.DetectHdr(pImage, dwSize, dwOffset); @@ -2113,7 +2113,7 @@ CImageBase* CDiskImageHelper::Detect(LPBYTE pImage, DWORD dwSize, const TCHAR* p return pImageType; } -CImageBase* CDiskImageHelper::GetImageForCreation(const TCHAR* pszExt, DWORD* pCreateImageSize) +CImageBase* CDiskImageHelper::GetImageForCreation(const TCHAR* pszExt, uint32_t* pCreateImageSize) { // WE CREATE ONLY DOS ORDER (DO), 6656-NIBBLE (NIB) OR WOZ2 (WOZ) FORMAT FILES for (UINT uLoop = 0; uLoop < GetNumImages(); uLoop++) @@ -2159,7 +2159,7 @@ CHardDiskImageHelper::CHardDiskImageHelper(void) : m_vecImageTypes.push_back( new CHDVImage ); } -CImageBase* CHardDiskImageHelper::Detect(LPBYTE pImage, DWORD dwSize, const TCHAR* pszExt, DWORD& dwOffset, ImageInfo* pImageInfo) +CImageBase* CHardDiskImageHelper::Detect(LPBYTE pImage, uint32_t dwSize, const TCHAR* pszExt, uint32_t& dwOffset, ImageInfo* pImageInfo) { dwOffset = 0; m_Result2IMG = m_2IMGHelper.DetectHdr(pImage, dwSize, dwOffset); @@ -2196,7 +2196,7 @@ CImageBase* CHardDiskImageHelper::Detect(LPBYTE pImage, DWORD dwSize, const TCHA return pImageType; } -CImageBase* CHardDiskImageHelper::GetImageForCreation(const TCHAR* pszExt, DWORD* pCreateImageSize) +CImageBase* CHardDiskImageHelper::GetImageForCreation(const TCHAR* pszExt, uint32_t* pCreateImageSize) { // NB. Not supported for HardDisks // - Would need to create a default 16-block file like CiderPress @@ -2237,7 +2237,7 @@ UINT CHardDiskImageHelper::GetMinDetectSize(const UINT uImageSize, bool* pTempDe #define ASSERT_OFFSET(x, offset) _ASSERT( ((BYTE*)&pWOZ->x - (BYTE*)pWOZ) == offset ) -BYTE* CWOZHelper::CreateEmptyDisk(DWORD& size) +BYTE* CWOZHelper::CreateEmptyDisk(uint32_t& size) { WOZEmptyImage525* pWOZ = new WOZEmptyImage525; memset(pWOZ, 0, sizeof(WOZEmptyImage525)); @@ -2289,7 +2289,7 @@ BYTE* CWOZHelper::CreateEmptyDisk(DWORD& size) #if _DEBUG // Replace the call in CheckNormalFile() to CreateEmptyDiskv1() to generate a WOZv1 empty image-file -BYTE* CWOZHelper::CreateEmptyDiskv1(DWORD& size) +BYTE* CWOZHelper::CreateEmptyDiskv1(uint32_t& size) { WOZv1EmptyImage525* pWOZ = new WOZv1EmptyImage525; memset(pWOZ, 0, sizeof(WOZv1EmptyImage525)); diff --git a/source/DiskImageHelper.h b/source/DiskImageHelper.h index 2247fcaf..42f10925 100644 --- a/source/DiskImageHelper.h +++ b/source/DiskImageHelper.h @@ -26,7 +26,7 @@ struct ImageInfo CImageHelperBase* pImageHelper; FileType_e FileType; HANDLE hFile; - DWORD uOffset; + uint32_t uOffset; bool bWriteProtected; UINT uImageSize; std::string szFilenameInZip; @@ -60,7 +60,7 @@ public: virtual ~CImageBase(void); virtual bool Boot(ImageInfo* pImageInfo) { return false; } - virtual eDetectResult Detect(const LPBYTE pImage, const DWORD dwImageSize, const TCHAR* pszExt) = 0; + virtual eDetectResult Detect(const LPBYTE pImage, const uint32_t dwImageSize, const TCHAR* pszExt) = 0; virtual void Read(ImageInfo* pImageInfo, const float phase, LPBYTE pTrackImageBuffer, int* pNibbles, UINT* pBitCount, bool enhanceDisk) { } virtual bool Read(ImageInfo* pImageInfo, UINT nBlock, LPBYTE pBlockBuffer) { return false; } virtual void Write(ImageInfo* pImageInfo, const float phase, LPBYTE pTrackImageBuffer, int nNibbles) { } @@ -77,7 +77,7 @@ public: bool WriteImageHeader(ImageInfo* pImageInfo, LPBYTE pHdr, const UINT hdrSize); void SetVolumeNumber(const BYTE uVolumeNumber) { m_uVolumeNumber = uVolumeNumber; } - bool IsValidImageSize(const DWORD uImageSize); + bool IsValidImageSize(const uint32_t uImageSize); // To accurately convert a half phase (quarter track) back to a track (round half tracks down), use: ceil(phase)/2, eg: // . phase=4,+1 half phase = phase 4.5 => ceil(4.5)/2 = track 2 (OK) @@ -96,7 +96,7 @@ protected: LPBYTE Code62(int sector); void Decode62(LPBYTE imageptr); void DenibblizeTrack (LPBYTE trackimage, SectorOrder_e SectorOrder, int nibbles); - DWORD NibblizeTrack (LPBYTE trackimagebuffer, SectorOrder_e SectorOrder, int track); + uint32_t NibblizeTrack (LPBYTE trackimagebuffer, SectorOrder_e SectorOrder, int track); void SkewTrack (const int nTrack, const int nNumNibbles, const LPBYTE pTrackImageBuffer); public: @@ -114,7 +114,7 @@ protected: class CHdrHelper { public: - virtual eDetectResult DetectHdr(LPBYTE& pImage, DWORD& dwImageSize, DWORD& dwOffset) = 0; + virtual eDetectResult DetectHdr(LPBYTE& pImage, uint32_t& dwImageSize, uint32_t& dwOffset) = 0; virtual UINT GetMaxHdrSize(void) = 0; protected: CHdrHelper(void) {} @@ -126,7 +126,7 @@ class CMacBinaryHelper : public CHdrHelper public: CMacBinaryHelper(void) {} virtual ~CMacBinaryHelper(void) {} - virtual eDetectResult DetectHdr(LPBYTE& pImage, DWORD& dwImageSize, DWORD& dwOffset); + virtual eDetectResult DetectHdr(LPBYTE& pImage, uint32_t& dwImageSize, uint32_t& dwOffset); virtual UINT GetMaxHdrSize(void) { return uMacBinHdrSize; } private: @@ -147,7 +147,7 @@ class C2IMGHelper : public CHdrHelper public: C2IMGHelper(const bool bIsFloppy) : m_bIsFloppy(bIsFloppy) {} virtual ~C2IMGHelper(void) {} - virtual eDetectResult DetectHdr(LPBYTE& pImage, DWORD& dwImageSize, DWORD& dwOffset); + virtual eDetectResult DetectHdr(LPBYTE& pImage, uint32_t& dwImageSize, uint32_t& dwOffset); virtual UINT GetMaxHdrSize(void) { return sizeof(Header2IMG); } BYTE GetVolumeNumber(void); bool IsLocked(void); @@ -206,17 +206,17 @@ public: m_pInfo(NULL) {} virtual ~CWOZHelper(void) {} - virtual eDetectResult DetectHdr(LPBYTE& pImage, DWORD& dwImageSize, DWORD& dwOffset) { _ASSERT(0); return eMismatch; } + virtual eDetectResult DetectHdr(LPBYTE& pImage, uint32_t& dwImageSize, uint32_t& dwOffset) { _ASSERT(0); return eMismatch; } virtual UINT GetMaxHdrSize(void) { return sizeof(WOZHeader); } - eDetectResult ProcessChunks(ImageInfo* pImageInfo, DWORD& dwOffset); + eDetectResult ProcessChunks(ImageInfo* pImageInfo, uint32_t& dwOffset); bool IsWriteProtected(void) { return m_pInfo->v1.writeProtected == 1; } BYTE GetOptimalBitTiming(void) { return (m_pInfo->v1.version >= 2) ? m_pInfo->optimalBitTiming : InfoChunkv2::optimalBitTiming5_25; } UINT GetMaxNibblesPerTrack(void) { return (m_pInfo->v1.version >= 2) ? m_pInfo->largestTrack*CWOZHelper::BLOCK_SIZE : WOZ1_TRACK_SIZE; } BYTE GetBootSectorFormat(void) { return (m_pInfo->v1.version >= 2) ? m_pInfo->bootSectorFormat : bootUnknown; } void InvalidateInfo(void) { m_pInfo = NULL; } - BYTE* CreateEmptyDisk(DWORD& size); + BYTE* CreateEmptyDisk(uint32_t& size); #if _DEBUG - BYTE* CreateEmptyDiskv1(DWORD& size); + BYTE* CreateEmptyDiskv1(uint32_t& size); #endif static const UINT32 ID1_WOZ1 = '1ZOW'; // 'WOZ1' @@ -378,10 +378,10 @@ public: ImageError_e Open(LPCTSTR pszImageFilename, ImageInfo* pImageInfo, const bool bCreateIfNecessary, std::string& strFilenameInZip); void Close(ImageInfo* pImageInfo); - bool WOZUpdateInfo(ImageInfo* pImageInfo, DWORD& dwOffset); + bool WOZUpdateInfo(ImageInfo* pImageInfo, uint32_t& dwOffset); - virtual CImageBase* Detect(LPBYTE pImage, DWORD dwSize, const TCHAR* pszExt, DWORD& dwOffset, ImageInfo* pImageInfo) = 0; - virtual CImageBase* GetImageForCreation(const TCHAR* pszExt, DWORD* pCreateImageSize) = 0; + virtual CImageBase* Detect(LPBYTE pImage, uint32_t dwSize, const TCHAR* pszExt, uint32_t& dwOffset, ImageInfo* pImageInfo) = 0; + virtual CImageBase* GetImageForCreation(const TCHAR* pszExt, uint32_t* pCreateImageSize) = 0; virtual UINT GetMaxImageSize(void) = 0; virtual UINT GetMinDetectSize(const UINT uImageSize, bool* pTempDetectBuffer) = 0; @@ -391,7 +391,7 @@ protected: ImageError_e CheckNormalFile(LPCTSTR pszImageFilename, ImageInfo* pImageInfo, const bool bCreateIfNecessary); void GetCharLowerExt(TCHAR* pszExt, LPCTSTR pszImageFilename, const UINT uExtSize); void GetCharLowerExt2(TCHAR* pszExt, LPCTSTR pszImageFilename, const UINT uExtSize); - void SetImageInfo(ImageInfo* pImageInfo, FileType_e fileType, DWORD dwOffset, CImageBase* pImageType, DWORD dwSize); + void SetImageInfo(ImageInfo* pImageInfo, FileType_e fileType, uint32_t dwOffset, CImageBase* pImageType, uint32_t dwSize); UINT GetNumImages(void) { return m_vecImageTypes.size(); }; CImageBase* GetImage(UINT uIndex) { _ASSERT(uIndexm_uNumTracksInImage = uNumTracks; } private: - void SkipMacBinaryHdr(LPBYTE& pImage, DWORD& dwSize, DWORD& dwOffset); + void SkipMacBinaryHdr(LPBYTE& pImage, uint32_t& dwSize, uint32_t& dwOffset); private: CMacBinaryHelper m_MacBinaryHelper; @@ -448,8 +448,8 @@ public: CHardDiskImageHelper(void); virtual ~CHardDiskImageHelper(void) {} - virtual CImageBase* Detect(LPBYTE pImage, DWORD dwSize, const TCHAR* pszExt, DWORD& dwOffset, ImageInfo* pImageInfo); - virtual CImageBase* GetImageForCreation(const TCHAR* pszExt, DWORD* pCreateImageSize); + virtual CImageBase* Detect(LPBYTE pImage, uint32_t dwSize, const TCHAR* pszExt, uint32_t& dwOffset, ImageInfo* pImageInfo); + virtual CImageBase* GetImageForCreation(const TCHAR* pszExt, uint32_t* pCreateImageSize); virtual UINT GetMaxImageSize(void); virtual UINT GetMinDetectSize(const UINT uImageSize, bool* pTempDetectBuffer); }; diff --git a/source/FrameBase.cpp b/source/FrameBase.cpp index a29e9ff1..449c45dc 100644 --- a/source/FrameBase.cpp +++ b/source/FrameBase.cpp @@ -37,7 +37,7 @@ void FrameBase::VideoRedrawScreen(void) } //=========================================================================== -void FrameBase::VideoRedrawScreenDuringFullSpeed(DWORD dwCyclesThisFrame, bool bInit /*=false*/) +void FrameBase::VideoRedrawScreenDuringFullSpeed(uint32_t dwCyclesThisFrame, bool bInit /*=false*/) { if (bInit) { @@ -46,7 +46,7 @@ void FrameBase::VideoRedrawScreenDuringFullSpeed(DWORD dwCyclesThisFrame, bool b return; } - DWORD dwFullSpeedDuration = GetTickCount() - dwFullSpeedStartTime; + uint32_t dwFullSpeedDuration = GetTickCount() - dwFullSpeedStartTime; if (dwFullSpeedDuration <= 16) // Only update after every realtime ~17ms of *continuous* full-speed return; @@ -55,7 +55,7 @@ void FrameBase::VideoRedrawScreenDuringFullSpeed(DWORD dwCyclesThisFrame, bool b VideoRedrawScreenAfterFullSpeed(dwCyclesThisFrame); } -void FrameBase::VideoRedrawScreenAfterFullSpeed(DWORD dwCyclesThisFrame) +void FrameBase::VideoRedrawScreenAfterFullSpeed(uint32_t dwCyclesThisFrame) { NTSC_VideoClockResync(dwCyclesThisFrame); VideoRedrawScreen(); // Better (no flicker) than using: NTSC_VideoReinitialize() or VideoReinitialize() diff --git a/source/FrameBase.h b/source/FrameBase.h index 98c0f9e7..08cb7496 100644 --- a/source/FrameBase.h +++ b/source/FrameBase.h @@ -53,14 +53,14 @@ public: // NULL if resource is invalid or size check fails // The pointer is only valid until the next call to GetResource // (in Windows, the pointer is valid forever, but it would be very restrictive to force this on other FrameBase implementations) - virtual BYTE* GetResource(WORD id, LPCSTR lpType, DWORD expectedSize) = 0; + virtual BYTE* GetResource(WORD id, LPCSTR lpType, uint32_t expectedSize) = 0; virtual void Restart() = 0; void VideoRefreshScreen(uint32_t uRedrawWholeScreenVideoMode, bool bRedrawWholeScreen); void VideoRedrawScreen(void); - void VideoRedrawScreenDuringFullSpeed(DWORD dwCyclesThisFrame, bool bInit = false); - void VideoRedrawScreenAfterFullSpeed(DWORD dwCyclesThisFrame); + void VideoRedrawScreenDuringFullSpeed(uint32_t dwCyclesThisFrame, bool bInit = false); + void VideoRedrawScreenAfterFullSpeed(uint32_t dwCyclesThisFrame); void Video_RedrawAndTakeScreenShot(const char* pScreenshotFilename); virtual std::string Video_GetScreenShotFolder() const = 0; @@ -78,7 +78,7 @@ private: bool g_bShowPrintScreenWarningDialog; - DWORD dwFullSpeedStartTime; + uint32_t dwFullSpeedStartTime; bool g_bDisplayPrintScreenFileName; int g_nLastScreenShot; diff --git a/source/Harddisk.cpp b/source/Harddisk.cpp index aee4035e..ecdfaf62 100644 --- a/source/Harddisk.cpp +++ b/source/Harddisk.cpp @@ -201,7 +201,7 @@ void HarddiskInterfaceCard::Reset(const bool powerCycle) void HarddiskInterfaceCard::InitializeIO(LPBYTE pCxRomPeripheral) { - const DWORD HARDDISK_FW_SIZE = APPLE_SLOT_SIZE; + const uint32_t HARDDISK_FW_SIZE = APPLE_SLOT_SIZE; WORD id = IDR_HDC_SMARTPORT_FW; // If not enhanced //e, then modify the firmware later // Use any cmd line override diff --git a/source/Joystick.cpp b/source/Joystick.cpp index db7c751f..44b7b441 100644 --- a/source/Joystick.cpp +++ b/source/Joystick.cpp @@ -49,7 +49,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA enum {DEVICE_NONE=0, DEVICE_JOYSTICK, DEVICE_KEYBOARD, DEVICE_MOUSE, DEVICE_JOYSTICK_THUMBSTICK2}; // Indexed by joytype[n] -static const DWORD joyinfo[6] = { DEVICE_NONE, +static const uint32_t joyinfo[6] = { DEVICE_NONE, DEVICE_JOYSTICK, DEVICE_KEYBOARD, // Cursors (prev: Numpad-Standard) DEVICE_KEYBOARD, // Numpad (prev: Numpad-Centering) @@ -90,7 +90,7 @@ static int joysubx[2] = {0,0}; static int joysuby[2] = {0,0}; // Value persisted to Registry for REGVALUE_JOYSTICK0_EMU_TYPE -static DWORD joytype[2] = {J0C_JOYSTICK1, J1C_DISABLED}; // Emulation Type for joysticks #0 & #1 +static uint32_t joytype[2] = {J0C_JOYSTICK1, J1C_DISABLED}; // Emulation Type for joysticks #0 & #1 static BOOL setbutton[3] = {0,0,0}; // Used when a mouse button is pressed/released @@ -136,8 +136,8 @@ static void CheckJoystick0() if (JOYSTICK_1 < 0) return; - static DWORD lastcheck = 0; - DWORD currtime = GetTickCount(); + static uint32_t lastcheck = 0; + uint32_t currtime = GetTickCount(); if ((currtime-lastcheck >= 10) || joybutton[0] || joybutton[1]) { lastcheck = currtime; @@ -160,8 +160,8 @@ static void CheckJoystick0() static void CheckJoystick1() { - static DWORD lastcheck = 0; - DWORD currtime = GetTickCount(); + static uint32_t lastcheck = 0; + uint32_t currtime = GetTickCount(); if ((currtime-lastcheck >= 10) || joybutton[2]) { lastcheck = currtime; @@ -796,7 +796,7 @@ void JoySetButton(eBUTTON number, eBUTTONSTATE down) } //=========================================================================== -BOOL JoySetEmulationType(HWND window, DWORD newtype, int nJoystickNumber, const bool bMousecardActive) +BOOL JoySetEmulationType(HWND window, uint32_t newtype, int nJoystickNumber, const bool bMousecardActive) { if(joytype[nJoystickNumber] == newtype) return 1; // Already set to this type. Return OK. @@ -922,7 +922,7 @@ void JoyDisableUsingMouse() //=========================================================================== -void JoySetJoyType(UINT num, DWORD type) +void JoySetJoyType(UINT num, uint32_t type) { _ASSERT(num <= JN_JOYSTICK1); if (num > JN_JOYSTICK1) @@ -948,7 +948,7 @@ void JoySetJoyType(UINT num, DWORD type) JoySetTrim(JoyGetTrim(false), false); } -DWORD JoyGetJoyType(UINT num) +uint32_t JoyGetJoyType(UINT num) { _ASSERT(num <= JN_JOYSTICK1); if (num > JN_JOYSTICK1) diff --git a/source/Joystick.h b/source/Joystick.h index 18285825..94dfe43e 100644 --- a/source/Joystick.h +++ b/source/Joystick.h @@ -12,15 +12,15 @@ void JoyInitialize(); BOOL JoyProcessKey(int,bool,bool,bool); void JoyReset(); void JoySetButton(eBUTTON,eBUTTONSTATE); -BOOL JoySetEmulationType(HWND,DWORD,int, const bool bMousecardActive); +BOOL JoySetEmulationType(HWND,uint32_t,int, const bool bMousecardActive); void JoySetPosition(int,int,int,int); BOOL JoyUsingMouse(); BOOL JoyUsingKeyboard(); BOOL JoyUsingKeyboardCursors(); BOOL JoyUsingKeyboardNumpad(); void JoyDisableUsingMouse(); -void JoySetJoyType(UINT num, DWORD type); -DWORD JoyGetJoyType(UINT num); +void JoySetJoyType(UINT num, uint32_t type); +uint32_t JoyGetJoyType(UINT num); void JoySetTrim(short nValue, bool bAxisX); short JoyGetTrim(bool bAxisX); void JoyportControl(const UINT uControl); diff --git a/source/Memory.cpp b/source/Memory.cpp index a9c15f10..88967862 100644 --- a/source/Memory.cpp +++ b/source/Memory.cpp @@ -225,7 +225,7 @@ static LPBYTE pCxRomPeripheral = NULL; static LPBYTE g_pMemMainLanguageCard = NULL; -static DWORD g_memmode = LanguageCardUnit::kMemModeInitialState; +static uint32_t g_memmode = LanguageCardUnit::kMemModeInitialState; static BOOL modechanging = 0; // An Optimisation: means delay calling UpdatePaging() for 1 instruction static UINT memrompages = 1; @@ -1085,16 +1085,16 @@ static bool IsCardInSlot(UINT slot) //=========================================================================== -DWORD GetMemMode(void) +uint32_t GetMemMode(void) { return g_memmode; } -void SetMemMode(DWORD uNewMemMode) +void SetMemMode(uint32_t uNewMemMode) { #if defined(_DEBUG) && 0 - static DWORD dwOldDiff = 0; - DWORD dwDiff = g_memmode ^ uNewMemMode; + static uint32_t dwOldDiff = 0; + uint32_t dwDiff = g_memmode ^ uNewMemMode; dwDiff &= ~(MF_SLOTC3ROM | MF_INTCXROM); if (dwOldDiff != dwDiff) { @@ -1947,7 +1947,7 @@ void MemInitializeFromSnapshot(void) } } -inline DWORD getRandomTime() +inline uint32_t getRandomTime() { return rand() ^ timeGetTime(); // We can't use g_nCumulativeCycles as it will be zero on a fresh execution. } @@ -1988,7 +1988,7 @@ void MemReset() // F2. Ctrl-F2. CALL-151, C050 C053 C057 // OR // F2, Ctrl-F2, F7, HGR - DWORD randTime = getRandomTime(); + uint32_t randTime = getRandomTime(); MemoryInitPattern_e eMemoryInitPattern = static_cast(g_nMemoryClearType); if (g_nMemoryClearType < 0) // random @@ -2168,7 +2168,7 @@ static void DebugFlip(WORD address, ULONG nExecutedCycles) BYTE __stdcall MemSetPaging(WORD programcounter, WORD address, BYTE write, BYTE value, ULONG nExecutedCycles) { address &= 0xFF; - DWORD lastmemmode = g_memmode; + uint32_t lastmemmode = g_memmode; #if defined(_DEBUG) && defined(DEBUG_FLIP_TIMINGS) DebugFlip(address, nExecutedCycles); #endif diff --git a/source/Memory.h b/source/Memory.h index 82b0379b..4949c9e8 100644 --- a/source/Memory.h +++ b/source/Memory.h @@ -59,8 +59,8 @@ LPBYTE MemGetAuxPtr(const WORD); LPBYTE MemGetMainPtr(const WORD); LPBYTE MemGetBankPtr(const UINT nBank, const bool isSaveSnapshotOrDebugging = true); LPBYTE MemGetCxRomPeripheral(); -DWORD GetMemMode(void); -void SetMemMode(DWORD memmode); +uint32_t GetMemMode(void); +void SetMemMode(uint32_t memmode); bool MemOptimizeForModeChanging(WORD programcounter, WORD address); bool MemIsAddrCodeMemory(const USHORT addr); void MemInitialize (); diff --git a/source/Mockingboard.cpp b/source/Mockingboard.cpp index 2466ee9a..0085c0d6 100644 --- a/source/Mockingboard.cpp +++ b/source/Mockingboard.cpp @@ -1010,7 +1010,7 @@ bool MockingboardCard::IsActiveToPreventFullSpeed(void) //----------------------------------------------------------------------------- -void MockingboardCard::SetVolume(DWORD volume, DWORD volumeMax) +void MockingboardCard::SetVolume(uint32_t volume, uint32_t volumeMax) { for (UINT i = 0; i < NUM_SSI263; i++) m_MBSubUnit[i].ssi263.SetVolume(volume, volumeMax); diff --git a/source/Mockingboard.h b/source/Mockingboard.h index 609c99d8..79617651 100644 --- a/source/Mockingboard.h +++ b/source/Mockingboard.h @@ -32,7 +32,7 @@ public: void MuteControl(bool mute); void UpdateCycles(ULONG executedCycles); bool IsActiveToPreventFullSpeed(void); - void SetVolume(DWORD dwVolume, DWORD dwVolumeMax); + void SetVolume(uint32_t dwVolume, uint32_t dwVolumeMax); void SetCumulativeCycles(void); UINT MB_Update(void); short** GetVoiceBuffers(void) { return m_ppAYVoiceBuffer; } @@ -75,7 +75,7 @@ public: static std::string GetSnapshotCardNameSDMusic(void); static const unsigned short NUM_MB_CHANNELS = 2; - static const DWORD SAMPLE_RATE = 44100; // Use a base freq so that DirectX (or sound h/w) doesn't have to up/down-sample + static const uint32_t SAMPLE_RATE = 44100; // Use a base freq so that DirectX (or sound h/w) doesn't have to up/down-sample private: enum MockingboardUnitState_e { AY_NOP0, AY_NOP1, AY_INACTIVE, AY_READ, AY_NOP4, AY_NOP5, AY_WRITE, AY_LATCH }; diff --git a/source/MockingboardCardManager.cpp b/source/MockingboardCardManager.cpp index 9720c20a..02a12834 100644 --- a/source/MockingboardCardManager.cpp +++ b/source/MockingboardCardManager.cpp @@ -145,12 +145,12 @@ bool MockingboardCardManager::IsActiveToPreventFullSpeed(void) return false; } -DWORD MockingboardCardManager::GetVolume(void) +uint32_t MockingboardCardManager::GetVolume(void) { return m_userVolume; } -void MockingboardCardManager::SetVolume(DWORD volume, DWORD volumeMax) +void MockingboardCardManager::SetVolume(uint32_t volume, uint32_t volumeMax) { m_userVolume = volume; @@ -330,7 +330,7 @@ UINT MockingboardCardManager::GenerateAllSoundData(void) if (FAILED(hr)) return 0; - if (m_byteOffset == (DWORD)-1) + if (m_byteOffset == (uint32_t)-1) { // First time in this func @@ -448,7 +448,7 @@ void MockingboardCardManager::MixAllAndCopyToRingBuffer(UINT nNumSamples) SHORT* pDSLockedBuffer0, * pDSLockedBuffer1; HRESULT hr = DSGetLock(m_mockingboardVoice.lpDSBvoice, - m_byteOffset, (DWORD)nNumSamples * sizeof(short) * MockingboardCard::NUM_MB_CHANNELS, + m_byteOffset, (uint32_t)nNumSamples * sizeof(short) * MockingboardCard::NUM_MB_CHANNELS, &pDSLockedBuffer0, &dwDSLockedBufferSize0, &pDSLockedBuffer1, &dwDSLockedBufferSize1); if (FAILED(hr)) @@ -462,7 +462,7 @@ void MockingboardCardManager::MixAllAndCopyToRingBuffer(UINT nNumSamples) hr = m_mockingboardVoice.lpDSBvoice->Unlock((void*)pDSLockedBuffer0, dwDSLockedBufferSize0, (void*)pDSLockedBuffer1, dwDSLockedBufferSize1); - m_byteOffset = (m_byteOffset + (DWORD)nNumSamples * sizeof(short) * MockingboardCard::NUM_MB_CHANNELS) % SOUNDBUFFER_SIZE; + m_byteOffset = (m_byteOffset + (uint32_t)nNumSamples * sizeof(short) * MockingboardCard::NUM_MB_CHANNELS) % SOUNDBUFFER_SIZE; if (m_outputToRiff) RiffPutSamples(&m_mixBuffer[0], nNumSamples); diff --git a/source/MockingboardCardManager.h b/source/MockingboardCardManager.h index f078767f..5b160555 100644 --- a/source/MockingboardCardManager.h +++ b/source/MockingboardCardManager.h @@ -10,7 +10,7 @@ public: MockingboardCardManager(void) { m_numSamplesError = 0; - m_byteOffset = (DWORD)-1; + m_byteOffset = (uint32_t)-1; m_cyclesThisAudioFrame = 0; m_userVolume = 0; m_outputToRiff = false; @@ -30,8 +30,8 @@ public: void UpdateCycles(ULONG executedCycles); void UpdateIRQ(void); bool IsActiveToPreventFullSpeed(void); - DWORD GetVolume(void); - void SetVolume(DWORD volume, DWORD volumeMax); + uint32_t GetVolume(void); + void SetVolume(uint32_t volume, uint32_t volumeMax); void OutputToRiff(void) { m_outputToRiff = true; } void SetEnableExtraCardTypes(bool enable) { m_enableExtraCardTypes = enable; } bool GetEnableExtraCardTypes(void); @@ -55,7 +55,7 @@ private: void MixAllAndCopyToRingBuffer(UINT nNumSamples); bool IsMockingboardExtraCardType(UINT slot); - static const DWORD SOUNDBUFFER_SIZE = MAX_SAMPLES * sizeof(short) * MockingboardCard::NUM_MB_CHANNELS; + static const uint32_t SOUNDBUFFER_SIZE = MAX_SAMPLES * sizeof(short) * MockingboardCard::NUM_MB_CHANNELS; static const SHORT WAVE_DATA_MIN = (SHORT)0x8000; static const SHORT WAVE_DATA_MAX = (SHORT)0x7FFF; @@ -66,9 +66,9 @@ private: // int m_numSamplesError; - DWORD m_byteOffset; + uint32_t m_byteOffset; UINT m_cyclesThisAudioFrame; - DWORD m_userVolume; // GUI's slide volume + uint32_t m_userVolume; // GUI's slide volume bool m_outputToRiff; bool m_enableExtraCardTypes; }; diff --git a/source/NTSC.cpp b/source/NTSC.cpp index de24f0b4..a41b6044 100644 --- a/source/NTSC.cpp +++ b/source/NTSC.cpp @@ -1904,7 +1904,7 @@ uint32_t*NTSC_VideoGetChromaTable( bool bHueTypeMonochrome, bool bMonitorTypeCol } //=========================================================================== -void NTSC_VideoClockResync(const DWORD dwCyclesThisFrame) +void NTSC_VideoClockResync(const uint32_t dwCyclesThisFrame) { g_nVideoClockVert = (uint16_t)(dwCyclesThisFrame / VIDEO_SCANNER_MAX_HORZ) % g_videoScannerMaxVert; g_nVideoClockHorz = (uint16_t)(dwCyclesThisFrame % VIDEO_SCANNER_MAX_HORZ); @@ -2269,7 +2269,7 @@ void NTSC_SetVideoStyle(void) case VT_MONO_CUSTOM: // From WinGDI.h - // #define RGB(r,g,b) ((COLORREF)(((BYTE)(r)|((WORD)((BYTE)(g))<<8))|(((DWORD)(BYTE)(b))<<16))) + // #define RGB(r,g,b) ((COLORREF)(((BYTE)(r)|((WORD)((BYTE)(g))<<8))|(((uint32_t)(BYTE)(b))<<16))) //#define GetRValue(rgb) (LOBYTE(rgb)) //#define GetGValue(rgb) (LOBYTE(((WORD)(rgb)) >> 8)) //#define GetBValue(rgb) (LOBYTE((rgb)>>16)) @@ -2387,7 +2387,7 @@ void NTSC_VideoInit( uint8_t* pFramebuffer ) // wsVideoInit } //=========================================================================== -void NTSC_VideoReinitialize( DWORD cyclesThisFrame, bool bInitVideoScannerAddress ) +void NTSC_VideoReinitialize( uint32_t cyclesThisFrame, bool bInitVideoScannerAddress ) { if (cyclesThisFrame >= g_videoScanner6502Cycles) { @@ -2534,7 +2534,7 @@ static bool CheckVideoTables2( eApple2Type type, uint32_t mode ) g_nVideoClockHorz = g_nVideoClockVert = 0; - for (DWORD cycles=0; cycles= 38 ? 0 : *(pMain + 2)); // all 28 bits chained - DWORD dwordval = (byteval1 & 0x7F) | ((byteval2 & 0x7F) << 7) | ((byteval3 & 0x7F) << 14) | ((byteval4 & 0x7F) << 21); + uint32_t dwordval = (byteval1 & 0x7F) | ((byteval2 & 0x7F) << 7) | ((byteval3 & 0x7F) << 14) | ((byteval4 & 0x7F) << 21); // Extraction of 14 color pixels UINT32 colors[14]; int color = 0; - DWORD dwordval_tmp = dwordval; + uint32_t dwordval_tmp = dwordval; dwordval_tmp = dwordval_tmp >> 7; bool offset = (byteval2 & 0x80) ? true : false; for (int i = 0; i < 14; i++) @@ -688,9 +688,9 @@ void UpdateHiResRGBCell(int x, int y, uint16_t addr, bgra_t* pVideoAddress) bw[0] = *reinterpret_cast(&g_pPaletteRGB[0]); bw[1] = *reinterpret_cast(&g_pPaletteRGB[1]); - DWORD mask = 0x01C0; // 00|000001 1|1000000 - DWORD chck1 = 0x0140; // 00|000001 0|1000000 - DWORD chck2 = 0x0080; // 00|000000 1|0000000 + uint32_t mask = 0x01C0; // 00|000001 1|1000000 + uint32_t chck1 = 0x0140; // 00|000001 0|1000000 + uint32_t chck2 = 0x0080; // 00|000000 1|0000000 // HIRES render in RGB works on a pixel-basis (1-bit data in framebuffer) // The pixel can be 'color', if it makes a 101 or 010 pattern with the two neighbour bits @@ -762,13 +762,13 @@ void UpdateDHiResCellRGB(int x, int y, uint16_t addr, bgra_t* pVideoAddress, boo uint8_t byteval4 = *(pMain + 1); // all 28 bits chained - DWORD dwordval = (byteval1 & 0x7F) | ((byteval2 & 0x7F) << 7) | ((byteval3 & 0x7F) << 14) | ((byteval4 & 0x7F) << 21); + uint32_t dwordval = (byteval1 & 0x7F) | ((byteval2 & 0x7F) << 7) | ((byteval3 & 0x7F) << 14) | ((byteval4 & 0x7F) << 21); // Extraction of 7 color pixels and 7x4 bits int bits[7]; UINT32 colors[7]; int color = 0; - DWORD dwordval_tmp = dwordval; + uint32_t dwordval_tmp = dwordval; for (int i = 0; i < 7; i++) { bits[i] = dwordval_tmp & 0xF; @@ -972,7 +972,7 @@ int UpdateDHiRes160Cell (int x, int y, uint16_t addr, bgra_t *pVideoAddress) BYTE byteval3 = *pMain; BYTE byteval4 = (x < 39) ? *(pAux+1) : 0; - DWORD dwordval = (byteval1 & 0xF8) | ((byteval2 & 0xFF) << 8) | + uint32_t dwordval = (byteval1 & 0xF8) | ((byteval2 & 0xFF) << 8) | ((byteval3 & 0xFF) << 16) | ((byteval4 & 0x1F) << 24); dwordval <<= 2; @@ -1003,7 +1003,7 @@ int UpdateDHiRes160Cell (int x, int y, uint16_t addr, bgra_t *pVideoAddress) BYTE byteval3 = *pMain; BYTE byteval4 = (x < 39) ? *(pAux+1) : 0; - DWORD dwordval = (byteval1 & 0xFC) | ((byteval2 & 0xFF) << 8) | // NB. Needs more bits than above squashed version, to avoid vertical black lines + uint32_t dwordval = (byteval1 & 0xFC) | ((byteval2 & 0xFF) << 8) | // NB. Needs more bits than above squashed version, to avoid vertical black lines ((byteval3 & 0xFF) << 16) | ((byteval4 & 0x3F) << 24); dwordval <<= 2; diff --git a/source/Registry.cpp b/source/Registry.cpp index 3dc2579e..530d847a 100644 --- a/source/Registry.cpp +++ b/source/Registry.cpp @@ -34,9 +34,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA namespace _ini { //=========================================================================== - BOOL RegLoadString(LPCTSTR section, LPCTSTR key, BOOL /*peruser*/, LPTSTR buffer, DWORD chars) + BOOL RegLoadString(LPCTSTR section, LPCTSTR key, BOOL /*peruser*/, LPTSTR buffer, uint32_t chars) { - DWORD n = GetPrivateProfileString(section, key, NULL, buffer, chars, g_sConfigFile.c_str()); + uint32_t n = GetPrivateProfileString(section, key, NULL, buffer, chars, g_sConfigFile.c_str()); return n > 0; } @@ -56,7 +56,7 @@ namespace _ini { } //=========================================================================== -BOOL RegLoadString (LPCTSTR section, LPCTSTR key, BOOL peruser, LPTSTR buffer, DWORD chars) +BOOL RegLoadString (LPCTSTR section, LPCTSTR key, BOOL peruser, LPTSTR buffer, uint32_t chars) { if (!g_sConfigFile.empty()) return _ini::RegLoadString(section, key, peruser, buffer, chars); @@ -86,7 +86,7 @@ BOOL RegLoadString (LPCTSTR section, LPCTSTR key, BOOL peruser, LPTSTR buffer, D } //=========================================================================== -BOOL RegLoadString (LPCTSTR section, LPCTSTR key, BOOL peruser, LPTSTR buffer, DWORD chars, LPCTSTR defaultValue) +BOOL RegLoadString (LPCTSTR section, LPCTSTR key, BOOL peruser, LPTSTR buffer, uint32_t chars, LPCTSTR defaultValue) { BOOL success = RegLoadString(section, key, peruser, buffer, chars); if (!success) @@ -95,19 +95,19 @@ BOOL RegLoadString (LPCTSTR section, LPCTSTR key, BOOL peruser, LPTSTR buffer, D } //=========================================================================== -BOOL RegLoadValue (LPCTSTR section, LPCTSTR key, BOOL peruser, DWORD* value) { +BOOL RegLoadValue (LPCTSTR section, LPCTSTR key, BOOL peruser, uint32_t* value) { TCHAR buffer[32]; if (!RegLoadString(section, key, peruser, buffer, 32)) { return FALSE; } - *value = (DWORD)_ttoi(buffer); + *value = (uint32_t)_ttoi(buffer); return TRUE; } //=========================================================================== -BOOL RegLoadValue (LPCTSTR section, LPCTSTR key, BOOL peruser, DWORD* value, DWORD defaultValue) { +BOOL RegLoadValue (LPCTSTR section, LPCTSTR key, BOOL peruser, uint32_t* value, uint32_t defaultValue) { BOOL success = RegLoadValue(section, key, peruser, value); if (!success) *value = defaultValue; @@ -147,7 +147,7 @@ void RegSaveString (LPCTSTR section, LPCTSTR key, BOOL peruser, const std::strin } //=========================================================================== -void RegSaveValue (LPCTSTR section, LPCTSTR key, BOOL peruser, DWORD value) { +void RegSaveValue (LPCTSTR section, LPCTSTR key, BOOL peruser, uint32_t value) { std::string strValue = StrFormat("%d", value); RegSaveString(section, key, peruser, strValue.c_str()); } diff --git a/source/Registry.h b/source/Registry.h index 10210d23..e2adebef 100644 --- a/source/Registry.h +++ b/source/Registry.h @@ -6,12 +6,12 @@ #define REGLOAD_DEFAULT(a, b, c) RegLoadValue(TEXT(REG_CONFIG), (a), TRUE, (b), (c)) #define REGSAVE(a, b) RegSaveValue(TEXT(REG_CONFIG), (a), TRUE, (b)) -BOOL RegLoadString (LPCTSTR section, LPCTSTR key, BOOL peruser, LPTSTR buffer, DWORD chars); -BOOL RegLoadString (LPCTSTR section, LPCTSTR key, BOOL peruser, LPTSTR buffer, DWORD chars, LPCTSTR defaultValue); -BOOL RegLoadValue (LPCTSTR section, LPCTSTR key, BOOL peruser, DWORD* value); -BOOL RegLoadValue (LPCTSTR section, LPCTSTR key, BOOL peruser, DWORD* value, DWORD defaultValue); +BOOL RegLoadString (LPCTSTR section, LPCTSTR key, BOOL peruser, LPTSTR buffer, uint32_t chars); +BOOL RegLoadString (LPCTSTR section, LPCTSTR key, BOOL peruser, LPTSTR buffer, uint32_t chars, LPCTSTR defaultValue); +BOOL RegLoadValue (LPCTSTR section, LPCTSTR key, BOOL peruser, uint32_t* value); +BOOL RegLoadValue (LPCTSTR section, LPCTSTR key, BOOL peruser, uint32_t* value, uint32_t defaultValue); void RegSaveString (LPCTSTR section, LPCTSTR key, BOOL peruser, const std::string & buffer); -void RegSaveValue (LPCTSTR section, LPCTSTR key, BOOL peruser, DWORD value); +void RegSaveValue (LPCTSTR section, LPCTSTR key, BOOL peruser, uint32_t value); std::string RegGetConfigSlotSection(UINT slot); void RegDeleteConfigSlotSection(UINT slot); diff --git a/source/SSI263.cpp b/source/SSI263.cpp index 0d4146ac..c22f3b2a 100644 --- a/source/SSI263.cpp +++ b/source/SSI263.cpp @@ -69,7 +69,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #define SSI_CTTRAMP 0x03 #define SSI_FILFREQ 0x04 -const DWORD SAMPLE_RATE_SSI263 = 22050; +const uint32_t SAMPLE_RATE_SSI263 = 22050; //----------------------------------------------------------------------------- @@ -444,7 +444,7 @@ void SSI263::Update(void) // NB. next call to this function: nowNormalSpeed = false if (nowNormalSpeed) - m_byteOffset = (DWORD)-1; // ...which resets m_numSamplesError below + m_byteOffset = (uint32_t)-1; // ...which resets m_numSamplesError below //------------- @@ -455,7 +455,7 @@ void SSI263::Update(void) bool prefillBufferOnInit = false; - if (m_byteOffset == (DWORD)-1) + if (m_byteOffset == (uint32_t)-1) { // First time in this func (or transitioned from full-speed to normal speed, or a ring-buffer reset) #ifdef DBG_SSI263_UPDATE @@ -577,7 +577,7 @@ void SSI263::Update(void) // When the AppleWin code restarts and reads the ring-buffer position it'll be at a random point, and maybe nearly full (>50% full) // - so the code waits until it drains (nNumSamples=0 each time) // - but it takes a large number of calls to this func to drain to an acceptable level - m_byteOffset = (DWORD)-1; + m_byteOffset = (uint32_t)-1; #if defined(DBG_SSI263_UPDATE) double fTicksSecs = (double)GetTickCount() / 1000.0; LogOutput("%010.3f: [SSUpdt%1d] Reset ring-buffer\n", fTicksSecs, m_device); @@ -658,7 +658,7 @@ void SSI263::Update(void) short *pDSLockedBuffer0, *pDSLockedBuffer1; hr = DSGetLock(SSI263SingleVoice.lpDSBvoice, - m_byteOffset, (DWORD)nNumSamples * sizeof(short) * m_kNumChannels, + m_byteOffset, (uint32_t)nNumSamples * sizeof(short) * m_kNumChannels, &pDSLockedBuffer0, &dwDSLockedBufferSize0, &pDSLockedBuffer1, &dwDSLockedBufferSize1); if (FAILED(hr)) @@ -674,7 +674,7 @@ void SSI263::Update(void) if (FAILED(hr)) return; - m_byteOffset = (m_byteOffset + (DWORD)nNumSamples*sizeof(short)*m_kNumChannels) % m_kDSBufferByteSize; + m_byteOffset = (m_byteOffset + (uint32_t)nNumSamples*sizeof(short)*m_kNumChannels) % m_kDSBufferByteSize; // @@ -919,7 +919,7 @@ void SSI263::Unmute(void) } } -void SSI263::SetVolume(DWORD dwVolume, DWORD dwVolumeMax) +void SSI263::SetVolume(uint32_t dwVolume, uint32_t dwVolumeMax) { SSI263SingleVoice.dwUserVolume = dwVolume; diff --git a/source/SSI263.h b/source/SSI263.h index 13b3720a..9631e731 100644 --- a/source/SSI263.h +++ b/source/SSI263.h @@ -40,7 +40,7 @@ public: // m_numSamplesError = 0; - m_byteOffset = (DWORD)-1; + m_byteOffset = (uint32_t)-1; m_currSampleSum = 0; m_currNumSamples = 0; m_currSampleMod4 = 0; @@ -87,7 +87,7 @@ public: void Mute(void); void Unmute(void); - void SetVolume(DWORD dwVolume, DWORD dwVolumeMax); + void SetVolume(uint32_t dwVolume, uint32_t dwVolumeMax); void PeriodicUpdate(UINT executedCycles); void Update(void); @@ -116,7 +116,7 @@ private: static const BYTE m_Votrax2SSI263[/*64*/]; static const unsigned short m_kNumChannels = 1; - static const DWORD m_kDSBufferByteSize = MAX_SAMPLES * sizeof(short) * m_kNumChannels; + static const uint32_t m_kDSBufferByteSize = MAX_SAMPLES * sizeof(short) * m_kNumChannels; short m_mixBufferSSI263[m_kDSBufferByteSize / sizeof(short)]; VOICE SSI263SingleVoice; @@ -170,7 +170,7 @@ private: // int m_numSamplesError; - DWORD m_byteOffset; + uint32_t m_byteOffset; int m_currSampleSum; int m_currNumSamples; UINT m_currSampleMod4; diff --git a/source/SoundCore.cpp b/source/SoundCore.cpp index 9db6cc43..71d87590 100644 --- a/source/SoundCore.cpp +++ b/source/SoundCore.cpp @@ -139,7 +139,7 @@ static const char *DirectSound_ErrorText (HRESULT error) //----------------------------------------------------------------------------- -HRESULT DSGetLock(LPDIRECTSOUNDBUFFER pVoice, DWORD dwOffset, DWORD dwBytes, +HRESULT DSGetLock(LPDIRECTSOUNDBUFFER pVoice, uint32_t dwOffset, uint32_t dwBytes, SHORT** ppDSLockedBuffer0, DWORD* pdwDSLockedBufferSize0, SHORT** ppDSLockedBuffer1, DWORD* pdwDSLockedBufferSize1) { @@ -182,7 +182,7 @@ HRESULT DSGetLock(LPDIRECTSOUNDBUFFER pVoice, DWORD dwOffset, DWORD dwBytes, //----------------------------------------------------------------------------- -HRESULT DSGetSoundBuffer(VOICE* pVoice, DWORD dwFlags, DWORD dwBufferSize, DWORD nSampleRate, int nChannels, const char* pszDevName) +HRESULT DSGetSoundBuffer(VOICE* pVoice, uint32_t dwFlags, uint32_t dwBufferSize, uint32_t nSampleRate, int nChannels, const char* pszDevName) { if (!g_lpDS) return E_FAIL; @@ -265,7 +265,7 @@ bool DSVoiceStop(PVOICE Voice) } // Use this to Play() -bool DSZeroVoiceBuffer(PVOICE Voice, DWORD dwBufferSize) +bool DSZeroVoiceBuffer(PVOICE Voice, uint32_t dwBufferSize) { #ifdef NO_DIRECT_X return false; @@ -308,7 +308,7 @@ bool DSZeroVoiceBuffer(PVOICE Voice, DWORD dwBufferSize) //----------------------------------------------------------------------------- -bool DSZeroVoiceWritableBuffer(PVOICE Voice, DWORD dwBufferSize) +bool DSZeroVoiceWritableBuffer(PVOICE Voice, uint32_t dwBufferSize) { DWORD dwDSLockedBufferSize0=0, dwDSLockedBufferSize1=0; SHORT *pDSLockedBuffer0, *pDSLockedBuffer1; @@ -613,7 +613,7 @@ void DSUninit() //----------------------------------------------------------------------------- -LONG NewVolume(DWORD dwVolume, DWORD dwVolumeMax) +LONG NewVolume(uint32_t dwVolume, uint32_t dwVolumeMax) { float fVol = (float) dwVolume / (float) dwVolumeMax; // 0.0=Max, 1.0=Min @@ -654,7 +654,7 @@ static DWORD_PTR g_pdwAdviseCookie = 0; // Not really used as pointer. static IReferenceClock *g_pRefClock = NULL; static HANDLE g_hSemaphore = NULL; static bool g_bRefClockTimerActive = false; -static DWORD g_dwLastUsecPeriod = 0; +static uint32_t g_dwLastUsecPeriod = 0; bool SysClk_InitTimer() @@ -698,7 +698,7 @@ void SysClk_WaitTimer() // -void SysClk_StartTimerUsec(DWORD dwUsecPeriod) +void SysClk_StartTimerUsec(uint32_t dwUsecPeriod) { if(g_bRefClockTimerActive && (g_dwLastUsecPeriod == dwUsecPeriod)) return; diff --git a/source/SoundCore.h b/source/SoundCore.h index cdd2f46f..3fd41103 100644 --- a/source/SoundCore.h +++ b/source/SoundCore.h @@ -12,7 +12,7 @@ struct VOICE bool bMute; LONG nVolume; // Current volume (as used by DirectSound) LONG nFadeVolume; // Current fade volume (as used by DirectSound) - DWORD dwUserVolume; // Volume from slider on Property Sheet (0=Max) + uint32_t dwUserVolume; // Volume from slider on Property Sheet (0=Max) bool bIsSpeaker; bool bRecentlyActive; // (Speaker only) false after 0.2s of speaker inactivity std::string name; @@ -36,16 +36,16 @@ struct VOICE typedef VOICE* PVOICE; -HRESULT DSGetLock(LPDIRECTSOUNDBUFFER pVoice, DWORD dwOffset, DWORD dwBytes, +HRESULT DSGetLock(LPDIRECTSOUNDBUFFER pVoice, uint32_t dwOffset, uint32_t dwBytes, SHORT** ppDSLockedBuffer0, DWORD* pdwDSLockedBufferSize0, SHORT** ppDSLockedBuffer1, DWORD* pdwDSLockedBufferSize1); -HRESULT DSGetSoundBuffer(VOICE* pVoice, DWORD dwFlags, DWORD dwBufferSize, DWORD nSampleRate, int nChannels, const char* pszDevName); +HRESULT DSGetSoundBuffer(VOICE* pVoice, uint32_t dwFlags, uint32_t dwBufferSize, uint32_t nSampleRate, int nChannels, const char* pszDevName); void DSReleaseSoundBuffer(VOICE* pVoice); bool DSVoiceStop(PVOICE Voice); -bool DSZeroVoiceBuffer(PVOICE Voice, DWORD dwBufferSize); -bool DSZeroVoiceWritableBuffer(PVOICE Voice, DWORD dwBufferSize); +bool DSZeroVoiceBuffer(PVOICE Voice, uint32_t dwBufferSize); +bool DSZeroVoiceWritableBuffer(PVOICE Voice, uint32_t dwBufferSize); enum eFADE {FADE_NONE, FADE_IN, FADE_OUT}; void SoundCore_SetFade(eFADE FadeType); @@ -60,12 +60,12 @@ void SoundCore_SetErrorMax(const int nErrorMax); bool DSInit(); void DSUninit(); -LONG NewVolume(DWORD dwVolume, DWORD dwVolumeMax); +LONG NewVolume(uint32_t dwVolume, uint32_t dwVolumeMax); void SysClk_WaitTimer(); bool SysClk_InitTimer(); void SysClk_UninitTimer(); -void SysClk_StartTimerUsec(DWORD dwUsecPeriod); +void SysClk_StartTimerUsec(uint32_t dwUsecPeriod); void SysClk_StopTimer(); // diff --git a/source/Speaker.cpp b/source/Speaker.cpp index a179eb9e..6369a259 100644 --- a/source/Speaker.cpp +++ b/source/Speaker.cpp @@ -38,7 +38,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include "YamlHelper.h" #include "Riff.h" -#include "Debugger/Debug.h" // For DWORD extbench +#include "Debugger/Debug.h" // For uint32_t extbench // Notes: // @@ -56,7 +56,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // NB. Setting g_nSPKR_NumChannels=1 still works (ie. mono). // . Retain it for a while in case there are regressions with the new 2-channel code, then remove it. static const unsigned short g_nSPKR_NumChannels = 2; -static const DWORD g_dwDSSpkrBufferSize = MAX_SAMPLES * sizeof(short) * g_nSPKR_NumChannels; +static const uint32_t g_dwDSSpkrBufferSize = MAX_SAMPLES * sizeof(short) * g_nSPKR_NumChannels; //------------------------------------- @@ -112,11 +112,11 @@ UINT Spkr_GetNumChannels(void) static void DisplayBenchmarkResults () { - DWORD totaltime = GetTickCount()-extbench; + uint32_t totaltime = GetTickCount()-extbench; GetFrame().VideoRedrawScreen(); std::string strText = StrFormat("This benchmark took %u.%02u seconds.", - (unsigned)(totaltime / 1000), - (unsigned)((totaltime / 10) % 100)); + (uint32_t)(totaltime / 1000), + (uint32_t)((totaltime / 10) % 100)); GetFrame().FrameMessageBox(strText.c_str(), "Benchmark Results", MB_ICONINFORMATION | MB_SETFOREGROUND); @@ -446,7 +446,7 @@ BYTE __stdcall SpkrToggle (WORD, WORD, BYTE, BYTE, ULONG nExecutedCycles) //============================================================================= // Called by ContinueExecution() -void SpkrUpdate (DWORD totalcycles) +void SpkrUpdate (uint32_t totalcycles) { #ifdef LOG_PERF_TIMINGS extern UINT64 g_timeSpeaker; @@ -508,7 +508,7 @@ void SpkrUpdate_Timer() //============================================================================= -static DWORD dwByteOffset = (DWORD)-1; +static uint32_t dwByteOffset = (uint32_t)-1; static int nNumSamplesError = 0; static int nDbgSpkrCnt = 0; @@ -544,7 +544,7 @@ static ULONG Spkr_SubmitWaveBuffer_FullSpeed(short* pSpeakerBuffer, ULONG nNumSa if(FAILED(hr)) return nNumSamples; - if(dwByteOffset == (DWORD)-1) + if(dwByteOffset == (uint32_t)-1) { // First time in this func (probably after re-init (Spkr_SubmitWaveBuffer())) @@ -613,7 +613,7 @@ static ULONG Spkr_SubmitWaveBuffer_FullSpeed(short* pSpeakerBuffer, ULONG nNumSa if(nNumSamplesToUse >= 128) // Limit the buffer unlock/locking to a minimum { hr = DSGetLock(SpeakerVoice.lpDSBvoice, - dwByteOffset, (DWORD)nNumSamplesToUse * sizeof(short) * g_nSPKR_NumChannels, + dwByteOffset, (uint32_t)nNumSamplesToUse * sizeof(short) * g_nSPKR_NumChannels, &pDSLockedBuffer0, &dwDSLockedBufferSize0, &pDSLockedBuffer1, &dwDSLockedBufferSize1); if (FAILED(hr)) @@ -621,8 +621,8 @@ static ULONG Spkr_SubmitWaveBuffer_FullSpeed(short* pSpeakerBuffer, ULONG nNumSa // - DWORD dwBufferSize0 = 0; - DWORD dwBufferSize1 = 0; + uint32_t dwBufferSize0 = 0; + uint32_t dwBufferSize1 = 0; if(nNumSamples) { @@ -712,7 +712,7 @@ static ULONG Spkr_SubmitWaveBuffer_FullSpeed(short* pSpeakerBuffer, ULONG nNumSa if(FAILED(hr)) return nNumSamples; - dwByteOffset = (dwByteOffset + (DWORD)nNumSamplesToUse*sizeof(short)*g_nSPKR_NumChannels) % g_dwDSSpkrBufferSize; + dwByteOffset = (dwByteOffset + (uint32_t)nNumSamplesToUse*sizeof(short)*g_nSPKR_NumChannels) % g_dwDSSpkrBufferSize; } return nNumSamples; @@ -730,7 +730,7 @@ static ULONG Spkr_SubmitWaveBuffer(short* pSpeakerBuffer, ULONG nNumSamples) if(pSpeakerBuffer == NULL) { // Re-init from SpkrReset() - dwByteOffset = (DWORD)-1; + dwByteOffset = (uint32_t)-1; nNumSamplesError = 0; // Don't call DSZeroVoiceBuffer() - get noise with "VIA AC'97 Enhanced Audio Controller" @@ -755,7 +755,7 @@ static ULONG Spkr_SubmitWaveBuffer(short* pSpeakerBuffer, ULONG nNumSamples) return nNumSamples; } - if(dwByteOffset == (DWORD)-1) + if(dwByteOffset == (uint32_t)-1) { // First time in this func (probably after re-init (above)) @@ -836,7 +836,7 @@ static ULONG Spkr_SubmitWaveBuffer(short* pSpeakerBuffer, ULONG nNumSamples) //LogOutput("[Submit] C=%08X, PC=%08X, WC=%08X, Diff=%08X, Off=%08X, NS=%08X +++\n", nDbgSpkrCnt, dwCurrentPlayCursor, dwCurrentWriteCursor, dwCurrentWriteCursor-dwCurrentPlayCursor, dwByteOffset, nNumSamplesToUse); hr = DSGetLock(SpeakerVoice.lpDSBvoice, - dwByteOffset, (DWORD)nNumSamplesToUse * sizeof(short) * g_nSPKR_NumChannels, + dwByteOffset, (uint32_t)nNumSamplesToUse * sizeof(short) * g_nSPKR_NumChannels, &pDSLockedBuffer0, &dwDSLockedBufferSize0, &pDSLockedBuffer1, &dwDSLockedBufferSize1); if (FAILED(hr)) @@ -865,7 +865,7 @@ static ULONG Spkr_SubmitWaveBuffer(short* pSpeakerBuffer, ULONG nNumSamples) return nNumSamples; } - dwByteOffset = (dwByteOffset + (DWORD)nNumSamplesToUse*sizeof(short)*g_nSPKR_NumChannels) % g_dwDSSpkrBufferSize; + dwByteOffset = (dwByteOffset + (uint32_t)nNumSamplesToUse*sizeof(short)*g_nSPKR_NumChannels) % g_dwDSSpkrBufferSize; } return bBufferError ? nNumSamples : nNumSamplesToUse; @@ -926,12 +926,12 @@ bool Spkr_IsActive() //----------------------------------------------------------------------------- -DWORD SpkrGetVolume() +uint32_t SpkrGetVolume() { return SpeakerVoice.dwUserVolume; } -void SpkrSetVolume(DWORD dwVolume, DWORD dwVolumeMax) +void SpkrSetVolume(uint32_t dwVolume, uint32_t dwVolumeMax) { SpeakerVoice.dwUserVolume = dwVolume; @@ -996,7 +996,7 @@ bool Spkr_DSInit() hr = SpeakerVoice.lpDSBvoice->GetCurrentPosition(&dwCurrentPlayCursor, &dwCurrentWriteCursor); LogFileOutput("Spkr_DSInit: GetCurrentPosition kludge (%08X)\n", hr); - LogOutput("[DSInit] PC=%08X, WC=%08X, Diff=%08X\n", dwCurrentPlayCursor, dwCurrentWriteCursor, dwCurrentWriteCursor-dwCurrentPlayCursor); + LogOutput("[DSInit] PC=%08" DWORD_T_FMT ", WC=%08" DWORD_T_FMT ", Diff=%08" DWORD_T_FMT "\n", dwCurrentPlayCursor, dwCurrentWriteCursor, dwCurrentWriteCursor-dwCurrentPlayCursor); } return true; diff --git a/source/Speaker.h b/source/Speaker.h index 16146b55..f4ed2fb0 100644 --- a/source/Speaker.h +++ b/source/Speaker.h @@ -22,10 +22,10 @@ void SpkrInitialize (); void SpkrReinitialize (); void SpkrReset(); void SpkrSetEmulationType (SoundType_e newSoundType); -void SpkrUpdate (DWORD); +void SpkrUpdate (uint32_t); void SpkrUpdate_Timer(); -DWORD SpkrGetVolume(); -void SpkrSetVolume(DWORD dwVolume, DWORD dwVolumeMax); +uint32_t SpkrGetVolume(); +void SpkrSetVolume(uint32_t dwVolume, uint32_t dwVolumeMax); void Spkr_Mute(); void Spkr_Unmute(); bool Spkr_IsActive(); diff --git a/source/StdAfx.h b/source/StdAfx.h index ff8151a6..11afa004 100644 --- a/source/StdAfx.h +++ b/source/StdAfx.h @@ -63,6 +63,7 @@ typedef UINT64 uint64_t; #else #define SIZE_T_FMT "zu" #define PTRDIFF_T_FMT "td" +#define DWORD_T_FMT "lX" #endif #else @@ -83,5 +84,6 @@ typedef UINT64 uint64_t; #define SIZE_T_FMT "zu" #define PTRDIFF_T_FMT "td" +#define DWORD_T_FMT "X" #endif diff --git a/source/Tfe/tfearch.cpp b/source/Tfe/tfearch.cpp index f0c42cbd..400b2c02 100644 --- a/source/Tfe/tfearch.cpp +++ b/source/Tfe/tfearch.cpp @@ -391,7 +391,7 @@ void tfe_arch_set_mac( const BYTE mac[6] ) #endif } -void tfe_arch_set_hashfilter(const DWORD hash_mask[2]) +void tfe_arch_set_hashfilter(const uint32_t hash_mask[2]) { #if defined(TFE_DEBUG_ARCH) || defined(TFE_DEBUG_FRAMES) if(g_fh) fprintf( g_fh, "New hash filter set: %08X:%08X.\n", diff --git a/source/Tfe/tfearch.h b/source/Tfe/tfearch.h index 45988a10..5fef7566 100644 --- a/source/Tfe/tfearch.h +++ b/source/Tfe/tfearch.h @@ -32,7 +32,7 @@ #include extern void tfe_arch_set_mac(const BYTE mac[6]); -extern void tfe_arch_set_hashfilter(const DWORD hash_mask[2]); +extern void tfe_arch_set_hashfilter(const uint32_t hash_mask[2]); struct pcap; typedef struct pcap pcap_t; diff --git a/source/Uthernet1.cpp b/source/Uthernet1.cpp index 4c66a548..36bf8851 100644 --- a/source/Uthernet1.cpp +++ b/source/Uthernet1.cpp @@ -412,7 +412,7 @@ void Uthernet1::tfe_sideeffects_write_pp(WORD ppaddress, int oddaddress) case TFE_PP_ADDR_LOG_ADDR_FILTER+6: { unsigned int pos = 8 * (ppaddress - TFE_PP_ADDR_LOG_ADDR_FILTER + oddaddress); - DWORD *p = (pos < 32) ? &tfe_hash_mask[0] : &tfe_hash_mask[1]; + uint32_t *p = (pos < 32) ? &tfe_hash_mask[0] : &tfe_hash_mask[1]; *p &= ~(0xFF << pos); /* clear out relevant bits */ *p |= GET_PP_8(ppaddress+oddaddress) << pos; diff --git a/source/Uthernet1.h b/source/Uthernet1.h index ad1b6dfd..10b865d5 100644 --- a/source/Uthernet1.h +++ b/source/Uthernet1.h @@ -175,7 +175,7 @@ private: BYTE tfe_ia_mac[6]; /* remember the value of the hash mask */ - DWORD tfe_hash_mask[2]; + uint32_t tfe_hash_mask[2]; int tfe_recv_broadcast; /* broadcast */ int tfe_recv_mac; /* individual address (IA) */ diff --git a/source/Uthernet2.cpp b/source/Uthernet2.cpp index ab0d13f6..70339045 100644 --- a/source/Uthernet2.cpp +++ b/source/Uthernet2.cpp @@ -1665,7 +1665,7 @@ bool Uthernet2::GetRegistryVirtualDNS(UINT slot) // as it is backward compatible // (except for the initial value of PTIMER which is anyway never used) - DWORD enabled = 1; + uint32_t enabled = 1; RegLoadValue(regSection.c_str(), REGVALUE_UTHERNET_VIRTUAL_DNS, TRUE, &enabled); return enabled != 0; } diff --git a/source/Utilities.cpp b/source/Utilities.cpp index 3e9897e9..64a61899 100644 --- a/source/Utilities.cpp +++ b/source/Utilities.cpp @@ -55,7 +55,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Backwards compatibility with AppleWin <1.24.0 static void LoadConfigOldJoystick_v1(const UINT uJoyNum) { - DWORD dwOldJoyType; + uint32_t dwOldJoyType; if (!REGLOAD(TEXT(uJoyNum==0 ? REGVALUE_OLD_JOYSTICK0_EMU_TYPE1 : REGVALUE_OLD_JOYSTICK1_EMU_TYPE1), &dwOldJoyType)) return; // EG. Old AppleWin never installed @@ -91,12 +91,12 @@ static void LoadConfigOldJoystick_v1(const UINT uJoyNum) // - Registry images may have been deleted from disk, so avoid the MessageBox void LoadConfiguration(bool loadImages) { - DWORD dwComputerType = 0; + uint32_t dwComputerType = 0; eApple2Type apple2Type = A2TYPE_APPLE2EENHANCED; if (REGLOAD(TEXT(REGVALUE_APPLE2_TYPE), &dwComputerType)) { - const DWORD dwLoadedComputerType = dwComputerType; + const uint32_t dwLoadedComputerType = dwComputerType; if ( (dwComputerType >= A2TYPE_MAX) || (dwComputerType >= A2TYPE_UNDEFINED && dwComputerType < A2TYPE_CLONE) || @@ -141,7 +141,7 @@ void LoadConfiguration(bool loadImages) // - DWORD dwMainCpuType; + uint32_t dwMainCpuType; REGLOAD_DEFAULT(TEXT(REGVALUE_CPU_TYPE), &dwMainCpuType, CPU_65C02); if (dwMainCpuType != CPU_6502 && dwMainCpuType != CPU_65C02) dwMainCpuType = CPU_65C02; @@ -149,7 +149,7 @@ void LoadConfiguration(bool loadImages) // - DWORD dwJoyType; + uint32_t dwJoyType; if (REGLOAD(TEXT(REGVALUE_JOYSTICK0_EMU_TYPE), &dwJoyType)) JoySetJoyType(JN_JOYSTICK0, dwJoyType); else if (REGLOAD(TEXT(REGVALUE_OLD_JOYSTICK0_EMU_TYPE2), &dwJoyType)) // GH#434 @@ -164,14 +164,14 @@ void LoadConfiguration(bool loadImages) else LoadConfigOldJoystick_v1(JN_JOYSTICK1); - DWORD copyProtectionDongleType; + uint32_t copyProtectionDongleType; std::string regSection = RegGetConfigSlotSection(GAME_IO_CONNECTOR); if (RegLoadValue(regSection.c_str(), REGVALUE_GAME_IO_TYPE, TRUE, ©ProtectionDongleType)) SetCopyProtectionDongleType((DONGLETYPE)copyProtectionDongleType); else SetCopyProtectionDongleType(DT_EMPTY); - DWORD dwSoundType; + uint32_t dwSoundType; REGLOAD_DEFAULT(TEXT(REGVALUE_SOUND_EMULATION), &dwSoundType, REG_SOUNDTYPE_WAVE); switch (dwSoundType) { @@ -192,7 +192,7 @@ void LoadConfiguration(bool loadImages) // - DWORD dwTmp = 0; + uint32_t dwTmp = 0; if(REGLOAD(TEXT(REGVALUE_FS_SHOW_SUBUNIT_STATUS), &dwTmp)) GetFrame().SetFullScreenShowSubunitStatus(dwTmp ? true : false); @@ -256,7 +256,7 @@ void LoadConfiguration(bool loadImages) // copy it to the new location PCapBackend::SetRegistryInterface(slot, szFilename); - DWORD tfeEnabled; + uint32_t tfeEnabled; REGLOAD_DEFAULT(TEXT(REGVALUE_UTHERNET_ACTIVE), &tfeEnabled, 0); GetCardMgr().Insert(SLOT3, tfeEnabled ? CT_Uthernet : CT_Empty); } @@ -304,7 +304,7 @@ void LoadConfiguration(bool loadImages) GetCardMgr().GetDisk2CardMgr().LoadLastDiskImage(); // Do this after populating the slots with Disk II controller(s) - DWORD dwEnhanceDisk; + uint32_t dwEnhanceDisk; REGLOAD_DEFAULT(TEXT(REGVALUE_ENHANCE_DISK_SPEED), &dwEnhanceDisk, 1); GetCardMgr().GetDisk2CardMgr().SetEnhanceDisk(dwEnhanceDisk ? true : false); diff --git a/source/Video.cpp b/source/Video.cpp index a8a35238..322c24c4 100644 --- a/source/Video.cpp +++ b/source/Video.cpp @@ -313,7 +313,7 @@ void Video::VideoLoadSnapshot(YamlLoadHelper& yamlLoadHelper, UINT version) // References to Jim Sather's books are given as eg: // UTAIIe:5-7,P3 (Understanding the Apple IIe, chapter 5, page 7, Paragraph 3) // -WORD Video::VideoGetScannerAddress(DWORD nCycles, VideoScanner_e videoScannerAddr /*= VS_FullAddr*/) +WORD Video::VideoGetScannerAddress(uint32_t nCycles, VideoScanner_e videoScannerAddr /*= VS_FullAddr*/) { const int kHBurstClock = 53; // clock when Color Burst starts const int kHBurstClocks = 4; // clocks per Color Burst duration @@ -446,7 +446,7 @@ WORD Video::VideoGetScannerAddress(DWORD nCycles, VideoScanner_e videoScannerAdd //=========================================================================== // Called when *outside* of CpuExecute() -bool Video::VideoGetVblBarEx(const DWORD dwCyclesThisFrame) +bool Video::VideoGetVblBarEx(const uint32_t dwCyclesThisFrame) { if (g_bFullSpeed) { @@ -458,7 +458,7 @@ bool Video::VideoGetVblBarEx(const DWORD dwCyclesThisFrame) } // Called when *inside* CpuExecute() -bool Video::VideoGetVblBar(const DWORD uExecutedCycles) +bool Video::VideoGetVblBar(const uint32_t uExecutedCycles) { if (g_bFullSpeed) { @@ -654,18 +654,18 @@ void Video::Config_Load_Video() , VT127_NUM_VIDEO_MODES }; - DWORD dwTmp; + uint32_t dwTmp; - REGLOAD_DEFAULT(TEXT(REGVALUE_VIDEO_MODE), &dwTmp, (DWORD)VT_DEFAULT); + REGLOAD_DEFAULT(TEXT(REGVALUE_VIDEO_MODE), &dwTmp, (uint32_t)VT_DEFAULT); g_eVideoType = dwTmp; - REGLOAD_DEFAULT(TEXT(REGVALUE_VIDEO_STYLE), &dwTmp, (DWORD)VS_HALF_SCANLINES); + REGLOAD_DEFAULT(TEXT(REGVALUE_VIDEO_STYLE), &dwTmp, (uint32_t)VS_HALF_SCANLINES); g_eVideoStyle = (VideoStyle_e)dwTmp; - REGLOAD_DEFAULT(TEXT(REGVALUE_VIDEO_MONO_COLOR), &dwTmp, (DWORD)RGB(0xC0, 0xC0, 0xC0)); + REGLOAD_DEFAULT(TEXT(REGVALUE_VIDEO_MONO_COLOR), &dwTmp, (uint32_t)RGB(0xC0, 0xC0, 0xC0)); g_nMonochromeRGB = (COLORREF)dwTmp; - REGLOAD_DEFAULT(TEXT(REGVALUE_VIDEO_REFRESH_RATE), &dwTmp, (DWORD)VR_60HZ); + REGLOAD_DEFAULT(TEXT(REGVALUE_VIDEO_REFRESH_RATE), &dwTmp, (uint32_t)VR_60HZ); SetVideoRefreshRate((VideoRefreshRate_e)dwTmp); // @@ -673,13 +673,13 @@ void Video::Config_Load_Video() const UINT16* pOldVersion = GetOldAppleWinVersion(); if (pOldVersion[0] == 1 && pOldVersion[1] <= 28 && pOldVersion[2] <= 1) { - DWORD dwHalfScanLines; + uint32_t dwHalfScanLines; REGLOAD_DEFAULT(TEXT(REGVALUE_VIDEO_HALF_SCAN_LINES), &dwHalfScanLines, 0); if (dwHalfScanLines) - g_eVideoStyle = (VideoStyle_e) ((DWORD)g_eVideoStyle | VS_HALF_SCANLINES); + g_eVideoStyle = (VideoStyle_e) ((uint32_t)g_eVideoStyle | VS_HALF_SCANLINES); else - g_eVideoStyle = (VideoStyle_e) ((DWORD)g_eVideoStyle & ~VS_HALF_SCANLINES); + g_eVideoStyle = (VideoStyle_e) ((uint32_t)g_eVideoStyle & ~VS_HALF_SCANLINES); REGSAVE(TEXT(REGVALUE_VIDEO_STYLE), g_eVideoStyle); } diff --git a/source/Video.h b/source/Video.h index 22a9ae16..1d9a8e9b 100644 --- a/source/Video.h +++ b/source/Video.h @@ -222,9 +222,9 @@ public: void ClearSHRResidue(void); enum VideoScanner_e {VS_FullAddr, VS_PartialAddrV, VS_PartialAddrH}; - WORD VideoGetScannerAddress(DWORD nCycles, VideoScanner_e videoScannerAddr = VS_FullAddr); - bool VideoGetVblBarEx(const DWORD dwCyclesThisFrame); - bool VideoGetVblBar(const DWORD uExecutedCycles); + WORD VideoGetScannerAddress(uint32_t nCycles, VideoScanner_e videoScannerAddr = VS_FullAddr); + bool VideoGetVblBarEx(const uint32_t dwCyclesThisFrame); + bool VideoGetVblBar(const uint32_t uExecutedCycles); bool VideoGetSW80COL(void); bool VideoGetSWDHIRES(void); @@ -289,7 +289,7 @@ private: int g_nAltCharSetOffset; uint32_t g_uVideoMode; // Current Video Mode (this is the last set one as it may change mid-scan line!) - DWORD g_eVideoType; // saved to Registry + uint32_t g_eVideoType; // saved to Registry VideoStyle_e g_eVideoStyle; bool g_bVideoScannerNTSC; // NTSC video scanning (or PAL) COLORREF g_nMonochromeRGB; // saved to Registry diff --git a/source/Windows/AppleWin.cpp b/source/Windows/AppleWin.cpp index b62d141d..67e0a693 100644 --- a/source/Windows/AppleWin.cpp +++ b/source/Windows/AppleWin.cpp @@ -219,18 +219,18 @@ static void ContinueExecution(void) const UINT uCyclesToExecuteWithFeedback = (nCyclesWithFeedback >= 0) ? nCyclesWithFeedback : 0; - const DWORD uCyclesToExecute = (g_nAppMode == MODE_RUNNING) ? uCyclesToExecuteWithFeedback + const uint32_t uCyclesToExecute = (g_nAppMode == MODE_RUNNING) ? uCyclesToExecuteWithFeedback /* MODE_STEPPING */ : 0; const bool bVideoUpdate = !g_bFullSpeed; - const DWORD uActualCyclesExecuted = CpuExecute(uCyclesToExecute, bVideoUpdate); + const uint32_t uActualCyclesExecuted = CpuExecute(uCyclesToExecute, bVideoUpdate); g_dwCyclesThisFrame += uActualCyclesExecuted; GetCardMgr().Update(uActualCyclesExecuted); // - DWORD uSpkrActualCyclesExecuted = uActualCyclesExecuted; + uint32_t uSpkrActualCyclesExecuted = uActualCyclesExecuted; bool bModeStepping_WaitTimer = false; if (g_nAppMode == MODE_STEPPING && !IsDebugSteppingAtFullSpeed()) diff --git a/source/Windows/Win32Frame.cpp b/source/Windows/Win32Frame.cpp index ce92112d..aeda910b 100644 --- a/source/Windows/Win32Frame.cpp +++ b/source/Windows/Win32Frame.cpp @@ -180,15 +180,15 @@ void Win32Frame::Benchmark(void) // SEE HOW MANY TEXT FRAMES PER SECOND WE CAN PRODUCE WITH NOTHING ELSE // GOING ON, CHANGING HALF OF THE BYTES IN THE VIDEO BUFFER EACH FRAME TO // SIMULATE THE ACTIVITY OF AN AVERAGE GAME - DWORD totaltextfps = 0; + uint32_t totaltextfps = 0; video.SetVideoMode(VF_TEXT); memset(mem + 0x400, 0x14, 0x400); VideoRedrawScreen(); - DWORD milliseconds = GetTickCount(); + uint32_t milliseconds = GetTickCount(); while (GetTickCount() == milliseconds); milliseconds = GetTickCount(); - DWORD cycle = 0; + uint32_t cycle = 0; do { if (cycle & 1) memset(mem + 0x400, 0x14, 0x400); @@ -203,7 +203,7 @@ void Win32Frame::Benchmark(void) // SEE HOW MANY HIRES FRAMES PER SECOND WE CAN PRODUCE WITH NOTHING ELSE // GOING ON, CHANGING HALF OF THE BYTES IN THE VIDEO BUFFER EACH FRAME TO // SIMULATE THE ACTIVITY OF AN AVERAGE GAME - DWORD totalhiresfps = 0; + uint32_t totalhiresfps = 0; video.SetVideoMode(VF_HIRES); memset(mem + 0x2000, 0x14, 0x2000); VideoRedrawScreen(); @@ -224,7 +224,7 @@ void Win32Frame::Benchmark(void) // DETERMINE HOW MANY 65C02 CLOCK CYCLES WE CAN EMULATE PER SECOND WITH // NOTHING ELSE GOING ON - DWORD totalmhz10[2] = { 0,0 }; // bVideoUpdate & !bVideoUpdate + uint32_t totalmhz10[2] = { 0,0 }; // bVideoUpdate & !bVideoUpdate for (UINT i = 0; i < 2; i++) { CpuSetupBenchmark(); @@ -287,7 +287,7 @@ void Win32Frame::Benchmark(void) // DO A REALISTIC TEST OF HOW MANY FRAMES PER SECOND WE CAN PRODUCE // WITH FULL EMULATION OF THE CPU, JOYSTICK, AND DISK HAPPENING AT // THE SAME TIME - DWORD realisticfps = 0; + uint32_t realisticfps = 0; memset(mem + 0x2000, 0xAA, 0x2000); VideoRedrawScreen(); milliseconds = GetTickCount(); @@ -298,7 +298,7 @@ void Win32Frame::Benchmark(void) if (realisticfps < 10) { int cycles = 100000; while (cycles > 0) { - DWORD executedcycles = CpuExecute(103, true); + uint32_t executedcycles = CpuExecute(103, true); cycles -= executedcycles; GetCardMgr().GetDisk2CardMgr().Update(executedcycles); } @@ -600,13 +600,13 @@ void Win32Frame::Restart() PostMessage(g_hFrameWindow, WM_CLOSE, 0, 0); } -BYTE* Win32Frame::GetResource(WORD id, LPCSTR lpType, DWORD dwExpectedSize) +BYTE* Win32Frame::GetResource(WORD id, LPCSTR lpType, uint32_t dwExpectedSize) { HRSRC hResInfo = FindResource(NULL, MAKEINTRESOURCE(id), lpType); if (hResInfo == NULL) return NULL; - DWORD dwResSize = SizeofResource(NULL, hResInfo); + uint32_t dwResSize = SizeofResource(NULL, hResInfo); if (dwResSize != dwExpectedSize) return NULL; diff --git a/source/Windows/Win32Frame.h b/source/Windows/Win32Frame.h index 77490479..3d732aef 100644 --- a/source/Windows/Win32Frame.h +++ b/source/Windows/Win32Frame.h @@ -54,7 +54,7 @@ public: virtual int FrameMessageBox(LPCSTR lpText, LPCSTR lpCaption, UINT uType); virtual void GetBitmap(LPCSTR lpBitmapName, LONG cb, LPVOID lpvBits); - virtual BYTE* GetResource(WORD id, LPCSTR lpType, DWORD expectedSize); + virtual BYTE* GetResource(WORD id, LPCSTR lpType, uint32_t expectedSize); virtual void Restart(); virtual std::string Video_GetScreenShotFolder() const; diff --git a/source/Windows/WinFrame.cpp b/source/Windows/WinFrame.cpp index 7e003377..e6b52b9a 100644 --- a/source/Windows/WinFrame.cpp +++ b/source/Windows/WinFrame.cpp @@ -63,7 +63,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA static bool FileExists(std::string strFilename); // Must keep in sync with Disk_Status_e g_aDiskFullScreenColors -static const DWORD g_aDiskFullScreenColorsLED[ NUM_DISK_STATUS ] = +static const uint32_t g_aDiskFullScreenColorsLED[ NUM_DISK_STATUS ] = { RGB( 0, 0, 0), // DISK_STATUS_OFF BLACK RGB( 0,255, 0), // DISK_STATUS_READ GREEN @@ -2263,7 +2263,7 @@ void Win32Frame::SetFullScreenMode(void) devMode.dmPelsHeight = m_bestHeightForFullScreen; devMode.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT; - DWORD dwFlags = 0; + uint32_t dwFlags = 0; LONG res = ChangeDisplaySettings(&devMode, dwFlags); m_changedDisplaySettings = true; } @@ -2578,7 +2578,7 @@ void Win32Frame::FrameCreateWindow(void) { const int nXScreen = GetSystemMetrics(SM_CXSCREEN) - nWidth; - if (RegLoadValue(TEXT(REG_PREFS), TEXT(REGVALUE_PREF_WINDOW_X_POS), 1, (DWORD*)&nXPos)) + if (RegLoadValue(TEXT(REG_PREFS), TEXT(REGVALUE_PREF_WINDOW_X_POS), 1, (uint32_t*)&nXPos)) { if ((nXPos > nXScreen) && !g_bMultiMon) nXPos = -1; // Not fully visible, so default to centre position @@ -2593,7 +2593,7 @@ void Win32Frame::FrameCreateWindow(void) { const int nYScreen = GetSystemMetrics(SM_CYSCREEN) - nHeight; - if (RegLoadValue(TEXT(REG_PREFS), TEXT(REGVALUE_PREF_WINDOW_Y_POS), 1, (DWORD*)&nYPos)) + if (RegLoadValue(TEXT(REG_PREFS), TEXT(REGVALUE_PREF_WINDOW_Y_POS), 1, (uint32_t*)&nYPos)) { if ((nYPos > nYScreen) && !g_bMultiMon) nYPos = -1; // Not fully visible, so default to centre position diff --git a/source/YamlHelper.cpp b/source/YamlHelper.cpp index 87fc37b2..10acde79 100644 --- a/source/YamlHelper.cpp +++ b/source/YamlHelper.cpp @@ -560,7 +560,7 @@ void YamlSaveHelper::SaveMemory(const LPBYTE pMemBase, const UINT uMemSize, cons size_t lineSize = kIndent+6+2*kStride+2; // "AAAA: 00010203...3F\n\00" = 6+ 2*64 +2 char* const pLine = new char [lineSize]; - for (DWORD addr = offset; addr < (uMemSize + offset); addr += kStride) + for (uint32_t addr = offset; addr < (uMemSize + offset); addr += kStride) { char* pDst = pLine; for (UINT i=0; i>8; - DWORD cycles = TestCpu6502(0); + uint32_t cycles = TestCpu6502(0); if (cycles != 5) return 1; if (regs.pc != dst) return 1; @@ -686,7 +686,7 @@ int GH278_JMP_INDX(void) mem[regs.pc+3] = dst&0xff; mem[regs.pc+4] = dst>>8; - DWORD cycles = TestCpu65C02(0); + uint32_t cycles = TestCpu65C02(0); if (cycles != 6) return 1; if (regs.pc != dst) return 1; @@ -737,7 +737,7 @@ int GH278_ADC_SBC(UINT op) // No page-cross reset(); regs.ps = AF_DECIMAL; - DWORD cycles = TestCpu6502(0); + uint32_t cycles = TestCpu6502(0); if (g_OpcodeTimings[op][CYC_6502] != cycles) return 1; reset(); @@ -803,7 +803,7 @@ int GH278_test(void) mem[regs.pc+0] = op; mem[regs.pc+1] = base&0xff; mem[regs.pc+2] = base>>8; - DWORD cycles = TestCpu6502(0); + uint32_t cycles = TestCpu6502(0); if (g_OpcodeTimings[op][variant] != cycles) return 1; } @@ -820,7 +820,7 @@ int GH278_test(void) mem[regs.pc+1] = base&0xff; mem[regs.pc+2] = base>>8; mem[0xff] = 0xff; mem[0x00] = 0x00; // For: OPCODE (zp),Y - DWORD cycles = TestCpu6502(0); + uint32_t cycles = TestCpu6502(0); if (g_OpcodeTimings[op][variant] != cycles) return 1; } @@ -838,7 +838,7 @@ int GH278_test(void) mem[regs.pc+0] = op; mem[regs.pc+1] = base&0xff; mem[regs.pc+2] = base>>8; - DWORD cycles = TestCpu65C02(0); + uint32_t cycles = TestCpu65C02(0); if (g_OpcodeTimings[op][variant] != cycles) return 1; } @@ -855,7 +855,7 @@ int GH278_test(void) mem[regs.pc+1] = base&0xff; mem[regs.pc+2] = base>>8; mem[0xff] = 0xff; mem[0x00] = 0x00; // For: OPCODE (zp),Y - DWORD cycles = TestCpu65C02(0); + uint32_t cycles = TestCpu65C02(0); if (g_OpcodeTimings[op][variant] != cycles) return 1; } @@ -892,7 +892,7 @@ int GH278_test(void) //------------------------------------- -DWORD AXA_ZPY(BYTE a, BYTE x, BYTE y, WORD base) +uint32_t AXA_ZPY(BYTE a, BYTE x, BYTE y, WORD base) { reset(); mem[0xfe] = base&0xff; @@ -905,7 +905,7 @@ DWORD AXA_ZPY(BYTE a, BYTE x, BYTE y, WORD base) return TestCpu6502(0); } -DWORD AXA_ABSY(BYTE a, BYTE x, BYTE y, WORD base) +uint32_t AXA_ABSY(BYTE a, BYTE x, BYTE y, WORD base) { reset(); regs.a = a; @@ -917,7 +917,7 @@ DWORD AXA_ABSY(BYTE a, BYTE x, BYTE y, WORD base) return TestCpu6502(0); } -DWORD SAY_ABSX(BYTE a, BYTE x, BYTE y, WORD base) +uint32_t SAY_ABSX(BYTE a, BYTE x, BYTE y, WORD base) { reset(); regs.a = a; @@ -929,7 +929,7 @@ DWORD SAY_ABSX(BYTE a, BYTE x, BYTE y, WORD base) return TestCpu6502(0); } -DWORD TAS_ABSY(BYTE a, BYTE x, BYTE y, WORD base) +uint32_t TAS_ABSY(BYTE a, BYTE x, BYTE y, WORD base) { reset(); regs.a = a; @@ -941,7 +941,7 @@ DWORD TAS_ABSY(BYTE a, BYTE x, BYTE y, WORD base) return TestCpu6502(0); } -DWORD XAS_ABSY(BYTE a, BYTE x, BYTE y, WORD base) +uint32_t XAS_ABSY(BYTE a, BYTE x, BYTE y, WORD base) { reset(); regs.a = a; @@ -960,7 +960,7 @@ int GH282_test(void) WORD base = 0x20ff, addr = 0x20ff; mem[addr] = 0xcc; BYTE a = 0xea, x = 0xff, y = 0; - DWORD cycles = AXA_ZPY(a, x, y, base); + uint32_t cycles = AXA_ZPY(a, x, y, base); if (cycles != 6) return 1; if (mem[addr] != (a & x & ((base>>8)+1))) return 1; } @@ -970,7 +970,7 @@ int GH282_test(void) WORD base = 0x20ff, addr = 0x2000; mem[addr] = 0xcc; BYTE a = 0xea, x = 0xff, y = 1; - DWORD cycles = AXA_ZPY(a, x, y, base); + uint32_t cycles = AXA_ZPY(a, x, y, base); if (cycles != 6) return 1; if (mem[addr] != (a & x & ((base>>8)+1))) return 1; } @@ -982,7 +982,7 @@ int GH282_test(void) WORD base = 0x20ff, addr = 0x20ff; mem[addr] = 0xcc; BYTE a = 0xea, x = 0xff, y = 0; - DWORD cycles = AXA_ABSY(a, x, y, base); + uint32_t cycles = AXA_ABSY(a, x, y, base); if (cycles != 5) return 1; if (mem[addr] != (a & x & ((base>>8)+1))) return 1; } @@ -992,7 +992,7 @@ int GH282_test(void) WORD base = 0x20ff, addr = 0x2000; mem[addr] = 0xcc; BYTE a = 0xea, x = 0xff, y = 1; - DWORD cycles = AXA_ABSY(a, x, y, base); + uint32_t cycles = AXA_ABSY(a, x, y, base); if (cycles != 5) return 1; if (mem[addr] != (a & x & ((base>>8)+1))) return 1; } @@ -1004,7 +1004,7 @@ int GH282_test(void) WORD base = 0x20ff, addr = 0x20ff; mem[addr] = 0xcc; BYTE a = 0xea, x = 0, y=0x20; - DWORD cycles = SAY_ABSX(a, x, y, base); + uint32_t cycles = SAY_ABSX(a, x, y, base); if (cycles != 5) return 1; if (mem[addr] != (y & ((base>>8)+1))) return 1; } @@ -1014,7 +1014,7 @@ int GH282_test(void) WORD base = 0x20ff, addr = 0x2000; mem[addr] = 0xcc; BYTE a = 0xea, x = 1, y=0x20; - DWORD cycles = SAY_ABSX(a, x, y, base); + uint32_t cycles = SAY_ABSX(a, x, y, base); if (cycles != 5) return 1; if (mem[addr] != (y & ((base>>8)+1))) return 1; } @@ -1026,7 +1026,7 @@ int GH282_test(void) WORD base = 0x20ff, addr = 0x20ff; mem[addr] = 0xcc; BYTE a = 0xea, x = 0xff, y = 0; - DWORD cycles = TAS_ABSY(a, x, y, base); + uint32_t cycles = TAS_ABSY(a, x, y, base); if (cycles != 5) return 1; if (mem[addr] != (a & x & ((base>>8)+1))) return 1; if (regs.sp != (0x100 | (a & x))) return 1; @@ -1037,7 +1037,7 @@ int GH282_test(void) WORD base = 0x20ff, addr = 0x2000; mem[addr] = 0xcc; BYTE a = 0xea, x = 0xff, y = 1; - DWORD cycles = TAS_ABSY(a, x, y, base); + uint32_t cycles = TAS_ABSY(a, x, y, base); if (cycles != 5) return 1; if (mem[addr] != (a & x & ((base>>8)+1))) return 1; if (regs.sp != (0x100 | (a & x))) return 1; @@ -1050,7 +1050,7 @@ int GH282_test(void) WORD base = 0x20ff, addr = 0x20ff; mem[addr] = 0xcc; BYTE a = 0xea, x = 0x20, y = 0; - DWORD cycles = XAS_ABSY(a, x, y, base); + uint32_t cycles = XAS_ABSY(a, x, y, base); if (cycles != 5) return 1; if (mem[addr] != (x & ((base>>8)+1))) return 1; } @@ -1060,7 +1060,7 @@ int GH282_test(void) WORD base = 0x20ff, addr = 0x2000; mem[addr] = 0xcc; BYTE a = 0xea, x = 0x20, y = 1; - DWORD cycles = XAS_ABSY(a, x, y, base); + uint32_t cycles = XAS_ABSY(a, x, y, base); if (cycles != 5) return 1; if (mem[addr] != (x & ((base>>8)+1))) return 1; } @@ -1156,7 +1156,7 @@ const BYTE g_GH321_code[] = 0x00 }; -DWORD g_dwCyclesThisFrame = 0; // # cycles executed in frame before Cpu65C02() was called +uint32_t g_dwCyclesThisFrame = 0; // # cycles executed in frame before Cpu65C02() was called ULONG CpuGetCyclesThisVideoFrame(ULONG nExecutedCycles) { @@ -1183,7 +1183,7 @@ int const kVSyncLines = 4; // lines per VSync duration bool bVideoScannerNTSC = true; // Derived from VideoGetScannerAddress() -bool VideoGetVbl(const DWORD uExecutedCycles) +bool VideoGetVbl(const uint32_t uExecutedCycles) { // get video scanner position //