A86: Re: Re: Re: Re: BG v1.0 grayscale converter is out !
[Prev][Next][Index][Thread]
A86: Re: Re: Re: Re: BG v1.0 grayscale converter is out !
<matt2000@gte.net> wrote:
>
>>I use a 3 dimensional array that handle the
>>layers. it could easely be extended to output
>>any number of layers (bits) At the moment it
>>is 3 but it could be 4,5,6.... resulting in any
>>number of colors from 2 to as many as your
>>routine can handle.
>
>
>Yeah 16 would be about the limit maybe too much, may flicker a lot too (as
>much as the old 8 level routine I hope) I would have to highly optimize it
>using IM 2 and it would require a whole 3 * 1024 = 3072 bytes of free
memory
>plus the 1024 bytes in the display area.
>
>Call me obssessed, but I had a dream that Kirk Meyer wrote some 3d game
that
>screwed with the LCD and caused it to have
>the shades of gray be "shades of purple" instead. Then I work up (5:22
A.M.)
>and now I am checking my mail.. Why?
>
>;-)
>
>Later,
> Matt
>
First of i'd like to say that i have never subscribed to
a mailing list before so if my replys or postings seem
wierd just let me know... :-)
About BG:
My method is maybe a bit primitive, i paste 3
layers 1024 * 3 to the end of my 184 byte loader
and then shift betwen them using port(0). The
loader is an obj named bg3.hdr in the bg10.zip
archive.
Port 0 (screen offset) accepts a value n
from 0-63. screen offset is then:
100h*(0C0h+n)
_asm_exec_ram is at 0D748h. The first
valid screen offset after that is at
100h*(0C0h+18h) = _asm_exec_ram+0B8h
= 0D800h, thus the loader must be at least
0B8h (184d) bytes long.
The first layer starts at memory offset:
0D748h+0B8h=0D800h
The next at :
0D748h+0B8h+400h=0DC00h
and so on...
I output (0D800h / 100h)-0C0h = 18h (24d)
and (0DC00h / 100h)-0C0h = 1Ch (28d)
and (0E000h / 100h)-0C0h = 20h (32d)
to port(0) in order to display a 3 bit grayscale
image.
If you need a bigger loader you would add
256 to the current loader size (now 184) and
increase each port(0) output value with 1.
I think you already know all this but i wanted
to clarify how much i knew..
Any loader that is to be used with the current
version BG must have the string 'BG3' in the
last 3 bytes. An idea for the next version is to
have the name of the loader as a command
line parameter, and the number in 'BG3' to
indicate the number of layers it uses i.e.
(BG3 = 3 layers, BG4 = 4...) That way BG
could automaticly create the appropriate
data for your loader.
My knowledge of z80 asm is limited but i
have programmed 80x86 asm before so
i think i have the basics.
Later,
Thomas ;-)