Skip to content

Commit 9e94975

Browse files
authored
Merge pull request #191 from boriel/bugfix/attr2
Bugfix bright 8 and flash 8
2 parents f8d065c + 5e607f4 commit 9e94975

53 files changed

Lines changed: 784 additions & 832 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

library-asm/bright.asm

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include once <const.asm>
55

66
BRIGHT:
7-
ld de, ATTR_P
7+
ld hl, ATTR_P
88

99
PROC
1010
LOCAL IS_TR
@@ -22,22 +22,21 @@ __SET_BRIGHT:
2222

2323
IS_ZERO:
2424
ld b, a ; Saves the color
25-
ld a, (de)
25+
ld a, (hl)
2626
and 0BFh ; Clears previous value
2727
or b
28-
ld (de), a
28+
ld (hl), a
29+
inc hl
30+
res 6, (hl) ;Reset bit 6 to disable transparency
2931
ret
3032

3133
IS_TR: ; transparent
32-
inc de ; Points DE to MASK_T or MASK_P
33-
ld a, (de)
34-
or 0x40; Set bit 6 to enable transparency
35-
ld (de), a
34+
inc hl ; Points DE to MASK_T or MASK_P
35+
set 6, (hl) ;Set bit 6 to enable transparency
3636
ret
3737

38-
3938
; Sets the BRIGHT flag passed in A register in the ATTR_T variable
4039
BRIGHT_TMP:
41-
ld de, ATTR_T
40+
ld hl, ATTR_T
4241
jr __SET_BRIGHT
4342
ENDP

library-asm/flash.asm

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include once <const.asm>
55

66
FLASH:
7-
ld de, ATTR_P
7+
ld hl, ATTR_P
88

99
PROC
1010
LOCAL IS_TR
@@ -22,22 +22,22 @@ __SET_FLASH:
2222

2323
IS_ZERO:
2424
ld b, a ; Saves the color
25-
ld a, (de)
25+
ld a, (hl)
2626
and 07Fh ; Clears previous value
2727
or b
28-
ld (de), a
28+
ld (hl), a
29+
inc hl
30+
res 7, (hl) ;Reset bit 7 to disable transparency
2931
ret
3032

3133
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
34+
inc hl ; Points DE to MASK_T or MASK_P
35+
set 7, (hl) ;Set bit 7 to enable transparency
3636
ret
3737

3838
; Sets the FLASH flag passed in A register in the ATTR_T variable
3939
FLASH_TMP:
40-
ld de, ATTR_T
40+
ld hl, ATTR_T
4141
jr __SET_FLASH
4242
ENDP
4343

tests/functional/astore16.asm

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ PAPER_TMP:
560560

561561

562562
FLASH:
563-
ld de, ATTR_P
563+
ld hl, ATTR_P
564564

565565
PROC
566566
LOCAL IS_TR
@@ -578,22 +578,22 @@ __SET_FLASH:
578578

579579
IS_ZERO:
580580
ld b, a ; Saves the color
581-
ld a, (de)
581+
ld a, (hl)
582582
and 07Fh ; Clears previous value
583583
or b
584-
ld (de), a
584+
ld (hl), a
585+
inc hl
586+
res 7, (hl) ;Reset bit 7 to disable transparency
585587
ret
586588

587589
IS_TR: ; transparent
588-
inc de ; Points DE to MASK_T or MASK_P
589-
ld a, (de)
590-
or 0x80; Set bit 7 to enable transparency
591-
ld (de), a
590+
inc hl ; Points DE to MASK_T or MASK_P
591+
set 7, (hl) ;Set bit 7 to enable transparency
592592
ret
593593

594594
; Sets the FLASH flag passed in A register in the ATTR_T variable
595595
FLASH_TMP:
596-
ld de, ATTR_T
596+
ld hl, ATTR_T
597597
jr __SET_FLASH
598598
ENDP
599599

@@ -606,7 +606,7 @@ FLASH_TMP:
606606

607607

608608
BRIGHT:
609-
ld de, ATTR_P
609+
ld hl, ATTR_P
610610

611611
PROC
612612
LOCAL IS_TR
@@ -624,23 +624,22 @@ __SET_BRIGHT:
624624

625625
IS_ZERO:
626626
ld b, a ; Saves the color
627-
ld a, (de)
627+
ld a, (hl)
628628
and 0BFh ; Clears previous value
629629
or b
630-
ld (de), a
630+
ld (hl), a
631+
inc hl
632+
res 6, (hl) ;Reset bit 6 to disable transparency
631633
ret
632634

633635
IS_TR: ; transparent
634-
inc de ; Points DE to MASK_T or MASK_P
635-
ld a, (de)
636-
or 0x40; Set bit 6 to enable transparency
637-
ld (de), a
636+
inc hl ; Points DE to MASK_T or MASK_P
637+
set 6, (hl) ;Set bit 6 to enable transparency
638638
ret
639639

640-
641640
; Sets the BRIGHT flag passed in A register in the ATTR_T variable
642641
BRIGHT_TMP:
643-
ld de, ATTR_T
642+
ld hl, ATTR_T
644643
jr __SET_BRIGHT
645644
ENDP
646645
#line 13 "print.asm"

tests/functional/attr.asm

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ BOLD_TMP:
138138

139139

140140
FLASH:
141-
ld de, ATTR_P
141+
ld hl, ATTR_P
142142

143143
PROC
144144
LOCAL IS_TR
@@ -156,22 +156,22 @@ __SET_FLASH:
156156

157157
IS_ZERO:
158158
ld b, a ; Saves the color
159-
ld a, (de)
159+
ld a, (hl)
160160
and 07Fh ; Clears previous value
161161
or b
162-
ld (de), a
162+
ld (hl), a
163+
inc hl
164+
res 7, (hl) ;Reset bit 7 to disable transparency
163165
ret
164166

165167
IS_TR: ; transparent
166-
inc de ; Points DE to MASK_T or MASK_P
167-
ld a, (de)
168-
or 0x80; Set bit 7 to enable transparency
169-
ld (de), a
168+
inc hl ; Points DE to MASK_T or MASK_P
169+
set 7, (hl) ;Set bit 7 to enable transparency
170170
ret
171171

172172
; Sets the FLASH flag passed in A register in the ATTR_T variable
173173
FLASH_TMP:
174-
ld de, ATTR_T
174+
ld hl, ATTR_T
175175
jr __SET_FLASH
176176
ENDP
177177

tests/functional/code00.asm

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -848,7 +848,7 @@ PAPER_TMP:
848848

849849

850850
FLASH:
851-
ld de, ATTR_P
851+
ld hl, ATTR_P
852852

853853
PROC
854854
LOCAL IS_TR
@@ -866,22 +866,22 @@ __SET_FLASH:
866866

867867
IS_ZERO:
868868
ld b, a ; Saves the color
869-
ld a, (de)
869+
ld a, (hl)
870870
and 07Fh ; Clears previous value
871871
or b
872-
ld (de), a
872+
ld (hl), a
873+
inc hl
874+
res 7, (hl) ;Reset bit 7 to disable transparency
873875
ret
874876

875877
IS_TR: ; transparent
876-
inc de ; Points DE to MASK_T or MASK_P
877-
ld a, (de)
878-
or 0x80; Set bit 7 to enable transparency
879-
ld (de), a
878+
inc hl ; Points DE to MASK_T or MASK_P
879+
set 7, (hl) ;Set bit 7 to enable transparency
880880
ret
881881

882882
; Sets the FLASH flag passed in A register in the ATTR_T variable
883883
FLASH_TMP:
884-
ld de, ATTR_T
884+
ld hl, ATTR_T
885885
jr __SET_FLASH
886886
ENDP
887887

@@ -894,7 +894,7 @@ FLASH_TMP:
894894

895895

896896
BRIGHT:
897-
ld de, ATTR_P
897+
ld hl, ATTR_P
898898

899899
PROC
900900
LOCAL IS_TR
@@ -912,23 +912,22 @@ __SET_BRIGHT:
912912

913913
IS_ZERO:
914914
ld b, a ; Saves the color
915-
ld a, (de)
915+
ld a, (hl)
916916
and 0BFh ; Clears previous value
917917
or b
918-
ld (de), a
918+
ld (hl), a
919+
inc hl
920+
res 6, (hl) ;Reset bit 6 to disable transparency
919921
ret
920922

921923
IS_TR: ; transparent
922-
inc de ; Points DE to MASK_T or MASK_P
923-
ld a, (de)
924-
or 0x40; Set bit 6 to enable transparency
925-
ld (de), a
924+
inc hl ; Points DE to MASK_T or MASK_P
925+
set 6, (hl) ;Set bit 6 to enable transparency
926926
ret
927927

928-
929928
; Sets the BRIGHT flag passed in A register in the ATTR_T variable
930929
BRIGHT_TMP:
931-
ld de, ATTR_T
930+
ld hl, ATTR_T
932931
jr __SET_BRIGHT
933932
ENDP
934933
#line 13 "print.asm"

tests/functional/code01.asm

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -848,7 +848,7 @@ PAPER_TMP:
848848

849849

850850
FLASH:
851-
ld de, ATTR_P
851+
ld hl, ATTR_P
852852

853853
PROC
854854
LOCAL IS_TR
@@ -866,22 +866,22 @@ __SET_FLASH:
866866

867867
IS_ZERO:
868868
ld b, a ; Saves the color
869-
ld a, (de)
869+
ld a, (hl)
870870
and 07Fh ; Clears previous value
871871
or b
872-
ld (de), a
872+
ld (hl), a
873+
inc hl
874+
res 7, (hl) ;Reset bit 7 to disable transparency
873875
ret
874876

875877
IS_TR: ; transparent
876-
inc de ; Points DE to MASK_T or MASK_P
877-
ld a, (de)
878-
or 0x80; Set bit 7 to enable transparency
879-
ld (de), a
878+
inc hl ; Points DE to MASK_T or MASK_P
879+
set 7, (hl) ;Set bit 7 to enable transparency
880880
ret
881881

882882
; Sets the FLASH flag passed in A register in the ATTR_T variable
883883
FLASH_TMP:
884-
ld de, ATTR_T
884+
ld hl, ATTR_T
885885
jr __SET_FLASH
886886
ENDP
887887

@@ -894,7 +894,7 @@ FLASH_TMP:
894894

895895

896896
BRIGHT:
897-
ld de, ATTR_P
897+
ld hl, ATTR_P
898898

899899
PROC
900900
LOCAL IS_TR
@@ -912,23 +912,22 @@ __SET_BRIGHT:
912912

913913
IS_ZERO:
914914
ld b, a ; Saves the color
915-
ld a, (de)
915+
ld a, (hl)
916916
and 0BFh ; Clears previous value
917917
or b
918-
ld (de), a
918+
ld (hl), a
919+
inc hl
920+
res 6, (hl) ;Reset bit 6 to disable transparency
919921
ret
920922

921923
IS_TR: ; transparent
922-
inc de ; Points DE to MASK_T or MASK_P
923-
ld a, (de)
924-
or 0x40; Set bit 6 to enable transparency
925-
ld (de), a
924+
inc hl ; Points DE to MASK_T or MASK_P
925+
set 6, (hl) ;Set bit 6 to enable transparency
926926
ret
927927

928-
929928
; Sets the BRIGHT flag passed in A register in the ATTR_T variable
930929
BRIGHT_TMP:
931-
ld de, ATTR_T
930+
ld hl, ATTR_T
932931
jr __SET_BRIGHT
933932
ENDP
934933
#line 13 "print.asm"

0 commit comments

Comments
 (0)