From 895bb6d6260e7ce25e6ee17e5a9ae97d6bdab907 Mon Sep 17 00:00:00 2001 From: Francisco Javier Trujillo Mata Date: Thu, 28 Dec 2023 00:45:31 +0100 Subject: [PATCH 1/3] Update gskit dependecy --- build-cmakelibs.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-cmakelibs.sh b/build-cmakelibs.sh index 5ace2ed1..305aded3 100755 --- a/build-cmakelibs.sh +++ b/build-cmakelibs.sh @@ -83,7 +83,7 @@ git clone https://github.com/sezero/mikmod.git mikmod-mikmod || { exit 1; } git clone --depth 1 -b feature/cmake https://github.com/mcmtroffaes/theora.git || { exit 1; } # SDL requires to have gsKit -git clone --depth 1 -b v1.3.5 https://github.com/ps2dev/gsKit || { exit 1; } +git clone --depth 1 -b v1.3.6 https://github.com/ps2dev/gsKit || { exit 1; } # We need to clone the whole repo and point to the specific hash for now, # till a new version is released after this commit From a546675e4ff95bfe893b419bc043ff996bd2cc41 Mon Sep 17 00:00:00 2001 From: Francisco Javier Trujillo Mata Date: Thu, 28 Dec 2023 00:51:28 +0100 Subject: [PATCH 2/3] Update libxmp and opus --- build-cmakelibs.sh | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/build-cmakelibs.sh b/build-cmakelibs.sh index 305aded3..8aec43c1 100755 --- a/build-cmakelibs.sh +++ b/build-cmakelibs.sh @@ -58,14 +58,8 @@ git clone --depth 1 -b 1.9.5 https://github.com/open-source-parsers/jsoncpp.git pushd jsoncpp sed -i -e 's/std::snprintf/snprintf/' include/json/config.h popd -# We need to clone the whole repo and point to the specific hash for now, -# till they release a new version with cmake compatibility -git clone https://github.com/libxmp/libxmp.git || { exit 1; } -(cd libxmp && git checkout b0769774109d338554d534d9c122439d61d2bdd1 && cd -) || { exit 1; } -# We need to clone the whole repo and point to the specific hash for now, -# till they release a new version with cmake compatibility -git clone https://github.com/xiph/opus.git || { exit 1; } -(cd opus && git checkout ab04fbb1b7d0b727636d28fc2cadb5df9febe515 && cd -) || { exit 1; } +git clone --depth 1 -b libxmp-4.6.0 https://github.com/libxmp/libxmp.git || { exit 1; } +git clone --depth 1 -b v1.4 https://github.com/xiph/opus.git || { exit 1; } # We need to clone the whole repo and point to the specific hash for now, # till they release a new version with cmake compatibility git clone https://github.com/xiph/opusfile.git || { exit 1; } From bdc46e3b28f83c88c471a76b4d8a5e9a581a77a2 Mon Sep 17 00:00:00 2001 From: Francisco Javier Trujillo Mata Date: Thu, 28 Dec 2023 01:00:10 +0100 Subject: [PATCH 3/3] Remove ldebug dependency from libjpg_ps2_addons --- .../include/libjpg_ps2_addons.h | 1 - libjpeg_ps2_addons/src/libjpg_ps2_addons.c | 97 +------------------ 2 files changed, 1 insertion(+), 97 deletions(-) diff --git a/libjpeg_ps2_addons/include/libjpg_ps2_addons.h b/libjpeg_ps2_addons/include/libjpg_ps2_addons.h index eab5e89a..ba4611d3 100644 --- a/libjpeg_ps2_addons/include/libjpg_ps2_addons.h +++ b/libjpeg_ps2_addons/include/libjpg_ps2_addons.h @@ -23,7 +23,6 @@ jpgData *jpgFromRAW(void *data, int size, int mode); jpgData *jpgFromFilename(const char *filename, int mode); jpgData *jpgFromFILE(FILE *in_file, int mode); void jpgFileFromJpgData(const char *filename, int quality, jpgData *jpg); -int jpgScreenshot(const char* pFilename,unsigned int VramAdress, unsigned int Width, unsigned int Height, unsigned int Psm); #ifdef __cplusplus } diff --git a/libjpeg_ps2_addons/src/libjpg_ps2_addons.c b/libjpeg_ps2_addons/src/libjpg_ps2_addons.c index 1f0b03ca..356b77bb 100644 --- a/libjpeg_ps2_addons/src/libjpg_ps2_addons.c +++ b/libjpeg_ps2_addons/src/libjpg_ps2_addons.c @@ -9,10 +9,8 @@ #include #include #include -#include #include #include -#include #include "../include/libjpg_ps2_addons.h" @@ -204,97 +202,4 @@ void jpgFileFromJpgData(const char *filename, int quality, jpgData *jpg) { fclose(outfile); jpeg_destroy_compress(&cinfo); -} - -int jpgScreenshot(const char* filename,unsigned int vramAdress, unsigned int width, unsigned int height, unsigned int psm) -{ - int y; - static uint32_t in_buffer[1024*4]; // max 1024*32bit for a line, should be ok - uint8_t *p_out; - jpgData *jpg; - - jpg = malloc(sizeof(jpgData)); - if(jpg == NULL) - return -1; - - jpg->buffer = malloc(width * height * 3); - if (jpg->buffer == NULL) { - free(jpg); - return -1; - } - - p_out = jpg->buffer; - - // Check if we have a tempbuffer, if we do we use it - for (y = 0; y < height; y++) - { - ps2_screenshot(in_buffer, vramAdress, 0, y, width, 1, psm); - - if (psm == GS_PSM_16) - { - uint32_t x; - uint16_t* p_in = (uint16_t*)&in_buffer; - - for (x = 0; x < width; x++) - { - uint32_t r = (p_in[x] & 31) << 3; - uint32_t g = ((p_in[x] >> 5) & 31) << 3; - uint32_t b = ((p_in[x] >> 10) & 31) << 3; - - p_out[x*3+0] = r; - p_out[x*3+1] = g; - p_out[x*3+2] = b; - } - } - else - { - if (psm == GS_PSM_24) - { - uint32_t x; - uint8_t* p_in = (uint8_t*)&in_buffer; - - for (x = 0; x < width; x++) - { - uint8_t r = *p_in++; - uint8_t g = *p_in++; - uint8_t b = *p_in++; - - p_out[x*3+0] = r; - p_out[x*3+1] = g; - p_out[x*3+2] = b; - } - } - else - { - uint8_t *p_in = (uint8_t *) &in_buffer; - uint32_t x; - - for(x = 0; x < width; x++) - { - uint8_t r = *p_in++; - uint8_t g = *p_in++; - uint8_t b = *p_in++; - - p_in++; - - p_out[x*3+0] = r; - p_out[x*3+1] = g; - p_out[x*3+2] = b; - } - } - - p_out+= width*3; - } - } - - jpg->width = width; - jpg->height = height; - jpg->bpp = 24; - - jpgFileFromJpgData(filename, 100, jpg); - - free(jpg->buffer); - free(jpg); - - return 0; -} +} \ No newline at end of file