Skip to content

Commit da10818

Browse files
committed
Some others improvements
1 parent 70d1b7a commit da10818

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2727,9 +2727,9 @@ elseif(PSP)
27272727
pspvram
27282728
pspaudio
27292729
pspvfpu
2730-
pspdisplay
27312730
pspgu
27322731
pspge
2732+
pspdisplay
27332733
psphprm
27342734
pspctrl
27352735
psppower

src/render/psp/SDL_render_psp.c

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ static void PSP_UnlockTexture(SDL_Renderer *renderer, SDL_Texture *texture)
209209
PSP_Texture *psp_texture = (PSP_Texture *)texture->driverdata;
210210
PSP_RenderData *data = (PSP_RenderData *)renderer->driverdata;
211211

212-
// gsKit_TexManager_invalidate(data->gsGlobal, psp_texture);
212+
sceKernelDcacheWritebackAll();
213213
}
214214

215215
static int PSP_UpdateTexture(SDL_Renderer *renderer, SDL_Texture *texture,
@@ -420,7 +420,7 @@ static int PSP_RenderClear(SDL_Renderer *renderer, SDL_RenderCommand *cmd)
420420
colorA = cmd->data.color.a;
421421

422422
sceGuClearColor(GU_RGBA(colorR, colorG, colorB, colorA));
423-
sceGuClearStencil(colorA);
423+
sceGuClearDepth(0);
424424
sceGuClear(GU_COLOR_BUFFER_BIT|GU_DEPTH_BUFFER_BIT);
425425

426426
return 0;
@@ -580,14 +580,15 @@ static int PSP_RenderPresent(SDL_Renderer *renderer)
580580
{
581581
PSP_RenderData *data = (PSP_RenderData *)renderer->driverdata;
582582

583+
sceGuFinish();
584+
sceGuSync(0,0);
585+
583586
if (((data->vsync == 2) && (data->vblank_not_reached)) || // Dynamic
584587
(data->vsync == 1)) { // Normal VSync
585588
sceDisplayWaitVblankStart();
586589
}
587590
data->vblank_not_reached = SDL_TRUE;
588591

589-
sceGuFinish();
590-
sceGuSync(0,0);
591592
data->backbuffer = data->frontbuffer;
592593
data->frontbuffer = vabsptr(sceGuSwapBuffers());
593594

@@ -658,6 +659,9 @@ static int PSP_CreateRenderer(SDL_Renderer *renderer, SDL_Window *window, Uint32
658659
return SDL_OutOfMemory();
659660
}
660661

662+
// flush cache so that no stray data remains
663+
sceKernelDcacheWritebackAll();
664+
661665
/* Specific GU init */
662666
bufferSize = getMemorySize(PSP_FRAME_BUFFER_WIDTH, PSP_SCREEN_HEIGHT, GU_PSM_8888);
663667
doublebuffer = vramalloc(bufferSize * 2);
@@ -683,6 +687,12 @@ static int PSP_CreateRenderer(SDL_Renderer *renderer, SDL_Window *window, Uint32
683687
sceDisplayWaitVblankStart();
684688
sceGuDisplay(GU_TRUE);
685689

690+
sceGuStart(GU_DIRECT,list);
691+
692+
// Clear the screen
693+
sceGuClearColor(0);
694+
sceGuClear(GU_COLOR_BUFFER_BIT);
695+
686696
/* Improve performance when VSYC is enabled and it is not reaching the 60 FPS */
687697
dynamicVsync = SDL_GetHintBoolean(SDL_HINT_PSP_DYNAMIC_VSYNC, SDL_FALSE);
688698
data->vsync = flags & SDL_RENDERER_PRESENTVSYNC ? (dynamicVsync ? 2 : 1) : 0;

0 commit comments

Comments
 (0)