Skip to content

Commit

Permalink
main: Update support state only while parsing patch list & v5.0.2
Browse files Browse the repository at this point in the history
* Unsupported version messages should now appear (when NIDs dont match)
  • Loading branch information
Electry committed Dec 29, 2019
1 parent a647596 commit 65b6ee3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ static vg_io_status_t vg_config_parse_line(const char line[]) {
if (ret.code != IO_OK)
return ret;

if (vg_main_is_game(titleid, self, nid)) {
if (vg_main_is_game(titleid, self, nid, false)) {
g_config_section = CONFIG_SECTION_GAME;
return ret;
}
Expand Down
4 changes: 2 additions & 2 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ static int sceDisplaySetFrameBuf_patched(const SceDisplayFrameBuf *pParam, int s
return TAI_CONTINUE(int, g_main.osd_hook_ref, pParam, sync);
}

bool vg_main_is_game(const char titleid[], const char self[], uint32_t nid) {
bool vg_main_is_game(const char titleid[], const char self[], uint32_t nid, bool update_support) {
vg_game_support_t supp = GAME_UNSUPPORTED;

if (!strncasecmp(titleid, TITLEID_ANY, TITLEID_LEN) ||
Expand All @@ -188,7 +188,7 @@ bool vg_main_is_game(const char titleid[], const char self[], uint32_t nid) {
}

// Update global support
if (supp > g_main.support)
if (update_support && supp > g_main.support)
g_main.support = supp;

return supp == GAME_SUPPORTED;
Expand Down
4 changes: 2 additions & 2 deletions src/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#define OSD_MSG_IOPLUS_HINT "Do you have ioPlus installed?"
#define OSD_MSG_GAME_WRONG_VERSION "Your game version is not supported :("

#define VG_VERSION "v5.0.1"
#define VG_VERSION "v5.0.2"
#define VG_FOLDER "ux0:data/VitaGrafix/"

#define STRING_BUFFER_SIZE 1024
Expand Down Expand Up @@ -75,6 +75,6 @@ typedef struct {

extern vg_main_t g_main;

bool vg_main_is_game(const char titleid[], const char self[], uint32_t nid);
bool vg_main_is_game(const char titleid[], const char self[], uint32_t nid, bool update_support);

#endif
2 changes: 1 addition & 1 deletion src/patch.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ static vg_io_status_t vg_patch_parse_section(const char line[]) {

g_patch_total_count++;

if (vg_main_is_game(titleid, self, nid)) {
if (vg_main_is_game(titleid, self, nid, true)) {
g_patch_section = PATCH_SECTION_GAME;
} else {
// If previous patch section didn't have any patches ->
Expand Down

0 comments on commit 65b6ee3

Please sign in to comment.