1
0
mirror of https://github.com/libretro/RetroArch synced 2024-07-08 12:15:49 +00:00

Merge remote-tracking branch 'upstream/master' into zip_support

This commit is contained in:
Timo Strunk 2014-09-12 17:06:41 +02:00
commit 11b63cbe3d
62 changed files with 2214 additions and 1231 deletions

View File

@ -133,6 +133,7 @@ ifeq ($(HAVE_MENU_COMMON), 1)
frontend/menu/menu_input_line_cb.o \
frontend/menu/menu_common.o \
frontend/menu/menu_navigation.o \
frontend/menu/menu_action.o \
frontend/menu/menu_entries.o
endif

View File

@ -92,6 +92,7 @@ ifeq ($(HAVE_MENU_COMMON), 1)
frontend/menu/menu_input_line_cb.o \
frontend/menu/menu_common.o \
frontend/menu/menu_navigation.o \
frontend/menu/menu_action.o \
frontend/menu/menu_entries.o
endif

View File

@ -88,12 +88,13 @@ HAVE_NETPLAY = 1
HAVE_STDIN_CMD = 1
HAVE_THREADS = 1
HAVE_RGUI = 1
HAVE_GLUI = 1
HAVE_7ZIP = 1
DYNAMIC = 1
HAVE_WINXINPUT = 1
HAVE_LAKKA = 0
HAVE_LAKKA = 1
ifeq ($(SLIM),)
HAVE_SDL = 1
@ -126,6 +127,10 @@ ifeq ($(HAVE_RGUI), 1)
OBJ += frontend/menu/disp/rgui.o
DEFINES += -DHAVE_MENU -DHAVE_RGUI
HAVE_MENU_COMMON = 1
ifeq ($(HAVE_GLUI), 1)
OBJ += frontend/menu/disp/glui.o
DEFINES += -DHAVE_GLUI
endif
ifeq ($(HAVE_LAKKA), 1)
OBJ += frontend/menu/backend/menu_lakka_backend.o frontend/menu/disp/lakka.o
DEFINES += -DHAVE_LAKKA
@ -139,6 +144,7 @@ ifeq ($(HAVE_MENU_COMMON), 1)
frontend/menu/menu_input_line_cb.o \
frontend/menu/menu_common.o \
frontend/menu/menu_navigation.o \
frontend/menu/menu_action.o \
frontend/menu/menu_entries.o
endif
@ -189,7 +195,7 @@ else
endif
ifeq ($(HAVE_D3D9), 1)
OBJ += gfx/d3d9/d3d.o gfx/d3d9/render_chain.o gfx/fonts/d3d_font.o gfx/fonts/d3d_w32_font.o gfx/context/d3d_ctx.o
OBJ += gfx/d3d9/d3d.o gfx/d3d9/render_chain.o gfx/d3d9/d3d_wrapper.o gfx/fonts/d3d_font.o gfx/fonts/d3d_w32_font.o gfx/context/d3d_ctx.o
DEFINES += -DHAVE_WIN32_D3D9
LIBS += -ld3d9 -lcg -lcgD3D9 -ld3dx9 -ldxguid
endif

View File

@ -161,7 +161,7 @@ error:
void rarch_cmd_free(rarch_cmd_t *handle)
{
#if defined(HAVE_NETWORK_CMD) && defined(HAVE_NETPLAY)
if (handle->net_fd >= 0)
if (handle && handle->net_fd >= 0)
close(handle->net_fd);
#endif

View File

@ -360,10 +360,15 @@ returntype main_entry(signature())
rarch_main_clear_state();
if (!(ret = (main_load_content(argc, argv, args,
driver.frontend_ctx->environment_get,
driver.frontend_ctx->process_args))))
return_var(ret);
if (driver.frontend_ctx)
{
if (!(ret = (main_load_content(argc, argv, args,
driver.frontend_ctx->environment_get,
driver.frontend_ctx->process_args))))
{
return_var(ret);
}
}
#if defined(HAVE_MENU)
#if defined(RARCH_CONSOLE) || defined(RARCH_MOBILE)

View File

@ -21,6 +21,7 @@
#include <limits.h>
#include <ctype.h>
#include "menu_common_backend.h"
#include "../menu_action.h"
#include "../menu_entries.h"
#include "../menu_navigation.h"
#include "../menu_input_line_cb.h"
@ -33,8 +34,6 @@
#include "../../../config.def.h"
#include "../../../input/keyboard_line.h"
#include "../../../settings_data.h"
#if defined(HAVE_CG) || defined(HAVE_HLSL) || defined(HAVE_GLSL)
#define HAVE_SHADER_MANAGER
#endif
@ -77,7 +76,8 @@ static int menu_info_screen_iterate(unsigned action)
driver.menu->selection_ptr,
setting_data_get_mainmenu(true))))
{
strlcpy(needle, current_setting->name, sizeof(needle));
if (current_setting)
strlcpy(needle, current_setting->name, sizeof(needle));
}
else
{
@ -209,44 +209,6 @@ static int menu_common_setting_set_perf(unsigned setting, unsigned action,
return 0;
}
static void menu_common_setting_set_current_boolean(
rarch_setting_t *setting, unsigned action)
{
if (
!strcmp(setting->name, "savestate") ||
!strcmp(setting->name, "loadstate"))
{
if (action == MENU_ACTION_START)
g_settings.state_slot = 0;
else if (action == MENU_ACTION_LEFT)
{
// Slot -1 is (auto) slot.
if (g_settings.state_slot >= 0)
g_settings.state_slot--;
}
else if (action == MENU_ACTION_RIGHT)
g_settings.state_slot++;
else if (action == MENU_ACTION_OK)
*setting->value.boolean = !(*setting->value.boolean);
}
else
{
switch (action)
{
case MENU_ACTION_OK:
case MENU_ACTION_LEFT:
case MENU_ACTION_RIGHT:
*setting->value.boolean = !(*setting->value.boolean);
break;
case MENU_ACTION_START:
*setting->value.boolean = setting->default_value.boolean;
break;
}
}
if (setting->change_handler)
setting->change_handler(setting);
}
static void menu_common_setting_set_current_path_selection(
rarch_setting_t *setting, const char *start_path,
@ -269,140 +231,6 @@ static void menu_common_setting_set_current_path_selection(
setting->change_handler(setting);
}
static void menu_common_setting_set_current_fraction(
rarch_setting_t *setting, unsigned action)
{
if (!strcmp(setting->name, "video_refresh_rate_auto"))
{
if (action == MENU_ACTION_START)
g_extern.measure_data.frame_time_samples_count = 0;
else if (action == MENU_ACTION_OK)
{
double refresh_rate, deviation = 0.0;
unsigned sample_points = 0;
if (driver_monitor_fps_statistics(&refresh_rate,
&deviation, &sample_points))
{
driver_set_monitor_refresh_rate(refresh_rate);
/* Incase refresh rate update forced non-block video. */
rarch_main_command(RARCH_CMD_VIDEO_SET_BLOCKING_STATE);
}
}
}
else if (!strcmp(setting->name, "fastforward_ratio"))
{
bool clamp_value = false;
if (action == MENU_ACTION_START)
*setting->value.fraction = setting->default_value.fraction;
else if (action == MENU_ACTION_LEFT)
{
*setting->value.fraction -= setting->step;
/* Avoid potential rounding errors when going from 1.1 to 1.0. */
if (*setting->value.fraction < 0.95f)
*setting->value.fraction = setting->default_value.fraction;
else
clamp_value = true;
}
else if (action == MENU_ACTION_RIGHT)
{
*setting->value.fraction += setting->step;
clamp_value = true;
}
if (clamp_value)
g_settings.fastforward_ratio =
max(min(*setting->value.fraction, setting->max), 1.0f);
}
else
{
switch (action)
{
case MENU_ACTION_LEFT:
*setting->value.fraction =
*setting->value.fraction - setting->step;
if (setting->enforce_minrange)
{
if (*setting->value.fraction < setting->min)
*setting->value.fraction = setting->min;
}
break;
case MENU_ACTION_RIGHT:
case MENU_ACTION_OK:
*setting->value.fraction =
*setting->value.fraction + setting->step;
if (setting->enforce_maxrange)
{
if (*setting->value.fraction > setting->max)
*setting->value.fraction = setting->max;
}
break;
case MENU_ACTION_START:
*setting->value.fraction = setting->default_value.fraction;
break;
}
}
if (setting->change_handler)
setting->change_handler(setting);
}
static void menu_common_setting_set_current_unsigned_integer(
rarch_setting_t *setting, unsigned id, unsigned action)
{
if (id == MENU_FILE_LINEFEED)
{
if (action == MENU_ACTION_OK)
menu_key_start_line(driver.menu, setting->short_description,
setting->name, st_uint_callback);
else if (action == MENU_ACTION_START)
*setting->value.unsigned_integer =
setting->default_value.unsigned_integer;
}
else
{
switch (action)
{
case MENU_ACTION_LEFT:
if (*setting->value.unsigned_integer != setting->min)
*setting->value.unsigned_integer =
*setting->value.unsigned_integer - setting->step;
if (setting->enforce_minrange)
{
if (*setting->value.unsigned_integer < setting->min)
*setting->value.unsigned_integer = setting->min;
}
break;
case MENU_ACTION_RIGHT:
case MENU_ACTION_OK:
*setting->value.unsigned_integer =
*setting->value.unsigned_integer + setting->step;
if (setting->enforce_maxrange)
{
if (*setting->value.unsigned_integer > setting->max)
*setting->value.unsigned_integer = setting->max;
}
break;
case MENU_ACTION_START:
*setting->value.unsigned_integer =
setting->default_value.unsigned_integer;
break;
}
}
if (setting->change_handler)
setting->change_handler(setting);
}
static void menu_common_setting_set_current_string_path(
rarch_setting_t *setting, const char *dir, const char *path)
{
@ -434,29 +262,15 @@ void menu_common_setting_set_current_string(
setting->change_handler(setting);
}
static void handle_driver(const char *label, char *driver,
size_t sizeof_driver, unsigned action)
{
switch (action)
{
case MENU_ACTION_LEFT:
find_prev_driver(label, driver, sizeof_driver);
break;
case MENU_ACTION_RIGHT:
find_next_driver(label, driver, sizeof_driver);
break;
}
}
static void handle_setting(rarch_setting_t *setting,
unsigned id, const char *label, unsigned action)
{
if (setting->type == ST_BOOL)
menu_common_setting_set_current_boolean(setting, action);
menu_action_setting_boolean(setting, action);
else if (setting->type == ST_UINT)
menu_common_setting_set_current_unsigned_integer(setting, id, action);
menu_action_setting_unsigned_integer(setting, id, action);
else if (setting->type == ST_FLOAT)
menu_common_setting_set_current_fraction(setting, action);
menu_action_setting_fraction(setting, action);
else if (setting->type == ST_DIR)
{
if (action == MENU_ACTION_START)
@ -472,7 +286,9 @@ static void handle_setting(rarch_setting_t *setting,
setting->default_value.string, setting->name, id, action);
else if (setting->type == ST_STRING)
{
if (id == MENU_FILE_LINEFEED || id == MENU_FILE_LINEFEED_SWITCH)
if (
(setting->flags & SD_FLAG_ALLOW_INPUT) ||
id == MENU_FILE_LINEFEED_SWITCH)
{
if (action == MENU_ACTION_OK)
menu_key_start_line(driver.menu, setting->short_description,
@ -480,16 +296,8 @@ static void handle_setting(rarch_setting_t *setting,
else if (action == MENU_ACTION_START)
*setting->value.string = '\0';
}
else if (!strcmp(setting->name, "audio_resampler_driver"))
{
if (action == MENU_ACTION_LEFT)
find_prev_resampler_driver();
else if (action == MENU_ACTION_RIGHT)
find_next_resampler_driver();
}
else if (id == MENU_FILE_DRIVER)
handle_driver(setting->name, setting->value.string,
setting->size, action);
else
menu_action_setting_driver(setting, action);
}
}
@ -1427,6 +1235,19 @@ static int menu_action_ok(const char *menu_path,
menu_flush_stack_type(driver.menu->menu_stack,MENU_SETTINGS);
return -1;
}
else
{
fill_pathname_join(g_extern.fullpath, menu_path, path,
sizeof(g_extern.fullpath));
menu_common_load_content();
rarch_main_command(RARCH_CMD_LOAD_CONTENT_PERSIST);
menu_flush_stack_type(driver.menu->menu_stack,MENU_SETTINGS);
driver.menu->msg_force = true;
RARCH_LOG("Gets here.\n");
return -1;
}
return 0;
@ -1569,15 +1390,6 @@ static int menu_action_ok(const char *menu_path,
menu_entries_push(driver.menu->menu_stack,
cat_path, menu_label, type, driver.menu->selection_ptr);
}
else
{
fill_pathname_join(g_extern.fullpath, menu_path, path,
sizeof(g_extern.fullpath));
menu_common_load_content();
return -1;
}
return 0;
}

View File

@ -18,6 +18,7 @@
#define _MENU_COMMON_BACKEND_H
#include "../menu_common.h"
#include "../../../settings_data.h"
#ifndef GFX_MAX_PARAMETERS
#define GFX_MAX_PARAMETERS 64
@ -72,4 +73,5 @@ enum
};
#endif
#endif

View File

@ -329,7 +329,7 @@ static int menu_common_shader_manager_setting_toggle(
{
if ((current_setting = setting_data_find_setting(
setting_data, "video_smooth")))
menu_common_setting_set_current_boolean(current_setting, action);
menu_action_setting_boolean(current_setting, action);
}
else if (id >= MENU_SETTINGS_SHADER_PARAMETER_0
&& id <= MENU_SETTINGS_SHADER_PARAMETER_LAST)

View File

@ -21,7 +21,7 @@
#include <string.h>
#include <limits.h>
#include <ctype.h>
#include "menu_common_backend.h"
#include "../menu_action.h"
#include "../menu_navigation.h"
#include "../../../gfx/gfx_common.h"
@ -39,15 +39,19 @@
#include "../../../config.h"
#endif
// Move the categories left or right depending on the menu_active_category variable
/* Move the categories left or right depending
* on the menu_active_category variable. */
static void lakka_switch_categories(void)
{
int i, j;
// translation
add_tween(LAKKA_DELAY, -menu_active_category * hspacing, &all_categories_x, &inOutQuad, NULL);
/* Translation */
add_tween(LAKKA_DELAY,
-menu_active_category * hspacing,
&all_categories_x, &inOutQuad, NULL);
// alpha tweening
/* Alpha tweening */
for (i = 0; i < num_categories; i++)
{
float ca, cz;
@ -63,10 +67,17 @@ static void lakka_switch_categories(void)
for (j = 0; j < category->num_items; j++)
{
float ia = (i != menu_active_category ) ? 0 :
(j == category->active_item) ? 1.0 : 0.5;
float ia = 0;
add_tween(LAKKA_DELAY, ia, &category->items[j].alpha, &inOutQuad, NULL);
if (i == menu_active_category)
{
ia = 0.5;
if (j == category->active_item)
ia = 1.0;
}
add_tween(LAKKA_DELAY, ia,
&category->items[j].alpha,&inOutQuad, NULL);
}
}
}
@ -74,21 +85,29 @@ static void lakka_switch_categories(void)
static void lakka_switch_items(void)
{
int j;
menu_category_t *active_category = (menu_category_t*)&categories[menu_active_category];
menu_category_t *active_category = (menu_category_t*)
&categories[menu_active_category];
for (j = 0; j < active_category->num_items; j++)
{
float ia, iz, iy;
float iy;
float ia = 0.5;
float iz = i_passive_zoom;
menu_item_t *active_item = (menu_item_t*)&active_category->items[j];
if (!active_item)
continue;
ia = (j == active_category->active_item) ? 1.0 : 0.5;
iz = (j == active_category->active_item) ? i_active_zoom : i_passive_zoom;
iy = (j == active_category->active_item) ? vspacing*active_item_factor :
(j < active_category->active_item) ? vspacing*(j - active_category->active_item + above_item_offset) :
vspacing*(j - active_category->active_item + under_item_offset);
iy = (j < active_category->active_item) ? vspacing *
(j - active_category->active_item + above_item_offset) :
vspacing * (j - active_category->active_item + under_item_offset);
if (j == active_category->active_item)
{
ia = 1.0;
iz = i_active_zoom;
iy = vspacing * active_item_factor;
}
add_tween(LAKKA_DELAY, ia, &active_item->alpha, &inOutQuad, NULL);
add_tween(LAKKA_DELAY, iz, &active_item->zoom, &inOutQuad, NULL);
@ -99,8 +118,10 @@ static void lakka_switch_items(void)
static void lakka_switch_subitems(void)
{
int k;
menu_category_t *active_category = (menu_category_t*)&categories[menu_active_category];
menu_item_t *item = (menu_item_t*)&active_category->items[active_category->active_item];
menu_category_t *active_category = (menu_category_t*)
&categories[menu_active_category];
menu_item_t *item = (menu_item_t*)
&active_category->items[active_category->active_item];
for (k = 0; k < item->num_subitems; k++)
{
@ -112,23 +133,30 @@ static void lakka_switch_subitems(void)
if (k < item->active_subitem)
{
/* Above items */
add_tween(LAKKA_DELAY, 0.5, &subitem->alpha, &inOutQuad, NULL);
add_tween(LAKKA_DELAY, vspacing*(k - item->active_subitem + above_subitem_offset), &subitem->y, &inOutQuad, NULL);
add_tween(LAKKA_DELAY, i_passive_zoom, &subitem->zoom, &inOutQuad, NULL);
add_tween(LAKKA_DELAY, 0.5,
&subitem->alpha, &inOutQuad, NULL);
add_tween(LAKKA_DELAY, vspacing*(k - item->active_subitem +
above_subitem_offset), &subitem->y, &inOutQuad, NULL);
add_tween(LAKKA_DELAY, i_passive_zoom,
&subitem->zoom, &inOutQuad, NULL);
}
else if (k == item->active_subitem)
{
/* Active item */
add_tween(LAKKA_DELAY, 1.0, &subitem->alpha, &inOutQuad, NULL);
add_tween(LAKKA_DELAY, vspacing*active_item_factor, &subitem->y, &inOutQuad, NULL);
add_tween(LAKKA_DELAY, i_active_zoom, &subitem->zoom, &inOutQuad, NULL);
add_tween(LAKKA_DELAY, vspacing*active_item_factor,
&subitem->y, &inOutQuad, NULL);
add_tween(LAKKA_DELAY, i_active_zoom,
&subitem->zoom, &inOutQuad, NULL);
}
else if (k > item->active_subitem)
{
/* Under items */
add_tween(LAKKA_DELAY, 0.5, &subitem->alpha, &inOutQuad, NULL);
add_tween(LAKKA_DELAY, vspacing*(k - item->active_subitem + under_item_offset), &subitem->y, &inOutQuad, NULL);
add_tween(LAKKA_DELAY, i_passive_zoom, &subitem->zoom, &inOutQuad, NULL);
add_tween(LAKKA_DELAY, vspacing*(k - item->active_subitem +
under_item_offset), &subitem->y, &inOutQuad, NULL);
add_tween(LAKKA_DELAY, i_passive_zoom,
&subitem->zoom, &inOutQuad, NULL);
}
}
}
@ -136,36 +164,45 @@ static void lakka_switch_subitems(void)
static void lakka_reset_submenu(void)
{
int i, j, k;
menu_category_t *active_category = (menu_category_t*)&categories[menu_active_category];
menu_category_t *active_category = (menu_category_t*)
&categories[menu_active_category];
if (!(
bool do_reset = (!(
g_extern.main_is_init
&& !g_extern.libretro_dummy
&& strcmp(g_extern.fullpath, active_category->items[active_category->active_item].rom) == 0))
&& (!strcmp(g_extern.fullpath,
active_category->items[
active_category->active_item].rom))));
if (!do_reset)
return;
/* Keeps active submenu state (do we really want that?) */
active_category->items[active_category->active_item].active_subitem = 0;
for (i = 0; i < num_categories; i++)
{
menu_category_t *category = (menu_category_t*)&categories[i];
// Keeps active submenu state (do we really want that?)
active_category->items[active_category->active_item].active_subitem = 0;
for (i = 0; i < num_categories; i++)
if (!category)
continue;
for (j = 0; j < category->num_items; j++)
{
menu_category_t *category = (menu_category_t*)&categories[i];
if (!category)
continue;
for (j = 0; j < category->num_items; j++)
for (k = 0; k < category->items[j].num_subitems; k++)
{
for (k = 0; k < category->items[j].num_subitems; k++)
{
menu_subitem_t *subitem = (menu_subitem_t*)&category->items[j].subitems[k];
menu_subitem_t *subitem = (menu_subitem_t*)
&category->items[j].subitems[k];
if (!subitem)
continue;
if (!subitem)
continue;
subitem->alpha = 0;
subitem->zoom = k == category->items[j].active_subitem ? i_active_zoom : i_passive_zoom;
subitem->y = k == 0 ? vspacing * active_item_factor : vspacing * (k + under_item_offset);
}
subitem->alpha = 0;
subitem->zoom = (k == category->items[j].active_subitem) ?
i_active_zoom : i_passive_zoom;
subitem->y = k == 0 ?
vspacing * active_item_factor :
vspacing * (k + under_item_offset);
}
}
}
@ -175,10 +212,11 @@ static void lakka_open_submenu(void)
{
int i, j, k;
add_tween(LAKKA_DELAY, -hspacing * (menu_active_category+1), &all_categories_x, &inOutQuad, NULL);
add_tween(LAKKA_DELAY, -hspacing * (menu_active_category+1),
&all_categories_x, &inOutQuad, NULL);
add_tween(LAKKA_DELAY, 1.0, &arrow_alpha, &inOutQuad, NULL);
// Reset contextual menu style
/* Reset contextual menu style */
lakka_reset_submenu();
for (i = 0; i < num_categories; i++)
@ -189,10 +227,12 @@ static void lakka_open_submenu(void)
continue;
if (i != menu_active_category)
add_tween(LAKKA_DELAY, 0, &category->alpha, &inOutQuad, NULL);
add_tween(LAKKA_DELAY, 0,
&category->alpha, &inOutQuad, NULL);
else
{
add_tween(LAKKA_DELAY, 1.0, &category->alpha, &inOutQuad, NULL);
add_tween(LAKKA_DELAY, 1.0,
&category->alpha, &inOutQuad, NULL);
for (j = 0; j < category->num_items; j++)
{
@ -200,22 +240,28 @@ static void lakka_open_submenu(void)
{
for (k = 0; k < category->items[j].num_subitems; k++)
{
menu_subitem_t *subitem = (menu_subitem_t*)&category->items[j].subitems[k];
menu_subitem_t *subitem = (menu_subitem_t*)
&category->items[j].subitems[k];
if (k == category->items[j].active_subitem)
{
add_tween(LAKKA_DELAY, 1.0, &subitem->alpha, &inOutQuad, NULL);
add_tween(LAKKA_DELAY, i_active_zoom, &subitem->zoom, &inOutQuad, NULL);
add_tween(LAKKA_DELAY, 1.0,
&subitem->alpha, &inOutQuad, NULL);
add_tween(LAKKA_DELAY, i_active_zoom,
&subitem->zoom, &inOutQuad, NULL);
}
else
{
add_tween(LAKKA_DELAY, 0.5, &subitem->alpha, &inOutQuad, NULL);
add_tween(LAKKA_DELAY, i_passive_zoom, &subitem->zoom, &inOutQuad, NULL);
add_tween(LAKKA_DELAY, 0.5,
&subitem->alpha, &inOutQuad, NULL);
add_tween(LAKKA_DELAY, i_passive_zoom,
&subitem->zoom, &inOutQuad, NULL);
}
}
}
else
add_tween(LAKKA_DELAY, 0, &category->items[j].alpha, &inOutQuad, NULL);
add_tween(LAKKA_DELAY, 0,
&category->items[j].alpha, &inOutQuad, NULL);
}
}
}
@ -225,7 +271,8 @@ static void lakka_close_submenu(void)
{
int i, j, k;
add_tween(LAKKA_DELAY, -hspacing * menu_active_category, &all_categories_x, &inOutQuad, NULL);
add_tween(LAKKA_DELAY, -hspacing * menu_active_category,
&all_categories_x, &inOutQuad, NULL);
add_tween(LAKKA_DELAY, 0.0, &arrow_alpha, &inOutQuad, NULL);
for (i = 0; i < num_categories; i++)
@ -238,36 +285,45 @@ static void lakka_close_submenu(void)
if (i == menu_active_category)
{
add_tween(LAKKA_DELAY, 1.0, &category->alpha, &inOutQuad, NULL);
add_tween(LAKKA_DELAY, c_active_zoom, &category->zoom, &inOutQuad, NULL);
add_tween(LAKKA_DELAY, c_active_zoom,
&category->zoom, &inOutQuad, NULL);
for (j = 0; j < category->num_items; j++)
{
if (j == category->active_item)
{
add_tween(LAKKA_DELAY, 1.0, &category->items[j].alpha, &inOutQuad, NULL);
add_tween(LAKKA_DELAY, 1.0,
&category->items[j].alpha, &inOutQuad, NULL);
for (k = 0; k < category->items[j].num_subitems; k++)
add_tween(LAKKA_DELAY, 0, &category->items[j].subitems[k].alpha, &inOutQuad, NULL);
add_tween(LAKKA_DELAY, 0,
&category->items[j].subitems[k].alpha,
&inOutQuad, NULL);
}
else
add_tween(LAKKA_DELAY, 0.5, &category->items[j].alpha, &inOutQuad, NULL);
add_tween(LAKKA_DELAY, 0.5,
&category->items[j].alpha, &inOutQuad, NULL);
}
}
else
{
add_tween(LAKKA_DELAY, 0.5, &category->alpha, &inOutQuad, NULL);
add_tween(LAKKA_DELAY, c_passive_zoom, &category->zoom, &inOutQuad, NULL);
add_tween(LAKKA_DELAY, 0.5,
&category->alpha, &inOutQuad, NULL);
add_tween(LAKKA_DELAY, c_passive_zoom,
&category->zoom, &inOutQuad, NULL);
for (j = 0; j < category->num_items; j++)
add_tween(LAKKA_DELAY, 0, &category->items[j].alpha, &inOutQuad, NULL);
add_tween(LAKKA_DELAY, 0,
&category->items[j].alpha, &inOutQuad, NULL);
}
}
}
static int menu_lakka_iterate(unsigned action)
{
menu_category_t *active_category;
menu_item_t *active_item;
menu_category_t *active_category = NULL;
menu_item_t *active_item = NULL;
menu_subitem_t * active_subitem = NULL;
if (!driver.menu)
{
@ -275,13 +331,15 @@ static int menu_lakka_iterate(unsigned action)
return 0;
}
active_category = NULL;
active_item = NULL;
active_category = (menu_category_t*)&categories[menu_active_category];
if (active_category)
active_item = (menu_item_t*)&active_category->items[active_category->active_item];
active_item = (menu_item_t*)
&active_category->items[active_category->active_item];
if (active_item)
active_subitem = (menu_subitem_t*)
&active_item->subitems[active_item->active_subitem];
if (!active_category || !active_item)
return 0;
@ -289,6 +347,34 @@ static int menu_lakka_iterate(unsigned action)
if (driver.video_data && driver.menu_ctx && driver.menu_ctx->set_texture)
driver.menu_ctx->set_texture(driver.menu);
if (action && depth == 1 && menu_active_category == 0
&& active_subitem->setting)
{
switch (action)
{
case MENU_ACTION_LEFT:
case MENU_ACTION_RIGHT:
case MENU_ACTION_OK:
case MENU_ACTION_START:
{
rarch_setting_t *setting = (rarch_setting_t*)
active_subitem->setting;
if (setting->type == ST_BOOL)
menu_action_setting_boolean(setting, action);
else if (setting->type == ST_UINT)
menu_action_setting_unsigned_integer(setting, 0, action);
else if (setting->type == ST_FLOAT)
menu_action_setting_fraction(setting, action);
else if (setting->type == ST_STRING)
menu_action_setting_driver(setting, action);
}
break;
default:
break;
}
}
switch (action)
{
case MENU_ACTION_LEFT:
@ -322,15 +408,26 @@ static int menu_lakka_iterate(unsigned action)
break;
case MENU_ACTION_DOWN:
if (depth == 0 && active_category->active_item < active_category->num_items - 1)
if (depth == 0
&& (active_category->active_item <
(active_category->num_items - 1)))
{
active_category->active_item++;
lakka_switch_items();
}
if (depth == 1 // if we are on subitems level
&& active_item->active_subitem < active_item->num_subitems -1 // and we do not exceed the number of subitems
&& (menu_active_category == 0 // and we are in settings or a rom is launched
|| ((active_item->active_subitem < active_item->num_subitems -1) && (g_extern.main_is_init && !g_extern.libretro_dummy) && strcmp(g_extern.fullpath, active_item->rom) == 0)))
/* If we are on subitems level, and we do not
* exceed the number of subitems, and we
* are in settings or content is launched. */
if (depth == 1
&& (active_item->active_subitem <
(active_item->num_subitems -1))
&& (menu_active_category == 0
|| ((active_item->active_subitem <
(active_item->num_subitems - 1))
&&
(g_extern.main_is_init && !g_extern.libretro_dummy)
&& (!strcmp(g_extern.fullpath, active_item->rom)))))
{
active_item->active_subitem++;
lakka_switch_subitems();
@ -351,21 +448,24 @@ static int menu_lakka_iterate(unsigned action)
break;
case MENU_ACTION_OK:
if (depth == 1)
if (depth == 1 && menu_active_category > 0)
{
switch (active_item->active_subitem)
{
case 0:
global_alpha = 0.0;
if (g_extern.main_is_init && !g_extern.libretro_dummy
&& strcmp(g_extern.fullpath, active_item->rom) == 0)
&& (!strcmp(g_extern.fullpath, active_item->rom)))
{
rarch_main_command(RARCH_CMD_RESUME);
}
else
{
strlcpy(g_extern.fullpath, active_item->rom, sizeof(g_extern.fullpath));
strlcpy(g_settings.libretro, active_category->libretro, sizeof(g_settings.libretro));
strlcpy(g_extern.fullpath,
active_item->rom, sizeof(g_extern.fullpath));
strlcpy(g_settings.libretro,
active_category->libretro,
sizeof(g_settings.libretro));
#ifdef HAVE_DYNAMIC
rarch_main_command(RARCH_CMD_LOAD_CORE);
@ -399,7 +499,10 @@ static int menu_lakka_iterate(unsigned action)
lakka_open_submenu();
depth = 1;
}
else if (depth == 0 && menu_active_category == 0 && active_category->active_item == active_category->num_items-1)
else if (depth == 0 &&
(menu_active_category == 0 &&
(active_category->active_item ==
(active_category->num_items - 1))))
{
add_tween(LAKKA_DELAY, 1.0, &global_alpha, &inOutQuad, NULL);
rarch_main_set_state(RARCH_ACTION_STATE_RUNNING_FINISHED);

View File

@ -207,7 +207,7 @@ static void glui_frame(void)
type_str, selected);
snprintf(message, sizeof(message), "%c %-*.*s %-*s",
selected ? '>' : ' ',
' ',
GLUI_TERM_WIDTH - (w + 1 + 2),
GLUI_TERM_WIDTH - (w + 1 + 2),
entry_title_buf,

View File

@ -536,9 +536,12 @@ static void lakka_draw_subitems(int i, int j)
}
}
if (subitem->value)
if (subitem->setting)
{
lakka_draw_text(subitem->value,
char val[256];
setting_data_get_string_representation(subitem->setting, val,
sizeof(val));
lakka_draw_text(val,
margin_left + hspacing * (i+2.25) +
all_categories_x + label_margin_left + 400,
margin_top + subitem->y + label_margin_top,
@ -783,8 +786,7 @@ void lakka_init_settings(void)
subitem->y = kk ? vspacing * (kk + under_item_offset)
: vspacing * active_item_factor;
setting_data_get_string_representation(&setting, subitem->value,
sizeof(subitem->value));
subitem->setting = &setting_data[k];
kk++;
}

View File

@ -51,7 +51,7 @@ typedef struct
float alpha;
float zoom;
float y;
char value[256];
rarch_setting_t *setting;
} menu_subitem_t;
typedef struct

View File

@ -145,10 +145,17 @@ static void blit_line(int x, int y, const char *message, bool green)
}
}
static void init_font(menu_handle_t *menu, const uint8_t *font_bmp_buf)
static bool init_font(menu_handle_t *menu, const uint8_t *font_bmp_buf)
{
unsigned i;
uint8_t *font = (uint8_t *) calloc(1, FONT_OFFSET(256));
if (!font)
{
RARCH_ERR("Font memory allocation failed in %s", __FUNCTION__);
return false;
}
menu->alloc_font = true;
for (i = 0; i < 256; i++)
{
@ -159,6 +166,7 @@ static void init_font(menu_handle_t *menu, const uint8_t *font_bmp_buf)
}
menu->font = font;
return true;
}
static bool rguidisp_init_font(void *data)
@ -169,7 +177,7 @@ static bool rguidisp_init_font(void *data)
const uint8_t *font_bin_buf = bitmap_bin;
if (font_bmp_buf)
init_font(menu, font_bmp_buf);
return init_font(menu, font_bmp_buf);
else if (font_bin_buf)
menu->font = font_bin_buf;
else

219
frontend/menu/menu_action.c Normal file
View File

@ -0,0 +1,219 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
* Copyright (C) 2011-2014 - Daniel De Matteis
*
* 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 <http://www.gnu.org/licenses/>.
*/
#include "menu_common.h"
#include "menu_input_line_cb.h"
#include "menu_action.h"
void menu_action_setting_boolean(
rarch_setting_t *setting, unsigned action)
{
if (
!strcmp(setting->name, "savestate") ||
!strcmp(setting->name, "loadstate"))
{
if (action == MENU_ACTION_START)
g_settings.state_slot = 0;
else if (action == MENU_ACTION_LEFT)
{
// Slot -1 is (auto) slot.
if (g_settings.state_slot >= 0)
g_settings.state_slot--;
}
else if (action == MENU_ACTION_RIGHT)
g_settings.state_slot++;
else if (action == MENU_ACTION_OK)
*setting->value.boolean = !(*setting->value.boolean);
}
else
{
switch (action)
{
case MENU_ACTION_OK:
case MENU_ACTION_LEFT:
case MENU_ACTION_RIGHT:
*setting->value.boolean = !(*setting->value.boolean);
break;
case MENU_ACTION_START:
*setting->value.boolean = setting->default_value.boolean;
break;
}
}
if (setting->change_handler)
setting->change_handler(setting);
}
void menu_action_setting_unsigned_integer(
rarch_setting_t *setting, unsigned id, unsigned action)
{
if (id == MENU_FILE_LINEFEED)
{
if (action == MENU_ACTION_OK)
menu_key_start_line(driver.menu, setting->short_description,
setting->name, st_uint_callback);
else if (action == MENU_ACTION_START)
*setting->value.unsigned_integer =
setting->default_value.unsigned_integer;
}
else
{
switch (action)
{
case MENU_ACTION_LEFT:
if (*setting->value.unsigned_integer != setting->min)
*setting->value.unsigned_integer =
*setting->value.unsigned_integer - setting->step;
if (setting->enforce_minrange)
{
if (*setting->value.unsigned_integer < setting->min)
*setting->value.unsigned_integer = setting->min;
}
break;
case MENU_ACTION_RIGHT:
case MENU_ACTION_OK:
*setting->value.unsigned_integer =
*setting->value.unsigned_integer + setting->step;
if (setting->enforce_maxrange)
{
if (*setting->value.unsigned_integer > setting->max)
*setting->value.unsigned_integer = setting->max;
}
break;
case MENU_ACTION_START:
*setting->value.unsigned_integer =
setting->default_value.unsigned_integer;
break;
}
}
if (setting->change_handler)
setting->change_handler(setting);
}
void menu_action_setting_fraction(
rarch_setting_t *setting, unsigned action)
{
if (!strcmp(setting->name, "video_refresh_rate_auto"))
{
if (action == MENU_ACTION_START)
g_extern.measure_data.frame_time_samples_count = 0;
else if (action == MENU_ACTION_OK)
{
double refresh_rate, deviation = 0.0;
unsigned sample_points = 0;
if (driver_monitor_fps_statistics(&refresh_rate,
&deviation, &sample_points))
{
driver_set_monitor_refresh_rate(refresh_rate);
/* Incase refresh rate update forced non-block video. */
rarch_main_command(RARCH_CMD_VIDEO_SET_BLOCKING_STATE);
}
}
}
else if (!strcmp(setting->name, "fastforward_ratio"))
{
bool clamp_value = false;
if (action == MENU_ACTION_START)
*setting->value.fraction = setting->default_value.fraction;
else if (action == MENU_ACTION_LEFT)
{
*setting->value.fraction -= setting->step;
/* Avoid potential rounding errors when going from 1.1 to 1.0. */
if (*setting->value.fraction < 0.95f)
*setting->value.fraction = setting->default_value.fraction;
else
clamp_value = true;
}
else if (action == MENU_ACTION_RIGHT)
{
*setting->value.fraction += setting->step;
clamp_value = true;
}
if (clamp_value)
g_settings.fastforward_ratio =
max(min(*setting->value.fraction, setting->max), 1.0f);
}
else
{
switch (action)
{
case MENU_ACTION_LEFT:
*setting->value.fraction =
*setting->value.fraction - setting->step;
if (setting->enforce_minrange)
{
if (*setting->value.fraction < setting->min)
*setting->value.fraction = setting->min;
}
break;
case MENU_ACTION_RIGHT:
case MENU_ACTION_OK:
*setting->value.fraction =
*setting->value.fraction + setting->step;
if (setting->enforce_maxrange)
{
if (*setting->value.fraction > setting->max)
*setting->value.fraction = setting->max;
}
break;
case MENU_ACTION_START:
*setting->value.fraction = setting->default_value.fraction;
break;
}
}
if (setting->change_handler)
setting->change_handler(setting);
}
void menu_action_setting_driver(
rarch_setting_t *setting, unsigned action)
{
if (!strcmp(setting->name, "audio_resampler_driver"))
{
if (action == MENU_ACTION_LEFT)
find_prev_resampler_driver();
else if (action == MENU_ACTION_RIGHT)
find_next_resampler_driver();
}
else if (setting->flags & SD_FLAG_IS_DRIVER)
{
const char *label = setting->name;
char *driver = (char*)setting->value.string;
size_t sizeof_driver = setting->size;
switch (action)
{
case MENU_ACTION_LEFT:
find_prev_driver(label, driver, sizeof_driver);
break;
case MENU_ACTION_RIGHT:
find_next_driver(label, driver, sizeof_driver);
break;
}
}
}

View File

@ -0,0 +1,34 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
* Copyright (C) 2011-2014 - Daniel De Matteis
*
* 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 <http://www.gnu.org/licenses/>.
*/
#ifndef _MENU_ACTION_H
#define _MENU_ACTION_H
#include "../../settings_data.h"
void menu_action_setting_boolean(
rarch_setting_t *setting, unsigned action);
void menu_action_setting_fraction(
rarch_setting_t *setting, unsigned action);
void menu_action_setting_unsigned_integer(
rarch_setting_t *setting, unsigned id, unsigned action);
void menu_action_setting_driver(
rarch_setting_t *setting, unsigned action);
#endif

View File

@ -83,31 +83,31 @@ static void menu_environment_get(int *argc, char *argv[],
bool load_menu_content(void)
{
if (driver.menu)
if (*g_extern.fullpath || (driver.menu && driver.menu->load_no_content))
{
if (*g_extern.fullpath || driver.menu->load_no_content)
if (*g_extern.fullpath)
{
if (*g_extern.fullpath)
{
char tmp[PATH_MAX];
char str[PATH_MAX];
char tmp[PATH_MAX];
char str[PATH_MAX];
fill_pathname_base(tmp, g_extern.fullpath, sizeof(tmp));
snprintf(str, sizeof(str), "INFO - Loading %s ...", tmp);
msg_queue_push(g_extern.msg_queue, str, 1, 1);
}
content_playlist_push(g_extern.history,
g_extern.fullpath,
g_settings.libretro,
g_extern.menu.info.library_name);
fill_pathname_base(tmp, g_extern.fullpath, sizeof(tmp));
snprintf(str, sizeof(str), "INFO - Loading %s ...", tmp);
msg_queue_push(g_extern.msg_queue, str, 1, 1);
}
content_playlist_push(g_extern.history,
g_extern.fullpath,
g_settings.libretro,
g_extern.menu.info.library_name);
}
/* redraw menu frame */
driver.menu->old_input_state = driver.menu->trigger_state = 0;
driver.menu->do_held = false;
driver.menu->msg_force = true;
if (driver.menu)
{
driver.menu->old_input_state = driver.menu->trigger_state = 0;
driver.menu->do_held = false;
driver.menu->msg_force = true;
}
if (driver.menu_ctx && driver.menu_ctx->backend &&
driver.menu_ctx->backend->iterate)

View File

@ -178,9 +178,9 @@ int menu_entries_push_list(menu_handle_t *menu,
if (!strcmp(label, "mainmenu"))
{
rarch_setting_t *setting;
setting_data = (rarch_setting_t *)setting_data_get_mainmenu(true);
rarch_setting_t *setting = (rarch_setting_t*)setting_data_find_setting(setting_data,
"Main Menu");
setting = (rarch_setting_t*)setting_data_find_setting(setting_data, "Main Menu");
file_list_clear(list);

View File

@ -234,6 +234,7 @@ static void frontend_xdk_get_environment_settings(int *argc, char *argv[],
}
#endif
exit:
#ifndef IS_SALAMANDER
g_extern.verbosity = original_verbose;
#endif

View File

@ -95,6 +95,7 @@ enum basic_event
RARCH_CMD_NONE = 0,
RARCH_CMD_RESET,
RARCH_CMD_LOAD_CONTENT,
RARCH_CMD_LOAD_CONTENT_PERSIST,
RARCH_CMD_LOAD_CORE,
RARCH_CMD_LOAD_STATE,
RARCH_CMD_SAVE_STATE,
@ -147,6 +148,7 @@ enum action_state
RARCH_ACTION_STATE_FLUSH_INPUT,
RARCH_ACTION_STATE_FLUSH_INPUT_FINISHED,
RARCH_ACTION_STATE_QUIT,
RARCH_ACTION_STATE_FORCE_QUIT,
};
enum menu_enums

View File

@ -15,12 +15,8 @@
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifdef _XBOX
#include "../d3d9/xdk_d3d.h"
#else
#include "../d3d9/d3d.hpp"
#include "win32_common.h"
#endif
#include "../gfx_common.h"

View File

@ -20,10 +20,12 @@
extern "C" {
#endif
#ifndef _XBOX
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
LRESULT win32_handle_keyboard_event(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam);
#endif
#ifdef __cplusplus
}

View File

@ -15,14 +15,24 @@
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifdef _XBOX
#include <xtl.h>
#include <xgraphics.h>
#endif
#include "d3d.hpp"
#ifndef _XBOX
#include "render_chain.hpp"
#endif
#include "../../file.h"
#include "../gfx_common.h"
#include "../context/win32_common.h"
#ifndef _XBOX
#define HAVE_MONITOR
#define HAVE_WINDOW
#endif
#include "../../compat/posix_string.h"
#include "../../performance.h"
@ -31,27 +41,18 @@
#define HAVE_SHADERS
#endif
/* forward decls */
static bool d3d_init_luts(d3d_video_t *d3d);
static void d3d_set_font_rect(d3d_video_t *d3d,
const struct font_params *params);
static bool d3d_process_shader(d3d_video_t *d3d);
static bool d3d_init_multipass(d3d_video_t *d3d);
static void d3d_deinit_chain(d3d_video_t *d3d);
#ifdef HAVE_HLSL
#include "../../gfx/shader_hlsl.h"
#endif
#include "d3d_shared.h"
#ifdef _XBOX
#include "../../xdk/xdk_resources.h"
#include "render_chain_xdk.h"
#endif
#ifdef HAVE_MONITOR
#define IDI_ICON 1
#define MAX_MONITORS 9
namespace Monitor
{
static HMONITOR last_hm;
static HMONITOR all_hms[MAX_MONITORS];
static unsigned num_mons;
}
static BOOL CALLBACK monitor_enum_proc(HMONITOR hMonitor,
HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData)
{
@ -98,6 +99,7 @@ static RECT d3d_monitor_rect(d3d_video_t *d3d)
}
#endif
#ifndef _XBOX
static void d3d_recompute_pass_sizes(d3d_video_t *d3d)
{
LinkInfo link_info = {0};
@ -139,6 +141,7 @@ static void d3d_recompute_pass_sizes(d3d_video_t *d3d)
link_info.pass = &d3d->shader.pass[i];
}
}
#endif
#ifndef DONT_HAVE_STATE_TRACKER
static bool d3d_init_imports(d3d_video_t *d3d)
@ -180,13 +183,27 @@ static bool d3d_init_chain(d3d_video_t *d3d, const video_info_t *video_info)
{
LPDIRECT3DDEVICE d3dr = (LPDIRECT3DDEVICE)d3d->dev;
/* Setup information for first pass. */
LinkInfo link_info = {0};
#ifdef _XBOX
/* TODO - properly implement this. */
d3d_video_t *link_info = (d3d_video_t*)d3d;
link_info->tex_w = link_info->tex_h =
RARCH_SCALE_BASE * video_info->input_scale;
//d3d_deinit_chain(d3d);
#else
LinkInfo link_info = {0};
link_info.pass = &d3d->shader.pass[0];
link_info.tex_w = link_info.tex_h =
video_info->input_scale * RARCH_SCALE_BASE;
#endif
d3d_deinit_chain(d3d);
#ifdef _XBOX
if (!renderchain_init(d3d, video_info))
{
RARCH_ERR("[D3D]: Failed to init render chain.\n");
return false;
}
#else
d3d->chain = new renderchain_t();
if (!d3d->chain)
return false;
@ -229,18 +246,138 @@ static bool d3d_init_chain(d3d_video_t *d3d, const video_info_t *video_info)
RARCH_ERR("[D3D9]: Failed to init LUTs.\n");
return false;
}
#endif
#ifndef _XBOX
#ifndef DONT_HAVE_STATE_TRACKER
if (!d3d_init_imports(d3d))
{
RARCH_ERR("[D3D9]: Failed to init imports.\n");
return false;
}
#endif
#endif
return true;
}
#ifdef _XBOX
static void d3d_reinit_renderchain(void *data,
const video_info_t *video)
{
d3d_video_t *d3d = (d3d_video_t*)data;
d3d->pixel_size = video->rgb32 ?
sizeof(uint32_t) : sizeof(uint16_t);
d3d->tex_w = d3d->tex_h =
RARCH_SCALE_BASE * video->input_scale;
RARCH_LOG(
"Reinitializing renderchain - and textures (%u x %u @ %u bpp)\n",
d3d->tex_w, d3d->tex_h, d3d->pixel_size * CHAR_BIT);
d3d_deinit_chain(d3d);
d3d_init_chain(d3d, video);
}
#endif
#ifdef _XBOX
#ifdef HAVE_RMENU
extern struct texture_image *menu_texture;
#endif
#ifdef _XBOX1
static bool texture_image_render(void *data,
struct texture_image *out_img,
int x, int y, int w, int h, bool force_fullscreen)
{
d3d_video_t *d3d = (d3d_video_t*)data;
LPDIRECT3DDEVICE d3dr = (LPDIRECT3DDEVICE)d3d->dev;
if (out_img->pixels == NULL || out_img->vertex_buf == NULL)
return false;
float fX = static_cast<float>(x);
float fY = static_cast<float>(y);
// create the new vertices
Vertex newVerts[] =
{
// x, y, z, color, u ,v
{fX, fY, 0.0f, 0, 0, 0},
{fX + w, fY, 0.0f, 0, 1, 0},
{fX + w, fY + h, 0.0f, 0, 1, 1},
{fX, fY + h, 0.0f, 0, 0, 1}
};
// load the existing vertices
Vertex *pCurVerts;
HRESULT ret = out_img->vertex_buf->Lock(0, 0,
(unsigned char**)&pCurVerts, 0);
if (FAILED(ret))
return false;
// copy the new verts over the old verts
memcpy(pCurVerts, newVerts, 4 * sizeof(Vertex));
out_img->vertex_buf->Unlock();
d3d->dev->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE);
d3d->dev->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);
d3d->dev->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA);
/* Also blend the texture with the set alpha value. */
d3d->dev->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_MODULATE);
d3d->dev->SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_DIFFUSE);
d3d->dev->SetTextureStageState(0, D3DTSS_ALPHAARG2, D3DTA_TEXTURE);
/* Draw the quad. */
d3dr->SetTexture(0, out_img->pixels);
d3d_set_stream_source(d3dr, 0,
out_img->vertex_buf, 0, sizeof(Vertex));
d3dr->SetVertexShader(D3DFVF_CUSTOMVERTEX);
if (force_fullscreen)
{
D3DVIEWPORT vp = {0};
vp.Width = w;
vp.Height = h;
vp.X = 0;
vp.Y = 0;
vp.MinZ = 0.0f;
vp.MaxZ = 1.0f;
d3dr->SetViewport(&vp);
}
d3d_draw_primitive(d3dr, D3DPT_QUADLIST, 0, 1);
return true;
}
#endif
#ifdef HAVE_MENU
static void d3d_draw_texture(void *data)
{
d3d_video_t *d3d = (d3d_video_t*)data;
#if defined(HAVE_RMENU)
menu_texture->x = 0;
menu_texture->y = 0;
if (d3d->menu_texture_enable)
{
d3d->dev->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_ONE);
d3d->dev->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA);
d3d->dev->SetRenderState(D3DRS_ALPHABLENDENABLE, true);
texture_image_render(d3d, menu_texture,
menu_texture->x, menu_texture->y,
d3d->screen_width, d3d->screen_height, true);
d3d->dev->SetRenderState(D3DRS_ALPHABLENDENABLE, false);
}
#endif
}
#endif
#endif
#ifdef HAVE_FBO
static bool d3d_init_multipass(d3d_video_t *d3d)
{
@ -332,6 +469,7 @@ static void d3d_set_font_rect(d3d_video_t *d3d,
static bool d3d_init_singlepass(d3d_video_t *d3d)
{
#ifndef _XBOX
memset(&d3d->shader, 0, sizeof(d3d->shader));
d3d->shader.passes = 1;
gfx_shader_pass &pass = d3d->shader.pass[0];
@ -340,6 +478,7 @@ static bool d3d_init_singlepass(d3d_video_t *d3d)
pass.fbo.type_x = pass.fbo.type_y = RARCH_SCALE_VIEWPORT;
strlcpy(pass.source.path, d3d->cg_shader.c_str(),
sizeof(pass.source.path));
#endif
return true;
}
@ -355,6 +494,7 @@ static bool d3d_process_shader(d3d_video_t *d3d)
return d3d_init_singlepass(d3d);
}
#ifndef _XBOX
static bool d3d_init_luts(d3d_video_t *d3d)
{
for (unsigned i = 0; i < d3d->shader.luts; i++)
@ -371,15 +511,8 @@ static bool d3d_init_luts(d3d_video_t *d3d)
return true;
}
#ifdef HAVE_WINDOW
extern LRESULT CALLBACK WindowProc(HWND hWnd, UINT message,
WPARAM wParam, LPARAM lParam);
#endif
static void d3d_calculate_rect(d3d_video_t *d3d, unsigned width,
unsigned height, bool keep, float desired_aspect);
#ifdef HAVE_OVERLAY
#include "d3d_overlays.cpp"
#endif
@ -415,13 +548,16 @@ static bool d3d_frame(void *data, const void *frame,
d3d->screen_height, d3d->video_info.force_aspect,
g_extern.system.aspect_ratio);
#ifndef _XBOX
renderchain_set_final_viewport(d3d->chain, &d3d->final_viewport);
d3d_recompute_pass_sizes(d3d);
#endif
d3d->should_resize = false;
}
/* render_chain() only clears out viewport, clear out everything. */
/* render_chain() only clears out viewport,
* clear out everything. */
screen_vp.X = 0;
screen_vp.Y = 0;
screen_vp.MinZ = 0;
@ -431,7 +567,8 @@ static bool d3d_frame(void *data, const void *frame,
d3dr->SetViewport(&screen_vp);
d3dr->Clear(0, 0, D3DCLEAR_TARGET, 0, 1, 0);
// Insert black frame first, so we can screenshot, etc.
/* Insert black frame first, so we
* can screenshot, etc. */
if (g_settings.video.black_frame_insertion)
{
D3DDevice_Presents(d3d, d3dr);
@ -440,12 +577,17 @@ static bool d3d_frame(void *data, const void *frame,
d3dr->Clear(0, 0, D3DCLEAR_TARGET, 0, 1, 0);
}
#ifdef _XBOX
renderchain_render_pass(d3d, frame, width, height,
pitch, d3d->dev_rotation);
#else
if (!renderchain_render(d3d->chain, frame, width,
height, pitch, d3d->dev_rotation))
{
RARCH_ERR("[D3D]: Failed to render scene.\n");
return false;
}
#endif
if (d3d->font_ctx && d3d->font_ctx->render_msg && msg)
{
@ -466,9 +608,11 @@ static bool d3d_frame(void *data, const void *frame,
}
#ifdef HAVE_MENU
#ifndef _XBOX
if (d3d->menu && d3d->menu->enabled)
d3d_overlay_render(d3d, d3d->menu);
#endif
#endif
#ifdef HAVE_OVERLAY
if (d3d->overlays_enabled)
@ -482,6 +626,12 @@ static bool d3d_frame(void *data, const void *frame,
if (g_extern.lifecycle_state & (1ULL << MODE_MENU)
&& driver.menu_ctx && driver.menu_ctx->frame)
driver.menu_ctx->frame();
#ifdef _XBOX
/* TODO - should be refactored. */
if (d3d && d3d->menu_texture_enable)
d3d_draw_texture(d3d);
#endif
#endif
RARCH_PERFORMANCE_STOP(d3d_frame);
@ -495,35 +645,6 @@ static bool d3d_frame(void *data, const void *frame,
return true;
}
static void d3d_free(void *data)
{
d3d_video_t *d3d = (d3d_video_t*)data;
d3d_deinitialize(d3d);
#ifdef HAVE_OVERLAY
d3d_free_overlays(d3d);
#endif
#ifdef HAVE_MENU
d3d_free_overlay(d3d, d3d->menu);
#endif
if (d3d->dev)
d3d->dev->Release();
if (d3d->g_pD3D)
d3d->g_pD3D->Release();
#ifdef HAVE_MONITOR
Monitor::last_hm = MonitorFromWindow(d3d->hWnd,
MONITOR_DEFAULTTONEAREST);
DestroyWindow(d3d->hWnd);
#endif
if (d3d)
delete d3d;
#ifndef _XBOX
UnregisterClass("RetroArch", GetModuleHandle(NULL));
#endif
}
static bool d3d_read_viewport(void *data, uint8_t *buffer)
{
d3d_video_t *d3d = (d3d_video_t*)data;
@ -532,6 +653,13 @@ static bool d3d_read_viewport(void *data, uint8_t *buffer)
RARCH_PERFORMANCE_INIT(d3d_read_viewport);
RARCH_PERFORMANCE_START(d3d_read_viewport);
bool ret = true;
(void)data;
(void)buffer;
#ifdef _XBOX
ret = false;
#else
LPDIRECT3DSURFACE target = NULL;
LPDIRECT3DSURFACE dest = NULL;
@ -588,6 +716,7 @@ end:
target->Release();
if (dest)
dest->Release();
#endif
return ret;
}
@ -596,12 +725,25 @@ static bool d3d_set_shader(void *data,
{
d3d_video_t *d3d = (d3d_video_t*)data;
std::string shader = "";
if (path && type == RARCH_SHADER_CG)
shader = path;
switch (type)
{
case RARCH_SHADER_CG:
if (path)
shader = path;
#ifdef HAVE_HLSL
d3d->shader = &hlsl_backend;
#endif
break;
default:
break;
}
std::string old_shader = d3d->cg_shader;
bool restore_old = false;
#ifdef HAVE_CG
d3d->cg_shader = shader;
#endif
if (!d3d_process_shader(d3d) || !d3d_restore(d3d))
{
@ -611,7 +753,9 @@ static bool d3d_set_shader(void *data,
if (restore_old)
{
#ifdef HAVE_CG
d3d->cg_shader = old_shader;
#endif
d3d_process_shader(d3d);
d3d_restore(d3d);
}
@ -631,6 +775,13 @@ static void d3d_set_menu_texture_frame(void *data,
{
d3d_video_t *d3d = (d3d_video_t*)data;
(void)frame;
(void)rgb32;
(void)width;
(void)height;
(void)alpha;
#ifndef _XBOX
if (!d3d->menu->tex || d3d->menu->tex_w != width
|| d3d->menu->tex_h != height)
{
@ -692,6 +843,7 @@ static void d3d_set_menu_texture_frame(void *data,
if (d3d->menu)
d3d->menu->tex->UnlockRect(0);
}
#endif
}
static void d3d_set_menu_texture_enable(void *data,
@ -699,11 +851,16 @@ static void d3d_set_menu_texture_enable(void *data,
{
d3d_video_t *d3d = (d3d_video_t*)data;
#ifdef _XBOX
d3d->menu_texture_enable = state;
d3d->menu_texture_full_screen = full_screen;
#else
if (!d3d || !d3d->menu)
return;
d3d->menu->enabled = state;
d3d->menu->fullscreen = full_screen;
#endif
}
#endif
@ -731,47 +888,6 @@ static void d3d_get_poke_interface(void *data,
*iface = &d3d_poke_interface;
}
static void *d3d_init(const video_info_t *info, const input_driver_t **input,
void **input_data)
{
d3d_video_t *vid = new d3d_video_t();
if (!vid)
return NULL;
vid->ctx_driver = d3d_get_context();
if (!vid->ctx_driver)
{
delete vid;
return NULL;
}
/* default values */
vid->g_pD3D = NULL;
vid->dev = NULL;
#ifndef _XBOX
vid->font = NULL;
#endif
vid->dev_rotation = 0;
vid->needs_restore = false;
#ifdef HAVE_CG
vid->cgCtx = NULL;
#endif
#ifdef HAVE_OVERLAY
vid->overlays_enabled = false;
#endif
vid->chain = NULL;
vid->menu = NULL;
if (!d3d_construct(vid, info, input, input_data))
{
RARCH_ERR("[D3D]: Failed to init D3D.\n");
delete vid;
return NULL;
}
return vid;
}
video_driver_t video_d3d = {
d3d_init,
d3d_frame,

View File

@ -35,9 +35,17 @@
#endif
#endif
#ifdef _XBOX1
#include <xfont.h>
#endif
#include "../../general.h"
#include "../../driver.h"
#if defined(HAVE_CG) || defined(HAVE_GLSL) || defined(HAVE_HLSL)
#include "../shader_parse.h"
#include "../shader_common.h"
#endif
#include "../fonts/d3d_font.h"
#include "../gfx_context.h"
@ -47,13 +55,17 @@
#include <Cg/cg.h>
#include <Cg/cgD3D9.h>
#endif
#include "d3d_defines.h"
#include "d3d_wrapper.h"
#include <string>
#include <vector>
class RenderChain;
#ifndef _XBOX
#if defined(_XBOX)
#if defined(_XBOX1)
#define D3DDevice_Presents(d3d, device) D3DDevice_Swap(0)
#elif defined(_XBOX360)
#define D3DDevice_Presents(d3d, device) D3DDevice_Present(device)
#endif
#else
#define D3DDevice_SetSamplerState_AddressU(dev, sampler, type) dev->SetSamplerState(sampler, D3DSAMP_ADDRESSU, type)
#define D3DDevice_SetSamplerState_AddressV(dev, sampler, type) dev->SetSamplerState(sampler, D3DSAMP_ADDRESSV, type)
#define D3DDevice_SetSamplerState_MinFilter(dev, sampler, type) dev->SetSamplerState(sampler, D3DSAMP_MINFILTER, type)
@ -93,7 +105,7 @@ class RenderChain;
}
#endif
#ifdef HAVE_OVERLAY
typedef struct
{
struct Coords
@ -109,15 +121,37 @@ typedef struct
LPDIRECT3DTEXTURE tex;
LPDIRECT3DVERTEXBUFFER vert_buf;
} overlay_t;
#endif
#ifdef _XBOX
typedef struct Vertex
{
float x, y;
#if defined(_XBOX1)
float z;
float rhw;
#endif
float u, v;
} Vertex;
#endif
#if defined(HAVE_CG) || defined(HAVE_HLSL) || defined(HAVE_GLSL)
#ifdef _XBOX
typedef struct gl_shader_backend gl_shader_backend_t;
#endif
#endif
bool d3d_init_shader(void *data);
void d3d_deinit_shader(void *data);
void d3d_make_d3dpp(void *data, const video_info_t *info, D3DPRESENT_PARAMETERS *d3dpp);
typedef struct d3d_video
{
const d3d_font_renderer_t *font_ctx;
const gfx_ctx_driver_t *ctx_driver;
#if defined(HAVE_CG) || defined(HAVE_HLSL) || defined(HAVE_GLSL)
#ifdef _XBOX
const gl_shader_backend_t *shader;
#endif
#endif
bool should_resize;
bool quitting;
@ -129,6 +163,11 @@ typedef struct d3d_video
LPDIRECT3DDEVICE dev;
#ifndef _XBOX
LPD3DXFONT font;
#endif
#if defined(HAVE_D3D9) && defined(_XBOX)
LPDIRECT3DSURFACE lpSurface;
LPDIRECT3DTEXTURE lpTexture_ot_as16srgb;
LPDIRECT3DTEXTURE lpTexture_ot;
#endif
HRESULT d3d_err;
unsigned cur_mon_id;
@ -140,7 +179,9 @@ typedef struct d3d_video
std::string cg_shader;
#ifndef _XBOX
struct gfx_shader shader;
#endif
video_info_t video_info;
@ -158,10 +199,31 @@ typedef struct d3d_video
std::vector<overlay_t> overlays;
#endif
#ifdef HAVE_MENU
bool menu_texture_enable;
bool menu_texture_full_screen;
#if defined(HAVE_MENU) && defined(HAVE_OVERLAY)
overlay_t *menu;
#endif
void *chain;
#ifdef _XBOX
/* TODO _ should all be refactored */
// RENDERCHAIN PASS
unsigned pixel_size;
LPDIRECT3DTEXTURE tex;
LPDIRECT3DVERTEXBUFFER vertex_buf;
unsigned last_width;
unsigned last_height;
#ifdef HAVE_D3D9
LPDIRECT3DVERTEXDECLARATION vertex_decl;
#endif
// RENDERCHAIN PASS -> INFO
unsigned tex_w;
unsigned tex_h;
#endif
#ifdef _XBOX
bool vsync;
#endif
} d3d_video_t;
#ifndef _XBOX

View File

@ -26,28 +26,53 @@
#define LPDIRECT3D LPDIRECT3D9
#define LPDIRECT3DDEVICE LPDIRECT3DDEVICE9
#define LPDIRECT3DTEXTURE LPDIRECT3DTEXTURE9
#define LPDIRECT3DCUBETEXTURE LPDIRECT3DCUBETEXTURE9
#define LPDIRECT3DVERTEXBUFFER LPDIRECT3DVERTEXBUFFER9
#define LPDIRECT3DVERTEXSHADER LPDIRECT3DVERTEXSHADER9
#define LPDIRECT3DPIXELSHADER LPDIRECT3DPIXELSHADER9
#define LPDIRECT3DSURFACE LPDIRECT3DSURFACE9
#define LPDIRECT3DVERTEXDECLARATION LPDIRECT3DVERTEXDECLARATION9
#define LPDIRECT3DVOLUMETEXTURE LPDIRECT3DVOLUMETEXTURE9
#define LPDIRECT3DRESOURCE LPDIRECT3DRESOURCE9
#define D3DVERTEXELEMENT D3DVERTEXELEMENT9
#define D3DVIEWPORT D3DVIEWPORT9
#define D3DCREATE_CTX Direct3DCreate9
#ifndef D3DCREATE_SOFTWARE_VERTEXPROCESSING
#define D3DCREATE_SOFTWARE_VERTEXPROCESSING 0
#endif
#elif defined(_XBOX1)
#include <xtl.h>
//Direct3D 8
#define LPDIRECT3D LPDIRECT3D8
#define LPDIRECT3DDEVICE LPDIRECT3DDEVICE8
#define LPDIRECT3DTEXTURE LPDIRECT3DTEXTURE8
#define LPDIRECT3DCUBETEXTURE LPDIRECT3DCUBETEXTURE8
#define LPDIRECT3DVOLUMETEXTURE LPDIRECT3DVOLUMETEXTURE8
#define LPDIRECT3DVERTEXBUFFER LPDIRECT3DVERTEXBUFFER8
#define LPDIRECT3DVERTEXSHADER LPDIRECT3DVERTEXSHADER8
#define LPDIRECT3DPIXELSHADER LPDIRECT3DPIXELSHADER8
#define LPDIRECT3DSURFACE LPDIRECT3DSURFACE8
#define LPDIRECT3DRESOURCE LPDIRECT3DRESOURCE8
#define D3DVERTEXELEMENT D3DVERTEXELEMENT8
#define D3DVIEWPORT D3DVIEWPORT8
#define D3DCREATE_CTX Direct3DCreate8
#define D3DLOCK_NOSYSLOCK (0)
#define D3DSAMP_ADDRESSU D3DTSS_ADDRESSU
#define D3DSAMP_ADDRESSV D3DTSS_ADDRESSV
#define D3DSAMP_MAGFILTER D3DTSS_MAGFILTER
#define D3DSAMP_MINFILTER D3DTSS_MINFILTER
#endif
#endif
#if defined(_XBOX360)
#define D3DFVF_CUSTOMVERTEX 0
#elif defined(_XBOX1)
#define D3DFVF_CUSTOMVERTEX (D3DFVF_XYZRHW | D3DFVF_TEX1)
#endif
#endif

View File

@ -116,7 +116,7 @@ static void d3d_overlay_render(void *data, overlay_t *overlay)
d3d->dev->SetViewport(&d3d->final_viewport);
}
void d3d_free_overlay(void *data, overlay_t *overlay)
static void d3d_free_overlay(void *data, overlay_t *overlay)
{
d3d_video_t *d3d = (d3d_video_t*)data;
@ -126,7 +126,7 @@ void d3d_free_overlay(void *data, overlay_t *overlay)
overlay->vert_buf->Release();
}
void d3d_free_overlays(void *data)
static void d3d_free_overlays(void *data)
{
unsigned i;
d3d_video_t *d3d = (d3d_video_t*)data;

View File

@ -1,8 +1,109 @@
#include "d3d_defines.h"
#include "../gfx_common.h"
static void d3d_deinit_chain(void *data)
#if defined(HAVE_CG) || defined(HAVE_GLSL) || defined(HAVE_HLSL)
#ifdef HAVE_HLSL
#include "../shader_hlsl.h"
#endif
#endif
/* forward declarations */
static void d3d_calculate_rect(d3d_video_t *d3d,
unsigned width, unsigned height,
bool keep, float desired_aspect);
static bool d3d_init_luts(d3d_video_t *d3d);
static void d3d_set_font_rect(d3d_video_t *d3d,
const struct font_params *params);
static bool d3d_process_shader(d3d_video_t *d3d);
static bool d3d_init_multipass(d3d_video_t *d3d);
static void d3d_deinit_chain(d3d_video_t *d3d);
static bool d3d_init_chain(d3d_video_t *d3d,
const video_info_t *video_info);
#ifdef HAVE_OVERLAY
static void d3d_free_overlays(void *data);
static void d3d_free_overlay(void *data, overlay_t *overlay);
#endif
#ifdef _XBOX
static void d3d_reinit_renderchain(void *data,
const video_info_t *video);
#endif
static void renderchain_free(void *data);
void d3d_make_d3dpp(void *data, const video_info_t *info,
D3DPRESENT_PARAMETERS *d3dpp);
#ifdef HAVE_WINDOW
#define IDI_ICON 1
#define MAX_MONITORS 9
extern LRESULT CALLBACK WindowProc(HWND hWnd, UINT message,
WPARAM wParam, LPARAM lParam);
static RECT d3d_monitor_rect(d3d_video_t *d3d);
#endif
#ifdef HAVE_MONITOR
namespace Monitor
{
static HMONITOR last_hm;
static HMONITOR all_hms[MAX_MONITORS];
static unsigned num_mons;
}
#endif
static void d3d_deinit_shader(void *data)
{
d3d_video_t *d3d = (d3d_video_t*)data;
(void)d3d;
(void)data;
#ifdef HAVE_CG
if (!d3d->cgCtx)
return;
cgD3D9UnloadAllPrograms();
cgD3D9SetDevice(NULL);
cgDestroyContext(d3d->cgCtx);
d3d->cgCtx = NULL;
#endif
}
static bool d3d_init_shader(void *data)
{
d3d_video_t *d3d = (d3d_video_t*)data;
(void)d3d;
(void)data;
#if defined(HAVE_HLSL)
RARCH_LOG("D3D]: Using HLSL shader backend.\n");
const gl_shader_backend_t *backend = &hlsl_backend;
const char *shader_path = g_settings.video.shader_path;
d3d->shader = backend;
if (!d3d->shader)
return false;
return d3d->shader->init(d3d, shader_path);
#elif defined(HAVE_CG)
d3d->cgCtx = cgCreateContext();
if (!d3d->cgCtx)
return false;
RARCH_LOG("[D3D]: Created shader context.\n");
HRESULT ret = cgD3D9SetDevice(d3d->dev);
if (FAILED(ret))
return false;
return true;
#elif defined(_XBOX1)
return false;
#endif
}
static void d3d_deinit_chain(d3d_video_t *d3d)
{
#ifdef _XBOX
renderchain_free(d3d);
#else
@ -176,9 +277,8 @@ static void d3d_set_viewport(d3d_video_t *d3d, int x, int y,
d3d_set_font_rect(d3d, NULL);
#endif
}
bool d3d_restore(void *data)
bool d3d_restore(d3d_video_t *d3d)
{
d3d_video_t *d3d = (d3d_video_t*)data;
d3d_deinitialize(d3d);
d3d->needs_restore = !d3d_initialize(d3d, &d3d->video_info);
@ -329,11 +429,15 @@ static bool d3d_construct(d3d_video_t *d3d,
gfx_set_dwm();
#endif
#ifdef HAVE_MENU
#if defined(HAVE_MENU) && defined(HAVE_OVERLAY)
if (d3d->menu)
free(d3d->menu);
d3d->menu = (overlay_t*)calloc(1, sizeof(overlay_t));
if (!d3d->menu)
return false;
d3d->menu->tex_coords.x = 0;
d3d->menu->tex_coords.y = 0;
d3d->menu->tex_coords.w = 1;
@ -344,7 +448,7 @@ static bool d3d_construct(d3d_video_t *d3d,
d3d->menu->vert_coords.h = -1;
#endif
#ifdef HAVE_WINDOW
#if defined(HAVE_WINDOW) && !defined(_XBOX)
memset(&d3d->windowClass, 0, sizeof(d3d->windowClass));
d3d->windowClass.cbSize = sizeof(d3d->windowClass);
d3d->windowClass.style = CS_HREDRAW | CS_VREDRAW;
@ -377,12 +481,12 @@ static bool d3d_construct(d3d_video_t *d3d,
(int)(mon_rect.bottom - mon_rect.top));
#else
if (d3d->ctx_driver && d3d->ctx_driver->get_video_size)
d3d->ctx_driver->get_video_size(&full_x, &full_y);
d3d->ctx_driver->get_video_size(d3d, &full_x, &full_y);
#endif
d3d->screen_width = info->fullscreen ? full_x : info->width;
d3d->screen_height = info->fullscreen ? full_y : info->height;
#ifdef HAVE_WINDOW
#if defined(HAVE_WINDOW) && !defined(_XBOX)
unsigned win_width = d3d->screen_width;
unsigned win_height = d3d->screen_height;
@ -421,7 +525,7 @@ static bool d3d_construct(d3d_video_t *d3d,
#endif
);
#ifdef HAVE_WINDOW
#if defined(HAVE_WINDOW) && !defined(_XBOX)
ShowWindow(d3d->hWnd, SW_RESTORE);
UpdateWindow(d3d->hWnd);
SetForegroundWindow(d3d->hWnd);
@ -484,17 +588,122 @@ static void d3d_show_mouse(void *data, bool state)
static const gfx_ctx_driver_t *d3d_get_context(void *data)
{
/* TODO: GL core contexts through ANGLE? */
enum gfx_ctx_api api;
unsigned major, minor;
/* Default to Direct3D9 for now.
TODO: GL core contexts through ANGLE? */
enum gfx_ctx_api api = GFX_CTX_DIRECT3D9_API;
unsigned major = 9, minor = 0;
(void)major;
(void)minor;
#if defined(_XBOX1)
api = GFX_CTX_DIRECT3D8_API;
major = 8;
#elif defined(_XBOX360)
api = GFX_CTX_DIRECT3D9_API;
major = 9;
#endif
minor = 0;
return gfx_ctx_init_first(driver.video_data, api,
major, minor, false);
}
static void *d3d_init(const video_info_t *info,
const input_driver_t **input, void **input_data)
{
#ifdef _XBOX
if (driver.video_data)
{
d3d_video_t *vid = (d3d_video_t*)driver.video_data;
/* Reinitialize renderchain as we
* might have changed pixel formats.*/
d3d_reinit_renderchain(vid, info);
if (input && input_data)
{
*input = driver.input;
*input_data = driver.input_data;
}
driver.video_data_own = true;
driver.input_data_own = true;
return driver.video_data;
}
#endif
d3d_video_t *vid = new d3d_video_t();
if (!vid)
return NULL;
vid->ctx_driver = d3d_get_context(vid);
if (!vid->ctx_driver)
{
delete vid;
return NULL;
}
/* Default values */
vid->g_pD3D = NULL;
vid->dev = NULL;
#ifndef _XBOX
vid->font = NULL;
#endif
vid->dev_rotation = 0;
vid->needs_restore = false;
#ifdef HAVE_CG
vid->cgCtx = NULL;
#endif
#ifdef HAVE_OVERLAY
vid->overlays_enabled = false;
#endif
#ifdef _XBOX
vid->should_resize = false;
vid->vsync = info->vsync;
#else
vid->menu = NULL;
#endif
if (!d3d_construct(vid, info, input, input_data))
{
RARCH_ERR("[D3D]: Failed to init D3D.\n");
delete vid;
return NULL;
}
#ifdef _XBOX
driver.video_data_own = true;
driver.input_data_own = true;
#endif
return vid;
}
static void d3d_free(void *data)
{
d3d_video_t *d3d = (d3d_video_t*)data;
d3d_deinitialize(d3d);
#ifdef HAVE_OVERLAY
d3d_free_overlays(d3d);
#endif
#if defined(HAVE_MENU) && !defined(_XBOX)
d3d_free_overlay(d3d, d3d->menu);
#endif
#ifdef _XBOX
if (d3d->ctx_driver && d3d->ctx_driver->destroy)
d3d->ctx_driver->destroy(d3d);
d3d->ctx_driver = NULL;
#endif
if (d3d->dev)
d3d->dev->Release();
if (d3d->g_pD3D)
d3d->g_pD3D->Release();
#ifdef HAVE_MONITOR
Monitor::last_hm = MonitorFromWindow(d3d->hWnd,
MONITOR_DEFAULTTONEAREST);
DestroyWindow(d3d->hWnd);
#endif
if (d3d)
delete d3d;
#ifndef _XBOX
UnregisterClass("RetroArch", GetModuleHandle(NULL));
#endif
}

195
gfx/d3d9/d3d_wrapper.c Normal file
View File

@ -0,0 +1,195 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
* Copyright (C) 2011-2014 - Daniel De Matteis
*
* 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 <http://www.gnu.org/licenses/>.
*/
#include "d3d.hpp"
#include "d3d_wrapper.h"
#include "render_chain.hpp"
void d3d_swap(void *data, LPDIRECT3DDEVICE dev)
{
d3d_video_t *d3d = (d3d_video_t*)data;
if (!d3d)
return;
#if defined(_XBOX1)
D3DDevice_Swap(0);
#elif defined(_XBOX360)
D3DDevice_Present(dev);
#else
if (dev->Present(NULL, NULL, NULL, NULL) != D3D_OK)
{
RARCH_ERR("[D3D]: Present() failed.\n");
d3d->needs_restore = true;
}
#endif
}
HRESULT d3d_create_vertex_buffer(LPDIRECT3DDEVICE dev,
unsigned length, unsigned usage, unsigned fvf,
D3DPOOL pool, LPDIRECT3DVERTEXBUFFER vert_buf, void *handle)
{
#if defined(_XBOX1)
return IDirect3DDevice8_CreateVertexBuffer(dev, length, usage, fvf, pool,
&vert_buf);
#elif defined(_XBOX360)
return IDirect3DDevice9_CreateVertexBuffer(dev, length, usage, fvf, pool,
&vert_buf, NULL);
#else
return dev->CreateVertexBuffer(length, usage, fvf, pool, &vert_buf, NULL);
#endif
}
void d3d_set_stream_source(LPDIRECT3DDEVICE dev, unsigned stream_no,
LPDIRECT3DVERTEXBUFFER stream_vertbuf, unsigned offset_bytes,
unsigned stride)
{
#if defined(_XBOX1)
IDirect3DDevice8_SetStreamSource(dev, stream_no, stream_vertbuf, stride);
#elif defined(_XBOX360)
D3DDevice_SetStreamSource_Inline(dev, stream_no, stream_vertbuf,
offset_bytes, stride);
#else
dev->SetStreamSource(stream_no, stream_vertbuf, offset_bytes, stride);
#endif
}
void d3d_set_sampler_address_u(LPDIRECT3DDEVICE dev,
unsigned sampler, unsigned value)
{
#if defined(_XBOX1)
D3D__DirtyFlags |= (D3DDIRTYFLAG_TEXTURE_STATE_0 << sampler);
D3D__TextureState[sampler][D3DTSS_ADDRESSU] = value;
#elif defined(_XBOX360)
D3DDevice_SetSamplerState_AddressU_Inline(dev, sampler, value);
#else
dev->SetSamplerState(sampler, D3DSAMP_ADDRESSU, value);
#endif
}
void d3d_set_sampler_address_v(LPDIRECT3DDEVICE dev,
unsigned sampler, unsigned value)
{
#if defined(_XBOX1)
D3D__DirtyFlags |= (D3DDIRTYFLAG_TEXTURE_STATE_0 << sampler);
D3D__TextureState[sampler][D3DTSS_ADDRESSV] = value;
#elif defined(_XBOX360)
D3DDevice_SetSamplerState_AddressV_Inline(dev, sampler, value);
#else
dev->SetSamplerState(sampler, D3DSAMP_ADDRESSV, value);
#endif
}
void d3d_set_sampler_minfilter(LPDIRECT3DDEVICE dev,
unsigned sampler, unsigned value)
{
#if defined(_XBOX1)
D3D__DirtyFlags |= (D3DDIRTYFLAG_TEXTURE_STATE_0 << sampler);
D3D__TextureState[sampler][D3DTSS_MINFILTER] = value;
#elif defined(_XBOX360)
D3DDevice_SetSamplerState_MinFilter(dev, sampler, value);
#else
dev->SetSamplerState(sampler, D3DSAMP_MINFILTER, value);
#endif
}
void d3d_set_sampler_magfilter(LPDIRECT3DDEVICE dev,
unsigned sampler, unsigned value)
{
#if defined(_XBOX1)
D3D__DirtyFlags |= (D3DDIRTYFLAG_TEXTURE_STATE_0 << sampler);
D3D__TextureState[sampler][D3DTSS_MAGFILTER] = value;
#elif defined(_XBOX360)
D3DDevice_SetSamplerState_MagFilter(dev, sampler, value);
#else
dev->SetSamplerState(sampler, D3DSAMP_MAGFILTER, value);
#endif
}
void d3d_draw_primitive(LPDIRECT3DDEVICE dev,
D3DPRIMITIVETYPE type, unsigned start, unsigned count)
{
#if defined(_XBOX1)
D3DDevice_DrawVertices(type, start, D3DVERTEXCOUNT(type, count));
#elif defined(_XBOX360)
D3DDevice_DrawVertices(dev, type, start, D3DVERTEXCOUNT(type, count));
#else
if (SUCCEEDED(dev->BeginScene()))
{
dev->DrawPrimitive(type, start, count);
dev->EndScene();
}
#endif
}
void d3d_lockrectangle_clear(LPDIRECT3DTEXTURE tex,
unsigned tex_width, unsigned tex_height,
unsigned level, D3DLOCKED_RECT lock_rect, RECT rect,
unsigned flags)
{
#if defined(_XBOX)
D3DTexture_LockRect(tex, level, &lock_rect, &rect, flags);
memset(lock_rect.pBits, 0, tex_height * lock_rect.Pitch);
#else
if (SUCCEEDED(tex->LockRect(level, &lock_rect, &rect, flags)))
{
memset(lock_rect.pBits, level, tex_height * lock_rect.Pitch);
tex->UnlockRect(0);
}
#endif
}
void d3d_textureblit(void *data, void *renderchain_data,
LPDIRECT3DTEXTURE tex, D3DSURFACE_DESC desc,
D3DLOCKED_RECT lr, const void *frame,
unsigned width, unsigned height, unsigned pitch)
{
d3d_video_t *d3d = (d3d_video_t*)d3d;
(void)desc;
(void)d3d;
if (!d3d)
return;
#if defined(_XBOX360)
tex->GetLevelDesc(0, &desc);
XGCopySurface(lr.pBits, lr.Pitch, width, height, desc.Format, NULL,
frame, pitch, desc.Format, NULL, 0, 0);
#elif defined(_XBOX1)
for (unsigned y = 0; y < height; y++)
{
const uint8_t *in = (const uint8_t*)frame + y * pitch;
uint8_t *out = (uint8_t*)lr.pBits + y * lr.Pitch;
memcpy(out, in, width * d3d->pixel_size);
}
#else
renderchain_t *chain = (renderchain_t*)renderchain_data;
if (!chain)
return;
if (SUCCEEDED(tex->LockRect(0, &lr, NULL, D3DLOCK_NOSYSLOCK)))
{
for (unsigned y = 0; y < height; y++)
{
const uint8_t *in = (const uint8_t*)frame + y * pitch;
uint8_t *out = (uint8_t*)lr.pBits + y * lr.Pitch;
memcpy(out, in, width * chain->pixel_size);
}
tex->UnlockRect(0);
}
#endif
}

58
gfx/d3d9/d3d_wrapper.h Normal file
View File

@ -0,0 +1,58 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
* Copyright (C) 2011-2014 - Daniel De Matteis
*
* 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 <http://www.gnu.org/licenses/>.
*/
#ifndef _D3D_WRAPPER_H
#define _D3D_WRAPPER_H
#include "../context/win32_common.h"
#include "d3d_defines.h"
void d3d_swap(void *data, LPDIRECT3DDEVICE dev);
HRESULT d3d_create_vertex_buffer(LPDIRECT3DDEVICE dev,
unsigned length, unsigned usage, unsigned fvf,
D3DPOOL pool, LPDIRECT3DVERTEXBUFFER vert_buf, void *handle);
void d3d_set_stream_source(LPDIRECT3DDEVICE dev, unsigned stream_no,
LPDIRECT3DVERTEXBUFFER stream_vertbuf, unsigned offset_bytes,
unsigned stride);
void d3d_set_sampler_address_u(LPDIRECT3DDEVICE dev,
unsigned sampler, unsigned value);
void d3d_set_sampler_address_v(LPDIRECT3DDEVICE dev,
unsigned sampler, unsigned value);
void d3d_set_sampler_minfilter(LPDIRECT3DDEVICE dev,
unsigned sampler, unsigned value);
void d3d_set_sampler_magfilter(LPDIRECT3DDEVICE dev,
unsigned sampler, unsigned value);
void d3d_draw_primitive(LPDIRECT3DDEVICE dev,
D3DPRIMITIVETYPE type, unsigned start, unsigned count);
void d3d_lockrectangle_clear(LPDIRECT3DTEXTURE tex,
unsigned tex_width, unsigned tex_height,
unsigned level, D3DLOCKED_RECT lock_rect, RECT rect,
unsigned flags);
void d3d_textureblit(void *data,
LPDIRECT3DTEXTURE tex, D3DSURFACE_DESC desc,
D3DLOCKED_RECT lr, const void *frame,
unsigned width, unsigned height, unsigned pitch);
#endif

View File

@ -133,8 +133,8 @@ bool renderchain_set_pass_size(void *data, unsigned pass_index,
return false;
d3dr->SetTexture(0, pass.tex);
D3DDevice_SetSamplerState_AddressU(d3dr, 0, D3DTADDRESS_BORDER);
D3DDevice_SetSamplerState_AddressV(d3dr, 0, D3DTADDRESS_BORDER);
d3d_set_sampler_address_u(d3dr, 0, D3DTADDRESS_BORDER);
d3d_set_sampler_address_v(d3dr, 0, D3DTADDRESS_BORDER);
d3dr->SetTexture(0, NULL);
}
@ -161,7 +161,7 @@ bool renderchain_add_pass(void *data, const LinkInfo *info)
? D3DUSAGE_SOFTWAREPROCESSING : 0,
0,
D3DPOOL_DEFAULT,
&pass.vertex_buf,
pass.vertex_buf,
NULL)))
return false;
@ -174,8 +174,8 @@ bool renderchain_add_pass(void *data, const LinkInfo *info)
return false;
d3dr->SetTexture(0, pass.tex);
D3DDevice_SetSamplerState_AddressU(d3dr, 0, D3DTADDRESS_BORDER);
D3DDevice_SetSamplerState_AddressV(d3dr, 0, D3DTADDRESS_BORDER);
d3d_set_sampler_address_u(d3dr, 0, D3DTADDRESS_BORDER);
d3d_set_sampler_address_v(d3dr, 0, D3DTADDRESS_BORDER);
d3dr->SetTexture(0, NULL);
chain->passes.push_back(pass);
@ -212,8 +212,8 @@ bool renderchain_add_lut(void *data, const std::string &id,
return false;
d3dr->SetTexture(0, lut);
D3DDevice_SetSamplerState_AddressU(d3dr, 0, D3DTADDRESS_BORDER);
D3DDevice_SetSamplerState_AddressV(d3dr, 0, D3DTADDRESS_BORDER);
d3d_set_sampler_address_u(d3dr, 0, D3DTADDRESS_BORDER);
d3d_set_sampler_address_v(d3dr, 0, D3DTADDRESS_BORDER);
d3dr->SetTexture(0, NULL);
lut_info info = { lut, id, smooth };
@ -377,8 +377,8 @@ bool renderchain_create_first_pass(void *data, const LinkInfo *info,
translate_filter(info->pass->filter));
D3DDevice_SetSamplerState_MagFilter(d3dr, 0,
translate_filter(info->pass->filter));
D3DDevice_SetSamplerState_AddressU(d3dr, 0, D3DTADDRESS_BORDER);
D3DDevice_SetSamplerState_AddressV(d3dr, 0, D3DTADDRESS_BORDER);
d3d_set_sampler_address_u(d3dr, 0, D3DTADDRESS_BORDER);
d3d_set_sampler_address_v(d3dr, 0, D3DTADDRESS_BORDER);
d3dr->SetTexture(0, NULL);
}
@ -532,6 +532,9 @@ void renderchain_blit_to_texture(void *data, const void *frame,
D3DLOCKED_RECT d3dlr;
renderchain_t *chain = (renderchain_t*)data;
Pass &first = chain->passes[0];
(void)desc;
if (first.last_width != width || first.last_height != height)
{
D3DTexture_LockRectClear(first, first.tex, 0, d3dlr,
@ -559,10 +562,8 @@ void renderchain_render_pass(void *data, Pass &pass, unsigned pass_index)
d3dr->SetVertexDeclaration(pass.vertex_decl);
#endif
for (unsigned i = 0; i < 4; i++)
{
D3DDevice_SetStreamSources(d3dr, i,
d3d_set_stream_source(d3dr, i,
pass.vertex_buf, 0, sizeof(Vertex));
}
renderchain_bind_orig(chain, pass);
renderchain_bind_prev(chain, pass);
@ -570,7 +571,7 @@ void renderchain_render_pass(void *data, Pass &pass, unsigned pass_index)
renderchain_bind_luts(chain, pass);
renderchain_bind_tracker(chain, pass, pass_index);
D3DDevice_DrawPrimitive(d3dr, D3DPT_TRIANGLESTRIP, 0, 2);
d3d_draw_primitive(d3dr, D3DPT_TRIANGLESTRIP, 0, 2);
// So we don't render with linear filter into render targets,
// which apparently looked odd (too blurry).
@ -640,9 +641,7 @@ void renderchain_unbind_all(void *data)
}
for (unsigned i = 0; i < chain->bound_vert.size(); i++)
{
D3DDevice_SetStreamSources(d3dr, chain->bound_vert[i], 0, 0, 0);
}
d3d_set_stream_source(d3dr, chain->bound_vert[i], 0, 0, 0);
chain->bound_tex.clear();
chain->bound_vert.clear();

View File

@ -40,6 +40,9 @@ static inline bool validate_param_name(const char *name)
"PASS",
};
if (!name)
return false;
for (unsigned i = 0; i < sizeof(illegal) / sizeof(illegal[0]); i++)
if (strstr(name, illegal[i]) == name)
return false;
@ -569,33 +572,4 @@ void renderchain_bind_pass(void *data, Pass &pass, unsigned pass_index)
}
}
}
bool d3d_init_shader(void *data)
{
d3d_video_t *d3d = (d3d_video_t*)data;
d3d->cgCtx = cgCreateContext();
if (!d3d->cgCtx)
return false;
RARCH_LOG("[D3D]: Created shader context.\n");
HRESULT ret = cgD3D9SetDevice(d3d->dev);
if (FAILED(ret))
return false;
return true;
}
void d3d_deinit_shader(void *data)
{
d3d_video_t *d3d = (d3d_video_t*)data;
if (!d3d->cgCtx)
return;
cgD3D9UnloadAllPrograms();
cgD3D9SetDevice(NULL);
cgDestroyContext(d3d->cgCtx);
d3d->cgCtx = NULL;
}
#endif

View File

@ -239,6 +239,8 @@ static void renderchain_set_vertices(void *data, unsigned pass, unsigned width,
RD3DVertexBuffer_Unlock(d3d->vertex_buf);
}
#if defined(HAVE_CG) || defined(HAVE_GLSL) || defined(HAVE_HLSL)
#ifdef _XBOX
if (d3d->shader)
{
renderchain_set_mvp(d3d, d3d->screen_width, d3d->screen_height, d3d->dev_rotation);
@ -249,6 +251,8 @@ static void renderchain_set_vertices(void *data, unsigned pass, unsigned width,
d3d->screen_height, g_extern.frame_count,
NULL, NULL, NULL, 0);
}
#endif
#endif
}
static void renderchain_set_mvp(void *data, unsigned vp_width, unsigned vp_height, unsigned rotation)
@ -278,6 +282,8 @@ static void renderchain_blit_to_texture(void *data, const void *frame,
D3DLOCKED_RECT d3dlr;
d3d_video_t *d3d = (d3d_video_t*)data;
(void)desc;
if (d3d->last_width != width || d3d->last_height != height)
{
D3DTexture_LockRectClear(d3d, d3d->tex, 0, d3dlr, NULL, D3DLOCK_NOSYSLOCK);
@ -286,52 +292,3 @@ static void renderchain_blit_to_texture(void *data, const void *frame,
D3DTexture_LockRect(d3d->tex, 0, &d3dlr, NULL, D3DLOCK_NOSYSLOCK);
D3DTexture_Blit(d3d, desc, d3dlr, frame, width, height, pitch);
}
static bool d3d_init_shader(void *data)
{
d3d_video_t *d3d = (d3d_video_t*)data;
const gl_shader_backend_t *backend = NULL;
const char *shader_path = g_settings.video.shader_path;
enum rarch_shader_type type = gfx_shader_parse_type(shader_path, DEFAULT_SHADER_TYPE);
switch (type)
{
case RARCH_SHADER_HLSL:
#ifdef HAVE_HLSL
RARCH_LOG("[D3D]: Using HLSL shader backend.\n");
backend = &hlsl_backend;
#endif
break;
}
if (!backend)
{
RARCH_ERR("[GL]: Didn't find valid shader backend. Continuing without shaders.\n");
return true;
}
d3d->shader = backend;
return d3d->shader->init(d3d, shader_path);
}
#ifdef HAVE_SHADERS
void d3d_deinit_shader(void *data)
{
d3d_video_t *d3d = (d3d_video_t*)data;
#ifdef HAVE_CG
if (!d3d->cgCtx)
return;
cgD3D9UnloadAllPrograms();
cgD3D9SetDevice(NULL);
cgDestroyContext(d3d->cgCtx);
d3d->cgCtx = NULL;
#else
if (d3d->shader && d3d->shader->deinit)
d3d->shader->deinit();
d3d->shader = NULL;
#endif
}
#endif

View File

@ -34,36 +34,6 @@
#include "render_chain_xdk.h"
#include "d3d_shared.h"
static void d3d_free(void *data)
{
d3d_video_t *d3d = (d3d_video_t*)data;
d3d_deinitialize(d3d);
#ifdef _XBOX
if (d3d->ctx_driver && d3d->ctx_driver->destroy)
d3d->ctx_driver->destroy(d3d);
d3d->ctx_driver = NULL;
#endif
if (d3d->dev)
d3d->dev->Release();
if (d3d->g_pD3D)
d3d->g_pD3D->Release();
#ifdef HAVE_MONITOR
Monitor::last_hm = MonitorFromWindow(d3d->hWnd,
MONITOR_DEFAULTTONEAREST);
DestroyWindow(d3d->hWnd);
#endif
if (d3d)
delete d3d;
#ifndef _XBOX
UnregisterClass("RetroArch", GetModuleHandle(NULL));
#endif
}
static bool d3d_set_shader(void *data,
enum rarch_shader_type type, const char *path)
{
@ -91,10 +61,9 @@ static bool d3d_set_shader(void *data,
return true;
}
static bool d3d_init_chain(void *data, const video_info_t *info)
static bool d3d_init_chain(d3d_video_t *d3d, const video_info_t *info)
{
d3d_video_t *d3d = (d3d_video_t*)data;
d3d_video_t *link_info = (d3d_video_t*)data;
d3d_video_t *link_info = (d3d_video_t*)d3d;
LPDIRECT3DDEVICE d3dr = (LPDIRECT3DDEVICE)d3d->dev;
link_info->tex_w = link_info->tex_h = RARCH_SCALE_BASE * info->input_scale;
@ -175,6 +144,7 @@ static void d3d_reinit_renderchain(void *data,
d3d_init_chain(d3d, video);
}
#ifdef _XBOX
#ifdef HAVE_RMENU
extern struct texture_image *menu_texture;
#endif
@ -249,7 +219,6 @@ static bool texture_image_render(void *data,
#endif
#ifdef HAVE_MENU
static void d3d_draw_texture(void *data)
{
d3d_video_t *d3d = (d3d_video_t*)data;
@ -270,9 +239,7 @@ static void d3d_draw_texture(void *data)
#endif
}
#endif
static void d3d_calculate_rect(void *data, unsigned width,
unsigned height, bool keep, float desired_aspect);
#endif
static bool d3d_frame(void *data, const void *frame,
unsigned width, unsigned height, unsigned pitch,
@ -423,74 +390,6 @@ static void d3d_get_poke_interface(void *data,
*iface = &d3d_poke_interface;
}
static void *d3d_init(const video_info_t *info,
const input_driver_t **input, void **input_data)
{
#ifdef _XBOX
if (driver.video_data)
{
d3d_video_t *vid = (d3d_video_t*)driver.video_data;
/* Reinitialize renderchain as we
* might have changed pixel formats.*/
d3d_reinit_renderchain(vid, info);
if (input && input_data)
{
*input = driver.input;
*input_data = driver.input_data;
}
driver.video_data_own = true;
driver.input_data_own = true;
return driver.video_data;
}
#endif
d3d_video_t *vid = new d3d_video_t();
if (!vid)
return NULL;
vid->ctx_driver = d3d_get_context(vid);
if (!vid->ctx_driver)
{
free(vid);
return NULL;
}
/* Default values */
vid->g_pD3D = NULL;
vid->dev = NULL;
#ifndef _XBOX
vid->font = NULL;
#endif
vid->dev_rotation = 0;
vid->needs_restore = false;
#ifdef HAVE_CG
vid->cgCtx = NULL;
#endif
#ifdef HAVE_OVERLAY
vid->overlays_enabled = false;
#endif
vid->should_resize = false;
vid->vsync = info->vsync;
vid->menu = NULL;
if (!d3d_construct(vid, info, input, input_data))
{
RARCH_ERR("[D3D]: Failed to init D3D.\n");
delete vid;
return NULL;
}
#ifdef _XBOX
driver.video_data_own = true;
driver.input_data_own = true;
#endif
return vid;
}
static bool d3d_read_viewport(void *data, uint8_t *buffer)
{
(void)data;

View File

@ -18,104 +18,5 @@
#define _XDK_D3D_VIDEO_H
#include <stdint.h>
#ifdef _XBOX1
#include <xfont.h>
#endif
#include "../../gfx/shader_common.h"
#include "../../gfx/shader_parse.h"
#include "../../gfx/image/image.h"
#include "../../gfx/fonts/d3d_font.h"
#include "../../gfx/gfx_context.h"
#include "../../gfx/d3d9/xdk_defines.h"
#define DFONT_MAX 4096
#if defined(_XBOX360)
#define D3DFVF_CUSTOMVERTEX 0
#elif defined(_XBOX1)
#define D3DFVF_CUSTOMVERTEX (D3DFVF_XYZRHW | D3DFVF_TEX1)
#endif
typedef struct
{
struct Coords
{
float x, y, w, h;
};
Coords tex_coords;
Coords vert_coords;
unsigned tex_w, tex_h;
bool fullscreen;
bool enabled;
float alpha_mod;
LPDIRECT3DTEXTURE tex;
LPDIRECT3DVERTEXBUFFER vert_buf;
} overlay_t;
typedef struct Vertex
{
float x, y;
#if defined(_XBOX1)
float z;
float rhw;
#endif
float u, v;
} Vertex;
typedef struct gl_shader_backend gl_shader_backend_t;
typedef struct d3d_video
{
const d3d_font_renderer_t *font_ctx;
const gfx_ctx_driver_t *ctx_driver;
const gl_shader_backend_t *shader;
bool should_resize;
bool quitting;
bool vsync;
bool needs_restore;
bool overlays_enabled;
unsigned screen_width;
unsigned screen_height;
unsigned dev_rotation;
HWND hWnd;
LPDIRECT3D g_pD3D;
LPDIRECT3DDEVICE dev;
#ifndef _XBOX
LPD3DXFONT font;
#endif
#ifdef HAVE_D3D9
LPDIRECT3DSURFACE lpSurface;
LPDIRECT3DTEXTURE lpTexture_ot_as16srgb;
LPDIRECT3DTEXTURE lpTexture_ot;
#endif
#ifdef HAVE_MENU
bool menu_texture_enable;
bool menu_texture_full_screen;
#endif
D3DVIEWPORT final_viewport;
video_info_t video_info;
HRESULT d3d_err;
unsigned cur_mon_id;
// RENDERCHAIN PASS
unsigned pixel_size;
LPDIRECT3DTEXTURE tex;
LPDIRECT3DVERTEXBUFFER vertex_buf;
unsigned last_width;
unsigned last_height;
#ifdef HAVE_D3D9
LPDIRECT3DVERTEXDECLARATION vertex_decl;
#endif
// RENDERCHAIN PASS -> INFO
unsigned tex_w;
unsigned tex_h;
#ifdef HAVE_MENU
overlay_t *menu;
#endif
} d3d_video_t;
extern void d3d_make_d3dpp(void *data, const video_info_t *info, D3DPRESENT_PARAMETERS *d3dpp);
extern bool texture_image_render(struct texture_image *out_img);
#endif

View File

@ -20,20 +20,6 @@
#if defined(_XBOX1)
/* XBox 1*/
#define LPDIRECT3DRESOURCE LPDIRECT3DRESOURCE8
#define LPDIRECT3DTEXTURE LPDIRECT3DTEXTURE8
#define LPDIRECT3DCUBETEXTURE LPDIRECT3DCUBETEXTURE8
#define LPDIRECT3DVOLUMETEXTURE LPDIRECT3DVOLUMETEXTURE8
#define LPDIRECT3DVERTEXBUFFER LPDIRECT3DVERTEXBUFFER8
#define LPDIRECT3DRESOURCE LPDIRECT3DRESOURCE8
#define LPDIRECT3D LPDIRECT3D8
#define LPDIRECT3DDEVICE LPDIRECT3DDEVICE8
#define LPDIRECT3DSURFACE LPDIRECT3DSURFACE8
#define D3DVIEWPORT D3DVIEWPORT8
#define D3DVERTEXELEMENT D3DVERTEXELEMENT8
#define direct3d_create_ctx Direct3DCreate8
#define SetSamplerState_function(device, sampler, type, value) \
D3D__DirtyFlags |= (D3DDIRTYFLAG_TEXTURE_STATE_0 << sampler); \
@ -56,32 +42,8 @@
#define D3DDevice_CreateVertexBuffers(device, Length, Usage, UnusedFVF, UnusedPool, ppVertexBuffer, pUnusedSharedHandle) IDirect3DDevice8_CreateVertexBuffer(device, Length, Usage, UnusedFVF, UnusedPool, ppVertexBuffer)
#define D3DDevice_SetStreamSources(device, streamNumber, pStreamData, OffsetInBytes, Stride) IDirect3DDevice8_SetStreamSource(device, streamNumber, pStreamData, Stride);
#define D3DLOCK_NOSYSLOCK (0)
#define D3DSAMP_ADDRESSU D3DTSS_ADDRESSU
#define D3DSAMP_ADDRESSV D3DTSS_ADDRESSV
#define D3DSAMP_MAGFILTER D3DTSS_MAGFILTER
#define D3DSAMP_MINFILTER D3DTSS_MINFILTER
#elif defined(_XBOX360)
/* XBox 360*/
#define LPDIRECT3D LPDIRECT3D9
#define LPDIRECT3DDEVICE LPDIRECT3DDEVICE9
#define LPDIRECT3DTEXTURE LPDIRECT3DTEXTURE9
#define LPDIRECT3DCUBETEXTURE LPDIRECT3DCUBETEXTURE9
#define LPDIRECT3DSURFACE LPDIRECT3DSURFACE9
#define LPDIRECT3DVOLUMETEXTURE LPDIRECT3DVOLUMETEXTURE9
#define LPDIRECT3DVERTEXBUFFER LPDIRECT3DVERTEXBUFFER9
#define LPDIRECT3DRESOURCE LPDIRECT3DRESOURCE9
#define LPDIRECT3DVERTEXDECLARATION LPDIRECT3DVERTEXDECLARATION9
#define LPDIRECT3DVERTEXSHADER LPDIRECT3DVERTEXSHADER9
#define LPDIRECT3DPIXELSHADER LPDIRECT3DPIXELSHADER9
#define D3DVIEWPORT D3DVIEWPORT9
#define D3DVERTEXELEMENT D3DVERTEXELEMENT9
#define direct3d_create_ctx Direct3DCreate9
#define RD3DVertexBuffer_Lock(device, OffsetToLock, SizeToLock, ppbData, Flags) *ppbData = D3DVertexBuffer_Lock(device, OffsetToLock, SizeToLock, Flags)
#define RD3DVertexBuffer_Unlock(device) D3DVertexBuffer_Unlock(device)
@ -109,8 +71,4 @@
#define D3DDevice_DrawPrimitive(dev, type, start, count) dev->DrawPrimitive(type, start, count)
#ifndef D3DCREATE_SOFTWARE_VERTEXPROCESSING
#define D3DCREATE_SOFTWARE_VERTEXPROCESSING 0
#endif
#endif

View File

@ -122,7 +122,7 @@ static const char *font_renderer_get_default_font(void)
return "";
}
const font_renderer_driver_t bitmap_font_renderer = {
font_renderer_driver_t bitmap_font_renderer = {
font_renderer_init,
font_renderer_get_atlas,
font_renderer_get_glyph,

View File

@ -13,8 +13,8 @@
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GL_FONT_H__
#define GL_FONT_H__
#ifndef D3D_FONT_H__
#define D3D_FONT_H__
#include <stdint.h>
#include "../../boolean.h"
@ -33,9 +33,9 @@ typedef struct d3d_font_renderer
const char *ident;
} d3d_font_renderer_t;
extern const d3d_font_renderer_t d3d_xbox360_font;
extern const d3d_font_renderer_t d3d_xdk1_font;
extern const d3d_font_renderer_t d3d_win32_font;
extern d3d_font_renderer_t d3d_xbox360_font;
extern d3d_font_renderer_t d3d_xdk1_font;
extern d3d_font_renderer_t d3d_win32_font;
const d3d_font_renderer_t *d3d_font_init_first(void *data,
const char *font_path, unsigned font_size);

View File

@ -75,7 +75,7 @@ static void d3dfonts_w32_render_msg(void *data, const char *msg,
}
}
const d3d_font_renderer_t d3d_win32_font = {
d3d_font_renderer_t d3d_win32_font = {
d3dfonts_w32_init_font,
d3dfonts_w32_deinit_font,
d3dfonts_w32_render_msg,

View File

@ -70,8 +70,8 @@ typedef struct font_renderer_driver
const char *ident;
} font_renderer_driver_t;
extern const font_renderer_driver_t ft_font_renderer;
extern const font_renderer_driver_t bitmap_font_renderer;
extern font_renderer_driver_t ft_font_renderer;
extern font_renderer_driver_t bitmap_font_renderer;
/* font_path can be NULL for default font. */
bool font_renderer_create_default(const font_renderer_driver_t **driver,

View File

@ -209,7 +209,7 @@ static const char *ft_renderer_get_default_font(void)
return NULL;
}
const font_renderer_driver_t ft_font_renderer = {
font_renderer_driver_t ft_font_renderer = {
ft_renderer_init,
ft_renderer_get_atlas,
ft_renderer_get_glyph,
@ -217,4 +217,3 @@ const font_renderer_driver_t ft_font_renderer = {
ft_renderer_get_default_font,
"freetype",
};

View File

@ -43,4 +43,3 @@ bool gl_font_init_first(const gl_font_renderer_t **font_driver, void **font_hand
return false;
}

View File

@ -23,15 +23,17 @@ typedef struct gl_font_renderer
{
void *(*init)(void *data, const char *font_path, float font_size);
void (*free)(void *data);
void (*render_msg)(void *data, const char *msg, const struct font_params *parms);
void (*render_msg)(void *data, const char *msg,
const struct font_params *parms);
const char *ident;
} gl_font_renderer_t;
extern const gl_font_renderer_t gl_raster_font;
extern const gl_font_renderer_t libdbg_font;
extern gl_font_renderer_t gl_raster_font;
extern gl_font_renderer_t libdbg_font;
bool gl_font_init_first(const gl_font_renderer_t **font_driver, void **font_handle,
void *gl_data, const char *font_path, float font_size);
bool gl_font_init_first(const gl_font_renderer_t **font_driver,
void **font_handle, void *gl_data,
const char *font_path, float font_size);
#endif

View File

@ -265,10 +265,9 @@ static void gl_render_msg(void *data, const char *msg,
gl_set_viewport(gl, gl->win_width, gl->win_height, false, true);
}
const gl_font_renderer_t gl_raster_font = {
gl_font_renderer_t gl_raster_font = {
gl_init_font,
gl_free_font,
gl_render_msg,
"GL raster",
};

View File

@ -94,10 +94,9 @@ static void gl_render_msg(void *data, const char *msg,
#endif
}
const gl_font_renderer_t libdbg_font = {
gl_font_renderer_t libdbg_font = {
gl_init_font,
gl_deinit_font,
gl_render_msg,
"GL raster",
};

View File

@ -69,7 +69,7 @@ static void xfonts_render_msg(void *data, const char *msg,
pFrontBuffer->Release();
}
const d3d_font_renderer_t d3d_xdk1_font = {
d3d_font_renderer_t d3d_xdk1_font = {
xfonts_init_font,
xfonts_deinit_font,
xfonts_render_msg,

View File

@ -467,7 +467,7 @@ static void xdk_render_msg(void *data, const char *str_msg,
}
}
const d3d_font_renderer_t d3d_xbox360_font = {
d3d_font_renderer_t d3d_xbox360_font = {
xdk_init_font,
xdk_deinit_font,
xdk_render_msg,

View File

@ -203,8 +203,16 @@ static bool gl_shader_init(gl_t *gl)
const char *shader_path = (g_settings.video.shader_enable && *g_settings.video.shader_path) ?
g_settings.video.shader_path : NULL;
enum rarch_shader_type type = gfx_shader_parse_type(shader_path,
gl->core_context ? RARCH_SHADER_GLSL : DEFAULT_SHADER_TYPE);
enum rarch_shader_type type;
if (!gl)
{
RARCH_ERR("Invalid GL instance passed to %s", __FUNCTION__);
return false;
}
type = gfx_shader_parse_type(shader_path,
gl->core_context ? RARCH_SHADER_GLSL : DEFAULT_SHADER_TYPE);
ret = 0;

View File

@ -204,7 +204,7 @@ typedef struct gl
bool vsync;
GLuint texture[MAX_TEXTURES];
unsigned tex_index; // For use with PREV.
unsigned tex_index; /* For use with PREV. */
unsigned textures;
struct gl_tex_info prev_info[MAX_TEXTURES];
GLuint tex_mag_filter;
@ -219,7 +219,7 @@ typedef struct gl
unsigned frame_count;
#ifdef HAVE_FBO
// Render-to-texture, multipass shaders
/* Render-to-texture, multipass shaders. */
GLuint fbo[MAX_SHADERS];
GLuint fbo_texture[MAX_SHADERS];
struct gl_fbo_rect fbo_rect[MAX_SHADERS];
@ -264,17 +264,17 @@ typedef struct gl
GLuint pbo;
GLenum internal_fmt;
GLenum texture_type; // RGB565 or ARGB
GLenum texture_type; /* RGB565 or ARGB */
GLenum texture_fmt;
GLenum wrap_mode;
unsigned base_size; // 2 or 4
unsigned base_size; /* 2 or 4 */
#ifdef HAVE_OPENGLES
bool support_unpack_row_length;
#else
bool have_es2_compat;
#endif
// Fonts
/* Fonts */
const gl_font_renderer_t *font_driver;
void *font_handle;
@ -292,7 +292,7 @@ typedef struct gl
#endif
#ifdef HAVE_GL_ASYNC_READBACK
// PBOs used for asynchronous viewport readbacks.
/* PBOs used for asynchronous viewport readbacks. */
GLuint pbo_readback[4];
bool pbo_readback_valid[4];
bool pbo_readback_enable;
@ -321,18 +321,19 @@ typedef struct gl
#if defined(HAVE_PSGL)
#define RARCH_GL_INTERNAL_FORMAT32 GL_ARGB_SCE
#define RARCH_GL_INTERNAL_FORMAT16 GL_RGB5 // TODO: Verify if this is really 565 or just 555.
#define RARCH_GL_INTERNAL_FORMAT16 GL_RGB5 /* TODO: Verify if this is really 565 or just 555. */
#define RARCH_GL_TEXTURE_TYPE32 GL_BGRA
#define RARCH_GL_TEXTURE_TYPE16 GL_BGRA
#define RARCH_GL_FORMAT32 GL_UNSIGNED_INT_8_8_8_8_REV
#define RARCH_GL_FORMAT16 GL_RGB5
#elif defined(HAVE_OPENGLES)
// Imgtec/SGX headers have this missing.
/* Imgtec/SGX headers have this missing. */
#ifndef GL_BGRA_EXT
#define GL_BGRA_EXT 0x80E1
#endif
#ifdef IOS
#define RARCH_GL_INTERNAL_FORMAT32 GL_RGBA // Stupid Apple
/* Stupid Apple. */
#define RARCH_GL_INTERNAL_FORMAT32 GL_RGBA
#else
#define RARCH_GL_INTERNAL_FORMAT32 GL_BGRA_EXT
#endif
@ -342,7 +343,7 @@ typedef struct gl
#define RARCH_GL_FORMAT32 GL_UNSIGNED_BYTE
#define RARCH_GL_FORMAT16 GL_UNSIGNED_SHORT_5_6_5
#else
// On desktop, we always use 32-bit.
/* On desktop, we always use 32-bit. */
#define RARCH_GL_INTERNAL_FORMAT32 GL_RGBA8
#define RARCH_GL_INTERNAL_FORMAT16 GL_RGBA8
#define RARCH_GL_TEXTURE_TYPE32 GL_BGRA
@ -350,8 +351,9 @@ typedef struct gl
#define RARCH_GL_FORMAT32 GL_UNSIGNED_INT_8_8_8_8_REV
#define RARCH_GL_FORMAT16 GL_UNSIGNED_INT_8_8_8_8_REV
// GL_RGB565 internal format isn't in desktop GL until 4.1 core (ARB_ES2_compatibility).
// Check for this.
/* GL_RGB565 internal format isn't in desktop GL
* until 4.1 core (ARB_ES2_compatibility).
* Check for this. */
#ifndef GL_RGB565
#define GL_RGB565 0x8D62
#endif
@ -360,15 +362,19 @@ typedef struct gl
#define RARCH_GL_FORMAT16_565 GL_UNSIGNED_SHORT_5_6_5
#endif
// Platform specific workarounds/hacks.
/* Platform specific workarounds/hacks. */
#if defined(__CELLOS_LV2__)
#define NO_GL_READ_PIXELS
// Performance hacks
/* Performance hacks. */
#ifdef HAVE_GCMGL
extern GLvoid* glMapBufferTextureReferenceRA( GLenum target, GLenum access );
extern GLboolean glUnmapBufferTextureReferenceRA( GLenum target );
extern void glBufferSubDataTextureReferenceRA( GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data );
extern void glBufferSubDataTextureReferenceRA( GLenum target,
GLintptr offset, GLsizeiptr size, const GLvoid *data );
#define glMapBuffer(target, access) glMapBufferTextureReferenceRA(target, access)
#define glUnmapBuffer(target) glUnmapBufferTextureReferenceRA(target)
#define glBufferSubData(target, offset, size, data) glBufferSubDataTextureReferenceRA(target, offset, size, data)
@ -383,7 +389,7 @@ extern void glBufferSubDataTextureReferenceRA( GLenum target, GLintptr offset, G
#define NO_GL_FF_MATRIX
#endif
#if defined(HAVE_OPENGLES2) // TODO: Figure out exactly what.
#if defined(HAVE_OPENGLES2) /* TODO: Figure out exactly what. */
#define NO_GL_CLAMP_TO_BORDER
#endif
@ -398,10 +404,15 @@ extern void glBufferSubDataTextureReferenceRA( GLenum target, GLintptr offset, G
#endif
void gl_set_projection(gl_t *gl, struct gl_ortho *ortho, bool allow_rotate);
void gl_set_viewport(gl_t *gl, unsigned width, unsigned height, bool force_full, bool allow_rotate);
void gl_shader_set_coords(gl_t *gl, const struct gl_coords *coords, const math_matrix *mat);
void gl_set_viewport(gl_t *gl, unsigned width, unsigned height,
bool force_full, bool allow_rotate);
void gl_shader_set_coords(gl_t *gl,
const struct gl_coords *coords, const math_matrix *mat);
void gl_init_fbo(gl_t *gl, unsigned width, unsigned height);
void gl_deinit_fbo(gl_t *gl);
static inline GLenum gl_wrap_type_to_enum(enum gfx_wrap_type type)

View File

@ -19,9 +19,11 @@
#include <stdint.h>
#include "../../boolean.h"
#ifdef _WIN32
#include "../context/win32_common.h"
#ifdef _XBOX1
#include <xtl.h>
#include "../../xdk/xdk_defines.h"
#include "../d3d9/d3d_defines.h"
#endif
#endif
struct texture_image

View File

@ -15,11 +15,11 @@
*/
#include "image.h"
#include "../../xdk/xdk_d3d.h"
#include "../d3d9/d3d_wrapper.h"
bool texture_image_load(struct texture_image *out_img, const char *path)
{
d3d_video_t *d3d = (d3d_video_t*)data;
d3d_video_t *d3d = (d3d_video_t*)driver.video_data;
D3DXIMAGE_INFO m_imageInfo;
@ -36,9 +36,9 @@ bool texture_image_load(struct texture_image *out_img, const char *path)
}
/* create a vertex buffer for the quad that will display the texture */
if (FAILED(D3DDevice_CreateVertexBuffers(d3d->dev, 4 * sizeof(Vertex),
if (FAILED(d3d_create_vertex_buffer(d3d->dev, 4 * sizeof(Vertex),
D3DUSAGE_WRITEONLY, D3DFVF_CUSTOMVERTEX,
D3DPOOL_MANAGED, &out_img->vertex_buf, NULL)))
D3DPOOL_MANAGED, out_img->vertex_buf, NULL)))
{
RARCH_ERR("Error occurred during CreateVertexBuffer().\n");
out_img->pixels->Release();

View File

@ -219,7 +219,8 @@ VIDEO DRIVER
#endif
#ifdef _XBOX
#include "../gfx/d3d9/xdk_d3d.cpp"
#include "../gfx/d3d9/d3d_wrapper.c"
#include "../gfx/d3d9/d3d.cpp"
#endif
#if defined(GEKKO)
@ -587,10 +588,9 @@ SCREENSHOTS
============================================================ */
#if defined(_XBOX1)
#include "../xdk/screenshot_xdk1.c"
#endif
#else
#include "../screenshot.c"
#endif
/*============================================================
PLAYLISTS
@ -603,6 +603,7 @@ MENU
#ifdef HAVE_MENU
#include "../frontend/menu/menu_input_line_cb.c"
#include "../frontend/menu/menu_common.c"
#include "../frontend/menu/menu_action.c"
#include "../frontend/menu/menu_entries.c"
#include "../frontend/menu/menu_navigation.c"

View File

@ -24,6 +24,7 @@
#include "../general.h"
#include "../boolean.h"
#include "input_common.h"
#include "retroarch_logger.h"
#include <stdlib.h>
#include <stddef.h>
#include <string.h>
@ -483,6 +484,12 @@ bool dinput_handle_message(void *dinput, UINT message, WPARAM wParam, LPARAM lPa
{
struct pointer_status *new_pointer =
(struct pointer_status *)malloc(sizeof(struct pointer_status));
if (!new_pointer)
{
RARCH_ERR("dinput_handle_message: pointer allocation in WM_POINTERDOWN failed.\n");
return false;
}
new_pointer->pointer_id = GET_POINTERID_WPARAM(wParam);
dinput_pointer_store_pos(new_pointer, lParam);
dinput_add_pointer(di, new_pointer);

View File

@ -1289,6 +1289,9 @@ unsigned input_translate_str_to_bind_id(const char *str)
static void parse_hat(struct retro_keybind *bind, const char *str)
{
if (!bind || !str)
return;
if (!isdigit(*str))
return;

View File

@ -16,8 +16,9 @@
#include <stdlib.h>
#include <string.h>
#include <stddef.h>
#include "message_queue.h"
#include "boolean.h"
#include "message_queue.h"
#include "retroarch_logger.h"
#include "compat/posix_string.h"
struct queue_elem
@ -72,6 +73,11 @@ void msg_queue_push(msg_queue_t *queue, const char *msg,
struct queue_elem *new_elem = (struct queue_elem*)
calloc(1, sizeof(struct queue_elem));
if (!new_elem)
{
RARCH_ERR("New element allocation failed in %s", __FUNCTION__);
return;
}
new_elem->prio = prio;
new_elem->duration = duration;

View File

@ -113,7 +113,7 @@
<MinimalRebuild>true</MinimalRebuild>
<BufferSecurityCheck>false</BufferSecurityCheck>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PreprocessorDefinitions>_DEBUG;_XBOX;HAVE_XINPUT2;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;RARCH_CONSOLE;HAVE_RMENU_XUI;HAVE_MENU;HAVE_NETPLAY;HAVE_SOCKET_LEGACY;HAVE_ZLIB;HAVE_RARCH_EXEC;HAVE_LIBRETRO_MANAGEMENT;D3DCOMPILE_USEVOIDS;HAVE_GRIFFIN;HAVE_CC_RESAMPLER;HAVE_HLSL;HAVE_D3D9;RARCH_INTERNAL;MSB_FIRST;_XBOX360;HAVE_FBO;WANT_MINIZ;SINC_LOWER_QUALITY;HAVE_XAUDIO;WANT_RPNG;HAVE_THREADS;HAVE_OVERLAY;HAVE_BUILTIN_AUTOCONFIG</PreprocessorDefinitions>
<PreprocessorDefinitions>_DEBUG;_XBOX;HAVE_XINPUT2;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;RARCH_CONSOLE;HAVE_RMENU_XUI;HAVE_MENU;HAVE_NETPLAY;HAVE_SOCKET_LEGACY;HAVE_ZLIB;HAVE_RARCH_EXEC;HAVE_LIBRETRO_MANAGEMENT;D3DCOMPILE_USEVOIDS;HAVE_GRIFFIN;HAVE_CC_RESAMPLER;HAVE_HLSL;HAVE_D3D9;RARCH_INTERNAL;MSB_FIRST;_XBOX360;WANT_MINIZ;SINC_LOWER_QUALITY;HAVE_XAUDIO;WANT_RPNG;HAVE_THREADS;HAVE_BUILTIN_AUTOCONFIG</PreprocessorDefinitions>
<CallAttributedProfiling>Callcap</CallAttributedProfiling>
<AdditionalIncludeDirectories>$(SolutionDir)\..\deps\rzlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
@ -152,7 +152,7 @@
<PREfast>AnalyzeOnly</PREfast>
<BufferSecurityCheck>false</BufferSecurityCheck>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PreprocessorDefinitions>_DEBUG;_XBOX;%(PreprocessorDefinitions);HAVE_XINPUT2;_CRT_SECURE_NO_WARNINGS;RARCH_CONSOLE;HAVE_RMENU_XUI;HAVE_MENU;HAVE_ZLIB;HAVE_RARCH_EXEC;HAVE_LIBRETRO_MANAGEMENT;D3DCOMPILE_USEVOIDS;HAVE_GRIFFIN;HAVE_CC_RESAMPLER;HAVE_HLSL;HAVE_D3D9;RARCH_INTERNAL;MSB_FIRST;_XBOX360;HAVE_FBO;WANT_MINIZ;SINC_LOWER_QUALITY;WANT_RPNG;HAVE_THREADS;HAVE_OVERLAY;HAVE_BUILTIN_AUTOCONFIG</PreprocessorDefinitions>
<PreprocessorDefinitions>_DEBUG;_XBOX;%(PreprocessorDefinitions);HAVE_XINPUT2;_CRT_SECURE_NO_WARNINGS;RARCH_CONSOLE;HAVE_RMENU_XUI;HAVE_MENU;HAVE_ZLIB;HAVE_RARCH_EXEC;HAVE_LIBRETRO_MANAGEMENT;D3DCOMPILE_USEVOIDS;HAVE_GRIFFIN;HAVE_CC_RESAMPLER;HAVE_HLSL;HAVE_D3D9;RARCH_INTERNAL;MSB_FIRST;_XBOX360;WANT_MINIZ;SINC_LOWER_QUALITY;WANT_RPNG;HAVE_THREADS;HAVE_BUILTIN_AUTOCONFIG</PreprocessorDefinitions>
<CallAttributedProfiling>Callcap</CallAttributedProfiling>
<AdditionalIncludeDirectories>$(SolutionDir)\..\deps\rzlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
@ -192,7 +192,7 @@
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
<BufferSecurityCheck>false</BufferSecurityCheck>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PreprocessorDefinitions>NDEBUG;_XBOX;PROFILE;%(PreprocessorDefinitions);HAVE_XINPUT2;_CRT_SECURE_NO_WARNINGS;RARCH_CONSOLE;HAVE_RMENU_XUI;HAVE_MENU;HAVE_ZLIB;HAVE_RARCH_EXEC;HAVE_LIBRETRO_MANAGEMENT;D3DCOMPILE_USEVOIDS;HAVE_GRIFFIN;HAVE_CC_RESAMPLER;HAVE_HLSL;HAVE_D3D9;RARCH_INTERNAL;MSB_FIRST;_XBOX360;HAVE_FBO;WANT_MINIZ;SINC_LOWER_QUALITY;HAVE_XAUDIO;WANT_RPNG;HAVE_THREADS;HAVE_OVERLAY;HAVE_BUILTIN_AUTOCONFIG</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;_XBOX;PROFILE;%(PreprocessorDefinitions);HAVE_XINPUT2;_CRT_SECURE_NO_WARNINGS;RARCH_CONSOLE;HAVE_RMENU_XUI;HAVE_MENU;HAVE_ZLIB;HAVE_RARCH_EXEC;HAVE_LIBRETRO_MANAGEMENT;D3DCOMPILE_USEVOIDS;HAVE_GRIFFIN;HAVE_CC_RESAMPLER;HAVE_HLSL;HAVE_D3D9;RARCH_INTERNAL;MSB_FIRST;_XBOX360;WANT_MINIZ;SINC_LOWER_QUALITY;HAVE_XAUDIO;WANT_RPNG;HAVE_THREADS;HAVE_BUILTIN_AUTOCONFIG</PreprocessorDefinitions>
<CallAttributedProfiling>Callcap</CallAttributedProfiling>
<AdditionalIncludeDirectories>$(SolutionDir)\..\deps\rzlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
@ -237,7 +237,7 @@
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
<BufferSecurityCheck>false</BufferSecurityCheck>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PreprocessorDefinitions>NDEBUG;_XBOX;PROFILE;FASTCAP;%(PreprocessorDefinitions);HAVE_XINPUT2;_CRT_SECURE_NO_WARNINGS;HAVE_ZLIB;HAVE_RARCH_EXEC;HAVE_LIBRETRO_MANAGEMENT;D3DCOMPILE_USEVOIDS;HAVE_GRIFFIN;HAVE_CC_RESAMPLER;HAVE_HLSL;HAVE_D3D9;RARCH_INTERNAL;MSB_FIRST;_XBOX360;HAVE_FBO;WANT_MINIZ;SINC_LOWER_QUALITY;HAVE_RMENU_XUI;HAVE_MENU;HAVE_XAUDIO;WANT_RPNG;HAVE_THREADS;HAVE_OVERLAY;HAVE_BUILTIN_AUTOCONFIG</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;_XBOX;PROFILE;FASTCAP;%(PreprocessorDefinitions);HAVE_XINPUT2;_CRT_SECURE_NO_WARNINGS;HAVE_ZLIB;HAVE_RARCH_EXEC;HAVE_LIBRETRO_MANAGEMENT;D3DCOMPILE_USEVOIDS;HAVE_GRIFFIN;HAVE_CC_RESAMPLER;HAVE_HLSL;HAVE_D3D9;RARCH_INTERNAL;MSB_FIRST;_XBOX360;WANT_MINIZ;SINC_LOWER_QUALITY;HAVE_RMENU_XUI;HAVE_MENU;HAVE_XAUDIO;WANT_RPNG;HAVE_THREADS;HAVE_BUILTIN_AUTOCONFIG</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)\..\deps\rzlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
@ -279,7 +279,7 @@
<ExceptionHandling>false</ExceptionHandling>
<BufferSecurityCheck>false</BufferSecurityCheck>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PreprocessorDefinitions>NDEBUG;_XBOX;%(PreprocessorDefinitions);HAVE_XINPUT2;_CRT_SECURE_NO_WARNINGS;RARCH_CONSOLE=1;HAVE_NETPLAY;HAVE_SOCKET_LEGACY;HAVE_ZLIB;HAVE_RARCH_EXEC;HAVE_LIBRETRO_MANAGEMENT;D3DCOMPILE_USEVOIDS;HAVE_GRIFFIN;HAVE_CC_RESAMPLER;HAVE_HLSL;HAVE_D3D9;RARCH_INTERNAL;MSB_FIRST;_XBOX360;HAVE_FBO;WANT_MINIZ;SINC_LOWER_QUALITY;HAVE_RMENU_XUI;HAVE_MENU;HAVE_XAUDIO;WANT_RPNG;HAVE_THREADS;HAVE_OVERLAY;HAVE_BUILTIN_AUTOCONFIG</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;_XBOX;%(PreprocessorDefinitions);HAVE_XINPUT2;_CRT_SECURE_NO_WARNINGS;RARCH_CONSOLE=1;HAVE_NETPLAY;HAVE_SOCKET_LEGACY;HAVE_ZLIB;HAVE_RARCH_EXEC;HAVE_LIBRETRO_MANAGEMENT;D3DCOMPILE_USEVOIDS;HAVE_GRIFFIN;HAVE_CC_RESAMPLER;HAVE_HLSL;HAVE_D3D9;RARCH_INTERNAL;MSB_FIRST;_XBOX360;WANT_MINIZ;SINC_LOWER_QUALITY;HAVE_RMENU_XUI;HAVE_MENU;HAVE_XAUDIO;WANT_RPNG;HAVE_THREADS;HAVE_BUILTIN_AUTOCONFIG</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)\..\deps\rzlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
@ -321,7 +321,7 @@
<ExceptionHandling>false</ExceptionHandling>
<BufferSecurityCheck>false</BufferSecurityCheck>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PreprocessorDefinitions>NDEBUG;_XBOX;LTCG;%(PreprocessorDefinitions);HAVE_XINPUT2;_CRT_SECURE_NO_WARNINGS;RARCH_CONSOLE;HAVE_RMENU_XUI;HAVE_MENU;HAVE_NETPLAY;HAVE_SOCKET_LEGACY;HAVE_ZLIB;HAVE_RARCH_EXEC;HAVE_LIBRETRO_MANAGEMENT;D3DCOMPILE_USEVOIDS;HAVE_GRIFFIN;HAVE_CC_RESAMPLER;HAVE_HLSL;HAVE_D3D9;RARCH_INTERNAL;MSB_FIRST;_XBOX360;HAVE_FBO;WANT_MINIZ;SINC_LOWER_QUALITY;HAVE_XAUDIO;WANT_RPNG;HAVE_THREADS;HAVE_OVERLAY;HAVE_BUILTIN_AUTOCONFIG</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;_XBOX;LTCG;%(PreprocessorDefinitions);HAVE_XINPUT2;_CRT_SECURE_NO_WARNINGS;RARCH_CONSOLE;HAVE_RMENU_XUI;HAVE_MENU;HAVE_NETPLAY;HAVE_SOCKET_LEGACY;HAVE_ZLIB;HAVE_RARCH_EXEC;HAVE_LIBRETRO_MANAGEMENT;D3DCOMPILE_USEVOIDS;HAVE_GRIFFIN;HAVE_CC_RESAMPLER;HAVE_HLSL;HAVE_D3D9;RARCH_INTERNAL;MSB_FIRST;_XBOX360;WANT_MINIZ;SINC_LOWER_QUALITY;HAVE_XAUDIO;WANT_RPNG;HAVE_THREADS;HAVE_BUILTIN_AUTOCONFIG</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)\..\deps\rzlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>

View File

@ -22,7 +22,7 @@
Optimization="3"
OptimizeForProcessor="2"
AdditionalIncludeDirectories="&quot;$(SolutionDir)\msvc-stdint&quot;;&quot;$(SolutionDir)\msvc-71&quot;;&quot;$(SolutionDir)\..\deps\rzlib&quot;"
PreprocessorDefinitions="_DEBUG;_XBOX;_XBOX1;HAVE_RMENU;HAVE_MENU;RARCH_CONSOLE;HAVE_XINPUT_XBOX1;__STDC_CONSTANT_MACROS;HAVE_ZLIB;HAVE_GRIFFIN;HAVE_CC_RESAMPLER;HAVE_LIBRETRO_MANAGEMENT;HAVE_RARCH_EXEC;HAVE_DSOUND;HAVE_D3D8;RARCH_INTERNAL;WANT_MINIZ;SINC_LOWER_QUALITY;HAVE_OVERLAY;HAVE_THREADS;HAVE_FILTERS_BUILTIN;HAVE_BUILTIN_AUTOCONFIG"
PreprocessorDefinitions="_DEBUG;_XBOX;_XBOX1;HAVE_RMENU;HAVE_MENU;RARCH_CONSOLE;HAVE_XINPUT_XBOX1;__STDC_CONSTANT_MACROS;HAVE_ZLIB;HAVE_GRIFFIN;HAVE_CC_RESAMPLER;HAVE_LIBRETRO_MANAGEMENT;HAVE_RARCH_EXEC;HAVE_DSOUND;HAVE_D3D8;RARCH_INTERNAL;WANT_MINIZ;SINC_LOWER_QUALITY;HAVE_THREADS;HAVE_FILTERS_BUILTIN;HAVE_BUILTIN_AUTOCONFIG"
MinimalRebuild="TRUE"
BasicRuntimeChecks="0"
RuntimeLibrary="1"
@ -72,7 +72,7 @@
OmitFramePointers="TRUE"
OptimizeForProcessor="2"
AdditionalIncludeDirectories="&quot;$(SolutionDir)\msvc-stdint&quot;;&quot;$(SolutionDir)\msvc-71&quot;;&quot;$(SolutionDir)\..\deps\rzlib&quot;"
PreprocessorDefinitions="NDEBUG;_XBOX;_XBOX1;HAVE_RMENU;HAVE_MENU;RARCH_CONSOLE;HAVE_XINPUT_XBOX1;__STDC_CONSTANT_MACROS;HAVE_ZLIB;PROFILE;HAVE_GRIFFIN;HAVE_CC_RESAMPLER;HAVE_LIBRETRO_MANAGEMENT;HAVE_RARCH_EXEC;HAVE_DSOUND;HAVE_D3D8;RARCH_INTERNAL;WANT_MINIZ;SINC_LOWER_QUALITY;HAVE_OVERLAY;HAVE_THREADS;HAVE_FILTERS_BUILTIN;HAVE_BUILTIN_AUTOCONFIG"
PreprocessorDefinitions="NDEBUG;_XBOX;_XBOX1;HAVE_RMENU;HAVE_MENU;RARCH_CONSOLE;HAVE_XINPUT_XBOX1;__STDC_CONSTANT_MACROS;HAVE_ZLIB;PROFILE;HAVE_GRIFFIN;HAVE_CC_RESAMPLER;HAVE_LIBRETRO_MANAGEMENT;HAVE_RARCH_EXEC;HAVE_DSOUND;HAVE_D3D8;RARCH_INTERNAL;WANT_MINIZ;SINC_LOWER_QUALITY;HAVE_THREADS;HAVE_FILTERS_BUILTIN;HAVE_BUILTIN_AUTOCONFIG"
StringPooling="TRUE"
RuntimeLibrary="0"
BufferSecurityCheck="TRUE"
@ -127,7 +127,7 @@
OmitFramePointers="TRUE"
OptimizeForProcessor="2"
AdditionalIncludeDirectories="&quot;$(SolutionDir)\msvc-stdint&quot;;&quot;$(SolutionDir)\msvc-71&quot;;&quot;$(SolutionDir)\..\deps\rzlib&quot;"
PreprocessorDefinitions="NDEBUG;_XBOX;_XBOX1;HAVE_RMENU;HAVE_MENU;RARCH_CONSOLE;HAVE_XINPUT_XBOX1;__STDC_CONSTANT_MACROS;HAVE_ZLIB;PROFILE;FASTCAP;HAVE_GRIFFIN;HAVE_CC_RESAMPLER;HAVE_LIBRETRO_MANAGEMENT;HAVE_RARCH_EXEC;HAVE_DSOUND;HAVE_D3D8;RARCH_INTERNAL;WANT_MINIZ;SINC_LOWER_QUALITY;HAVE_OVERLAY;HAVE_THREADS;HAVE_FILTERS_BUILTIN;HAVE_BUILTIN_AUTOCONFIG"
PreprocessorDefinitions="NDEBUG;_XBOX;_XBOX1;HAVE_RMENU;HAVE_MENU;RARCH_CONSOLE;HAVE_XINPUT_XBOX1;__STDC_CONSTANT_MACROS;HAVE_ZLIB;PROFILE;FASTCAP;HAVE_GRIFFIN;HAVE_CC_RESAMPLER;HAVE_LIBRETRO_MANAGEMENT;HAVE_RARCH_EXEC;HAVE_DSOUND;HAVE_D3D8;RARCH_INTERNAL;WANT_MINIZ;SINC_LOWER_QUALITY;HAVE_THREADS;HAVE_FILTERS_BUILTIN;HAVE_BUILTIN_AUTOCONFIG"
StringPooling="TRUE"
RuntimeLibrary="0"
BufferSecurityCheck="TRUE"
@ -188,7 +188,7 @@
EnableFiberSafeOptimizations="TRUE"
OptimizeForProcessor="2"
AdditionalIncludeDirectories="&quot;$(SolutionDir)\msvc-stdint&quot;;&quot;$(SolutionDir)\msvc-71&quot;;&quot;$(SolutionDir)\..\deps\rzlib&quot;"
PreprocessorDefinitions="NDEBUG;_XBOX;_XBOX1;HAVE_RMENU;HAVE_MENU;RARCH_CONSOLE;HAVE_XINPUT_XBOX1;__STDC_CONSTANT_MACROS;HAVE_ZLIB;HAVE_GRIFFIN;HAVE_CC_RESAMPLER;inline=_inline;HAVE_LIBRETRO_MANAGEMENT;HAVE_RARCH_EXEC;HAVE_DSOUND;HAVE_D3D8;RARCH_INTERNAL;WANT_MINIZ;SINC_LOWER_QUALITY;HAVE_OVERLAY;HAVE_THREADS;HAVE_FILTERS_BUILTIN;HAVE_BUILTIN_AUTOCONFIG"
PreprocessorDefinitions="NDEBUG;_XBOX;_XBOX1;HAVE_RMENU;HAVE_MENU;RARCH_CONSOLE;HAVE_XINPUT_XBOX1;__STDC_CONSTANT_MACROS;HAVE_ZLIB;HAVE_GRIFFIN;HAVE_CC_RESAMPLER;inline=_inline;HAVE_LIBRETRO_MANAGEMENT;HAVE_RARCH_EXEC;HAVE_DSOUND;HAVE_D3D8;RARCH_INTERNAL;WANT_MINIZ;SINC_LOWER_QUALITY;HAVE_THREADS;HAVE_FILTERS_BUILTIN;HAVE_BUILTIN_AUTOCONFIG"
StringPooling="TRUE"
RuntimeLibrary="0"
BufferSecurityCheck="TRUE"
@ -241,7 +241,7 @@
OmitFramePointers="TRUE"
OptimizeForProcessor="2"
AdditionalIncludeDirectories="&quot;$(SolutionDir)\msvc-stdint&quot;;&quot;$(SolutionDir)\msvc-71&quot;;&quot;$(SolutionDir)\..\deps\rzlib&quot;"
PreprocessorDefinitions="NDEBUG;_XBOX;_XBOX1;HAVE_RMENU;HAVE_MENU;RARCH_CONSOLE;HAVE_XINPUT_XBOX1;__STDC_CONSTANT_MACROS;HAVE_ZLIB;LTCG;HAVE_GRIFFIN;HAVE_CC_RESAMPLER;HAVE_LIBRETRO_MANAGEMENT;HAVE_RARCH_EXEC;HAVE_DSOUND;HAVE_D3D8;RARCH_INTERNAL;WANT_MINIZ;SINC_LOWER_QUALITY;HAVE_OVERLAY;HAVE_THREADS;HAVE_FILTERS_BUILTIN;HAVE_BUILTIN_AUTOCONFIG"
PreprocessorDefinitions="NDEBUG;_XBOX;_XBOX1;HAVE_RMENU;HAVE_MENU;RARCH_CONSOLE;HAVE_XINPUT_XBOX1;__STDC_CONSTANT_MACROS;HAVE_ZLIB;LTCG;HAVE_GRIFFIN;HAVE_CC_RESAMPLER;HAVE_LIBRETRO_MANAGEMENT;HAVE_RARCH_EXEC;HAVE_DSOUND;HAVE_D3D8;RARCH_INTERNAL;WANT_MINIZ;SINC_LOWER_QUALITY;HAVE_THREADS;HAVE_FILTERS_BUILTIN;HAVE_BUILTIN_AUTOCONFIG"
StringPooling="TRUE"
RuntimeLibrary="0"
BufferSecurityCheck="TRUE"
@ -300,7 +300,7 @@
EnableFiberSafeOptimizations="TRUE"
OptimizeForProcessor="2"
AdditionalIncludeDirectories="&quot;$(SolutionDir)\msvc-stdint&quot;;&quot;$(SolutionDir)\msvc-71&quot;;&quot;$(SolutionDir)\..\deps\rzlib&quot;"
PreprocessorDefinitions="NDEBUG;_XBOX;_XBOX1;HAVE_RMENU;HAVE_MENU;RARCH_CONSOLE;HAVE_XINPUT_XBOX1;__STDC_CONSTANT_MACROS;HAVE_ZLIB;HAVE_GRIFFIN;HAVE_CC_RESAMPLER;inline=_inline;HAVE_LIBRETRO_MANAGEMENT;HAVE_RARCH_EXEC;HAVE_DSOUND;HAVE_D3D8;RARCH_INTERNAL;WANT_MINIZ;SINC_LOWER_QUALITY;HAVE_OVERLAY;HAVE_THREADS;HAVE_FILTERS_BUILTIN;HAVE_BUILTIN_AUTOCONFIG"
PreprocessorDefinitions="NDEBUG;_XBOX;_XBOX1;HAVE_RMENU;HAVE_MENU;RARCH_CONSOLE;HAVE_XINPUT_XBOX1;__STDC_CONSTANT_MACROS;HAVE_ZLIB;HAVE_GRIFFIN;HAVE_CC_RESAMPLER;inline=_inline;HAVE_LIBRETRO_MANAGEMENT;HAVE_RARCH_EXEC;HAVE_DSOUND;HAVE_D3D8;RARCH_INTERNAL;WANT_MINIZ;SINC_LOWER_QUALITY;HAVE_THREADS;HAVE_FILTERS_BUILTIN;HAVE_BUILTIN_AUTOCONFIG"
StringPooling="TRUE"
RuntimeLibrary="0"
BufferSecurityCheck="TRUE"
@ -353,7 +353,7 @@
OmitFramePointers="TRUE"
OptimizeForProcessor="2"
AdditionalIncludeDirectories="&quot;$(SolutionDir)\msvc-stdint&quot;;&quot;$(SolutionDir)\msvc-71&quot;;&quot;$(SolutionDir)\..\deps\rzlib&quot;"
PreprocessorDefinitions="NDEBUG;_XBOX;_XBOX1;HAVE_RMENU;HAVE_MENU;RARCH_CONSOLE;HAVE_XINPUT_XBOX1;__STDC_CONSTANT_MACROS;HAVE_ZLIB;LTCG;HAVE_GRIFFIN;HAVE_CC_RESAMPLER;HAVE_LIBRETRO_MANAGEMENT;HAVE_RARCH_EXEC;HAVE_DSOUND;HAVE_D3D8;RARCH_INTERNAL;WANT_MINIZ;SINC_LOWER_QUALITY;HAVE_OVERLAY;HAVE_THREADS;HAVE_FILTERS_BUILTIN;HAVE_BUILTIN_AUTOCONFIG"
PreprocessorDefinitions="NDEBUG;_XBOX;_XBOX1;HAVE_RMENU;HAVE_MENU;RARCH_CONSOLE;HAVE_XINPUT_XBOX1;__STDC_CONSTANT_MACROS;HAVE_ZLIB;LTCG;HAVE_GRIFFIN;HAVE_CC_RESAMPLER;HAVE_LIBRETRO_MANAGEMENT;HAVE_RARCH_EXEC;HAVE_DSOUND;HAVE_D3D8;RARCH_INTERNAL;WANT_MINIZ;SINC_LOWER_QUALITY;HAVE_THREADS;HAVE_FILTERS_BUILTIN;HAVE_BUILTIN_AUTOCONFIG"
StringPooling="TRUE"
RuntimeLibrary="0"
BufferSecurityCheck="TRUE"

View File

@ -219,12 +219,14 @@
<ClCompile Include="..\..\deps\rzlib\unzip.c" />
<ClCompile Include="..\..\deps\rzlib\zutil.c" />
<ClCompile Include="..\..\file_extract.c" />
<ClCompile Include="..\..\gfx\d3d9\d3d_wrapper.c" />
<ClCompile Include="..\..\playlist.c" />
<ClCompile Include="..\..\file_list.c" />
<ClCompile Include="..\..\frontend\menu\backend\menu_common_backend.c" />
<ClCompile Include="..\..\frontend\menu\disp\rgui.c" />
<ClCompile Include="..\..\frontend\menu\menu_common.c" />
<ClCompile Include="..\..\frontend\menu\menu_input_line_cb.c" />
<ClCompile Include="..\..\frontend\menu\menu_action.c" />
<ClCompile Include="..\..\frontend\menu\menu_entries.c" />
<ClCompile Include="..\..\frontend\menu\menu_navigation.c" />
<ClCompile Include="..\..\core_info.c" />
@ -346,6 +348,74 @@
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\audio\dsp_filter.h" />
<ClInclude Include="..\..\audio\resamplers\resampler.h" />
<ClInclude Include="..\..\audio\thread_wrapper.h" />
<ClInclude Include="..\..\audio\utils.h" />
<ClInclude Include="..\..\autosave.h" />
<ClInclude Include="..\..\cheats.h" />
<ClInclude Include="..\..\command.h" />
<ClInclude Include="..\..\compat\rxml\rxml.h" />
<ClInclude Include="..\..\core_info.h" />
<ClInclude Include="..\..\core_options.h" />
<ClInclude Include="..\..\driver.h" />
<ClInclude Include="..\..\dynamic.h" />
<ClInclude Include="..\..\dynamic_dummy.h" />
<ClInclude Include="..\..\fifo_buffer.h" />
<ClInclude Include="..\..\file.h" />
<ClInclude Include="..\..\file_extract.h" />
<ClInclude Include="..\..\file_list.h" />
<ClInclude Include="..\..\file_path.h" />
<ClInclude Include="..\..\frontend\frontend.h" />
<ClInclude Include="..\..\frontend\frontend_context.h" />
<ClInclude Include="..\..\frontend\menu\backend\menu_common_backend.h" />
<ClInclude Include="..\..\frontend\menu\disp\shared.h" />
<ClInclude Include="..\..\frontend\menu\menu_common.h" />
<ClInclude Include="..\..\frontend\menu\menu_entries.h" />
<ClInclude Include="..\..\frontend\menu\menu_input_line_cb.h" />
<ClInclude Include="..\..\frontend\menu\menu_navigation.h" />
<ClInclude Include="..\..\gfx\context\win32_common.h" />
<ClInclude Include="..\..\gfx\d3d9\d3d.hpp" />
<ClInclude Include="..\..\gfx\d3d9\render_chain.hpp" />
<ClInclude Include="..\..\gfx\filter.h" />
<ClInclude Include="..\..\gfx\fonts\d3d_font.h" />
<ClInclude Include="..\..\gfx\fonts\fonts.h" />
<ClInclude Include="..\..\gfx\fonts\gl_font.h" />
<ClInclude Include="..\..\gfx\gfx_common.h" />
<ClInclude Include="..\..\gfx\gfx_context.h" />
<ClInclude Include="..\..\gfx\glsym\glsym_gl.h" />
<ClInclude Include="..\..\gfx\glsym\rglgen.h" />
<ClInclude Include="..\..\gfx\gl_common.h" />
<ClInclude Include="..\..\gfx\image\image.h" />
<ClInclude Include="..\..\gfx\math\matrix.h" />
<ClInclude Include="..\..\gfx\math\matrix_3x3.h" />
<ClInclude Include="..\..\gfx\rpng\rpng.h" />
<ClInclude Include="..\..\gfx\scaler\pixconv.h" />
<ClInclude Include="..\..\gfx\scaler\scaler.h" />
<ClInclude Include="..\..\gfx\scaler\scaler_common.h" />
<ClInclude Include="..\..\gfx\scaler\scaler_int.h" />
<ClInclude Include="..\..\gfx\shader_cg.h" />
<ClInclude Include="..\..\gfx\shader_common.h" />
<ClInclude Include="..\..\gfx\shader_glsl.h" />
<ClInclude Include="..\..\gfx\shader_parse.h" />
<ClInclude Include="..\..\gfx\state_tracker.h" />
<ClInclude Include="..\..\hash.h" />
<ClInclude Include="..\..\input\autoconf\builtin.h" />
<ClInclude Include="..\..\input\input_common.h" />
<ClInclude Include="..\..\input\keyboard_line.h" />
<ClInclude Include="..\..\input\overlay.h" />
<ClInclude Include="..\..\message_queue.h" />
<ClInclude Include="..\..\movie.h" />
<ClInclude Include="..\..\netplay.h" />
<ClInclude Include="..\..\patch.h" />
<ClInclude Include="..\..\performance.h" />
<ClInclude Include="..\..\playlist.h" />
<ClInclude Include="..\..\record\ffemu.h" />
<ClInclude Include="..\..\retroarch_logger.h" />
<ClInclude Include="..\..\rewind.h" />
<ClInclude Include="..\..\screenshot.h" />
<ClInclude Include="..\..\settings_data.h" />
<ClInclude Include="..\..\thread.h" />
<ClInclude Include="resource.h" />
</ItemGroup>
<ItemGroup>
@ -354,4 +424,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>

View File

@ -1,339 +1,494 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ClCompile Include="..\..\autosave.c" />
<ClCompile Include="..\..\cheats.c" />
<ClCompile Include="..\..\core_options.c" />
<ClCompile Include="..\..\file_extract.c" />
<ClCompile Include="..\..\performance.c" />
<ClCompile Include="..\..\command.c" />
<ClCompile Include="..\..\conf\config_file.c" />
<ClCompile Include="..\..\driver.c" />
<ClCompile Include="..\..\dynamic.c" />
<ClCompile Include="..\..\dynamic_dummy.c" />
<ClCompile Include="..\..\fifo_buffer.c" />
<ClCompile Include="..\..\file.c" />
<ClCompile Include="..\..\file_path.c" />
<ClCompile Include="..\..\hash.c" />
<ClCompile Include="..\..\message_queue.c" />
<ClCompile Include="..\..\movie.c" />
<ClCompile Include="..\..\netplay.c" />
<ClCompile Include="..\..\patch.c" />
<ClCompile Include="..\..\retroarch.c" />
<ClCompile Include="..\..\location\nulllocation.c" />
<ClCompile Include="..\..\camera\nullcamera.c" />
<ClCompile Include="..\..\gfx\nullgfx.c" />
<ClCompile Include="..\..\rewind.c" />
<ClCompile Include="..\..\screenshot.c" />
<ClCompile Include="..\..\settings.c" />
<ClCompile Include="..\..\thread.c" />
<ClCompile Include="..\..\gfx\gfx_common.c">
<Filter>gfx</Filter>
</ClCompile>
<ClCompile Include="..\..\gfx\gfx_context.c">
<Filter>gfx</Filter>
</ClCompile>
<ClCompile Include="..\..\gfx\gl.c">
<Filter>gfx</Filter>
</ClCompile>
<ClCompile Include="..\..\frontend\menu\menu_common.c">
<Filter>frontend\menu</Filter>
</ClCompile>
<ClCompile Include="..\..\frontend\menu\disp\rgui.c">
<Filter>frontend\menu\disp</Filter>
</ClCompile>
<ClCompile Include="..\..\gfx\glsym\rglgen.c">
<Filter>gfx\glsym</Filter>
</ClCompile>
<ClCompile Include="..\..\gfx\glsym\glsym_gl.c">
<Filter>gfx\glsym</Filter>
</ClCompile>
<ClCompile Include="..\..\audio\resamplers\sinc.c">
<Filter>audio</Filter>
</ClCompile>
<ClCompile Include="..\..\audio\utils.c">
<Filter>audio</Filter>
</ClCompile>
<ClCompile Include="..\..\audio\resamplers\resampler.c">
<Filter>audio</Filter>
</ClCompile>
<ClCompile Include="..\..\gfx\math\matrix.c">
<Filter>gfx\math</Filter>
</ClCompile>
<ClCompile Include="..\..\gfx\math\matrix_3x3.c">
<Filter>gfx\math</Filter>
</ClCompile>
<ClCompile Include="..\..\gfx\shader_cg.c">
<Filter>gfx</Filter>
</ClCompile>
<ClCompile Include="..\..\gfx\shader_glsl.c">
<Filter>gfx</Filter>
</ClCompile>
<ClCompile Include="..\..\gfx\state_tracker.c">
<Filter>gfx</Filter>
</ClCompile>
<ClCompile Include="..\..\gfx\shader_parse.c">
<Filter>gfx</Filter>
</ClCompile>
<ClCompile Include="..\..\gfx\context\wgl_ctx.c">
<Filter>gfx\context</Filter>
</ClCompile>
<ClCompile Include="..\..\audio\dsound.c">
<Filter>audio</Filter>
</ClCompile>
<ClCompile Include="..\..\audio\xaudio-c\xaudio-c.cpp">
<Filter>audio</Filter>
</ClCompile>
<ClCompile Include="..\..\audio\xaudio.c">
<Filter>audio</Filter>
</ClCompile>
<ClCompile Include="..\..\input\dinput.c">
<Filter>input</Filter>
</ClCompile>
<ClCompile Include="..\..\input\osk\nullosk.c">
<Filter>input</Filter>
</ClCompile>
<ClCompile Include="..\..\input\winxinput_joypad.c">
<Filter>input</Filter>
</ClCompile>
<ClCompile Include="..\..\input\keyboard_line.c">
<Filter>input</Filter>
</ClCompile>
<ClCompile Include="..\..\audio\thread_wrapper.c">
<Filter>audio</Filter>
</ClCompile>
<ClCompile Include="..\..\gfx\video_thread_wrapper.c">
<Filter>gfx</Filter>
</ClCompile>
<ClCompile Include="..\..\gfx\rpng\rpng.c">
<Filter>gfx\rpng</Filter>
</ClCompile>
<ClCompile Include="..\..\input\input_common.c">
<Filter>input</Filter>
</ClCompile>
<ClCompile Include="..\..\compat\compat.c">
<Filter>compat</Filter>
</ClCompile>
<ClCompile Include="..\..\frontend\frontend.c">
<Filter>frontend</Filter>
</ClCompile>
<ClCompile Include="..\..\frontend\frontend_context.c">
<Filter>frontend</Filter>
</ClCompile>
<ClCompile Include="..\..\gfx\context\win32_common.c">
<Filter>input</Filter>
</ClCompile>
<ClCompile Include="..\..\gfx\scaler\pixconv.c">
<Filter>gfx\scaler</Filter>
</ClCompile>
<ClCompile Include="..\..\gfx\scaler\scaler.c">
<Filter>gfx\scaler</Filter>
</ClCompile>
<ClCompile Include="..\..\gfx\scaler\scaler_int.c">
<Filter>gfx\scaler</Filter>
</ClCompile>
<ClCompile Include="..\..\gfx\scaler\scaler_filter.c">
<Filter>gfx\scaler</Filter>
</ClCompile>
<ClCompile Include="..\..\gfx\d3d9\render_chain.cpp">
<Filter>gfx\d3d9</Filter>
</ClCompile>
<ClCompile Include="..\..\compat\rxml\rxml.c">
<Filter>compat\rxml</Filter>
</ClCompile>
<ClCompile Include="..\..\input\autoconf\builtin_win.c">
<Filter>input\autoconf</Filter>
</ClCompile>
<ClCompile Include="..\..\gfx\d3d9\d3d.cpp">
<Filter>gfx\d3d9</Filter>
</ClCompile>
<ClCompile Include="..\..\deps\rzlib\zutil.c">
<Filter>deps\zlib</Filter>
</ClCompile>
<ClCompile Include="..\..\deps\rzlib\adler32.c">
<Filter>deps\zlib</Filter>
</ClCompile>
<ClCompile Include="..\..\deps\rzlib\compress.c">
<Filter>deps\zlib</Filter>
</ClCompile>
<ClCompile Include="..\..\deps\rzlib\crc32.c">
<Filter>deps\zlib</Filter>
</ClCompile>
<ClCompile Include="..\..\deps\rzlib\deflate.c">
<Filter>deps\zlib</Filter>
</ClCompile>
<ClCompile Include="..\..\deps\rzlib\gzclose.c">
<Filter>deps\zlib</Filter>
</ClCompile>
<ClCompile Include="..\..\deps\rzlib\gzlib.c">
<Filter>deps\zlib</Filter>
</ClCompile>
<ClCompile Include="..\..\deps\rzlib\gzread.c">
<Filter>deps\zlib</Filter>
</ClCompile>
<ClCompile Include="..\..\deps\rzlib\gzwrite.c">
<Filter>deps\zlib</Filter>
</ClCompile>
<ClCompile Include="..\..\deps\rzlib\inffast.c">
<Filter>deps\zlib</Filter>
</ClCompile>
<ClCompile Include="..\..\deps\rzlib\inflate.c">
<Filter>deps\zlib</Filter>
</ClCompile>
<ClCompile Include="..\..\deps\rzlib\inftrees.c">
<Filter>deps\zlib</Filter>
</ClCompile>
<ClCompile Include="..\..\deps\rzlib\ioapi.c">
<Filter>deps\zlib</Filter>
</ClCompile>
<ClCompile Include="..\..\deps\rzlib\trees.c">
<Filter>deps\zlib</Filter>
</ClCompile>
<ClCompile Include="..\..\deps\rzlib\uncompr.c">
<Filter>deps\zlib</Filter>
</ClCompile>
<ClCompile Include="..\..\deps\rzlib\unzip.c">
<Filter>deps\zlib</Filter>
</ClCompile>
<ClCompile Include="..\..\gfx\fonts\d3d_font.c">
<Filter>gfx\fonts</Filter>
</ClCompile>
<ClCompile Include="..\..\gfx\fonts\fonts.c">
<Filter>gfx\fonts</Filter>
</ClCompile>
<ClCompile Include="..\..\gfx\fonts\bitmapfont.c">
<Filter>gfx\fonts</Filter>
</ClCompile>
<ClCompile Include="..\..\gfx\fonts\d3d_w32_font.cpp">
<Filter>gfx\fonts</Filter>
</ClCompile>
<ClCompile Include="..\..\gfx\fonts\gl_font.c">
<Filter>gfx\fonts</Filter>
</ClCompile>
<ClCompile Include="..\..\gfx\fonts\gl_raster_font.c">
<Filter>gfx\fonts</Filter>
</ClCompile>
<ClCompile Include="..\..\input\overlay.c">
<Filter>input</Filter>
</ClCompile>
<ClCompile Include="..\..\frontend\menu\menu_input_line_cb.c">
<Filter>frontend\menu</Filter>
</ClCompile>
<ClCompile Include="..\..\frontend\menu\menu_entries.c">
<Filter>frontend\menu</Filter>
</ClCompile>
<ClCompile Include="..\..\frontend\menu\menu_navigation.c">
<Filter>frontend\menu</Filter>
</ClCompile>
<ClCompile Include="..\..\gfx\context\d3d_ctx.cpp">
<Filter>gfx\context</Filter>
</ClCompile>
<ClCompile Include="..\..\gfx\filter.c">
<Filter>gfx</Filter>
</ClCompile>
<ClCompile Include="..\..\audio\resamplers\cc_resampler.c">
<Filter>audio</Filter>
</ClCompile>
<ClCompile Include="..\..\frontend\menu\backend\menu_common_backend.c">
<Filter>frontend\menu\backend</Filter>
</ClCompile>
<ClCompile Include="..\..\gfx\shader_common.c">
<Filter>gfx</Filter>
</ClCompile>
<ClCompile Include="..\..\frontend\platform\platform_null.c">
<Filter>frontend\platform</Filter>
</ClCompile>
<ClCompile Include="..\..\gfx\image\image_rpng.c">
<Filter>gfx\image</Filter>
</ClCompile>
<ClCompile Include="..\..\audio\dsp_filter.c">
<Filter>audio</Filter>
</ClCompile>
<ClCompile Include="..\..\playlist.c" />
<ClCompile Include="..\..\file_list.c" />
<ClCompile Include="..\..\core_info.c" />
<ClCompile Include="..\..\audio\nullaudio.c" />
<ClCompile Include="..\..\input\nullinput.c" />
<ClCompile Include="..\..\settings_data.c" />
<ClCompile Include="..\..\record\ffemu.c">
<Filter>record</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="resource.h" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\..\media\rarch.rc" />
</ItemGroup>
<ItemGroup>
<Filter Include="gfx">
<UniqueIdentifier>{8e47cc2f-ec74-4943-b7b7-156705b5d06e}</UniqueIdentifier>
</Filter>
<Filter Include="frontend">
<UniqueIdentifier>{70d71fcb-ca47-4008-a027-26ed3eaa1f16}</UniqueIdentifier>
</Filter>
<Filter Include="frontend\menu">
<UniqueIdentifier>{6a00f197-1398-4044-bbf1-ee767df7a2ee}</UniqueIdentifier>
</Filter>
<Filter Include="frontend\menu\disp">
<UniqueIdentifier>{45fc4432-da59-4c73-a194-1fd2155489bc}</UniqueIdentifier>
</Filter>
<Filter Include="gfx\glsym">
<UniqueIdentifier>{98e75d1b-5c77-4e09-ba68-248974772850}</UniqueIdentifier>
</Filter>
<Filter Include="audio">
<UniqueIdentifier>{a4e2c91e-3109-4ef9-a5ae-a42dc713c499}</UniqueIdentifier>
</Filter>
<Filter Include="gfx\d3d9">
<UniqueIdentifier>{f2f1e12e-ac10-4b0e-aa95-7a4b6a555d44}</UniqueIdentifier>
</Filter>
<Filter Include="gfx\math">
<UniqueIdentifier>{c5041859-b61d-41bb-8f3a-f596248b1132}</UniqueIdentifier>
</Filter>
<Filter Include="gfx\context">
<UniqueIdentifier>{46e89489-2413-4645-aef3-66c7d9dd9dca}</UniqueIdentifier>
</Filter>
<Filter Include="input">
<UniqueIdentifier>{c7cbb180-c629-4897-89f0-a4298eaf5f27}</UniqueIdentifier>
</Filter>
<Filter Include="gfx\rpng">
<UniqueIdentifier>{a6b082bc-7b37-4715-8d02-701cc9acae5c}</UniqueIdentifier>
</Filter>
<Filter Include="compat">
<UniqueIdentifier>{6489e28b-b1bf-45a3-ab30-4d9a3e68c57b}</UniqueIdentifier>
</Filter>
<Filter Include="gfx\fonts">
<UniqueIdentifier>{21c771b7-6971-4953-83d7-d1f83239d490}</UniqueIdentifier>
</Filter>
<Filter Include="gfx\scaler">
<UniqueIdentifier>{8cc14084-f5b9-4166-81ac-3f66afd6527d}</UniqueIdentifier>
</Filter>
<Filter Include="compat\rxml">
<UniqueIdentifier>{c2ea7f2b-5a09-4f28-8bbe-a628bd3a0bdd}</UniqueIdentifier>
</Filter>
<Filter Include="input\autoconf">
<UniqueIdentifier>{a923ed53-ddfb-47d1-a5e7-ec6105c4bd79}</UniqueIdentifier>
</Filter>
<Filter Include="deps">
<UniqueIdentifier>{d1a36d53-e5e6-46a5-b5b4-b43794342cd1}</UniqueIdentifier>
</Filter>
<Filter Include="deps\zlib">
<UniqueIdentifier>{cf7c2fb9-ca3c-468e-af4f-74c652b3e5fe}</UniqueIdentifier>
</Filter>
<Filter Include="frontend\menu\info">
<UniqueIdentifier>{bc290b55-620e-4351-b3b8-4d7a0a3b8792}</UniqueIdentifier>
</Filter>
<Filter Include="frontend\menu\backend">
<UniqueIdentifier>{dd1ca879-56f4-43f6-8bd8-ae50222061e8}</UniqueIdentifier>
</Filter>
<Filter Include="frontend\platform">
<UniqueIdentifier>{09d78055-1c93-4f12-ae3e-97aaa90cf78f}</UniqueIdentifier>
</Filter>
<Filter Include="gfx\image">
<UniqueIdentifier>{4a5338d9-92ad-4d07-bb1a-97bd6eb475e4}</UniqueIdentifier>
</Filter>
<Filter Include="record">
<UniqueIdentifier>{5a80dd03-b4d7-4118-92ff-55a601fd80fc}</UniqueIdentifier>
</Filter>
</ItemGroup>
</Project>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ClCompile Include="..\..\autosave.c" />
<ClCompile Include="..\..\cheats.c" />
<ClCompile Include="..\..\core_options.c" />
<ClCompile Include="..\..\file_extract.c" />
<ClCompile Include="..\..\performance.c" />
<ClCompile Include="..\..\command.c" />
<ClCompile Include="..\..\conf\config_file.c" />
<ClCompile Include="..\..\driver.c" />
<ClCompile Include="..\..\dynamic.c" />
<ClCompile Include="..\..\dynamic_dummy.c" />
<ClCompile Include="..\..\fifo_buffer.c" />
<ClCompile Include="..\..\file.c" />
<ClCompile Include="..\..\file_path.c" />
<ClCompile Include="..\..\hash.c" />
<ClCompile Include="..\..\message_queue.c" />
<ClCompile Include="..\..\movie.c" />
<ClCompile Include="..\..\netplay.c" />
<ClCompile Include="..\..\patch.c" />
<ClCompile Include="..\..\retroarch.c" />
<ClCompile Include="..\..\location\nulllocation.c" />
<ClCompile Include="..\..\camera\nullcamera.c" />
<ClCompile Include="..\..\gfx\nullgfx.c" />
<ClCompile Include="..\..\rewind.c" />
<ClCompile Include="..\..\screenshot.c" />
<ClCompile Include="..\..\settings.c" />
<ClCompile Include="..\..\thread.c" />
<ClCompile Include="..\..\gfx\gfx_common.c">
<Filter>gfx</Filter>
</ClCompile>
<ClCompile Include="..\..\gfx\gfx_context.c">
<Filter>gfx</Filter>
</ClCompile>
<ClCompile Include="..\..\gfx\gl.c">
<Filter>gfx</Filter>
</ClCompile>
<ClCompile Include="..\..\frontend\menu\menu_common.c">
<Filter>frontend\menu</Filter>
</ClCompile>
<ClCompile Include="..\..\frontend\menu\disp\rgui.c">
<Filter>frontend\menu\disp</Filter>
</ClCompile>
<ClCompile Include="..\..\gfx\glsym\rglgen.c">
<Filter>gfx\glsym</Filter>
</ClCompile>
<ClCompile Include="..\..\gfx\glsym\glsym_gl.c">
<Filter>gfx\glsym</Filter>
</ClCompile>
<ClCompile Include="..\..\audio\resamplers\sinc.c">
<Filter>audio</Filter>
</ClCompile>
<ClCompile Include="..\..\audio\utils.c">
<Filter>audio</Filter>
</ClCompile>
<ClCompile Include="..\..\audio\resamplers\resampler.c">
<Filter>audio</Filter>
</ClCompile>
<ClCompile Include="..\..\gfx\math\matrix.c">
<Filter>gfx\math</Filter>
</ClCompile>
<ClCompile Include="..\..\gfx\math\matrix_3x3.c">
<Filter>gfx\math</Filter>
</ClCompile>
<ClCompile Include="..\..\gfx\shader_cg.c">
<Filter>gfx</Filter>
</ClCompile>
<ClCompile Include="..\..\gfx\shader_glsl.c">
<Filter>gfx</Filter>
</ClCompile>
<ClCompile Include="..\..\gfx\state_tracker.c">
<Filter>gfx</Filter>
</ClCompile>
<ClCompile Include="..\..\gfx\shader_parse.c">
<Filter>gfx</Filter>
</ClCompile>
<ClCompile Include="..\..\gfx\context\wgl_ctx.c">
<Filter>gfx\context</Filter>
</ClCompile>
<ClCompile Include="..\..\audio\dsound.c">
<Filter>audio</Filter>
</ClCompile>
<ClCompile Include="..\..\audio\xaudio-c\xaudio-c.cpp">
<Filter>audio</Filter>
</ClCompile>
<ClCompile Include="..\..\audio\xaudio.c">
<Filter>audio</Filter>
</ClCompile>
<ClCompile Include="..\..\input\dinput.c">
<Filter>input</Filter>
</ClCompile>
<ClCompile Include="..\..\input\osk\nullosk.c">
<Filter>input</Filter>
</ClCompile>
<ClCompile Include="..\..\input\winxinput_joypad.c">
<Filter>input</Filter>
</ClCompile>
<ClCompile Include="..\..\input\keyboard_line.c">
<Filter>input</Filter>
</ClCompile>
<ClCompile Include="..\..\audio\thread_wrapper.c">
<Filter>audio</Filter>
</ClCompile>
<ClCompile Include="..\..\gfx\video_thread_wrapper.c">
<Filter>gfx</Filter>
</ClCompile>
<ClCompile Include="..\..\gfx\rpng\rpng.c">
<Filter>gfx\rpng</Filter>
</ClCompile>
<ClCompile Include="..\..\input\input_common.c">
<Filter>input</Filter>
</ClCompile>
<ClCompile Include="..\..\compat\compat.c">
<Filter>compat</Filter>
</ClCompile>
<ClCompile Include="..\..\frontend\frontend.c">
<Filter>frontend</Filter>
</ClCompile>
<ClCompile Include="..\..\frontend\frontend_context.c">
<Filter>frontend</Filter>
</ClCompile>
<ClCompile Include="..\..\gfx\scaler\pixconv.c">
<Filter>gfx\scaler</Filter>
</ClCompile>
<ClCompile Include="..\..\gfx\scaler\scaler.c">
<Filter>gfx\scaler</Filter>
</ClCompile>
<ClCompile Include="..\..\gfx\scaler\scaler_int.c">
<Filter>gfx\scaler</Filter>
</ClCompile>
<ClCompile Include="..\..\gfx\scaler\scaler_filter.c">
<Filter>gfx\scaler</Filter>
</ClCompile>
<ClCompile Include="..\..\gfx\d3d9\render_chain.cpp">
<Filter>gfx\d3d9</Filter>
</ClCompile>
<ClCompile Include="..\..\compat\rxml\rxml.c">
<Filter>compat\rxml</Filter>
</ClCompile>
<ClCompile Include="..\..\input\autoconf\builtin_win.c">
<Filter>input\autoconf</Filter>
</ClCompile>
<ClCompile Include="..\..\gfx\d3d9\d3d.cpp">
<Filter>gfx\d3d9</Filter>
</ClCompile>
<ClCompile Include="..\..\deps\rzlib\zutil.c">
<Filter>deps\zlib</Filter>
</ClCompile>
<ClCompile Include="..\..\deps\rzlib\adler32.c">
<Filter>deps\zlib</Filter>
</ClCompile>
<ClCompile Include="..\..\deps\rzlib\compress.c">
<Filter>deps\zlib</Filter>
</ClCompile>
<ClCompile Include="..\..\deps\rzlib\crc32.c">
<Filter>deps\zlib</Filter>
</ClCompile>
<ClCompile Include="..\..\deps\rzlib\deflate.c">
<Filter>deps\zlib</Filter>
</ClCompile>
<ClCompile Include="..\..\deps\rzlib\gzclose.c">
<Filter>deps\zlib</Filter>
</ClCompile>
<ClCompile Include="..\..\deps\rzlib\gzlib.c">
<Filter>deps\zlib</Filter>
</ClCompile>
<ClCompile Include="..\..\deps\rzlib\gzread.c">
<Filter>deps\zlib</Filter>
</ClCompile>
<ClCompile Include="..\..\deps\rzlib\gzwrite.c">
<Filter>deps\zlib</Filter>
</ClCompile>
<ClCompile Include="..\..\deps\rzlib\inffast.c">
<Filter>deps\zlib</Filter>
</ClCompile>
<ClCompile Include="..\..\deps\rzlib\inflate.c">
<Filter>deps\zlib</Filter>
</ClCompile>
<ClCompile Include="..\..\deps\rzlib\inftrees.c">
<Filter>deps\zlib</Filter>
</ClCompile>
<ClCompile Include="..\..\deps\rzlib\ioapi.c">
<Filter>deps\zlib</Filter>
</ClCompile>
<ClCompile Include="..\..\deps\rzlib\trees.c">
<Filter>deps\zlib</Filter>
</ClCompile>
<ClCompile Include="..\..\deps\rzlib\uncompr.c">
<Filter>deps\zlib</Filter>
</ClCompile>
<ClCompile Include="..\..\deps\rzlib\unzip.c">
<Filter>deps\zlib</Filter>
</ClCompile>
<ClCompile Include="..\..\gfx\fonts\d3d_font.c">
<Filter>gfx\fonts</Filter>
</ClCompile>
<ClCompile Include="..\..\gfx\fonts\fonts.c">
<Filter>gfx\fonts</Filter>
</ClCompile>
<ClCompile Include="..\..\gfx\fonts\bitmapfont.c">
<Filter>gfx\fonts</Filter>
</ClCompile>
<ClCompile Include="..\..\gfx\fonts\d3d_w32_font.cpp">
<Filter>gfx\fonts</Filter>
</ClCompile>
<ClCompile Include="..\..\gfx\fonts\gl_font.c">
<Filter>gfx\fonts</Filter>
</ClCompile>
<ClCompile Include="..\..\gfx\fonts\gl_raster_font.c">
<Filter>gfx\fonts</Filter>
</ClCompile>
<ClCompile Include="..\..\input\overlay.c">
<Filter>input</Filter>
</ClCompile>
<ClCompile Include="..\..\frontend\menu\menu_input_line_cb.c">
<Filter>frontend\menu</Filter>
</ClCompile>
<ClCompile Include="..\..\frontend\menu\menu_entries.c">
<Filter>frontend\menu</Filter>
</ClCompile>
<ClCompile Include="..\..\frontend\menu\menu_navigation.c">
<Filter>frontend\menu</Filter>
</ClCompile>
<ClCompile Include="..\..\gfx\context\d3d_ctx.cpp">
<Filter>gfx\context</Filter>
</ClCompile>
<ClCompile Include="..\..\gfx\filter.c">
<Filter>gfx</Filter>
</ClCompile>
<ClCompile Include="..\..\audio\resamplers\cc_resampler.c">
<Filter>audio</Filter>
</ClCompile>
<ClCompile Include="..\..\frontend\menu\backend\menu_common_backend.c">
<Filter>frontend\menu\backend</Filter>
</ClCompile>
<ClCompile Include="..\..\gfx\shader_common.c">
<Filter>gfx</Filter>
</ClCompile>
<ClCompile Include="..\..\frontend\platform\platform_null.c">
<Filter>frontend\platform</Filter>
</ClCompile>
<ClCompile Include="..\..\gfx\image\image_rpng.c">
<Filter>gfx\image</Filter>
</ClCompile>
<ClCompile Include="..\..\audio\dsp_filter.c">
<Filter>audio</Filter>
</ClCompile>
<ClCompile Include="..\..\playlist.c" />
<ClCompile Include="..\..\file_list.c" />
<ClCompile Include="..\..\core_info.c" />
<ClCompile Include="..\..\audio\nullaudio.c" />
<ClCompile Include="..\..\input\nullinput.c" />
<ClCompile Include="..\..\settings_data.c" />
<ClCompile Include="..\..\record\ffemu.c">
<Filter>record</Filter>
</ClCompile>
<ClCompile Include="..\..\gfx\context\win32_common.c">
<Filter>gfx\context</Filter>
</ClCompile>
<ClCompile Include="..\..\frontend\menu\menu_action.c" />
<ClCompile Include="..\..\gfx\d3d9\d3d_wrapper.c">
<Filter>gfx\d3d9</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="resource.h" />
<ClInclude Include="..\..\retroarch_logger.h" />
<ClInclude Include="..\..\autosave.h" />
<ClInclude Include="..\..\cheats.h" />
<ClInclude Include="..\..\command.h" />
<ClInclude Include="..\..\core_info.h" />
<ClInclude Include="..\..\core_options.h" />
<ClInclude Include="..\..\driver.h" />
<ClInclude Include="..\..\dynamic.h" />
<ClInclude Include="..\..\dynamic_dummy.h" />
<ClInclude Include="..\..\file.h" />
<ClInclude Include="..\..\file_extract.h" />
<ClInclude Include="..\..\fifo_buffer.h" />
<ClInclude Include="..\..\file_list.h" />
<ClInclude Include="..\..\file_path.h" />
<ClInclude Include="..\..\hash.h" />
<ClInclude Include="..\..\rewind.h" />
<ClInclude Include="..\..\screenshot.h" />
<ClInclude Include="..\..\settings_data.h" />
<ClInclude Include="..\..\thread.h" />
<ClInclude Include="..\..\message_queue.h" />
<ClInclude Include="..\..\movie.h" />
<ClInclude Include="..\..\netplay.h" />
<ClInclude Include="..\..\patch.h" />
<ClInclude Include="..\..\performance.h" />
<ClInclude Include="..\..\playlist.h" />
<ClInclude Include="..\..\audio\resamplers\resampler.h">
<Filter>audio</Filter>
</ClInclude>
<ClInclude Include="..\..\audio\thread_wrapper.h">
<Filter>audio</Filter>
</ClInclude>
<ClInclude Include="..\..\audio\utils.h">
<Filter>audio</Filter>
</ClInclude>
<ClInclude Include="..\..\audio\dsp_filter.h">
<Filter>audio</Filter>
</ClInclude>
<ClInclude Include="..\..\compat\rxml\rxml.h">
<Filter>compat\rxml</Filter>
</ClInclude>
<ClInclude Include="..\..\frontend\frontend.h">
<Filter>frontend</Filter>
</ClInclude>
<ClInclude Include="..\..\frontend\frontend_context.h">
<Filter>frontend</Filter>
</ClInclude>
<ClInclude Include="..\..\frontend\menu\menu_navigation.h">
<Filter>frontend\menu</Filter>
</ClInclude>
<ClInclude Include="..\..\frontend\menu\menu_common.h">
<Filter>frontend\menu</Filter>
</ClInclude>
<ClInclude Include="..\..\frontend\menu\menu_entries.h">
<Filter>frontend\menu</Filter>
</ClInclude>
<ClInclude Include="..\..\frontend\menu\menu_input_line_cb.h">
<Filter>frontend\menu</Filter>
</ClInclude>
<ClInclude Include="..\..\frontend\menu\backend\menu_common_backend.h">
<Filter>frontend\menu\backend</Filter>
</ClInclude>
<ClInclude Include="..\..\frontend\menu\disp\shared.h">
<Filter>frontend\menu\disp</Filter>
</ClInclude>
<ClInclude Include="..\..\gfx\shader_cg.h">
<Filter>gfx</Filter>
</ClInclude>
<ClInclude Include="..\..\gfx\shader_common.h">
<Filter>gfx</Filter>
</ClInclude>
<ClInclude Include="..\..\gfx\shader_glsl.h">
<Filter>gfx</Filter>
</ClInclude>
<ClInclude Include="..\..\gfx\shader_parse.h">
<Filter>gfx</Filter>
</ClInclude>
<ClInclude Include="..\..\gfx\state_tracker.h">
<Filter>gfx</Filter>
</ClInclude>
<ClInclude Include="..\..\gfx\filter.h">
<Filter>gfx</Filter>
</ClInclude>
<ClInclude Include="..\..\gfx\gfx_common.h">
<Filter>gfx</Filter>
</ClInclude>
<ClInclude Include="..\..\gfx\gfx_context.h">
<Filter>gfx</Filter>
</ClInclude>
<ClInclude Include="..\..\gfx\gl_common.h">
<Filter>gfx</Filter>
</ClInclude>
<ClInclude Include="..\..\gfx\d3d9\d3d.hpp">
<Filter>gfx\d3d9</Filter>
</ClInclude>
<ClInclude Include="..\..\gfx\d3d9\render_chain.hpp">
<Filter>gfx\d3d9</Filter>
</ClInclude>
<ClInclude Include="..\..\gfx\fonts\gl_font.h">
<Filter>gfx\fonts</Filter>
</ClInclude>
<ClInclude Include="..\..\gfx\fonts\d3d_font.h">
<Filter>gfx\fonts</Filter>
</ClInclude>
<ClInclude Include="..\..\gfx\fonts\fonts.h">
<Filter>gfx\fonts</Filter>
</ClInclude>
<ClInclude Include="..\..\gfx\glsym\rglgen.h">
<Filter>gfx\glsym</Filter>
</ClInclude>
<ClInclude Include="..\..\gfx\glsym\glsym_gl.h">
<Filter>gfx\glsym</Filter>
</ClInclude>
<ClInclude Include="..\..\gfx\image\image.h">
<Filter>gfx\image</Filter>
</ClInclude>
<ClInclude Include="..\..\gfx\math\matrix_3x3.h">
<Filter>gfx\math</Filter>
</ClInclude>
<ClInclude Include="..\..\gfx\math\matrix.h">
<Filter>gfx\math</Filter>
</ClInclude>
<ClInclude Include="..\..\gfx\rpng\rpng.h">
<Filter>gfx\rpng</Filter>
</ClInclude>
<ClInclude Include="..\..\gfx\scaler\scaler_common.h">
<Filter>gfx\scaler</Filter>
</ClInclude>
<ClInclude Include="..\..\gfx\scaler\scaler_int.h">
<Filter>gfx\scaler</Filter>
</ClInclude>
<ClInclude Include="..\..\gfx\scaler\pixconv.h">
<Filter>gfx\scaler</Filter>
</ClInclude>
<ClInclude Include="..\..\gfx\scaler\scaler.h">
<Filter>gfx\scaler</Filter>
</ClInclude>
<ClInclude Include="..\..\input\input_common.h">
<Filter>input</Filter>
</ClInclude>
<ClInclude Include="..\..\input\keyboard_line.h">
<Filter>input</Filter>
</ClInclude>
<ClInclude Include="..\..\input\autoconf\builtin.h">
<Filter>input\autoconf</Filter>
</ClInclude>
<ClInclude Include="..\..\input\overlay.h">
<Filter>input</Filter>
</ClInclude>
<ClInclude Include="..\..\gfx\context\win32_common.h">
<Filter>gfx\context</Filter>
</ClInclude>
<ClInclude Include="..\..\record\ffemu.h">
<Filter>record</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\..\media\rarch.rc" />
</ItemGroup>
<ItemGroup>
<Filter Include="gfx">
<UniqueIdentifier>{8e47cc2f-ec74-4943-b7b7-156705b5d06e}</UniqueIdentifier>
</Filter>
<Filter Include="frontend">
<UniqueIdentifier>{70d71fcb-ca47-4008-a027-26ed3eaa1f16}</UniqueIdentifier>
</Filter>
<Filter Include="frontend\menu">
<UniqueIdentifier>{6a00f197-1398-4044-bbf1-ee767df7a2ee}</UniqueIdentifier>
</Filter>
<Filter Include="frontend\menu\disp">
<UniqueIdentifier>{45fc4432-da59-4c73-a194-1fd2155489bc}</UniqueIdentifier>
</Filter>
<Filter Include="gfx\glsym">
<UniqueIdentifier>{98e75d1b-5c77-4e09-ba68-248974772850}</UniqueIdentifier>
</Filter>
<Filter Include="audio">
<UniqueIdentifier>{a4e2c91e-3109-4ef9-a5ae-a42dc713c499}</UniqueIdentifier>
</Filter>
<Filter Include="gfx\d3d9">
<UniqueIdentifier>{f2f1e12e-ac10-4b0e-aa95-7a4b6a555d44}</UniqueIdentifier>
</Filter>
<Filter Include="gfx\math">
<UniqueIdentifier>{c5041859-b61d-41bb-8f3a-f596248b1132}</UniqueIdentifier>
</Filter>
<Filter Include="gfx\context">
<UniqueIdentifier>{46e89489-2413-4645-aef3-66c7d9dd9dca}</UniqueIdentifier>
</Filter>
<Filter Include="input">
<UniqueIdentifier>{c7cbb180-c629-4897-89f0-a4298eaf5f27}</UniqueIdentifier>
</Filter>
<Filter Include="gfx\rpng">
<UniqueIdentifier>{a6b082bc-7b37-4715-8d02-701cc9acae5c}</UniqueIdentifier>
</Filter>
<Filter Include="compat">
<UniqueIdentifier>{6489e28b-b1bf-45a3-ab30-4d9a3e68c57b}</UniqueIdentifier>
</Filter>
<Filter Include="gfx\fonts">
<UniqueIdentifier>{21c771b7-6971-4953-83d7-d1f83239d490}</UniqueIdentifier>
</Filter>
<Filter Include="gfx\scaler">
<UniqueIdentifier>{8cc14084-f5b9-4166-81ac-3f66afd6527d}</UniqueIdentifier>
</Filter>
<Filter Include="compat\rxml">
<UniqueIdentifier>{c2ea7f2b-5a09-4f28-8bbe-a628bd3a0bdd}</UniqueIdentifier>
</Filter>
<Filter Include="input\autoconf">
<UniqueIdentifier>{a923ed53-ddfb-47d1-a5e7-ec6105c4bd79}</UniqueIdentifier>
</Filter>
<Filter Include="deps">
<UniqueIdentifier>{d1a36d53-e5e6-46a5-b5b4-b43794342cd1}</UniqueIdentifier>
</Filter>
<Filter Include="deps\zlib">
<UniqueIdentifier>{cf7c2fb9-ca3c-468e-af4f-74c652b3e5fe}</UniqueIdentifier>
</Filter>
<Filter Include="frontend\menu\backend">
<UniqueIdentifier>{dd1ca879-56f4-43f6-8bd8-ae50222061e8}</UniqueIdentifier>
</Filter>
<Filter Include="frontend\platform">
<UniqueIdentifier>{09d78055-1c93-4f12-ae3e-97aaa90cf78f}</UniqueIdentifier>
</Filter>
<Filter Include="gfx\image">
<UniqueIdentifier>{4a5338d9-92ad-4d07-bb1a-97bd6eb475e4}</UniqueIdentifier>
</Filter>
<Filter Include="record">
<UniqueIdentifier>{5a80dd03-b4d7-4118-92ff-55a601fd80fc}</UniqueIdentifier>
</Filter>
</ItemGroup>
</Project>

View File

@ -752,17 +752,28 @@ static bool get_info_spectate(netplay_t *handle)
return ret;
}
static void init_buffers(netplay_t *handle)
static bool init_buffers(netplay_t *handle)
{
unsigned i;
handle->buffer = (struct delta_frame*)calloc(handle->buffer_size,
sizeof(*handle->buffer));
if (!handle->buffer)
return false;
handle->state_size = pretro_serialize_size();
for (i = 0; i < handle->buffer_size; i++)
{
handle->buffer[i].state = malloc(handle->state_size);
if (!handle->buffer[i].state)
return false;
handle->buffer[i].is_simulated = true;
}
return true;
}
netplay_t *netplay_new(const char *server, uint16_t port,
@ -818,7 +829,9 @@ netplay_t *netplay_new(const char *server, uint16_t port,
handle->buffer_size = frames + 1;
init_buffers(handle);
if (!init_buffers(handle))
goto error;
handle->has_connection = true;
}

View File

@ -3321,6 +3321,10 @@ void rarch_main_set_state(unsigned cmd)
rarch_main_set_state(RARCH_ACTION_STATE_MENU_RUNNING_FINISHED);
rarch_main_set_state(RARCH_ACTION_STATE_RUNNING_FINISHED);
break;
case RARCH_ACTION_STATE_FORCE_QUIT:
g_extern.lifecycle_state = 0;
rarch_main_set_state(RARCH_ACTION_STATE_QUIT);
break;
case RARCH_ACTION_STATE_FLUSH_INPUT:
g_extern.lifecycle_state |= (1ULL << MODE_CLEAR_INPUT);
break;
@ -3352,10 +3356,13 @@ void rarch_main_command(unsigned cmd)
switch (cmd)
{
case RARCH_CMD_LOAD_CONTENT:
#ifdef HAVE_DYNAMIC
case RARCH_CMD_LOAD_CONTENT_PERSIST:
rarch_main_command(RARCH_CMD_LOAD_CORE);
rarch_main_set_state(RARCH_ACTION_STATE_LOAD_CONTENT);
break;
case RARCH_CMD_LOAD_CONTENT:
#ifdef HAVE_DYNAMIC
rarch_main_command(RARCH_CMD_LOAD_CONTENT_PERSIST);
#else
rarch_environment_cb(RETRO_ENVIRONMENT_SET_LIBRETRO_PATH,
(void*)g_settings.libretro);
@ -3549,7 +3556,7 @@ void rarch_main_command(unsigned cmd)
init_drivers();
break;
case RARCH_CMD_QUIT_RETROARCH:
rarch_main_set_state(RARCH_ACTION_STATE_QUIT);
rarch_main_set_state(RARCH_ACTION_STATE_FORCE_QUIT);
break;
case RARCH_CMD_RESUME:
rarch_main_set_state(RARCH_ACTION_STATE_RUNNING);
@ -3665,7 +3672,10 @@ void rarch_main_command(unsigned cmd)
driver.menu_ctx->backend->shader_manager_save_preset(NULL, true);
else
{
#if defined(HAVE_CG) || defined(HAVE_HLSL) || defined(HAVE_GLSL)
shader_type = gfx_shader_parse_type("", DEFAULT_SHADER_TYPE);
#endif
if (shader_type == RARCH_SHADER_NONE)
{
#if defined(HAVE_GLSL)

View File

@ -18,6 +18,7 @@
#define __RARCH_LOGGER_H
#include <stdarg.h>
#include <stdio.h>
#if defined(RARCH_DUMMY_LOG)
#define LOG_FILE (stderr)

View File

@ -13,9 +13,9 @@
* If not, see <http://www.gnu.org/licenses/>.
*/
#include "screenshot.h"
#include "compat/strl.h"
#include <stdio.h>
#include <stddef.h>
#include <time.h>
#include "boolean.h"
#include <stdint.h>

View File

@ -19,6 +19,7 @@
#include "gfx/shader_common.h"
#include "input/input_common.h"
#include "config.def.h"
#include "retroarch_logger.h"
#ifdef APPLE
#include "input/apple_keycode.h"
@ -40,7 +41,19 @@
static void get_input_config_prefix(char *buf, size_t sizeof_buf,
const rarch_setting_t *setting)
{
snprintf(buf, sizeof_buf, "input%cplayer%d",
if (!buf)
{
RARCH_ERR("Null buffer passed to %s", __FUNCTION__);
return;
}
if (!setting)
{
RARCH_ERR("Null setting passed to %s", __FUNCTION__);
return;
}
snprintf(buf, sizeof_buf, "input%cplayer%u",
setting->index ? '_' : '\0', setting->index);
}
@ -48,6 +61,19 @@ static void get_input_config_key(char *buf, size_t sizeof_buf,
const rarch_setting_t* setting, const char* type)
{
char prefix[32];
if (!buf)
{
RARCH_ERR("Null buffer passed to %s", __FUNCTION__);
return;
}
if (!setting)
{
RARCH_ERR("Null setting passed to %s", __FUNCTION__);
return;
}
get_input_config_prefix(prefix, sizeof(prefix), setting);
snprintf(buf, sizeof_buf, "%s_%s%c%s", prefix, setting->name,
type ? '_' : '\0', type);
@ -61,6 +87,18 @@ static void get_key_name(char *buf, size_t sizeof_buf,
{
uint32_t hidkey, i;
if (!buf)
{
RARCH_ERR("Null buffer passed to %s", __FUNCTION__);
return;
}
if (!setting)
{
RARCH_ERR("Null setting passed to %s", __FUNCTION__);
return;
}
if (BINDFOR(*setting).key == RETROK_UNKNOWN)
return;
@ -80,6 +118,18 @@ static void get_key_name(char *buf, size_t sizeof_buf,
static void get_button_name(char *buf, size_t sizeof_buf,
const rarch_setting_t* setting)
{
if (!buf)
{
RARCH_ERR("Null buffer passed to %s", __FUNCTION__);
return;
}
if (!setting)
{
RARCH_ERR("Null setting passed to %s", __FUNCTION__);
return;
}
if (BINDFOR(*setting).joykey == NO_BTN)
return;
@ -90,16 +140,36 @@ static void get_button_name(char *buf, size_t sizeof_buf,
static void get_axis_name(char *buf, size_t sizeof_buf,
const rarch_setting_t* setting)
{
uint32_t joyaxis = BINDFOR(*setting).joyaxis;
uint32_t joyaxis;
if (!buf)
{
RARCH_ERR("Null buffer passed to %s", __FUNCTION__);
return;
}
if (!setting)
{
RARCH_ERR("Null setting passed to %s", __FUNCTION__);
return;
}
joyaxis = BINDFOR(*setting).joyaxis;
if (AXIS_NEG_GET(joyaxis) != AXIS_DIR_NONE)
snprintf(buf, sizeof_buf, "-%d", AXIS_NEG_GET(joyaxis));
snprintf(buf, sizeof_buf, "-%u", AXIS_NEG_GET(joyaxis));
else if (AXIS_POS_GET(joyaxis) != AXIS_DIR_NONE)
snprintf(buf, sizeof_buf, "+%d", AXIS_POS_GET(joyaxis));
snprintf(buf, sizeof_buf, "+%u", AXIS_POS_GET(joyaxis));
}
void setting_data_reset_setting(const rarch_setting_t* setting)
{
if (!setting)
{
RARCH_ERR("Null setting passed to %s", __FUNCTION__);
return;
}
switch (setting->type)
{
case ST_BOOL:
@ -158,7 +228,7 @@ void setting_data_reset(const rarch_setting_t* settings)
static bool setting_data_load_config(
const rarch_setting_t* settings, config_file_t* config)
{
if (!config)
if (!settings || !config)
return false;
for (; settings->type != ST_NONE; settings++)
@ -265,7 +335,7 @@ bool setting_data_load_config_path(const rarch_setting_t* settings,
bool setting_data_save_config(const rarch_setting_t* settings,
config_file_t* config)
{
if (!config)
if (!settings || !config)
return false;
for (; settings->type != ST_NONE; settings++)
@ -365,7 +435,7 @@ rarch_setting_t* setting_data_find_setting(rarch_setting_t* setting,
{
bool found = false;
if (!name)
if (!setting || !name)
return NULL;
for (; setting->type != ST_NONE; setting++)
@ -459,8 +529,14 @@ void setting_data_set_with_string_representation(const rarch_setting_t* setting,
static void menu_common_setting_set_label_st_bool(rarch_setting_t *setting,
char *type_str, size_t type_str_size)
{
if (!setting)
{
RARCH_ERR("Null setting passed to %s", __FUNCTION__);
return;
}
if (!strcmp(setting->name, "savestate") ||
!strcmp(setting->name, "loadstate"))
!strcmp(setting->name, "loadstate"))
{
if (g_settings.state_slot < 0)
strlcpy(type_str, "-1 (auto)", type_str_size);
@ -468,29 +544,41 @@ static void menu_common_setting_set_label_st_bool(rarch_setting_t *setting,
snprintf(type_str, type_str_size, "%d", g_settings.state_slot);
}
else
{
strlcpy(type_str, *setting->value.boolean ? setting->boolean.on_label :
setting->boolean.off_label, type_str_size);
}
}
static void menu_common_setting_set_label_st_uint(rarch_setting_t *setting,
char *type_str, size_t type_str_size)
{
if (setting && !strcmp(setting->name, "video_monitor_index"))
if (!setting)
{
RARCH_ERR("Null setting passed to %s", __FUNCTION__);
return;
}
if (!strcmp(setting->name, "video_monitor_index"))
{
if (*setting->value.unsigned_integer)
snprintf(type_str, type_str_size, "%d",
snprintf(type_str, type_str_size, "%u",
*setting->value.unsigned_integer);
else
strlcpy(type_str, "0 (Auto)", type_str_size);
}
else if (setting && !strcmp(setting->name, "video_rotation"))
else if (!strcmp(setting->name, "video_rotation"))
{
strlcpy(type_str, rotation_lut[*setting->value.unsigned_integer],
type_str_size);
else if (setting && !strcmp(setting->name, "aspect_ratio_index"))
}
else if (!strcmp(setting->name, "aspect_ratio_index"))
{
strlcpy(type_str,
aspectratio_lut[*setting->value.unsigned_integer].name,
type_str_size);
else if (setting && !strcmp(setting->name, "autosave_interval"))
}
else if (!strcmp(setting->name, "autosave_interval"))
{
if (*setting->value.unsigned_integer)
snprintf(type_str, type_str_size, "%u seconds",
@ -498,7 +586,7 @@ static void menu_common_setting_set_label_st_uint(rarch_setting_t *setting,
else
strlcpy(type_str, "OFF", type_str_size);
}
else if (setting && !strcmp(setting->name, "user_language"))
else if (!strcmp(setting->name, "user_language"))
{
static const char *modes[] = {
"English",
@ -517,7 +605,7 @@ static void menu_common_setting_set_label_st_uint(rarch_setting_t *setting,
strlcpy(type_str, modes[g_settings.user_language], type_str_size);
}
else if (setting && !strcmp(setting->name, "libretro_log_level"))
else if (!strcmp(setting->name, "libretro_log_level"))
{
static const char *modes[] = {
"0 (Debug)",
@ -530,14 +618,22 @@ static void menu_common_setting_set_label_st_uint(rarch_setting_t *setting,
type_str_size);
}
else
snprintf(type_str, type_str_size, "%d",
{
snprintf(type_str, type_str_size, "%u",
*setting->value.unsigned_integer);
}
}
static void menu_common_setting_set_label_st_float(rarch_setting_t *setting,
char *type_str, size_t type_str_size)
{
if (setting && !strcmp(setting->name, "video_refresh_rate_auto"))
if (!setting)
{
RARCH_ERR("Null setting passed to %s", __FUNCTION__);
return;
}
if (!strcmp(setting->name, "video_refresh_rate_auto"))
{
double refresh_rate = 0.0;
double deviation = 0.0;
@ -550,8 +646,10 @@ static void menu_common_setting_set_label_st_float(rarch_setting_t *setting,
strlcpy(type_str, "N/A", type_str_size);
}
else
{
snprintf(type_str, type_str_size, setting->rounding_fraction,
*setting->value.fraction);
}
}
void setting_data_get_string_representation(rarch_setting_t* setting,
@ -1950,7 +2048,6 @@ static void general_write_handler(const void *data)
if (!setting)
return;
if (!strcmp(setting->name, "quit_retroarch"))
{
if (*setting->value.boolean)
@ -2171,7 +2268,28 @@ static void general_write_handler(const void *data)
rarch_main_command(rarch_cmd);
}
#define APPEND(VALUE) if (index == list_size) { list_size *= 2; list = (rarch_setting_t*)realloc(list, sizeof(rarch_setting_t) * list_size); } (list[index++]) = VALUE
#define APPEND(VALUE) \
if (index == list_size) \
{ \
rarch_setting_t* list_temp = NULL; \
\
list_size *= 2; \
list_temp = (rarch_setting_t*)realloc(list, sizeof(rarch_setting_t) * list_size); \
\
if (list_temp) \
{ \
list = list_temp; \
} \
else \
{ \
RARCH_ERR("Settings list reallocation failed.\n"); \
free(list); \
list = NULL; \
return NULL; \
} \
} \
(list[index++]) = VALUE
#define START_GROUP(NAME) { const char *GROUP_NAME = NAME; APPEND(setting_data_group_setting (ST_GROUP, NAME));
#define END_GROUP() APPEND(setting_data_group_setting (ST_END_GROUP, 0)); }
#define START_SUB_GROUP(NAME, GROUPNAME) { const char *SUBGROUP_NAME = NAME; (void)SUBGROUP_NAME; APPEND(setting_data_subgroup_setting (ST_SUB_GROUP, NAME, GROUPNAME));
@ -2210,6 +2328,7 @@ rarch_setting_t *setting_data_get_mainmenu(bool regenerate)
{
int index = 0;
static rarch_setting_t* list = NULL;
rarch_setting_t* list_tmp = NULL;
int list_size = 32;
static bool lists[32];
@ -2223,6 +2342,11 @@ rarch_setting_t *setting_data_get_mainmenu(bool regenerate)
}
list = (rarch_setting_t*)malloc(sizeof(rarch_setting_t) * list_size);
if (!list)
{
RARCH_ERR("setting_data_get_mainmenu list allocation failed.\n");
return NULL;
}
START_GROUP("Main Menu")
START_SUB_GROUP("State", GROUP_NAME)
@ -2271,7 +2395,18 @@ rarch_setting_t *setting_data_get_mainmenu(bool regenerate)
APPEND(terminator);
/* flatten this array to save ourselves some kilobytes */
list = (rarch_setting_t*)realloc(list, sizeof(rarch_setting_t) * index);
list_tmp = (rarch_setting_t*)realloc(list, sizeof(rarch_setting_t) * index);
if (list_tmp)
{
list = list_tmp;
}
else
{
RARCH_ERR("setting_data_get_mainmenu list flattening failed.\n");
free(list);
list = NULL;
}
/* do not optimize into return realloc(),
* list is static and must be written. */
return (rarch_setting_t*)list;
@ -2282,12 +2417,18 @@ rarch_setting_t *setting_data_get_list(void)
{
int i, player, index = 0;
static rarch_setting_t* list = NULL;
rarch_setting_t* list_tmp = NULL;
int list_size = 512;
if (list)
return list;
list = (rarch_setting_t*)malloc(sizeof(rarch_setting_t) * list_size);
if (!list)
{
RARCH_ERR("setting_data_get_list list allocation failed.\n");
return NULL;
}
START_GROUP("Driver Options")
START_SUB_GROUP("State", GROUP_NAME)
@ -2617,8 +2758,18 @@ rarch_setting_t *setting_data_get_list(void)
APPEND(terminator);
/* flatten this array to save ourselves some kilobytes. */
list = (rarch_setting_t*)
list_tmp = (rarch_setting_t*)
realloc(list, sizeof(rarch_setting_t) * index);
if (list_tmp)
{
list = list_tmp;
}
else
{
RARCH_ERR("setting_data_get_list list flattening failed.\n");
free(list);
list = NULL;
}
/* do not optimize into return realloc(),
* list is static and must be written. */