initial RESTOR routine and $314-$333 vectors support

This commit is contained in:
FeralChild64 committed 2019-06-14 18:50:53 +02:00
1 parent 5fcbdb601e
commit 8e3b66bd7a
8 files changed
+86 -6

No files matched your search

+20 -2
View File
@@ -76,6 +76,26 @@
.alias screen_scroll_disable $0292
.alias pal_or_ntsc $02A6
;; Kernal vectors - interrupts
.alias CINV $0314
.alias CBINV $0316
.alias NMINV $0318
;; Kernal vectors - routines
.alias IOPEN $031A
.alias ICLOSE $031C
.alias ICHKIN $031E
.alias ICKOUT $0320
.alias ICLRCH $0322
.alias IBASIN $0324
.alias IBASOUT $0326
.alias ISTOP $0328
.alias IGETIN $032A
.alias ICLALL $032C
.alias USRCMD $032E
.alias ILOAD $0330
.alias ISAVE $0331
;; Under-ROM routines
;; (BASIC also includes them. XXX - We should de-duplicate them in a safe manner)
.alias missed_nmi_flag $2A7
@@ -84,5 +104,3 @@
.alias poke_under_roms tiny_nmi_handler+poke_under_roms_routine-tiny_nmi_handler_routine
.alias memmap_allram tiny_nmi_handler+memmap_allram_routine-tiny_nmi_handler_routine
.alias memmap_normal tiny_nmi_handler+memmap_normal_routine-tiny_nmi_handler_routine
+2
View File
@@ -0,0 +1,2 @@
clall:
rts
-2
View File
@@ -1,2 +0,0 @@
close_all_files:
rts
+1 -1
View File
@@ -1,3 +1,3 @@
; $FFE7 - Close all files vector
; (http://codebase64.org/doku.php?id=base:kernalreference)
jmp close_all_files
jmp clall
+39
View File
@@ -1,3 +1,42 @@
; Function defined on pp272-273 of C64 Programmers Reference Guide
restor:
;; According to 'Compute's Mapping the Commodore 64' p237 this resets 15 vectors
;; placed starting from $0314
;; XXX simplify this implementation when vector is implemented
;; Make sure the IRQ is disabled - better safe than sorry
php
cli
;; Copy vectors in a loop
ldx #$1F
*
lda restor_def_arr, x
sta CINV, x
dex
bpl -
;; Restore status register before return
plp
rts
restor_def_arr:
.word $0000 ;; CINV XXX implement this
.word $0000 ;; CBINV XXX implement this
.word $0000 ;; NMINV XXX implement this
.word open ;; IOPEN
.word close ;; ICLOSE
.word chkin ;; ICHKIN
.word chkout ;; ICKOUT
.word clrchn ;; ICLRCH
.word chrin ;; IBASIN
.word chrout ;; IBASOUT
.word stop ;; ISTOP
.word getin ;; IGETIN
.word clall ;; ICLALL
.word $0000 ;; USRCMD XXX implement this
.word load ;; ILOAD
.word save ;; ISAVE
+3
View File
@@ -1,3 +1,6 @@
; Function defined on pp272-273 of C64 Programmers Reference Guide
vector:
;; XXX adapt restor when this is implemented
rts