Subversion Repositories freemyipod

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
304 theseven 1
//
2
//
3
//    Copyright 2010 TheSeven
4
//
5
//
6
//    This file is part of emBIOS.
7
//
8
//    emBIOS is free software: you can redistribute it and/or
9
//    modify it under the terms of the GNU General Public License as
10
//    published by the Free Software Foundation, either version 2 of the
11
//    License, or (at your option) any later version.
12
//
13
//    emBIOS is distributed in the hope that it will be useful,
14
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
15
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16
//    See the GNU General Public License for more details.
17
//
18
//    You should have received a copy of the GNU General Public License along
19
//    with emBIOS.  If not, see <http://www.gnu.org/licenses/>.
20
//
21
//
22
 
23
 
24
#include "global.h"
25
#include "clickwheel.h"
26
 
27
 
28
#define sysi ((uint8_t*)0x2203fdf0)
29
#define sysiword ((uint32_t*)0x2203fdf0)
30
 
31
 
32
void targetinit_late()
33
{
34
    int i;
35
 
36
    clickwheel_init();
37
 
38
/*    uint32_t scfg_size = norword[0x401];
39
    uint32_t scfg_entrycount = norword[0x405];
40
    if (norword[0x400] == 0x53436667 && scfg_size <= 0x1000
41
     && scfg_entrycount * 0x14 + 0x18 == scfg_size)
42
    {
43
        memset(sysi, 0, 0x104);
44
        sysiword[0] = 0x53797349;
45
        sysiword[1] = 0x104;
46
        sysiword[0x21] = 0x100000;
47
        for (i = 0; i < scfg_entrycount; i++)
48
            switch (norword[0x406 + i * 5])
49
            {
50
                case 0x48774e6d: // HwNm
51
                    memcpy(&sysi[0x08], &norword[0x406 + i * 5 + 1], 16);
52
                    break;
53
                case 0x48775672: // HwVr
54
                    if (norword[0x406 + i * 5 + 1] == 0)
55
                        sysiword[0x21] = norword[0x406 + i * 5 + 2];
56
                    break;
57
                case 0x53724e6d: // SrNm
58
                    memcpy(&sysi[0x18], &norword[0x406 + i * 5 + 1], 16);
59
                    break;
60
                case 0x46774964: // FwId
61
                    if (nor[0x1018 + i * 0x14 + 7] == 0)
62
                    {
63
                        memcpy(&sysi[0x38], &norword[0x406 + i * 5 + 2], 3);
64
                        sysi[0x3b] = 2;
65
                        sysiword[0xf] = 0xa2700;
66
                    }
67
                    else memcpy(&sysi[0x38], &norword[0x406 + i * 5 + 2], 8);
68
                    memset(&sysi[0x40], 10, 0);
69
                    break;
70
                case 0x556e7443: // UntC
71
                    memcpy(&sysi[0xbc], &norword[0x406 + i * 5 + 1], 16);
72
                    break;
73
                case 0x52746341: // RtcA
74
                    if (norword[0x406 + i * 5 + 1] == 1)
75
                        sysiword[0x80] = norword[0x406 + i * 5 + 2];
76
                    break;
77
                case 0x42747279: // Btry
78
                    if (norword[0x406 + i * 5 + 1] == 1)
79
                        memcpy(&sysi[0x5c], &norword[0x406 + i * 5 + 2], 12);
80
                    break;
81
                case 0x5265676e: // Regn
82
                    if (nor[0x1018 + i * 0x14 + 4] == 1 && nor[0x1018 + i * 0x14 + 5] == 0)
83
                        memcpy(&sysi[0x92], &norword[0x406 + i * 5 + 2], 4);
84
                    break;
85
                case 0x4d6f6423: // Mod#
86
                    memcpy(&sysi[0x98], &norword[0x406 + i * 5 + 1], 16);
87
                    break;
88
                case 0x48774f31: // Hw01
89
                    memcpy(&sysi[0xa8], &norword[0x406 + i * 5 + 1], 16);
90
                    break;
91
                case 0x436f6e74: // Cont
92
                    if (nor[0x1018 + i * 0x14 + 4] == 0 && nor[0x1018 + i * 0x14 + 5] == 0)
93
                    {
94
                        sysi[0xb8] = nor[0x1018 + i * 0x14 + 6];
95
                        sysi[0xb9] = nor[0x1018 + i * 0x14 + 8];
96
                    }
97
                    break;
98
                case 0x426b4c74: // BkLt
99
                    if (nor[0x1018 + i * 0x14 + 4] == 0xaa && nor[0x1018 + i * 0x14 + 5] == 0x55)
100
                    {
101
                        sysi[0xba] = nor[0x1018 + i * 0x14 + 6];
102
                        sysi[0xbb] = nor[0x1018 + i * 0x14 + 8];
103
                    }
104
                    break;
105
                case 0x44726d56: // DrmV
106
                    memcpy(&sysi[0xce], &norword[0x406 + i * 5 + 1], 16);
107
                    break;
108
            }
109
        sysiword[2] = 0x646f5069;
110
        sysiword[3] = 0x36334e20;
111
        sysi[0x88] = 0x4e;
112
        sysi[0x89] = 0x41;
113
#ifdef TARGET_ipodclassic
114
        sysiword[0x38] = 0x4000000;
115
#else
116
        sysiword[0x38] = 0x2000000;
117
#endif
118
        sysiword[0x39] = 0x8000000;
119
        sysiword[0x3a] = 0x40000;
120
        sysiword[0x3b] = 0x22000000;
121
        sysiword[0x3c] = 0x100000;
122
        sysiword[0x3d] = 0x24000000;
123
        sysiword[0x4a] = 0x53797349;
124
        sysiword[0x4b] = 0x2203fdf0;
125
    }
126
*/
127
}