aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/file_nes.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/scumm/file_nes.cpp')
-rw-r--r--engines/scumm/file_nes.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/engines/scumm/file_nes.cpp b/engines/scumm/file_nes.cpp
index 5403354830..d9d84f04ff 100644
--- a/engines/scumm/file_nes.cpp
+++ b/engines/scumm/file_nes.cpp
@@ -27,6 +27,7 @@
#include "common/debug.h"
#include "common/endian.h"
#include "common/md5.h"
+#include "common/memstream.h"
namespace Scumm {
@@ -47,10 +48,6 @@ struct ScummNESFile::ResourceGroup {
ScummNESFile::ScummNESFile() : _stream(0), _buf(0), _ROMset(kROMsetNum) {
}
-void ScummNESFile::setEnc(byte enc) {
- _stream->setEnc(enc);
-}
-
static const ScummNESFile::Resource res_roomgfx_usa[40] = {
{ 0x04001, 0x03C9 }, { 0x043CA, 0x069E }, { 0x04A68, 0x0327 }, { 0x04D8F, 0x053B }, { 0x052CA, 0x06BE },
{ 0x05988, 0x0682 }, { 0x0600A, 0x0778 }, { 0x06782, 0x0517 }, { 0x06C99, 0x07FB }, { 0x07494, 0x07BE },
@@ -1450,5 +1447,17 @@ bool ScummNESFile::openSubFile(const Common::String &filename) {
}
}
+uint32 ScummNESFile::read(void *dataPtr, uint32 dataSize) {
+ uint32 realLen = _stream->read(dataPtr, dataSize);
+
+ if (_encbyte) {
+ byte *p = (byte *)dataPtr;
+ byte *end = p + realLen;
+ while (p < end)
+ *p++ ^= _encbyte;
+ }
+
+ return realLen;
+}
} // End of namespace Scumm