reenabled BRK handler, now prints BRK address

This commit is contained in:
FeralChild64 committed 2019-09-01 16:20:36 +02:00
1 parent 2d590f95c5
commit 180c88ef42
6 files changed
+40 -16

No files matched your search

+1 -5
View File
@@ -34,11 +34,7 @@
.alias IEC_TMP1 $A3 ; temporary variable for tape and IEC
.alias IEC_TMP2 $A4 ; temporary variable for tape and IEC
;; 2-byte location below seems to be a good place for temporary storage,
;; it seems used for timing during tape reads only - see:
;; - 'C64 Programmer's Reference Guide', page 314
;; - 'Compute's Mapping the Commodore 64', page 32
.alias CMP0 $B0 ; $B0-$B1
.alias CMP0 $B0 ; $B0-$B1, temporary tape storage, we use it too for BRK instruction address
.alias FNLEN $B7 ; current file name length
+18 -2
View File
@@ -2,6 +2,22 @@
basic_warm_start:
jsr install_ram_routines
;; If warm start caused by BRK, print it address
lda CMP0
ora CMP0+1
beq +
ldx #32
jsr print_packed_message
lda CMP0+1
jsr printf_printhexbyte
lda CMP0+0
jsr printf_printhexbyte
lda #$0D
jsr JCHROUT
*
jmp basic_main_loop
@@ -26,5 +26,9 @@ default_nmi_handler:
bcs +
jmp return_from_interrupt ; no STOP pressed
*
jmp (CBINV) ; STOP + RESTORE
;; STOP + RESTORE - clean the address of the BRK instruction (it's not BRK) first
lda #$00
sta CMP0+0
sta CMP0+1
jmp (CBINV)
+13 -6
View File
@@ -16,12 +16,10 @@ irq_handler:
pha
;; Check if caused by BRK
;; XXX disabled for now - resets Duotris game, unknown why
; tsx
; lda $0104, x ; get the pre-interrupt processor state
; and #$10
; bne irq_handler_brk
tsx
lda $0104, x ; get the pre-interrupt processor state
and #$10
bne irq_handler_brk
;; Not caused by BRK - call interrupt routine (only if initialised)
lda CINV
@@ -34,6 +32,15 @@ irq_handler:
irq_handler_brk:
;; Store BRK adddress, to be displayed
sec
lda $0105, x
sbc #$02
sta CMP0+0
lda $0106, x
sbc #$00
sta CMP0+1
;; Interrupt caused by BRK
jmp (CBINV)