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

Contents of /branch/debug/0.X/0.9.X/0.9.7/r3113/fps2bios/intro/romdir.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 59 - (show annotations) (download)
Tue Sep 7 06:17:51 2010 UTC (10 years, 7 months ago) by william
File MIME type: text/plain
File size: 989 byte(s)
create working branch for pcsx2-0.9.7-r3113-debug
1 /***************************************************************
2 * romdir.c, based over Alex Lau (http://alexlau.8k.com) RomDir *
3 ****************************************************************/
4 #include "romdir.h"
5
6 struct romdir *romdirInit() {
7 u8 *mem;
8
9 for (mem=(u8*)0xbfc00000; (u32)mem<0xbfc01000; mem++) {
10 if (mem[0] == 'R' && mem[1] == 'E' &&
11 mem[2] == 'S' && mem[3] == 'E' &&
12 mem[4] == 'T')
13 break;
14 }
15 if ((u32)mem == 0xbfc01000) return NULL;
16
17 return (struct romdir*)mem;
18 }
19
20 struct rominfo *romdirGetFile(char *name, struct rominfo *ri) {
21 struct romdir *rd;
22 struct romdir *base;
23 int i;
24
25 base = romdirInit();
26 if (base == NULL) return NULL;
27
28 ri->fileOffset = 0;
29 for (rd = base; rd->fileName[0] != 0; rd++) {
30 for (i=0; i<10 && name[i] != 0; i++) {
31 if (rd->fileName[i] != name[i]) break;
32 }
33 if (rd->fileName[i] != name[i]) {
34 ri->fileOffset+= (rd->fileSize + 15) & ~0xF;
35 continue;
36 }
37
38 ri->fileSize = rd->fileSize;
39 return ri;
40 }
41
42 return NULL;
43 }

  ViewVC Help
Powered by ViewVC 1.1.22