mirror of
https://github.com/libretro/RetroArch.git
synced 2025-03-03 15:37:30 +00:00
Added set_aspect_ratio callback function
This commit is contained in:
parent
d617e50bbf
commit
e18a9e1001
@ -206,7 +206,7 @@ HRESULT CSSNESQuickMenu::OnNotifyPress( HXUIOBJ hObjPressed, int & bHandled )
|
|||||||
else
|
else
|
||||||
g_console.aspect_ratio_index = 0;
|
g_console.aspect_ratio_index = 0;
|
||||||
|
|
||||||
xdk360_set_aspect_ratio(g_console.aspect_ratio_index);
|
video_xdk360.set_aspect_ratio(NULL, g_console.aspect_ratio_index);
|
||||||
char aspectratio_label[32];
|
char aspectratio_label[32];
|
||||||
sprintf(aspectratio_label, "Aspect Ratio: %s", g_console.aspect_ratio_name);
|
sprintf(aspectratio_label, "Aspect Ratio: %s", g_console.aspect_ratio_name);
|
||||||
unsigned long dwNum = MultiByteToWideChar(CP_ACP, 0, aspectratio_label, -1, NULL, 0);
|
unsigned long dwNum = MultiByteToWideChar(CP_ACP, 0, aspectratio_label, -1, NULL, 0);
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
#include "../driver.h"
|
#include "../driver.h"
|
||||||
#include "xdk360_video.h"
|
#include "xdk360_video.h"
|
||||||
#include "xdk360_video_resources.h"
|
#include "xdk360_video_resources.h"
|
||||||
|
#include "../console/console_ext.h"
|
||||||
#include "../general.h"
|
#include "../general.h"
|
||||||
#include "../message.h"
|
#include "../message.h"
|
||||||
#include "shared.h"
|
#include "shared.h"
|
||||||
@ -301,18 +302,39 @@ static void xdk360_set_orientation(void * data, uint32_t orientation)
|
|||||||
hlsl_program.modelViewProj = XMMatrixRotationZ(angle);
|
hlsl_program.modelViewProj = XMMatrixRotationZ(angle);
|
||||||
}
|
}
|
||||||
|
|
||||||
void xdk360_set_aspect_ratio(uint32_t aspectratio_index)
|
static void xdk360_set_aspect_ratio(void * data, uint32_t aspectratio_index)
|
||||||
{
|
{
|
||||||
|
(void)data;
|
||||||
switch(aspectratio_index)
|
switch(aspectratio_index)
|
||||||
{
|
{
|
||||||
case ASPECT_RATIO_4_3:
|
case ASPECT_RATIO_4_3:
|
||||||
g_settings.video.aspect_ratio = 1.33333333333;
|
g_settings.video.aspect_ratio = 1.33333333333;
|
||||||
strlcpy(g_console.aspect_ratio_name, "4:3", sizeof(g_console.aspect_ratio_name));
|
strlcpy(g_console.aspect_ratio_name, "4:3", sizeof(g_console.aspect_ratio_name));
|
||||||
break;
|
break;
|
||||||
|
case ASPECT_RATIO_4_4:
|
||||||
|
g_settings.video.aspect_ratio = 1.0;
|
||||||
|
strlcpy(g_console.aspect_ratio_name, "4:4", sizeof(g_console.aspect_ratio_name));
|
||||||
|
break;
|
||||||
|
case ASPECT_RATIO_4_1:
|
||||||
|
g_settings.video.aspect_ratio = 4.0;
|
||||||
|
strlcpy(g_console.aspect_ratio_name, "4:1", sizeof(g_console.aspect_ratio_name));
|
||||||
|
break;
|
||||||
case ASPECT_RATIO_5_4:
|
case ASPECT_RATIO_5_4:
|
||||||
g_settings.video.aspect_ratio = 1.25;
|
g_settings.video.aspect_ratio = 1.25;
|
||||||
strlcpy(g_console.aspect_ratio_name, "5:4", sizeof(g_console.aspect_ratio_name));
|
strlcpy(g_console.aspect_ratio_name, "5:4", sizeof(g_console.aspect_ratio_name));
|
||||||
break;
|
break;
|
||||||
|
case ASPECT_RATIO_6_5:
|
||||||
|
g_settings.video.aspect_ratio = 1.2;
|
||||||
|
strlcpy(g_console.aspect_ratio_name, "6:5", sizeof(g_console.aspect_ratio_name));
|
||||||
|
break;
|
||||||
|
case ASPECT_RATIO_7_9:
|
||||||
|
g_settings.video.aspect_ratio = 0.77777777777;
|
||||||
|
strlcpy(g_console.aspect_ratio_name, "7:9", sizeof(g_console.aspect_ratio_name));
|
||||||
|
break;
|
||||||
|
case ASPECT_RATIO_8_3:
|
||||||
|
g_settings.video.aspect_ratio = 2.66666666666;
|
||||||
|
strlcpy(g_console.aspect_ratio_name, "8:3", sizeof(g_console.aspect_ratio_name));
|
||||||
|
break;
|
||||||
case ASPECT_RATIO_8_7:
|
case ASPECT_RATIO_8_7:
|
||||||
g_settings.video.aspect_ratio = 1.14287142857;
|
g_settings.video.aspect_ratio = 1.14287142857;
|
||||||
strlcpy(g_console.aspect_ratio_name, "8:7", sizeof(g_console.aspect_ratio_name));
|
strlcpy(g_console.aspect_ratio_name, "8:7", sizeof(g_console.aspect_ratio_name));
|
||||||
@ -329,10 +351,22 @@ void xdk360_set_aspect_ratio(uint32_t aspectratio_index)
|
|||||||
g_settings.video.aspect_ratio = 3.2;
|
g_settings.video.aspect_ratio = 3.2;
|
||||||
strlcpy(g_console.aspect_ratio_name, "16:15", sizeof(g_console.aspect_ratio_name));
|
strlcpy(g_console.aspect_ratio_name, "16:15", sizeof(g_console.aspect_ratio_name));
|
||||||
break;
|
break;
|
||||||
|
case ASPECT_RATIO_19_12:
|
||||||
|
g_settings.video.aspect_ratio = 1.58333333333;
|
||||||
|
strlcpy(g_console.aspect_ratio_name, "19:12", sizeof(g_console.aspect_ratio_name));
|
||||||
|
break;
|
||||||
case ASPECT_RATIO_19_14:
|
case ASPECT_RATIO_19_14:
|
||||||
g_settings.video.aspect_ratio = 1.36;
|
g_settings.video.aspect_ratio = 1.35714285714;
|
||||||
strlcpy(g_console.aspect_ratio_name, "19:14", sizeof(g_console.aspect_ratio_name));
|
strlcpy(g_console.aspect_ratio_name, "19:14", sizeof(g_console.aspect_ratio_name));
|
||||||
break;
|
break;
|
||||||
|
case ASPECT_RATIO_30_17:
|
||||||
|
g_settings.video.aspect_ratio = 1.76470588235;
|
||||||
|
strlcpy(g_console.aspect_ratio_name, "30:17", sizeof(g_console.aspect_ratio_name));
|
||||||
|
break;
|
||||||
|
case ASPECT_RATIO_32_9:
|
||||||
|
g_settings.video.aspect_ratio = 3.55555555555;
|
||||||
|
strlcpy(g_console.aspect_ratio_name, "32:9", sizeof(g_console.aspect_ratio_name));
|
||||||
|
break;
|
||||||
case ASPECT_RATIO_2_1:
|
case ASPECT_RATIO_2_1:
|
||||||
g_settings.video.aspect_ratio = 2.0;
|
g_settings.video.aspect_ratio = 2.0;
|
||||||
strlcpy(g_console.aspect_ratio_name, "2:1", sizeof(g_console.aspect_ratio_name));
|
strlcpy(g_console.aspect_ratio_name, "2:1", sizeof(g_console.aspect_ratio_name));
|
||||||
@ -342,7 +376,7 @@ void xdk360_set_aspect_ratio(uint32_t aspectratio_index)
|
|||||||
strlcpy(g_console.aspect_ratio_name, "3:2", sizeof(g_console.aspect_ratio_name));
|
strlcpy(g_console.aspect_ratio_name, "3:2", sizeof(g_console.aspect_ratio_name));
|
||||||
break;
|
break;
|
||||||
case ASPECT_RATIO_3_4:
|
case ASPECT_RATIO_3_4:
|
||||||
g_settings.video.aspect_ratio = 1.5;
|
g_settings.video.aspect_ratio = 0.75;
|
||||||
strlcpy(g_console.aspect_ratio_name, "3:4", sizeof(g_console.aspect_ratio_name));
|
strlcpy(g_console.aspect_ratio_name, "3:4", sizeof(g_console.aspect_ratio_name));
|
||||||
break;
|
break;
|
||||||
case ASPECT_RATIO_1_1:
|
case ASPECT_RATIO_1_1:
|
||||||
@ -676,5 +710,6 @@ const video_driver_t video_xdk360 = {
|
|||||||
"xdk360",
|
"xdk360",
|
||||||
xdk360_set_swap_block_swap,
|
xdk360_set_swap_block_swap,
|
||||||
xdk360_swap,
|
xdk360_swap,
|
||||||
xdk360_set_orientation
|
xdk360_set_orientation,
|
||||||
};
|
xdk360_set_aspect_ratio
|
||||||
|
};
|
||||||
|
@ -23,17 +23,18 @@
|
|||||||
#include "fonts.h"
|
#include "fonts.h"
|
||||||
#include "xdk360_video_general.h"
|
#include "xdk360_video_general.h"
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
float x;
|
|
||||||
float y;
|
|
||||||
float z;
|
|
||||||
float rhw;
|
|
||||||
float u;
|
|
||||||
float v;
|
|
||||||
} primitive_t;
|
|
||||||
|
|
||||||
#define DFONT_MAX 4096
|
#define DFONT_MAX 4096
|
||||||
#define PRIM_FVF (D3DFVF_XYZRHW | D3DFVF_TEX1)
|
#define PRIM_FVF (D3DFVF_XYZRHW | D3DFVF_TEX1)
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
float x;
|
||||||
|
float y;
|
||||||
|
float z;
|
||||||
|
float rhw;
|
||||||
|
float u;
|
||||||
|
float v;
|
||||||
|
} primitive_t;
|
||||||
|
|
||||||
typedef struct DrawVerticeFormats
|
typedef struct DrawVerticeFormats
|
||||||
{
|
{
|
||||||
@ -43,9 +44,10 @@ typedef struct DrawVerticeFormats
|
|||||||
|
|
||||||
typedef struct xdk360_video
|
typedef struct xdk360_video
|
||||||
{
|
{
|
||||||
bool block_swap;
|
bool block_swap;
|
||||||
bool vsync;
|
bool vsync;
|
||||||
unsigned last_width, last_height;
|
unsigned last_width;
|
||||||
|
unsigned last_height;
|
||||||
IDirect3D9* xdk360_device;
|
IDirect3D9* xdk360_device;
|
||||||
IDirect3DDevice9* xdk360_render_device;
|
IDirect3DDevice9* xdk360_render_device;
|
||||||
IDirect3DVertexShader9 *pVertexShader;
|
IDirect3DVertexShader9 *pVertexShader;
|
||||||
@ -57,27 +59,9 @@ typedef struct xdk360_video
|
|||||||
XVIDEO_MODE video_mode;
|
XVIDEO_MODE video_mode;
|
||||||
} xdk360_video_t;
|
} xdk360_video_t;
|
||||||
|
|
||||||
enum
|
|
||||||
{
|
|
||||||
ASPECT_RATIO_4_3,
|
|
||||||
ASPECT_RATIO_5_4,
|
|
||||||
ASPECT_RATIO_8_7,
|
|
||||||
ASPECT_RATIO_16_9,
|
|
||||||
ASPECT_RATIO_16_10,
|
|
||||||
ASPECT_RATIO_16_15,
|
|
||||||
ASPECT_RATIO_19_14,
|
|
||||||
ASPECT_RATIO_2_1,
|
|
||||||
ASPECT_RATIO_3_2,
|
|
||||||
ASPECT_RATIO_3_4,
|
|
||||||
ASPECT_RATIO_1_1,
|
|
||||||
ASPECT_RATIO_AUTO,
|
|
||||||
ASPECT_RATIO_CUSTOM
|
|
||||||
};
|
|
||||||
|
|
||||||
void xdk360_video_init(void);
|
void xdk360_video_init(void);
|
||||||
void xdk360_video_deinit(void);
|
void xdk360_video_deinit(void);
|
||||||
void xdk360_video_set_vsync(bool vsync);
|
void xdk360_video_set_vsync(bool vsync);
|
||||||
void xdk360_set_aspect_ratio(uint32_t aspectratio_index);
|
|
||||||
|
|
||||||
extern void *g_d3d;
|
extern void *g_d3d;
|
||||||
|
|
||||||
|
@ -19,6 +19,33 @@
|
|||||||
#ifndef ROM_EXT_H__
|
#ifndef ROM_EXT_H__
|
||||||
#define ROM_EXT_H__
|
#define ROM_EXT_H__
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
ASPECT_RATIO_4_3,
|
||||||
|
ASPECT_RATIO_4_4,
|
||||||
|
ASPECT_RATIO_4_1,
|
||||||
|
ASPECT_RATIO_5_4,
|
||||||
|
ASPECT_RATIO_6_5,
|
||||||
|
ASPECT_RATIO_7_9,
|
||||||
|
ASPECT_RATIO_8_3,
|
||||||
|
ASPECT_RATIO_8_7,
|
||||||
|
ASPECT_RATIO_16_9,
|
||||||
|
ASPECT_RATIO_16_10,
|
||||||
|
ASPECT_RATIO_16_15,
|
||||||
|
ASPECT_RATIO_19_12,
|
||||||
|
ASPECT_RATIO_19_14,
|
||||||
|
ASPECT_RATIO_30_17,
|
||||||
|
ASPECT_RATIO_32_9,
|
||||||
|
ASPECT_RATIO_2_1,
|
||||||
|
ASPECT_RATIO_3_2,
|
||||||
|
ASPECT_RATIO_3_4,
|
||||||
|
ASPECT_RATIO_1_1,
|
||||||
|
ASPECT_RATIO_AUTO,
|
||||||
|
ASPECT_RATIO_CUSTOM
|
||||||
|
};
|
||||||
|
|
||||||
|
#define LAST_ASPECT_RATIO ASPECT_RATIO_CUSTOM
|
||||||
|
|
||||||
#include "console_ext_input.h"
|
#include "console_ext_input.h"
|
||||||
|
|
||||||
/*============================================================
|
/*============================================================
|
||||||
|
@ -40,6 +40,7 @@
|
|||||||
#define video_xml_shader_func(path) driver.video->xml_shader(driver.video_data, path)
|
#define video_xml_shader_func(path) driver.video->xml_shader(driver.video_data, path)
|
||||||
#define video_free_func() gl_free(driver.video_data)
|
#define video_free_func() gl_free(driver.video_data)
|
||||||
#define video_set_rotation_func(orientation) ps3graphics_set_orientation(driver.video_data, orientation)
|
#define video_set_rotation_func(orientation) ps3graphics_set_orientation(driver.video_data, orientation)
|
||||||
|
#define video_set_aspect_ratio_func(aspectratio_idx) ps3graphics_set_aspect_ratio(driver.video_data, aspectratio_idx)
|
||||||
|
|
||||||
#define input_init_func() ps3_input_initialize()
|
#define input_init_func() ps3_input_initialize()
|
||||||
#define input_poll_func() ps3_input_poll(driver.input_data)
|
#define input_poll_func() ps3_input_poll(driver.input_data)
|
||||||
@ -64,6 +65,7 @@
|
|||||||
#define video_xml_shader_func(path) driver.video->xml_shader(driver.video_data, path)
|
#define video_xml_shader_func(path) driver.video->xml_shader(driver.video_data, path)
|
||||||
#define video_free_func() xdk360_gfx_free(driver.video_data)
|
#define video_free_func() xdk360_gfx_free(driver.video_data)
|
||||||
#define video_set_rotation_func(orientation) xdk360_set_orientation(driver.video_data, orientation)
|
#define video_set_rotation_func(orientation) xdk360_set_orientation(driver.video_data, orientation)
|
||||||
|
#define video_set_aspect_ratio_func(aspectratio_idx) xdk360_set_aspect_ratio(driver.video_data, aspectratio_idx)
|
||||||
|
|
||||||
#define input_init_func() xdk360_input_initialize()
|
#define input_init_func() xdk360_input_initialize()
|
||||||
#define input_poll_func() xdk360_input_poll(driver.input_data)
|
#define input_poll_func() xdk360_input_poll(driver.input_data)
|
||||||
|
2
driver.h
2
driver.h
@ -157,6 +157,7 @@ typedef struct video_driver
|
|||||||
void (*swap)(void *data); // Explicitly swap buffers. Only useful when set_swap_block_state() is set to true.
|
void (*swap)(void *data); // Explicitly swap buffers. Only useful when set_swap_block_state() is set to true.
|
||||||
#endif
|
#endif
|
||||||
void (*set_rotation)(void *data, unsigned rotation);
|
void (*set_rotation)(void *data, unsigned rotation);
|
||||||
|
void (*set_aspect_ratio)(void *data, unsigned aspectratio_idx);
|
||||||
} video_driver_t;
|
} video_driver_t;
|
||||||
|
|
||||||
typedef struct driver
|
typedef struct driver
|
||||||
@ -236,6 +237,7 @@ extern const input_driver_t input_xdk360;
|
|||||||
#define video_focus_func() driver.video->focus(driver.video_data)
|
#define video_focus_func() driver.video->focus(driver.video_data)
|
||||||
#define video_xml_shader_func(path) driver.video->xml_shader(driver.video_data, path)
|
#define video_xml_shader_func(path) driver.video->xml_shader(driver.video_data, path)
|
||||||
#define video_set_rotation_func(rotate) driver.video->set_rotation(driver.video_data, rotate)
|
#define video_set_rotation_func(rotate) driver.video->set_rotation(driver.video_data, rotate)
|
||||||
|
#define video_set_aspect_ratio_func(aspect_idx) driver.video->set_aspect_ratio(driver.video_data, aspect_idx)
|
||||||
#define video_free_func() driver.video->free(driver.video_data)
|
#define video_free_func() driver.video->free(driver.video_data)
|
||||||
|
|
||||||
#define input_init_func() driver.input->init()
|
#define input_init_func() driver.input->init()
|
||||||
|
14
ps3/menu.c
14
ps3/menu.c
@ -1304,7 +1304,7 @@ static void producesettingentry(menu * menu_obj, uint64_t switchvalue)
|
|||||||
if(g_console.aspect_ratio_index > 0)
|
if(g_console.aspect_ratio_index > 0)
|
||||||
{
|
{
|
||||||
g_console.aspect_ratio_index--;
|
g_console.aspect_ratio_index--;
|
||||||
ps3graphics_set_aspect_ratio(g_console.aspect_ratio_index);
|
video_gl.set_aspect_ratio(NULL, g_console.aspect_ratio_index);
|
||||||
set_delay = DELAY_SMALL;
|
set_delay = DELAY_SMALL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1313,14 +1313,14 @@ static void producesettingentry(menu * menu_obj, uint64_t switchvalue)
|
|||||||
if(g_console.aspect_ratio_index < LAST_ASPECT_RATIO)
|
if(g_console.aspect_ratio_index < LAST_ASPECT_RATIO)
|
||||||
{
|
{
|
||||||
g_console.aspect_ratio_index++;
|
g_console.aspect_ratio_index++;
|
||||||
ps3graphics_set_aspect_ratio(g_console.aspect_ratio_index);
|
video_gl.set_aspect_ratio(NULL, g_console.aspect_ratio_index);
|
||||||
set_delay = DELAY_SMALL;
|
set_delay = DELAY_SMALL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(CTRL_START(state))
|
if(CTRL_START(state))
|
||||||
{
|
{
|
||||||
g_console.aspect_ratio_index = ASPECT_RATIO_4_3;
|
g_console.aspect_ratio_index = ASPECT_RATIO_4_3;
|
||||||
ps3graphics_set_aspect_ratio(g_console.aspect_ratio_index);
|
video_gl.set_aspect_ratio(NULL, g_console.aspect_ratio_index);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SETTING_HW_TEXTURE_FILTER:
|
case SETTING_HW_TEXTURE_FILTER:
|
||||||
@ -2122,7 +2122,7 @@ static void ingame_menu(uint32_t menu_id)
|
|||||||
if(g_console.aspect_ratio_index > 0)
|
if(g_console.aspect_ratio_index > 0)
|
||||||
{
|
{
|
||||||
g_console.aspect_ratio_index--;
|
g_console.aspect_ratio_index--;
|
||||||
ps3graphics_set_aspect_ratio(g_console.aspect_ratio_index);
|
video_gl.set_aspect_ratio(NULL, g_console.aspect_ratio_index);
|
||||||
set_delay = DELAY_LONG;
|
set_delay = DELAY_LONG;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2131,14 +2131,14 @@ static void ingame_menu(uint32_t menu_id)
|
|||||||
if(g_console.aspect_ratio_index < LAST_ASPECT_RATIO)
|
if(g_console.aspect_ratio_index < LAST_ASPECT_RATIO)
|
||||||
{
|
{
|
||||||
g_console.aspect_ratio_index++;
|
g_console.aspect_ratio_index++;
|
||||||
ps3graphics_set_aspect_ratio(g_console.aspect_ratio_index);
|
video_gl.set_aspect_ratio(NULL, g_console.aspect_ratio_index);
|
||||||
set_delay = DELAY_LONG;
|
set_delay = DELAY_LONG;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(CTRL_START(state))
|
if(CTRL_START(state))
|
||||||
{
|
{
|
||||||
g_console.aspect_ratio_index = ASPECT_RATIO_4_3;
|
g_console.aspect_ratio_index = ASPECT_RATIO_4_3;
|
||||||
ps3graphics_set_aspect_ratio(g_console.aspect_ratio_index);
|
video_gl.set_aspect_ratio(NULL, g_console.aspect_ratio_index);
|
||||||
}
|
}
|
||||||
strcpy(comment, "Press LEFT or RIGHT to change the [Aspect Ratio].\nPress START to reset back to default values.");
|
strcpy(comment, "Press LEFT or RIGHT to change the [Aspect Ratio].\nPress START to reset back to default values.");
|
||||||
break;
|
break;
|
||||||
@ -2249,7 +2249,7 @@ static void ingame_menu(uint32_t menu_id)
|
|||||||
if(CTRL_CROSS(state))
|
if(CTRL_CROSS(state))
|
||||||
{
|
{
|
||||||
g_console.aspect_ratio_index = ASPECT_RATIO_CUSTOM;
|
g_console.aspect_ratio_index = ASPECT_RATIO_CUSTOM;
|
||||||
ps3graphics_set_aspect_ratio(g_console.aspect_ratio_index);
|
video_gl.set_aspect_ratio(NULL, g_console.aspect_ratio_index);
|
||||||
while(stuck_in_loop && g_console.ingame_menu_enable)
|
while(stuck_in_loop && g_console.ingame_menu_enable)
|
||||||
{
|
{
|
||||||
state = cell_pad_input_poll_device(0);
|
state = cell_pad_input_poll_device(0);
|
||||||
|
@ -2176,6 +2176,101 @@ static void ps3graphics_swap(void * data)
|
|||||||
cellSysutilCheckCallback();
|
cellSysutilCheckCallback();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void ps3graphics_set_aspect_ratio(void * data, uint32_t aspectratio_index)
|
||||||
|
{
|
||||||
|
(void)data;
|
||||||
|
gl_t * gl = g_gl;
|
||||||
|
|
||||||
|
switch(aspectratio_index)
|
||||||
|
{
|
||||||
|
case ASPECT_RATIO_4_3:
|
||||||
|
g_settings.video.aspect_ratio = 1.33333333333;
|
||||||
|
strlcpy(g_console.aspect_ratio_name, "4:3", sizeof(g_console.aspect_ratio_name));
|
||||||
|
break;
|
||||||
|
case ASPECT_RATIO_4_4:
|
||||||
|
g_settings.video.aspect_ratio = 1.0;
|
||||||
|
strlcpy(g_console.aspect_ratio_name, "4:4", sizeof(g_console.aspect_ratio_name));
|
||||||
|
break;
|
||||||
|
case ASPECT_RATIO_4_1:
|
||||||
|
g_settings.video.aspect_ratio = 4.0;
|
||||||
|
strlcpy(g_console.aspect_ratio_name, "4:1", sizeof(g_console.aspect_ratio_name));
|
||||||
|
break;
|
||||||
|
case ASPECT_RATIO_5_4:
|
||||||
|
g_settings.video.aspect_ratio = 1.25;
|
||||||
|
strlcpy(g_console.aspect_ratio_name, "5:4", sizeof(g_console.aspect_ratio_name));
|
||||||
|
break;
|
||||||
|
case ASPECT_RATIO_6_5:
|
||||||
|
g_settings.video.aspect_ratio = 1.2;
|
||||||
|
strlcpy(g_console.aspect_ratio_name, "6:5", sizeof(g_console.aspect_ratio_name));
|
||||||
|
break;
|
||||||
|
case ASPECT_RATIO_7_9:
|
||||||
|
g_settings.video.aspect_ratio = 0.77777777777;
|
||||||
|
strlcpy(g_console.aspect_ratio_name, "7:9", sizeof(g_console.aspect_ratio_name));
|
||||||
|
break;
|
||||||
|
case ASPECT_RATIO_8_3:
|
||||||
|
g_settings.video.aspect_ratio = 2.66666666666;
|
||||||
|
strlcpy(g_console.aspect_ratio_name, "8:3", sizeof(g_console.aspect_ratio_name));
|
||||||
|
break;
|
||||||
|
case ASPECT_RATIO_8_7:
|
||||||
|
g_settings.video.aspect_ratio = 1.14287142857;
|
||||||
|
strlcpy(g_console.aspect_ratio_name, "8:7", sizeof(g_console.aspect_ratio_name));
|
||||||
|
break;
|
||||||
|
case ASPECT_RATIO_16_9:
|
||||||
|
g_settings.video.aspect_ratio = 1.777778;
|
||||||
|
strlcpy(g_console.aspect_ratio_name, "16:9", sizeof(g_console.aspect_ratio_name));
|
||||||
|
break;
|
||||||
|
case ASPECT_RATIO_16_10:
|
||||||
|
g_settings.video.aspect_ratio = 1.6;
|
||||||
|
strlcpy(g_console.aspect_ratio_name, "16:10", sizeof(g_console.aspect_ratio_name));
|
||||||
|
break;
|
||||||
|
case ASPECT_RATIO_16_15:
|
||||||
|
g_settings.video.aspect_ratio = 3.2;
|
||||||
|
strlcpy(g_console.aspect_ratio_name, "16:15", sizeof(g_console.aspect_ratio_name));
|
||||||
|
break;
|
||||||
|
case ASPECT_RATIO_19_12:
|
||||||
|
g_settings.video.aspect_ratio = 1.58333333333;
|
||||||
|
strlcpy(g_console.aspect_ratio_name, "19:12", sizeof(g_console.aspect_ratio_name));
|
||||||
|
break;
|
||||||
|
case ASPECT_RATIO_19_14:
|
||||||
|
g_settings.video.aspect_ratio = 1.35714285714;
|
||||||
|
strlcpy(g_console.aspect_ratio_name, "19:14", sizeof(g_console.aspect_ratio_name));
|
||||||
|
break;
|
||||||
|
case ASPECT_RATIO_30_17:
|
||||||
|
g_settings.video.aspect_ratio = 1.76470588235;
|
||||||
|
strlcpy(g_console.aspect_ratio_name, "30:17", sizeof(g_console.aspect_ratio_name));
|
||||||
|
break;
|
||||||
|
case ASPECT_RATIO_32_9:
|
||||||
|
g_settings.video.aspect_ratio = 3.55555555555;
|
||||||
|
strlcpy(g_console.aspect_ratio_name, "32:9", sizeof(g_console.aspect_ratio_name));
|
||||||
|
break;
|
||||||
|
case ASPECT_RATIO_2_1:
|
||||||
|
g_settings.video.aspect_ratio = 2.0;
|
||||||
|
strlcpy(g_console.aspect_ratio_name, "2:1", sizeof(g_console.aspect_ratio_name));
|
||||||
|
break;
|
||||||
|
case ASPECT_RATIO_3_2:
|
||||||
|
g_settings.video.aspect_ratio = 1.5;
|
||||||
|
strlcpy(g_console.aspect_ratio_name, "3:2", sizeof(g_console.aspect_ratio_name));
|
||||||
|
break;
|
||||||
|
case ASPECT_RATIO_3_4:
|
||||||
|
g_settings.video.aspect_ratio = 0.75;
|
||||||
|
strlcpy(g_console.aspect_ratio_name, "3:4", sizeof(g_console.aspect_ratio_name));
|
||||||
|
break;
|
||||||
|
case ASPECT_RATIO_1_1:
|
||||||
|
g_settings.video.aspect_ratio = 1.0;
|
||||||
|
strlcpy(g_console.aspect_ratio_name, "1:1", sizeof(g_console.aspect_ratio_name));
|
||||||
|
break;
|
||||||
|
case ASPECT_RATIO_AUTO:
|
||||||
|
strlcpy(g_console.aspect_ratio_name, "(Auto)", sizeof(g_console.aspect_ratio_name));
|
||||||
|
break;
|
||||||
|
case ASPECT_RATIO_CUSTOM:
|
||||||
|
strlcpy(g_console.aspect_ratio_name, "(Custom)", sizeof(g_console.aspect_ratio_name));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
g_settings.video.force_aspect = false;
|
||||||
|
gl->keep_aspect = true;
|
||||||
|
set_viewport(gl, gl->win_width, gl->win_height, false);
|
||||||
|
}
|
||||||
|
|
||||||
const video_driver_t video_gl =
|
const video_driver_t video_gl =
|
||||||
{
|
{
|
||||||
.init = gl_init,
|
.init = gl_init,
|
||||||
@ -2187,6 +2282,7 @@ const video_driver_t video_gl =
|
|||||||
.ident = "gl",
|
.ident = "gl",
|
||||||
.set_swap_block_state = ps3graphics_set_swap_block_swap,
|
.set_swap_block_state = ps3graphics_set_swap_block_swap,
|
||||||
.set_rotation = ps3graphics_set_orientation,
|
.set_rotation = ps3graphics_set_orientation,
|
||||||
|
.set_aspect_ratio = ps3graphics_set_aspect_ratio,
|
||||||
.swap = ps3graphics_swap
|
.swap = ps3graphics_swap
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -2371,67 +2467,6 @@ void ps3graphics_set_overscan(bool overscan_enable, float amount, bool recalcula
|
|||||||
set_viewport(gl, gl->win_width, gl->win_height, false);
|
set_viewport(gl, gl->win_width, gl->win_height, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ps3graphics_set_aspect_ratio(uint32_t aspectratio_index)
|
|
||||||
{
|
|
||||||
gl_t * gl = g_gl;
|
|
||||||
|
|
||||||
switch(aspectratio_index)
|
|
||||||
{
|
|
||||||
case ASPECT_RATIO_4_3:
|
|
||||||
g_settings.video.aspect_ratio = 1.33333333333;
|
|
||||||
strlcpy(g_console.aspect_ratio_name, "4:3", sizeof(g_console.aspect_ratio_name));
|
|
||||||
break;
|
|
||||||
case ASPECT_RATIO_5_4:
|
|
||||||
g_settings.video.aspect_ratio = 1.25;
|
|
||||||
strlcpy(g_console.aspect_ratio_name, "5:4", sizeof(g_console.aspect_ratio_name));
|
|
||||||
break;
|
|
||||||
case ASPECT_RATIO_8_7:
|
|
||||||
g_settings.video.aspect_ratio = 1.14287142857;
|
|
||||||
strlcpy(g_console.aspect_ratio_name, "8:7", sizeof(g_console.aspect_ratio_name));
|
|
||||||
break;
|
|
||||||
case ASPECT_RATIO_16_9:
|
|
||||||
g_settings.video.aspect_ratio = 1.777778;
|
|
||||||
strlcpy(g_console.aspect_ratio_name, "16:9", sizeof(g_console.aspect_ratio_name));
|
|
||||||
break;
|
|
||||||
case ASPECT_RATIO_16_10:
|
|
||||||
g_settings.video.aspect_ratio = 1.6;
|
|
||||||
strlcpy(g_console.aspect_ratio_name, "16:10", sizeof(g_console.aspect_ratio_name));
|
|
||||||
break;
|
|
||||||
case ASPECT_RATIO_16_15:
|
|
||||||
g_settings.video.aspect_ratio = 3.2;
|
|
||||||
strlcpy(g_console.aspect_ratio_name, "16:15", sizeof(g_console.aspect_ratio_name));
|
|
||||||
break;
|
|
||||||
case ASPECT_RATIO_19_14:
|
|
||||||
g_settings.video.aspect_ratio = 1.35714285714;
|
|
||||||
strlcpy(g_console.aspect_ratio_name, "19:14", sizeof(g_console.aspect_ratio_name));
|
|
||||||
break;
|
|
||||||
case ASPECT_RATIO_2_1:
|
|
||||||
g_settings.video.aspect_ratio = 2.0;
|
|
||||||
strlcpy(g_console.aspect_ratio_name, "2:1", sizeof(g_console.aspect_ratio_name));
|
|
||||||
break;
|
|
||||||
case ASPECT_RATIO_3_2:
|
|
||||||
g_settings.video.aspect_ratio = 1.5;
|
|
||||||
strlcpy(g_console.aspect_ratio_name, "3:2", sizeof(g_console.aspect_ratio_name));
|
|
||||||
break;
|
|
||||||
case ASPECT_RATIO_3_4:
|
|
||||||
g_settings.video.aspect_ratio = 1.5;
|
|
||||||
strlcpy(g_console.aspect_ratio_name, "3:4", sizeof(g_console.aspect_ratio_name));
|
|
||||||
break;
|
|
||||||
case ASPECT_RATIO_1_1:
|
|
||||||
g_settings.video.aspect_ratio = 1.0;
|
|
||||||
strlcpy(g_console.aspect_ratio_name, "1:1", sizeof(g_console.aspect_ratio_name));
|
|
||||||
break;
|
|
||||||
case ASPECT_RATIO_AUTO:
|
|
||||||
strlcpy(g_console.aspect_ratio_name, "(Auto)", sizeof(g_console.aspect_ratio_name));
|
|
||||||
break;
|
|
||||||
case ASPECT_RATIO_CUSTOM:
|
|
||||||
strlcpy(g_console.aspect_ratio_name, "(Custom)", sizeof(g_console.aspect_ratio_name));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
g_settings.video.force_aspect = false;
|
|
||||||
gl->keep_aspect = true;
|
|
||||||
set_viewport(gl, gl->win_width, gl->win_height, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* PS3 needs a working graphics stack before SSNES even starts.
|
/* PS3 needs a working graphics stack before SSNES even starts.
|
||||||
|
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
#include "../gfx/gl_common.h"
|
#include "../gfx/gl_common.h"
|
||||||
#include "../gfx/gfx_common.h"
|
#include "../gfx/gfx_common.h"
|
||||||
#include "../gfx/image.h"
|
#include "../gfx/image.h"
|
||||||
|
#include "../console/console_ext.h"
|
||||||
#include <cell/dbgfont.h>
|
#include <cell/dbgfont.h>
|
||||||
|
|
||||||
#define FBO_DEINIT 0
|
#define FBO_DEINIT 0
|
||||||
@ -43,25 +44,6 @@
|
|||||||
#define SSNES_CG_MAX_SHADERS 16
|
#define SSNES_CG_MAX_SHADERS 16
|
||||||
#define SSNES_CG_MENU_SHADER_INDEX (SSNES_CG_MAX_SHADERS - 1)
|
#define SSNES_CG_MENU_SHADER_INDEX (SSNES_CG_MAX_SHADERS - 1)
|
||||||
|
|
||||||
enum
|
|
||||||
{
|
|
||||||
ASPECT_RATIO_4_3,
|
|
||||||
ASPECT_RATIO_5_4,
|
|
||||||
ASPECT_RATIO_8_7,
|
|
||||||
ASPECT_RATIO_16_9,
|
|
||||||
ASPECT_RATIO_16_10,
|
|
||||||
ASPECT_RATIO_16_15,
|
|
||||||
ASPECT_RATIO_19_14,
|
|
||||||
ASPECT_RATIO_2_1,
|
|
||||||
ASPECT_RATIO_3_2,
|
|
||||||
ASPECT_RATIO_3_4,
|
|
||||||
ASPECT_RATIO_1_1,
|
|
||||||
ASPECT_RATIO_AUTO,
|
|
||||||
ASPECT_RATIO_CUSTOM
|
|
||||||
};
|
|
||||||
|
|
||||||
#define LAST_ASPECT_RATIO ASPECT_RATIO_CUSTOM
|
|
||||||
|
|
||||||
typedef struct gl
|
typedef struct gl
|
||||||
{
|
{
|
||||||
bool block_swap;
|
bool block_swap;
|
||||||
@ -133,7 +115,6 @@ void ps3_next_resolution (void);
|
|||||||
void ps3_set_filtering(unsigned index, bool set_smooth);
|
void ps3_set_filtering(unsigned index, bool set_smooth);
|
||||||
void ps3_video_deinit(void);
|
void ps3_video_deinit(void);
|
||||||
void ps3graphics_reinit_fbos (void);
|
void ps3graphics_reinit_fbos (void);
|
||||||
void ps3graphics_set_aspect_ratio(uint32_t aspectratio_index);
|
|
||||||
void ps3graphics_set_overscan(bool overscan_enable, float amount, bool recalculate_viewport);
|
void ps3graphics_set_overscan(bool overscan_enable, float amount, bool recalculate_viewport);
|
||||||
void ps3graphics_set_vsync(uint32_t vsync);
|
void ps3graphics_set_vsync(uint32_t vsync);
|
||||||
void ps3graphics_video_init(bool get_all_resolutions);
|
void ps3graphics_video_init(bool get_all_resolutions);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user