/[pcsx2_0.9.7]/branch/r3113_0.9.7_beta/fps2bios/kernel/iopstart.c
ViewVC logotype

Annotation of /branch/r3113_0.9.7_beta/fps2bios/kernel/iopstart.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 32 - (hide annotations) (download)
Tue Sep 7 03:29:01 2010 UTC (10 years, 10 months ago) by william
File MIME type: text/plain
File size: 1352 byte(s)
branching from upstream revision (http://pcsx2.googlecode.com/svn/trunk
): r3113 to
https://svn.netsolutions.dnsalias.com/websvn/ps2/pcsx2/pcsx2_0.9.7/branch/r3113_0.9.7_beta
1 william 31 #include <tamtypes.h>
2     #include "romdir.h"
3    
4     static void Kputc(u8 c) {
5     *((u8*)0x1f80380c) = c;
6     }
7    
8     static void Kputs(u8 *s) {
9     while (*s != 0) {
10     Kputc(*s++);
11     }
12     }
13    
14     static void Kmemcpy(void *dest, const void *src, int n) {
15     const u8 *s = (u8*)src;
16     u8 *d = (u8*)dest;
17    
18     while (n) {
19     *d++ = *s++; n--;
20     }
21     }
22    
23     static void _iopstart() {
24     struct rominfo ri;
25     u8 *str;
26    
27     // setup iop
28     *(char*)0xbf802070 = 9;
29     *(int*)0xfffe0130 = 0xcc4;
30     *(int*)0xfffe0130 = 0xcc0;
31     if( (*(int*)0xbf801450) & 8 )
32     *(int*)0xfffe0130 = 0x1e988;
33     else
34     *(int*)0xfffe0130 = 0x1edd8;
35    
36     romdirGetFile("ROMVER", &ri);
37     str = (u8*)(0xbfc00000 + ri.fileOffset);
38     Kputs("iopstart: fps2bios v");
39     Kputc(str[1]); Kputc('.'); Kputc(str[3]); Kputc('\n');
40    
41     // note, IOPBOOT has to be linked at location ri.fileOffset=0x600!!
42     romdirGetFile("IOPBOOT", &ri);
43    
44     Kputs("_iopstart: loading IOPBOOT to 0xbfc0a180\n");
45     //Kmemcpy((void*)0x80000000, (void*)(0xbfc00000 + ri.fileOffset), ri.fileSize);
46    
47     __asm__ (
48     "li $a0, 2\n" // 2Mb
49     "move $a1, $0\n"
50     "move $a2, $0\n"
51     "move $a3, $0\n"
52     "move $26, %0\n"
53     "jr $26\n"
54     "nop\n" : : "r"(0xbfc00000+ri.fileOffset));
55     for (;;);
56     }
57    
58     __asm__ (
59     ".global iopstart\n"
60     "iopstart:\n"
61     "li $sp, 0x001fffc0\n" // (2<<20)-0x40
62     "move $fp, $sp\n"
63     "j _iopstart\n"
64     "nop\n");
65    
66    

  ViewVC Help
Powered by ViewVC 1.1.22