mirror of
https://github.com/ekeeke/Genesis-Plus-GX.git
synced 2024-12-27 19:51:48 +01:00
commit
afefce4496
@ -2,317 +2,258 @@ DEBUG = 0
|
|||||||
LOGSOUND = 0
|
LOGSOUND = 0
|
||||||
FRONTEND_SUPPORTS_RGB565 = 1
|
FRONTEND_SUPPORTS_RGB565 = 1
|
||||||
|
|
||||||
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
|
|
||||||
arch = intel
|
|
||||||
ifeq ($(shell uname -p),powerpc)
|
|
||||||
arch = ppc
|
|
||||||
endif
|
|
||||||
else ifneq ($(findstring win,$(shell uname -a)),)
|
|
||||||
platform = win
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
# system platform
|
# system platform
|
||||||
system_platform = unix
|
ifeq ($(platform),)
|
||||||
ifeq ($(shell uname -a),)
|
platform = unix
|
||||||
EXE_EXT = .exe
|
ifeq ($(shell uname -a),)
|
||||||
system_platform = win
|
platform = win
|
||||||
else ifneq ($(findstring Darwin,$(shell uname -a)),)
|
EXE_EXT = .exe
|
||||||
system_platform = osx
|
else ifneq ($(findstring MINGW,$(shell uname -a)),)
|
||||||
arch = intel
|
platform = win
|
||||||
ifeq ($(shell uname -p),powerpc)
|
else ifneq ($(findstring Darwin,$(shell uname -a)),)
|
||||||
arch = ppc
|
platform = osx
|
||||||
endif
|
arch = intel
|
||||||
else ifneq ($(findstring MINGW,$(shell uname -a)),)
|
ifeq ($(shell uname -p),powerpc)
|
||||||
system_platform = win
|
arch = ppc
|
||||||
|
endif
|
||||||
|
else ifneq ($(findstring win,$(shell uname -a)),)
|
||||||
|
platform = win
|
||||||
|
endif
|
||||||
|
else ifneq (,$(findstring armv,$(platform)))
|
||||||
|
override platform += unix
|
||||||
|
else ifneq (,$(findstring rpi,$(platform)))
|
||||||
|
override platform += unix
|
||||||
endif
|
endif
|
||||||
|
|
||||||
TARGET_NAME := genesis_plus_gx
|
TARGET_NAME := genesis_plus_gx
|
||||||
|
|
||||||
LIBM := -lm
|
LIBM := -lm
|
||||||
|
|
||||||
GIT_VERSION ?= " $(shell git rev-parse --short HEAD || echo unknown)"
|
GIT_VERSION ?= " $(shell git rev-parse --short HEAD || echo unknown)"
|
||||||
ifneq ($(GIT_VERSION)," unknown")
|
ifneq ($(GIT_VERSION)," unknown")
|
||||||
CFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\"
|
CFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Unix
|
# Unix
|
||||||
ifeq ($(platform), unix)
|
ifneq (,$(findstring unix,$(platform)))
|
||||||
TARGET := $(TARGET_NAME)_libretro.so
|
TARGET := $(TARGET_NAME)_libretro.so
|
||||||
fpic := -fPIC
|
fpic := -fPIC
|
||||||
SHARED := -shared -Wl,--version-script=libretro/link.T -Wl,--no-undefined
|
SHARED := -shared -Wl,--version-script=libretro/link.T -Wl,--no-undefined
|
||||||
ENDIANNESS_DEFINES := -DLSB_FIRST -DBYTE_ORDER=LITTLE_ENDIAN
|
ENDIANNESS_DEFINES := -DLSB_FIRST -DBYTE_ORDER=LITTLE_ENDIAN
|
||||||
PLATFORM_DEFINES := -DHAVE_ZLIB
|
PLATFORM_DEFINES := -DHAVE_ZLIB
|
||||||
|
|
||||||
|
# Raspberry Pi
|
||||||
|
ifneq (,$(findstring rpi,$(platform)))
|
||||||
|
ENDIANNESS_DEFINES += -DALIGN_LONG
|
||||||
|
CFLAGS += -fomit-frame-pointer -ffast-math
|
||||||
|
ifneq (,$(findstring rpi1,$(platform)))
|
||||||
|
PLATFORM_DEFINES += -DARM11 -marm -march=armv6j -mfpu=vfp -mfloat-abi=hard
|
||||||
|
else ifneq (,$(findstring rpi2,$(platform)))
|
||||||
|
PLATFORM_DEFINES += -DARM -marm -mcpu=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard
|
||||||
|
else ifneq (,$(findstring rpi3,$(platform)))
|
||||||
|
PLATFORM_DEFINES += -DARM -marm -mcpu=cortex-a53 -mfpu=neon-fp-armv8 -mfloat-abi=hard
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
# Portable Linux
|
# Portable Linux
|
||||||
else ifeq ($(platform), linux-portable)
|
else ifeq ($(platform), linux-portable)
|
||||||
TARGET := $(TARGET_NAME)_libretro.so
|
TARGET := $(TARGET_NAME)_libretro.so
|
||||||
fpic := -fPIC -nostdlib
|
fpic := -fPIC -nostdlib
|
||||||
SHARED := -shared -Wl,--version-script=libretro/link.T
|
SHARED := -shared -Wl,--version-script=libretro/link.T
|
||||||
ENDIANNESS_DEFINES := -DLSB_FIRST -DBYTE_ORDER=LITTLE_ENDIAN
|
ENDIANNESS_DEFINES := -DLSB_FIRST -DBYTE_ORDER=LITTLE_ENDIAN
|
||||||
PLATFORM_DEFINES := -DHAVE_ZLIB
|
PLATFORM_DEFINES := -DHAVE_ZLIB
|
||||||
LIBM :=
|
LIBM :=
|
||||||
|
|
||||||
# OS X
|
# OS X
|
||||||
else ifeq ($(platform), osx)
|
else ifeq ($(platform), osx)
|
||||||
TARGET := $(TARGET_NAME)_libretro.dylib
|
TARGET := $(TARGET_NAME)_libretro.dylib
|
||||||
fpic := -fPIC
|
fpic := -fPIC
|
||||||
SHARED := -dynamiclib
|
SHARED := -dynamiclib
|
||||||
ifeq ($(arch),ppc)
|
ifeq ($(arch),ppc)
|
||||||
ENDIANNESS_DEFINES := -DBYTE_ORDER=BIG_ENDIAN
|
ENDIANNESS_DEFINES := -DBYTE_ORDER=BIG_ENDIAN
|
||||||
else
|
else
|
||||||
ENDIANNESS_DEFINES := -DLSB_FIRST -DBYTE_ORDER=LITTLE_ENDIAN
|
ENDIANNESS_DEFINES := -DLSB_FIRST -DBYTE_ORDER=LITTLE_ENDIAN
|
||||||
endif
|
endif
|
||||||
PLATFORM_DEFINES := -DHAVE_ZLIB
|
PLATFORM_DEFINES := -DHAVE_ZLIB
|
||||||
|
|
||||||
OSXVER = `sw_vers -productVersion | cut -d. -f 2`
|
OSXVER = `sw_vers -productVersion | cut -d. -f 2`
|
||||||
OSX_LT_MAVERICKS = `(( $(OSXVER) <= 9)) && echo "YES"`
|
OSX_LT_MAVERICKS = `(( $(OSXVER) <= 9)) && echo "YES"`
|
||||||
fpic += -mmacosx-version-min=10.1
|
fpic += -mmacosx-version-min=10.1
|
||||||
ifndef ($(NOUNIVERSAL))
|
ifndef ($(NOUNIVERSAL))
|
||||||
CFLAGS += $(ARCHFLAGS)
|
CFLAGS += $(ARCHFLAGS)
|
||||||
LDFLAGS += $(ARCHFLAGS)
|
LDFLAGS += $(ARCHFLAGS)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# iOS
|
# iOS
|
||||||
else ifneq (,$(findstring ios,$(platform)))
|
else ifneq (,$(findstring ios,$(platform)))
|
||||||
|
TARGET := $(TARGET_NAME)_libretro_ios.dylib
|
||||||
|
fpic := -fPIC
|
||||||
|
SHARED := -dynamiclib
|
||||||
|
ENDIANNESS_DEFINES := -DLSB_FIRST -DBYTE_ORDER=LITTLE_ENDIAN
|
||||||
|
PLATFORM_DEFINES := -DHAVE_ZLIB
|
||||||
|
|
||||||
TARGET := $(TARGET_NAME)_libretro_ios.dylib
|
ifeq ($(IOSSDK),)
|
||||||
fpic := -fPIC
|
IOSSDK := $(shell xcrun -sdk iphoneos -show-sdk-path)
|
||||||
SHARED := -dynamiclib
|
endif
|
||||||
ENDIANNESS_DEFINES := -DLSB_FIRST -DBYTE_ORDER=LITTLE_ENDIAN
|
|
||||||
PLATFORM_DEFINES := -DHAVE_ZLIB
|
|
||||||
|
|
||||||
ifeq ($(IOSSDK),)
|
CC = cc -arch armv7 -isysroot $(IOSSDK)
|
||||||
IOSSDK := $(shell xcrun -sdk iphoneos -show-sdk-path)
|
ifeq ($(platform),ios9)
|
||||||
endif
|
CC += -miphoneos-version-min=8.0
|
||||||
|
PLATFORM_DEFINES += -miphoneos-version-min=8.0
|
||||||
CC = cc -arch armv7 -isysroot $(IOSSDK)
|
else
|
||||||
ifeq ($(platform),ios9)
|
CC += -miphoneos-version-min=5.0
|
||||||
CC += -miphoneos-version-min=8.0
|
PLATFORM_DEFINES += -miphoneos-version-min=5.0
|
||||||
PLATFORM_DEFINES += -miphoneos-version-min=8.0
|
endif
|
||||||
else
|
|
||||||
CC += -miphoneos-version-min=5.0
|
|
||||||
PLATFORM_DEFINES += -miphoneos-version-min=5.0
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Theos
|
# Theos
|
||||||
else ifeq ($(platform), theos_ios)
|
else ifeq ($(platform), theos_ios)
|
||||||
DEPLOYMENT_IOSVERSION = 5.0
|
DEPLOYMENT_IOSVERSION = 5.0
|
||||||
TARGET = iphone:latest:$(DEPLOYMENT_IOSVERSION)
|
TARGET = iphone:latest:$(DEPLOYMENT_IOSVERSION)
|
||||||
ARCHS = armv7 armv7s
|
ARCHS = armv7 armv7s
|
||||||
TARGET_IPHONEOS_DEPLOYMENT_VERSION=$(DEPLOYMENT_IOSVERSION)
|
TARGET_IPHONEOS_DEPLOYMENT_VERSION=$(DEPLOYMENT_IOSVERSION)
|
||||||
THEOS_BUILD_DIR := objs
|
THEOS_BUILD_DIR := objs
|
||||||
include $(THEOS)/makefiles/common.mk
|
include $(THEOS)/makefiles/common.mk
|
||||||
|
|
||||||
LIBRARY_NAME = $(TARGET_NAME)_libretro_ios
|
LIBRARY_NAME = $(TARGET_NAME)_libretro_ios
|
||||||
|
|
||||||
ENDIANNESS_DEFINES := -DLSB_FIRST -DBYTE_ORDER=LITTLE_ENDIAN
|
ENDIANNESS_DEFINES := -DLSB_FIRST -DBYTE_ORDER=LITTLE_ENDIAN
|
||||||
PLATFORM_DEFINES := -DHAVE_ZLIB
|
PLATFORM_DEFINES := -DHAVE_ZLIB
|
||||||
|
|
||||||
# QNX
|
# QNX
|
||||||
else ifeq ($(platform), qnx)
|
else ifeq ($(platform), qnx)
|
||||||
TARGET := $(TARGET_NAME)_libretro_qnx.so
|
TARGET := $(TARGET_NAME)_libretro_qnx.so
|
||||||
fpic := -fPIC
|
fpic := -fPIC
|
||||||
SHARED := -shared -Wl,--version-script=libretro/link.T -Wl,--no-undefined
|
SHARED := -shared -Wl,--version-script=libretro/link.T -Wl,--no-undefined
|
||||||
ENDIANNESS_DEFINES := -DLSB_FIRST -DBYTE_ORDER=LITTLE_ENDIAN
|
ENDIANNESS_DEFINES := -DLSB_FIRST -DBYTE_ORDER=LITTLE_ENDIAN
|
||||||
PLATFORM_DEFINES := -DHAVE_ZLIB
|
PLATFORM_DEFINES := -DHAVE_ZLIB
|
||||||
CC = qcc -Vgcc_ntoarmv7le
|
CC = qcc -Vgcc_ntoarmv7le
|
||||||
AR = qcc -Vgcc_ntoarmv7le
|
AR = qcc -Vgcc_ntoarmv7le
|
||||||
PLATFORM_DEFINES := -D__BLACKBERRY_QNX__ -marm -mcpu=cortex-a9 -mfpu=neon -mfloat-abi=softfp
|
PLATFORM_DEFINES := -D__BLACKBERRY_QNX__ -marm -mcpu=cortex-a9 -mfpu=neon -mfloat-abi=softfp
|
||||||
|
|
||||||
# PS3
|
# PS3
|
||||||
else ifeq ($(platform), ps3)
|
else ifneq (,$(filter $(platform), ps3 sncps3 psl1ght))
|
||||||
TARGET := $(TARGET_NAME)_libretro_ps3.a
|
TARGET := $(TARGET_NAME)_libretro_ps3.a
|
||||||
CC = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-gcc.exe
|
PLATFORM_DEFINES := -D__CELLOS_LV2 -DALT_RENDER
|
||||||
AR = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-ar.exe
|
STATIC_LINKING = 1
|
||||||
PLATFORM_DEFINES := -D__CELLOS_LV2 -DALT_RENDER -DBYTE_ORDER=BIG_ENDIAN
|
|
||||||
STATIC_LINKING = 1
|
|
||||||
|
|
||||||
# sncps3
|
# sncps3
|
||||||
else ifeq ($(platform), sncps3)
|
ifneq (,$(findstring sncps3,$(platform)))
|
||||||
TARGET := $(TARGET_NAME)_libretro_ps3.a
|
CC = $(CELL_SDK)/host-win32/sn/bin/ps3ppusnc.exe
|
||||||
CC = $(CELL_SDK)/host-win32/sn/bin/ps3ppusnc.exe
|
AR = $(CELL_SDK)/host-win32/sn/bin/ps3snarl.exe
|
||||||
AR = $(CELL_SDK)/host-win32/sn/bin/ps3snarl.exe
|
PLATFORM_DEFINES += -DBYTE_ORDER=BIG_ENDIAN
|
||||||
PLATFORM_DEFINES := -D__CELLOS_LV2 -DALT_RENDER -DBYTE_ORDER=BIG_ENDIAN
|
|
||||||
STATIC_LINKING = 1
|
|
||||||
|
|
||||||
# Lightweight PS3 Homebrew SDK
|
# PS3
|
||||||
else ifeq ($(platform), psl1ght)
|
else ifneq (,$(findstring ps3,$(platform)))
|
||||||
TARGET := $(TARGET_NAME)_libretro_$(platform).a
|
CC = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-gcc.exe
|
||||||
CC = $(PS3DEV)/ppu/bin/ppu-gcc$(EXE_EXT)
|
AR = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-ar.exe
|
||||||
AR = $(PS3DEV)/ppu/bin/ppu-ar$(EXE_EXT)
|
PLATFORM_DEFINES += -DBYTE_ORDER=BIG_ENDIAN
|
||||||
PLATFORM_DEFINES := -D__CELLOS_LV2 -DALT_RENDER
|
|
||||||
STATIC_LINKING = 1
|
# Lightweight PS3 Homebrew SDK
|
||||||
|
else ifneq (,$(findstring psl1ght,$(platform)))
|
||||||
|
TARGET := $(TARGET_NAME)_libretro_$(platform).a
|
||||||
|
CC = $(PS3DEV)/ppu/bin/ppu-gcc$(EXE_EXT)
|
||||||
|
AR = $(PS3DEV)/ppu/bin/ppu-ar$(EXE_EXT)
|
||||||
|
endif
|
||||||
|
|
||||||
# PSP
|
# PSP
|
||||||
else ifeq ($(platform), psp1)
|
else ifeq ($(platform), psp1)
|
||||||
TARGET := $(TARGET_NAME)_libretro_$(platform).a
|
TARGET := $(TARGET_NAME)_libretro_$(platform).a
|
||||||
CC = psp-gcc$(EXE_EXT)
|
CC = psp-gcc$(EXE_EXT)
|
||||||
AR = psp-ar$(EXE_EXT)
|
AR = psp-ar$(EXE_EXT)
|
||||||
ENDIANNESS_DEFINES := -DLSB_FIRST -DBYTE_ORDER=LITTLE_ENDIAN
|
ENDIANNESS_DEFINES := -DLSB_FIRST -DBYTE_ORDER=LITTLE_ENDIAN
|
||||||
PLATFORM_DEFINES := -DPSP
|
PLATFORM_DEFINES := -DPSP
|
||||||
CFLAGS += -G0
|
CFLAGS += -G0
|
||||||
STATIC_LINKING = 1
|
STATIC_LINKING = 1
|
||||||
|
|
||||||
# Vita
|
# Vita
|
||||||
else ifeq ($(platform), vita)
|
else ifeq ($(platform), vita)
|
||||||
TARGET := $(TARGET_NAME)_libretro_$(platform).a
|
TARGET := $(TARGET_NAME)_libretro_$(platform).a
|
||||||
CC = arm-vita-eabi-gcc$(EXE_EXT)
|
CC = arm-vita-eabi-gcc$(EXE_EXT)
|
||||||
AR = arm-vita-eabi-ar$(EXE_EXT)
|
AR = arm-vita-eabi-ar$(EXE_EXT)
|
||||||
CFLAGS += -O3 -mfloat-abi=hard -ffast-math -fsingle-precision-constant
|
CFLAGS += -O3 -mfloat-abi=hard -ffast-math -fsingle-precision-constant
|
||||||
ENDIANNESS_DEFINES := -DLSB_FIRST -DALIGN_LONG -DALT_RENDERER -DHAVE_ALLOCA_H -DBYTE_ORDER=LITTLE_ENDIAN
|
ENDIANNESS_DEFINES := -DLSB_FIRST -DALIGN_LONG -DALT_RENDERER -DHAVE_ALLOCA_H -DBYTE_ORDER=LITTLE_ENDIAN
|
||||||
PLATFORM_DEFINES := -DVITA
|
PLATFORM_DEFINES := -DVITA
|
||||||
STATIC_LINKING = 1
|
STATIC_LINKING = 1
|
||||||
|
|
||||||
# CTR (3DS)
|
# CTR (3DS)
|
||||||
else ifeq ($(platform), ctr)
|
else ifeq ($(platform), ctr)
|
||||||
TARGET := $(TARGET_NAME)_libretro_$(platform).a
|
TARGET := $(TARGET_NAME)_libretro_$(platform).a
|
||||||
CC = $(DEVKITARM)/bin/arm-none-eabi-gcc$(EXE_EXT)
|
CC = $(DEVKITARM)/bin/arm-none-eabi-gcc$(EXE_EXT)
|
||||||
AR = $(DEVKITARM)/bin/arm-none-eabi-ar$(EXE_EXT)
|
AR = $(DEVKITARM)/bin/arm-none-eabi-ar$(EXE_EXT)
|
||||||
ENDIANNESS_DEFINES := -DLSB_FIRST -DALIGN_LONG -DBYTE_ORDER=LITTLE_ENDIAN -DUSE_DYNAMIC_ALLOC
|
ENDIANNESS_DEFINES := -DLSB_FIRST -DALIGN_LONG -DBYTE_ORDER=LITTLE_ENDIAN -DUSE_DYNAMIC_ALLOC
|
||||||
PLATFORM_DEFINES := -DARM11 -D_3DS
|
PLATFORM_DEFINES := -DARM11 -D_3DS
|
||||||
CFLAGS += -march=armv6k -mtune=mpcore -mfloat-abi=hard -marm -mfpu=vfp
|
CFLAGS += -march=armv6k -mtune=mpcore -mfloat-abi=hard -marm -mfpu=vfp
|
||||||
CFLAGS += -Wall -mword-relocations
|
CFLAGS += -Wall -mword-relocations
|
||||||
CFLAGS += -fomit-frame-pointer -ffast-math
|
CFLAGS += -fomit-frame-pointer -ffast-math
|
||||||
STATIC_LINKING = 1
|
STATIC_LINKING = 1
|
||||||
|
|
||||||
# Raspberry Pi 1
|
|
||||||
else ifeq ($(platform), rpi1)
|
|
||||||
TARGET := $(TARGET_NAME)_libretro.so
|
|
||||||
fpic := -fPIC
|
|
||||||
SHARED := -shared -Wl,--version-script=libretro/link.T -Wl,--no-undefined
|
|
||||||
PLATFORM_DEFINES := -DHAVE_ZLIB
|
|
||||||
PLATFORM_DEFINES += -DARM11
|
|
||||||
PLATFORM_DEFINES += -marm -march=armv6j -mfloat-abi=hard -mfpu=vfp
|
|
||||||
ENDIANNESS_DEFINES := -DLSB_FIRST -DALIGN_LONG -DBYTE_ORDER=LITTLE_ENDIAN
|
|
||||||
CFLAGS += -fomit-frame-pointer -ffast-math
|
|
||||||
CXXFLAGS = $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++11
|
|
||||||
|
|
||||||
# Raspberry Pi 2
|
|
||||||
else ifeq ($(platform), rpi2)
|
|
||||||
TARGET := $(TARGET_NAME)_libretro.so
|
|
||||||
fpic := -fPIC
|
|
||||||
SHARED := -shared -Wl,--version-script=libretro/link.T -Wl,--no-undefined
|
|
||||||
PLATFORM_DEFINES := -DHAVE_ZLIB
|
|
||||||
PLATFORM_DEFINES += -DARM
|
|
||||||
PLATFORM_DEFINES += -marm -mcpu=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard
|
|
||||||
ENDIANNESS_DEFINES := -DLSB_FIRST -DALIGN_LONG -DBYTE_ORDER=LITTLE_ENDIAN
|
|
||||||
CFLAGS += -fomit-frame-pointer -ffast-math
|
|
||||||
CXXFLAGS = $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++11
|
|
||||||
|
|
||||||
# Raspberry Pi 3
|
|
||||||
else ifeq ($(platform), rpi3)
|
|
||||||
TARGET := $(TARGET_NAME)_libretro.so
|
|
||||||
fpic := -fPIC
|
|
||||||
SHARED := -shared -Wl,--version-script=libretro/link.T -Wl,--no-undefined
|
|
||||||
PLATFORM_DEFINES := -DHAVE_ZLIB
|
|
||||||
PLATFORM_DEFINES += -DARM
|
|
||||||
PLATFORM_DEFINES += -marm -mcpu=cortex-a53 -mfpu=neon-fp-armv8 -mfloat-abi=hard
|
|
||||||
ENDIANNESS_DEFINES := -DLSB_FIRST -DALIGN_LONG -DBYTE_ORDER=LITTLE_ENDIAN
|
|
||||||
CFLAGS += -fomit-frame-pointer -ffast-math
|
|
||||||
CXXFLAGS = $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++11
|
|
||||||
|
|
||||||
# Xbox 360
|
# Xbox 360
|
||||||
else ifeq ($(platform), xenon)
|
else ifeq ($(platform), xenon)
|
||||||
TARGET := $(TARGET_NAME)_libretro_xenon360.a
|
TARGET := $(TARGET_NAME)_libretro_xenon360.a
|
||||||
CC = xenon-gcc$(EXE_EXT)
|
CC = xenon-gcc$(EXE_EXT)
|
||||||
AR = xenon-ar$(EXE_EXT)
|
AR = xenon-ar$(EXE_EXT)
|
||||||
PLATFORM_DEFINES := -D__LIBXENON__ -DALT_RENDER
|
PLATFORM_DEFINES := -D__LIBXENON__ -DALT_RENDER
|
||||||
ENDIANNESS_DEFINES := -DBYTE_ORDER=BIG_ENDIAN
|
ENDIANNESS_DEFINES := -DBYTE_ORDER=BIG_ENDIAN
|
||||||
STATIC_LINKING = 1
|
STATIC_LINKING = 1
|
||||||
|
|
||||||
# Nintendo Game Cube
|
# Nintendo GameCube / Wii / WiiU
|
||||||
else ifeq ($(platform), ngc)
|
else ifneq (,$(filter $(platform), ngc wii wiiu))
|
||||||
TARGET := $(TARGET_NAME)_libretro_$(platform).a
|
TARGET := $(TARGET_NAME)_libretro_$(platform).a
|
||||||
CC = $(DEVKITPPC)/bin/powerpc-eabi-gcc$(EXE_EXT)
|
CC = $(DEVKITPPC)/bin/powerpc-eabi-gcc$(EXE_EXT)
|
||||||
AR = $(DEVKITPPC)/bin/powerpc-eabi-ar$(EXE_EXT)
|
AR = $(DEVKITPPC)/bin/powerpc-eabi-ar$(EXE_EXT)
|
||||||
ENDIANNESS_DEFINES := -DBYTE_ORDER=BIG_ENDIAN
|
ENDIANNESS_DEFINES := -DBYTE_ORDER=BIG_ENDIAN
|
||||||
PLATFORM_DEFINES := -DGEKKO -DHW_DOL -mrvl -mcpu=750 -meabi -mhard-float -DALT_RENDER
|
PLATFORM_DEFINES := -DGEKKO -mcpu=750 -meabi -mhard-float -DALT_RENDER
|
||||||
PLATFORM_DEFINES += -U__INT32_TYPE__ -U __UINT32_TYPE__ -D__INT32_TYPE__=int
|
PLATFORM_DEFINES += -U__INT32_TYPE__ -U __UINT32_TYPE__ -D__INT32_TYPE__=int
|
||||||
STATIC_LINKING = 1
|
STATIC_LINKING = 1
|
||||||
|
|
||||||
# Nintendo Wii
|
# Nintendo WiiU
|
||||||
else ifeq ($(platform), wii)
|
ifneq (,$(findstring wiiu,$(platform)))
|
||||||
TARGET := $(TARGET_NAME)_libretro_$(platform).a
|
PLATFORM_DEFINES += -DWIIU -DHW_RVL -mwup -DUSE_DYNAMIC_ALLOC
|
||||||
CC = $(DEVKITPPC)/bin/powerpc-eabi-gcc$(EXE_EXT)
|
|
||||||
AR = $(DEVKITPPC)/bin/powerpc-eabi-ar$(EXE_EXT)
|
|
||||||
PLATFORM_DEFINES := -DGEKKO -DHW_RVL -mrvl -mcpu=750 -meabi -mhard-float -DALT_RENDER
|
|
||||||
PLATFORM_DEFINES += -U__INT32_TYPE__ -U __UINT32_TYPE__ -D__INT32_TYPE__=int
|
|
||||||
ENDIANNESS_DEFINES := -DBYTE_ORDER=BIG_ENDIAN
|
|
||||||
STATIC_LINKING = 1
|
|
||||||
|
|
||||||
# Nintendo WiiU
|
# Nintendo Wii
|
||||||
else ifeq ($(platform), wiiu)
|
else ifneq (,$(findstring wii,$(platform)))
|
||||||
TARGET := $(TARGET_NAME)_libretro_$(platform).a
|
PLATFORM_DEFINES += -DHW_RVL -mrvl
|
||||||
CC = $(DEVKITPPC)/bin/powerpc-eabi-gcc$(EXE_EXT)
|
|
||||||
AR = $(DEVKITPPC)/bin/powerpc-eabi-ar$(EXE_EXT)
|
|
||||||
PLATFORM_DEFINES := -DGEKKO -DWIIU -DHW_RVL -mwup -mcpu=750 -meabi -mhard-float -DALT_RENDER -DUSE_DYNAMIC_ALLOC
|
|
||||||
PLATFORM_DEFINES += -U__INT32_TYPE__ -U __UINT32_TYPE__ -D__INT32_TYPE__=int
|
|
||||||
ENDIANNESS_DEFINES := -DBYTE_ORDER=BIG_ENDIAN
|
|
||||||
STATIC_LINKING = 1
|
|
||||||
|
|
||||||
# ARM
|
# Nintendo GameCube
|
||||||
else ifneq (,$(findstring armv,$(platform)))
|
else ifneq (,$(findstring ngc,$(platform)))
|
||||||
TARGET := $(TARGET_NAME)_libretro.so
|
PLATFORM_DEFINES += -DHW_DOL -mrvl
|
||||||
fpic := -fPIC
|
endif
|
||||||
SHARED := -shared -Wl,--version-script=libretro/link.T -Wl,--no-undefined
|
|
||||||
ENDIANNESS_DEFINES := -DLSB_FIRST -DBYTE_ORDER=LITTLE_ENDIAN
|
|
||||||
PLATFORM_DEFINES := -DHAVE_ZLIB
|
|
||||||
ifneq (,$(findstring cortexa5,$(platform)))
|
|
||||||
PLATFORM_DEFINES += -marm -mcpu=cortex-a5
|
|
||||||
else ifneq (,$(findstring cortexa8,$(platform)))
|
|
||||||
PLATFORM_DEFINES += -marm -mcpu=cortex-a8
|
|
||||||
else ifneq (,$(findstring cortexa9,$(platform)))
|
|
||||||
PLATFORM_DEFINES += -marm -mcpu=cortex-a9
|
|
||||||
else ifneq (,$(findstring cortexa15a7,$(platform)))
|
|
||||||
PLATFORM_DEFINES += -marm -mcpu=cortex-a15.cortex-a7
|
|
||||||
else
|
|
||||||
PLATFORM_DEFINES += -marm
|
|
||||||
endif
|
|
||||||
ifneq (,$(findstring softfloat,$(platform)))
|
|
||||||
PLATFORM_DEFINES += -mfloat-abi=softfp
|
|
||||||
else ifneq (,$(findstring hardfloat,$(platform)))
|
|
||||||
PLATFORM_DEFINES += -mfloat-abi=hard
|
|
||||||
endif
|
|
||||||
PLATFORM_DEFINES += -DARM
|
|
||||||
|
|
||||||
# emscripten
|
# emscripten
|
||||||
else ifeq ($(platform), emscripten)
|
else ifeq ($(platform), emscripten)
|
||||||
TARGET := $(TARGET_NAME)_libretro_$(platform).bc
|
TARGET := $(TARGET_NAME)_libretro_$(platform).bc
|
||||||
ENDIANNESS_DEFINES := -DLSB_FIRST -DALIGN_LONG -DBYTE_ORDER=LITTLE_ENDIAN -DHAVE_ZLIB
|
ENDIANNESS_DEFINES := -DLSB_FIRST -DALIGN_LONG -DBYTE_ORDER=LITTLE_ENDIAN -DHAVE_ZLIB
|
||||||
STATIC_LINKING = 1
|
STATIC_LINKING = 1
|
||||||
|
|
||||||
# GCW0
|
# GCW0
|
||||||
else ifeq ($(platform), gcw0)
|
else ifeq ($(platform), gcw0)
|
||||||
TARGET := $(TARGET_NAME)_libretro.so
|
TARGET := $(TARGET_NAME)_libretro.so
|
||||||
CC = /opt/gcw0-toolchain/usr/bin/mipsel-linux-gcc
|
CC = /opt/gcw0-toolchain/usr/bin/mipsel-linux-gcc
|
||||||
CXX = /opt/gcw0-toolchain/usr/bin/mipsel-linux-g++
|
AR = /opt/gcw0-toolchain/usr/bin/mipsel-linux-ar
|
||||||
AR = /opt/gcw0-toolchain/usr/bin/mipsel-linux-ar
|
SHARED := -shared -Wl,--version-script=libretro/link.T -Wl,--no-undefined
|
||||||
SHARED := -shared -Wl,--version-script=libretro/link.T -Wl,--no-undefined
|
fpic := -fPIC
|
||||||
fpic := -fPIC
|
LDFLAGS += $(PTHREAD_FLAGS)
|
||||||
LDFLAGS += $(PTHREAD_FLAGS)
|
CFLAGS += $(PTHREAD_FLAGS) -DHAVE_MKDIR
|
||||||
CFLAGS += $(PTHREAD_FLAGS) -DHAVE_MKDIR
|
CFLAGS += -ffast-math -march=mips32 -mtune=mips32r2 -mhard-float
|
||||||
CFLAGS += -ffast-math -march=mips32 -mtune=mips32r2 -mhard-float
|
|
||||||
|
|
||||||
# Windows
|
# Windows
|
||||||
else
|
else
|
||||||
TARGET := $(TARGET_NAME)_libretro.dll
|
TARGET := $(TARGET_NAME)_libretro.dll
|
||||||
CC = gcc
|
CC = gcc
|
||||||
SHARED := -shared -static-libgcc -static-libstdc++ -Wl,--version-script=libretro/link.T -Wl,--no-undefined
|
SHARED := -shared -static-libgcc -static-libstdc++ -Wl,--version-script=libretro/link.T -Wl,--no-undefined
|
||||||
|
|
||||||
ENDIANNESS_DEFINES := -DLSB_FIRST -DBYTE_ORDER=LITTLE_ENDIAN
|
ENDIANNESS_DEFINES := -DLSB_FIRST -DBYTE_ORDER=LITTLE_ENDIAN
|
||||||
PLATFORM_DEFINES := -DHAVE_ZLIB
|
PLATFORM_DEFINES := -DHAVE_ZLIB
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
LDFLAGS += $(LIBM)
|
LDFLAGS += $(LIBM)
|
||||||
|
ifeq ($(SHARED_LIBVORBIS), 1)
|
||||||
|
LDFLAGS += -lvorbisfile
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(DEBUG), 1)
|
ifeq ($(DEBUG), 1)
|
||||||
CFLAGS += -O0 -g
|
CFLAGS += -O0 -g
|
||||||
else ifeq ($(platform),qnx)
|
else ifeq ($(platform),qnx)
|
||||||
CFLAGS += -Os -DNDEBUG
|
CFLAGS += -Os -DNDEBUG
|
||||||
else ifeq ($(platform), emscripten)
|
else ifeq ($(platform), emscripten)
|
||||||
@ -323,25 +264,31 @@ endif
|
|||||||
|
|
||||||
CORE_DIR := .
|
CORE_DIR := .
|
||||||
|
|
||||||
TREMOR_SRC_DIR := $(CORE_DIR)/core/tremor
|
ifeq ($(SHARED_LIBVORBIS),)
|
||||||
LIBRETRO_DIR := $(CORE_DIR)/libretro
|
TREMOR_SRC_DIR := $(CORE_DIR)/core/tremor
|
||||||
|
endif
|
||||||
|
LIBRETRO_DIR := $(CORE_DIR)/libretro
|
||||||
|
|
||||||
include $(LIBRETRO_DIR)/Makefile.common
|
include $(LIBRETRO_DIR)/Makefile.common
|
||||||
|
|
||||||
OBJECTS := $(SOURCES_C:.c=.o)
|
OBJECTS := $(SOURCES_C:.c=.o)
|
||||||
|
|
||||||
ifeq ($(LOGSOUND), 1)
|
ifeq ($(LOGSOUND), 1)
|
||||||
LIBRETRO_CFLAGS := -DLOGSOUND
|
LIBRETRO_CFLAGS := -DLOGSOUND
|
||||||
endif
|
endif
|
||||||
|
|
||||||
DEFINES := -DUSE_LIBTREMOR
|
ifeq ($(SHARED_LIBVORBIS), 1)
|
||||||
|
DEFINES := -DUSE_LIBVORBIS
|
||||||
|
else
|
||||||
|
DEFINES := -DUSE_LIBTREMOR
|
||||||
|
endif
|
||||||
CFLAGS += $(fpic) $(DEFINES) $(CODE_DEFINES)
|
CFLAGS += $(fpic) $(DEFINES) $(CODE_DEFINES)
|
||||||
|
|
||||||
ifeq ($(FRONTEND_SUPPORTS_RGB565), 1)
|
ifeq ($(FRONTEND_SUPPORTS_RGB565), 1)
|
||||||
# if you have a new frontend that supports RGB565
|
# if you have a new frontend that supports RGB565
|
||||||
BPP_DEFINES = -DUSE_16BPP_RENDERING -DFRONTEND_SUPPORTS_RGB565
|
BPP_DEFINES = -DUSE_16BPP_RENDERING -DFRONTEND_SUPPORTS_RGB565
|
||||||
else
|
else
|
||||||
BPP_DEFINES = -DUSE_15BPP_RENDERING
|
BPP_DEFINES = -DUSE_15BPP_RENDERING
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
@ -352,9 +299,9 @@ LIBRETRO_CFLAGS += $(BPP_DEFINES) \
|
|||||||
-D__LIBRETRO__
|
-D__LIBRETRO__
|
||||||
|
|
||||||
ifeq ($(platform), qnx)
|
ifeq ($(platform), qnx)
|
||||||
LIBRETRO_CFLAGS += -D__inline__=inline
|
LIBRETRO_CFLAGS += -D__inline__=inline
|
||||||
else
|
else
|
||||||
LIBRETRO_CFLAGS += -DINLINE="static inline"
|
LIBRETRO_CFLAGS += -DINLINE="static inline"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(platform), theos_ios)
|
ifeq ($(platform), theos_ios)
|
||||||
@ -367,7 +314,7 @@ else
|
|||||||
all: $(TARGET)
|
all: $(TARGET)
|
||||||
|
|
||||||
%.o: %.c
|
%.o: %.c
|
||||||
$(CC) -o $@ -c $< $(CFLAGS) $(LIBRETRO_CFLAGS)
|
$(CC) -o $@ -c $< $(CPPFLAGS) $(CFLAGS) $(LIBRETRO_CFLAGS)
|
||||||
|
|
||||||
$(TARGET): $(OBJECTS)
|
$(TARGET): $(OBJECTS)
|
||||||
ifeq ($(STATIC_LINKING), 1)
|
ifeq ($(STATIC_LINKING), 1)
|
||||||
|
@ -8,9 +8,13 @@ GENPLUS_SRC_DIR := $(CORE_DIR)/core \
|
|||||||
$(CORE_DIR)/core/cart_hw \
|
$(CORE_DIR)/core/cart_hw \
|
||||||
$(CORE_DIR)/core/cart_hw/svp
|
$(CORE_DIR)/core/cart_hw/svp
|
||||||
|
|
||||||
SOURCES_C = $(foreach dir,$(GENPLUS_SRC_DIR),$(wildcard $(dir)/*.c)) \
|
SOURCES_C = $(foreach dir,$(GENPLUS_SRC_DIR),$(wildcard $(dir)/*.c))
|
||||||
$(foreach dir,$(TREMOR_SRC_DIR),$(wildcard $(dir)/*.c)) \
|
|
||||||
$(LIBRETRO_DIR)/libretro.c
|
ifeq ($(SHARED_LIBVORBIS),)
|
||||||
|
SOURCES_C += $(foreach dir,$(TREMOR_SRC_DIR),$(wildcard $(dir)/*.c))
|
||||||
|
endif
|
||||||
|
|
||||||
|
SOURCES_C += $(LIBRETRO_DIR)/libretro.c
|
||||||
|
|
||||||
SOURCES_C += $(LIBRETRO_DIR)/scrc32.c
|
SOURCES_C += $(LIBRETRO_DIR)/scrc32.c
|
||||||
|
|
||||||
|
@ -2136,8 +2136,12 @@ void *retro_get_memory_data(unsigned id)
|
|||||||
case RETRO_MEMORY_SAVE_RAM:
|
case RETRO_MEMORY_SAVE_RAM:
|
||||||
return sram.sram;
|
return sram.sram;
|
||||||
case RETRO_MEMORY_SYSTEM_RAM:
|
case RETRO_MEMORY_SYSTEM_RAM:
|
||||||
return work_ram;
|
|
||||||
|
|
||||||
|
if (system_hw == SYSTEM_SMS)
|
||||||
|
return zram; // 0x2000 = 8kb z80 ram
|
||||||
|
else
|
||||||
|
return work_ram; //0x10000 = 64kb 68000 ram
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user