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

Annotation of /branch/r3113_0.9.7_beta/fps2bios/kernel/romdir.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: 989 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 /***************************************************************
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