/[pcsx2_0.9.7]/branch/debug/0.X/0.9.X/0.9.7/r3113/fps2bios/kernel/iopstart.c
ViewVC logotype

Contents of /branch/debug/0.X/0.9.X/0.9.7/r3113/fps2bios/kernel/iopstart.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 59 - (show annotations) (download)
Tue Sep 7 06:17:51 2010 UTC (10 years, 9 months ago) by william
File MIME type: text/plain
File size: 1352 byte(s)
create working branch for pcsx2-0.9.7-r3113-debug
1 #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