This commit is contained in:
Irmen de Jong 2017-12-27 16:22:12 +01:00
parent a3faf07c8c
commit c07698dfda

View File

@ -169,9 +169,9 @@ sub HOMECRSR () -> (A?, X?, Y?) = $E566 ; cursor to top left of screen
sub IRQDFRT () -> (A?, X?, Y?) = $EA31 ; default IRQ routine
sub IRQDFEND () -> (A?, X?, Y?) = $EA81 ; default IRQ end/cleanup
sub CINT () -> (A?, X?, Y?) = $FF81 ; (alias: SCINIT) initialize screen editor and video chip
sub IOINIT () -> (A?, X?) = $FF84 ; initialize I/O devices
sub IOINIT () -> (A?, X?) = $FF84 ; initialize I/O devices (CIA, SID, IRQ)
sub RAMTAS () -> (A?, X?, Y?) = $FF87 ; initialize RAM, tape buffer, screen
sub RESTOR () -> () = $FF8A ; restore default I/O vectors
sub RESTOR () -> (A?, X?, Y?) = $FF8A ; restore default I/O vectors
sub VECTOR (dir: SC, userptr: XY) -> (A?, Y?) = $FF8D ; read/set I/O vector table
sub SETMSG (value: A) -> () = $FF90 ; set Kernal message control flag
sub SECOND (address: A) -> (A?) = $FF93 ; (alias: LSTNSA) send secondary address after LISTEN
@ -219,6 +219,36 @@ sub IOBASE () -> (X, Y) = $FFF3 ; read base address
~ c64util {
sub init_state () -> (A?, X?, Y?) {
; ---- initializes the machine to a sane starting state
; This means that the BASIC, KERNAL and CHARGEN ROMs are banked in,
; the VIC, SID and CIA chips are reset, screen is cleared, and the default IRQ is set.
; Also a different color scheme is chosen to identify ourselves a little.
asm {
sei
cld
lda #%00101111
sta $00
lda #%00100111
sta $01
jsr c64.IOINIT
jsr c64.RESTOR
jsr c64.CINT
lda #6
sta c64.EXTCOL
lda #7
sta c64.COLOR
lda #0
sta c64.BGCOL0
tax
tay
clc
cli
rts
}
}
sub FREADS32 () -> (A?, X?, Y?) {
; ---- fac1 = signed int32 from $62-$65 big endian (MSB FIRST)
asm {