Sunplus

Here are the Worm Warrior sources:

Sunplus MP8000 – This contains a slightly modified version of libgame, and should compile cleanly with the SPMP8k development kit downloaded from the internet. The archive also contains LodePNG and Game STL (gstl). I had to use the Game STL since pushing a value into a std::vector would freeze on the second push. It contains the source for two unused libraries, FastLZ and FastXml. The code can also be compiled for Windows using Visual Studio 2010 Express edition or higher and SDL 1.2.15 extracted into a  SDL-1.2.15 subdirectory.

Game Gadget and MotoMagx – This contains the same stuff as the Sunplus version in addition to the Hekkus Sound System compiled for each platform, using SDL sound. I am unable to distribute the source code to my SDL port, as it is typically distributed by the author. The Game Gadget version can be compiled with either the Game Gadget toolchain under Ubuntu or the Dingux toolchain under Windows. The MotoMagx version can be compiled with the MotoMagx toolchain under Ubuntu or andLinux/coLinux (on Windows).

Didj – This contains the source, minus the Hekkus Sound System, FastLZ, and FastXml sources. The Didj version can be compiled with the Windows Didj toolchain. There are linux toolchains located here (I would link to the blog posts, but the links are wrong).

I changed to a 16 bit blitter which fixed the non-transparent issues. Sound effects are also implemented, but only one can be played at a time and starting a new sound effects stops the last one. Music is not implemented, as midi is the only supported music format. There also is no documented way of creating a sound buffer that can notify the game when more sound data is needed.

The new version can be downloaded from the same location:

Sunplus 8000 Worm Warrior

Thanks to AleMaxx and Triple Oxygen for their code. The Sunplus port was developed using libgame and based on the keydemo sources, and Triple Oxygen’s audio demo.

I added the following to the gfx_types.h header file to create a 16 bit bitmap:

#define IMG_TYPE_16BPP 0

… created the bitmap using:

uint8_t bitmapID;
 
gfx_loadimg_t  loadImg;
 
uint16_t pImageBuffer = new uint16_t[SCREENWIDTH * SCREENHEIGHT];
 
loadImg.data = pImageBuffer;
loadImg.width = SCREENWIDTH;
loadImg.height = SCREENHEIGHT;
loadImg.img_type = IMG_TYPE_16BPP;
loadImg.unk2 = 0;
loadImg.pal_data = NULL;
loadImg.pal_size = 0;
loadImg.unk3 = 0x80;
 
gfx_load_image(&loadImg, &bitmapID);

… and blitted the bitmap to the screen using:

gfx_point2d_t pos;
gfx_rect_t rect;
 
pos.x = 0;
pos.y = 0;
rect.x = 0;
rect.y = 0;
rect.width = SCREENWIDTH;
rect.height = SCREENHEIGHT;
 
gfx_set_colorrop(COLOR_ROP_TRANSP);
gfx_bitblt(bitmapID, &rect, &pos);
 
gfx_flush();
gfx_paint();

The created 16 bit buffer is in RGB565 format, where:

Full red is 0xF800

Full green is 0x07E0

Full blue is 0x001F

And white is 0xFFFF

Here’s my initial port of Worm Warrior to a Sunplus MP8000 based system:

Sunplus MP8000 Worm Warrior

The Sunplus processor is used in many Chinese PSP/MP5 game systems.

I haven’t implemented sound, and I’m attempting to figure out how to do a transparent blit for sprites. Currently every sprite is surrounded with color 0, which should be transparent. The port runs smoothly, and sound should be easy to add.

Move the directory in the archive to the GAME folder on the game system.

To play the game:

The direction pad controls the character and X fires.

Select is start.

O will exit back to the menu.