Re: A82: Clearing part of GraphMem


[Prev][Next][Index][Thread]

Re: A82: Clearing part of GraphMem




>>    How would I clear only part of Graph_mem? I need to clear the 
first 8 
>>  pixels in every line.
>>       Sam
>
>very simple.  just do a 62 count loop that clears the byte pointed to 
by hl
>(which will start out as GRAPH_MEM), and then add 12 to hl
>
>~AdammAN

   I tried to do that and it didn't work. What's wrong with this:

ClearGraph:
 ld b,64          ;do this 64 times 
 ld hl,GRAPH_MEM  ;Copy from GRAPH_MEM
loop:
 push bc          ;save bc
 ld (hl),0        ;Clear the bytes
 ld h,d           ;Save to GRAPH_MEM
 ld l,e           ;Save to GRAPH_MEM
 ld bc,8          ;Copy first 8 pixels of line
 ldir             ;do it
 pop bc           ;restore bc
 ld de,12         ;load 12 to de
 add hl,de        ;add 12 to hl
 djnz loop        ;repeat loop if not b=0 
 ret              ;return

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com


Follow-Ups: