DOS Wedge nowv asks for confirmation on dangerous commands, updated binaries
This commit is contained in:
1 parent
8e65db666d
commit
f3803fb0db
8 files changed
+62
-5
No files matched your search
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -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
|
* `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)
|
* 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
|
* 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
|
* `←V` (verify from tape) - if Kernal is extended to offer this feature
|
||||||
* modulo function or opeerator
|
* modulo function or opeerator
|
||||||
* `DPEEK`, `DPOKE`, `QPEEK`, `QPOKE` - 2/4 byte `PEEK` and `POKE` variants
|
* `DPEEK`, `DPOKE`, `QPEEK`, `QPOKE` - 2/4 byte `PEEK` and `POKE` variants
|
||||||
|
|||||||
@@ -51,6 +51,52 @@ wedge_dos:
|
|||||||
|
|
||||||
wedge_dos_command:
|
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
|
// Provide command name
|
||||||
|
|
||||||
jsr wedge_dos_setnam
|
jsr wedge_dos_setnam
|
||||||
@@ -62,14 +108,13 @@ wedge_dos_command:
|
|||||||
// Retrieve status, print it if not OK
|
// Retrieve status, print it if not OK
|
||||||
|
|
||||||
jsr JCLALL
|
jsr JCLALL
|
||||||
jsr wedge_dos_status_get
|
jsr wedge_dos_status_get_no_new_line
|
||||||
|
|
||||||
lda BUF+0
|
lda BUF+0
|
||||||
cmp #$30 // '0'
|
cmp #$30 // '0'
|
||||||
bne wedge_dos_status_print
|
bne wedge_dos_status_print
|
||||||
|
|
||||||
lda BUF+1
|
eor BUF+1
|
||||||
cmp #$30 // '0'
|
|
||||||
bne wedge_dos_status_print
|
bne wedge_dos_status_print
|
||||||
|
|
||||||
// Clean-up and exit
|
// Clean-up and exit
|
||||||
@@ -103,6 +148,10 @@ wedge_dos_status_get:
|
|||||||
|
|
||||||
jsr print_return
|
jsr print_return
|
||||||
|
|
||||||
|
// FALLTROUGH
|
||||||
|
|
||||||
|
wedge_dos_status_get_no_new_line:
|
||||||
|
|
||||||
// Here the flow is mostly the same as in the example from
|
// 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
|
// 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:
|
wedge_dos_status:
|
||||||
|
|
||||||
jsr wedge_dos_status_get
|
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
|
// FALLTROUGH
|
||||||
|
|
||||||
wedge_dos_status_print:
|
wedge_dos_status_print_no_new_line:
|
||||||
|
|
||||||
// Print buffered status
|
// Print buffered status
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user