44#include once <sposn.asm>
55#include once <error.asm>
66#include once <in_screen.asm>
7- #include once <const.asm>
8- #include once <cls.asm>
7+ #include once <sysvars.asm>
98
109 push namespace core
1110
@@ -14,20 +13,18 @@ __ATTR_ADDR:
1413 ; Contributed by Santiago Romero at http://www.speccy.org
1514 ld h , 0 ; 7 T-States
1615 ld a , d ; 4 T-States
16+ ld d , h
1717 add a , a ; a * 2 ; 4 T-States
1818 add a , a ; a * 4 ; 4 T-States
1919 ld l , a ; HL = A * 4 ; 4 T-States
2020
2121 add hl , hl ; HL = A * 8 ; 15 T-States
2222 add hl , hl ; HL = A * 16 ; 15 T-States
2323 add hl , hl ; HL = A * 32 ; 15 T-States
24-
25- ld d , 18h ; DE = 6144 + E. Note: 6144 is the screen size (before attr zone)
2624 add hl , de
2725
28- ld de , (SCREEN_ADDR ) ; Adds the screen address
26+ ld de , (SCREEN_ATTR_ADDR ) ; Adds the screen address
2927 add hl , de
30-
3128 ; Return current screen address in HL
3229 ret
3330
@@ -74,9 +71,9 @@ SET_PIXEL_ADDR_ATTR:
7471 rrca
7572 rrca
7673 and 3
77- or 18h
74+
7875 ld h , a
79- ld de , (SCREEN_ADDR )
76+ ld de , (SCREEN_ATTR_ADDR )
8077 add hl , de ;; Final screen addr
8178 jp __SET_ATTR2
8279
0 commit comments