Skip to content

Commit

Permalink
提升1.00BIOS的兼容性
Browse files Browse the repository at this point in the history
  • Loading branch information
tpunix committed Jan 17, 2024
1 parent 8928b7d commit bc33ff5
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 5 deletions.
40 changes: 36 additions & 4 deletions Firm_Saturn/game_load.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,38 @@ void my_cdplayer(void)
if(debug_flag&1) sci_init();
printk("\nLoad my multiPlayer ...\n");

go = (void*)0x1d7c;
go(0);

*(u8*)(0xfffffe92) = 0x10;
*(u8*)(0xfffffe92) = 0x1;

*(u32*)(0xffffff40) = 0x00;
*(u32*)(0xffffff44) = 0x00;
*(u16*)(0xffffff48) = 0x00;
*(u32*)(0xffffff60) = 0x00;
*(u32*)(0xffffff64) = 0x00;
*(u16*)(0xffffff68) = 0x00;
*(u32*)(0xffffff70) = 0x00;
*(u32*)(0xffffff74) = 0x00;
*(u16*)(0xffffff78) = 0x00;

*(u8*)(0xfffffe71) = 0x0;
*(u8*)(0xfffffe72) = 0x0;

*(u32*)(0xffffff80) = 0x00;
*(u32*)(0xffffff84) = 0x00;
*(u32*)(0xffffff88) = 0x01;
*(u32*)(0xffffff8c) = 0x00;
*(u32*)(0xffffff90) = 0x00;
*(u32*)(0xffffff94) = 0x00;
*(u32*)(0xffffff98) = 0x01;
*(u32*)(0xffffff9c) = 0x00;

*(u32*)(0xffffff08) = 0x00;
*(u32*)(0xffffffb0) = 0x00;

go = (void*)*(u32*)(0x060002dc);
go(3);


*(u32*)(0x06000348) = 0xffffffff;

Expand Down Expand Up @@ -154,8 +184,10 @@ static void read_1st(void)
go();

patch_game((char*)0x06002020);
*(u32*)(0x06000358) = (u32)bup_init;
*(u32*)(0x0600026c) = (u32)my_cdplayer;
if(need_bup){
*(u32*)(0x06000358) = (u32)bup_init;
*(u32*)(0x0600026c) = (u32)my_cdplayer;
}

// 0x06000320: 0x060006b0 bios_set_clock_speed
memcpy((u8*)0x060006b8, code_06b8, sizeof(code_06b8));
Expand Down
4 changes: 3 additions & 1 deletion Firm_Saturn/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,7 @@ int main_handle(int ctrl)
select_game();
return MENU_RESTART;
}else if(index==1){
write_file("/SAROO/SS_BUP.BIN", 0, 0x10000, (void*)0x20180000);
cdblock_on(0);
bios_run_cd_player();
return MENU_RESTART;
Expand Down Expand Up @@ -663,10 +664,11 @@ int _main(void)
debug_flag = LE32((void*)(SYSINFO_ADDR+0x08));

// restore bios_loadcd_init1
*(u32*)(0x060002dc) = 0x2650;
*(u32*)(0x060002dc) = *(u32*)(0x2000111c);
*(u32*)(0x02000f04) = (u32)cdc_read_sector;
*(u32*)(0x02000f08) = (u32)read_file;
*(u32*)(0x02000f0c) = (u32)write_file;
*(u32*)(0x02000f30) = (u32)bios_cd_cmd;
*(u32*)(0x02000f38) = (u32)sci_init;
*(u32*)(0x02000f3c) = (u32)printk;

Expand Down

0 comments on commit bc33ff5

Please sign in to comment.