Merge pull request #1589 from aliaspider/master

(3DS) video driver update.
This commit is contained in:
Twinaphex 2015-04-05 22:49:19 +02:00
commit 563bdafada
2 changed files with 36 additions and 16 deletions

View File

@ -77,40 +77,40 @@ typedef struct ctr_video
#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)
static void ctr_set_frame_coords(ctr_vertex_t* v, int x0, int y0, int x1, int y1, int w, int h)
{
v[0].x = x;
v[0].y = y;
v[0].x = x0;
v[0].y = y0;
v[0].z = -1;
v[0].u = 0;
v[0].v = 0;
v[1].x = x + w;
v[1].y = y;
v[1].x = x1;
v[1].y = y0;
v[1].z = -1;
v[1].u = w;
v[1].v = 0;
v[2].x = x + w;
v[2].y = y + h;
v[2].x = x1;
v[2].y = y1;
v[2].z = -1;
v[2].u = w;
v[2].v = h;
v[3].x = x;
v[3].y = y;
v[3].x = x0;
v[3].y = y0;
v[3].z = -1;
v[3].u = 0;
v[3].v = 0;
v[4].x = x + w;
v[4].y = y + h;
v[4].x = x1;
v[4].y = y1;
v[4].z = -1;
v[4].u = w;
v[4].v = h;
v[5].x = x;
v[5].y = y + h;
v[5].x = x0;
v[5].y = y1;
v[5].z = -1;
v[5].u = 0;
v[5].v = h;
@ -144,7 +144,8 @@ static void* ctr_init(const video_info_t* video,
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_set_frame_coords(ctr->frame_coords, 0, 0, CTR_TOP_FRAMEBUFFER_WIDTH, CTR_TOP_FRAMEBUFFER_HEIGHT,
CTR_TOP_FRAMEBUFFER_WIDTH, CTR_TOP_FRAMEBUFFER_HEIGHT);
ctr->menu.texture_width = 512;
ctr->menu.texture_height = 512;
@ -154,7 +155,8 @@ static void* ctr_init(const video_info_t* video,
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_set_frame_coords(ctr->menu.frame_coords, 40, 0, CTR_TOP_FRAMEBUFFER_WIDTH - 40, CTR_TOP_FRAMEBUFFER_HEIGHT ,
CTR_TOP_FRAMEBUFFER_WIDTH - 80, CTR_TOP_FRAMEBUFFER_HEIGHT);
@ -315,6 +317,8 @@ static bool ctr_frame(void* data, const void* frame,
GPU_RGB565);
ctr_set_frame_coords(ctr->frame_coords, 0, 0, CTR_TOP_FRAMEBUFFER_WIDTH, CTR_TOP_FRAMEBUFFER_HEIGHT,
width, height);
GSPGPU_FlushDataCache(NULL, (u8*)ctr->frame_coords,
6 * sizeof(ctr_vertex_t));
ctrGuSetAttributeBuffers(2,

View File

@ -1,3 +1,18 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2014-2015 - Ali Bouhlel
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with RetroArch.
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CTR_GU_H
#define CTR_GU_H
@ -140,7 +155,8 @@ static inline void ctrGuSetVertexShaderFloatUniform(int id, float* data, int cou
#define CTRGU_ATTRIBFMT(f, n) ((((n)-1)<<2)|((f)&3))
void ctrGuSetAttributeBuffers(u32 total_attributes, void* base_address, u64 attribute_formats, u32 buffer_size)
__attribute__((always_inline))
static inline void ctrGuSetAttributeBuffers(u32 total_attributes, void* base_address, u64 attribute_formats, u32 buffer_size)
{
u32 param[0x28];