*** Updated on 16/12/2005 ***
Fixed:
(Right-click+Save As..) Current snapshot of Fuse-gp2x v0.1.1 (in a normal zip file)
Apologies for the ropey screenshots. These may not match the current versions.
Please bear in mind that this is alpha/pre-alpha quality at the moment, so don't expect it to be good/stable. It is however good enough to use to play some games and that's about it. I am still working on it!
For tapes/etc you could try World of Spectrum or the .TZX vault
(Ugly, hacked about) Sources: Fuse-gp2x-0.6 and libspectrum-0.2.1 These are really in no fit state to be played around with at the moment, but if you must see what abominations I have done to the code before I clean up, here they are.
If you fancy donating some money, you can give it to the original authors, or to those that make World of Spectrum so damn good or to the WWF, or to a charity of your choice. If you want to give me money, I'll set up a Paypal thingy at some point.Big thanks to those that got me up and running on an unfamiliar platform. Rlyeh, DJWillis, WinterMute, rhk, theoddbot and anyone else who gave me a hand in #gp2xdev, I owe you one!
Any problems, observations, whatever (-spam), send me an email, maysubdivide {\.] org [at) ben_ost (switch around!)
These are selected on the onscreen keyboard by selecting 'k1', 'k2' and 'k3'. They start set up as follows, but you can rebind any of these during play. Selecting a new game will reset these, but if people object to this behaviour, I can make them stay to the keys you choose.:
All sets: A -> '0' (zero. It is often the fire/jump button)
B -> 'Enter/Return'
X -> 's'
Y -> 'c'
Select -> 'Escape'
Start -> 'Space'
'k1' up/down/left/right -> Arrow keys
'k2' up/down/left/right -> 7/6/5/8 (Spectrum cursor keys)
'k3' up/down/left/right -> p/l/z/x
'k1' and 'k2' are typically good for games where you can select 'cursor' controls, but if the game uses Caps lock as a button, use k2, as k1 will cause it to be triggered at every press. Why the difference?
TODO:
FAQ
Q. Manic Miner keeps jumping! A. It believes CapsLock is held down, which oddly is what is typically set when you access the arrow keys on a spectrum. Use the keyset 'k2' which is made for just such a game.
Q. Info, guides, reviews of speccy classics? A. http://www.worldofspectrum.org/
Get it here. - Uses and includes rlyeh's minilib 0.A
New version, using 0.B with a very preliminary ogg playback test. - Uses and includes rlyeh's minilib 0.B
Preliminary lib addon. Expect it all to change with the next version of rlyeh's minilib.
Image loading and frame blitting by Ben O'Steen, using Rlyeh's minilib, 0.A.
Current version is alpha grade.
To use, include the image header file, as well as minimal.h:
E.g.
#include minimal.h
#include minimal_image.h
And use a compile line like:
arm-linux-gcc minimal.c minimal_image.c Yourapp.c -oYourapp.gpe -lpng -lz -lm
-lpthread -static -I/path/to/your/devkit/include -L/path/to/your/devkit/lib -g
Shrink the exe:
arm-linux-strip blit.gpe
Quick start:
Running the executable in a directory with all four (test1->4) bmp's and png's
will act in the following way:
test1.bmp is the background image.
Bouncing image shows transparent pixel handling in the blit of test2.png
Move the joystick to pan around a test3.bmp in a small viewport, 1/3 of image
width, and a 1/4 of the image height.
Press B to increment the frame pointer that acts on test4.png.
Bear in mind that there is no wait for vsync type code in the demo. The bottom
part of the screen may or may not be flickery on your unit, depending on
firmware, etc.
--------------------------------------------------------------
Functions:
==========
gp2x_loadBMP(char filename[], gp2x_rect *gp2ximage, int bitdepth, int solid,
unsigned char *palette)
gp2x_loadPNG(char filename[], gp2x_rect *gp2ximage, int bitdepth, int solid)
Current Support:
8bpp indexed bmps -> 8bit, 15bit and 16bit gp2x_rects
24bpp RGB bmps -> 15bit, 16bit gp2x_rects
24bpp RGB pngs -> 15bit gp2x_rect
32bpp RGBA pngs -> 15bit gp2x_rect with alpha values of zero being made into the
transparent colour, which is black by default.
Loading an 8bit bmp will cause *palette to point to the palette table, BGRr
format (r is reserved and pointless) -> Four bytes wide per palette entry,
Blue, Green, Red and resevered (which is normally zero).
--------------------------------------------------------------------------------
gp2x_blitter_rect15(gp2x_rect *blit)
gp2x_blitter_rect8(gp2x_rect *blit)
Blits the data, using rlyeh's routine with a typo fix. (That's why his lib is
included.)
--------------------------------------------------------------------------------
gp2x_createspritemap(gp2x_anim_rect *blit, int cols, int rows)
gp2x_rect here only needs data15, and w,h to be correct. The other values are
defined from the function arguments.
cols and rows are the number of columns and rows you wish to split the image
into:
ie:
0 1 2 3 4
5 6 7 8 9
rows=2
cols=5
frameno= 0 to 9
Example code:
-------------
unsigned short **frames;
error = gp2x_loadPNG("test4.png", test4, 15, 1);
// Split test4 into 10 columns and 5 rows of frames, 50 in total.
frames=gp2x_createspritemap(test4, 10, 5);
// Change image to frame frameno, which is valid from 0 to 49.
test4->data15 = frames[frameno];
--------------------------------------------------------------------------------
void gp2x_blitanimrect(gp2x_rect *blit, int framex, int framey, int frameh, int
framew)
blit a portion of the gp2x_rect blit at (x,y), and use a rect of blit, starting
at (framex,framey) and being framew wide and frameh tall.
Slow and 15/16 bit only.
--------------------------------------------------------------------------------
gp2x_spritemapblit(gp2x_rect *blit, int x, int y, int cols, int rows, int frame)
Legacy function, better to break up the rect with gp2x_createspritemap first and
use rlyeh's fast blitting routine.