gu: speedup

This commit is contained in:
Crow-bar
2024-02-02 11:22:23 +03:00
parent 0513fe7d02
commit d71a9da389
3 changed files with 79 additions and 95 deletions

View File

@@ -31,5 +31,5 @@ libpspgu_a_SOURCES = callbackFin.c callbackSig.c guInternal.c resetValues.c sceG
sceGuSignal.c sceGuSpecular.c sceGuStart.c sceGuStencilFunc.c sceGuStencilOp.c \
sceGuSwapBuffers.c sceGuSync.c sceGuTerm.c sceGuTexEnvColor.c sceGuTexFilter.c sceGuTexFlush.c sceGuTexFunc.c \
sceGuTexImage.c sceGuTexLevelMode.c sceGuTexMapMode.c sceGuTexMode.c sceGuTexOffset.c sceGuTexProjMapMode.c \
sceGuTexScale.c sceGuTexSlope.c sceGuTexSync.c sceGuTexWrap.c sceGuViewport.c sendCommand.c
sceGuTexScale.c sceGuTexSlope.c sceGuTexSync.c sceGuTexWrap.c sceGuViewport.c

View File

@@ -114,12 +114,33 @@ extern int gu_object_stack_depth;
extern GuLightSettings light_settings[4];
void sendCommandi(int cmd, int argument);
void sendCommandiStall(int cmd, int argument);
void sendCommandf(int cmd, float argument);
void callbackSig(int id, void* arg);
void callbackFin(int id, void* arg);
void resetValues();
static __inline__ void sendCommandi(int cmd, int argument)
{
*(gu_list->current++) = (cmd << 24) | (argument & 0xffffff);
}
static __inline__ void sendCommandf(int cmd, float argument)
{
union
{
float f;
unsigned int i;
} t;
t.f = argument;
sendCommandi(cmd,t.i >> 8);
}
static __inline__ void sendCommandiStall(int cmd, int argument)
{
sendCommandi(cmd,argument);
if (!gu_object_stack_depth && !gu_curr_context)
sceGeListUpdateStallAddr(ge_list_executed[0],gu_list->current);
}
#endif

View File

@@ -1,37 +0,0 @@
/*
* PSP Software Development Kit - https://github.com/pspdev
* -----------------------------------------------------------------------
* Licensed under the BSD license, see LICENSE in PSPSDK root for details.
*
* Copyright (c) 2005 Jesper Svennevid
*/
#include "guInternal.h"
#include <pspkernel.h>
#include <pspge.h>
void sendCommandi(int cmd, int argument)
{
*(gu_list->current++) = (cmd << 24) | (argument & 0xffffff);
}
void sendCommandf(int cmd, float argument)
{
union
{
float f;
unsigned int i;
} t;
t.f = argument;
sendCommandi(cmd,t.i >> 8);
}
void sendCommandiStall(int cmd, int argument)
{
sendCommandi(cmd,argument);
if (!gu_object_stack_depth && !gu_curr_context)
sceGeListUpdateStallAddr(ge_list_executed[0],gu_list->current);
}