mirror of
https://github.com/AppleWin/AppleWin.git
synced 2024-12-23 00:30:17 +00:00
Applied Nick's patch for 'disk info' cmd
This commit is contained in:
parent
24b0f4080e
commit
7232ebe523
@ -15,7 +15,8 @@ tomch at users.berlios.de
|
||||
|
||||
Latest:
|
||||
-------
|
||||
|
||||
Changes:
|
||||
. Debugger: Added "disk info" command
|
||||
Fixes:
|
||||
. [ Bug #19154 ] ProDOS Order 2IMG crashing
|
||||
|
||||
|
@ -3620,9 +3620,32 @@ Update_t CmdDisk ( int nArgs)
|
||||
if (! nArgs)
|
||||
goto _Help;
|
||||
|
||||
// check for info command
|
||||
int iParam = 0;
|
||||
int nInfoFound = FindParam( g_aArgs[ 1 ].sArg, MATCH_EXACT, iParam, _PARAM_DISK_BEGIN, _PARAM_DISK_END );
|
||||
if (iParam == PARAM_DISK_INFO)
|
||||
{
|
||||
if (nArgs > 2)
|
||||
goto _Help;
|
||||
|
||||
int drive = DiskGetCurrentDrive() + 1;
|
||||
char buffer[200] = "";
|
||||
sprintf(buffer, "D%d at T$%X (%d), phase $%X, offset $%X, %s",
|
||||
drive,
|
||||
DiskGetCurrentTrack(),
|
||||
DiskGetCurrentTrack(),
|
||||
DiskGetCurrentPhase(),
|
||||
DiskGetCurrentOffset(),
|
||||
DiskGetCurrentState());
|
||||
|
||||
ConsoleBufferPush(buffer);
|
||||
return ConsoleUpdate();
|
||||
}
|
||||
|
||||
if (nArgs < 2)
|
||||
goto _Help;
|
||||
|
||||
// first param should be drive
|
||||
int iDrive = g_aArgs[ 1 ].nValue;
|
||||
|
||||
if ((iDrive < 1) || (iDrive > 2))
|
||||
@ -3630,7 +3653,7 @@ Update_t CmdDisk ( int nArgs)
|
||||
|
||||
iDrive--;
|
||||
|
||||
int iParam = 0;
|
||||
// second param is command
|
||||
int nFound = FindParam( g_aArgs[ 2 ].sArg, MATCH_EXACT, iParam, _PARAM_DISK_BEGIN, _PARAM_DISK_END );
|
||||
|
||||
if (! nFound)
|
||||
|
@ -418,6 +418,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
{TEXT("TARGET") , NULL, PARAM_CONFIG_TARGET },
|
||||
// Disk
|
||||
{TEXT("EJECT") , NULL, PARAM_DISK_EJECT },
|
||||
{TEXT("INFO") , NULL, PARAM_DISK_INFO },
|
||||
{TEXT("PROTECT") , NULL, PARAM_DISK_PROTECT },
|
||||
{TEXT("READ") , NULL, PARAM_DISK_READ },
|
||||
// Font (Config)
|
||||
|
@ -1315,6 +1315,7 @@ const DisasmData_t* pDisasmData;
|
||||
// Disk
|
||||
, _PARAM_DISK_BEGIN = _PARAM_CONFIG_END // Daisy Chain
|
||||
, PARAM_DISK_EJECT = _PARAM_DISK_BEGIN // DISK 1 EJECT
|
||||
, PARAM_DISK_INFO // DISK 1 INFO
|
||||
, PARAM_DISK_PROTECT // DISK 1 PROTECT
|
||||
, PARAM_DISK_READ // DISK 1 READ Track Sector NumSectors MemAddress
|
||||
, _PARAM_DISK_END
|
||||
|
@ -93,7 +93,39 @@ static void WriteTrack (int drive);
|
||||
|
||||
//===========================================================================
|
||||
|
||||
void Disk_LoadLastDiskImage(const int iDrive)
|
||||
int DiskGetCurrentDrive(void) { return currdrive; }
|
||||
int DiskGetCurrentTrack(void) { return g_aFloppyDisk[currdrive].track; }
|
||||
int DiskGetCurrentPhase(void) { return g_aFloppyDisk[currdrive].phase; }
|
||||
int DiskGetCurrentOffset(void) { return g_aFloppyDisk[currdrive].byte; }
|
||||
|
||||
char* DiskGetCurrentState(void)
|
||||
{
|
||||
if (g_aFloppyDisk[currdrive].imagehandle == NULL)
|
||||
return "Empty";
|
||||
|
||||
if (!floppymotoron)
|
||||
{
|
||||
if (g_aFloppyDisk[currdrive].spinning > 0)
|
||||
return "Off (spinning)";
|
||||
else
|
||||
return "Off";
|
||||
}
|
||||
else if (floppywritemode)
|
||||
{
|
||||
if (g_aFloppyDisk[currdrive].bWriteProtected)
|
||||
return "Writing";
|
||||
else
|
||||
return "Writing (write protected)";
|
||||
}
|
||||
else
|
||||
{
|
||||
return "Reading";
|
||||
}
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
|
||||
void Disk_LoadLastDiskImage(const int iDrive)
|
||||
{
|
||||
char sFilePath[ MAX_PATH + 1];
|
||||
sFilePath[0] = 0;
|
||||
|
@ -60,6 +60,11 @@ void DiskNotifyInvalidImage(const int iDrive, LPCTSTR pszImageFilename, const
|
||||
void DiskReset(void);
|
||||
bool DiskGetProtect(const int iDrive);
|
||||
void DiskSetProtect(const int iDrive, const bool bWriteProtect);
|
||||
int DiskGetCurrentDrive();
|
||||
int DiskGetCurrentTrack();
|
||||
int DiskGetCurrentPhase();
|
||||
int DiskGetCurrentOffset();
|
||||
char* DiskGetCurrentState();
|
||||
void DiskSelect(const int iDrive);
|
||||
void DiskUpdatePosition(DWORD);
|
||||
bool DiskDriveSwap(void);
|
||||
|
Loading…
Reference in New Issue
Block a user