Skip to content

Commit

Permalink
retroarch: backport another patch from Lakka-v4.x
Browse files Browse the repository at this point in the history
  • Loading branch information
ToKe79 committed Apr 6, 2022
1 parent 2bd5b8f commit 035d9e4
Showing 1 changed file with 89 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
From 09cb8867423725a9aaa0b947aa98db2dc1ee1887 Mon Sep 17 00:00:00 2001
From: Romeo <[email protected]>
Date: Sat, 2 Apr 2022 15:11:45 -0400
Subject: [PATCH 1/3] Update task_database.c

---
tasks/task_database.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/tasks/task_database.c b/tasks/task_database.c
index 29ddf9f55f4..b6bddfe77a6 100644
--- a/tasks/task_database.c
+++ b/tasks/task_database.c
@@ -616,6 +616,10 @@ static int task_database_iterate_playlist(
break;
/* Consider Wii WBFS files similar to ISO files. */
case FILE_TYPE_WBFS:
+ db_state->serial[0] = '\0';
+ intfstream_file_get_serial(name, 0, SIZE_MAX, db_state->serial);
+ db->type = DATABASE_TYPE_SERIAL_LOOKUP;
+ break;
case FILE_TYPE_ISO:
db_state->serial[0] = '\0';
intfstream_file_get_serial(name, 0, SIZE_MAX, db_state->serial);

From 644016e40368d5e32f70b61b64f27aaadd43a91e Mon Sep 17 00:00:00 2001
From: Romeo <[email protected]>
Date: Sat, 2 Apr 2022 15:37:33 -0400
Subject: [PATCH 2/3] Update task_database_cue.c

---
tasks/task_database_cue.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/tasks/task_database_cue.c b/tasks/task_database_cue.c
index 4134a058be7..5b1dc199fa6 100644
--- a/tasks/task_database_cue.c
+++ b/tasks/task_database_cue.c
@@ -66,6 +66,7 @@ static struct magic_entry MAGIC_NUMBERS[] = {
{ 0x000010, "Sega - Saturn", "\x53\x45\x47\x41\x20\x53\x45\x47\x41\x53\x41\x54\x55\x52\x4e", 15},
{ 0x000010, "Sega - Dreamcast", "\x53\x45\x47\x41\x20\x53\x45\x47\x41\x4b\x41\x54\x41\x4e\x41", 15},
{ 0x000018, "Nintendo - Wii", "\x5d\x1c\x9e\xa3", 4},
+ { 0x000218, "Nintendo - Wii", "\x5d\x1c\x9e\xa3", 4},
{ 0x00001c, "Nintendo - GameCube", "\xc2\x33\x9f\x3d", 4},
{ 0x008008, "Sony - PlayStation Portable", "\x50\x53\x50\x20\x47\x41\x4d\x45", 8},
{ 0x008008, "Sony - PlayStation", "\x50\x4c\x41\x59\x53\x54\x41\x54\x49\x4f\x4e", 11},
@@ -865,10 +866,17 @@ int detect_wii_game(intfstream_t *fd, char *game_id, const char *filename)
/* Load raw serial or quit */
if (intfstream_seek(fd, 0x0000, SEEK_SET) < 0)
return false;
-
+
if (intfstream_read(fd, raw_game_id, 6) <= 0)
return false;
-
+
+ if (string_is_equal_fast(raw_game_id, "WBFS", 4))
+ {
+ if (intfstream_seek(fd, 0x0200, SEEK_SET) < 0)
+ return false;
+ if (intfstream_read(fd, raw_game_id, 6) <= 0)
+ return false;
+ }
raw_game_id[6] = '\0';

/** Scrub files with bad data and log **/

From d3416699ccfbe42e2bb340a318e39cfe9001eff3 Mon Sep 17 00:00:00 2001
From: Romeo <[email protected]>
Date: Sat, 2 Apr 2022 15:42:39 -0400
Subject: [PATCH 3/3] Update task_database_cue.c

---
tasks/task_database_cue.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tasks/task_database_cue.c b/tasks/task_database_cue.c
index 5b1dc199fa6..b86df9e2d2b 100644
--- a/tasks/task_database_cue.c
+++ b/tasks/task_database_cue.c
@@ -866,7 +866,7 @@ int detect_wii_game(intfstream_t *fd, char *game_id, const char *filename)
/* Load raw serial or quit */
if (intfstream_seek(fd, 0x0000, SEEK_SET) < 0)
return false;
-
+
if (intfstream_read(fd, raw_game_id, 6) <= 0)
return false;

0 comments on commit 035d9e4

Please sign in to comment.