From ded6f6993335fa8aced9c564bdbfa17698e97648 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sun, 8 Jul 2012 18:21:29 +0300 Subject: [PATCH] (Xbox) Added RARCH_CONSOLE functions for null video driver - using null video driver for Xbox 1 for now --- 360/frontend-xdk/main.c | 11 +++++++++-- config.def.h | 2 +- console/griffin/griffin.c | 2 +- console/griffin/hook.h | 2 +- driver.c | 2 +- gfx/null.c | 9 +++++++++ 6 files changed, 22 insertions(+), 6 deletions(-) diff --git a/360/frontend-xdk/main.c b/360/frontend-xdk/main.c index b7b8f98e48..f49898ea93 100644 --- a/360/frontend-xdk/main.c +++ b/360/frontend-xdk/main.c @@ -286,14 +286,17 @@ int main(int argc, char *argv[]) configure_libretro("game:\\", ".xex"); #endif +#if defined(HAVE_D3D8) || defined(HAVE_D3D9) video_xdk_d3d.start(); +#else + video_null.start(); +#endif input_xinput.init(); rarch_input_set_default_keybind_names_for_emulator(); menu_init(); - begin_loop: if(g_console.mode_switch == MODE_EMULATION) { @@ -322,9 +325,13 @@ begin_shutdown: rarch_config_save(SYS_CONFIG_FILE); menu_free(); +#if defined(HAVE_D3D8) || defined(HAVE_D3D9) video_xdk_d3d.stop(); +#else + video_null.stop(); +#endif input_xinput.free(NULL); rarch_exec(); return 0; -} \ No newline at end of file +} diff --git a/config.def.h b/config.def.h index beb7c3132c..86016c0bed 100644 --- a/config.def.h +++ b/config.def.h @@ -78,7 +78,7 @@ enum #define VIDEO_DEFAULT_DRIVER VIDEO_WII #elif defined(XENON) #define VIDEO_DEFAULT_DRIVER VIDEO_XENON360 -#elif defined(_XBOX1) || defined(_XBOX360) +#elif (defined(_XBOX1) || defined(_XBOX360)) && (defined(HAVE_D3D8) || defined(HAVE_D3D9)) #define VIDEO_DEFAULT_DRIVER VIDEO_XDK_D3D #elif defined(HAVE_XVIDEO) #define VIDEO_DEFAULT_DRIVER VIDEO_XVIDEO diff --git a/console/griffin/griffin.c b/console/griffin/griffin.c index b8181abe82..2c8f2e3d46 100644 --- a/console/griffin/griffin.c +++ b/console/griffin/griffin.c @@ -98,7 +98,7 @@ VIDEO DRIVER #include "../../wii/video.c" #endif -#ifdef _XBOX +#if defined(_XBOX) && (defined(HAVE_D3D8) || defined(HAVE_D3D9)) #include "../../360/xdk_d3d.cpp" #endif diff --git a/console/griffin/hook.h b/console/griffin/hook.h index a87786506d..d8aa70bb29 100644 --- a/console/griffin/hook.h +++ b/console/griffin/hook.h @@ -54,7 +54,7 @@ XBOX 1 / XBOX 360 ============================================================ */ -#elif defined(_XBOX) +#elif defined(_XBOX) && (defined(HAVE_D3D8) || defined(HAVE_D3D9)) #define video_init_func(video_info, input, input_data) \ xdk_d3d_init(video_info, input, input_data) diff --git a/driver.c b/driver.c index b8f9ec2413..6b5e9a175a 100644 --- a/driver.c +++ b/driver.c @@ -85,7 +85,7 @@ static const video_driver_t *video_drivers[] = { #ifdef XENON &video_xenon360, #endif -#ifdef _XBOX +#if defined(_XBOX) && (defined(HAVE_D3D8) || defined(HAVE_D3D9)) &video_xdk_d3d, #endif #ifdef HAVE_SDL diff --git a/gfx/null.c b/gfx/null.c index b378471f83..bcc44bcbaa 100644 --- a/gfx/null.c +++ b/gfx/null.c @@ -62,6 +62,10 @@ static void null_gfx_free(void *data) (void)data; } +static void null_gfx_start(void) {} +static void null_gfx_restart(void) {} +static void null_gfx_stop(void) {} + const video_driver_t video_null = { null_gfx_init, null_gfx_frame, @@ -71,5 +75,10 @@ const video_driver_t video_null = { NULL, null_gfx_free, "null", +#ifdef RARCH_CONSOLE + null_gfx_start, + null_gfx_stop, + null_gfx_restart, +#endif };