common screen visibilityy handling for Turbo Tape and JiffyDOS

This commit is contained in:
FeralChild64 committed 2019-12-06 18:42:06 +01:00
1 parent aad50ee979
commit 430682d9c7
5 files changed
+61 -49

No files matched your search

+5 -11
View File
@@ -23,21 +23,15 @@ load_jiffydos:
#if CONFIG_IEC_BLANK_SCREEN
// Blank screen to make sure no sprite/badline will interrupt
// Preserve register with screen status (blank/visibe)
lda VIC_SCROLY
sta TBTCNT
and #($FF - $10)
sta VIC_SCROLY
// Only the next screen is badline-free
!:
lda VIC_SCROLY // wait for lower part of screen
bpl !-
!:
lda VIC_SCROLY // wait for screen start
bmi !-
// Blank screen to make sure no sprite/badline will interrupt
jsr screen_off
// Preserve 3 lowest bits of CIA2_PRA XXX deduplicate this
lda CIA2_PRA
and #%00000111
sta C3PO
@@ -58,7 +52,7 @@ load_jiffydos:
load_jiffydos_loop:
// Wait until device is ready to send (releases CLK)
jsr iec_wait_for_clk_release // XXX consider inlining this
jsr iec_wait_for_clk_release
#if CONFIG_IEC_BLANK_SCREEN
-28
View File
@@ -1,28 +0,0 @@
//
// Helper routines to blank/show screen
//
#if CONFIG_TAPE_NORMAL || CONFIG_TAPE_TURBO
screen_blank:
lda VIC_SCROLY
and #($FF - $10)
sta VIC_SCROLY
rts
screen_show:
lda VIC_SCROLY
ora #$10
sta VIC_SCROLY
rts
#endif
+28
View File
@@ -0,0 +1,28 @@
//
// Helper routine to blank screen
//
#if CONFIG_TAPE_NORMAL || CONFIG_TAPE_TURBO || (CONFIG_IEC_JIFFYDOS && !CONFIG_MEMORY_MODEL_60K)
screen_off:
lda VIC_SCROLY
and #($FF - $10)
sta VIC_SCROLY
// To be sure there are no badlines we have to wait till the next screen,
// as the bit is checked by VIC-II at the start of the frame only
!:
lda VIC_SCROLY // wait for lower part of screen
bpl !-
!:
lda VIC_SCROLY // wait for screen start
bmi !-
rts
#endif
+18
View File
@@ -0,0 +1,18 @@
//
// Helper routine to show screen
//
#if CONFIG_TAPE_NORMAL || CONFIG_TAPE_TURBO
screen_on:
lda VIC_SCROLY
ora #$10
sta VIC_SCROLY
rts
#endif
+10 -10
View File
@@ -58,20 +58,20 @@ tape_motor_on:
// store/restore screen color
//
tape_screen_show_motor_off:
tape_screen_on_motor_off:
jsr tape_motor_off
lda COLSTORE
sta VIC_EXTCOL
jmp screen_show
jmp screen_on
tape_screen_hide_motor_on:
tape_screen_off_motor_on:
lda VIC_EXTCOL
sta COLSTORE
jsr screen_blank
jsr screen_off
jmp tape_motor_on
@@ -124,7 +124,7 @@ tape_wait_play_done:
sta CAS1 // set the interlock
jsr print_return
jmp tape_screen_hide_motor_on
jmp tape_screen_off_motor_on
//
@@ -133,7 +133,7 @@ tape_wait_play_done:
tape_handle_header:
jsr tape_screen_show_motor_off
jsr tape_screen_on_motor_off
// Print FOUND + file name
@@ -220,7 +220,7 @@ tape_handle_header_displayed:
// Load the file
jsr tape_screen_hide_motor_on
jsr tape_screen_off_motor_on
// FALLTROUGH
@@ -234,7 +234,7 @@ tape_handle_header_skip:
// Skip this file
jsr print_return
jsr tape_screen_hide_motor_on
jsr tape_screen_off_motor_on
// FALLTROUGH
@@ -317,7 +317,7 @@ tape_header_wait_stop:
tape_load_success:
jsr tape_screen_show_motor_off
jsr tape_screen_on_motor_off
jsr lvs_display_done
cli
@@ -325,7 +325,7 @@ tape_load_success:
tape_load_error:
jsr tape_screen_show_motor_off
jsr tape_screen_on_motor_off
cli
jmp lvs_load_verify_error