+# release packaging makefile\r
+\r
+VER := $(shell head -n 1 ../common/version.h | \\r
+ sed 's/.*"\(.*\)\.\(.*\)".*/\1\2/g')\r
+BUILD := $(shell git describe HEAD | grep -- - | \\r
+ sed -e 's/.*\-\(.*\)\-.*/\1/')\r
+ifneq "$(BUILD)" ""\r
+VER := $(VER)_$(BUILD)\r
+endif\r
+\r
+all: rel\r
+\r
+../../tools/textfilter:\r
+ make -C ../../tools/\r
+\r
readme.txt: ../../tools/textfilter ../base_readme.txt\r
../../tools/textfilter ../base_readme.txt $@ GP2X\r
\r
-VER ?= $(shell head -n 1 version.h | sed 's/.*"\(.*\)\.\(.*\)".*/\1\2/g')\r
CODE940 = code940/pico940_v3.bin\r
\r
-rel: PicoDrive PicoDrive.gpe $(CODE940) readme.txt ../game_def.cfg \\r
+rel: ../../PicoDrive PicoDrive.gpe $(CODE940) readme.txt ../game_def.cfg \\r
PicoDrive.png PicoDrive_s.png PicoDrive_t.png \\r
warm_2.4.25.o warm_2.4.26-open2x.o warm_2.6.24.ko \\r
../../pico/carthw.cfg\r
--- /dev/null
+[info]
+name="PicoDrive"
+path="/PicoDrive/PicoDrive.gpe"
+icon="/PicoDrive/PicoDrive_s.png"
+title="/PicoDrive/PicoDrive_t.png"
+group="GAMES"
}\r
\r
/* XXX */\r
-#ifdef __GP2X__\r
unsigned int plat_get_ticks_ms(void)\r
{\r
return gp2x_get_ticks_ms();\r
{\r
return gp2x_get_ticks_us();\r
}\r
-#endif\r
\r
void plat_wait_till_us(unsigned int us_to)\r
{\r
if (currentConfig.EmuOpt & EOPT_WIZ_TEAR_FIX)\r
gp2x_mode = -gp2x_mode;\r
\r
- gp2x_video_changemode(gp2x_mode);\r
+ gp2x_video_changemode(gp2x_mode, Pico.m.pal);\r
\r
Pico.m.dirtyPal = 1;\r
\r
\r
void pemu_sound_start(void)\r
{\r
- emu_sound_start();\r
-\r
- plat_target_step_volume(¤tConfig.volume, 0);\r
-\r
-#if 0\r
- static int PsndRate_old = 0, PicoOpt_old = 0, pal_old = 0;\r
+ gp2x_soc_t soc;\r
\r
- PsndOut = NULL;\r
+ emu_sound_start();\r
\r
- // prepare sound stuff\r
if (currentConfig.EmuOpt & EOPT_EN_SOUND)\r
{\r
- int is_stereo = (PicoOpt & POPT_EN_STEREO) ? 1 : 0;\r
- int snd_rate_oss = PsndRate;\r
- gp2x_soc_t soc;\r
-\r
- memset(sndBuffer, 0, sizeof(sndBuffer));\r
- PsndOut = sndBuffer;\r
- PicoWriteSound = oss_write_nonblocking;\r
- plat_update_volume(0, 0);\r
-\r
- printf("starting audio: %i len: %i stereo: %i, pal: %i\n",\r
- PsndRate, PsndLen, is_stereo, Pico.m.pal);\r
- sndout_oss_start(snd_rate_oss, is_stereo, 1);\r
- sndout_oss_setvol(currentConfig.volume, currentConfig.volume);\r
-\r
soc = soc_detect();\r
- if (soc == SOCID_POLLUX)\r
+ if (soc == SOCID_POLLUX) {\r
PsndRate = pollux_get_real_snd_rate(PsndRate);\r
-\r
- #define SOUND_RERATE_FLAGS (POPT_EN_FM|POPT_EN_PSG|POPT_EN_STEREO|POPT_EXT_FM|POPT_EN_MCD_CDDA)\r
- if (PsndRate != PsndRate_old || Pico.m.pal != pal_old || ((PicoOpt & POPT_EXT_FM) && crashed_940) ||\r
- ((PicoOpt ^ PicoOpt_old) & SOUND_RERATE_FLAGS)) {\r
PsndRerate(Pico.m.frame_count ? 1 : 0);\r
}\r
\r
- PsndRate_old = PsndRate;\r
- PicoOpt_old = PicoOpt;\r
- pal_old = Pico.m.pal;\r
+ plat_target_step_volume(¤tConfig.volume, 0);\r
}\r
-#endif\r
}\r
\r
static const int sound_rates[] = { 44100, 32000, 22050, 16000, 11025, 8000 };\r
void (*gp2x_video_flip)(void);
void (*gp2x_video_flip2)(void);
-void (*gp2x_video_changemode_ll)(int bpp);
+void (*gp2x_video_changemode_ll)(int bpp, int is_pal);
void (*gp2x_video_setpalette)(int *pal, int len);
void (*gp2x_video_RGB_setscaling)(int ln_offs, int W, int H);
void (*gp2x_video_wait_vsync)(void);
{ 0, 0, 0 }
};
-void gp2x_video_changemode(int bpp)
+void gp2x_video_changemode(int bpp, int is_pal)
{
- gp2x_video_changemode_ll(bpp);
+ gp2x_video_changemode_ll(bpp, is_pal);
gp2x_current_bpp = bpp < 0 ? -bpp : bpp;
}
gp2x_video_flip2();
// switch to 16bpp
- gp2x_video_changemode_ll(16);
+ gp2x_video_changemode_ll(16, 0);
gp2x_video_RGB_setscaling(0, 320, 240);
-printf("menu_enter\n");
}
void plat_video_menu_begin(void)
extern void (*gp2x_video_flip)(void);
extern void (*gp2x_video_flip2)(void);
/* negative bpp means rotated mode (for Wiz) */
-extern void (*gp2x_video_changemode_ll)(int bpp);
+extern void (*gp2x_video_changemode_ll)(int bpp, int is_pal);
extern void (*gp2x_video_setpalette)(int *pal, int len);
extern void (*gp2x_video_RGB_setscaling)(int ln_offs, int W, int H);
extern void (*gp2x_video_wait_vsync)(void);
/* ??? */
-void gp2x_video_changemode(int bpp);
+void gp2x_video_changemode(int bpp, int is_pal);
void gp2x_memcpy_all_buffers(void *data, int offset, int len);
void gp2x_memset_all_buffers(int offset, int byte, int len);
g_screen_ptr = gp2x_screens[++screensel&1];
}
-static void gp2x_video_changemode_ll_(int bpp)
+static void gp2x_video_changemode_ll_(int bpp, int is_pal)
{
-printf("changemode %d\n", bpp);
memregs[0x28DA>>1] = (((bpp+1)/8)<<9)|0xAB; /*8/15/16/24bpp...*/
memregs[0x290C>>1] = 320*((bpp+1)/8); /*line width in bytes*/
}
void vid_mmsp2_finish(void)
{
gp2x_video_RGB_setscaling_(0, 320, 240);
- gp2x_video_changemode_ll_(16);
+ gp2x_video_changemode_ll_(16, 0);
memregs[0x290E>>1] = gp2x_screenaddr_old[0];
memregs[0x2910>>1] = gp2x_screenaddr_old[1];
#include "../common/arm_utils.h"
#include "plat.h"
-#define fb_buf_count 4
-static unsigned int fb_paddr[fb_buf_count];
+#define FB_BUF_COUNT 4
+#define FB_MEM_SIZE (320*240*2 * FB_BUF_COUNT)
+
+static unsigned int fb_paddr[FB_BUF_COUNT];
static int fb_work_buf;
static int fbdev = -1;
-static unsigned short memtimex_old[2];
-static int last_pal_setting = 0;
-
-
-/* misc */
-static void pollux_set_fromenv(const char *env_var)
-{
- const char *set_string;
- set_string = getenv(env_var);
- if (set_string)
- pollux_set(memregs, set_string);
- else
- printf("env var %s not defined.\n", env_var);
-}
/* video stuff */
static void pollux_video_flip(int buf_count)
{
- memregl[0x406C>>2] = fb_paddr[fb_work_buf];
+ memregl[0x406C>>2] = memregl[0x446C>>2] = fb_paddr[fb_work_buf];
memregl[0x4058>>2] |= 0x10;
+ memregl[0x4458>>2] |= 0x10;
+
fb_work_buf++;
if (fb_work_buf >= buf_count)
fb_work_buf = 0;
static void gp2x_video_flip_(void)
{
- pollux_video_flip(fb_buf_count);
+ pollux_video_flip(FB_BUF_COUNT);
}
/* doulblebuffered flip */
pollux_video_flip(2);
}
-static void gp2x_video_changemode_ll_(int bpp)
+static void gp2x_video_changemode_ll_(int bpp, int is_pal)
{
static int prev_bpp = 0;
int code = 0, bytes = 2;
memregl[0x4000>>2] |= 1 << 3;
/* the above ioctl resets LCD timings, so set them here */
- snprintf(buff, sizeof(buff), "POLLUX_LCD_TIMINGS_%s", last_pal_setting ? "PAL" : "NTSC");
- pollux_set_fromenv(buff);
+ snprintf(buff, sizeof(buff), "POLLUX_LCD_TIMINGS_%s",
+ is_pal ? "PAL" : "NTSC");
+ pollux_set_fromenv(memregs, buff);
switch (abs(bpp))
{
return;
}
- memregl[0x405c>>2] = bytes;
- memregl[0x4060>>2] = bytes * (bpp < 0 ? 240 : 320);
+ // program both MLCs so that TV-out works
+ memregl[0x405c>>2] = memregl[0x445c>>2] = bytes;
+ memregl[0x4060>>2] = memregl[0x4460>>2] =
+ bytes * (bpp < 0 ? 240 : 320);
r = memregl[0x4058>>2];
r = (r & 0xffff) | (code << 16) | 0x10;
memregl[0x4058>>2] = r;
+
+ r = memregl[0x4458>>2];
+ r = (r & 0xffff) | (code << 16) | 0x10;
+ memregl[0x4458>>2] = r;
}
static void gp2x_video_setpalette_(int *pal, int len)
memregl[0x308c>>2] |= 1 << 10;
}
-/* RAM timings */
-static void set_ram_timings_(void)
-{
- pollux_set_fromenv("POLLUX_RAM_TIMINGS");
-}
-
-static void unset_ram_timings_(void)
-{
- int i;
-
- memregs[0x14802>>1] = memtimex_old[0];
- memregs[0x14804>>1] = memtimex_old[1] | 0x8000;
-
- for (i = 0; i < 0x100000; i++)
- if (!(memregs[0x14804>>1] & 0x8000))
- break;
-
- printf("RAM timings reset to startup values.\n");
-}
-
void vid_pollux_init(void)
{
struct fb_fix_screeninfo fbfix;
printf("framebuffer: \"%s\" @ %08lx\n", fbfix.id, fbfix.smem_start);
fb_paddr[0] = fbfix.smem_start;
- gp2x_screens[0] = mmap(0, 320*240*2*fb_buf_count, PROT_READ|PROT_WRITE,
+ gp2x_screens[0] = mmap(0, FB_MEM_SIZE, PROT_READ|PROT_WRITE,
MAP_SHARED, memdev, fb_paddr[0]);
if (gp2x_screens[0] == MAP_FAILED)
{
perror("mmap(gp2x_screens) failed");
exit(1);
}
- memset(gp2x_screens[0], 0, 320*240*2*fb_buf_count);
+ memset(gp2x_screens[0], 0, FB_MEM_SIZE);
printf(" %p -> %08x\n", gp2x_screens[0], fb_paddr[0]);
- for (i = 1; i < fb_buf_count; i++)
+ for (i = 1; i < FB_BUF_COUNT; i++)
{
fb_paddr[i] = fb_paddr[i-1] + 320*240*2;
gp2x_screens[i] = (char *)gp2x_screens[i-1] + 320*240*2;
fb_work_buf = 0;
g_screen_ptr = gp2x_screens[0];
- set_ram_timings_();
-
gp2x_video_flip = gp2x_video_flip_;
gp2x_video_flip2 = gp2x_video_flip2_;
gp2x_video_changemode_ll = gp2x_video_changemode_ll_;
void vid_pollux_finish(void)
{
- munmap(gp2x_screens[0], 320*240*2 * fb_buf_count);
+ memset(gp2x_screens[0], 0, FB_MEM_SIZE);
+ munmap(gp2x_screens[0], FB_MEM_SIZE);
close(fbdev);
fbdev = -1;
-
- unset_ram_timings_();
}
-Subproject commit 1bc471ebf1c85cf78f1862f5596a76f051e7112d
+Subproject commit 39014486f9e50110d23dece007ce4c0ed90d15b1