Need more...
ZXNet echo conference «code.zx»
From Alexander Bondarenko → To All 3 June 2003
*Hello, All!*
Procedures required:
1. Calculate the screen address based on pixel coordinates.
2. Calculation of the address in the attributes based on the screen address.
/That’s all, All, you can scroll further.../
From Evgeny Goljakov → To Alexander Bondarenko 5 June 2003
Hello Alexander.
Tue 3 Jun 02 Alexander Bondarenko -> All:
Uwaaah!
AB> 1. Calculation of the screen address based on pixel coordinates.
AB> 2. Calculation of the address in attributes based on the screen
AB> addresses.
If there are no restrictions, then write that way ;)))
I can advise you to paint a sign with the addresses of all points on the screen
and search in it.
11 ADD HL,SP //start. signs + (pixel number*2)
10 POP rr
--
21 measures
Thank you for your attention.
From Kirill Frolov → To Alexander Bondarenko 10 June 2003
On Tue, 03 Jun 2003 22:39:00 +0400, Alexander Bondarenko wrote:
AB> 1. Calculation of the screen address based on pixel coordinates.
AB> 2. Calculation of the address in attributes based on the screen address.
Bitmap address on screen, 16-bit word, bits (most significant on the left):
B1 B0 e0 L4 L3 y2 y1 y0 L2 L1 L0 C4 C3 C2 C1 C0
Screen color address:
B1 B0 0 1 1 0 L4 L3 L2 L1 L0 C4 C3 C2 C1 C0
B0,1 = bank 5 or 7 (low two bits)
e0 = odd familiarity in 512x192 mode, otherwise 0.
L4,3,2,1,0 = familiarity along the Y coordinate (0..23)
y2,1,0 = pixel at Y coordinate (0..7)
C4,3,2,1,0 = familiarity along the X coordinate (0..31)
the origin point is in the upper left corner of the screen,
Y coordinate is vertical, X is horizontal axis.
Now for your questions:
P.1
(y>>3)&0x18|bank|(y&7)|((y<<5)&0xe0)|((x>>3)&0x1f)
depending on bank number
and registers used is possible
optimization of the assembler program...
P.2
(address>>3)&7|0x18|bank
depending on bank number
and registers used is possible
optimization of the assembler program...
--
[ZX]