mirror of
https://github.com/libretro/RetroArch.git
synced 2025-03-03 07:18:56 +00:00
Cleanups
This commit is contained in:
parent
fcf6228dce
commit
a3ded01b64
@ -118,23 +118,32 @@ static struct
|
||||
} menu_tex ATTRIBUTE_ALIGN(32);
|
||||
|
||||
static OSCond g_video_cond;
|
||||
static unsigned g_current_framebuf;
|
||||
static volatile bool g_draw_done = false;
|
||||
static bool g_vsync = false;
|
||||
static uint32_t g_orientation = 0;
|
||||
|
||||
static uint32_t retraceCount;
|
||||
static uint32_t referenceRetraceCount;
|
||||
static volatile bool g_draw_done = false;
|
||||
static bool g_vsync = false;
|
||||
|
||||
static uint8_t gx_fifo[256 * 1024] ATTRIBUTE_ALIGN(32);
|
||||
static uint8_t display_list[1024] ATTRIBUTE_ALIGN(32);
|
||||
static size_t display_list_size;
|
||||
uint16_t gx_xOrigin, gx_yOrigin;
|
||||
int8_t gx_system_xOrigin, gx_used_system_xOrigin;
|
||||
int8_t gx_xOriginNeg, gx_xOriginPos;
|
||||
int8_t gx_yOriginNeg, gx_yOriginPos;
|
||||
|
||||
static uint8_t gx_fifo[256 * 1024] ATTRIBUTE_ALIGN(32);
|
||||
static uint8_t display_list[1024] ATTRIBUTE_ALIGN(32);
|
||||
|
||||
static uint16_t gx_xOrigin = 0;
|
||||
static uint16_t gx_yOrigin = 0;
|
||||
|
||||
static unsigned g_current_framebuf = 0;
|
||||
static uint32_t g_orientation = 0;
|
||||
|
||||
static uint32_t retraceCount = 0;
|
||||
static uint32_t referenceRetraceCount = 0;
|
||||
|
||||
static unsigned gx_old_width = 0;
|
||||
static unsigned gx_old_height = 0;
|
||||
|
||||
static size_t display_list_size;
|
||||
|
||||
GXRModeObj gx_mode;
|
||||
unsigned gx_old_width, gx_old_height;
|
||||
|
||||
float verts[16] ATTRIBUTE_ALIGN(32) = {
|
||||
-1, 1, -0.5,
|
||||
@ -247,15 +256,15 @@ unsigned menu_gx_resolutions[][2] = {
|
||||
|
||||
static void retrace_callback(u32 retrace_count)
|
||||
{
|
||||
u32 level = 0;
|
||||
uint32_t level = 0;
|
||||
|
||||
(void)retrace_count;
|
||||
|
||||
g_draw_done = true;
|
||||
OSSignalCond(g_video_cond);
|
||||
_CPU_ISR_Disable(level);
|
||||
_CPU_ISR_Disable((u32)level);
|
||||
retraceCount = retrace_count;
|
||||
_CPU_ISR_Restore(level);
|
||||
_CPU_ISR_Restore((u32)level);
|
||||
}
|
||||
|
||||
static bool gx_isValidXOrigin(int origin)
|
||||
@ -276,14 +285,19 @@ static bool gx_isValidYOrigin(int origin)
|
||||
static void gx_set_video_mode(void *data, unsigned fbWidth, unsigned lines,
|
||||
bool fullscreen)
|
||||
{
|
||||
f32 y_scale;
|
||||
int tmpOrigin;
|
||||
float refresh_rate;
|
||||
u16 xfbWidth, xfbHeight;
|
||||
bool progressive;
|
||||
unsigned modetype, viHeightMultiplier, viWidth, tvmode,
|
||||
max_width, i;
|
||||
gx_video_t *gx = (gx_video_t*)data;
|
||||
settings_t *settings = config_get_ptr();
|
||||
size_t new_fb_pitch = 0;
|
||||
unsigned new_fb_width = 0;
|
||||
unsigned new_fb_height = 0;
|
||||
float y_scale = 0.0f;
|
||||
uint16_t xfbWidth = 0;
|
||||
uint16_t xfbHeight = 0;
|
||||
gx_video_t *gx = (gx_video_t*)data;
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
/* stop vsync callback */
|
||||
VIDEO_SetPostRetraceCallback(NULL);
|
||||
@ -391,7 +405,8 @@ static void gx_set_video_mode(void *data, unsigned fbWidth, unsigned lines,
|
||||
while(viWidth + gx_used_system_xOrigin > 720) gx_used_system_xOrigin++;
|
||||
}
|
||||
|
||||
int tmpOrigin = (max_width - gx_mode.viWidth) / 2;
|
||||
tmpOrigin = (max_width - gx_mode.viWidth) / 2;
|
||||
|
||||
if(gx_system_xOrigin > 0)
|
||||
{
|
||||
while(!gx_isValidXOrigin(tmpOrigin)) tmpOrigin--;
|
||||
@ -446,10 +461,7 @@ static void gx_set_video_mode(void *data, unsigned fbWidth, unsigned lines,
|
||||
gx->should_resize = true;
|
||||
|
||||
/* calculate menu dimensions */
|
||||
size_t new_fb_pitch;
|
||||
unsigned new_fb_width;
|
||||
unsigned new_fb_height = (gx_mode.efbHeight /
|
||||
(gx->double_strike ? 1 : 2)) & ~3;
|
||||
new_fb_height = (gx_mode.efbHeight / (gx->double_strike ? 1 : 2)) & ~3;
|
||||
|
||||
if (new_fb_height > 240)
|
||||
new_fb_height = 240;
|
||||
@ -466,10 +478,10 @@ static void gx_set_video_mode(void *data, unsigned fbWidth, unsigned lines,
|
||||
GX_SetViewportJitter(0, 0, gx_mode.fbWidth, gx_mode.efbHeight, 0, 1, 1);
|
||||
GX_SetDispCopySrc(0, 0, gx_mode.fbWidth, gx_mode.efbHeight);
|
||||
|
||||
y_scale = GX_GetYScaleFactor(gx_mode.efbHeight, gx_mode.xfbHeight);
|
||||
xfbWidth = VIDEO_PadFramebufferWidth(gx_mode.fbWidth);
|
||||
xfbHeight = GX_SetDispCopyYScale(y_scale);
|
||||
GX_SetDispCopyDst(xfbWidth, xfbHeight);
|
||||
y_scale = GX_GetYScaleFactor(gx_mode.efbHeight, gx_mode.xfbHeight);
|
||||
xfbWidth = VIDEO_PadFramebufferWidth(gx_mode.fbWidth);
|
||||
xfbHeight = GX_SetDispCopyYScale((f32)y_scale);
|
||||
GX_SetDispCopyDst((u16)xfbWidth, (u16)xfbHeight);
|
||||
|
||||
GX_SetCopyFilter(gx_mode.aa, gx_mode.sample_pattern,
|
||||
(gx_mode.xfbMode == VI_XFBMODE_SF)
|
||||
@ -585,17 +597,16 @@ static void setup_video_mode(gx_video_t *gx)
|
||||
|
||||
static void init_texture(void *data, unsigned width, unsigned height)
|
||||
{
|
||||
unsigned g_filter;
|
||||
size_t fb_pitch;
|
||||
unsigned fb_width, fb_height;
|
||||
gx_video_t *gx = (gx_video_t*)data;
|
||||
GXTexObj *fb_ptr = (GXTexObj*)&g_tex.obj;
|
||||
GXTexObj *menu_ptr = (GXTexObj*)&menu_tex.obj;
|
||||
settings_t *settings = config_get_ptr();
|
||||
unsigned g_filter = settings->bools.video_smooth ? GX_LINEAR : GX_NEAR;
|
||||
|
||||
width &= ~3;
|
||||
height &= ~3;
|
||||
g_filter = settings->bools.video_smooth ? GX_LINEAR : GX_NEAR;
|
||||
|
||||
menu_display_get_fb_size(&fb_width, &fb_height,
|
||||
&fb_pitch);
|
||||
@ -614,11 +625,11 @@ static void init_texture(void *data, unsigned width, unsigned height)
|
||||
static void init_vtx(void *data, const video_info_t *video)
|
||||
{
|
||||
Mtx44 m;
|
||||
gx_video_t *gx = (gx_video_t*)data;
|
||||
u32 level = 0;
|
||||
_CPU_ISR_Disable(level);
|
||||
gx_video_t *gx = (gx_video_t*)data;
|
||||
uint32_t level = 0;
|
||||
_CPU_ISR_Disable((u32)level);
|
||||
referenceRetraceCount = retraceCount;
|
||||
_CPU_ISR_Restore(level);
|
||||
_CPU_ISR_Restore((u32)level);
|
||||
|
||||
GX_SetCullMode(GX_CULL_NONE);
|
||||
GX_SetClipMode(GX_CLIP_DISABLE);
|
||||
@ -898,6 +909,7 @@ static void convert_texture32(const uint32_t *_src, uint32_t *_dst,
|
||||
|
||||
static void gx_resize(void *data)
|
||||
{
|
||||
int gamma;
|
||||
unsigned degrees;
|
||||
unsigned width, height;
|
||||
Mtx44 m1, m2;
|
||||
@ -915,11 +927,11 @@ static void gx_resize(void *data)
|
||||
|
||||
#ifdef HW_RVL
|
||||
VIDEO_SetTrapFilter(global->console.softfilter_enable);
|
||||
int gamma = global->console.screen.gamma_correction;
|
||||
gamma = global->console.screen.gamma_correction;
|
||||
if(gamma == 0) gamma = 10; //default 1.0 gamma value
|
||||
VIDEO_SetGamma(gamma);
|
||||
#else
|
||||
int gamma = global->console.screen.gamma_correction;
|
||||
gamma = global->console.screen.gamma_correction;
|
||||
GX_SetDispCopyGamma(MAX(0,MIN(2,gamma)));
|
||||
#endif
|
||||
|
||||
@ -1484,7 +1496,7 @@ static bool gx_frame(void *data, const void *frame,
|
||||
char fps_text_buf[128];
|
||||
gx_video_t *gx = (gx_video_t*)data;
|
||||
u8 clear_efb = GX_FALSE;
|
||||
u32 level = 0;
|
||||
uint32_t level = 0;
|
||||
|
||||
fps_text_buf[0] = '\0';
|
||||
|
||||
@ -1569,11 +1581,11 @@ static bool gx_frame(void *data, const void *frame,
|
||||
gx_render_overlay(gx);
|
||||
#endif
|
||||
|
||||
_CPU_ISR_Disable(level);
|
||||
_CPU_ISR_Disable((u32)level);
|
||||
if (referenceRetraceCount > retraceCount)
|
||||
VIDEO_WaitVSync();
|
||||
referenceRetraceCount = retraceCount;
|
||||
_CPU_ISR_Restore(level);
|
||||
_CPU_ISR_Restore((u32)level);
|
||||
|
||||
GX_DrawDone();
|
||||
|
||||
@ -1615,9 +1627,9 @@ static bool gx_frame(void *data, const void *frame,
|
||||
VIDEO_SetNextFramebuffer(gx->framebuf[g_current_framebuf]);
|
||||
VIDEO_Flush();
|
||||
|
||||
_CPU_ISR_Disable(level);
|
||||
_CPU_ISR_Disable((u32)level);
|
||||
++referenceRetraceCount;
|
||||
_CPU_ISR_Restore(level);
|
||||
_CPU_ISR_Restore((u32)level);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -215,7 +215,7 @@ static void* wiiu_gfx_init(const video_info_t* video,
|
||||
*input_data = wiiuinput;
|
||||
}
|
||||
|
||||
/* video init */
|
||||
/* video initialize */
|
||||
wiiu->cmd_buffer = MEM2_alloc(0x400000, 0x40);
|
||||
u32 init_attributes[] =
|
||||
{
|
||||
@ -276,19 +276,14 @@ static void* wiiu_gfx_init(const video_info_t* video,
|
||||
GX2SetScissor(0, 0, wiiu->color_buffer.surface.width, wiiu->color_buffer.surface.height);
|
||||
GX2SetDepthOnlyControl(GX2_DISABLE, GX2_DISABLE, GX2_COMPARE_FUNC_ALWAYS);
|
||||
GX2SetColorControl(GX2_LOGIC_OP_COPY, 1, GX2_DISABLE, GX2_ENABLE);
|
||||
#if 1
|
||||
GX2SetBlendControl(GX2_RENDER_TARGET_0, GX2_BLEND_MODE_SRC_ALPHA, GX2_BLEND_MODE_INV_SRC_ALPHA, GX2_BLEND_COMBINE_MODE_ADD,
|
||||
GX2_ENABLE, GX2_BLEND_MODE_SRC_ALPHA, GX2_BLEND_MODE_INV_SRC_ALPHA, GX2_BLEND_COMBINE_MODE_ADD);
|
||||
#else
|
||||
GX2SetBlendControl(GX2_RENDER_TARGET_0, GX2_BLEND_MODE_ONE, GX2_BLEND_MODE_ZERO, GX2_BLEND_COMBINE_MODE_ADD,
|
||||
GX2_DISABLE, GX2_BLEND_MODE_ONE, GX2_BLEND_MODE_ZERO, GX2_BLEND_COMBINE_MODE_ADD);
|
||||
#endif
|
||||
GX2SetCullOnlyControl(GX2_FRONT_FACE_CCW, GX2_DISABLE, GX2_DISABLE);
|
||||
#ifdef GX2_CAN_ACCESS_DATA_SECTION
|
||||
wiiu->shader = &tex_shader;
|
||||
#else
|
||||
|
||||
/* init shader */
|
||||
/* Initialize shader */
|
||||
wiiu->shader = MEM2_alloc(sizeof(tex_shader), 0x1000);
|
||||
memcpy(wiiu->shader, &tex_shader, sizeof(tex_shader));
|
||||
GX2Invalidate(GX2_INVALIDATE_MODE_CPU, wiiu->shader, sizeof(tex_shader));
|
||||
@ -341,7 +336,7 @@ static void* wiiu_gfx_init(const video_info_t* video,
|
||||
wiiu_set_tex_coords(wiiu->menu.tex_coord, &wiiu->menu.texture, 0, 0,
|
||||
wiiu->menu.texture.surface.width, wiiu->menu.texture.surface.height, 0);
|
||||
|
||||
/* init frame texture */
|
||||
/* Initialize frame texture */
|
||||
memset(&wiiu->texture, 0, sizeof(GX2Texture));
|
||||
wiiu->texture.surface.width = video->input_scale * RARCH_SCALE_BASE;
|
||||
wiiu->texture.surface.height = video->input_scale * RARCH_SCALE_BASE;
|
||||
@ -390,12 +385,14 @@ static void* wiiu_gfx_init(const video_info_t* video,
|
||||
GX2Invalidate(GX2_INVALIDATE_MODE_CPU_TEXTURE, wiiu->menu.texture.surface.image,
|
||||
wiiu->menu.texture.surface.imageSize);
|
||||
|
||||
wiiu->vertex_cache.size = 0x1000;
|
||||
wiiu->vertex_cache.current = 0;
|
||||
wiiu->vertex_cache.positions = MEM2_alloc(wiiu->vertex_cache.size * sizeof(position_t), GX2_VERTEX_BUFFER_ALIGNMENT);
|
||||
wiiu->vertex_cache.tex_coords = MEM2_alloc(wiiu->vertex_cache.size * sizeof(tex_coord_t), GX2_VERTEX_BUFFER_ALIGNMENT);
|
||||
wiiu->vertex_cache.size = 0x1000;
|
||||
wiiu->vertex_cache.current = 0;
|
||||
wiiu->vertex_cache.positions = MEM2_alloc(wiiu->vertex_cache.size
|
||||
* sizeof(position_t), GX2_VERTEX_BUFFER_ALIGNMENT);
|
||||
wiiu->vertex_cache.tex_coords = MEM2_alloc(wiiu->vertex_cache.size
|
||||
* sizeof(tex_coord_t), GX2_VERTEX_BUFFER_ALIGNMENT);
|
||||
|
||||
/* init samplers */
|
||||
/* Initialize samplers */
|
||||
GX2InitSampler(&wiiu->sampler_nearest, GX2_TEX_CLAMP_MODE_CLAMP, GX2_TEX_XY_FILTER_MODE_POINT);
|
||||
GX2InitSampler(&wiiu->sampler_linear, GX2_TEX_CLAMP_MODE_CLAMP, GX2_TEX_XY_FILTER_MODE_LINEAR);
|
||||
|
||||
@ -415,10 +412,10 @@ static void* wiiu_gfx_init(const video_info_t* video,
|
||||
GX2SetTVEnable(GX2_ENABLE);
|
||||
GX2SetDRCEnable(GX2_ENABLE);
|
||||
|
||||
wiiu->keep_aspect = true;
|
||||
wiiu->should_resize = true;
|
||||
wiiu->smooth = video->smooth;
|
||||
wiiu->vsync = video->vsync;
|
||||
wiiu->keep_aspect = true;
|
||||
wiiu->should_resize = true;
|
||||
wiiu->smooth = video->smooth;
|
||||
wiiu->vsync = video->vsync;
|
||||
GX2SetSwapInterval(!!video->vsync);
|
||||
|
||||
wiiu->vp.x = 0;
|
||||
@ -495,11 +492,17 @@ static bool wiiu_gfx_frame(void* data, const void* frame,
|
||||
unsigned width, unsigned height, uint64_t frame_count,
|
||||
unsigned pitch, const char* msg, video_frame_info_t *video_info)
|
||||
{
|
||||
(void)msg;
|
||||
#if 0
|
||||
static float fps;
|
||||
static u32 frames;
|
||||
static u32 lastTick , currentTick;
|
||||
u32 diff;
|
||||
#endif
|
||||
int i;
|
||||
|
||||
wiiu_video_t* wiiu = (wiiu_video_t*) data;
|
||||
|
||||
(void)msg;
|
||||
|
||||
if(wiiu->vsync)
|
||||
{
|
||||
uint32_t swap_count;
|
||||
@ -517,32 +520,32 @@ static bool wiiu_gfx_frame(void* data, const void* frame,
|
||||
else
|
||||
wiiu->last_vsync = last_vsync;
|
||||
}
|
||||
GX2WaitForFlip();
|
||||
|
||||
GX2WaitForFlip();
|
||||
|
||||
if (!width || !height)
|
||||
return true;
|
||||
|
||||
static u32 lastTick , currentTick;
|
||||
#if 0
|
||||
currentTick = OSGetSystemTick();
|
||||
u32 diff = currentTick - lastTick;
|
||||
static float fps;
|
||||
static u32 frames;
|
||||
diff = currentTick - lastTick;
|
||||
|
||||
frames++;
|
||||
|
||||
if(diff > wiiu_timer_clock)
|
||||
{
|
||||
fps = (float)frames * ((float) wiiu_timer_clock / (float) diff);
|
||||
lastTick = currentTick;
|
||||
frames = 0;
|
||||
}
|
||||
#if 0
|
||||
|
||||
static u32 last_frame_tick;
|
||||
if (!(wiiu->menu.enable))
|
||||
printf("frame time : %10.6f ms \r", (float)(currentTick - last_frame_tick) * 1000.0f / (float)wiiu_timer_clock);
|
||||
last_frame_tick = currentTick;
|
||||
#endif
|
||||
printf("fps: %8.8f frames : %5i\r", fps, wiiu->frames++);
|
||||
fflush(stdout);
|
||||
#endif
|
||||
|
||||
if (wiiu->should_resize)
|
||||
wiiu_gfx_update_viewport(wiiu);
|
||||
@ -559,8 +562,9 @@ static bool wiiu_gfx_frame(void* data, const void* frame,
|
||||
if (height > wiiu->texture.surface.height)
|
||||
height = wiiu->texture.surface.height;
|
||||
|
||||
wiiu->width = width;
|
||||
wiiu->width = width;
|
||||
wiiu->height = height;
|
||||
|
||||
if(wiiu->rgb32)
|
||||
{
|
||||
const uint32_t* src = frame;
|
||||
@ -577,12 +581,12 @@ static bool wiiu_gfx_frame(void* data, const void* frame,
|
||||
}
|
||||
else
|
||||
{
|
||||
const uint16_t* src = frame;
|
||||
uint16_t* dst = (uint16_t*)wiiu->texture.surface.image;
|
||||
const uint16_t *src = frame;
|
||||
uint16_t *dst = (uint16_t*)wiiu->texture.surface.image;
|
||||
|
||||
for (i = 0; i < height; i++)
|
||||
{
|
||||
int j;
|
||||
unsigned j;
|
||||
for(j = 0; j < width; j++)
|
||||
dst[j] = __builtin_bswap16(src[j]);
|
||||
dst += wiiu->texture.surface.pitch;
|
||||
@ -596,8 +600,10 @@ static bool wiiu_gfx_frame(void* data, const void* frame,
|
||||
wiiu_set_tex_coords(wiiu->tex_coord, &wiiu->texture, 0, 0, width, height, wiiu->rotation);
|
||||
}
|
||||
|
||||
GX2SetAttribBuffer(0, 4 * sizeof(*wiiu->position), sizeof(*wiiu->position), wiiu->position);
|
||||
GX2SetAttribBuffer(1, 4 * sizeof(*wiiu->tex_coord), sizeof(*wiiu->tex_coord), wiiu->tex_coord);
|
||||
GX2SetAttribBuffer(0, 4 * sizeof(*wiiu->position),
|
||||
sizeof(*wiiu->position), wiiu->position);
|
||||
GX2SetAttribBuffer(1, 4 * sizeof(*wiiu->tex_coord),
|
||||
sizeof(*wiiu->tex_coord), wiiu->tex_coord);
|
||||
|
||||
GX2SetPixelTexture(&wiiu->texture, wiiu->shader->sampler.location);
|
||||
GX2SetPixelSampler(wiiu->smooth? &wiiu->sampler_linear : &wiiu->sampler_nearest,
|
||||
@ -607,8 +613,10 @@ static bool wiiu_gfx_frame(void* data, const void* frame,
|
||||
|
||||
if (wiiu->menu.enable)
|
||||
{
|
||||
GX2SetAttribBuffer(0, 4 * sizeof(*wiiu->menu.position), sizeof(*wiiu->menu.position), wiiu->menu.position);
|
||||
GX2SetAttribBuffer(1, 4 * sizeof(*wiiu->menu.tex_coord), sizeof(*wiiu->menu.tex_coord), wiiu->menu.tex_coord);
|
||||
GX2SetAttribBuffer(0, 4 * sizeof(*wiiu->menu.position),
|
||||
sizeof(*wiiu->menu.position), wiiu->menu.position);
|
||||
GX2SetAttribBuffer(1, 4 * sizeof(*wiiu->menu.tex_coord),
|
||||
sizeof(*wiiu->menu.tex_coord), wiiu->menu.tex_coord);
|
||||
|
||||
GX2SetPixelTexture(&wiiu->menu.texture, wiiu->shader->sampler.location);
|
||||
GX2SetPixelSampler(&wiiu->sampler_linear, wiiu->shader->sampler.location);
|
||||
@ -617,8 +625,10 @@ static bool wiiu_gfx_frame(void* data, const void* frame,
|
||||
}
|
||||
|
||||
wiiu->vertex_cache.current = 0;
|
||||
GX2SetAttribBuffer(0, wiiu->vertex_cache.size * sizeof(position_t), sizeof(position_t), wiiu->vertex_cache.positions);
|
||||
GX2SetAttribBuffer(1, wiiu->vertex_cache.size * sizeof(tex_coord_t), sizeof(tex_coord_t), wiiu->vertex_cache.tex_coords);
|
||||
GX2SetAttribBuffer(0, wiiu->vertex_cache.size * sizeof(position_t),
|
||||
sizeof(position_t), wiiu->vertex_cache.positions);
|
||||
GX2SetAttribBuffer(1, wiiu->vertex_cache.size * sizeof(tex_coord_t),
|
||||
sizeof(tex_coord_t), wiiu->vertex_cache.tex_coords);
|
||||
GX2SetPixelSampler(&wiiu->sampler_linear, wiiu->shader->sampler.location);
|
||||
|
||||
wiiu->render_msg_enabled = true;
|
||||
@ -631,8 +641,10 @@ static bool wiiu_gfx_frame(void* data, const void* frame,
|
||||
|
||||
wiiu->render_msg_enabled = false;
|
||||
|
||||
GX2Invalidate(GX2_INVALIDATE_MODE_CPU_ATTRIBUTE_BUFFER, wiiu->vertex_cache.positions, wiiu->vertex_cache.current * sizeof(position_t));
|
||||
GX2Invalidate(GX2_INVALIDATE_MODE_CPU_ATTRIBUTE_BUFFER, wiiu->vertex_cache.tex_coords, wiiu->vertex_cache.current * sizeof(tex_coord_t));
|
||||
GX2Invalidate(GX2_INVALIDATE_MODE_CPU_ATTRIBUTE_BUFFER,
|
||||
wiiu->vertex_cache.positions, wiiu->vertex_cache.current * sizeof(position_t));
|
||||
GX2Invalidate(GX2_INVALIDATE_MODE_CPU_ATTRIBUTE_BUFFER,
|
||||
wiiu->vertex_cache.tex_coords, wiiu->vertex_cache.current * sizeof(tex_coord_t));
|
||||
|
||||
if (wiiu->menu.enable)
|
||||
GX2DrawDone();
|
||||
@ -729,8 +741,8 @@ static uintptr_t wiiu_gfx_load_texture(void* video_data, void* data,
|
||||
texture->surface.tileMode = GX2_TILE_MODE_LINEAR_ALIGNED;
|
||||
texture->viewNumSlices = 1;
|
||||
|
||||
texture->surface.format = GX2_SURFACE_FORMAT_UNORM_R8_G8_B8_A8;
|
||||
texture->compMap = GX2_COMP_SEL(_G, _B, _A, _R);
|
||||
texture->surface.format = GX2_SURFACE_FORMAT_UNORM_R8_G8_B8_A8;
|
||||
texture->compMap = GX2_COMP_SEL(_G, _B, _A, _R);
|
||||
|
||||
GX2CalcSurfaceSizeAndAlignment(&texture->surface);
|
||||
GX2InitTextureRegs(texture);
|
||||
@ -768,15 +780,15 @@ static void wiiu_gfx_apply_state_changes(void* data)
|
||||
|
||||
if (wiiu)
|
||||
wiiu->should_resize = true;
|
||||
|
||||
|
||||
}
|
||||
|
||||
static void wiiu_gfx_set_texture_frame(void* data, const void* frame, bool rgb32,
|
||||
unsigned width, unsigned height, float alpha)
|
||||
{
|
||||
int i;
|
||||
wiiu_video_t* wiiu = (wiiu_video_t*) data;
|
||||
const uint16_t *src = NULL;
|
||||
uint16_t *dst = NULL;
|
||||
wiiu_video_t* wiiu = (wiiu_video_t*) data;
|
||||
|
||||
if (!wiiu)
|
||||
return;
|
||||
@ -790,11 +802,11 @@ static void wiiu_gfx_set_texture_frame(void* data, const void* frame, bool rgb32
|
||||
if (height > wiiu->menu.texture.surface.height)
|
||||
height = wiiu->menu.texture.surface.height;
|
||||
|
||||
wiiu->menu.width = width;
|
||||
wiiu->menu.width = width;
|
||||
wiiu->menu.height = height;
|
||||
|
||||
const uint16_t* src = frame;
|
||||
uint16_t* dst = (uint16_t*)wiiu->menu.texture.surface.image;
|
||||
src = frame;
|
||||
dst = (uint16_t*)wiiu->menu.texture.surface.image;
|
||||
|
||||
for (i = 0; i < height; i++)
|
||||
{
|
||||
@ -807,7 +819,6 @@ static void wiiu_gfx_set_texture_frame(void* data, const void* frame, bool rgb32
|
||||
wiiu->menu.texture.surface.imageSize);
|
||||
|
||||
wiiu_set_tex_coords(wiiu->menu.tex_coord, &wiiu->menu.texture, 0, 0, width, height, 0);
|
||||
// wiiu_set_tex_coords(wiiu->menu.tex_coord, &wiiu->menu.texture, 0, 0, wiiu->menu.texture.surface.width, wiiu->menu.texture.surface.height, 0);
|
||||
}
|
||||
|
||||
static void wiiu_gfx_set_texture_enable(void* data, bool state, bool full_screen)
|
||||
@ -860,7 +871,7 @@ static const video_poke_interface_t wiiu_poke_interface =
|
||||
};
|
||||
|
||||
static void wiiu_gfx_get_poke_interface(void* data,
|
||||
const video_poke_interface_t** iface)
|
||||
const video_poke_interface_t** iface)
|
||||
{
|
||||
(void)data;
|
||||
*iface = &wiiu_poke_interface;
|
||||
|
@ -59,10 +59,12 @@ static int16_t ctr_input_state(void *data,
|
||||
switch (device)
|
||||
{
|
||||
case RETRO_DEVICE_JOYPAD:
|
||||
return input_joypad_pressed(ctr->joypad, joypad_info, port, binds[port], id);
|
||||
return input_joypad_pressed(ctr->joypad,
|
||||
joypad_info, port, binds[port], id);
|
||||
case RETRO_DEVICE_ANALOG:
|
||||
if (binds[port])
|
||||
return input_joypad_analog(ctr->joypad, joypad_info, port, idx, id, binds[port]);
|
||||
return input_joypad_analog(ctr->joypad,
|
||||
joypad_info, port, idx, id, binds[port]);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -53,10 +53,12 @@ static int16_t gx_input_state(void *data,
|
||||
switch (device)
|
||||
{
|
||||
case RETRO_DEVICE_JOYPAD:
|
||||
return input_joypad_pressed(gx->joypad, joypad_info, port, binds[port], id);
|
||||
return input_joypad_pressed(gx->joypad,
|
||||
joypad_info, port, binds[port], id);
|
||||
case RETRO_DEVICE_ANALOG:
|
||||
if (binds[port])
|
||||
return input_joypad_analog(gx->joypad, joypad_info, port, idx, id, binds[port]);
|
||||
return input_joypad_analog(gx->joypad,
|
||||
joypad_info, port, idx, id, binds[port]);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -36,9 +36,9 @@
|
||||
#define MAX_PADS 5
|
||||
|
||||
static unsigned char keyboardChannel = 0x00;
|
||||
static KBDModifier keyboardModifier = 0x00;
|
||||
static unsigned char keyboardCode = 0x00;
|
||||
static KEYState keyboardState[256] = { KBD_WIIU_NULL };
|
||||
static KBDModifier keyboardModifier = 0x00;
|
||||
static unsigned char keyboardCode = 0x00;
|
||||
static KEYState keyboardState[256] = { KBD_WIIU_NULL };
|
||||
|
||||
typedef struct wiiu_input
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user