From 5f6a8eb7bf69bdd659c0bd33d99df692a994f50e Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Wed, 3 Feb 2021 20:20:10 +0100 Subject: [PATCH] MEGA65 banner now displays internal device numbers --- src/,,config_mega65.s | 4 +-- src/basic/,imports.s | 2 ++ src/basic/basic_commands_04/cmd_sysinfo.s | 38 +++++++++++++++++++++-- src/basic/board_m65/mega65_imports.s | 1 + src/basic/board_m65/mega65_proxies.s | 6 ++++ src/basic/init/initmsg_m65.s | 4 +-- src/dos_m65/,aliases_dos.s | 11 +++---- src/dos_m65/dos_unitnum.s | 13 ++++---- src/kernal/board_m65/mega65_map_helpers.s | 19 +----------- src/kernal/iec_fast/m65dos_bridge.s | 4 +-- tools/generate_strings.cc | 5 ++- 11 files changed, 67 insertions(+), 40 deletions(-) diff --git a/src/,,config_mega65.s b/src/,,config_mega65.s index 8398be8c..59537149 100644 --- a/src/,,config_mega65.s +++ b/src/,,config_mega65.s @@ -33,8 +33,6 @@ ;; #CONFIG# IEC_JIFFYDOS_BLANK NO ;; #CONFIG# IEC_BURST_M65 NO ; please keep disabled for now -;; #CONFIG# UNIT_SDCARD 20 ; do not change for now - ; --- Tape deck configuration @@ -93,7 +91,7 @@ ; --- Built-in DOS configuration -;; #CONFIG# UNIT_SDCARD 0 ; do not change, DOS is not implemented yet +;; #CONFIG# UNIT_SDCARD 20 ; do not change, DOS is not implemented yet ;; #CONFIG# UNIT_FLOPPY 0 ; do not change, DOS is not implemented yet ;; #CONFIG# UNIT_RAMDISK 0 ; do not change, DOS is not implemented yet diff --git a/src/basic/,imports.s b/src/basic/,imports.s index 767bf70a..d3626678 100644 --- a/src/basic/,imports.s +++ b/src/basic/,imports.s @@ -50,6 +50,8 @@ ;; #ALIAS# m65_shadow_BZP = KERNAL_0.m65_shadow_BZP ;; #ALIAS# proxy_M1_IO_end = KERNAL_0.proxy_M1_IO_end +;; #ALIAS# m65dos_unitnum = KERNAL_0.m65dos_unitnum + ; ; Ultimate 64 specific parts ; diff --git a/src/basic/basic_commands_04/cmd_sysinfo.s b/src/basic/basic_commands_04/cmd_sysinfo.s index 27f5c5b3..dfed12c2 100644 --- a/src/basic/basic_commands_04/cmd_sysinfo.s +++ b/src/basic/basic_commands_04/cmd_sysinfo.s @@ -106,12 +106,46 @@ print_sysinfo_video: @5: jsr print_packed_misc_str - ; Print build featires information + ; Print build features information ldx #IDX__STR_SI_FEATURES - jmp print_packed_misc_str + jsr print_packed_misc_str + ; Print SD CARD unit ID + lda #$00 + jsr cmd_sysinfo_print_dev + + ldx #IDX__STR_DOS_FD + jsr print_packed_misc_str + + ; Print floppy unit ID + + lda #$01 + jsr cmd_sysinfo_print_dev + + ; Print ram disk unit ID + + ldx #IDX__STR_DOS_RD + jsr print_packed_misc_str + + lda #$02 + jsr cmd_sysinfo_print_dev + + jmp print_return + +cmd_sysinfo_print_dev: + + jsr m65dos_unitnum + bcs @nounit + tax + lda #$00 + jmp print_integer + +@nounit: + + lda #'-' + jmp JCHROUT cmd_sysinfo_hw_ids: diff --git a/src/basic/board_m65/mega65_imports.s b/src/basic/board_m65/mega65_imports.s index 999391b6..613df99e 100644 --- a/src/basic/board_m65/mega65_imports.s +++ b/src/basic/board_m65/mega65_imports.s @@ -46,3 +46,4 @@ ;; #ALIAS# fetch_character_skip_spaces = BASIC_0.proxy_B1_fetch_character_skip_spaces ;; #ALIAS# fetch_uint8 = BASIC_0.proxy_B1_fetch_uint8 ;; #ALIAS# shell_main_loop = BASIC_0.proxy_B1_shell_main_loop +;; #ALIAS# m65dos_unitnum = BASIC_0.proxy_B1_m65dos_unitnum diff --git a/src/basic/board_m65/mega65_proxies.s b/src/basic/board_m65/mega65_proxies.s index a218be22..953e9658 100644 --- a/src/basic/board_m65/mega65_proxies.s +++ b/src/basic/board_m65/mega65_proxies.s @@ -156,3 +156,9 @@ proxy_M1_print_kernal_error: jsr do_error_print_only jmp proxy_M1_IO_end } + +proxy_B1_m65dos_unitnum: + + jsr map_NORMAL + jsr m65dos_unitnum + bra proxy_B1_end_2 diff --git a/src/basic/init/initmsg_m65.s b/src/basic/init/initmsg_m65.s index 3608cc7a..72c1f2c0 100644 --- a/src/basic/init/initmsg_m65.s +++ b/src/basic/init/initmsg_m65.s @@ -31,11 +31,11 @@ INITMSG_native: ; Native mode - ldx #48 + ldx #44 ldy #0 jsr M65_SETWIN_XY - ldx #32 + ldx #36 ldy #9 jsr M65_SETWIN_WH diff --git a/src/dos_m65/,aliases_dos.s b/src/dos_m65/,aliases_dos.s index 685fd5b6..031df0f1 100644 --- a/src/dos_m65/,aliases_dos.s +++ b/src/dos_m65/,aliases_dos.s @@ -3,7 +3,6 @@ ; ; NOTES: -; - DOS zeropage is mirrored at $8000 ; - starting from $8000, 16KB RAM is available (starting from $10000 in C65 address space) ; - additional 16KB RAM is reserved for DOS too ($14000-$17FFF), and can be banked-in if needed @@ -13,14 +12,14 @@ ; Page 0 ; - !addr MAGICSTR = $00 ; magic string; if not matching, DOS considered non-functional + !addr MAGICSTR = $8000 ; magic string; if not matching, DOS considered non-functional ; General DOS configuration - !addr UNIT_SDCARD = $05 - !addr UNIT_FLOPPY = $06 - !addr UNIT_RAMDISK = $07 + !addr UNIT_SDCARD = $8005 + !addr UNIT_FLOPPY = $8006 + !addr UNIT_RAMDISK = $8007 ; General DOS status - !addr UNIT_HANDLER = $08 \ No newline at end of file + !addr UNIT_HANDLER = $8008 diff --git a/src/dos_m65/dos_unitnum.s b/src/dos_m65/dos_unitnum.s index 8336a779..c0bc9509 100644 --- a/src/dos_m65/dos_unitnum.s +++ b/src/dos_m65/dos_unitnum.s @@ -20,30 +20,31 @@ dos_UNITNUM: cmp #$02 beq dos_UNITNUM_ramdisk - lda #$00 - ; FALLTROUGH dos_UNITNUM_none: + lda #$00 + sec rts dos_UNITNUM_sdcard: lda UNIT_SDCARD - - +skip_2_bytes_trash_nvz + bra dos_UNITNUM_common dos_UNITNUM_floppy: lda UNIT_FLOPPY - - +skip_2_bytes_trash_nvz + bra dos_UNITNUM_common dos_UNITNUM_ramdisk: lda UNIT_RAMDISK + bra dos_UNITNUM_common + +dos_UNITNUM_common: cmp #$00 beq dos_UNITNUM_none diff --git a/src/kernal/board_m65/mega65_map_helpers.s b/src/kernal/board_m65/mega65_map_helpers.s index 0c9005bf..8cfb5b59 100644 --- a/src/kernal/board_m65/mega65_map_helpers.s +++ b/src/kernal/board_m65/mega65_map_helpers.s @@ -76,12 +76,8 @@ map_DOS_1: phy phz - lda #$80 - tab ; from now on, zeropage starts from $C000 - ldy #$80 - lda #$30 - taz ; $8000 <- map 16KB RAM from $10000 + ldz #$30 ; $8000 <- map 16KB RAM from $10000 lda #$C0 ldx #$C1 ; $4000 <- map 16KB ROM from $20000 @@ -89,19 +85,6 @@ map_DOS_1: map bra map_end_no_eom ; no EOM, we do not want interrupts within DOS! -map_NORMAL_from_DOS_1: - - php - pha - phx - phy - phz - - lda #$00 - tab - - bra map_NORMAL_common - map_MON_1: php diff --git a/src/kernal/iec_fast/m65dos_bridge.s b/src/kernal/iec_fast/m65dos_bridge.s index 8acfbfc8..7e7643c1 100644 --- a/src/kernal/iec_fast/m65dos_bridge.s +++ b/src/kernal/iec_fast/m65dos_bridge.s @@ -67,7 +67,7 @@ m65dos_acptr: m65dos_end_1: - jmp map_NORMAL_from_DOS_1 ; ACPTR is slightly faster + jmp map_NORMAL ; ACPTR is slightly faster m65dos_ciout: @@ -78,7 +78,7 @@ m65dos_ciout: m65dos_end_2: - jmp map_NORMAL_from_DOS_1 ; CIOUT is slightly faster + jmp map_NORMAL ; CIOUT is slightly faster m65dos_listen: diff --git a/tools/generate_strings.cc b/tools/generate_strings.cc index dc9cc2e1..62c22dbd 100644 --- a/tools/generate_strings.cc +++ b/tools/generate_strings.cc @@ -306,6 +306,9 @@ const StringEntryList GLOBAL_MiscStrings = { ListType::STRINGS_BASIC, "misc", { false, true, true, false, false, "STR_MEM_STRS", "\r STRS" }, { false, true, true, false, false, "STR_MEM_FREE", "\r\r FREE" }, + { false, false, true, false, false, "STR_DOS_FD", ", FDD " }, + { false, false, true, false, false, "STR_DOS_RD", ", RAM " }, + { false, false, true, false, false, "STR_SI_HEADER", "OPEN ROMS, " }, { false, false, true, false, false, "STR_SI_MODE64", "LEGACY MODE" }, { false, false, true, false, false, "STR_SI_MODE65", "NATIVE MODE" }, @@ -1221,7 +1224,7 @@ void DataSet::generateConfigDepStrings() // CBDOS features - featureStrM65 += "CBDOS : NO FDD/SD/RAM SUPPORT\r"; + featureStrM65 += "CBDOS : CARD "; // Keyboard support features