mirror of
https://github.com/FunKey-Project/picodrive-irixxxx.git
synced 2026-03-30 16:52:52 +02:00
psp port runs, bad colors
git-svn-id: file:///home/notaz/opt/svn/PicoDrive@275 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
@@ -1,7 +1,15 @@
|
||||
#if defined(__GP2X__) || defined(PSP)
|
||||
#include <stdio.h>
|
||||
#define lprintf printf
|
||||
#if defined(__GP2X__)
|
||||
#include <stdio.h>
|
||||
#define lprintf printf
|
||||
#elif defined(PSP)
|
||||
#if 0
|
||||
#include <stdio.h>
|
||||
#define lprintf printf
|
||||
#else
|
||||
extern void lprintf_f(const char *fmt, ...);
|
||||
#define lprintf lprintf_f
|
||||
#endif
|
||||
#else
|
||||
#include "giz.h"
|
||||
#include "giz.h"
|
||||
#endif
|
||||
|
||||
|
||||
@@ -164,7 +164,12 @@ static int parse_hex_color(char *buff)
|
||||
{
|
||||
char *endp = buff;
|
||||
int t = (int) strtoul(buff, &endp, 16);
|
||||
if (endp != buff) return ((t>>8)&0xf800) | ((t>>5)&0x07e0) | ((t>>3)&0x1f);
|
||||
if (endp != buff)
|
||||
#ifdef PSP
|
||||
return ((t<<8)&0xf800) | ((t>>5)&0x07e0) | ((t>>19)&0x1f);
|
||||
#else
|
||||
return ((t>>8)&0xf800) | ((t>>5)&0x07e0) | ((t>>3)&0x1f);
|
||||
#endif
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@@ -80,7 +80,11 @@ void readpng(void *dest, const char *fname, readpng_what what)
|
||||
int len = width;
|
||||
while (len--)
|
||||
{
|
||||
*dst++ = ((src[0]&0xf8)<<8) | ((src[1]&0xf8)<<3) | (src[2] >> 3);
|
||||
#ifdef PSP
|
||||
*dst++ = ((src[2]&0xf8)<<8) | ((src[1]&0xf8)<<3) | (src[0] >> 3); // BGR
|
||||
#else
|
||||
*dst++ = ((src[0]&0xf8)<<8) | ((src[1]&0xf8)<<3) | (src[2] >> 3); // RGB
|
||||
#endif
|
||||
src += 3;
|
||||
}
|
||||
dst += BG_WIDTH - width;
|
||||
|
||||
Reference in New Issue
Block a user