From 2f50827c3d2bb48e79f202cd084de08b5ad65732 Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Sat, 6 May 2023 12:06:02 +0100 Subject: Implement hardware blitter --- example.asm | 85 +++++++++++++++++-------------------------------------------- 1 file changed, 24 insertions(+), 61 deletions(-) (limited to 'example.asm') diff --git a/example.asm b/example.asm index 2ab0ee7..cffef5e 100644 --- a/example.asm +++ b/example.asm @@ -61,71 +61,34 @@ int_handler: iret draw_sprite: - push y - ld y, 16 - ld [sp + 0], y + ; blitter in settings mode + ld x, 128 + ld a, 0xb0 + port a, x - ; src - ld a, >sprite - ld x, 15 - ; is transparent - cmp x, 16 - bnc - jmp transparent - - ld [b : y], x - -transparent: - pop x - - inc x - bo + ; setup inc a - - inc y - - push y - ld y, [sp + 1] - dec y - ld [sp + 1], y - pop y - - bnz - jmp line - - add y, 112 - bo - inc b - - cmp x, end_sprite - bz - jmp done - -next_row: - push y - ld y, 16 - ld [sp + 1], y - pop y - - jmp line - -done: - pop y + ; 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" -end_sprite: -- cgit v1.2.3