; ; 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 ; loop filling the screen with one ; colour cycling the whole palette ld b, 0 loop: call fill inc b and b, 15 push b call draw_sprite pop b ; wait 1 second ld x, 60 wait_loop: halt dec x bnz jmp wait_loop jmp loop ; fill frame-buffer with a color in reg b fill: ld a, 0xbf ld x, 0 ld y, 0x40 fill_loop: ld [a : x], b inc x bno jmp fill_loop inc a dec y bnz jmp fill_loop ret int_handler: iret draw_sprite: ; blitter in settings mode ld x, 128 ld a, 0xb0 port a, x ; setup inc a ; source ld x, sprite port a, x ; destination (56, 56) ld x, 56 port a, x 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"