Replace two line disk info. with one line

This commit is contained in:
michaelangel007 2023-04-27 21:37:15 -07:00
parent 89e16847e8
commit 66fc4ab2eb
4 changed files with 16 additions and 51 deletions

View File

@ -1,10 +1,5 @@
/*
2.9.1.21 Added: DISK INFO [#]
You can now config and see a 1 or 2 line DISK INFO line.
To configure 1 or 2 line respectively use:
DISK INFO 1
DISK INFO 2
2.9.1.20 Added: 1 line status to DISK INFO
2.9.1.20 Fixed: Changed DISK INFO to have 1 line abbreviation for disk state
2.9.1.19 Added: QoL to DISK INFO.
Colorized numbers and status to improve readability.
Also shows the .WOZ current shift register.

View File

@ -53,7 +53,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#define MAKE_VERSION(a,b,c,d) ((a<<24) | (b<<16) | (c<<8) | (d))
// See /docs/Debugger_Changelog.txt for full details
const int DEBUGGER_VERSION = MAKE_VERSION(2,9,1,21);
const int DEBUGGER_VERSION = MAKE_VERSION(2,9,1,20);
// Public _________________________________________________________________________________________
@ -217,8 +217,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
int g_iConfigDisasmBranchType = DISASM_BRANCH_FANCY;
int g_bConfigDisasmImmediateChar = DISASM_IMMED_BOTH;
int g_iConfigDisasmScroll = 3; // favor 3 byte opcodes
// Config - Disk
bool g_bConfigDiskOneLine = false; // DISK INFO [#]
// Config - Info
bool g_bConfigInfoTargetPointer = false;
@ -3638,7 +3636,6 @@ Update_t CmdFlag (int nArgs)
// Usage:
// DISK SLOT [#] // Show [or set] the current slot of the Disk II I/F card (for all other cmds to act on)
// DISK INFO // Info for current drive
// DISK INFO [#] // Set 1 or 2 line info. output
// DISK # EJECT // Unmount disk
// DISK # PROTECT # // Write-protect disk on/off
// DISK # "<filename>" // Mount filename as floppy disk
@ -3684,32 +3681,13 @@ Update_t CmdDisk (int nArgs)
if (iParam == PARAM_DISK_INFO)
{
if (nArgs > 2)
if (nArgs > 1)
return HelpLastCommand();
if (nArgs == 2)
{
int nLines = g_aArgs[ 2 ].nValue;
if ((nLines == 1) || (nLines == 2))
g_bConfigDiskOneLine = (nLines == 1);
else
return ConsoleDisplayErrorFormat("Can only display 1 or 2 disk status line.");
}
Disk_Status_e eDiskState;
LPCTSTR sDiskState = diskCard.GetCurrentState(eDiskState);
BYTE nShiftReg = diskCard.GetCurrentShiftReg();
static const char *aDiskStateMiniDesc[NUM_DISK_STATUS] =
{
"Off" // DISK_STATUS_OFF
,"R" // DISK_STATUS_READ
,"W" // DISK_STATUS_WRITE
,"WP" // DISK_STATUS_PROT
,"n/a" // DISK_STATUS_EMPTY
,"Spin" // DISK_STATUS_SPIN
};
static const char *aDiskStatusCHC[NUM_DISK_STATUS] =
{
CHC_INFO "%s" CHC_DEFAULT " " CHC_NUM_HEX " " // DISK_STATUS_OFF
@ -3726,18 +3704,9 @@ Update_t CmdDisk (int nArgs)
CHC_DEFAULT " T$" CHC_NUM_HEX "%s" CHC_ARG_SEP ","
CHC_DEFAULT " Phase $" CHC_NUM_HEX "%s" CHC_ARG_SEP ","
CHC_DEFAULT " bitOffset $" CHC_ADDRESS "%04X" CHC_ARG_SEP ","
CHC_DEFAULT " Cycles " CHC_NUM_DEC "%.2f" CHC_ARG_SEP ","
CHC_DEFAULT " Cycles " CHC_NUM_DEC "%.2f" CHC_ARG_SEP ", "
);
std::string Format2(g_bConfigDiskOneLine ? " " : "\n "); // Same line? 1 space after comma
Format2 += aDiskStatusCHC[eDiskState]; // Two lines? Extra indent for readability
if (g_bConfigDiskOneLine)
{
sDiskState = aDiskStateMiniDesc[eDiskState];
}
Format += Format2;
Format += aDiskStatusCHC[eDiskState];
ConsolePrintFormat(
Format.c_str(),

View File

@ -176,16 +176,17 @@ LPCTSTR Disk2InterfaceCard::GetCurrentState(Disk_Status_e& eDiskState_)
}
}
static const char *aDiskStateLongDesc[NUM_DISK_STATUS] =
static const char *aDiskStateMiniDesc[NUM_DISK_STATUS] =
{
"Off" // DISK_STATUS_OFF
,"Reading" // DISK_STATUS_READ
,"Writing" // DISK_STATUS_WRITE
,"Writing (write protected)" // DISK_STATUS_PROT
,"Empty" // DISK_STATUS_EMPTY
,"Off (spinning)" // DISK_STATUS_SPIN
"Off" // DISK_STATUS_OFF
,"R" // DISK_STATUS_READ
,"W" // DISK_STATUS_WRITE
,"WP" // DISK_STATUS_PROT
,"n/a" // DISK_STATUS_EMPTY
,"Spin" // DISK_STATUS_SPIN
};
return aDiskStateLongDesc[eDiskState_];
return aDiskStateMiniDesc[eDiskState_];
}
//===========================================================================

View File

@ -45,12 +45,12 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
enum Disk_Status_e
{
DISK_STATUS_OFF ,
DISK_STATUS_OFF , // motor is off
DISK_STATUS_READ ,
DISK_STATUS_WRITE,
DISK_STATUS_PROT , // NOTE: GetDriveLightStatus() and GetCurrentState() return slightly different states
DISK_STATUS_EMPTY, // See: GetCurrentState(); no disk image mounted
DISK_STATUS_SPIN , // See: GetCurrentState(), not reading, not writing
DISK_STATUS_SPIN , // See: GetCurrentState(), motor has been turned off, spinning before stopping
NUM_DISK_STATUS
};