Hello to all again, I've run into a really strange problem!   
 
This code used to work, and after I added a few features into my program, it's started crashing when I change the palette (or more specifically, when I build a new palette)
So I started chopping all of the other code out and basically now all I have is creating a screen surface, then changing the palette. But it still crashes then!
This is the line it hates:
	
	
	
		
GeePee32 asks me to send an error message to micro$oft, and the Gp32 gives the following error:
	
	
	
		
(I can post the full error message here if it's important)
this is gpmain.c: (chopped down to almost nothing)
	
	
	
		
and gpmain.h:
	
	
	
		
incase it's important, clouds.h looks like any other graphics file converted with gp32convertor:
	
	
	
		
If someone could help me i would really appreciate it - many hours of work will go down the drain otherwise! I'm totally at a loss at what the problem could be!
				
			This code used to work, and after I added a few features into my program, it's started crashing when I change the palette (or more specifically, when I build a new palette)
So I started chopping all of the other code out and basically now all I have is creating a screen surface, then changing the palette. But it still crashes then!
This is the line it hates:
		Code:
	
	h_pal = GpPaletteCreate(256, (GP_PALETTEENTRY*)Clouds_Pal);
		Code:
	
	Exception: Translation
Registers:        CP15 Registers:
...this is gpmain.c: (chopped down to almost nothing)
		Code:
	
	#include "gpdef.h"
#include "gpstdlib.h"
#include "gpgraphic.h"
#include "gpmain.h"
#include "gpstdio.h"
#include "gpfont.h"
#include "gpmm.h"
int  nflip, ExKey;
//----------------------------------------------------------------------------------//
//Pallete, memory and file loading crap
GP_HPALETTE h_pal, old_pal;
BGFONTINFO  tInfo;
F_HANDLE  fh;
ERR_CODE  err;
unsigned long n_size,n_read;
char *  	app_path;
BGFONTINFO  game_font;
extern const unsigned char fontresEng1[];
extern const unsigned char fontresKor1[];
//----------------------------------------------------------------------------------//
//Include all of the graphics here
#include "Graphics\Clouds.h"
//Include the custom fonts
#include "Fonts\fontdat.c"
//----------------------------------------------------------------------------------//
void GpMain(void *arg)
{
	int i, j;
	//Set up screen surface
  	nflip = 1;
	GpLcdSurfaceGet(&gpDraw[0], 0);
	GpLcdSurfaceGet(&gpDraw[1], 1);
	GpSurfaceSet(&gpDraw[0]);
	//Change Pallete
	h_pal = GpPaletteCreate(256, (GP_PALETTEENTRY*)Clouds_Pal);
	GpPaletteSelect(h_pal);
	GpPaletteRealize();
	GpPaletteDelete(h_pal);
	h_pal = NULL;
}and gpmain.h:
		Code:
	
	#ifndef __gpmain_h__
#define __gpmain_h__
void GpMain(void * arg);
//Load the graphics buffer
GPDRAWSURFACE gpDraw[2];
#endif /*__gpmain_h__*/incase it's important, clouds.h looks like any other graphics file converted with gp32convertor:
		Code:
	
	/////////////////////////////////////////
//
// Header file for GP32
//
// convertion of Clouds.bmp file :
// Width     = 60
// Heigth    = 60
// GP32 Mode = 8 Bits per Pixel
//
// with GP32Converter coded by Edorul :
//    http://www.ifrance.com/edorul/
//    edorul@free.fr
//
/////////////////////////////////////////
#define Clouds_width      60
#define Clouds_height     60
#define Clouds_palnb      256
#include "gpgraphic.h"
GP_PALETTEENTRY Clouds_Pal[256] = {
      0x1, 0xEF, 0xF1, 0xF3, 0x12D, 0x12F, 0x927, 0x929, 0x92B, 0x92D, 0x1085, 0x20C7, 0x2109, 0x2909, 0x294B, 0x314B, 
      0x318B, 0x39CD, 0x420D, 0x4211, 0x4A4F, 0x5293, 0x5295, 0x5909, 0x5AD3, 0x5AD5, 0x5AD7, 0x6109, 0x6315, 0x6317, 0x6319, 0x6359, 
      0x6907, 0x6B57, 0x6B59, 0x6B5B, 0x70C7, 0x7107, 0x7399, 0x739B, 0x739D, 0x78C7, 0x7A11, 0x7AD7, 0x7BDB, 0x7BDD, 0x80C5, 0x80C7, 
      0x8211, 0x841F, 0x8421, 0x88C5, 0x8C63, 0x8C9F, 0x90C5, 0x9461, 0x94A1, 0x94A5, 0x9883, 0x9885, 0x9CA3, 0x9CE1, 0x9CE3, 0x9CE7, 
      0xA083, 0xA2D7, 0xA525, 0xA527, 0xA529, 0xA565, 0xA883, 0xAD67, 0xAD69, 0xAD6B, 0xADA7, 0xB081, 0xB083, 0xB5A7, 0xB5A9, 0xB5AB, 
      0xB5AD, 0xB5E9, 0xB841, 0xBA11, 0xBCA5, 0xBDED, 0xBDEF, 0xC041, 0xC549, 0xC54B, 0xC589, 0xC58B, 0xC58D, 0xC58F, 0xC5EF, 0xC62D, 
      0xC62F, 0xC631, 0xC6BB, 0xC6BD, 0xC6FB, 0xC6FD, 0xC841, 0xCD89, 0xCD8B, 0xCD8D, 0xCD8F, 0xCDC9, 0xCDCB, 0xCDCF, 0xCDD1, 0xCDD3, 
      0xCDD5, 0xCE71, 0xCE73, 0xCEFB, 0xCEFD, 0xD39D, 0xD3DF, 0xD5C9, 0xD5CB, 0xD5CD, 0xD5CF, 0xD609, 0xD60B, 0xD60D, 0xD60F, 0xD611, 
      0xD613, 0xD615, 0xD617, 0xD619, 0xD61B, 0xD65B, 0xD65D, 0xD6B3, 0xD6B5, 0xD6FB, 0xD6FD, 0xD73B, 0xD73D, 0xDE09, 0xDE0B, 0xDE0D, 
      0xDE0F, 0xDE11, 0xDE4D, 0xDE4F, 0xDE51, 0xDE55, 0xDE57, 0xDE59, 0xDE5B, 0xDE5D, 0xDE5F, 0xDE9F, 0xDEA1, 0xDEA3, 0xDEF5, 0xDEF7, 
      0xDF3B, 0xDF3D, 0xDF7D, 0xE651, 0xE653, 0xE695, 0xE697, 0xE699, 0xE69B, 0xE69D, 0xE69F, 0xE6A3, 0xE6A5, 0xE6DB, 0xE6DD, 0xE6DF, 
      0xE6E5, 0xE6E7, 0xE6E9, 0xE6EB, 0xE72B, 0xE737, 0xE739, 0xE73D, 0xE77D, 0xEA95, 0xEEDD, 0xEEDF, 0xEEE1, 0xEEE3, 0xEEE5, 0xEF23, 
      0xEF25, 0xEF27, 0xEF29, 0xEF2B, 0xEF2D, 0xEF2F, 0xEF31, 0xEF71, 0xEF73, 0xEF7B, 0xF729, 0xF76B, 0xF76D, 0xF76F, 0xF771, 0xF773, 
      0xF775, 0xF7B3, 0xF7B5, 0xF7B7, 0xF7B9, 0xF7BD, 0xF801, 0xF83F, 0xF885, 0xF94B, 0xF98D, 0xFA11, 0xFB19, 0xFB5B, 0xFB9D, 0xFBDF, 
      0xFC21, 0xFC63, 0xFCA5, 0xFCE7, 0xFD27, 0xFD6B, 0xFDED, 0xFDEF, 0xFE31, 0xFE73, 0xFF39, 0xFF7B, 0xFFB5, 0xFFB7, 0xFFB9, 0xFFBB, 
      0xFFBD, 0xFFF9, 0xFFFB, 0xFFFD, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF
      
};
const unsigned char Clouds[3600] = {
      0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 
...      
};If someone could help me i would really appreciate it - many hours of work will go down the drain otherwise! I'm totally at a loss at what the problem could be!
 
	
