Blah
Wanna Be Programmer
I have updated the code again. Support for 8bit graphics with transparency has been added. For more information, go to this thread: Graphics in Mr. Mirkos SDK.
There should be more updates, as this code is the first step in a new project I am starting that requires a good graphics core.
edit: I previously said to use memcpy to change your palette, but I figured out this was faster (hehe, I'm a cruddy programmer):
So your simply re-assigning the pointer, not copying over a palette.
This isn't too useful of information, but it would come in handy if your doing effects by fast palette shifting.
Make your sprites like this:
16 bit sprites:
bmp2bin -r -x sprite.bmp sprite.raw
8 bit sprites:
bmp2bin -i -r -x sprite.bmp sprite.raw
Make sure your bmp is 256 colors. Use the GP32 palette, or you can use your own
if you wish (generate the palette information with GP32converter).
edit: Update! gp_blit_8to16 added. This is used for blitting 8bit sprites to a 16bit framebuffer. Also theres gp_blitT_8to16, which does the same, but with transparency. The tiling functions have been updated with support for these features.
edit: Update!
Too lazy to write it twice, so here:
Oops, I broke gp_blit16...Fixed.
There should be more updates, as this code is the first step in a new project I am starting that requires a good graphics core.
edit: I previously said to use memcpy to change your palette, but I figured out this was faster (hehe, I'm a cruddy programmer):
Code:
extern u32 my_palette[];
u32 *palette = (u32*) PALETTE;
*palette = *my_palette;
So your simply re-assigning the pointer, not copying over a palette.
This isn't too useful of information, but it would come in handy if your doing effects by fast palette shifting.
Make your sprites like this:
16 bit sprites:
bmp2bin -r -x sprite.bmp sprite.raw
8 bit sprites:
bmp2bin -i -r -x sprite.bmp sprite.raw
Make sure your bmp is 256 colors. Use the GP32 palette, or you can use your own
if you wish (generate the palette information with GP32converter).
edit: Update! gp_blit_8to16 added. This is used for blitting 8bit sprites to a 16bit framebuffer. Also theres gp_blitT_8to16, which does the same, but with transparency. The tiling functions have been updated with support for these features.
edit: Update!
Too lazy to write it twice, so here:
* Changelog:
*
* June 10 2005 - Blah on gp32x.de
* First release
*
* June 11 2005 - Blah on gp32x.de
* Added transparency and headerless graphics support
*
* June 18 2005 - Blah on gp32x.de
* Added GNU GPL License
* Added basic tile support
* Added basic 8bit (256 color) graphics support
* Changed function names to make more sense (and be shorter and easier on the typist)
*
* June 21 2005 - Blah on gp32x.de
* Added 8bit graphics with transparency support
*
* June 22 2005 - Blah on gp32x.de
* Added support for blitting 8bit sprites in 16bit mode with and without transparency headers, etc.
*
* June 24 2005 - Blah on gp32x.de
* Added support for blitting 8bit sprites in 16bit mode with alpha.
* Cleaned up some functions.
*
* Todo:
* Clean up commenting
* Add rotation support
* Add scaling support
* Add "hardware scrolling" (changing framebuffer pointer)
* Add DMA support?
* Fix bugs?
* Anything else?
*/
Oops, I broke gp_blit16...Fixed.
Last edited by a moderator: