first work towards DOS wedge
This commit is contained in:
1 parent
e49efcce67
commit
5accf927b3
2 files changed
+85
-4
No files matched your search
@@ -80,9 +80,9 @@ basic_execute_statement:
|
||||
;; Now consume the character
|
||||
jsr basic_consume_character
|
||||
|
||||
rts
|
||||
rts
|
||||
|
||||
not_a_token:
|
||||
not_a_token:
|
||||
;; Space, which we can also just ignore
|
||||
cmp #$20
|
||||
beq basic_skip_char
|
||||
@@ -93,11 +93,27 @@ not_a_token:
|
||||
cmp #$3a
|
||||
beq basic_skip_char
|
||||
|
||||
;; START wedge support
|
||||
|
||||
;; 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
|
||||
ldx basic_current_line_number+1
|
||||
cpx #$ff
|
||||
bne +
|
||||
;; We are in direct mode, allow wedge to handle '@' sign
|
||||
;; XXX Maybe it should be allowed only as the first command?
|
||||
cmp #$40
|
||||
bne +
|
||||
jsr basic_consume_character
|
||||
jmp wedge_dos
|
||||
*
|
||||
;; END wedge support
|
||||
|
||||
;; If all else fails, it's a syntax error
|
||||
jmp do_SYNTAX_error
|
||||
|
||||
jmp basic_main_loop
|
||||
|
||||
basic_skip_char:
|
||||
jsr basic_consume_character
|
||||
jmp basic_execute_statement
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
|
||||
;; START wedge support
|
||||
|
||||
wedge_dos:
|
||||
|
||||
;; Close all the channels, so that wedge has full control
|
||||
jsr $FFE7 ; CLALL
|
||||
|
||||
;; Take last device number, make sure it's a drive
|
||||
;; If not, set to 8 (first drive number)
|
||||
lda current_device_number
|
||||
cmp #$07
|
||||
bpl +
|
||||
lda #$08
|
||||
*
|
||||
;; Set remaining file parameters
|
||||
ldx #$0F
|
||||
ldy #$0F
|
||||
jsr $FFBA ; SETLFS
|
||||
|
||||
;; Now we have to check what the user wants us to do
|
||||
|
||||
;; Check if user asked for a status
|
||||
ldy #$00
|
||||
lda (basic_current_statement_ptr), y
|
||||
beq wedge_dos_status
|
||||
cmp #$20
|
||||
beq wedge_dos_status
|
||||
|
||||
;; Check if asked for a directory
|
||||
cmp #$24
|
||||
beq wedge_dos_directory
|
||||
*
|
||||
;; XXX Check if asked to change drive number
|
||||
|
||||
wedge_dos_command: ; default
|
||||
|
||||
;; XXX - implement this
|
||||
jsr printf
|
||||
.byte "DBG: CMD", 0
|
||||
jmp do_NOT_IMPLEMENTED_error
|
||||
|
||||
wedge_dos_change_drive:
|
||||
|
||||
;; XXX - implement this
|
||||
jsr printf
|
||||
.byte "DBG: CHANGE DRIVE", 0
|
||||
jmp do_NOT_IMPLEMENTED_error
|
||||
|
||||
wedge_dos_status:
|
||||
|
||||
;; XXX - implement this
|
||||
jsr printf
|
||||
.byte "DBG: STATUS", 0
|
||||
jmp do_NOT_IMPLEMENTED_error
|
||||
|
||||
wedge_dos_directory:
|
||||
|
||||
;; XXX - implement this
|
||||
jsr printf
|
||||
.byte "DBG: DIR", 0
|
||||
jmp do_NOT_IMPLEMENTED_error
|
||||
|
||||
;; END wedge support
|
||||
|
||||
Reference in new issue
Block a user