From b0e318f7f0c1cbb4a1fa7926045c6309ee37b117 Mon Sep 17 00:00:00 2001 From: notaz Date: Thu, 12 Nov 2009 16:42:42 +0000 Subject: [PATCH] 32x: drc: first implementation finished, no more interpreter dep git-svn-id: file:///home/notaz/opt/svn/PicoDrive/platform@832 be3aeb3a-fb24-0410-a615-afba39da0efa --- common/common.mak | 78 +++++++++++++++++++++++++++++++++++++++++++ common/common_arm.mak | 14 -------- gp2x/Makefile | 52 +++++------------------------ linux/Makefile | 72 +++++---------------------------------- 4 files changed, 95 insertions(+), 121 deletions(-) create mode 100644 common/common.mak diff --git a/common/common.mak b/common/common.mak new file mode 100644 index 0000000..edc8aae --- /dev/null +++ b/common/common.mak @@ -0,0 +1,78 @@ +# === CPU cores === +# --- M68k --- +ifeq "$(use_musashi)" "1" +DEFINES += EMU_M68K +OBJS += cpu/musashi/m68kops.o cpu/musashi/m68kcpu.o +#OBJS += cpu/musashi/m68kdasm.o +endif +ifeq "$(use_cyclone)" "1" +DEFINES += EMU_C68K +OBJS += pico/m68kif_cyclone.o cpu/Cyclone/proj/Cyclone.o cpu/Cyclone/tools/idle.o +endif +ifeq "$(use_fame)" "1" +DEFINES += EMU_F68K +OBJS += cpu/fame/famec.o +endif + +# --- Z80 --- +ifeq "$(use_mz80)" "1" +DEFINES += _USE_MZ80 +OBJS += cpu/mz80/mz80.o +endif +# +ifeq "$(use_drz80)" "1" +DEFINES += _USE_DRZ80 +OBJS += cpu/DrZ80/drz80.o +endif +# +ifeq "$(use_cz80)" "1" +DEFINES += _USE_CZ80 +OBJS += cpu/cz80/cz80.o +endif + +# --- SH2 --- +OBJS += cpu/sh2/sh2.o +OBJS += cpu/drc/cmn.o +# +ifeq "$(use_sh2drc)" "1" +DEFINES += DRC_SH2 +OBJS += cpu/sh2/compiler.o +OBJS += cpu/sh2/stub_$(ARCH).o +ifdef drc_debug +DEFINES += DRC_DEBUG=$(drc_debug) +OBJS += cpu/sh2/mame/sh2dasm.o +OBJS += platform/linux/host_dasm.o +LDFLAGS += -lbfd -lopcodes -liberty +endif +ifeq "$(drc_debug_interp)" "1" +DEFINES += DRC_DEBUG_INTERP +use_sh2mame = 1 +endif +endif +# +ifeq "$(use_sh2mame)" "1" +OBJS += cpu/sh2/mame/sh2pico.o +endif + + +# random deps +pico/carthw/svp/compiler.o : ../../cpu/drc/emit_$(ARCH).c +cpu/sh2/compiler.o : ../../cpu/drc/emit_$(ARCH).c +cpu/sh2/mame/sh2pico.o : ../../cpu/sh2/mame/sh2.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 + +../../cpu/musashi/m68kops.c : + @make -C ../../cpu/musashi + +../../cpu/mz80/mz80.asm : + @make -C ../../cpu/mz80/ + +cpu/fame/famec.o : ../../cpu/fame/famec.c ../../cpu/fame/famec_opcodes.h + @echo ">>>" $< + $(CC) $(CFLAGS) -Wno-unused -c $< -o $@ + +../../cpu/Cyclone/proj/Cyclone.s: + @echo building Cyclone... + @make -C ../../cpu/Cyclone/proj CONFIG_FILE=config_pico.h + diff --git a/common/common_arm.mak b/common/common_arm.mak index 6f8eb9a..11270a3 100644 --- a/common/common_arm.mak +++ b/common/common_arm.mak @@ -45,20 +45,6 @@ clean_prof: mkdirs: mkdir -p $(DIRS) -# 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 - -# build Cyclone -../../cpu/Cyclone/proj/Cyclone.s: - @echo building Cyclone... - @make -C ../../cpu/Cyclone/proj CONFIG_FILE=config_pico.h - -../../cpu/musashi/m68kops.c : - @make -C ../../cpu/musashi - # build helix libs ../common/helix/$(CROSS)helix-mp3.a: make -C ../common/helix clean all diff --git a/gp2x/Makefile b/gp2x/Makefile index 934be24..cdfea37 100644 --- a/gp2x/Makefile +++ b/gp2x/Makefile @@ -1,8 +1,12 @@ -export CROSS = arm-linux- +CROSS ?= arm-linux- # settings -#mz80 = 1 -#debug_cyclone = 1 +use_cyclone = 1 +#use_musashi = 1 +use_drz80 = 1 +use_sh2drc = 1 +#use_sh2mame = 1 + asm_memory = 1 asm_render = 1 asm_ym2612 = 1 @@ -11,8 +15,6 @@ asm_cdpico = 1 asm_cdmemory = 1 amalgamate = 0 #profile = 1 -#use_musashi = 1 -use_sh2drc = 1 #drc_debug = 3 -include Makefile.local @@ -25,10 +27,9 @@ ifeq "$(use_musashi)" "1" # due to CPU stop flag acces asm_cdpico = 0 asm_cdmemory = 0 -else -use_cyclone = 1 endif +ARCH = arm DEFINES += ARM __GP2X__ IN_GP2X IN_EVDEV # BENCHMARK CFLAGS += -Wall -Winline -I../.. -I. ifeq ($(DEBUG),) @@ -94,42 +95,6 @@ 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 -# debug -ifeq "$(debug_cyclone)" "1" -OBJS += pico/DebugCPU.o cpu/musashi/m68kdasm.o -endif -# CPU cores -ifeq "$(use_musashi)" "1" -DEFINES += EMU_M68K -OBJS += cpu/musashi/m68kops.o cpu/musashi/m68kcpu.o -endif -ifeq "$(use_cyclone)" "1" -DEFINES += EMU_C68K -OBJS += pico/m68kif_cyclone.o cpu/Cyclone/proj/Cyclone.o cpu/Cyclone/tools/idle.o -endif -ifeq "$(mz80)" "1" -DEFINES += _USE_MZ80 -OBJS += cpu/mz80/mz80.o -else -DEFINES += _USE_DRZ80 -OBJS += cpu/DrZ80/drz80.o -endif -OBJS += cpu/sh2/sh2.o -ifeq "$(use_sh2drc)" "1" -DEFINES += DRC_SH2 DRC_TMP -OBJS += cpu/sh2/mame/sh2pico.o -OBJS += cpu/sh2/compiler.o -OBJS += cpu/sh2/stub_arm.o -ifdef drc_debug -DEFINES += DRC_DEBUG=$(drc_debug) -OBJS += cpu/sh2/mame/sh2dasm.o -OBJS += platform/linux/host_dasm.o -LDFLAGS += -lbfd -lopcodes -liberty -endif -else -OBJS += cpu/sh2/mame/sh2pico.o -endif -OBJS += cpu/drc/cmn.o CFLAGS += $(addprefix -D,$(DEFINES)) @@ -144,6 +109,7 @@ DIRS = platform platform/gp2x platform/linux platform/common pico pico/cd pico/p all: mkdirs PicoDrive +include ../common/common.mak include ../common/common_arm.mak include ../common/revision.mak diff --git a/linux/Makefile b/linux/Makefile index 3638286..6c28e41 100644 --- a/linux/Makefile +++ b/linux/Makefile @@ -1,9 +1,12 @@ # settings use_musashi = 1 #use_fame = 1 -#use_mz80 = 1 +use_cz80 = 1 use_sh2drc = 1 +#use_sh2mame = 1 + #drc_debug = 3 +#drc_debug_interp = 1 #profile = 1 #fake_in_gp2x = 1 @@ -70,47 +73,6 @@ 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 zlib/uncompr.o # unzip OBJS += unzip/unzip.o unzip/unzip_stream.o -# CPU cores -ifeq "$(use_musashi)" "1" -DEFINES += EMU_M68K -OBJS += cpu/musashi/m68kops.o cpu/musashi/m68kcpu.o -#OBJS += cpu/musashi/m68kdasm.o -endif -ifeq "$(use_fame)" "1" -DEFINES += EMU_F68K -OBJS += cpu/fame/famec.o -endif -# z80 -ifeq "$(use_mz80)" "1" -DEFINES += _USE_MZ80 -OBJS += cpu/mz80/mz80.o -else -DEFINES += _USE_CZ80 -OBJS += cpu/cz80/cz80.o -endif -# sh2 -OBJS += cpu/sh2/sh2.o -ifeq "$(use_sh2drc)" "1" -DEFINES += DRC_SH2 DRC_TMP -OBJS += cpu/sh2/mame/sh2pico.o -OBJS += cpu/sh2/compiler.o -OBJS += cpu/sh2/stub_$(ARCH).o -ifdef drc_debug -DEFINES += DRC_DEBUG=$(drc_debug) -OBJS += cpu/sh2/mame/sh2dasm.o -OBJS += host_dasm.o -LDFLAGS += -lbfd -lopcodes -liberty -endif -else -OBJS += cpu/sh2/mame/sh2pico.o -endif -OBJS += cpu/drc/cmn.o -# misc -ifeq "$(use_fame)" "1" -ifeq "$(use_musashi)" "1" -OBJS += pico/debugCPU.o -endif -endif CFLAGS += $(addprefix -D,$(DEFINES)) @@ -119,10 +81,13 @@ vpath %.s = ../.. vpath %.S = ../.. vpath %.asm = ../.. -DIRS = platform platform/gp2x platform/common pico pico/cd pico/pico pico/sound pico/carthw/svp \ +DIRS = platform/linux platform/gp2x platform/common pico pico/cd pico/pico pico/sound pico/carthw/svp \ pico/32x zlib unzip cpu cpu/musashi cpu/fame cpu/mz80 cpu/cz80 cpu/sh2/mame cpu/drc all: mkdirs PicoDrive + +include ../common/common.mak + clean: tidy @$(RM) PicoDrive tidy: @@ -139,22 +104,6 @@ mkdirs: include ../common/revision.mak -pico/carthw/svp/compiler.o : ../../cpu/drc/emit_arm.c -cpu/sh2/compiler.o : ../../cpu/drc/emit_x86.c -cpu/sh2/mame/sh2pico.o : ../../cpu/sh2/mame/sh2.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 - -../../cpu/musashi/m68kops.c : - @make -C ../../cpu/musashi - -cpu/mz80/mz80.o : ../../cpu/mz80/mz80.asm - @echo $@ - @nasm -f elf $< -o $@ - -../../cpu/mz80/mz80.asm : - @make -C ../../cpu/mz80/ - .c.o: @echo ">>>" $< $(CC) $(CFLAGS) -c $< -o $@ @@ -165,8 +114,3 @@ cpu/mz80/mz80.o : ../../cpu/mz80/mz80.asm @echo ">>>" $< nasm -f elf $< -o $@ - -cpu/fame/famec.o : ../../cpu/fame/famec.c ../../cpu/fame/famec_opcodes.h - @echo ">>>" $< - $(CC) $(CFLAGS) -Wno-unused -c $< -o $@ - -- 2.39.5