fixed Ultimate 64 detection

This commit is contained in:
FeralChild64 committed 2019-07-19 21:58:54 +02:00
1 parent 4a040ac935
commit 4762bb02a5
1 file changed
+20 -18
+20 -18
View File
@@ -6,27 +6,18 @@
u64_load: u64_load:
jsr printf
.byte "DGB: 0",$0D,0
;; First check whether the command interface is enabled ;; First check whether the command interface is enabled
;; XXX identification does not work, why? lda U64_IDENTIFICATION
;; lda U64_IDENTIFICATION cmp #U64_MAGIC_ID
;; cmp U64_MAGIC_ID beq +
;; beq +
u64_load_skip: u64_load_skip:
;; rts rts
* *
jsr printf
.byte "DGB: 1",$0D,0
;; XXX find out which device number softIEC is mapped to ;; XXX find out which device number softIEC is mapped to
lda current_device_number lda current_device_number
cmp #$20 ; for now use device number 32 cmp #$20 ; for now use device number 32
beq u64_load_skip bne u64_load_skip
.byte "DGB: 2",$0D,0
;; Takeover the flow completely ;; Takeover the flow completely
pla pla
@@ -35,12 +26,14 @@ u64_load_skip:
;; Display SEARCHING FOR + filename ;; Display SEARCHING FOR + filename
jsr lvs_display_searching_for jsr lvs_display_searching_for
.byte "DGB: 3",$0D,0 jsr printf
.byte $0D,"DBG: 1",$0D,0
;; Whatever the interface was doing - ask to abort it ;; Whatever the interface was doing - ask to abort it
jsr u64_load_abort jsr u64_load_abort
.byte "DGB: 4",$0D,0 jsr printf
.byte "DBG: 2",$0D,0
;; Send a command to open the file ;; Send a command to open the file
lda #U64_DOS_CMD_OPEN_FILE lda #U64_DOS_CMD_OPEN_FILE
@@ -50,7 +43,8 @@ u64_load_skip:
jsr u64_load_send_filename jsr u64_load_send_filename
jsr u64_load_finalize_cmd jsr u64_load_finalize_cmd
.byte "DGB: 5",$0D,0 jsr printf
.byte "DBG: 3",$0D,0
;; Check status ;; Check status
jsr u64_load_check_status jsr u64_load_check_status
@@ -60,7 +54,8 @@ u64_load_skip:
;; XXX ;; XXX
.byte "DGB: 6",$0D,0 jsr printf
.byte "DBG: 4",$0D,0
jmp lvs_wrap_around_error jmp lvs_wrap_around_error
rts rts
@@ -116,6 +111,9 @@ u64_load_check_status:
cmp #$30 ; '0' cmp #$30 ; '0'
bne u64_load_check_status_wrong bne u64_load_check_status_wrong
jsr printf
.byte "DBG: X1 OK",$0D,0
;; Check the second status character ;; Check the second status character
lda U64_STATUS lda U64_STATUS
and #U64_STAT_BIT_STAT_AV and #U64_STAT_BIT_STAT_AV
@@ -123,6 +121,10 @@ u64_load_check_status:
lda U64_STATUS_DATA lda U64_STATUS_DATA
cmp #$30 ; '0' cmp #$30 ; '0'
beq u64_load_check_status_ok beq u64_load_check_status_ok
jsr printf
.byte "DBG: X2 NOK",$0D,0
;; FALLTROUGH ;; FALLTROUGH
u64_load_check_status_wrong: u64_load_check_status_wrong:
sec sec