DOS wedge can now change device number

This commit is contained in:
FeralChild64 committed 2019-06-13 23:32:46 +02:00
1 parent 5accf927b3
commit c0d4df362f
2 files changed
+30 -9

No files matched your search

+2 -1
View File
@@ -98,7 +98,8 @@ not_a_token:
;; Are we in direct mode?
;; DOS Wedge is a hacky solution (inelegant, but convenient),
;; BASIC programmers should implement communication with drives
;; the standard way, handling channels properly
;; the standard way, handling channels properly. Besides,
;; current implementation does not support characters under ROM
ldx basic_current_line_number+1
cpx #$ff
bne +
+28 -8
View File
@@ -9,9 +9,9 @@ wedge_dos:
;; Take last device number, make sure it's a drive
;; If not, set to 8 (first drive number)
lda current_device_number
cmp #$07
cmp #$07 ;; XXX allow high device numbers, like 170
bpl +
lda #$08
lda #$08
*
;; Set remaining file parameters
ldx #$0F
@@ -26,12 +26,24 @@ wedge_dos:
beq wedge_dos_status
cmp #$20
beq wedge_dos_status
;; XXX consider SYNTAX ERROR if anything besides spaces is there
;; Check if asked for a directory
cmp #$24
beq wedge_dos_directory
*
;; XXX Check if asked to change drive number
;; Check if asked to change drive number, or if it is a regular command
cmp #$30
bmi wedge_dos_command ; char code before 0
cmp #$3A
bpl wedge_dos_command ; char code after 9
iny
lda (basic_current_statement_ptr), y
beq wedge_dos_change_drive ; end of buffer
cmp #$20
beq wedge_dos_change_drive
;; XXX consider SYNTAX ERROR if anything besides spaces is there
jmp -
wedge_dos_command: ; default
@@ -42,10 +54,19 @@ wedge_dos_command: ; default
wedge_dos_change_drive:
;; XXX - implement this
jsr printf
.byte "DBG: CHANGE DRIVE", 0
jmp do_NOT_IMPLEMENTED_error
;; Reuse the line number parser for device number retrieval
jsr basic_parse_line_number
lda basic_line_number+1
beq +
jmp do_ILLEGAL_QUANTITY_error
*
lda basic_line_number+0
cmp #$08 ;; XXX allow high device numbers, like 170
bpl +
jmp do_ILLEGAL_DEVICE_NUMBER_error
*
sta current_device_number
jmp basic_end_of_line
wedge_dos_status:
@@ -62,4 +83,3 @@ wedge_dos_directory:
jmp do_NOT_IMPLEMENTED_error
;; END wedge support