Right now I'm trying to see if I can create a file and have it put Sprite data in it, but I keep getting the segfault:
Code:
This is my save code:
Code:
I put the PrintXY's for debugging purposes, but it doesn't display them so I assume it's something before. Any ideas?
Also, do you see anything with my previous problem above?
Code:
System ERROR
REBOOT :[EXIT]
INITIALIZE:[EXE]
ILLEGAL CODE ERR
TARGET=00000000
PC =00000000
This is my save code:
Code:
void saveFile(char *filename, color_t *data, int width, int height){
char widthbuffer[sizeof(width)/2], heightbuffer[sizeof(height)/2];
int size = sizeof(data)+sizeof(width)+sizeof(height);
char PATH[sizeof("\\\\fls0\\")+strlen1(filename)+sizeof(".ppf")];
unsigned short pFile[sizeof(PATH)*2];
strcat(PATH, "\\\\fls0\\");
strcat(PATH, filename);
strcat(PATH, ".ppf");
Bfile_StrToName_ncpy(pFile, (unsigned char*)PATH, sizeof(PATH));
Bfile_CreateEntry_OS(pFile, CREATEMODE_FILE, &size);
int hFile = Bfile_OpenFile_OS(pFile, 2);
itoa(width, widthbuffer);
PrintXY(1,0,"xxPie1",0,0);
Bfile_WriteFile_OS(hFile, widthbuffer, sizeof(widthbuffer));
Bfile_WriteFile_OS(hFile, "\n", sizeof("\n"));
itoa(height, heightbuffer);
PrintXY(1,0,"xxPie2",0,0);
Bfile_WriteFile_OS(hFile, heightbuffer, sizeof(heightbuffer));
Bfile_WriteFile_OS(hFile, "\n", sizeof("\n"));
PrintXY(1,0,"xxPie3",0,0);
Bfile_WriteFile_OS(hFile, data, sizeof(data));
Bfile_WriteFile_OS(hFile, "\n", sizeof("\n"));
Bfile_CloseFile_OS(hFile);
}
I put the PrintXY's for debugging purposes, but it doesn't display them so I assume it's something before. Any ideas?
Also, do you see anything with my previous problem above?