From 627e526d0a4631f6a65ca18ee6fdad5e0c51e24a Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Sat, 6 May 2023 19:35:19 +0100 Subject: Improve comments and refactored turn --- example.asm | 53 +++++++++++++++++++++++++---------------------------- 1 file changed, 25 insertions(+), 28 deletions(-) diff --git a/example.asm b/example.asm index 48ee7db..6714543 100644 --- a/example.asm +++ b/example.asm @@ -46,21 +46,9 @@ loop: jmp update_y turn_x: - ; update incx - ; 1 -> -1 - ; -1 -> 1 ld a, >incx ld x, incy @@ -83,21 +71,9 @@ update_y: jmp update_done turn_y: - ; update incy - ; 1 -> -1 - ; -1 -> 1 ld a, >incy ld x, -1 + ; -1 -> 1 + ld y, [a : x] + ld b, 254 + xor y, b + ld [a : x], y + + ; change color + ld b, [sp + 2] + inc b + and b, 15 + ld [sp + 2], b + ret + + + ; fill frame-buffer + ; in: reg b color fill_screen: ld a, 0xbf ld x, 0 @@ -128,7 +123,8 @@ fill_loop: int_handler: iret - ; draw sprite getting coordinates from px, py + ; draw sprite + ; in: coordinates in px, py draw_sprite: ; blitter in settings mode ld x, 128 @@ -142,6 +138,7 @@ draw_sprite: port a, x ld x, >sprite port a, x + ; destination ld y, px ld x, [b : y] -- cgit v1.2.3