Merge from Tom: 674-676
Fix cmd-line -d1/d2 switches with relative path (Bug #16632) Fix speaker volume when booting with -d1 switch Fix debugger bugs: - Crash when doing: help * - Crash when doing: run script.txt (Bug #16651) Fix "Harddisk images aren't persisted when in different folders" (Bug #16652)
This commit is contained in:
parent
9bbf3392cf
commit
8955b88865
9 changed files with 136 additions and 84 deletions
|
@ -478,7 +478,7 @@ void LoadConfiguration ()
|
|||
}
|
||||
|
||||
REGLOAD(TEXT("Emulation Speed") ,&g_dwSpeed);
|
||||
REGLOAD(TEXT("Enhance Disk Speed"),(DWORD *)&enhancedisk);
|
||||
REGLOAD(TEXT(REGVALUE_ENHANCE_DISK_SPEED),(DWORD *)&enhancedisk);
|
||||
|
||||
Config_Load_Video();
|
||||
|
||||
|
@ -522,11 +522,11 @@ void LoadConfiguration ()
|
|||
if(REGLOAD(TEXT(REGVALUE_HDD_ENABLED), &dwTmp))
|
||||
HD_SetEnabled(dwTmp ? true : false);
|
||||
|
||||
char szHDFilename[MAX_PATH] = {0};
|
||||
if(RegLoadString(TEXT(REG_CONFIG), TEXT(REGVALUE_HDD_IMAGE1), 1, szHDFilename, sizeof(szHDFilename)))
|
||||
HD_InsertDisk2(0, szHDFilename);
|
||||
if(RegLoadString(TEXT(REG_CONFIG), TEXT(REGVALUE_HDD_IMAGE2), 1, szHDFilename, sizeof(szHDFilename)))
|
||||
HD_InsertDisk2(1, szHDFilename);
|
||||
char szHDVPathname[MAX_PATH] = {0};
|
||||
if(RegLoadString(TEXT(REG_PREFS), TEXT(REGVALUE_PREF_LAST_HARDDISK_1), 1, szHDVPathname, sizeof(szHDVPathname)))
|
||||
HD_InsertDisk(HARDDISK_1, szHDVPathname);
|
||||
if(RegLoadString(TEXT(REG_PREFS), TEXT(REGVALUE_PREF_LAST_HARDDISK_2), 1, szHDVPathname, sizeof(szHDVPathname)))
|
||||
HD_InsertDisk(HARDDISK_2, szHDVPathname);
|
||||
|
||||
if(REGLOAD(TEXT(REGVALUE_PDL_XTRIM), &dwTmp))
|
||||
JoySetTrim((short)dwTmp, true);
|
||||
|
@ -742,10 +742,29 @@ LPSTR GetNextArg(LPSTR lpCmdLine)
|
|||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
static int DoDiskInsert(int nDrive, LPSTR szFileName)
|
||||
static int DoDiskInsert(const int nDrive, LPCSTR szFileName)
|
||||
{
|
||||
ImageError_e Error = DiskInsert(nDrive, szFileName, IMAGE_USE_FILES_WRITE_PROTECT_STATUS, IMAGE_DONT_CREATE);
|
||||
return (Error == eIMAGE_ERROR_NONE) ? 0 : 1;
|
||||
string strPathName;
|
||||
|
||||
if (szFileName[0] == '\\' || szFileName[1] == ':')
|
||||
{
|
||||
// Abs pathname
|
||||
strPathName = szFileName;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Rel pathname
|
||||
char szCWD[_MAX_PATH] = {0};
|
||||
if (!GetCurrentDirectory(sizeof(szCWD), szCWD))
|
||||
return false;
|
||||
|
||||
strPathName = szCWD;
|
||||
strPathName.append("\\");
|
||||
strPathName.append(szFileName);
|
||||
}
|
||||
|
||||
ImageError_e Error = DiskInsert(nDrive, strPathName.c_str(), IMAGE_USE_FILES_WRITE_PROTECT_STATUS, IMAGE_DONT_CREATE);
|
||||
return Error == eIMAGE_ERROR_NONE;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
@ -977,8 +996,7 @@ int APIENTRY WinMain (HINSTANCE passinstance, HINSTANCE, LPSTR lpCmdLine, int)
|
|||
|
||||
if(bBoot)
|
||||
{
|
||||
PostMessage(g_hFrameWindow, WM_KEYDOWN, VK_F1+BTN_RUN, 0);
|
||||
PostMessage(g_hFrameWindow, WM_KEYUP, VK_F1+BTN_RUN, 0);
|
||||
PostMessage(g_hFrameWindow, WM_USER_BOOT, 0, 0);
|
||||
bBoot = false;
|
||||
}
|
||||
|
||||
|
|
|
@ -78,8 +78,6 @@ enum AppMode_e
|
|||
#define REGVALUE_SAVESTATE_FILENAME "Save State Filename"
|
||||
#define REGVALUE_SAVE_STATE_ON_EXIT "Save State On Exit"
|
||||
#define REGVALUE_HDD_ENABLED "Harddisk Enable"
|
||||
#define REGVALUE_HDD_IMAGE1 "Harddisk Image 1"
|
||||
#define REGVALUE_HDD_IMAGE2 "Harddisk Image 2"
|
||||
#define REGVALUE_PDL_XTRIM "PDL X-Trim"
|
||||
#define REGVALUE_PDL_YTRIM "PDL Y-Trim"
|
||||
#define REGVALUE_SCROLLLOCK_TOGGLE "ScrollLock Toggle"
|
||||
|
@ -100,12 +98,18 @@ enum AppMode_e
|
|||
#define REGVALUE_VIDEO_HALF_SCAN_LINES "Half Scan Lines"
|
||||
#define REGVALUE_VIDEO_MONO_COLOR "Monochrome Color"
|
||||
#define REGVALUE_SERIAL_PORT_NAME "Serial Port Name"
|
||||
#define REGVALUE_ENHANCE_DISK_SPEED "Enhance Disk Speed"
|
||||
|
||||
// Preferences
|
||||
#define REG_PREFS "Preferences"
|
||||
#define REG_PREFS "Preferences"
|
||||
#define REGVALUE_PREF_START_DIR "Starting Directory"
|
||||
#define REGVALUE_PREF_LAST_DISK_1 "Last Disk Image 1"
|
||||
#define REGVALUE_PREF_LAST_DISK_2 "Last Disk Image 2"
|
||||
#define REGVALUE_PREF_WINDOW_X_POS "Window X-Position"
|
||||
#define REGVALUE_PREF_WINDOW_Y_POS "Window Y-Position"
|
||||
#define REGVALUE_PREF_HDV_START_DIR "HDV Starting Directory"
|
||||
#define REGVALUE_PREF_LAST_HARDDISK_1 "Last Harddisk Image 1"
|
||||
#define REGVALUE_PREF_LAST_HARDDISK_2 "Last Harddisk Image 2"
|
||||
|
||||
#define WM_USER_BENCHMARK WM_USER+1
|
||||
#define WM_USER_RESTART WM_USER+2
|
||||
|
@ -114,6 +118,7 @@ enum AppMode_e
|
|||
#define VK_SNAPSHOT_560 WM_USER+5
|
||||
#define VK_SNAPSHOT_280 WM_USER+6
|
||||
#define WM_USER_TCP_SERIAL WM_USER+7
|
||||
#define WM_USER_BOOT WM_USER+8
|
||||
|
||||
enum eSOUNDCARDTYPE {SC_UNINIT=0, SC_NONE, SC_MOCKINGBOARD, SC_PHASOR}; // Apple soundcard type
|
||||
|
||||
|
|
|
@ -1314,7 +1314,7 @@ Update_t CmdHelpSpecific (int nArgs)
|
|||
sprintf( sText, "%s%-5s%s: Loads symbols from last/default \"filename\"", CHC_STRING, g_aParameters[ PARAM_SAVE ].m_sName, CHC_DEFAULT ); ConsolePrint( sText );
|
||||
sprintf( sText, "%s%-5s%s: Saves symbol table to \"filename\"" , CHC_STRING, g_aParameters[ PARAM_LOAD ].m_sName, CHC_DEFAULT ); ConsolePrint( sText );
|
||||
sprintf( sText, "%s%-5s%s: Clears the symbol table" , CHC_STRING, g_aParameters[ PARAM_CLEAR ].m_sName, CHC_DEFAULT ); ConsolePrint( sText );
|
||||
sprintf( sText, "%s%-5s%s: Remove symbol" , CHC_STRING, g_aTokens[ TOKEN_EXCLAMATION ] , CHC_DEFAULT ); ConsolePrint( sText );
|
||||
sprintf( sText, "%s%-5s%s: Remove symbol" , CHC_STRING, g_aTokens[ TOKEN_EXCLAMATION ].sToken, CHC_DEFAULT ); ConsolePrint( sText );
|
||||
break;
|
||||
case CMD_SYMBOLS_LIST :
|
||||
Colorize( sText, " Usage: symbol" );
|
||||
|
|
|
@ -99,11 +99,11 @@ void Disk_LoadLastDiskImage(const int iDrive)
|
|||
char sFilePath[ MAX_PATH + 1];
|
||||
sFilePath[0] = 0;
|
||||
|
||||
char *pRegKey = (!iDrive)
|
||||
char *pRegKey = (iDrive == DRIVE_1)
|
||||
? REGVALUE_PREF_LAST_DISK_1
|
||||
: REGVALUE_PREF_LAST_DISK_2;
|
||||
|
||||
if( RegLoadString(TEXT(REG_PREFS),pRegKey,1,sFilePath,MAX_PATH) )
|
||||
if (RegLoadString(TEXT(REG_PREFS),pRegKey,1,sFilePath,MAX_PATH))
|
||||
{
|
||||
sFilePath[ MAX_PATH ] = 0;
|
||||
DiskPathFilename[ iDrive ] = sFilePath;
|
||||
|
@ -127,12 +127,12 @@ void Disk_SaveLastDiskImage(const int iDrive)
|
|||
{
|
||||
const char *pFileName = DiskPathFilename[iDrive].c_str();
|
||||
|
||||
if(g_bSaveDiskImage)
|
||||
if (g_bSaveDiskImage)
|
||||
{
|
||||
if( iDrive == DRIVE_1 )
|
||||
RegSaveString(TEXT(REG_PREFS),REGVALUE_PREF_LAST_DISK_1,1,pFileName );
|
||||
if (iDrive == DRIVE_1)
|
||||
RegSaveString(TEXT(REG_PREFS),REGVALUE_PREF_LAST_DISK_1,1,pFileName);
|
||||
else
|
||||
RegSaveString(TEXT(REG_PREFS),REGVALUE_PREF_LAST_DISK_2,1,pFileName );
|
||||
RegSaveString(TEXT(REG_PREFS),REGVALUE_PREF_LAST_DISK_2,1,pFileName);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -732,12 +732,12 @@ void DiskReset(void)
|
|||
void DiskSelectImage(const int iDrive, LPSTR pszFilename)
|
||||
{
|
||||
TCHAR directory[MAX_PATH] = TEXT("");
|
||||
TCHAR filename[MAX_PATH];
|
||||
TCHAR filename[MAX_PATH] = TEXT("");
|
||||
TCHAR title[40];
|
||||
|
||||
strcpy(filename, pszFilename);
|
||||
|
||||
RegLoadString(TEXT("Preferences"), REGVALUE_PREF_START_DIR, 1, directory, MAX_PATH);
|
||||
RegLoadString(TEXT(REG_PREFS), REGVALUE_PREF_START_DIR, 1, directory, MAX_PATH);
|
||||
_tcscpy(title, TEXT("Select Disk Image For Drive "));
|
||||
_tcscat(title, iDrive ? TEXT("2") : TEXT("1"));
|
||||
|
||||
|
@ -746,9 +746,9 @@ void DiskSelectImage(const int iDrive, LPSTR pszFilename)
|
|||
ofn.lStructSize = sizeof(OPENFILENAME);
|
||||
ofn.hwndOwner = g_hFrameWindow;
|
||||
ofn.hInstance = g_hInstance;
|
||||
ofn.lpstrFilter = TEXT("All Images\0*.bin;*.do;*.dsk;*.nib;*.po;*.gz;*.zip;*.2mg;*.2img;*.iie;*.apl\0")
|
||||
TEXT("Disk Images (*.bin,*.do,*.dsk,*.nib,*.po,*.gz,*.zip,*.2mg,*.2img,*.iie)\0*.bin;*.do;*.dsk;*.nib;*.po;*.gz;*.zip;*.2mg;*.2img;*.iie\0")
|
||||
TEXT("All Files\0*.*\0");
|
||||
ofn.lpstrFilter = TEXT("All Images\0*.bin;*.do;*.dsk;*.nib;*.po;*.gz;*.zip;*.2mg;*.2img;*.iie;*.apl\0")
|
||||
TEXT("Disk Images (*.bin,*.do,*.dsk,*.nib,*.po,*.gz,*.zip,*.2mg,*.2img,*.iie)\0*.bin;*.do;*.dsk;*.nib;*.po;*.gz;*.zip;*.2mg;*.2img;*.iie\0")
|
||||
TEXT("All Files\0*.*\0");
|
||||
ofn.lpstrFile = filename;
|
||||
ofn.nMaxFile = MAX_PATH;
|
||||
ofn.lpstrInitialDir = directory;
|
||||
|
@ -758,7 +758,7 @@ void DiskSelectImage(const int iDrive, LPSTR pszFilename)
|
|||
if (GetOpenFileName(&ofn))
|
||||
{
|
||||
if ((!ofn.nFileExtension) || !filename[ofn.nFileExtension])
|
||||
_tcscat(filename,TEXT(".DSK"));
|
||||
_tcscat(filename,TEXT(".dsk"));
|
||||
|
||||
ImageError_e Error = DiskInsert(iDrive, filename, ofn.Flags & OFN_READONLY, IMAGE_CREATE);
|
||||
if (Error == eIMAGE_ERROR_NONE)
|
||||
|
@ -766,9 +766,7 @@ void DiskSelectImage(const int iDrive, LPSTR pszFilename)
|
|||
DiskPathFilename[iDrive] = filename;
|
||||
filename[ofn.nFileOffset] = 0;
|
||||
if (_tcsicmp(directory, filename))
|
||||
{
|
||||
RegSaveString(TEXT(REG_PREFS), TEXT(REGVALUE_PREF_START_DIR), 1, filename);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -658,8 +658,8 @@ LRESULT CALLBACK FrameWndProc (
|
|||
SetNormalMode();
|
||||
if (!IsIconic(window))
|
||||
GetWindowRect(window,&framerect);
|
||||
RegSaveValue(TEXT("Preferences"),TEXT("Window X-Position"),1,framerect.left);
|
||||
RegSaveValue(TEXT("Preferences"),TEXT("Window Y-Position"),1,framerect.top);
|
||||
RegSaveValue(TEXT(REG_PREFS), TEXT(REGVALUE_PREF_WINDOW_X_POS), 1, framerect.left);
|
||||
RegSaveValue(TEXT(REG_PREFS), TEXT(REGVALUE_PREF_WINDOW_Y_POS), 1, framerect.top);
|
||||
FrameReleaseDC();
|
||||
SetUsingCursor(0);
|
||||
if (helpquit) {
|
||||
|
@ -714,10 +714,8 @@ LRESULT CALLBACK FrameWndProc (
|
|||
{
|
||||
if (!g_bIsFullScreen)
|
||||
DrawButton((HDC)0,BTN_DRIVE1);
|
||||
SetForegroundWindow(window);
|
||||
Sleep(500); // Wait for SetForegroundWindow() to take affect (400ms seems OK, so use 500ms to be sure)
|
||||
SoundCore_TweakVolumes();
|
||||
ProcessButtonClick(BTN_RUN);
|
||||
|
||||
PostMessage(window, WM_USER_BOOT, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1333,6 +1331,7 @@ LRESULT CALLBACK FrameWndProc (
|
|||
break;
|
||||
|
||||
case WM_USER_TCP_SERIAL: // TCP serial events
|
||||
{
|
||||
WORD error = WSAGETSELECTERROR(lparam);
|
||||
if (error != 0)
|
||||
{
|
||||
|
@ -1374,7 +1373,20 @@ LRESULT CALLBACK FrameWndProc (
|
|||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Message posted by: WM_DDE_EXECUTE & Cmd-line boot
|
||||
case WM_USER_BOOT:
|
||||
{
|
||||
SetForegroundWindow(window);
|
||||
Sleep(500); // Wait for SetForegroundWindow() to take affect (400ms seems OK, so use 500ms to be sure)
|
||||
SoundCore_TweakVolumes();
|
||||
ProcessButtonClick(BTN_RUN);
|
||||
break;
|
||||
}
|
||||
|
||||
} // switch(message)
|
||||
|
||||
return DefWindowProc(window,message,wparam,lparam);
|
||||
}
|
||||
|
||||
|
@ -1779,22 +1791,48 @@ void SetUsingCursor (BOOL bNewValue)
|
|||
//===========================================================================
|
||||
void FrameCreateWindow ()
|
||||
{
|
||||
int width = VIEWPORTCX + VIEWPORTX*2
|
||||
+ BUTTONCX
|
||||
+ GetSystemMetrics(SM_CXBORDER)*2
|
||||
+ MAGICX;
|
||||
int height = VIEWPORTCY + VIEWPORTY*2
|
||||
+ GetSystemMetrics(SM_CYBORDER)
|
||||
+ GetSystemMetrics(SM_CYCAPTION)
|
||||
+ MAGICY;
|
||||
int xpos;
|
||||
const int nWidth = VIEWPORTCX + VIEWPORTX*2
|
||||
+ BUTTONCX
|
||||
+ GetSystemMetrics(SM_CXBORDER)*2
|
||||
+ MAGICX;
|
||||
const int nHeight = VIEWPORTCY + VIEWPORTY*2
|
||||
+ GetSystemMetrics(SM_CYBORDER)
|
||||
+ GetSystemMetrics(SM_CYCAPTION)
|
||||
+ MAGICY;
|
||||
|
||||
if (!RegLoadValue(TEXT("Preferences"),TEXT("Window X-Position"),1,(DWORD *)&xpos))
|
||||
xpos = (GetSystemMetrics(SM_CXSCREEN)-width) >> 1;
|
||||
//
|
||||
|
||||
int ypos;
|
||||
if (!RegLoadValue(TEXT("Preferences"),TEXT("Window Y-Position"),1,(DWORD *)&ypos))
|
||||
ypos = (GetSystemMetrics(SM_CYSCREEN)-height) >> 1;
|
||||
int nXPos = -1;
|
||||
{
|
||||
int nXScreen = GetSystemMetrics(SM_CXSCREEN) - nWidth;
|
||||
|
||||
if (RegLoadValue(TEXT("Preferences"), TEXT("Window X-Position"), 1, (DWORD*)&nXPos))
|
||||
{
|
||||
if (nXPos > nXScreen)
|
||||
nXPos = -1; // Not fully visible, so default to centre position
|
||||
}
|
||||
|
||||
if (nXPos == -1)
|
||||
nXPos = nXScreen / 2;
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
int nYPos = -1;
|
||||
{
|
||||
int nYScreen = GetSystemMetrics(SM_CYSCREEN) - nHeight;
|
||||
|
||||
if (RegLoadValue(TEXT("Preferences"), TEXT("Window Y-Position"), 1, (DWORD*)&nYPos))
|
||||
{
|
||||
if (nYPos > nYScreen)
|
||||
nYPos = -1; // Not fully visible, so default to centre position
|
||||
}
|
||||
|
||||
if (nYPos == -1)
|
||||
nYPos = nYScreen / 2;
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
switch (g_Apple2Type)
|
||||
{
|
||||
|
@ -1813,10 +1851,10 @@ void FrameCreateWindow ()
|
|||
g_pAppTitle,
|
||||
WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU |
|
||||
WS_MINIMIZEBOX | WS_VISIBLE,
|
||||
xpos,ypos,width,height,
|
||||
nXPos, nYPos, nWidth, nHeight,
|
||||
HWND_DESKTOP,
|
||||
(HMENU)0,
|
||||
g_hInstance,NULL );
|
||||
g_hInstance, NULL );
|
||||
|
||||
|
||||
InitCommonControls();
|
||||
|
|
|
@ -278,6 +278,11 @@ LPCTSTR HD_GetFullName(const int iDrive)
|
|||
return g_HardDisk[iDrive].fullname;
|
||||
}
|
||||
|
||||
LPCTSTR HD_GetFullPathName(const int iDrive)
|
||||
{
|
||||
return g_HardDisk[iDrive].Info.szFilename;
|
||||
}
|
||||
|
||||
static LPCTSTR HD_DiskGetBaseName (const int iDrive) // Not used
|
||||
{
|
||||
return g_HardDisk[iDrive].imagename;
|
||||
|
@ -319,21 +324,7 @@ VOID HD_Cleanup(void)
|
|||
}
|
||||
}
|
||||
|
||||
// pszFilename is not qualified with path
|
||||
BOOL HD_InsertDisk2(const int iDrive, LPCTSTR pszFilename)
|
||||
{
|
||||
if (*pszFilename == 0x00)
|
||||
return false;
|
||||
|
||||
char szFullFilename[MAX_PATH];
|
||||
|
||||
RegLoadString(TEXT("Preferences"), TEXT("HDV Starting Directory"), 1, szFullFilename, MAX_PATH);
|
||||
strcat(szFullFilename, pszFilename);
|
||||
|
||||
return HD_InsertDisk(iDrive, szFullFilename);
|
||||
}
|
||||
|
||||
// imagefilename is qualified with path
|
||||
// pszImageFilename is qualified with path
|
||||
BOOL HD_InsertDisk(const int iDrive, LPCTSTR pszImageFilename)
|
||||
{
|
||||
if (*pszImageFilename == 0x00)
|
||||
|
@ -342,12 +333,12 @@ BOOL HD_InsertDisk(const int iDrive, LPCTSTR pszImageFilename)
|
|||
if (g_HardDisk[iDrive].hd_imageloaded)
|
||||
HD_CleanupDrive(iDrive);
|
||||
|
||||
BOOL result = HD_Load_Image(iDrive, pszImageFilename);
|
||||
BOOL bResult = HD_Load_Image(iDrive, pszImageFilename);
|
||||
|
||||
if (result)
|
||||
if (bResult)
|
||||
GetImageTitle(pszImageFilename, &g_HardDisk[iDrive]);
|
||||
|
||||
return result;
|
||||
return bResult;
|
||||
}
|
||||
|
||||
void HD_Select(const int iDrive)
|
||||
|
@ -356,10 +347,10 @@ void HD_Select(const int iDrive)
|
|||
TCHAR filename[MAX_PATH] = TEXT("");
|
||||
TCHAR title[40];
|
||||
|
||||
RegLoadString(TEXT("Preferences"), TEXT("HDV Starting Directory"), 1, directory, MAX_PATH);
|
||||
_tcscpy(title,TEXT("Select HDV Image For HDD "));
|
||||
_tcscat(title,iDrive ? TEXT("2") : TEXT("1"));
|
||||
|
||||
RegLoadString(TEXT(REG_PREFS), TEXT(REGVALUE_PREF_HDV_START_DIR), 1, directory, MAX_PATH);
|
||||
_tcscpy(title, TEXT("Select HDV Image For HDD "));
|
||||
_tcscat(title, iDrive ? TEXT("2") : TEXT("1"));
|
||||
|
||||
OPENFILENAME ofn;
|
||||
ZeroMemory(&ofn,sizeof(OPENFILENAME));
|
||||
ofn.lStructSize = sizeof(OPENFILENAME);
|
||||
|
@ -381,8 +372,8 @@ void HD_Select(const int iDrive)
|
|||
if (HD_InsertDisk(iDrive, filename))
|
||||
{
|
||||
filename[ofn.nFileOffset] = 0;
|
||||
if (_tcsicmp(directory,filename))
|
||||
RegSaveString(TEXT("Preferences"),TEXT("HDV Starting Directory"),1,filename);
|
||||
if (_tcsicmp(directory, filename))
|
||||
RegSaveString(TEXT(REG_PREFS), TEXT(REGVALUE_PREF_HDV_START_DIR), 1, filename);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -10,9 +10,9 @@ enum HardDrive_e
|
|||
bool HD_CardIsEnabled(void);
|
||||
void HD_SetEnabled(const bool bEnabled);
|
||||
LPCTSTR HD_GetFullName(const int iDrive);
|
||||
LPCTSTR HD_GetFullPathName(const int iDrive);
|
||||
VOID HD_Load_Rom(const LPBYTE pCxRomPeripheral, const UINT uSlot);
|
||||
VOID HD_Cleanup(void);
|
||||
BOOL HD_InsertDisk2(const int iDrive, LPCTSTR pszFilename);
|
||||
BOOL HD_InsertDisk(const int iDrive, LPCTSTR pszImageFilename);
|
||||
void HD_Select(const int iDrive);
|
||||
void HD_Unplug(const int iDrive);
|
||||
|
|
|
@ -923,10 +923,11 @@ static void DiskDlg_OK(HWND window, UINT afterclose)
|
|||
bool bHDDIsEnabled = IsDlgButtonChecked(window, IDC_HDD_ENABLE) ? true : false;
|
||||
HD_SetEnabled(bHDDIsEnabled);
|
||||
|
||||
REGSAVE(TEXT("Enhance Disk Speed"),newdisktype);
|
||||
REGSAVE(TEXT(REGVALUE_ENHANCE_DISK_SPEED),newdisktype);
|
||||
REGSAVE(TEXT(REGVALUE_HDD_ENABLED), bHDDIsEnabled ? 1 : 0);
|
||||
RegSaveString(TEXT("Configuration"), TEXT(REGVALUE_HDD_IMAGE1), 1, HD_GetFullName(0));
|
||||
RegSaveString(TEXT("Configuration"), TEXT(REGVALUE_HDD_IMAGE2), 1, HD_GetFullName(1));
|
||||
|
||||
RegSaveString(TEXT(REG_PREFS), TEXT(REGVALUE_PREF_LAST_HARDDISK_1), 1, HD_GetFullPathName(HARDDISK_1));
|
||||
RegSaveString(TEXT(REG_PREFS), TEXT(REGVALUE_PREF_LAST_HARDDISK_2), 1, HD_GetFullPathName(HARDDISK_2));
|
||||
|
||||
//
|
||||
|
||||
|
|
|
@ -58,15 +58,16 @@ void MemoryTextFile_t::GetLinePointers()
|
|||
return;
|
||||
|
||||
m_vLines.erase( m_vLines.begin(), m_vLines.end() );
|
||||
char *pBegin = & m_vBuffer.at( 0 );
|
||||
char *pLast = & m_vBuffer[ m_vBuffer.size() ];
|
||||
char *pBegin = & m_vBuffer[ 0 ];
|
||||
char *pLast = & m_vBuffer[ m_vBuffer.size()-1 ];
|
||||
|
||||
char *pEnd = NULL;
|
||||
char *pStartNextLine;
|
||||
|
||||
while (pBegin < pLast)
|
||||
while (pBegin <= pLast)
|
||||
{
|
||||
m_vLines.push_back( pBegin );
|
||||
if ( *pBegin ) // Only keep non-empty lines
|
||||
m_vLines.push_back( pBegin );
|
||||
|
||||
pEnd = const_cast<char*>( SkipUntilEOL( pBegin ));
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue