A83: Re: Buffer Draw Routines... (As seen on Dim-TI TCPA)
[Prev][Next][Index][Thread]
A83: Re: Buffer Draw Routines... (As seen on Dim-TI TCPA)
Look at Olle's sprite routine...I think its even smaller isn't it?
Later,
James.
==========================================
E-mail matthews@tkb.att.ne.jp ICQ: 7413754
http://home.att.ne.jp/gold/tomcat21/index.html
http://hyperion.advanced.org/18242/
==========================================
-----Original Message-----
From: Scott Dial <homosapian@geocities.com>
To: ASM83 <assembly-83@lists.ticalc.org>
Date: Tuesday, February 23, 1999 11:14 AM
Subject: A83: Buffer Draw Routines... (As seen on Dim-TI TCPA)
>
>I think that are great but the PIXEL routine which is the basis for most
>of the routines is extremely unoptimized... I made it much quicker and
>smaller (I believe someone mention this before on the list) So I made
>the following:
>
>;-----------------------------------------------------------------------;
>; Pixel Plotting Routine - By Jason Kovacs, with ZLIB's GetPix Routine.
>;
>; Revision by Scott Dial
>;
>; All clock times are + GETPIX
>;
>; Original - 44 Bytes
>;
>; White - 182 Clocks ;
>; Black - 175 Clocks ;
>; Xor - 172 Clocks ;
>; Revision - 36 Bytes
>;
>; White - 136 Clocks ;
>; Black - 143 Clocks
>;
>; Xor - 126 Clocks
>;
>; This increase in speed and shorting in size makes almost every other
>;
>; routine increase in speed and shorten in size.
>;
>;-----------------------------------------------------------------------;
>; Input: D = X, E = Y, C = Pixel Color (0-Clear, 1-Plot, 2-XOR Pixel).
>;
>; Output: Pixel is Plotted to Graph Buffer according to Command in 'C'.
>;
>;-----------------------------------------------------------------------;
>
>PIXEL:
> push bc ; [11] Save Loop Value and Color
> push de ; [11] Save the Coordinates
> push hl ; [11] Save these Values
> ld a, c ; [ 4] Load this to check which Color
> or a ; [ 4] CP 0
> jr z, PIXEL_WHITE ; [12/7] Execute PIXEL_WHITE if C=0
> dec a ; [ 4] CP 1
> jr z, PIXEL_BLACK ; [12/7] Execute PIXEL_BLACK if C=1
> ld a, d ; [ 4] 'a' now has X Coordinate
> call GETPIX ; [17] Call the Pixel Routine from ZLIB
> xor (hl) ; [ 7] 'XOR' to Toggle the Pixel
>PIXEL_RET:
> ld (hl), a ; [ 7] Write the new byte to Graph
>Buffer
> pop de ; [11] Retrieve the Coords for Other
>Routines
> pop bc ; [11] Retrieve the Loop Value and Color
> ret ; [10] Return
>
>PIXEL_WHITE:
> ld a, d ; [ 4] 'a' now has X Coordinate
> call GETPIX ; [17] Call the Pixel Routine from ZLIB
> CPL ; [ 4] Compliment 'a' for the correct
>Bit Mask
> and (hl) ; [ 7] 'AND' to Clear the Pixel
> jr PIXEL_RET ; [12]
>PIXEL_BLACK:
> ld a, d ; [ 4] 'a' now has X Coordinate
> call GETPIX ; [17] Call the Pixel Routine from ZLIB
> or (hl) ; [ 7] 'OR' to Plot the Pixel
> jr PIXEL_RET ; [12]
>
>--
>Scott "_Wrath_" Dial
>homosapian@geocities.com
>ICQ#3608935
>http://www.geocities.com/~homosapian/
>
>
Follow-Ups: