VOID HD_Cleanup() { for(int i=DRIVE_1; i<DRIVE_2; i++) { HD_CleanupDrive(i); } }
VOID HD_Cleanup(void) { for(int i=HARDDISK_1; i<HARDDISK_2; i++) { HD_CleanupDrive(i); } if (filerom) VirtualFree(filerom ,0,MEM_RELEASE); if (m_pHDExpansionRom) delete m_pHDExpansionRom; }
// imagefilename is qualified with path BOOL HD_InsertDisk(int nDrive, LPCTSTR imagefilename) { if (*imagefilename == 0x00) return false; if (g_HardDrive[nDrive].hd_imageloaded) HD_CleanupDrive(nDrive); BOOL result = HD_Load_Image(nDrive, imagefilename); if (result) GetImageTitle(imagefilename, &g_HardDrive[nDrive]); return result; }
// pszImageFilename is qualified with path BOOL HD_InsertDisk(const int iDrive, LPCTSTR pszImageFilename) { if (*pszImageFilename == 0x00) return false; if (g_HardDisk[iDrive].hd_imageloaded) HD_CleanupDrive(iDrive); BOOL bResult = HD_Load_Image(iDrive, pszImageFilename); if (bResult) GetImageTitle(pszImageFilename, &g_HardDisk[iDrive]); return bResult; }
// imagefilename is qualified with path BOOL HD_InsertDisk(int nDrive, LPCTSTR imagefilename) { if (*imagefilename == 0x00) return false; if (g_HardDrive[nDrive].hd_imageloaded) HD_CleanupDrive(nDrive); BOOL result = HD_Load_Image(nDrive, imagefilename); if (result) GetImageTitle(imagefilename, &g_HardDrive[nDrive]); else NotifyInvalidImage((char*)imagefilename); // could not load hd image return result; }
static ImageError_e ImageOpen( LPCTSTR pszImageFilename, const int iDrive, const bool bCreateIfNecessary, std::string& strFilenameInZip) { if (!pszImageFilename) return eIMAGE_ERROR_BAD_POINTER; HDD* pHDD = &g_HardDisk[iDrive]; ImageInfo* pImageInfo = &pHDD->Info; pImageInfo->bWriteProtected = false; ImageError_e Err = sg_HardDiskImageHelper.Open(pszImageFilename, pImageInfo, bCreateIfNecessary, strFilenameInZip); if (Err != eIMAGE_ERROR_NONE) { HD_CleanupDrive(iDrive); return Err; } return eIMAGE_ERROR_NONE; }
void HD_Unplug(const int iDrive) { if (g_HardDisk[iDrive].hd_imageloaded) HD_CleanupDrive(iDrive); }