safer NMI handling

This commit is contained in:
FeralChild64 committed 2020-06-04 22:19:10 +02:00
1 parent 1c118d9bc9
commit f8e57f1cf2
10 files changed
+114 -19

No files matched your search

+3
View File
@@ -45,6 +45,9 @@ load_tape_normal:
// Start playing
jsr tape_common_prepare_cia
jsr tape_ask_play
#if CONFIG_TAPE_HEAD_ALIGN
jsr tape_prepare_reading
#endif
// FALLTROUGH
+3
View File
@@ -32,6 +32,9 @@ load_tape_auto:
// Start playing
jsr tape_common_prepare_cia
jsr tape_ask_play
#if CONFIG_TAPE_HEAD_ALIGN
jsr tape_prepare_reading
#endif
// FALLTROUGH
+11 -3
View File
@@ -104,6 +104,17 @@ tape_wait_first_pulse:
tape_wait_play_done:
lda #$01
sta CAS1 // set the interlock
#if CONFIG_TAPE_HEAD_ALIGN
rts
tape_prepare_reading:
#endif // CONFIG_TAPE_HEAD_ALIGN
#if CONFIG_MB_MEGA_65
// Display confirmation
@@ -115,9 +126,6 @@ tape_wait_play_done:
// Prepare for reading
lda #$01
sta CAS1 // set the interlock
jsr print_return
jmp tape_screen_off_motor_on
+11 -6
View File
@@ -12,9 +12,7 @@
// XXX for Mega65 it can be done more easily, by just disabling the badlines
// XXX consider "PRESS PLAY ON TAPE" before start, with option to stop
// XXX document CONFIG_TAPE_HEAD_ALIGN option
// XXX block NMIs
// XXX fix Mega65 build compilation issues
@@ -50,12 +48,22 @@ tape_head_align:
#else
// Make sure user really wants to launch the tool
jsr tape_ask_play
// Disable interrupts, set proper I/O values
jsr CLALL
sei
jsr IOINIT
jsr cint_legacy
jsr CINT
jsr nmi_lock
// Prepare CIA timers
ldx #$02 // set timer A to 3 ticks
jsr tape_common_prepare_cia_by_x
@@ -111,8 +119,6 @@ tape_head_align:
dey
bne !-
// Set graphics mode
lda #$28 // graphics start at $2000, color at $0800
@@ -252,7 +258,6 @@ tape_head_align_drawn:
beq tape_head_align_loop_1
tape_head_align_quit:
// It makes no sense to return to system, as we already destroyed