diff --git a/compiler/src/prog8/compiler/target/CompilationTarget.kt b/compiler/src/prog8/compiler/target/CompilationTarget.kt index cd7fd29d1..090a7df37 100644 --- a/compiler/src/prog8/compiler/target/CompilationTarget.kt +++ b/compiler/src/prog8/compiler/target/CompilationTarget.kt @@ -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" } diff --git a/examples/test.p8 b/examples/test.p8 index 8c77edce0..e1757a1bc 100644 --- a/examples/test.p8 +++ b/examples/test.p8 @@ -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) { ...}