added 'SYSINFO' BASIC command
This commit is contained in:
1 parent
9a154b3710
commit
19dfa0f4a1
7 files changed
+210
-42
No files matched your search
@@ -84,6 +84,10 @@ Displays BASIC memory usage information:
|
|||||||
* `STRS` - bytes occupied by strings, also the ones belonging to arrays
|
* `STRS` - bytes occupied by strings, also the ones belonging to arrays
|
||||||
* `FREE` - unused space
|
* `FREE` - unused space
|
||||||
|
|
||||||
|
### `SYSINFO` (Mega65)
|
||||||
|
|
||||||
|
Displays various system information.
|
||||||
|
|
||||||
### `CLEAR` (all)
|
### `CLEAR` (all)
|
||||||
|
|
||||||
Clears the screen content.
|
Clears the screen content.
|
||||||
|
|||||||
@@ -27,6 +27,7 @@
|
|||||||
|
|
||||||
// MISC registers
|
// MISC registers
|
||||||
|
|
||||||
|
.label MISC_BOARDID = $D629 // board identification byte
|
||||||
.label MISC_EMU = $D710 // to enable badlines and slow interrupts
|
.label MISC_EMU = $D710 // to enable badlines and slow interrupts
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -22,7 +22,8 @@
|
|||||||
// varstr_garbage_collect, // cmd_dispose
|
// varstr_garbage_collect, // cmd_dispose
|
||||||
|
|
||||||
cmd_cold,
|
cmd_cold,
|
||||||
cmd_mem
|
cmd_mem,
|
||||||
|
cmd_sysinfo
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,105 @@
|
|||||||
|
// #LAYOUT# M65 * #TAKE
|
||||||
|
// #LAYOUT# * * #IGNORE
|
||||||
|
|
||||||
|
|
||||||
|
#if SEGMENT_BASIC_0
|
||||||
|
|
||||||
|
cmd_sysinfo:
|
||||||
|
|
||||||
|
jsr map_BASIC_1
|
||||||
|
jsr_ind VB1__cmd_sysinfo
|
||||||
|
jmp map_NORMAL
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
cmd_sysinfo:
|
||||||
|
|
||||||
|
jsr print_return
|
||||||
|
|
||||||
|
// Print mode and build information
|
||||||
|
|
||||||
|
ldx #IDX__STR_SI_HEADER
|
||||||
|
jsr print_packed_misc_str
|
||||||
|
|
||||||
|
jsr M65_ISMODE65
|
||||||
|
bcc !+
|
||||||
|
|
||||||
|
ldx #IDX__STR_SI_MODE64
|
||||||
|
skip_2_bytes_trash_nvz
|
||||||
|
!:
|
||||||
|
ldx #IDX__STR_SI_MODE65
|
||||||
|
jsr print_packed_misc_str
|
||||||
|
|
||||||
|
ldx #IDX__STR_SI_HDR_REL
|
||||||
|
jsr print_packed_misc_str
|
||||||
|
|
||||||
|
lda #<rom_revision_basic_string
|
||||||
|
ldy #>rom_revision_basic_string
|
||||||
|
jsr STROUT
|
||||||
|
|
||||||
|
// Print board ID
|
||||||
|
|
||||||
|
ldx #IDX__STR_SI_HDR_HW
|
||||||
|
jsr print_packed_misc_str
|
||||||
|
|
||||||
|
lda MISC_BOARDID
|
||||||
|
ldy #(__cmd_sysinfo_hw_ids_end - cmd_sysinfo_hw_ids - 1)
|
||||||
|
!:
|
||||||
|
cmp cmd_sysinfo_hw_ids, y
|
||||||
|
beq !+
|
||||||
|
dey
|
||||||
|
bpl !-
|
||||||
|
ldy #(__cmd_sysinfo_hw_ids_end - cmd_sysinfo_hw_ids)
|
||||||
|
!:
|
||||||
|
ldx cmd_sysinfo_hw_str, y
|
||||||
|
jsr print_packed_misc_str
|
||||||
|
|
||||||
|
// Print video system information
|
||||||
|
|
||||||
|
ldx #IDX__STR_SI_HDR_VID
|
||||||
|
jsr print_packed_misc_str
|
||||||
|
|
||||||
|
ldx #IDX__STR_NTSC
|
||||||
|
lda TVSFLG
|
||||||
|
beq !+
|
||||||
|
ldx #IDX__STR_PAL
|
||||||
|
!:
|
||||||
|
jsr print_packed_misc_str
|
||||||
|
|
||||||
|
// Print build featires information
|
||||||
|
|
||||||
|
ldx #IDX__STR_SI_FEATURES
|
||||||
|
jmp print_packed_misc_str
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
cmd_sysinfo_hw_ids:
|
||||||
|
|
||||||
|
.byte $01
|
||||||
|
.byte $02
|
||||||
|
.byte $03
|
||||||
|
.byte $21
|
||||||
|
.byte $40
|
||||||
|
.byte $41
|
||||||
|
.byte $42
|
||||||
|
.byte $FD
|
||||||
|
.byte $FE
|
||||||
|
|
||||||
|
__cmd_sysinfo_hw_ids_end:
|
||||||
|
|
||||||
|
cmd_sysinfo_hw_str:
|
||||||
|
|
||||||
|
.byte IDX__STR_SI_HW_01
|
||||||
|
.byte IDX__STR_SI_HW_02
|
||||||
|
.byte IDX__STR_SI_HW_03
|
||||||
|
.byte IDX__STR_SI_HW_21
|
||||||
|
.byte IDX__STR_SI_HW_40
|
||||||
|
.byte IDX__STR_SI_HW_41
|
||||||
|
.byte IDX__STR_SI_HW_42
|
||||||
|
.byte IDX__STR_SI_HW_FD
|
||||||
|
.byte IDX__STR_SI_HW_FE
|
||||||
|
.byte IDX__STR_SI_HW_XX
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -22,8 +22,9 @@
|
|||||||
.label VB1__do_clr = $4000 + 2 * 7
|
.label VB1__do_clr = $4000 + 2 * 7
|
||||||
.label VB1__do_restore = $4000 + 2 * 8
|
.label VB1__do_restore = $4000 + 2 * 8
|
||||||
.label VB1__cmd_mem_cont = $4000 + 2 * 9
|
.label VB1__cmd_mem_cont = $4000 + 2 * 9
|
||||||
.label VB1__prepare_direct_execution = $4000 + 2 * 10
|
.label VB1__cmd_sysinfo = $4000 + 2 * 10
|
||||||
.label VB1__helper_ask_if_sure = $4000 + 2 * 11
|
.label VB1__prepare_direct_execution = $4000 + 2 * 11
|
||||||
|
.label VB1__helper_ask_if_sure = $4000 + 2 * 12
|
||||||
|
|
||||||
#if CONFIG_DOS_WEDGE
|
#if CONFIG_DOS_WEDGE
|
||||||
.label VB1__wedge_dos = $4000 + 2 * 12
|
.label VB1__wedge_dos = $4000 + 2 * 12
|
||||||
@@ -43,6 +44,7 @@
|
|||||||
.word do_clr
|
.word do_clr
|
||||||
.word do_restore
|
.word do_restore
|
||||||
.word cmd_mem_cont
|
.word cmd_mem_cont
|
||||||
|
.word cmd_sysinfo
|
||||||
.word prepare_direct_execution
|
.word prepare_direct_execution
|
||||||
.word helper_ask_if_sure
|
.word helper_ask_if_sure
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,8 @@
|
|||||||
|
|
||||||
// Routine is too long to fit in the original location
|
// Routine is too long to fit in the original location
|
||||||
|
|
||||||
|
// XXX banner-related code needs cleanup, move MEGA65 stuff to a separate file
|
||||||
|
|
||||||
|
|
||||||
#if ROM_LAYOUT_M65
|
#if ROM_LAYOUT_M65
|
||||||
|
|
||||||
|
|||||||
+92
-39
@@ -202,6 +202,7 @@ const StringEntryList GLOBAL_Keywords_02 = { ListType::KEYWORDS, "keywords_02",
|
|||||||
|
|
||||||
{ false, true, false, false, "K02_07", "COLD", }, // Not present in CBM BASIC dialects, but common to some extensions (*)
|
{ false, true, false, false, "K02_07", "COLD", }, // Not present in CBM BASIC dialects, but common to some extensions (*)
|
||||||
{ false, true, false, false, "K02_08", "MEM", }, // Not present in CBM BASIC dialects, Open ROMs specific
|
{ false, true, false, false, "K02_08", "MEM", }, // Not present in CBM BASIC dialects, Open ROMs specific
|
||||||
|
{ false, true, false, false, "K02_09", "SYSINFO", }, // Not present in CBM BASIC dialects, Open ROMs specific
|
||||||
|
|
||||||
// (*) see https://sourceforge.net/p/vice-emu/code/HEAD/tree/trunk/vice/src/petcat.c
|
// (*) see https://sourceforge.net/p/vice-emu/code/HEAD/tree/trunk/vice/src/petcat.c
|
||||||
} };
|
} };
|
||||||
@@ -283,22 +284,41 @@ const StringEntryList GLOBAL_Errors = { ListType::STRINGS_BASIC, "errors",
|
|||||||
const StringEntryList GLOBAL_MiscStrings = { ListType::STRINGS_BASIC, "misc",
|
const StringEntryList GLOBAL_MiscStrings = { ListType::STRINGS_BASIC, "misc",
|
||||||
{
|
{
|
||||||
// STD M65 U64 X16 --- misc strings as on CBM machines
|
// STD M65 U64 X16 --- misc strings as on CBM machines
|
||||||
{ true, true, true, true, "STR_RET_QM", "\r?" },
|
{ true, true, true, true, "STR_RET_QM", "\r?" },
|
||||||
{ true, true, true, true, "STR_BYTES", " BASIC BYTES FREE" }, // https://github.com/stefanhaustein/expressionparser
|
{ true, true, true, true, "STR_BYTES", " BASIC BYTES FREE" }, // https://github.com/stefanhaustein/expressionparser
|
||||||
{ true, true, true, true, "STR_READY", "\rREADY.\r" }, // https://www.ibm.com/support/knowledgecenter/zosbasics/com.ibm.zos.zconcepts/zconc_whatistsonative.htm https://github.com/stefanhaustein/expressionparser
|
{ true, true, true, true, "STR_READY", "\rREADY.\r" }, // https://www.ibm.com/support/knowledgecenter/zosbasics/com.ibm.zos.zconcepts/zconc_whatistsonative.htm https://github.com/stefanhaustein/expressionparser
|
||||||
{ true, true, true, true, "STR_ERROR", " ERROR" }, // simply the word error that is attached to the other parts of messages https://fjkraan.home.xs4all.nl/comp/apple2faq/app2asoftfaq.html
|
{ true, true, true, true, "STR_ERROR", " ERROR" }, // simply the word error that is attached to the other parts of messages https://fjkraan.home.xs4all.nl/comp/apple2faq/app2asoftfaq.html
|
||||||
{ true, true, true, true, "STR_IN", " IN " },
|
{ true, true, true, true, "STR_IN", " IN " },
|
||||||
{ false, true, false, false, "STR_IF_SURE", "\rARE YOU SURE? " }, // https://docs.microsoft.com/en-us/windows/win32/uxguide/mess-confirm
|
{ false, true, false, false, "STR_IF_SURE", "\rARE YOU SURE? " }, // https://docs.microsoft.com/en-us/windows/win32/uxguide/mess-confirm
|
||||||
// STD M65 U64 X16 --- misc strings specific to Open ROMs, not present in CBM ROMs
|
// STD M65 U64 X16 --- misc strings specific to Open ROMs, not present in CBM ROMs
|
||||||
{ true, true, true, true, "STR_BRK_AT", "\rBRK AT $" },
|
{ true, true, true, true, "STR_BRK_AT", "\rBRK AT $" },
|
||||||
{ false, true, false, false, "STR_MEM_HDR", "\r\x12 AREA START SIZE \r" },
|
|
||||||
{ false, true, false, false, "STR_MEM_1", " $" },
|
{ false, true, false, false, "STR_MEM_HDR", "\r\x12 AREA START SIZE \r" },
|
||||||
{ false, true, false, false, "STR_MEM_2", " " },
|
{ false, true, false, false, "STR_MEM_1", " $" },
|
||||||
{ false, true, false, false, "STR_MEM_TEXT", "\r TEXT" },
|
{ false, true, false, false, "STR_MEM_2", " " },
|
||||||
{ false, true, false, false, "STR_MEM_VARS", "\r VARS" },
|
{ false, true, false, false, "STR_MEM_TEXT", "\r TEXT" },
|
||||||
{ false, true, false, false, "STR_MEM_ARRS", "\r ARRS" },
|
{ false, true, false, false, "STR_MEM_VARS", "\r VARS" },
|
||||||
{ false, true, false, false, "STR_MEM_STRS", "\r STRS" },
|
{ false, true, false, false, "STR_MEM_ARRS", "\r ARRS" },
|
||||||
{ false, true, false, false, "STR_MEM_FREE", "\r\r FREE" },
|
{ false, true, false, false, "STR_MEM_STRS", "\r STRS" },
|
||||||
|
{ false, true, false, false, "STR_MEM_FREE", "\r\r FREE" },
|
||||||
|
|
||||||
|
{ false, true, false, false, "STR_SI_HEADER", "OPEN ROMS, " },
|
||||||
|
{ false, true, false, false, "STR_SI_MODE64", "LEGACY MODE" },
|
||||||
|
{ false, true, false, false, "STR_SI_MODE65", "NATIVE MODE" },
|
||||||
|
{ false, true, false, false, "STR_SI_HDR_REL", "\rRELEASE " },
|
||||||
|
{ false, true, false, false, "STR_SI_HDR_HW", "\r\rBOARD : " },
|
||||||
|
{ false, true, false, false, "STR_SI_HW_01", "MEGA65 R1" },
|
||||||
|
{ false, true, false, false, "STR_SI_HW_02", "MEGA65 R2" },
|
||||||
|
{ false, true, false, false, "STR_SI_HW_03", "MEGA65 R3" },
|
||||||
|
{ false, true, false, false, "STR_SI_HW_21", "MEGAPHONE R1" },
|
||||||
|
{ false, true, false, false, "STR_SI_HW_40", "NEXYS4 PSRAM" },
|
||||||
|
{ false, true, false, false, "STR_SI_HW_41", "NEXYS4 DDR" },
|
||||||
|
{ false, true, false, false, "STR_SI_HW_42", "NEXYS4 DDR WIDGET" },
|
||||||
|
{ false, true, false, false, "STR_SI_HW_FD", "WUKONG A100T" },
|
||||||
|
{ false, true, false, false, "STR_SI_HW_FE", "SIMULATION VHDL" },
|
||||||
|
{ false, true, false, false, "STR_SI_HW_XX", "UNKNOWN" },
|
||||||
|
{ false, true, false, false, "STR_SI_HDR_VID", "\rVIDEO : " },
|
||||||
|
|
||||||
|
|
||||||
// Note: depending on configuration, additional strings will be added here
|
// Note: depending on configuration, additional strings will be added here
|
||||||
} };
|
} };
|
||||||
@@ -1108,68 +1128,91 @@ void DataSet::generateConfigDepStrings()
|
|||||||
// Generate string to show the build features
|
// Generate string to show the build features
|
||||||
|
|
||||||
std::string featureStr;
|
std::string featureStr;
|
||||||
|
std::string featureStrM65 = "\r";
|
||||||
|
|
||||||
// Tape support features
|
// Tape support features
|
||||||
|
|
||||||
if (GLOBAL_ConfigOptions["CONFIG_TAPE_NORMAL"] && GLOBAL_ConfigOptions["CONFIG_TAPE_TURBO"])
|
if (GLOBAL_ConfigOptions["CONFIG_TAPE_NORMAL"] && GLOBAL_ConfigOptions["CONFIG_TAPE_TURBO"])
|
||||||
{
|
{
|
||||||
featureStr = "TAPE LOAD NORMAL TURBO\r";
|
featureStr += "TAPE LOAD NORMAL TURBO\r";
|
||||||
|
featureStrM65 += "TAPE : LOAD NORMAL TURBO\r";
|
||||||
}
|
}
|
||||||
else if (GLOBAL_ConfigOptions["CONFIG_TAPE_NORMAL"])
|
else if (GLOBAL_ConfigOptions["CONFIG_TAPE_NORMAL"])
|
||||||
{
|
{
|
||||||
featureStr = "TAPE LOAD NORMAL\r";
|
featureStr += "TAPE LOAD NORMAL\r";
|
||||||
|
featureStrM65 += "TAPE : LOAD NORMAL\r";
|
||||||
}
|
}
|
||||||
else if (GLOBAL_ConfigOptions["CONFIG_TAPE_TURBO"])
|
else if (GLOBAL_ConfigOptions["CONFIG_TAPE_TURBO"])
|
||||||
{
|
{
|
||||||
featureStr = "TAPE LOAD TURBO\r";
|
featureStr += "TAPE LOAD TURBO\r";
|
||||||
|
featureStrM65 += "TAPE : LOAD TURBO\r";
|
||||||
}
|
}
|
||||||
|
|
||||||
// IEC support features
|
// IEC support features
|
||||||
|
|
||||||
if (GLOBAL_ConfigOptions["CONFIG_IEC"])
|
if (GLOBAL_ConfigOptions["CONFIG_IEC"])
|
||||||
{
|
{
|
||||||
featureStr += "IEC";
|
featureStr += "IEC";
|
||||||
|
featureStrM65 += "IEC :";
|
||||||
|
|
||||||
bool extendedIEC = false;
|
bool extendedIEC = false;
|
||||||
|
|
||||||
if (GLOBAL_ConfigOptions["CONFIG_IEC_BURST_CIA1"])
|
if (GLOBAL_ConfigOptions["CONFIG_IEC_BURST_CIA1"])
|
||||||
{
|
{
|
||||||
featureStr += " BURST1";
|
featureStr += " BURST1";
|
||||||
extendedIEC = true;
|
extendedIEC = true;
|
||||||
}
|
}
|
||||||
if (GLOBAL_ConfigOptions["CONFIG_IEC_BURST_CIA2"])
|
if (GLOBAL_ConfigOptions["CONFIG_IEC_BURST_CIA2"])
|
||||||
{
|
{
|
||||||
featureStr += " BURST2";
|
featureStr += " BURST2";
|
||||||
extendedIEC = true;
|
extendedIEC = true;
|
||||||
}
|
}
|
||||||
if (GLOBAL_ConfigOptions["CONFIG_IEC_BURST_MEGA65"])
|
if (GLOBAL_ConfigOptions["CONFIG_IEC_BURST_MEGA65"])
|
||||||
{
|
{
|
||||||
featureStr += " BURST";
|
featureStr += " BURST";
|
||||||
extendedIEC = true;
|
featureStrM65 += " BURST";
|
||||||
|
extendedIEC = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GLOBAL_ConfigOptions["CONFIG_IEC_DOLPHINDOS"])
|
if (GLOBAL_ConfigOptions["CONFIG_IEC_DOLPHINDOS"])
|
||||||
{
|
{
|
||||||
featureStr += " DOLPHIN";
|
featureStr += " DOLPHIN";
|
||||||
extendedIEC = true;
|
featureStrM65 += " DOLPHIN";
|
||||||
|
extendedIEC = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GLOBAL_ConfigOptions["CONFIG_IEC_JIFFYDOS"])
|
if (GLOBAL_ConfigOptions["CONFIG_IEC_JIFFYDOS"])
|
||||||
{
|
{
|
||||||
featureStr += " JIFFY";
|
featureStr += " JIFFY";
|
||||||
extendedIEC = true;
|
featureStrM65 += " JIFFY";
|
||||||
|
extendedIEC = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!extendedIEC) featureStr += " NORMAL";
|
if (!extendedIEC)
|
||||||
|
{
|
||||||
featureStr += "\r";
|
featureStr += " NORMAL ONLY";
|
||||||
|
featureStrM65 += " NORMAL ONLY";
|
||||||
|
}
|
||||||
|
|
||||||
|
featureStr += "\r";
|
||||||
|
featureStrM65 += "\r";
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
featureStrM65 += "IEC : NO\r";
|
||||||
|
}
|
||||||
|
|
||||||
// RS-232 support features
|
// RS-232 support features
|
||||||
|
|
||||||
if (GLOBAL_ConfigOptions["CONFIG_RS232_UP2400"]) featureStr += "UP2400\r";
|
if (GLOBAL_ConfigOptions["CONFIG_RS232_UP2400"]) featureStr += "UP2400\r";
|
||||||
if (GLOBAL_ConfigOptions["CONFIG_RS232_UP9600"]) featureStr += "UP9600\r";
|
if (GLOBAL_ConfigOptions["CONFIG_RS232_UP9600"]) featureStr += "UP9600\r";
|
||||||
|
|
||||||
|
featureStrM65 += "RS-232 : NO\r";
|
||||||
|
|
||||||
|
// CBDOS features
|
||||||
|
|
||||||
|
featureStrM65 += "CBDOS : NO\r";
|
||||||
|
|
||||||
// Keyboard support features
|
// Keyboard support features
|
||||||
|
|
||||||
if (GLOBAL_ConfigOptions["CONFIG_KEYBOARD_C128"]) featureStr += "KBD 128\r";
|
if (GLOBAL_ConfigOptions["CONFIG_KEYBOARD_C128"]) featureStr += "KBD 128\r";
|
||||||
@@ -1183,18 +1226,28 @@ void DataSet::generateConfigDepStrings()
|
|||||||
|
|
||||||
// List found
|
// List found
|
||||||
|
|
||||||
if (GLOBAL_ConfigOptions["CONFIG_SHOW_FEATURES"])
|
if (GLOBAL_ConfigOptions["CONFIG_SHOW_FEATURES"] || GLOBAL_ConfigOptions["CONFIG_BRAND_MEGA_65"])
|
||||||
{
|
{
|
||||||
StringEntry newEntry1 = { true, true, true, true, "STR_PAL", "PAL\r" };
|
StringEntry newEntry1 = { true, true, true, true, "STR_PAL", "PAL\r" };
|
||||||
StringEntry newEntry2 = { true, true, true, true, "STR_NTSC", "NTSC\r" };
|
StringEntry newEntry2 = { true, true, true, true, "STR_NTSC", "NTSC\r" };
|
||||||
StringEntry newEntry3 = { true, true, true, true, "STR_FEATURES", featureStr };
|
|
||||||
|
|
||||||
stringEntryList.list.push_back(newEntry1);
|
stringEntryList.list.push_back(newEntry1);
|
||||||
stringEntryList.list.push_back(newEntry2);
|
stringEntryList.list.push_back(newEntry2);
|
||||||
stringEntryList.list.push_back(newEntry3);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (GLOBAL_ConfigOptions["CONFIG_SHOW_FEATURES"])
|
||||||
|
{
|
||||||
|
StringEntry newEntry = { true, true, true, true, "STR_FEATURES", featureStr };
|
||||||
|
stringEntryList.list.push_back(newEntry);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (GLOBAL_ConfigOptions["CONFIG_BRAND_MEGA_65"])
|
||||||
|
{
|
||||||
|
StringEntry newEntry = { false, true, false, false, "STR_SI_FEATURES", featureStrM65 };
|
||||||
|
stringEntryList.list.push_back(newEntry);
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user