pt3_lib: start splitting up detection code

This commit is contained in:
Vince Weaver 2019-12-28 16:45:43 -05:00
parent 0c429774e5
commit d0c87370c8
2 changed files with 57 additions and 56 deletions

View File

@ -324,59 +324,3 @@ done_apple_detect:
;==================================
; Print mockingboard detect message
;==================================
; note: on IIc must do this before enabling interrupt
; as we disable ROM (COUT won't work?)
print_mockingboard_detect:
; print detection message
ldy #0
print_mocking_message:
lda mocking_message,Y ; load loading message
beq done_mocking_message
ora #$80
jsr COUT
iny
jmp print_mocking_message
done_mocking_message:
jsr CROUT1
rts
print_mocking_notfound:
ldy #0
print_not_message:
lda not_message,Y ; load loading message
beq print_not_message_done
ora #$80
jsr COUT
iny
jmp print_not_message
print_not_message_done:
rts
print_mocking_found:
ldy #0
print_found_message:
lda found_message,Y ; load loading message
beq done_found_message
ora #$80
jsr COUT
iny
jmp print_found_message
done_found_message:
rts
;=========
; strings
;=========
mocking_message: .asciiz "LOOKING FOR MOCKINGBOARD IN SLOT #4"
not_message: .byte "NOT "
found_message: .asciiz "FOUND"

View File

@ -98,6 +98,63 @@ forever_loop:
;========================================
;========================================
;==================================
; Print mockingboard detect message
;==================================
; note: on IIc must do this before enabling interrupt
; as we disable ROM (COUT won't work?)
print_mockingboard_detect:
; print detection message
ldy #0
print_mocking_message:
lda mocking_message,Y ; load loading message
beq done_mocking_message
ora #$80
jsr COUT
iny
jmp print_mocking_message
done_mocking_message:
jsr CROUT1
rts
print_mocking_notfound:
ldy #0
print_not_message:
lda not_message,Y ; load loading message
beq print_not_message_done
ora #$80
jsr COUT
iny
jmp print_not_message
print_not_message_done:
rts
print_mocking_found:
ldy #0
print_found_message:
lda found_message,Y ; load loading message
beq done_found_message
ora #$80
jsr COUT
iny
jmp print_found_message
done_found_message:
rts
;=========
; strings
;=========
mocking_message: .asciiz "LOOKING FOR MOCKINGBOARD IN SLOT #4"
not_message: .byte "NOT "
found_message: .asciiz "FOUND"
;=========
; vars
;=========