# asm stuff
ifeq "$(asm_render)" "1"
-DEFINC += -D_ASM_DRAW_C
+DEFINES += _ASM_DRAW_C
OBJS += pico/draw_arm.o pico/draw2_arm.o
endif
ifeq "$(asm_memory)" "1"
-DEFINC += -D_ASM_MEMORY_C
+DEFINES += _ASM_MEMORY_C
OBJS += pico/memory_arm.o
endif
ifeq "$(asm_ym2612)" "1"
-DEFINC += -D_ASM_YM2612_C
+DEFINES += _ASM_YM2612_C
OBJS += pico/sound/ym2612_arm.o
endif
ifeq "$(asm_misc)" "1"
-DEFINC += -D_ASM_MISC_C
+DEFINES += _ASM_MISC_C
OBJS += pico/misc_arm.o
OBJS += pico/cd/misc_arm.o
endif
ifeq "$(asm_cdpico)" "1"
-DEFINC += -D_ASM_CD_PICO_C
+DEFINES += _ASM_CD_PICO_C
OBJS += pico/cd/pico_arm.o
endif
ifeq "$(asm_cdmemory)" "1"
-DEFINC += -D_ASM_CD_MEMORY_C
+DEFINES += _ASM_CD_MEMORY_C
OBJS += pico/cd/memory_arm.o
endif
.c.o:
@echo ">>>" $<
- $(CC) $(CFLAGS) $(DEFINC) -c $< -o $@
+ $(CC) $(CFLAGS) -c $< -o $@
.S.o:
@echo ">>>" $<
- $(CC) $(SFLAGS) $(DEFINC) -c $< -o $@
+ $(CC) $(CFLAGS) -c $< -o $@
../../tools/textfilter: ../../tools/textfilter.c
mkdirs:
mkdir -p $(DIRS)
-# deps
-pico/carthw/svp/compiler.o : ../../pico/carthw/svp/ssp16.o ../../pico/carthw/svp/gen_arm.c
+# some deps
+pico/carthw/svp/compiler.o : ../../pico/carthw/svp/ssp16.o ../../cpu/drc/emit_arm.c
+cpu/sh2/compiler.o : ../../cpu/drc/emit_arm.c
pico/pico.o pico/cd/pico.o : ../../pico/pico_cmn.c ../../pico/pico_int.h
pico/memory.o pico/cd/memory.o : ../../pico/pico_int.h ../../pico/memory.h
amalgamate = 0\r
#profile = 1\r
#use_musashi = 1\r
-use_sh2mame = 1\r
-#up = 1\r
+use_sh2drc = 1\r
+drc_debug = 1\r
\r
\r
ifeq "$(debug_cyclone)" "1"\r
use_cyclone = 1\r
endif\r
\r
-DEFINC = -I../.. -I. -DARM -D__GP2X__ -DIN_GP2X -DIN_EVDEV # -DBENCHMARK\r
-CFLAGS += -Wall -Winline\r
+DEFINES += ARM __GP2X__ IN_GP2X IN_EVDEV # BENCHMARK\r
+CFLAGS += -Wall -Winline -I../.. -I.\r
ifeq ($(DEBUG),)\r
CFLAGS += -O3 -fomit-frame-pointer -fstrict-aliasing -ffast-math\r
else\r
CFLAGS += -fprofile-use\r
endif\r
CFLAGS += -mcpu=arm920t -mtune=arm920t\r
-SFLAGS = $(CFLAGS)\r
ASFLAGS = -mcpu=arm920t -mfloat-abi=soft\r
+LDFLAGS += -lm -lpng\r
+\r
CC = $(CROSS)gcc\r
STRIP = $(CROSS)strip\r
AS = $(CROSS)as\r
OBJCOPY = $(CROSS)objcopy\r
\r
# frontend\r
-OBJS += plat.o warm.o pollux_set.o soc.o soc_mmsp2.o soc_pollux.o emu.o in_gp2x.o\r
+OBJS += plat.o warm.o pollux_set.o soc.o soc_mmsp2.o soc_pollux.o soc_dummy.o emu.o in_gp2x.o\r
# 940 core control\r
OBJS += 940ctl.o\r
\r
endif\r
# CPU cores\r
ifeq "$(use_musashi)" "1"\r
-DEFINC += -DEMU_M68K\r
+DEFINES += EMU_M68K\r
OBJS += cpu/musashi/m68kops.o cpu/musashi/m68kcpu.o\r
endif\r
ifeq "$(use_cyclone)" "1"\r
-DEFINC += -DEMU_C68K\r
+DEFINES += EMU_C68K\r
OBJS += pico/m68kif_cyclone.o cpu/Cyclone/proj/Cyclone.o cpu/Cyclone/tools/idle.o\r
endif\r
ifeq "$(mz80)" "1"\r
-DEFINC += -D_USE_MZ80\r
+DEFINES += _USE_MZ80\r
OBJS += cpu/mz80/mz80.o\r
else\r
-DEFINC += -D_USE_DRZ80\r
+DEFINES += _USE_DRZ80\r
OBJS += cpu/DrZ80/drz80.o\r
endif\r
OBJS += cpu/sh2/sh2.o\r
-ifeq "$(use_sh2mame)" "1"\r
+ifeq "$(use_sh2drc)" "1"\r
+DEFINES += DRC_SH2 DRC_TMP\r
OBJS += cpu/sh2/mame/sh2pico.o\r
+OBJS += cpu/sh2/compiler.o\r
+OBJS += cpu/sh2/stub_arm.o\r
+ifeq "$(drc_debug)" "1"\r
+DEFINES += DRC_DEBUG=1\r
+OBJS += cpu/sh2/mame/sh2dasm.o\r
+OBJS += platform/linux/host_dasm.o\r
+LDFLAGS += -lbfd -lopcodes -liberty\r
+endif\r
else\r
+OBJS += cpu/sh2/mame/sh2pico.o\r
endif\r
OBJS += cpu/drc/cmn.o\r
\r
+CFLAGS += $(addprefix -D,$(DEFINES))\r
+\r
vpath %.c = ../..\r
vpath %.s = ../..\r
vpath %.S = ../..\r
# also libm on F100 is not compatible\r
PicoDrive : PicoDrive.o\r
@echo ">>>" $@\r
- $(CC) -static -o $@ $(CFLAGS) $^ -lm -lpng -Wl,-Map=$@.map\r
+ $(CC) -static -o $@ $(CFLAGS) $^ $(LDFLAGS) -Wl,-Map=$@.map\r
ifeq ($(DEBUG),)\r
$(STRIP) $@\r
endif\r
default_cpu_clock = 533;
break;
default:
- fprintf(stderr, "could not recognize SoC, bailing out.\n");
- exit(1);
+ printf("could not recognize SoC, running in dummy mode.\n");
+ break;
}
}
menu_plat_setup(1);
break;
default:
+ dummy_init();
break;
}
case SOCID_POLLUX:
pollux_finish();
break;
+ default:
+ dummy_finish();
+ break;
}
sndout_oss_exit();
{
volatile unsigned short *memregs;
volatile unsigned int *memregl;
- static gp2x_soc_t ret = -1;
+ static gp2x_soc_t ret = -2;
int pollux_chipname[0x30/4 + 1];
char *pollux_chipname_c = (char *)pollux_chipname;
int memdev;
int i;
- if (ret != -1)
+ if (ret != -2)
/* already detected */
return ret;
if (memdev == -1)
{
perror("open(/dev/mem)");
+ ret = -1;
return -1;
}
{
perror("mmap(memregs)");
close(memdev);
+ ret = -1;
return -1;
}
memregl = (volatile void *)memregs;
void pollux_init(void);
void pollux_finish(void);
+void dummy_init(void);
+void dummy_finish(void);
+
/* SoC specific functions */
extern void (*gp2x_video_flip)(void);
extern void (*gp2x_video_flip2)(void);
--- /dev/null
+/* dummy code for qemu testing, etc */
+#include <stdlib.h>
+
+#include "soc.h"
+#include "../common/emu.h"
+
+extern void *gp2x_screens[4];
+
+extern unsigned int plat_get_ticks_ms_good(void);
+extern unsigned int plat_get_ticks_us_good(void);
+
+/* video stuff */
+static void gp2x_video_flip_(void)
+{
+}
+
+/* doulblebuffered flip */
+static void gp2x_video_flip2_(void)
+{
+}
+
+static void gp2x_video_changemode_ll_(int bpp)
+{
+}
+
+static void gp2x_video_setpalette_(int *pal, int len)
+{
+}
+
+static void gp2x_video_RGB_setscaling_(int ln_offs, int W, int H)
+{
+}
+
+static void gp2x_video_wait_vsync_(void)
+{
+}
+
+/* CPU clock */
+static void gp2x_set_cpuclk_(unsigned int mhz)
+{
+}
+
+/* RAM timings */
+static void set_ram_timings_(void)
+{
+}
+
+static void unset_ram_timings_(void)
+{
+}
+
+/* LCD refresh */
+static void set_lcd_custom_rate_(int is_pal)
+{
+}
+
+static void unset_lcd_custom_rate_(void)
+{
+}
+
+static void set_lcd_gamma_(int g100, int A_SNs_curve)
+{
+}
+
+static int gp2x_read_battery_(void)
+{
+ return 0;
+}
+
+void dummy_init(void)
+{
+ int i;
+ g_screen_ptr = malloc(320 * 240 * 2);
+ for (i = 0; i < array_size(gp2x_screens); i++)
+ gp2x_screens[i] = g_screen_ptr;
+
+ gp2x_video_flip = gp2x_video_flip_;
+ gp2x_video_flip2 = gp2x_video_flip2_;
+ gp2x_video_changemode_ll = gp2x_video_changemode_ll_;
+ gp2x_video_setpalette = gp2x_video_setpalette_;
+ gp2x_video_RGB_setscaling = gp2x_video_RGB_setscaling_;
+ gp2x_video_wait_vsync = gp2x_video_wait_vsync_;
+
+ gp2x_set_cpuclk = gp2x_set_cpuclk_;
+
+ set_lcd_custom_rate = set_lcd_custom_rate_;
+ unset_lcd_custom_rate = unset_lcd_custom_rate_;
+ set_lcd_gamma = set_lcd_gamma_;
+
+ set_ram_timings = set_ram_timings_;
+ unset_ram_timings = unset_ram_timings_;
+ gp2x_read_battery = gp2x_read_battery_;
+
+ gp2x_get_ticks_ms = plat_get_ticks_ms_good;
+ gp2x_get_ticks_us = plat_get_ticks_us_good;
+}
+
+void dummy_finish(void)
+{
+ free(gp2x_screens[0]);
+}
+
static unsigned short memtimex_old[2];
static unsigned short reg0910;
-extern unsigned int plat_get_ticks_ms_gtod(void);
-extern unsigned int plat_get_ticks_us_gtod(void);
+extern unsigned int plat_get_ticks_ms_good(void);
+extern unsigned int plat_get_ticks_us_good(void);
/* video stuff */
static void gp2x_video_flip_(void)
unset_ram_timings = unset_ram_timings_;
gp2x_read_battery = gp2x_read_battery_;
- gp2x_get_ticks_ms = plat_get_ticks_ms_gtod;
- gp2x_get_ticks_us = plat_get_ticks_us_gtod;
+ gp2x_get_ticks_ms = plat_get_ticks_ms_good;
+ gp2x_get_ticks_us = plat_get_ticks_us_good;
}
void mmsp2_finish(void)
DEFINES += DRC_DEBUG=1
OBJS += cpu/sh2/mame/sh2dasm.o
OBJS += host_dasm.o
-LDFLAGS += -lbfd -lopcodes
+LDFLAGS += -lbfd -lopcodes -liberty
endif
else
OBJS += cpu/sh2/mame/sh2pico.o
#define BFD_MACH bfd_mach_i386_i386_intel_syntax
#endif
-/* hacks for ARM */
-int floatformat_to_double;
-int floatformat_ieee_single_little;
-
/* symbols */
static asymbol **symbols;
static long symcount;
#ifdef __GP2X__
/* Wiz has a borked gettimeofday().. */
-#define plat_get_ticks_ms plat_get_ticks_ms_gtod
-#define plat_get_ticks_us plat_get_ticks_us_gtod
+#define plat_get_ticks_ms plat_get_ticks_ms_good
+#define plat_get_ticks_us plat_get_ticks_us_good
#endif
unsigned int plat_get_ticks_ms(void)