A83: Re: Partial screen draws


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

A83: Re: Partial screen draws




A routine for this wouldnt be all that difficult.  If you look at the .asm
file outputted by pic83 you'll notice that the right part on the .db 's has
mostly 0,0,0's

here is how a routine would work...


; To Use this routine properly you must clip off any 0,0,0's from the .db

ImgCtr = SAVESSCREEN
ROWS = 2		;  number of bytes across /8    If it is a fraction round up...
ie.  9/8 =2

LftImage:
 ld hl,repback		; location to *grab* data from
 ld de,plotsscreen	; start of graphbuffer
 ld bc,ROWS*64	; this is number of times hl needs to be incremented
 ld a,0			; start ImgCtr at 0
 ld (imgctr),a
ImgLoop1:
 ld (de),(hl)		; not sure if its legal... if it isnt then do this:   ld
a,(hl) /  ld (de),a
 inc hl
 inc de
 dec bc
 ld a,c
 AND B
 cp 0
 ret z			; quit if BC=0
 ld a,(ImgCtr)
 inc a
 ld (ImgCtr),a
 cp ROWS
 jr nz,LftImage		; If ImgCtr /= rows goto Lftimage
 push bc
 ld b,12-ROWS		; times it will move around the graph buffer
ImgLoop2:
 inc de
 djnz ImgLoop2
 ld a,0
 ld (ImgCtr),a
 jr ImgLoop1

This should work...
Reply back if it doesnt.
-harper

> From: Jonathan Wang <jwang@isb.bj.edu.cn>
> To: assembly-83@lists.ticalc.org
> Subject: A83: Partial screen draws
> Date: Sunday, January 11, 1998 6:14 AM
> 
> 
> Okay, I know that I can draw a picture to the screen by doing:
> 
>  ld hl,repback
>  ld de,plotsscreen
>  ld bc,768
>  ldir
>  call _grbufcpy_v
> 
> where repback is the name of an asm picture converted by pic83.  My 
> question is, what does each line do?
> 
> Also, can I just draw part of the screen.  For example, say I have a 
> screen like this:
> 
> |------------------------------------------------------|
> |             |                                        |
> |             |                                        |
> |             |                                        |
> |             |                                        |
> ...
> 
> and the left side is a toolbar, and the right side is the main 
> screen.  Can I just draw parts of the screen so that the toolbar 
> stays the same, while the main screen is updated?  It is kind of 
> wasteful to redraw the entire screen when I only need to update small 
> portions.
> 
> 
> 
> Jonathan Wang
> jwang@isb.bj.edu.cn
> jonathan_wang@hotmail.com
> 
> Come visit my home page:
> http://www.htmlinfo.home.ml.org/
> 
> Quote of the day:
> 
>      Virtue has never been as respectable as money.
>                                 - Mark Twain