From a7488f2a0b5542a09a05891863a6901ddb015837 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Sat, 30 Mar 2024 21:43:28 +1100 Subject: [PATCH] PS1: WIP on texture support PSP: Fix faces not being culled --- misc/ps1/classicube.zip | Bin 0 -> 20218 bytes misc/ps1/iso.xml | 3 + misc/ps3/Makefile | 4 +- src/Graphics_PS1.c | 131 +++++++++++++++++++++++++++++++++++++++- src/Graphics_PS3.c | 2 +- src/Graphics_PSP.c | 4 +- src/Platform_PS1.c | 21 +++++-- src/Window_PS3.c | 2 +- 8 files changed, 154 insertions(+), 13 deletions(-) create mode 100644 misc/ps1/classicube.zip diff --git a/misc/ps1/classicube.zip b/misc/ps1/classicube.zip new file mode 100644 index 0000000000000000000000000000000000000000..bfc0896479d4380ba8fae305968a2703fe38c5b7 GIT binary patch literal 20218 zcmV)QK(xP5O9KQH0000001m8*P2r_RBrpU305Ajq00;m80ApxjaxQRgXNgcwM-2)Z z3IG5A4M|8uQUCw|KmY&$AP5Ek005$$euMx300d`2O+f$vv5yP1&mnpqrd_?YVI>YDm%dS>@vGn!pIzI$uSgY{8w4&Oh$Yc4;W zHs9Wy^uWhjma~$%Bg^@hlhdHY)^SK@8?lfGWDfcPQ&?|%gnM-LYZ z@gs;xHNlZT%UMY~biZg%7@lj0k}buih)KiaYxnLPN~S04Pgu6U^IWqS_tnsqvD{E0 zdbj-@$JUo0BwllGjPC<)$gbveWh^&bB({XOUmrDapKJsYuPZ*~Q7+kPhOS*1%MFS6 z`Q>Aa<`RKW70)_N(3~|17BLS(btP89v7swtxj}Ih;)OFusC)div}pS8X)nI<#b{L`~-BbR4sjn3Q>`@4Vdx@DEFKO zs0n@ou(LfoQ88YG@FKHf!3$DRpbsFlcIS`r+Cy`kQfw`$Xvf7wrZm8d_oA`&YY_eW z6gieJ745hf2cc6Mz>W2OW5)s_wee$&%zdl)WF=o*r1z>(o@9`S$wvq za7> zC+*_g=M9KW0Nvb+P$5D-D8)k-&rfJ1{{79+&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xml index 96ea23a8c..220f72635 100644 --- a/misc/ps1/iso.xml +++ b/misc/ps1/iso.xml @@ -69,6 +69,9 @@ --> + + + diff --git a/misc/ps3/Makefile b/misc/ps3/Makefile index b37d83967..e28411b5a 100644 --- a/misc/ps3/Makefile +++ b/misc/ps3/Makefile @@ -35,7 +35,7 @@ ICON0 := ../misc/ps3/ICON0.png CFLAGS = -O2 -DPLAT_PS3 -Wall -mcpu=cell -fno-math-errno $(MACHDEP) $(INCLUDE) CXXFLAGS = $(CFLAGS) -LDFLAGS = $(MACHDEP) -Wl,-Map,$(notdir $@).map +LDFLAGS = $(MACHDEP) -Wl,-Map,$(notdir $@).map -fno-use-linker-plugin #--------------------------------------------------------------------------------- # any extra libraries we wish to link with the project @@ -141,4 +141,4 @@ $(OUTPUT).elf: $(OFILES) #--------------------------------------------------------------------------------- endif -#--------------------------------------------------------------------------------- \ No newline at end of file +#--------------------------------------------------------------------------------- diff --git a/src/Graphics_PS1.c b/src/Graphics_PS1.c index dbd92d3e4..8579dc584 100644 --- a/src/Graphics_PS1.c +++ b/src/Graphics_PS1.c @@ -115,16 +115,141 @@ void Gfx_Free(void) { /*########################################################################################################################* *---------------------------------------------------------Textures--------------------------------------------------------* *#########################################################################################################################*/ +// VRAM can be divided into texture pages +// 32 texture pages total - each page is 64 x 256 +// 10 texture pages are occupied by the doublebuffered display +// 22 texture packs are usable, and are then divided into +// - 4 pages for 256 wide textures, 8 for 128 wide, 10 for 64 +#define TPAGE_START_HOR 5 +#define TPAGES_PER_HALF 16 + +#define TPAGE_WIDTH 64 +#define TPAGE_HEIGHT 256 +#define MAX_TEX_PAGES 22 +static cc_uint8 vram_used[(MAX_TEX_PAGES * TPAGE_HEIGHT) / 8]; + +#define VRAM_SetUsed(line) (vram_used[(line) / 8] |= (1 << ((line) % 8))) +#define VRAM_UnUsed(line) (vram_used[(line) / 8] &= ~(1 << ((line) % 8))) +#define VRAM_IsUsed(line) (vram_used[(line) / 8] & (1 << ((line) % 8))) + +static void VRAM_GetBlockRange(int width, int* beg, int* end) { + if (width >= 256) { + *beg = 0; + *end = 4 * TPAGE_HEIGHT; + } else if (width >= 128) { + *beg = 4 * TPAGE_HEIGHT; + *end = 12 * TPAGE_HEIGHT; + } else { + *beg = 12 * TPAGE_HEIGHT; + *end = 22 * TPAGE_HEIGHT; + } +} + +static cc_bool VRAM_IsRangeFree(int beg, int end) { + for (int i = beg; i < end; i++) + { + if (VRAM_IsUsed(i)) return false; + } + return true; +} + +static int VRAM_FindFreeBlock(int width, int height) { + int beg, end; + VRAM_GetBlockRange(width, &beg, &end); + + // TODO kinda inefficient + for (int i = beg; i < end - height; i++) + { + if (VRAM_IsUsed(i)) continue; + + if (VRAM_IsRangeFree(i, i + height)) return i; + } + return -1; +} + +#define TEXTURES_MAX_COUNT 64 +typedef struct GPUTexture { + cc_uint16 width, height; + cc_uint16 line, tpage; +} GPUTexture; +static GPUTexture textures[TEXTURES_MAX_COUNT]; + +#define BGRA8_to_PS1(src) \ + ((src[2] & 0xF8) >> 3) | ((src[1] & 0xF8) << 2) | ((src[0] & 0xF8) << 7) | 0x8000 + +static void* AllocTextureAt(int i, struct Bitmap* bmp) { + cc_uint16* tmp = Mem_TryAlloc(2, bmp->width * bmp->height); + if (!tmp) return NULL; + + for (int y = 0; y < bmp->height; y++) + { + cc_uint32* src = bmp->scan0 + y * bmp->width; + cc_uint16* dst = tmp + y * bmp->width; + + for (int x = 0; x < bmp->width; x++) { + cc_uint8* color = (cc_uint8*)&src[x]; + dst[x] = BGRA8_to_PS1(color); + } + } + + GPUTexture* tex = &textures[i]; + int line = VRAM_FindFreeBlock(bmp->width, bmp->height); + if (line == -1) { Mem_Free(tmp); return NULL; } + + tex->width = bmp->width; + tex->height = bmp->height; + tex->line = line; + + int page = TPAGE_START_HOR + (line / TPAGE_HEIGHT); + // In bottom half of VRAM? Need to offset horizontally again + if (page >= TPAGES_PER_HALF) page += TPAGE_START_HOR; + + for (int i = tex->line; i < tex->line + tex->height; i++) + { + VRAM_SetUsed(i); + } + tex->tpage = page; + Platform_Log4("%i x %i = %i,%i", &bmp->width, &bmp->height, &line, &page); + + RECT rect; + rect.x = ((page % TPAGES_PER_HALF)) * TPAGE_WIDTH; + rect.y = ((page / TPAGES_PER_HALF)) * TPAGE_HEIGHT + (line % TPAGE_HEIGHT); + rect.w = bmp->width; + rect.h = bmp->height; + + int RX = rect.x, RY = rect.y; + Platform_Log2("LOAD AT: %i, %i", &RX, &RY); + LoadImage2(&rect, tmp); + + Mem_Free(tmp); + return tex; +} + static GfxResourceID Gfx_AllocTexture(struct Bitmap* bmp, cc_uint8 flags, cc_bool mipmaps) { + for (int i = 0; i < TEXTURES_MAX_COUNT; i++) + { + if (textures[i].width) continue; + return AllocTextureAt(i, bmp); + } + + Platform_LogConst("No room for more textures"); return NULL; } void Gfx_BindTexture(GfxResourceID texId) { + // TODO } void Gfx_DeleteTexture(GfxResourceID* texId) { GfxResourceID data = *texId; - if (data) Mem_Free(data); + if (!data) return; + GPUTexture* tex = (GPUTexture*)data; + + for (int i = tex->line; i < tex->line + tex->height; i++) + { + VRAM_UnUsed(i); + } + tex->width = 0; tex->height = 0; *texId = NULL; } @@ -133,7 +258,7 @@ void Gfx_UpdateTexture(GfxResourceID texId, int x, int y, struct Bitmap* part, i } void Gfx_UpdateTexturePart(GfxResourceID texId, int x, int y, struct Bitmap* part, cc_bool mipmaps) { - // TODO + Gfx_UpdateTexture(texId, x, y, part, part->width, mipmaps); } void Gfx_EnableMipmaps(void) { } @@ -521,7 +646,7 @@ cc_result Gfx_TakeScreenshot(struct Stream* output) { } cc_bool Gfx_WarnIfNecessary(void) { - return false; + return true; } void Gfx_BeginFrame(void) { diff --git a/src/Graphics_PS3.c b/src/Graphics_PS3.c index 63c9d4e9d..8bcd00447 100644 --- a/src/Graphics_PS3.c +++ b/src/Graphics_PS3.c @@ -711,4 +711,4 @@ void Gfx_DrawVb_IndexedTris(int verticesCount) {/* TODO */ void Gfx_DrawIndexedTris_T2fC4b(int verticesCount, int startVertex) {/* TODO */ rsxDrawVertexArray(context, GCM_TYPE_QUADS, startVertex, verticesCount); } -#endif \ No newline at end of file +#endif diff --git a/src/Graphics_PSP.c b/src/Graphics_PSP.c index 324e6cb34..b382f4f3b 100644 --- a/src/Graphics_PSP.c +++ b/src/Graphics_PSP.c @@ -44,7 +44,7 @@ static void guInit(void) { sceGuOffset(2048 - (SCREEN_WIDTH / 2), 2048 - (SCREEN_HEIGHT / 2)); sceGuViewport(2048, 2048, SCREEN_WIDTH, SCREEN_HEIGHT); sceGuDepthRange(65535,0); - sceGuFrontFace(GU_CW); + sceGuFrontFace(GU_CCW); sceGuShadeModel(GU_SMOOTH); sceGuDisable(GU_TEXTURE_2D); @@ -166,7 +166,7 @@ void Gfx_BindTexture(GfxResourceID texId) { *-----------------------------------------------------State management----------------------------------------------------* *#########################################################################################################################*/ static PackedCol gfx_clearColor; -void Gfx_SetFaceCulling(cc_bool enabled) { /*GU_Toggle(GU_CULL_FACE); */ } // TODO: Fix? GU_CCW instead?? +void Gfx_SetFaceCulling(cc_bool enabled) { GU_Toggle(GU_CULL_FACE); } void Gfx_SetAlphaBlending(cc_bool enabled) { GU_Toggle(GU_BLEND); } void Gfx_SetAlphaArgBlend(cc_bool enabled) { } diff --git a/src/Platform_PS1.c b/src/Platform_PS1.c index 38c5465a6..4708a1534 100644 --- a/src/Platform_PS1.c +++ b/src/Platform_PS1.c @@ -8,6 +8,7 @@ #include "Window.h" #include "Utils.h" #include "Errors.h" +#include "Options.h" #include "PackedCol.h" #include #include @@ -77,12 +78,20 @@ static void Stopwatch_Init(void) { /*########################################################################################################################* *-----------------------------------------------------Directory/File------------------------------------------------------* *#########################################################################################################################*/ +static const cc_string root_path = String_FromConst("cdrom:/"); + +static void GetNativePath(char* str, const cc_string* path) { + Mem_Copy(str, root_path.buffer, root_path.length); + str += root_path.length; + String_EncodeUtf8(str, path); +} + cc_result Directory_Create(const cc_string* path) { return ERR_NOT_SUPPORTED; } int File_Exists(const cc_string* path) { - return 0; + return ERR_NOT_SUPPORTED; } cc_result Directory_Enum(const cc_string* dirPath, void* obj, Directory_EnumCallback callback) { @@ -92,9 +101,11 @@ cc_result Directory_Enum(const cc_string* dirPath, void* obj, Directory_EnumCall cc_result File_Open(cc_file* file, const cc_string* path) { return ERR_NOT_SUPPORTED; } + cc_result File_Create(cc_file* file, const cc_string* path) { return ERR_NOT_SUPPORTED; } + cc_result File_OpenOrCreate(cc_file* file, const cc_string* path) { return ERR_NOT_SUPPORTED; } @@ -108,10 +119,10 @@ cc_result File_Write(cc_file file, const void* data, cc_uint32 count, cc_uint32* } cc_result File_Close(cc_file file) { - return 0; + return ERR_NOT_SUPPORTED; } -cc_result File_Seek(cc_file file, int offset, int seekType) { +cc_result File_Seek(cc_file file, int offset, int seekType) { return ERR_NOT_SUPPORTED; } @@ -207,8 +218,10 @@ cc_result Socket_CheckWritable(cc_socket s, cc_bool* writable) { *--------------------------------------------------------Platform---------------------------------------------------------* *#########################################################################################################################*/ void Platform_Init(void) { - ResetGraph( 0 ); + ResetGraph(0); Stopwatch_Init(); + + Options_SetBool(OPT_USE_CHAT_FONT, true); } void Platform_Free(void) { } diff --git a/src/Window_PS3.c b/src/Window_PS3.c index d9e200f22..8caf2adb0 100644 --- a/src/Window_PS3.c +++ b/src/Window_PS3.c @@ -369,4 +369,4 @@ cc_result Window_OpenFileDialog(const struct OpenFileDialogArgs* args) { cc_result Window_SaveFileDialog(const struct SaveFileDialogArgs* args) { return ERR_NOT_SUPPORTED; } -#endif \ No newline at end of file +#endif