; ; example.asm for TR8 ; .org 0 ; address of the frame interrupt vector .equ INT_VECT 0xff00 ; setup an int handler so we ; can use the frame int to sync ld a, >INT_VECT ld x, int_handler ld [a : x], b ; enable interrupts cif ld b, 0 loop: call fill_screen push b ; update sprite position ld a, >incx ld x, -1 ; -1 -> 1 ld a, >incx ld x, incy ld x, -1 ; -1 -> 1 ld a, >incy ld x, sprite port a, x ld y, px ld x, [b : y] port a, x ld y, py ld x, [b : y] port a, x ; size 16x16 ld x, 16 port a, x port a, x ; now blit dec a ld x, 3 ; 3: write with transparent color support port a, x ret sprite: .incpng "assets/icon.png" incx: .db 1 px: .db 18 incy: .db 1 py: .db 64