1
0
mirror of https://github.com/g012/l65.git synced 2024-06-11 10:29:27 +00:00
l65/vcs_test.l65

46 lines
832 B
Plaintext

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"