mirror of
https://github.com/AppleWin/AppleWin.git
synced 2024-06-22 15:29:29 +00:00
Flush current track (if dirty) before 'Send to CiderPress' (fix #499)
This commit is contained in:
parent
1cb5c6868d
commit
c49d68f2b5
|
@ -320,14 +320,23 @@ static void ReadTrack(const int iDrive)
|
|||
|
||||
//===========================================================================
|
||||
|
||||
void DiskFlushCurrentTrack(const int iDrive)
|
||||
{
|
||||
Disk_t *pFloppy = &g_aFloppyDisk[iDrive];
|
||||
|
||||
if (pFloppy->trackimage && pFloppy->trackimagedirty)
|
||||
WriteTrack(iDrive);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
|
||||
static void RemoveDisk(const int iDrive)
|
||||
{
|
||||
Disk_t *pFloppy = &g_aFloppyDisk[iDrive];
|
||||
|
||||
if (pFloppy->imagehandle)
|
||||
{
|
||||
if (pFloppy->trackimage && pFloppy->trackimagedirty)
|
||||
WriteTrack( iDrive);
|
||||
DiskFlushCurrentTrack(iDrive);
|
||||
|
||||
ImageClose(pFloppy->imagehandle);
|
||||
pFloppy->imagehandle = NULL;
|
||||
|
@ -442,10 +451,7 @@ static void __stdcall DiskControlStepper(WORD, WORD address, BYTE, BYTE, ULONG u
|
|||
: MIN(nNumTracksInImage-1, fptr->phase >> 1); // (round half tracks down)
|
||||
if (newtrack != fptr->track)
|
||||
{
|
||||
if (fptr->trackimage && fptr->trackimagedirty)
|
||||
{
|
||||
WriteTrack(currdrive);
|
||||
}
|
||||
DiskFlushCurrentTrack(currdrive);
|
||||
fptr->track = newtrack;
|
||||
fptr->trackimagedata = 0;
|
||||
}
|
||||
|
|
|
@ -47,6 +47,7 @@ void DiskDestroy(void); // no, doesn't "destroy" the disk image. DiskIIManag
|
|||
|
||||
void DiskBoot(void);
|
||||
void DiskEject(const int iDrive);
|
||||
void DiskFlushCurrentTrack(const int iDrive);
|
||||
|
||||
LPCTSTR DiskGetFullName(const int iDrive);
|
||||
LPCTSTR DiskGetFullDiskFilename(const int iDrive);
|
||||
|
|
|
@ -2040,6 +2040,8 @@ void ProcessDiskPopupMenu(HWND hwnd, POINT pt, const int iDrive)
|
|||
"Please install CiderPress.\n"
|
||||
"Otherwise set the path to CiderPress from Configuration->Disk.";
|
||||
|
||||
DiskFlushCurrentTrack(iDrive);
|
||||
|
||||
//if(!filename1.compare("\"\"") == false) //Do not use this, for some reason it does not work!!!
|
||||
if(!filename1.compare(sFileNameEmpty) )
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Block a user