c64 system reset now banks kernel rom back in

This commit is contained in:
Irmen de Jong 2020-09-15 00:10:20 +02:00
parent 48858019b7
commit d110d1cb5f
2 changed files with 18 additions and 16 deletions

View File

@ -35,7 +35,7 @@ internal object C64Target: CompilationTarget {
if(altEncoding) Petscii.decodeScreencode(bytes, true) else Petscii.decodePetscii(bytes, true)
override fun asmGenerator(program: Program, errors: ErrorReporter, zp: Zeropage, options: CompilationOptions, path: Path) =
AsmGen(program, errors, zp, options, path)
override val asmForSystemReset = " sei | jmp (c64.RESET_VEC)" // TODO enable kernal rom bank
override val asmForSystemReset = " sei | lda #14 | sta $1 | jmp (c64.RESET_VEC)"
override val initProcName = "c64.init_system"
}

View File

@ -1,8 +1,7 @@
%import c64textio
;%import c64flt
;%option enable_floats
%zeropage basicsafe
; TODO system reset should also work when kernal is paged out
%zeropage kernalsafe
main {
@ -10,20 +9,23 @@ main {
sub start() {
uword ub1
word ww1
uword ii
%asm {{
sei
ldy #0
sty $1
lda #0
- sta $f000,y
iny
bne -
- lda $f000,y
sta $0400,y
iny
bne -
}}
for ii in 0 to 20 {
; ub1 = ii
; ub1 *= 40 ; TODO implement non-stack optimized muls
; todo a = EXPRESSION * const -> is that optimized?
ub1 = ii * 15
txt.print_uw(ub1)
c64.CHROUT(',')
ub1 = 1+(ii * 15)
txt.print_uw(ub1)
c64.CHROUT('\n')
repeat 60000 {
ubyte a = sin (3)
a++
}
;asmsub clear_screen (ubyte char @ A, ubyte color @ Y) clobbers(A) { ...}