WIP: IDC_SLOTn_OPTION for HDD

This commit is contained in:
tomcw
2025-11-22 18:37:59 +00:00
parent f6da6c811d
commit 63ed9bee2b
4 changed files with 60 additions and 17 deletions
+3 -1
View File
@@ -29,6 +29,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "../Common.h"
#include "../CardManager.h"
#include "../Disk.h"
#include "../Harddisk.h"
#include "../Interface.h"
#include "../Mockingboard.h"
#include "../Registry.h"
@@ -164,7 +165,8 @@ INT_PTR CPageSound::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPAR
}
if (m_PropertySheetHelper.GetConfigNew().m_Slot[slot] == CT_GenericHDD)
{
// DialogBox(GetFrame().g_hInstance, (LPCTSTR)IDD_HARD_DISK_DRIVES, hWnd, 0);
HarddiskInterfaceCard::ms_this = dynamic_cast<HarddiskInterfaceCard*>(GetCardMgr().GetObj(slot));
DialogBox(GetFrame().g_hInstance, (LPCTSTR)IDD_HARD_DISK_DRIVES, hWnd, HarddiskInterfaceCard::DlgProc);
}
}
break;
+39
View File
@@ -1223,6 +1223,45 @@ bool HarddiskInterfaceCard::ImageSwap(void)
//===========================================================================
HarddiskInterfaceCard* HarddiskInterfaceCard::ms_this = 0;
INT_PTR CALLBACK HarddiskInterfaceCard::DlgProc(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam)
{
// Switch from static func to our instance
return HarddiskInterfaceCard::ms_this->DlgProcInternal(hWnd, message, wparam, lparam);
}
INT_PTR HarddiskInterfaceCard::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam)
{
switch (message)
{
case WM_COMMAND:
switch (LOWORD(wparam))
{
case IDOK:
// DlgOK(hWnd);
return TRUE;
case IDCANCEL:
// DlgCANCEL(hWnd);
return TRUE;
}
return FALSE;
case WM_CLOSE:
EndDialog(hWnd, 0);
return TRUE;
case WM_INITDIALOG:
// TODO
return TRUE;
}
return FALSE;
}
//===========================================================================
// Unit version history:
// 2: Updated $C7nn firmware to fix GH#319
// 3: Updated $Csnn firmware to fix GH#996 (now slot-independent code)
+4
View File
@@ -121,6 +121,9 @@ public:
virtual void SaveSnapshot(YamlSaveHelper& yamlSaveHelper);
virtual bool LoadSnapshot(YamlLoadHelper& yamlLoadHelper, UINT version);
static INT_PTR CALLBACK DlgProc(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam);
static HarddiskInterfaceCard* ms_this;
static BYTE __stdcall IORead(WORD pc, WORD addr, BYTE bWrite, BYTE d, ULONG nExecutedCycles);
static BYTE __stdcall IOWrite(WORD pc, WORD addr, BYTE bWrite, BYTE d, ULONG nExecutedCycles);
@@ -143,6 +146,7 @@ private:
UINT GetImageSizeInBlocks(ImageInfo* const pImageInfo, const bool is16bit = false);
void SaveSnapshotHDDUnit(YamlSaveHelper& yamlSaveHelper, const UINT unit);
bool LoadSnapshotHDDUnit(YamlLoadHelper& yamlLoadHelper, const UINT unit, const UINT version);
INT_PTR DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam);
//