Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[KERNAL] add ability to bypass cartridge boot by holding Shift #374

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion kernal/drivers/x16/x16.s
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,12 @@
.import jsrfar
.import fetvec
.import fetch
.import softclock_timer_get
.import kbdbuf_get_modifiers
.importzp tmp2

MODIFIER_SHIFT = 1

.segment "MACHINE"

;---------------------------------------------------------------
Expand Down Expand Up @@ -157,7 +161,26 @@ boot_cartridge:
bne @no
dey
bpl @chkloop


; introduce a delay so we can reliably check for the Shift key
; which is a signal to us to skip booting the cartridge
jsr softclock_timer_get
clc
adc #60 ; 60 jiffy delay
sta tmp2
; enable interrupts for this section so that we can receive keystrokes from the SMC
cli
@delayloop:
jsr softclock_timer_get
cmp tmp2
bne @delayloop
; re-mask interrupts since we don't need them anymore for now
; the cart expects to be entered while interrupts are masked
sei
jsr kbdbuf_get_modifiers
and #MODIFIER_SHIFT
bne @no

jsr jsrfar
.word $C004
.byte 32 ; cartridge ROM
Expand Down
Loading