revive pandora and win32 builds, rm gp2x dep for linux, lots of refactoring

git-svn-id: file:///home/notaz/opt/svn/PicoDrive/platform@842 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
notaz 2009-12-16 23:38:37 +00:00
parent a96477bb5e
commit d2f29611d1
24 changed files with 722 additions and 1039 deletions

View file

@ -13,7 +13,6 @@ asm_ym2612 = 1
asm_misc = 1
asm_cdpico = 1
asm_cdmemory = 1
amalgamate = 0
#profile = 1
#drc_debug = 3
@ -34,14 +33,6 @@ DEFINES += ARM __GP2X__ IN_GP2X IN_EVDEV # BENCHMARK
CFLAGS += -Wall -Winline -I../.. -I.
ifeq ($(DEBUG),)
CFLAGS += -O3 -fomit-frame-pointer -fstrict-aliasing -ffast-math
else
CFLAGS += -ggdb
endif
ifeq "$(profile)" "1"
CFLAGS += -fprofile-generate
endif
ifeq "$(profile)" "2"
CFLAGS += -fprofile-use
endif
CFLAGS += -mcpu=arm920t -mtune=arm920t
ASFLAGS = -mcpu=arm920t -mfloat-abi=soft
@ -58,53 +49,27 @@ OBJS += plat.o warm.o pollux_set.o soc.o soc_mmsp2.o soc_pollux.o soc_dummy.o em
# 940 core control
OBJS += 940ctl.o
# ARM stuff
OBJS += pico/carthw/svp/compiler.o pico/carthw/svp/stub_arm.o
OBJS += pico/sound/mix_arm.o
# common
OBJS += platform/common/emu.o platform/common/menu.o platform/common/fonts.o platform/common/config.o \
platform/common/arm_utils.o platform/common/arm_linux.o platform/common/readpng.o \
platform/common/mp3_helix.o platform/common/input.o platform/common/main.o \
platform/linux/sndout_oss.o platform/linux/plat.o platform/linux/in_evdev.o
# Pico
ifeq "$(amalgamate)" "1"
OBJS += ../../picoAll.o
else
OBJS += pico/area.o pico/cart.o pico/memory.o pico/pico.o pico/sek.o pico/z80if.o \
pico/videoport.o pico/draw2.o pico/draw.o pico/mode4.o pico/sms.o \
pico/misc.o pico/eeprom.o pico/patch.o pico/debug.o
# Pico - CD
OBJS += pico/cd/pico.o pico/cd/memory.o pico/cd/sek.o pico/cd/LC89510.o \
pico/cd/cd_sys.o pico/cd/cd_file.o pico/cd/cue.o pico/cd/gfx_cd.o \
pico/cd/area.o pico/cd/misc.o pico/cd/pcm.o pico/cd/buffering.o
endif
# Pico - 32X
OBJS += pico/32x/32x.o pico/32x/memory.o pico/32x/draw.o pico/32x/pwm.o
# Pico - Pico
OBJS += pico/pico/pico.o pico/pico/memory.o pico/pico/xpcm.o
# Pico - carthw
OBJS += pico/carthw/carthw.o pico/carthw/svp/svp.o pico/carthw/svp/memory.o \
pico/carthw/svp/ssp16.o pico/carthw/svp/compiler.o pico/carthw/svp/stub_arm.o
# Pico - sound
ifneq "$(amalgamate)" "1"
OBJS += pico/sound/sound.o
endif
OBJS += pico/sound/mix_arm.o
OBJS += pico/sound/sn76496.o pico/sound/ym2612.o
# unzip
OBJS += unzip/unzip.o unzip/unzip_stream.o
# zlib
OBJS += zlib/gzio.o zlib/inffast.o zlib/inflate.o zlib/inftrees.o zlib/trees.o \
zlib/deflate.o zlib/crc32.o zlib/adler32.o zlib/zutil.o zlib/compress.o
CFLAGS += $(addprefix -D,$(DEFINES))
vpath %.c = ../..
vpath %.s = ../..
vpath %.S = ../..
DIRS = platform platform/gp2x platform/linux platform/common pico pico/cd pico/pico pico/32x \
pico/sound pico/carthw/svp zlib unzip cpu cpu/musashi cpu/Cyclone/proj cpu/Cyclone/tools \
cpu/mz80 cpu/DrZ80 cpu/sh2/mame cpu/drc
DIRS += platform/gp2x platform/linux zlib unzip
all: mkdirs PicoDrive
@ -113,6 +78,8 @@ include ../common/common.mak
include ../common/common_arm.mak
include ../common/revision.mak
CFLAGS += $(addprefix -D,$(DEFINES))
# partial linking helps profiled builds due to section merging
PicoDrive.o : $(OBJS) ../common/helix/$(CROSS)helix-mp3.a
$(LD) -r -o $@ $^

View file

@ -40,21 +40,6 @@ static int osd_fps_x, osd_y;
extern void *gp2x_screens[4];
int plat_get_root_dir(char *dst, int len)
{
extern char **g_argv;
int j;
strncpy(dst, g_argv[0], len);
len -= 32; // reserve
if (len < 0) len = 0;
dst[len] = 0;
for (j = strlen(dst); j > 0; j--)
if (dst[j] == '/') { dst[j+1] = 0; break; }
return j + 1;
}
static void scaling_update(void)
{
@ -76,21 +61,7 @@ void pemu_prep_defconfig(void)
{
gp2x_soc_t soc;
memset(&defaultConfig, 0, sizeof(defaultConfig));
defaultConfig.EmuOpt = 0x9d | EOPT_RAM_TIMINGS|EOPT_CONFIRM_SAVE|EOPT_EN_CD_LEDS;
defaultConfig.s_PicoOpt = POPT_EN_STEREO|POPT_EN_FM|POPT_EN_PSG|POPT_EN_Z80 |
POPT_EN_MCD_PCM|POPT_EN_MCD_CDDA|POPT_EN_SVP_DRC|POPT_ACC_SPRITES |
POPT_EN_32X|POPT_EN_PWM;
defaultConfig.s_PsndRate = 44100;
defaultConfig.s_PicoRegion = 0; // auto
defaultConfig.s_PicoAutoRgnOrder = 0x184; // US, EU, JP
defaultConfig.s_PicoCDBuffers = 0;
defaultConfig.Frameskip = -1; // auto
defaultConfig.CPUclock = default_cpu_clock;
defaultConfig.volume = 50;
defaultConfig.gamma = 100;
defaultConfig.scaling = 0;
defaultConfig.turbo_rate = 15;
soc = soc_detect();
if (soc == SOCID_MMSP2)
@ -99,6 +70,23 @@ void pemu_prep_defconfig(void)
defaultConfig.EmuOpt |= EOPT_WIZ_TEAR_FIX|EOPT_SHOW_RTC;
}
void pemu_validate_config(void)
{
gp2x_soc_t soc;
soc = soc_detect();
if (soc != SOCID_MMSP2)
PicoOpt &= ~POPT_EXT_FM;
if (soc != SOCID_POLLUX)
currentConfig.EmuOpt &= ~EOPT_WIZ_TEAR_FIX;
if (currentConfig.gamma < 10 || currentConfig.gamma > 300)
currentConfig.gamma = 100;
if (currentConfig.CPUclock < 10 || currentConfig.CPUclock > 1024)
currentConfig.CPUclock = default_cpu_clock;
}
static void (*osd_text)(int x, int y, const char *text);
static void osd_text8(int x, int y, const char *text)
@ -346,13 +334,13 @@ void pemu_update_display(const char *fps, const char *notice)
}
}
if (notice || (emu_opt & 2)) {
if (notice || (emu_opt & EOPT_SHOW_FPS)) {
if (notice)
osd_text(4, osd_y, notice);
if (emu_opt & 2)
osd_text(osd_fps_x, osd_y, fps);
}
if ((emu_opt & 0x400) && (PicoAHW & PAHW_MCD))
if ((PicoAHW & PAHW_MCD) && (emu_opt & EOPT_EN_CD_LEDS))
draw_cd_leds();
if (PicoAHW & PAHW_PICO)
draw_pico_ptr();

View file

@ -80,6 +80,9 @@ static int in_gp2x_get_wiz_bits(void)
}
#ifdef FAKE_IN_GP2X
volatile unsigned short *gp2x_memregs;
gp2x_soc_t soc_detect(void) { return -1; }
static int in_gp2x_get_fake_bits(void)
{
extern int current_keys;

View file

@ -69,26 +69,6 @@ char cpu_clk_name[16] = "GP2X CPU clocks";
void plat_video_menu_enter(int is_rom_loaded)
{
if (is_rom_loaded)
{
// darken the active framebuffer
memset(g_screen_ptr, 0, 320*8*2);
menu_darken_bg((char *)g_screen_ptr + 320*8*2, 320*224, 1);
memset((char *)g_screen_ptr + 320*232*2, 0, 320*8*2);
}
else
{
char buff[256];
// should really only happen once, on startup..
emu_make_path(buff, "skin/background.png", sizeof(buff));
if (readpng(g_screen_ptr, buff, READPNG_BG) < 0)
memset(g_screen_ptr, 0, 320*240*2);
}
// copy to buffer2, switch to black
gp2x_memcpy_buffers((1<<2), g_screen_ptr, 0, 320*240*2);
/* try to switch nicely avoiding tearing on Wiz */
gp2x_video_wait_vsync();
memset(gp2x_screens[0], 0, 320*240*2);
@ -114,23 +94,6 @@ void plat_video_menu_end(void)
gp2x_video_flip2();
}
void plat_validate_config(void)
{
gp2x_soc_t soc;
soc = soc_detect();
if (soc != SOCID_MMSP2)
PicoOpt &= ~POPT_EXT_FM;
if (soc != SOCID_POLLUX)
currentConfig.EmuOpt &= ~EOPT_WIZ_TEAR_FIX;
if (currentConfig.gamma < 10 || currentConfig.gamma > 300)
currentConfig.gamma = 100;
if (currentConfig.CPUclock < 10 || currentConfig.CPUclock > 1024)
currentConfig.CPUclock = default_cpu_clock;
}
void plat_early_init(void)
{
gp2x_soc_t soc;
@ -175,6 +138,9 @@ void plat_init(void)
gp2x_memset_all_buffers(0, 0, 320*240*2);
// use buffer2 for menubg (using only buffers 0, 1 in menu)
g_menubg_ptr = gp2x_screens[2];
// snd
sndout_oss_init();
}