From 3d67be96a06af1472ffae28bfd96a65f5a293c75 Mon Sep 17 00:00:00 2001 From: 1UP Date: Tue, 11 Feb 2020 20:27:43 -0500 Subject: [PATCH] Put in a basic game check --- fragmentPatcher.c | 26 +++++++++++++++++++------- menu.c | 2 +- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/fragmentPatcher.c b/fragmentPatcher.c index 5623e24..dd6bf0d 100644 --- a/fragmentPatcher.c +++ b/fragmentPatcher.c @@ -16,7 +16,6 @@ #include #include "menu.h" - #define _RESIDENT_ __attribute__((section(".resident"))) #define DEBUG #define ERROR_HAX0R -4 @@ -69,6 +68,7 @@ void initalise(void) int ret; SifInitRpc(0); + // init debug screen init_scr(); // load all modules @@ -533,7 +533,7 @@ int getVTblAddr(void) } void startGame() { - scr_printf(" Loading... "); + //wait for CD to spin up int cdWait = 6; @@ -548,11 +548,23 @@ void startGame() if(cdWait == 2) { - // Shutdown - padPortClose(0, 0); - - SifExitRpc(); - LoadExecPS2("cdrom0:\\SLPS_255.27;1", 0, NULL); + FILE* fp = fopen("cdrom0:\\SLPS_255.27", "r"); + + + if (fp == NULL) + { + scr_printf("\n Please insert the fragment game disk and restart the ps2 / emulator."); + } + else + { + scr_printf(" \n Loading Fragment"); + // Shutdown + padPortClose(0, 0); + SifExitRpc(); + LoadExecPS2("cdrom0:\\SLPS_255.27;1", 0, NULL); + + } + } } diff --git a/menu.c b/menu.c index bc4e06b..f3af5d3 100644 --- a/menu.c +++ b/menu.c @@ -1,7 +1,7 @@ #include "menu.h" void menu_DisplayMain(void) { - char *currentVersion = "Patch Version: 1.0.5\n"; + char *currentVersion = "Patch Version: 1.0.6\n"; scr_printf(".hack//Fragment Patcher by 1UP\n"); scr_printf(currentVersion);