Merge commit '1d96a10acb661e07775de954338f4bb3724705a3' into libretro_core
# Conflicts: # libretro/libretro.c
This commit is contained in:
commit
0891de668b
@ -1,6 +1,11 @@
|
||||
STATIC_LINKING := 0
|
||||
AR := ar
|
||||
|
||||
GIT_VERSION ?= " $(shell git rev-parse --short HEAD || echo unknown)"
|
||||
ifneq ($(GIT_VERSION)," unknown")
|
||||
CFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\"
|
||||
endif
|
||||
|
||||
ifeq ($(platform),)
|
||||
platform = unix
|
||||
ifeq ($(shell uname -a),)
|
||||
@ -48,7 +53,7 @@ endif
|
||||
|
||||
ifeq ($(platform), osx)
|
||||
ifndef ($(NOUNIVERSAL))
|
||||
CXXFLAGS += $(ARCHFLAGS)
|
||||
CFLAGS += $(ARCHFLAGS)
|
||||
LFLAGS += $(ARCHFLAGS)
|
||||
endif
|
||||
endif
|
||||
@ -88,10 +93,10 @@ else
|
||||
endif
|
||||
ifeq ($(platform),$(filter $(platform),ios9 ios-arm64))
|
||||
CC += -miphoneos-version-min=8.0
|
||||
CXXFLAGS += -miphoneos-version-min=8.0
|
||||
CFLAGS += -miphoneos-version-min=8.0
|
||||
else
|
||||
CC += -miphoneos-version-min=5.0
|
||||
CXXFLAGS += -miphoneos-version-min=5.0
|
||||
CFLAGS += -miphoneos-version-min=5.0
|
||||
endif
|
||||
else ifneq (,$(findstring qnx,$(platform)))
|
||||
TARGET := $(TARGET_NAME)_libretro_qnx.so
|
||||
@ -121,9 +126,9 @@ MKDIR := $(shell which mkdir)
|
||||
LDFLAGS += $(LIBM)
|
||||
|
||||
ifeq ($(DEBUG), 1)
|
||||
CXXFLAGS += -O0 -g
|
||||
CFLAGS += -O0 -g
|
||||
else
|
||||
CXXFLAGS += -O2 -DNDEBUG
|
||||
CFLAGS += -O2 -DNDEBUG
|
||||
endif
|
||||
|
||||
include Makefile.common
|
||||
@ -131,7 +136,6 @@ include Makefile.common
|
||||
OBJECTS := $(patsubst %.c,$(CORE_DIR)/build/obj/%_libretro.c.o,$(SOURCES_C))
|
||||
|
||||
CFLAGS += -Wall -D__LIBRETRO__ $(fpic) $(INCFLAGS) -std=gnu11 -D_GNU_SOURCE -D_USE_MATH_DEFINES
|
||||
CXXFLAGS += -Wall -D__LIBRETRO__ $(fpic)
|
||||
|
||||
all: $(TARGET)
|
||||
|
||||
|
@ -1,7 +1,11 @@
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
GIT_VERSION ?= " $(shell git rev-parse --short HEAD || echo unknown)"
|
||||
ifneq ($(GIT_VERSION)," unknown")
|
||||
LOCAL_CXXFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\"
|
||||
endif
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
HAVE_NETWORK = 1
|
||||
LOCAL_MODULE := libretro
|
||||
|
@ -14,6 +14,8 @@
|
||||
#define snprintf _snprintf
|
||||
#endif
|
||||
|
||||
#define SAMEBOY_CORE_VERSION "0.9"
|
||||
|
||||
#include <Core/gb.h>
|
||||
#include "libretro.h"
|
||||
|
||||
@ -168,12 +170,15 @@ void retro_get_system_info(struct retro_system_info *info)
|
||||
{
|
||||
memset(info, 0, sizeof(*info));
|
||||
info->library_name = "SameBoy";
|
||||
info->library_version = "0.9";
|
||||
#ifdef GIT_VERSION
|
||||
info->library_version = SAMEBOY_CORE_VERSION GIT_VERSION;
|
||||
#else
|
||||
info->library_version = SAMEBOY_CORE_VERSION;
|
||||
#endif
|
||||
info->need_fullpath = true;
|
||||
info->valid_extensions = "gb|gbc";
|
||||
}
|
||||
|
||||
|
||||
void retro_get_system_av_info(struct retro_system_av_info *info)
|
||||
{
|
||||
struct retro_game_geometry geom = { VIDEO_WIDTH, VIDEO_HEIGHT,VIDEO_WIDTH, VIDEO_HEIGHT ,160.0 / 144.0 };
|
||||
@ -202,13 +207,6 @@ void retro_set_environment(retro_environment_t cb)
|
||||
{ NULL, 0 },
|
||||
};
|
||||
cb(RETRO_ENVIRONMENT_SET_CONTROLLER_INFO, (void*)ports);
|
||||
|
||||
static struct retro_variable vars[] = {
|
||||
{ "sameboy_color_correction_mode", "Color Correction; off|correct curves|emulate hardware|preserve brightness" },
|
||||
{ "sameboy_high_pass_filter_mode", "High Pass Filter; off|accurate|remove dc offset" },
|
||||
};
|
||||
cb(RETRO_ENVIRONMENT_SET_VARIABLES, (void*)vars);
|
||||
|
||||
}
|
||||
|
||||
void retro_set_audio_sample(retro_audio_sample_t cb)
|
||||
@ -246,7 +244,7 @@ static void check_variables(void)
|
||||
|
||||
var.key = "sameboy_color_correction_mode";
|
||||
var.value = NULL;
|
||||
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
|
||||
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value && GB_is_cgb(&gb))
|
||||
{
|
||||
if (strcmp(var.value, "off") == 0)
|
||||
GB_set_color_correction_mode(&gb, GB_COLOR_CORRECTION_DISABLED);
|
||||
@ -422,6 +420,21 @@ bool retro_load_game(const struct retro_game_info *info)
|
||||
else
|
||||
log_cb(RETRO_LOG_INFO, "Rumble environment not supported.\n");
|
||||
|
||||
static struct retro_variable vars_cgb[] = {
|
||||
{ "sameboy_color_correction_mode", "Color Correction; off|correct curves|emulate hardware|preserve brightness" },
|
||||
{ "sameboy_high_pass_filter_mode", "High Pass Filter; off|accurate|remove dc offset" },
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
static struct retro_variable vars_dmg[] = {
|
||||
{ "sameboy_high_pass_filter_mode", "High Pass Filter; off|accurate|remove dc offset" },
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
if (GB_is_cgb(&gb))
|
||||
environ_cb(RETRO_ENVIRONMENT_SET_VARIABLES, vars_cgb);
|
||||
else
|
||||
environ_cb(RETRO_ENVIRONMENT_SET_VARIABLES, vars_dmg);
|
||||
check_variables();
|
||||
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user