STOP + RESTORE now works (bad news: works even without STOP)
This commit is contained in:
1 parent
03bc8b8e78
commit
e4ddf9ec0c
12 files changed
+46
-19
No files matched your search
@@ -147,7 +147,7 @@ test: build/newkern_generic build/newbasic_generic
|
|||||||
x64 -kernal build/newkern_generic -basic build/newbasic_generic -8 empty.d64
|
x64 -kernal build/newkern_generic -basic build/newbasic_generic -8 empty.d64
|
||||||
|
|
||||||
testremote: build/newkern_generic build/newbasic_generic
|
testremote: build/newkern_generic build/newbasic_generic
|
||||||
x64 -kernal build/newkern-generic -basic build/newbasic-generic -remotemonitor
|
x64 -kernal build/newkern_generic -basic build/newbasic_generic -remotemonitor
|
||||||
|
|
||||||
testm65: build/newc65
|
testm65: build/newc65
|
||||||
m65 -b ../mega65-core/bin/mega65r1.bit -k ../mega65-core/bin/KICKUP.M65 -R build/newc65 -4
|
m65 -b ../mega65-core/bin/mega65r1.bit -k ../mega65-core/bin/KICKUP.M65 -R build/newc65 -4
|
||||||
|
|||||||
@@ -102,10 +102,10 @@ NOTE: Even the 'DONE' routines won't support features described as missing in on
|
|||||||
| `$FFD8` | `SAVE` | NOT DONE | |
|
| `$FFD8` | `SAVE` | NOT DONE | |
|
||||||
| `$FFDB` | `SETTIM` | NOT DONE | |
|
| `$FFDB` | `SETTIM` | NOT DONE | |
|
||||||
| `$FFDE` | `RDTIM` | NOT DONE | |
|
| `$FFDE` | `RDTIM` | NOT DONE | |
|
||||||
| `$FFE1` | `STOP` | PARTIAL | no connection with UDTIM |
|
| `$FFE1` | `STOP` | PARTIAL | |
|
||||||
| `$FFE4` | `GETIN` | PARTIAL | only some devices supported |
|
| `$FFE4` | `GETIN` | PARTIAL | only some devices supported |
|
||||||
| `$FFE7` | `CLALL` | DONE | |
|
| `$FFE7` | `CLALL` | DONE | |
|
||||||
| `$FFEA` | `UDTIM` | NOT DONE | |
|
| `$FFEA` | `UDTIM` | NOT DONE | checking for STOP key present in SCNKEY instead |
|
||||||
| `$FFED` | `SCREEN` | DONE | |
|
| `$FFED` | `SCREEN` | DONE | |
|
||||||
| `$FFF0` | `PLOT` | NOT DONE | |
|
| `$FFF0` | `PLOT` | NOT DONE | |
|
||||||
| `$FFF3` | `IOBASE` | DONE | |
|
| `$FFF3` | `IOBASE` | DONE | |
|
||||||
|
|||||||
+1
-3
@@ -48,9 +48,7 @@ cint_brk: ; entry for BRK and STOP+RESTORE - XXX, where should it start?
|
|||||||
|
|
||||||
;; Set default I/O devices (see SCINIT description at http://sta.c64.org/cbm64krnfunc.html)
|
;; Set default I/O devices (see SCINIT description at http://sta.c64.org/cbm64krnfunc.html)
|
||||||
jsr clrchn_reset
|
jsr clrchn_reset
|
||||||
|
|
||||||
;; Fallthrough/jump to screen clear routine (Compute's Mapping the 64 p215)
|
;; Fallthrough/jump to screen clear routine (Compute's Mapping the 64 p215)
|
||||||
jmp clear_screen
|
jmp clear_screen
|
||||||
|
|
||||||
rts
|
|
||||||
|
|
||||||
@@ -2,7 +2,8 @@
|
|||||||
default_irq_handler:
|
default_irq_handler:
|
||||||
|
|
||||||
jsr blink_cursor
|
jsr blink_cursor
|
||||||
jsr scan_keyboard
|
jsr JSCNKEY
|
||||||
|
jsr JUDTIM ; update jiffy clock
|
||||||
|
|
||||||
;; Acknowledge CIA interrupt and return
|
;; Acknowledge CIA interrupt and return
|
||||||
jmp clear_cia1_interrupt_flag_and_return_from_interrupt
|
jmp clear_cia1_interrupt_flag_and_return_from_interrupt
|
||||||
@@ -1,12 +1,25 @@
|
|||||||
|
|
||||||
default_nmi_handler:
|
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 cartridge present, enter it through warm start vector
|
||||||
;; XXX if stop pressed, go to default_brk_handler
|
|
||||||
|
|
||||||
inc $D020
|
;; According to C64 Wiki, if STOP key is pressed, the routine assumes warm start request
|
||||||
rti
|
|
||||||
|
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
|
;; 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 JRESTOR
|
||||||
jsr JIOINIT
|
jsr JIOINIT
|
||||||
jsr CINT_BRK
|
jsr CINT_BRK
|
||||||
|
|
||||||
|
cli
|
||||||
|
|
||||||
jmp (IBASIC_WARM_START)
|
jmp (IBASIC_WARM_START)
|
||||||
|
|
||||||
@@ -15,6 +15,8 @@ irq_handler:
|
|||||||
tya
|
tya
|
||||||
pha
|
pha
|
||||||
|
|
||||||
|
;; XXX check if caused by BRK, react accordingly
|
||||||
|
|
||||||
;; Call interrupt routine (only if initialised)
|
;; Call interrupt routine (only if initialised)
|
||||||
lda CINV
|
lda CINV
|
||||||
ora CINV+1
|
ora CINV+1
|
||||||
|
|||||||
@@ -1,7 +1,18 @@
|
|||||||
|
|
||||||
nmi_handler:
|
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)
|
jmp (NMINV)
|
||||||
|
*
|
||||||
|
;; Vector not initialized - call default interrupt routine
|
||||||
|
pla
|
||||||
|
jmp default_nmi_handler
|
||||||
|
|
||||||
|
|
||||||
@@ -1,3 +1,3 @@
|
|||||||
; Scan keyboard
|
; Scan keyboard
|
||||||
; C64 Programmer's Reference Guide Page 273
|
; C64 Programmer's Reference Guide Page 273
|
||||||
jmp scan_keyboard
|
jmp SCNKEY
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
; $FFEA - Update jiffy clock vector
|
; $FFEA - Update jiffy clock vector
|
||||||
; (http://codebase64.org/doku.php?id=base:kernalreference)
|
; (http://codebase64.org/doku.php?id=base:kernalreference)
|
||||||
|
|
||||||
jmp update_jiffy_clock
|
jmp UDTIM
|
||||||
@@ -69,7 +69,7 @@
|
|||||||
;// Operational Variables
|
;// Operational Variables
|
||||||
.alias MaxKeyRollover 3
|
.alias MaxKeyRollover 3
|
||||||
|
|
||||||
scan_keyboard:
|
scnkey:
|
||||||
|
|
||||||
lda #$00
|
lda #$00
|
||||||
sta BufferQuantity
|
sta BufferQuantity
|
||||||
@@ -538,5 +538,3 @@ KeyCanRepeat:
|
|||||||
KeyRepeatWait:
|
KeyRepeatWait:
|
||||||
pla
|
pla
|
||||||
jmp ConsiderNextKey
|
jmp ConsiderNextKey
|
||||||
|
|
||||||
|
|
||||||
@@ -8,5 +8,5 @@
|
|||||||
;; CPU registers that has to be preserved (see [RG64]): .Y
|
;; CPU registers that has to be preserved (see [RG64]): .Y
|
||||||
;;
|
;;
|
||||||
|
|
||||||
update_jiffy_clock:
|
udtim:
|
||||||
rts
|
rts
|
||||||
Reference in new issue
Block a user