From 0c7af232ccc40c704b9527261bdffa6e6d8c1b26 Mon Sep 17 00:00:00 2001 From: Twinaphex Date: Wed, 20 Jun 2012 06:39:52 +0200 Subject: [PATCH] (Android) Have Android port use null video/input/audio drivers for now - also changed some things in Griffin so things work again after null drivers commit --- android/jni/Android.mk | 2 +- console/console_ext.c | 9 +++++---- console/console_ext.h | 2 ++ console/griffin/func_hooks.h | 2 +- console/griffin/griffin.c | 10 +++++++--- console/griffin/hook.h | 25 +++++++++++++++++++++++++ 6 files changed, 41 insertions(+), 9 deletions(-) diff --git a/android/jni/Android.mk b/android/jni/Android.mk index 94ec9e7c22..a6894688cc 100644 --- a/android/jni/Android.mk +++ b/android/jni/Android.mk @@ -7,6 +7,6 @@ include $(CLEAR_VARS) LOCAL_MODULE := retroarch LOCAL_SRC_FILES = ../../console/griffin/griffin.c ../../console/rzlib/rzlib.c -LOCAL_CFLAGS = -DINLINE=inline -DRARCH_CONSOLE -DLSB_FIRST -D__LIBRETRO__ -DHAVE_CONFIGFILE=1 -DHAVE_GRIFFIN=1 -DPACKAGE_VERSION=\"$(RARCH_VERSION)\" -Dmain=rarch_main -std=gnu99 +LOCAL_CFLAGS = -DANDROID -DHAVE_DYNAMIC -DHAVE_ZLIB -DINLINE=inline -DRARCH_CONSOLE -DLSB_FIRST -D__LIBRETRO__ -DHAVE_CONFIGFILE=1 -DHAVE_GRIFFIN=1 -DPACKAGE_VERSION=\"$(RARCH_VERSION)\" -Dmain=rarch_main -std=gnu99 include $(BUILD_SHARED_LIBRARY) diff --git a/console/console_ext.c b/console/console_ext.c index 024c4280af..050d22a99a 100644 --- a/console/console_ext.c +++ b/console/console_ext.c @@ -52,7 +52,7 @@ const char *rarch_console_get_rom_ext(void) const char *retval = NULL; struct retro_system_info info; - retro_get_system_info(&info); + pretro_get_system_info(&info); if (info.valid_extensions) retval = info.valid_extensions; @@ -68,7 +68,7 @@ void rarch_console_name_from_id(char *name, size_t size) return; struct retro_system_info info; - retro_get_system_info(&info); + pretro_get_system_info(&info); const char *id = info.library_name ? info.library_name : "Unknown"; if (!id || strlen(id) >= size) @@ -410,7 +410,6 @@ const char *rarch_input_find_platform_key_label(uint64_t joykey) return "Unknown"; } -#endif void rarch_input_set_keybind(unsigned player, unsigned keybind_action, uint64_t default_retro_joypad_id) { @@ -445,10 +444,12 @@ void rarch_input_set_default_keybinds(unsigned player) g_settings.input.dpad_emulation[player] = DPAD_EMULATION_LSTICK; } +#endif + void rarch_input_set_default_keybind_names_for_emulator(void) { struct retro_system_info info; - retro_get_system_info(&info); + pretro_get_system_info(&info); const char *id = info.library_name ? info.library_name : "Unknown"; // Genesis Plus GX/Next diff --git a/console/console_ext.h b/console/console_ext.h index 4ef5611d11..324f24f77f 100644 --- a/console/console_ext.h +++ b/console/console_ext.h @@ -148,6 +148,7 @@ int rarch_extract_zipfile(const char *zip_path); INPUT EXTENSIONS ============================================================ */ +#ifdef HAVE_DEFAULT_RETROPAD_INPUT const char *rarch_input_find_platform_key_label(uint64_t joykey); uint64_t rarch_input_find_previous_platform_key(uint64_t joykey); uint64_t rarch_input_find_next_platform_key(uint64_t joykey); @@ -157,6 +158,7 @@ uint64_t rarch_input_find_next_platform_key(uint64_t joykey); void rarch_input_set_default_keybind_names_for_emulator(void); void rarch_input_set_keybind(unsigned player, unsigned keybind_action, uint64_t default_retro_joypad_id); +#endif /*============================================================ diff --git a/console/griffin/func_hooks.h b/console/griffin/func_hooks.h index 6bfea46ab6..d74e630ae2 100644 --- a/console/griffin/func_hooks.h +++ b/console/griffin/func_hooks.h @@ -19,7 +19,7 @@ /*============================================================ GENERAL ============================================================ */ -#if defined(__CELLOS_LV2__) || defined(_XBOX) || defined(GEKKO) +#if defined(__CELLOS_LV2__) || defined(_XBOX) || defined(GEKKO) || defined(ANDROID) #define HAVE_GRIFFIN_OVERRIDE_VIDEO_FRAME_FUNC 1 #endif diff --git a/console/griffin/griffin.c b/console/griffin/griffin.c index 1b3511d92e..fa442b426b 100644 --- a/console/griffin/griffin.c +++ b/console/griffin/griffin.c @@ -88,14 +88,14 @@ VIDEO DRIVER #ifdef HAVE_OPENGL #include "../../gfx/gl.c" -#endif - -#if defined(_XBOX) +#elif defined(_XBOX) #include "../../360/xdk360_video.cpp" #elif defined(GEKKO) #include "../../wii/video.c" #endif +#include "../../gfx/null.c" + /*============================================================ FONTS ============================================================ */ @@ -119,6 +119,8 @@ INPUT #include "../../wii/input.c" #endif +#include "../../input/null.c" + /*============================================================ STATE TRACKER ============================================================ */ @@ -163,6 +165,8 @@ AUDIO #include "../../wii/audio.c" #endif +#include "../../audio/null.c" + /*============================================================ DYNAMIC ============================================================ */ diff --git a/console/griffin/hook.h b/console/griffin/hook.h index a7b6890503..c5674e4f1f 100644 --- a/console/griffin/hook.h +++ b/console/griffin/hook.h @@ -103,4 +103,29 @@ #define input_free_func() wii_free_input(driver.input_data) #define gfx_ctx_window_has_focus() (true) +#else + +/*============================================================ + NULL +============================================================ */ + +#define video_init_func(video_info, input, input_data) null_gfx_init(video_info, input, input_data) +#define video_frame_func(data, width, height, pitch, msg) \ + null_gfx_frame(driver.video_data, data, width, height, pitch, msg) +#define video_set_nonblock_state_func(state) null_gfx_set_nonblock_state(driver.video_data, state) +#define video_alive_func() null_gfx_alive(driver.video_data) +#define video_focus_func() null_gfx_focus(driver.video_data) +#define video_xml_shader_func(path) driver.video->xml_shader(driver.video_data, path) +#define video_free_func() null_gfx_free(driver.video_data) +#define video_set_rotation_func(orientation) (true) +#define video_set_aspect_ratio_func(aspectratio_idx) (true) + +#define input_init_func() null_input_init() +#define input_poll_func() null_input_poll(driver.input_data) +#define input_input_state_func(snes_keybinds, port, device, index, id) \ + null_input_state(driver.input_data, snes_keybinds, port, device, index, id) +#define input_key_pressed_func(key) null_input_key_pressed(driver.input_data, key) +#define input_free_func() null_input_free(driver.input_data) +#define gfx_ctx_window_has_focus() (true) + #endif