No longe uses a lookup table.

This commit is contained in:
Pedro de Oliveira 2014-08-19 07:43:37 +01:00
parent 0d95f0183c
commit 1326881923
1 changed files with 13 additions and 18 deletions

View File

@ -50,28 +50,23 @@ main
PROC PROC
tbl_origin db $0, $1, $2, $3, $4, $5, $6, $7 ; Video Ram Address in HL
tbl_dest db 128, 64, 32, 16, 8, 4, 2, 1 ; Pixel to write in A
write_pixel write_pixel
push hl
ld de, tbl_origin
ld hl, tbl_dest
lookup_table_loop
ld b, a ld b, a
ld a, (de) ld c, $0
cp b scf
jr z, lookup_table_found write_pixel_loop
inc de ld a, c
inc hl rra
ld c, a
ld a, b ld a, b
jr lookup_table_loop jr z, write_pixel_do_it
lookup_table_found dec b
jr write_pixel_loop
write_pixel_do_it
ld a, (hl) ld a, (hl)
ld b, a or c
pop hl
ld a, (hl)
or b
ld (hl), a ld (hl), a
ret ret
ENDP ENDP