notaz.gp2x.de
/
fceu.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
compile fix
[fceu.git]
/
drivers
/
gp2x_test
/
minimal.c
diff --git
a/drivers/gp2x_test/minimal.c
b/drivers/gp2x_test/minimal.c
index
a32a08f
..
57c98f6
100644
(file)
--- a/
drivers/gp2x_test/minimal.c
+++ b/
drivers/gp2x_test/minimal.c
@@
-13,6
+13,7
@@
#include "../gp2x/minimal.h"
#include "../gp2x/usbjoy.h"
#include "../gp2x/minimal.h"
#include "../gp2x/usbjoy.h"
+#include "../gp2x/cpuctrl.h"
SDL_Surface *screen;
void *gp2x_screen;
SDL_Surface *screen;
void *gp2x_screen;
@@
-84,7
+85,7
@@
void gp2x_video_setpalette(int *pal, int len)
}
}
-void gp2x_video_RGB_setscaling(int
ln_offs, int
W, int H)
+void gp2x_video_RGB_setscaling(int W, int H)
{
}
{
}
@@
-92,6
+93,10
@@
void gp2x_video_set_offs(int offs)
{
}
{
}
+void gp2x_video_flush_cache(void)
+{
+}
+
void gp2x_memcpy_buffers(int buffers, void *data, int offset, int len)
{
}
void gp2x_memcpy_buffers(int buffers, void *data, int offset, int len)
{
}
@@
-199,9
+204,9
@@
void gp2x_init(void)
{
printf("entering init()\n"); fflush(stdout);
{
printf("entering init()\n"); fflush(stdout);
- gp2x_screen = malloc(320*240*2);
+ gp2x_screen = malloc(320*240*2
+ 32
);
if(gp2x_screen == NULL) return;
if(gp2x_screen == NULL) return;
- memset(gp2x_screen, 0, 320*240*2);
+ memset(gp2x_screen, 0, 320*240*2
+ 32
);
if(SDL_Init(SDL_INIT_NOPARACHUTE))
{
if(SDL_Init(SDL_INIT_NOPARACHUTE))
{
@@
-235,6
+240,7
@@
void gp2x_deinit(void)
SDL_QuitSubSystem(SDL_INIT_VIDEO);
SDL_Quit();
SDL_QuitSubSystem(SDL_INIT_VIDEO);
SDL_Quit();
+ free(gp2x_screen);
if (sounddev > 0) close(sounddev);
gp2x_usbjoy_deinit();
}
if (sounddev > 0) close(sounddev);
gp2x_usbjoy_deinit();
}
@@
-261,6
+267,14
@@
void set_gamma(int g100)
{
}
{
}
+void set_LCD_custom_rate(lcd_rate_t rate)
+{
+}
+
+void unset_LCD_custom_rate(void)
+{
+}
+
int mmuhack(void)
{
int mmuhack(void)
{
@@
-282,7
+296,20
@@
void spend_cycles(int c)
usleep(c/200);
}
usleep(c/200);
}
+void convert2RGB555(unsigned short *dst, unsigned char *src, unsigned short *pal, int count)
+{
+ while (count--)
+ *dst++ = pal[*src++];
+}
+
+/* don't scale, just convert */
void soft_scale(void *dst, unsigned short *pal, int line_offs, int lines)
{
void soft_scale(void *dst, unsigned short *pal, int line_offs, int lines)
{
+ unsigned char *src = (unsigned char *)dst + (line_offs + lines) * 320;
+ unsigned short *dest = (unsigned short *)dst + (line_offs + lines) * 320;
+ int count = lines*320;
+
+ while (count--)
+ *(--dest) = pal[*(--src)];
}
}