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
@@ -41,12 +38,13 @@ SET_ATTR:
4138 call __IN_SCREEN
4239 ret nc
4340
41+ call __ATTR_ADDR
42+
4443__SET_ATTR:
4544 ; Internal __FASTCALL__ Entry used by printing routines
45+ ; HL contains the address of the ATTR cell to set
4646 PROC
4747
48- call __ATTR_ADDR
49-
5048__SET_ATTR2: ; Sets attr from ATTR_T to (HL) which points to the scr address
5149 ld de , (ATTR_T) ; E = ATTR_T, D = MASK_T
5250
@@ -64,20 +62,4 @@ __SET_ATTR2: ; Sets attr from ATTR_T to (HL) which points to the scr address
6462
6563 ENDP
6664
67-
68- ; Sets the attribute at a given screen pixel address in hl
69- ; HL contains the address in RAM for a given pixel (not a coordinate)
70- SET_PIXEL_ADDR_ATTR:
71- ;; gets ATTR position with offset given in SCREEN_ADDR
72- ld a , h
73- rrca
74- rrca
75- rrca
76- and 3
77- or 18h
78- ld h , a
79- ld de , (SCREEN_ADDR)
80- add hl , de ;; Final screen addr
81- jp __SET_ATTR2
82-
8365 pop namespace
0 commit comments