Re: A82: Clearing part of GraphMem
[Prev][Next][Index][Thread]
Re: A82: Clearing part of GraphMem
>Assuming this is meant to be "ld d,h \ ld e,l", then , yes, your code
will
>work. But there is no point in ldir-ing 8 times. Infact, there is no
point
>in ldir-ing at all. You see, each pixel on the graphics screen is
>represented by one _bit_ in GRAPH_MEM. Your code writes zero to the
first
>_byte_ in GRAPH_MEM (on the current line) and then proceeds to write
(hl)
>to (de) when they are exactly the same. There is no point in even using
>de; apart from the "ld (hl),0", that block of code does essentially
>nothing. Eliminating it also means not having to save bc, which gets
rid
>of 2 commands. After this "pruning", you're essentially left with the
code
>Adamman proposed (which _does_ work), except that his version will run
a
>tad faster because it only executes "ld de,12" once, instead of 64
times.
>Also, unless you're call-ing that function, the "ret" command will most
>likely take your calc somewhere it doesn't want to be..
>
>Jwaz
>
Yeah, i meant "ld d,h / ld e,l", I was half-asleep at the time.
Doesn't really matter though cuz Adamman's code works.
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com