diff options
author | Bertrand Augereau | 2011-11-17 18:21:34 +0100 |
---|---|---|
committer | Bertrand Augereau | 2011-11-17 18:31:17 +0100 |
commit | 088ec69949b60e6398a447c3b37fbb5064fa8d46 (patch) | |
tree | 112ed586b6c436b6f07ad1a7d33660f22fe324c7 /engines/dreamweb/stubs.cpp | |
parent | 6c51635bb268aef450d4819877e5bb4ee328557d (diff) | |
download | scummvm-rg350-088ec69949b60e6398a447c3b37fbb5064fa8d46.tar.gz scummvm-rg350-088ec69949b60e6398a447c3b37fbb5064fa8d46.tar.bz2 scummvm-rg350-088ec69949b60e6398a447c3b37fbb5064fa8d46.zip |
DREAMWEB: 'standardload' ported to C++
Diffstat (limited to 'engines/dreamweb/stubs.cpp')
-rw-r--r-- | engines/dreamweb/stubs.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp index 1a2943043c..c2dfa6644f 100644 --- a/engines/dreamweb/stubs.cpp +++ b/engines/dreamweb/stubs.cpp @@ -208,6 +208,20 @@ static Common::String getFilename(Context &context) { return Common::String(name); } +uint16 DreamGenContext::standardload(const char *fileName) { + engine->openFile(fileName); + engine->readFromFile(cs.ptr(kFileheader, kHeaderlen), kHeaderlen); + uint16 sizeInBytes = cs.word(kFiledata); + uint16 result = allocatemem((sizeInBytes + 15) / 16); + engine->readFromFile(segRef(result).ptr(0, 0), sizeInBytes); + engine->closeFile(); + return result; +} + +void DreamGenContext::standardload() { + ax = standardload((const char *)cs.ptr(dx, 0)); +} + void DreamGenContext::seecommandtail() { data.word(kSoundbaseadd) = 0x220; data.byte(kSoundint) = 5; |