01-21-2014, 02:15 AM
This is the Function to calculate Attribute Address in Dual line mode.
In Dual Byte Colour mode it will return ink colour. For Paper you must add 4096.
With this:
You can now make something like cooper bars:
And these are the core routines...
Code:
function CalcAdrDualOffset(x as ubyte,y as ubyte)
dim y1 as uinteger
y1=(y&96)+((y&28)>>2)+((y&3)<<3)
return $6000+x+(y1<<5)
end function
With this:
Code:
sub FillMem(mem as Uinteger,size as Uinteger,byt as Ubyte)
asm
ld h,(ix+5)
ld l,(ix+4)
ld d,h
ld e,l
inc de
ld b,(ix+7)
ld c,(ix+6)
dec bc
ld a,(ix+9)
ld (hl),a
ldir
end asm
end sub
Code:
FillMem(4096+CalcAdrDualOffset(0,13),32,RGBto64Col(1,0,1))
FillMem(4096+CalcAdrDualOffset(0,14),32,RGBto64Col(2,0,2))
FillMem(4096+CalcAdrDualOffset(0,15),32,RGBto64Col(3,0,3))
FillMem(4096+CalcAdrDualOffset(0,16),32,RGBto64Col(2,0,2))
FillMem(4096+CalcAdrDualOffset(0,17),32,RGBto64Col(1,0,1))
And these are the core routines...
------------------------------------------------------------
http://lcd-one.da.ru redirector is dead
Visit my http://members.inode.at/838331/index.html home page!
http://lcd-one.da.ru redirector is dead
Visit my http://members.inode.at/838331/index.html home page!