Remove PSP special weirdness, has almost no perf impact.

This commit is contained in:
David Guillen Fandos 2023-08-31 00:26:42 +02:00
parent 7906413f28
commit 7321d49ca4
4 changed files with 3 additions and 49 deletions

View File

@ -219,7 +219,7 @@ else ifeq ($(platform), psp1)
CC = psp-gcc$(EXE_EXT)
CXX = psp-g++$(EXE_EXT)
AR = psp-ar$(EXE_EXT)
CFLAGS += -DPSP -G0 -DUSE_BGR_FORMAT -DMIPS_HAS_R2_INSTS -DSMALL_TRANSLATION_CACHE
CFLAGS += -DPSP -G0 -DMIPS_HAS_R2_INSTS -DSMALL_TRANSLATION_CACHE
CFLAGS += -I$(shell psp-config --pspsdk-path)/include
CFLAGS += -march=allegrex -mfp32 -mgp32 -mlong32 -mabi=eabi
CFLAGS += -fomit-frame-pointer -ffast-math

View File

@ -78,10 +78,7 @@
typedef signed long long int s64;
#endif
#ifdef USE_BGR_FORMAT
#define convert_palette(value) \
(((value & 0x7FE0) << 1) | (value & 0x1F))
#elif defined(USE_XBGR1555_FORMAT)
#if defined(USE_XBGR1555_FORMAT)
#define convert_palette(value) \
(value & 0x7FFF)
#else

View File

@ -102,20 +102,6 @@ static void (*video_post_process)(void) = NULL;
static bool post_process_cc = false;
static bool post_process_mix = false;
#if defined(PSP)
static uint32_t next_pow2(uint32_t v)
{
v--;
v |= v >> 1;
v |= v >> 2;
v |= v >> 4;
v |= v >> 8;
v |= v >> 16;
v++;
return v;
}
#endif
static void error_msg(const char* text)
{
if (log_cb)
@ -430,31 +416,8 @@ static void video_run(void)
gba_screen_pixels_buf = gba_processed_pixels;
}
#if defined(PSP)
static unsigned int __attribute__((aligned(16))) d_list[32];
void* texture_vram_p = NULL;
int texture_size = (GBA_SCREEN_WIDTH*GBA_SCREEN_HEIGHT*2);
texture_vram_p = (void*) (0x44200000 - texture_size); /* max VRAM address - frame size */
sceKernelDcacheWritebackRange(gba_screen_pixels_buf, texture_size);
sceGuStart(GU_DIRECT, d_list);
sceGuTexMode(GU_PSM_5650, 0, 0, GU_FALSE);
sceGuCopyImage(GU_PSM_5650, 0, 0, GBA_SCREEN_WIDTH, GBA_SCREEN_HEIGHT, GBA_SCREEN_WIDTH,
gba_screen_pixels_buf, 0, 0, GBA_SCREEN_WIDTH, texture_vram_p);
sceGuTexImage(0, next_pow2(GBA_SCREEN_WIDTH), next_pow2(GBA_SCREEN_HEIGHT), GBA_SCREEN_WIDTH, texture_vram_p);
sceGuTexFunc(GU_TFX_REPLACE, GU_TCC_RGB);
sceGuDisable(GU_BLEND);
sceGuFinish();
video_cb(texture_vram_p, GBA_SCREEN_WIDTH, GBA_SCREEN_HEIGHT,
GBA_SCREEN_PITCH * 2);
#else
video_cb(gba_screen_pixels_buf, GBA_SCREEN_WIDTH, GBA_SCREEN_HEIGHT,
GBA_SCREEN_PITCH * 2);
#endif
}
#ifdef PERF_TEST

View File

@ -2356,13 +2356,7 @@ static void emit_pmemst_stub(
// Palette conversion functions. a1 contains the palette value (16 LSB)
// Places the result in reg_temp, can use a0 as temporary register
#ifdef USE_BGR_FORMAT
/* 0BGR to BGR565, only for PSP (uses ins) */
#define palette_convert() \
mips_emit_sll(reg_temp, reg_a1, 1); \
mips_emit_andi(reg_temp, reg_temp, 0xFFC0); \
mips_emit_ins(reg_temp, reg_a1, 0, 5);
#elif defined(USE_XBGR1555_FORMAT)
#if defined(USE_XBGR1555_FORMAT)
/* PS2's native format */
#define palette_convert() \
mips_emit_andi(reg_temp, reg_a1, 0x7FFF);