Merge remote-tracking branch 'upstream/master'

This commit is contained in:
radius 2015-04-05 15:43:15 -05:00
commit 1613b86a39
21 changed files with 524 additions and 350 deletions

View File

@ -374,8 +374,8 @@ ifeq ($(HAVE_DINPUT), 1)
JOYCONFIG_LIBS += -ldinput8 -ldxguid -lole32
endif
ifeq ($(HAVE_WINXINPUT), 1)
DEFINES += -DHAVE_WINXINPUT -DHAVE_BUILTIN_AUTOCONFIG
ifeq ($(HAVE_XINPUT), 1)
DEFINES += -DHAVE_XINPUT -DHAVE_BUILTIN_AUTOCONFIG
OBJ += input/drivers_joypad/xinput_joypad.o \
input/autoconf/builtin_win.o
endif

View File

@ -20,7 +20,7 @@ HAVE_ZLIB_DEFLATE = 1
HAVE_PYTHON = 0
DYNAMIC = 1
HAVE_WINXINPUT = 1
HAVE_XINPUT = 1
HAVE_SDL := 0
HAVE_SDL2 := 0

View File

@ -94,7 +94,7 @@ enum
INPUT_NULL,
JOYPAD_PS3,
JOYPAD_WINXINPUT,
JOYPAD_XINPUT,
JOYPAD_GX,
JOYPAD_XDK,
JOYPAD_PSP,
@ -251,8 +251,8 @@ enum
#if defined(__CELLOS_LV2__)
#define JOYPAD_DEFAULT_DRIVER JOYPAD_PS3
#elif defined(HAVE_WINXINPUT)
#define JOYPAD_DEFAULT_DRIVER JOYPAD_WINXINPUT
#elif defined(HAVE_XINPUT)
#define JOYPAD_DEFAULT_DRIVER JOYPAD_XINPUT
#elif defined(GEKKO)
#define JOYPAD_DEFAULT_DRIVER JOYPAD_GX
#elif defined(_XBOX)

View File

@ -264,8 +264,8 @@ const char *config_get_default_joypad(void)
{
case JOYPAD_PS3:
return "ps3";
case JOYPAD_WINXINPUT:
return "winxinput";
case JOYPAD_XINPUT:
return "xinput";
case JOYPAD_GX:
return "gx";
case JOYPAD_XDK:

View File

@ -394,20 +394,20 @@ void ANativeActivity_onCreate(ANativeActivity* activity,
}
memset(android_app, 0, sizeof(struct android_app));
android_app->activity = activity;
android_app->mutex = slock_new();
android_app->cond = scond_new();
android_app->mutex = slock_new();
android_app->cond = scond_new();
if (pipe(msgpipe))
{
RARCH_ERR("could not create pipe: %s.\n", strerror(errno));
activity->instance = NULL;
}
android_app->msgread = msgpipe[0];
android_app->msgread = msgpipe[0];
android_app->msgwrite = msgpipe[1];
android_app->thread = sthread_create(android_app_entry, android_app);
android_app->thread = sthread_create(android_app_entry, android_app);
/* Wait for thread to start. */
slock_lock(android_app->mutex);

View File

@ -120,6 +120,8 @@ static void frontend_ctr_deinit(void *data)
global->log_file = NULL;
#endif
wait_for_input();
gfxExit();
// sdmcExit();
// fsExit();
@ -134,13 +136,6 @@ static void frontend_ctr_shutdown(bool unused)
(void)unused;
}
static int exit_callback(int arg1, int arg2, void *common)
{
frontend_ctr_deinit(NULL);
frontend_ctr_shutdown(false);
return 0;
}
#define PRINTFPOS(X,Y) "\x1b["#X";"#Y"H"
#define PRINTFPOS_STR(X,Y) "\x1b["X";"Y"H"
static void frontend_ctr_init(void *data)
@ -150,23 +145,10 @@ static void frontend_ctr_init(void *data)
global_t *global = global_get_ptr();
global->verbosity = true;
gfxInitDefault();
// gfxInitDefault();
gfxInit(GSP_BGR8_OES,GSP_RGB565_OES,false);
gfxSet3D(false);
consoleInit(GFX_BOTTOM, NULL);
// consoleInit(GFX_BOTTOM, NULL);
// gfxInitDefault();
// gfxInit(GSP_RGBA8_OES,GSP_RGBA8_OES,false);
// gfxSet3D(false);
// consoleInit(GFX_BOTTOM, NULL);
// printf(PRINTFPOS(0,0)"3ds_test");
// printf(PRINTFPOS(0,1)"Press Start to exit.");
// gfxFlushBuffers();
// gfxSwapBuffers();
#endif
}
@ -174,12 +156,12 @@ static void frontend_ctr_init(void *data)
static int frontend_ctr_get_rating(void)
{
return 4;
return 3;
}
bool select_pressed = false;
void wait_for_input()
{
printf("Press Start.\n\n\n\n");fflush(stdout);
printf("\n\nPress Start.\n\n");fflush(stdout);
while(aptMainLoop())
{
hidScanInput();

View File

@ -297,7 +297,7 @@ static void renderchain_set_shader_mvp(void *data, void *shader_data, void *matr
cgD3D9SetUniform(cgp, &val); \
} while(0)
void renderchain_set_shader_params(void *data, void *pass_data,
static void renderchain_set_shader_params(void *data, void *pass_data,
unsigned video_w, unsigned video_h,
unsigned tex_w, unsigned tex_h,
unsigned viewport_w, unsigned viewport_h)

View File

@ -98,11 +98,6 @@ void renderchain_set_shaders(void *data, void *fragment_data, void *vertex_data)
void renderchain_destroy_shader(void *data, int i);
void renderchain_set_shader_params(void *data, void *pass_data,
unsigned video_w, unsigned video_h,
unsigned tex_w, unsigned tex_h,
unsigned viewport_w, unsigned viewport_h);
bool renderchain_init_shader_fvf(void *data, void *pass_data);
#endif

View File

@ -20,7 +20,7 @@ static void renderchain_set_mvp(void *data, unsigned vp_width,
#endif
}
static void renderchain_clear(void *data)
void renderchain_clear(void *data)
{
d3d_video_t *d3d = (d3d_video_t*)data;
@ -28,7 +28,7 @@ static void renderchain_clear(void *data)
d3d_vertex_buffer_free(d3d->vertex_buf, d3d->vertex_decl);
}
static void renderchain_free(void *data)
void renderchain_free(void *data)
{
d3d_video_t *chain = (d3d_video_t*)data;
@ -100,11 +100,11 @@ static bool renderchain_create_first_pass(void *data,
return true;
}
static void renderchain_deinit_shader(void)
void renderchain_deinit_shader(void)
{
}
static bool renderchain_init_shader(void *data)
bool renderchain_init_shader(void *data)
{
const char *shader_path = NULL;
d3d_video_t *d3d = (d3d_video_t*)data;
@ -239,7 +239,7 @@ static void renderchain_set_vertices(void *data, unsigned pass,
#endif
}
static void renderchain_blit_to_texture(void *data, const void *frame,
void renderchain_blit_to_texture(void *data, const void *frame,
unsigned width, unsigned height, unsigned pitch)
{
D3DLOCKED_RECT d3dlr;

View File

@ -1,39 +1,33 @@
; setup constants
.const c20, 0.0, 1.0, 0.0, 1.0
.const c20, 0.0, 1.0, 0.0, 1.0
; .in v0, vertex
; .in v1, texCoord
; setup outmap
.out o0, result.position, 0xF
.out o1, result.color, 0xF
.out o2, result.texcoord0, 0x3
; setup uniform map (not required)
.uniform c0, c3, projection
; .uniform c0, c0, vertexScale
; .uniform c1, c1, textureScale
.vsh vmain, end_vmain
.vsh vmain, end_vmain
;code
vmain:
mov r0, v0 (0x4)
mov r0, c20 (0x3)
dp4 o0, c0, r0 (0x0)
dp4 o0, c1, r0 (0x1)
dp4 o0, c2, r0 (0x2)
mov o0, c20 (0x3)
mov o1, c20 (0x5)
;mov o2, v1 (0x6)
mul r0, c3, v1 (0x6)
add o2, c20, r0 (0x7)
flush
mul r0, c0, v0 (0x0)
add o0, c20, r0 (0x1)
mov o0, c20 (0x2)
mov o1, c20 (0x3)
mul r0, c1, v1 (0x4)
add o2, c20, r0 (0x5)
nop
end
end_vmain:
;operand descriptors
.opdesc x___, xyzw, xyzw ; 0x0
.opdesc _y__, xyzw, xyzw ; 0x1
.opdesc __z_, xyzw, xyzw ; 0x2
.opdesc ___w, xyzw, xyzw ; 0x3
.opdesc xyz_, xyzw, xyzw ; 0x4
.opdesc xyzw, wwww, wwww ; 0x5
.opdesc xyzw, xyzw, xyzw ; 0x6
.opdesc xyzw, xyzz, xyzw ; 0x7
.opdesc xyz_, xyzw, yxzw ; 0x0
.opdesc xyz_, yyzw, xyzw ; 0x1
.opdesc ___w, xyzw, xyzw ; 0x2
.opdesc xyzw, wwww, wwww ; 0x3
.opdesc xyzw, xyzw, xyzw ; 0x4
.opdesc xyzw, xyzw, xyzw ; 0x5

View File

@ -13,15 +13,13 @@
* If not, see <http://www.gnu.org/licenses/>.
*/
/* using code the from GPU example in crtulib */
#include <3ds.h>
#include <stdio.h>
#include <string.h>
#include <malloc.h>
#include "ctr_gu.h"
#include "ctr_blit_shader_shbin.h"
#include "../../general.h"
#include "../../driver.h"
#include "../video_viewport.h"
@ -29,8 +27,45 @@
#include "retroarch.h"
#define CTR_TOP_FRAMEBUFFER_WIDTH 400
#define CTR_TOP_FRAMEBUFFER_HEIGHT 240
#define CTR_GPU_FRAMEBUFFER ((void*)0x1F119400)
#define CTR_GPU_DEPTHBUFFER ((void*)0x1F370800)
typedef struct
{
s16 x, y, z;
s16 u, v;
} ctr_vertex_t;
typedef struct ctr_video
{
struct
{
uint32_t* display_list;
int display_list_size;
void* texture_linear;
void* texture_swizzled;
int texture_width;
int texture_height;
float texture_scale[4];
ctr_vertex_t* frame_coords;
}menu;
uint32_t* display_list;
int display_list_size;
void* texture_linear;
void* texture_swizzled;
int texture_width;
int texture_height;
float vertex_scale[4];
float texture_scale[4];
ctr_vertex_t* frame_coords;
DVLB_s* dvlb;
shaderProgram_s shader;
bool rgb32;
bool vsync;
bool smooth;
@ -38,206 +73,117 @@ typedef struct ctr_video
unsigned rotation;
} ctr_video_t;
DVLB_s* dvlb;
shaderProgram_s shader;
u32* texData;
u32* texData2;
//GPU framebuffer address
u32* gpuOut = (u32*)0x1F119400;
//GPU depth buffer address
u32* gpuDOut = (u32*)0x1F370800;
typedef struct
{
struct
{
float x, y, z;
} position;
float texcoord[2];
} vertex_s;
u32 gpuCmdSize;
u32* gpuCmd;
u32* gpuCmdRight;
u32* texture_bin;
#define tex_w 512
#define tex_h 512
#define gpu_tex_w 512
#define gpu_tex_h 512
#define TEX_MAKE_SIZE(W,H) (((u32)(W))|((u32)(H)<<16))
#define tex_size TEX_MAKE_SIZE(tex_w, tex_h)
#define gpu_tex_size TEX_MAKE_SIZE(gpu_tex_w, gpu_tex_h)
#define texture_bin_size (tex_w * tex_h * sizeof(*texture_bin))
#define gpu_texture_bin_size (gpu_tex_w * gpu_tex_h * 4)
#define fbwidth 400
#define fbheight 240
#define CTR_MATRIX(X0,Y0,Z0,W0,X1,Y1,Z1,W1,X2,Y2,Z2,W2,X3,Y3,Z3,W3) {W0,Z0,Y0,X0,W1,Z1,Y1,X1,W2,Z2,Y2,X2,W3,Z3,Y3,X3}
float proj_m[16] = CTR_MATRIX
(
0.0, -2.0 / fbheight, 0.0, 1.0,
-2.0 / fbwidth, 0.0, 0.0, 1.0,
0.0, 0.0, 1.0, 0.0,
1.0 / gpu_tex_w, -1.0 / gpu_tex_h, 1.0, 1.0
);
const vertex_s modelVboData[] =
{
{{ 40 + 0.0f, 0.0f, -1.0f}, {0.0f, 0.0f}},
{{ 40 + 320, 0.0f, -1.0f}, {320, 0.0f}},
{{ 40 + 320, tex_h, -1.0f}, {320, tex_h}},
{{ 40 + 0.0f, 0.0f, -1.0f}, {0.0f, 0.0f}},
{{ 40 + 320, tex_h, -1.0f}, {320, tex_h}},
{{ 40 + 0.0f, tex_h, -1.0f}, {0.0f, tex_h}}
};
void* vbo_buffer;
//stolen from staplebutt
void GPU_SetDummyTexEnv(u8 num)
{
GPU_SetTexEnv(num,
GPU_TEVSOURCES(GPU_PREVIOUS, 0, 0),
GPU_TEVSOURCES(GPU_PREVIOUS, 0, 0),
GPU_TEVOPERANDS(0, 0, 0),
GPU_TEVOPERANDS(0, 0, 0),
GPU_REPLACE,
GPU_REPLACE,
0xFFFFFFFF);
}
// topscreen
void renderFrame(ctr_video_t* ctr)
{
GPU_SetViewport((u32*)osConvertVirtToPhys((u32)gpuDOut),
(u32*)osConvertVirtToPhys((u32)gpuOut), 0, 0, fbheight * 2, fbwidth);
GPU_DepthMap(-1.0f, 0.0f);
GPU_SetFaceCulling(GPU_CULL_NONE);
GPU_SetStencilTest(false, GPU_ALWAYS, 0x00, 0xFF, 0x00);
GPU_SetStencilOp(GPU_KEEP, GPU_KEEP, GPU_KEEP);
GPU_SetBlendingColor(0, 0, 0, 0);
// GPU_SetDepthTestAndWriteMask(true, GPU_GREATER, GPU_WRITE_ALL);
GPU_SetDepthTestAndWriteMask(false, GPU_ALWAYS, GPU_WRITE_ALL);
// GPU_SetDepthTestAndWriteMask(true, GPU_ALWAYS, GPU_WRITE_ALL);
GPUCMD_AddMaskedWrite(GPUREG_0062, 0x1, 0);
GPUCMD_AddWrite(GPUREG_0118, 0);
GPU_SetAlphaBlending(GPU_BLEND_ADD, GPU_BLEND_ADD, GPU_SRC_ALPHA,
GPU_ONE_MINUS_SRC_ALPHA, GPU_SRC_ALPHA, GPU_ONE_MINUS_SRC_ALPHA);
GPU_SetAlphaTest(false, GPU_ALWAYS, 0x00);
GPU_SetTextureEnable(GPU_TEXUNIT0);
GPU_SetTexEnv(0,
GPU_TEVSOURCES(GPU_TEXTURE0, GPU_PRIMARY_COLOR, GPU_PRIMARY_COLOR),
GPU_TEVSOURCES(GPU_TEXTURE0, GPU_PRIMARY_COLOR, GPU_PRIMARY_COLOR),
GPU_TEVOPERANDS(0, 0, 0),
GPU_TEVOPERANDS(0, 0, 0),
GPU_MODULATE, GPU_MODULATE,
0xFFFFFFFF);
GPU_SetDummyTexEnv(1);
GPU_SetDummyTexEnv(2);
GPU_SetDummyTexEnv(3);
GPU_SetDummyTexEnv(4);
GPU_SetDummyTexEnv(5);
//texturing stuff
GPU_SetTexture(GPU_TEXUNIT0, (u32*)osConvertVirtToPhys((u32)texData), gpu_tex_w, gpu_tex_h,
GPU_TEXTURE_MAG_FILTER(GPU_LINEAR) | GPU_TEXTURE_MIN_FILTER(GPU_LINEAR),
ctr->menu_texture_enable?GPU_RGBA4:GPU_RGB565);
u32 bufferoffset = 0x00000000;
u64 bufferpermutations = 0x210;
u8 numattributes = 2;
GPU_SetAttributeBuffers(3, (u32*)osConvertVirtToPhys((u32)vbo_buffer),
GPU_ATTRIBFMT(0, 3, GPU_FLOAT) | GPU_ATTRIBFMT(1, 2, GPU_FLOAT),
0xFFC, 0x210, 1, &bufferoffset, &bufferpermutations, &numattributes);
GPU_DrawArray(GPU_TRIANGLES, sizeof(modelVboData) / sizeof(vertex_s));
GPU_FinishDrawing();
}
void gpu_init_calls(void)
{
GPU_Init(NULL);
gpuCmdSize = 0x40000;
gpuCmd = (u32*)linearAlloc(gpuCmdSize * 4);
gpuCmdRight = (u32*)linearAlloc(gpuCmdSize * 4);
GPU_Reset(NULL, gpuCmd, gpuCmdSize);
dvlb = DVLB_ParseFile((u32*)ctr_blit_shader_shbin, ctr_blit_shader_shbin_size);
shaderProgramInit(&shader);
shaderProgramSetVsh(&shader, &dvlb->DVLE[0]);
shaderProgramUse(&shader);
// Flush the command buffer so that the shader upload gets executed
GPUCMD_Finalize();
GPUCMD_FlushAndRun(NULL);
gspWaitForP3D();
//create texture
texData = (u32*)linearMemAlign(gpu_texture_bin_size,
0x80); //textures need to be 0x80-byte aligned
texData2 = (u32*)linearMemAlign(texture_bin_size,
0x80); //textures need to be 0x80-byte aligned
memcpy(texData2, texture_bin, texture_bin_size);
vbo_buffer = linearAlloc(sizeof(modelVboData));
memcpy(vbo_buffer, (void*)modelVboData, sizeof(modelVboData));
}
#define PRINTFPOS(X,Y) "\x1b["#X";"#Y"H"
#define PRINTFPOS_STR(X,Y) "\x1b["X";"Y"H"
static void ctr_set_frame_coords(ctr_vertex_t* v, int x, int y, int w, int h)
{
v[0].x = x;
v[0].y = y;
v[0].z = -1;
v[0].u = 0;
v[0].v = 0;
v[1].x = x + w;
v[1].y = y;
v[1].z = -1;
v[1].u = w;
v[1].v = 0;
v[2].x = x + w;
v[2].y = y + h;
v[2].z = -1;
v[2].u = w;
v[2].v = h;
v[3].x = x;
v[3].y = y;
v[3].z = -1;
v[3].u = 0;
v[3].v = 0;
v[4].x = x + w;
v[4].y = y + h;
v[4].z = -1;
v[4].u = w;
v[4].v = h;
v[5].x = x;
v[5].y = y + h;
v[5].z = -1;
v[5].u = 0;
v[5].v = h;
}
static void* ctr_init(const video_info_t* video,
const input_driver_t** input, void** input_data)
{
void* ctrinput = NULL;
global_t* global = global_get_ptr();
ctr_video_t* ctr = (ctr_video_t*)calloc(1, sizeof(ctr_video_t));
ctr_video_t* ctr = (ctr_video_t*)linearAlloc(sizeof(ctr_video_t));
if (!ctr)
return NULL;
printf("%s@%s:%d.\n",__FUNCTION__, __FILE__, __LINE__);fflush(stdout);
// gfxInitDefault();
// gfxSet3D(false);
texture_bin = (typeof(texture_bin))malloc(texture_bin_size);
int i, j;
for (j = 0; j < tex_h; j++)
{
for (i = 0; i < tex_w; i++)
{
if ((i & 0x8) || (j & 0x8))
texture_bin[i + j * tex_w] = 0x0000FFFF;
else
texture_bin[i + j * tex_w] = 0xFFFFFFFF;
if (i > 64)
texture_bin[i + j * tex_w] = 0xFF0000FF;
memset(ctr, 0, sizeof(ctr_video_t));
}
ctr->display_list_size = 0x40000;
ctr->display_list = linearAlloc(ctr->display_list_size * sizeof(uint32_t));
GPU_Reset(NULL, ctr->display_list, ctr->display_list_size);
}
ctr->texture_width = 512;
ctr->texture_height = 512;
ctr->texture_linear =
linearMemAlign(ctr->texture_width * ctr->texture_height * sizeof(uint32_t), 128);
ctr->texture_swizzled =
linearMemAlign(ctr->texture_width * ctr->texture_height * sizeof(uint32_t), 128);
ctr->frame_coords = linearAlloc(6 * sizeof(ctr_vertex_t));
ctr_set_frame_coords(ctr->frame_coords, 0, 0, CTR_TOP_FRAMEBUFFER_WIDTH, CTR_TOP_FRAMEBUFFER_HEIGHT);
ctr->menu.texture_width = 512;
ctr->menu.texture_height = 512;
ctr->menu.texture_linear =
linearMemAlign(ctr->texture_width * ctr->texture_height * sizeof(uint16_t), 128);
ctr->menu.texture_swizzled =
linearMemAlign(ctr->texture_width * ctr->texture_height * sizeof(uint16_t), 128);
ctr->menu.frame_coords = linearAlloc(6 * sizeof(ctr_vertex_t));
ctr_set_frame_coords(ctr->menu.frame_coords, 40, 0, CTR_TOP_FRAMEBUFFER_WIDTH, CTR_TOP_FRAMEBUFFER_HEIGHT);
ctr->vertex_scale[0] = 1.0;
ctr->vertex_scale[1] = 1.0;
ctr->vertex_scale[2] = -2.0 / CTR_TOP_FRAMEBUFFER_WIDTH;
ctr->vertex_scale[3] = -2.0 / CTR_TOP_FRAMEBUFFER_HEIGHT;
ctr->texture_scale[0] = 1.0;
ctr->texture_scale[1] = 1.0;
ctr->texture_scale[2] = -1.0 / ctr->texture_height;
ctr->texture_scale[3] = 1.0 / ctr->texture_width;
ctr->menu.texture_scale[0] = 1.0;
ctr->menu.texture_scale[1] = 1.0;
ctr->menu.texture_scale[2] = -1.0 / ctr->texture_height;
ctr->menu.texture_scale[3] = 1.0 / ctr->texture_width;
ctr->dvlb = DVLB_ParseFile((u32*)ctr_blit_shader_shbin, ctr_blit_shader_shbin_size);
shaderProgramInit(&ctr->shader);
shaderProgramSetVsh(&ctr->shader, &ctr->dvlb->DVLE[0]);
shaderProgramUse(&ctr->shader);
GPUCMD_Finalize();
GPUCMD_FlushAndRun(NULL);
gspWaitForEvent(GSPEVENT_P3D, false);
gpu_init_calls();
if (input && input_data)
{
@ -246,7 +192,6 @@ static void* ctr_init(const video_info_t* video,
*input_data = ctrinput;
}
printf("%s@%s:%d.\n",__FUNCTION__, __FILE__, __LINE__);fflush(stdout);
return ctr;
}
@ -256,9 +201,8 @@ static bool ctr_frame(void* data, const void* frame,
ctr_video_t* ctr = (ctr_video_t*)data;
settings_t* settings = config_get_ptr();
// int i;
static uint64_t currentTick,lastTick;
static float fps=0.0;
static float fps = 0.0;
static int total_frames = 0;
static int frames = 0;
@ -291,72 +235,157 @@ static bool ctr_frame(void* data, const void* frame,
frames = 0;
}
printf("fps: %8.4f frames: %i current tick: %llu\r", fps, total_frames++, currentTick);
printf("fps: %8.4f frames: %i\r", fps, total_frames++);
fflush(stdout);
// gfxFlushBuffers();
// gspWaitForEvent(GSPEVENT_VBlank0, true);
u32 backgroundColor = 0x00000000;
GPUCMD_SetBufferOffset(0);
GPU_SetFloatUniform(GPU_VERTEX_SHADER,
shaderInstanceGetUniformLocation(shader.vertexShader, "projection"),
(u32*)proj_m, 4);
ctrGuSetVertexShaderFloatUniform(0, ctr->vertex_scale, 1);
if(!ctr->menu_texture_enable && frame)
GPU_SetViewport(VIRT_TO_PHYS(CTR_GPU_DEPTHBUFFER),
VIRT_TO_PHYS(CTR_GPU_FRAMEBUFFER),
0, 0, CTR_TOP_FRAMEBUFFER_HEIGHT, CTR_TOP_FRAMEBUFFER_WIDTH);
// GPU_SetViewport(NULL,
// VIRT_TO_PHYS(CTR_GPU_FRAMEBUFFER),
// 0, 0, CTR_TOP_FRAMEBUFFER_HEIGHT, CTR_TOP_FRAMEBUFFER_WIDTH);
GPU_DepthMap(-1.0f, 0.0f);
GPU_SetFaceCulling(GPU_CULL_NONE);
GPU_SetStencilTest(false, GPU_ALWAYS, 0x00, 0xFF, 0x00);
GPU_SetStencilOp(GPU_KEEP, GPU_KEEP, GPU_KEEP);
GPU_SetBlendingColor(0, 0, 0, 0);
// GPU_SetDepthTestAndWriteMask(true, GPU_GREATER, GPU_WRITE_ALL);
GPU_SetDepthTestAndWriteMask(false, GPU_ALWAYS, GPU_WRITE_ALL);
// GPU_SetDepthTestAndWriteMask(true, GPU_ALWAYS, GPU_WRITE_ALL);
GPUCMD_AddMaskedWrite(GPUREG_0062, 0x1, 0);
GPUCMD_AddWrite(GPUREG_0118, 0);
GPU_SetAlphaBlending(GPU_BLEND_ADD, GPU_BLEND_ADD,
GPU_SRC_ALPHA, GPU_ONE_MINUS_SRC_ALPHA,
GPU_SRC_ALPHA, GPU_ONE_MINUS_SRC_ALPHA);
GPU_SetAlphaTest(false, GPU_ALWAYS, 0x00);
GPU_SetTextureEnable(GPU_TEXUNIT0);
GPU_SetTexEnv(0,
GPU_TEVSOURCES(GPU_TEXTURE0, GPU_PRIMARY_COLOR, 0),
GPU_TEVSOURCES(GPU_TEXTURE0, GPU_PRIMARY_COLOR, 0),
GPU_TEVOPERANDS(0, 0, 0),
GPU_TEVOPERANDS(0, 0, 0),
GPU_MODULATE, GPU_MODULATE,
0xFFFFFFFF);
GPU_SetTexEnv(1, GPU_PREVIOUS,GPU_PREVIOUS, 0, 0, 0, 0, 0);
GPU_SetTexEnv(2, GPU_PREVIOUS,GPU_PREVIOUS, 0, 0, 0, 0, 0);
GPU_SetTexEnv(3, GPU_PREVIOUS,GPU_PREVIOUS, 0, 0, 0, 0, 0);
GPU_SetTexEnv(4, GPU_PREVIOUS,GPU_PREVIOUS, 0, 0, 0, 0, 0);
GPU_SetTexEnv(5, GPU_PREVIOUS,GPU_PREVIOUS, 0, 0, 0, 0, 0);
if(frame)
{
int i;
uint8_t* dst = (uint8_t*)texData2;
uint16_t* dst = (uint16_t*)ctr->texture_linear;
const uint8_t* src = frame;
if (width > tex_w)
width = tex_w;
if (height > tex_h)
height = tex_h;
if (width > ctr->texture_width)
width = ctr->texture_width;
if (height > ctr->texture_height)
height = ctr->texture_height;
for (i = 0; i < height; i++)
{
memcpy(dst, src, width*2);
dst += tex_w*2;
memcpy(dst, src, width * sizeof(uint16_t));
dst += ctr->texture_width;
src += pitch;
}
GSPGPU_FlushDataCache(NULL, ctr->texture_linear,
ctr->texture_width * ctr->texture_height * sizeof(uint16_t));
ctrGuCopyImage(ctr->texture_linear, ctr->texture_width, ctr->menu.texture_height, CTRGU_RGB565, false,
ctr->texture_swizzled, ctr->texture_width, CTRGU_RGB565, true);
gspWaitForEvent(GSPEVENT_PPF, false);
ctrGuSetTexture(GPU_TEXUNIT0, VIRT_TO_PHYS(ctr->texture_swizzled), ctr->texture_width, ctr->texture_height,
GPU_TEXTURE_MAG_FILTER(GPU_LINEAR) | GPU_TEXTURE_MIN_FILTER(GPU_LINEAR) |
GPU_TEXTURE_WRAP_S(GPU_CLAMP_TO_EDGE) | GPU_TEXTURE_WRAP_T(GPU_CLAMP_TO_EDGE),
GPU_RGB565);
GSPGPU_FlushDataCache(NULL, (u8*)ctr->frame_coords,
6 * sizeof(ctr_vertex_t));
ctrGuSetAttributeBuffers(2,
VIRT_TO_PHYS(ctr->frame_coords),
CTRGU_ATTRIBFMT(GPU_SHORT, 3) << 0 |
CTRGU_ATTRIBFMT(GPU_SHORT, 2) << 4,
sizeof(ctr_vertex_t));
ctrGuSetVertexShaderFloatUniform(1, ctr->texture_scale, 1);
GPU_DrawArray(GPU_TRIANGLES, 6);
}
GSPGPU_FlushDataCache(NULL, (u8*)texData2, texture_bin_size);
GX_SetDisplayTransfer(NULL, (u32*)texData2, tex_size, (u32*)texData, gpu_tex_size,
0x3302); // rgb32=0x0 rgb32=0x0 ??=0x0 linear2swizzeled=0x2
gspWaitForPPF();
if (ctr->menu_texture_enable)
{
GSPGPU_FlushDataCache(NULL, ctr->menu.texture_linear,
ctr->menu.texture_width * ctr->menu.texture_height * sizeof(uint16_t));
ctrGuCopyImage(ctr->menu.texture_linear, ctr->menu.texture_width, ctr->menu.texture_height, CTRGU_RGBA4444,false,
ctr->menu.texture_swizzled, ctr->menu.texture_width, CTRGU_RGBA4444, true);
gspWaitForEvent(GSPEVENT_PPF, false);
ctrGuSetTexture(GPU_TEXUNIT0, VIRT_TO_PHYS(ctr->menu.texture_swizzled), ctr->menu.texture_width, ctr->menu.texture_height,
GPU_TEXTURE_MAG_FILTER(GPU_LINEAR) | GPU_TEXTURE_MIN_FILTER(GPU_LINEAR) |
GPU_TEXTURE_WRAP_S(GPU_CLAMP_TO_EDGE) | GPU_TEXTURE_WRAP_T(GPU_CLAMP_TO_EDGE),
GPU_RGBA4);
GSPGPU_FlushDataCache(NULL, (u8*)ctr->menu.frame_coords,
6 * sizeof(ctr_vertex_t));
ctrGuSetAttributeBuffers(2,
VIRT_TO_PHYS(ctr->menu.frame_coords),
CTRGU_ATTRIBFMT(GPU_SHORT, 3) << 0 |
CTRGU_ATTRIBFMT(GPU_SHORT, 2) << 4,
sizeof(ctr_vertex_t));
ctrGuSetVertexShaderFloatUniform(1, ctr->menu.texture_scale, 1);
GPU_DrawArray(GPU_TRIANGLES, 6);
}
GPU_FinishDrawing();
renderFrame(ctr);
GPUCMD_Finalize();
// for (i = 0; i < 16; i++)
// printf(PRINTFPOS_STR("%i", "%i")"%f", i >> 2, 10 * (i & 0x3), proj_m[i]);
// printf(PRINTFPOS(20, 10)"frames: %i", frames++);
//draw the frame
GPUCMD_FlushAndRun(NULL);
gspWaitForP3D();
gspWaitForEvent(GSPEVENT_P3D, false);
//clear the screen
GX_SetDisplayTransfer(NULL, (u32*)gpuOut, 0x019001E0,
(u32*)gfxGetFramebuffer(GFX_TOP, GFX_LEFT, NULL, NULL), 0x019001E0, 0x01001000);
gspWaitForPPF();
ctrGuDisplayTransfer(CTR_GPU_FRAMEBUFFER, 240,400, CTRGU_RGBA8,
gfxGetFramebuffer(GFX_TOP, GFX_LEFT, NULL, NULL), 240,400,CTRGU_RGB8, CTRGU_MULTISAMPLE_NONE);
//clear the screen
GX_SetMemoryFill(NULL, (u32*)gpuOut, backgroundColor, (u32*)&gpuOut[0x2EE00],
0x201, (u32*)gpuDOut, 0x00000000, (u32*)&gpuDOut[0x2EE00], 0x201);
gspWaitForPSC0();
gspWaitForEvent(GSPEVENT_PPF, false);
GX_SetMemoryFill(NULL, (u32*)CTR_GPU_FRAMEBUFFER, 0x00000000,
(u32*)(CTR_GPU_FRAMEBUFFER + CTR_TOP_FRAMEBUFFER_WIDTH * CTR_TOP_FRAMEBUFFER_HEIGHT * sizeof(uint32_t)),
0x201, (u32*)CTR_GPU_DEPTHBUFFER, 0x00000000,
(u32*)(CTR_GPU_DEPTHBUFFER + CTR_TOP_FRAMEBUFFER_WIDTH * CTR_TOP_FRAMEBUFFER_HEIGHT * sizeof(uint32_t)),
0x201);
gspWaitForEvent(GSPEVENT_PSC0, false);
gfxSwapBuffersGpu();
// gspWaitForEvent(GSPEVENT_VBlank0, true);
// gfxFlushBuffers();
// gfxSwapBuffers();
// if (ctr->vsync)
// gspWaitForEvent(GSPEVENT_VBlank0, true);
return true;
}
@ -401,37 +430,43 @@ static void ctr_free(void* data)
if (!ctr)
return;
printf("%s@%s:%d.\n",__FUNCTION__, __FILE__, __LINE__);fflush(stdout);
shaderProgramFree(&shader);
DVLB_Free(dvlb);
linearFree(gpuCmd);
linearFree(gpuCmdRight);
linearFree(texData);
linearFree(texData2);
linearFree(vbo_buffer);
free(texture_bin);
// gfxExit();
free(ctr);
shaderProgramFree(&ctr->shader);
DVLB_Free(ctr->dvlb);
linearFree(ctr->display_list);
linearFree(ctr->texture_linear);
linearFree(ctr->texture_swizzled);
linearFree(ctr->frame_coords);
linearFree(ctr->menu.texture_linear);
linearFree(ctr->menu.texture_swizzled);
linearFree(ctr->menu.frame_coords);
linearFree(ctr);
// gfxExit();
}
static void ctr_set_texture_frame(void* data, const void* frame, bool rgb32,
unsigned width, unsigned height, float alpha)
{
ctr_video_t* ctr = (ctr_video_t*)data;
int i;
uint8_t* dst = (uint8_t*)texData2;
const uint8_t* src = frame;
ctr_video_t* ctr = (ctr_video_t*)data;
uint16_t* dst = (uint16_t*)ctr->menu.texture_linear;
const uint16_t* src = frame;
int line_width = width;
(void)rgb32;
(void)alpha;
if (line_width > ctr->menu.texture_width)
line_width = ctr->menu.texture_width;
if (height > (unsigned)ctr->menu.texture_height)
height = (unsigned)ctr->menu.texture_height;
for (i = 0; i < height; i++)
{
memcpy(dst, src, width*2);
dst += tex_w*2;
src += width*2;
memcpy(dst, src, line_width * sizeof(uint16_t));
dst += ctr->menu.texture_width;
src += width;
}
}
static void ctr_set_texture_enable(void* data, bool state, bool full_screen)

164
gfx/drivers/ctr_gu.h Normal file
View File

@ -0,0 +1,164 @@
#ifndef CTR_GU_H
#define CTR_GU_H
#include <3ds.h>
#include <stdint.h>
#define VIRT_TO_PHYS(vaddr) \
(((u32)(vaddr)) >= 0x14000000 && ((u32)(vaddr)) < 0x1c000000)?(void*)((u32)(vaddr) + 0x0c000000):\
(((u32)(vaddr)) >= 0x1F000000 && ((u32)(vaddr)) < 0x1F600000)?(void*)((u32)(vaddr) - 0x07000000):\
(((u32)(vaddr)) >= 0x1FF00000 && ((u32)(vaddr)) < 0x1FF80000)?(void*)(vaddr):\
(((u32)(vaddr)) >= 0x30000000 && ((u32)(vaddr)) < 0x40000000)?(void*)((u32)(vaddr) - 0x10000000):(void*)0
#define CTRGU_SIZE(W,H) (((u32)(W)&0xFFFF)|((u32)(H)<<16))
/* DMA flags */
#define CTRGU_DMA_VFLIP (1 << 0)
#define CTRGU_DMA_L_TO_T (1 << 1)
#define CTRGU_DMA_T_TO_L (0 << 1)
#define CTRGU_DMA_TRUNCATE (1 << 2)
#define CTRGU_DMA_CONVERT_NONE (1 << 3)
#define CTRGU_RGBA8 (0)
#define CTRGU_RGB8 (1)
#define CTRGU_RGB565 (2)
#define CTRGU_RGBA5551 (3)
#define CTRGU_RGBA4444 (4)
#define CTRGU_MULTISAMPLE_NONE (0 << 24)
#define CTRGU_MULTISAMPLE_2x1 (1 << 24)
#define CTRGU_MULTISAMPLE_2x2 (2 << 24)
typedef struct
{
uint32_t buffer[8];
}gtrgu_gx_command_t;
__attribute__((always_inline))
static inline int ctrGuWriteDisplayTransferCommand(gtrgu_gx_command_t* command,
void* src, int src_w, int src_h,
void* dst, int dst_w, int dst_h,
uint32_t flags)
{
command->buffer[0] = 0x03; //CommandID
command->buffer[1] = (uint32_t)src;
command->buffer[2] = (uint32_t)dst;
command->buffer[3] = CTRGU_SIZE(src_w, src_h);
command->buffer[4] = CTRGU_SIZE(dst_w, dst_h);
command->buffer[5] = flags;
command->buffer[6] = 0x0;
command->buffer[7] = 0x0;
return 0;
}
__attribute__((always_inline))
static inline int ctrGuSubmitGxCommand(u32* gxbuf, gtrgu_gx_command_t* command)
{
if(!gxbuf) gxbuf = gxCmdBuf;
return GSPGPU_SubmitGxCommand(gxbuf, (u32*)command, NULL);
}
__attribute__((always_inline))
static inline void ctrGuSetTexture(GPU_TEXUNIT unit, u32* data, u16 width, u16 height, u32 param, GPU_TEXCOLOR colorType)
{
switch (unit)
{
case GPU_TEXUNIT0:
GPUCMD_AddWrite(GPUREG_TEXUNIT0_TYPE, colorType);
GPUCMD_AddWrite(GPUREG_TEXUNIT0_LOC, ((u32)data)>>3);
GPUCMD_AddWrite(GPUREG_TEXUNIT0_DIM, (height)|(width<<16));
GPUCMD_AddWrite(GPUREG_TEXUNIT0_PARAM, param);
break;
case GPU_TEXUNIT1:
GPUCMD_AddWrite(GPUREG_TEXUNIT1_TYPE, colorType);
GPUCMD_AddWrite(GPUREG_TEXUNIT1_LOC, ((u32)data)>>3);
GPUCMD_AddWrite(GPUREG_TEXUNIT1_DIM, (height)|(width<<16));
GPUCMD_AddWrite(GPUREG_TEXUNIT1_PARAM, param);
break;
case GPU_TEXUNIT2:
GPUCMD_AddWrite(GPUREG_TEXUNIT2_TYPE, colorType);
GPUCMD_AddWrite(GPUREG_TEXUNIT2_LOC, ((u32)data)>>3);
GPUCMD_AddWrite(GPUREG_TEXUNIT2_DIM, (height)|(width<<16));
GPUCMD_AddWrite(GPUREG_TEXUNIT2_PARAM, param);
break;
}
}
__attribute__((always_inline))
static inline Result ctrGuCopyImage
(void* src, int src_w, int src_h, int src_fmt, bool src_is_tiled,
void* dst, int dst_w, int dst_fmt, bool dst_is_tiled)
{
u32 gxCommand[0x8];
gxCommand[0]=0x03; //CommandID
gxCommand[1]=(u32)src;
gxCommand[2]=(u32)dst;
gxCommand[3]=dst_w&0xFF8;
gxCommand[4]=CTRGU_SIZE(src_w, src_h);
gxCommand[5]=(src_fmt << 8)|(dst_fmt << 12)
| ((src_is_tiled == dst_is_tiled)? CTRGU_DMA_CONVERT_NONE
: src_is_tiled? CTRGU_DMA_T_TO_L
: CTRGU_DMA_L_TO_T)
| ((dst_w > src_w) ? CTRGU_DMA_TRUNCATE : 0);
gxCommand[6]=gxCommand[7]=0x0;
return GSPGPU_SubmitGxCommand(gxCmdBuf, gxCommand, NULL);
}
__attribute__((always_inline))
static inline Result ctrGuDisplayTransfer
(void* src, int src_w, int src_h, int src_fmt,
void* dst, int dst_w, int dst_h, int dst_fmt, int multisample_lvl)
{
u32 gxCommand[0x8];
gxCommand[0]=0x03; //CommandID
gxCommand[1]=(u32)src;
gxCommand[2]=(u32)dst;
gxCommand[3]=CTRGU_SIZE(dst_w, dst_h);
gxCommand[4]=CTRGU_SIZE(src_w, src_h);
gxCommand[5]=(src_fmt << 8) | (dst_fmt << 12) | multisample_lvl;
gxCommand[6]=gxCommand[7]=0x0;
return GSPGPU_SubmitGxCommand(gxCmdBuf, gxCommand, NULL);
}
__attribute__((always_inline))
static inline void ctrGuSetVertexShaderFloatUniform(int id, float* data, int count)
{
GPUCMD_AddWrite(GPUREG_VSH_FLOATUNIFORM_CONFIG, 0x80000000|(u32)id);
GPUCMD_AddWrites(GPUREG_VSH_FLOATUNIFORM_DATA, (u32*)data, (u32)count * 4);
}
#define CTRGU_ATTRIBFMT(f, n) ((((n)-1)<<2)|((f)&3))
void ctrGuSetAttributeBuffers(u32 total_attributes, void* base_address, u64 attribute_formats, u32 buffer_size)
{
u32 param[0x28];
memset(param, 0x00, sizeof(param));
param[0x0]=((u32)base_address)>>3;
param[0x1]=attribute_formats & 0xFFFFFFFF;
param[0x2]=((total_attributes-1)<<28)|0xFFF0000|((attribute_formats>>32)&0xFFFF);
param[0x4]=0x76543210;
param[0x5]=(total_attributes<<28)|((buffer_size&0xFFF)<<16)|0xBA98;
GPUCMD_AddIncrementalWrites(GPUREG_ATTRIBBUFFERS_LOC, param, 0x00000027);
GPUCMD_AddMaskedWrite(GPUREG_VSH_INPUTBUFFER_CONFIG, 0xB, 0xA0000000|(total_attributes-1));
GPUCMD_AddWrite(GPUREG_0242, (total_attributes-1));
GPUCMD_AddIncrementalWrites(GPUREG_VSH_ATTRIBUTES_PERMUTATION_LOW, ((u32[]){0x76543210, 0xBA98}), 2);
}
#endif // CTR_GU_H

View File

@ -338,7 +338,7 @@ INPUT
#include "../input/drivers/dinput.c"
#endif
#ifdef HAVE_WINXINPUT
#ifdef HAVE_XINPUT
#include "../input/drivers_joypad/xinput_joypad.c"
#endif

View File

@ -45,10 +45,10 @@ DECL_AXIS(r_y_minus, +3)
const char* const input_builtin_autoconfs[] =
{
DECL_AUTOCONF_DEVICE("XInput Controller (User 1)", "winxinput", XINPUT_DEFAULT_BINDS),
DECL_AUTOCONF_DEVICE("XInput Controller (User 2)", "winxinput", XINPUT_DEFAULT_BINDS),
DECL_AUTOCONF_DEVICE("XInput Controller (User 3)", "winxinput", XINPUT_DEFAULT_BINDS),
DECL_AUTOCONF_DEVICE("XInput Controller (User 4)", "winxinput", XINPUT_DEFAULT_BINDS),
DECL_AUTOCONF_DEVICE("XInput Controller (User 1)", "xinput", XINPUT_DEFAULT_BINDS),
DECL_AUTOCONF_DEVICE("XInput Controller (User 2)", "xinput", XINPUT_DEFAULT_BINDS),
DECL_AUTOCONF_DEVICE("XInput Controller (User 3)", "xinput", XINPUT_DEFAULT_BINDS),
DECL_AUTOCONF_DEVICE("XInput Controller (User 4)", "xinput", XINPUT_DEFAULT_BINDS),
NULL
};

View File

@ -17,7 +17,7 @@
#include "../../general.h"
#include "../../driver.h"
#include "retroarch.h"
static uint32_t kDown;
static int16_t pad_state;
@ -53,13 +53,16 @@ static void ctr_input_poll(void *data)
*lifecycle_state &= ~((1ULL << RARCH_MENU_TOGGLE));
if (
(pad_state & (1ULL << RETRO_DEVICE_ID_JOYPAD_L))
&& (pad_state & (1ULL << RETRO_DEVICE_ID_JOYPAD_R))
&& (pad_state & (1ULL << RETRO_DEVICE_ID_JOYPAD_SELECT))
&& (pad_state & (1ULL << RETRO_DEVICE_ID_JOYPAD_START))
)
*lifecycle_state |= (1ULL << RARCH_MENU_TOGGLE);
if(kDown & KEY_TOUCH)
*lifecycle_state |= (1ULL << RARCH_MENU_TOGGLE);
/* panic button */
if((kDown & KEY_START) &&
(kDown & KEY_SELECT) &&
(kDown & KEY_L) &&
(kDown & KEY_R))
rarch_main_command(RARCH_CMD_QUIT);
}
static int16_t ctr_input_state(void *data,

View File

@ -838,7 +838,7 @@ static BOOL CALLBACK enum_joypad_cb(const DIDEVICEINSTANCE *inst, void *p)
g_pads[g_joypad_cnt].joy_name = strdup(inst->tszProductName);
#ifdef HAVE_WINXINPUT
#ifdef HAVE_XINPUT
#if 0
is_xinput_pad = g_xinput_block_pads
&& name_is_xinput_pad(inst->tszProductName);
@ -861,7 +861,7 @@ static BOOL CALLBACK enum_joypad_cb(const DIDEVICEINSTANCE *inst, void *p)
IDirectInputDevice8_EnumObjects(*pad, enum_axes_cb,
*pad, DIDFT_ABSAXIS);
#ifdef HAVE_WINXINPUT
#ifdef HAVE_XINPUT
if (!is_xinput_pad)
#endif
{

View File

@ -26,7 +26,7 @@ static rarch_joypad_driver_t *joypad_drivers[] = {
#ifdef __CELLOS_LV2__
&ps3_joypad,
#endif
#ifdef HAVE_WINXINPUT
#ifdef HAVE_XINPUT
&xinput_joypad,
#endif
#ifdef GEKKO

View File

@ -100,7 +100,7 @@
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;RARCH_INTERNAL;HAVE_D3D;HAVE_D3D9;HAVE_CG;HAVE_GLSL;HAVE_GRIFFIN;HAVE_FBO;HAVE_ZLIB;HAVE_XMB;WANT_ZLIB;HAVE_GRIFFIN;HAVE_FBO;HAVE_ZLIB;HAVE_XMB;WANT_ZLIB;_DEBUG;_WINDOWS;%(PreprocessorDefinitions);HAVE_BUILTIN_AUTOCONFIG;HAVE_DINPUT;HAVE_WINXINPUT;HAVE_XAUDIO;HAVE_DSOUND;HAVE_OPENGL;HAVE_DYLIB;HAVE_NETPLAY;HAVE_NETWORKING;HAVE_NETWORK_CMD;HAVE_COMMAND;HAVE_STDIN_CMD;HAVE_THREADS;HAVE_DYNAMIC;_CRT_NONSTDC_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;__SSE__;__i686__;HAVE_OVERLAY;HAVE_RGUI;HAVE_GL_SYNC;HAVE_MENU;HAVE_7ZIP;HAVE_GLUI;HAVE_LIBRETRODB</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;RARCH_INTERNAL;HAVE_D3D;HAVE_D3D9;HAVE_CG;HAVE_GLSL;HAVE_GRIFFIN;HAVE_FBO;HAVE_ZLIB;HAVE_XMB;WANT_ZLIB;HAVE_GRIFFIN;HAVE_FBO;HAVE_ZLIB;HAVE_XMB;WANT_ZLIB;_DEBUG;_WINDOWS;%(PreprocessorDefinitions);HAVE_BUILTIN_AUTOCONFIG;HAVE_DINPUT;HAVE_XINPUT;HAVE_XAUDIO;HAVE_DSOUND;HAVE_OPENGL;HAVE_DYLIB;HAVE_NETPLAY;HAVE_NETWORKING;HAVE_NETWORK_CMD;HAVE_COMMAND;HAVE_STDIN_CMD;HAVE_THREADS;HAVE_DYNAMIC;_CRT_NONSTDC_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;__SSE__;__i686__;HAVE_OVERLAY;HAVE_RGUI;HAVE_GL_SYNC;HAVE_MENU;HAVE_7ZIP;HAVE_GLUI;HAVE_LIBRETRODB</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(MSBuildProjectDirectory);$(MSBuildProjectDirectory)\..\..\;$(CG_INC_PATH);$(MSBuildProjectDirectory)\..\..\deps\zlib;$(MSBuildProjectDirectory)\..\..\libretro-common\include;$(MSBuildProjectDirectory)\..\..\gfx\inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<CompileAs>CompileAsCpp</CompileAs>
@ -120,7 +120,7 @@
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;RARCH_INTERNAL;HAVE_D3D;HAVE_D3D9;HAVE_CG;HAVE_GLSL;HAVE_GRIFFIN;HAVE_FBO;HAVE_ZLIB;HAVE_XMB;WANT_ZLIB;HAVE_FBO;HAVE_ZLIB;WANT_ZLIB;_DEBUG;_WINDOWS;%(PreprocessorDefinitions);HAVE_BUILTIN_AUTOCONFIG;HAVE_DINPUT;HAVE_WINXINPUT;HAVE_XAUDIO;HAVE_DSOUND;HAVE_OPENGL;HAVE_DYLIB;HAVE_NETPLAY;HAVE_NETWORKING;HAVE_NETWORK_CMD;HAVE_COMMAND;HAVE_STDIN_CMD;HAVE_THREADS;HAVE_DYNAMIC;_CRT_SECURE_NO_WARNINGS;__SSE__;__SSE2__;__x86_64__;HAVE_OVERLAY;HAVE_RGUI;HAVE_GL_SYNC;HAVE_MENU;HAVE_7ZIP;HAVE_GLUI;HAVE_LIBRETRODB</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;RARCH_INTERNAL;HAVE_D3D;HAVE_D3D9;HAVE_CG;HAVE_GLSL;HAVE_GRIFFIN;HAVE_FBO;HAVE_ZLIB;HAVE_XMB;WANT_ZLIB;HAVE_FBO;HAVE_ZLIB;WANT_ZLIB;_DEBUG;_WINDOWS;%(PreprocessorDefinitions);HAVE_BUILTIN_AUTOCONFIG;HAVE_DINPUT;HAVE_XINPUT;HAVE_XAUDIO;HAVE_DSOUND;HAVE_OPENGL;HAVE_DYLIB;HAVE_NETPLAY;HAVE_NETWORKING;HAVE_NETWORK_CMD;HAVE_COMMAND;HAVE_STDIN_CMD;HAVE_THREADS;HAVE_DYNAMIC;_CRT_SECURE_NO_WARNINGS;__SSE__;__SSE2__;__x86_64__;HAVE_OVERLAY;HAVE_RGUI;HAVE_GL_SYNC;HAVE_MENU;HAVE_7ZIP;HAVE_GLUI;HAVE_LIBRETRODB</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(MSBuildProjectDirectory);$(MSBuildProjectDirectory)\..\..\;$(CG_INC_PATH);$(MSBuildProjectDirectory)\..\..\deps\zlib;$(MSBuildProjectDirectory)\..\..\libretro-common\include;$(MSBuildProjectDirectory)\..\..\gfx\inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<CompileAs>CompileAsCpp</CompileAs>
@ -142,7 +142,7 @@
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;RARCH_INTERNAL;HAVE_D3D;HAVE_D3D9;HAVE_CG;HAVE_GLSL;HAVE_GRIFFIN;HAVE_FBO;HAVE_ZLIB;HAVE_XMB;WANT_ZLIB;HAVE_GRIFFIN;HAVE_FBO;HAVE_ZLIB;HAVE_XMB;WANT_ZLIB;NDEBUG;_WINDOWS;%(PreprocessorDefinitions);HAVE_BUILTIN_AUTOCONFIG;HAVE_DINPUT;HAVE_WINXINPUT;HAVE_XAUDIO;HAVE_DSOUND;HAVE_OPENGL;HAVE_DYLIB;HAVE_NETPLAY;HAVE_NETWORKING;HAVE_NETWORK_CMD;HAVE_COMMAND;HAVE_STDIN_CMD;HAVE_THREADS;HAVE_DYNAMIC;_CRT_NONSTDC_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;__SSE__;__i686__;HAVE_OVERLAY;HAVE_MENU;HAVE_RGUI;HAVE_GL_SYNC;HAVE_7ZIP;HAVE_GLUI;HAVE_LIBRETRODB</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;RARCH_INTERNAL;HAVE_D3D;HAVE_D3D9;HAVE_CG;HAVE_GLSL;HAVE_GRIFFIN;HAVE_FBO;HAVE_ZLIB;HAVE_XMB;WANT_ZLIB;HAVE_GRIFFIN;HAVE_FBO;HAVE_ZLIB;HAVE_XMB;WANT_ZLIB;NDEBUG;_WINDOWS;%(PreprocessorDefinitions);HAVE_BUILTIN_AUTOCONFIG;HAVE_DINPUT;HAVE_XINPUT;HAVE_XAUDIO;HAVE_DSOUND;HAVE_OPENGL;HAVE_DYLIB;HAVE_NETPLAY;HAVE_NETWORKING;HAVE_NETWORK_CMD;HAVE_COMMAND;HAVE_STDIN_CMD;HAVE_THREADS;HAVE_DYNAMIC;_CRT_NONSTDC_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;__SSE__;__i686__;HAVE_OVERLAY;HAVE_MENU;HAVE_RGUI;HAVE_GL_SYNC;HAVE_7ZIP;HAVE_GLUI;HAVE_LIBRETRODB</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(MSBuildProjectDirectory);$(MSBuildProjectDirectory)\..\..\;$(CG_INC_PATH);$(MSBuildProjectDirectory)\..\..\deps\zlib;$(MSBuildProjectDirectory)\..\..\libretro-common\include;$(MSBuildProjectDirectory)\..\..\gfx\inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<CompileAs>CompileAsCpp</CompileAs>
@ -167,7 +167,7 @@
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;RARCH_INTERNAL;HAVE_D3D;HAVE_D3D9;HAVE_CG;HAVE_GLSL;HAVE_GRIFFIN;HAVE_FBO;HAVE_ZLIB;HAVE_XMB;WANT_ZLIB;HAVE_FBO;NDEBUG;_WINDOWS;%(PreprocessorDefinitions);HAVE_BUILTIN_AUTOCONFIG;HAVE_DINPUT;HAVE_WINXINPUT;HAVE_XAUDIO;HAVE_DSOUND;HAVE_OPENGL;HAVE_DYLIB;HAVE_NETPLAY;HAVE_NETWORKING;HAVE_NETWORK_CMD;HAVE_COMMAND;HAVE_STDIN_CMD;HAVE_THREADS;HAVE_DYNAMIC;HAVE_ZLIB;WANT_ZLIB;_CRT_SECURE_NO_WARNINGS;__SSE__;__SSE2__;__x86_64__;HAVE_OVERLAY;HAVE_RGUI;HAVE_GL_SYNC;HAVE_MENU;HAVE_7ZIP;HAVE_GLUI;HAVE_LIBRETRODB</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;RARCH_INTERNAL;HAVE_D3D;HAVE_D3D9;HAVE_CG;HAVE_GLSL;HAVE_GRIFFIN;HAVE_FBO;HAVE_ZLIB;HAVE_XMB;WANT_ZLIB;HAVE_FBO;NDEBUG;_WINDOWS;%(PreprocessorDefinitions);HAVE_BUILTIN_AUTOCONFIG;HAVE_DINPUT;HAVE_XINPUT;HAVE_XAUDIO;HAVE_DSOUND;HAVE_OPENGL;HAVE_DYLIB;HAVE_NETPLAY;HAVE_NETWORKING;HAVE_NETWORK_CMD;HAVE_COMMAND;HAVE_STDIN_CMD;HAVE_THREADS;HAVE_DYNAMIC;HAVE_ZLIB;WANT_ZLIB;_CRT_SECURE_NO_WARNINGS;__SSE__;__SSE2__;__x86_64__;HAVE_OVERLAY;HAVE_RGUI;HAVE_GL_SYNC;HAVE_MENU;HAVE_7ZIP;HAVE_GLUI;HAVE_LIBRETRODB</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(MSBuildProjectDirectory);$(MSBuildProjectDirectory)\..\..\;$(CG_INC_PATH);$(MSBuildProjectDirectory)\..\..\deps\zlib;$(MSBuildProjectDirectory)\..\..\libretro-common\include;$(MSBuildProjectDirectory)\..\..\gfx\inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<CompileAs>CompileAsCpp</CompileAs>

View File

@ -219,7 +219,7 @@ if [ "$OS" = 'Win32' ]; then
check_lib DSOUND -ldsound
if [ "$HAVE_DINPUT" != 'no' ]; then
HAVE_WINXINPUT=yes
HAVE_XINPUT=yes
fi
HAVE_XAUDIO=yes

View File

@ -489,6 +489,7 @@ static int do_pause_state_checks(
bool rewind_pressed)
{
runloop_t *runloop = rarch_main_get_ptr();
bool check_is_oneshot = frameadvance_pressed || rewind_pressed;
if (!runloop || !runloop->is_paused)
return 0;
@ -499,7 +500,7 @@ static int do_pause_state_checks(
rarch_render_cached_frame();
}
if (!(frameadvance_pressed | rewind_pressed))
if (!check_is_oneshot)
return 1;
return 0;
@ -1052,7 +1053,7 @@ static void rarch_main_cmd_get_state(rarch_cmd_state_t *cmd,
cmd->state_slot_decrease = BIT64_GET(trigger_input, RARCH_STATE_SLOT_MINUS);
cmd->pause_pressed = BIT64_GET(trigger_input, RARCH_PAUSE_TOGGLE);
cmd->frameadvance_pressed = BIT64_GET(trigger_input, RARCH_FRAMEADVANCE);
cmd->rewind_pressed = BIT64_GET(trigger_input, RARCH_REWIND);
cmd->rewind_pressed = BIT64_GET(input, RARCH_REWIND);
cmd->netplay_flip_pressed = BIT64_GET(trigger_input, RARCH_NETPLAY_FLIP);
cmd->fullscreen_toggle = BIT64_GET(trigger_input, RARCH_FULLSCREEN_TOGGLE_KEY);
cmd->cheat_index_plus_pressed = BIT64_GET(trigger_input,

View File

@ -25,7 +25,7 @@
#include "../input/drivers/dinput.c"
#endif
#if defined(HAVE_WINXINPUT)
#if defined(HAVE_XINPUT)
#include "../input/drivers_joypad/xinput_joypad.c"
#endif