mirror of
https://github.com/AppleWin/AppleWin.git
synced 2024-06-26 01:29:30 +00:00
WIP show current disk track
This commit is contained in:
parent
a4bae75d2a
commit
9f8ad1a65b
|
@ -64,6 +64,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
string strFilenameInZip; // 0x00 or <FILENAME.EXT>
|
string strFilenameInZip; // 0x00 or <FILENAME.EXT>
|
||||||
HIMAGE imagehandle; // Init'd by DiskInsert() -> ImageOpen()
|
HIMAGE imagehandle; // Init'd by DiskInsert() -> ImageOpen()
|
||||||
int track;
|
int track;
|
||||||
|
int nLastTrack;
|
||||||
LPBYTE trackimage;
|
LPBYTE trackimage;
|
||||||
int phase;
|
int phase;
|
||||||
int byte;
|
int byte;
|
||||||
|
@ -82,6 +83,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
strFilenameInZip = other.strFilenameInZip;
|
strFilenameInZip = other.strFilenameInZip;
|
||||||
imagehandle = other.imagehandle;
|
imagehandle = other.imagehandle;
|
||||||
track = other.track;
|
track = other.track;
|
||||||
|
nLastTrack = other.nLastTrack;
|
||||||
trackimage = other.trackimage;
|
trackimage = other.trackimage;
|
||||||
phase = other.phase;
|
phase = other.phase;
|
||||||
byte = other.byte;
|
byte = other.byte;
|
||||||
|
@ -117,6 +119,7 @@ int DiskGetCurrentDrive(void) { return currdrive; }
|
||||||
int DiskGetCurrentTrack(void) { return g_aFloppyDisk[currdrive].track; }
|
int DiskGetCurrentTrack(void) { return g_aFloppyDisk[currdrive].track; }
|
||||||
int DiskGetCurrentPhase(void) { return g_aFloppyDisk[currdrive].phase; }
|
int DiskGetCurrentPhase(void) { return g_aFloppyDisk[currdrive].phase; }
|
||||||
int DiskGetCurrentOffset(void) { return g_aFloppyDisk[currdrive].byte; }
|
int DiskGetCurrentOffset(void) { return g_aFloppyDisk[currdrive].byte; }
|
||||||
|
int DiskGetTrack( int drive ) { return g_aFloppyDisk[ drive ].track; }
|
||||||
|
|
||||||
const string& DiskGetDiskPathFilename(const int iDrive)
|
const string& DiskGetDiskPathFilename(const int iDrive)
|
||||||
{
|
{
|
||||||
|
@ -784,6 +787,15 @@ static BYTE __stdcall DiskReadWrite (WORD programcounter, WORD, BYTE, BYTE, ULON
|
||||||
if (!fptr->trackimagedata)
|
if (!fptr->trackimagedata)
|
||||||
return 0xFF;
|
return 0xFF;
|
||||||
|
|
||||||
|
// Bug # .. Show Track status
|
||||||
|
if( fptr->nLastTrack != fptr->track )
|
||||||
|
{
|
||||||
|
fptr->nLastTrack = fptr->track;
|
||||||
|
|
||||||
|
//FrameRefreshStatus(DRAW_LEDS);
|
||||||
|
DrawStatusAreaDisk( (HDC)0 );
|
||||||
|
}
|
||||||
|
|
||||||
BYTE result = 0;
|
BYTE result = 0;
|
||||||
|
|
||||||
if (!floppywritemode || !fptr->bWriteProtected)
|
if (!floppywritemode || !fptr->bWriteProtected)
|
||||||
|
|
|
@ -62,6 +62,7 @@ bool DiskGetProtect(const int iDrive);
|
||||||
void DiskSetProtect(const int iDrive, const bool bWriteProtect);
|
void DiskSetProtect(const int iDrive, const bool bWriteProtect);
|
||||||
int DiskGetCurrentDrive();
|
int DiskGetCurrentDrive();
|
||||||
int DiskGetCurrentTrack();
|
int DiskGetCurrentTrack();
|
||||||
|
int DiskGetTrack( int drive );
|
||||||
int DiskGetCurrentPhase();
|
int DiskGetCurrentPhase();
|
||||||
int DiskGetCurrentOffset();
|
int DiskGetCurrentOffset();
|
||||||
char* DiskGetCurrentState();
|
char* DiskGetCurrentState();
|
||||||
|
|
|
@ -546,6 +546,62 @@ static void DrawFrameWindow ()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DrawStatusAreaDisk( HDC passdc )
|
||||||
|
{
|
||||||
|
FrameReleaseDC();
|
||||||
|
HDC dc = (passdc ? passdc : GetDC(g_hFrameWindow));
|
||||||
|
// HDC dc = g_hFrameDC;
|
||||||
|
|
||||||
|
int x = buttonx;
|
||||||
|
int y = buttony+BUTTONS*BUTTONCY+1;
|
||||||
|
|
||||||
|
Disk_Status_e eDrive1Status = DISK_STATUS_OFF;
|
||||||
|
Disk_Status_e eDrive2Status = DISK_STATUS_OFF;
|
||||||
|
DiskGetLightStatus(&eDrive1Status, &eDrive2Status);
|
||||||
|
|
||||||
|
int Disk1Track = DiskGetTrack(0);
|
||||||
|
int Disk2Track = DiskGetTrack(1);
|
||||||
|
|
||||||
|
if (g_bIsFullScreen)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
SelectObject(dc,smallfont);
|
||||||
|
SetBkMode(dc,OPAQUE);
|
||||||
|
SetBkColor(dc,RGB(0,0,0));
|
||||||
|
SetTextAlign(dc,TA_LEFT | TA_TOP);
|
||||||
|
*/
|
||||||
|
SetTextColor(dc, g_aDiskFullScreenColorsLED[ eDrive1Status ] );
|
||||||
|
TextOut(dc,x+ 3,y+2,TEXT("1"),1);
|
||||||
|
|
||||||
|
SetTextColor(dc, g_aDiskFullScreenColorsLED[ eDrive2Status ] );
|
||||||
|
TextOut(dc,x+13,y+2,TEXT("2"),1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
RECT rDiskLed = {0,0,8,8};
|
||||||
|
|
||||||
|
DrawBitmapRect(dc,x+12,y+6,&rDiskLed,g_hDiskWindowedLED[eDrive1Status]);
|
||||||
|
DrawBitmapRect(dc,x+31,y+6,&rDiskLed,g_hDiskWindowedLED[eDrive2Status]);
|
||||||
|
|
||||||
|
// Track/Sector
|
||||||
|
SelectObject(dc,smallfont);
|
||||||
|
SetTextAlign(dc,TA_CENTER | TA_TOP);
|
||||||
|
SetTextColor(dc,RGB(0,0,0));
|
||||||
|
SetBkMode(dc,TRANSPARENT);
|
||||||
|
// SetBkMode(dc,OPAQUE);
|
||||||
|
|
||||||
|
char buffer[16] = "";
|
||||||
|
sprintf_s( buffer, sizeof(buffer), "%2d ", Disk1Track );
|
||||||
|
TextOut(dc,x+16,y+5,buffer, strlen(buffer) ); // 1
|
||||||
|
|
||||||
|
sprintf_s( buffer, sizeof(buffer), "%2d ", Disk2Track );
|
||||||
|
TextOut(dc,x+35,y+5,buffer, strlen(buffer) );
|
||||||
|
}
|
||||||
|
|
||||||
|
// if (!passdc)
|
||||||
|
// ReleaseDC(g_hFrameWindow,dc);
|
||||||
|
}
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
static void DrawStatusArea (HDC passdc, int drawflags)
|
static void DrawStatusArea (HDC passdc, int drawflags)
|
||||||
{
|
{
|
||||||
|
@ -556,10 +612,6 @@ static void DrawStatusArea (HDC passdc, int drawflags)
|
||||||
const bool bCaps = KeybGetCapsStatus();
|
const bool bCaps = KeybGetCapsStatus();
|
||||||
//const bool bP8Caps = KeybGetP8CapsStatus(); // TODO: FIXME: Not used ?! Should show the LED status ...
|
//const bool bP8Caps = KeybGetP8CapsStatus(); // TODO: FIXME: Not used ?! Should show the LED status ...
|
||||||
|
|
||||||
Disk_Status_e eDrive1Status = DISK_STATUS_OFF;
|
|
||||||
Disk_Status_e eDrive2Status = DISK_STATUS_OFF;
|
|
||||||
DiskGetLightStatus(&eDrive1Status, &eDrive2Status);
|
|
||||||
|
|
||||||
#if HD_LED
|
#if HD_LED
|
||||||
// 1.19.0.0 Hard Disk Status/Indicator Light
|
// 1.19.0.0 Hard Disk Status/Indicator Light
|
||||||
Disk_Status_e eHardDriveStatus = DISK_STATUS_OFF;
|
Disk_Status_e eHardDriveStatus = DISK_STATUS_OFF;
|
||||||
|
@ -573,11 +625,7 @@ static void DrawStatusArea (HDC passdc, int drawflags)
|
||||||
SetBkColor(dc,RGB(0,0,0));
|
SetBkColor(dc,RGB(0,0,0));
|
||||||
SetTextAlign(dc,TA_LEFT | TA_TOP);
|
SetTextAlign(dc,TA_LEFT | TA_TOP);
|
||||||
|
|
||||||
SetTextColor(dc, g_aDiskFullScreenColorsLED[ eDrive1Status ] );
|
// DrawStatusAreaDisk( passdc );
|
||||||
TextOut(dc,x+ 3,y+2,TEXT("1"),1);
|
|
||||||
|
|
||||||
SetTextColor(dc, g_aDiskFullScreenColorsLED[ eDrive2Status ] );
|
|
||||||
TextOut(dc,x+13,y+2,TEXT("2"),1);
|
|
||||||
|
|
||||||
#if HD_LED
|
#if HD_LED
|
||||||
SetTextColor(dc, g_aDiskFullScreenColorsLED[ eHardDriveStatus ] );
|
SetTextColor(dc, g_aDiskFullScreenColorsLED[ eHardDriveStatus ] );
|
||||||
|
@ -618,9 +666,8 @@ static void DrawStatusArea (HDC passdc, int drawflags)
|
||||||
TextOut(dc,x+BUTTONCX/2,y+13,(g_nAppMode == MODE_PAUSED
|
TextOut(dc,x+BUTTONCX/2,y+13,(g_nAppMode == MODE_PAUSED
|
||||||
? TITLE_PAUSED
|
? TITLE_PAUSED
|
||||||
: TITLE_STEPPING) ,8);
|
: TITLE_STEPPING) ,8);
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else // g_bIsFullScreen
|
||||||
{
|
{
|
||||||
if (drawflags & DRAW_BACKGROUND)
|
if (drawflags & DRAW_BACKGROUND)
|
||||||
{
|
{
|
||||||
|
@ -638,12 +685,10 @@ static void DrawStatusArea (HDC passdc, int drawflags)
|
||||||
// 1.19.0.0 Hard Disk Status/Indicator Light
|
// 1.19.0.0 Hard Disk Status/Indicator Light
|
||||||
TextOut(dc,x+ 7,y+17,TEXT("H"),1);
|
TextOut(dc,x+ 7,y+17,TEXT("H"),1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (drawflags & DRAW_LEDS)
|
if (drawflags & DRAW_LEDS)
|
||||||
{
|
{
|
||||||
RECT rDiskLed = {0,0,8,8};
|
DrawStatusAreaDisk( dc );
|
||||||
|
|
||||||
DrawBitmapRect(dc,x+12,y+6,&rDiskLed,g_hDiskWindowedLED[eDrive1Status]);
|
|
||||||
DrawBitmapRect(dc,x+31,y+6,&rDiskLed,g_hDiskWindowedLED[eDrive2Status]);
|
|
||||||
|
|
||||||
if (!IS_APPLE2)
|
if (!IS_APPLE2)
|
||||||
{
|
{
|
||||||
|
@ -662,6 +707,7 @@ static void DrawStatusArea (HDC passdc, int drawflags)
|
||||||
|
|
||||||
#if HD_LED
|
#if HD_LED
|
||||||
// 1.19.0.0 Hard Disk Status/Indicator Light
|
// 1.19.0.0 Hard Disk Status/Indicator Light
|
||||||
|
RECT rDiskLed = {0,0,8,8};
|
||||||
DrawBitmapRect(dc,x+12,y+18,&rDiskLed,g_hDiskWindowedLED[eHardDriveStatus]);
|
DrawBitmapRect(dc,x+12,y+18,&rDiskLed,g_hDiskWindowedLED[eHardDriveStatus]);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -672,6 +718,7 @@ static void DrawStatusArea (HDC passdc, int drawflags)
|
||||||
GetAppleWindowTitle(); // SetWindowText() // WindowTitle
|
GetAppleWindowTitle(); // SetWindowText() // WindowTitle
|
||||||
SendMessage(g_hFrameWindow,WM_SETTEXT,0,(LPARAM)g_pAppTitle);
|
SendMessage(g_hFrameWindow,WM_SETTEXT,0,(LPARAM)g_pAppTitle);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (drawflags & DRAW_BUTTON_DRIVES)
|
if (drawflags & DRAW_BUTTON_DRIVES)
|
||||||
{
|
{
|
||||||
DrawButton(dc, BTN_DRIVE1);
|
DrawButton(dc, BTN_DRIVE1);
|
||||||
|
|
|
@ -48,6 +48,8 @@
|
||||||
bool GetFullScreen32Bit(void);
|
bool GetFullScreen32Bit(void);
|
||||||
void SetFullScreen32Bit(bool b32Bit);
|
void SetFullScreen32Bit(bool b32Bit);
|
||||||
|
|
||||||
|
void DrawStatusAreaDisk( HDC hdc );
|
||||||
|
|
||||||
LRESULT CALLBACK FrameWndProc (
|
LRESULT CALLBACK FrameWndProc (
|
||||||
HWND window,
|
HWND window,
|
||||||
UINT message,
|
UINT message,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user