diff options
Diffstat (limited to 'engines/scumm')
-rw-r--r-- | engines/scumm/actor.cpp | 10 | ||||
-rw-r--r-- | engines/scumm/charset.cpp | 2 | ||||
-rw-r--r-- | engines/scumm/costume.cpp | 20 | ||||
-rw-r--r-- | engines/scumm/costume.h | 2 | ||||
-rw-r--r-- | engines/scumm/cursor.cpp | 2 | ||||
-rw-r--r-- | engines/scumm/debugger.cpp | 10 | ||||
-rw-r--r-- | engines/scumm/gfx.cpp | 50 | ||||
-rw-r--r-- | engines/scumm/he/wiz_he.cpp | 2 | ||||
-rw-r--r-- | engines/scumm/input.cpp | 14 | ||||
-rw-r--r-- | engines/scumm/object.cpp | 2 | ||||
-rw-r--r-- | engines/scumm/palette.cpp | 4 | ||||
-rw-r--r-- | engines/scumm/player_pce.cpp | 150 | ||||
-rw-r--r-- | engines/scumm/player_pce.h | 4 | ||||
-rw-r--r-- | engines/scumm/player_sid.h | 6 | ||||
-rw-r--r-- | engines/scumm/player_v2.h | 26 | ||||
-rw-r--r-- | engines/scumm/player_v2cms.cpp | 154 | ||||
-rw-r--r-- | engines/scumm/player_v4a.cpp | 10 | ||||
-rw-r--r-- | engines/scumm/player_v4a.h | 2 | ||||
-rw-r--r-- | engines/scumm/script_v0.cpp | 14 | ||||
-rw-r--r-- | engines/scumm/script_v6.cpp | 4 | ||||
-rw-r--r-- | engines/scumm/scumm.cpp | 2 | ||||
-rw-r--r-- | engines/scumm/scumm.h | 4 | ||||
-rw-r--r-- | engines/scumm/sound.cpp | 4 | ||||
-rw-r--r-- | engines/scumm/verbs.cpp | 34 |
24 files changed, 266 insertions, 266 deletions
diff --git a/engines/scumm/actor.cpp b/engines/scumm/actor.cpp index 0ebe378996..bb3617f8b2 100644 --- a/engines/scumm/actor.cpp +++ b/engines/scumm/actor.cpp @@ -528,11 +528,11 @@ void Actor_v2::walkActor() { new_dir = updateActorDirection(false); // FIXME: is this correct? if (_facing != new_dir) { - + // Actor never stops walking when an object has been selected without this if (_vm->_game.version ==0) _moving = 0; - + setDirection(new_dir); } else @@ -572,9 +572,9 @@ void Actor_v2::walkActor() { _walkdata.curbox = next_box; - // WORKAROUND: The route of the meteor landing in the introduction isn't correct. + // WORKAROUND: The route of the meteor landing in the introduction isn't correct. // MM V0 in contrast to MM V2 uses two walkboxes instead of just one. Hence a route - // from walkbox 1 to 0 is calculated first. This causes the meteor to fly on a + // from walkbox 1 to 0 is calculated first. This causes the meteor to fly on a // horizontal line to walkbox 0 then vertically to the ground. // To fix this problem, the box-to-box routing has been disabled in room 33. if (_vm->_game.version == 0 && _vm->_currentRoom == 33) { @@ -1444,7 +1444,7 @@ void ScummEngine::processActors() { Actor** end = _sortedActors + numactors; for (Actor** ac = _sortedActors; ac != end; ++ac) { Actor* a = *ac; - + // V0 MM: 0x057B if (_game.version == 0) { ActorC64 *A = (ActorC64*) a; diff --git a/engines/scumm/charset.cpp b/engines/scumm/charset.cpp index f4e2f74c43..cf1c18b4f1 100644 --- a/engines/scumm/charset.cpp +++ b/engines/scumm/charset.cpp @@ -76,7 +76,7 @@ void ScummEngine::loadCJKFont() { } else { _useCJKMode = true; debug(2, "Loading PC-Engine System Card"); - + // A 0x200 byte header can be present at the beginning of the syscard. Seek past it too. fp.seek((fp.size() & 0x200) ? 0x30200 : 0x30000); diff --git a/engines/scumm/costume.cpp b/engines/scumm/costume.cpp index 9bf4ee0cdc..caa348460f 100644 --- a/engines/scumm/costume.cpp +++ b/engines/scumm/costume.cpp @@ -652,8 +652,8 @@ void ClassicCostumeRenderer::procPCEngine(Codec1 &v1) { maskbit = revBitMask((v1.x + xPos) % 8); pcolor = block[row][col]; - masked = (v1.y + yPos < 0 || v1.y + yPos >= _out.h) || - (v1.x + xPos < 0 || v1.x + xPos >= _out.w) || + masked = (v1.y + yPos < 0 || v1.y + yPos >= _out.h) || + (v1.x + xPos < 0 || v1.x + xPos >= _out.w) || (v1.mask_ptr && (mask[0] & maskbit)); if (pcolor && !masked) { @@ -1178,7 +1178,7 @@ byte C64CostumeRenderer::drawLimb(const Actor *a, int limb) { _draw_top = 200; _draw_bottom = 0; } - + bool flipped = (a->_cost.start[limb] & 0x80) != 0; byte frameStart = _loaded._frameOffsets[a->_cost.frame[limb]]; byte frame = _loaded._frameOffsets[frameStart + a->_cost.curpos[limb]]; @@ -1297,7 +1297,7 @@ void C64CostumeLoader::frameUpdate(ActorC64 *a, int cmd ) { for (int limb = 0, pos = 0; limb < 8; ++limb, pos = 0) { // get a limb frames ptr from the costume command limbFrames = ((_animCmds + cmd)[limb]); - + // Dont change limb if entry is invalid if (limbFrames == 0xFF) continue; @@ -1320,13 +1320,13 @@ void C64CostumeLoader::frameUpdate(ActorC64 *a, int cmd ) { // Each animation-frame until we find end if (frame == 0xFF) break; - + byte ptrLow = _baseptr[frame]; byte ptrHigh = ptrLow + _dataOffsets[4]; int frameOffset = (_baseptr[ptrHigh] << 8) + _baseptr[ptrLow + 2]; // 0x23EF / 0x2400 const byte *data = _baseptr + frameOffset; - + if (data[3] > _maxHeight) _maxHeight = data[3] + 1; @@ -1367,8 +1367,8 @@ void C64CostumeLoader::costumeDecodeData(Actor *a, int frame, uint usemask) { ActorC64 *A = (ActorC64 *)a; int dir = newDirToOldDir(a->getFacing()); int command = dir; - - loadCostume(a->_costume); + + loadCostume(a->_costume); // Enable/Disable speaking flag if (frame == a->_talkStartFrame) { @@ -1382,7 +1382,7 @@ void C64CostumeLoader::costumeDecodeData(Actor *a, int frame, uint usemask) { // Different command for stand frame if (frame == a->_standFrame) - command = dirToDirStop(dir); + command = dirToDirStop(dir); // Update the limb frames frameUpdate(A, command); @@ -1403,7 +1403,7 @@ void C64CostumeLoader::costumeDecodeData(Actor *a, int frame, uint usemask) { byte C64CostumeLoader::increaseAnims(Actor *a) { ActorC64 *A = (ActorC64 *)a; - + // check if the actor speak flag has changed since last frame increase if (A->_speaking != A->_speakingPrev) { int cmd = A->_costCommand; diff --git a/engines/scumm/costume.h b/engines/scumm/costume.h index c9f2586087..b72ac6d282 100644 --- a/engines/scumm/costume.h +++ b/engines/scumm/costume.h @@ -84,7 +84,7 @@ protected: void actorSpeak(ActorC64 *a, int &cmd); int dirToDirStop(int oldDir); void frameUpdate(ActorC64 *A, int cmd); - + }; class ClassicCostumeRenderer : public BaseCostumeRenderer { diff --git a/engines/scumm/cursor.cpp b/engines/scumm/cursor.cpp index fd8aac42e7..5b210f9af6 100644 --- a/engines/scumm/cursor.cpp +++ b/engines/scumm/cursor.cpp @@ -179,7 +179,7 @@ void ScummEngine_v70he::setDefaultCursor() { static const byte palette[] = {0, 0, 0, 0, 0xff, 0xff, 0xff, 0, 0, 0, 0, 0}; - + if (_bytesPerPixel == 2) { for (i = 0; i < 1024; i++) WRITE_UINT16(_grabbedCursor + i * 2, 5); diff --git a/engines/scumm/debugger.cpp b/engines/scumm/debugger.cpp index cc3614805b..0adc05d662 100644 --- a/engines/scumm/debugger.cpp +++ b/engines/scumm/debugger.cpp @@ -858,17 +858,17 @@ bool ScummDebugger::Cmd_Passcode(int argc, const char **argv) { int args[16]; memset(args, 0, sizeof(args)); args[0] = _vm->_bootParam; - + _vm->runScript(61, 0, 0, args); - + if (_vm->_bootParam != _vm->_scummVars[411]){ DebugPrintf("Invalid Passcode\n"); return true; } - - _vm->_bootParam = 0; + + _vm->_bootParam = 0; _detach_now = true; - + } else { DebugPrintf("Use 'passcode <SEGA CD Passcode>'\n"); return true; diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp index 8a6a831258..3e49fd0afe 100644 --- a/engines/scumm/gfx.cpp +++ b/engines/scumm/gfx.cpp @@ -731,7 +731,7 @@ void ScummEngine::drawStripToScreen(VirtScreen *vs, int x, int width, int top, i // HACK: In this way we won't get a screen with dirty side strips when // loading a narrow room in a full screen room. - if (width == 224 && height == 240 && x == 16) { + if (width == 224 && height == 240 && x == 16) { char blackbuf[16 * 240]; memset(blackbuf, 0, 16 * 240); // Prepare a buffer 16px wide and 240px high, to fit on a lateral strip @@ -2645,7 +2645,7 @@ void readOffsetTable(const byte *ptr, uint16 **table, int *count) { for (int i = 0; i < *count; i++) { (*table)[i] = READ_LE_UINT16(ptr + pos) + pos + 2; pos += 2; - } + } } void decodeTileColor(byte cmd, byte *colors, int *rowIndex, int numRows) { @@ -2657,7 +2657,7 @@ void decodeTileColor(byte cmd, byte *colors, int *rowIndex, int numRows) { void GdiPCEngine::decodeStrip(const byte *ptr, uint16 *tiles, byte *colors, uint16 *masks, int numRows, bool isObject) { int loopCnt; uint16 lastTileData; - + /* * read tiles indices */ @@ -2670,34 +2670,34 @@ void GdiPCEngine::decodeStrip(const byte *ptr, uint16 *tiles, byte *colors, uint tiles[numRows - 1] = 0; loopCnt = numRows - 1; } - + while (true) { uint16 cmd = READ_LE_UINT16(ptr); ptr += 2; if (cmd & 0x8000) { tiles[rowIndex - 1] = cmd & 0x0FFF; } else if (cmd & 0x4000) { - tiles[numRows - 1] = cmd & 0x0FFF; + tiles[numRows - 1] = cmd & 0x0FFF; } else { tiles[rowIndex++] = cmd; lastTileData = cmd; break; } - } - + } + while (rowIndex < loopCnt) { byte cmd = *ptr++; int cnt = cmd & 0x1F; - + if (cmd & 0x80) { for (int i = 0; i < cnt; ++i) { tiles[rowIndex++] = lastTileData; - } + } } else if (cmd & 0x40) { for (int i = 0; i < cnt; ++i) { ++lastTileData; tiles[rowIndex++] = lastTileData; - } + } } else { for (int i = 0; i < cnt; ++i) { lastTileData = READ_LE_UINT16(ptr); @@ -2710,8 +2710,8 @@ void GdiPCEngine::decodeStrip(const byte *ptr, uint16 *tiles, byte *colors, uint /* * read palette data */ - - rowIndex = 0; + + rowIndex = 0; byte cmd = *ptr++; if (cmd == 0xFE) { while (rowIndex < numRows) { @@ -2736,11 +2736,11 @@ void GdiPCEngine::decodeStrip(const byte *ptr, uint16 *tiles, byte *colors, uint } } } - + /* * read mask indices */ - + if (_distaff || _PCE.maskIDSize == 0 || numRows > 18) { return; } @@ -2770,7 +2770,7 @@ void GdiPCEngine::decodeStrip(const byte *ptr, uint16 *tiles, byte *colors, uint masks[rowIndex++] = READ_LE_UINT16(ptr); ptr += 2; } - } + } } } } @@ -2787,14 +2787,14 @@ void GdiPCEngine::decodePCEngineGfx(const byte *room) { int numRows = *smap_ptr++; _PCE.maskIDSize = *smap_ptr++; *smap_ptr++; // unknown - + memset(_PCE.nametable, 0, sizeof(_PCE.nametable)); memset(_PCE.colortable, 0, sizeof(_PCE.colortable)); readOffsetTable(smap_ptr, &stripOffsets, &numStrips); for (int i = 0; i < numStrips; ++i) { - const byte *tilePtr = smap_ptr + stripOffsets[i]; - decodeStrip(tilePtr, - &_PCE.nametable[i * numRows], + const byte *tilePtr = smap_ptr + stripOffsets[i]; + decodeStrip(tilePtr, + &_PCE.nametable[i * numRows], &_PCE.colortable[i * numRows], &_PCE.masktable[i * numRows], numRows, @@ -2813,10 +2813,10 @@ void GdiPCEngine::decodePCEngineObject(const byte *ptr, int xpos, int ypos, int readOffsetTable(ptr, &stripOffsets, &numStrips); for (int i = 0; i < numStrips; ++i) { const byte *tilePtr = ptr + stripOffsets[i]; - decodeStrip(tilePtr, - &_PCE.nametableObj[i * numRows], - &_PCE.colortableObj[i * numRows], - &_PCE.masktableObj[i * numRows], + decodeStrip(tilePtr, + &_PCE.nametableObj[i * numRows], + &_PCE.colortableObj[i * numRows], + &_PCE.masktableObj[i * numRows], numRows, true); } @@ -2831,7 +2831,7 @@ void setTileData(byte *tile, int index, byte byte0, byte byte1) { plane02Bit = (byte0 >> (7-col)) & 0x1; // plane=0: bit0, plane=2: bit2 plane13Bit = (byte1 >> (7-col)) & 0x1; // plane=0: bit1, plane=2: bit3 tile[row * 8 + col] |= plane02Bit << (plane + 0); - tile[row * 8 + col] |= plane13Bit << (plane + 1); + tile[row * 8 + col] |= plane13Bit << (plane + 1); } } @@ -2842,7 +2842,7 @@ void GdiPCEngine::decodePCEngineTileData(const byte *ptr) { byte byte0, byte1; readOffsetTable(ptr, &tileOffsets, &_PCE.numTiles); - + if (_distaff) { free(_PCE.staffTiles); _PCE.staffTiles = (byte*)calloc(_PCE.numTiles * 8 * 8, sizeof(byte)); diff --git a/engines/scumm/he/wiz_he.cpp b/engines/scumm/he/wiz_he.cpp index d5513262ee..1ac7e98689 100644 --- a/engines/scumm/he/wiz_he.cpp +++ b/engines/scumm/he/wiz_he.cpp @@ -1473,7 +1473,7 @@ uint8 *Wiz::drawWizImage(int resNum, int state, int maskNum, int maskState, int mask = _vm->findWrappedBlock(MKID_BE('WIZD'), maskPtr, maskState, 0); assert(mask); - } + } if (flags & kWIFHasPalette) { uint8 *pal = _vm->findWrappedBlock(MKID_BE('RGBS'), dataPtr, state, 0); diff --git a/engines/scumm/input.cpp b/engines/scumm/input.cpp index 7e142921f8..5e3f9fefeb 100644 --- a/engines/scumm/input.cpp +++ b/engines/scumm/input.cpp @@ -597,16 +597,16 @@ void ScummEngine::processKeyboard(Common::KeyState lastKeyHit) { // the menu screen. switch (lastKeyHit.keycode) { case Common::KEYCODE_UP: - _mouseAndKeyboardStat = 328; + _mouseAndKeyboardStat = 328; break; - case Common::KEYCODE_DOWN: - _mouseAndKeyboardStat = 336; + case Common::KEYCODE_DOWN: + _mouseAndKeyboardStat = 336; break; - case Common::KEYCODE_LEFT: - _mouseAndKeyboardStat = 331; + case Common::KEYCODE_LEFT: + _mouseAndKeyboardStat = 331; break; - case Common::KEYCODE_RIGHT: - _mouseAndKeyboardStat = 333; + case Common::KEYCODE_RIGHT: + _mouseAndKeyboardStat = 333; break; default: break; diff --git a/engines/scumm/object.cpp b/engines/scumm/object.cpp index 43143a0187..c6ac53b862 100644 --- a/engines/scumm/object.cpp +++ b/engines/scumm/object.cpp @@ -326,7 +326,7 @@ int ScummEngine::whereIsObjectInventory(int object) { _v0ObjectInInventory = true; res = whereIsObject(object); _v0ObjectInInventory = false; - + return res; } diff --git a/engines/scumm/palette.cpp b/engines/scumm/palette.cpp index 8be707c281..ed61f9ab3b 100644 --- a/engines/scumm/palette.cpp +++ b/engines/scumm/palette.cpp @@ -245,12 +245,12 @@ void ScummEngine::setPCEPaletteFromPtr(const byte *ptr) { byte charsetR, charsetG, charsetB; int paletteOffset = *ptr++; - int numPalettes = *ptr++; + int numPalettes = *ptr++; int firstIndex = paletteOffset * 16; int numcolor = numPalettes * 16; - // the only color over which a background sprite + // the only color over which a background sprite // (bit 7 of the sprite attributes) will be visible colorPCEToRGB(READ_LE_UINT16(ptr), &bgSpriteR, &bgSpriteG, &bgSpriteB); ptr += 2; diff --git a/engines/scumm/player_pce.cpp b/engines/scumm/player_pce.cpp index bd0a358c3e..4c7f2980bc 100644 --- a/engines/scumm/player_pce.cpp +++ b/engines/scumm/player_pce.cpp @@ -60,19 +60,19 @@ static const byte wave_table[7][32] = { 0x10, 0x1C, 0x1D, 0x1E, 0x1E, 0x1F, 0x1F, 0x1E, 0x1C, 0x1E, 0x1F, 0x1F, 0x1E, 0x1E, 0x1D, 0x1C, 0x10, 0x03, 0x02, 0x01, 0x01, 0x00, 0x00, 0x01, 0x03, 0x01, 0x00, 0x00, 0x01, 0x01, 0x02, 0x03, }, { // square - 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, + 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, }, { // triangle - 0x10, 0x0C, 0x08, 0x04, 0x01, 0x04, 0x08, 0x0C, 0x10, 0x14, 0x18, 0x1C, 0x1F, 0x1C, 0x18, 0x14, - 0x10, 0x0C, 0x08, 0x04, 0x01, 0x04, 0x08, 0x0C, 0x10, 0x14, 0x18, 0x1C, 0x1F, 0x1C, 0x18, 0x14, + 0x10, 0x0C, 0x08, 0x04, 0x01, 0x04, 0x08, 0x0C, 0x10, 0x14, 0x18, 0x1C, 0x1F, 0x1C, 0x18, 0x14, + 0x10, 0x0C, 0x08, 0x04, 0x01, 0x04, 0x08, 0x0C, 0x10, 0x14, 0x18, 0x1C, 0x1F, 0x1C, 0x18, 0x14, }, { // saw-tooth 0x00, 0x01, 0x02, 0x03, 0x04, 0x06, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, }, { // sigmoid - 0x07, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x1F, 0x1F, 0x1E, 0x1D, 0x1C, 0x1B, 0x1A, 0x19, + 0x07, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x1F, 0x1F, 0x1E, 0x1D, 0x1C, 0x1B, 0x1A, 0x19, 0x08, 0x06, 0x05, 0x03, 0x02, 0x01, 0x00, 0x00, 0x0F, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x16, }, { // MW-shaped - 0x1F, 0x1E, 0x1D, 0x1D, 0x1C, 0x1A, 0x17, 0x0F, 0x0F, 0x17, 0x1A, 0x1C, 0x1D, 0x1D, 0x1E, 0x1F, + 0x1F, 0x1E, 0x1D, 0x1D, 0x1C, 0x1A, 0x17, 0x0F, 0x0F, 0x17, 0x1A, 0x1C, 0x1D, 0x1D, 0x1E, 0x1F, 0x00, 0x01, 0x02, 0x02, 0x03, 0x05, 0x08, 0x0F, 0x0F, 0x08, 0x05, 0x03, 0x02, 0x02, 0x01, 0x00 } }; @@ -84,19 +84,19 @@ static const int control_offsets[14] = { // AED8 static const byte control_data[205] = { - /* 0*/ 0xF0, 0x00, 0xF8, 0x01, 0x00, 0x00, 0xFF, - /* 7*/ 0xF0, 0x00, 0xF8, 0x01, 0x00, 0x00, 0x01, 0x00, 0xF0, 0x3A, 0x00, 0xFD, 0xFF, + /* 0*/ 0xF0, 0x00, 0xF8, 0x01, 0x00, 0x00, 0xFF, + /* 7*/ 0xF0, 0x00, 0xF8, 0x01, 0x00, 0x00, 0x01, 0x00, 0xF0, 0x3A, 0x00, 0xFD, 0xFF, /* 20*/ 0xF0, 0x00, 0xF8, 0x01, 0x00, 0x00, 0x01, 0x00, 0xF0, 0x1D, 0x00, 0xF8, 0xFF, /* 33*/ 0xF0, 0x00, 0xF8, 0x01, 0x00, 0x00, 0x02, 0x00, 0xF0, 0x1E, 0x00, 0xFC, 0xFF, - /* 46*/ 0xF0, 0x00, 0xF8, 0x01, 0x00, 0x00, 0x07, 0x00, 0xE0, 0xFF, + /* 46*/ 0xF0, 0x00, 0xF8, 0x01, 0x00, 0x00, 0x07, 0x00, 0xE0, 0xFF, /* 56*/ 0xF0, 0x00, 0xF8, 0x01, 0x00, 0x00, 0x01, 0x00, 0xD8, 0xF0, 0x00, 0xD8, 0x01, 0x00, 0x00, 0x04, 0x00, 0xF0, 0xFF, /* 75*/ 0xF0, 0x00, 0xF8, 0x01, 0x00, 0x00, 0x03, 0x00, 0xF8, 0x6E, 0x00, 0xFF, 0xFF, - /* 88*/ 0xF0, 0x00, 0xF8, 0x01, 0x00, 0x00, 0x08, 0x00, 0xF0, 0xF0, 0x00, 0xD0, 0x01, 0x00, 0x00, 0x05, 0x00, 0xF0, 0xF0, 0x00, 0xB8, 0xE6, 0x80, 0xFF, 0xE6, 0x80, 0xFF, 0xFF, - /*116*/ 0xF0, 0x00, 0xF8, 0x01, 0x00, 0x00, 0x05, 0x00, 0xD0, 0xFF, - /*126*/ 0xF0, 0x00, 0xF8, 0x01, 0x00, 0x00, 0x04, 0x00, 0xF8, 0xFF, - /*136*/ 0xF0, 0x00, 0xF8, 0x01, 0x00, 0x00, 0x03, 0x00, 0xF4, 0xE6, 0xC0, 0xFF, 0xE6, 0xC0, 0xFF, 0xFF, - /*152*/ 0xF0, 0x00, 0xD0, 0x01, 0x00, 0x00, 0x02, 0x00, 0x10, 0x0E, 0x00, 0xFE, 0xFF, - /*165*/ 0xF0, 0x00, 0xA8, 0x01, 0x00, 0x00, 0x18, 0x00, 0x02, 0xE6, 0x80, 0xFE, 0xE6, 0xC0, 0xFF, 0xFF, + /* 88*/ 0xF0, 0x00, 0xF8, 0x01, 0x00, 0x00, 0x08, 0x00, 0xF0, 0xF0, 0x00, 0xD0, 0x01, 0x00, 0x00, 0x05, 0x00, 0xF0, 0xF0, 0x00, 0xB8, 0xE6, 0x80, 0xFF, 0xE6, 0x80, 0xFF, 0xFF, + /*116*/ 0xF0, 0x00, 0xF8, 0x01, 0x00, 0x00, 0x05, 0x00, 0xD0, 0xFF, + /*126*/ 0xF0, 0x00, 0xF8, 0x01, 0x00, 0x00, 0x04, 0x00, 0xF8, 0xFF, + /*136*/ 0xF0, 0x00, 0xF8, 0x01, 0x00, 0x00, 0x03, 0x00, 0xF4, 0xE6, 0xC0, 0xFF, 0xE6, 0xC0, 0xFF, 0xFF, + /*152*/ 0xF0, 0x00, 0xD0, 0x01, 0x00, 0x00, 0x02, 0x00, 0x10, 0x0E, 0x00, 0xFE, 0xFF, + /*165*/ 0xF0, 0x00, 0xA8, 0x01, 0x00, 0x00, 0x18, 0x00, 0x02, 0xE6, 0x80, 0xFE, 0xE6, 0xC0, 0xFF, 0xFF, /*181*/ 0xF0, 0x00, 0xF8, 0x01, 0x00, 0x00, 0x02, 0x00, 0xF8, 0x02, 0x00, 0x00, 0x02, 0x00, 0xF0, 0x01, 0x00, 0xF8, 0x02, 0x00, 0x08, 0xF1, 0x99, 0xAF }; @@ -120,8 +120,8 @@ static const uint16 freq_offset[3] = { }; static const uint16 freq_table[] = { - 0x0000, 0x0800, - 0xFFB0, 0xFFD1, 0xFFE8, 0xFFF1, 0x0005, 0x0000, 0x0800, + 0x0000, 0x0800, + 0xFFB0, 0xFFD1, 0xFFE8, 0xFFF1, 0x0005, 0x0000, 0x0800, 0xFF9C, 0xFFD8, 0x0000, 0x000F, 0x0005, 0x0000, 0x0800 }; @@ -130,7 +130,7 @@ static const int sound_table[13] = { }; // 0xAE12 -// Note: +// Note: // - offsets relative to data_table // - byte one of each sound was always 0x3F (= use all channels) -> removed from table static const uint16 sounds[13][6] = { @@ -158,63 +158,63 @@ static const byte data_table[482] = { 0xF2, 0xB2, 0xE1, 0x08, 0xF2, 0xF2, 0xB2, 0xE1, 0x09, 0xF2, 0xF2, 0xB2, 0xE1, 0x0A, 0xF2, 0xF2, 0xB2, 0xE1, 0x0B, 0xF2, 0xF2, 0xB2, 0xE1, 0x0C, 0xF2, 0xF2, 0xB2, 0xE1, 0x0D, 0xF2, 0xF2, 0xB2, 0xFF, 0xD1, 0x03, 0xF3, - /* 84*/ 0xFF, - + /* 84*/ 0xFF, + /* 85*/ 0xE2, 0x0C, 0xE1, 0x02, 0xE0, 0x0F, 0xE6, 0xED, 0xD3, 0x07, 0xFF, - /* 96*/ 0xE2, 0x06, 0xE1, 0x02, 0xE0, 0x0F, 0xE6, 0xED, 0xD4, 0xF0, 0x0C, 0x07, 0xFF, - /*109*/ 0xFF, - - /*110*/ 0xE2, 0x0C, 0xE1, 0x02, 0xE0, 0x0F, 0xE6, 0xED, 0xD3, 0x27, 0xFF, - /*121*/ 0xE2, 0x06, 0xE1, 0x02, 0xE0, 0x0F, 0xE6, 0xED, 0xD4, 0xF0, 0x0C, 0x27, 0xFF, - /*134*/ 0xFF, - - /*135*/ 0xE2, 0x0C, 0xE1, 0x02, 0xE0, 0x0F, 0xE6, 0xED, 0xD3, 0x47, 0xFF, - /*146*/ 0xE2, 0x06, 0xE1, 0x02, 0xE0, 0x0F, 0xE6, 0xED, 0xD4, 0xF0, 0x0C, 0x47, 0xFF, - /*159*/ 0xFF, - - /*160*/ 0xE2, 0x0C, 0xE1, 0x02, 0xE0, 0x0F, 0xE6, 0xED, 0xD3, 0x57, 0xFF, - /*171*/ 0xE2, 0x06, 0xE1, 0x02, 0xE0, 0x0F, 0xE6, 0xED, 0xD4, 0xF0, 0x0C, 0x57, 0xFF, - /*184*/ 0xFF, - - /*185*/ 0xE2, 0x0C, 0xE1, 0x02, 0xE0, 0x0F, 0xE6, 0xED, 0xD3, 0x77, 0xFF, - /*196*/ 0xE2, 0x06, 0xE1, 0x02, 0xE0, 0x0F, 0xE6, 0xED, 0xD4, 0xF0, 0x0C, 0x77, 0xFF, - /*209*/ 0xFF, - - /*210*/ 0xE2, 0x0C, 0xE1, 0x02, 0xE0, 0x0F, 0xE6, 0xED, 0xD3, 0x97, 0xFF, - /*221*/ 0xE2, 0x06, 0xE1, 0x02, 0xE0, 0x0F, 0xE6, 0xED, 0xD4, 0xF0, 0x0C, 0x97, 0xFF, - /*234*/ 0xFF, - - /*235*/ 0xE2, 0x0C, 0xE1, 0x02, 0xE0, 0x0F, 0xE6, 0xED, 0xD3, 0xB7, 0xFF, - /*246*/ 0xE2, 0x06, 0xE1, 0x02, 0xE0, 0x0F, 0xE6, 0xED, 0xD4, 0xF0, 0x0C, 0xB7, 0xFF, - /*259*/ 0xFF, - - /*260*/ 0xE2, 0x0C, 0xE1, 0x02, 0xE0, 0x0F, 0xE6, 0xED, 0xD4, 0x07, 0xFF, - /*271*/ 0xE2, 0x06, 0xE1, 0x02, 0xE0, 0x0F, 0xE6, 0xED, 0xD5, 0xF0, 0x0C, 0x07, 0xFF, - /*284*/ 0xFF, - - /*285*/ 0xE2, 0x0B, 0xE1, 0x04, 0xE6, 0xED, 0xE0, 0x0A, 0xD0, 0xDB, 0x14, 0x0E, 0xFF, - /*298*/ 0xE2, 0x0B, 0xE1, 0x04, 0xE6, 0xED, 0xE0, 0x0A, 0xD0, 0xDB, 0x32, 0x1E, 0xFF, + /* 96*/ 0xE2, 0x06, 0xE1, 0x02, 0xE0, 0x0F, 0xE6, 0xED, 0xD4, 0xF0, 0x0C, 0x07, 0xFF, + /*109*/ 0xFF, + + /*110*/ 0xE2, 0x0C, 0xE1, 0x02, 0xE0, 0x0F, 0xE6, 0xED, 0xD3, 0x27, 0xFF, + /*121*/ 0xE2, 0x06, 0xE1, 0x02, 0xE0, 0x0F, 0xE6, 0xED, 0xD4, 0xF0, 0x0C, 0x27, 0xFF, + /*134*/ 0xFF, + + /*135*/ 0xE2, 0x0C, 0xE1, 0x02, 0xE0, 0x0F, 0xE6, 0xED, 0xD3, 0x47, 0xFF, + /*146*/ 0xE2, 0x06, 0xE1, 0x02, 0xE0, 0x0F, 0xE6, 0xED, 0xD4, 0xF0, 0x0C, 0x47, 0xFF, + /*159*/ 0xFF, + + /*160*/ 0xE2, 0x0C, 0xE1, 0x02, 0xE0, 0x0F, 0xE6, 0xED, 0xD3, 0x57, 0xFF, + /*171*/ 0xE2, 0x06, 0xE1, 0x02, 0xE0, 0x0F, 0xE6, 0xED, 0xD4, 0xF0, 0x0C, 0x57, 0xFF, + /*184*/ 0xFF, + + /*185*/ 0xE2, 0x0C, 0xE1, 0x02, 0xE0, 0x0F, 0xE6, 0xED, 0xD3, 0x77, 0xFF, + /*196*/ 0xE2, 0x06, 0xE1, 0x02, 0xE0, 0x0F, 0xE6, 0xED, 0xD4, 0xF0, 0x0C, 0x77, 0xFF, + /*209*/ 0xFF, + + /*210*/ 0xE2, 0x0C, 0xE1, 0x02, 0xE0, 0x0F, 0xE6, 0xED, 0xD3, 0x97, 0xFF, + /*221*/ 0xE2, 0x06, 0xE1, 0x02, 0xE0, 0x0F, 0xE6, 0xED, 0xD4, 0xF0, 0x0C, 0x97, 0xFF, + /*234*/ 0xFF, + + /*235*/ 0xE2, 0x0C, 0xE1, 0x02, 0xE0, 0x0F, 0xE6, 0xED, 0xD3, 0xB7, 0xFF, + /*246*/ 0xE2, 0x06, 0xE1, 0x02, 0xE0, 0x0F, 0xE6, 0xED, 0xD4, 0xF0, 0x0C, 0xB7, 0xFF, + /*259*/ 0xFF, + + /*260*/ 0xE2, 0x0C, 0xE1, 0x02, 0xE0, 0x0F, 0xE6, 0xED, 0xD4, 0x07, 0xFF, + /*271*/ 0xE2, 0x06, 0xE1, 0x02, 0xE0, 0x0F, 0xE6, 0xED, 0xD5, 0xF0, 0x0C, 0x07, 0xFF, + /*284*/ 0xFF, + + /*285*/ 0xE2, 0x0B, 0xE1, 0x04, 0xE6, 0xED, 0xE0, 0x0A, 0xD0, 0xDB, 0x14, 0x0E, 0xFF, + /*298*/ 0xE2, 0x0B, 0xE1, 0x04, 0xE6, 0xED, 0xE0, 0x0A, 0xD0, 0xDB, 0x32, 0x1E, 0xFF, /*311*/ 0xE2, 0x0B, 0xE1, 0x0B, 0xE6, 0xED, 0xE0, 0x0A, 0xD0, 0xDB, 0x50, 0x1E, 0xFF, - /*324*/ 0xE2, 0x0B, 0xE1, 0x0B, 0xE6, 0xED, 0xE0, 0x0A, 0xD0, 0x0E, 0xFF, + /*324*/ 0xE2, 0x0B, 0xE1, 0x0B, 0xE6, 0xED, 0xE0, 0x0A, 0xD0, 0x0E, 0xFF, /*335*/ 0xE2, 0x0B, 0xE1, 0x02, 0xE6, 0xED, 0xE0, 0x0A, 0xD0, 0xDB, 0x0A, 0x0E, 0xFF, - /*348*/ 0xFF, - + /*348*/ 0xFF, + /*349*/ 0xE2, 0x03, 0xE1, 0x01, 0xE6, 0xED, 0xE0, 0x06, 0xD6, 0x17, 0xFF, - /*360*/ 0xFF, - /*361*/ 0xFF, - /*362*/ 0xE2, 0x04, 0xE1, 0x04, 0xE6, 0xED, 0xE0, 0x06, 0xD5, 0xA7, 0xFF, + /*360*/ 0xFF, + /*361*/ 0xFF, + /*362*/ 0xE2, 0x04, 0xE1, 0x04, 0xE6, 0xED, 0xE0, 0x06, 0xD5, 0xA7, 0xFF, /*373*/ 0xE2, 0x03, 0xE1, 0x06, 0xE6, 0xED, 0xE0, 0x06, 0xD6, 0x37, 0xFF, - /*384*/ 0xE2, 0x04, 0xE1, 0x06, 0xE6, 0xED, 0xE0, 0x06, 0xD3, 0x87, 0xFF, - + /*384*/ 0xE2, 0x04, 0xE1, 0x06, 0xE6, 0xED, 0xE0, 0x06, 0xD3, 0x87, 0xFF, + /*395*/ 0xE2, 0x0C, 0xE1, 0x00, 0xE0, 0x04, 0xE6, 0xED, 0xD4, 0x0B, 0xE8, 0x0B, 0xFF, /*408*/ 0xE2, 0x0C, 0xE1, 0x03, 0xE0, 0x04, 0xE6, 0xED, 0xD4, 0xF0, 0x0C, 0x00, 0xE8, 0x10, 0xE8, 0x00, 0xE8, 0x10, 0xE8, 0x00, 0xE8, 0x10, 0xE8, 0x00, 0xE8, 0x10, 0xE8, 0x00, 0xE8, 0x10, 0xE8, 0x00, 0xE8, 0x10, 0xE8, 0x00, 0xE8, 0x10, 0xE8, 0x00, 0xE8, 0x10, 0xE8, 0x00, 0xE8, 0x10, 0xE8, 0x00, - 0xE8, 0x10, 0xE8, 0x00, 0xE8, 0x10, 0xE8, 0x00, 0xE8, 0x10, 0xFF, + 0xE8, 0x10, 0xE8, 0x00, 0xE8, 0x10, 0xE8, 0x00, 0xE8, 0x10, 0xFF, /*467*/ 0xE2, 0x0C, 0xE1, 0x00, 0xE0, 0x04, 0xE6, 0xED, 0xD4, 0x1B, 0xE8, 0x1B, 0xFF, - /*480*/ 0xFF, - + /*480*/ 0xFF, + /*481*/ 0xFF }; @@ -249,7 +249,7 @@ public: void reset(); void write(int offset, byte data); void update(int16* samples, int sampleCnt); - + PSG_HuC6280(double clock, double samplerate); }; @@ -538,8 +538,8 @@ int Player_PCE::readBuffer(int16 *buffer, const int numSamples) { // copy remaining samples to the front of the buffer if (_sampleBufferCnt > 0) { - memmove(&_sampleBuffer[0], - &_sampleBuffer[_samplesPerPeriod - _sampleBufferCnt], + memmove(&_sampleBuffer[0], + &_sampleBuffer[_samplesPerPeriod - _sampleBufferCnt], _sampleBufferCnt * sizeof(int16)); } @@ -552,7 +552,7 @@ void Player_PCE::procA731(channel_t *channel) { PSG_Write(0, channel->id); PSG_Write(2, channel->freq & 0xFF); PSG_Write(3, (channel->freq >> 8) & 0xFF); - + int tmp = channel->controlVec11; if ((channel->controlVec11 & 0xC0) == 0x80) { tmp = channel->controlVec11 & 0x1F; @@ -584,7 +584,7 @@ void Player_PCE::processSoundData(channel_t *channel) { } while (true) { - const byte *ptr = channel->soundDataPtr; + const byte *ptr = channel->soundDataPtr; byte value = (ptr ? *ptr++ : 0xFF); if (value < 0xD0) { int mult = (value & 0x0F) + 1; @@ -594,7 +594,7 @@ void Player_PCE::processSoundData(channel_t *channel) { channel->soundDataPtr = ptr; return; } - + // jump_table (A7F7) switch (value - 0xD0) { case 0: /*A85A*/ @@ -662,7 +662,7 @@ void Player_PCE::procAA62(channel_t *channel, int a) { void Player_PCE::procAB7F(channel_t *channel) { uint16 freqValue = channel->controlVecShort02; channel->controlVecShort02 += channel->controlVecShort03; - + int pos = freq_offset[channel->controlVec19] + channel->controlVec18; freqValue += freq_table[pos]; if (freq_table[pos + 1] != 0x0800) { @@ -703,9 +703,9 @@ void Player_PCE::procAC24(channel_t *channel) { } void Player_PCE::procACEA(channel_t *channel, int a) { - int x = a + - channel->controlVec2 + - channel->controlVec8 + + int x = a + + channel->controlVec2 + + channel->controlVec8 + channel->controlVec9; channel->controlVecShort02 = lookup_table[x]; } @@ -730,7 +730,7 @@ Player_PCE::Player_PCE(ScummEngine *scumm, Audio::Mixer *mixer) { } Player_PCE::~Player_PCE() { - _mixer->stopHandle(_soundHandle); + _mixer->stopHandle(_soundHandle); delete[] _sampleBuffer; delete _psg; } diff --git a/engines/scumm/player_pce.h b/engines/scumm/player_pce.h index 37a70b123b..b3d51edbf9 100644 --- a/engines/scumm/player_pce.h +++ b/engines/scumm/player_pce.h @@ -91,7 +91,7 @@ public: bool endOfData() const { return false; } int getRate() const { return _sample_rate; } -private: +private: ScummEngine *_vm; Audio::Mixer *_mixer; Audio::SoundHandle _soundHandle; @@ -118,7 +118,7 @@ private: void updateSound(); void procA731(channel_t *channel); void processSoundData(channel_t *channel); - void procA9F3(int x); + void procA9F3(int x); void procAA62(channel_t *channel, int a); uint16 procAAF6(int x); void procAB7F(channel_t *channel); diff --git a/engines/scumm/player_sid.h b/engines/scumm/player_sid.h index e03728d901..bfc9453070 100644 --- a/engines/scumm/player_sid.h +++ b/engines/scumm/player_sid.h @@ -189,7 +189,7 @@ private: // never read //uint8 vec19[7]; // never read (needed by scumm engine?) - //bool curChannelActive; + //bool curChannelActive; uint8* vec20[7]; @@ -232,10 +232,10 @@ private: bool pulseWidthSwapped; bool swapPrepared; - + // never read //uint8 var5163; - + bool filterSwapped; uint8 SIDReg24_HiNibble; bool keepSwapVars; diff --git a/engines/scumm/player_v2.h b/engines/scumm/player_v2.h index e2dd252b5b..83094617da 100644 --- a/engines/scumm/player_v2.h +++ b/engines/scumm/player_v2.h @@ -178,7 +178,7 @@ public: bool isStereo() const { return true; } bool endOfData() const { return false; } int getRate() const { return _sample_rate; } - + protected: #include "common/pack-start.h" // START STRUCT PACKING @@ -192,12 +192,12 @@ protected: int16 vibrato2; int16 noise; } PACKED_STRUCT; - + struct Voice2 { byte *amplitudeOutput; byte *freqOutput; byte *octaveOutput; - + uint8 channel; int8 sustainLevel; int8 attackRate; @@ -208,7 +208,7 @@ protected: int8 releaseTime; int8 vibratoRate; int8 vibratoDepth; - + int8 curVibratoRate; int8 curVibratoUnk; @@ -230,7 +230,7 @@ protected: byte chanNumber; } PACKED_STRUCT; - + struct MusicChip { byte ampl[4]; byte freq[4]; @@ -241,7 +241,7 @@ protected: Voice _cmsVoicesBase[16]; Voice2 _cmsVoices[8]; MusicChip _cmsChips[2]; - + int8 _tempo; int8 _tempoSum; byte _looping; @@ -251,35 +251,35 @@ protected: byte _midiChannelUse[16]; byte *_midiData; byte *_midiSongBegin; - + int _loadedMidiSong; - + byte _lastMidiCommand; uint _outputTableReady; byte _clkFrequenz; byte _restart; byte _curSno; - + void loadMidiData(byte *data, int sound); void play(); - + void processChannel(Voice2 *channel); void processRelease(Voice2 *channel); void processAttack(Voice2 *channel); void processDecay(Voice2 *channel); void processSustain(Voice2 *channel); void processVibrato(Voice2 *channel); - + void playMusicChips(const MusicChip *table); void playNote(byte *&data); void clearNote(byte *&data); void offAllChannels(); void playVoice(); void processMidiData(uint ticks); - + Voice2 *getFreeVoice(); Voice2 *getPlayVoice(byte param); - + // from Player_V2 protected: bool _isV3Game; diff --git a/engines/scumm/player_v2cms.cpp b/engines/scumm/player_v2cms.cpp index 4c993b7c2d..ccc93df902 100644 --- a/engines/scumm/player_v2cms.cpp +++ b/engines/scumm/player_v2cms.cpp @@ -153,16 +153,16 @@ public: _sampleRate = sampleRate; memset(_saa1099, 0, sizeof(SAA1099)*2); } - + ~CMSEmulator() { } - + void portWrite(int port, int val); void readBuffer(int16 *buffer, const int numSamples); private: uint32 _sampleRate; - + SAA1099 _saa1099[2]; - + void envelope(int chip, int ch); void update(int chip, int16 *buffer, int length); void portWriteIntern(int chip, int offset, int data); @@ -173,7 +173,7 @@ void CMSEmulator::portWrite(int port, int val) { case 0x220: portWriteIntern(0, 1, val); break; - + case 0x221: _saa1099[0].selected_reg = val & 0x1f; if (_saa1099[0].selected_reg == 0x18 || _saa1099[0].selected_reg == 0x19) { @@ -182,11 +182,11 @@ void CMSEmulator::portWrite(int port, int val) { if (_saa1099[0].env_clock[1]) envelope(0, 1); } break; - + case 0x222: portWriteIntern(1, 1, val); break; - + case 0x223: _saa1099[1].selected_reg = val & 0x1f; if (_saa1099[1].selected_reg == 0x18 || _saa1099[1].selected_reg == 0x19) { @@ -195,7 +195,7 @@ void CMSEmulator::portWrite(int port, int val) { if (_saa1099[1].env_clock[1]) envelope(1, 1); } break; - + default: warning("CMSEmulator got port: 0x%X", port); break; @@ -254,7 +254,7 @@ void CMSEmulator::update(int chip, int16 *buffer, int length) { } return; } - + if (chip == 0) { memset(buffer, 0, sizeof(int16)*length*2); } @@ -349,7 +349,7 @@ void CMSEmulator::portWriteIntern(int chip, int offset, int data) { saa->channels[ch].amplitude[LEFT] = amplitude_lookup[data & 0x0f]; saa->channels[ch].amplitude[RIGHT] = amplitude_lookup[(data >> 4) & 0x0f]; break; - + /* channel i frequency */ case 0x08: case 0x09: @@ -360,7 +360,7 @@ void CMSEmulator::portWriteIntern(int chip, int offset, int data) { ch = reg & 7; saa->channels[ch].frequency = data & 0xff; break; - + /* channel i octave */ case 0x10: case 0x11: @@ -369,7 +369,7 @@ void CMSEmulator::portWriteIntern(int chip, int offset, int data) { saa->channels[ch + 0].octave = data & 0x07; saa->channels[ch + 1].octave = (data >> 4) & 0x07; break; - + /* channel i frequency enable */ case 0x14: saa->channels[0].freq_enable = data & 0x01; @@ -379,7 +379,7 @@ void CMSEmulator::portWriteIntern(int chip, int offset, int data) { saa->channels[4].freq_enable = data & 0x10; saa->channels[5].freq_enable = data & 0x20; break; - + /* channel i noise enable */ case 0x15: saa->channels[0].noise_enable = data & 0x01; @@ -389,13 +389,13 @@ void CMSEmulator::portWriteIntern(int chip, int offset, int data) { saa->channels[4].noise_enable = data & 0x10; saa->channels[5].noise_enable = data & 0x20; break; - + /* noise generators parameters */ case 0x16: saa->noise_params[0] = data & 0x03; saa->noise_params[1] = (data >> 4) & 0x03; break; - + /* envelope generators parameters */ case 0x18: case 0x19: @@ -408,7 +408,7 @@ void CMSEmulator::portWriteIntern(int chip, int offset, int data) { /* reset the envelope */ saa->env_step[ch] = 0; break; - + /* channels enable & reset generators */ case 0x1c: saa->all_ch_enable = data & 0x01; @@ -422,7 +422,7 @@ void CMSEmulator::portWriteIntern(int chip, int offset, int data) { } } break; - + default: /* Error! */ error("CMS Unkown write to reg %x with %x",reg, data); } @@ -720,7 +720,7 @@ static const byte freqTable[] = { /*static const byte amplTable[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 0 % - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 10 % 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, // 20 % @@ -740,13 +740,13 @@ static const byte freqTable[] = { 0x00, 0x00, 0x10, 0x20, 0x30, 0x40, 0x50, 0x60, // 90 % 0x70, 0x80, 0x90, 0x90, 0xA0, 0xB0, 0xC0, 0xD0, 0x00, 0x10, 0x20, 0x30, 0x40, 0x50, 0x60, 0x70, // 100 % - 0x80, 0x90, 0xA0, 0xB0, 0xC0, 0xD0, 0xE0, 0xF0 + 0x80, 0x90, 0xA0, 0xB0, 0xC0, 0xD0, 0xE0, 0xF0 };*/ static const byte octaveTable[] = { 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x03, 0x00, 0x04, 0x00, 0x05, 0x00, 0x06, 0x00, 0x07, - 0x00, 0x08, 0x00, 0x09, 0x00, 0x0A, 0x00, 0x0B, + 0x00, 0x08, 0x00, 0x09, 0x00, 0x0A, 0x00, 0x0B, 0x01, 0x00, 0x01, 0x01, 0x01, 0x02, 0x01, 0x03, 0x01, 0x04, 0x01, 0x05, 0x01, 0x06, 0x01, 0x07, 0x01, 0x08, 0x01, 0x09, 0x01, 0x0A, 0x01, 0x0B, @@ -842,14 +842,14 @@ Player_V2CMS::Player_V2CMS(ScummEngine *scumm, Audio::Mixer *mixer) { _timer_output = 0; for (i = 0; i < 4; i++) _timer_count[i] = 0; - + memset(_cmsVoicesBase, 0, sizeof(Voice)*16); memset(_cmsVoices, 0, sizeof(Voice2)*8); memset(_cmsChips, 0, sizeof(MusicChip)*2); _midiDelay = _octaveMask = _looping = _tempo = 0; _midiData = _midiSongBegin = 0; _loadedMidiSong = 0; - memset(_midiChannel, 0, sizeof(Voice2*)*16); + memset(_midiChannel, 0, sizeof(Voice2*)*16); memset(_midiChannelUse, 0, sizeof(byte)*16); _cmsVoices[0].amplitudeOutput = &(_cmsChips[0].ampl[0]); @@ -884,7 +884,7 @@ Player_V2CMS::Player_V2CMS(ScummEngine *scumm, Audio::Mixer *mixer) { 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x03, 0x00, 0x04, 0x00, 0x05, 0x00, 0x14, 0x3F, 0x15, 0x00, 0x16, 0x00, 0x18, 0x00, 0x19, 0x00, 0x1C, 0x01 }; - + i = 0; for (int cmsPort = 0x220; i < 2; cmsPort += 2, ++i) { for (int off = 0; off < 13; ++off) { @@ -892,7 +892,7 @@ Player_V2CMS::Player_V2CMS(ScummEngine *scumm, Audio::Mixer *mixer) { g_cmsEmu->portWrite(cmsPort, cmsInitData[off*2+1]); } } - + _mixer->playInputStream(Audio::Mixer::kPlainSoundType, &_soundHandle, this, -1, Audio::Mixer::kMaxChannelVolume, 0, DisposeAfterUse::NO, true); } @@ -974,7 +974,7 @@ void Player_V2CMS::stopSound(int nr) { void Player_V2CMS::startSound(int nr) { byte *data = _vm->getResourceAddress(rtSound, nr); assert(data); - + if (data[6] == 0x80) { mutex_up(); loadMidiData(data, nr); @@ -1021,28 +1021,28 @@ void Player_V2CMS::startSound(int nr) { void Player_V2CMS::loadMidiData(byte *data, int sound) { memset(_midiChannelUse, 0, sizeof(byte)*16); - + _tempo = data[7]; _looping = data[8]; - + byte channels = data[14]; byte curChannel = 0; byte *voice2 = data + 23; - + for (; channels != 0; ++curChannel, --channels, voice2 += 16) { if (*(data + 15 + curChannel)) { byte channel = *(data + 15 + curChannel) - 1; _midiChannelUse[channel] = 1; - + Voice *voiceDef = &_cmsVoicesBase[channel]; - + byte attackDecay = voice2[10]; voiceDef->attack = attackRate[attackDecay >> 4]; voiceDef->decay = decayRate[attackDecay & 0x0F]; byte sustainRelease = voice2[11]; voiceDef->sustain = sustainRate[sustainRelease >> 4]; voiceDef->release = releaseRate[sustainRelease & 0x0F]; - + if (voice2[3] & 0x40) { voiceDef->vibrato = 0x0301; if (voice2[13] & 0x40) { @@ -1051,7 +1051,7 @@ void Player_V2CMS::loadMidiData(byte *data, int sound) { } else { voiceDef->vibrato = 0; } - + if (voice2[8] & 0x80) { voiceDef->vibrato2 = 0x0506; if (voice2[13] & 0x80) { @@ -1060,7 +1060,7 @@ void Player_V2CMS::loadMidiData(byte *data, int sound) { } else { voiceDef->vibrato2 = 0; } - + if ((voice2[8] & 0x0F) > 1) { voiceDef->octadd = 0x01; } else { @@ -1068,7 +1068,7 @@ void Player_V2CMS::loadMidiData(byte *data, int sound) { } } } - + for (int i = 0, channel = 0; i < 8; ++i, channel += 2) { _cmsVoices[i].chanNumber = 0xFF; _cmsVoices[i].curVolume = 0; @@ -1076,12 +1076,12 @@ void Player_V2CMS::loadMidiData(byte *data, int sound) { _midiChannel[channel] = 0; } - + _midiDelay = 0; memset(_cmsChips, 0, sizeof(MusicChip)*2); _midiData = data + 151; _midiSongBegin = _midiData + data[9]; - + _loadedMidiSong = sound; } @@ -1306,7 +1306,7 @@ void Player_V2CMS::next_freqs(ChannelInfo *channel) { if (channel->d.freqmod_offset != 0) if (channel->d.freqmod_offset > channel->d.freqmod_modulo) channel->d.freqmod_offset -= channel->d.freqmod_modulo; - + channel->d.freq = (int) (freqmod_table[channel->d.freqmod_table + (channel->d.freqmod_offset >> 4)]) * (int) channel->d.freqmod_multiplier / 256 @@ -1382,12 +1382,12 @@ void Player_V2CMS::processMidiData(uint ticks) { } else { _lastMidiCommand = command; if (command < 0x90) { - clearNote(currentData); + clearNote(currentData); } else { playNote(currentData); } } - + temp = command = *currentData++; if (command & 0x80) { temp = (command & 0x7F) << 8; @@ -1399,14 +1399,14 @@ void Player_V2CMS::processMidiData(uint ticks) { int lastBit = temp & 1; temp >>= 1; temp += lastBit; - + if (temp) break; } _midiData = currentData; _midiDelay = temp; } - + _midiDelay -= ticks; if (_midiDelay < 0) _midiDelay = 0; @@ -1426,7 +1426,7 @@ int Player_V2CMS::readBuffer(int16 *buffer, const int numSamples) { if (!(_clkFrequenz & 0x01)) { playVoice(); } - + _tempoSum += _tempo; // FIXME: _tempoSum is declared as char; on some systems char is unsigned. // E.g. on OS X. Hence the following check is always false. @@ -1437,7 +1437,7 @@ int Player_V2CMS::readBuffer(int16 *buffer, const int numSamples) { processMidiData(1); } } - + if (!(_next_tick >> FIXP_SHIFT) && !_midiData) { _next_tick += _tick_len; nextTick(); @@ -1461,29 +1461,29 @@ void Player_V2CMS::playVoice() { playMusicChips(_cmsChips); _outputTableReady = 0; } - + _octaveMask = 0xF0; Voice2 *voice =0; for (int i = 0; i < 8; ++i) { voice = &_cmsVoices[i]; _octaveMask = ~_octaveMask; - + if (voice->chanNumber != 0xFF) { processChannel(voice); continue; } - + if (!voice->curVolume) { *(voice->amplitudeOutput) = 0; } - + int volume = voice->curVolume - voice->releaseRate; voice->curVolume = volume; - + if (volume < 0) { volume = voice->curVolume = 0; } - + *(voice->amplitudeOutput) = ((volume >> 4) | (volume & 0xF0)) & voice->channel; ++_outputTableReady; } @@ -1495,23 +1495,23 @@ void Player_V2CMS::processChannel(Voice2 *channel) { case PROCESS_RELEASE: processRelease(channel); break; - + case PROCESS_ATTACK: processAttack(channel); break; - + case PROCESS_DECAY: processDecay(channel); break; - + case PROCESS_SUSTAIN: processSustain(channel); break; - + case PROCESS_VIBRATO: processVibrato(channel); break; - + default: break; } @@ -1573,7 +1573,7 @@ void Player_V2CMS::processVibrato(Voice2 *channel) { channel->curVibratoUnk = (channel->vibratoDepth & 0x0F) << 1; } } - + byte *output = channel->amplitudeOutput; *output = ((channel->curVolume >> 4) | (channel->curVolume & 0xF0)) & channel->channel; output = channel->freqOutput; @@ -1584,14 +1584,14 @@ void Player_V2CMS::processVibrato(Voice2 *channel) { void Player_V2CMS::offAllChannels() { warning("offAllChannels STUB"); -/* +/* // after using this sound can not be played anymore (since it would deinit the emulator) static const byte cmsOffData[10*2] = { 0x1C, 0x02, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x03, 0x00, 0x04, 0x00, 0x05, 0x00, 0x14, 0x3F, 0x15, 0x00, 0x16, 0x00 }; - + for (int cmsPort = 0x220, i = 0; i < 2; cmsPort += 2, ++i) { for (int off = 0; off < 10; ++off) { g_cmsEmu->portWrite(cmsPort+1, cmsOffData[off*2]); @@ -1604,7 +1604,7 @@ Player_V2CMS::Voice2 *Player_V2CMS::getFreeVoice() { Voice2 *curVoice = 0; Voice2 *selected = 0; uint8 volume = 0xFF; - + for (int i = 0; i < 8; ++i) { curVoice = &_cmsVoices[i]; @@ -1613,23 +1613,23 @@ Player_V2CMS::Voice2 *Player_V2CMS::getFreeVoice() { selected = curVoice; break; } - + if (curVoice->curVolume < volume) { selected = curVoice; volume = selected->curVolume; } } } - + if (selected) { selected->chanNumber = _lastMidiCommand & 0x0F; - + uint8 channel = selected->chanNumber; Voice2 *oldChannel = _midiChannel[channel]; _midiChannel[channel] = selected; selected->nextVoice = oldChannel; } - + return selected; } @@ -1647,13 +1647,13 @@ void Player_V2CMS::playNote(byte *&data) { freeVoice->vibratoRate = freeVoice->curVibratoRate = voice->vibrato; freeVoice->unkVibratoRate = freeVoice->unkRate = voice->vibrato2; freeVoice->maxAmpl = 0xFF; - + uint8 rate = freeVoice->attackRate; uint8 volume = freeVoice->curVolume >> 1; - + if (rate < volume) rate = volume; - + rate -= freeVoice->attackRate; freeVoice->curVolume = rate; freeVoice->playingNote = *data; @@ -1680,7 +1680,7 @@ void Player_V2CMS::playNote(byte *&data) { Player_V2CMS::Voice2 *Player_V2CMS::getPlayVoice(byte param) { byte channelNum = _lastMidiCommand & 0x0F; Voice2 *channel = _midiChannel[channelNum]; - + if (channel) { Voice2 *backUp = 0; while (true) { @@ -1692,7 +1692,7 @@ Player_V2CMS::Voice2 *Player_V2CMS::getPlayVoice(byte param) { if (!channel) return 0; } - + Voice2 *backUp2 = channel->nextVoice; { Voice2 *temp = backUp; @@ -1706,7 +1706,7 @@ Player_V2CMS::Voice2 *Player_V2CMS::getPlayVoice(byte param) { } channel = backUp; } - + return channel; } @@ -1723,18 +1723,18 @@ void Player_V2CMS::clearNote(byte *&data) { void Player_V2CMS::play() { _octaveMask = 0xF0; channel_data *chan = &(_channels[0].d); - + static byte volumeReg[4] = { 0x00, 0x00, 0x00, 0x00 }; static byte octaveReg[4] = { 0x66, 0x66, 0x66, 0x66 }; static byte freqReg[4] = { 0xFF, 0xFF, 0xFF, 0xFF }; - + static byte freqEnable = 0x3E; static byte noiseEnable = 0x01; static byte noiseGen = 0x02; for (int i = 1; i <= 4; ++i) { if (chan->time_left) { uint16 freq = chan->freq; - + if (i == 4) { if ((freq >> 8) & 0x40) { noiseGen = freq & 0xFF; @@ -1747,10 +1747,10 @@ void Player_V2CMS::play() { if (freq == 0) { freq = 0xFFC0; } - + int cmsOct = 2; int freqOct = 0x8000; - + while (true) { if (freq >= freqOct) { break; @@ -1765,11 +1765,11 @@ void Player_V2CMS::play() { } byte oct = cmsOct << 4; oct |= cmsOct; - + oct &= _octaveMask; oct |= ((~_octaveMask) & octaveReg[((i & 3) >> 1)]); octaveReg[((i & 3) >> 1)] = oct; - + freq >>= -(cmsOct-9); freqReg[(i&3)] = (-(freq-511)) & 0xFF; } @@ -1805,9 +1805,9 @@ void Player_V2CMS::play() { g_cmsEmu->portWrite(0x221, 0x11); g_cmsEmu->portWrite(0x220, octaveReg[1]); g_cmsEmu->portWrite(0x221, 0x14); - g_cmsEmu->portWrite(0x220, freqEnable); + g_cmsEmu->portWrite(0x220, freqEnable); g_cmsEmu->portWrite(0x221, 0x15); - g_cmsEmu->portWrite(0x220, noiseEnable); + g_cmsEmu->portWrite(0x220, noiseEnable); g_cmsEmu->portWrite(0x221, 0x16); g_cmsEmu->portWrite(0x220, noiseGen); } diff --git a/engines/scumm/player_v4a.cpp b/engines/scumm/player_v4a.cpp index ad5d5c0a5b..28489f86ce 100644 --- a/engines/scumm/player_v4a.cpp +++ b/engines/scumm/player_v4a.cpp @@ -52,7 +52,7 @@ Player_V4A::Player_V4A(ScummEngine *scumm, Audio::Mixer *mixer) bool Player_V4A::init() { if (_vm->_game.id != GID_MONKEY_VGA) error("player_v4a - unknown game"); - + Common::File fileMdat, fileSample; if (fileMdat.open("music.dat") && fileSample.open("sample.dat")) { @@ -63,7 +63,7 @@ bool Player_V4A::init() { } } else warning("player_v4a: couldnt load one of the music resources: music.dat, sample.dat"); - + return false; } @@ -81,7 +81,7 @@ void Player_V4A::stopAllSounds() { debug(5, "player_v4a: stopAllSounds"); if (_initState > 0) { _tfmxMusic.stopSong(); - _signal = 0; + _signal = 0; _musicId = 0; _tfmxSfx.stopSong(); @@ -164,7 +164,7 @@ void Player_V4A::startSound(int nr) { _tfmxMusic.doSong(index); _signal = 2; - // the Tfmx-player never "ends" the output by itself, so this should be threadsafe + // the Tfmx-player never "ends" the output by itself, so this should be threadsafe if (!_mixer->isSoundHandleActive(_musicHandle)) _mixer->playInputStream(Audio::Mixer::kMusicSoundType, &_musicHandle, &_tfmxMusic, -1, Audio::Mixer::kMaxChannelVolume, 0, DisposeAfterUse::NO); _musicId = nr; @@ -176,7 +176,7 @@ int Player_V4A::getMusicTimer() { if (_initState < 0) return 2000; if (_musicId) { - // The titlesong (and a few others) is running with ~70 ticks per second and the scale seems to be based on that. + // The titlesong (and a few others) is running with ~70 ticks per second and the scale seems to be based on that. // The Game itself doesnt get the timing from the Tfmx Player however, so we just use the elapsed time // 357 ~ 1000 * 25 * (1 / 70) return _mixer->getSoundElapsedTime(_musicHandle) / 357; diff --git a/engines/scumm/player_v4a.h b/engines/scumm/player_v4a.h index 15e225854c..abacd8e511 100644 --- a/engines/scumm/player_v4a.h +++ b/engines/scumm/player_v4a.h @@ -69,7 +69,7 @@ private: // byte type; } _sfxSlots[4]; - int8 _initState; // < 0: failed, 0: uninitialised, > 0: initialised + int8 _initState; // < 0: failed, 0: uninitialised, > 0: initialised int getSfxChan(int id) const { for (int i = 0; i < ARRAYSIZE(_sfxSlots); ++i) diff --git a/engines/scumm/script_v0.cpp b/engines/scumm/script_v0.cpp index d0339f478a..d21b26beb3 100644 --- a/engines/scumm/script_v0.cpp +++ b/engines/scumm/script_v0.cpp @@ -411,7 +411,7 @@ void ScummEngine_v0::decodeParseString() { void ScummEngine_v0::drawSentenceWord(int object, bool usePrep, bool objInInventory) { const byte *temp; int sentencePrep = 0; - + // If object not in inventory, we except an index if (!objInInventory) _v0ObjectIndex = true; @@ -497,7 +497,7 @@ void ScummEngine_v0::drawSentence() { else inventoryFirst = true; } - + // Draw the inventory? if (_activeInventory > 0 && _activeObject2 == 0) { @@ -511,8 +511,8 @@ void ScummEngine_v0::drawSentence() { } else // Room based drawSentenceWord(_activeObjectIndex, inventoryFirst, false); } - - // Draw the 2nd active object + + // Draw the 2nd active object } else if (_activeObject2) { // 2nd Object is in inventory @@ -527,7 +527,7 @@ void ScummEngine_v0::drawSentence() { // Draw the active actor if (_activeActor) { Actor *a = derefActor(_activeActor, ""); - + strcat(_sentenceBuf, " "); strcat(_sentenceBuf, (const char*)a->getActorName()); } @@ -780,7 +780,7 @@ void ScummEngine_v0::o_pickupObject() { if (whereIsObjectInventory(_activeObject2) == WIO_INVENTORY) /* Don't take an */ return; /* object twice */ - + addObjectToInventory(obj, _roomResource); markObjectRectAsDirty(obj); putOwner(obj, VAR(VAR_EGO)); @@ -803,7 +803,7 @@ void ScummEngine_v0::o_setActorBitVar() { byte act = getVarOrDirectByte(PARAM_1); byte mask = getVarOrDirectByte(PARAM_2); byte mod = getVarOrDirectByte(PARAM_3); - + // 0x63ED if (act >= _numActors) return; diff --git a/engines/scumm/script_v6.cpp b/engines/scumm/script_v6.cpp index 435cbf50c7..1380c9c0ba 100644 --- a/engines/scumm/script_v6.cpp +++ b/engines/scumm/script_v6.cpp @@ -700,12 +700,12 @@ void ScummEngine_v6::o6_ifNot() { void ScummEngine_v6::o6_jump() { int offset = fetchScriptWordSigned(); - // WORKAROUND bug #2826144: Talking to the guard at the bigfoot party, after + // WORKAROUND bug #2826144: Talking to the guard at the bigfoot party, after // he's let you inside, will cause the game to hang, if you end the conversation. // This is a script bug, due to a missing jump in one segment of the script. if (_game.id == GID_SAMNMAX && vm.slot[_currentScript].number == 101 && readVar(0x8000 + 97) == 1 && offset == 1) { offset = -18; - } + } _scriptPointer += offset; } diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index e474e8b5a8..a286f5a162 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -507,7 +507,7 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr) case Common::kRenderCGA: case Common::kRenderEGA: case Common::kRenderAmiga: - if ((_game.version >= 4 && !(_game.features & GF_16COLOR) + if ((_game.version >= 4 && !(_game.features & GF_16COLOR) && !(_game.platform == Common::kPlatformAmiga && _renderMode == Common::kRenderEGA)) || (_game.features & GF_OLD256)) _renderMode = Common::kRenderDefault; diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h index 5c49d50531..5442c12185 100644 --- a/engines/scumm/scumm.h +++ b/engines/scumm/scumm.h @@ -994,7 +994,7 @@ protected: // HACK Double the array size to handle 16-bit images. // this should be dynamically allocated based on game depth instead. - byte _grabbedCursor[16384]; + byte _grabbedCursor[16384]; byte _currentCursor; byte _newEffect, _switchRoomEffect2, _switchRoomEffect; @@ -1039,7 +1039,7 @@ protected: void setPaletteFromTable(const byte *ptr, int numcolor, int firstIndex = 0); void resetPalette(); - + void setCurrentPalette(int pal); void setRoomPalette(int pal, int room); void setPCEPaletteFromPtr(const byte *ptr); diff --git a/engines/scumm/sound.cpp b/engines/scumm/sound.cpp index 6004ac62b3..6760072ed7 100644 --- a/engines/scumm/sound.cpp +++ b/engines/scumm/sound.cpp @@ -424,7 +424,7 @@ void Sound::playSound(int soundID) { size = READ_BE_UINT16(ptr + 12); assert(size); - + rate = 3579545 / READ_BE_UINT16(ptr + 20); sound = (byte *)malloc(size); int vol = ptr[24] * 4; @@ -2113,7 +2113,7 @@ int ScummEngine::readSoundResourceSmallHeader(int idx) { if (_game.features & GF_OLD_BUNDLE) { _fileHandle->seek(wa_offs + wa_size + 6, SEEK_SET); byte musType = _fileHandle->readByte(); - + if (musType == 0x80) { _fileHandle->seek(ad_offs, SEEK_SET); _fileHandle->read(_res->createResource(rtSound, idx, ad_size), ad_size); diff --git a/engines/scumm/verbs.cpp b/engines/scumm/verbs.cpp index d371f8744d..d63c1f9381 100644 --- a/engines/scumm/verbs.cpp +++ b/engines/scumm/verbs.cpp @@ -709,7 +709,7 @@ bool ScummEngine_v0::verbMoveToActor(int actor) { return false; return true; - } + } return true; } @@ -744,8 +744,8 @@ bool ScummEngine_v0::verbMove(int object, int objectIndex, bool invObject) { _activeObjectIndex = objectIndex; _v0ObjectIndex = true; - // Execute pickup - runObject(objectIndex, 14); + // Execute pickup + runObject(objectIndex, 14); _v0ObjectIndex = false; _activeObject = oldActive; @@ -753,7 +753,7 @@ bool ScummEngine_v0::verbMove(int object, int objectIndex, bool invObject) { // Finished picking up _verbPickup = false; - } + } } return false; @@ -792,7 +792,7 @@ bool ScummEngine_v0::verbObtain(int obj, int objIndex) { } int ScummEngine_v0::verbPrep(int object) { - if (!_v0ObjectInInventory) + if (!_v0ObjectInInventory) _v0ObjectIndex = true; else _v0ObjectIndex = false; @@ -825,7 +825,7 @@ bool ScummEngine_v0::verbExec() { // Lets try walk to the object if (_activeObject && _activeObjectIndex && !_activeObjectObtained && _currentMode != 0) { prep = verbPrep(_activeObjectIndex); - + if (verbObtain(_activeObject, _activeObjectIndex)) return true; @@ -838,7 +838,7 @@ bool ScummEngine_v0::verbExec() { _v0ObjectInInventory = false; if (verbObtain(_activeObject2, _activeObject2Index)) return true; - + if (prep != 1 && prep != 4) { _activeInventory = _activeObject; _activeObject = _activeObject2; @@ -901,7 +901,7 @@ bool ScummEngine_v0::verbExec() { resetSentence(true); return false; } - + resetSentence(); return false; } @@ -914,10 +914,10 @@ bool ScummEngine_v0::verbExec() { if (verbExecutes(_activeInventory, true) == false) { if (_activeObject2 && verbExecutes(_activeObject2, true)) { _v0ObjectInInventory = true; - + _activeObject = _activeInventory; _activeInventory = _activeObject2; - + runObject(_activeObject, _activeVerb); } else { _v0ObjectInInventory = true; @@ -952,7 +952,7 @@ void ScummEngine_v0::checkExecVerbs() { int over = findVerbAtPos(_mouse.x, _mouse.y); int act = getActorFromPos(_virtualMouse.x, _virtualMouse.y); int obj = findObject(_virtualMouse.x, _virtualMouse.y); - + if (over && over != _activeVerb) { _activeVerb = over; _verbExecuting = false; @@ -960,7 +960,7 @@ void ScummEngine_v0::checkExecVerbs() { } if (!obj && !act && !over) { - resetSentence(false); + resetSentence(false); } else { a = derefActor(VAR(VAR_EGO), "checkExecVerbs"); a->stopActorMoving(); @@ -1000,7 +1000,7 @@ void ScummEngine_v0::checkExecVerbs() { checkV2Inventory(_mouse.x, _mouse.y); if (!_activeInventory) return; - + // Did we just change the selected inventory item? if (prevInventory && prevInventory != _activeInventory && _activeInventory != _activeObject2) { _activeObject = 0; @@ -1042,7 +1042,7 @@ void ScummEngine_v0::checkExecVerbs() { if (_activeVerb != 7) { _activeVerb = over; over = 0; - } + } if (over) { _activeVerb = 13; @@ -1054,7 +1054,7 @@ void ScummEngine_v0::checkExecVerbs() { return; } - + // Clicked on nothing, walk here? if (!over && !act && _activeVerb == 13 && !obj && _currentMode != 0) { // Clear all selected @@ -1123,10 +1123,10 @@ void ScummEngine_v0::checkExecVerbs() { } else { _activeObject = obj; _activeObjectIndex = objIdx; - + if (_activeVerb != 13) return; - + //return; } } |