Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion source/Common.h
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ inline bool IsApple2PlusOrClone(eApple2Type type) // Apple ][,][+,][J-Plus or cl

inline bool IsAppleIIe(eApple2Type type) // Apple //e,Enhanced//e or clone //e,Enhanced//e
{
return type & APPLE2E_MASK;
return (type & APPLE2E_MASK) != 0;
}

inline bool IsAppleIIeOrAbove(eApple2Type type) // Apple //e,Enhanced//e,//c or clone //e,Enhanced//e
Expand Down
2 changes: 1 addition & 1 deletion source/Configuration/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ void CConfigNeedingRestart::Reload()
m_uSaveLoadStateMsg = 0;
m_saveStateOnExit = GetSaveStateOnExit();
char ciderPressPathname[MAX_PATH];
RegLoadString(REG_CONFIG, REGVALUE_CIDERPRESSLOC, 1, ciderPressPathname, MAX_PATH, "");
RegLoadString(REG_CONFIG, REGVALUE_CIDERPRESSLOC, true, ciderPressPathname, MAX_PATH, "");
m_ciderPressPathname = ciderPressPathname;
m_enableTheFreezesF8Rom = GetPropertySheet().GetTheFreezesF8Rom();
m_gameIOConnectorType = GetCopyProtectionDongleType();
Expand Down
4 changes: 2 additions & 2 deletions source/Configuration/PageAdvanced.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,10 @@ void CPageAdvanced::ApplyConfigAfterClose()
m_PropertySheetHelper.SaveStateUpdate();
}

RegSaveString(REG_CONFIG, REGVALUE_CIDERPRESSLOC, 1, m_PropertySheetHelper.GetConfigNew().m_ciderPressPathname.c_str());
RegSaveString(REG_CONFIG, REGVALUE_CIDERPRESSLOC, true, m_PropertySheetHelper.GetConfigNew().m_ciderPressPathname);

SetSaveStateOnExit(m_PropertySheetHelper.GetConfigNew().m_saveStateOnExit);
REGSAVE(REGVALUE_SAVE_STATE_ON_EXIT, m_PropertySheetHelper.GetConfigNew().m_saveStateOnExit ? 1 : 0);
REGSAVE(REGVALUE_SAVE_STATE_ON_EXIT, m_PropertySheetHelper.GetConfigNew().m_saveStateOnExit);

// Save the copy protection dongle type
SetCopyProtectionDongleType(m_PropertySheetHelper.GetConfigNew().m_gameIOConnectorType);
Expand Down
6 changes: 3 additions & 3 deletions source/Configuration/PageConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ void CPageConfig::ApplyConfigAfterClose()
{
Win32Frame& win32Frame = Win32Frame::GetWin32Frame();

const BOOL bNewConfirmReboot = m_PropertySheetHelper.GetConfigNew().m_confirmReboot ? 1 : 0;
const bool bNewConfirmReboot = m_PropertySheetHelper.GetConfigNew().m_confirmReboot;
if (win32Frame.g_bConfirmReboot != bNewConfirmReboot)
{
REGSAVE(REGVALUE_CONFIRM_REBOOT, bNewConfirmReboot);
Expand Down Expand Up @@ -372,7 +372,7 @@ void CPageConfig::ApplyConfigAfterClose()
const bool bNewFSSubunitStatus = m_PropertySheetHelper.GetConfigNew().m_fullScreen_ShowSubunitStatus;
if (win32Frame.GetFullScreenShowSubunitStatus() != bNewFSSubunitStatus)
{
REGSAVE(REGVALUE_FS_SHOW_SUBUNIT_STATUS, bNewFSSubunitStatus ? 1 : 0);
REGSAVE(REGVALUE_FS_SHOW_SUBUNIT_STATUS, bNewFSSubunitStatus);
win32Frame.SetFullScreenShowSubunitStatus(bNewFSSubunitStatus);

if (win32Frame.IsFullScreen())
Expand All @@ -385,7 +385,7 @@ void CPageConfig::ApplyConfigAfterClose()
if (GetCardMgr().GetDisk2CardMgr().GetEnhanceDisk() != bNewEnhanceDisk)
{
GetCardMgr().GetDisk2CardMgr().SetEnhanceDisk(bNewEnhanceDisk);
REGSAVE(REGVALUE_ENHANCE_DISK_SPEED, bNewEnhanceDisk ? 1 : 0);
REGSAVE(REGVALUE_ENHANCE_DISK_SPEED, bNewEnhanceDisk);
}

const UINT newScrollLockToggle = m_PropertySheetHelper.GetConfigNew().m_scrollLockToggle;
Expand Down
2 changes: 1 addition & 1 deletion source/Configuration/PageSlots.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ void CPageSlots::DlgDisk2OK(HWND hWnd)

if (win32Frame.GetWindowedModeShowDiskiiStatus() != bNewDiskiiStatus)
{
REGSAVE(REGVALUE_SHOW_DISKII_STATUS, bNewDiskiiStatus ? 1 : 0);
REGSAVE(REGVALUE_SHOW_DISKII_STATUS, bNewDiskiiStatus);
win32Frame.SetWindowedModeShowDiskiiStatus(bNewDiskiiStatus);

if (!win32Frame.IsFullScreen())
Expand Down
8 changes: 4 additions & 4 deletions source/Configuration/PropertySheetHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ void CPropertySheetHelper::SetSlot(UINT slot, SS_CARDTYPE newCardType)
std::string CPropertySheetHelper::BrowseToFile(HWND hWindow, const char* pszTitle, const char* REGVALUE, const char* FILEMASKS)
{
char szFilename[MAX_PATH];
RegLoadString(REG_CONFIG, REGVALUE, 1, szFilename, MAX_PATH, "");
RegLoadString(REG_CONFIG, REGVALUE, true, szFilename, MAX_PATH, "");
std::string pathname = szFilename;

OPENFILENAME ofn;
Expand Down Expand Up @@ -179,7 +179,7 @@ void CPropertySheetHelper::SaveStateUpdate()
if (m_bSSNewFilename)
{
Snapshot_SetFilename(m_szSSNewFilename, m_szSSNewDirectory);
RegSaveString(REG_CONFIG, REGVALUE_SAVESTATE_FILENAME, 1, Snapshot_GetPathname());
RegSaveString(REG_CONFIG, REGVALUE_SAVESTATE_FILENAME, true, Snapshot_GetPathname());
}
}

Expand Down Expand Up @@ -400,7 +400,7 @@ void CPropertySheetHelper::ApplyNewConfigForRestart()
REGSAVE(REGVALUE_THE_FREEZES_F8_ROM, m_ConfigNew.m_enableTheFreezesF8Rom);

if (CONFIG_CHANGED(m_NoSlotClock))
REGSAVE(REGVALUE_NO_SLOT_CLOCK, m_ConfigNew.m_NoSlotClock ? 1 : 0);
REGSAVE(REGVALUE_NO_SLOT_CLOCK, m_ConfigNew.m_NoSlotClock);
}

// Called from Snapshot_LoadState_v2()
Expand Down Expand Up @@ -435,7 +435,7 @@ void CPropertySheetHelper::ApplyNewConfigFromSnapshot()
SetRamWorksMemorySize(config.m_RamWorksMemorySize);
REGSAVE(REGVALUE_VIDEO_REFRESH_RATE, config.m_videoRefreshRate);
//REGSAVE(REGVALUE_THE_FREEZES_F8_ROM, config.m_bEnableTheFreezesF8Rom); // Not currently in save-state
REGSAVE(REGVALUE_NO_SLOT_CLOCK, config.m_NoSlotClock ? 1 : 0);
REGSAVE(REGVALUE_NO_SLOT_CLOCK, config.m_NoSlotClock);
}

// Called when PSPs are created
Expand Down
2 changes: 1 addition & 1 deletion source/Core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ bool CheckOldAppleWinVersion(void)
{
const int VERSIONSTRING_SIZE = 16;
char szOldAppleWinVersion[VERSIONSTRING_SIZE + 1];
RegLoadString(REG_CONFIG, REGVALUE_VERSION, TRUE, szOldAppleWinVersion, VERSIONSTRING_SIZE, "");
RegLoadString(REG_CONFIG, REGVALUE_VERSION, true, szOldAppleWinVersion, VERSIONSTRING_SIZE, "");
const bool bShowAboutDlg = (g_VERSIONSTRING != szOldAppleWinVersion);

// version: xx.yy.zz.ww
Expand Down
2 changes: 1 addition & 1 deletion source/Debugger/Debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4824,7 +4824,7 @@ Update_t CmdMemoryLoad (int nArgs)

memcpy(pMemBankBase + nAddressStart, pMemory.get() + nAddressStart, nAddressLen);

MemUpdatePaging(TRUE);
MemUpdatePaging(PagingFullInitialize);
}
else
{
Expand Down
14 changes: 7 additions & 7 deletions source/Disk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Disk2InterfaceCard::Disk2InterfaceCard(UINT slot) :
uint32_t tmp;
std::string regSection = RegGetConfigSlotSection(m_slot);
const uint32_t kForce13SectorFirmware_Default = 0;
RegLoadValue(regSection.c_str(), REGVALUE_DISKII_13_SECTOR_FIRMWARE, TRUE, &tmp, kForce13SectorFirmware_Default);
RegLoadValue(regSection.c_str(), REGVALUE_DISKII_13_SECTOR_FIRMWARE, true, &tmp, kForce13SectorFirmware_Default);
m_force13SectorFirmware = tmp ? true : false;

ResetLogicStateSequencer();
Expand Down Expand Up @@ -208,7 +208,7 @@ void Disk2InterfaceCard::LoadLastDiskImage(const int drive)
char pathname[MAX_PATH];

std::string regSection = RegGetConfigSlotSection(m_slot);
if (RegLoadString(regSection.c_str(), regKey.c_str(), TRUE, pathname, MAX_PATH, "") && (pathname[0] != 0))
if (RegLoadString(regSection.c_str(), regKey.c_str(), true, pathname, MAX_PATH, "") && (pathname[0] != 0))
{
m_saveDiskImage = false;
ImageError_e error = InsertDisk(drive, pathname, IMAGE_USE_FILES_WRITE_PROTECT_STATUS, IMAGE_DONT_CREATE);
Expand All @@ -232,15 +232,15 @@ void Disk2InterfaceCard::SaveLastDiskImage(const int drive)
return;

std::string regSection = RegGetConfigSlotSection(m_slot);
RegSaveValue(regSection.c_str(), REGVALUE_CARD_TYPE, TRUE, CT_Disk2);
RegSaveValue(regSection.c_str(), REGVALUE_CARD_TYPE, true, CT_Disk2);

const std::string regKey = (drive == DRIVE_1)
? REGVALUE_LAST_DISK_1
: REGVALUE_LAST_DISK_2;

const std::string& pathName = DiskGetFullPathName(drive);

RegSaveString(regSection.c_str(), regKey.c_str(), TRUE, pathName);
RegSaveString(regSection.c_str(), regKey.c_str(), true, pathName);

//

Expand All @@ -253,7 +253,7 @@ void Disk2InterfaceCard::SaveLastDiskImage(const int drive)
if (slash != std::string::npos)
{
const std::string dirName = pathName.substr(0, slash + 1);
RegSaveString(REG_PREFS, REGVALUE_PREF_START_DIR, 1, dirName);
RegSaveString(REG_PREFS, REGVALUE_PREF_START_DIR, true, dirName);
}
}

Expand Down Expand Up @@ -1844,7 +1844,7 @@ bool Disk2InterfaceCard::UserSelectNewDiskImageOnly(const int drive, LPCSTR pszF

StringCbCopy(filename, MAX_PATH, pszFilename);

RegLoadString(REG_PREFS, REGVALUE_PREF_START_DIR, 1, directory, MAX_PATH, "");
RegLoadString(REG_PREFS, REGVALUE_PREF_START_DIR, true, directory, MAX_PATH, "");
std::string title = StrFormat("Select Disk Image For Drive %d", drive + 1);

OPENFILENAME ofn;
Expand Down Expand Up @@ -2068,7 +2068,7 @@ void Disk2InterfaceCard::Set13SectorFirmware(const bool is13Sector)
m_force13SectorFirmware = is13Sector;

std::string regSection = RegGetConfigSlotSection(m_slot);
RegSaveValue(regSection.c_str(), REGVALUE_DISKII_13_SECTOR_FIRMWARE, TRUE, is13Sector ? 1 : 0);
RegSaveValue(regSection.c_str(), REGVALUE_DISKII_13_SECTOR_FIRMWARE, true, is13Sector);
}

bool Disk2InterfaceCard::GetFirmware(WORD lpNameId, BYTE* pDst)
Expand Down
2 changes: 1 addition & 1 deletion source/FrameBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ FrameBase::FrameBase()
{
g_hFrameWindow = (HWND)0;
g_bConfirmReboot = kConfirmReboot_Default;
g_bMultiMon = 0; // OFF = load window position & clamp initial frame to screen, ON = use window position as is
g_bMultiMon = false; // OFF = load window position & clamp initial frame to screen, ON = use window position as is
g_bFreshReset = false;
g_hInstance = (HINSTANCE)0;
g_bDisplayPrintScreenFileName = false;
Expand Down
6 changes: 3 additions & 3 deletions source/FrameBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include "Video.h"

const BOOL kConfirmReboot_Default = TRUE;
constexpr bool kConfirmReboot_Default = true;

class NetworkBackend;
class SoundBuffer;
Expand All @@ -16,8 +16,8 @@ class FrameBase

HINSTANCE g_hInstance;
HWND g_hFrameWindow;
BOOL g_bConfirmReboot; // saved PageConfig REGSAVE
BOOL g_bMultiMon;
bool g_bConfirmReboot; // saved PageConfig REGSAVE
bool g_bMultiMon;
bool g_bFreshReset;

virtual void Initialize(bool resetVideoState) = 0;
Expand Down
18 changes: 9 additions & 9 deletions source/Harddisk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ HarddiskInterfaceCard::HarddiskInterfaceCard(UINT slot) :

uint32_t tmp;
std::string regSection = RegGetConfigSlotSection(m_slot);
RegLoadValue(regSection.c_str(), REGVALUE_HDC_FIRMWARE, TRUE, &tmp, HdcDefault);
RegLoadValue(regSection.c_str(), REGVALUE_HDC_FIRMWARE, true, &tmp, HdcDefault);
m_useHdcFirmwareMode = (HdcMode)tmp;
}

Expand Down Expand Up @@ -215,7 +215,7 @@ void HarddiskInterfaceCard::SetHdcFirmwareMode(HdcMode hdcMode)
m_useHdcFirmwareMode = hdcMode;

std::string regSection = RegGetConfigSlotSection(m_slot);
RegSaveValue(regSection.c_str(), REGVALUE_HDC_FIRMWARE, TRUE, (UINT)m_useHdcFirmwareMode);
RegSaveValue(regSection.c_str(), REGVALUE_HDC_FIRMWARE, true, m_useHdcFirmwareMode);
}

void HarddiskInterfaceCard::InitializeIO(LPBYTE pCxRomPeripheral)
Expand Down Expand Up @@ -316,7 +316,7 @@ void HarddiskInterfaceCard::LoadLastDiskImage(const int drive)
char pathname[MAX_PATH];

std::string regSection = RegGetConfigSlotSection(m_slot);
if (RegLoadString(regSection.c_str(), regKey.c_str(), TRUE, pathname, MAX_PATH, "") && (pathname[0] != 0))
if (RegLoadString(regSection.c_str(), regKey.c_str(), true, pathname, MAX_PATH, "") && (pathname[0] != 0))
{
m_saveDiskImage = false;
bool res = Insert(drive, pathname);
Expand All @@ -340,12 +340,12 @@ void HarddiskInterfaceCard::SaveLastDiskImage(const int drive)
return;

std::string regSection = RegGetConfigSlotSection(m_slot);
RegSaveValue(regSection.c_str(), REGVALUE_CARD_TYPE, TRUE, CT_GenericHDD);
RegSaveValue(regSection.c_str(), REGVALUE_CARD_TYPE, true, CT_GenericHDD);

const std::string regKey = std::string(REGVALUE_LAST_HARDDISK_) + (char)('1' + drive);
const std::string& pathName = HarddiskGetFullPathName(drive);

RegSaveString(regSection.c_str(), regKey.c_str(), TRUE, pathName);
RegSaveString(regSection.c_str(), regKey.c_str(), true, pathName);

//

Expand All @@ -358,7 +358,7 @@ void HarddiskInterfaceCard::SaveLastDiskImage(const int drive)
if (slash != std::string::npos)
{
const std::string dirName = pathName.substr(0, slash + 1);
RegSaveString(REG_PREFS, REGVALUE_PREF_HDV_START_DIR, 1, dirName);
RegSaveString(REG_PREFS, REGVALUE_PREF_HDV_START_DIR, true, dirName);
}
}

Expand Down Expand Up @@ -489,7 +489,7 @@ bool HarddiskInterfaceCard::UserSelectNewDiskImageOnly(const int drive, LPCSTR p

StringCbCopy(filename, MAX_PATH, pszFilename);

RegLoadString(REG_PREFS, REGVALUE_PREF_HDV_START_DIR, 1, directory, MAX_PATH, "");
RegLoadString(REG_PREFS, REGVALUE_PREF_HDV_START_DIR, true, directory, MAX_PATH, "");
std::string title = StrFormat("Select HDV Image For HDD %d", drive + 1);

OPENFILENAME ofn;
Expand Down Expand Up @@ -1042,7 +1042,7 @@ BYTE HarddiskInterfaceCard::GetProDOSBlockDeviceUnit(void)

HardDiskDrive* HarddiskInterfaceCard::GetUnit(void)
{
const bool isSmartPortCmd = m_command & SP_Cmd_base;
const bool isSmartPortCmd = !!(m_command & SP_Cmd_base);

if (!isSmartPortCmd)
return &m_hardDiskDrive[GetProDOSBlockDeviceUnit()];
Expand Down Expand Up @@ -1473,7 +1473,7 @@ bool HarddiskInterfaceCard::LoadSnapshot(YamlLoadHelper& yamlLoadHelper, UINT ve
userSelectedImageFolder |= LoadSnapshotHDDUnit(yamlLoadHelper, i, version);

if (!userSelectedImageFolder)
RegSaveString(REG_PREFS, REGVALUE_PREF_HDV_START_DIR, 1, Snapshot_GetPath());
RegSaveString(REG_PREFS, REGVALUE_PREF_HDV_START_DIR, true, Snapshot_GetPath());

GetFrame().FrameRefreshStatus(DRAW_LEDS | DRAW_DISK_STATUS);

Expand Down
12 changes: 6 additions & 6 deletions source/LanguageCard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ bool LanguageCardSlot0::LoadSnapshot(YamlLoadHelper& yamlLoadHelper, UINT versio

yamlLoadHelper.PopMap();

// NB. MemUpdatePaging(TRUE) called at end of Snapshot_LoadState_v2()
// NB. MemUpdatePaging(PagingFullInitialize) called at end of Snapshot_LoadState_v2()

return true;
}
Expand All @@ -329,7 +329,7 @@ Saturn128K::Saturn128K(UINT slot, UINT banks)
if (banks == 0)
{
std::string regSection = RegGetConfigSlotSection(m_slot);
RegLoadValue(regSection.c_str(), REGVALUE_SATURN_NUM_BANKS, TRUE, &m_uSaturnTotalBanks, kMaxSaturnBanks);
RegLoadValue(regSection.c_str(), REGVALUE_SATURN_NUM_BANKS, true, &m_uSaturnTotalBanks, kMaxSaturnBanks);
}

for (UINT i=0; i<kMaxSaturnBanks; i++)
Expand Down Expand Up @@ -542,7 +542,7 @@ bool Saturn128K::LoadSnapshot(YamlLoadHelper& yamlLoadHelper, UINT version)

// NB. MemInitializeFromSnapshot() called at end of Snapshot_LoadState_v2():
// . SetMemMainLanguageCard() for the slot/card that last set the 16KB LC bank
// . MemUpdatePaging(TRUE)
// . MemUpdatePaging(PagingFullInitialize)

return true;
}
Expand Down Expand Up @@ -582,7 +582,7 @@ void Saturn128K::SetSaturnMemorySize(uint8_t banks)
m_uSaturnTotalBanks = banks;

std::string regSection = RegGetConfigSlotSection(m_slot);
RegSaveValue(regSection.c_str(), REGVALUE_SATURN_NUM_BANKS, TRUE, m_uSaturnTotalBanks);
RegSaveValue(regSection.c_str(), REGVALUE_SATURN_NUM_BANKS, true, m_uSaturnTotalBanks);
}

uint8_t Saturn128K::GetSaturnMemorySizeSlot0()
Expand All @@ -608,7 +608,7 @@ void Saturn128K::SetSaturnMemorySizeSlot0(uint8_t banks)
* . TODO: assist with debugger's display of "sNN" for active 16K bank
*/

// Only called by ResetPaging(BOOL initialize)
// Only called by ResetPaging(bool initialize)
// NB. Individual cards (LC or Saturn) are reset via GetCardMgr().Reset()
void LanguageCardManager::Reset(const bool powerCycle /*=false*/)
{
Expand Down Expand Up @@ -671,7 +671,7 @@ void LanguageCardManager::SetMemMode(const uint8_t slot)
card.SetMainMemLanguageCardMemory();
}

MemUpdatePaging(0); // Initialize=0
MemUpdatePaging(PagingUpdateOnly);
}

void LanguageCardManager::SetMemModeFromSnapshot(void)
Expand Down
Loading
Loading