Stuff to add
------------
* proper recolour function
* gp_spr_pre01b format which interleaves pixel & mask data a word at a time, ala DMASprite/XSpr?
* preshifted toscreen() and sync() functions
* some kind of menu/UI code?
- list of elements, including size & rendering code
- can then check for mouse clicks & return selected element
* Screen line/circle/rectangle/etc plotting funcs that perform GP_MT_GREY, GP_MT_RGB recolours
* Compressed sprite formats!
- GP_MT_ONOFF only
- Simple format that can only be generated from screens/sprites (i.e. no per-pixel write access)
- Each sprite has a row index, containing offsets to the data for each row
- Each row then contains a series of chunks - each chunk has type (mask/colour), length (pixels), followed by the data
  - For ps=0, can be a byte giving the type in top bit and length in other 7 bits
  - For ps=1, can be a short giving the type in top bit and length in other 15
    - Or if top bit indicates it's a colour, the length is implied to be 1, and the colour data is stored in the other 15 bits? Would reduce overall sprite size, but may complicate plotter too much when trying LDM/STM
  - For ps=2, can be a word, giving the type in the top bit, length in next 7, colour data for current pixel (if colour) in remaining 24.
* Palettised formats?
- Can use seperate functions (ala paint sprite format) to enable/disable palette lookups during sprite read/write access (the fact that PS & MT are obtained via function calls will work well for this - all code should be able to handle the sprite changing PS during its lifespan), to resize the palette, read/write entries, etc. Obvious aim would be to have code suitable for DeathDawn

Stuff to amend
--------------
* DOCUMENTATION!
* improve (ARM/C) plotting speed
- loading/storing mask & pixel seperate where applicable (e.g. mt 2/3, ps 0)
- optimise for not reading from screen memory where possible
  - e.g. bottom clause of asm_gp_spr_transfer
    - just rewrite it to not load from screen at all - shouldn't result in any slowdowns
* translate C to ARM
* _gp_simpspr defined twice - in simpspr.c and in sprplotgen.c
* rewrite assembler versions of asm_gp_24_grey and asm_gp_24_rgb to be same as sasm ones

Stuff to fix
------------
* fix gp_spr_paint fromscreen,fromspr code to calculate size properly for mask (it should be stored like a 1bpp sprite!)
* Fix gp_spr tplot functions to return the error code, like the definition says they should

Stuff to design
---------------
* triangle/polygon/etc plotters for screens
* sprite transformation functions
- scale
- light/colour
- etc.

Stuff to think about
--------------------
* filled & unfilled graphics funcs in gp_screen?
* poke gp_spr_plot_rotscale again to be more accurate?
* screen rectangle copy funcs? (plot screen into screen, ala spr into screen)
* palettised sprite support:
- internally all pixels are 8bpp
- but special (i.e. not gp_sprfmt) setpalette() function can be used to register a palette with the sprite. Parameters are ps and mt of the palette, pointer, and number of defined entries(?). Function can also be used to unregister palette. A seperate function is available to get a pointer to the palette. Multiple palettes can be registered at once (one per ps, mt combo). The palette will not be copied into the sprite memory; this allows multiple sprites to share the same palette.
- then, when reading/writing pixels, plotting, etc., if a palette exists for the given input/output ps&mt combo, that palette will be used to convert to/from the internal 8 bit number
- only problem with this idea is that it won't allow transparent loading of palettised sprites (in data form) by deathdawn, as the sprite format will be different. However (a) ddconvert could be updated to output palettised sprites, or (b) sprites could be loaded as gp_sprfmt00 and then converted to palettised sprites (which will then have a palette assigned afterwards). Also, if the internal data pointer of the sprite contains pointers to the palettes, there is the problem that the pointers will get written out when the sprite is saved. So maybe need to replace the current load/save system with proper functions to load and save to FILE *'s (or serialise/deserialise functions to load and save into memory). Or add a seperate entry to the gp_spr struct that contains non-saveable data (but this will break lots of current code?), or add pre-save function that cleans the sprite (but that will probably need a post-save function to restore it afterwards, which may make things messy), or just warn against saving with palettes assigned.

Other stuff
-----------
* MT_GREY/MT_RGB onto MT_GREY/MT_RGB plotters still untested

Stuff done
----------
26/2/08
* Applied GPL v3 license to code
24/2/08
* Rewrote makefile to get use patterns for building files
22/2/08
* Added optional 'scr' parameter to sprite toscreen function, so an existing gp_screen can be reused if the user desires
17/2/08
* Marked some functions/parameters as const, in an effort to get a little bit more speed
5/2/08
* Amended gp_font_puts_scaled to support variable-height fonts
2/2/08
* Amended gp_font code to support variable-width fonts
10/6/07
* Updated gp_paint_spr code to allow unmasked paint sprites to be toscreen'd. However the results will not be valid for sprites with less than 256 colours!
3/2/07
* Fixed sprplotgen.c to check SASM_H instead of SASM_M when deciding whether halfword load/store is supported!
20/1/07
* Applied a simple optimisation to asm_gp_spr_transfer so that each word of screen data is only loaded if one or both pixels of a trueps 1 sprite are transparent
17/9/06
* Changed sprite plotter generator to use LDR/STRH on appropriate hardware
9/6/06
* Changed the fromscreen and fromspr methods of gp_spr_paint to clear the top bit of 16bpp pixels and the top byte of 24bpp pixels so that the Sprite module processes the sprites properly
31/12/05
* Wrote a new version of the rotscale plotter
26/12/05
* Added gp_font_puts_scaled
25/12/05
* Added GP_SPROP macro to simplify performing sprite ops
7/12/05
* Added gp_font_old, to control how many old fonts the font code will remember before it begins to recycle them
28/11/05
* Fixed a bug in gp_spr_ar_convert that was stopping it from working
* Fixed a bug in gp_spr_igen_getpix that was causing gp_spr_11 pixel reads to only return black
10/11/05
* Fixed a bug in gp_screen_rect that caused most rectangles to be drawn incorrectly
18/9/05
* Fixed another bug in gp_spr_plot_rotscale for sprites which have their origin close to a corner/edge and are rotated very close to 0/90/180/270 degrees
4/4/05
* Added preshifted sprite formats: gp_spr_pre00, gp_spr_pre01, gp_spr_pre10, gp_spr_pre11
* Modified gp_spr_plot_rotscale to rotate the sprite about its origin, not its center
2/4/05
* Fixed a bug in gp_spr_plot_rotscale for sprites which are very close to a rotation of 0/90/180/270 degrees
26/3/05
* Fixed a bug in gp_spr_plot_rotscale for sprites rotated right 90 degrees
25/9/04
* Sped up gp_spr_gen_fromscreen and gp_spr_gen_fromspr for destination sprites with no mask
23/9/04
* Tweaked gp_spr_plot_rotscale to produce better results with sprites at 1:1 or less scale
22/9/04
* Rewrote gp_spr_plot_rotscale to be more robust and fix numerous inaccuracies
* Added support for masked screens to gp_spr_paint_fromscreen
* Swapped the order of the mt and ps parameters of the screen mask read/write functions, to match the same order as the sprite functions
* made gp_screen_new_frompaintsprite cope with sprites which don't have word aligned data
* made gp_spr_gen_plot and gp_spr_gen_tplot read the screen colour & mask from bank 0 (i.e. the bank being plotted to).
* optimised the pixel load & store functions in sprplotgen.c a bit, so that they now only increase the buffer pointer if asked to and use LDM/STM where possible
21/9/04
* Fixed a bug in the block copy sprite plotter generator where the per-pixel code would load pixels from the screen, not the sprite
* Fixed a bug in gp_spr_gen_fromspr that was stopping the sprite mask from being generated properly
20/9/04
* Split spr.c into three files: spr.c, containing generic code, simpspr.c, containing the simple sprite code, and paintspr.c, containing the paint sprite code
* added gp_spr_ar_delete, gp_spr_ar_convert, gp_spr_paint_find, gp_font_flush, gp_spr_plot_rotscale
* fixed a bug in the transformed plotter generator that was causing l+1 pixels to be drawn
13/9/04
* Added generator for transformed plotters
5/9/04
* Fixed a bug in font.c where old fonts that were getting recycled wouldn't have their ps property updated, causing subsequent calls to gp_font_load to fail to detect the font, causing more recycling, etc.
3/9/04
* Fixed a bug in sprplotgen's block copy plotter where if the sprite was a multiple of 7 words (or 6 if ps<2 and mt!=0) then an extra 7 (or 6) words would be drawn per line 
1/9/04
* Added gp_screen_new_frompaintsprite
* Fixed gp_spr_paint_savefile to give the file the correct file type
* Fixed gp_spr_paint.create and gp_spr_paint.fromscreen to nullify the characters after the sprite name, otherwise !Paint has trouble reading the sprite
29/8/04
* Added block copy plotter to sprplotgen.c. If no colour conversion is needed, the true pixel sizes are the same, and no mask/onoff mask is in use (in either) then pixels will be copied in blocks
* Renamed the genplot functions a bit
28/8/04
* Fixed a bug in GP_8_TO_16
* retired sprplot.s
* rewrote plotter generator to use a two-level system. For each sprite format there is an optional jump table leading to optional sprite plotters per screen format.
* added gp_col_trueps
* added mask type field to gp_screen
* updated screen.c's drawing tools to account for this
* added gp_screen_hline3
* moved gp_mask_conv to screen.c
* updated scrplotgen.c to cope with masked screens
* rewrote asm_gp_24_grey and asm_gp_24_rgb to use less registers
* added font caching: Up to 5 dead fonts will be kept before they get recycled 
27/8/04
* translated sprplot.s to runtime assembled code using sasm in file sprplotgen.c
25/8/04
* added null font/screen/string/length checks to gp_font_puts
24/8/04
* changed font manager to use seperate font definitions per style instead of one big structure
* fixed bugs in the font code
* added background colour to font code; now masked & unmasked fonts are supported
23/8/04
* supplied font loader: suitable for sprite files: white as foreground colour, masked areas as transparent
* simple font string plotter
* fixed memory leak in font handler where reused fonts weren't deleted
* fixed a bug in spr.c with the internal gp_spr.toscreen function
22/8/04
* font manager
