gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Beginners > tutorial by neogeo

#50006 - NighTiger - Thu Aug 04, 2005 2:45 pm

In this tutorial was explained how to load and display a sprite...

http://home.no/neogeo/HOVEDSIDE_INDEX/GBA_HOVEDSIDE_INDEX_ENGELSK/index.html

But I didn't see anything after the creation of gba bin
why? :-\

#50043 - QuantumDoja - Thu Aug 04, 2005 7:28 pm

Have you got any code you can post so we can look at your problem?
_________________
Chris Davis

#50089 - NighTiger - Fri Aug 05, 2005 8:07 am

yes

Code:

#include "gba.h"
#include "image.h"

OAMEntry sprites[128];

void CopyOAM()
{
/*  u16 loop;
  u16* temp;

  temp = (u16*)sprites;

  for(loop = 0; loop < 128*4; loop++) //2 bytes at the time (2byte * 4 * 128 = 1024 bytes)
    OAMmem[loop] = temp[loop];
*/
  memcpy(OAMmem, sprites, sizeof(u16)*128*4);
}

//function that sets OAM data for all sprites, so that they are not shown on the screen.
//by setting coordinates to all sprites outside the visible area of the screen, they are not shown.
void InitializeSprites()
{
  u16 loop;

  for(loop = 0; loop < 128; loop++)
  {
    sprites[loop].attribute0 = 160;  //y to > 159
    sprites[loop].attribute1 = 240;  //x to > 239
    sprites[loop].attribute2 = 0;
  }
}

int main()
{
  u16 loop;
  s16 x = 10;
  s16 y = 50;

  //set mode 1, switch on sprites, set storing of sprite tiles as 1D
  SetMode(MODE1 | OBJ_ENABLE | OBJ_MAP_1D);

  InitializeSprites();   //set all sprites outside the screen (removes unwanted sprites)
                                                                     
  sprites[0].attribute0 = COLOR_256 | TALL | y;  //set 256 colors, shape and y-coordinate
  sprites[0].attribute1 = SIZE_32 | x;  //set shape and x-coordinate
  sprites[0].attribute2 = 0;   //points to where in VRAM we get the tile data from

  /*for(loop = 0; loop < 256; loop++)          //transfer palette data into memory (256 colors)
  {
    OBJPalettemem[loop] = smurfPalette[loop];
  }*/
  memcpy(OBJPalettemem, imagePalette, sizeof(u16)*256);
                                                         
  //for(loop = 0; loop < 1024; loop++)   //transfer sprite tile data into memory (32x64)
    //OAMdata[loop] = smurfData[loop];

  memcpy(OAMdata, imageData, sizeof(u16)*1024);

  while(1)
  {
    Vsync();  //wait for screen to finish drawing.
    CopyOAM();  //copy sprite info (OAM) into OAM memory
  }

  return 0;
}


regs and other stuff

Code:

typedef unsigned char   u8;
typedef unsigned short  u16;
typedef unsigned long   u32;

typedef signed char     s8;
typedef signed short    s16;
typedef signed long     s32;

typedef unsigned char   byte;
typedef unsigned short  hword;
typedef unsigned long   word;

#define MODE0                   0x0     //!< Screen mode 0
#define OAMmem                  ((u16*)0x7000000)
#define OAMdata                 ((u16*)0x6010000)
#define OBJPalettemem           ((u16*)0x5000200)
#define REG_DISPCNT             *(u16*)0x4000000
#define REG_VCOUNT              *(volatile u16*)0x4000006


#define OBJ_MAP_1D                      0x40
#define COLOR_256                       0x2000        //!< 256 colors

#define TALL                            0x8000

#define SIZE_64                         0xC000

typedef struct tagOAMEntry
{
  u16 attribute0;
  u16 attribute1;
  u16 attribute2;
  u16 attribute3;
}OAMEntry, *pOAMEntry;

/// Sprite rotation information
typedef struct tagRotData
{
  u16 filler1[3];
  u16 pa;
  u16 filler2[3];
  u16 pb;
  u16 filler3[3];
  u16 pc;
  u16 filler4[3];
  u16 pd;
}RotData, *pRotData;

#define Vsync() while(REG_VCOUNT != 160);

#define SetMode(mode) REG_DISPCNT=(mode)

// From pcx2gba
#define image_WIDTH  32
#define image_HEIGHT 64

const u16 imageData[] = {
   0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1900, 0x1919, 0x1919, 0x1919, 0x1919, 0x1919, 0x1919, 0x0019, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1900, 0x1919, 0x1919, 0x1919, 0x1919, 0x1919, 0x1919, 0x1919, 0x1919, 0x0019, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1900, 0x1919, 0x1919, 0x1919, 0x1919, 0x1919, 0x1919, 0x1919, 0x1919, 0x1919, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x1919, 0x1919, 0x1919, 0x1919, 0x0019, 0x0000, 0x0000, 0x0000, 0x2222, 0x0022, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x1919, 0x1919, 0x1919, 0x2222, 0x2222, 0x2222, 0x2222, 0x0022, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x1919, 0x1919, 0x2219, 0x2222, 0x2222, 0x2222, 0x0022, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x1991, 0x1919, 0x1919, 0x2222, 0x2222, 0x2222, 0x0022, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x1991, 0x1919, 0x1919, 0x0022, 0x0000, 0x0000, 0x0000, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x1919, 0x1919, 0x0019, 0x0000, 0x0000, 0x0000, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x1922, 0x1919, 0x0019, 0x0000, 0x0000, 0x0000, 0x9191, 0x9191, 0x2222, 0x2222, 0x2222, 0x9122, 0x9191, 0x9191, 0x9191, 0x9191, 0x1922, 0x1919, 0x0019, 0x0000, 0x0000, 0x0000, 0x9191, 0x9191, 0x2222, 0x2222, 0x2222, 0x2222, 0x9122, 0x9191, 0x9191, 0x9191, 0x2222, 0x1919, 0x0019, 0x0000, 0x0000, 0x0000, 0x9191, 0x9191, 0x2222, 0x2222, 0x2222, 0x2222, 0x2222, 0x9122, 0x9191, 0x9191, 0x2222, 0x1919, 0x0019, 0x0000, 0x0000, 0x0000, 0x9191, 0x9191, 0x9191, 0x2222, 0x2222, 0x2222, 0x2222, 0x9122, 0x9191, 0x2291, 0x2222, 0x1919, 0x1919, 0x0000, 0x0000, 0x0000, 0x9191, 0x9191, 0x9191, 0x2222, 0x2222, 0x2291, 0x2222, 0x2222, 0x9122, 0x2222, 0x2222, 0x1919, 0x1919, 0x0000, 0x0000, 0x0000, 0x9191, 0x9191, 0x9191, 0x2222, 0x2222, 0x9122, 0x2222, 0x2222, 0x9122, 0x2222, 0x2222, 0x1922, 0x1919, 0x0019, 0x0000, 0x0000, 0x9191, 0x9191, 0x9191, 0x2291, 0x2222, 0x2222, 0x2222, 0x2222, 0x2222, 0x2222, 0x2222, 0x1922, 0x1919, 0x0019, 0x0000, 0x0000, 0x9191, 0x9191, 0x9191, 0x9191, 0x2222, 0x2222, 0x2222, 0x2222, 0x2222, 0x2222, 0x2222, 0x1922, 0x1919, 0x1919, 0x0000, 0x0000, 0x9191, 0x9191, 0x9191, 0x9191, 0x2222, 0x2222, 0x2222, 0x2222, 0x2222, 0x2222, 0x2222, 0x2222, 0x1919, 0x1919, 0x0000, 0x0000, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x2222, 0x2222, 0x2222, 0x2222, 0x2222, 0x1922, 0x1919, 0x0000, 0x0000, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x2222, 0x2222, 0x2222, 0x2222, 0x2222, 0x1922, 0x1919, 0x0000, 0x0000, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x2291, 0x2222, 0x2222, 0x2222, 0x2222, 0x1922, 0x1919, 0x0019, 0x0000, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x2222, 0x2222, 0x2222, 0x2222, 0x1922, 0x1919, 0x1919, 0x0000, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x2222, 0x2222, 0x2222, 0x9122, 0x9191, 0x1919, 0x1919, 0x0019, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x2222, 0x2222, 0x2222, 0x9122, 0x9191, 0x1991, 0x1919, 0x0019, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x2222, 0x2222, 0x9122, 0x9191, 0x1991, 0x1919, 0x1919, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x2222, 0x2222, 0x2222, 0x9122, 0x9191, 0x9191, 0x1919, 0x1919, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x2222, 0x2222, 0x9122, 0x9191, 0x9191, 0x9191, 0x1991, 0x1919, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x2222, 0x2222, 0x9122, 0x9191, 0x9191, 0x9191, 0x9191, 0x1919, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x2222, 0x9122, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x1919, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x2222, 0x2222, 0x9122, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x2222, 0x2222, 0x9122, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x2222, 0x2222, 0x2222, 0x9122, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x2222, 0x2222, 0x9122, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x2222, 0x2222, 0x2222, 0x2222, 0x9122, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9100, 0x9191, 0x9191, 0x9191, 0x2222, 0x2222, 0x2222, 0x9122, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9100, 0x9191, 0x9191, 0x9191, 0x2222, 0x2222, 0x2222, 0x9122, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9100, 0x9191, 0x9191, 0x2291, 0x2222, 0x9122, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x0000, 0x9191, 0x9191, 0x2222, 0x2222, 0x9122, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x0000, 0x9100, 0x9191, 0x2222, 0x2222, 0x9122, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x0000, 0x9100, 0x9191, 0x2222, 0x2222, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x0000, 0x0000, 0x9100, 0x2222, 0x9122, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x0000, 0x0000, 0x9100, 0x2222, 0x9122, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x0000, 0x0000, 0x0000, 0x2222, 0x9122, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x0091, 0x0000, 0x0000, 0x0000, 0x2222, 0x9122, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x0000, 0x0000, 0x0000, 0x0000, 0x2222, 0x9122, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x0000, 0x0000, 0x0000, 0x0000, 0x2222, 0x0022, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2222, 0x0022, 0x9100, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x9191, 0x0091, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2222, 0x0022, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2222, 0x0022, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2222, 0x2222, 0x0022, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2222, 0x2222, 0x0022, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2222, 0x2222, 0x0022, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000};

const u16 imagePalette[] = {
   0x18C6, 0x6234, 0x6235, 0x6256, 0x6257, 0x6278, 0x6279, 0x627A, 0x629B, 0x629C, 0x62BD, 0x5E9C, 0x5E5B, 0x5A39, 0x59F8, 0x55D6, 0x51B5, 0x5173, 0x4D52, 0x4D10, 0x48EF, 0x4551, 0x41D4, 0x4256, 0x3ED9, 0x3B5C, 0x3F3A, 0x42F8, 0x4AD7, 0x4EB5, 0x5273, 0x5A51, 0x5E30, 0x65EE, 0x69CC, 0x61CD, 0x55CF, 0x49D1, 0x41F3, 0x35F5, 0x29F6, 0x21F8, 0x161A, 0x161A, 0x1A1A, 0x1A3A, 0x1E3A, 0x1E5B, 0x225B, 0x225B, 0x267B, 0x267B, 0x2A9B, 0x2A9B, 0x2EBB, 0x2EBC, 0x32BC, 0x32DC, 0x36DC, 0x36FC, 0x3AFC, 0x3AFC, 0x3F1C, 0x3F1D, 0x433D, 0x433D, 0x475D, 0x475D, 0x475D, 0x473C, 0x471B, 0x471A, 0x46F9, 0x46D8, 0x42D7, 0x42B6, 0x4295, 0x4294, 0x4273, 0x4252, 0x3E52, 0x3E31, 0x3E10, 0x3E0F, 0x3DEE, 0x3DCD, 0x39CC, 0x39AB, 0x398A, 0x3989, 0x3968, 0x3947, 0x3526, 0x3547, 0x3567, 0x3588, 0x3589, 0x35A9, 0x35CA, 0x35EB, 0x360B, 0x362C, 0x364D, 0x364D, 0x366E, 0x368E, 0x36AF, 0x36D0, 0x36F0, 0x36F1, 0x3712, 0x3732, 0x3353, 0x3353, 0x3333, 0x3333, 0x3313, 0x2F13, 0x2EF3, 0x2EF3, 0x2ED3, 0x2AD3, 0x2AB3, 0x2AB3, 0x2A93, 0x2693, 0x2673, 0x2673, 0x2653, 0x2253, 0x2233, 0x2233, 0x2213, 0x1DF3, 0x25F4, 0x2A14, 0x3215, 0x3A36, 0x3E36, 0x4637, 0x4A57, 0x5258, 0x5258, 0x5258, 0x4E58, 0x4E58, 0x4A38, 0x4A38, 0x4638, 0x4638, 0x4238, 0x4217, 0x3E17, 0x3E17, 0x3A17, 0x3A17, 0x35F7, 0x35F7, 0x35F7, 0x31F7, 0x31F6, 0x2DD6, 0x2DD6, 0x29D6, 0x29D6, 0x25D6, 0x25B6, 0x21B6, 0x21B6, 0x1DB5, 0x1DB5, 0x1995, 0x1995, 0x1595, 0x1594, 0x1993, 0x1991, 0x1D90, 0x1D8F, 0x1DAE, 0x21AC, 0x21AB, 0x25AA, 0x25A9, 0x29A7, 0x29C6, 0x29C5, 0x2DC4, 0x2DC2, 0x31C1, 0x31E0, 0x31E0, 0x31C0, 0x35C0, 0x35C0, 0x35A0, 0x35A0, 0x35A0, 0x3980, 0x3980, 0x3980, 0x3960, 0x3960, 0x3D40, 0x3D40, 0x3D40, 0x3D20, 0x3D20, 0x4120, 0x4100, 0x4100, 0x4100, 0x40E0, 0x44E1, 0x44E3, 0x4506, 0x4929, 0x494B, 0x4D6E, 0x4D91, 0x5194, 0x51B6, 0x55D9, 0x55D9, 0x55F9, 0x55F9, 0x5619, 0x5619, 0x5618, 0x5638, 0x5638, 0x5638, 0x5658, 0x5657, 0x5677, 0x5677, 0x5677, 0x5697, 0x5696, 0x56B6, 0x56B6, 0x56B6, 0x56D6, 0x56D5, 0x56F5, 0x56F5, 0x56F5, 0x5715, 0x5714, 0x5714, 0x5734, 0x5734, 0x5754, 0x5353, 0x5752, 0x5B71};


I hope that I don't forget anything :)

I can't upload the image.pcx because geocities doesn't allowed me

If you need the image I will send to you.
tnx[/url]

#50092 - Cearn - Fri Aug 05, 2005 8:50 am

Well, I got 'something' showing by simply copy-pasting your code and data, but not necessarly what you intended. I can't say why it doesn't work for you. You may want to check your compiler settings. Also look in the memory/tile/sprite viewer of your emulator to see the data actually makes it there.
The sprite is garbled, though. Sprite graphics (the stuff you put into OBJ VRAM (0x0601:0000, which has nothing to do with OAMData, that's a misnomer)) need to be tiled, which this data isn't. IIRC, pcx2gba only does bitmaps, not tiles. I believe you need pcx2sprite for that, or any other tool that can create 8x8 tiles.

Final note on memcpy. While it is indeed much faster and cleaner than u16-array copies, use it only if source and data are 32bit aligned and you have more than 16 bytes to copy. Otherwise it'll use byte-copies, which don't work very well for VRAM, OAM and the palette. In most cases this won't be something to worry about, but when it does screw up, you'd have one hell of a time find the bug.

#50093 - NighTiger - Fri Aug 05, 2005 9:10 am

Where I can find a pcx2sprite tool for linux?

#50095 - Cearn - Fri Aug 05, 2005 9:19 am

Same place you got pcx2gba probably :P. There should be a linux version of gfx2gba, which can do the work of both those tools and much more besides. I think it's this one: http://www.ohnehirn.de/tools/gfx2gba, but you'll have to check for yourself to be sure.

#50096 - NighTiger - Fri Aug 05, 2005 9:27 am

this the sprite in jpg format :-P

http://img342.imageshack.us/img342/7412/image6hp.jpg

#50097 - Cearn - Fri Aug 05, 2005 9:49 am

Argh.

Oh, alright then, just this once. http://user.chem.tue.nl/jakvijn/files/image6hp.tar. (Are there linux tools for .zip btw?). Converted to 8bpp tiles, though with my own tools and not via gfx2gba, you're on your own with that one. If you know how to read common graphics formats, you can always write your own tools, it's really not that hard. If you don't, maybe it's time to learn using file descriptions from, say, http://www.wotsit.org.

Also, jpgs. Lossy compression. *ick*.

#50098 - NighTiger - Fri Aug 05, 2005 9:54 am

Wait wait :)

the image is in jpg because shack doesn't allow me to upload the pcx files :)

Anyway your header works fine.
Can you send me your tool to convert the bmp to a header file, please?

I can't find anything for linux that works fine...

(zip works on linux)

Maybe a good way is make a raw data of the image by the arm-elf-objcopy???

Maybe, in this way, I can made my demo without the pcx2sprite tool?!