 |
WH LIB
1.0
|
|
|
Actually two- in-one!
- WHgraphics (wh_circle, wh_ellipse)
These were added to the rexdk
library by Daniel Schmidt & renamed DsCircle & DsEllipse.
(This library was replaced by an assembly version - see WH GraphLib2 below.)
-WHtrans (wh_sin, wh_cos, wh_tan,
wh_atan & wh_tanh2)
I couldn't get the original Z88DK
transcendental functions to work & I wanted them for the "Muslim Qibla"
AddIn so I wrote them!
I think it's my mistake - I maybe missing something! (Yes & no - some realy
had bugs that I fixed later)
Anyway, I had the functions from a PIC project & with minor modifications they will work.
The original algorithm is from the web somewhere, by Glen M. Davis
(Later I fixed Z88DK
transcendental functions & dropped using this library.)

|
 |
WH
GraphLib 2.1
|
|
This is an incomplete graphic library
all in assembly! I don't have time to complete it :(
These routine are much faster also lighter than my old C routines
(even the partial asm ellipse!)

Module : Graphics routines - ASM version
(incomplete!)
Version : 2.0
Author : Waleed Hasan
Date : January 15th, 2002
(Released February 19th, 2002)
The working routines are:
WH_pix_addr:
returns the memory address of (x,y) - also 3rd argument will
hold the bit number in the byte (count from LSB.)
WH_set_pix :
This a direct write to the LCD memory. I think this is much faster
than using the REX.
WH_circle :
It's a direct ASM translation of my previous circle C function used
in REXDK library.
WH_Ellipse :
This is not full ASM but modefied C to save some bytes by
elemenating Set4Pixels & re-using part of the circle code. It's
faster & smaller!
WH_clrscr :
It's smaller than calling DsClearScreen (it's actually a call to
DisplayBlockClear) and I think it's faster!
DsClearScreen costs 0 byte per AddIn but costs 27 bytes for every
DsClearScreen call!
WH_clrscr costs 13 bytes per program & 3 bytes per call!
So a single call to WH_clrscr saves 11 bytes and each additional call
saves 24 bytes! :)
WH_fillscr :
Same as above but has a fill pattern parameter. This routine costs
18 bytes per program & only
8 bytes per call! so even a single call to WH_clrscr saves 1 byte over
DisplayBlockClear :)
|
I Wanted to write the following
routines but no time :(
- Have the routines handle XOR pixels &
- A full ASM ellipse.
- Box.
- Multi-point polygon.
- Beziers curves.
- Curve-fit to point array.
- Fill area (given a seed point.)
- Filled circle, ellipse, Box & polygon
- Sprite routines:
. Store display block
. Restore display block.
. Super-impose sprite block (sprite block pixel types are: White, Black
& transparent) |
I Wanted to write the following
routines but no time :(
- Have the routines handle XOR pixels &
- A full ASM ellipse.
- Box.
- Multi-point polygon.
- Beziers curves.
- Curve-fit to point array.
- Fill area (given a seed point.)
- Filled circle, ellipse, Box & polygon
- Sprite routines:
. Store display block
. Restore display block.
. Super-impose sprite block (sprite block pixel types are: White, Black
& transparent) |
| I got 2 nice feedbacks after
releasing version 2.0 so I added these functions.
* Version : 2.1
* Released February 22nd, 2002
The new functions are:
WH_get_pix :
Get pixel value, returns 0/1 (read the comment in the function code)
WH_reset_pix :
Resets the pixel.
WH_inv_pix :
Inverts the pixel.
|
| |
| |