PSP: fixed build
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118
diff --git a/Makefile.psp b/Makefile.psp
index 7ccc809..69d7312 100644
--- a/Makefile.psp
+++ b/Makefile.psp
@@ -1,6 +1,7 @@
TARGET_LIB = libSDL2.a
OBJS= src/SDL.o \
src/SDL_assert.o \
+ src/SDL_dataqueue.o \
src/SDL_error.o \
src/SDL_hints.o \
src/SDL_log.o \
@@ -15,6 +16,7 @@ OBJS= src/SDL.o \
src/audio/psp/SDL_pspaudio.o \
src/cpuinfo/SDL_cpuinfo.o \
src/events/SDL_clipboardevents.o \
+ src/events/SDL_displayevents.o \
src/events/SDL_dropevents.o \
src/events/SDL_events.o \
src/events/SDL_gesture.o \
@@ -29,6 +31,7 @@ OBJS= src/SDL.o \
src/joystick/SDL_joystick.o \
src/joystick/SDL_gamecontroller.o \
src/joystick/psp/SDL_sysjoystick.o \
+ src/joystick/virtual/SDL_virtualjoystick.o \
src/power/SDL_power.o \
src/power/psp/SDL_syspower.o \
src/filesystem/dummy/SDL_sysfilesystem.o \
@@ -77,10 +80,12 @@ OBJS= src/SDL.o \
src/video/SDL_stretch.o \
src/video/SDL_surface.o \
src/video/SDL_video.o \
+ src/video/SDL_yuv.o \
src/video/psp/SDL_pspevents.o \
src/video/psp/SDL_pspvideo.o \
src/video/psp/SDL_pspgl.o \
- src/video/psp/SDL_pspmouse.o
+ src/video/psp/SDL_pspmouse.o \
+ src/video/yuv2rgb/yuv_rgb.o
INCDIR = ./include
CFLAGS = -g -O2 -G0 -Wall -D__PSP__ -DHAVE_OPENGL
diff --git a/src/render/psp/SDL_render_psp.c b/src/render/psp/SDL_render_psp.c
index e662704..6a6f585 100644
--- a/src/render/psp/SDL_render_psp.c
+++ b/src/render/psp/SDL_render_psp.c
@@ -56,6 +56,15 @@ static unsigned int __attribute__((aligned(16))) DisplayList[262144];
#define COL4444(r,g,b,a) ((r>>4) | ((g>>4)<<4) | ((b>>4)<<8) | ((a>>4)<<12))
#define COL8888(r,g,b,a) ((r) | ((g)<<8) | ((b)<<16) | ((a)<<24))
+typedef struct
+{
+ SDL_bool viewport_dirty;
+ SDL_Rect viewport;
+ SDL_bool cliprect_enabled_dirty;
+ SDL_bool cliprect_enabled;
+ SDL_bool cliprect_dirty;
+ SDL_Rect cliprect;
+} PSP_DrawStateCache;
typedef struct
{
@@ -70,6 +79,7 @@ typedef struct
unsigned int currentColor;
int currentBlendMode;
+ PSP_DrawStateCache drawstate;
} PSP_RenderData;
@@ -346,12 +356,6 @@ PSP_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture)
return 0;
}
-static int
-PSP_SetTextureColorMod(SDL_Renderer * renderer, SDL_Texture * texture)
-{
- return SDL_Unsupported();
-}
-
void
TextureActivate(SDL_Texture * texture)
{
@@ -373,6 +377,9 @@ TextureActivate(SDL_Texture * texture)
sceGuTexFunc(GU_TFX_REPLACE, GU_TCC_RGBA);
}
+static int
+PSP_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture,
+ const SDL_Rect * rect, void **pixels, int *pitch);
static int
PSP_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture,
@@ -469,7 +476,7 @@ PSP_QueueDrawPoints(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const SDL_F
static int
PSP_QueueFillRects(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const SDL_FRect * rects, int count)
{
- VertV *verts = (GLfloat *) SDL_AllocateRenderVertices(renderer, count * 2 * sizeof (VertV), 4, &cmd->data.draw.first);
+ VertV *verts = (VertV *) SDL_AllocateRenderVertices(renderer, count * 2 * sizeof (VertV), 4, &cmd->data.draw.first);
int i;
if (!verts) {
@@ -691,7 +698,6 @@ static int
PSP_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *vertices, size_t vertsize)
{
PSP_RenderData *data = (PSP_RenderData *) renderer->driverdata;
- size_t i;
StartDrawing(renderer);
@@ -952,7 +958,6 @@ PSP_CreateRenderer(SDL_Window * window, Uint32 flags)
renderer->WindowEvent = PSP_WindowEvent;
renderer->CreateTexture = PSP_CreateTexture;
- renderer->SetTextureColorMod = PSP_SetTextureColorMod;
renderer->UpdateTexture = PSP_UpdateTexture;
renderer->LockTexture = PSP_LockTexture;
renderer->UnlockTexture = PSP_UnlockTexture;