COMMON: Move ProDos disk parser from Immortal engine to Common

This commit is contained in:
Michael Hayman 2023-02-12 17:59:16 -05:00
parent f5b648de20
commit a845f0bb61
6 changed files with 11 additions and 13 deletions

View File

@ -4,6 +4,7 @@ MODULE_OBJS := \
iff_container.o \
ini-file.o \
json.o \
prodos.o \
quicktime.o \
winexe.o \
winexe_ne.o \

View File

@ -19,9 +19,9 @@
*
*/
#include "immortal/disk.h"
#include "common/formats/prodos.h"
namespace Immortal {
namespace Common {
// --- ProDOSFile methods ---
@ -427,4 +427,4 @@ Common::SeekableReadStream *ProDOSDisk::createReadStreamForMember(const Common::
return f->createReadStream();
}
} // namespace Immortal
} // Namespace Common

View File

@ -19,8 +19,8 @@
*
*/
#ifndef IMMORTAL_DISK_H
#define IMMORTAL_DISK_H
#ifndef COMMON_PRODOS_H
#define COMMON_PRODOS_H
#include "common/memstream.h"
#include "common/file.h"
@ -34,7 +34,7 @@
* matter for game engines anyway.
*/
namespace Immortal {
namespace Common {
// These values define for ProDOS how to read the file entry, and also whether it's a keyblock (if it is a directory header, it's the keyblock of that directory)
enum FileType : char {
@ -210,6 +210,6 @@ private:
};
} // namespace Immortal
} // Namespace Common
#endif

View File

@ -108,7 +108,7 @@ Common::ErrorCode ImmortalEngine::initDisks() {
if (SearchMan.hasFile("IMMORTAL.dsk")) {
// Instantiate the disk as an object. The disk will then open and parse itself
ProDOSDisk *diskBoot = new ProDOSDisk("IMMORTAL.dsk");
Common::ProDOSDisk *diskBoot = new Common::ProDOSDisk("IMMORTAL.dsk");
if (diskBoot) {
// With the disk successfully parsed, it can be added to the search manager
@ -122,7 +122,7 @@ Common::ErrorCode ImmortalEngine::initDisks() {
// Check for the gfx disk
if (SearchMan.hasFile("IMMORTAL_GFX.dsk")) {
ProDOSDisk *diskGFX = new ProDOSDisk("IMMORTAL_GFX.dsk");
Common::ProDOSDisk *diskGFX = new Common::ProDOSDisk("IMMORTAL_GFX.dsk");
if (diskGFX) {
debug("Gfx disk found");
SearchMan.add("IMMORTAL_GFX.dsk", diskGFX, 0, true);

View File

@ -37,9 +37,7 @@
// Detection is only needed by the main engine
#include "immortal/detection.h"
// Disk is only used by immortal.cpp
#include "immortal/disk.h"
#include "common/formats/prodos.h"
#include "common/debug-channels.h"
#include "common/events.h"
#include "common/scummsys.h"

View File

@ -5,7 +5,6 @@ MODULE_OBJS = \
compression.o \
cycle.o \
door.o \
disk.o \
drawChr.o \
flameSet.o \
immortal.o \