void game_init() { // Initialize the PSXSDK library PSX_Init(); // Initialize graphics GsInit(); // Clear video memory GsClearMem(); // Set up drawing environment game_drawenv.dither = 0; game_drawenv.draw_on_display = 0; game_drawenv.x = 0; game_drawenv.y = 0; game_drawenv.w = 320; game_drawenv.h = 240; game_drawenv.ignore_mask = 0; game_drawenv.set_mask = 0; GsSetDrawEnv(&game_drawenv); // Set up display environment game_dispenv.x = 0; game_dispenv.y = 256; GsSetDispEnv(&game_dispenv); // Set drawing list GsSetList(game_draw_list); // Initialize sound SsInit(); }
/* ** PSF driver main() replacement */ int psfdrv(void) { void *pac; int rtype; int rdepth; int r; int play_a0; int play_a1; int play_a2; int play_a3; pac = (void*)(GM_PAC); /* ** Retrieve parameters and set useful defaults if they're zero */ rtype = PARAM_RTYPE; rdepth = PARAM_RDEPTH; /* ** Retrieve parameters for playback function */ play_a0 = PARAM_PLAY_A0; /* 0 (driver seems to ignore this parameter, perhaps) */ play_a1 = PARAM_PLAY_A1; /* target set (0 for BGM, maybe reverse-order of the file order?) */ play_a2 = PARAM_PLAY_A2; /* target song (index of DMF sequence) */ play_a3 = PARAM_PLAY_A3; /* loading method? (seems to be 1 for BGM, 0 for others) */ /* ** Initialize and startup stuff (comes from original main routine) */ //ResetCallback(); SsInit(); SsInitHot(); // since HokutoSsInitHot(0) contains MemCard things HokutoSsStart(); /* ** Reverb setup ** Actually the game already has set the reverb parameters ** during the initialization above. Anyway, here it is. */ if (rtype != 0 || rdepth != 0) { if(!rtype) rtype = 4; if(!rdepth) rdepth = 0; SsUtReverbOff(); //SsSetRVol(0x20, 0x20); SsUtSetReverbType(rtype); SsUtSetReverbDepth(rdepth, rdepth); SsUtReverbOn(); } /* ** Load the PAC */ r = HokutoSsOpenPac(pac, 15); ASSERT(r == 0); /* ** Play the DMF */ HokutoSsPlaySeq(play_a0, play_a1, play_a2, play_a3); /* ** Loop a while. */ loopforever(); return 0; }