Moved setting the auto expanding disk size logic.
This commit is contained in:
parent
6472f47c79
commit
2927a10865
|
@ -36,6 +36,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
#include "../Interface.h"
|
#include "../Interface.h"
|
||||||
#include "../Uthernet2.h"
|
#include "../Uthernet2.h"
|
||||||
#include "../Tfe/PCapBackend.h"
|
#include "../Tfe/PCapBackend.h"
|
||||||
|
#include "../CmdLine.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Config causing AfterClose msgs:
|
Config causing AfterClose msgs:
|
||||||
|
@ -134,6 +135,8 @@ void CPropertySheetHelper::SetSlot(UINT slot, SS_CARDTYPE newCardType)
|
||||||
|
|
||||||
GetCardMgr().Insert(slot, newCardType);
|
GetCardMgr().Insert(slot, newCardType);
|
||||||
GetCardMgr().GetRef(slot).InitializeIO(GetCxRomPeripheral());
|
GetCardMgr().GetRef(slot).InitializeIO(GetCxRomPeripheral());
|
||||||
|
if (newCardType == CT_GenericHDD)
|
||||||
|
dynamic_cast<HarddiskInterfaceCard&>(GetCardMgr().GetRef(slot)).SetUserNumBlocks(g_cmdLine.uHarddiskNumBlocks);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Used by:
|
// Used by:
|
||||||
|
|
|
@ -37,7 +37,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
#include "Registry.h"
|
#include "Registry.h"
|
||||||
#include "SaveState.h"
|
#include "SaveState.h"
|
||||||
#include "YamlHelper.h"
|
#include "YamlHelper.h"
|
||||||
#include "CmdLine.h"
|
|
||||||
|
|
||||||
#include "Debugger/Debug.h"
|
#include "Debugger/Debug.h"
|
||||||
#include "../resource/resource.h"
|
#include "../resource/resource.h"
|
||||||
|
@ -677,13 +676,13 @@ BYTE __stdcall HarddiskInterfaceCard::IORead(WORD pc, WORD addr, BYTE bWrite, BY
|
||||||
break;
|
break;
|
||||||
case 0x9:
|
case 0x9:
|
||||||
if (pHDD->m_imageloaded)
|
if (pHDD->m_imageloaded)
|
||||||
r = (BYTE)(GetImageSizeInBlocks(pHDD->m_imagehandle) & 0x00ff);
|
r = (BYTE)(pCard->GetImageSizeInBlocks(pHDD->m_imagehandle) & 0x00ff);
|
||||||
else
|
else
|
||||||
r = 0;
|
r = 0;
|
||||||
break;
|
break;
|
||||||
case 0xa:
|
case 0xa:
|
||||||
if (pHDD->m_imageloaded)
|
if (pHDD->m_imageloaded)
|
||||||
r = (BYTE)((GetImageSizeInBlocks(pHDD->m_imagehandle) & 0xff00) >> 8);
|
r = (BYTE)((pCard->GetImageSizeInBlocks(pHDD->m_imagehandle) & 0xff00) >> 8);
|
||||||
else
|
else
|
||||||
r = 0;
|
r = 0;
|
||||||
break;
|
break;
|
||||||
|
@ -750,8 +749,8 @@ BYTE __stdcall HarddiskInterfaceCard::IOWrite(WORD pc, WORD addr, BYTE bWrite, B
|
||||||
|
|
||||||
UINT HarddiskInterfaceCard::GetImageSizeInBlocks(ImageInfo* const pImageInfo)
|
UINT HarddiskInterfaceCard::GetImageSizeInBlocks(ImageInfo* const pImageInfo)
|
||||||
{
|
{
|
||||||
if (g_cmdLine.uHarddiskNumBlocks != 0)
|
if (m_userNumBlocks != 0)
|
||||||
return g_cmdLine.uHarddiskNumBlocks;
|
return m_userNumBlocks;
|
||||||
UINT numberOfBlocks = (pImageInfo ? pImageInfo->uImageSize : 0) / HD_BLOCK_SIZE;
|
UINT numberOfBlocks = (pImageInfo ? pImageInfo->uImageSize : 0) / HD_BLOCK_SIZE;
|
||||||
if (numberOfBlocks > kHarddiskMaxNumBlocks)
|
if (numberOfBlocks > kHarddiskMaxNumBlocks)
|
||||||
numberOfBlocks = kHarddiskMaxNumBlocks;
|
numberOfBlocks = kHarddiskMaxNumBlocks;
|
||||||
|
|
|
@ -100,6 +100,7 @@ public:
|
||||||
void Unplug(const int iDrive);
|
void Unplug(const int iDrive);
|
||||||
bool IsDriveUnplugged(const int iDrive);
|
bool IsDriveUnplugged(const int iDrive);
|
||||||
void LoadLastDiskImage(const int iDrive);
|
void LoadLastDiskImage(const int iDrive);
|
||||||
|
void SetUserNumBlocks(UINT numBlocks) { m_userNumBlocks = numBlocks; }
|
||||||
|
|
||||||
void GetLightStatus(Disk_Status_e* pDisk1Status);
|
void GetLightStatus(Disk_Status_e* pDisk1Status);
|
||||||
bool ImageSwap(void);
|
bool ImageSwap(void);
|
||||||
|
@ -119,7 +120,7 @@ private:
|
||||||
const std::string& DiskGetBaseName(const int iDrive);
|
const std::string& DiskGetBaseName(const int iDrive);
|
||||||
bool SelectImage(const int drive, LPCSTR pszFilename);
|
bool SelectImage(const int drive, LPCSTR pszFilename);
|
||||||
void UpdateLightStatus(HardDiskDrive* pHDD);
|
void UpdateLightStatus(HardDiskDrive* pHDD);
|
||||||
static UINT GetImageSizeInBlocks(ImageInfo* const pImageInfo);
|
UINT GetImageSizeInBlocks(ImageInfo* const pImageInfo);
|
||||||
void SaveSnapshotHDDUnit(YamlSaveHelper& yamlSaveHelper, UINT unit);
|
void SaveSnapshotHDDUnit(YamlSaveHelper& yamlSaveHelper, UINT unit);
|
||||||
bool LoadSnapshotHDDUnit(YamlLoadHelper& yamlLoadHelper, UINT unit);
|
bool LoadSnapshotHDDUnit(YamlLoadHelper& yamlLoadHelper, UINT unit);
|
||||||
|
|
||||||
|
@ -128,6 +129,7 @@ private:
|
||||||
BYTE m_unitNum; // b7=unit
|
BYTE m_unitNum; // b7=unit
|
||||||
BYTE m_command;
|
BYTE m_command;
|
||||||
UINT64 m_notBusyCycle;
|
UINT64 m_notBusyCycle;
|
||||||
|
UINT m_userNumBlocks;
|
||||||
|
|
||||||
bool m_saveDiskImage; // Save the DiskImage name to Registry
|
bool m_saveDiskImage; // Save the DiskImage name to Registry
|
||||||
|
|
||||||
|
|
|
@ -802,6 +802,8 @@ static void RepeatInitialization(void)
|
||||||
{
|
{
|
||||||
if (GetCardMgr().QuerySlot(i) == CT_Disk2 && g_cmdLine.slotInfo[i].isDiskII13)
|
if (GetCardMgr().QuerySlot(i) == CT_Disk2 && g_cmdLine.slotInfo[i].isDiskII13)
|
||||||
dynamic_cast<Disk2InterfaceCard&>(GetCardMgr().GetRef(i)).SetFirmware13Sector();
|
dynamic_cast<Disk2InterfaceCard&>(GetCardMgr().GetRef(i)).SetFirmware13Sector();
|
||||||
|
if (GetCardMgr().QuerySlot(i) == CT_GenericHDD)
|
||||||
|
dynamic_cast<HarddiskInterfaceCard&>(GetCardMgr().GetRef(i)).SetUserNumBlocks(g_cmdLine.uHarddiskNumBlocks);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create window after inserting/removing VidHD card (as it affects width & height)
|
// Create window after inserting/removing VidHD card (as it affects width & height)
|
||||||
|
|
Loading…
Reference in New Issue