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

+2 -1
View File
@@ -7,6 +7,7 @@ Here are the features of the Open ROMs not found in the original ROMs from the 8
* joystick (port 1) can be used to move text cursor
* uses RAM under ROM and I/O: 61436 bytes free
* cold/warm start silences multiple SID chips - all $D4xx and $D5xx addresses
* wark start due to BRK prints out the instruction address
* extended `LOAD` command
* start/end addresses are displayed, in the Final cartridge style
* command with just the file name tries to use the last device if it's number seems sane; otherwise uses 8
@@ -28,7 +29,7 @@ The following ROM features are currently missing:
* tape support
* RS-232 support
* breaking Kernal routines with RUN/STOP key
* BRK handling; NMI/IRQ handling is incomplete
* NMI andling is incomplete
# API status
+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)
+1 -1
View File
@@ -161,7 +161,7 @@ char *error_list[]={
"READY.\r", // #29 // https://www.ibm.com/support/knowledgecenter/zosbasics/com.ibm.zos.zconcepts/zconc_whatistsonative.htm https://github.com/stefanhaustein/expressionparser
"NTSC, ", // #30
"PAL, ", // #31
"", // unused for now
"BRK AT $", // #32
"ERROR", // #33 // Simply the word error that is attached to the other parts of messages https://fjkraan.home.xs4all.nl/comp/apple2faq/app2asoftfaq.html
"BYTES FREE\r\r", // #34 // https://github.com/stefanhaustein/expressionparser
"MEMORY CORRUPT", // #35