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

Contents of /branch/debug/0.X/0.9.X/0.9.7/r3113/fps2bios/loader/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, 9 months ago) by william
File MIME type: text/plain
File size: 1046 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 *base = NULL;
7
8 struct romdir *romdirInit() {
9 u8 *mem;
10
11 for (mem=(u8*)0xbfc00000; (u32)mem<0xbfc01000; mem++) {
12 if (mem[0] == 'R' && mem[1] == 'E' &&
13 mem[2] == 'S' && mem[3] == 'E' &&
14 mem[4] == 'T')
15 break;
16 }
17 if ((u32)mem == 0xbfc01000) return NULL;
18
19 return (struct romdir*)mem;
20 }
21
22 struct rominfo *romdirGetFile(char *name, struct rominfo *ri) {
23 struct romdir *rd;
24 // struct romdir *base;
25 int i;
26
27 if (base == NULL) {
28 base = romdirInit();
29 if (base == NULL) return NULL;
30 }
31
32 ri->fileOffset = 0;
33 for (rd = base; rd->fileName[0] != 0; rd++) {
34 for (i=0; i<10 && name[i] != 0; i++) {
35 if (rd->fileName[i] != name[i]) break;
36 }
37 if (rd->fileName[i] != name[i]) {
38 ri->fileOffset+= (rd->fileSize + 15) & ~0xF;
39 continue;
40 }
41
42 ri->fileSize = rd->fileSize;
43 return ri;
44 }
45
46 return NULL;
47 }

  ViewVC Help
Powered by ViewVC 1.1.22