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
+29 -8

No files matched your search

+2 -1
View File
@@ -98,7 +98,8 @@ not_a_token:
;; Are we in direct mode? ;; Are we in direct mode?
;; DOS Wedge is a hacky solution (inelegant, but convenient), ;; DOS Wedge is a hacky solution (inelegant, but convenient),
;; BASIC programmers should implement communication with drives ;; 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 ldx basic_current_line_number+1
cpx #$ff cpx #$ff
bne + bne +
+27 -7
View File
@@ -9,7 +9,7 @@ wedge_dos:
;; Take last device number, make sure it's a drive ;; Take last device number, make sure it's a drive
;; If not, set to 8 (first drive number) ;; If not, set to 8 (first drive number)
lda current_device_number lda current_device_number
cmp #$07 cmp #$07 ;; XXX allow high device numbers, like 170
bpl + bpl +
lda #$08 lda #$08
* *
@@ -26,12 +26,24 @@ wedge_dos:
beq wedge_dos_status beq wedge_dos_status
cmp #$20 cmp #$20
beq wedge_dos_status beq wedge_dos_status
;; XXX consider SYNTAX ERROR if anything besides spaces is there
;; Check if asked for a directory ;; Check if asked for a directory
cmp #$24 cmp #$24
beq wedge_dos_directory 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 wedge_dos_command: ; default
@@ -42,10 +54,19 @@ wedge_dos_command: ; default
wedge_dos_change_drive: wedge_dos_change_drive:
;; XXX - implement this ;; Reuse the line number parser for device number retrieval
jsr printf jsr basic_parse_line_number
.byte "DBG: CHANGE DRIVE", 0 lda basic_line_number+1
jmp do_NOT_IMPLEMENTED_error 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: wedge_dos_status:
@@ -62,4 +83,3 @@ wedge_dos_directory:
jmp do_NOT_IMPLEMENTED_error jmp do_NOT_IMPLEMENTED_error
;; END wedge support ;; END wedge support