mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-03 16:36:25 +00:00
Use filesystem drivers
This commit is contained in:

committed by
Sam Lantinga

parent
3d67b8d026
commit
40f0744b73
@@ -34,9 +34,7 @@
|
|||||||
#include <sifrpc.h>
|
#include <sifrpc.h>
|
||||||
#include <iopcontrol.h>
|
#include <iopcontrol.h>
|
||||||
#include <sbv_patches.h>
|
#include <sbv_patches.h>
|
||||||
#include <ps2_fileXio_driver.h>
|
#include <ps2_filesystem_driver.h>
|
||||||
#include <ps2_memcard_driver.h>
|
|
||||||
#include <ps2_usb_driver.h>
|
|
||||||
|
|
||||||
__attribute__((weak)) void reset_IOP()
|
__attribute__((weak)) void reset_IOP()
|
||||||
{
|
{
|
||||||
@@ -58,29 +56,12 @@ static void prepare_IOP()
|
|||||||
|
|
||||||
static void init_drivers()
|
static void init_drivers()
|
||||||
{
|
{
|
||||||
init_memcard_driver(true);
|
init_ps2_filesystem_driver();
|
||||||
init_usb_driver(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void deinit_drivers()
|
static void deinit_drivers()
|
||||||
{
|
{
|
||||||
deinit_usb_driver(true);
|
deinit_ps2_filesystem_driver();
|
||||||
deinit_memcard_driver(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void waitUntilDeviceIsReady(char *path)
|
|
||||||
{
|
|
||||||
struct stat buffer;
|
|
||||||
int ret = -1;
|
|
||||||
int retries = 50;
|
|
||||||
|
|
||||||
while (ret != 0 && retries > 0) {
|
|
||||||
ret = stat(path, &buffer);
|
|
||||||
/* Wait until the device is ready */
|
|
||||||
nopdelay();
|
|
||||||
|
|
||||||
retries--;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DECLSPEC int
|
DECLSPEC int
|
||||||
@@ -93,9 +74,6 @@ SDL_RunApp(int argc, char* argv[], SDL_main_func mainFunction, void * reserved)
|
|||||||
prepare_IOP();
|
prepare_IOP();
|
||||||
init_drivers();
|
init_drivers();
|
||||||
|
|
||||||
getcwd(cwd, sizeof(cwd));
|
|
||||||
waitUntilDeviceIsReady(cwd);
|
|
||||||
|
|
||||||
SDL_SetMainReady();
|
SDL_SetMainReady();
|
||||||
|
|
||||||
res = mainFunction(argc, argv);
|
res = mainFunction(argc, argv);
|
||||||
|
Reference in New Issue
Block a user