Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Andrea Odetti 2017-10-20 20:10:34 +01:00
commit 0c9bec8af3
3 changed files with 15 additions and 6 deletions

View file

@ -351,14 +351,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;
@ -473,10 +482,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;
}

View file

@ -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);

View file

@ -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) )
{