From ad9071bee0b64aecd69874d1eaff3a06ac70debf Mon Sep 17 00:00:00 2001 From: Jeroen Domburg Date: Thu, 23 Mar 2017 20:47:28 +0800 Subject: [PATCH] Add more tme esp32 files --- components/tme/Makefile | 26 ++++++++++++++++++++++++++ components/tme/component.mk | 26 ++++++++++++++++++++++++++ components/tme/romhack/.gitignore | 2 ++ components/tme/tmeconfig.h | 20 ++++++++++++++++++++ 4 files changed, 74 insertions(+) create mode 100644 components/tme/Makefile create mode 100644 components/tme/component.mk create mode 100644 components/tme/romhack/.gitignore create mode 100644 components/tme/tmeconfig.h diff --git a/components/tme/Makefile b/components/tme/Makefile new file mode 100644 index 0000000..c81d17a --- /dev/null +++ b/components/tme/Makefile @@ -0,0 +1,26 @@ +#Makefile for a native (SDL) tme build + +TARGET:=tme +MUSASHI_GEN_SRC:=musashi/m68kopac.c musashi/m68kopdm.c musashi/m68kopnz.c +MUSASHI_OP_PREGEN_SRC:=musashi/m68kops_pre.c +OBJ:=$(MUSASHI_GEN_SRC:%.x=%.o) $(MUSASHI_OP_PREGEN_SRC:%.x=%.o) musashi/m68kcpu.o sdl/main.o emu.o sdl/disp.o iwm.o via.o rtc.o ncr.o sdl/hd.o +#musashi/m68kdasm.o +CFLAGS=-Wall -I. -I./musashi -Og -ggdb `sdl2-config --cflags` +LDFLAGS=`sdl2-config --libs` + +$(TARGET): $(OBJ) + $(CC) -o $(@) $(CFLAGS) $(LDFLAGS) $^ + +$(MUSASHI_GEN_SRC): musashi/m68kmake + cd musashi; ../$(^) + +$(MUSASHI_OP_PREGEN_SRC): $(MUSASHI_GEN_SRC) + $(CC) -o musashi/m68kops musashi/m68kops.c + ./musashi/m68kops > $(MUSASHI_OP_PREGEN_SRC) + +musashi/m68kmake: musashi/m68kmake.c + $(CC) -o $@ $^ + +clean: + rm -f $(MUSASHI_GEN_SRC) musashi/m68kmake + rm -f $(OBJ) $(TARGET) diff --git a/components/tme/component.mk b/components/tme/component.mk new file mode 100644 index 0000000..8b9c060 --- /dev/null +++ b/components/tme/component.mk @@ -0,0 +1,26 @@ +# +# Component Makefile +# + +COMPONENT_ADD_INCLUDEDIRS := . ./musashi +COMPONENT_SRCDIRS := . musashi + +MUSASHI_GEN_SRC := musashi/m68kops_pre.c musashi/m68kopac.c musashi/m68kopdm.c musashi/m68kopnz.c +MUSASHI_GEN_OBJ := $(MUSASHI_GEN_SRC:%.c=%.o) +COMPONENT_OBJS := $(MUSASHI_GEN_OBJ) musashi/m68kcpu.o emu.o iwm.o via.o rtc.o ncr.o + +CFLAGS += -Wno-error=implicit-function-declaration + +#Some deeper Make magic to generate the file that generates bits and pieces of the +#68K emu, and run that to get the C files we need. +#We generate the things in the src dir, which is less optimal, but eh, it works. + +COMPONENT_EXTRA_CLEAN := $(addprefix $(COMPONENT_PATH)/musashi/,$(MUSASHI_GEN_SRC) m68kmake) + +#Using wildcard magic here because otherwise Make will invoke this multiple times. +#$(COMPONENT_PATH)/musashi/ +musashi/m68kop%.c: $(COMPONENT_PATH)/musashi/m68kmake + cd $(COMPONENT_PATH)/musashi/; ./m68kmake; $(HOSTCC) -o m68kops_gen m68kops_gen.c; ./m68kops_gen > m68kops_pre.c + +$(COMPONENT_PATH)/musashi/m68kmake: $(COMPONENT_PATH)/musashi/m68kmake.c + $(HOSTCC) -o $@ $^ diff --git a/components/tme/romhack/.gitignore b/components/tme/romhack/.gitignore new file mode 100644 index 0000000..ea86054 --- /dev/null +++ b/components/tme/romhack/.gitignore @@ -0,0 +1,2 @@ +recalcchs +*.o \ No newline at end of file diff --git a/components/tme/tmeconfig.h b/components/tme/tmeconfig.h new file mode 100644 index 0000000..dacaf58 --- /dev/null +++ b/components/tme/tmeconfig.h @@ -0,0 +1,20 @@ + + +#define TME_ROMSIZE (128*1024) + + +#define TME_MAC128K + +#ifndef TME_MAC128K + +#define TME_RAMSIZE (1024*1024) +#define TME_SCREENBUF (TME_RAMSIZE-0x5900) +#define TME_SCREENBUF_ALT (TME_RAMSIZE-0xD900) + +#else + +#define TME_RAMSIZE (128*1024) +#define TME_SCREENBUF 0x1A700 +#define TME_SCREENBUF_ALT 0x12700 + +#endif \ No newline at end of file