mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
Logging improvements and warning fixes.
(Had a super odd crash that I can't repro anymore in PPGe init...)
This commit is contained in:
1 parent
6b6520013f
commit
4bcd8df079
3 files changed
+13
-10
No files matched your search
@@ -767,7 +767,7 @@ static int sysclib_strstr(u32 s1, u32 s2) {
|
||||
}
|
||||
|
||||
static int sysclib_strncmp(u32 s1, u32 s2, u32 size) {
|
||||
ERROR_LOG(SCEKERNEL, "Untested sysclib_strncmp(%08x, %08x, x)", s1, s2, size);
|
||||
ERROR_LOG(SCEKERNEL, "Untested sysclib_strncmp(%08x, %08x, %08x)", s1, s2, size);
|
||||
if (Memory::IsValidAddress(s1) && Memory::IsValidAddress(s2)) {
|
||||
const char * str1 = Memory::GetCharPointer(s1);
|
||||
const char * str2 = Memory::GetCharPointer(s2);
|
||||
@@ -777,7 +777,7 @@ static int sysclib_strncmp(u32 s1, u32 s2, u32 size) {
|
||||
}
|
||||
|
||||
static u32 sysclib_memmove(u32 dst, u32 src, u32 size) {
|
||||
ERROR_LOG(SCEKERNEL, "Untested sysclib_memmove(%08x, %08x, x)", dst, src, size);
|
||||
ERROR_LOG(SCEKERNEL, "Untested sysclib_memmove(%08x, %08x, %08x)", dst, src, size);
|
||||
if (Memory::IsValidRange(dst, size) && Memory::IsValidRange(src, size)) {
|
||||
memmove(Memory::GetPointer(dst), Memory::GetPointer(src), size);
|
||||
}
|
||||
|
||||
@@ -225,9 +225,8 @@ void __PPGeInit() {
|
||||
|
||||
if (loadedZIM) {
|
||||
size_t atlas_data_size;
|
||||
uint8_t *atlas_data;
|
||||
if (!g_ppge_atlas.IsMetadataLoaded()) {
|
||||
atlas_data = VFSReadFile("ppge_atlas.meta", &atlas_data_size);
|
||||
uint8_t *atlas_data = VFSReadFile("ppge_atlas.meta", &atlas_data_size);
|
||||
if (atlas_data)
|
||||
g_ppge_atlas.Load(atlas_data, atlas_data_size);
|
||||
delete[] atlas_data;
|
||||
@@ -262,7 +261,7 @@ void __PPGeInit() {
|
||||
u8 cval = (a2 << 4) | a1;
|
||||
ramPtr[i] = cval;
|
||||
}
|
||||
|
||||
|
||||
free(imageData[0]);
|
||||
|
||||
// We can't create it here, because Android needs it on the right thread.
|
||||
@@ -271,7 +270,7 @@ void __PPGeInit() {
|
||||
textDrawer = nullptr;
|
||||
textDrawerImages.clear();
|
||||
|
||||
DEBUG_LOG(SCEGE, "PPGe drawing library initialized. DL: %08x Data: %08x Atlas: %08x (%i) Args: %08x",
|
||||
INFO_LOG(SCEGE, "PPGe drawing library initialized. DL: %08x Data: %08x Atlas: %08x (%i) Args: %08x",
|
||||
dlPtr, dataPtr, atlasPtr, atlasSize, listArgs.ptr);
|
||||
}
|
||||
|
||||
|
||||
@@ -82,8 +82,7 @@ int LoadZIMPtr(const uint8_t *zim, size_t datasize, int *width, int *height, int
|
||||
total_data_size += image_data_size[i];
|
||||
}
|
||||
|
||||
if (total_data_size == 0)
|
||||
{
|
||||
if (total_data_size == 0) {
|
||||
ELOG("Invalid ZIM data size 0");
|
||||
return 0;
|
||||
}
|
||||
@@ -95,12 +94,15 @@ int LoadZIMPtr(const uint8_t *zim, size_t datasize, int *width, int *height, int
|
||||
|
||||
if (*flags & ZIM_ZLIB_COMPRESSED) {
|
||||
long outlen = (long)total_data_size;
|
||||
if (Z_OK != ezuncompress(*image, &outlen, (unsigned char *)(zim + 16), (long)datasize - 16)) {
|
||||
int retcode = ezuncompress(*image, &outlen, (unsigned char *)(zim + 16), (long)datasize - 16);
|
||||
if (Z_OK != retcode) {
|
||||
ELOG("ZIM zlib format decompression failed: %d", retcode);
|
||||
free(*image);
|
||||
*image = 0;
|
||||
return 0;
|
||||
}
|
||||
if (outlen != total_data_size) {
|
||||
// Shouldn't happen if return value was Z_OK.
|
||||
ELOG("Wrong size data in ZIM: %i vs %i", (int)outlen, (int)total_data_size);
|
||||
}
|
||||
} else {
|
||||
@@ -116,11 +118,13 @@ int LoadZIM(const char *filename, int *width, int *height, int *format, uint8_t
|
||||
size_t size;
|
||||
uint8_t *buffer = VFSReadFile(filename, &size);
|
||||
if (!buffer) {
|
||||
ELOG("Couldn't read data for '%s'", buffer);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int retval = LoadZIMPtr(buffer, (int)size, width, height, format, image);
|
||||
if (!retval) {
|
||||
ELOG("Not a valid ZIM file: %s", filename);
|
||||
ELOG("Not a valid ZIM file: %s (size: %d bytes)", filename, (int)size);
|
||||
}
|
||||
delete [] buffer;
|
||||
return retval;
|
||||
|
||||
Reference in new issue
Block a user