Update libretro port.

This commit is contained in:
Brandon Wright 2018-05-25 16:56:02 -05:00
parent b64eaba633
commit 7b3bbda18b
18 changed files with 3062 additions and 1307 deletions

View File

@ -1,213 +1,460 @@
DEBUG = 0
HAVE_EXCEPTIONS = 0
LAGFIX=1
SPACE :=
SPACE := $(SPACE) $(SPACE)
BACKSLASH :=
BACKSLASH := \$(BACKSLASH)
filter_out1 = $(filter-out $(firstword $1),$1)
filter_out2 = $(call filter_out1,$(call filter_out1,$1))
ifeq ($(platform),)
platform = unix
ifeq ($(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 MINGW,$(shell uname -a)),)
platform = win
else ifneq ($(findstring win,$(shell uname -a)),)
platform = win
endif
platform = unix
ifeq ($(shell uname -s),)
platform = win
else ifneq ($(findstring MINGW,$(shell uname -s)),)
platform = win
else ifneq ($(findstring Darwin,$(shell uname -s)),)
platform = osx
arch = intel
ifeq ($(shell uname -p),powerpc)
arch = ppc
endif
else ifneq ($(findstring win,$(shell uname -s)),)
platform = win
endif
else ifneq (,$(findstring armv,$(platform)))
override platform += unix
else ifneq (,$(findstring rpi,$(platform)))
override platform += unix
endif
CXX ?= g++
CC ?= gcc
TARGET_NAME = snes9x
LIBM = -lm
LIBS =
ifeq (,$(findstring msvc,$(platform)))
LIBS += -lm
endif
GIT_VERSION := " $(shell git rev-parse --short HEAD || echo unknown)"
ifneq ($(GIT_VERSION)," unknown")
CXXFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\"
endif
ifeq ($(LAGFIX),1)
CFLAGS += -DLAGFIX
CXXFLAGS += -DLAGFIX
endif
# Unix
ifeq ($(platform), unix)
TARGET := $(TARGET_NAME)_libretro.so
fpic := -fPIC
SHARED := -shared -Wl,--version-script=link.T
ifneq ($(findstring Haiku,$(shell uname -a)),)
LIBM :=
endif
ifneq (,$(findstring unix,$(platform)))
TARGET := $(TARGET_NAME)_libretro.so
fpic := -fPIC
ifneq ($(findstring SunOS,$(shell uname -a)),)
CC = gcc
SHARED := -shared -z defs
else
SHARED := -shared -Wl,--version-script=link.T
endif
ifneq ($(findstring Haiku,$(shell uname -a)),)
LIBS :=
endif
# ARM
ifneq (,$(findstring armv,$(platform)))
CXXFLAGS += -DARM
# Raspberry Pi
else ifneq (,$(findstring rpi,$(platform)))
CXXFLAGS += -DARM
endif
# OS X
else ifeq ($(platform), osx)
TARGET := $(TARGET_NAME)_libretro.dylib
fpic := -fPIC
SHARED := -dynamiclib
arch = intel
ifeq ($(shell uname -p),powerpc)
arch = ppc
endif
ifeq ($(arch),ppc)
CXXFLAGS += -DBLARGG_BIG_ENDIAN=1 -D__ppc__
endif
OSXVER = `sw_vers -productVersion | cut -d. -f 2`
OSX_LT_MAVERICKS = `(( $(OSXVER) <= 9)) && echo "YES"`
fpic += -mmacosx-version-min=10.1
TARGET := $(TARGET_NAME)_libretro.dylib
fpic := -fPIC
SHARED := -dynamiclib
arch = intel
ifeq ($(shell uname -p),powerpc)
arch = ppc
endif
ifeq ($(arch),ppc)
CXXFLAGS += -DBLARGG_BIG_ENDIAN=1 -D__ppc__
endif
OSXVER = `sw_vers -productVersion | cut -d. -f 2`
OSX_LT_MAVERICKS = `(( $(OSXVER) <= 9)) && echo "YES"`
fpic += -mmacosx-version-min=10.1
# iOS
else ifneq (,$(findstring ios,$(platform)))
TARGET := $(TARGET_NAME)_libretro_ios.dylib
fpic := -fPIC
SHARED := -dynamiclib
TARGET := $(TARGET_NAME)_libretro_ios.dylib
fpic := -fPIC
SHARED := -dynamiclib
ifeq ($(IOSSDK),)
IOSSDK := $(shell xcodebuild -version -sdk iphoneos Path)
endif
ifeq ($(platform),ios-arm64)
CC = clang -arch arm64 -isysroot $(IOSSDK)
CXX = clang++ -arch arm64 -isysroot $(IOSSDK)
else
CC = clang -arch armv7 -isysroot $(IOSSDK)
CXX = clang++ -arch armv7 -isysroot $(IOSSDK)
endif
CXXFLAGS += -DIOS
CXXFLAGS += -DARM
ifeq ($(platform),$(filter $(platform),ios9 ios-arm64))
CC += -miphoneos-version-min=8.0
CXX += -miphoneos-version-min=8.0
CFLAGS += -miphoneos-version-min=8.0
CXXFLAGS += -miphoneos-version-min=8.0
else
CC += -miphoneos-version-min=5.0
CXX += -miphoneos-version-min=5.0
CFLAGS += -miphoneos-version-min=5.0
CXXFLAGS += -miphoneos-version-min=5.0
endif
ifeq ($(IOSSDK),)
IOSSDK := $(shell xcodebuild -version -sdk iphoneos Path)
endif
CC = clang -arch armv7 -isysroot $(IOSSDK)
CXX = clang++ -arch armv7 -isysroot $(IOSSDK)
CXXFLAGS += -DIOS
CXXFLAGS += -DARM
ifeq ($(platform),ios9)
CC += -miphoneos-version-min=8.0
CXX += -miphoneos-version-min=8.0
CFLAGS += -miphoneos-version-min=8.0
CXXFLAGS += -miphoneos-version-min=8.0
else
CC += -miphoneos-version-min=5.0
CXX += -miphoneos-version-min=5.0
CFLAGS += -miphoneos-version-min=5.0
CXXFLAGS += -miphoneos-version-min=5.0
endif
# Theos
else ifeq ($(platform), theos_ios)
DEPLOYMENT_IOSVERSION = 5.0
TARGET = iphone:latest:$(DEPLOYMENT_IOSVERSION)
ARCHS = armv7 armv7s
TARGET_IPHONEOS_DEPLOYMENT_VERSION=$(DEPLOYMENT_IOSVERSION)
THEOS_BUILD_DIR := objs
include $(THEOS)/makefiles/common.mk
LIBRARY_NAME = $(TARGET_NAME)_libretro_ios
DEPLOYMENT_IOSVERSION = 5.0
TARGET = iphone:latest:$(DEPLOYMENT_IOSVERSION)
ARCHS = armv7 armv7s
TARGET_IPHONEOS_DEPLOYMENT_VERSION=$(DEPLOYMENT_IOSVERSION)
THEOS_BUILD_DIR := objs
include $(THEOS)/makefiles/common.mk
LIBRARY_NAME = $(TARGET_NAME)_libretro_ios
# QNX
else ifeq ($(platform), qnx)
TARGET := $(TARGET_NAME)_libretro_$(platform).so
fpic := -fPIC
TARGET := $(TARGET_NAME)_libretro_$(platform).so
fpic := -fPIC
SHARED := -shared -Wl,--version-script=link.T
CC = qcc -Vgcc_notarmv7le
CXX = QCC -Vgcc_notarmv7le
AR = QCC -Vgcc_ntoarmv7le
CXXFLAGS += -D__BLACKBERRY_QNX__
CXXFLAGS += -DARM
HAVE_EXCEPTIONS = 1
CC = qcc -Vgcc_notarmv7le
CXX = QCC -Vgcc_notarmv7le
AR = QCC -Vgcc_ntoarmv7le
CXXFLAGS += -D__BLACKBERRY_QNX__
CXXFLAGS += -DARM
HAVE_EXCEPTIONS = 1
# Vita
else ifeq ($(platform), vita)
TARGET := $(TARGET_NAME)_libretro_$(platform).so
fpic := -fPIC
CC = arm-vita-eabi-gcc$(EXE_EXT)
CXX = arm-vita-eabi-g++$(EXE_EXT)
AR = arm-vita-eabi-ar$(EXE_EXT)
CXXFLAGS += -DVITA
HAVE_EXCEPTIONS = 1
TARGET := $(TARGET_NAME)_libretro_$(platform).so
fpic := -fPIC
CC = arm-vita-eabi-gcc$(EXE_EXT)
CXX = arm-vita-eabi-g++$(EXE_EXT)
AR = arm-vita-eabi-ar$(EXE_EXT)
CXXFLAGS += -DVITA
HAVE_EXCEPTIONS = 1
# PS3
else ifeq ($(platform), ps3)
TARGET := $(TARGET_NAME)_libretro_$(platform).a
CC = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-gcc.exe
CXX = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-g++.exe
AR = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-ar.exe
CXXFLAGS += -DBLARGG_BIG_ENDIAN=1 -D__ppc__
STATIC_LINKING = 1
else ifneq (,$(filter $(platform), ps3 sncps3 psl1ght))
TARGET := $(TARGET_NAME)_libretro_$(platform).a
CXXFLAGS += -DBLARGG_BIG_ENDIAN=1 -D__ppc__
STATIC_LINKING = 1
# sncps3
else ifeq ($(platform), sncps3)
TARGET := $(TARGET_NAME)_libretro_ps3.a
CC = $(CELL_SDK)/host-win32/sn/bin/ps3ppusnc.exe
CXX = $(CELL_SDK)/host-win32/sn/bin/ps3ppusnc.exe
AR = $(CELL_SDK)/host-win32/sn/bin/ps3snarl.exe
CXXFLAGS += -DBLARGG_BIG_ENDIAN=1 -D__ppc__
STATIC_LINKING = 1
# sncps3
ifneq (,$(findstring sncps3,$(platform)))
TARGET := $(TARGET_NAME)_libretro_ps3.a
CC = $(CELL_SDK)/host-win32/sn/bin/ps3ppusnc.exe
CXX = $(CC)
AR = $(CELL_SDK)/host-win32/sn/bin/ps3snarl.exe
# Lightweight PS3 Homebrew SDK
else ifeq ($(platform), psl1ght)
TARGET := $(TARGET_NAME)_libretro_$(platform).a
CC = $(PS3DEV)/ppu/bin/ppu-gcc$(EXE_EXT)
CXX = $(PS3DEV)/ppu/bin/ppu-g++$(EXE_EXT)
AR = $(PS3DEV)/ppu/bin/ppu-ar$(EXE_EXT)
CXXFLAGS += -DBLARGG_BIG_ENDIAN=1 -D__ppc__
STATIC_LINKING = 1
# PS3
else ifneq (,$(findstring ps3,$(platform)))
CC = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-gcc.exe
CXX = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-g++.exe
AR = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-ar.exe
# Lightweight PS3 Homebrew SDK
else ifneq (,$(findstring psl1ght,$(platform)))
CC = $(PS3DEV)/ppu/bin/ppu-gcc$(EXE_EXT)
CXX = $(PS3DEV)/ppu/bin/ppu-g++$(EXE_EXT)
AR = $(PS3DEV)/ppu/bin/ppu-ar$(EXE_EXT)
endif
# Xbox 360
else ifeq ($(platform), xenon)
TARGET := $(TARGET_NAME)_libretro_xenon360.a
CC = xenon-gcc$(EXE_EXT)
CXX = xenon-g++$(EXE_EXT)
AR = xenon-ar$(EXE_EXT)
CXXFLAGS += -D__LIBXENON__ -m32 -D__ppc__
STATIC_LINKING = 1
TARGET := $(TARGET_NAME)_libretro_xenon360.a
CC = xenon-gcc$(EXE_EXT)
CXX = xenon-g++$(EXE_EXT)
AR = xenon-ar$(EXE_EXT)
CXXFLAGS += -D__LIBXENON__ -m32 -D__ppc__
STATIC_LINKING = 1
# Nintendo Wii
else ifeq ($(platform), wii)
TARGET := $(TARGET_NAME)_libretro_$(platform).a
CC = $(DEVKITPPC)/bin/powerpc-eabi-gcc$(EXE_EXT)
CXX = $(DEVKITPPC)/bin/powerpc-eabi-g++$(EXE_EXT)
AR = $(DEVKITPPC)/bin/powerpc-eabi-ar$(EXE_EXT)
CXXFLAGS += -DGEKKO -mrvl -mcpu=750 -meabi -mhard-float -DBLARGG_BIG_ENDIAN=1 -D__ppc__
STATIC_LINKING = 1
# Nintendo Game Cube / Wii / WiiU
else ifneq (,$(filter $(platform), ngc wii wiiu))
TARGET := $(TARGET_NAME)_libretro_$(platform).a
CC = $(DEVKITPPC)/bin/powerpc-eabi-gcc$(EXE_EXT)
CXX = $(DEVKITPPC)/bin/powerpc-eabi-g++$(EXE_EXT)
AR = $(DEVKITPPC)/bin/powerpc-eabi-ar$(EXE_EXT)
CXXFLAGS += -mcpu=750 -meabi -mhard-float -DBLARGG_BIG_ENDIAN=1 -D__ppc__
CXXFLAGS += -U__INT32_TYPE__ -U __UINT32_TYPE__ -D__INT32_TYPE__=int
STATIC_LINKING = 1
# Nintendo WiiU
ifneq (,$(findstring wiiu,$(platform)))
CXXFLAGS += -mwup
# Nintendo Wii
else ifneq (,$(findstring wii,$(platform)))
CXXFLAGS += -DGEKKO -mrvl
# Nintendo Game Cube
else ifneq (,$(findstring ngc,$(platform)))
CXXFLAGS += -DGEKKO -mrvl
endif
# Emscripten
else ifeq ($(platform), emscripten)
TARGET := $(TARGET_NAME)_libretro_$(platform).bc
STATIC_LINKING = 1
TARGET := $(TARGET_NAME)_libretro_$(platform).bc
STATIC_LINKING = 1
# ARM
else ifneq (,$(findstring armv,$(platform)))
TARGET := $(TARGET_NAME)_libretro.so
SHARED := -shared -Wl,--no-undefined
fpic := -fPIC
CC ?= gcc
CXX ?= g++
ifneq (,$(findstring cortexa8,$(platform)))
CXXFLAGS += -marm -mcpu=cortex-a8
else ifneq (,$(findstring cortexa9,$(platform)))
CXXFLAGS += -marm -mcpu=cortex-a9
else ifneq (,$(findstring cortexa53,$(platform)))
CXXFLAGS += -marm -mcpu=cortex-a53
endif
CXXFLAGS += -marm
ifneq (,$(findstring neon,$(platform)))
CXXFLAGS += -mfpu=neon
HAVE_NEON = 1
endif
ifneq (,$(findstring softfloat,$(platform)))
CXXFLAGS += -mfloat-abi=softfp
else ifneq (,$(findstring hardfloat,$(platform)))
CXXFLAGS += -mfloat-abi=hard
endif
CXXFLAGS += -DARM
# Windows MSVC 2003 Xbox 1
else ifeq ($(platform), xbox1_msvc2003)
TARGET := $(TARGET_NAME)_libretro_xdk1.lib
MSVCBINDIRPREFIX = $(XDK)/xbox/bin/vc71
CC = "$(MSVCBINDIRPREFIX)/CL.exe"
CXX = "$(MSVCBINDIRPREFIX)/CL.exe"
LD = "$(MSVCBINDIRPREFIX)/lib.exe"
# Android
else ifneq (,$(findstring android,$(platform)))
TARGET := $(TARGET_NAME)_libretro_android.so
SHARED := -shared -Wl,--no-undefined -march=armv7-a -Wl,--fix-cortex-a8
fpic := -fPIC
CXXFLAGS += -marm -march=armv7-a -mfloat-abi=softfp -mfpu=neon -DANDROID -DARM
HAVE_NEON = 1
export INCLUDE := $(XDK)/xbox/include
export LIB := $(XDK)/xbox/lib
PSS_STYLE :=2
CFLAGS += -D_XBOX -D_XBOX1
CXXFLAGS += -D_XBOX -D_XBOX1
STATIC_LINKING=1
HAS_GCC := 0
# Windows MSVC 2010 Xbox 360
else ifeq ($(platform), xbox360_msvc2010)
TARGET := $(TARGET_NAME)_libretro_xdk360.lib
MSVCBINDIRPREFIX = $(XEDK)/bin/win32
CC = "$(MSVCBINDIRPREFIX)/cl.exe"
CXX = "$(MSVCBINDIRPREFIX)/cl.exe"
LD = "$(MSVCBINDIRPREFIX)/lib.exe"
export INCLUDE := $(XEDK)/include/xbox
export LIB := $(XEDK)/lib/xbox
PSS_STYLE :=2
CFLAGS += -D_XBOX -D_XBOX360
CXXFLAGS += -D_XBOX -D_XBOX360
STATIC_LINKING=1
HAS_GCC := 0
# Windows MSVC 2017 all architectures
else ifneq (,$(findstring windows_msvc2017,$(platform)))
PlatformSuffix = $(subst windows_msvc2017_,,$(platform))
ifneq (,$(findstring desktop,$(PlatformSuffix)))
WinPartition = desktop
MSVC2017CompileFlags = -DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP
LDFLAGS += -MANIFEST -LTCG:incremental -NXCOMPAT -DYNAMICBASE -DEBUG -OPT:REF -INCREMENTAL:NO -SUBSYSTEM:WINDOWS -MANIFESTUAC:"level='asInvoker' uiAccess='false'" -OPT:ICF -ERRORREPORT:PROMPT -NOLOGO -TLBID:1
LIBS += kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib
else ifneq (,$(findstring uwp,$(PlatformSuffix)))
WinPartition = uwp
MSVC2017CompileFlags = -DWINAPI_FAMILY=WINAPI_FAMILY_APP -DWINDLL -D_UNICODE -DUNICODE -DWRL_NO_DEFAULT_LIB
LDFLAGS += -APPCONTAINER -NXCOMPAT -DYNAMICBASE -MANIFEST:NO -LTCG -OPT:REF -SUBSYSTEM:CONSOLE -MANIFESTUAC:NO -OPT:ICF -ERRORREPORT:PROMPT -NOLOGO -TLBID:1 -DEBUG:FULL -WINMD:NO
LIBS += WindowsApp.lib
endif
CFLAGS += $(MSVC2017CompileFlags)
CXXFLAGS += $(MSVC2017CompileFlags)
TargetArchMoniker = $(subst $(WinPartition)_,,$(PlatformSuffix))
CC = cl.exe
CXX = cl.exe
reg_query = $(call filter_out2,$(subst $2,,$(shell reg query "$2" -v "$1" 2>nul)))
fix_path = $(subst $(SPACE),\ ,$(subst \,/,$1))
ProgramFiles86w := $(shell cmd /c "echo %PROGRAMFILES(x86)%")
ProgramFiles86 := $(shell cygpath "$(ProgramFiles86w)")
WindowsSdkDir ?= $(call reg_query,InstallationFolder,HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v10.0)
WindowsSdkDir ?= $(call reg_query,InstallationFolder,HKEY_CURRENT_USER\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v10.0)
WindowsSdkDir ?= $(call reg_query,InstallationFolder,HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v10.0)
WindowsSdkDir ?= $(call reg_query,InstallationFolder,HKEY_CURRENT_USER\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v10.0)
WindowsSdkDir := $(WindowsSdkDir)
WindowsSDKVersion ?= $(firstword $(foreach folder,$(subst $(subst \,/,$(WindowsSdkDir)Include/),,$(wildcard $(call fix_path,$(WindowsSdkDir)Include\*))),$(if $(wildcard $(call fix_path,$(WindowsSdkDir)Include/$(folder)/um/Windows.h)),$(folder),)))$(BACKSLASH)
WindowsSDKVersion := $(WindowsSDKVersion)
VsInstallBuildTools = $(ProgramFiles86)/Microsoft Visual Studio/2017/BuildTools
VsInstallEnterprise = $(ProgramFiles86)/Microsoft Visual Studio/2017/Enterprise
VsInstallProfessional = $(ProgramFiles86)/Microsoft Visual Studio/2017/Professional
VsInstallCommunity = $(ProgramFiles86)/Microsoft Visual Studio/2017/Community
VsInstallRoot ?= $(shell if [ -d "$(VsInstallBuildTools)" ]; then echo "$(VsInstallBuildTools)"; fi)
ifeq ($(VsInstallRoot), )
VsInstallRoot = $(shell if [ -d "$(VsInstallEnterprise)" ]; then echo "$(VsInstallEnterprise)"; fi)
endif
ifeq ($(VsInstallRoot), )
VsInstallRoot = $(shell if [ -d "$(VsInstallProfessional)" ]; then echo "$(VsInstallProfessional)"; fi)
endif
ifeq ($(VsInstallRoot), )
VsInstallRoot = $(shell if [ -d "$(VsInstallCommunity)" ]; then echo "$(VsInstallCommunity)"; fi)
endif
VsInstallRoot := $(VsInstallRoot)
VcCompilerToolsVer := $(shell cat "$(VsInstallRoot)/VC/Auxiliary/Build/Microsoft.VCToolsVersion.default.txt" | grep -o '[0-9\.]*')
VcCompilerToolsDir := $(VsInstallRoot)/VC/Tools/MSVC/$(VcCompilerToolsVer)
WindowsSDKSharedIncludeDir := $(shell cygpath -w "$(WindowsSdkDir)\Include\$(WindowsSDKVersion)\shared")
WindowsSDKUCRTIncludeDir := $(shell cygpath -w "$(WindowsSdkDir)\Include\$(WindowsSDKVersion)\ucrt")
WindowsSDKUMIncludeDir := $(shell cygpath -w "$(WindowsSdkDir)\Include\$(WindowsSDKVersion)\um")
WindowsSDKUCRTLibDir := $(shell cygpath -w "$(WindowsSdkDir)\Lib\$(WindowsSDKVersion)\ucrt\$(TargetArchMoniker)")
WindowsSDKUMLibDir := $(shell cygpath -w "$(WindowsSdkDir)\Lib\$(WindowsSDKVersion)\um\$(TargetArchMoniker)")
# For some reason the HostX86 compiler doesn't like compiling for x64
# ("no such file" opening a shared library), and vice-versa.
# Work around it for now by using the strictly x86 compiler for x86, and x64 for x64.
# NOTE: What about ARM?
ifneq (,$(findstring x64,$(TargetArchMoniker)))
VCCompilerToolsBinDir := $(VcCompilerToolsDir)\bin\HostX64
else
VCCompilerToolsBinDir := $(VcCompilerToolsDir)\bin\HostX86
endif
PATH := $(shell IFS=$$'\n'; cygpath "$(VCCompilerToolsBinDir)/$(TargetArchMoniker)"):$(PATH)
PATH := $(PATH):$(shell IFS=$$'\n'; cygpath "$(VsInstallRoot)/Common7/IDE")
INCLUDE := $(shell IFS=$$'\n'; cygpath -w "$(VcCompilerToolsDir)/include")
LIB := $(shell IFS=$$'\n'; cygpath -w "$(VcCompilerToolsDir)/lib/$(TargetArchMoniker)")
export INCLUDE := $(INCLUDE);$(WindowsSDKSharedIncludeDir);$(WindowsSDKUCRTIncludeDir);$(WindowsSDKUMIncludeDir)
export LIB := $(LIB);$(WindowsSDKUCRTLibDir);$(WindowsSDKUMLibDir)
TARGET := $(TARGET_NAME)_libretro.dll
PSS_STYLE :=2
LDFLAGS += -DLL
# Windows MSVC 2010 x64
else ifeq ($(platform), windows_msvc2010_x64)
CC = cl.exe
CXX = cl.exe
PATH := $(shell IFS=$$'\n'; cygpath "$(VS100COMNTOOLS)../../VC/bin/amd64"):$(PATH)
PATH := $(PATH):$(shell IFS=$$'\n'; cygpath "$(VS100COMNTOOLS)../IDE")
LIB := $(shell IFS=$$'\n'; cygpath "$(VS100COMNTOOLS)../../VC/lib/amd64")
INCLUDE := $(shell IFS=$$'\n'; cygpath "$(VS100COMNTOOLS)../../VC/include")
WindowsSdkDir := $(shell reg query "HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A" -v "InstallationFolder" | grep -o '[A-Z]:\\.*')lib/x64
WindowsSdkDir ?= $(shell reg query "HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.1A" -v "InstallationFolder" | grep -o '[A-Z]:\\.*')lib/x64
WindowsSdkDirInc := $(shell reg query "HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A" -v "InstallationFolder" | grep -o '[A-Z]:\\.*')Include
WindowsSdkDirInc ?= $(shell reg query "HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.1A" -v "InstallationFolder" | grep -o '[A-Z]:\\.*')Include
INCFLAGS_PLATFORM = -I"$(WindowsSdkDirInc)"
export INCLUDE := $(INCLUDE)
export LIB := $(LIB);$(WindowsSdkDir)
TARGET := $(TARGET_NAME)_libretro.dll
PSS_STYLE :=2
LDFLAGS += -DLL
LIBS :=
# Windows MSVC 2010 x86
else ifeq ($(platform), windows_msvc2010_x86)
CC = cl.exe
CXX = cl.exe
PATH := $(shell IFS=$$'\n'; cygpath "$(VS100COMNTOOLS)../../VC/bin"):$(PATH)
PATH := $(PATH):$(shell IFS=$$'\n'; cygpath "$(VS100COMNTOOLS)../IDE")
LIB := $(shell IFS=$$'\n'; cygpath -w "$(VS100COMNTOOLS)../../VC/lib")
INCLUDE := $(shell IFS=$$'\n'; cygpath "$(VS100COMNTOOLS)../../VC/include")
WindowsSdkDir := $(shell reg query "HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A" -v "InstallationFolder" | grep -o '[A-Z]:\\.*')lib
WindowsSdkDir ?= $(shell reg query "HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.1A" -v "InstallationFolder" | grep -o '[A-Z]:\\.*')lib
WindowsSdkDirInc := $(shell reg query "HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A" -v "InstallationFolder" | grep -o '[A-Z]:\\.*')Include
WindowsSdkDirInc ?= $(shell reg query "HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.1A" -v "InstallationFolder" | grep -o '[A-Z]:\\.*')Include
INCFLAGS_PLATFORM = -I"$(WindowsSdkDirInc)"
export INCLUDE := $(INCLUDE)
export LIB := $(LIB);$(WindowsSdkDir)
TARGET := $(TARGET_NAME)_libretro.dll
PSS_STYLE :=2
LDFLAGS += -DLL
LIBS :=
# Windows MSVC 2003 x86
else ifeq ($(platform), windows_msvc2003_x86)
CC = cl.exe
CXX = cl.exe
PATH := $(shell IFS=$$'\n'; cygpath "$(VS71COMNTOOLS)../../Vc7/bin"):$(PATH)
PATH := $(PATH):$(shell IFS=$$'\n'; cygpath "$(VS71COMNTOOLS)../IDE")
INCLUDE := $(shell IFS=$$'\n'; cygpath "$(VS71COMNTOOLS)../../Vc7/include")
LIB := $(shell IFS=$$'\n'; cygpath -w "$(VS71COMNTOOLS)../../Vc7/lib")
BIN := $(shell IFS=$$'\n'; cygpath "$(VS71COMNTOOLS)../../Vc7/bin")
WindowsSdkDir := $(INETSDK)
export INCLUDE := $(INCLUDE);$(INETSDK)/Include;src/drivers/libretro/msvc/msvc-2005
export LIB := $(LIB);$(WindowsSdkDir);$(INETSDK)/Lib
TARGET := $(TARGET_NAME)_libretro.dll
PSS_STYLE :=2
LDFLAGS += -DLL
CFLAGS += -D_CRT_SECURE_NO_DEPRECATE
# Windows MSVC 2005 x86
else ifeq ($(platform), windows_msvc2005_x86)
CC = cl.exe
CXX = cl.exe
PATH := $(shell IFS=$$'\n'; cygpath "$(VS80COMNTOOLS)../../VC/bin"):$(PATH)
PATH := $(PATH):$(shell IFS=$$'\n'; cygpath "$(VS80COMNTOOLS)../IDE")
INCLUDE := $(shell IFS=$$'\n'; cygpath "$(VS80COMNTOOLS)../../VC/include")
LIB := $(shell IFS=$$'\n'; cygpath -w "$(VS80COMNTOOLS)../../VC/lib")
BIN := $(shell IFS=$$'\n'; cygpath "$(VS80COMNTOOLS)../../VC/bin")
WindowsSdkDir := $(INETSDK)
export INCLUDE := $(INCLUDE);$(INETSDK)/Include;libretro-common/include/compat/msvc
export LIB := $(LIB);$(WindowsSdkDir);$(INETSDK)/Lib
TARGET := $(TARGET_NAME)_libretro.dll
PSS_STYLE :=2
LDFLAGS += -DLL
CFLAGS += -D_CRT_SECURE_NO_DEPRECATE
# Windows
else
TARGET := $(TARGET_NAME)_libretro.dll
CC = gcc
CXX = g++
SHARED := -shared -static-libgcc -static-libstdc++ -s -Wl,--version-script=link.T
CXXFLAGS += -D__WIN32__ -D__WIN32_LIBSNES__
TARGET := $(TARGET_NAME)_libretro.dll
CC = gcc
CXX = g++
SHARED := -shared -static-libgcc -static-libstdc++ -s -Wl,--version-script=link.T
CXXFLAGS += -D__WIN32__
endif
CORE_DIR := ..
ifeq ($(DEBUG), 1)
CXXFLAGS += -O0 -g
CFLAGS += -O0 -g
ifneq (,$(findstring msvc,$(platform)))
CFLAGS += -Od -Zi -DDEBUG -D_DEBUG
CXXFLAGS += -Od -Zi -DDEBUG -D_DEBUG
ifeq ($(STATIC_LINKING),1)
CFLAGS += -MTd
CXXFLAGS += -MTd
else
CFLAGS += -MDd
CXXFLAGS += -MDd
endif
else
CFLAGS += -O0 -g -DDEBUG
CXXFLAGS += -O0 -g -DDEBUG
endif
else
CXXFLAGS += -O3 -DNDEBUG
CFLAGS += -O3 -DNDEBUG
CFLAGS += -O2 -DNDEBUG
CXXFLAGS += -O2 -DNDEBUG
ifneq (,$(findstring msvc,$(platform)))
ifeq ($(STATIC_LINKING),1)
CFLAGS += -MT
CXXFLAGS += -MT
else
CFLAGS += -MD
CXXFLAGS += -MD
endif
endif
endif
include Makefile.common
@ -215,21 +462,46 @@ include Makefile.common
OBJECTS := $(SOURCES_CXX:.cpp=.o) $(SOURCES_C:.c=.o)
ifeq ($(platform), sncps3)
WARNINGS_DEFINES =
CODE_DEFINES =
WARNINGS_DEFINES =
CODE_DEFINES =
else ifneq (,$(findstring msvc,$(platform)))
WARNINGS_DEFINES =
CODE_DEFINES =
else
WARNINGS_DEFINES = -Wall -W -Wno-unused-parameter
CODE_DEFINES = -fomit-frame-pointer
WARNINGS_DEFINES = -Wall -W -Wno-unused-parameter
CODE_DEFINES = -fomit-frame-pointer
endif
ifneq ($(HAVE_EXCEPTIONS), 1)
CXXFLAGS += -fno-exceptions
endif
CXXFLAGS += $(CODE_DEFINES) -fno-rtti -pedantic $(WARNINGS_DEFINES) $(fpic)
CXXFLAGS += -DHAVE_STRINGS_H -DHAVE_STDINT_H -DRIGHTSHIFT_IS_SAR -D__LIBRETRO__
CXXFLAGS += $(CODE_DEFINES) $(WARNINGS_DEFINES) $(fpic)
CXXFLAGS += -DRIGHTSHIFT_IS_SAR -D__LIBRETRO__
CFLAGS = $(CXXFLAGS)
ifeq (,$(findstring msvc,$(platform)))
CXXFLAGS += -DHAVE_STRINGS_H
CXXFLAGS += -fno-rtti -pedantic
ifneq ($(HAVE_EXCEPTIONS), 1)
CXXFLAGS += -fno-exceptions
endif
endif
OBJOUT = -o
LINKOUT = -o
ifneq (,$(findstring msvc,$(platform)))
OBJOUT = -Fo
LINKOUT = -out:
ifeq ($(STATIC_LINKING),1)
LD ?= lib.exe
STATIC_LINKING=0
else
LD = link.exe
endif
else
LD = $(CXX)
endif
INCFLAGS += $(INCFLAGS_PLATFORM)
ifeq ($(platform), theos_ios)
COMMON_FLAGS := -DIOS -DARM $(COMMON_DEFINES) $(INCFLAGS) -I$(THEOS_INCLUDE_PATH) -Wno-error
$(LIBRARY_NAME)_CFLAGS += $(CFLAGS) $(COMMON_FLAGS)
@ -243,14 +515,14 @@ $(TARGET): $(OBJECTS)
ifeq ($(STATIC_LINKING), 1)
$(AR) rcs $@ $(OBJECTS)
else
$(CXX) $(fpic) $(SHARED) $(INCFLAGS) -o $@ $(OBJECTS) $(LIBM)
$(LD) $(fpic) $(SHARED) $(LINKOUT)$@ $(OBJECTS) $(LDFLAGS) $(LIBS)
endif
%.o: %.cpp
$(CXX) $(INCFLAGS) $(CXXFLAGS) -c -o $@ $<
$(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $(OBJOUT)$@ $<
%.o: %.c
$(CC) $(INCFLAGS) $(CFLAGS) -c -o $@ $<
$(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) -c $(OBJOUT)$@ $<
clean:
rm -f $(OBJECTS) $(TARGET)

View File

@ -1,12 +1,16 @@
LIBRETRO_COMM_DIR = $(CORE_DIR)/libretro/libretro-common
INCFLAGS = -I$(CORE_DIR)/libretro -I$(CORE_DIR) -I$(CORE_DIR)/apu/ -I$(CORE_DIR)/apu/bapu
ifneq (,$(findstring msvc2003,$(platform)))
INCFLAGS += -I$(LIBRETRO_COMM_DIR)/include/compat/msvc
endif
SOURCES_C :=
SOURCES_CXX := $(CORE_DIR)/apu/apu.cpp \
$(CORE_DIR)/apu/bapu/dsp/sdsp.cpp \
$(CORE_DIR)/apu/bapu/dsp/SPC_DSP.cpp \
$(CORE_DIR)/apu/bapu/smp/smp.cpp \
$(CORE_DIR)/apu/bapu/smp/smp_state.cpp \
$(CORE_DIR)/bml.cpp \
$(CORE_DIR)/bsx.cpp \
$(CORE_DIR)/c4.cpp \
$(CORE_DIR)/c4emu.cpp \
@ -31,24 +35,24 @@ SOURCES_CXX := $(CORE_DIR)/apu/apu.cpp \
$(CORE_DIR)/globals.cpp \
$(CORE_DIR)/logger.cpp \
$(CORE_DIR)/memmap.cpp \
$(CORE_DIR)/movie.cpp \
$(CORE_DIR)/msu1.cpp \
$(CORE_DIR)/obc1.cpp \
$(CORE_DIR)/msu1.cpp \
$(CORE_DIR)/ppu.cpp \
$(CORE_DIR)/stream.cpp \
$(CORE_DIR)/sa1.cpp \
$(CORE_DIR)/sa1cpu.cpp \
$(CORE_DIR)/screenshot.cpp \
$(CORE_DIR)/sdd1.cpp \
$(CORE_DIR)/sdd1emu.cpp \
$(CORE_DIR)/seta.cpp \
$(CORE_DIR)/seta010.cpp \
$(CORE_DIR)/seta011.cpp \
$(CORE_DIR)/seta018.cpp \
$(CORE_DIR)/sha256.cpp \
$(CORE_DIR)/snapshot.cpp \
$(CORE_DIR)/snes9x.cpp \
$(CORE_DIR)/spc7110.cpp \
$(CORE_DIR)/srtc.cpp \
$(CORE_DIR)/tile.cpp \
$(CORE_DIR)/sha256.cpp \
$(CORE_DIR)/bml.cpp \
$(CORE_DIR)/movie.cpp \
$(CORE_DIR)/libretro/libretro.cpp

10
libretro/control Normal file
View File

@ -0,0 +1,10 @@
Package: com.libretro.snes9x
Name: snes9x
Depends:
Version: 0.0.1
Architecture: iphoneos-arm
Description: Libretro iOS core of SNES9x
Maintainer: libretro
Author: libretro
Section: System
Tag: role::developer

View File

@ -1,23 +1,19 @@
LOCAL_PATH := $(call my-dir)
CORE_DIR := $(LOCAL_PATH)/../..
include $(CORE_DIR)/libretro/Makefile.common
COREFLAGS := -DANDROID -D__LIBRETRO__ -DHAVE_STRINGS_H -DRIGHTSHIFT_IS_SAR $(INCFLAGS)
GIT_VERSION := " $(shell git rev-parse --short HEAD || echo unknown)"
ifneq ($(GIT_VERSION)," unknown")
COREFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\"
endif
include $(CLEAR_VARS)
ifeq ($(TARGET_ARCH),arm)
LOCAL_CFLAGS += -DANDROID_ARM
LOCAL_ARM_MODE := arm
endif
ifeq ($(TARGET_ARCH),x86)
LOCAL_CFLAGS += -DANDROID_X86
endif
ifeq ($(TARGET_ARCH),mips)
LOCAL_CFLAGS += -DANDROID_MIPS
endif
LOCAL_MODULE := libretro
LOCAL_SRC_FILES = ../../apu/apu.cpp ../../apu/bapu/dsp/sdsp.cpp ../../apu/bapu/dsp/SPC_DSP.cpp ../../apu/bapu/smp/smp.cpp ../../apu/bapu/smp/smp_state.cpp ../../bsx.cpp ../../c4.cpp ../../c4emu.cpp ../../cheats.cpp ../../cheats2.cpp ../../clip.cpp ../../conffile.cpp ../../controls.cpp ../../cpu.cpp ../../cpuexec.cpp ../../cpuops.cpp ../../crosshairs.cpp ../../dma.cpp ../../dsp.cpp ../../dsp1.cpp ../../dsp2.cpp ../../dsp3.cpp ../../dsp4.cpp ../../fxinst.cpp ../../fxemu.cpp ../../gfx.cpp ../../globals.cpp ../../logger.cpp ../../memmap.cpp ../../movie.cpp ../../obc1.cpp ../../ppu.cpp ../../stream.cpp ../../sa1.cpp ../../sa1cpu.cpp ../../screenshot.cpp ../../sdd1.cpp ../../sdd1emu.cpp ../../seta.cpp ../../seta010.cpp ../../seta011.cpp ../../seta018.cpp ../../snapshot.cpp ../../snes9x.cpp ../../spc7110.cpp ../../srtc.cpp ../../tile.cpp ../libretro.cpp
LOCAL_CXXFLAGS = -DANDROID -DARM -D__LIBRETRO__ -DHAVE_STRINGS_H -DHAVE_STDINT_H -DRIGHTSHIFT_IS_SAR
LOCAL_C_INCLUDES = ../../ ../../apu/bapu/
LOCAL_MODULE := retro
LOCAL_SRC_FILES := $(SOURCES_CXX)
LOCAL_CXXFLAGS := $(COREFLAGS)
LOCAL_LDFLAGS := -Wl,-version-script=$(CORE_DIR)/libretro/link.T
include $(BUILD_SHARED_LIBRARY)

View File

@ -0,0 +1,104 @@
/* Copyright (C) 2010-2016 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (msvc_compat.h).
* ---------------------------------------------------------------------------------------
*
* Permission is hereby granted, free of charge,
* to any person obtaining a copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef __LIBRETRO_SDK_COMPAT_MSVC_H
#define __LIBRETRO_SDK_COMPAT_MSVC_H
#ifdef _MSC_VER
#ifdef __cplusplus
extern "C" {
#endif
/* Pre-MSVC 2015 compilers don't implement snprintf in a cross-platform manner. */
#if _MSC_VER < 1900
#include <stdlib.h>
#ifndef snprintf
#define snprintf c99_snprintf_retro__
#endif
int c99_snprintf_retro__(char *outBuf, size_t size, const char *format, ...);
#endif
/* Pre-MSVC 2010 compilers don't implement vsnprintf in a cross-platform manner? Not sure about this one. */
#if _MSC_VER < 1600
#include <stdarg.h>
#include <stdlib.h>
#ifndef vsnprintf
#define vsnprintf c99_vsnprintf_retro__
#endif
int c99_vsnprintf_retro__(char *outBuf, size_t size, const char *format, va_list ap);
#endif
#ifdef __cplusplus
}
#endif
#undef UNICODE /* Do not bother with UNICODE at this time. */
#include <direct.h>
#include <stddef.h>
#include <math.h>
/* Python headers defines ssize_t and sets HAVE_SSIZE_T.
* Cannot duplicate these efforts.
*/
#ifndef HAVE_SSIZE_T
#if defined(_WIN64)
typedef __int64 ssize_t;
#elif defined(_WIN32)
typedef int ssize_t;
#endif
#endif
#define mkdir(dirname, unused) _mkdir(dirname)
#define strtoull _strtoui64
#undef strcasecmp
#define strcasecmp _stricmp
#undef strncasecmp
#define strncasecmp _strnicmp
/* Disable some of the annoying warnings. */
#pragma warning(disable : 4800)
#pragma warning(disable : 4805)
#pragma warning(disable : 4244)
#pragma warning(disable : 4305)
#pragma warning(disable : 4146)
#pragma warning(disable : 4267)
#pragma warning(disable : 4723)
#pragma warning(disable : 4996)
/* roundf is available since MSVC 2013 */
#if _MSC_VER < 1800
#define roundf(in) (in >= 0.0f ? floorf(in + 0.5f) : ceilf(in - 0.5f))
#endif
#ifndef PATH_MAX
#define PATH_MAX _MAX_PATH
#endif
#ifndef SIZE_MAX
#define SIZE_MAX _UI32_MAX
#endif
#endif
#endif

View File

@ -0,0 +1,254 @@
/* ISO C9x compliant stdint.h for Microsoft Visual Studio
* Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
*
* Copyright (c) 2006-2008 Alexander Chemeris
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* 3. The name of the author may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
* EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef __RARCH_STDINT_H
#define __RARCH_STDINT_H
#if _MSC_VER && (_MSC_VER < 1600)
/* Pre-MSVC 2010 needs an implementation of stdint.h. */
#if _MSC_VER > 1000
#pragma once
#endif
#include <limits.h>
/* For Visual Studio 6 in C++ mode and for many Visual Studio versions when
* compiling for ARM we should wrap <wchar.h> include with 'extern "C++" {}'
* or compiler give many errors like this:
*
* error C2733: second C linkage of overloaded function 'wmemchr' not allowed
*/
#ifdef __cplusplus
extern "C" {
#endif
# include <wchar.h>
#ifdef __cplusplus
}
#endif
/* Define _W64 macros to mark types changing their size, like intptr_t. */
#ifndef _W64
# if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300
# define _W64 __w64
# else
# define _W64
# endif
#endif
/* 7.18.1 Integer types. */
/* 7.18.1.1 Exact-width integer types. */
/* Visual Studio 6 and Embedded Visual C++ 4 doesn't
* realize that, e.g. char has the same size as __int8
* so we give up on __intX for them.
*/
#if (_MSC_VER < 1300)
typedef signed char int8_t;
typedef signed short int16_t;
typedef signed int int32_t;
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
#else
typedef signed __int8 int8_t;
typedef signed __int16 int16_t;
typedef signed __int32 int32_t;
typedef unsigned __int8 uint8_t;
typedef unsigned __int16 uint16_t;
typedef unsigned __int32 uint32_t;
#endif
typedef signed __int64 int64_t;
typedef unsigned __int64 uint64_t;
/* 7.18.1.2 Minimum-width integer types. */
typedef int8_t int_least8_t;
typedef int16_t int_least16_t;
typedef int32_t int_least32_t;
typedef int64_t int_least64_t;
typedef uint8_t uint_least8_t;
typedef uint16_t uint_least16_t;
typedef uint32_t uint_least32_t;
typedef uint64_t uint_least64_t;
/* 7.18.1.3 Fastest minimum-width integer types. */
typedef int8_t int_fast8_t;
typedef int16_t int_fast16_t;
typedef int32_t int_fast32_t;
typedef int64_t int_fast64_t;
typedef uint8_t uint_fast8_t;
typedef uint16_t uint_fast16_t;
typedef uint32_t uint_fast32_t;
typedef uint64_t uint_fast64_t;
/* 7.18.1.4 Integer types capable of holding object pointers. */
#ifdef _WIN64 /* [ */
typedef signed __int64 intptr_t;
typedef unsigned __int64 uintptr_t;
#else /* _WIN64 ][ */
typedef _W64 signed int intptr_t;
typedef _W64 unsigned int uintptr_t;
#endif /* _WIN64 ] */
/* 7.18.1.5 Greatest-width integer types. */
typedef int64_t intmax_t;
typedef uint64_t uintmax_t;
/* 7.18.2 Limits of specified-width integer types. */
#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS)
/* [ See footnote 220 at page 257 and footnote 221 at page 259. */
/* 7.18.2.1 Limits of exact-width integer types. */
#define INT8_MIN ((int8_t)_I8_MIN)
#define INT8_MAX _I8_MAX
#define INT16_MIN ((int16_t)_I16_MIN)
#define INT16_MAX _I16_MAX
#define INT32_MIN ((int32_t)_I32_MIN)
#define INT32_MAX _I32_MAX
#define INT64_MIN ((int64_t)_I64_MIN)
#define INT64_MAX _I64_MAX
#define UINT8_MAX _UI8_MAX
#define UINT16_MAX _UI16_MAX
#define UINT32_MAX _UI32_MAX
#define UINT64_MAX _UI64_MAX
/* 7.18.2.2 Limits of minimum-width integer types. */
#define INT_LEAST8_MIN INT8_MIN
#define INT_LEAST8_MAX INT8_MAX
#define INT_LEAST16_MIN INT16_MIN
#define INT_LEAST16_MAX INT16_MAX
#define INT_LEAST32_MIN INT32_MIN
#define INT_LEAST32_MAX INT32_MAX
#define INT_LEAST64_MIN INT64_MIN
#define INT_LEAST64_MAX INT64_MAX
#define UINT_LEAST8_MAX UINT8_MAX
#define UINT_LEAST16_MAX UINT16_MAX
#define UINT_LEAST32_MAX UINT32_MAX
#define UINT_LEAST64_MAX UINT64_MAX
/* 7.18.2.3 Limits of fastest minimum-width integer types. */
#define INT_FAST8_MIN INT8_MIN
#define INT_FAST8_MAX INT8_MAX
#define INT_FAST16_MIN INT16_MIN
#define INT_FAST16_MAX INT16_MAX
#define INT_FAST32_MIN INT32_MIN
#define INT_FAST32_MAX INT32_MAX
#define INT_FAST64_MIN INT64_MIN
#define INT_FAST64_MAX INT64_MAX
#define UINT_FAST8_MAX UINT8_MAX
#define UINT_FAST16_MAX UINT16_MAX
#define UINT_FAST32_MAX UINT32_MAX
#define UINT_FAST64_MAX UINT64_MAX
/* 7.18.2.4 Limits of integer types capable of holding object pointers. */
#ifdef _WIN64 /* [ */
# define INTPTR_MIN INT64_MIN
# define INTPTR_MAX INT64_MAX
# define UINTPTR_MAX UINT64_MAX
#else /* _WIN64 ][ */
# define INTPTR_MIN INT32_MIN
# define INTPTR_MAX INT32_MAX
# define UINTPTR_MAX UINT32_MAX
#endif /* _WIN64 ] */
/* 7.18.2.5 Limits of greatest-width integer types */
#define INTMAX_MIN INT64_MIN
#define INTMAX_MAX INT64_MAX
#define UINTMAX_MAX UINT64_MAX
/* 7.18.3 Limits of other integer types */
#ifdef _WIN64 /* [ */
# define PTRDIFF_MIN _I64_MIN
# define PTRDIFF_MAX _I64_MAX
#else /* _WIN64 ][ */
# define PTRDIFF_MIN _I32_MIN
# define PTRDIFF_MAX _I32_MAX
#endif /* _WIN64 ] */
#define SIG_ATOMIC_MIN INT_MIN
#define SIG_ATOMIC_MAX INT_MAX
#ifndef SIZE_MAX /* [ */
# ifdef _WIN64 /* [ */
# define SIZE_MAX _UI64_MAX
# else /* _WIN64 ][ */
# define SIZE_MAX _UI32_MAX
# endif /* _WIN64 ] */
#endif /* SIZE_MAX ] */
/* WCHAR_MIN and WCHAR_MAX are also defined in <wchar.h> */
#ifndef WCHAR_MIN /* [ */
# define WCHAR_MIN 0
#endif /* WCHAR_MIN ] */
#ifndef WCHAR_MAX // [
# define WCHAR_MAX _UI16_MAX
#endif /* WCHAR_MAX ] */
#define WINT_MIN 0
#define WINT_MAX _UI16_MAX
#endif /* __STDC_LIMIT_MACROS ] */
/* 7.18.4 Limits of other integer types */
#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS)
/* [ See footnote 224 at page 260 */
/* 7.18.4.1 Macros for minimum-width integer constants */
#define INT8_C(val) val##i8
#define INT16_C(val) val##i16
#define INT32_C(val) val##i32
#define INT64_C(val) val##i64
#define UINT8_C(val) val##ui8
#define UINT16_C(val) val##ui16
#define UINT32_C(val) val##ui32
#define UINT64_C(val) val##ui64
/* 7.18.4.2 Macros for greatest-width integer constants */
#define INTMAX_C INT64_C
#define UINTMAX_C UINT64_C
#endif
/* __STDC_CONSTANT_MACROS ] */
#else
/* Sanity for everything else. */
#include <stdint.h>
#endif
#endif

View File

@ -0,0 +1,794 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9,00"
Name="libretro-win32"
ProjectGUID="{4A2A7544-0547-4539-8B53-047FB9A15C75}"
RootNamespace="libsneswin32"
Keyword="Win32Proj"
TargetFrameworkVersion="196613"
>
<Platforms>
<Platform
Name="Win32"
/>
<Platform
Name="x64"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="libsnes Debug|Win32"
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="0"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../;../apu/bapu"
PreprocessorDefinitions="__WIN32__"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
WarningLevel="2"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)\libretro.dll"
LinkIncremental="2"
ModuleDefinitionFile="libretro.def"
GenerateDebugInformation="true"
SubSystem="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="libsnes Debug|x64"
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="0"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../;../apu/bapu"
PreprocessorDefinitions="__WIN32__"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
WarningLevel="2"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)\libretro.dll"
LinkIncremental="2"
ModuleDefinitionFile="libretro.def"
GenerateDebugInformation="true"
SubSystem="2"
TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="libsnes Release|Win32"
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="0"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="3"
InlineFunctionExpansion="2"
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="1"
AdditionalIncludeDirectories="../;../apu/bapu"
PreprocessorDefinitions="__WIN32__"
RuntimeLibrary="0"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
WarningLevel="2"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)\libretro.dll"
LinkIncremental="1"
ModuleDefinitionFile="libretro.def"
GenerateDebugInformation="true"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="libsnes Release|x64"
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="0"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="3"
InlineFunctionExpansion="2"
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="1"
OmitFramePointers="true"
AdditionalIncludeDirectories="../;../apu/bapu"
PreprocessorDefinitions="__WIN32__"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
WarningLevel="2"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)\libretro.dll"
LinkIncremental="1"
ModuleDefinitionFile="libretro.def"
GenerateDebugInformation="true"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="s9x-source"
>
<File
RelativePath="..\65c816.h"
>
</File>
<File
RelativePath="..\bml.cpp"
>
</File>
<File
RelativePath="..\bsx.cpp"
>
</File>
<File
RelativePath="..\bsx.h"
>
</File>
<File
RelativePath="..\c4.cpp"
>
</File>
<File
RelativePath="..\c4.h"
>
</File>
<File
RelativePath="..\c4emu.cpp"
>
</File>
<File
RelativePath="..\cheats.cpp"
>
</File>
<File
RelativePath="..\cheats.h"
>
</File>
<File
RelativePath="..\cheats2.cpp"
>
</File>
<File
RelativePath="..\clip.cpp"
>
</File>
<File
RelativePath="..\conffile.cpp"
>
</File>
<File
RelativePath="..\conffile.h"
>
</File>
<File
RelativePath="..\controls.cpp"
>
</File>
<File
RelativePath="..\controls.h"
>
</File>
<File
RelativePath="..\cpu.cpp"
>
</File>
<File
RelativePath="..\cpuaddr.h"
>
</File>
<File
RelativePath="..\cpuexec.cpp"
>
</File>
<File
RelativePath="..\cpuexec.h"
>
</File>
<File
RelativePath="..\cpumacro.h"
>
</File>
<File
RelativePath="..\cpuops.cpp"
>
</File>
<File
RelativePath="..\cpuops.h"
>
</File>
<File
RelativePath="..\crosshairs.cpp"
>
</File>
<File
RelativePath="..\crosshairs.h"
>
</File>
<File
RelativePath="..\debug.cpp"
>
</File>
<File
RelativePath="..\debug.h"
>
</File>
<File
RelativePath="..\display.h"
>
</File>
<File
RelativePath="..\dma.cpp"
>
</File>
<File
RelativePath="..\dma.h"
>
</File>
<File
RelativePath="..\dsp.cpp"
>
</File>
<File
RelativePath="..\dsp.h"
>
</File>
<File
RelativePath="..\dsp1.cpp"
>
</File>
<File
RelativePath="..\dsp2.cpp"
>
</File>
<File
RelativePath="..\dsp3.cpp"
>
</File>
<File
RelativePath="..\dsp4.cpp"
>
</File>
<File
RelativePath="..\font.h"
>
</File>
<File
RelativePath="..\fxemu.cpp"
>
</File>
<File
RelativePath="..\fxemu.h"
>
</File>
<File
RelativePath="..\fxinst.cpp"
>
</File>
<File
RelativePath="..\fxinst.h"
>
</File>
<File
RelativePath="..\getset.h"
>
</File>
<File
RelativePath="..\gfx.cpp"
>
</File>
<File
RelativePath="..\gfx.h"
>
</File>
<File
RelativePath="..\globals.cpp"
>
</File>
<File
RelativePath="..\language.h"
>
</File>
<File
RelativePath="..\loadzip.cpp"
>
</File>
<File
RelativePath="..\logger.cpp"
>
</File>
<File
RelativePath="..\logger.h"
>
</File>
<File
RelativePath="..\memmap.cpp"
>
</File>
<File
RelativePath="..\memmap.h"
>
</File>
<File
RelativePath="..\messages.h"
>
</File>
<File
RelativePath="..\missing.h"
>
</File>
<File
RelativePath="..\movie.cpp"
>
</File>
<File
RelativePath="..\movie.h"
>
</File>
<File
RelativePath="..\netplay.cpp"
>
</File>
<File
RelativePath="..\netplay.h"
>
</File>
<File
RelativePath="..\obc1.cpp"
>
</File>
<File
RelativePath="..\obc1.h"
>
</File>
<File
RelativePath="..\pixform.h"
>
</File>
<File
RelativePath="..\port.h"
>
</File>
<File
RelativePath="..\ppu.cpp"
>
</File>
<File
RelativePath="..\ppu.h"
>
</File>
<File
RelativePath="..\sa1.cpp"
>
</File>
<File
RelativePath="..\sa1.h"
>
</File>
<File
RelativePath="..\sa1cpu.cpp"
>
</File>
<File
RelativePath="..\sar.h"
>
</File>
<File
RelativePath="..\screenshot.cpp"
>
</File>
<File
RelativePath="..\screenshot.h"
>
</File>
<File
RelativePath="..\sdd1.cpp"
>
</File>
<File
RelativePath="..\sdd1.h"
>
</File>
<File
RelativePath="..\sdd1emu.cpp"
>
</File>
<File
RelativePath="..\sdd1emu.h"
>
</File>
<File
RelativePath="..\server.cpp"
>
</File>
<File
RelativePath="..\seta.cpp"
>
</File>
<File
RelativePath="..\seta.h"
>
</File>
<File
RelativePath="..\seta010.cpp"
>
</File>
<File
RelativePath="..\seta011.cpp"
>
</File>
<File
RelativePath="..\seta018.cpp"
>
</File>
<File
RelativePath="..\sha256.cpp"
>
</File>
<File
RelativePath="..\snapshot.cpp"
>
</File>
<File
RelativePath="..\snapshot.h"
>
</File>
<File
RelativePath="..\snes9x.cpp"
>
</File>
<File
RelativePath="..\snes9x.h"
>
</File>
<File
RelativePath="..\spc7110.cpp"
>
</File>
<File
RelativePath="..\spc7110.h"
>
</File>
<File
RelativePath="..\srtc.cpp"
>
</File>
<File
RelativePath="..\srtc.h"
>
</File>
<File
RelativePath="..\stream.cpp"
>
</File>
<File
RelativePath="..\stream.h"
>
</File>
<File
RelativePath="..\tile.cpp"
>
</File>
<File
RelativePath="..\tile.h"
>
</File>
<Filter
Name="APU"
>
<File
RelativePath="..\apu\apu.cpp"
>
</File>
<File
RelativePath="..\apu\apu.h"
>
</File>
<File
RelativePath="..\apu\hermite_resampler.h"
>
</File>
<File
RelativePath="..\apu\resampler.h"
>
</File>
<File
RelativePath="..\apu\ring_buffer.h"
>
</File>
<Filter
Name="SMP"
>
<File
RelativePath="..\apu\bapu\smp\smp.cpp"
>
</File>
<File
RelativePath="..\apu\bapu\smp\smp_state.cpp"
>
</File>
</Filter>
<Filter
Name="DSP"
>
<File
RelativePath="..\apu\bapu\dsp\blargg_common.h"
>
</File>
<File
RelativePath="..\apu\bapu\dsp\blargg_config.h"
>
</File>
<File
RelativePath="..\apu\bapu\dsp\blargg_endian.h"
>
</File>
<File
RelativePath="..\apu\bapu\dsp\blargg_source.h"
>
</File>
<File
RelativePath="..\apu\bapu\dsp\sdsp.cpp"
>
</File>
<File
RelativePath="..\apu\bapu\dsp\sdsp.hpp"
>
</File>
<File
RelativePath="..\apu\bapu\dsp\SPC_DSP.cpp"
>
</File>
<File
RelativePath="..\apu\bapu\dsp\SPC_DSP.h"
>
</File>
</Filter>
</Filter>
</Filter>
<Filter
Name="libretro"
>
<File
RelativePath=".\libretro.cpp"
>
</File>
<File
RelativePath=".\libretro.def"
>
</File>
<File
RelativePath=".\libretro.h"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -1,303 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="libretro Debug|Win32">
<Configuration>libretro Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="libretro Debug|x64">
<Configuration>libretro Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="libretro Release|Win32">
<Configuration>libretro Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="libretro Release|x64">
<Configuration>libretro Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{4A2A7544-0547-4539-8B53-047FB9A15C75}</ProjectGuid>
<RootNamespace>libretrowin32</RootNamespace>
<Keyword>Win32Proj</Keyword>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='libretro Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v141_xp</PlatformToolset>
<CharacterSet>NotSet</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='libretro Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v141_xp</PlatformToolset>
<CharacterSet>NotSet</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='libretro Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v141_xp</PlatformToolset>
<CharacterSet>NotSet</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='libretro Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v141_xp</PlatformToolset>
<CharacterSet>NotSet</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='libretro Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='libretro Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='libretro Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='libretro Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>14.0.25431.1</_ProjectFileVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='libretro Debug|Win32'">
<OutDir>$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
<LinkIncremental>true</LinkIncremental>
<TargetName>libretro_debug</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='libretro Debug|x64'">
<OutDir>$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
<LinkIncremental>true</LinkIncremental>
<TargetName>libretro_debug</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='libretro Release|Win32'">
<OutDir>$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
<LinkIncremental>false</LinkIncremental>
<TargetName>libretro</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='libretro Release|x64'">
<OutDir>$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
<LinkIncremental>false</LinkIncremental>
<TargetName>libretro</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='libretro Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>../;../apu/bapu;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>__WIN32__;__WIN32_LIBSNES__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader />
<WarningLevel>Level2</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
</ClCompile>
<Link>
<ModuleDefinitionFile>
</ModuleDefinitionFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='libretro Debug|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>../;../apu/bapu;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>__WIN32__;__WIN32_LIBSNES__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader />
<WarningLevel>Level2</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<ModuleDefinitionFile>
</ModuleDefinitionFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<TargetMachine>MachineX64</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='libretro Release|Win32'">
<ClCompile>
<Optimization>Full</Optimization>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<AdditionalIncludeDirectories>../;../apu/bapu;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>__WIN32__;__WIN32_LIBSNES__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader />
<WarningLevel>Level2</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<ModuleDefinitionFile>
</ModuleDefinitionFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='libretro Release|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<Optimization>Full</Optimization>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
<AdditionalIncludeDirectories>../;../apu/bapu;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>__WIN32__;__WIN32_LIBSNES__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader />
<WarningLevel>Level2</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<ModuleDefinitionFile>
</ModuleDefinitionFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<TargetMachine>MachineX64</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\65c816.h" />
<ClInclude Include="..\apu\apu.h" />
<ClInclude Include="..\apu\bapu\dsp\blargg_common.h" />
<ClInclude Include="..\apu\bapu\dsp\blargg_config.h" />
<ClInclude Include="..\apu\bapu\dsp\blargg_endian.h" />
<ClInclude Include="..\apu\bapu\dsp\blargg_source.h" />
<ClInclude Include="..\apu\bapu\dsp\sdsp.hpp" />
<ClInclude Include="..\apu\bapu\dsp\SPC_DSP.h" />
<ClInclude Include="..\apu\hermite_resampler.h" />
<ClInclude Include="..\apu\resampler.h" />
<ClInclude Include="..\apu\ring_buffer.h" />
<ClInclude Include="..\bsx.h" />
<ClInclude Include="..\c4.h" />
<ClInclude Include="..\cheats.h" />
<ClInclude Include="..\conffile.h" />
<ClInclude Include="..\controls.h" />
<ClInclude Include="..\cpuaddr.h" />
<ClInclude Include="..\cpuexec.h" />
<ClInclude Include="..\cpumacro.h" />
<ClInclude Include="..\cpuops.h" />
<ClInclude Include="..\crosshairs.h" />
<ClInclude Include="..\debug.h" />
<ClInclude Include="..\display.h" />
<ClInclude Include="..\dma.h" />
<ClInclude Include="..\dsp.h" />
<ClInclude Include="..\font.h" />
<ClInclude Include="..\fxemu.h" />
<ClInclude Include="..\fxinst.h" />
<ClInclude Include="..\getset.h" />
<ClInclude Include="..\gfx.h" />
<ClInclude Include="..\language.h" />
<ClInclude Include="..\logger.h" />
<ClInclude Include="..\memmap.h" />
<ClInclude Include="..\messages.h" />
<ClInclude Include="..\missing.h" />
<ClInclude Include="..\movie.h" />
<ClInclude Include="..\msu1.h" />
<ClInclude Include="..\netplay.h" />
<ClInclude Include="..\obc1.h" />
<ClInclude Include="..\pixform.h" />
<ClInclude Include="..\port.h" />
<ClInclude Include="..\ppu.h" />
<ClInclude Include="..\sa1.h" />
<ClInclude Include="..\sar.h" />
<ClInclude Include="..\screenshot.h" />
<ClInclude Include="..\sdd1.h" />
<ClInclude Include="..\sdd1emu.h" />
<ClInclude Include="..\seta.h" />
<ClInclude Include="..\snapshot.h" />
<ClInclude Include="..\snes9x.h" />
<ClInclude Include="..\spc7110.h" />
<ClInclude Include="..\srtc.h" />
<ClInclude Include="..\stream.h" />
<ClInclude Include="..\tile.h" />
<ClInclude Include="libretro.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\apu\apu.cpp" />
<ClCompile Include="..\apu\bapu\dsp\sdsp.cpp" />
<ClCompile Include="..\apu\bapu\dsp\SPC_DSP.cpp" />
<ClCompile Include="..\apu\bapu\smp\smp.cpp" />
<ClCompile Include="..\apu\bapu\smp\smp_state.cpp" />
<ClCompile Include="..\bsx.cpp" />
<ClCompile Include="..\c4.cpp" />
<ClCompile Include="..\c4emu.cpp" />
<ClCompile Include="..\cheats.cpp" />
<ClCompile Include="..\cheats2.cpp" />
<ClCompile Include="..\clip.cpp" />
<ClCompile Include="..\conffile.cpp" />
<ClCompile Include="..\controls.cpp" />
<ClCompile Include="..\cpu.cpp" />
<ClCompile Include="..\cpuexec.cpp" />
<ClCompile Include="..\cpuops.cpp" />
<ClCompile Include="..\crosshairs.cpp" />
<ClCompile Include="..\debug.cpp" />
<ClCompile Include="..\dma.cpp" />
<ClCompile Include="..\dsp.cpp" />
<ClCompile Include="..\dsp1.cpp" />
<ClCompile Include="..\dsp2.cpp" />
<ClCompile Include="..\dsp3.cpp" />
<ClCompile Include="..\dsp4.cpp" />
<ClCompile Include="..\fxemu.cpp" />
<ClCompile Include="..\fxinst.cpp" />
<ClCompile Include="..\gfx.cpp" />
<ClCompile Include="..\globals.cpp" />
<ClCompile Include="..\loadzip.cpp" />
<ClCompile Include="..\logger.cpp" />
<ClCompile Include="..\memmap.cpp" />
<ClCompile Include="..\movie.cpp" />
<ClCompile Include="..\msu1.cpp" />
<ClCompile Include="..\netplay.cpp" />
<ClCompile Include="..\obc1.cpp" />
<ClCompile Include="..\ppu.cpp" />
<ClCompile Include="..\sa1.cpp" />
<ClCompile Include="..\sa1cpu.cpp" />
<ClCompile Include="..\screenshot.cpp" />
<ClCompile Include="..\sdd1.cpp" />
<ClCompile Include="..\sdd1emu.cpp" />
<ClCompile Include="..\server.cpp" />
<ClCompile Include="..\seta.cpp" />
<ClCompile Include="..\seta010.cpp" />
<ClCompile Include="..\seta011.cpp" />
<ClCompile Include="..\seta018.cpp" />
<ClCompile Include="..\snapshot.cpp" />
<ClCompile Include="..\snes9x.cpp" />
<ClCompile Include="..\spc7110.cpp" />
<ClCompile Include="..\srtc.cpp" />
<ClCompile Include="..\stream.cpp" />
<ClCompile Include="..\tile.cpp" />
<ClCompile Include="libretro.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -1,348 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="s9x-source">
<UniqueIdentifier>{11448d42-5e46-4e58-b0be-8cb4b3b52ec0}</UniqueIdentifier>
</Filter>
<Filter Include="s9x-source\APU">
<UniqueIdentifier>{dff4c5c7-1360-4c70-9a67-f5457847b1e9}</UniqueIdentifier>
</Filter>
<Filter Include="s9x-source\APU\SMP">
<UniqueIdentifier>{d36ce584-8d5f-421c-9e1c-219a937e23c3}</UniqueIdentifier>
</Filter>
<Filter Include="s9x-source\APU\DSP">
<UniqueIdentifier>{bb8b70ce-cd5a-45ab-848c-5c5379190802}</UniqueIdentifier>
</Filter>
<Filter Include="libretro">
<UniqueIdentifier>{7445db59-72e6-42a3-963c-c352087333b1}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\65c816.h">
<Filter>s9x-source</Filter>
</ClInclude>
<ClInclude Include="..\bsx.h">
<Filter>s9x-source</Filter>
</ClInclude>
<ClInclude Include="..\c4.h">
<Filter>s9x-source</Filter>
</ClInclude>
<ClInclude Include="..\cheats.h">
<Filter>s9x-source</Filter>
</ClInclude>
<ClInclude Include="..\conffile.h">
<Filter>s9x-source</Filter>
</ClInclude>
<ClInclude Include="..\controls.h">
<Filter>s9x-source</Filter>
</ClInclude>
<ClInclude Include="..\cpuaddr.h">
<Filter>s9x-source</Filter>
</ClInclude>
<ClInclude Include="..\cpuexec.h">
<Filter>s9x-source</Filter>
</ClInclude>
<ClInclude Include="..\cpumacro.h">
<Filter>s9x-source</Filter>
</ClInclude>
<ClInclude Include="..\cpuops.h">
<Filter>s9x-source</Filter>
</ClInclude>
<ClInclude Include="..\crosshairs.h">
<Filter>s9x-source</Filter>
</ClInclude>
<ClInclude Include="..\debug.h">
<Filter>s9x-source</Filter>
</ClInclude>
<ClInclude Include="..\display.h">
<Filter>s9x-source</Filter>
</ClInclude>
<ClInclude Include="..\dma.h">
<Filter>s9x-source</Filter>
</ClInclude>
<ClInclude Include="..\dsp.h">
<Filter>s9x-source</Filter>
</ClInclude>
<ClInclude Include="..\font.h">
<Filter>s9x-source</Filter>
</ClInclude>
<ClInclude Include="..\fxemu.h">
<Filter>s9x-source</Filter>
</ClInclude>
<ClInclude Include="..\fxinst.h">
<Filter>s9x-source</Filter>
</ClInclude>
<ClInclude Include="..\getset.h">
<Filter>s9x-source</Filter>
</ClInclude>
<ClInclude Include="..\gfx.h">
<Filter>s9x-source</Filter>
</ClInclude>
<ClInclude Include="..\language.h">
<Filter>s9x-source</Filter>
</ClInclude>
<ClInclude Include="..\logger.h">
<Filter>s9x-source</Filter>
</ClInclude>
<ClInclude Include="..\memmap.h">
<Filter>s9x-source</Filter>
</ClInclude>
<ClInclude Include="..\messages.h">
<Filter>s9x-source</Filter>
</ClInclude>
<ClInclude Include="..\missing.h">
<Filter>s9x-source</Filter>
</ClInclude>
<ClInclude Include="..\movie.h">
<Filter>s9x-source</Filter>
</ClInclude>
<ClInclude Include="..\netplay.h">
<Filter>s9x-source</Filter>
</ClInclude>
<ClInclude Include="..\obc1.h">
<Filter>s9x-source</Filter>
</ClInclude>
<ClInclude Include="..\pixform.h">
<Filter>s9x-source</Filter>
</ClInclude>
<ClInclude Include="..\port.h">
<Filter>s9x-source</Filter>
</ClInclude>
<ClInclude Include="..\ppu.h">
<Filter>s9x-source</Filter>
</ClInclude>
<ClInclude Include="..\sa1.h">
<Filter>s9x-source</Filter>
</ClInclude>
<ClInclude Include="..\sar.h">
<Filter>s9x-source</Filter>
</ClInclude>
<ClInclude Include="..\screenshot.h">
<Filter>s9x-source</Filter>
</ClInclude>
<ClInclude Include="..\sdd1.h">
<Filter>s9x-source</Filter>
</ClInclude>
<ClInclude Include="..\sdd1emu.h">
<Filter>s9x-source</Filter>
</ClInclude>
<ClInclude Include="..\seta.h">
<Filter>s9x-source</Filter>
</ClInclude>
<ClInclude Include="..\snapshot.h">
<Filter>s9x-source</Filter>
</ClInclude>
<ClInclude Include="..\snes9x.h">
<Filter>s9x-source</Filter>
</ClInclude>
<ClInclude Include="..\spc7110.h">
<Filter>s9x-source</Filter>
</ClInclude>
<ClInclude Include="..\srtc.h">
<Filter>s9x-source</Filter>
</ClInclude>
<ClInclude Include="..\stream.h">
<Filter>s9x-source</Filter>
</ClInclude>
<ClInclude Include="..\tile.h">
<Filter>s9x-source</Filter>
</ClInclude>
<ClInclude Include="..\apu\apu.h">
<Filter>s9x-source\APU</Filter>
</ClInclude>
<ClInclude Include="..\apu\hermite_resampler.h">
<Filter>s9x-source\APU</Filter>
</ClInclude>
<ClInclude Include="..\apu\resampler.h">
<Filter>s9x-source\APU</Filter>
</ClInclude>
<ClInclude Include="..\apu\ring_buffer.h">
<Filter>s9x-source\APU</Filter>
</ClInclude>
<ClInclude Include="..\apu\bapu\dsp\blargg_common.h">
<Filter>s9x-source\APU\DSP</Filter>
</ClInclude>
<ClInclude Include="..\apu\bapu\dsp\blargg_config.h">
<Filter>s9x-source\APU\DSP</Filter>
</ClInclude>
<ClInclude Include="..\apu\bapu\dsp\blargg_endian.h">
<Filter>s9x-source\APU\DSP</Filter>
</ClInclude>
<ClInclude Include="..\apu\bapu\dsp\blargg_source.h">
<Filter>s9x-source\APU\DSP</Filter>
</ClInclude>
<ClInclude Include="..\apu\bapu\dsp\sdsp.hpp">
<Filter>s9x-source\APU\DSP</Filter>
</ClInclude>
<ClInclude Include="..\apu\bapu\dsp\SPC_DSP.h">
<Filter>s9x-source\APU\DSP</Filter>
</ClInclude>
<ClInclude Include="libretro.h">
<Filter>libretro</Filter>
</ClInclude>
<ClInclude Include="..\msu1.h">
<Filter>s9x-source</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\bsx.cpp">
<Filter>s9x-source</Filter>
</ClCompile>
<ClCompile Include="..\c4.cpp">
<Filter>s9x-source</Filter>
</ClCompile>
<ClCompile Include="..\c4emu.cpp">
<Filter>s9x-source</Filter>
</ClCompile>
<ClCompile Include="..\cheats.cpp">
<Filter>s9x-source</Filter>
</ClCompile>
<ClCompile Include="..\cheats2.cpp">
<Filter>s9x-source</Filter>
</ClCompile>
<ClCompile Include="..\clip.cpp">
<Filter>s9x-source</Filter>
</ClCompile>
<ClCompile Include="..\conffile.cpp">
<Filter>s9x-source</Filter>
</ClCompile>
<ClCompile Include="..\controls.cpp">
<Filter>s9x-source</Filter>
</ClCompile>
<ClCompile Include="..\cpu.cpp">
<Filter>s9x-source</Filter>
</ClCompile>
<ClCompile Include="..\cpuexec.cpp">
<Filter>s9x-source</Filter>
</ClCompile>
<ClCompile Include="..\cpuops.cpp">
<Filter>s9x-source</Filter>
</ClCompile>
<ClCompile Include="..\crosshairs.cpp">
<Filter>s9x-source</Filter>
</ClCompile>
<ClCompile Include="..\debug.cpp">
<Filter>s9x-source</Filter>
</ClCompile>
<ClCompile Include="..\dma.cpp">
<Filter>s9x-source</Filter>
</ClCompile>
<ClCompile Include="..\dsp.cpp">
<Filter>s9x-source</Filter>
</ClCompile>
<ClCompile Include="..\dsp1.cpp">
<Filter>s9x-source</Filter>
</ClCompile>
<ClCompile Include="..\dsp2.cpp">
<Filter>s9x-source</Filter>
</ClCompile>
<ClCompile Include="..\dsp3.cpp">
<Filter>s9x-source</Filter>
</ClCompile>
<ClCompile Include="..\dsp4.cpp">
<Filter>s9x-source</Filter>
</ClCompile>
<ClCompile Include="..\fxemu.cpp">
<Filter>s9x-source</Filter>
</ClCompile>
<ClCompile Include="..\fxinst.cpp">
<Filter>s9x-source</Filter>
</ClCompile>
<ClCompile Include="..\gfx.cpp">
<Filter>s9x-source</Filter>
</ClCompile>
<ClCompile Include="..\globals.cpp">
<Filter>s9x-source</Filter>
</ClCompile>
<ClCompile Include="..\loadzip.cpp">
<Filter>s9x-source</Filter>
</ClCompile>
<ClCompile Include="..\logger.cpp">
<Filter>s9x-source</Filter>
</ClCompile>
<ClCompile Include="..\memmap.cpp">
<Filter>s9x-source</Filter>
</ClCompile>
<ClCompile Include="..\movie.cpp">
<Filter>s9x-source</Filter>
</ClCompile>
<ClCompile Include="..\netplay.cpp">
<Filter>s9x-source</Filter>
</ClCompile>
<ClCompile Include="..\obc1.cpp">
<Filter>s9x-source</Filter>
</ClCompile>
<ClCompile Include="..\ppu.cpp">
<Filter>s9x-source</Filter>
</ClCompile>
<ClCompile Include="..\sa1.cpp">
<Filter>s9x-source</Filter>
</ClCompile>
<ClCompile Include="..\sa1cpu.cpp">
<Filter>s9x-source</Filter>
</ClCompile>
<ClCompile Include="..\screenshot.cpp">
<Filter>s9x-source</Filter>
</ClCompile>
<ClCompile Include="..\sdd1.cpp">
<Filter>s9x-source</Filter>
</ClCompile>
<ClCompile Include="..\sdd1emu.cpp">
<Filter>s9x-source</Filter>
</ClCompile>
<ClCompile Include="..\server.cpp">
<Filter>s9x-source</Filter>
</ClCompile>
<ClCompile Include="..\seta.cpp">
<Filter>s9x-source</Filter>
</ClCompile>
<ClCompile Include="..\seta010.cpp">
<Filter>s9x-source</Filter>
</ClCompile>
<ClCompile Include="..\seta011.cpp">
<Filter>s9x-source</Filter>
</ClCompile>
<ClCompile Include="..\seta018.cpp">
<Filter>s9x-source</Filter>
</ClCompile>
<ClCompile Include="..\snapshot.cpp">
<Filter>s9x-source</Filter>
</ClCompile>
<ClCompile Include="..\snes9x.cpp">
<Filter>s9x-source</Filter>
</ClCompile>
<ClCompile Include="..\spc7110.cpp">
<Filter>s9x-source</Filter>
</ClCompile>
<ClCompile Include="..\srtc.cpp">
<Filter>s9x-source</Filter>
</ClCompile>
<ClCompile Include="..\stream.cpp">
<Filter>s9x-source</Filter>
</ClCompile>
<ClCompile Include="..\tile.cpp">
<Filter>s9x-source</Filter>
</ClCompile>
<ClCompile Include="..\apu\apu.cpp">
<Filter>s9x-source\APU</Filter>
</ClCompile>
<ClCompile Include="..\apu\bapu\smp\smp.cpp">
<Filter>s9x-source\APU\SMP</Filter>
</ClCompile>
<ClCompile Include="..\apu\bapu\smp\smp_state.cpp">
<Filter>s9x-source\APU\SMP</Filter>
</ClCompile>
<ClCompile Include="..\apu\bapu\dsp\sdsp.cpp">
<Filter>s9x-source\APU\DSP</Filter>
</ClCompile>
<ClCompile Include="..\apu\bapu\dsp\SPC_DSP.cpp">
<Filter>s9x-source\APU\DSP</Filter>
</ClCompile>
<ClCompile Include="libretro.cpp">
<Filter>libretro</Filter>
</ClCompile>
<ClCompile Include="..\msu1.cpp">
<Filter>s9x-source</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@ -9,29 +9,30 @@
#include "snapshot.h"
#include "controls.h"
#include "cheats.h"
#include "movie.h"
#include "logger.h"
#include "display.h"
#include "conffile.h"
#include <stdio.h>
#ifndef __WIN32__
#ifdef _WIN32
#include <direct.h>
#else
#include <unistd.h>
#endif
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
#define RETRO_DEVICE_JOYPAD_MULTITAP ((1 << 8) | RETRO_DEVICE_JOYPAD)
#define RETRO_DEVICE_LIGHTGUN_SUPER_SCOPE ((1 << 8) | RETRO_DEVICE_LIGHTGUN)
#define RETRO_DEVICE_LIGHTGUN_JUSTIFIER ((2 << 8) | RETRO_DEVICE_LIGHTGUN)
#define RETRO_DEVICE_LIGHTGUN_JUSTIFIERS ((3 << 8) | RETRO_DEVICE_LIGHTGUN)
#define RETRO_DEVICE_JOYPAD_MULTITAP ((1 << 8) | RETRO_DEVICE_JOYPAD)
#define RETRO_DEVICE_LIGHTGUN_SUPER_SCOPE ((1 << 8) | RETRO_DEVICE_LIGHTGUN)
#define RETRO_DEVICE_LIGHTGUN_JUSTIFIER ((2 << 8) | RETRO_DEVICE_LIGHTGUN)
#define RETRO_DEVICE_LIGHTGUN_JUSTIFIERS ((3 << 8) | RETRO_DEVICE_LIGHTGUN)
#define RETRO_MEMORY_SNES_BSX_RAM ((1 << 8) | RETRO_MEMORY_SAVE_RAM)
#define RETRO_MEMORY_SNES_BSX_PRAM ((2 << 8) | RETRO_MEMORY_SAVE_RAM)
#define RETRO_MEMORY_SNES_SUFAMI_TURBO_A_RAM ((3 << 8) | RETRO_MEMORY_SAVE_RAM)
#define RETRO_MEMORY_SNES_SUFAMI_TURBO_B_RAM ((4 << 8) | RETRO_MEMORY_SAVE_RAM)
#define RETRO_MEMORY_SNES_GAME_BOY_RAM ((5 << 8) | RETRO_MEMORY_SAVE_RAM)
#define RETRO_MEMORY_SNES_GAME_BOY_RTC ((6 << 8) | RETRO_MEMORY_RTC)
#define RETRO_MEMORY_SNES_BSX_RAM ((1 << 8) | RETRO_MEMORY_SAVE_RAM)
#define RETRO_MEMORY_SNES_BSX_PRAM ((2 << 8) | RETRO_MEMORY_SAVE_RAM)
#define RETRO_MEMORY_SNES_SUFAMI_TURBO_A_RAM ((3 << 8) | RETRO_MEMORY_SAVE_RAM)
#define RETRO_MEMORY_SNES_SUFAMI_TURBO_B_RAM ((4 << 8) | RETRO_MEMORY_SAVE_RAM)
#define RETRO_MEMORY_SNES_GAME_BOY_RAM ((5 << 8) | RETRO_MEMORY_SAVE_RAM)
#define RETRO_MEMORY_SNES_GAME_BOY_RTC ((6 << 8) | RETRO_MEMORY_RTC)
#define RETRO_GAME_TYPE_BSX 0x101
#define RETRO_GAME_TYPE_BSX_SLOTTED 0x102
@ -39,12 +40,14 @@
#define RETRO_GAME_TYPE_SUPER_GAME_BOY 0x104
#define SNES_4_3 4.0f / 3.0f
#define SNES_8_7 8.0f / 7.0f
char g_rom_dir[PATH_MAX];
char g_basename[PATH_MAX];
char g_rom_dir[1024];
char g_basename[1024];
bool overclock_cycles = false;
bool reduce_sprite_flicker = false;
int one_c, slow_one_c, two_c;
static retro_log_printf_t log_cb = NULL;
retro_log_printf_t log_cb = NULL;
static retro_video_refresh_t video_cb = NULL;
static retro_audio_sample_t audio_cb = NULL;
static retro_audio_sample_batch_t audio_batch_cb = NULL;
@ -110,21 +113,9 @@ void retro_set_input_state(retro_input_state_t cb)
input_state_cb = cb;
}
enum overscan_mode {
OVERSCAN_CROP_ON,
OVERSCAN_CROP_OFF,
OVERSCAN_CROP_AUTO
};
enum aspect_mode {
ASPECT_RATIO_4_3,
ASPECT_RATIO_8_7,
ASPECT_RATIO_NTSC,
ASPECT_RATIO_PAL,
ASPECT_RATIO_AUTO
};
static retro_environment_t environ_cb;
static overscan_mode crop_overscan_mode = OVERSCAN_CROP_ON; // default to crop
static aspect_mode aspect_ratio_mode = ASPECT_RATIO_4_3; // default to 4:3
static unsigned crop_overscan_mode = 0;
static unsigned aspect_ratio_mode = 0;
static bool rom_loaded = false;
void retro_set_environment(retro_environment_t cb)
{
@ -134,6 +125,10 @@ void retro_set_environment(retro_environment_t cb)
// These variable names and possible values constitute an ABI with ZMZ (ZSNES Libretro player).
// Changing "Show layer 1" is fine, but don't change "layer_1"/etc or the possible values ("Yes|No").
// Adding more variables and rearranging them is safe.
{ "snes9x_up_down_allowed", "Allow Opposing Directions; disabled|enabled" },
{ "snes9x_overclock", "SuperFX Frequency; 100%|200%|400%|600%|800%|1000%" },
//{ "snes9x_overclock_cycles", "Reduce Slowdown (Hack, Unsafe); disabled|compatible|max" },
//{ "snes9x_reduce_sprite_flicker", "Reduce Flickering (Hack, Unsafe); disabled|enabled" },
{ "snes9x_layer_1", "Show layer 1; enabled|disabled" },
{ "snes9x_layer_2", "Show layer 2; enabled|disabled" },
{ "snes9x_layer_3", "Show layer 3; enabled|disabled" },
@ -141,6 +136,7 @@ void retro_set_environment(retro_environment_t cb)
{ "snes9x_layer_5", "Show sprite layer; enabled|disabled" },
{ "snes9x_gfx_clip", "Enable graphic clip windows; enabled|disabled" },
{ "snes9x_gfx_transp", "Enable transparency effects; enabled|disabled" },
{ "snes9x_gfx_hires", "Enable hires mode; enabled|disabled" },
{ "snes9x_sndchan_1", "Enable sound channel 1; enabled|disabled" },
{ "snes9x_sndchan_2", "Enable sound channel 2; enabled|disabled" },
{ "snes9x_sndchan_3", "Enable sound channel 3; enabled|disabled" },
@ -149,20 +145,20 @@ void retro_set_environment(retro_environment_t cb)
{ "snes9x_sndchan_6", "Enable sound channel 6; enabled|disabled" },
{ "snes9x_sndchan_7", "Enable sound channel 7; enabled|disabled" },
{ "snes9x_sndchan_8", "Enable sound channel 8; enabled|disabled" },
{ "snes9x_overscan", "Crop overscan; enabled|disabled|auto" },
{ "snes9x_aspect", "Preferred aspect ratio; 4:3|8:7|auto|ntsc|pal" },
{ "snes9x_overscan", "Crop overscan; auto|enabled|disabled" },
{ "snes9x_aspect", "Preferred aspect ratio; auto|ntsc|pal|4:3" },
{ NULL, NULL },
};
environ_cb(RETRO_ENVIRONMENT_SET_VARIABLES, variables);
const struct retro_controller_description port_1[] = {
static const struct retro_controller_description port_1[] = {
{ "SNES Joypad", RETRO_DEVICE_JOYPAD },
{ "SNES Mouse", RETRO_DEVICE_MOUSE },
{ "Multitap", RETRO_DEVICE_JOYPAD_MULTITAP },
};
const struct retro_controller_description port_2[] = {
static const struct retro_controller_description port_2[] = {
{ "SNES Joypad", RETRO_DEVICE_JOYPAD },
{ "SNES Mouse", RETRO_DEVICE_MOUSE },
{ "Multitap", RETRO_DEVICE_JOYPAD_MULTITAP },
@ -170,10 +166,10 @@ void retro_set_environment(retro_environment_t cb)
{ "Justifier", RETRO_DEVICE_LIGHTGUN_JUSTIFIER },
};
const struct retro_controller_info ports[] = {
static const struct retro_controller_info ports[] = {
{ port_1, 3 },
{ port_2, 5 },
{ 0 },
{ 0, 0 },
};
environ_cb(RETRO_ENVIRONMENT_SET_CONTROLLER_INFO, (void*)ports);
@ -191,16 +187,67 @@ static void update_variables(void)
bool geometry_update = false;
char key[256];
struct retro_variable var;
var.key = "snes9x_overclock";
var.value = NULL;
var.key=key;
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var))
{
int freq = atoi(var.value);
Settings.SuperFXClockMultiplier = freq;
}
var.key = "snes9x_up_down_allowed";
var.value = NULL;
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var))
{
Settings.UpAndDown = !strcmp(var.value, "disabled") ? false : true;
}
else
Settings.UpAndDown = false;
var.key = "snes9x_overclock_cycles";
var.value = NULL;
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
{
if (strcmp(var.value, "compatible") == 0)
{
overclock_cycles = true;
one_c = 4;
slow_one_c = 5;
two_c = 6;
}
else if (strcmp(var.value, "max") == 0)
{
overclock_cycles = true;
one_c = 3;
slow_one_c = 3;
two_c = 3;
}
else
overclock_cycles = false;
}
var.key = "snes9x_reduce_sprite_flicker";
var.value = NULL;
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
{
if (strcmp(var.value, "enabled") == 0)
reduce_sprite_flicker = true;
else
reduce_sprite_flicker = false;
}
int disabled_channels=0;
strcpy(key, "snes9x_sndchan_x");
var.key=key;
for (int i=0;i<8;i++)
{
key[strlen("snes9x_sndchan_")]='1'+i;
var.value=NULL;
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value && !strcmp("disabled", var.value))
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && !strcmp("disabled", var.value))
disabled_channels|=1<<i;
}
S9xSetSoundControl(disabled_channels^0xFF);
@ -212,7 +259,7 @@ static void update_variables(void)
{
key[strlen("snes9x_layer_")]='1'+i;
var.value=NULL;
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value && !strcmp("disabled", var.value))
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && !strcmp("disabled", var.value))
disabled_layers|=1<<i;
}
Settings.BG_Forced=disabled_layers;
@ -220,21 +267,25 @@ static void update_variables(void)
//for some reason, Transparency seems to control both the fixed color and the windowing registers?
var.key="snes9x_gfx_clip";
var.value=NULL;
Settings.DisableGraphicWindows=(environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value && !strcmp("disabled", var.value));
Settings.DisableGraphicWindows=(environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && !strcmp("disabled", var.value));
var.key="snes9x_gfx_transp";
var.value=NULL;
Settings.Transparency=!(environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value && !strcmp("disabled", var.value));
Settings.Transparency=!(environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && !strcmp("disabled", var.value));
var.key="snes9x_gfx_hires";
var.value=NULL;
Settings.SupportHiRes=!(environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && !strcmp("disabled", var.value));
var.key = "snes9x_overscan";
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
{
overscan_mode newval = OVERSCAN_CROP_AUTO;
unsigned newval = 0;
if (strcmp(var.value, "enabled") == 0)
newval = OVERSCAN_CROP_ON;
newval = 1;
else if (strcmp(var.value, "disabled") == 0)
newval = OVERSCAN_CROP_OFF;
newval = 2;
if (newval != crop_overscan_mode)
{
@ -247,15 +298,13 @@ static void update_variables(void)
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
{
aspect_mode newval = ASPECT_RATIO_AUTO;
unsigned newval = 0;
if (strcmp(var.value, "ntsc") == 0)
newval = ASPECT_RATIO_NTSC;
newval = 1;
else if (strcmp(var.value, "pal") == 0)
newval = ASPECT_RATIO_PAL;
newval = 2;
else if (strcmp(var.value, "4:3") == 0)
newval = ASPECT_RATIO_4_3;
else if (strcmp(var.value, "8:7") == 0)
newval = ASPECT_RATIO_8_7;
newval = 3;
if (newval != aspect_ratio_mode)
{
@ -270,13 +319,25 @@ static void update_variables(void)
static void S9xAudioCallback(void*)
{
// Just pick a big buffer. We won't use it all.
static int16_t audio_buf[0x20000];
const int BUFFER_SIZE = 256;
// This is called every time 128 to 132 samples are generated, which happens about 8 times per frame. A buffer size of 256 samples is enough here.
static int16_t audio_buf[BUFFER_SIZE];
S9xFinalizeSamples();
size_t avail = S9xGetSampleCount();
S9xMixSamples((uint8*)audio_buf, avail);
audio_batch_cb(audio_buf,avail >> 1);
while (avail >= BUFFER_SIZE)
{
//this loop will never be entered, but handle oversized sample counts just in case
S9xMixSamples((uint8*)audio_buf, BUFFER_SIZE);
audio_batch_cb(audio_buf, BUFFER_SIZE >> 1);
avail -= BUFFER_SIZE;
}
if (avail > 0)
{
S9xMixSamples((uint8*)audio_buf, avail);
audio_batch_cb(audio_buf, avail >> 1);
}
}
void retro_get_system_info(struct retro_system_info *info)
@ -284,36 +345,34 @@ void retro_get_system_info(struct retro_system_info *info)
memset(info,0,sizeof(retro_system_info));
info->library_name = "Snes9x";
info->library_version = VERSION;
info->valid_extensions = "smc|sfc|swc|fig|bs";
#ifndef GIT_VERSION
#define GIT_VERSION ""
#endif
info->library_version = VERSION GIT_VERSION;
info->valid_extensions = "smc|sfc|swc|fig";
info->need_fullpath = false;
info->block_extract = false;
}
float get_aspect_ratio(unsigned width, unsigned height)
{
if (aspect_ratio_mode == ASPECT_RATIO_4_3)
if (aspect_ratio_mode == 3) // 4:3
{
return SNES_4_3;
}
else if (aspect_ratio_mode == ASPECT_RATIO_8_7)
{
return SNES_8_7;
}
// OV2: not sure if these really make sense - NTSC is similar to 4:3, PAL looks weird
float sample_frequency_ntsc = 135000000.0 / 11.0;
float sample_frequency_pal = 14750000.0;
float sample_freq = retro_get_region() == RETRO_REGION_NTSC ? sample_frequency_ntsc : sample_frequency_pal;
float dot_rate = SNES::cpu.frequency / 4.0;
if (aspect_ratio_mode == ASPECT_RATIO_NTSC) // ntsc
if (aspect_ratio_mode == 1) // ntsc
{
sample_freq = sample_frequency_ntsc;
dot_rate = NTSC_MASTER_CLOCK / 4.0;
}
else if (aspect_ratio_mode == ASPECT_RATIO_PAL) // pal
else if (aspect_ratio_mode == 2) // pal
{
sample_freq = sample_frequency_pal;
dot_rate = PAL_MASTER_CLOCK / 4.0;
@ -328,9 +387,9 @@ void retro_get_system_av_info(struct retro_system_av_info *info)
memset(info,0,sizeof(retro_system_av_info));
unsigned width = SNES_WIDTH;
unsigned height = PPU.ScreenHeight;
if (crop_overscan_mode == OVERSCAN_CROP_ON)
if (crop_overscan_mode == 1) // enabled
height = SNES_HEIGHT;
else if (crop_overscan_mode == OVERSCAN_CROP_OFF)
else if (crop_overscan_mode == 2) // disabled
height = SNES_HEIGHT_EXTENDED;
info->geometry.base_width = width;
@ -356,40 +415,40 @@ void retro_reset()
static unsigned snes_devices[2];
void retro_set_controller_port_device(unsigned port, unsigned device)
{
if(port < 2)
if (port < 2)
{
int offset = snes_devices[0] == RETRO_DEVICE_JOYPAD_MULTITAP ? 4 : 1;
switch (device)
{
case RETRO_DEVICE_JOYPAD:
S9xSetController(port, CTL_JOYPAD, port * offset, 0, 0, 0);
snes_devices[port] = RETRO_DEVICE_JOYPAD;
break;
case RETRO_DEVICE_JOYPAD_MULTITAP:
S9xSetController(port, CTL_MP5, port * offset, port * offset + 1, port * offset + 2, port * offset + 3);
snes_devices[port] = RETRO_DEVICE_JOYPAD_MULTITAP;
break;
case RETRO_DEVICE_MOUSE:
S9xSetController(port, CTL_MOUSE, 0, 0, 0, 0);
snes_devices[port] = RETRO_DEVICE_MOUSE;
break;
case RETRO_DEVICE_LIGHTGUN_SUPER_SCOPE:
S9xSetController(port, CTL_SUPERSCOPE, 0, 0, 0, 0);
snes_devices[port] = RETRO_DEVICE_LIGHTGUN_SUPER_SCOPE;
break;
case RETRO_DEVICE_LIGHTGUN_JUSTIFIER:
S9xSetController(port, CTL_JUSTIFIER, 0, 0, 0, 0);
snes_devices[port] = RETRO_DEVICE_LIGHTGUN_JUSTIFIER;
break;
default:
if (log_cb)
log_cb(RETRO_LOG_ERROR, "[libretro]: Invalid device (%d).\n", device);
}
if (!port)
retro_set_controller_port_device(1, snes_devices[1]);
int offset = snes_devices[0] == RETRO_DEVICE_JOYPAD_MULTITAP ? 4 : 1;
switch (device)
{
case RETRO_DEVICE_JOYPAD:
S9xSetController(port, CTL_JOYPAD, port * offset, 0, 0, 0);
snes_devices[port] = RETRO_DEVICE_JOYPAD;
break;
case RETRO_DEVICE_JOYPAD_MULTITAP:
S9xSetController(port, CTL_MP5, port * offset, port * offset + 1, port * offset + 2, port * offset + 3);
snes_devices[port] = RETRO_DEVICE_JOYPAD_MULTITAP;
break;
case RETRO_DEVICE_MOUSE:
S9xSetController(port, CTL_MOUSE, port, 0, 0, 0);
snes_devices[port] = RETRO_DEVICE_MOUSE;
break;
case RETRO_DEVICE_LIGHTGUN_SUPER_SCOPE:
S9xSetController(port, CTL_SUPERSCOPE, 0, 0, 0, 0);
snes_devices[port] = RETRO_DEVICE_LIGHTGUN_SUPER_SCOPE;
break;
case RETRO_DEVICE_LIGHTGUN_JUSTIFIER:
S9xSetController(port, CTL_JUSTIFIER, 0, 0, 0, 0);
snes_devices[port] = RETRO_DEVICE_LIGHTGUN_JUSTIFIER;
break;
default:
if (log_cb)
log_cb(RETRO_LOG_ERROR, "[libretro]: Invalid device.\n");
}
if (!port)
retro_set_controller_port_device(1, snes_devices[1]);
}
else if(device != RETRO_DEVICE_NONE)
log_cb(RETRO_LOG_INFO, "[libretro]: Nonexistent Port (%d).\n", port);
log_cb(RETRO_LOG_INFO, "[libretro]: Nonexistent Port (%d).\n", port);
}
void retro_cheat_reset()
@ -432,6 +491,49 @@ void retro_cheat_set(unsigned index, bool enabled, const char *codeline)
S9xCheatsEnable();
}
#define MAX_MAPS 32
static struct retro_memory_descriptor memorydesc[MAX_MAPS];
static unsigned memorydesc_c;
static bool merge_mapping()
{
if (memorydesc_c==1) return false;//can't merge the only one
struct retro_memory_descriptor * a=&memorydesc[MAX_MAPS - (memorydesc_c-1)];
struct retro_memory_descriptor * b=&memorydesc[MAX_MAPS - memorydesc_c];
//printf("test %x/%x\n",a->start,b->start);
if (a->flags != b->flags) return false;
if (a->disconnect != b->disconnect) return false;
if (a->len != b->len) return false;
if (a->addrspace || b->addrspace) return false;//we don't use these
if (((char*)a->ptr)+a->offset==((char*)b->ptr)+b->offset && a->select==b->select)
{
//printf("merge/mirror\n");
a->select&=~(a->start^b->start);
memorydesc_c--;
return true;
}
uint32 len=a->len;
if (!len) len=(0x1000000 - a->select);
if (len && ((len-1) & (len | a->disconnect))==0 && ((char*)a->ptr)+a->offset+len == ((char*)b->ptr)+b->offset)
{
//printf("merge/consec\n");
a->select &=~ len;
a->disconnect &=~ len;
memorydesc_c--;
return true;
}
//printf("nomerge\n");
return false;
}
void S9xAppendMapping(struct retro_memory_descriptor *desc)
{
//do it backwards - snes9x defines the last one to win, while we define the first one to win
//printf("add %x\n",desc->start);
memcpy(&memorydesc[MAX_MAPS - (++memorydesc_c)], desc, sizeof(struct retro_memory_descriptor));
while (merge_mapping()) {}
}
static void init_descriptors(void)
{
struct retro_input_descriptor desc[] = {
@ -500,15 +602,18 @@ static void init_descriptors(void)
{ 4, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_SELECT, "Select" },
{ 4, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_START, "Start" },
{ 0 },
{ 0, 0, 0, 0, NULL },
};
environ_cb(RETRO_ENVIRONMENT_SET_INPUT_DESCRIPTORS, desc);
}
static bool ChronoTriggerFrameHack;
bool retro_load_game(const struct retro_game_info *game)
{
init_descriptors();
memorydesc_c = 0;
update_variables();
@ -525,19 +630,35 @@ bool retro_load_game(const struct retro_game_info *game)
rom_loaded = Memory.LoadROMMem((const uint8_t*)game->data ,game->size);
}
enum retro_pixel_format fmt = RETRO_PIXEL_FORMAT_RGB565;
if(!environ_cb || !environ_cb(RETRO_ENVIRONMENT_SET_PIXEL_FORMAT, &fmt))
{
return false;
int pixel_format = RGB555;
if(environ_cb) {
pixel_format = RGB565;
enum retro_pixel_format fmt = RETRO_PIXEL_FORMAT_RGB565;
if (!environ_cb(RETRO_ENVIRONMENT_SET_PIXEL_FORMAT, &fmt))
pixel_format = RGB555;
}
S9xGraphicsDeinit();
S9xSetRenderPixelFormat(pixel_format);
S9xGraphicsInit();
if (!rom_loaded && log_cb)
log_cb(RETRO_LOG_ERROR, "[libretro]: Rom loading failed...\n");
/* Check if Chrono Trigger is loaded, if so, we need to set a variable to
* true to get rid of an annoying mid-frame resolution switch to 256x239
* which can cause an undesirable flicker/breakup of the screen for a
* split second - this happens whenever the game switches from normal
* mode to battle mode and vice versa. */
ChronoTriggerFrameHack = false;
if (Memory.match_nc("CHRONO TRIGGER") || /* Chrono Trigger */
Memory.match_id("ACT") ||
Memory.match_id("AC9J") /* Chrono Trigger (Sample) */
)
ChronoTriggerFrameHack = true;
struct retro_memory_map map={ memorydesc+MAX_MAPS-memorydesc_c, memorydesc_c };
if (rom_loaded) environ_cb(RETRO_ENVIRONMENT_SET_MEMORY_MAPS, &map);
return rom_loaded;
}
@ -548,6 +669,7 @@ bool retro_load_game_special(unsigned game_type,
const struct retro_game_info *info, size_t num_info) {
init_descriptors();
memorydesc_c = 0;
update_variables();
@ -593,6 +715,9 @@ bool retro_load_game_special(unsigned game_type,
break;
}
struct retro_memory_map map={ memorydesc+MAX_MAPS-memorydesc_c, memorydesc_c };
if (rom_loaded) environ_cb(RETRO_ENVIRONMENT_SET_MEMORY_MAPS, &map);
return rom_loaded;
}
@ -605,7 +730,7 @@ static void check_system_specs(void)
environ_cb(RETRO_ENVIRONMENT_SET_PERFORMANCE_LEVEL, &level);
}
void retro_init()
void retro_init(void)
{
struct retro_log_callback log;
@ -614,6 +739,10 @@ void retro_init()
else
log_cb = NULL;
// State that SNES9X supports achievements.
bool achievements = true;
environ_cb(RETRO_ENVIRONMENT_SET_SUPPORT_ACHIEVEMENTS, &achievements);
memset(&Settings, 0, sizeof(Settings));
Settings.MouseMaster = TRUE;
Settings.SuperScopeMaster = TRUE;
@ -631,10 +760,6 @@ void retro_init()
Settings.InitialInfoStringTimeout = 120;
Settings.HDMATimingHack = 100;
Settings.BlockInvalidVRAMAccessMaster = TRUE;
Settings.WrongMovieStateProtection = TRUE;
Settings.DumpStreamsMaxFrames = -1;
Settings.StretchScreenshots = 0;
Settings.SnapshotScreenshots = FALSE;
Settings.CartAName[0] = 0;
Settings.CartBName[0] = 0;
Settings.AutoSaveDelay = 1;
@ -652,8 +777,14 @@ void retro_init()
exit(1);
}
//very slow devices will still pop
S9xInitSound(1000, 0);//just give it a 1 second buffer
//this needs to be applied to all snes9x cores
//increasing the buffer size does not cause extra lag(tested with 1000ms buffer)
//bool8 S9xInitSound (int buffer_ms, int lag_ms)
S9xInitSound(32, 0); //give it a 1.9 frame long buffer, or 1026 samples. The audio buffer is flushed every 128-132 samples anyway, so it won't get anywhere near there.
S9xSetSoundMute(FALSE);
S9xSetSamplesAvailableCallback(S9xAudioCallback, NULL);
@ -725,6 +856,7 @@ void retro_init()
#define BTN_POINTER (BTN_LAST + 1)
#define BTN_POINTER2 (BTN_POINTER + 1)
static void map_buttons()
{
MAP_BUTTON(MAKE_BUTTON(PAD_1, BTN_A), "Joypad1 A");
@ -875,9 +1007,26 @@ void retro_run()
update_geometry();
height = PPU.ScreenHeight;
}
int result = -1;
bool okay = environ_cb(RETRO_ENVIRONMENT_GET_AUDIO_VIDEO_ENABLE, &result);
if (okay)
{
bool audioEnabled = 0 != (result & 2);
bool videoEnabled = 0 != (result & 1);
IPPU.RenderThisFrame = videoEnabled;
S9xSetSoundMute(!audioEnabled);
}
else
{
IPPU.RenderThisFrame = true;
S9xSetSoundMute(false);
}
poll_cb();
report_buttons();
S9xMainLoop();
S9xAudioCallback(NULL);
}
void retro_deinit()
@ -917,6 +1066,9 @@ void* retro_get_memory_data(unsigned type)
case RETRO_MEMORY_VIDEO_RAM:
data = Memory.VRAM;
break;
//case RETRO_MEMORY_ROM:
// data = Memory.ROM;
// break;
default:
data = NULL;
break;
@ -948,6 +1100,9 @@ size_t retro_get_memory_size(unsigned type)
case RETRO_MEMORY_VIDEO_RAM:
size = 64 * 1024;
break;
//case RETRO_MEMORY_ROM:
// size = Memory.CalculatedSize;
// break;
default:
size = 0;
break;
@ -973,12 +1128,17 @@ bool retro_unserialize(const void* data, size_t size)
{
if (S9xUnfreezeGameMem((const uint8_t*)data,size) != SUCCESS)
return false;
return true;
}
bool8 S9xDeinitUpdate(int width, int height)
{
if (crop_overscan_mode == OVERSCAN_CROP_ON)
// Apply Chrono Trigger Framehack
if (ChronoTriggerFrameHack && (height > SNES_HEIGHT))
height = SNES_HEIGHT;
if (crop_overscan_mode == 1) // enabled
{
if (height >= SNES_HEIGHT << 1)
{
@ -989,7 +1149,7 @@ bool8 S9xDeinitUpdate(int width, int height)
height = SNES_HEIGHT;
}
}
else if (crop_overscan_mode == OVERSCAN_CROP_OFF)
else if (crop_overscan_mode == 2) // disabled
{
if (height > SNES_HEIGHT_EXTENDED)
{
@ -1011,7 +1171,7 @@ bool8 S9xDeinitUpdate(int width, int height)
bool8 S9xContinueUpdate(int width, int height)
{
return true;
return S9xDeinitUpdate(width, height);
}
// Dummy functions that should probably be implemented correctly later.
@ -1019,6 +1179,12 @@ void S9xParsePortConfig(ConfigFile&, int) {}
void S9xSyncSpeed() {}
const char* S9xStringInput(const char* in) { return in; }
#ifdef _WIN32
#define SLASH '\\'
#else
#define SLASH '/'
#endif
const char* S9xGetFilename(const char* in, s9x_getdirtype type)
{
static char newpath[2048];
@ -1028,8 +1194,8 @@ const char* S9xGetFilename(const char* in, s9x_getdirtype type)
switch (type)
{
case ROMFILENAME_DIR:
snprintf(newpath, sizeof(newpath), "%s%c%s%s",
g_rom_dir, SLASH_CHAR, g_basename, in);
sprintf(newpath, "%s%c%s%s",
g_rom_dir, SLASH, g_basename, in);
return newpath;
default:
break;
@ -1060,13 +1226,35 @@ const char* S9xBasename(const char* in) { return in; }
bool8 S9xInitUpdate() { return TRUE; }
void S9xExtraUsage() {}
bool8 S9xOpenSoundDevice() { return TRUE; }
void S9xMessage(int, int, const char*) {}
bool S9xPollAxis(unsigned int, short*) { return FALSE; }
void S9xSetPalette() {}
void S9xParseArg(char**, int&, int) {}
void S9xExit() {}
bool S9xPollPointer(unsigned int, short*, short*) { return false; }
const char *S9xChooseMovieFilename(unsigned char) { return NULL; }
void S9xMessage(int type, int, const char* s)
{
if (!log_cb) return;
switch (type)
{
case S9X_DEBUG:
log_cb(RETRO_LOG_DEBUG, "%s\n", s);
break;
case S9X_WARNING:
log_cb(RETRO_LOG_WARN, "%s\n", s);
break;
case S9X_INFO:
log_cb(RETRO_LOG_INFO, "%s\n", s);
break;
case S9X_ERROR:
log_cb(RETRO_LOG_ERROR, "%s\n", s);
break;
default:
log_cb(RETRO_LOG_DEBUG, "%s\n", s);
break;
}
}
bool8 S9xOpenSnapshotFile(const char* filepath, bool8 read_only, STREAM *file)
{

39
libretro/libretro.def Normal file
View File

@ -0,0 +1,39 @@
LIBRARY libretro
EXPORTS
retro_api_version
retro_get_system_info
retro_get_system_av_info
retro_set_video_refresh
retro_set_audio_sample
retro_set_audio_sample_batch
retro_set_input_poll
retro_set_input_state
retro_set_environment
retro_set_controller_port_device
retro_init
retro_deinit
retro_reset
retro_run
retro_serialize_size
retro_serialize
retro_unserialize
retro_cheat_reset
retro_cheat_set
retro_load_game
retro_unload_game
retro_load_game_special
retro_get_region
retro_get_memory_data
retro_get_memory_size

321
libretro/libretro.h Executable file → Normal file
View File

@ -1,4 +1,4 @@
/* Copyright (C) 2010-2016 The RetroArch team
/* Copyright (C) 2010-2017 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this libretro API header (libretro.h).
@ -23,7 +23,7 @@
#ifndef LIBRETRO_H__
#define LIBRETRO_H__
#include <port.h>
#include <stdint.h>
#include <stddef.h>
#include <limits.h>
@ -126,16 +126,23 @@ extern "C" {
*/
#define RETRO_DEVICE_KEYBOARD 3
/* Lightgun X/Y coordinates are reported relatively to last poll,
* similar to mouse. */
/* LIGHTGUN device is similar to Guncon-2 for PlayStation 2.
* It reports X/Y coordinates in screen space (similar to the pointer)
* in the range [-0x8000, 0x7fff] in both axes, with zero being center.
* As well as reporting on/off screen state. It features a trigger,
* start/select buttons, auxiliary action buttons and a
* directional pad. A forced off-screen shot can be requested for
* auto-reloading function in some games.
*/
#define RETRO_DEVICE_LIGHTGUN 4
/* The ANALOG device is an extension to JOYPAD (RetroPad).
* Similar to DualShock it adds two analog sticks.
* This is treated as a separate device type as it returns values in the
* full analog range of [-0x8000, 0x7fff]. Positive X axis is right.
* Positive Y axis is down.
* Only use ANALOG type when polling for analog values of the axes.
* Similar to DualShock2 it adds two analog sticks and all buttons can
* be analog. This is treated as a separate device type as it returns
* axis values in the full analog range of [-0x8000, 0x7fff].
* Positive X axis is right. Positive Y axis is down.
* Buttons are returned in the range [0, 0x7fff].
* Only use ANALOG type when polling for analog values.
*/
#define RETRO_DEVICE_ANALOG 5
@ -174,7 +181,8 @@ extern "C" {
/* Buttons for the RetroPad (JOYPAD).
* The placement of these is equivalent to placements on the
* Super Nintendo controller.
* L2/R2/L3/R3 buttons correspond to the PS1 DualShock. */
* L2/R2/L3/R3 buttons correspond to the PS1 DualShock.
* Also used as id values for RETRO_DEVICE_INDEX_ANALOG_BUTTON */
#define RETRO_DEVICE_ID_JOYPAD_B 0
#define RETRO_DEVICE_ID_JOYPAD_Y 1
#define RETRO_DEVICE_ID_JOYPAD_SELECT 2
@ -193,10 +201,11 @@ extern "C" {
#define RETRO_DEVICE_ID_JOYPAD_R3 15
/* Index / Id values for ANALOG device. */
#define RETRO_DEVICE_INDEX_ANALOG_LEFT 0
#define RETRO_DEVICE_INDEX_ANALOG_RIGHT 1
#define RETRO_DEVICE_ID_ANALOG_X 0
#define RETRO_DEVICE_ID_ANALOG_Y 1
#define RETRO_DEVICE_INDEX_ANALOG_LEFT 0
#define RETRO_DEVICE_INDEX_ANALOG_RIGHT 1
#define RETRO_DEVICE_INDEX_ANALOG_BUTTON 2
#define RETRO_DEVICE_ID_ANALOG_X 0
#define RETRO_DEVICE_ID_ANALOG_Y 1
/* Id values for MOUSE. */
#define RETRO_DEVICE_ID_MOUSE_X 0
@ -208,15 +217,30 @@ extern "C" {
#define RETRO_DEVICE_ID_MOUSE_MIDDLE 6
#define RETRO_DEVICE_ID_MOUSE_HORIZ_WHEELUP 7
#define RETRO_DEVICE_ID_MOUSE_HORIZ_WHEELDOWN 8
#define RETRO_DEVICE_ID_MOUSE_BUTTON_4 9
#define RETRO_DEVICE_ID_MOUSE_BUTTON_5 10
/* Id values for LIGHTGUN types. */
#define RETRO_DEVICE_ID_LIGHTGUN_X 0
#define RETRO_DEVICE_ID_LIGHTGUN_Y 1
#define RETRO_DEVICE_ID_LIGHTGUN_TRIGGER 2
#define RETRO_DEVICE_ID_LIGHTGUN_CURSOR 3
#define RETRO_DEVICE_ID_LIGHTGUN_TURBO 4
#define RETRO_DEVICE_ID_LIGHTGUN_PAUSE 5
#define RETRO_DEVICE_ID_LIGHTGUN_START 6
/* Id values for LIGHTGUN. */
#define RETRO_DEVICE_ID_LIGHTGUN_SCREEN_X 13 /*Absolute Position*/
#define RETRO_DEVICE_ID_LIGHTGUN_SCREEN_Y 14 /*Absolute*/
#define RETRO_DEVICE_ID_LIGHTGUN_IS_OFFSCREEN 15 /*Status Check*/
#define RETRO_DEVICE_ID_LIGHTGUN_TRIGGER 2
#define RETRO_DEVICE_ID_LIGHTGUN_RELOAD 16 /*Forced off-screen shot*/
#define RETRO_DEVICE_ID_LIGHTGUN_AUX_A 3
#define RETRO_DEVICE_ID_LIGHTGUN_AUX_B 4
#define RETRO_DEVICE_ID_LIGHTGUN_START 6
#define RETRO_DEVICE_ID_LIGHTGUN_SELECT 7
#define RETRO_DEVICE_ID_LIGHTGUN_AUX_C 8
#define RETRO_DEVICE_ID_LIGHTGUN_DPAD_UP 9
#define RETRO_DEVICE_ID_LIGHTGUN_DPAD_DOWN 10
#define RETRO_DEVICE_ID_LIGHTGUN_DPAD_LEFT 11
#define RETRO_DEVICE_ID_LIGHTGUN_DPAD_RIGHT 12
/* deprecated */
#define RETRO_DEVICE_ID_LIGHTGUN_X 0 /*Relative Position*/
#define RETRO_DEVICE_ID_LIGHTGUN_Y 1 /*Relative*/
#define RETRO_DEVICE_ID_LIGHTGUN_CURSOR 3 /*Use Aux:A*/
#define RETRO_DEVICE_ID_LIGHTGUN_TURBO 4 /*Use Aux:B*/
#define RETRO_DEVICE_ID_LIGHTGUN_PAUSE 5 /*Use Start*/
/* Id values for POINTER. */
#define RETRO_DEVICE_ID_POINTER_X 0
@ -230,20 +254,22 @@ extern "C" {
/* Id values for LANGUAGE */
enum retro_language
{
RETRO_LANGUAGE_ENGLISH = 0,
RETRO_LANGUAGE_JAPANESE = 1,
RETRO_LANGUAGE_FRENCH = 2,
RETRO_LANGUAGE_SPANISH = 3,
RETRO_LANGUAGE_GERMAN = 4,
RETRO_LANGUAGE_ITALIAN = 5,
RETRO_LANGUAGE_DUTCH = 6,
RETRO_LANGUAGE_PORTUGUESE = 7,
RETRO_LANGUAGE_RUSSIAN = 8,
RETRO_LANGUAGE_KOREAN = 9,
RETRO_LANGUAGE_CHINESE_TRADITIONAL = 10,
RETRO_LANGUAGE_CHINESE_SIMPLIFIED = 11,
RETRO_LANGUAGE_ESPERANTO = 12,
RETRO_LANGUAGE_POLISH = 13,
RETRO_LANGUAGE_ENGLISH = 0,
RETRO_LANGUAGE_JAPANESE = 1,
RETRO_LANGUAGE_FRENCH = 2,
RETRO_LANGUAGE_SPANISH = 3,
RETRO_LANGUAGE_GERMAN = 4,
RETRO_LANGUAGE_ITALIAN = 5,
RETRO_LANGUAGE_DUTCH = 6,
RETRO_LANGUAGE_PORTUGUESE_BRAZIL = 7,
RETRO_LANGUAGE_PORTUGUESE_PORTUGAL = 8,
RETRO_LANGUAGE_RUSSIAN = 9,
RETRO_LANGUAGE_KOREAN = 10,
RETRO_LANGUAGE_CHINESE_TRADITIONAL = 11,
RETRO_LANGUAGE_CHINESE_SIMPLIFIED = 12,
RETRO_LANGUAGE_ESPERANTO = 13,
RETRO_LANGUAGE_POLISH = 14,
RETRO_LANGUAGE_VIETNAMESE = 15,
RETRO_LANGUAGE_LAST,
/* Ensure sizeof(enum) == sizeof(int) */
@ -712,7 +738,7 @@ enum retro_mod
/* struct retro_log_callback * --
* Gets an interface for logging. This is useful for
* logging in a cross-platform way
* as certain platforms cannot use use stderr for logging.
* as certain platforms cannot use stderr for logging.
* It also allows the frontend to
* show logging information in a more suitable way.
* If this interface is not used, libretro cores should
@ -921,6 +947,182 @@ enum retro_mod
* writeable (and readable).
*/
#define RETRO_ENVIRONMENT_SET_HW_SHARED_CONTEXT (44 | RETRO_ENVIRONMENT_EXPERIMENTAL)
/* N/A (null) * --
* The frontend will try to use a 'shared' hardware context (mostly applicable
* to OpenGL) when a hardware context is being set up.
*
* Returns true if the frontend supports shared hardware contexts and false
* if the frontend does not support shared hardware contexts.
*
* This will do nothing on its own until SET_HW_RENDER env callbacks are
* being used.
*/
#define RETRO_ENVIRONMENT_GET_VFS_INTERFACE (45 | RETRO_ENVIRONMENT_EXPERIMENTAL)
/* struct retro_vfs_interface_info * --
* Gets access to the VFS interface.
* VFS presence needs to be queried prior to load_game or any
* get_system/save/other_directory being called to let front end know
* core supports VFS before it starts handing out paths.
* It is recomended to do so in retro_set_environment */
#define RETRO_ENVIRONMENT_GET_AUDIO_VIDEO_ENABLE (47 | RETRO_ENVIRONMENT_EXPERIMENTAL)
/* int * --
* Tells the core if the frontend wants audio or video.
* If disabled, the frontend will discard the audio or video,
* so the core may decide to skip generating a frame or generating audio.
* This is mainly used for increasing performance.
* Bit 0 (value 1): Enable Video
* Bit 1 (value 2): Enable Audio
* Bit 2 (value 4): Use Fast Savestates.
* Bit 3 (value 8): Hard Disable Audio
* Other bits are reserved for future use and will default to zero.
* If video is disabled:
* * The frontend wants the core to not generate any video,
* including presenting frames via hardware acceleration.
* * The frontend's video frame callback will do nothing.
* * After running the frame, the video output of the next frame should be
* no different than if video was enabled, and saving and loading state
* should have no issues.
* If audio is disabled:
* * The frontend wants the core to not generate any audio.
* * The frontend's audio callbacks will do nothing.
* * After running the frame, the audio output of the next frame should be
* no different than if audio was enabled, and saving and loading state
* should have no issues.
* Fast Savestates:
* * Guaranteed to be created by the same binary that will load them.
* * Will not be written to or read from the disk.
* * Suggest that the core assumes loading state will succeed.
* * Suggest that the core updates its memory buffers in-place if possible.
* * Suggest that the core skips clearing memory.
* * Suggest that the core skips resetting the system.
* * Suggest that the core may skip validation steps.
* Hard Disable Audio:
* * Used for a secondary core when running ahead.
* * Indicates that the frontend will never need audio from the core.
* * Suggests that the core may stop synthesizing audio, but this should not
* compromise emulation accuracy.
* * Audio output for the next frame does not matter, and the frontend will
* never need an accurate audio state in the future.
* * State will never be saved when using Hard Disable Audio.
*/
/* VFS functionality */
/* File paths:
* File paths passed as parameters when using this api shall be well formed unix-style,
* using "/" (unquoted forward slash) as directory separator regardless of the platform's native separator.
* Paths shall also include at least one forward slash ("game.bin" is an invalid path, use "./game.bin" instead).
* Other than the directory separator, cores shall not make assumptions about path format:
* "C:/path/game.bin", "http://example.com/game.bin", "#game/game.bin", "./game.bin" (without quotes) are all valid paths.
* Cores may replace the basename or remove path components from the end, and/or add new components;
* however, cores shall not append "./", "../" or multiple consecutive forward slashes ("//") to paths they request to front end.
* The frontend is encouraged to make such paths work as well as it can, but is allowed to give up if the core alters paths too much.
* Frontends are encouraged, but not required, to support native file system paths (modulo replacing the directory separator, if applicable).
* Cores are allowed to try using them, but must remain functional if the front rejects such requests.
* Cores are encouraged to use the libretro-common filestream functions for file I/O,
* as they seamlessly integrate with VFS, deal with directory separator replacement as appropriate
* and provide platform-specific fallbacks in cases where front ends do not support VFS. */
/* Opaque file handle
* Introduced in VFS API v1 */
struct retro_vfs_file_handle;
/* File open flags
* Introduced in VFS API v1 */
#define RETRO_VFS_FILE_ACCESS_READ (1 << 0) /* Read only mode */
#define RETRO_VFS_FILE_ACCESS_WRITE (1 << 1) /* Write only mode, discard contents and overwrites existing file unless RETRO_VFS_FILE_ACCESS_UPDATE is also specified */
#define RETRO_VFS_FILE_ACCESS_READ_WRITE (RETRO_VFS_FILE_ACCESS_READ | RETRO_VFS_FILE_ACCESS_WRITE) /* Read-write mode, discard contents and overwrites existing file unless RETRO_VFS_FILE_ACCESS_UPDATE is also specified*/
#define RETRO_VFS_FILE_ACCESS_UPDATE_EXISTING (1 << 2) /* Prevents discarding content of existing files opened for writing */
/* These are only hints. The frontend may choose to ignore them. Other than RAM/CPU/etc use,
and how they react to unlikely external interference (for example someone else writing to that file,
or the file's server going down), behavior will not change. */
#define RETRO_VFS_FILE_ACCESS_HINT_NONE (0)
/* Indicate that the file will be accessed many times. The frontend should aggressively cache everything. */
#define RETRO_VFS_FILE_ACCESS_HINT_FREQUENT_ACCESS (1 << 0)
/* Seek positions */
#define RETRO_VFS_SEEK_POSITION_START 0
#define RETRO_VFS_SEEK_POSITION_CURRENT 1
#define RETRO_VFS_SEEK_POSITION_END 2
/* Get path from opaque handle. Returns the exact same path passed to file_open when getting the handle
* Introduced in VFS API v1 */
typedef const char *(RETRO_CALLCONV *retro_vfs_get_path_t)(struct retro_vfs_file_handle *stream);
/* Open a file for reading or writing. If path points to a directory, this will
* fail. Returns the opaque file handle, or NULL for error.
* Introduced in VFS API v1 */
typedef struct retro_vfs_file_handle *(RETRO_CALLCONV *retro_vfs_open_t)(const char *path, unsigned mode, unsigned hints);
/* Close the file and release its resources. Must be called if open_file returns non-NULL. Returns 0 on succes, -1 on failure.
* Whether the call succeeds ot not, the handle passed as parameter becomes invalid and should no longer be used.
* Introduced in VFS API v1 */
typedef int (RETRO_CALLCONV *retro_vfs_close_t)(struct retro_vfs_file_handle *stream);
/* Return the size of the file in bytes, or -1 for error.
* Introduced in VFS API v1 */
typedef int64_t (RETRO_CALLCONV *retro_vfs_size_t)(struct retro_vfs_file_handle *stream);
/* Get the current read / write position for the file. Returns - 1 for error.
* Introduced in VFS API v1 */
typedef int64_t (RETRO_CALLCONV *retro_vfs_tell_t)(struct retro_vfs_file_handle *stream);
/* Set the current read/write position for the file. Returns the new position, -1 for error.
* Introduced in VFS API v1 */
typedef int64_t (RETRO_CALLCONV *retro_vfs_seek_t)(struct retro_vfs_file_handle *stream, int64_t offset, int seek_position);
/* Read data from a file. Returns the number of bytes read, or -1 for error.
* Introduced in VFS API v1 */
typedef int64_t (RETRO_CALLCONV *retro_vfs_read_t)(struct retro_vfs_file_handle *stream, void *s, uint64_t len);
/* Write data to a file. Returns the number of bytes written, or -1 for error.
* Introduced in VFS API v1 */
typedef int64_t (RETRO_CALLCONV *retro_vfs_write_t)(struct retro_vfs_file_handle *stream, const void *s, uint64_t len);
/* Flush pending writes to file, if using buffered IO. Returns 0 on sucess, or -1 on failure.
* Introduced in VFS API v1 */
typedef int (RETRO_CALLCONV *retro_vfs_flush_t)(struct retro_vfs_file_handle *stream);
/* Delete the specified file. Returns 0 on success, -1 on failure
* Introduced in VFS API v1 */
typedef int (RETRO_CALLCONV *retro_vfs_remove_t)(const char *path);
/* Rename the specified file. Returns 0 on success, -1 on failure
* Introduced in VFS API v1 */
typedef int (RETRO_CALLCONV *retro_vfs_rename_t)(const char *old_path, const char *new_path);
struct retro_vfs_interface
{
retro_vfs_get_path_t get_path;
retro_vfs_open_t open;
retro_vfs_close_t close;
retro_vfs_size_t size;
retro_vfs_tell_t tell;
retro_vfs_seek_t seek;
retro_vfs_read_t read;
retro_vfs_write_t write;
retro_vfs_flush_t flush;
retro_vfs_remove_t remove;
retro_vfs_rename_t rename;
};
struct retro_vfs_interface_info
{
/* Set by core: should this be higher than the version the front end supports,
* front end will return false in the RETRO_ENVIRONMENT_GET_VFS_INTERFACE call
* Introduced in VFS API v1 */
uint32_t required_interface_version;
/* Frontend writes interface pointer here. The frontend also sets the actual
* version, must be at least required_interface_version.
* Introduced in VFS API v1 */
struct retro_vfs_interface *iface;
};
enum retro_hw_render_interface_type
{
RETRO_HW_RENDER_INTERFACE_VULKAN = 0,
@ -976,6 +1178,36 @@ struct retro_hw_render_context_negotiation_interface
* so it will be used after SET_HW_RENDER, but before the context_reset callback.
*/
/* Serialized state is incomplete in some way. Set if serialization is
* usable in typical end-user cases but should not be relied upon to
* implement frame-sensitive frontend features such as netplay or
* rerecording. */
#define RETRO_SERIALIZATION_QUIRK_INCOMPLETE (1 << 0)
/* The core must spend some time initializing before serialization is
* supported. retro_serialize() will initially fail; retro_unserialize()
* and retro_serialize_size() may or may not work correctly either. */
#define RETRO_SERIALIZATION_QUIRK_MUST_INITIALIZE (1 << 1)
/* Serialization size may change within a session. */
#define RETRO_SERIALIZATION_QUIRK_CORE_VARIABLE_SIZE (1 << 2)
/* Set by the frontend to acknowledge that it supports variable-sized
* states. */
#define RETRO_SERIALIZATION_QUIRK_FRONT_VARIABLE_SIZE (1 << 3)
/* Serialized state can only be loaded during the same session. */
#define RETRO_SERIALIZATION_QUIRK_SINGLE_SESSION (1 << 4)
/* Serialized state cannot be loaded on an architecture with a different
* endianness from the one it was saved on. */
#define RETRO_SERIALIZATION_QUIRK_ENDIAN_DEPENDENT (1 << 5)
/* Serialized state cannot be loaded on a different platform from the one it
* was saved on for reasons other than endianness, such as word size
* dependence */
#define RETRO_SERIALIZATION_QUIRK_PLATFORM_DEPENDENT (1 << 6)
#define RETRO_ENVIRONMENT_SET_SERIALIZATION_QUIRKS 44
/* uint64_t * --
* Sets quirk flags associated with serialization. The frontend will zero any flags it doesn't
* recognize or support. Should be set in either retro_init or retro_load_game, but not both.
*/
#define RETRO_MEMDESC_CONST (1 << 0) /* The frontend will never change this memory area once retro_load_game has returned. */
#define RETRO_MEMDESC_BIGENDIAN (1 << 1) /* The memory area contains big endian data. Default is little endian. */
#define RETRO_MEMDESC_ALIGN_2 (1 << 16) /* All memory access in this area is aligned to their own size, or 2, whichever is smaller. */
@ -1284,6 +1516,8 @@ struct retro_log_callback
#define RETRO_SIMD_VFPV4 (1 << 17)
#define RETRO_SIMD_POPCNT (1 << 18)
#define RETRO_SIMD_MOVBE (1 << 19)
#define RETRO_SIMD_CMOV (1 << 20)
#define RETRO_SIMD_ASIMD (1 << 21)
typedef uint64_t retro_perf_tick_t;
typedef int64_t retro_time_t;
@ -1657,7 +1891,8 @@ struct retro_hw_render_callback
* be providing preallocated framebuffers. */
retro_hw_get_current_framebuffer_t get_current_framebuffer;
/* Set by frontend. */
/* Set by frontend.
* Can return all relevant functions, including glClear on Windows. */
retro_hw_get_proc_address_t get_proc_address;
/* Set if render buffers should have depth component attached.
@ -1940,10 +2175,12 @@ struct retro_variable
struct retro_game_info
{
const char *path; /* Path to game, UTF-8 encoded.
* Usually used as a reference.
* May be NULL if rom was loaded from stdin
* or similar.
* retro_system_info::need_fullpath guaranteed
* Sometimes used as a reference for building other paths.
* May be NULL if game was loaded from stdin or similar,
* but in this case some cores will be unable to load `data`.
* So, it is preferable to fabricate something here instead
* of passing NULL, which will help more cores to succeed.
* retro_system_info::need_fullpath requires
* that this path is valid. */
const void *data; /* Memory buffer of loaded game. Will be NULL
* if need_fullpath was set. */

124
libretro/msvc/msvc-2010.bat Normal file
View File

@ -0,0 +1,124 @@
@echo off
@echo Setting environment for using Microsoft Visual Studio 2010 x86 tools.
@call :GetVSCommonToolsDir
@if "%VS100COMNTOOLS%"=="" goto error_no_VS100COMNTOOLSDIR
@call "%VS100COMNTOOLS%VCVarsQueryRegistry.bat" 32bit No64bit
@if "%VSINSTALLDIR%"=="" goto error_no_VSINSTALLDIR
@if "%FrameworkDir32%"=="" goto error_no_FrameworkDIR32
@if "%FrameworkVersion32%"=="" goto error_no_FrameworkVer32
@if "%Framework35Version%"=="" goto error_no_Framework35Version
@set FrameworkDir=%FrameworkDir32%
@set FrameworkVersion=%FrameworkVersion32%
@if not "%WindowsSdkDir%" == "" (
@set "PATH=%WindowsSdkDir%bin\NETFX 4.0 Tools;%WindowsSdkDir%bin;%PATH%"
@set "INCLUDE=%WindowsSdkDir%include;%INCLUDE%"
@set "LIB=%WindowsSdkDir%lib;%LIB%"
)
@rem
@rem Root of Visual Studio IDE installed files.
@rem
@set DevEnvDir=%VSINSTALLDIR%Common7\IDE\
@rem PATH
@rem ----
@if exist "%VSINSTALLDIR%Team Tools\Performance Tools" (
@set "PATH=%VSINSTALLDIR%Team Tools\Performance Tools;%PATH%"
)
@if exist "%ProgramFiles%\HTML Help Workshop" set PATH=%ProgramFiles%\HTML Help Workshop;%PATH%
@if exist "%ProgramFiles(x86)%\HTML Help Workshop" set PATH=%ProgramFiles(x86)%\HTML Help Workshop;%PATH%
@if exist "%VCINSTALLDIR%VCPackages" set PATH=%VCINSTALLDIR%VCPackages;%PATH%
@set PATH=%FrameworkDir%%Framework35Version%;%PATH%
@set PATH=%FrameworkDir%%FrameworkVersion%;%PATH%
@set PATH=%VSINSTALLDIR%Common7\Tools;%PATH%
@if exist "%VCINSTALLDIR%BIN" set PATH=%VCINSTALLDIR%BIN;%PATH%
@set PATH=%DevEnvDir%;%PATH%
@if exist "%VSINSTALLDIR%VSTSDB\Deploy" (
@set "PATH=%VSINSTALLDIR%VSTSDB\Deploy;%PATH%"
)
@if not "%FSHARPINSTALLDIR%" == "" (
@set "PATH=%FSHARPINSTALLDIR%;%PATH%"
)
@rem INCLUDE
@rem -------
@if exist "%VCINSTALLDIR%ATLMFC\INCLUDE" set INCLUDE=%VCINSTALLDIR%ATLMFC\INCLUDE;%INCLUDE%
@if exist "%VCINSTALLDIR%INCLUDE" set INCLUDE=%VCINSTALLDIR%INCLUDE;%INCLUDE%
@rem LIB
@rem ---
@if exist "%VCINSTALLDIR%ATLMFC\LIB" set LIB=%VCINSTALLDIR%ATLMFC\LIB;%LIB%
@if exist "%VCINSTALLDIR%LIB" set LIB=%VCINSTALLDIR%LIB;%LIB%
@rem LIBPATH
@rem -------
@if exist "%VCINSTALLDIR%ATLMFC\LIB" set LIBPATH=%VCINSTALLDIR%ATLMFC\LIB;%LIBPATH%
@if exist "%VCINSTALLDIR%LIB" set LIBPATH=%VCINSTALLDIR%LIB;%LIBPATH%
@set LIBPATH=%FrameworkDir%%Framework35Version%;%LIBPATH%
@set LIBPATH=%FrameworkDir%%FrameworkVersion%;%LIBPATH%
@goto end
@REM -----------------------------------------------------------------------
:GetVSCommonToolsDir
@set VS100COMNTOOLS=
@call :GetVSCommonToolsDirHelper32 HKLM > nul 2>&1
@if errorlevel 1 call :GetVSCommonToolsDirHelper32 HKCU > nul 2>&1
@if errorlevel 1 call :GetVSCommonToolsDirHelper64 HKLM > nul 2>&1
@if errorlevel 1 call :GetVSCommonToolsDirHelper64 HKCU > nul 2>&1
@exit /B 0
:GetVSCommonToolsDirHelper32
@for /F "tokens=1,2*" %%i in ('reg query "%1\SOFTWARE\Microsoft\VisualStudio\SxS\VS7" /v "10.0"') DO (
@if "%%i"=="10.0" (
@SET "VS100COMNTOOLS=%%k"
)
)
@if "%VS100COMNTOOLS%"=="" exit /B 1
@SET "VS100COMNTOOLS=%VS100COMNTOOLS%Common7\Tools\"
@exit /B 0
:GetVSCommonToolsDirHelper64
@for /F "tokens=1,2*" %%i in ('reg query "%1\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7" /v "10.0"') DO (
@if "%%i"=="10.0" (
@SET "VS100COMNTOOLS=%%k"
)
)
@if "%VS100COMNTOOLS%"=="" exit /B 1
@SET "VS100COMNTOOLS=%VS100COMNTOOLS%Common7\Tools\"
@exit /B 0
@REM -----------------------------------------------------------------------
:error_no_VS100COMNTOOLSDIR
@echo ERROR: Cannot determine the location of the VS Common Tools folder.
@goto end
:error_no_VSINSTALLDIR
@echo ERROR: Cannot determine the location of the VS installation.
@goto end
:error_no_FrameworkDIR32
@echo ERROR: Cannot determine the location of the .NET Framework 32bit installation.
@goto end
:error_no_FrameworkVer32
@echo ERROR: Cannot determine the version of the .NET Framework 32bit installation.
@goto end
:error_no_Framework35Version
@echo ERROR: Cannot determine the .NET Framework 3.5 version.
@goto end
:end
msbuild msvc-2010.sln /p:Configuration=Release /target:clean
msbuild msvc-2010.sln /p:Configuration=Release
exit

View File

@ -0,0 +1,20 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "msvc-2010", "msvc-2010\msvc-2010.vcxproj", "{5BDB0E63-AD88-4547-BF48-169312DDD188}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{5BDB0E63-AD88-4547-BF48-169312DDD188}.Debug|Win32.ActiveCfg = Debug|Win32
{5BDB0E63-AD88-4547-BF48-169312DDD188}.Debug|Win32.Build.0 = Debug|Win32
{5BDB0E63-AD88-4547-BF48-169312DDD188}.Release|Win32.ActiveCfg = Release|Win32
{5BDB0E63-AD88-4547-BF48-169312DDD188}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,27 @@
LIBRARY "msvc-2010"
EXPORTS
retro_set_environment
retro_set_video_refresh
retro_set_audio_sample
retro_set_audio_sample_batch
retro_set_input_poll
retro_set_input_state
retro_init
retro_deinit
retro_api_version
retro_get_system_info
retro_get_system_av_info
retro_set_controller_port_device
retro_reset
retro_run
retro_serialize_size
retro_serialize
retro_unserialize
retro_cheat_reset
retro_cheat_set
retro_load_game
retro_load_game_special
retro_unload_game
retro_get_region
retro_get_memory_data
retro_get_memory_size

View File

@ -0,0 +1,140 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{5BDB0E63-AD88-4547-BF48-169312DDD188}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>msvc2010</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)msvc-2010\$(Configuration)\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)msvc-2010\$(Configuration)\</OutDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;MSVC2010_EXPORTS;%(PreprocessorDefinitions);RIGHTSHIFT_IS_SAR;__LIBRETRO__;__WIN32__;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)\..\..\;$(SolutionDir)\..\..\..\;$(SolutionDir)\..\..\apu\bapu\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ModuleDefinitionFile>libretro.def</ModuleDefinitionFile>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;MSVC2010_EXPORTS;%(PreprocessorDefinitions);RIGHTSHIFT_IS_SAR;__LIBRETRO__;__WIN32__;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)\..\..\;$(SolutionDir)\..\..\..\;$(SolutionDir)\..\..\apu\bapu\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<ModuleDefinitionFile>libretro.def</ModuleDefinitionFile>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\..\apu\apu.cpp" />
<ClCompile Include="..\..\..\apu\bapu\dsp\sdsp.cpp" />
<ClCompile Include="..\..\..\apu\bapu\dsp\SPC_DSP.cpp" />
<ClCompile Include="..\..\..\apu\bapu\smp\smp.cpp" />
<ClCompile Include="..\..\..\apu\bapu\smp\smp_state.cpp" />
<ClCompile Include="..\..\..\bml.cpp" />
<ClCompile Include="..\..\..\bsx.cpp" />
<ClCompile Include="..\..\..\c4.cpp" />
<ClCompile Include="..\..\..\c4emu.cpp" />
<ClCompile Include="..\..\..\cheats.cpp" />
<ClCompile Include="..\..\..\cheats2.cpp" />
<ClCompile Include="..\..\..\clip.cpp" />
<ClCompile Include="..\..\..\conffile.cpp" />
<ClCompile Include="..\..\..\controls.cpp" />
<ClCompile Include="..\..\..\cpu.cpp" />
<ClCompile Include="..\..\..\cpuexec.cpp" />
<ClCompile Include="..\..\..\cpuops.cpp" />
<ClCompile Include="..\..\..\crosshairs.cpp" />
<ClCompile Include="..\..\..\debug.cpp" />
<ClCompile Include="..\..\..\dma.cpp" />
<ClCompile Include="..\..\..\dsp.cpp" />
<ClCompile Include="..\..\..\dsp1.cpp" />
<ClCompile Include="..\..\..\dsp2.cpp" />
<ClCompile Include="..\..\..\dsp3.cpp" />
<ClCompile Include="..\..\..\dsp4.cpp" />
<ClCompile Include="..\..\..\fxdbg.cpp" />
<ClCompile Include="..\..\..\fxemu.cpp" />
<ClCompile Include="..\..\..\fxinst.cpp" />
<ClCompile Include="..\..\..\gfx.cpp" />
<ClCompile Include="..\..\..\globals.cpp" />
<ClCompile Include="..\..\..\logger.cpp" />
<ClCompile Include="..\..\..\memmap.cpp" />
<ClCompile Include="..\..\..\movie.cpp" />
<ClCompile Include="..\..\..\netplay.cpp" />
<ClCompile Include="..\..\..\obc1.cpp" />
<ClCompile Include="..\..\..\ppu.cpp" />
<ClCompile Include="..\..\..\sa1.cpp" />
<ClCompile Include="..\..\..\sa1cpu.cpp" />
<ClCompile Include="..\..\..\sdd1.cpp" />
<ClCompile Include="..\..\..\sdd1emu.cpp" />
<ClCompile Include="..\..\..\server.cpp" />
<ClCompile Include="..\..\..\seta.cpp" />
<ClCompile Include="..\..\..\seta010.cpp" />
<ClCompile Include="..\..\..\seta011.cpp" />
<ClCompile Include="..\..\..\seta018.cpp" />
<ClCompile Include="..\..\..\sha256.cpp" />
<ClCompile Include="..\..\..\snapshot.cpp" />
<ClCompile Include="..\..\..\snes9x.cpp" />
<ClCompile Include="..\..\..\spc7110.cpp" />
<ClCompile Include="..\..\..\srtc.cpp" />
<ClCompile Include="..\..\..\stream.cpp" />
<ClCompile Include="..\..\..\tile.cpp" />
<ClCompile Include="..\..\libretro.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,193 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
<Filter Include="Source Files\apu">
<UniqueIdentifier>{7722f8be-0c98-4fd5-a919-d642e2bae1ce}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\apu\bapu">
<UniqueIdentifier>{effa9675-f3f1-4f4e-a39c-171182a225b8}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\apu\bapu\dsp">
<UniqueIdentifier>{e6d15138-760b-4651-ac48-7eaab1f67fec}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\apu\bapu\smp">
<UniqueIdentifier>{57cbef14-a9d6-45dd-9d6b-338d7b63a520}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\libretro">
<UniqueIdentifier>{161f54ee-3443-4972-afe1-b1931c65570b}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\libretro.cpp">
<Filter>Source Files\libretro</Filter>
</ClCompile>
<ClCompile Include="..\..\..\apu\apu.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\apu\bapu\dsp\sdsp.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\apu\bapu\dsp\SPC_DSP.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\apu\bapu\smp\smp.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\apu\bapu\smp\smp_state.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\bml.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\bsx.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\c4.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\c4emu.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\cheats.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\cheats2.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\clip.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\conffile.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\controls.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\cpu.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\cpuexec.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\cpuops.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\crosshairs.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\debug.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\dma.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\dsp.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\dsp1.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\dsp2.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\dsp3.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\dsp4.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\fxdbg.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\fxemu.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\fxinst.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\gfx.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\globals.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\logger.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\memmap.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\movie.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\netplay.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\obc1.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\ppu.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\sa1.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\sa1cpu.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\sdd1.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\sdd1emu.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\server.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\seta.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\seta010.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\seta011.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\seta018.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\sha256.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\snapshot.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\snes9x.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\spc7110.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\srtc.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\stream.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\tile.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

18
port.h
View File

@ -216,10 +216,14 @@
#define RIGHTSHIFT_int8_IS_SAR
#define RIGHTSHIFT_int16_IS_SAR
#define RIGHTSHIFT_int32_IS_SAR
#ifndef __WIN32_LIBSNES__
#ifndef __LIBRETRO__
#define SNES_JOY_READ_CALLBACKS
#define GFX_MULTI_FORMAT
#endif //__WIN32_LIBSNES__
#endif //__LIBRETRO__
#endif
#ifdef __LIBRETRO__
#define GFX_MULTI_FORMAT
#endif
#ifdef __MACOSX__
@ -279,9 +283,9 @@ __extension__
typedef long long int64;
typedef unsigned long long uint64;
#ifdef PTR_NOT_INT
typedef long pint;
typedef size_t pint;
#else // __PTR_NOT_INT
typedef int pint;
typedef size_t pint;
#endif // __PTR_NOT_INT
#endif // __WIN32__
#endif // HAVE_STDINT_H
@ -320,14 +324,14 @@ void _makepath (char *, const char *, const char *, const char *, const char *);
#define snprintf _snprintf
#define strcasecmp stricmp
#define strncasecmp strnicmp
#ifndef __WIN32_LIBSNES__
#ifndef __LIBRETRO__
void WinDisplayStringFromBottom(const char *string, int linesFromBottom, int pixelsFromLeft, bool allowWrap);
#define S9xDisplayString WinDisplayStringFromBottom
void SetInfoDlgColor(unsigned char, unsigned char, unsigned char);
#define SET_UI_COLOR(r,g,b) SetInfoDlgColor(r,g,b)
#else // __WIN32_LIBSNES__
#else // __LIBRETRO__
#define S9xDisplayString DisplayStringFromBottom
#endif // __WIN32_LIBSNES__
#endif // __LIBRETRO__
#endif // __WIN32__
#if defined(__DJGPP) || defined(__WIN32__)