diff --git a/bin/basic_generic.rom b/bin/basic_generic.rom index dc9dba7b..8e9caf1c 100644 Binary files a/bin/basic_generic.rom and b/bin/basic_generic.rom differ diff --git a/bin/basic_ultimate64.rom b/bin/basic_ultimate64.rom index 804c3705..a8010f7e 100644 Binary files a/bin/basic_ultimate64.rom and b/bin/basic_ultimate64.rom differ diff --git a/bin/kernal_generic.rom b/bin/kernal_generic.rom index 75684fcc..57116e02 100644 Binary files a/bin/kernal_generic.rom and b/bin/kernal_generic.rom differ diff --git a/bin/kernal_ultimate64.rom b/bin/kernal_ultimate64.rom index 379d1847..80a270c8 100644 Binary files a/bin/kernal_ultimate64.rom and b/bin/kernal_ultimate64.rom differ diff --git a/bin/mega65.rom b/bin/mega65.rom index c299e1c5..563284aa 100644 Binary files a/bin/mega65.rom and b/bin/mega65.rom differ diff --git a/bin/mega65_pxlfont.rom b/bin/mega65_pxlfont.rom index e496e285..896f68ff 100644 Binary files a/bin/mega65_pxlfont.rom and b/bin/mega65_pxlfont.rom differ diff --git a/doc/Extended-BASIC.md b/doc/Extended-BASIC.md index 29f27e61..4dd452ca 100644 --- a/doc/Extended-BASIC.md +++ b/doc/Extended-BASIC.md @@ -112,7 +112,6 @@ Ideas for the future, most of them suitable for Mega65 or other power machines o * `LABEL`, `LGOTO` and `LGOSUB` - jump to label * some kind of subroutines with local variable namespace, possibly loaded from disc (like in Warsaw Basic 3.2) * for Mega65 mode, move variables to a separate memory area, consider extending variable name length -* DOS Wedge should ask (`ARE YOU SURE?`) before removing a file or formating the disc * `←V` (verify from tape) - if Kernal is extended to offer this feature * modulo function or opeerator * `DPEEK`, `DPOKE`, `QPEEK`, `QPOKE` - 2/4 byte `PEEK` and `POKE` variants diff --git a/src/basic/wedge/wedge_dos.s b/src/basic/wedge/wedge_dos.s index f214d91d..214d6d49 100644 --- a/src/basic/wedge/wedge_dos.s +++ b/src/basic/wedge/wedge_dos.s @@ -51,6 +51,52 @@ wedge_dos: wedge_dos_command: + // Check if command needs confirmation + + ldy #$00 + lda (TXTPTR), y + + cmp #$52 // 'R' - because 'RD' is a directory removal command + bne !+ + + iny + lda (TXTPTR), y + cmp #$44 // 'D' + bne wedge_dos_command_confirmed + beq wedge_dos_command_ask +!: + cmp #$4E // 'N' - for the disk format + beq !+ + cmp #$53 // 'S' - for the file scratch + bne wedge_dos_command_confirmed +!: + // This is probably a dangerous command - check further the syntax, + // if 'N:', 'S:', 'Nx:' or 'Sx:' (where 'x' is a digit) - ask for confirmation first + + iny + lda (TXTPTR), y + cmp #$3A // ':' - colon + beq wedge_dos_command_ask + + jsr is_09 + bcs wedge_dos_command_confirmed + + iny + lda (TXTPTR), y + cmp #$3A // ':' - colon + bne wedge_dos_command_confirmed + + // FALLTROUGH + +wedge_dos_command_ask: + + jsr helper_ask_if_sure + bcs_16 wedge_dos_clean_exit + + // FALLTROUGH + +wedge_dos_command_confirmed: + // Provide command name jsr wedge_dos_setnam @@ -62,14 +108,13 @@ wedge_dos_command: // Retrieve status, print it if not OK jsr JCLALL - jsr wedge_dos_status_get + jsr wedge_dos_status_get_no_new_line lda BUF+0 cmp #$30 // '0' bne wedge_dos_status_print - lda BUF+1 - cmp #$30 // '0' + eor BUF+1 bne wedge_dos_status_print // Clean-up and exit @@ -103,6 +148,10 @@ wedge_dos_status_get: jsr print_return + // FALLTROUGH + +wedge_dos_status_get_no_new_line: + // Here the flow is mostly the same as in the example from // https://codebase64.org/doku.php?id=base:reading_the_error_channel_of_a_disk_drive @@ -158,10 +207,19 @@ wedge_dos_status_get_done: wedge_dos_status: jsr wedge_dos_status_get +#if HAS_OPCODES_65C02 + bra wedge_dos_status_print_no_new_line +#else + jmp wedge_dos_status_print_no_new_line +#endif + +wedge_dos_status_print: + + jsr print_return // FALLTROUGH -wedge_dos_status_print: +wedge_dos_status_print_no_new_line: // Print buffered status @@ -205,7 +263,7 @@ wedge_dos_directory: bcs wedge_dos_basic_error // Ignore start address (2 first bytes) - XXX check for errors - + jsr JCHRIN bcs wedge_dos_basic_error jsr JCHRIN