diff options
author | Travis Howell | 2006-05-13 06:18:47 +0000 |
---|---|---|
committer | Travis Howell | 2006-05-13 06:18:47 +0000 |
commit | 9dfcea873919812a106080d2756c183b9c1d3952 (patch) | |
tree | 479fa92239c5dd958040fb169873cdfff115e0a6 /engines/simon/simon.cpp | |
parent | d6e39db09db28a4b074c59e282eb2a904ea7c5e8 (diff) | |
download | scummvm-rg350-9dfcea873919812a106080d2756c183b9c1d3952.tar.gz scummvm-rg350-9dfcea873919812a106080d2756c183b9c1d3952.tar.bz2 scummvm-rg350-9dfcea873919812a106080d2756c183b9c1d3952.zip |
Split VGA resource management back into FF and Simon 1/2 versions
svn-id: r22427
Diffstat (limited to 'engines/simon/simon.cpp')
-rw-r--r-- | engines/simon/simon.cpp | 94 |
1 files changed, 61 insertions, 33 deletions
diff --git a/engines/simon/simon.cpp b/engines/simon/simon.cpp index 73f6b34af0..c3bc5cd3ea 100644 --- a/engines/simon/simon.cpp +++ b/engines/simon/simon.cpp @@ -1339,20 +1339,31 @@ void SimonEngine::checkNoOverWrite(byte *end) { vpe = &_vgaBufferPointers[_noOverWrite]; - if (vpe->vgaFile1 < end && vpe->vgaFile1End > _vgaBufFreeStart) { - _rejectBlock = true; - _rejectCount++; - _vgaBufFreeStart = vpe->vgaFile1End; - } else if (vpe->vgaFile2 < end && vpe->vgaFile2End > _vgaBufFreeStart) { - _rejectBlock = true; - _rejectCount++; - _vgaBufFreeStart = vpe->vgaFile2End; - } else if (vpe->sfxFile && vpe->sfxFile < end && vpe->sfxFileEnd > _vgaBufFreeStart) { - _rejectBlock = true; - _rejectCount++; - _vgaBufFreeStart = vpe->sfxFileEnd; + if (getGameType() == GType_FF) { + if (vpe->vgaFile1 < end && vpe->vgaFile1End > _vgaBufFreeStart) { + _rejectBlock = true; + _rejectCount++; + _vgaBufFreeStart = vpe->vgaFile1End; + } else if (vpe->vgaFile2 < end && vpe->vgaFile2End > _vgaBufFreeStart) { + _rejectBlock = true; + _rejectCount++; + _vgaBufFreeStart = vpe->vgaFile2End; + } else if (vpe->sfxFile && vpe->sfxFile < end && vpe->sfxFileEnd > _vgaBufFreeStart) { + _rejectBlock = true; + _rejectCount++; + _vgaBufFreeStart = vpe->sfxFileEnd; + } else { + _rejectBlock = false; + } } else { - _rejectBlock = false; + if (_vgaBufFreeStart <= vpe->vgaFile1 && end >= vpe->vgaFile1 || + _vgaBufFreeStart <= vpe->vgaFile2 && end >= vpe->vgaFile2) { + _rejectBlock = true; + _rejectCount++; + _vgaBufFreeStart = vpe->vgaFile1 + 0x5000; + } else { + _rejectBlock = false; + } } } @@ -1375,17 +1386,27 @@ void SimonEngine::checkAnims(uint a, byte *end) { vpe = &_vgaBufferPointers[a]; - if (vpe->vgaFile1 < end && vpe->vgaFile1End > _vgaBufFreeStart) { - _rejectBlock = true; - _vgaBufFreeStart = vpe->vgaFile1End; - } else if (vpe->vgaFile2 < end && vpe->vgaFile2End > _vgaBufFreeStart) { - _rejectBlock = true; - _vgaBufFreeStart = vpe->vgaFile2End; - } else if (vpe->sfxFile && vpe->sfxFile < end && vpe->sfxFileEnd > _vgaBufFreeStart) { - _rejectBlock = true; - _vgaBufFreeStart = vpe->sfxFileEnd; + if (getGameType() == GType_FF) { + if (vpe->vgaFile1 < end && vpe->vgaFile1End > _vgaBufFreeStart) { + _rejectBlock = true; + _vgaBufFreeStart = vpe->vgaFile1End; + } else if (vpe->vgaFile2 < end && vpe->vgaFile2End > _vgaBufFreeStart) { + _rejectBlock = true; + _vgaBufFreeStart = vpe->vgaFile2End; + } else if (vpe->sfxFile && vpe->sfxFile < end && vpe->sfxFileEnd > _vgaBufFreeStart) { + _rejectBlock = true; + _vgaBufFreeStart = vpe->sfxFileEnd; + } else { + _rejectBlock = false; + } } else { - _rejectBlock = false; + if (_vgaBufFreeStart <= vpe->vgaFile1 && end >= vpe->vgaFile1 || + _vgaBufFreeStart <= vpe->vgaFile2 && end >= vpe->vgaFile2) { + _rejectBlock = true; + _vgaBufFreeStart = vpe->vgaFile1 + 0x5000; + } else { + _rejectBlock = false; + } } } @@ -1393,17 +1414,24 @@ void SimonEngine::checkZonePtrs(byte *end) { uint count = ARRAYSIZE(_vgaBufferPointers); VgaPointersEntry *vpe = _vgaBufferPointers; do { - if (vpe->vgaFile1 < end && vpe->vgaFile1End > _vgaBufFreeStart || - vpe->vgaFile2 < end && vpe->vgaFile2End > _vgaBufFreeStart || - vpe->sfxFile < end && vpe->sfxFileEnd > _vgaBufFreeStart) { - vpe->vgaFile1 = NULL; - vpe->vgaFile1End = NULL; - vpe->vgaFile2 = NULL; - vpe->vgaFile2End = NULL; - vpe->sfxFile = NULL; - vpe->sfxFileEnd = NULL; + if (getGameType() == GType_FF) { + if (vpe->vgaFile1 < end && vpe->vgaFile1End > _vgaBufFreeStart || + vpe->vgaFile2 < end && vpe->vgaFile2End > _vgaBufFreeStart || + vpe->sfxFile < end && vpe->sfxFileEnd > _vgaBufFreeStart) { + vpe->vgaFile1 = NULL; + vpe->vgaFile1End = NULL; + vpe->vgaFile2 = NULL; + vpe->vgaFile2End = NULL; + vpe->sfxFile = NULL; + vpe->sfxFileEnd = NULL; + } + } else { + if (_vgaBufFreeStart <= vpe->vgaFile1 && end >= vpe->vgaFile1 || + _vgaBufFreeStart <= vpe->vgaFile2 && end >= vpe->vgaFile2) { + vpe->vgaFile1 = NULL; + vpe->vgaFile2 = NULL; + } } - } while (++vpe, --count); } |