dofile "vcs.lua" TIM_OVERSCAN = 50 -- TIM64T, 3200 cycles = ~ 42 scanlines TIM_VBLANK = 61 -- TIM64T, 3904 cycles = ~ 51 scanlines TIM_KERNEL = 17 -- T1024T, 17408 cycles = ~229 scanlines location(0xf000, 0xffff) section waitForIntim lda INTIM bne waitForIntim rts -- alternate syntax section waitForIntim { a=INTIM }!= rts section waitForIntim repeat a=INTIM until N @{ a=INTIM }~0 rts -- interop: generate stubs at fixed addresses -- stub(0xff10, waitForIntim[, altname]) -- and dumps all generated code/data into opaque data function inca() asm("clc; adc #0") end section "testMacro" { lda #0 inca() } => section("testMacro") label("testMacro") lda{imm=0} inca() => clc() adc{imm=0} endsection() require_ "6502-def"