Don't set GFX_MULTI_FORMAT if not needed. The BuildPixel calls cost ~3% performance.

This commit is contained in:
Brandon Wright 2018-04-21 19:17:39 -05:00
parent 97f4067cd8
commit 513926521d
6 changed files with 27 additions and 22 deletions

View File

@ -359,7 +359,7 @@ NASM="not_found"
ZSNESC4=no
ZSNESFX=no
CFLAGS="$CFLAGS -DCORRECT_VRAM_READS"
CFLAGS="$CFLAGS -DPIXEL_FORMAT=RGB555 -DCORRECT_VRAM_READS"
CORRECT_VRAM_READS=1
if test yes = "$with_debugger"; then

View File

@ -1832,7 +1832,6 @@ void
S9xInitDisplay (int argc, char **argv)
{
Settings.SupportHiRes = TRUE;
S9xSetRenderPixelFormat (RGB555);
S9xBlit2xSaIFilterInit ();
#ifdef USE_HQ2X
S9xBlitHQ2xFilterInit ();

View File

@ -546,15 +546,14 @@ bool retro_load_game(const struct retro_game_info *game)
rom_loaded = Memory.LoadROMMem((const uint8_t*)game->data ,game->size);
}
int pixel_format = RGB555;
if(environ_cb) {
pixel_format = RGB565;
enum retro_pixel_format fmt = RETRO_PIXEL_FORMAT_RGB565;
if (!environ_cb(RETRO_ENVIRONMENT_SET_PIXEL_FORMAT, &fmt))
pixel_format = RGB555;
enum retro_pixel_format fmt = RETRO_PIXEL_FORMAT_RGB565;
if(!environ_cb || !environ_cb(RETRO_ENVIRONMENT_SET_PIXEL_FORMAT, &fmt))
{
return false
}
S9xGraphicsDeinit();
S9xSetRenderPixelFormat(pixel_format);
S9xGraphicsInit();
if (!rom_loaded && log_cb)

7
port.h
View File

@ -211,8 +211,6 @@
#include <windows.h>
#endif
#define GFX_MULTI_FORMAT
#ifdef __WIN32__
//#define RIGHTSHIFT_IS_SAR
#define RIGHTSHIFT_int8_IS_SAR
@ -220,6 +218,7 @@
#define RIGHTSHIFT_int32_IS_SAR
#ifndef __WIN32_LIBSNES__
#define SNES_JOY_READ_CALLBACKS
#define GFX_MULTI_FORMAT
#endif //__WIN32_LIBSNES__
#endif
@ -228,6 +227,10 @@
#define PIXEL_FORMAT RGB555
#endif
#ifndef PIXEL_FORMAT
#define PIXEL_FORMAT RGB565
#endif
#ifndef snes9x_types_defined
#define snes9x_types_defined
typedef unsigned char bool8;

24
unix/configure vendored
View File

@ -1,7 +1,7 @@
#! /bin/sh
# From configure.ac Revision: 1.54.1 .
# From configure.ac Revision: 1.55 .
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for Snes9x 1.54.1.
# Generated by GNU Autoconf 2.69 for Snes9x 1.55.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@ -578,8 +578,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='Snes9x'
PACKAGE_TARNAME='snes9x'
PACKAGE_VERSION='1.54.1'
PACKAGE_STRING='Snes9x 1.54.1'
PACKAGE_VERSION='1.55'
PACKAGE_STRING='Snes9x 1.55'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''
@ -1279,7 +1279,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures Snes9x 1.54.1 to adapt to many kinds of systems.
\`configure' configures Snes9x 1.55 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@ -1349,7 +1349,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of Snes9x 1.54.1:";;
short | recursive ) echo "Configuration of Snes9x 1.55:";;
esac
cat <<\_ACEOF
@ -1466,7 +1466,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
Snes9x configure 1.54.1
Snes9x configure 1.55
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@ -1869,7 +1869,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by Snes9x $as_me 1.54.1, which was
It was created by Snes9x $as_me 1.55, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@ -6306,9 +6306,11 @@ else
S9XDEFS="$S9XDEFS -DNOSOUND"
fi
S9XDEFS="$S9XDEFS -DGFX_MULTI_FORMAT"
# Output.
S9XFLGS="$CXXFLAGS $CPPFLAGS $LDFLAGS $S9XFLGS"
S9XFLGS="$CXXFLAGS $CPPFLAGS $S9XFLGS"
S9XLIBS="$LIBS $S9XLIBS"
S9XFLGS="`echo \"$S9XFLGS\" | sed -e 's/ */ /g'`"
@ -6901,7 +6903,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by Snes9x $as_me 1.54.1, which was
This file was extended by Snes9x $as_me 1.55, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@ -6954,7 +6956,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
Snes9x config.status 1.54.1
Snes9x config.status 1.55
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"

View File

@ -446,6 +446,8 @@ else
S9XDEFS="$S9XDEFS -DNOSOUND"
fi
S9XDEFS="$S9XDEFS -DGFX_MULTI_FORMAT"
# Output.
S9XFLGS="$CXXFLAGS $CPPFLAGS $S9XFLGS"