1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20  *
21  */
22 
23 #ifndef SKY_DISK_H
24 #define SKY_DISK_H
25 
26 
27 #include "common/scummsys.h"
28 #include "sky/rnc_deco.h"
29 
30 #define MAX_FILES_IN_LIST 60
31 
32 namespace Common {
33 class File;
34 }
35 
36 namespace Sky {
37 
38 class Disk {
39 public:
40 	Disk();
41 	~Disk();
42 
43 	uint8 *loadFile(uint16 fileNr);
44 	uint16 *loadScriptFile(uint16 fileNr);
45 	bool fileExists(uint16 fileNr);
46 
47 	uint32 determineGameVersion();
48 
49 	uint32 _lastLoadedFileSize;
50 
51 	void fnMiniLoad(uint16 fileNum);
52 	void fnCacheFast(uint16 *fList);
53 	void fnCacheChip(uint16 *fList);
54 	void fnCacheFiles();
55 	void fnFlushBuffers();
giveLoadedFilesList()56 	uint32 *giveLoadedFilesList() { return _loadedFilesList; }
57 	void refreshFilesList(uint32 *list);
58 
59 protected:
60 	uint8 *getFileInfo(uint16 fileNr);
61 	void dumpFile(uint16 fileNr);
62 
63 	uint32 _dinnerTableEntries;
64 	uint8 *_dinnerTableArea;
65 	Common::File *_dataDiskHandle;
66 	RncDecoder _rncDecoder;
67 
68 	uint16 _buildList[MAX_FILES_IN_LIST];
69 	uint32 _loadedFilesList[MAX_FILES_IN_LIST];
70 };
71 
72 } // End of namespace Sky
73 
74 #endif
75