reenabled BRK handler, now prints BRK address
This commit is contained in:
1 parent
2d590f95c5
commit
180c88ef42
6 files changed
+38
-14
No files matched your search
@@ -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
|
* joystick (port 1) can be used to move text cursor
|
||||||
* uses RAM under ROM and I/O: 61436 bytes free
|
* uses RAM under ROM and I/O: 61436 bytes free
|
||||||
* cold/warm start silences multiple SID chips - all $D4xx and $D5xx addresses
|
* 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
|
* extended `LOAD` command
|
||||||
* start/end addresses are displayed, in the Final cartridge style
|
* 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
|
* 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
|
* tape support
|
||||||
* RS-232 support
|
* RS-232 support
|
||||||
* breaking Kernal routines with RUN/STOP key
|
* breaking Kernal routines with RUN/STOP key
|
||||||
* BRK handling; NMI/IRQ handling is incomplete
|
* NMI andling is incomplete
|
||||||
|
|
||||||
|
|
||||||
# API status
|
# API status
|
||||||
|
|||||||
@@ -34,11 +34,7 @@
|
|||||||
.alias IEC_TMP1 $A3 ; temporary variable for tape and IEC
|
.alias IEC_TMP1 $A3 ; temporary variable for tape and IEC
|
||||||
.alias IEC_TMP2 $A4 ; 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,
|
.alias CMP0 $B0 ; $B0-$B1, temporary tape storage, we use it too for BRK instruction address
|
||||||
;; 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 FNLEN $B7 ; current file name length
|
.alias FNLEN $B7 ; current file name length
|
||||||
|
|
||||||
|
|||||||
@@ -3,5 +3,21 @@
|
|||||||
basic_warm_start:
|
basic_warm_start:
|
||||||
jsr install_ram_routines
|
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
|
jmp basic_main_loop
|
||||||
|
|
||||||
@@ -26,5 +26,9 @@ default_nmi_handler:
|
|||||||
bcs +
|
bcs +
|
||||||
jmp return_from_interrupt ; no STOP pressed
|
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)
|
||||||
|
|
||||||
@@ -16,12 +16,10 @@ irq_handler:
|
|||||||
pha
|
pha
|
||||||
|
|
||||||
;; Check if caused by BRK
|
;; Check if caused by BRK
|
||||||
|
tsx
|
||||||
;; XXX disabled for now - resets Duotris game, unknown why
|
lda $0104, x ; get the pre-interrupt processor state
|
||||||
; tsx
|
and #$10
|
||||||
; lda $0104, x ; get the pre-interrupt processor state
|
bne irq_handler_brk
|
||||||
; and #$10
|
|
||||||
; bne irq_handler_brk
|
|
||||||
|
|
||||||
;; Not caused by BRK - call interrupt routine (only if initialised)
|
;; Not caused by BRK - call interrupt routine (only if initialised)
|
||||||
lda CINV
|
lda CINV
|
||||||
@@ -34,6 +32,15 @@ irq_handler:
|
|||||||
|
|
||||||
irq_handler_brk:
|
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
|
;; Interrupt caused by BRK
|
||||||
jmp (CBINV)
|
jmp (CBINV)
|
||||||
|
|
||||||
+1
-1
@@ -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
|
"READY.\r", // #29 // https://www.ibm.com/support/knowledgecenter/zosbasics/com.ibm.zos.zconcepts/zconc_whatistsonative.htm https://github.com/stefanhaustein/expressionparser
|
||||||
"NTSC, ", // #30
|
"NTSC, ", // #30
|
||||||
"PAL, ", // #31
|
"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
|
"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
|
"BYTES FREE\r\r", // #34 // https://github.com/stefanhaustein/expressionparser
|
||||||
"MEMORY CORRUPT", // #35
|
"MEMORY CORRUPT", // #35
|
||||||
|
|||||||
Reference in new issue
Block a user