mirror of
https://github.com/AppleWin/AppleWin.git
synced 2026-04-21 23:16:39 +00:00
#201 Fixed Track/Sector display to be responsive
This commit is contained in:
+27
-16
@@ -64,7 +64,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
string strFilenameInZip; // 0x00 or <FILENAME.EXT>
|
||||
HIMAGE imagehandle; // Init'd by DiskInsert() -> ImageOpen()
|
||||
int track;
|
||||
int nLastTrack;
|
||||
LPBYTE trackimage;
|
||||
int phase;
|
||||
int byte;
|
||||
@@ -83,7 +82,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
strFilenameInZip = other.strFilenameInZip;
|
||||
imagehandle = other.imagehandle;
|
||||
track = other.track;
|
||||
nLastTrack = other.nLastTrack;
|
||||
trackimage = other.trackimage;
|
||||
phase = other.phase;
|
||||
byte = other.byte;
|
||||
@@ -212,7 +210,8 @@ static void CheckSpinning(void)
|
||||
if (floppymotoron)
|
||||
g_aFloppyDisk[currdrive].spinning = 20000;
|
||||
if (modechange)
|
||||
FrameRefreshStatus(DRAW_LEDS);
|
||||
//FrameRefreshStatus(DRAW_LEDS);
|
||||
FrameDrawDiskLEDS( (HDC)0 );
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
@@ -464,6 +463,10 @@ static BYTE __stdcall DiskControlStepper(WORD, WORD address, BYTE, BYTE, ULONG)
|
||||
fptr->track = newtrack;
|
||||
fptr->trackimagedata = 0;
|
||||
}
|
||||
|
||||
// Feature Request #201 Show track status
|
||||
// https://github.com/AppleWin/AppleWin/issues/201
|
||||
FrameDrawDiskStatus( (HDC)0 );
|
||||
}
|
||||
#else // Old 1.13.1 code for Chessmaster 2000 to work! (see bug#18109)
|
||||
const int nNumTracksInImage = ImageGetNumTracks(fptr->imagehandle);
|
||||
@@ -787,16 +790,6 @@ static BYTE __stdcall DiskReadWrite (WORD programcounter, WORD, BYTE, BYTE, ULON
|
||||
if (!fptr->trackimagedata)
|
||||
return 0xFF;
|
||||
|
||||
// Feature Request #201 Show track status
|
||||
// https://github.com/AppleWin/AppleWin/issues/201
|
||||
if( fptr->nLastTrack != fptr->track )
|
||||
{
|
||||
fptr->nLastTrack = fptr->track;
|
||||
|
||||
//FrameRefreshStatus(DRAW_LEDS);
|
||||
DrawStatusAreaDisk( (HDC)0 );
|
||||
}
|
||||
|
||||
BYTE result = 0;
|
||||
|
||||
if (!floppywritemode || !fptr->bWriteProtected)
|
||||
@@ -825,6 +818,12 @@ static BYTE __stdcall DiskReadWrite (WORD programcounter, WORD, BYTE, BYTE, ULON
|
||||
if (++fptr->byte >= fptr->nibbles)
|
||||
fptr->byte = 0;
|
||||
|
||||
// Feature Request #201 Show track status
|
||||
// https://github.com/AppleWin/AppleWin/issues/201
|
||||
// NB. Prevent flooding of forcing UI to redraw!!!
|
||||
if( ((fptr->byte) & 0xFF) == 0 )
|
||||
FrameDrawDiskStatus( (HDC)0 );
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -917,7 +916,10 @@ static BYTE __stdcall DiskSetWriteMode(WORD, WORD, BYTE, BYTE, ULONG)
|
||||
BOOL modechange = !g_aFloppyDisk[currdrive].writelight;
|
||||
g_aFloppyDisk[currdrive].writelight = 20000;
|
||||
if (modechange)
|
||||
FrameRefreshStatus(DRAW_LEDS);
|
||||
{
|
||||
//FrameRefreshStatus(DRAW_LEDS);
|
||||
FrameDrawDiskLEDS( (HDC)0 );
|
||||
}
|
||||
return MemReturnRandomData(1);
|
||||
}
|
||||
|
||||
@@ -932,7 +934,11 @@ void DiskUpdatePosition(DWORD cycles)
|
||||
|
||||
if (fptr->spinning && !floppymotoron) {
|
||||
if (!(fptr->spinning -= MIN(fptr->spinning, (cycles >> 6))))
|
||||
FrameRefreshStatus(DRAW_LEDS);
|
||||
{
|
||||
// FrameRefreshStatus(DRAW_LEDS);
|
||||
FrameDrawDiskLEDS( (HDC)0 );
|
||||
FrameDrawDiskStatus( (HDC)0 );
|
||||
}
|
||||
}
|
||||
|
||||
if (floppywritemode && (currdrive == loop) && fptr->spinning)
|
||||
@@ -942,7 +948,11 @@ void DiskUpdatePosition(DWORD cycles)
|
||||
else if (fptr->writelight)
|
||||
{
|
||||
if (!(fptr->writelight -= MIN(fptr->writelight, (cycles >> 6))))
|
||||
FrameRefreshStatus(DRAW_LEDS);
|
||||
{
|
||||
//FrameRefreshStatus(DRAW_LEDS);
|
||||
FrameDrawDiskLEDS( (HDC)0 );
|
||||
FrameDrawDiskStatus( (HDC)0 );
|
||||
}
|
||||
}
|
||||
|
||||
if ((!enhancedisk) && (!diskaccessed) && fptr->spinning)
|
||||
@@ -973,6 +983,7 @@ bool DiskDriveSwap(void)
|
||||
Disk_SaveLastDiskImage(DRIVE_2);
|
||||
|
||||
FrameRefreshStatus(DRAW_LEDS | DRAW_BUTTON_DRIVES);
|
||||
FrameDrawDiskLEDS( (HDC)0 );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user