

	myLCD
v0.20.3 build 14052006

An LCD framebuffer library
   Michael McElligott
okio@users.sourceforge.net

---

0.20.3 14'th May 2006


Exported functions added:
(view mylcd.h for details)
void lHTMLCharRefEnable();
void lHTMLCharRefDisable();
void *lFontIDToFont (int fontid);
int lSetFontLineSpacing (int fontid, int pixels);
int lGetFontLineSpacing (int fontid);
int lFlipFrame (TFRAME *src_in, TFRAME *des_in, int ff_flag); // destination frame size must equal source size

Implemented Tab (0x09) character handling, use the lTabSpaceWidth define (mylcd.h) to set number
of replacement characters per tab and lTabSpaceChar to select the replacement character.
Print flag PF_HTMLCHARREF removed, use lHTMLCharRefEnable()/Disable() in place.

Text metrics API now accepts print control flags (PF_).
Examples makefile for the PSP modified to link libmylcd.a instead of liblcd.a.
lGetTextMetricsList() now accepts TLPRINTR structs in place of width and height variables.
Minumum and maximum rendering coordinates are now placed in to bx1 through to by2

Added examples:
  filerender.c - an example of rendering text files
  bdfdump.c - converts .bdf font to bitmap
  supports.c - displays [un]supported features
  plasma.c - small benchmark demo 
  mystify.c - screensaver type demo donated by Hung Ki Chan.
  ray.c. - small 3d raycaster demo

Added preliminary unicode character combining support.
Added TIS620 (Thai) encoding support, use CMT_TIS620.
Added JISX0213 (Japanese) encoding support, use CMT_JISX0213.
Added adjustable line space per line wrap on a per font basis. Use mylcd.h define 'lLineSpaceHeight'
to set default value at compile time, lSetFontLineSpacing() and lGetFontLineSpacing() at runtime.
Added a catch [all] for required BDF fields which are either missing or incomplete.

Added a display driver for the SED1565 LCD controller, which as of 08/05/2006 is untested.
Added a display driver for the PCD8544 LCD controller. PCD8544 controllers are found in Nokia 3310,
3210, 8210, 8250, 5210, 6210, 5110 and many others. Driver has been tested with an 8210, 3310, and a 5210.
Note: 5210 displays are addressed 'right to left' as opposed to 'left to right' of the 8210 and co.
CAP flag 'CAP_PCD8544_FLIPH' should be used when dealing with 5210's

Windows makefile has been reorganized, building myLCD now requires two targets to be specified at compile time;
the port driver and display driver. ie, 'make -f makefile.win portdriver displaydriver'
eg; 'make -f makefile.win winio pcd8544 install'

Implemented a proof of concept event driven GUI API (mylcd/src/gui/). UI is disabled by default but can be
enabled via mylcd.h.
GUI Example text.c and mouseserver.c added to mylcd/examples/window/

Default pixel bit depth has been reduced from 8bits wide to 1bit, core pixel manipulation routines have been moved
from 'pixel.c' to 'pixel.h' to further take advantage of 'static inline', resulting is imporved ;render to buffer 'time


Added a standalone driver for the VLCM12864, acquired in a hong Kong hardware store.
The VLCM12864 a 128x64 KS0108 display with a serially controlled MPU (8051) piggedbacked.
Check 'mylcd/examples/vlcm/' for details.

..various bug fixes here and there.

---

0.20.0	6'th of March 2006


Added makefiles and a display driver for the Sony PlayStation Portable (PSP)

Exported functions added:
(view mylcd.h for details)
int lCountCharacters (ubyte *str);
int lCreateCharacterList (ubyte *str, unsigned int *glist, int total);
int lStripCharacterList (unsigned int *glist, int gtotal, TWFONT *font);
int lCacheCharacterRange (unsigned int min, unsigned int max, int fontid);
int lCacheCharacterList (unsigned int *glist, int gtotal, int fontid);
int lCacheCharacterBuffer (unsigned int *glist, int gtotal, int fontid);
int lCacheCharacters (ubyte *str, int fontid);
int lCacheCharactersAll (int fontid);
int lGetTextMetricsList (unsigned int *glist, int first, int last, int fontid, int *width, int *height);
int lPrintList (TFRAME *frm, unsigned int *glist, int first, int total, TLPRINTR *rect, int font, int flags, int style);
int lDecodeChararacterCode (ubyte *str, unsigned int *chrout);
int lDecodeCharacterBuffer (ubyte *str, unsigned int *glist, int total);
int lSetFontCharacterSpacing (int pixels, int fontid);
int lGetFontCharacterSpacing (int fontid);
int lSetCapabilities (THWD *hw, unsigned int flag, int value);
int lGetCapabilities (THWD *hw, unsigned int flag);
int lGetImageBoundingBox (TFRAME *frame, TLPOINTEX *p);
int lDrawMask (TFRAME *src, TFRAME *mask, TFRAME *des, int maskXOffset, int maskYOffset, int lmask_mode);
unsigned int lConvertFrameTo1BPP (TFRAME *frame, void *des);
unsigned int lConvertFrameTo8BPP (TFRAME *frame, void *des, const ubyte clrLow, const ubyte clrHigh);
unsigned int lConvertFrameToRGB4444 (TFRAME *frame, void *des, const int clrLow, const int clrHigh);
unsigned int lConvertFrameToRGB555 (TFRAME *frame, void *des, const int clrLow, const int clrHigh);
unsigned int lConvertFrameToRGB565 (TFRAME *frame, void *des, const int clrLow, const int clrHigh);
unsigned int lConvertFrameToRGB888 (TFRAME *frame, void *des, const int clrLow, const int clrHigh);
unsigned int lConvertFrameToRGB8888 (TFRAME *frame, void *des, const int clrLow, const int clrHigh);

Wide character renderer completely rewritten;
 1) To removed the requirement for fonts to be built in their full, reducing memory overhead
 2) To fix the problem whereby input strings needed to be decoded on each pass.
 3) To allow greater control over the rendering process.

Instead input strings are decoded once on entry, only requested glyphs are loaded and built, unsupported code points marked.
Decoded buffer is then used throughout the rendering pipeline with the end result of decreased rendering time.


struct 'TLCD' renamed to 'TFRAME'
Added PNG image suppport, use flag 'IMG_PNG'.
Added GB18030 character support
Added BDF fonts: b10.bdf, screen8x16.bdf, proof9x16.bdf, koinil2.bdf, koi9x18.bdf,
      koi7x14.bdf, koi5x8.bdf, koi12x24b.bdf and koi10x20.bdf
Linked library renamed from 'lcddll.dll' to 'mylcd.dll'
Included header renamed  from 'lcd.h' to 'mylcd.h'

... and many more optimizations and code tidying too numerous to mention.
      
Example files added: big5.c, masks.c and glyphs.c


---

0.19.7	18'th of December 2005

Unicode-UTF8 implementation mostly completed, refer to new example unicode.c for more details.
Use 'lSetCharacterEncoding(CMT_UTF8)' (renamed from lSetCharacterMap) to select UTF8 encoding, CMT_ASCII/CMT_NONE - none,
CMT_BIG5 & CMT_BG2312 for double byte character encoding (wide char) or register another map with 'lRegisterCharacterMap()'.
Added 'lGetCharacterEncoding()'.
Added 'unregisterFrameGroup()' to frame.h
Modified in 'frame.h' the frame handling interface to allow [registered] frames to be categorized in to groups. The purpose
of this is to aid the selection of all frames relating to a particular task or handle. The beneficial feature of this is to
allow each font, when built, to group its characters (which are themselves frames) via a common id. This allows myLCD to
quickly delete all frames via the common ID as opposed to searching the list container on a per frame basis.
As a few of the BDF fonts contain over 30,000 characters this has resulted in a large performance increase.
Wide character printing (BDF LFTW_) now defaults to the specified default character of the font in place of
unsupported characters. Use flag 'PF_NODEFAULTCHAR' to disable.
Text is rendered left To right by default. right to left is not planned, top to bottom is planned.

PF_DRAWTEXT flag removed, text is now rendered by default, use PF_DONTRENDER to disable rendering.
Other lPrintEX flags added are:
PF_NODEFAULTCHAR	don't use font-defined default char inplace of a missing char (BDF wide char only)
PF_FIXEDWIDTH		set fixed width printing
PF_USELASTX		use x end point as next start point
PF_NEWLINE		use y end point as next start point (an alias for PF_USELASTY)
PF_USELASTXY		PF_USELASTX|PF_NEWLINE
PF_RESETX		[re]set x start point to bx1 bounding point
PF_RESETY		[re]set y start point to by1 bounding point
PF_RESETXY		PF_RESETX|PF_RESETY
PF_LEFTJUSTIFY		text is left justified by default
PF_MIDDLEJUSTIFY	middle justify text
PF_RIGHTJUSTIFY		right justify text. Justifing is still work in progress.
PF_HTMLCHARREF		enable HTML character and entity references, eg; "&#36215;", "&Epsilon;", etc..
PF_DISABLEAUTOWIDTH	disables wide character (bdf) auto width calculation, is overriden by 'PF_FIXEDWIDTH'
PF_GLYPHBOUNDINGBOX	enclose each glyph within a rectangle, is not overridden by 'PF_DONTRENDER'
PF_TEXTBOUNDINGBOX	as above but draws a rectangle around text area.
PF_INVERTTEXTRECT	invert text rectangle area.

Added lstring.c/h. (Intent is to wrap all system calls to aid portability.)
Updated ks0108.c, unrolled a few loops to improve performance.
KS0108 driver now contains a 'back buffer' to enable quad based LCD updates, increasing data throughput efficiency of LPT port.
Use 'lSetCapabilities(CAP_BACKBUFFER)' to enable and 'lSetCapabilities(~CAP_BACKBUFFER)' to disable.
Updated utf.c
Added hex2bdf.c to convert from the hex (encoding:xf45..) encoded font format to bdf.
Added a Makefile (currently MS Windwows only) for the example programs, batch files moved to the examples/misc directory
Makefile usage: 'make example.exe', 'make all' 'make clean'
Added a null display and port driver. Use as a template.
Added image and text rotation to lcmd. set rotation via '--rot 90'. Must be reset for next non rotated operation.
Added complete HTML character and entity reference capability to the wide character print renderer. Use 'PF_HTMLCHARREF' to enable.
Added lMergeWFont (font1,font2). Merge font2 on to font1, font1 has glyph priority.
Various bug fixes and general code updates
Added a myLCD XBLite header (http://perso.wanadoo.fr/xblite/) and example 'xbtest.x' to /src/xb/
A few specific XBlite functions will be introduced to enable specific support for this excellent compiler.
kbhit.c/h removed from the core of myLCD. kbhit.c now forms part of the examples header - demos.h
Added fonts: ComicSans20.bdf, snap.bdf, Rought18.bdf, B24.bdf (nice CJK font) and B14.bdf (nice Unicode font).
Repositioned the period glypth in many of the BDF fonts left from 1 to 3 pixels.
Print renderer now auto calculates glyph width of fixed width BDF fonts, use 'PF_DISABLEAUTOWIDTH' to disable.
Extended Print interface (lPrintEx) modified to accept formatted text.
Added 'TLCD *lNewString (THWD *hw, int font, ubyte *formatstring, ...)'.
lNewString creates and returns a frame containing rendered string with the strings dimensions.
lGetFontMetrics() now also returns ascent and descent fields.
Added 'lCloneFrame()'. As the name sugguests, Returns an exact copy of frame.
Added 'lSetCapabilities()' and 'lGetCapabilities()'. Allows hardware capabilites to be specified.
Currently the only supported hardware dependant capability is software side backbuffering of KS0108 displays.
Added 'lGetMinPixelRect ()'. Returns a best fit rectangle of frame data.
'cmap.c' updated to allow code points above 0xFFFF.
Added 'lDrawMask(TLCD *src, TLCD *mask, TLCD *dest, int maskXoffset, maskYoffset, int mode)'
lDrawMask() combines 'dest' frame with 'src' and 'mask'. Use flags LMASK_OR/XOR/AND/CPYSRC/CPYMASK/CLEAR.
Added 'lGetGlyph (ubyte *c, int ch, int fontid)'. Returns BDF glyph (TWCHAR*) pointed to by either string 'c' or code point 'ch'

---
0.19.5  20'th of November 2005

Added utf.c to aid conversion between UTF8 and wide charactor(16bit), still work in progress.
PGM write support added, savePGM() added to pgm.c/h.
Added full support for BMP bit depths of 1,4,8,16,24 & 32bpp. RLE is unsupported, use TGA if you require compression.
TGA supports both read and write RLE compression.
Created and added l_memset(), l_memcpy(), l_malloc(), l_calloc(), l_free() & l_realloc() to memory.c/h
Due to the above several memory leaks were discovered and resolved.
Added lFlushFont(). see tga/bdftest.c for usage.
Added several BDF and 3 TGA fonts. Total fonts included with the myLCD base package now stands at 60 BDF and 67 TGA.
lGetWTextMetrics() now returns the correct width and height.
XMMs and Winamp plugins have been updated to include another bar graph style.
General code tidying here and there.
lGetWCharMetrics(), lGetWTextMetrics(), lGetWFontMetrics(), lWPrint() & lWPrintf() have been removed with the functionality
being encompassed in to the non 'W' counterpart.
Added example lcmd.c - a command line myLCD parser.
'texttest.c' renamed to tgatest.c
Added example bdftest.c
Added version defines 'myLCDVERSIONmj' and 'myLCDVERSIONmi' to lcd.h, major and minor.
Created and added l_fopen(), l_fclose(), l_fread(). l_fwrite(), l_flush(), l_fseek(), l_ftell(), l_lof(), l_rewind(), l_fgetpos()
and l_fsetpos() to fileio.c/h.
Added 'lPrintEx (TLCD *frame, ubyte *txt, TLPOINTEX *rect, int id, int flags, int style)', an extended version of lPrint().
lPrintEx() allows text to be printed and clipped within a rectangular area, x1 & y1 of TLPOINTEX return the last (bottom right) +1
pixel position rendered.
lPrintEx() flags are:
PF_DRAWTEXT - sets whether funciton will actually render anything
PF_CLIPDRAW - clips rendering to the rect
PF_CLIPTEXTH/V - sets whether function will draw part of the last/bottom character(s) if it overlaps the rect boundary,
ie; only render glyph if there is room. PF_CLIPDRAW must be set.
PF_CLIPWRAP - wrap text around frame. This auto sets PF_CLIPDRAW.
PF_NOESCAPE - disables '\n' line break escaping.
Corrected glyphs 'B' and '/' in dragonfly.tga
Updated example winamp.c to allow selectable character maps.
Print rendering now autodetects and handles '\n' as escape characters.
Whichever print function was called will return with the byteoffset in to the string at whichever point rendering ended.
Example file 'simple.c' updated to use lPrintEx().
Removed flag '-march=pentium-mmx' from Makefile.linux

---
0.19.3  28'th October 2005

fixed the seg fault linux users were experiencing while using the SDL display driver.
rewrote the bdf font and charactor map loading routines.
XMMS plugin added.
library source and media directories reorganized
make targets 'clean' and 'install' added

'lSetFontPath()' and 'lGetFontPath' added.
Use lSetFontPath() to set the location of the font directories before calling lOpen();
eg: lSetFontPath("/usr/share/mylcd/fonts/"), then when required myLCD should expect to find
bdf in location "/usr/share/mylcd/fonts/bdf/"
Font path defaults to "fonts/".

default paths are:-
Win32:
"../fonts/"
"../mappings/"
Linux:
"/usr/share/mylcd/fonts/"
"/usr/share/mylcd/mappings/"
use 'make -f Makefile.linux install' to install library and fonts&mappings.

---
0.19.2	17'th October 2005


serial port driver added (win32 only)

rewrote the image file load/save interface - removed lLoadXXX(), lSaveASXXX() and lSaveFrame()
image.c/h added
lLoadImage() and lSaveImage() added
pgm.c/h added
added .PGM image load support (raw P5)
eg:
  lLoadImage (frame, "test.pgm", IMG_PGM, LSP_XOR);
  lSaveImage (frame, "test.tga", IMG_TGA, width, height);
lSaveImage will scale frame to 'width' and 'height'
  

device.c/h added
modified the library initiation sequence.
use lOpen() to open a handle to the hardware then lNewFrame() thereafter to acquire a surface (a frame)
eg:
  THWD *hw = lOpen(lcdWidth,lcdHeight,1,0x378);
  TLCD *frame = lNewFrame(hw,frameWidth,frameheight);
  lDeleteFrame(frame);
  lClose(hw);
view demos for more details


implemented error checking, mostly completed.
error.c/h added
error handling functions added: lGetLastErrorInt(), lGetLastErrorStr(), lErrorToString().
eg:
  printf ("%i %s %s\n",lGetLastErrorInt(),lGetLastErrorStr(),lErrorToString(lGetLastErrorInt()));


GTK virtual display for win32/linux in progress

added the 'misc' directory to house those files which don't really belong anywhere else
added a few DevC++ project files


Scroll interface rewritten & reimplemented
eg:
  TLSCROLLEX *s = lNewScroll (TLCD *src, TLCD *dest);
  s->dir = SCR_LEFT; // set direction
  s->desRect->x1 = 10;
  s->desRect->y1 = 10;         // set destination rectangle
  s->desRect->x2 = 120;
  s->desRect->y2 = s->desRect->y1+height; (top down)
  lUpdateScroll(s); // scroll left by one pixel width
  lDeleteScroll(s);

setmem() added to utils
lRefreshAreaTo() removed
lRefreshArea2() renamed to lRefreshAreaB()

... and lots of other code modifications and tidying too numerous to mention

------
0.19	6'th October 2005

The 'WinIo.dll' dll source (from www.internal.com) has been amalgamated in to what was the myLCD winio driver code.
This means myLCD may be built with the winio driver but with one less external .DLL (winio.dll) requirement,
thus requiring 'winio.sys' only. WinNT/2K/XP only.
In font 'comicsansms7x8.tga': glyphs '/' and '%' have been slightly modified to improve clarity.
It's nolonger possible to open the library more than once without first closing.
sysinfo.c and progressbar.c examples added and Kneego's clock updated to include a few system stats.
lWritePort16/32() completed and updated throughout the various drivers.
mem leak fixed - Delete_Scroll() was incorrectly freeing the scroll frame and struct.
atexit(_exit_)/_exit_() added to catch improper shutdowns.
At shutdown myLCD should now automatically free all unfreed frames.
misc.c/h created
functions moved from lcd.c to misc.c:
	lResizeFrame(), lSleep(), lVersion() & lSaveFrame()
frame.c/h created
functions moved from lcd.c to frame.c:
	lClearFrame(), lNewFrame(), lDeleteFrame()
internal functions added to frame.c:
	unregisterFrame(), unregisterAllFrames(), initFrameList()
	freeFrame(), countFrames(), getFreeFrameSlot()
error.c/h created
template.c added
'build' directory and contents removed.
Various minor fixes here and there.
DevC++ build files removed, will return later.
API reference documents begun, should appear in next release
	
------
0.18.6	28'th September 2005

Makefiles for Win32 and Linux added
Linux make targets are: linuxstatic and tinysdlstatic
win32 make targets are:
	winiodll	make WinIO lcddll.dll
	winiostatic	make WinIO liblcd.a static library
	oppdll		OpenParPort lcddll.dll
	oppstatic	OpenParPort liblcd.a
	dlpdll		DLPortIO lcddll.dll
	dlpstatic	DLPortIO liblcd.a
	tinyptcdll	TinyPTC lcddll.dll
	tinyptcstatic	TinyPTC liblcd.a
	tinysdldll	TinySDL lcddll.dll
	tinysdlstatic	TinySDL liblcd.a
	all		make default target, currently winiodll
	clean		removes all objects and targetfiles

compiling.txt updated
compiler flag -Wall added and flag -O3 replaced with -O2.
ks0108.c/h files moved to ks0108/
pdriver.h created
declarations for 'lSleep (),lOpenDisplay(), lCloseDisplay(), SetPortAddress (), GetPortAddress ()' moved to lcd.h
declarations for 'lLoadDriver(), lCloseDriver(), lOpenDriver(), lUnloadDriver(), lIsDriverReady()' moved to pdriver.h
declarations for 'lReadPort(), lWritePort(), lWritePort16(), lWritePort32()' moved to pdriver.h
pixel.c/h created
lSetPixel() and lGetPixel() moved to pixel.c
internal functions added to pixel.c:
	getPixel(), getPixel(), getPixel_NB(), setPixel_NB()
	setPixel_NBS(), setPixel_NBC(), setPixel_NBX(), checkbounds()

------
0.18.4	25'th September 2005

added TinySDL virtual display for both Win32 and Linux
modified lcd.h resolving compiling issues under linux
lSleep() now using usleep() on linux
examples modified to use lSleep in place of sleep()
kbhit.c added to emulate dos based kbhit() on linux
font and character map filenames converted to lowercase
build directory created to house build files
many other minor & various fixes
linux build scripts created.

------
0.18	22'nd September 2005

initial bug infested release.