more work on DOS Wedge integration into monitor
This commit is contained in:
1 parent
409b01aec4
commit
966f2fbefb
3 files changed
+108
-8
No files matched your search
@@ -16,8 +16,8 @@
|
|||||||
!addr ADRAY2 = $05 ; $05-$06
|
!addr ADRAY2 = $05 ; $05-$06
|
||||||
!addr CHARAC = $07 ; [!] our implementation might be different XXX give more details
|
!addr CHARAC = $07 ; [!] our implementation might be different XXX give more details
|
||||||
!addr ENDCHR = $08 ; [!] our implementation might be different XXX give more details
|
!addr ENDCHR = $08 ; [!] our implementation might be different XXX give more details
|
||||||
!addr TRMPOS = $09 ; -- NOT IMPLEMENTED --
|
!addr TRMPOS = $09 ; -- NOT IMPLEMENTED -- [!] on MEGA65 also used by DOS Wedge under MONITOR
|
||||||
!addr VERCKB = $0A ; flag used by BASIC, 0 - LOAD, 1 - VERIFY
|
!addr VERCKB = $0A ; flag used by BASIC, 0 - LOAD, 1 - VERIFY, [!] on MEGA65 also used by DOS Wedge
|
||||||
!addr COUNT = $0B ; [!] our implementation might be different XXX give more details
|
!addr COUNT = $0B ; [!] our implementation might be different XXX give more details
|
||||||
!addr DIMFLG = $0C ; [!] our implementation might be different XXX give more details
|
!addr DIMFLG = $0C ; [!] our implementation might be different XXX give more details
|
||||||
!addr VALTYP = $0D ; expression eveluation result; $00 - float, $FF - string
|
!addr VALTYP = $0D ; expression eveluation result; $00 - float, $FF - string
|
||||||
|
|||||||
@@ -22,6 +22,12 @@
|
|||||||
!addr __tokenise_work4 = $0F ; GARBFL
|
!addr __tokenise_work4 = $0F ; GARBFL
|
||||||
!addr __tokenise_work5 = $0C ; DIMFLG
|
!addr __tokenise_work5 = $0C ; DIMFLG
|
||||||
|
|
||||||
|
;
|
||||||
|
; Helper aliases for DOS Wedge under MONITOR
|
||||||
|
;
|
||||||
|
|
||||||
|
!addr __wedge_mon = $0A ; VERCKB
|
||||||
|
!addr __wedge_spstore = $09 ; TRMPOS
|
||||||
|
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|||||||
+100
-6
@@ -22,7 +22,11 @@ wedge_dos_monitor: ; entry point for the MONITOR
|
|||||||
|
|
||||||
wedge_dos_monitor:
|
wedge_dos_monitor:
|
||||||
|
|
||||||
rts
|
tsx
|
||||||
|
stx __wedge_spstore ; preserve stack pointer
|
||||||
|
|
||||||
|
lda #$FF ; mark MONITOR-called wedge
|
||||||
|
bra wedge_dos_monitor_cont
|
||||||
}
|
}
|
||||||
|
|
||||||
; .X has to contain size of the buffer
|
; .X has to contain size of the buffer
|
||||||
@@ -44,10 +48,16 @@ wedge_dos:
|
|||||||
} else {
|
} else {
|
||||||
|
|
||||||
; Prepare buffer - finish it with '0'
|
; Prepare buffer - finish it with '0'
|
||||||
|
|
||||||
lda #$00
|
lda #$00
|
||||||
sta BUF,x
|
sta BUF,x
|
||||||
|
|
||||||
|
!ifdef CONFIG_MB_M65 {
|
||||||
|
|
||||||
|
wedge_dos_monitor_cont:
|
||||||
|
|
||||||
|
sta __wedge_mon ; mark BASIC/MONITOR-called wedge
|
||||||
|
}
|
||||||
|
|
||||||
; Close all the channels, so that wedge has full control
|
; Close all the channels, so that wedge has full control
|
||||||
jsr JCLALL
|
jsr JCLALL
|
||||||
|
|
||||||
@@ -164,7 +174,11 @@ wedge_dos_change_drive:
|
|||||||
|
|
||||||
jsr fetch_uint8
|
jsr fetch_uint8
|
||||||
cmp #$08
|
cmp #$08
|
||||||
|
!ifdef CONFIG_MB_M65 {
|
||||||
|
+bcc wedge_dos_wrapper_ILLEGAL_DEVICE_NUMBER_error
|
||||||
|
} else {
|
||||||
+bcc do_ILLEGAL_DEVICE_NUMBER_error
|
+bcc do_ILLEGAL_DEVICE_NUMBER_error
|
||||||
|
}
|
||||||
|
|
||||||
; Check if this is end of command, or directory request
|
; Check if this is end of command, or directory request
|
||||||
|
|
||||||
@@ -176,8 +190,11 @@ wedge_dos_change_drive:
|
|||||||
; Make sure this is end of command
|
; Make sure this is end of command
|
||||||
|
|
||||||
cmp #$00
|
cmp #$00
|
||||||
|
!ifdef CONFIG_MB_M65 {
|
||||||
|
+bne wedge_dos_wrapper_SYNTAX_error
|
||||||
|
} else {
|
||||||
+bne do_SYNTAX_error
|
+bne do_SYNTAX_error
|
||||||
|
}
|
||||||
; Store new device number and return to shell
|
; Store new device number and return to shell
|
||||||
|
|
||||||
pla
|
pla
|
||||||
@@ -221,8 +238,11 @@ wedge_dos_status_get_loop:
|
|||||||
; Check for buffer overflow
|
; Check for buffer overflow
|
||||||
|
|
||||||
cpy #$50
|
cpy #$50
|
||||||
|
!ifdef CONFIG_MB_M65 {
|
||||||
|
+beq wedge_dos_wrapper_OVERFLOW_error
|
||||||
|
} else {
|
||||||
+beq do_OVERFLOW_error
|
+beq do_OVERFLOW_error
|
||||||
|
}
|
||||||
; Check for EOF
|
; Check for EOF
|
||||||
|
|
||||||
jsr JREADST
|
jsr JREADST
|
||||||
@@ -326,8 +346,12 @@ wedge_dos_directory_line:
|
|||||||
jsr JCHRIN
|
jsr JCHRIN
|
||||||
bcs wedge_dos_basic_error
|
bcs wedge_dos_basic_error
|
||||||
sta BUF, y
|
sta BUF, y
|
||||||
cpy #$50
|
cpy #$50 ; make sure line is not too long
|
||||||
+beq do_OVERFLOW_error ; branch if line too long
|
!ifdef CONFIG_MB_M65 {
|
||||||
|
+beq wedge_dos_wrapper_OVERFLOW_error
|
||||||
|
} else {
|
||||||
|
+beq do_OVERFLOW_error
|
||||||
|
}
|
||||||
jsr JREADST
|
jsr JREADST
|
||||||
bne @6 ; end of file
|
bne @6 ; end of file
|
||||||
cpy #$04 ; 2 bytes (pointer to next line) + 2 bytes (line number)
|
cpy #$04 ; 2 bytes (pointer to next line) + 2 bytes (line number)
|
||||||
@@ -371,14 +395,22 @@ wedge_dos_directory_display:
|
|||||||
wedge_dos_clean_exit:
|
wedge_dos_clean_exit:
|
||||||
|
|
||||||
jsr JCLALL
|
jsr JCLALL
|
||||||
|
!ifdef CONFIG_MB_M65 {
|
||||||
|
jmp wedge_dos_wrapper_exit
|
||||||
|
} else {
|
||||||
jmp shell_main_loop
|
jmp shell_main_loop
|
||||||
|
}
|
||||||
|
|
||||||
wedge_dos_basic_error:
|
wedge_dos_basic_error:
|
||||||
|
|
||||||
pha
|
pha
|
||||||
jsr JCLALL
|
jsr JCLALL
|
||||||
pla
|
pla
|
||||||
|
!ifdef CONFIG_MB_M65 {
|
||||||
|
bra wedge_dos_wrapper_kernal_error
|
||||||
|
} else {
|
||||||
jmp do_kernal_error
|
jmp do_kernal_error
|
||||||
|
}
|
||||||
|
|
||||||
wedge_dos_setnam:
|
wedge_dos_setnam:
|
||||||
|
|
||||||
@@ -398,6 +430,68 @@ wedge_dos_setnam:
|
|||||||
|
|
||||||
jmp JSETNAM
|
jmp JSETNAM
|
||||||
|
|
||||||
|
!ifdef CONFIG_MB_M65 {
|
||||||
|
|
||||||
|
wedge_dos_wrapper_exit:
|
||||||
|
|
||||||
|
bbr7 __wedge_mon, wedge_dos_clean_exit_basic
|
||||||
|
|
||||||
|
; FALLTROUGH
|
||||||
|
|
||||||
|
wedge_dos_wrapper_exit_nocheck:
|
||||||
|
|
||||||
|
ldx __wedge_spstore
|
||||||
|
txs
|
||||||
|
rts
|
||||||
|
|
||||||
|
wedge_dos_wrapper_SYNTAX_error:
|
||||||
|
|
||||||
|
bbr7 __wedge_mon, wedge_dos_SYNTAX_error
|
||||||
|
|
||||||
|
; XXX
|
||||||
|
|
||||||
|
wedge_dos_wrapper_ILLEGAL_DEVICE_NUMBER_error:
|
||||||
|
|
||||||
|
bbr7 __wedge_mon, wedge_dos_ILLEGAL_DEVICE_NUMBER_error
|
||||||
|
|
||||||
|
; XXX
|
||||||
|
|
||||||
|
wedge_dos_wrapper_OVERFLOW_error:
|
||||||
|
|
||||||
|
bbr7 __wedge_mon, wedge_dos_OVERFLOW_error
|
||||||
|
|
||||||
|
; XXX
|
||||||
|
|
||||||
|
wedge_dos_wrapper_kernal_error:
|
||||||
|
|
||||||
|
bbr7 __wedge_mon, wedge_dos_kernal_error
|
||||||
|
|
||||||
|
; XXX
|
||||||
|
|
||||||
|
bra wedge_dos_wrapper_exit_nocheck
|
||||||
|
|
||||||
|
wedge_dos_SYNTAX_error:
|
||||||
|
|
||||||
|
jmp do_SYNTAX_error
|
||||||
|
|
||||||
|
wedge_dos_ILLEGAL_DEVICE_NUMBER_error:
|
||||||
|
|
||||||
|
jmp do_ILLEGAL_DEVICE_NUMBER_error
|
||||||
|
|
||||||
|
wedge_dos_OVERFLOW_error:
|
||||||
|
|
||||||
|
jmp do_OVERFLOW_error
|
||||||
|
|
||||||
|
wedge_dos_kernal_error:
|
||||||
|
|
||||||
|
jmp do_kernal_error
|
||||||
|
|
||||||
|
wedge_dos_clean_exit_basic:
|
||||||
|
|
||||||
|
jmp shell_main_loop
|
||||||
|
|
||||||
|
|
||||||
|
} ; MEGA65 specific code
|
||||||
|
|
||||||
} ; ROM layout
|
} ; ROM layout
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user