diff --git a/Makefile b/Makefile index c8926d613d..0eaffc23d2 100644 --- a/Makefile +++ b/Makefile @@ -27,6 +27,8 @@ OBJ = retroarch.o \ gfx/image.o \ gfx/fonts/fonts.o \ gfx/fonts/bitmapfont.o \ + audio/hermite.o \ + audio/resampler.o \ performance.o JOYCONFIG_OBJ = tools/retroarch-joyconfig.o \ @@ -298,8 +300,6 @@ ifeq ($(HAVE_SINC), 1) ifeq ($(HAVE_NEON),1) OBJ += audio/sinc_neon.o endif -else - OBJ += audio/hermite.o endif OBJ += audio/utils.o ifeq ($(HAVE_NEON),1) diff --git a/Makefile.ngc b/Makefile.ngc index 79530bdf89..54936e616b 100644 --- a/Makefile.ngc +++ b/Makefile.ngc @@ -1,7 +1,4 @@ -### -## -# Makefile for RetroArch GameCube. -## +RARCH_VERSION = "0.9.8.3" DEBUG = 0 HAVE_LOGGER = 1 @@ -56,7 +53,7 @@ CFLAGS += -DHAVE_FILE_LOGGER CFLAGS += -Iconsole/logger endif -CFLAGS += -std=gnu99 -DHAVE_DEFAULT_RETROPAD_INPUT -DHAVE_RMENU -DHAVE_RGUI -DHAVE_THREAD -DRARCH_CONSOLE -DHAVE_LIBRETRO_MANAGEMENT -DHAVE_RARCH_EXEC -DGEKKO -DHAVE_ZLIB -DWANT_RZLIB -DHAVE_RARCH_MAIN_WRAP -DHAVE_GRIFFIN=1 -DHAVE_SCREENSHOTS -DPACKAGE_VERSION=\"0.9.8.2\" -Dmain=rarch_main -Wno-char-subscripts +CFLAGS += -std=gnu99 -DHAVE_DEFAULT_RETROPAD_INPUT -DHAVE_RMENU -DHAVE_RGUI -DHAVE_THREAD -DRARCH_CONSOLE -DHAVE_LIBRETRO_MANAGEMENT -DHAVE_RARCH_EXEC -DGEKKO -DHAVE_ZLIB -DWANT_RZLIB -DHAVE_RARCH_MAIN_WRAP -DHAVE_GRIFFIN=1 -DHAVE_SCREENSHOTS -DPACKAGE_VERSION=\"$(RARCH_VERSION)\" -Dmain=rarch_main -Wno-char-subscripts ifeq ($(DEBUG), 1) CFLAGS += -O0 -g diff --git a/Makefile.ps3 b/Makefile.ps3 index 021d386036..9abf5bd488 100644 --- a/Makefile.ps3 +++ b/Makefile.ps3 @@ -1,4 +1,4 @@ -RARCH_VERSION = "0.9.8.1" +RARCH_VERSION = "0.9.8.3" #which compiler to build with - GCC or SNC #set to GCC for debug builds for use with debugger @@ -109,7 +109,7 @@ PPU_LDLIBS = $(FONT_LIBS) $(GL_LIBS) $(WHOLE_START) -lretro_ps3 $(WHOLE_END) -l PPU_RANLIB = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-ranlib.exe -DEFINES += -DHAVE_DEFAULT_RETROPAD_INPUT -DHAVE_RMENU -DHAVE_RMENU_GUI -DHAVE_THREAD -DRARCH_CONSOLE -DHAVE_OPENGL -DHAVE_HEADSET -DHAVE_VID_CONTEXT -DHAVE_OPENGLES -DHAVE_OPENGLES1 -DHAVE_PSGL -DHAVE_CG -DHAVE_CG_RUNTIME_COMPILER -DHAVE_FILEBROWSER -DHAVE_FBO -DHAVE_RARCH_MAIN_WRAP -DHAVE_SYSMODULES -DHAVE_SYSUTILS -DHAVE_RARCH_EXEC -DHAVE_LIBRETRO_MANAGEMENT -DHAVE_RSOUND -DHAVE_ZLIB -DWANT_RZLIB -D__CELLOS_LV2__ -DHAVE_NETPLAY=1 -DHAVE_SOCKET_LEGACY=1 -DHAVE_OSKUTIL -DHAVE_MOUSE -DHAVE_GRIFFIN=1 -DHAVE_MULTIMAN=1 -DPACKAGE_VERSION=\"$(RARCH_VERSION)\" -Dmain=rarch_main -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT) +DEFINES += -DHAVE_DEFAULT_RETROPAD_INPUT -DHAVE_RMENU -DHAVE_RMENU_GUI -DHAVE_THREAD -DRARCH_CONSOLE -DHAVE_OPENGL -DHAVE_HEADSET -DHAVE_VID_CONTEXT -DHAVE_OPENGLES -DHAVE_OPENGLES1 -DHAVE_PSGL -DHAVE_CG -DHAVE_CG_RUNTIME_COMPILER -DHAVE_FILEBROWSER -DHAVE_FBO -DHAVE_RARCH_MAIN_WRAP -DHAVE_SYSMODULES -DHAVE_SYSUTILS -DHAVE_RARCH_EXEC -DHAVE_LIBRETRO_MANAGEMENT -DHAVE_RSOUND -DHAVE_ZLIB -DWANT_RZLIB -DHAVE_SINC -DSINC_LOWER_QUALITY -D__CELLOS_LV2__ -DHAVE_NETPLAY=1 -DHAVE_SOCKET_LEGACY=1 -DHAVE_OSKUTIL -DHAVE_MOUSE -DHAVE_GRIFFIN=1 -DHAVE_MULTIMAN=1 -DPACKAGE_VERSION=\"$(RARCH_VERSION)\" -Dmain=rarch_main -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT) ifeq ($(DEBUG), 1) PPU_OPTIMIZE_LV := -O0 -g diff --git a/Makefile.psl1ght b/Makefile.psl1ght index 5c37332b76..6f8845e8b5 100644 --- a/Makefile.psl1ght +++ b/Makefile.psl1ght @@ -1,8 +1,4 @@ -### -## -# Makefile for RetroArch PSL1GHT. -## -RARCH_VERSION = "0.9.8" +RARCH_VERSION = "0.9.8.3" DEBUG = 0 HAVE_LOGGER = 0 diff --git a/Makefile.psp1 b/Makefile.psp1 index 92b1ee21e4..73b4dcb133 100644 --- a/Makefile.psp1 +++ b/Makefile.psp1 @@ -1,4 +1,4 @@ -RARCH_VERSION = "0.9.8" +RARCH_VERSION = "0.9.8.3" HAVE_FILE_LOGGER = 1 diff --git a/Makefile.wii b/Makefile.wii index 3be9f6ee33..3e03db212d 100644 --- a/Makefile.wii +++ b/Makefile.wii @@ -1,7 +1,4 @@ -### -## -# Makefile for RetroArch Wii. -## +RARCH_VERSION = "0.9.8.3" DEBUG = 0 HAVE_LOGGER = 0 @@ -69,7 +66,7 @@ CFLAGS += -Iconsole/logger endif -CFLAGS += -std=gnu99 -DHAVE_DEFAULT_RETROPAD_INPUT -DHAVE_RGUI -DHAVE_THREAD -DRARCH_CONSOLE -DHAVE_LIBRETRO_MANAGEMENT -DHAVE_RARCH_EXEC -DHAVE_RMENU -DGEKKO -DHAVE_ZLIB -DWANT_RZLIB -DHAVE_RARCH_MAIN_WRAP -DHAVE_GRIFFIN=1 -DHAVE_SCREENSHOTS -DPACKAGE_VERSION=\"0.9.8.2\" -Dmain=rarch_main -Wno-char-subscripts +CFLAGS += -std=gnu99 -DHAVE_SINC -DSINC_LOWER_QUALITY -DHAVE_DEFAULT_RETROPAD_INPUT -DHAVE_RGUI -DHAVE_THREAD -DRARCH_CONSOLE -DHAVE_LIBRETRO_MANAGEMENT -DHAVE_RARCH_EXEC -DHAVE_RMENU -DGEKKO -DHAVE_ZLIB -DWANT_RZLIB -DHAVE_RARCH_MAIN_WRAP -DHAVE_GRIFFIN=1 -DHAVE_SCREENSHOTS -DPACKAGE_VERSION=\"$(RARCH_VERSION)\" -Dmain=rarch_main -Wno-char-subscripts ifeq ($(DEBUG), 1) CFLAGS += -O0 -g -DDEBUG diff --git a/Makefile.win b/Makefile.win index 7a5838c5b6..ff02d01eea 100644 --- a/Makefile.win +++ b/Makefile.win @@ -30,6 +30,8 @@ OBJ = retroarch.o \ gfx/fonts/fonts.o \ gfx/fonts/bitmapfont.o \ gfx/image.o \ + audio/hermite.o \ + audio/resampler.o \ performance.o JOBJ := conf/config_file.o \ @@ -208,8 +210,7 @@ endif ifeq ($(HAVE_SINC), 1) OBJ += audio/sinc.o -else - OBJ += audio/hermite.o + DEFINES += -DHAVE_SINC endif ifneq ($(V), 1) diff --git a/Makefile.xenon b/Makefile.xenon index 8c20c2273b..a23fb407df 100644 --- a/Makefile.xenon +++ b/Makefile.xenon @@ -1,9 +1,4 @@ -### -## -# Makefile for RetroArch libxenon. -## -### -## +RARCH_VERSION = "0.9.8.3" DEBUG = 0 @@ -21,7 +16,7 @@ INCDIRS = -I. -I$(DEVKITXENON)/usr/include OBJ = console/griffin/griffin.o LIBS = -lretro_xenon360 -lxenon -lm -lc -DEFINES = -std=gnu99 -DPACKAGE_VERSION=\"0.9.8\" -DRARCH_CONSOLE -DHAVE_THREAD -DHAVE_GETOPT_LONG=1 -DHAVE_GRIFFIN -Dmain=rarch_main +DEFINES = -std=gnu99 -DPACKAGE_VERSION=\"$(RARCH_VERSION)\" -DRARCH_CONSOLE -DHAVE_THREAD -DHAVE_GETOPT_LONG=1 -DHAVE_GRIFFIN -Dmain=rarch_main DEFINES += -maltivec -mhard-float -m32 -mpowerpc64 -mcpu=cell -mtune=cell -fno-pic -g -Wall -DXENON $(INCDIRS) -Wno-char-subscripts DEFINES += -u read -u _start -u exc_base diff --git a/android/native/jni/Android.mk b/android/native/jni/Android.mk index ea5d613c7f..25b1a45b9e 100644 --- a/android/native/jni/Android.mk +++ b/android/native/jni/Android.mk @@ -1,4 +1,4 @@ -RARCH_VERSION = "0.9.8" +RARCH_VERSION = "0.9.8.3" LOCAL_PATH := $(call my-dir) PERF_TEST := 0 HAVE_NEON := 1 @@ -27,7 +27,7 @@ ifeq ($(HAVE_SINC),1) ifeq ($(HAVE_NEON),1) LOCAL_SRC_FILES += ../../../audio/sinc_neon.S.neon endif -LOCAL_CFLAGS += -DHAVE_SINC +LOCAL_CFLAGS += -DHAVE_SINC -DSINC_LOWER_QUALITY endif LOCAL_CFLAGS += -DANDROID_ARM_V7 diff --git a/android/native/jni/input_android.c b/android/native/jni/input_android.c index 7ce5a667ea..7c64fdb914 100644 --- a/android/native/jni/input_android.c +++ b/android/native/jni/input_android.c @@ -172,10 +172,16 @@ static void android_input_poll(void *data) action == AMOTION_EVENT_ACTION_CANCEL || action == AMOTION_EVENT_ACTION_POINTER_UP) || (source == AINPUT_SOURCE_MOUSE && action != AMOTION_EVENT_ACTION_DOWN); - int max = min(AMotionEvent_getPointerCount(event), MAX_TOUCH); - for (motion_pointer = 0; motion_pointer < max; motion_pointer++) + if (keyup && motion_pointer < MAX_TOUCH) { - if (!keyup) + memmove(pointer + motion_pointer, pointer + motion_pointer + 1, (MAX_TOUCH - motion_pointer - 1) * sizeof(struct input_pointer)); + if (pointer_count > 0) + pointer_count--; + } + else + { + int pointer_max = min(AMotionEvent_getPointerCount(event), MAX_TOUCH); + for (motion_pointer = 0; motion_pointer < pointer_max; motion_pointer++) { x = AMotionEvent_getX(event, motion_pointer); y = AMotionEvent_getY(event, motion_pointer); @@ -186,12 +192,6 @@ static void android_input_poll(void *data) pointer_count = max(pointer_count, motion_pointer + 1); } - else - { - memmove(pointer + motion_pointer, pointer + motion_pointer + 1, (MAX_TOUCH - motion_pointer - 1) * sizeof(struct input_pointer)); - if (pointer_count > 0) - pointer_count--; - } } } diff --git a/android/native/jni/input_autodetect.c b/android/native/jni/input_autodetect.c index f26728ae36..8af5c568d5 100644 --- a/android/native/jni/input_autodetect.c +++ b/android/native/jni/input_autodetect.c @@ -178,6 +178,34 @@ void input_autodetect_setup (void *data, char *msg, size_t sizeof_msg, unsigned keycode_lut[AKEYCODE_BUTTON_START] |= ((RETRO_DEVICE_ID_JOYPAD_START+1) << shift); } } + else if (strstr(name_buf, "TTT THT Arcade console 2P USB Play")) + { + /* same as Rumblepad 2 - merge? */ + keycode_lut[AKEYCODE_BUTTON_1] |= ((RETRO_DEVICE_ID_JOYPAD_Y+1) << shift); + keycode_lut[AKEYCODE_BUTTON_2] |= ((RETRO_DEVICE_ID_JOYPAD_B+1) << shift); + keycode_lut[AKEYCODE_BUTTON_3] |= ((RETRO_DEVICE_ID_JOYPAD_A+1) << shift); + keycode_lut[AKEYCODE_BUTTON_4] |= ((RETRO_DEVICE_ID_JOYPAD_X+1) << shift); + keycode_lut[AKEYCODE_BUTTON_5] |= ((RETRO_DEVICE_ID_JOYPAD_L+1) << shift); + keycode_lut[AKEYCODE_BUTTON_6] |= ((RETRO_DEVICE_ID_JOYPAD_R+1) << shift); + keycode_lut[AKEYCODE_BUTTON_7] |= ((RETRO_DEVICE_ID_JOYPAD_L2+1) << shift); + keycode_lut[AKEYCODE_BUTTON_8] |= ((RETRO_DEVICE_ID_JOYPAD_R2+1) << shift); + keycode_lut[AKEYCODE_BUTTON_9] |= ((RETRO_DEVICE_ID_JOYPAD_SELECT+1) << shift); + keycode_lut[AKEYCODE_BUTTON_10] |= ((RETRO_DEVICE_ID_JOYPAD_START+1) << shift); + + /* unsure about pad 2 still */ + shift = 8 + ((port + 1) * 8); + + keycode_lut[AKEYCODE_BUTTON_11] |= ((RETRO_DEVICE_ID_JOYPAD_Y+1) << shift); + keycode_lut[AKEYCODE_BUTTON_12] |= ((RETRO_DEVICE_ID_JOYPAD_B+1) << shift); + keycode_lut[AKEYCODE_BUTTON_13] |= ((RETRO_DEVICE_ID_JOYPAD_A+1) << shift); + keycode_lut[AKEYCODE_BUTTON_14] |= ((RETRO_DEVICE_ID_JOYPAD_X+1) << shift); + keycode_lut[AKEYCODE_BUTTON_15] |= ((RETRO_DEVICE_ID_JOYPAD_L+1) << shift); + keycode_lut[AKEYCODE_BUTTON_16] |= ((RETRO_DEVICE_ID_JOYPAD_R+1) << shift); + keycode_lut[AKEYCODE_BUTTON_A] |= ((RETRO_DEVICE_ID_JOYPAD_L2+1) << shift); + keycode_lut[AKEYCODE_BUTTON_B] |= ((RETRO_DEVICE_ID_JOYPAD_R2+1) << shift); + keycode_lut[AKEYCODE_BUTTON_C] |= ((RETRO_DEVICE_ID_JOYPAD_SELECT+1) << shift); + keycode_lut[AKEYCODE_BUTTON_X] |= ((RETRO_DEVICE_ID_JOYPAD_START+1) << shift); + } else if (strstr(name_buf, "Madcatz")) { if (strstr(name_buf, "PC USB Wired Stick")) @@ -218,17 +246,60 @@ void input_autodetect_setup (void *data, char *msg, size_t sizeof_msg, unsigned keycode_lut[AKEYCODE_BUTTON_R1] |= ((RETRO_DEVICE_ID_JOYPAD_R2+1) << shift); } } - else if (strstr(name_buf, "HuiJia USB GamePad")) + else if (strstr(name_buf, "Zeemote")) + { + if (strstr(name_buf, "Steelseries free")) + { + keycode_lut[AKEYCODE_BUTTON_A] |= ((RETRO_DEVICE_ID_JOYPAD_B+1) << shift); + keycode_lut[AKEYCODE_BUTTON_B] |= ((RETRO_DEVICE_ID_JOYPAD_A+1) << shift); + + keycode_lut[AKEYCODE_BUTTON_Y] |= ((RETRO_DEVICE_ID_JOYPAD_X+1) << shift); + keycode_lut[AKEYCODE_BUTTON_X] |= ((RETRO_DEVICE_ID_JOYPAD_Y+1) << shift); + + keycode_lut[AKEYCODE_BUTTON_MODE] |= ((RETRO_DEVICE_ID_JOYPAD_SELECT+1) << shift); + keycode_lut[AKEYCODE_BUTTON_START] |= ((RETRO_DEVICE_ID_JOYPAD_START+1) << shift); + + keycode_lut[AKEYCODE_BUTTON_L1] |= ((RETRO_DEVICE_ID_JOYPAD_L+1) << shift); + keycode_lut[AKEYCODE_BUTTON_R1] |= ((RETRO_DEVICE_ID_JOYPAD_R+1) << shift); + } + } + else if (strstr(name_buf, "HuiJia USB GamePad") || + strstr(name_buf, "Smartjoy Family Super Smartjoy 2")) { keycode_lut[AKEYCODE_BUTTON_3] |= ((RETRO_DEVICE_ID_JOYPAD_B+1) << shift); keycode_lut[AKEYCODE_BUTTON_4] |= ((RETRO_DEVICE_ID_JOYPAD_Y+1) << shift); - keycode_lut[AKEYCODE_BUTTON_9] |= ((RETRO_DEVICE_ID_JOYPAD_SELECT+1) << shift); - keycode_lut[AKEYCODE_BUTTON_10] |= ((RETRO_DEVICE_ID_JOYPAD_START+1) << shift); + + if (strstr(name_buf, "Smartjoy Family Super Smartjoy 2")) + { + keycode_lut[AKEYCODE_BUTTON_5] |= ((RETRO_DEVICE_ID_JOYPAD_SELECT+1) << shift); + keycode_lut[AKEYCODE_BUTTON_6] |= ((RETRO_DEVICE_ID_JOYPAD_START+1) << shift); + } + else if (strstr(name_buf, "HuiJia USB GamePad")) + { + keycode_lut[AKEYCODE_BUTTON_9] |= ((RETRO_DEVICE_ID_JOYPAD_SELECT+1) << shift); + keycode_lut[AKEYCODE_BUTTON_10] |= ((RETRO_DEVICE_ID_JOYPAD_START+1) << shift); + } keycode_lut[AKEYCODE_BUTTON_2] |= ((RETRO_DEVICE_ID_JOYPAD_A+1) << shift); keycode_lut[AKEYCODE_BUTTON_1] |= ((RETRO_DEVICE_ID_JOYPAD_X+1) << shift); keycode_lut[AKEYCODE_BUTTON_7] |= ((RETRO_DEVICE_ID_JOYPAD_L+1) << shift); keycode_lut[AKEYCODE_BUTTON_8] |= ((RETRO_DEVICE_ID_JOYPAD_R+1) << shift); } + else if (strstr(name_buf, "Jess Tech Dual Analog Rumble Pad")) + { + /* Saitek Rumble P480 */ + keycode_lut[AKEYCODE_BUTTON_3] |= ((RETRO_DEVICE_ID_JOYPAD_B+1) << shift); + keycode_lut[AKEYCODE_BUTTON_1] |= ((RETRO_DEVICE_ID_JOYPAD_Y+1) << shift); + keycode_lut[AKEYCODE_BUTTON_9] |= ((RETRO_DEVICE_ID_JOYPAD_SELECT+1) << shift); + keycode_lut[AKEYCODE_BUTTON_10] |= ((RETRO_DEVICE_ID_JOYPAD_START+1) << shift); + keycode_lut[AKEYCODE_BUTTON_4] |= ((RETRO_DEVICE_ID_JOYPAD_A+1) << shift); + keycode_lut[AKEYCODE_BUTTON_2] |= ((RETRO_DEVICE_ID_JOYPAD_X+1) << shift); + keycode_lut[AKEYCODE_BUTTON_5] |= ((RETRO_DEVICE_ID_JOYPAD_L+1) << shift); + keycode_lut[AKEYCODE_BUTTON_7] |= ((RETRO_DEVICE_ID_JOYPAD_R+1) << shift); + keycode_lut[AKEYCODE_BUTTON_6] |= ((RETRO_DEVICE_ID_JOYPAD_L2+1) << shift); + keycode_lut[AKEYCODE_BUTTON_8] |= ((RETRO_DEVICE_ID_JOYPAD_R2+1) << shift); + keycode_lut[AKEYCODE_BUTTON_11] |= ((RETRO_DEVICE_ID_JOYPAD_L3+1) << shift); + keycode_lut[AKEYCODE_BUTTON_12] |= ((RETRO_DEVICE_ID_JOYPAD_R3+1) << shift); + } else if (strstr(name_buf, "Microsoft")) { if (strstr(name_buf, "Dual Strike")) @@ -243,7 +314,8 @@ void input_autodetect_setup (void *data, char *msg, size_t sizeof_msg, unsigned keycode_lut[AKEYCODE_BUTTON_8] |= ((RETRO_DEVICE_ID_JOYPAD_R) << shift); keycode_lut[AKEYCODE_BUTTON_9] |= ((RETRO_DEVICE_ID_JOYPAD_L2) << shift); } - else if (strstr(name_buf, "SideWinder") || strstr(name_buf, "X-Box")) + else if (strstr(name_buf, "SideWinder") || strstr(name_buf, "X-Box") || + strstr(name_buf, "Xbox 360 Wireless Receiver")) { if (strstr(name_buf, "SideWinder")) { @@ -254,7 +326,8 @@ void input_autodetect_setup (void *data, char *msg, size_t sizeof_msg, unsigned keycode_lut[AKEYCODE_BUTTON_Z] |= ((RETRO_DEVICE_ID_JOYPAD_L2+1) << shift); keycode_lut[AKEYCODE_BUTTON_C] |= ((RETRO_DEVICE_ID_JOYPAD_R2+1) << shift); } - else if (strstr(name_buf, "X-Box 360") || strstr(name_buf, "X-Box")) + else if (strstr(name_buf, "X-Box 360") || strstr(name_buf, "X-Box") + || strstr(name_buf, "Xbox 360 Wireless Receiver")) { /* TODO: left and right triggers for Xbox 1*/ keycode_lut[AKEYCODE_BUTTON_SELECT] |= ((RETRO_DEVICE_ID_JOYPAD_SELECT+1) << shift); @@ -406,6 +479,18 @@ void input_autodetect_setup (void *data, char *msg, size_t sizeof_msg, unsigned keycode_lut[AKEYCODE_BUTTON_THUMBL] |= ((RETRO_DEVICE_ID_JOYPAD_L3+1) << shift); keycode_lut[AKEYCODE_BUTTON_THUMBR] |= ((RETRO_DEVICE_ID_JOYPAD_R3+1) << shift); } + else if (strstr(name_buf, "2-Axis , 8 -Button")) + { + /* Genius MaxFire G-08XU */ + keycode_lut[AKEYCODE_BUTTON_B] |= ((RETRO_DEVICE_ID_JOYPAD_A+1) << shift); + keycode_lut[AKEYCODE_BUTTON_A] |= ((RETRO_DEVICE_ID_JOYPAD_B+1) << shift); + keycode_lut[AKEYCODE_BUTTON_X] |= ((RETRO_DEVICE_ID_JOYPAD_X+1) << shift); + keycode_lut[AKEYCODE_BUTTON_C] |= ((RETRO_DEVICE_ID_JOYPAD_Y+1) << shift); + keycode_lut[AKEYCODE_BUTTON_Y] |= ((RETRO_DEVICE_ID_JOYPAD_L+1) << shift); + keycode_lut[AKEYCODE_BUTTON_Z] |= ((RETRO_DEVICE_ID_JOYPAD_R+1) << shift); + keycode_lut[AKEYCODE_BUTTON_L1] |= ((RETRO_DEVICE_ID_JOYPAD_SELECT+1) << shift); + keycode_lut[AKEYCODE_BUTTON_R1] |= ((RETRO_DEVICE_ID_JOYPAD_START+1) << shift); + } else if (strstr(name_buf, "USB,2-axis 8-button gamepad") || strstr(name_buf, "BUFFALO BGC-FC801")) { @@ -556,36 +641,57 @@ void input_autodetect_setup (void *data, char *msg, size_t sizeof_msg, unsigned } else if (strstr(name_buf, "Broadcom Bluetooth HID")) { - /* TODO: unsure about Select button here */ - /* TODO: hookup right stick - * RStick Up: 37 - * RStick Down: 39 - * RStick Left:38 - * RStick Right: 40 */ + if ((g_settings.input.icade_count +1) < 4) + { + g_settings.input.icade_count++; - /* Red Samurai */ - keycode_lut[AKEYCODE_W] |= ((RETRO_DEVICE_ID_JOYPAD_UP+1) << shift); - keycode_lut[AKEYCODE_S] |= ((RETRO_DEVICE_ID_JOYPAD_DOWN+1) << shift); - keycode_lut[AKEYCODE_A] |= ((RETRO_DEVICE_ID_JOYPAD_LEFT+1) << shift); - keycode_lut[AKEYCODE_D]|= ((RETRO_DEVICE_ID_JOYPAD_RIGHT+1) << shift); - keycode_lut[AKEYCODE_DPAD_UP] |= ((RETRO_DEVICE_ID_JOYPAD_UP+1) << shift); - keycode_lut[AKEYCODE_DPAD_DOWN] |= ((RETRO_DEVICE_ID_JOYPAD_DOWN+1) << shift); - keycode_lut[AKEYCODE_DPAD_LEFT] |= ((RETRO_DEVICE_ID_JOYPAD_LEFT+1) << shift); - keycode_lut[AKEYCODE_DPAD_RIGHT]|= ((RETRO_DEVICE_ID_JOYPAD_RIGHT+1) << shift); - keycode_lut[AKEYCODE_BACK] |= ((RETRO_DEVICE_ID_JOYPAD_SELECT+1) << shift); - keycode_lut[AKEYCODE_ENTER] |= ((RETRO_DEVICE_ID_JOYPAD_START+1) << shift); - keycode_lut[AKEYCODE_9] |= ((RETRO_DEVICE_ID_JOYPAD_L3+1) << shift); - keycode_lut[AKEYCODE_0] |= ((RETRO_DEVICE_ID_JOYPAD_R3+1) << shift); - keycode_lut[AKEYCODE_5] |= ((RETRO_DEVICE_ID_JOYPAD_L+1) << shift); - keycode_lut[AKEYCODE_6] |= ((RETRO_DEVICE_ID_JOYPAD_L2+1) << shift); - keycode_lut[AKEYCODE_7] |= ((RETRO_DEVICE_ID_JOYPAD_R+1) << shift); - keycode_lut[AKEYCODE_8] |= ((RETRO_DEVICE_ID_JOYPAD_R2+1) << shift); + switch(g_settings.input.icade_profile[g_settings.input.icade_count]) + { + case ICADE_PROFILE_RED_SAMURAI: + /* TODO: unsure about Select button here */ + /* TODO: hookup right stick + * RStick Up: 37 + * RStick Down: 39 + * RStick Left:38 + * RStick Right: 40 */ - /* unsure if the person meant the SNES-mapping here or whether it's the pad */ - keycode_lut[AKEYCODE_1] |= ((RETRO_DEVICE_ID_JOYPAD_B+1) << shift); - keycode_lut[AKEYCODE_2] |= ((RETRO_DEVICE_ID_JOYPAD_A+1) << shift); - keycode_lut[AKEYCODE_3] |= ((RETRO_DEVICE_ID_JOYPAD_Y+1) << shift); - keycode_lut[AKEYCODE_4] |= ((RETRO_DEVICE_ID_JOYPAD_X+1) << shift); + /* Red Samurai */ + keycode_lut[AKEYCODE_W] |= ((RETRO_DEVICE_ID_JOYPAD_UP+1) << shift); + keycode_lut[AKEYCODE_S] |= ((RETRO_DEVICE_ID_JOYPAD_DOWN+1) << shift); + keycode_lut[AKEYCODE_A] |= ((RETRO_DEVICE_ID_JOYPAD_LEFT+1) << shift); + keycode_lut[AKEYCODE_D]|= ((RETRO_DEVICE_ID_JOYPAD_RIGHT+1) << shift); + keycode_lut[AKEYCODE_DPAD_UP] |= ((RETRO_DEVICE_ID_JOYPAD_UP+1) << shift); + keycode_lut[AKEYCODE_DPAD_DOWN] |= ((RETRO_DEVICE_ID_JOYPAD_DOWN+1) << shift); + keycode_lut[AKEYCODE_DPAD_LEFT] |= ((RETRO_DEVICE_ID_JOYPAD_LEFT+1) << shift); + keycode_lut[AKEYCODE_DPAD_RIGHT]|= ((RETRO_DEVICE_ID_JOYPAD_RIGHT+1) << shift); + keycode_lut[AKEYCODE_BACK] |= ((RETRO_DEVICE_ID_JOYPAD_SELECT+1) << shift); + keycode_lut[AKEYCODE_ENTER] |= ((RETRO_DEVICE_ID_JOYPAD_START+1) << shift); + keycode_lut[AKEYCODE_9] |= ((RETRO_DEVICE_ID_JOYPAD_L3+1) << shift); + keycode_lut[AKEYCODE_0] |= ((RETRO_DEVICE_ID_JOYPAD_R3+1) << shift); + keycode_lut[AKEYCODE_5] |= ((RETRO_DEVICE_ID_JOYPAD_L+1) << shift); + keycode_lut[AKEYCODE_6] |= ((RETRO_DEVICE_ID_JOYPAD_L2+1) << shift); + keycode_lut[AKEYCODE_7] |= ((RETRO_DEVICE_ID_JOYPAD_R+1) << shift); + keycode_lut[AKEYCODE_8] |= ((RETRO_DEVICE_ID_JOYPAD_R2+1) << shift); + + /* unsure if the person meant the SNES-mapping here or whether it's the pad */ + keycode_lut[AKEYCODE_1] |= ((RETRO_DEVICE_ID_JOYPAD_B+1) << shift); + keycode_lut[AKEYCODE_2] |= ((RETRO_DEVICE_ID_JOYPAD_A+1) << shift); + keycode_lut[AKEYCODE_3] |= ((RETRO_DEVICE_ID_JOYPAD_Y+1) << shift); + keycode_lut[AKEYCODE_4] |= ((RETRO_DEVICE_ID_JOYPAD_X+1) << shift); + break; + case ICADE_PROFILE_IPEGA_PG9017: + /* Todo: diagonals - patchy? */ + keycode_lut[AKEYCODE_BUTTON_1] |= ((RETRO_DEVICE_ID_JOYPAD_Y+1) << shift); + keycode_lut[AKEYCODE_BUTTON_2] |= ((RETRO_DEVICE_ID_JOYPAD_X+1) << shift); + keycode_lut[AKEYCODE_BUTTON_3] |= ((RETRO_DEVICE_ID_JOYPAD_B+1) << shift); + keycode_lut[AKEYCODE_BUTTON_4] |= ((RETRO_DEVICE_ID_JOYPAD_A+1) << shift); + keycode_lut[AKEYCODE_BUTTON_5] |= ((RETRO_DEVICE_ID_JOYPAD_L+1) << shift); + keycode_lut[AKEYCODE_BUTTON_6] |= ((RETRO_DEVICE_ID_JOYPAD_R+1) << shift); + keycode_lut[AKEYCODE_BUTTON_9] |= ((RETRO_DEVICE_ID_JOYPAD_SELECT+1) << shift); + keycode_lut[AKEYCODE_BUTTON_10] |= ((RETRO_DEVICE_ID_JOYPAD_START+1) << shift); + break; + } + } } else if (strstr(name_buf, "USB Gamepad") || strstr(name_buf, "DragonRise")) { diff --git a/android/native/jni/input_autodetect.h b/android/native/jni/input_autodetect.h index 5c76415251..ce96d6393d 100644 --- a/android/native/jni/input_autodetect.h +++ b/android/native/jni/input_autodetect.h @@ -21,6 +21,11 @@ #define AKEY_EVENT_NO_ACTION 255 +enum { + ICADE_PROFILE_RED_SAMURAI = 0, + ICADE_PROFILE_IPEGA_PG9017, +} icade_profile_enums; + enum { AKEYCODE_META_FUNCTION_ON = 8, AKEYCODE_ESCAPE = 111, diff --git a/android/phoenix/AndroidManifest.xml b/android/phoenix/AndroidManifest.xml index e37366c38a..3344cfb734 100644 --- a/android/phoenix/AndroidManifest.xml +++ b/android/phoenix/AndroidManifest.xml @@ -1,7 +1,7 @@ + android:versionCode="11" + android:versionName="0.9.8.3" > + + + diff --git a/android/phoenix/res/layout/faq_games_are_slow_with_rewind_why.xml b/android/phoenix/res/layout/faq_games_are_slow_with_rewind_why.xml new file mode 100644 index 0000000000..74ed7b330c --- /dev/null +++ b/android/phoenix/res/layout/faq_games_are_slow_with_rewind_why.xml @@ -0,0 +1,13 @@ + + + + + diff --git a/android/phoenix/res/layout/faq_how_do_i_run_cave_story.xml b/android/phoenix/res/layout/faq_how_do_i_run_cave_story.xml new file mode 100644 index 0000000000..ac0dd06c63 --- /dev/null +++ b/android/phoenix/res/layout/faq_how_do_i_run_cave_story.xml @@ -0,0 +1,13 @@ + + + + + diff --git a/android/phoenix/res/layout/faq_how_do_i_run_prboom.xml b/android/phoenix/res/layout/faq_how_do_i_run_prboom.xml new file mode 100644 index 0000000000..a6d08b9efa --- /dev/null +++ b/android/phoenix/res/layout/faq_how_do_i_run_prboom.xml @@ -0,0 +1,13 @@ + + + + + diff --git a/android/phoenix/res/layout/faq_neo_geo_game_doesnt_work.xml b/android/phoenix/res/layout/faq_neo_geo_game_doesnt_work.xml new file mode 100644 index 0000000000..b94cc64df1 --- /dev/null +++ b/android/phoenix/res/layout/faq_neo_geo_game_doesnt_work.xml @@ -0,0 +1,13 @@ + + + + + diff --git a/android/phoenix/res/layout/faq_neo_geo_game_in_fba_shows_video_ram_err_why.xml b/android/phoenix/res/layout/faq_neo_geo_game_in_fba_shows_video_ram_err_why.xml new file mode 100644 index 0000000000..0bafbd49e8 --- /dev/null +++ b/android/phoenix/res/layout/faq_neo_geo_game_in_fba_shows_video_ram_err_why.xml @@ -0,0 +1,13 @@ + + + + + diff --git a/android/phoenix/res/layout/faq_pce_cd_game_doesnt_work.xml b/android/phoenix/res/layout/faq_pce_cd_game_doesnt_work.xml new file mode 100644 index 0000000000..2e8a11ae93 --- /dev/null +++ b/android/phoenix/res/layout/faq_pce_cd_game_doesnt_work.xml @@ -0,0 +1,13 @@ + + + + + diff --git a/android/phoenix/res/layout/faq_ps1_core_looks_bad_on_my_tegra_2_why.xml b/android/phoenix/res/layout/faq_ps1_core_looks_bad_on_my_tegra_2_why.xml new file mode 100644 index 0000000000..1286c4f0eb --- /dev/null +++ b/android/phoenix/res/layout/faq_ps1_core_looks_bad_on_my_tegra_2_why.xml @@ -0,0 +1,14 @@ + + + + + diff --git a/android/phoenix/res/layout/faq_ps1_game_doesnt_work.xml b/android/phoenix/res/layout/faq_ps1_game_doesnt_work.xml new file mode 100644 index 0000000000..510dfcc0bf --- /dev/null +++ b/android/phoenix/res/layout/faq_ps1_game_doesnt_work.xml @@ -0,0 +1,13 @@ + + + + + diff --git a/android/phoenix/res/layout/faq_sega_cd_game_doesnt_work.xml b/android/phoenix/res/layout/faq_sega_cd_game_doesnt_work.xml new file mode 100644 index 0000000000..2eea4ee4a6 --- /dev/null +++ b/android/phoenix/res/layout/faq_sega_cd_game_doesnt_work.xml @@ -0,0 +1,13 @@ + + + + + diff --git a/android/phoenix/res/layout/faq_sound_choppy.xml b/android/phoenix/res/layout/faq_sound_choppy.xml new file mode 100644 index 0000000000..37d26e9b4c --- /dev/null +++ b/android/phoenix/res/layout/faq_sound_choppy.xml @@ -0,0 +1,13 @@ + + + + + diff --git a/android/phoenix/res/layout/faq_supported_pads.xml b/android/phoenix/res/layout/faq_supported_pads.xml new file mode 100644 index 0000000000..1bd9fe4461 --- /dev/null +++ b/android/phoenix/res/layout/faq_supported_pads.xml @@ -0,0 +1,13 @@ + + + + + diff --git a/android/phoenix/res/layout/faq_system_requirements.xml b/android/phoenix/res/layout/faq_system_requirements.xml new file mode 100644 index 0000000000..f393bc6d84 --- /dev/null +++ b/android/phoenix/res/layout/faq_system_requirements.xml @@ -0,0 +1,28 @@ + + + + + diff --git a/android/phoenix/res/layout/faq_what_is_a_libretro_core.xml b/android/phoenix/res/layout/faq_what_is_a_libretro_core.xml new file mode 100644 index 0000000000..07a218e6b7 --- /dev/null +++ b/android/phoenix/res/layout/faq_what_is_a_libretro_core.xml @@ -0,0 +1,13 @@ + + + + + diff --git a/android/phoenix/res/layout/faq_whats_new.xml b/android/phoenix/res/layout/faq_whats_new.xml new file mode 100644 index 0000000000..dc787c4feb --- /dev/null +++ b/android/phoenix/res/layout/faq_whats_new.xml @@ -0,0 +1,104 @@ + + + + + diff --git a/android/phoenix/res/layout/faq_where_are_the_games.xml b/android/phoenix/res/layout/faq_where_are_the_games.xml new file mode 100644 index 0000000000..f888e8146d --- /dev/null +++ b/android/phoenix/res/layout/faq_where_are_the_games.xml @@ -0,0 +1,13 @@ + + + + + diff --git a/android/phoenix/res/layout/faq_why_are_the_shaders_so_slow.xml b/android/phoenix/res/layout/faq_why_are_the_shaders_so_slow.xml new file mode 100644 index 0000000000..5107968b8a --- /dev/null +++ b/android/phoenix/res/layout/faq_why_are_the_shaders_so_slow.xml @@ -0,0 +1,13 @@ + + + + + diff --git a/android/phoenix/res/layout/faq_why_does_prboom_have_no_music.xml b/android/phoenix/res/layout/faq_why_does_prboom_have_no_music.xml new file mode 100644 index 0000000000..54331db3a8 --- /dev/null +++ b/android/phoenix/res/layout/faq_why_does_prboom_have_no_music.xml @@ -0,0 +1,57 @@ + + + + + diff --git a/android/phoenix/res/layout/faq_why_doesnt_it_autodetect_my_gamepad.xml b/android/phoenix/res/layout/faq_why_doesnt_it_autodetect_my_gamepad.xml new file mode 100644 index 0000000000..e107766193 --- /dev/null +++ b/android/phoenix/res/layout/faq_why_doesnt_it_autodetect_my_gamepad.xml @@ -0,0 +1,21 @@ + + + + + diff --git a/android/phoenix/res/layout/faq_why_doesnt_the_ps1_core_show_up_in_the_list.xml b/android/phoenix/res/layout/faq_why_doesnt_the_ps1_core_show_up_in_the_list.xml new file mode 100644 index 0000000000..e24ef2f961 --- /dev/null +++ b/android/phoenix/res/layout/faq_why_doesnt_the_ps1_core_show_up_in_the_list.xml @@ -0,0 +1,14 @@ + + + + + diff --git a/android/phoenix/res/layout/faq_why_is_gba_so_slow.xml b/android/phoenix/res/layout/faq_why_is_gba_so_slow.xml new file mode 100644 index 0000000000..c391668690 --- /dev/null +++ b/android/phoenix/res/layout/faq_why_is_gba_so_slow.xml @@ -0,0 +1,13 @@ + + + + + diff --git a/android/phoenix/res/menu/context_menu.xml b/android/phoenix/res/menu/context_menu.xml index f4add82b67..8a0a6a6176 100644 --- a/android/phoenix/res/menu/context_menu.xml +++ b/android/phoenix/res/menu/context_menu.xml @@ -1,6 +1,7 @@ + diff --git a/android/phoenix/res/values/array.xml b/android/phoenix/res/values/array.xml index 2a62fa352c..fa494636ba 100644 --- a/android/phoenix/res/values/array.xml +++ b/android/phoenix/res/values/array.xml @@ -19,6 +19,16 @@ 1.60000 1.14286 + + + Red Samurai + iPega PG-9017 + + + + 0 + 1 + 1.0x @@ -249,4 +259,4 @@ MUSIC CALCULATOR - \ No newline at end of file + diff --git a/android/phoenix/res/values/strings.xml b/android/phoenix/res/values/strings.xml index 7e2dbf1846..bb44ca812e 100644 --- a/android/phoenix/res/values/strings.xml +++ b/android/phoenix/res/values/strings.xml @@ -4,7 +4,7 @@ Input Method File type icon Video Settings - RetroArch Settings + Settings Audio Settings Input Settings General Settings @@ -14,6 +14,7 @@ Overlay How-to Guide Select the button to use Unbind + Help Report IME Report Refresh Rate Detect diff --git a/android/phoenix/res/xml/help.xml b/android/phoenix/res/xml/help.xml new file mode 100644 index 0000000000..6f790e6850 --- /dev/null +++ b/android/phoenix/res/xml/help.xml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/android/phoenix/res/xml/prefs.xml b/android/phoenix/res/xml/prefs.xml index d2daac6eba..8908a94155 100644 --- a/android/phoenix/res/xml/prefs.xml +++ b/android/phoenix/res/xml/prefs.xml @@ -18,7 +18,8 @@ android:key="savefile_directory_enable" android:defaultValue="false"/> + android:summary="Sets directory where to save and load game save files." + android:dependency="savefile_directory_enable"> @@ -30,7 +31,8 @@ android:key="savestate_directory_enable" android:defaultValue="false"/> + android:summary="Sets directory where to save and load game save states." + android:dependency="savestate_directory_enable"> @@ -65,16 +67,6 @@ android:key="video_vsync" android:summary="When set to enabled, prevents screen tearing." android:title="VSync" /> - - + + + + + + + + + + + android:summary="Sets GLES2 style XML shader." + android:title="XML shader" + android:dependency="video_shader_enable" > @@ -117,12 +132,13 @@ + android:title="XML shader (2nd pass)" + android:dependency="video_second_pass_shader_enable" > @@ -157,7 +173,8 @@ android:defaultValue="true" android:key="audio_rate_control" android:summary="Enable dynamic rate control (recommended)." - android:title="Dynamic Rate Control" /> + android:title="Dynamic Rate Control" + android:dependency="audio_enable" /> @@ -168,6 +185,34 @@ android:summary="This will attempt to preconfigure various gamepads and/or IME apps that you connect." android:title="Enable" android:disableDependentsState="true" /> + + + + + + + + + android:title="Input overlay" + android:dependency="input_overlay_enable" > @@ -193,7 +239,8 @@ + android:key="input_overlay_opacity" + android:dependency="input_overlay_enable" /> = WARMUP_SECONDS) { + mStartTime = t; + mNumFrames = 0; + mState = STATE_TEST; + } + break; + + case STATE_TEST: + mNumFrames++; + double elapsed = t - mStartTime; + if (elapsed >= TEST_SECONDS) { + double fps = (double)mNumFrames / elapsed; + Log.i(TAG, "Measured FPS to: " + fps); + setFPSSetting(fps); + mState = STATE_DONE; + } + break; + + case STATE_DONE: + activity.runOnUiThread(new Runnable() { + public void run() { + finish(); + } + }); + mState = STATE_DEAD; + break; + + case STATE_DEAD: + break; + } + + float luma = (float)Math.sin((double)mNumFrames * 0.10); + luma *= 0.2f; + luma += 0.5f; + GLES20.glClearColor(luma, luma, luma, 1.0f); + GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT); + } + + @Override + public void onSurfaceChanged(GL10 gl, int width, int height) { + // TODO Auto-generated method stub + } + + @Override + public void onSurfaceCreated(GL10 gl, EGLConfig config) { + // TODO Auto-generated method stub + } + } + + private GLSurfaceView surfaceView; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + Toast.makeText(this, "Touch the screen with your fingers for more accurate measurements.", Toast.LENGTH_LONG).show(); + surfaceView = new GLSurfaceView(this); + surfaceView.setEGLConfigChooser(false); + surfaceView.setEGLContextClientVersion(2); + surfaceView.setRenderer(new Renderer(this)); + getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); + setTitle("Refresh rate calibration"); + setContentView(surfaceView); + } + + @Override + protected void onDestroy() { + SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getBaseContext()); + String fps = prefs.getString("video_refresh_rate", "ERROR"); + Toast.makeText(this, "Refresh rate measured to: " + fps + " Hz.", Toast.LENGTH_LONG).show(); + super.onDestroy(); + } +} diff --git a/android/phoenix/src/org/retroarch/browser/HelpActivity.java b/android/phoenix/src/org/retroarch/browser/HelpActivity.java new file mode 100644 index 0000000000..ea1e113b79 --- /dev/null +++ b/android/phoenix/src/org/retroarch/browser/HelpActivity.java @@ -0,0 +1,17 @@ +package org.retroarch.browser; + +import org.retroarch.R; + +import android.os.Bundle; +import android.preference.PreferenceActivity; +import android.preference.PreferenceManager; + +public class HelpActivity extends PreferenceActivity { + @SuppressWarnings("deprecation") + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + addPreferencesFromResource(R.xml.help); + PreferenceManager.setDefaultValues(this, R.xml.help, false); + } +} \ No newline at end of file diff --git a/android/phoenix/src/org/retroarch/browser/RefreshRateSetOS.java b/android/phoenix/src/org/retroarch/browser/RefreshRateSetOS.java new file mode 100644 index 0000000000..b9479c80eb --- /dev/null +++ b/android/phoenix/src/org/retroarch/browser/RefreshRateSetOS.java @@ -0,0 +1,29 @@ +package org.retroarch.browser; + +import android.app.Activity; +import android.content.Context; +import android.content.SharedPreferences; +import android.os.Bundle; +import android.preference.PreferenceManager; +import android.view.Display; +import android.view.WindowManager; +import android.widget.Toast; + +public class RefreshRateSetOS extends Activity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + final WindowManager wm = (WindowManager) getSystemService(Context.WINDOW_SERVICE); + final Display display = wm.getDefaultDisplay(); + double rate = display.getRefreshRate(); + SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getBaseContext()); + SharedPreferences.Editor edit = prefs.edit(); + edit.putString("video_refresh_rate", Double.valueOf(rate).toString()); + edit.commit(); + + Toast.makeText(this, "Using OS-reported refresh rate of: " + rate + " Hz.", Toast.LENGTH_LONG).show(); + finish(); + } +} diff --git a/android/phoenix/src/org/retroarch/browser/RetroArch.java b/android/phoenix/src/org/retroarch/browser/RetroArch.java index 5ec6e2f490..de137fba09 100644 --- a/android/phoenix/src/org/retroarch/browser/RetroArch.java +++ b/android/phoenix/src/org/retroarch/browser/RetroArch.java @@ -66,9 +66,16 @@ public class RetroArch extends Activity implements private ConfigFile core_config; private final double getDisplayRefreshRate() { + // Android is *very* likely to screw this up. + // It is rarely a good value to use, so make sure it's not + // completely wrong. Some phones return refresh rates that are completely bogus + // (like 0.3 Hz, etc), so try to be very conservative here. final WindowManager wm = (WindowManager) getSystemService(Context.WINDOW_SERVICE); final Display display = wm.getDefaultDisplay(); - return display.getRefreshRate(); + double rate = display.getRefreshRate(); + if (rate > 61.0 || rate < 58.0) + rate = 59.95; + return rate; } private final double getRefreshRate() { @@ -176,10 +183,19 @@ public class RetroArch extends Activity implements } //extractAssets(assets, cacheDir, "", 0); - Log.i("ASSETS", "Extracting shader assets now..."); - extractAssets(assets, cacheDir, "Shaders", 1); - Log.i("ASSETS", "Extracting overlay assets now..."); - extractAssets(assets, cacheDir, "Overlays", 1); + Log.i("ASSETS", "Extracting shader assets now ..."); + try { + extractAssets(assets, cacheDir, "Shaders", 1); + } catch (IOException e) { + Log.i("ASSETS", "Failed to extract shaders ..."); + } + + Log.i("ASSETS", "Extracting overlay assets now ..."); + try { + extractAssets(assets, cacheDir, "Overlays", 1); + } catch (IOException e) { + Log.i("ASSETS", "Failed to extract overlays ..."); + } DataOutputStream outputCacheVersion = new DataOutputStream(new FileOutputStream(cacheVersion, false)); outputCacheVersion.writeInt(version); @@ -192,7 +208,6 @@ public class RetroArch extends Activity implements @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - try { config = new ConfigFile(new File(getDefaultConfigPath())); @@ -269,11 +284,37 @@ public class RetroArch extends Activity implements this.setVolumeControlStream(AudioManager.STREAM_MUSIC); - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) - { + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) { this.registerForContextMenu(findViewById(android.R.id.content)); } } + + @Override + protected void onStart() { + super.onStart(); + + SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getBaseContext()); + + if (!prefs.getBoolean("first_time_refreshrate_calculate", false)) { + prefs.edit().putBoolean("first_time_refreshrate_calculate", true).commit(); + AlertDialog.Builder alert = new AlertDialog.Builder(this) + .setTitle("Calculate Refresh Rate") + .setMessage("It is highly recommended you run the refresh rate calibration test before you use RetroArch. Do you want to run it now?\n\nIf you choose No, you can run it at any time in the video preferences.") + .setPositiveButton("Yes", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + Intent i = new Intent(getBaseContext(), DisplayRefreshRateTest.class); + startActivity(i); + } + }) + .setNegativeButton("No", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + } + }); + alert.show(); + } + } @Override public void onItemClick(AdapterView aListView, View aView, @@ -324,16 +365,12 @@ public class RetroArch extends Activity implements config.setBoolean("video_vsync", prefs.getBoolean("video_vsync", true)); config.setBoolean("input_autodetect_enable", prefs.getBoolean("input_autodetect_enable", true)); config.setBoolean("input_debug_enable", prefs.getBoolean("input_debug_enable", false)); + config.setInt("input_autodetect_icade_profile_pad1", prefs.getInt("input_autodetect_icade_profile_pad1", 0)); + config.setInt("input_autodetect_icade_profile_pad2", prefs.getInt("input_autodetect_icade_profile_pad2", 0)); + config.setInt("input_autodetect_icade_profile_pad3", prefs.getInt("input_autodetect_icade_profile_pad3", 0)); + config.setInt("input_autodetect_icade_profile_pad4", prefs.getInt("input_autodetect_icade_profile_pad4", 0)); - if (prefs.getBoolean("video_sync_refreshrate_to_screen", true) - && (getRefreshRate() < 59.95)) { - Log.i(TAG, - "Refresh rate of screen lower than 59.95Hz, adjusting to screen."); - config.setDouble("video_refresh_rate", getRefreshRate()); - } else { - Log.i(TAG, "Refresh rate set to 59.95Hz (default)."); - config.setDouble("video_refresh_rate", 59.95); - } + config.setDouble("video_refresh_rate", getRefreshRate()); String aspect = prefs.getString("video_aspect_ratio", "auto"); if (aspect.equals("full")) { @@ -489,13 +526,17 @@ public class RetroArch extends Activity implements Intent rset = new Intent(this, SettingsActivity.class); startActivity(rset); return true; + case R.id.help: + Intent help = new Intent(this, HelpActivity.class); + startActivity(help); + return true; case R.id.report_ime: String current_ime = Settings.Secure.getString(getContentResolver(), Settings.Secure.DEFAULT_INPUT_METHOD); new AlertDialog.Builder(this).setMessage(current_ime).setNeutralButton("Close", null).show(); return true; case R.id.report_refreshrate: - String current_rate = "Screen Refresh Rate: " + new Double(report_refreshrate).toString(); + String current_rate = "Screen Refresh Rate: " + Double.valueOf(report_refreshrate).toString(); new AlertDialog.Builder(this).setMessage(current_rate).setNeutralButton("Close", null).show(); return true; diff --git a/audio/hermite.c b/audio/hermite.c index 9c1565221d..1dc80e3a6f 100644 --- a/audio/hermite.c +++ b/audio/hermite.c @@ -27,11 +27,11 @@ #define CHANNELS 2 -struct rarch_resampler +typedef struct rarch_hermite_resampler { float chan_data[CHANNELS][4]; double r_frac; -}; +} rarch_hermite_resampler_t; static inline float hermite_kernel(float mu1, float a, float b, float c, float d) { @@ -51,14 +51,17 @@ static inline float hermite_kernel(float mu1, float a, float b, float c, float d return (a0 * b) + (a1 * m0) + (a2 * m1) + (a3 * c); } -rarch_resampler_t *resampler_new(void) +void *resampler_hermite_new(void) { +#ifndef RESAMPLER_TEST RARCH_LOG("Hermite resampler [C]\n"); - return (rarch_resampler_t*)calloc(1, sizeof(rarch_resampler_t)); +#endif + return calloc(1, sizeof(rarch_hermite_resampler_t)); } -void resampler_process(rarch_resampler_t *re, struct resampler_data *data) +static void resampler_hermite_process(void *re_, struct resampler_data *data) { + rarch_hermite_resampler_t *re = (rarch_hermite_resampler_t*)re_; double r_step = 1.0 / data->ratio; size_t processed_out = 0; @@ -99,8 +102,15 @@ void resampler_process(rarch_resampler_t *re, struct resampler_data *data) data->output_frames = processed_out; } -void resampler_free(rarch_resampler_t *re) +static void resampler_hermite_free(void *re) { free(re); } +const rarch_resampler_t hermite_resampler = { + resampler_hermite_new, + resampler_hermite_process, + resampler_hermite_free, + "hermite", +}; + diff --git a/audio/openal.c b/audio/openal.c index df496222e5..0f17781f7b 100644 --- a/audio/openal.c +++ b/audio/openal.c @@ -14,6 +14,7 @@ */ #include "../driver.h" +#include "../general.h" #ifdef __APPLE__ #include @@ -30,29 +31,50 @@ #include #endif -#define BUFSIZE 128 +#define BUFSIZE 1024 typedef struct al { ALuint source; ALuint *buffers; ALuint *res_buf; - int res_ptr; + size_t res_ptr; ALenum format; - int num_buffers; + size_t num_buffers; int rate; - int queue; uint8_t tmpbuf[BUFSIZE]; - int tmpbuf_ptr; + size_t tmpbuf_ptr; ALCdevice *handle; ALCcontext *ctx; bool nonblock; - } al_t; +static void al_free(void *data) +{ + al_t *al = (al_t*)data; + if (!al) + return; + + alSourceStop(al->source); + alDeleteSources(1, &al->source); + + if (al->buffers) + alDeleteBuffers(al->num_buffers, al->buffers); + + free(al->buffers); + free(al->res_buf); + alcMakeContextCurrent(NULL); + + if (al->ctx) + alcDestroyContext(al->ctx); + if (al->handle) + alcCloseDevice(al->handle); + free(al); +} + static void *al_init(const char *device, unsigned rate, unsigned latency) { (void)device; @@ -72,7 +94,13 @@ static void *al_init(const char *device, unsigned rate, unsigned latency) al->rate = rate; - al->num_buffers = (latency * rate * 2 * 2) / (1000 * BUFSIZE); + // We already use one buffer for tmpbuf. + al->num_buffers = (latency * rate * 2 * sizeof(int16_t)) / (1000 * BUFSIZE) - 1; + if (al->num_buffers < 2) + al->num_buffers = 2; + + RARCH_LOG("[OpenAL]: Using %u buffers of %u bytes.\n", (unsigned)al->num_buffers, BUFSIZE); + al->buffers = (ALuint*)calloc(al->num_buffers, sizeof(ALuint)); al->res_buf = (ALuint*)calloc(al->num_buffers, sizeof(ALuint)); if (al->buffers == NULL || al->res_buf == NULL) @@ -87,19 +115,7 @@ static void *al_init(const char *device, unsigned rate, unsigned latency) return al; error: - if (al) - { - alcMakeContextCurrent(NULL); - if (al->ctx) - alcDestroyContext(al->ctx); - if (al->handle) - alcCloseDevice(al->handle); - if (al->buffers) - free(al->buffers); - if (al->res_buf) - free(al->res_buf); - free(al); - } + al_free(al); return NULL; } @@ -121,14 +137,8 @@ static bool al_unqueue_buffers(al_t *al) static bool al_get_buffer(al_t *al, ALuint *buffer) { - if (al->res_ptr == 0) + if (!al->res_ptr) { -#ifndef _WIN32 - struct timespec tv = {0}; - tv.tv_sec = 0; - tv.tv_nsec = 1000000; -#endif - for (;;) { if (al_unqueue_buffers(al)) @@ -137,11 +147,8 @@ static bool al_get_buffer(al_t *al, ALuint *buffer) if (al->nonblock) return false; -#ifdef _WIN32 - Sleep(1); -#else - nanosleep(&tv, NULL); -#endif + // Must sleep as there is no proper blocking method. :( + rarch_sleep(1); } } @@ -151,28 +158,31 @@ static bool al_get_buffer(al_t *al, ALuint *buffer) static size_t al_fill_internal_buf(al_t *al, const void *buf, size_t size) { - size_t read_size = (BUFSIZE - al->tmpbuf_ptr > (ssize_t)size) ? size : (BUFSIZE - al->tmpbuf_ptr); + size_t read_size = min(BUFSIZE - al->tmpbuf_ptr, size); memcpy(al->tmpbuf + al->tmpbuf_ptr, buf, read_size); al->tmpbuf_ptr += read_size; return read_size; } -static ssize_t al_write(void *data, const void *buf, size_t size) +static ssize_t al_write(void *data, const void *buf_, size_t size) { al_t *al = (al_t*)data; + const uint8_t *buf = (const uint8_t*)buf_; size_t written = 0; - while (written < size) + while (size) { - size_t rc = al_fill_internal_buf(al, (const char*)buf + written, size - written); + size_t rc = al_fill_internal_buf(al, buf, size); written += rc; + buf += rc; + size -= rc; if (al->tmpbuf_ptr != BUFSIZE) break; ALuint buffer; if (!al_get_buffer(al, &buffer)) - return 0; + break; alBufferData(buffer, AL_FORMAT_STEREO16, al->tmpbuf, BUFSIZE, al->rate); al->tmpbuf_ptr = 0; @@ -189,7 +199,7 @@ static ssize_t al_write(void *data, const void *buf, size_t size) return -1; } - return size; + return written; } static bool al_stop(void *data) @@ -210,24 +220,17 @@ static bool al_start(void *data) return true; } -static void al_free(void *data) +static size_t al_write_avail(void *data) { al_t *al = (al_t*)data; - if (al) - { - alSourceStop(al->source); - alDeleteSources(1, &al->source); - if (al->buffers) - { - alDeleteBuffers(al->num_buffers, al->buffers); - free(al->buffers); - free(al->res_buf); - } - } - alcMakeContextCurrent(NULL); - alcDestroyContext(al->ctx); - alcCloseDevice(al->handle); - free(al); + al_unqueue_buffers(al); + return al->res_ptr * BUFSIZE + (BUFSIZE - al->tmpbuf_ptr); +} + +static size_t al_buffer_size(void *data) +{ + al_t *al = (al_t*)data; + return (al->num_buffers + 1) * BUFSIZE; // Also got tmpbuf. } const audio_driver_t audio_openal = { @@ -238,6 +241,8 @@ const audio_driver_t audio_openal = { al_set_nonblock_state, al_free, NULL, - "openal" + "openal", + al_write_avail, + al_buffer_size, }; diff --git a/audio/resampler.c b/audio/resampler.c new file mode 100644 index 0000000000..8ee2f3e36a --- /dev/null +++ b/audio/resampler.c @@ -0,0 +1,66 @@ +/* RetroArch - A frontend for libretro. + * Copyright (C) 2010-2013 - Hans-Kristian Arntzen + * + * RetroArch is free software: you can redistribute it and/or modify it under the terms + * of the GNU General Public License as published by the Free Software Found- + * ation, either version 3 of the License, or (at your option) any later version. + * + * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with RetroArch. + * If not, see . + */ + +#include "resampler.h" +#include + +#ifdef HAVE_CONFIG_H +#include "../config.h" +#endif + +#include "../general.h" + +static const rarch_resampler_t *backends[] = { +#ifdef HAVE_SINC + &sinc_resampler, +#endif + &hermite_resampler, +}; + +bool rarch_resampler_realloc(void **re, const rarch_resampler_t **backend, const char *ident) +{ + if (*re && *backend) + (*backend)->free(*re); + + *re = NULL; + *backend = NULL; + + if (ident) + { + for (unsigned i = 0; i < ARRAY_SIZE(backends); i++) + { + if (strcmp(backends[i]->ident, ident) == 0) + { + *backend = backends[i]; + break; + } + } + } + else + *backend = backends[0]; + + if (!*backend) + return false; + + *re = (*backend)->init(); + if (!*re) + { + *backend = NULL; + return false; + } + + return true; +} + diff --git a/audio/resampler.h b/audio/resampler.h index 498e66a245..a865f2ab5a 100644 --- a/audio/resampler.h +++ b/audio/resampler.h @@ -24,13 +24,13 @@ #include #include #include +#include "../boolean.h" // M_PI is left out of ISO C99 :( #ifndef M_PI #define M_PI 3.14159265358979323846264338327 #endif -typedef struct rarch_resampler rarch_resampler_t; typedef float sample_t; struct resampler_data @@ -44,9 +44,33 @@ struct resampler_data double ratio; }; -rarch_resampler_t *resampler_new(void); -void resampler_process(rarch_resampler_t *re, struct resampler_data *data); -void resampler_free(rarch_resampler_t *re); +typedef struct rarch_resampler +{ + void *(*init)(void); + void (*process)(void *re, struct resampler_data *data); + void (*free)(void *re); + const char *ident; +} rarch_resampler_t; + +extern const rarch_resampler_t hermite_resampler; +extern const rarch_resampler_t sinc_resampler; + +// Reallocs resampler. Will free previous handle before allocating a new one. +// If ident is NULL, first resampler will be used. +bool rarch_resampler_realloc(void **re, const rarch_resampler_t **backend, const char *ident); + +// Convenience macros. +// freep makes sure to set handles to NULL to avoid double-free in rarch_resampler_realloc. +#define rarch_resampler_freep(backend, handle) do { \ + if (*(backend) && *(handle)) \ + (*backend)->free(*handle); \ + *backend = NULL; \ + *handle = NULL; \ +} while(0) + +#define rarch_resampler_process(backend, handle, data) do { \ + (backend)->process(handle, data); \ +} while(0) #endif diff --git a/audio/sinc.c b/audio/sinc.c index 07e78d70b9..fb912a3371 100644 --- a/audio/sinc.c +++ b/audio/sinc.c @@ -33,25 +33,36 @@ #include #endif +#ifdef SINC_LOWER_QUALITY +#define PHASE_BITS 12 +#define SIDELOBES 4 +#define ENABLE_AVX 0 +#elif defined(SINC_HIGHER_QUALITY) +#define PHASE_BITS 16 +#define SIDELOBES 32 +#define ENABLE_AVX 1 +#else +#define PHASE_BITS 16 +#define SIDELOBES 8 +#define ENABLE_AVX 0 +#endif + // For the little amount of taps we're using, // SSE1 is faster than AVX for some reason. // AVX code is kept here though as by increasing number // of sinc taps, the AVX code is clearly faster than SSE1. -#define ENABLE_AVX 0 #if defined(__AVX__) && ENABLE_AVX #include #endif -#define PHASE_BITS 16 #define SUBPHASE_BITS 10 #define PHASES (1 << (PHASE_BITS + SUBPHASE_BITS)) -#define SIDELOBES 8 #define TAPS (SIDELOBES * 2) #define CUTOFF 0.98 -struct rarch_resampler +typedef struct rarch_sinc_resampler { sample_t phase_table[1 << PHASE_BITS][TAPS]; sample_t buffer_l[2 * TAPS]; @@ -59,7 +70,7 @@ struct rarch_resampler unsigned ptr; uint32_t time; -}; +} rarch_sinc_resampler_t; static inline double sinc(double val) { @@ -74,7 +85,7 @@ static inline double lanzcos(double index) return sinc(index); } -static void init_sinc_table(rarch_resampler_t *resamp) +static void init_sinc_table(rarch_sinc_resampler_t *resamp) { // Sinc phases: [..., p + 3, p + 2, p + 1, p + 0, p - 1, p - 2, p - 3, p - 4, ...] for (int i = 0; i < (1 << PHASE_BITS); i++) @@ -110,7 +121,7 @@ static void aligned_free__(void *ptr) free(p[-1]); } -static inline void process_sinc_C(rarch_resampler_t *resamp, float *out_buffer) +static inline void process_sinc_C(rarch_sinc_resampler_t *resamp, float *out_buffer) { float sum_l = 0.0f; float sum_r = 0.0f; @@ -133,7 +144,7 @@ static inline void process_sinc_C(rarch_resampler_t *resamp, float *out_buffer) #if defined(__AVX__) && ENABLE_AVX #define process_sinc_func process_sinc -static void process_sinc(rarch_resampler_t *resamp, float *out_buffer) +static void process_sinc(rarch_sinc_resampler_t *resamp, float *out_buffer) { __m256 sum_l = _mm256_setzero_ps(); __m256 sum_r = _mm256_setzero_ps(); @@ -169,7 +180,7 @@ static void process_sinc(rarch_resampler_t *resamp, float *out_buffer) } #elif defined(__SSE__) #define process_sinc_func process_sinc -static void process_sinc(rarch_resampler_t *resamp, float *out_buffer) +static void process_sinc(rarch_sinc_resampler_t *resamp, float *out_buffer) { __m128 sum_l = _mm_setzero_ps(); __m128 sum_r = _mm_setzero_ps(); @@ -212,12 +223,15 @@ static void process_sinc(rarch_resampler_t *resamp, float *out_buffer) _mm_store_ss(out_buffer + 1, _mm_movehl_ps(sum, sum)); } #elif defined(HAVE_NEON) + // Need to make this function pointer as Android doesn't have built-in targets // for NEON and plain ARMv7a. -static void (*process_sinc_func)(rarch_resampler_t *resamp, float *out_buffer); +static void (*process_sinc_func)(rarch_sinc_resampler_t *resamp, float *out_buffer); -void process_sinc_neon_asm(float *out, const float *left, const float *right, const float *coeff); -static void process_sinc_neon(rarch_resampler_t *resamp, float *out_buffer) +// Assumes that taps >= 8, and that taps is a multiple of 8. +void process_sinc_neon_asm(float *out, const float *left, const float *right, const float *coeff, unsigned taps); + +static void process_sinc_neon(rarch_sinc_resampler_t *resamp, float *out_buffer) { const float *buffer_l = resamp->buffer_l + resamp->ptr; const float *buffer_r = resamp->buffer_r + resamp->ptr; @@ -225,14 +239,16 @@ static void process_sinc_neon(rarch_resampler_t *resamp, float *out_buffer) unsigned phase = resamp->time >> SUBPHASE_BITS; const float *phase_table = resamp->phase_table[phase]; - process_sinc_neon_asm(out_buffer, buffer_l, buffer_r, phase_table); + process_sinc_neon_asm(out_buffer, buffer_l, buffer_r, phase_table, TAPS); } #else // Plain ol' C99 #define process_sinc_func process_sinc_C #endif -void resampler_process(rarch_resampler_t *re, struct resampler_data *data) +static void resampler_sinc_process(void *re_, struct resampler_data *data) { + rarch_sinc_resampler_t *re = (rarch_sinc_resampler_t*)re_; + // If data->ratio is < 1, we are downsampling. // The sinc table is not set up for this, as it always assumes upsampling. // Downsampling will work, but with some added noise due to aliasing might be present. @@ -267,14 +283,14 @@ void resampler_process(rarch_resampler_t *re, struct resampler_data *data) data->output_frames = out_frames; } -void resampler_free(rarch_resampler_t *re) +static void resampler_sinc_free(void *re) { aligned_free__(re); } -rarch_resampler_t *resampler_new(void) +static void *resampler_sinc_new(void) { - rarch_resampler_t *re = (rarch_resampler_t*)aligned_alloc__(1024, sizeof(*re)); + rarch_sinc_resampler_t *re = (rarch_sinc_resampler_t*)aligned_alloc__(128, sizeof(*re)); if (!re) return NULL; @@ -295,6 +311,15 @@ rarch_resampler_t *resampler_new(void) RARCH_LOG("Sinc resampler [C]\n"); #endif + RARCH_LOG("SINC params (%u phase bits, %u taps).\n", PHASE_BITS, TAPS); + return re; } +const rarch_resampler_t sinc_resampler = { + resampler_sinc_new, + resampler_sinc_process, + resampler_sinc_free, + "sinc", +}; + diff --git a/audio/sinc_neon.S b/audio/sinc_neon.S index 0db4a4e3d0..d32ebf7a7b 100644 --- a/audio/sinc_neon.S +++ b/audio/sinc_neon.S @@ -1,5 +1,5 @@ /* RetroArch - A frontend for libretro. - * Copyright (C) 2010-2012 - Hans-Kristian Arntzen + * Copyright (C) 2010-2013 - Hans-Kristian Arntzen * * RetroArch is free software: you can redistribute it and/or modify it under the terms * of the GNU General Public License as published by the Free Software Found- @@ -16,37 +16,39 @@ .arm .align 4 .global process_sinc_neon_asm -# void process_sinc_neon(float *out, const float *left, const float *right, const float *coeff) -# Hardcoded to 16 taps. +# void process_sinc_neon(float *out, const float *left, const float *right, const float *coeff, unsigned taps) +# Assumes taps is >= 8, and a multiple of 8. process_sinc_neon_asm: + + push {r4, lr} + vmov.f32 q0, #0.0 + vmov.f32 q8, #0.0 + + # Taps argument (r4) goes on stack in armeabi. + ldr r4, [sp, #8] + +1: # Left - vld1.f32 {q0-q1}, [r1]! - vld1.f32 {q2-q3}, [r1]! + vld1.f32 {q2-q3}, [r1]! # Right - vld1.f32 {q8-q9}, [r2]! vld1.f32 {q10-q11}, [r2]! # Coeff vld1.f32 {q12-q13}, [r3, :128]! - vld1.f32 {q14-q15}, [r3, :128]! - # Left - vmul.f32 q0, q0, q12 - vmul.f32 q1, q1, q13 - vmla.f32 q0, q2, q14 - vmla.f32 q1, q3, q15 + # Left / Right + vmla.f32 q0, q2, q12 + vmla.f32 q8, q10, q12 + vmla.f32 q0, q3, q13 + vmla.f32 q8, q11, q13 - # Right - vmul.f32 q8, q8, q12 - vmul.f32 q9, q9, q13 - vmla.f32 q8, q10, q14 - vmla.f32 q9, q11, q15 + subs r4, r4, #8 + bne 1b # Add everything together - vadd.f32 q0, q0, q1 - vadd.f32 q8, q8, q9 vadd.f32 d0, d0, d1 vadd.f32 d16, d16, d17 vpadd.f32 d0, d0, d16 vst1.f32 d0, [r0] - bx lr + pop {r4, pc} + diff --git a/audio/test/Makefile b/audio/test/Makefile index c8e9b5f9f7..55ea3498ea 100644 --- a/audio/test/Makefile +++ b/audio/test/Makefile @@ -5,18 +5,24 @@ LDFLAGS += -lm all: $(TESTS) -test-hermite: ../hermite.o ../utils.o main.o +test-hermite: ../hermite.o ../utils.o main.o resampler-hermite.o $(CC) -o $@ $^ $(LDFLAGS) -test-sinc: ../sinc.o ../utils.o main.o +test-sinc: ../sinc.o ../utils.o main.o ../hermite.o resampler-sinc.o $(CC) -o $@ $^ $(LDFLAGS) -test-snr-sinc: ../sinc.o ../utils.o snr.o +test-snr-sinc: ../sinc.o ../utils.o snr.o ../hermite.o resampler-sinc.o $(CC) -o $@ $^ $(LDFLAGS) -test-snr-hermite: ../hermite.o ../utils.o snr.o +test-snr-hermite: ../hermite.o ../utils.o snr.o resampler-hermite.o $(CC) -o $@ $^ $(LDFLAGS) +resampler-sinc.o: ../resampler.c + $(CC) -c -o $@ $< $(CFLAGS) -DHAVE_SINC + +resampler-hermite.o: ../resampler.c + $(CC) -c -o $@ $< $(CFLAGS) + %.o: %.c $(CC) -c -o $@ $< $(CFLAGS) diff --git a/audio/test/main.c b/audio/test/main.c index 04d2145d04..b51cdb4e04 100644 --- a/audio/test/main.c +++ b/audio/test/main.c @@ -45,8 +45,9 @@ int main(int argc, char *argv[]) return 1; } - rarch_resampler_t *resamp = resampler_new(); - if (!resamp) + const rarch_resampler_t *resampler = NULL; + void *re = NULL; + if (!rarch_resampler_realloc(&re, &resampler, NULL)) { fprintf(stderr, "Failed to allocate resampler ...\n"); return 1; @@ -66,7 +67,7 @@ int main(int argc, char *argv[]) .ratio = ratio, }; - resampler_process(resamp, &data); + rarch_resampler_process(resampler, re, &data); size_t output_samples = data.output_frames * 2; @@ -76,6 +77,6 @@ int main(int argc, char *argv[]) break; } - resampler_free(resamp); + rarch_resampler_freep(&resampler, &re); } diff --git a/audio/test/snr.c b/audio/test/snr.c index 0f65cb542c..ab55461528 100644 --- a/audio/test/snr.c +++ b/audio/test/snr.c @@ -270,8 +270,10 @@ int main(int argc, char *argv[]) assert(input); assert(output); - rarch_resampler_t *re = resampler_new(); - assert(re); + void *re = NULL; + const rarch_resampler_t *resampler = NULL; + if (!rarch_resampler_realloc(&re, &resampler, NULL)) + return 1; test_fft(); @@ -289,7 +291,7 @@ int main(int argc, char *argv[]) .ratio = ratio, }; - resampler_process(re, &data); + rarch_resampler_process(resampler, re, &data); unsigned out_samples = data.output_frames * 2; assert(out_samples >= fft_samples * 2); @@ -307,7 +309,7 @@ int main(int argc, char *argv[]) res.alias_freq[2] / (float)in_rate, res.alias_power[2]); } - resampler_free(re); + rarch_resampler_freep(&resampler, &re); free(input); free(output); free(butterfly_buf); diff --git a/audio/utils_neon.S b/audio/utils_neon.S index 4c45cd5235..4c7ef7c6f2 100644 --- a/audio/utils_neon.S +++ b/audio/utils_neon.S @@ -1,5 +1,5 @@ /* RetroArch - A frontend for libretro. - * Copyright (C) 2010-2012 - Hans-Kristian Arntzen + * Copyright (C) 2010-2013 - Hans-Kristian Arntzen * * RetroArch is free software: you can redistribute it and/or modify it under the terms * of the GNU General Public License as published by the Free Software Found- diff --git a/config.def.h b/config.def.h index 228befb46c..0f96680b01 100644 --- a/config.def.h +++ b/config.def.h @@ -317,6 +317,13 @@ static const int out_latency = 64; // Will sync audio. (recommended) static const bool audio_sync = true; +// Default resampler +#ifdef HAVE_SINC +static const char *audio_resampler = "sinc"; +#else +static const char *audio_resampler = "hermite"; +#endif + // Experimental rate control #if defined(GEKKO) || !defined(RARCH_CONSOLE) static const bool rate_control = true; diff --git a/console/griffin/griffin.c b/console/griffin/griffin.c index e5997a1e52..6fc2a6efbf 100644 --- a/console/griffin/griffin.c +++ b/console/griffin/griffin.c @@ -275,13 +275,13 @@ FIFO BUFFER #include "../../fifo_buffer.c" /*============================================================ -AUDIO HERMITE +AUDIO RESAMPLER ============================================================ */ +#include "../../audio/resampler.c" #ifdef HAVE_SINC #include "../../audio/sinc.c" -#else -#include "../../audio/hermite.c" #endif +#include "../../audio/hermite.c" /*============================================================ RSOUND diff --git a/dist-scripts/ps3-cores-cex-355.sh b/dist-scripts/ps3-cores-cex-355.sh index cdd4b8de44..a05c72bf9a 100755 --- a/dist-scripts/ps3-cores-cex-355.sh +++ b/dist-scripts/ps3-cores-cex-355.sh @@ -1,4 +1,5 @@ #!/bin/sh +RARCH_VERSION=0.9.8.3 make -C ../ -f Makefile.ps3.salamander clean || exit 1 make -C ../ -f Makefile.ps3.rgl clean || exit 1 @@ -29,4 +30,4 @@ make -C ../ -f Makefile.shaders deploy-ps3 make_self_wc ../retroarch-salamander_ps3.elf ../ps3/pkg/USRDIR/EBOOT.BIN rm -rf ../retroarch-salamander_ps3.elf -python2 ../ps3/ps3py/pkg.py --contentid UP0001-SSNE10000_00-0000000000000001 ../ps3/pkg/ retroarch-ps3-cfw-0.9.8.1.pkg +python2 ../ps3/ps3py/pkg.py --contentid UP0001-SSNE10000_00-0000000000000001 ../ps3/pkg/ retroarch-ps3-cfw-$RARCH_VERSION.pkg diff --git a/dist-scripts/retroarch-360-README.txt b/dist-scripts/retroarch-360-README.txt new file mode 100644 index 0000000000..b49abcea34 --- /dev/null +++ b/dist-scripts/retroarch-360-README.txt @@ -0,0 +1,201 @@ +------------------------------------------------------------------------------ +RETROARCH 360 - 0.9.8.3 +------------------------------------------------------------------------------ +RetroConsole Level: 2 +Author: Themaister, Squarepusher/Twin Aphex +------------------------------------------------------------------------------ + +------------------------------------------------------------------------------ +HOW TO INSTALL THIS +------------------------------------------------------------------------------ +Copy the entire folder to your harddrive. + +ROMs go into the 'roms' directory, or some subdirectory in the RetroArch-360 +directory. + +------------------------------------------------------------------------------ +HOW TO USE THIS +------------------------------------------------------------------------------ +On first startup, RetroArch will select one of the dozen or so +emulator/game cores. The name of the core currently loaded will be +shown at the bottom side of the screen. + +You can now select a ROM that this core supports and load it in the Filebrowser. + +To select a different core - go to 'Change Libretro core' in the Main Menu. +Press A to go to a filebrowser where you can select a different core. Press A +to switch to the emulator/game core. + +------------------------------------------------------------------------------ +INGAME CONTROLS +------------------------------------------------------------------------------ +During ingame operation you can do some extra actions: + +Right Thumb Stick - Down - Fast-forwards the game +Right Thumb Stick - Up - Rewinds the game in real-time + ('Rewind' has to be enabled in the 'Settings' + screen - warning - comes at a slight + performance decrease but will be worth it + if you love this feature) +RStick Left + RT - Decrease save state slot +Rtick Right + RT - Increase save state slot +RStick Up + RT - Load selected save state slot +RStick Down + RT - Save selected save state slot +Right Thumb + Left Thumb - Go back to 'Menu'/'Quick Menu' + +------------------------------------------------------------------------------ +WHAT IS RETROARCH? +------------------------------------------------------------------------------ +RetroArch is a modular multi-system emulator system that is designed to +be fast, lightweight and portable. It has features few other emulator +frontends have, such as real-time rewinding and game-aware shading. + +------------------------------------------------------------------------------ +WHAT IS LIBRETRO? +------------------------------------------------------------------------------ +Libretro is the API that RetroArch uses. It makes it easy to port games +and emulators to a single core backend, such as RetroArch. + +For the user, this means - more ports to play with, more crossplatform +portability, less worrying about developers having to reinvent the wheel +writing boilerplate UI/port code - so that they can get busy with writing +the emulator/porting the emulator/game. + +------------------------------------------------------------------------------ +WHAT'S THE BIG DEAL? +------------------------------------------------------------------------------ +Right now it's unique in that it runs the same emulator cores on +multiple systems (such as Xbox 360, PS3, PC, Wii, etc). + +For each emulator 'core', RetroArch makes use of a library API that we +like to call 'libretro'. + +Think of libretro as an interface for emulator and game ports. You can +make a libretro port once and expect the same code to run on all the +platforms that RetroArch supports. It's designed with simplicity and +ease of use in mind so that the porter can worry about the port at hand +instead of having to wrestle with an obfuscatory API. + +The purpose of libretro is to help ease the work of the emulator/game +porter by giving him an API that allows him to target multiple platforms +at once without having to redo any code. He doesn't have to worry about +writing input/video/audio drivers - all of that is supplied to him by +RetroArch. All he/she has to do is to have the emulator port hook +into the libretro API and that's it - we take care of the rest. + +------------------------------------------------------------------------------ +XBOX 360 PORT +------------------------------------------------------------------------------ +The Xbox 360 port of RetroArch has the following features: + +- Real-time rewinding +- Switching between emulator cores seamlessly, and ability to install +new libretro cores + +Included with RetroArch 360 are a bunch of shaders - including the latest +version of the popular xBR shader. It is possible to use two shaders +simultaneously to get the best possible graphical look. + +------------------------------------------------------------------------------ +EMULATOR/GAME CORES BUNDLED WITH XBOX 360 PORT +------------------------------------------------------------------------------ +The following emulators/games have been ported to RetroArch and are included in +the Xbox 360 release of RetroArch. + +For more information about them, see the included +'retroarch-libretro-README.txt' file. + +- Final Burn Alpha (Arcade - various) [version 0.2.97.28] +- FCEUmm (Nintendo Entertainment System) [recent SVN version] +- NEStopia (Nintendo Entertainment System) [1.44] +- Gambatte (Game Boy | Super Game Boy | Game Boy Color) [version 0.5.0 WIP] +- Genesis Plus GX (Sega SG-1000 | Master System | Game Gear | Genesis/Mega Drive | + Sega CD) [version 1.7.3] +- SNES9x Next (Super Nintendo/Super Famicom) +- VBA Next (Game Boy Advance) +- Prboom (for playing Doom 1/Doom 2/Ultimate Doom/Final Doom) +- Mednafen PCE Fast (PC Engine/PC Engine CD/Turbografx 16) +- Mednafen Wonderswan (WonderSwan/WonderSwan Color/WonderSwan Crystal) +- Mednafen NGP (Neo Geo Pocket Color) + +All of the emulators listed above are the latest versions currently +available. Most of them have been specifically optimized so that +they will run better on 360 (some games would not reach fullspeed +without these optimizations). + +------------------------------------------------------------------------------ +WHAT EXTENSIONS ARE SUPPORTED BY EACH CORE +------------------------------------------------------------------------------ +- Prboom WAD|wad +- SNES9x Next smc|fig|sfc|gd3|gd7|dx2|bsx|swc|zip|SMC|FIG|SFC|BSX|GD3| + GD7|DX2|SWC +- Genesis Plus GX md|smd|bin|gen|zip|MD|SMD|bin|GEN|ZIP|sms|SMS|gg|GG|sg|SG| + cue|CUE +- VBA Next GBA|gba +- FCEUmm nes|NES|unif|UNIF +- NEStopia nes|NES|fds|FDS +- Gambatte gb|gbc|dmg|zip|GB|GBC|DMG|ZIP +- Final Burn Alpha zip|ZIP +- Mednafen PCE pce|PCE|cue|CUE +- Mednafen Wonderswan ws|WS|wsc|WSC +- Mednafen NGP ngp|NGP + +------------------------------------------------------------------------------ +ZIP SUPPORT +------------------------------------------------------------------------------ +Selecting a ZIP file will temporarily unzip that file to the harddrive. The +temporary file will be deleted as soon as the game gets unloaded and/or when +you quit RetroArch. + +NOTE: For the FBA core (and other cores that have 'block_extract' set to +true) - selecting a ZIP file from the Filebrowser will load that game +directly. + +------------------------------------------------------------------------------ +Troubleshooting +------------------------------------------------------------------------------ + +If you find that RetroArch no longer works for whatever reason, there is +a way to get it back to work - + +- Remove retroarch.cfg from the 'Retroarch-360' folder, then start up again. +The Libretro management service in RetroArch should automatically pick a +random libretro core and write this to the config file. + +------------------------------------------------------------------------------ +What can you expect in the future? +------------------------------------------------------------------------------ +- Do a Blackberry Playbook/Blackberry 10 RetroArch port +- Do an iOS port of RetroArch (will need hardware for this - gifts appreciated) +- Make the libxenon port release-worthy. +- Add console-friendly features (nicely formatted names for FBA, some better +way to do core switching, etc) +- Fix NxEngine issues on consoles +- Finish up MAME 0.72 port +- Finish up ScummVM port +- Port of VICE to libretro +- More emulators, more games that will run on RetroArch +- Lots of other crazy ideas that might or might not pan out + +------------------------------------------------------------------------------ +Credits +------------------------------------------------------------------------------ +- Mudlord for his Waterpaint/Noise shaders. +- Hyllian for the xBR shader. +- Opium2k for the nice manual shaders (bundled with PS3 release). +- Deank for assistance with RetroArch Salamander on CFW PS3s and + Multiman interoperability. +- FBA devs for adopting the libretro port. +- Ekeeke for help with the Genesis Plus GX port. +- ToadKing for having done a lot of work on RetroArch Wii. +- Freakdave for helping out with the Xbox 1 port. + +------------------------------------------------------------------------------ +Websites +------------------------------------------------------------------------------ +Twitter: http://twitter.com/libretro +Source: http://github.com/libretro +Homepage: http://www.libretro.org +IRC: #retroarch (freenode) + +------------------------------------------------------------------------------ diff --git a/dist-scripts/retroarch-CHANGELOG.txt b/dist-scripts/retroarch-CHANGELOG.txt new file mode 100644 index 0000000000..ce5aa01f3d --- /dev/null +++ b/dist-scripts/retroarch-CHANGELOG.txt @@ -0,0 +1,124 @@ +RETROARCH CONSOLE +------------------------------------------------------------------------------ +v0.9.8.3 +------------------------------------------------------------------------------ +* [FBA core] Various changes/fixes +- Hook up Armed Police Batrider controls +- Afterburner - make fire buttons work +- Hook up Bad Dudes controls +- Hook up Cyberbots controls +- Hook up 1942 controls +- Add missing Chase HQ controls +- Add missing WWF Wrestlefest controls +- EEPROM save should now work (tested with EEPROM-based system such as Capcom CPS2) +- Samples are now looked for - should be in 'samples' subdirectory +- Hiscore files should now be read from/written to. +* [SNES9x Next] Added big speed hack for Star Fox 1 - makes it fast enough for it to run at fullspeed on the Wii. +* [Genesis Plus GX] Set samplerate back to 44Khz. +* [Android] New 'Calibrate Refresh Rate' option - use this to get an accurate estimation of your screen refresh rate. NOTE: Touch the screen at all times during calibration for more accurate measurements. You might have to slightly tweak the value later on for the best results. +* [Android] Added a 'Set OS-reported refresh rate' which should do the same as what 'Sync refreshrate to Screen' previously did. Note 2 users might get better results with this than they will with 'Calibrate refresh rate'. +* [Android] Added a built-in help system that should answer a lot of the frequently asked questions. +* ]Android] Add iCade profiles - two added for now - iPega and Red Samurai +* [Android] Audio resampler now faster +* [Android] Input autodetection expanded - +* [CONSOLES] Audio resampler is now adjustable - can choose between Sinc resampler (new) and Hermite resampler (old). Sinc is now selected by default, is superior audio-quality wise and will fix a lot of sound issues. +* [PS3] Save Preset fixed +* [PS3] Starting with Dual Shader/Custom Scaling mode OFF and then turning it ON works now +* [Wii] Numerous Wii video mode fixes - including PAL modes that went beyond the internal framebuffer bounds +- PC2JAMMA-USB (needs to be tested) +- Genius MaxFire G-08XU +- Zeemote Steelseries +- Saitek Rumblepad +- Super Smart Joy + +------------------------------------------------------------------------------ +v0.9.8.1 +------------------------------------------------------------------------------ +- (Android) Lots of changes - too numerous to list +- [FBA] Fixed serious bug that would cause a lot of games to get stuck +in service mode or to display graphical corruption (CPS1). +- [NEStopia] Now outputs in mono sound mode. +- [FCEUmm] Uses RGB565 now - should no longer flicker on RMenu. +- [Mednafen PC Engine Fast] Fixed libretro issue where certain games +had totally wrong pitch +- [Mednafen Wonderswan] Core fixed, works again. +- [Genesis Plus GX] Set audio samplerate at 48KHz (from 44KHz). +- [PS3] Fixed serious bugs where it could get 'stuck' or the app could +'hang' while toggling between ingame and quickmenu/file browser. +- [PS3] Added 'Menu Skins' to 'Retro Settings' - will allow you to +select a different background for the menu. Captain CPS-X's menu skin +is also included. +- [Wii] Fixes serious analog stick issues with CC Pro/CC. +- [Wii] Added additional resolutions - 304x224, 576x224, 608x224 +- [Wii] More natural way to switch between cores +------------------------------------------------------------------------------ +v0.9.8 +------------------------------------------------------------------------------ +- (Android) Initial release of RetroArch Android. +- [LIBRETRO] Added Mednafen NGP and Mednafen VB. +- [LIBRETRO] Added NEStopia Undead (1.44). +- [LIBRETRO] Updated Mednafen PCE Fast and Mednafen Wonderswan to 0.9.28. +- [LIBRETRO] Added PCSX ReARMed for RetroArch Android. +- [FBA] Updated Final Burn Alpha to 0.9.27.28. +- [Gambatte] Updated Gambatte (now has built-in GBC BIOS color palettes). +- [SNES9x Next] Updated SNES9x Next (fixes numerous bugs). +- [FCEUmm] Updated FCEUmm to latest version. +- [Genesis Plus GX] Updated Genesis Plus GX to latest version. +- (360) Gamma correction can now be applied on-the-fly - no longer requires +reboots +- (360) Added new shaders - mudlord-oldtvshader-variant, crt-curved, and +others +- (360) Added 'SRAM dir Enable' option - allows you to save all your SRAM to +game:/sram instead of the ROM directory +- (360) Added 'SRAM dir Enable' option - allows you to save all your states to +game:/savestates +- (RARCH_CONSOLE) Various stability fixes +- (RARCH_CONSOLE) More sane unzipping mode - will temporarily extract file to +HDD and then instantly delete it when it's done with it (ie. when another ROM +gets loaded or when RetroArch shuts down) +- (RARCH_CONSOLE) All console ports now use 59.94Hz for synchronization on +the RetroArch side instead of 59.92Hz as before. All consoles use 59.94Hz +so this agrees better with them. +- (PS3) Added PAL60 temporal PAL mode +- (PS3) Fixed a lot of path issues - SRAM/savestate dir enable now work, +'Default ROM directory' should now work, etc. +- (PS3) Added rewind granularity options +- (PS3) Rewrote video driver from scratch (RGL v2). Faster blitting. +- (PS3) Onscreen keyboard should work again. +- (WII) Made a custom wiiuse input driver and built it in. Slimmed down +and should give better results. Also rejigged input in general. +- (WII) Added rewind option. NOTE: This feature is CPU intensive - a core +might need to at least run at double realtime FPS in order for this option +to be useful. +- (WII) Button combos can now be done ingame. You can do rewinding, fast +forwarding, selecting save state slots and 'save state load/save state save' +all ingame without first going to the menu. For more information, read the +README.txt for the Wii release. +------------------------------------------------------------------------------ +v0.9.7.1 +------------------------------------------------------------------------------ +- (FBAcores CPS1) Sound crackling/popping fixed +- (FBACores CPS2) Sound crackling/popping fixed +- (FBACores NeoGeo) Sound crackling/popping fixed +- (WII) Fixed left/right audio channels being in reverse issue +- (WII) Filebrowser now filters by core supported extensions +- (WII) Fixed filebrowser performance issues in v0.9.7 +------------------------------------------------------------------------------ +v0.9.7 +------------------------------------------------------------------------------ +- (XBOX 1/Wii) Made an Xbox 1/Wii port. +- (LIBRETRO) Added Mednafen PCE FAST, and Mednafen Wonderswan cores +- (360) Added Genesis Plus GX to official 360 release +- (Genesis Plus GX) Updated to v1.7.0 +- (PS3) Improved GUI +- (360) Improved UI +- (ALL) Improved stability / error trapping +- (ALL) ZIP extract modes expanded - it can extract the contents of a ZIP file to +the current directory, and/or extract to current dir and immediately load the +first ROM/game file. +- Too many things to mention + +------------------------------------------------------------------------------ +v0.9.6 +------------------------------------------------------------------------------ +- (PS3/360) Initial release of RetroArch PS3/360. diff --git a/dist-scripts/retroarch-ps3-README.txt b/dist-scripts/retroarch-ps3-README.txt new file mode 100644 index 0000000000..bef61e3d54 --- /dev/null +++ b/dist-scripts/retroarch-ps3-README.txt @@ -0,0 +1,237 @@ +------------------------------------------------------------------------------ +RETROARCH PS3 - 0.9.8.3 +------------------------------------------------------------------------------ +RetroConsole Level: 2 +Author: Themaister, Squarepusher/Twin Aphex +------------------------------------------------------------------------------ + +------------------------------------------------------------------------------ +HOW TO INSTALL THIS +------------------------------------------------------------------------------ + +------------------------------------------------------------------------------ +ON DEBUG (DEX) PS3 +------------------------------------------------------------------------------ +Put the PKG file 'retroarch-ps3-v0.9.8.3-dex.pkg' on your +USB stick, put it in your PS3. Go to the PS3 XMB - go to the +Game tab - Select 'Install Packages', and install the PKG file. + +------------------------------------------------------------------------------ +ON CFW P3 +------------------------------------------------------------------------------ +Put the PKG file 'retroarch-ps3-v0.9.8.3-cfw.pkg' on your +USB stick. Put it in your CFW PS3. Go to the PS3 XMB - go to the +Game tab - select 'Install Packages', and install the PKG file. + +NOTE: The official release no longer supports Geohot/Wutangzra +CFWs. If you must use them, you have to do pkg_finalize on the PKG +to install it. + +------------------------------------------------------------------------------ +HOW TO USE THIS +------------------------------------------------------------------------------ +On first startup, RetroArch will select one of the dozen or +so emulator/game cores. The name of the core currently loaded will +be shown at the top side of the screen. + +You can now select a ROM that this core supports and load it in +the Filebrowser. + +To select a different core in the menu - press Select to go to the +Settings screen. From here, go to the 'Retro tab', and select +'Default emulator core'. Press X to go to a filebrowser where you +can select a different core. Press X to confirm, then exit +RetroArch. Start up again to boot up to the new emulator core. + +To change to a different core ingame - press R3 to bring up +the 'Quick Menu'. Select 'Change libretro core'. Press X to +go to a filebrowser where you can select a different core. + +------------------------------------------------------------------------------ +INGAME CONTROLS +------------------------------------------------------------------------------ +During ingame operation you can do some extra actions: + +Right Thumb Stick - Down - Fast-forwards the game +Right Thumb Stick - Up - Rewinds the game in real-time + ('Rewind' has to be enabled in the + 'Settings' menu - warning - comes at a + performance decrease but will be worth it + if you love this feature) +RStick Left + R2 - Decrease save state slot +Rtick Right + R2 - Increase save state slot +RStick Up + R2 - Load selected save state slot +RStick Down + R2 - Save selected save state slot +L3 + R3 - Go back to 'Menu'/'Quick Menu' + +------------------------------------------------------------------------------ +WHAT IS RETROARCH? +------------------------------------------------------------------------------ +RetroArch is a modular multi-system emulator system that is +designed to be fast, lightweight and portable. It has features +few other emulator frontends have, such as real-time rewinding +and game-aware shading. + +------------------------------------------------------------------------------ +WHAT IS LIBRETRO? +------------------------------------------------------------------------------ +Libretro is the API that RetroArch uses. It makes it easy to +port games and emulators to a single core backend, such as +RetroArch. + +For the user, this means - more ports to play with, more +crossplatform portability, less worrying about developers having +to reinvent the wheel writing boilerplate UI/port code - so that +they can get busy with writing the emulator/porting the emulator/game. + +------------------------------------------------------------------------------ +WHAT'S THE BIG DEAL? +------------------------------------------------------------------------------ +Right now it's unique in that it runs the same emulator cores on +multiple systems (such as Xbox 360, PS3, PC, Wii, Xbox 1, etc). + +For each emulator 'core', RetroArch makes use of a library API that +we like to call 'libretro'. + +Think of libretro as an interface for emulator and game ports. You +can make a libretro port once and expect the same code to run on all +the platforms that RetroArch supports. It's designed with simplicity +and ease of use in mind so that the porter can worry about the port +at hand instead of having to wrestle with an obfuscatory API. + +The purpose of libretro is to help ease the work of the emulator/game +porter by giving him an API that allows him to target multiple +platforms at once without having to redo any code. He doesn't have +to worry about writing input/video/audio drivers - all of that is +supplied to him by RetroArch. All he has to do is to have the emulator +port hook into the libretro API and that's it - we take care of the rest. + +------------------------------------------------------------------------------ +PLAYSTATION3 PORT +------------------------------------------------------------------------------ +The PS3 port of RetroArch is one of the most developed console ports +of RetroArch. + +A couple of unique features RetroArch PS3 boasts that is not commonly +found anywhere else: + +- Game-aware shading in every emulator now (*) +- Real-time rewinding +- More shader features (motion blurring, etc) +- Switching between emulator cores seamlessly, and ability to install new + libretro cores + +Included with RetroArch PS3 are a bunch of shaders - including the +latest versions of the popular xBR shader. It is possible to use two +shaders simultaneously to get the best possible graphical look. + +* Check out Opium2k's manual shaders for Zelda 3 and others - you can +find DLC packs for RetroArch at this site: + +https://code.google.com/p/retro-arch/ + +------------------------------------------------------------------------------ +EMULATOR/GAME CORES BUNDLED WITH PS3 PORT +------------------------------------------------------------------------------ +The following emulators have been ported to RetroArch and are included +in the PS3 release of RetroArch. + +For more information about them, see the included +'retroarch-libretro-README.txt' file. + +- Final Burn Alpha (Arcade - various) [version 0.2.97.28] +- FCEUmm (Nintendo Entertainment System) [recent SVN version] +- NEStopia (Nintendo Entertainment System) [1.44] +- Gambatte (Game Boy | Super Game Boy | Game Boy Color) [version 0.5.0 WIP] +- Genesis Plus GX (Sega SG-1000 | Master System | Game Gear | Genesis/Mega Drive | + Sega CD) [version 1.7.3] +- SNES9x Next (Super Nintendo/Super Famicom) +- VBA Next (Game Boy Advance) +- Prboom (for playing Doom 1/Doom 2/Ultimate Doom/Final Doom) +- Mednafen PCE Fast (PC Engine/PC Engine CD/Turbografx 16) +- Mednafen Wonderswan (WonderSwan/WonderSwan Color/WonderSwan Crystal) +- Mednafen NGP (Neo Geo Pocket Color) +- Mednafen VB (Virtual Boy) + +All of the emulators listed above are the latest versions currently +available. Most of them have been specifically optimized so that they +will run better on PS3 (some games would not reach fullspeed without these optimizations). + +------------------------------------------------------------------------------ +WHAT EXTENSIONS ARE SUPPORTED BY EACH CORE +------------------------------------------------------------------------------ +- Prboom WAD|wad +- SNES9x Next smc|fig|sfc|gd3|gd7|dx2|bsx|swc|zip|SMC|FIG|SFC|BSX|GD3| + GD7|DX2|SWC +- Genesis Plus GX md|smd|bin|gen|zip|MD|SMD|bin|GEN|ZIP|sms|SMS|gg|GG|sg|SG| + cue|CUE +- VBA Next GBA|gba +- FCEUmm nes|NES|unif|UNIF +- NEStopia nes|NES|fds|FDS +- Gambatte gb|gbc|dmg|zip|GB|GBC|DMG|ZIP +- Final Burn Alpha zip|ZIP +- Mednafen PCE pce|PCE|cue|CUE +- Mednafen Wonderswan ws|WS|wsc|WSC +- Mednafen NGP ngp|NGP +- Mednafen VB vb|VB + +------------------------------------------------------------------------------ +ZIP SUPPORT +------------------------------------------------------------------------------ +Selecting a ZIP file will temporarily unzip that file to the harddrive. The +temporary file will be deleted as soon as the game gets unloaded and/or when +you quit RetroArch. + +NOTE: For the FBA core (and other cores that have 'block_extract' set to +true) - selecting a ZIP file from the Filebrowser will load that game +directly. + +------------------------------------------------------------------------------ +Troubleshooting +------------------------------------------------------------------------------ + +If you find that RetroArch no longer works for whatever reason, there is +a way to get it back to work - + +- Remove retroarch.cfg from the 'SSNE100000' folder, then start up again. +The Libretro management service in RetroArch should automatically pick a +random libretro core and write this to the config file. + +------------------------------------------------------------------------------ +What can you expect in the future? +------------------------------------------------------------------------------ +- Do a Blackberry Playbook/Blackberry 10 RetroArch port +- Do an iOS port of RetroArch (will need hardware for this - gifts appreciated) +- Make the libxenon port release-worthy. +- Add console-friendly features (nicely formatted names for FBA, some better +way to do core switching, etc) +- Fix NxEngine issues on consoles +- Finish up MAME 0.72 port +- Finish up ScummVM port +- Port of VICE to libretro +- More emulators, more games that will run on RetroArch +- Lots of other crazy ideas that might or might not pan out + +------------------------------------------------------------------------------ +Credits +------------------------------------------------------------------------------ +- Mudlord for his Waterpaint/Noise shaders. +- Hyllian for the xBR shader. +- Opium2k for the nice manual shaders (bundled with PS3 release). +- Deank for assistance with RetroArch Salamander on CFW PS3s and + Multiman interoperability. +- FBA devs for adopting the libretro port. +- Ekeeke for help with the Genesis Plus GX port. +- ToadKing for having done a lot of work on RetroArch Wii. +- Freakdave for helping out with the Xbox 1 port. + +------------------------------------------------------------------------------ +Websites +------------------------------------------------------------------------------ +Twitter: http://twitter.com/libretro +Source: http://github.com/libretro +Homepage: http://www.libretro.org +Opium2K DLC for RetroArch: https://code.google.com/p/retro-arch/ +IRC: #retroarch (freenode) + +------------------------------------------------------------------------------ diff --git a/dist-scripts/retroarch-wii-readme.txt b/dist-scripts/retroarch-wii-readme.txt new file mode 100644 index 0000000000..eb28304084 --- /dev/null +++ b/dist-scripts/retroarch-wii-readme.txt @@ -0,0 +1,237 @@ +------------------------------------------------------------------------------ +RETROARCH WII - 0.9.8.3 +------------------------------------------------------------------------------ +RetroConsole Level: 1 +Author: Themaister, Toad King, Squarepusher/Twin Aphex +------------------------------------------------------------------------------ + +------------------------------------------------------------------------------ +HOW TO INSTALL THIS +------------------------------------------------------------------------------ +Copy the entire directory (retroarch-wii) to your SD card in your 'apps' +directory. Start up the Homebrew Channel and start up RetroArch Wii from +there. + +On first startup, RetroArch will create a folder in the root of your storage +device called 'retroarch'. All RetroArch configuration files are stored here. + +------------------------------------------------------------------------------ +HOW TO USE THIS +------------------------------------------------------------------------------ +On first startup, RetroArch will select one of the dozen or so +emulator/game cores. The name of the core currently loaded will be +shown at the bottom side of the screen. + +You can now select a ROM that this core supports and load it in the Filebrowser. + +To select a different core - go to the Settings menu (see 'Ingame controls'). +Select the option 'Core' and hit the A button. A filebrowser will appear +where you can select a different core. Press A to switch to the +emulator/game core. + +After doing so, select 'Restart RetroArch' to load the newly selected core. + +------------------------------------------------------------------------------ +CONTROLS +------------------------------------------------------------------------------ +RetroArch Wii will create a new input config file for each core you load. +All input settings will be saved when RetroArch exits. + +NOTE: When starting up a new core for the first time, you might have to first +initialize the input settings. Go to the Settings menu (see 'Ingame controls') +and go to 'Controller #number config'. Re-set the 'Device' by going back and +forth between a previous device. The controls will be automatically applied. + +This only has to be done once per core. + +------------------------------------------------------------------------------ +INGAME CONTROLS +------------------------------------------------------------------------------ +During ingame operation you can do some extra actions: + +Wii Classic Minus - Go to Settings +Wii Classic Controller Home + ZL + ZR - Quit RetroArch +Wii Classic Controller Home - Go back to 'Menu' + +Wiimote Minus - Go to Settings +Wiimote Home - Go back to 'Menu' +Wiimote Home + B - Quit RetroArch + +Gamecube pad Z - Go to Settings +Gamecube pad L + R + LStick Up + Rstick Up - Go back to 'Menu' +Gamecube pad L + R + LStick Down + Rstick Down - Quit RetroArch + +Right Thumb Stick - Down - Fast-forwards the game +Right Thumb Stick - Up - Rewinds the game in real-time + ('Rewind' has to be enabled in the + 'Settings' menu - warning - comes at a + performance decrease but will be worth it + if you love this feature) +RStick Left + ZL - Decrease save state slot +Rtick Right + ZR - Increase save state slot +RStick Up + ZR - Load selected save state slot +RStick Down + ZR - Save selected save state slot + +(NOTE: For Gamecube pads - you would press Z trigger + any of the Rstick +Down movements shown above instead of ZR/ZL) + +------------------------------------------------------------------------------ +WHAT IS RETROARCH? +------------------------------------------------------------------------------ +RetroArch is a modular multi-system emulator system that is designed to +be fast, lightweight and portable. + +------------------------------------------------------------------------------ +WHAT IS LIBRETRO? +------------------------------------------------------------------------------ +Libretro is the API that RetroArch uses. It makes it easy to port games +and emulators to a single core backend, such as RetroArch. + +For the user, this means - more ports to play with, more crossplatform +portability, less worrying about developers having to reinvent the wheel +writing boilerplate UI/port code - so that they can get busy with writing +the emulator/porting the emulator/game. + +------------------------------------------------------------------------------ +WHAT'S THE BIG DEAL? +------------------------------------------------------------------------------ +Right now it's unique in that it runs the same emulator cores on +multiple systems (such as Xbox 360, Xbox 1, PS3, PC, Wii, Android, +etc). + +For each emulator 'core', RetroArch makes use of a library API that we +like to call 'libretro'. + +Think of libretro as an interface for emulator and game ports. You can +make a libretro port once and expect the same code to run on all the +platforms that RetroArch supports. It's designed with simplicity and +ease of use in mind so that the porter can worry about the port at hand +instead of having to wrestle with an obfuscatory API. + +The purpose of libretro is to help ease the work of the emulator/game +porter by giving him an API that allows him to target multiple platforms +at once without having to redo any code. He doesn't have to worry about +writing input/video/audio drivers - all of that is supplied to him by +RetroArch. All he has to do is to have the emulator port hook into the +libretro API and that's it - we take care of the rest. + +------------------------------------------------------------------------------ +WII PORT +------------------------------------------------------------------------------ +The Wii port of RetroArch has the following features: + +- Real-time rewinding +- Switching between emulator cores seamlessly, and ability to install +new libretro cores + +------------------------------------------------------------------------------ +EMULATOR/GAME CORES BUNDLED WITH WII PORT +------------------------------------------------------------------------------ +The following emulators/games have been ported to RetroArch and are included in +the Wii release of RetroArch. + +For more information about them, see the included +'retroarch-libretro-README.txt' file. + +- Final Burn Alpha [version 0.2.97.28] +- Final Burn Alpha Cores (CPS1 - CPS2 - NeoGeo) [version 0.2.97.28] (**) +- FCEUmm (Nintendo Entertainment System) [recent SVN version] +- NEStopia (Nintendo Entertainment System) [1.44] +- Gambatte (Game Boy | Super Game Boy | Game Boy Color) [version 0.5.0 WIP] +- Genesis Plus GX (Sega SG-1000 | Master System | Game Gear | Genesis/Mega Drive | + Sega CD) [version 1.7.3] +- SNES9x Next (Super Nintendo/Super Famicom) +- VBA Next (Game Boy Advance) (*) +- Prboom (for playing Doom 1/Doom 2/Ultimate Doom/Final Doom) +- Mednafen PCE Fast (PC Engine/PC Engine CD/Turbografx 16) +- Mednafen Wonderswan (WonderSwan/WonderSwan Color/WonderSwan Crystal) +- Mednafen NGP (Neo Geo Pocket Color) +- Mednafen VB (Virtual Boy) + +All of the emulators listed above are the latest versions currently +available. Most of them have been specifically optimized so that +they will run better on Wii (some games would not reach fullspeed +without these optimizations). + +* Some games don't run at fullspeed on Wii (VBA Next is a +RetroConsole Level 2 emulator port). +** The biggest Neo-Geo ROMs that can be loaded are around 23+MB in +size, such as Real Bout Fatal Fury 1 and King of Fighters '96. + +------------------------------------------------------------------------------ +WHAT EXTENSIONS ARE SUPPORTED BY EACH CORE +------------------------------------------------------------------------------ +- Prboom WAD|wad +- SNES9x Next smc|fig|sfc|gd3|gd7|dx2|bsx|swc|zip|SMC|FIG|SFC|BSX|GD3| + GD7|DX2|SWC +- Genesis Plus GX md|smd|bin|gen|zip|MD|SMD|bin|GEN|ZIP|sms|SMS|gg|GG|sg|SG| + cue|CUE +- VBA Next GBA|gba +- FCEUmm nes|NES|unif|UNIF +- NEStopia nes|NES|fds|FDS +- Gambatte gb|gbc|dmg|zip|GB|GBC|DMG|ZIP +- Final Burn Alpha zip|ZIP +- Mednafen PCE pce|PCE|cue|CUE +- Mednafen Wonderswan ws|WS|wsc|WSC +- Mednafen NGP ngp|NGP +- Mednafen VB vb|VB + +------------------------------------------------------------------------------ +ZIP SUPPORT (IN GENERAL) +------------------------------------------------------------------------------ +Selecting a ZIP file will temporarily unzip that file to the harddrive. The +temporary file will be deleted as soon as the game gets unloaded and/or when +you quit RetroArch. + +NOTE: For the FBA core (and other cores that have 'block_extract' set to +true) - selecting a ZIP file from the Filebrowser will load that game +directly. + +------------------------------------------------------------------------------ +Troubleshooting +------------------------------------------------------------------------------ + +If you find that RetroArch no longer works for whatever reason, there is +a way to get it back to work - + +- Remove retroarch.cfg from the 'retroarch' folder on your storage device, +then start up again. The Libretro management service in RetroArch should +automatically pick a random libretro core and write this to the config file. + +------------------------------------------------------------------------------ +What can you expect in the future? +------------------------------------------------------------------------------ +- Do a Blackberry Playbook/Blackberry 10 RetroArch port +- Do an iOS port of RetroArch (will need hardware for this - gifts appreciated) +- Make the libxenon port release-worthy. +- Add console-friendly features (nicely formatted names for FBA, some better +way to do core switching, etc) +- Fix NxEngine issues on consoles +- Finish up MAME 0.72 port +- Finish up ScummVM port +- Port of VICE to libretro +- More emulators, more games that will run on RetroArch +- Lots of other crazy ideas that might or might not pan out + +------------------------------------------------------------------------------ +Credits +------------------------------------------------------------------------------ +- Hyllian for the xBR shader family. +- Opium2k for the nice manual shaders (bundled with PS3 release). +- Deank for assistance with RetroArch Salamander on CFW PS3s and +- Mudlord for his Waterpaint/Noise shaders. + Multiman interoperability. +- FBA devs for adopting the libretro port. +- Ekeeke for help with the Genesis Plus GX port. +- ToadKing for having done a lot of work on RetroArch Wii. +- Freakdave for helping out with the Xbox 1 port. + +------------------------------------------------------------------------------ +Websites +------------------------------------------------------------------------------ +Twitter: http://twitter.com/libretro +Source: http://github.com/libretro +Homepage: http://www.libretro.org +IRC: #retroarch (freenode) + +------------------------------------------------------------------------------ diff --git a/dist-scripts/retroarch-xbox1-README.txt b/dist-scripts/retroarch-xbox1-README.txt new file mode 100644 index 0000000000..f60efa1329 --- /dev/null +++ b/dist-scripts/retroarch-xbox1-README.txt @@ -0,0 +1,229 @@ +------------------------------------------------------------------------------ +RETROARCH XBOX 1 - 0.9.8.3 +------------------------------------------------------------------------------ +RetroConsole Level: 1 +Author: Themaister, Squarepusher/Twin Aphex, Freakdave +------------------------------------------------------------------------------ + +------------------------------------------------------------------------------ +HOW TO INSTALL THIS +------------------------------------------------------------------------------ +Copy the entire folder ('RetroArch-XB1') to your harddrive. + +ROMs go into the 'roms' directory, or some subdirectory in the 'RetroArch-XB1' +directory. + +------------------------------------------------------------------------------ +HOW TO USE THIS +------------------------------------------------------------------------------ +On first startup, RetroArch will select one of the dozen or so +emulator/game cores. The name of the core currently loaded will be +shown at the bottom side of the screen. + +You can now select a ROM that this core supports and load it in the Filebrowser. + +There are two ways of selecting a different core: + +1) 'Change Libretro core' in the Main Menu + +Go to the Settings menu by pressing [Select], go forwards two pages by pressing +he [R Trigger] until you come across 'Default libretro core'. Press A to go to +a filebrowser where you can select a different core. Press [A button] to switch +to the emulator/game core. + +2) From the Ingame Menu + +While playing a game, press the [Right Thumb] button. Select 'Change libretro core' +with the [A button] and select a different core. + +------------------------------------------------------------------------------ +INGAME CONTROLS +------------------------------------------------------------------------------ +During ingame operation you can do some extra actions: + +Right Thumb Stick - Down - Fast-forwards the game +Right Thumb Stick - Up - Rewinds the game in real-time + ('Rewind' has to be enabled in the 'Settings' + screen - warning - comes at a slight + performance decrease but will be worth it + if you love this feature) +RStick Left + RT - Decrease save state slot +Rtick Right + RT - Increase save state slot +RStick Up + RT - Load selected save state slot +RStick Down + RT - Save selected save state slot +Right Thumb + Left Thumb - Go back to 'Menu'/'Quick Menu' + +------------------------------------------------------------------------------ +FILE BROWSER EXTRA CONTROLS +------------------------------------------------------------------------------ + +Left Trigger - Go to previous drive mapping +Right Trigger - Go to next drive mapping + +White - Scroll list up +Black - Scroll list down + +------------------------------------------------------------------------------ +WHAT IS RETROARCH? +------------------------------------------------------------------------------ +RetroArch is a modular multi-system emulator system that is designed to +be fast, lightweight and portable. It has features few other emulator +frontends have, such as real-time rewinding and game-aware shading. + +------------------------------------------------------------------------------ +WHAT IS LIBRETRO? +------------------------------------------------------------------------------ +Libretro is the API that RetroArch uses. It makes it easy to port games +and emulators to a single core backend, such as RetroArch. + +For the user, this means - more ports to play with, more crossplatform +portability, less worrying about developers having to reinvent the wheel +writing boilerplate UI/port code - so that they can get busy with writing +the emulator/porting the emulator/game. + +------------------------------------------------------------------------------ +WHAT'S THE BIG DEAL? +------------------------------------------------------------------------------ +Right now it's unique in that it runs the same emulator cores on +multiple systems (such as Xbox 360, Xbox 1, PS3, PC, Wii, etc). + +For each emulator 'core', RetroArch makes use of a library API that we +like to call 'libretro'. + +Think of libretro as an interface for emulator and game ports. You can +make a libretro port once and expect the same code to run on all the +platforms that RetroArch supports. It's designed with simplicity and +ease of use in mind so that the porter can worry about the port at hand +instead of having to wrestle with an obfuscatory API. + +The purpose of libretro is to help ease the work of the emulator/game +porter by giving him an API that allows him to target multiple platforms +at once without having to redo any code. He doesn't have to worry about +writing input/video/audio drivers - all of that is supplied to him by +RetroArch. All he has to do is to have the emulator port hook into the +libretro API and that's it - we take care of the rest. + +------------------------------------------------------------------------------ +XBOX 1 PORT +------------------------------------------------------------------------------ +The Xbox 1 port of RetroArch has the following features: + +- Real-time rewinding. +- Switching between emulator cores seamlessly, and ability to install +new libretro cores + +------------------------------------------------------------------------------ +EMULATOR/GAME CORES BUNDLED WITH XBOX 1 PORT +------------------------------------------------------------------------------ +The following emulators/games have been ported to RetroArch and are included in +the Xbox 1 release of RetroArch. + +For more information about them, see the included +'retroarch-libretro-README.txt' file. + +- Final Burn Alpha (Arcade - various) [version 0.2.97.28] +- Final Burn Alpha Cores (CPS1 - CPS2 - Neo - more) [version 0.2.97.28] (***) +- FCEUmm (Nintendo Entertainment System) [recent SVN version] +- NEStopia (Nintendo Entertainment System) [1.44] +- Gambatte (Game Boy | Super Game Boy | Game Boy Color) [version 0.5.0 WIP] +- Genesis Plus GX (Sega SG-1000 | Master System | Game Gear | Genesis/Mega Drive | + Sega CD) [version 1.7.3] +- SNES9x Next (Super Nintendo/Super Famicom) (v1.52.3) (**) +- VBA Next (Game Boy Advance) (*) +- Prboom (for playing Doom 1/Doom 2/Ultimate Doom/Final Doom) +- Mednafen PCE Fast (PC Engine/PC Engine CD/Turbografx 16) +- Mednafen Wonderswan (WonderSwan/WonderSwan Color/WonderSwan Crystal) +- Mednafen NGP (Neo Geo Pocket Color) + +All of the emulators listed above are the latest versions currently +available. Most of them have been specifically optimized so that +they will run better on Xbox 1 (some games would not reach fullspeed +without these optimizations). + +* - VBA Next doesn't run at fullspeed on Wii (VBA Next is a RetroConsole +Level 2 emulator port). It will be replaced by a port of gpSP in the near +future. +** - SuperFX games will not run at fullspeed - a special version of SNES9x +will be developed for Retro Console Level 1 systems. +*** The biggest Neo-Geo ROMs that can be loaded are around 23+MB in +size, such as Real Bout Fatal Fury 1 and King of Fighters '96. + +------------------------------------------------------------------------------ +WHAT EXTENSIONS ARE SUPPORTED BY EACH CORE +------------------------------------------------------------------------------ +- Prboom WAD|wad +- SNES9x Next smc|fig|sfc|gd3|gd7|dx2|bsx|swc|zip|SMC|FIG|SFC|BSX|GD3| + GD7|DX2|SWC +- Genesis Plus GX md|smd|bin|gen|zip|MD|SMD|bin|GEN|ZIP|sms|SMS|gg|GG|sg|SG| + cue|CUE +- VBA Next GBA|gba +- FCEUmm nes|NES|unif|UNIF +- NEStopia nes|NES|fds|FDS +- Gambatte gb|gbc|dmg|zip|GB|GBC|DMG|ZIP +- Final Burn Alpha zip|ZIP +- Mednafen PCE pce|PCE|cue|CUE +- Mednafen Wonderswan ws|WS|wsc|WSC +- Mednafen PCE pce|PCE|cue|CUE +- Mednafen Wonderswan ws|WS|wsc|WSC +- Mednafen NGP ngp|NGP + +------------------------------------------------------------------------------ +ZIP SUPPORT +------------------------------------------------------------------------------ +Selecting a ZIP file will temporarily unzip that file to the harddrive. The +temporary file will be deleted as soon as the game gets unloaded and/or when +you quit RetroArch. + +NOTE: For the FBA core (and other cores that have 'block_extract' set to +true) - selecting a ZIP file from the Filebrowser will load that game +directly. + +------------------------------------------------------------------------------ +Troubleshooting +------------------------------------------------------------------------------ + +If you find that RetroArch no longer works for whatever reason, there is +a way to get it back to work - + +- Remove retroarch.cfg from the 'Retroarch-XB1' folder, then start up again. +The Libretro management service in RetroArch should automatically pick a +random libretro core and write this to the config file. + +------------------------------------------------------------------------------ +What can you expect in the future? +------------------------------------------------------------------------------ +- Do a Blackberry Playbook/Blackberry 10 RetroArch port +- Do an iOS port of RetroArch (will need hardware for this - gifts appreciated) +- Make the libxenon port release-worthy. +- Add console-friendly features (nicely formatted names for FBA, some better +way to do core switching, etc) +- Fix NxEngine issues on consoles +- Finish up MAME 0.72 port +- Finish up ScummVM port +- Port of VICE to libretro +- More emulators, more games that will run on RetroArch +- Lots of other crazy ideas that might or might not pan out + +------------------------------------------------------------------------------ +Credits +------------------------------------------------------------------------------ +- Mudlord for his Waterpaint/Noise shaders. +- Hyllian for the xBR shader. +- Opium2k for the nice manual shaders (bundled with PS3 release). +- Deank for assistance with RetroArch Salamander on CFW PS3s and + Multiman interoperability. +- FBA devs for adopting the libretro port. +- Ekeeke for help with the Genesis Plus GX port. +- ToadKing for having done a lot of work on RetroArch Wii. +- Freakdave for helping out with the Xbox 1 port. + +------------------------------------------------------------------------------ +Websites +------------------------------------------------------------------------------ +Twitter: http://twitter.com/libretro +Source: http://github.com/libretro +Homepage: http://www.libretro.org +IRC: #retroarch (freenode) + +------------------------------------------------------------------------------ + diff --git a/driver.c b/driver.c index 636579e7cc..471eb50025 100644 --- a/driver.c +++ b/driver.c @@ -22,6 +22,7 @@ #include #include "compat/posix_string.h" #include "audio/utils.h" +#include "audio/resampler.h" #ifdef HAVE_X11 #include "gfx/context/x11_common.h" @@ -408,9 +409,13 @@ void init_audio(void) g_extern.audio_data.chunk_size = g_extern.audio_data.nonblock_chunk_size; } - g_extern.audio_data.source = resampler_new(); - if (!g_extern.audio_data.source) + const char *resampler = *g_settings.audio.resampler ? g_settings.audio.resampler : NULL; + if (!rarch_resampler_realloc(&g_extern.audio_data.resampler_data, &g_extern.audio_data.resampler, + resampler)) + { + RARCH_ERR("Failed to initialize resampler \"%s\".\n", resampler ? resampler : "(default)"); g_extern.audio_active = false; + } rarch_assert(g_extern.audio_data.data = (float*)malloc(max_bufsamples * sizeof(float))); @@ -447,23 +452,23 @@ void init_audio(void) static void compute_audio_buffer_statistics(void) { unsigned samples = min(g_extern.measure_data.buffer_free_samples_count, AUDIO_BUFFER_FREE_SAMPLES_COUNT); - if (samples < 2) + if (samples < 3) return; uint64_t accum = 0; - for (unsigned i = 0; i < samples; i++) + for (unsigned i = 1; i < samples; i++) accum += g_extern.measure_data.buffer_free_samples[i]; - int avg = accum / samples; + int avg = accum / (samples - 1); uint64_t accum_var = 0; - for (unsigned i = 0; i < samples; i++) + for (unsigned i = 1; i < samples; i++) { int diff = avg - g_extern.measure_data.buffer_free_samples[i]; accum_var += diff * diff; } - unsigned stddev = (unsigned)sqrt((double)accum_var / (samples - 1)); + unsigned stddev = (unsigned)sqrt((double)accum_var / (samples - 2)); float avg_filled = 1.0f - (float)avg / g_extern.audio_data.driver_buffer_size; float deviation = (float)stddev / g_extern.audio_data.driver_buffer_size; @@ -473,7 +478,7 @@ static void compute_audio_buffer_statistics(void) unsigned low_water_count = 0; unsigned high_water_count = 0; - for (unsigned i = 0; i < samples; i++) + for (unsigned i = 1; i < samples; i++) { if (g_extern.measure_data.buffer_free_samples[i] >= low_water_size) low_water_count++; @@ -484,41 +489,47 @@ static void compute_audio_buffer_statistics(void) RARCH_LOG("Average audio buffer saturation: %.2f %%, standard deviation (percentage points): %.2f %%.\n", avg_filled * 100.0, deviation * 100.0); RARCH_LOG("Amount of time spent close to underrun: %.2f %%. Close to blocking: %.2f %%.\n", - (100.0 * low_water_count) / samples, - (100.0 * high_water_count) / samples); + (100.0 * low_water_count) / (samples - 1), + (100.0 * high_water_count) / (samples - 1)); } static void compute_monitor_fps_statistics(void) { - unsigned samples = min(g_extern.measure_data.frame_time_samples_count, - MEASURE_FRAME_TIME_SAMPLES_COUNT); - - if (samples < 2) + if (g_extern.measure_data.frame_time_samples_count < 2 * MEASURE_FRAME_TIME_SAMPLES_COUNT) + { + RARCH_LOG("Does not have enough samples for monitor refresh rate estimation. Requires to run for at least %u frames.\n", + 2 * MEASURE_FRAME_TIME_SAMPLES_COUNT); return; + } + + unsigned samples = MEASURE_FRAME_TIME_SAMPLES_COUNT; // Measure statistics on frame time (microsecs), *not* FPS. rarch_time_t accum = 0; for (unsigned i = 0; i < samples; i++) accum += g_extern.measure_data.frame_time_samples[i]; +#if 0 + for (unsigned i = 0; i < samples; i++) + RARCH_LOG("Interval #%u: %d usec / frame.\n", + i, (int)g_extern.measure_data.frame_time_samples[i]); +#endif + rarch_time_t avg = accum / samples; rarch_time_t accum_var = 0; + + // Drop first measurement. It is likely to be bad. for (unsigned i = 0; i < samples; i++) { - rarch_time_t diff = avg - g_extern.measure_data.frame_time_samples[i]; + rarch_time_t diff = g_extern.measure_data.frame_time_samples[i] - avg; accum_var += diff * diff; } double stddev = sqrt((double)accum_var / (samples - 1)); double avg_fps = 1000000.0 / avg; - double max_stddev_fps = 1000000.0 / (avg - stddev); - double stddev_fps = max_stddev_fps - avg_fps; - double sigma_deviation = (g_settings.video.refresh_rate - avg_fps) / stddev_fps; - RARCH_LOG("Average monitor Hz: %.6f Hz. Standard deviation: %.6f Hz (%.3f %% deviation, based on %u last samples).\n", - avg_fps, stddev_fps, 100.0 * stddev_fps / avg_fps, samples); - RARCH_LOG("Configured monitor FPS %.6f Hz deviates %.3f sigma from average.\n", - g_settings.video.refresh_rate, sigma_deviation); + RARCH_LOG("Average monitor Hz: %.6f Hz. (%.3f %% frame time deviation, based on %u last samples).\n", + avg_fps, 100.0 * stddev / avg, samples); } void uninit_audio(void) @@ -539,8 +550,7 @@ void uninit_audio(void) if (driver.audio_data && driver.audio) driver.audio->free(driver.audio_data); - if (g_extern.audio_data.source) - resampler_free(g_extern.audio_data.source); + rarch_resampler_freep(&g_extern.audio_data.resampler, &g_extern.audio_data.resampler_data); free(g_extern.audio_data.data); g_extern.audio_data.data = NULL; diff --git a/dynamic.h b/dynamic.h index 8f46521230..b306a2a532 100644 --- a/dynamic.h +++ b/dynamic.h @@ -29,6 +29,10 @@ #undef NEED_DYNAMIC #endif +#ifdef __cplusplus +extern "C" { +#endif + void init_libretro_sym(void); void uninit_libretro_sym(void); @@ -78,5 +82,9 @@ extern unsigned (*pretro_get_region)(void); extern void *(*pretro_get_memory_data)(unsigned); extern size_t (*pretro_get_memory_size)(unsigned); +#ifdef __cplusplus +} +#endif + #endif diff --git a/frontend/menu/rgui.c b/frontend/menu/rgui.c index 6a7aa43d0a..322c627de9 100644 --- a/frontend/menu/rgui.c +++ b/frontend/menu/rgui.c @@ -463,6 +463,14 @@ static void render_text(rgui_handle_t *rgui) case RGUI_SETTINGS_AUDIO_CONTROL_RATE: snprintf(type_str, sizeof(type_str), "%.3f", g_settings.audio.rate_control_delta); break; + case RGUI_SETTINGS_RESAMPLER_TYPE: +#ifdef HAVE_SINC + if (strstr(g_settings.audio.resampler, "sinc")) + snprintf(type_str, sizeof(type_str), "Sinc"); + else +#endif + snprintf(type_str, sizeof(type_str), "Hermite"); + break; case RGUI_SETTINGS_SRAM_DIR: snprintf(type_str, sizeof(type_str), (g_extern.lifecycle_mode_state & (1ULL << MODE_LOAD_GAME_SRAM_DIR_ENABLE)) ? "ON" : "OFF"); break; @@ -750,6 +758,40 @@ static int rgui_settings_toggle_setting(rgui_file_type_t setting, rgui_action_t else if (action == RGUI_ACTION_RIGHT) rmenu_settings_set(S_AUDIO_CONTROL_RATE_INCREMENT); break; + case RGUI_SETTINGS_RESAMPLER_TYPE: + { + bool changed = false; + if (action == RGUI_ACTION_START) + { +#ifdef HAVE_SINC + snprintf(g_settings.audio.resampler, sizeof(g_settings.audio.resampler), "sinc"); +#else + snprintf(g_settings.audio.resampler, sizeof(g_settings.audio.resampler), "hermite"); +#endif + changed = true; + } + else if (action == RGUI_ACTION_LEFT || action == RGUI_ACTION_RIGHT) + { +#ifdef HAVE_SINC + if( strstr(g_settings.audio.resampler, "hermite")) + snprintf(g_settings.audio.resampler, sizeof(g_settings.audio.resampler), "sinc"); + else +#endif + snprintf(g_settings.audio.resampler, sizeof(g_settings.audio.resampler), "hermite"); + changed = true; + } + + if (g_extern.main_is_init && changed) + { + if (!rarch_resampler_realloc(&g_extern.audio_data.resampler_data, &g_extern.audio_data.resampler, + g_settings.audio.resampler)) + { + RARCH_ERR("Failed to initialize resampler \"%s\".\n", g_settings.audio.resampler); + g_extern.audio_active = false; + } + } + } + break; case RGUI_SETTINGS_SRAM_DIR: if (action == RGUI_ACTION_START || action == RGUI_ACTION_LEFT) g_extern.lifecycle_mode_state &= ~(1ULL << MODE_LOAD_GAME_SRAM_DIR_ENABLE); @@ -879,6 +921,7 @@ static void rgui_settings_populate_entries(rgui_handle_t *rgui) RGUI_MENU_ITEM("Rotation", RGUI_SETTINGS_VIDEO_ROTATION); RGUI_MENU_ITEM("Mute Audio", RGUI_SETTINGS_AUDIO_MUTE); RGUI_MENU_ITEM("Audio Control Rate", RGUI_SETTINGS_AUDIO_CONTROL_RATE); + RGUI_MENU_ITEM("Audio Resampler", RGUI_SETTINGS_RESAMPLER_TYPE); RGUI_MENU_ITEM("SRAM Saves in \"sram\" Dir", RGUI_SETTINGS_SRAM_DIR); RGUI_MENU_ITEM("State Saves in \"state\" Dir", RGUI_SETTINGS_STATE_DIR); RGUI_MENU_ITEM("Core", RGUI_SETTINGS_CORE); diff --git a/frontend/menu/rgui.h b/frontend/menu/rgui.h index 4fa0216b91..e6be443ad6 100644 --- a/frontend/menu/rgui.h +++ b/frontend/menu/rgui.h @@ -54,6 +54,7 @@ typedef enum RGUI_SETTINGS_VIDEO_ROTATION, RGUI_SETTINGS_AUDIO_MUTE, RGUI_SETTINGS_AUDIO_CONTROL_RATE, + RGUI_SETTINGS_RESAMPLER_TYPE, RGUI_SETTINGS_ZIP_EXTRACT, RGUI_SETTINGS_SRAM_DIR, RGUI_SETTINGS_STATE_DIR, diff --git a/frontend/menu/rmenu.c b/frontend/menu/rmenu.c index be91002d69..91b23db716 100644 --- a/frontend/menu/rmenu.c +++ b/frontend/menu/rmenu.c @@ -290,6 +290,21 @@ static void populate_setting_item(void *data, unsigned input) snprintf(current_item->setting_text, sizeof(current_item->setting_text), ""); snprintf(current_item->comment, sizeof(current_item->comment), "INFO - Set all [General Audio Settings] back to their 'DEFAULT' values."); break; + case SETTING_RESAMPLER_TYPE: + snprintf(current_item->text, sizeof(current_item->text), "Sound resampler"); +#ifdef HAVE_SINC + if (strstr(g_settings.audio.resampler, "sinc")) + { + snprintf(current_item->setting_text, sizeof(current_item->setting_text), "Sinc"); + snprintf(current_item->comment, sizeof(current_item->comment), "INFO - [Sinc resampler] - slightly slower but better sound quality at high frequencies."); + } + else +#endif + { + snprintf(current_item->setting_text, sizeof(current_item->setting_text), "Hermite"); + snprintf(current_item->comment, sizeof(current_item->comment), "INFO - [Hermite resampler] - faster but less accurate at high frequencies."); + } + break; case SETTING_EMU_CURRENT_SAVE_STATE_SLOT: snprintf(current_item->text, sizeof(current_item->text), "Current save state slot"); snprintf(current_item->setting_text, sizeof(current_item->setting_text), "%d", g_extern.state_slot); @@ -922,6 +937,7 @@ static bool osk_callback_enter_filename(void *data) RARCH_LOG("[osk_callback_enter_filename]: filepath is: %s.\n", filepath); struct gl_cg_cgp_info current_settings; + memset(¤t_settings, 0, sizeof(current_settings)); current_settings.shader[0] = g_settings.video.cg_shader_path; current_settings.shader[1] = g_settings.video.second_pass_shader; current_settings.filter_linear[0] = g_settings.video.smooth; @@ -1310,9 +1326,12 @@ static int set_setting_action(void *data, unsigned switchvalue, uint64_t input) #ifdef HAVE_OSKUTIL if((input & (1ULL << RMENU_DEVICE_NAV_LEFT)) || (input & (1ULL << RMENU_DEVICE_NAV_RIGHT)) || (input & (1ULL << RMENU_DEVICE_NAV_B))) { - rmenu_state.osk_param = SHADER_PRESET_FILE; - rmenu_state.osk_init = osk_callback_enter_filename_init; - rmenu_state.osk_callback = osk_callback_enter_filename; + if(g_extern.main_is_init) + { + rmenu_state.osk_param = SHADER_PRESET_FILE; + rmenu_state.osk_init = osk_callback_enter_filename_init; + rmenu_state.osk_callback = osk_callback_enter_filename; + } } #endif break; @@ -1320,6 +1339,11 @@ static int set_setting_action(void *data, unsigned switchvalue, uint64_t input) break; #endif case SETTING_DEFAULT_VIDEO_ALL: + if(input & (1ULL << RMENU_DEVICE_NAV_START)) + { + set_setting_action(NULL, SETTING_SHADER, 1ULL << RMENU_DEVICE_NAV_START); + set_setting_action(NULL, SETTING_SHADER_2, 1ULL << RMENU_DEVICE_NAV_START); + } break; case SETTING_SOUND_MODE: if(input & (1ULL << RMENU_DEVICE_NAV_LEFT)) @@ -1425,6 +1449,46 @@ static int set_setting_action(void *data, unsigned switchvalue, uint64_t input) return -1; } break; + case SETTING_RESAMPLER_TYPE: + if((input & (1ULL << RMENU_DEVICE_NAV_LEFT)) || (input & (1ULL << RMENU_DEVICE_NAV_RIGHT)) || (input & (1ULL << RMENU_DEVICE_NAV_B))) + { +#ifdef HAVE_SINC + if( strstr(g_settings.audio.resampler, "hermite")) + snprintf(g_settings.audio.resampler, sizeof(g_settings.audio.resampler), "sinc"); + else +#endif + snprintf(g_settings.audio.resampler, sizeof(g_settings.audio.resampler), "hermite"); + + if (g_extern.main_is_init) + { + if (!rarch_resampler_realloc(&g_extern.audio_data.resampler_data, &g_extern.audio_data.resampler, + g_settings.audio.resampler)) + { + RARCH_ERR("Failed to initialize resampler \"%s\".\n", g_settings.audio.resampler); + g_extern.audio_active = false; + } + } + + } + if(input & (1ULL << RMENU_DEVICE_NAV_START)) + { +#ifdef HAVE_SINC + snprintf(g_settings.audio.resampler, sizeof(g_settings.audio.resampler), "sinc"); +#else + snprintf(g_settings.audio.resampler, sizeof(g_settings.audio.resampler), "hermite"); +#endif + + if (g_extern.main_is_init) + { + if (!rarch_resampler_realloc(&g_extern.audio_data.resampler_data, &g_extern.audio_data.resampler, + g_settings.audio.resampler)) + { + RARCH_ERR("Failed to initialize resampler \"%s\".\n", g_settings.audio.resampler); + g_extern.audio_active = false; + } + } + } + break; case SETTING_EMU_AUDIO_MUTE: if((input & (1ULL << RMENU_DEVICE_NAV_LEFT)) || (input & (1ULL << RMENU_DEVICE_NAV_RIGHT)) || (input & (1ULL << RMENU_DEVICE_NAV_B))) rmenu_settings_set(S_AUDIO_MUTE); diff --git a/frontend/menu/rmenu.h b/frontend/menu/rmenu.h index ab51cc6dc5..7fa62d64fa 100644 --- a/frontend/menu/rmenu.h +++ b/frontend/menu/rmenu.h @@ -134,6 +134,7 @@ enum #ifdef HAVE_RSOUND SETTING_RSOUND_SERVER_IP_ADDRESS, #endif + SETTING_RESAMPLER_TYPE, SETTING_ENABLE_CUSTOM_BGM, SETTING_DEFAULT_AUDIO_ALL, SETTING_EMU_CURRENT_SAVE_STATE_SLOT, diff --git a/frontend/menu/rmenu_xui.cpp b/frontend/menu/rmenu_xui.cpp index a0d3dda60a..15ad810c5a 100644 --- a/frontend/menu/rmenu_xui.cpp +++ b/frontend/menu/rmenu_xui.cpp @@ -396,6 +396,7 @@ HRESULT CRetroArchSettings::OnInit(XUIMessageInit * pInitData, BOOL& bHandled) m_settingslist.SetText(SETTING_EMU_SHOW_INFO_MSG, (g_extern.lifecycle_mode_state & (1ULL << MODE_INFO_DRAW)) ? L"Info messages: ON" : L"Info messages: OFF"); m_settingslist.SetText(SETTING_EMU_SHOW_DEBUG_INFO_MSG, (g_extern.lifecycle_mode_state & (1ULL << MODE_FPS_DRAW)) ? L"Debug Info messages: ON" : L"Debug Info messages: OFF"); m_settingslist.SetText(SETTING_GAMMA_CORRECTION_ENABLED, g_extern.console.screen.gamma_correction ? L"Gamma correction: ON" : L"Gamma correction: OFF"); + m_settingslist.SetText(SETTING_AUDIO_RESAMPLER_TYPE, strstr(g_settings.audio.resampler, "sinc") ? L"Audio Resampler: Sinc" : L"Audio Resampler: Hermite"); m_settingslist.SetText(SETTING_HW_TEXTURE_FILTER, g_settings.video.smooth ? L"Hardware filtering shader #1: Linear interpolation" : L"Hardware filtering shader #1: Point filtering"); m_settingslist.SetText(SETTING_HW_TEXTURE_FILTER_2, g_settings.video.second_pass_smooth ? L"Hardware filtering shader #2: Linear interpolation" : L"Hardware filtering shader #2: Point filtering"); m_settingslist.SetText(SETTING_SCALE_ENABLED, g_settings.video.render_to_texture ? L"Custom Scaling/Dual Shaders: ON" : L"Custom Scaling/Dual Shaders: OFF"); @@ -467,6 +468,25 @@ HRESULT CRetroArchSettings::OnNotifyPress( HXUIOBJ hObjPressed, int & bHandled g_extern.lifecycle_mode_state |= (1ULL << MODE_FPS_DRAW); m_settingslist.SetText(SETTING_EMU_SHOW_DEBUG_INFO_MSG, (g_extern.lifecycle_mode_state & (1ULL << MODE_FPS_DRAW)) ? L"Debug Info messages: ON" : L"Debug Info messages: OFF"); break; + case SETTING_AUDIO_RESAMPLER_TYPE: +#ifdef HAVE_SINC + if( strstr(g_settings.audio.resampler, "hermite")) + snprintf(g_settings.audio.resampler, sizeof(g_settings.audio.resampler), "sinc"); + else +#endif + snprintf(g_settings.audio.resampler, sizeof(g_settings.audio.resampler), "hermite"); + m_settingslist.SetText(SETTING_AUDIO_RESAMPLER_TYPE, strstr(g_settings.audio.resampler, "sinc") ? L"Audio Resampler: Sinc" : L"Audio Resampler: Hermite"); + + if (g_extern.main_is_init) + { + if (!rarch_resampler_realloc(&g_extern.audio_data.resampler_data, &g_extern.audio_data.resampler, + g_settings.audio.resampler)) + { + RARCH_ERR("Failed to initialize resampler \"%s\".\n", g_settings.audio.resampler); + g_extern.audio_active = false; + } + } + break; case SETTING_GAMMA_CORRECTION_ENABLED: g_extern.console.screen.gamma_correction = g_extern.console.screen.gamma_correction ? 0 : 1; driver.video->restart(); @@ -577,6 +597,25 @@ HRESULT CRetroArchSettings::OnControlNavigate(XUIMessageControlNavigate *pContro g_extern.lifecycle_mode_state |= (1ULL << MODE_FPS_DRAW); m_settingslist.SetText(SETTING_EMU_SHOW_DEBUG_INFO_MSG, (g_extern.lifecycle_mode_state & (1ULL << MODE_FPS_DRAW)) ? L"Debug Info messages: ON" : L"Debug Info messages: OFF"); break; + case SETTING_AUDIO_RESAMPLER_TYPE: +#ifdef HAVE_SINC + if( strstr(g_settings.audio.resampler, "hermite")) + snprintf(g_settings.audio.resampler, sizeof(g_settings.audio.resampler), "sinc"); + else +#endif + snprintf(g_settings.audio.resampler, sizeof(g_settings.audio.resampler), "hermite"); + m_settingslist.SetText(SETTING_AUDIO_RESAMPLER_TYPE, strstr(g_settings.audio.resampler, "sinc") ? L"Audio Resampler: Sinc" : L"Audio Resampler: Hermite"); + + if (g_extern.main_is_init) + { + if (!rarch_resampler_realloc(&g_extern.audio_data.resampler_data, &g_extern.audio_data.resampler, + g_settings.audio.resampler)) + { + RARCH_ERR("Failed to initialize resampler \"%s\".\n", g_settings.audio.resampler); + g_extern.audio_active = false; + } + } + break; case SETTING_GAMMA_CORRECTION_ENABLED: g_extern.console.screen.gamma_correction = g_extern.console.screen.gamma_correction ? 0 : 1; driver.video->restart(); @@ -631,6 +670,25 @@ HRESULT CRetroArchSettings::OnControlNavigate(XUIMessageControlNavigate *pContro g_extern.lifecycle_mode_state |= (1ULL << MODE_FPS_DRAW); m_settingslist.SetText(SETTING_EMU_SHOW_DEBUG_INFO_MSG, (g_extern.lifecycle_mode_state & (1ULL << MODE_FPS_DRAW)) ? L"Debug Info messages: ON" : L"Debug Info messages: OFF"); break; + case SETTING_AUDIO_RESAMPLER_TYPE: +#ifdef HAVE_SINC + if( strstr(g_settings.audio.resampler, "hermite")) + snprintf(g_settings.audio.resampler, sizeof(g_settings.audio.resampler), "sinc"); + else +#endif + snprintf(g_settings.audio.resampler, sizeof(g_settings.audio.resampler), "hermite"); + m_settingslist.SetText(SETTING_AUDIO_RESAMPLER_TYPE, strstr(g_settings.audio.resampler, "sinc") ? L"Audio Resampler: Sinc" : L"Audio Resampler: Hermite"); + + if (g_extern.main_is_init) + { + if (!rarch_resampler_realloc(&g_extern.audio_data.resampler_data, &g_extern.audio_data.resampler, + g_settings.audio.resampler)) + { + RARCH_ERR("Failed to initialize resampler \"%s\".\n", g_settings.audio.resampler); + g_extern.audio_active = false; + } + } + break; case SETTING_GAMMA_CORRECTION_ENABLED: g_extern.console.screen.gamma_correction = g_extern.console.screen.gamma_correction ? 0 : 1; driver.video->restart(); diff --git a/frontend/menu/rmenu_xui.h b/frontend/menu/rmenu_xui.h index d5215646fa..edcdbf1516 100644 --- a/frontend/menu/rmenu_xui.h +++ b/frontend/menu/rmenu_xui.h @@ -26,6 +26,7 @@ enum SETTING_EMU_REWIND_GRANULARITY, SETTING_EMU_SHOW_INFO_MSG, SETTING_EMU_SHOW_DEBUG_INFO_MSG, + SETTING_AUDIO_RESAMPLER_TYPE, SETTING_GAMMA_CORRECTION_ENABLED, SETTING_SHADER, SETTING_SHADER_2, diff --git a/general.h b/general.h index 6b5272dc9c..e6bfa575fe 100644 --- a/general.h +++ b/general.h @@ -95,6 +95,10 @@ #include "audio/resampler.h" +#ifdef __cplusplus +extern "C" { +#endif + #define MAX_PLAYERS 8 enum dpad_emu_enums @@ -217,6 +221,8 @@ struct settings bool rate_control; float rate_control_delta; float volume; // dB scale + + char resampler[32]; } audio; struct @@ -229,6 +235,8 @@ struct settings bool debug_enable; #ifdef ANDROID bool autodetect_enable; + unsigned icade_profile[MAX_PLAYERS]; + unsigned icade_count; #endif #ifdef RARCH_CONSOLE uint64_t default_binds[RARCH_CUSTOM_BIND_LIST_END]; @@ -373,7 +381,8 @@ struct global struct { - rarch_resampler_t *source; + void *resampler_data; + const rarch_resampler_t *resampler; float *data; @@ -413,7 +422,7 @@ struct global unsigned buffer_free_samples[AUDIO_BUFFER_FREE_SAMPLES_COUNT]; uint64_t buffer_free_samples_count; -#define MEASURE_FRAME_TIME_SAMPLES_COUNT 256 +#define MEASURE_FRAME_TIME_SAMPLES_COUNT (2 * 1024) rarch_time_t frame_time_samples[MEASURE_FRAME_TIME_SAMPLES_COUNT]; uint64_t frame_time_samples_count; } measure_data; @@ -649,6 +658,10 @@ extern struct settings g_settings; extern struct global g_extern; ///////// +#ifdef __cplusplus +} +#endif + #include "retroarch_logger.h" #ifndef max diff --git a/gfx/gfx_common.c b/gfx/gfx_common.c index aace2f90a1..c70bf7af70 100644 --- a/gfx/gfx_common.c +++ b/gfx/gfx_common.c @@ -23,43 +23,49 @@ static float time_to_fps(rarch_time_t last_time, rarch_time_t new_time, int fram return (1000000.0f * frames) / (new_time - last_time); } +#define FPS_UPDATE_INTERVAL 256 bool gfx_get_fps(char *buf, size_t size, bool always_write) { static rarch_time_t time; + static rarch_time_t fps_time; static float last_fps; bool ret = false; + *buf = '\0'; - if (g_extern.frame_count == 0) + rarch_time_t new_time = rarch_get_time_usec(); + if (g_extern.frame_count) { - time = rarch_get_time_usec(); - snprintf(buf, size, "%s", g_extern.title_buf); - ret = true; - } - else if ((g_extern.frame_count % 180) == 0) - { - rarch_time_t new_time = rarch_get_time_usec(); - last_fps = time_to_fps(time, new_time, 180); - unsigned write_index = g_extern.measure_data.frame_time_samples_count++ & (MEASURE_FRAME_TIME_SAMPLES_COUNT - 1); - g_extern.measure_data.frame_time_samples[write_index] = (new_time - time) / 180; + g_extern.measure_data.frame_time_samples[write_index] = new_time - fps_time; + fps_time = new_time; - time = new_time; + if ((g_extern.frame_count % FPS_UPDATE_INTERVAL) == 0) + { + last_fps = time_to_fps(time, new_time, FPS_UPDATE_INTERVAL); + time = new_time; #ifdef RARCH_CONSOLE - snprintf(buf, size, "FPS: %6.1f || Frames: %d", last_fps, g_extern.frame_count); + snprintf(buf, size, "FPS: %6.1f || Frames: %d", last_fps, g_extern.frame_count); #else - snprintf(buf, size, "%s || FPS: %6.1f || Frames: %d", g_extern.title_buf, last_fps, g_extern.frame_count); + snprintf(buf, size, "%s || FPS: %6.1f || Frames: %d", g_extern.title_buf, last_fps, g_extern.frame_count); #endif - ret = true; + ret = true; + } + else if (always_write) + { +#ifdef RARCH_CONSOLE + snprintf(buf, size, "FPS: %6.1f || Frames: %d", last_fps, g_extern.frame_count); +#else + snprintf(buf, size, "%s || FPS: %6.1f || Frames: %d", g_extern.title_buf, last_fps, g_extern.frame_count); +#endif + } } - else if (always_write) + else { -#ifdef RARCH_CONSOLE - snprintf(buf, size, "FPS: %6.1f || Frames: %d", last_fps, g_extern.frame_count); -#else - snprintf(buf, size, "%s || FPS: %6.1f || Frames: %d", g_extern.title_buf, last_fps, g_extern.frame_count); -#endif + time = fps_time = new_time; + snprintf(buf, size, "%s", g_extern.title_buf); + ret = true; } return ret; diff --git a/gfx/gl.c b/gfx/gl.c index c054b6ba5a..62c4670a52 100644 --- a/gfx/gl.c +++ b/gfx/gl.c @@ -566,16 +566,22 @@ void gl_init_fbo(void *data, unsigned width, unsigned height) gl_t *gl = (gl_t*)data; // No need to use FBOs. +#ifndef RARCH_CONSOLE + /* we always want FBO to be at least initialized on startup for consoles */ if (!g_settings.video.render_to_texture && gl_shader_num_func(gl) == 0) return; +#endif struct gl_fbo_scale scale, scale_last; gl_shader_scale(gl, 1, &scale); gl_shader_scale(gl, gl_shader_num_func(gl), &scale_last); // No need to use FBOs. +#ifndef RARCH_CONSOLE + /* we always want FBO to be at least initialized on startup for consoles */ if (gl_shader_num_func(gl) == 1 && !scale.valid && !g_settings.video.render_to_texture) return; +#endif if (!load_fbo_proc(gl)) { @@ -1930,6 +1936,9 @@ static void gl_start(void) #ifdef RARCH_CONSOLE // Comes too early for console - moved to gl_start gl->font_ctx = gl_font_init_first(gl, g_settings.video.font_path, g_settings.video.font_size); + + if (!g_settings.video.render_to_texture) + gl_deinit_fbo(gl); #endif context_get_available_resolutions_func(); diff --git a/gfx/rpng/rpng.h b/gfx/rpng/rpng.h index 32de0581dc..d2adb73b34 100644 --- a/gfx/rpng/rpng.h +++ b/gfx/rpng/rpng.h @@ -23,6 +23,10 @@ #include "../../config.h" #endif +#ifdef __cplusplus +extern "C" { +#endif + bool rpng_load_image_argb(const char *path, uint32_t **data, unsigned *width, unsigned *height); #ifdef HAVE_ZLIB_DEFLATE @@ -32,5 +36,9 @@ bool rpng_save_image_bgr24(const char *path, const uint8_t *data, unsigned width, unsigned height, unsigned pitch); #endif +#ifdef __cplusplus +} +#endif + #endif diff --git a/gfx/scaler/scaler_int.c b/gfx/scaler/scaler_int.c index ee807ed01e..334229eda2 100644 --- a/gfx/scaler/scaler_int.c +++ b/gfx/scaler/scaler_int.c @@ -21,6 +21,9 @@ #if defined(__SSE2__) #include +#ifdef _WIN32 +#include +#endif #endif static inline uint64_t build_argb64(uint16_t a, uint16_t r, uint16_t g, uint16_t b) diff --git a/gfx/shader_cg.c b/gfx/shader_cg.c index 1a482eae9a..424912e76e 100644 --- a/gfx/shader_cg.c +++ b/gfx/shader_cg.c @@ -484,7 +484,11 @@ static bool load_plain(const char *path) if (!load_program(1, path, true)) return false; - if (*g_settings.video.second_pass_shader && g_settings.video.render_to_texture) + if (*g_settings.video.second_pass_shader +#ifndef RARCH_CONSOLE + && g_settings.video.render_to_texture +#endif + ) { if (!load_program(2, g_settings.video.second_pass_shader, true)) return false; @@ -797,6 +801,22 @@ static bool load_shader(const char *cgp_path, unsigned i, config_file_t *conf) if (!load_program(i + 1, path_buf, true)) return false; +#ifdef HAVE_RMENU + // In RMenu, need to display shaders in menu. + switch (i) + { + case 0: + strlcpy(g_settings.video.cg_shader_path, + path_buf, sizeof(g_settings.video.cg_shader_path)); + break; + + case 1: + strlcpy(g_settings.video.second_pass_shader, + path_buf, sizeof(g_settings.video.second_pass_shader)); + break; + } +#endif + return true; } @@ -930,6 +950,16 @@ static bool load_shader_params(unsigned i, config_file_t *conf) } } +#ifdef HAVE_RMENU + // In RMenu, need to set FBO scaling factors for first pass. + if (i == 0 && scale->type_x == RARCH_SCALE_INPUT && scale->type_y && RARCH_SCALE_INPUT + && scale->scale_x == scale->scale_y) + { + g_settings.video.fbo.scale_x = scale->scale_x; + g_settings.video.fbo.scale_y = scale->scale_y; + } +#endif + end: free(scale_type); free(scale_type_x); @@ -989,6 +1019,20 @@ static bool load_preset(const char *path) print_buf(filter_name_buf, "filter_linear%u", i); if (config_get_bool(conf, filter_name_buf, &smooth)) fbo_smooth[i + 1] = smooth ? FILTER_LINEAR : FILTER_NEAREST; + +#ifdef HAVE_RMENU + // In RMenu, need to set smoothing for first and second passes. + switch (i) + { + case 0: + g_settings.video.smooth = fbo_smooth[1]; + break; + + case 1: + g_settings.video.second_pass_smooth = fbo_smooth[2]; + break; + } +#endif } for (int i = 0; i < shaders; i++) diff --git a/gx/gx_video.c b/gx/gx_video.c index 79470d5749..25cb678a86 100644 --- a/gx/gx_video.c +++ b/gx/gx_video.c @@ -116,29 +116,25 @@ void gx_set_video_mode(unsigned fbWidth, unsigned lines) bool progressive = VIDEO_HaveComponentCable(); unsigned tvmode = VIDEO_GetCurrentTvMode(); #endif - unsigned max_width, max_height, max_xfb_height; + unsigned max_width, max_height; switch (tvmode) { case VI_PAL: max_width = VI_MAX_WIDTH_PAL; - max_height = VI_MAX_HEIGHT_PAL; - max_xfb_height = 574; + max_height = /* VI_MAX_HEIGHT_PAL */ 574; break; case VI_MPAL: max_width = VI_MAX_WIDTH_MPAL; max_height = VI_MAX_HEIGHT_MPAL; - max_xfb_height = 574; break; case VI_EURGB60: max_width = VI_MAX_WIDTH_NTSC; max_height = VI_MAX_HEIGHT_NTSC; - max_xfb_height = 480; break; default: tvmode = VI_NTSC; max_width = VI_MAX_WIDTH_EURGB60; max_height = VI_MAX_HEIGHT_EURGB60; - max_xfb_height = 480; break; } @@ -170,10 +166,10 @@ void gx_set_video_mode(unsigned fbWidth, unsigned lines) gx_mode.fbWidth = fbWidth; gx_mode.efbHeight = min(lines, 480); - if (modetype == VI_NON_INTERLACE && lines > max_xfb_height / 2) - gx_mode.xfbHeight = max_xfb_height / 2; - else if (modetype != VI_NON_INTERLACE && lines > max_xfb_height) - gx_mode.xfbHeight = max_xfb_height; + if (modetype == VI_NON_INTERLACE && lines > max_height / 2) + gx_mode.xfbHeight = max_height / 2; + else if (modetype != VI_NON_INTERLACE && lines > max_height) + gx_mode.xfbHeight = max_height; else gx_mode.xfbHeight = lines; @@ -316,9 +312,9 @@ static void init_texture(unsigned width, unsigned height) unsigned g_filter = g_settings.video.smooth ? GX_LINEAR : GX_NEAR; GX_InitTexObj(&g_tex.obj, g_tex.data, width, height, (gx->rgb32) ? GX_TF_RGBA8 : (g_extern.lifecycle_mode_state & (1ULL << MODE_MENU_DRAW)) ? GX_TF_RGB5A3 : GX_TF_RGB565, GX_CLAMP, GX_CLAMP, GX_FALSE); - GX_InitTexObjLOD(&g_tex.obj, g_filter, GX_NEAR_MIP_NEAR, 0, 0, 0, GX_TRUE, GX_FALSE, GX_ANISO_1); + GX_InitTexObjLOD(&g_tex.obj, g_filter, g_filter, 0, 0, 0, GX_TRUE, GX_FALSE, GX_ANISO_1); GX_InitTexObj(&menu_tex.obj, menu_tex.data, RGUI_WIDTH, RGUI_HEIGHT, GX_TF_RGB5A3, GX_CLAMP, GX_CLAMP, GX_FALSE); - GX_InitTexObjLOD(&menu_tex.obj, g_filter, GX_NEAR_MIP_NEAR, 0, 0, 0, GX_TRUE, GX_FALSE, GX_ANISO_1); + GX_InitTexObjLOD(&menu_tex.obj, g_filter, g_filter, 0, 0, 0, GX_TRUE, GX_FALSE, GX_ANISO_1); GX_InvalidateTexAll(); } diff --git a/hash.h b/hash.h index 8d5266564e..3fd6abb023 100644 --- a/hash.h +++ b/hash.h @@ -19,6 +19,7 @@ #include #include +#include "msvc/msvc_compat.h" #ifdef HAVE_CONFIG_H #include "config.h" #endif diff --git a/media/360/hd/rarch_settings.xui b/media/360/hd/rarch_settings.xui index 22ef8bee6e..b2468419c0 100644 --- a/media/360/hd/rarch_settings.xui +++ b/media/360/hd/rarch_settings.xui @@ -34,6 +34,7 @@ Rewind granularity: Info messages: Debug info messages: +Audio Resampler: Gamma Correction: Shader #1: Shader #2: diff --git a/media/360/sd/rarch_settings.xui b/media/360/sd/rarch_settings.xui index 32dff11fcf..a43371eec9 100644 --- a/media/360/sd/rarch_settings.xui +++ b/media/360/sd/rarch_settings.xui @@ -34,6 +34,7 @@ Rewind granularity: Info messages: Debug info messages: +Audio Resampler: Gamma Correction: Shader #1: Shader #2: diff --git a/msvc/RetroArch-360/RetroArch-360.vcxproj b/msvc/RetroArch-360/RetroArch-360.vcxproj index ee4b90be7b..d5c2f6b889 100644 --- a/msvc/RetroArch-360/RetroArch-360.vcxproj +++ b/msvc/RetroArch-360/RetroArch-360.vcxproj @@ -113,7 +113,7 @@ true false MultiThreadedDebug - _DEBUG;_XBOX;HAVE_XINPUT2;PACKAGE_VERSION="0.9.8";%(PreprocessorDefinitions);HAVE_DEFAULT_RETROPAD_INPUT;_CRT_SECURE_NO_WARNINGS;main=rarch_main;RARCH_CONSOLE;HAVE_RMENU;HAVE_FILEBROWSER;HAVE_NETPLAY;HAVE_SOCKET_LEGACY;HAVE_ZLIB;HAVE_RARCH_MAIN_WRAP;HAVE_RARCH_EXEC;HAVE_LIBRETRO_MANAGEMENT;D3DCOMPILE_USEVOIDS;HAVE_GRIFFIN;HAVE_HLSL;HAVE_VID_CONTEXT;HAVE_D3D9;_XBOX360;HAVE_FBO;HAVE_SCREENSHOTS;WANT_RZLIB;HAVE_XAUDIO + _DEBUG;_XBOX;HAVE_XINPUT2;PACKAGE_VERSION="0.9.8.3";%(PreprocessorDefinitions);HAVE_DEFAULT_RETROPAD_INPUT;_CRT_SECURE_NO_WARNINGS;main=rarch_main;RARCH_CONSOLE;HAVE_RMENU;HAVE_FILEBROWSER;HAVE_NETPLAY;HAVE_SOCKET_LEGACY;HAVE_ZLIB;HAVE_RARCH_MAIN_WRAP;HAVE_RARCH_EXEC;HAVE_LIBRETRO_MANAGEMENT;D3DCOMPILE_USEVOIDS;HAVE_GRIFFIN;HAVE_HLSL;HAVE_VID_CONTEXT;HAVE_D3D9;_XBOX360;HAVE_FBO;HAVE_SCREENSHOTS;WANT_RZLIB;HAVE_SINC;SINC_LOWER_QUALITY;HAVE_XAUDIO Callcap @@ -151,7 +151,7 @@ AnalyzeOnly false MultiThreadedDebug - _DEBUG;_XBOX;%(PreprocessorDefinitions);HAVE_XINPUT2;PACKAGE_VERSION="0.9.8";HAVE_DEFAULT_RETROPAD_INPUT;_CRT_SECURE_NO_WARNINGS;main=rarch_main;HAVE_FILEBROWSER;RARCH_CONSOLE;HAVE_RMENU;HAVE_ZLIB;HAVE_RARCH_MAIN_WRAP;HAVE_RARCH_EXEC;HAVE_LIBRETRO_MANAGEMENT;D3DCOMPILE_USEVOIDS;HAVE_GRIFFIN;HAVE_HLSL;HAVE_VID_CONTEXT;HAVE_D3D9;_XBOX360;HAVE_FBO;HAVE_SCREENSHOTS;WANT_RZLIB + _DEBUG;_XBOX;%(PreprocessorDefinitions);HAVE_XINPUT2;PACKAGE_VERSION="0.9.8.3";HAVE_DEFAULT_RETROPAD_INPUT;_CRT_SECURE_NO_WARNINGS;main=rarch_main;HAVE_FILEBROWSER;RARCH_CONSOLE;HAVE_RMENU;HAVE_ZLIB;HAVE_RARCH_MAIN_WRAP;HAVE_RARCH_EXEC;HAVE_LIBRETRO_MANAGEMENT;D3DCOMPILE_USEVOIDS;HAVE_GRIFFIN;HAVE_HLSL;HAVE_VID_CONTEXT;HAVE_D3D9;_XBOX360;HAVE_FBO;HAVE_SCREENSHOTS;WANT_RZLIB;HAVE_SINC;SINC_LOWER_QUALITY Callcap @@ -190,7 +190,7 @@ Size false MultiThreaded - NDEBUG;_XBOX;PROFILE;%(PreprocessorDefinitions);HAVE_XINPUT2;PACKAGE_VERSION="0.9.8";HAVE_DEFAULT_RETROPAD_INPUT;_CRT_SECURE_NO_WARNINGS;RARCH_CONSOLE;HAVE_RMENU;main=rarch_main;HAVE_FILEBROWSER;HAVE_ZLIB;HAVE_RARCH_MAIN_WRAP;HAVE_RARCH_EXEC;HAVE_LIBRETRO_MANAGEMENT;D3DCOMPILE_USEVOIDS;HAVE_GRIFFIN;HAVE_HLSL;HAVE_VID_CONTEXT;HAVE_D3D9;_XBOX360;HAVE_FBO;HAVE_SCREENSHOTS;WANT_RZLIB;HAVE_XAUDIO + NDEBUG;_XBOX;PROFILE;%(PreprocessorDefinitions);HAVE_XINPUT2;PACKAGE_VERSION="0.9.8.3";HAVE_DEFAULT_RETROPAD_INPUT;_CRT_SECURE_NO_WARNINGS;RARCH_CONSOLE;HAVE_RMENU;main=rarch_main;HAVE_FILEBROWSER;HAVE_ZLIB;HAVE_RARCH_MAIN_WRAP;HAVE_RARCH_EXEC;HAVE_LIBRETRO_MANAGEMENT;D3DCOMPILE_USEVOIDS;HAVE_GRIFFIN;HAVE_HLSL;HAVE_VID_CONTEXT;HAVE_D3D9;_XBOX360;HAVE_FBO;HAVE_SCREENSHOTS;WANT_RZLIB;HAVE_SINC;SINC_LOWER_QUALITY;HAVE_XAUDIO Callcap @@ -234,7 +234,7 @@ Size false MultiThreaded - NDEBUG;_XBOX;PROFILE;FASTCAP;%(PreprocessorDefinitions);HAVE_XINPUT2;PACKAGE_VERSION="0.9.8";HAVE_DEFAULT_RETROPAD_INPUT;_CRT_SECURE_NO_WARNINGS;main=rarch_main;HAVE_FILEBROWSER;HAVE_ZLIB;HAVE_RARCH_MAIN_WRAP;HAVE_RARCH_EXEC;HAVE_LIBRETRO_MANAGEMENT;D3DCOMPILE_USEVOIDS;HAVE_GRIFFIN;HAVE_HLSL;HAVE_VID_CONTEXT;HAVE_D3D9;_XBOX360;HAVE_FBO;HAVE_SCREENSHOTS;WANT_RZLIB;HAVE_RMENU;HAVE_XAUDIO + NDEBUG;_XBOX;PROFILE;FASTCAP;%(PreprocessorDefinitions);HAVE_XINPUT2;PACKAGE_VERSION="0.9.8.3";HAVE_DEFAULT_RETROPAD_INPUT;_CRT_SECURE_NO_WARNINGS;main=rarch_main;HAVE_FILEBROWSER;HAVE_ZLIB;HAVE_RARCH_MAIN_WRAP;HAVE_RARCH_EXEC;HAVE_LIBRETRO_MANAGEMENT;D3DCOMPILE_USEVOIDS;HAVE_GRIFFIN;HAVE_HLSL;HAVE_VID_CONTEXT;HAVE_D3D9;_XBOX360;HAVE_FBO;HAVE_SCREENSHOTS;WANT_RZLIB;HAVE_SINC;SINC_LOWER_QUALITY;HAVE_RMENU;HAVE_XAUDIO true @@ -275,7 +275,7 @@ false false MultiThreaded - NDEBUG;_XBOX;%(PreprocessorDefinitions);HAVE_XINPUT2;PACKAGE_VERSION="0.9.8";_CRT_SECURE_NO_WARNINGS;HAVE_DEFAULT_RETROPAD_INPUT;main=rarch_main;RARCH_CONSOLE=1;HAVE_FILEBROWSER;HAVE_NETPLAY;HAVE_SOCKET_LEGACY;HAVE_ZLIB;HAVE_RARCH_MAIN_WRAP;HAVE_RARCH_EXEC;HAVE_LIBRETRO_MANAGEMENT;D3DCOMPILE_USEVOIDS;HAVE_GRIFFIN;HAVE_HLSL;HAVE_VID_CONTEXT;HAVE_D3D9;_XBOX360;HAVE_FBO;HAVE_SCREENSHOTS;WANT_RZLIB;HAVE_RMENU;HAVE_XAUDIO + NDEBUG;_XBOX;%(PreprocessorDefinitions);HAVE_XINPUT2;PACKAGE_VERSION="0.9.8.3";_CRT_SECURE_NO_WARNINGS;HAVE_DEFAULT_RETROPAD_INPUT;main=rarch_main;RARCH_CONSOLE=1;HAVE_FILEBROWSER;HAVE_NETPLAY;HAVE_SOCKET_LEGACY;HAVE_ZLIB;HAVE_RARCH_MAIN_WRAP;HAVE_RARCH_EXEC;HAVE_LIBRETRO_MANAGEMENT;D3DCOMPILE_USEVOIDS;HAVE_GRIFFIN;HAVE_HLSL;HAVE_VID_CONTEXT;HAVE_D3D9;_XBOX360;HAVE_FBO;HAVE_SCREENSHOTS;WANT_RZLIB;HAVE_SINC;SINC_LOWER_QUALITY;HAVE_RMENU;HAVE_XAUDIO true @@ -316,7 +316,7 @@ false false MultiThreaded - NDEBUG;_XBOX;LTCG;%(PreprocessorDefinitions);HAVE_XINPUT2;PACKAGE_VERSION="0.9.8";_CRT_SECURE_NO_WARNINGS;HAVE_DEFAULT_RETROPAD_INPUT;RARCH_CONSOLE;HAVE_RMENU;main=rarch_main;HAVE_FILEBROWSER;HAVE_NETPLAY;HAVE_SOCKET_LEGACY;HAVE_ZLIB;HAVE_RARCH_MAIN_WRAP;HAVE_RARCH_EXEC;HAVE_LIBRETRO_MANAGEMENT;D3DCOMPILE_USEVOIDS;HAVE_GRIFFIN;HAVE_HLSL;HAVE_VID_CONTEXT;HAVE_D3D9;_XBOX360;HAVE_FBO;HAVE_SCREENSHOTS;WANT_RZLIB;HAVE_XAUDIO + NDEBUG;_XBOX;LTCG;%(PreprocessorDefinitions);HAVE_XINPUT2;PACKAGE_VERSION="0.9.8.3";_CRT_SECURE_NO_WARNINGS;HAVE_DEFAULT_RETROPAD_INPUT;RARCH_CONSOLE;HAVE_RMENU;main=rarch_main;HAVE_FILEBROWSER;HAVE_NETPLAY;HAVE_SOCKET_LEGACY;HAVE_ZLIB;HAVE_RARCH_MAIN_WRAP;HAVE_RARCH_EXEC;HAVE_LIBRETRO_MANAGEMENT;D3DCOMPILE_USEVOIDS;HAVE_GRIFFIN;HAVE_HLSL;HAVE_VID_CONTEXT;HAVE_D3D9;_XBOX360;HAVE_FBO;HAVE_SCREENSHOTS;WANT_RZLIB;HAVE_SINC;SINC_LOWER_QUALITY;HAVE_XAUDIO true diff --git a/msvc/RetroArch-Xbox1/RetroArch-Xbox1.vcproj b/msvc/RetroArch-Xbox1/RetroArch-Xbox1.vcproj index 248ea6c536..c25481a4a2 100644 --- a/msvc/RetroArch-Xbox1/RetroArch-Xbox1.vcproj +++ b/msvc/RetroArch-Xbox1/RetroArch-Xbox1.vcproj @@ -22,7 +22,7 @@ Optimization="3" OptimizeForProcessor="2" AdditionalIncludeDirectories=""$(SolutionDir)\msvc-stdint";"$(SolutionDir)\msvc-71"" - PreprocessorDefinitions="_DEBUG;_XBOX;_XBOX1;HAVE_RMENU;HAVE_RMENU_GUI;RARCH_CONSOLE;HAVE_XINPUT_XBOX1;PACKAGE_VERSION=\"0.9.8\";__STDC_CONSTANT_MACROS;HAVE_ZLIB;HAVE_GRIFFIN;HAVE_RARCH_MAIN_WRAP;HAVE_LIBRETRO_MANAGEMENT;HAVE_RARCH_EXEC;HAVE_DEFAULT_RETROPAD_INPUT;HAVE_VID_CONTEXT;HAVE_DSOUND;HAVE_D3D8;HAVE_FILEBROWSER;HAVE_SCREENSHOTS;WANT_RZLIB" + PreprocessorDefinitions="_DEBUG;_XBOX;_XBOX1;HAVE_RMENU;HAVE_RMENU_GUI;RARCH_CONSOLE;HAVE_XINPUT_XBOX1;PACKAGE_VERSION=\"0.9.8.3\";__STDC_CONSTANT_MACROS;HAVE_ZLIB;HAVE_GRIFFIN;HAVE_RARCH_MAIN_WRAP;HAVE_LIBRETRO_MANAGEMENT;HAVE_RARCH_EXEC;HAVE_DEFAULT_RETROPAD_INPUT;HAVE_VID_CONTEXT;HAVE_DSOUND;HAVE_D3D8;HAVE_FILEBROWSER;HAVE_SCREENSHOTS;WANT_RZLIB;HAVE_SINC;SINC_LOWER_QUALITY" MinimalRebuild="TRUE" BasicRuntimeChecks="0" RuntimeLibrary="1" @@ -72,7 +72,7 @@ OmitFramePointers="TRUE" OptimizeForProcessor="2" AdditionalIncludeDirectories=""$(SolutionDir)\msvc-stdint";"$(SolutionDir)\msvc-71"" - PreprocessorDefinitions="NDEBUG;_XBOX;_XBOX1;HAVE_RMENU;HAVE_RMENU_GUI;RARCH_CONSOLE;HAVE_XINPUT_XBOX1;PACKAGE_VERSION=\"0.9.8\";__STDC_CONSTANT_MACROS;HAVE_ZLIB;PROFILE;HAVE_GRIFFIN;HAVE_RARCH_MAIN_WRAP;HAVE_LIBRETRO_MANAGEMENT;HAVE_RARCH_EXEC;HAVE_DEFAULT_RETROPAD_INPUT;HAVE_VID_CONTEXT;HAVE_DSOUND;HAVE_D3D8;HAVE_FILEBROWSER;HAVE_SCREENSHOTS;WANT_RZLIB" + PreprocessorDefinitions="NDEBUG;_XBOX;_XBOX1;HAVE_RMENU;HAVE_RMENU_GUI;RARCH_CONSOLE;HAVE_XINPUT_XBOX1;PACKAGE_VERSION=\"0.9.8.3\";__STDC_CONSTANT_MACROS;HAVE_ZLIB;PROFILE;HAVE_GRIFFIN;HAVE_RARCH_MAIN_WRAP;HAVE_LIBRETRO_MANAGEMENT;HAVE_RARCH_EXEC;HAVE_DEFAULT_RETROPAD_INPUT;HAVE_VID_CONTEXT;HAVE_DSOUND;HAVE_D3D8;HAVE_FILEBROWSER;HAVE_SCREENSHOTS;WANT_RZLIB;HAVE_SINC;SINC_LOWER_QUALITY" StringPooling="TRUE" RuntimeLibrary="0" BufferSecurityCheck="TRUE" @@ -127,7 +127,7 @@ OmitFramePointers="TRUE" OptimizeForProcessor="2" AdditionalIncludeDirectories=""$(SolutionDir)\msvc-stdint";"$(SolutionDir)\msvc-71"" - PreprocessorDefinitions="NDEBUG;_XBOX;_XBOX1;HAVE_RMENU;HAVE_RMENU_GUI;RARCH_CONSOLE;HAVE_XINPUT_XBOX1;PACKAGE_VERSION=\"0.9.8\";__STDC_CONSTANT_MACROS;HAVE_ZLIB;PROFILE;FASTCAP;HAVE_GRIFFIN;HAVE_RARCH_MAIN_WRAP;HAVE_LIBRETRO_MANAGEMENT;HAVE_RARCH_EXEC;HAVE_DEFAULT_RETROPAD_INPUT;HAVE_VID_CONTEXT;HAVE_DSOUND;HAVE_D3D8;HAVE_FILEBROWSER;HAVE_SCREENSHOTS;WANT_RZLIB" + PreprocessorDefinitions="NDEBUG;_XBOX;_XBOX1;HAVE_RMENU;HAVE_RMENU_GUI;RARCH_CONSOLE;HAVE_XINPUT_XBOX1;PACKAGE_VERSION=\"0.9.8.3\";__STDC_CONSTANT_MACROS;HAVE_ZLIB;PROFILE;FASTCAP;HAVE_GRIFFIN;HAVE_RARCH_MAIN_WRAP;HAVE_LIBRETRO_MANAGEMENT;HAVE_RARCH_EXEC;HAVE_DEFAULT_RETROPAD_INPUT;HAVE_VID_CONTEXT;HAVE_DSOUND;HAVE_D3D8;HAVE_FILEBROWSER;HAVE_SCREENSHOTS;WANT_RZLIB;HAVE_SINC;SINC_LOWER_QUALITY" StringPooling="TRUE" RuntimeLibrary="0" BufferSecurityCheck="TRUE" @@ -188,7 +188,7 @@ EnableFiberSafeOptimizations="TRUE" OptimizeForProcessor="2" AdditionalIncludeDirectories=""$(SolutionDir)\msvc-stdint";"$(SolutionDir)\msvc-71"" - PreprocessorDefinitions="NDEBUG;_XBOX;_XBOX1;HAVE_RMENU;HAVE_RMENU_GUI;RARCH_CONSOLE;HAVE_XINPUT_XBOX1;PACKAGE_VERSION=\"0.9.8\";__STDC_CONSTANT_MACROS;HAVE_ZLIB;HAVE_GRIFFIN;inline=_inline;HAVE_RARCH_MAIN_WRAP;HAVE_LIBRETRO_MANAGEMENT;HAVE_RARCH_EXEC;HAVE_DEFAULT_RETROPAD_INPUT;HAVE_VID_CONTEXT;HAVE_DSOUND;HAVE_D3D8;HAVE_FILEBROWSER;HAVE_SCREENSHOTS;WANT_RZLIB" + PreprocessorDefinitions="NDEBUG;_XBOX;_XBOX1;HAVE_RMENU;HAVE_RMENU_GUI;RARCH_CONSOLE;HAVE_XINPUT_XBOX1;PACKAGE_VERSION=\"0.9.8.3\";__STDC_CONSTANT_MACROS;HAVE_ZLIB;HAVE_GRIFFIN;inline=_inline;HAVE_RARCH_MAIN_WRAP;HAVE_LIBRETRO_MANAGEMENT;HAVE_RARCH_EXEC;HAVE_DEFAULT_RETROPAD_INPUT;HAVE_VID_CONTEXT;HAVE_DSOUND;HAVE_D3D8;HAVE_FILEBROWSER;HAVE_SCREENSHOTS;WANT_RZLIB;HAVE_SINC;SINC_LOWER_QUALITY" StringPooling="TRUE" RuntimeLibrary="0" BufferSecurityCheck="TRUE" @@ -241,7 +241,7 @@ OmitFramePointers="TRUE" OptimizeForProcessor="2" AdditionalIncludeDirectories=""$(SolutionDir)\msvc-stdint";"$(SolutionDir)\msvc-71"" - PreprocessorDefinitions="NDEBUG;_XBOX;_XBOX1;HAVE_RMENU;HAVE_RMENU_GUI;RARCH_CONSOLE;HAVE_XINPUT_XBOX1;PACKAGE_VERSION=\"0.9.8\";__STDC_CONSTANT_MACROS;HAVE_ZLIB;LTCG;HAVE_GRIFFIN;HAVE_RARCH_MAIN_WRAP;HAVE_LIBRETRO_MANAGEMENT;HAVE_RARCH_EXEC;HAVE_DEFAULT_RETROPAD_INPUT;HAVE_VID_CONTEXT;HAVE_DSOUND;HAVE_D3D8;HAVE_FILEBROWSER;HAVE_SCREENSHOTS;WANT_RZLIB" + PreprocessorDefinitions="NDEBUG;_XBOX;_XBOX1;HAVE_RMENU;HAVE_RMENU_GUI;RARCH_CONSOLE;HAVE_XINPUT_XBOX1;PACKAGE_VERSION=\"0.9.8.3\";__STDC_CONSTANT_MACROS;HAVE_ZLIB;LTCG;HAVE_GRIFFIN;HAVE_RARCH_MAIN_WRAP;HAVE_LIBRETRO_MANAGEMENT;HAVE_RARCH_EXEC;HAVE_DEFAULT_RETROPAD_INPUT;HAVE_VID_CONTEXT;HAVE_DSOUND;HAVE_D3D8;HAVE_FILEBROWSER;HAVE_SCREENSHOTS;WANT_RZLIB;HAVE_SINC;SINC_LOWER_QUALITY" StringPooling="TRUE" RuntimeLibrary="0" BufferSecurityCheck="TRUE" diff --git a/msvc/msvc-2010/RetroArch-msvc2010.vcxproj b/msvc/msvc-2010/RetroArch-msvc2010.vcxproj index 588feb40eb..ece58c8913 100644 --- a/msvc/msvc-2010/RetroArch-msvc2010.vcxproj +++ b/msvc/msvc-2010/RetroArch-msvc2010.vcxproj @@ -64,23 +64,23 @@ true - $(DXSDK_DIR)Include;$(IncludePath) - $(DXSDK_DIR)Lib\x86;$(LibraryPath) + $(DXSDK_DIR)Include;$(CG_INC_PATH);$(IncludePath) + $(DXSDK_DIR)Lib\x86;$(CG_LIB_PATH);$(LibraryPath) true - $(DXSDK_DIR)Include;$(IncludePath) - $(DXSDK_DIR)Lib\x64;$(LibraryPath) + $(DXSDK_DIR)Include;$(CG_INC_PATH);$(IncludePath) + $(DXSDK_DIR)Lib\x64;$(CG_LIB64_PATH);$(LibraryPath) false - $(DXSDK_DIR)Include;$(IncludePath) - $(DXSDK_DIR)Lib\x86;$(LibraryPath) + $(DXSDK_DIR)Include;$(CG_INC_PATH);$(IncludePath) + $(DXSDK_DIR)Lib\x86;$(CG_LIB_PATH);$(LibraryPath) false - $(DXSDK_DIR)Include;$(IncludePath) - $(DXSDK_DIR)Lib\x64;$(LibraryPath) + $(DXSDK_DIR)Include;$(CG_INC_PATH);$(IncludePath) + $(DXSDK_DIR)Lib\x64;$(CG_LIB64_PATH);$(LibraryPath) @@ -88,10 +88,12 @@ Level3 Disabled - WIN32;HAVE_WIN32_D3D9;HAVE_CG;_DEBUG;_WINDOWS;%(PreprocessorDefinitions);HAVE_SCREENSHOTS;HAVE_BSV_MOVIE;HAVE_DINPUT;HAVE_XAUDIO;HAVE_DSOUND;HAVE_OPENGL;HAVE_DYLIB;HAVE_NETPLAY;HAVE_NETWORK_CMD;HAVE_COMMAND;HAVE_STDIN_CMD;HAVE_THREADS;HAVE_DYNAMIC;PACKAGE_VERSION="0.9.8";_CRT_SECURE_NO_WARNINGS;CPU_X86 + WIN32;HAVE_WIN32_D3D9;HAVE_CG;HAVE_GLSL;HAVE_ZLIB;WANT_RZLIB;_DEBUG;_WINDOWS;%(PreprocessorDefinitions);HAVE_SCREENSHOTS;HAVE_BSV_MOVIE;HAVE_DINPUT;HAVE_XAUDIO;HAVE_DSOUND;HAVE_OPENGL;HAVE_DYLIB;HAVE_NETPLAY;HAVE_NETWORK_CMD;HAVE_COMMAND;HAVE_STDIN_CMD;HAVE_THREADS;HAVE_DYNAMIC;HAVE_SINC;PACKAGE_VERSION="0.9.8";_CRT_SECURE_NO_WARNINGS;__SSE__;__i686__ $(MSBuildProjectDirectory);$(MSBuildProjectDirectory)\..\..\;$(CG_INC_PATH);%(AdditionalIncludeDirectories) MultiThreadedDebug CompileAsCpp + Fast + StreamingSIMDExtensions Console @@ -106,10 +108,12 @@ Level3 Disabled - WIN32;HAVE_WIN32_D3D9;HAVE_CG;_DEBUG;_WINDOWS;%(PreprocessorDefinitions);HAVE_SCREENSHOTS;HAVE_BSV_MOVIE;HAVE_DINPUT;HAVE_XAUDIO;HAVE_DSOUND;HAVE_OPENGL;HAVE_DYLIB;HAVE_NETPLAY;HAVE_NETWORK_CMD;HAVE_COMMAND;HAVE_STDIN_CMD;HAVE_THREADS;HAVE_DYNAMIC;PACKAGE_VERSION="0.9.8";_CRT_SECURE_NO_WARNINGS + WIN32;HAVE_WIN32_D3D9;HAVE_CG;HAVE_GLSL;HAVE_ZLIB;WANT_RZLIB;_DEBUG;_WINDOWS;%(PreprocessorDefinitions);HAVE_SCREENSHOTS;HAVE_BSV_MOVIE;HAVE_DINPUT;HAVE_XAUDIO;HAVE_DSOUND;HAVE_OPENGL;HAVE_DYLIB;HAVE_NETPLAY;HAVE_NETWORK_CMD;HAVE_COMMAND;HAVE_STDIN_CMD;HAVE_THREADS;HAVE_DYNAMIC;HAVE_SINC;PACKAGE_VERSION="0.9.8";_CRT_SECURE_NO_WARNINGS;__SSE__;__SSE2__;__x86_64__ $(MSBuildProjectDirectory);$(MSBuildProjectDirectory)\..\..\;$(CG_INC_PATH);%(AdditionalIncludeDirectories) MultiThreadedDebug CompileAsCpp + Fast + StreamingSIMDExtensions2 Console @@ -126,10 +130,12 @@ MaxSpeed true true - WIN32;HAVE_WIN32_D3D9;HAVE_CG;NDEBUG;_WINDOWS;%(PreprocessorDefinitions);HAVE_SCREENSHOTS;HAVE_BSV_MOVIE;HAVE_DINPUT;HAVE_XAUDIO;HAVE_DSOUND;HAVE_OPENGL;HAVE_DYLIB;HAVE_NETPLAY;HAVE_NETWORK_CMD;HAVE_COMMAND;HAVE_STDIN_CMD;HAVE_THREADS;HAVE_DYNAMIC;PACKAGE_VERSION="0.9.8";_CRT_SECURE_NO_WARNINGS;CPU_X86 + WIN32;HAVE_WIN32_D3D9;HAVE_CG;HAVE_GLSL;HAVE_ZLIB;WANT_RZLIB;HAVE_SINC;NDEBUG;_WINDOWS;%(PreprocessorDefinitions);HAVE_SCREENSHOTS;HAVE_BSV_MOVIE;HAVE_DINPUT;HAVE_XAUDIO;HAVE_DSOUND;HAVE_OPENGL;HAVE_DYLIB;HAVE_NETPLAY;HAVE_NETWORK_CMD;HAVE_COMMAND;HAVE_STDIN_CMD;HAVE_THREADS;HAVE_DYNAMIC;PACKAGE_VERSION="0.9.8";_CRT_SECURE_NO_WARNINGS;__SSE__;__i686__ $(MSBuildProjectDirectory);$(MSBuildProjectDirectory)\..\..\;$(CG_INC_PATH);%(AdditionalIncludeDirectories) MultiThreaded CompileAsCpp + Fast + StreamingSIMDExtensions Console @@ -148,10 +154,12 @@ MaxSpeed true true - WIN32;HAVE_WIN32_D3D9;HAVE_CG;NDEBUG;_WINDOWS;%(PreprocessorDefinitions);HAVE_SCREENSHOTS;HAVE_BSV_MOVIE;HAVE_DINPUT;HAVE_XAUDIO;HAVE_DSOUND;HAVE_OPENGL;HAVE_DYLIB;HAVE_NETPLAY;HAVE_NETWORK_CMD;HAVE_COMMAND;HAVE_STDIN_CMD;HAVE_THREADS;HAVE_DYNAMIC;PACKAGE_VERSION="0.9.8";_CRT_SECURE_NO_WARNINGS + WIN32;HAVE_WIN32_D3D9;HAVE_CG;HAVE_GLSL;NDEBUG;_WINDOWS;%(PreprocessorDefinitions);HAVE_SCREENSHOTS;HAVE_BSV_MOVIE;HAVE_DINPUT;HAVE_XAUDIO;HAVE_DSOUND;HAVE_OPENGL;HAVE_DYLIB;HAVE_NETPLAY;HAVE_NETWORK_CMD;HAVE_COMMAND;HAVE_STDIN_CMD;HAVE_THREADS;HAVE_DYNAMIC;HAVE_SINC;HAVE_ZLIB;WANT_RZLIB;PACKAGE_VERSION="0.9.8";_CRT_SECURE_NO_WARNINGS;__SSE__;__SSE2__;__x86_64__ $(MSBuildProjectDirectory);$(MSBuildProjectDirectory)\..\..\;$(CG_INC_PATH);%(AdditionalIncludeDirectories) MultiThreaded CompileAsCpp + Fast + StreamingSIMDExtensions2 Console @@ -165,30 +173,29 @@ - - - - $(IntDir)\nullaudio.obj - $(IntDir)\nullaudio.obj - $(IntDir)\nullaudio.obj - $(IntDir)\nullaudio.obj - + + - - + + + + + + + @@ -209,8 +216,6 @@ - - @@ -223,8 +228,6 @@ - - @@ -241,12 +244,6 @@ - - $(IntDir)\nullinput.obj - $(IntDir)\nullinput.obj - $(IntDir)\nullinput.obj - $(IntDir)\nullinput.obj - @@ -275,4 +272,4 @@ - + \ No newline at end of file diff --git a/msvc/msvc-2010/RetroArch-msvc2010.vcxproj.filters b/msvc/msvc-2010/RetroArch-msvc2010.vcxproj.filters index a0ba3f1026..e35b2ee99b 100644 --- a/msvc/msvc-2010/RetroArch-msvc2010.vcxproj.filters +++ b/msvc/msvc-2010/RetroArch-msvc2010.vcxproj.filters @@ -43,6 +43,12 @@ {ae4f70af-fc87-4c8d-84a5-b2c4cd57e722} + + {a1975595-d469-4d96-81bf-d6a4f0be32f5} + + + {a1302353-aa00-4f85-a62f-3c40160a5fa3} + @@ -102,12 +108,6 @@ Source Files\audio - - Source Files\audio - - - Source Files\audio - Source Files\audio @@ -117,9 +117,6 @@ Source Files\gfx\context - - Source Files\gfx - Source Files\gfx @@ -132,9 +129,6 @@ Source Files\gfx - - Source Files\gfx - Source Files\gfx @@ -144,9 +138,6 @@ Source Files\input - - Source Files\input - Source Files\conf @@ -171,9 +162,6 @@ Source Files\gfx\math - - Source Files\audio - Source Files\gfx\d3d9 @@ -198,6 +186,33 @@ Source Files\gfx\fonts + + Source Files\audio + + + Source Files\compat + + + Source Files\audio + + + Source Files\audio + + + Source Files + + + Source Files\gfx + + + Source Files\deps + + + Source Files + + + Source Files\gfx\rpng + diff --git a/performance.h b/performance.h index 01831faaed..4515dc1c65 100644 --- a/performance.h +++ b/performance.h @@ -21,6 +21,10 @@ #include "config.h" #endif +#ifdef __cplusplus +extern "C" { +#endif + #include "boolean.h" #include typedef unsigned long long rarch_perf_tick_t; @@ -94,5 +98,9 @@ void rarch_get_cpu_features(struct rarch_cpu_features *cpu); #endif +#ifdef __cplusplus +} +#endif + #endif diff --git a/record/ffemu.c b/record/ffemu.c index 4c4f574c43..4728c7ac44 100644 --- a/record/ffemu.c +++ b/record/ffemu.c @@ -99,7 +99,9 @@ struct ff_audio_info // Most lossy audio codecs only support certain sampling rates. // Could use libswresample, but it doesn't support floating point ratios. :( // Use either S16 or (planar) float for simplicity. - rarch_resampler_t *resampler; + const rarch_resampler_t *resampler; + void *resampler_data; + bool use_float; bool is_planar; unsigned sample_size; @@ -277,7 +279,9 @@ static bool ffemu_init_audio(ffemu_t *handle) audio->codec->sample_rate = params->sample_rate; audio->codec->time_base = av_d2q(1.0 / params->sample_rate, 1000000); - audio->resampler = resampler_new(); + rarch_resampler_realloc(&audio->resampler_data, + &audio->resampler, + *g_settings.audio.resampler ? g_settings.audio.resampler : NULL); } else { @@ -683,8 +687,8 @@ void ffemu_free(ffemu_t *handle) if (handle->config.audio_opts) av_dict_free(&handle->config.audio_opts); - if (handle->audio.resampler) - resampler_free(handle->audio.resampler); + rarch_resampler_freep(&handle->audio.resampler, + &handle->audio.resampler_data); av_free(handle->audio.float_conv); av_free(handle->audio.resample_out); @@ -1023,7 +1027,7 @@ static void ffemu_audio_resample(ffemu_t *handle, struct ffemu_audio_data *data) info.input_frames = data->frames; info.ratio = handle->audio.ratio; - resampler_process(handle->audio.resampler, &info); + rarch_resampler_process(handle->audio.resampler, handle->audio.resampler_data, &info); data->data = handle->audio.resample_out; data->frames = info.output_frames; diff --git a/retroarch.c b/retroarch.c index 58546bf090..0cd2a16318 100644 --- a/retroarch.c +++ b/retroarch.c @@ -33,6 +33,7 @@ #include "screenshot.h" #include "cheats.h" #include "compat/getopt_rarch.h" +#include "compat/posix_string.h" #if defined(_WIN32) && !defined(_XBOX) #define WIN32_LEAN_AND_MEAN @@ -402,7 +403,8 @@ static bool audio_flush(const int16_t *data, size_t samples) RARCH_PERFORMANCE_INIT(resampler_proc); RARCH_PERFORMANCE_START(resampler_proc); - resampler_process(g_extern.audio_data.source, &src_data); + rarch_resampler_process(g_extern.audio_data.resampler, + g_extern.audio_data.resampler_data, &src_data); RARCH_PERFORMANCE_STOP(resampler_proc); output_data = g_extern.audio_data.outsamples; diff --git a/retroarch.cfg b/retroarch.cfg index 46d01d83be..2237d20e35 100644 --- a/retroarch.cfg +++ b/retroarch.cfg @@ -159,6 +159,10 @@ # Audio output samplerate. # audio_out_rate = 48000 +# Which resampler to use. "sinc" and "hermite" are currently implemented. +# Default will use "sinc" if compiled in. +# audio_resampler = + # When altering audio_in_rate on-the-fly, define by how much each time. # audio_rate_step = 0.25 diff --git a/settings.c b/settings.c index 1de569b709..1d2af6a5e2 100644 --- a/settings.c +++ b/settings.c @@ -203,6 +203,7 @@ void config_set_defaults(void) g_settings.audio.rate_control = rate_control; g_settings.audio.rate_control_delta = rate_control_delta; g_settings.audio.volume = audio_volume; + strlcpy(g_settings.audio.resampler, audio_resampler, sizeof(g_settings.audio.resampler)); g_settings.rewind_enable = rewind_enable; g_settings.rewind_buffer_size = rewind_buffer_size; @@ -277,6 +278,8 @@ void config_set_defaults(void) #if defined(__CELLOS_LV2) || defined(_XBOX360) g_settings.video.aspect_ratio_idx = ASPECT_RATIO_16_9; +#elif defined(GEKKO) || defined(_XBOX1) + g_settings.video.aspect_ratio_idx = ASPECT_RATIO_4_3; #else g_settings.video.aspect_ratio_idx = 0; #endif @@ -467,7 +470,7 @@ bool config_load_file(const char *path) CONFIG_GET_INT(video.aspect_ratio_idx, "aspect_ratio_index"); CONFIG_GET_FLOAT(video.aspect_ratio, "video_aspect_ratio"); - for (unsigned i = 0; i < 8; i++) + for (unsigned i = 0; i < MAX_PLAYERS; i++) { char cfg[64]; snprintf(cfg, sizeof(cfg), "input_dpad_emulation_p%u", i + 1); @@ -476,6 +479,12 @@ bool config_load_file(const char *path) CONFIG_GET_INT(input.device[i], cfg); } +#ifdef ANDROID + CONFIG_GET_INT(input.icade_profile[0], "input_autodetect_icade_profile_pad1"); + CONFIG_GET_INT(input.icade_profile[1], "input_autodetect_icade_profile_pad2"); + CONFIG_GET_INT(input.icade_profile[2], "input_autodetect_icade_profile_pad3"); + CONFIG_GET_INT(input.icade_profile[3], "input_autodetect_icade_profile_pad4"); +#endif CONFIG_GET_BOOL_EXTERN(console.screen.gamma_correction, "gamma_correction"); @@ -643,6 +652,7 @@ bool config_load_file(const char *path) CONFIG_GET_BOOL(audio.rate_control, "audio_rate_control"); CONFIG_GET_FLOAT(audio.rate_control_delta, "audio_rate_control_delta"); CONFIG_GET_FLOAT(audio.volume, "audio_volume"); + CONFIG_GET_STRING(audio.resampler, "audio_resampler"); CONFIG_GET_STRING(video.driver, "video_driver"); CONFIG_GET_STRING(audio.driver, "audio_driver"); @@ -1177,6 +1187,14 @@ bool config_save_file(const char *path) config_set_bool(conf, "audio_rate_control", g_settings.audio.rate_control); config_set_float(conf, "audio_rate_control_delta", g_settings.audio.rate_control_delta); config_set_string(conf, "system_directory", g_settings.system_directory); + config_set_string(conf, "audio_resampler", g_settings.audio.resampler); + +#ifdef ANDROID + config_set_int(conf, "input_autodetect_icade_profile_pad1", input.icade_profile[0]); + config_set_int(conf, "input_autodetect_icade_profile_pad2", input.icade_profile[1]); + config_set_int(conf, "input_autodetect_icade_profile_pad3", input.icade_profile[2]); + config_set_int(conf, "input_autodetect_icade_profile_pad4", input.icade_profile[3]); +#endif if (g_extern.lifecycle_mode_state & (1ULL << MODE_VIDEO_OVERSCAN_ENABLE)) config_set_bool(conf, "overscan_enable", true); diff --git a/tools/retrolaunch/launch.conf b/tools/retrolaunch/launch.conf index 64e0d44243..dbc9c2f490 100644 --- a/tools/retrolaunch/launch.conf +++ b/tools/retrolaunch/launch.conf @@ -68,7 +68,7 @@ "ps1.Chippoke Ralph no Daibouken (Adventure of Little Ralph)" mednafen-psx dualanalog ; "ps1.Chocobo Racing" mednafen-psx dualanalog ; "ps1.Chrono Cross*" pcsxr dualanalog ; -"ps1.Colin Mc[rR]rae*" mednafen-psx dualanalog ; +"ps1.Colin Mc[rR]ae*" mednafen-psx dualanalog ; "ps1.Colony Wars*" mednafen-psx dualanalog ; "ps1.Cosmowarrior Rei" mednafen-psx dualanalog ; "ps1.Cowboy Bebop" mednafen-psx dualanalog ; diff --git a/wii/pkg/meta.xml b/wii/pkg/meta.xml index 47e5dbef1a..677c2e8975 100644 --- a/wii/pkg/meta.xml +++ b/wii/pkg/meta.xml @@ -2,7 +2,7 @@ RetroArch GX Maister, Squarepusher, ToadKing - 0.9.8.1 + 0.9.8.3 2012-2013 Multi-system emulator A port of RetroArch to the GameCube/Wii.