For some reason, when I draw my image it seems like it draws over a triangular wedge of the lower left corner of it, a big one. I think it's drawing over it cause it doesn't show the text I'm drawing there when I draw the sprite, but it shows the text when I don't draw the sprite. Before I put the image in the loop it displayed the whole thing. Anyways, I have no idea what's happening with it. Here's the code, I hope someone can help:
There's some keychecking after the drawing in the loop, too, but I don't think that's relevant. If you need the image or the object file, I can post it.
Code:
#include "gp32.h"
#include "fileio.h"
#include "color.h"
unsigned short *fb[2];
short bgcolor = 0;
short fgcolor = 0xffff;
int erlvl = 0;
int letter = 0;
extern unsigned char title[];
char capt[60] = "Command Prompt";
char buffer=0;
void swap_screen()
{
gp_setFramebuffer(fb[buffer],1);
buffer++;
if(buffer == 2)
buffer=0;
}
int length(char* str)
{
int i=0;
while(str[i] != '\0')
{ i++; }
return i;
}
int main()
{
gp_setCpuspeed(33);
fb[0] = (unsigned short*) FRAMEBUFFER;
fb[1] = (unsigned short*) FRAMEBUFFER;
gp_initFramebuffer(fb[0],16,85);
gp_clearFramebuffer16(fb[0],bgcolor);
gp_clearFramebuffer16(fb[1],bgcolor);
int i;
while(1)
{
swap_screen();
gp_clearFramebuffer16(fb[buffer],bgcolor);
gp_drawSpriteH((u16*)title,0,0,fb[buffer]);
gp_drawString(25,8,length(capt),capt,fgcolor,fb[buffer]);
}
}