@@ -43,7 +43,6 @@ sub fastcall WinScrollRight(row as uByte, col as uByte, width as Ubyte, height a
4343 push bc
4444 ld a,b
4545 and 18 h
46- or 40 h
4746 ld h,a
4847 ld a,b
4948 and 07 h
@@ -56,6 +55,8 @@ sub fastcall WinScrollRight(row as uByte, col as uByte, width as Ubyte, height a
5655 add a,d
5756 dec a
5857 ld l,a ;HL=top-left window address in bitmap coord
58+ ld bc, (SCREEN_ADDR)
59+ add hl, bc
5960 ld b,e
6061
6162BucleChars:
@@ -100,8 +101,9 @@ BucleScans:
100101 dec a
101102 ld l,a
102103 ld a,h
103- add a, 58 h
104104 ld h,a ;HL=top-left window address in attr coord
105+ ld bc, (SCREEN_ATTR_ADDR)
106+ add hl, bc
105107 ld b,e
106108
107109BucleAttrs:
@@ -155,7 +157,6 @@ sub fastcall WinScrollLeft(row as uByte, col as uByte, width as Ubyte, height as
155157 push bc
156158 ld a,b
157159 and 18 h
158- or 40 h
159160 ld h,a
160161 ld a,b
161162 and 07 h
@@ -166,6 +167,8 @@ sub fastcall WinScrollLeft(row as uByte, col as uByte, width as Ubyte, height as
166167 add a,a
167168 add a,c
168169 ld l,a ;HL=top-left window address in bitmap coord
170+ ld bc, (SCREEN_ADDR)
171+ add hl, bc
169172 ld b,e
170173
171174BucleChars:
@@ -209,8 +212,9 @@ BucleScans:
209212 add a,c
210213 ld l,a
211214 ld a,h
212- add a, 58 h
213215 ld h,a ;HL=top-left address in attr coords
216+ ld bc, (SCREEN_ATTR_ADDR)
217+ add hl, bc
214218 ld b,e
215219
216220BucleAttrs:
@@ -266,7 +270,6 @@ sub fastcall WinScrollUp(row as uByte, col as uByte, width as Ubyte, height as U
266270
267271 ld a,b
268272 and 18 h
269- or 40 h
270273 ld h,a
271274 ld a,b
272275 and 07 h
@@ -277,6 +280,8 @@ sub fastcall WinScrollUp(row as uByte, col as uByte, width as Ubyte, height as U
277280 add a,a
278281 add a,c
279282 ld l,a ;HL=top-left window address in bitmap coord
283+ ld bc, (SCREEN_ADDR)
284+ add hl, bc
280285 ld a,e
281286 ld c, d ; c = width
282287 ld d, h
@@ -351,8 +356,9 @@ ScrollAttrs:
351356 add a,c
352357 ld l,a
353358 ld a,h
354- add a, 58 h
355359 ld h,a ;HL=top-left address in attr coords
360+ ld bc, (SCREEN_ATTR_ADDR)
361+ add hl, bc
356362 ld b,e
357363 dec b
358364 ret z
@@ -414,7 +420,6 @@ sub fastcall WinScrollDown(row as uByte, col as uByte, width as Ubyte, height as
414420
415421 ld a,b
416422 and 18 h
417- or 40 h
418423 ld h,a
419424 ld a,b
420425 and 07 h
@@ -425,6 +430,8 @@ sub fastcall WinScrollDown(row as uByte, col as uByte, width as Ubyte, height as
425430 add a,a
426431 add a,c
427432 ld l,a ;HL=bottom-left window address in bitmap coord
433+ ld bc, (SCREEN_ADDR)
434+ add hl, bc
428435 ld a,e
429436 ld c, d ; c = width
430437 ld d, h
@@ -499,8 +506,9 @@ ScrollAttrs:
499506 add a,c
500507 ld l,a
501508 ld a,h
502- add a, 58 h
503509 ld h,a ;HL=top-left address in attr coords
510+ ld bc, (SCREEN_ATTR_ADDR)
511+ add hl, bc
504512 ld b,e
505513 dec b
506514 ret z
@@ -533,6 +541,7 @@ REM the following is required, because it defines screen start addr
533541#require "cls.asm"
534542#require "SP/PixelDown.asm"
535543#require "SP/PixelUp.asm"
544+ #require "sysvars.asm"
536545
537546
538- # endif
547+ # endif
0 commit comments