Merge pull request #43 from freakdave/master

(Xbox 1) Fixed screen rotation code
This commit is contained in:
Squarepusher 2012-08-07 08:20:45 -07:00
commit f41c252f6f
4 changed files with 35 additions and 20 deletions

View File

@ -1868,15 +1868,23 @@ static void ingame_menu_resize(item *items, menu *current_menu, uint64_t input)
gfx_ctx_set_aspect_ratio(NULL, g_console.aspect_ratio_index);
if(input & (1 << RETRO_DEVICE_ID_JOYPAD_ANALOG_LEFT_DPAD_LEFT))
#ifdef _XBOX1
{
#ifdef _XBOX
if(g_console.viewports.custom_vp.x >= 4)
#endif
{
g_console.viewports.custom_vp.x -= 4;
}
}
else if(input & (1 << RETRO_DEVICE_ID_JOYPAD_LEFT))
#ifdef _XBOX1
{
#ifdef _XBOX
if(g_console.viewports.custom_vp.x > 0)
#endif
{
g_console.viewports.custom_vp.x -= 1;
}
}
if(input & (1 << RETRO_DEVICE_ID_JOYPAD_ANALOG_LEFT_DPAD_RIGHT))
g_console.viewports.custom_vp.x += 4;
@ -1889,15 +1897,23 @@ static void ingame_menu_resize(item *items, menu *current_menu, uint64_t input)
g_console.viewports.custom_vp.y += 1;
if(input & (1 << RETRO_DEVICE_ID_JOYPAD_ANALOG_LEFT_DPAD_DOWN))
#ifdef _XBOX1
{
#ifdef _XBOX
if(g_console.viewports.custom_vp.y >= 4)
#endif
{
g_console.viewports.custom_vp.y -= 4;
}
}
else if(input & (1 << RETRO_DEVICE_ID_JOYPAD_DOWN))
#ifdef _XBOX1
{
#ifdef _XBOX
if(g_console.viewports.custom_vp.y > 0)
#endif
{
g_console.viewports.custom_vp.y -= 1;
}
}
if(input & (1 << RETRO_DEVICE_ID_JOYPAD_ANALOG_RIGHT_DPAD_LEFT))
g_console.viewports.custom_vp.width -= 4;

View File

@ -249,7 +249,7 @@ static void callback_sysutil_exit(uint64_t status, uint64_t param, void *userdat
int main(int argc, char *argv[])
{
#if defined(_XBOX)
XINPUT_STATE state;
XINPUT_STATE state; //C4101
get_environment_settings();

View File

@ -88,7 +88,7 @@ void gfx_ctx_clear(void)
#ifdef _XBOX1
device_ptr->d3d_render_device->BeginScene();
device_ptr->d3d_render_device->SetFlickerFilter(1);
device_ptr->d3d_render_device->SetSoftDisplayFilter(1);
device_ptr->d3d_render_device->SetSoftDisplayFilter(false);
#endif
}

View File

@ -33,6 +33,7 @@
wchar_t strw_buffer[128];
unsigned font_x, font_y;
FLOAT angle;
static void check_window(xdk_d3d_video_t *d3d)
{
@ -147,31 +148,26 @@ static void xdk_d3d_set_rotation(void * data, unsigned orientation)
{
(void)data;
xdk_d3d_video_t *d3d = (xdk_d3d_video_t*)data;
FLOAT angle;
switch(orientation)
{
case ORIENTATION_NORMAL:
angle = M_PI * 0 / 180;
RARCH_LOG("D3D8: Set rotation to ORIENTATION_NORMAL\n");
break;
case ORIENTATION_VERTICAL:
angle = M_PI * 270 / 180;
RARCH_LOG("D3D8: Set rotation to ORIENTATION_VERTICAL\n");
break;
case ORIENTATION_FLIPPED:
angle = M_PI * 180 / 180;
RARCH_LOG("D3D8: Set rotation to ORIENTATION_FLIPPED\n");
break;
case ORIENTATION_FLIPPED_ROTATED:
angle = M_PI * 90 / 180;
RARCH_LOG("D3D8: Set rotation to ORIENTATION_FLIPPED_ROTATED\n");
break;
}
/*
D3DXMATRIX p_out;
D3DXMatrixIdentity(&p_out);
d3d->d3d_render_device->SetTransform(D3DTS_PROJECTION, &p_out);
d3d->should_resize = TRUE;
*/
}
static void *xdk_d3d_init(const video_info_t *video, const input_driver_t **input, void **input_data)
@ -187,7 +183,7 @@ static void *xdk_d3d_init(const video_info_t *video, const input_driver_t **inpu
if (!d3d->d3d_device)
{
free(d3d);
RARCH_ERR("Failed to create a D3D8 object.\n");
RARCH_ERR("D3D8: Failed to create a D3D8 object.\n");
return NULL;
}
@ -429,13 +425,16 @@ static bool xdk_d3d_frame(void *data, const void *frame,
d3d->d3d_render_device->SetSamplerState(0, D3DSAMP_ADDRESSU, D3DTADDRESS_BORDER);
d3d->d3d_render_device->SetSamplerState(0, D3DSAMP_ADDRESSV, D3DTADDRESS_BORDER);
D3DXMATRIX p_out;
d3d->d3d_render_device->SetVertexShader(D3DFVF_XYZ | D3DFVF_TEX1);
D3DXMATRIX p_out, p_rotate;
D3DXMatrixIdentity(&p_out);
d3d->d3d_render_device->SetTransform(D3DTS_WORLD, &p_out);
D3DXMatrixRotationZ(&p_rotate, angle);
d3d->d3d_render_device->SetTransform(D3DTS_WORLD, &p_rotate);
d3d->d3d_render_device->SetTransform(D3DTS_VIEW, &p_out);
d3d->d3d_render_device->SetTransform(D3DTS_PROJECTION, &p_out);
d3d->d3d_render_device->SetVertexShader(D3DFVF_XYZ | D3DFVF_TEX1);
d3d->d3d_render_device->SetStreamSource(0, d3d->vertex_buf, sizeof(DrawVerticeFormats));
d3d->d3d_render_device->Clear(0, NULL, D3DCLEAR_TARGET, 0xff000000, 1.0f, 0);
@ -483,7 +482,7 @@ static void xdk_d3d_set_nonblock_state(void *data, bool state)
if(d3d->vsync)
{
RARCH_LOG("D3D Vsync => %s\n", state ? "off" : "on");
RARCH_LOG("D3D8: Vsync => %s\n", state ? "off" : "on");
gfx_ctx_set_swap_interval(state ? 0 : 1, TRUE);
}
}