PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
boardinf.c
1/*
2# _____ ___ ____ ___ ____
3# ____| | ____| | | |____|
4# | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
5#-----------------------------------------------------------------------
6# Copyright ps2dev - http://www.ps2dev.org
7# Licenced under Academic Free License version 2.0
8# Review ps2sdk README & LICENSE files for further details.
9*/
10
11#include "irx_imports.h"
12
13#include "iop_mmio_hwport.h"
14
15// Based on the module from SDK 3.1.0.
16
17int _start(int ac, char **av)
18{
19 u16 bootmode_7_val;
20 USE_IOP_MMIO_HWPORT();
21
22 (void)av;
23 if ( ac > 0 )
24 {
25 return 1;
26 }
27 {
28 u32 bootmode_tmp[1];
29
30 bootmode_tmp[0] = (iop_mmio_hwport->exp2_r2[4612] & 0xFFFF) | 0x60000;
31 RegisterBootMode((iop_bootmode_t *)bootmode_tmp);
32 }
33 switch ( iop_mmio_hwport->exp2_r2[4612] & 0xF8 )
34 {
35 case 0:
36 case 16:
37 case 32:
38 case 48:
39 bootmode_7_val = 0x00C8;
40 break;
41 case 64:
42 case 80:
43 bootmode_7_val = 0x012C;
44 break;
45 default:
46 bootmode_7_val = 0x0126;
47 break;
48 }
49 {
50 u32 bootmode_tmp[1];
51
52 bootmode_tmp[0] = (bootmode_7_val & 0xFFFF) | 0x70000;
53 RegisterBootMode((iop_bootmode_t *)bootmode_tmp);
54 }
55 return 1;
56}