diff --git a/BootROMs/dmg_boot.asm b/BootROMs/dmg_boot.asm index 2cf0591..7fba493 100644 --- a/BootROMs/dmg_boot.asm +++ b/BootROMs/dmg_boot.asm @@ -92,9 +92,9 @@ Start: ; Set registers to match the original DMG boot IF DEF(MGB) - ld hl, $01B0 -ELSE ld hl, $FFB0 +ELSE + ld hl, $01B0 ENDC push hl pop af diff --git a/libretro/Makefile b/libretro/Makefile index cde75a0..87ae472 100644 --- a/libretro/Makefile +++ b/libretro/Makefile @@ -8,17 +8,20 @@ endif CFLAGS += -DSAMEBOY_CORE_VERSION=\"$(VERSION)\" +platform=ctr + ifeq ($(platform),) -platform = unix -ifeq ($(shell uname -a),) - platform = win -else ifneq ($(findstring MINGW,$(shell uname -a)),) - platform = win -else ifneq ($(findstring Darwin,$(shell uname -a)),) - platform = osx -else ifneq ($(findstring win,$(shell uname -a)),) - platform = win -endif + platform = unix + + ifeq ($(shell uname -a),) + platform = win + else ifneq ($(findstring MINGW,$(shell uname -a)),) + platform = win + else ifneq ($(findstring Darwin,$(shell uname -a)),) + platform = osx + else ifneq ($(findstring win,$(shell uname -a)),) + platform = win + endif endif # system platform @@ -94,6 +97,18 @@ else ifeq ($(platform), wiiu) CFLAGS += -DGEKKO -DHW_RVL -DWIIU -mwup -mcpu=750 -meabi -mhard-float -D__ppc__ -DMSB_FIRST -I$(DEVKITPRO)/libogc/include CFLAGS += -U__INT32_TYPE__ -U __UINT32_TYPE__ -D__INT32_TYPE__=int STATIC_LINKING = 1 + # CTR(3DS) +else ifeq ($(platform), ctr) + TARGET := $(TARGET_NAME)_libretro_$(platform).a + CC = $(DEVKITARM)/bin/arm-none-eabi-gcc$(EXE_EXT) + AR = $(DEVKITARM)/bin/arm-none-eabi-ar$(EXE_EXT) + CFLAGS += -DARM11 -D_3DS + CFLAGS += -march=armv6k -mtune=mpcore -mfloat-abi=hard + CFLAGS += -Wall -mword-relocations + CFLAGS += -fomit-frame-pointer -ffast-math + CFLAGS += -I$(CTRULIB)/include + CFLAGS += -std=c99 -DUSE_VFS_3DS + STATIC_LINKING = 1 else ifneq (,$(findstring osx,$(platform))) TARGET := $(TARGET_NAME)_libretro.dylib fpic := -fPIC @@ -178,10 +193,13 @@ $(CORE_DIR)/build/bin/BootROMs/%_boot.bin: $(MAKE) -C $(CORE_DIR) $(patsubst $(CORE_DIR)/%,%,$@) $(TARGET): $(OBJECTS) + @echo "** BUILDING $(TARGET) FOR PLATFORM $(platform) **" -@$(MKDIR) -p $(dir $@) ifeq ($(STATIC_LINKING), 1) + echo $(AR) rcs $@ $(OBJECTS) $(AR) rcs $@ $(OBJECTS) else + echo $(CC) $(fpic) $(SHARED) $(INCFLAGS) -o $@ $(OBJECTS) $(LDFLAGS) $(CC) $(fpic) $(SHARED) $(INCFLAGS) -o $@ $(OBJECTS) $(LDFLAGS) endif