Skip to content

Commit 5664ed8

Browse files
committed
Fix FLASH setting
FLASH 8 was not being set (transparent mode). Also FLASH 0 is now 0 and any other value is FLASH 1.
1 parent e7a0982 commit 5664ed8

1 file changed

Lines changed: 20 additions & 2 deletions

File tree

library-asm/flash.asm

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,39 @@
55

66
FLASH:
77
ld de, ATTR_P
8+
9+
PROC
10+
LOCAL IS_TR
11+
LOCAL IS_ZERO
12+
813
__SET_FLASH:
914
; Another entry. This will set the flash flag at location pointer by DE
10-
and 1 ; # Convert to 0/1
15+
cp 8
16+
jr z, IS_TR
17+
18+
; # Convert to 0/1
19+
or a
20+
jr z, IS_ZERO
21+
ld a, 0x80
1122

12-
rrca
23+
IS_ZERO:
1324
ld b, a ; Saves the color
1425
ld a, (de)
1526
and 07Fh ; Clears previous value
1627
or b
1728
ld (de), a
1829
ret
1930

31+
IS_TR: ; transparent
32+
inc de ; Points DE to MASK_T or MASK_P
33+
ld a, (de)
34+
or 0x80; Set bit 7 to enable transparency
35+
ld (de), a
36+
ret
2037

2138
; Sets the FLASH flag passed in A register in the ATTR_T variable
2239
FLASH_TMP:
2340
ld de, ATTR_T
2441
jr __SET_FLASH
42+
ENDP
2543

0 commit comments

Comments
 (0)