initial psp code, functional menu

git-svn-id: file:///home/notaz/opt/svn/PicoDrive/platform@274 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
notaz 2007-10-11 20:43:48 +00:00
parent e86e20be70
commit 2951214ea6
15 changed files with 2135 additions and 5 deletions

View file

@ -26,7 +26,11 @@
#elif defined(__GIZ__)
#include "../gizmondo/giz.h"
#define SCREEN_WIDTH 321
#define SCREEN_BUFFER giz_screen // ?
#define SCREEN_BUFFER giz_screen
#elif defined(PSP)
#include "../psp/psp.h"
#define SCREEN_WIDTH 512
#define SCREEN_BUFFER psp_screen
#endif
char *PicoConfigFile = "picoconfig.bin";

View file

@ -1,4 +1,5 @@
#if defined(__GP2X__)
#if defined(__GP2X__) || defined(PSP)
#include <stdio.h>
#define lprintf printf
#else
#include "giz.h"

View file

@ -22,6 +22,10 @@
#define SCREEN_WIDTH 321
#define SCREEN_BUFFER menu_screen
extern unsigned char *menu_screen;
#elif defined(PSP)
#include "../psp/psp.h"
#define SCREEN_WIDTH 512
#define SCREEN_BUFFER psp_screen
#endif
char menuErrorMsg[64] = { 0, };
@ -216,6 +220,7 @@ void menu_init(void)
int tmp = parse_hex_color(buff+16);
if (tmp >= 0) menu_sel_color = tmp;
else lprintf("skin.txt: parse error for selection_color\n");
lprintf("sel color: %04x\n", menu_sel_color);
}
else
lprintf("skin.txt: parse error: %s\n", buff);

View file

@ -4,6 +4,14 @@
#include "readpng.h"
#include "lprintf.h"
#ifdef PSP
#define BG_WIDTH 480
#define BG_HEIGHT 272
#else
#define BG_WIDTH 320
#define BG_HEIGHT 240
#endif
void readpng(void *dest, const char *fname, readpng_what what)
{
FILE *fp;
@ -62,9 +70,9 @@ void readpng(void *dest, const char *fname, readpng_what what)
break;
}
height = info_ptr->height;
if (height > 240) height = 240;
if (height > BG_HEIGHT) height = BG_HEIGHT;
width = info_ptr->width;
if (width > 320) width = 320;
if (width > BG_WIDTH) width = BG_WIDTH;
for (h = 0; h < height; h++)
{
@ -75,7 +83,7 @@ void readpng(void *dest, const char *fname, readpng_what what)
*dst++ = ((src[0]&0xf8)<<8) | ((src[1]&0xf8)<<3) | (src[2] >> 3);
src += 3;
}
dst += 320 - width;
dst += BG_WIDTH - width;
}
break;
}