Atlas - SDL_sysmain_runapp.c
Home / ext / SDL / src / main / ps2 Lines: 1 | Size: 2050 bytes [Download] [Show on GitHub] [Search similar files] [Raw] [Raw (proxy)][FILE BEGIN]1/* 2 Simple DirectMedia Layer 3 Copyright (C) 1997-2025 Sam Lantinga <[email protected]> 4 5 This software is provided 'as-is', without any express or implied 6 warranty. In no event will the authors be held liable for any damages 7 arising from the use of this software. 8 9 Permission is granted to anyone to use this software for any purpose, 10 including commercial applications, and to alter it and redistribute it 11 freely, subject to the following restrictions: 12 13 1. The origin of this software must not be misrepresented; you must not 14 claim that you wrote the original software. If you use this software 15 in a product, an acknowledgment in the product documentation would be 16 appreciated but is not required. 17 2. Altered source versions must be plainly marked as such, and must not be 18 misrepresented as being the original software. 19 3. This notice may not be removed or altered from any source distribution. 20*/ 21 22#include "SDL_internal.h" 23 24#ifdef SDL_PLATFORM_PS2 25 26// SDL_RunApp() code for PS2 based on SDL_ps2_main.c, [email protected] 27 28#include "../SDL_main_callbacks.h" 29 30#include <sys/types.h> 31#include <sys/stat.h> 32#include <unistd.h> 33#include <stdio.h> 34 35#include <kernel.h> 36#include <sifrpc.h> 37#include <iopcontrol.h> 38#include <sbv_patches.h> 39#include <ps2_filesystem_driver.h> 40 41__attribute__((weak)) void reset_IOP(void) 42{ 43 SifInitRpc(0); 44 while (!SifIopReset(NULL, 0)) { 45 } 46 while (!SifIopSync()) { 47 } 48} 49 50static void prepare_IOP(void) 51{ 52 reset_IOP(); 53 SifInitRpc(0); 54 sbv_patch_enable_lmb(); 55 sbv_patch_disable_prefix_check(); 56 sbv_patch_fileio(); 57} 58 59static void init_drivers(void) 60{ 61 init_ps2_filesystem_driver(); 62} 63 64static void deinit_drivers(void) 65{ 66 deinit_ps2_filesystem_driver(); 67} 68 69int SDL_RunApp(int argc, char *argv[], SDL_main_func mainFunction, void * reserved) 70{ 71 int result; 72 (void)reserved; 73 74 prepare_IOP(); 75 init_drivers(); 76 77 result = SDL_CallMainFunction(argc, argv, mainFunction); 78 79 deinit_drivers(); 80 81 return result; 82} 83 84#endif // SDL_PLATFORM_PS2 85[FILE END](C) 2025 0x4248 (C) 2025 4248 Media and 4248 Systems, All part of 0x4248 See LICENCE files for more information. Not all files are by 0x4248 always check Licencing.