mirror of
https://github.com/AppleWin/AppleWin.git
synced 2024-09-30 13:55:37 +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)
|
static void RemoveDisk(const int iDrive)
|
||||||
{
|
{
|
||||||
Disk_t *pFloppy = &g_aFloppyDisk[iDrive];
|
Disk_t *pFloppy = &g_aFloppyDisk[iDrive];
|
||||||
|
|
||||||
if (pFloppy->imagehandle)
|
if (pFloppy->imagehandle)
|
||||||
{
|
{
|
||||||
if (pFloppy->trackimage && pFloppy->trackimagedirty)
|
DiskFlushCurrentTrack(iDrive);
|
||||||
WriteTrack( iDrive);
|
|
||||||
|
|
||||||
ImageClose(pFloppy->imagehandle);
|
ImageClose(pFloppy->imagehandle);
|
||||||
pFloppy->imagehandle = NULL;
|
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)
|
: MIN(nNumTracksInImage-1, fptr->phase >> 1); // (round half tracks down)
|
||||||
if (newtrack != fptr->track)
|
if (newtrack != fptr->track)
|
||||||
{
|
{
|
||||||
if (fptr->trackimage && fptr->trackimagedirty)
|
DiskFlushCurrentTrack(currdrive);
|
||||||
{
|
|
||||||
WriteTrack(currdrive);
|
|
||||||
}
|
|
||||||
fptr->track = newtrack;
|
fptr->track = newtrack;
|
||||||
fptr->trackimagedata = 0;
|
fptr->trackimagedata = 0;
|
||||||
}
|
}
|
||||||
|
@ -47,6 +47,7 @@ void DiskDestroy(void); // no, doesn't "destroy" the disk image. DiskIIManag
|
|||||||
|
|
||||||
void DiskBoot(void);
|
void DiskBoot(void);
|
||||||
void DiskEject(const int iDrive);
|
void DiskEject(const int iDrive);
|
||||||
|
void DiskFlushCurrentTrack(const int iDrive);
|
||||||
|
|
||||||
LPCTSTR DiskGetFullName(const int iDrive);
|
LPCTSTR DiskGetFullName(const int iDrive);
|
||||||
LPCTSTR DiskGetFullDiskFilename(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"
|
"Please install CiderPress.\n"
|
||||||
"Otherwise set the path to CiderPress from Configuration->Disk.";
|
"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("\"\"") == false) //Do not use this, for some reason it does not work!!!
|
||||||
if(!filename1.compare(sFileNameEmpty) )
|
if(!filename1.compare(sFileNameEmpty) )
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user