From bdbb811ac1a60920f87a5640f2f68e7f349fe2c0 Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Thu, 4 May 2023 22:55:50 +0100 Subject: Include PNG images as data --- example.asm | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) (limited to 'example.asm') diff --git a/example.asm b/example.asm index 56afcba..73aa9a5 100644 --- a/example.asm +++ b/example.asm @@ -27,6 +27,10 @@ loop: inc b and b, 15 + push b + call draw_sprite + pop b + ; wait 1 second ld x, 60 wait_loop: @@ -55,3 +59,64 @@ fill_loop: int_handler: iret + +draw_sprite: + push y + ld y, 16 + ld [sp + 0], y + + ; src + ld a, >sprite + ld x, end_sprite + bz + jmp done + +next_row: + push y + ld y, 16 + ld [sp + 1], y + pop y + + jmp line + +done: + pop y + ret + +sprite: + .incpng "assets/icon.png" +end_sprite: + -- cgit v1.2.3