get CIA IRQ running.
This commit is contained in:
1 parent
b551bc7827
commit
c46a4aa1dd
2 files changed
+24
No files matched your search
@@ -14,5 +14,26 @@ ioinit:
|
||||
sta $D020
|
||||
lda #$06
|
||||
sta $D021
|
||||
|
||||
;; Enable CIA1 IRQ and ~50Hz timer
|
||||
;; (https://csdb.dk/forums/?roomid=11&topicid=69037)
|
||||
lda #$7f
|
||||
sta $DC0D ; First disable all
|
||||
|
||||
;; Set timer interval to ~1/50th of a second
|
||||
lda #<20000
|
||||
sta $dc04
|
||||
lda #>20000
|
||||
sta $dc05
|
||||
|
||||
;; Enable timer interrupt
|
||||
lda #$81
|
||||
sta $dc0d
|
||||
|
||||
;; Enable timer A to run continuously
|
||||
;; (http://codebase64.org/doku.php?id=base:timerinterrupts)
|
||||
lda #$11
|
||||
sta $dc0e
|
||||
lda $dc0d
|
||||
|
||||
rts
|
||||
@@ -14,6 +14,9 @@ irq_handler:
|
||||
tya
|
||||
pha
|
||||
|
||||
;; Acknowledge CIA interrupt
|
||||
lda $dc0d
|
||||
|
||||
;; Call interrupt routine
|
||||
;; (but only if initialised)
|
||||
lda $0314
|
||||
|
||||
Reference in new issue
Block a user