STOP + RESTORE now works (bad news: works even without STOP)

This commit is contained in:
FeralChild64 committed 2019-08-06 22:00:50 +02:00
1 parent 03bc8b8e78
commit e4ddf9ec0c
12 files changed
+46 -19

No files matched your search

@@ -2,7 +2,8 @@
default_irq_handler:
jsr blink_cursor
jsr scan_keyboard
jsr JSCNKEY
jsr JUDTIM ; update jiffy clock
;; Acknowledge CIA interrupt and return
jmp clear_cia1_interrupt_flag_and_return_from_interrupt
@@ -1,12 +1,25 @@
default_nmi_handler:
;; XXX implement according to Compute's Mapping the Commodore 64, page 74
;; Implemented according to Compute's Mapping the Commodore 64, page 74
;; and to https://www.c64-wiki.com/wiki/Interrupt
;; Save registers, sequence according to Compute's Mapping the Commodore 64, page 73
pha
txa
pha
tya
pha
;; XXX: RS-232 support is not implemented
;; XXX check if the source was RESTORE key, quit if it wasn't (no RS-232 support)
;; XXX if cartridge present, enter it through warm start vector
;; XXX if stop pressed, go to default_brk_handler
inc $D020
rti
;; According to C64 Wiki, if STOP key is pressed, the routine assumes warm start request
jsr JSTOP
bcs +
jmp return_from_interrupt ; no STOP pressed
*
jmp (CBINV) ; STOP + RESTORE
@@ -3,9 +3,13 @@ default_brk_handler:
;; Implemented according to Compute's Mapping the Commodore 64, pages 73-74
sei ; disable IRQs, to be sure they won't interfere
jsr JRESTOR
jsr JIOINIT
jsr CINT_BRK
cli
jmp (IBASIC_WARM_START)
+2
View File
@@ -15,6 +15,8 @@ irq_handler:
tya
pha
;; XXX check if caused by BRK, react accordingly
;; Call interrupt routine (only if initialised)
lda CINV
ora CINV+1
+12 -1
View File
@@ -1,7 +1,18 @@
nmi_handler:
;; XXX provide real implementation
sei ;; don't allow IRQ to interfere, see https://www.c64-wiki.com/wiki/Interrupt
;; Call interrupt routine (only if initialised)
pha
lda NMINV
ora NMINV+1
bne +
pla
jmp (NMINV)
*
;; Vector not initialized - call default interrupt routine
pla
jmp default_nmi_handler