From bd0a327a3910b96e260952b7a812c02aba0d1619 Mon Sep 17 00:00:00 2001 From: Travis Howell Date: Sat, 28 Oct 2006 14:08:35 +0000 Subject: Remove vga opcodes which are never used by games svn-id: r24557 --- engines/agos/agos.h | 6 +----- engines/agos/event.cpp | 30 ++---------------------------- engines/agos/vga.cpp | 11 ----------- engines/agos/vga_e2.cpp | 1 - engines/agos/vga_ff.cpp | 24 ------------------------ 5 files changed, 3 insertions(+), 69 deletions(-) (limited to 'engines') diff --git a/engines/agos/agos.h b/engines/agos/agos.h index 7ad81954be..c268ea1319 100644 --- a/engines/agos/agos.h +++ b/engines/agos/agos.h @@ -107,7 +107,6 @@ struct VgaTimerEntry { const byte *script_pointer; uint16 sprite_id; uint16 cur_vga_file; - int32 param; VgaTimerEntry() { memset(this, 0, sizeof(*this)); } }; @@ -907,7 +906,6 @@ public: void vc42_delayIfNotEQ(); // Video Script Opcodes, Elvira 1 - void vc11_onStop(); void vc17_waitEnd(); void vc22_setPaletteOld(); void vc32_saveScreen(); @@ -968,7 +966,6 @@ public: void vc74_clearMark(); // Video Script Opcodes, Feeble Files - void vc53_panSFX(); void vc75_setScale(); void vc76_setScaleXOffs(); void vc77_setScaleYOffs(); @@ -1309,11 +1306,10 @@ protected: bool isVgaQueueEmpty(); void haltAnimation(); void restartAnimation(); - void addVgaEvent(uint16 num, const byte *code_ptr, uint16 cur_sprite, uint16 curZoneNum, int32 param = 0); + void addVgaEvent(uint16 num, const byte *code_ptr, uint16 cur_sprite, uint16 curZoneNum); void deleteVgaEvent(VgaTimerEntry * vte); void processVgaEvents(); void animateEvent(const byte *code_ptr, uint16 curZoneNum, uint16 cur_sprite); - void panEvent(uint16 curZoneNum, uint16 cur_sprite, int32 param); void scrollEvent(); VgaSprite *findCurSprite(); diff --git a/engines/agos/event.cpp b/engines/agos/event.cpp index 68cd77425f..1f083d23dd 100644 --- a/engines/agos/event.cpp +++ b/engines/agos/event.cpp @@ -174,7 +174,7 @@ void AGOSEngine::restartAnimation() { _lockWord &= ~0x10; } -void AGOSEngine::addVgaEvent(uint16 num, const byte *code_ptr, uint16 cur_sprite, uint16 curZoneNum, int32 param) { +void AGOSEngine::addVgaEvent(uint16 num, const byte *code_ptr, uint16 cur_sprite, uint16 curZoneNum) { VgaTimerEntry *vte; // When Simon talks to the Golum about stew in French version of @@ -196,7 +196,6 @@ void AGOSEngine::addVgaEvent(uint16 num, const byte *code_ptr, uint16 cur_sprite vte->script_pointer = code_ptr; vte->sprite_id = cur_sprite; vte->cur_vga_file = curZoneNum; - vte->param = param; _lockWord &= ~1; } @@ -227,15 +226,11 @@ void AGOSEngine::processVgaEvents() { uint16 curZoneNum = vte->cur_vga_file; uint16 cur_sprite = vte->sprite_id; const byte *script_ptr = vte->script_pointer; - int32 param = vte->param; _nextVgaTimerToProcess = vte + 1; deleteVgaEvent(vte); - if ((getGameType() == GType_FF || getGameType() == GType_PP) && - script_ptr == NULL) { - panEvent(curZoneNum, cur_sprite, param); - } else if (getGameType() == GType_SIMON2 && script_ptr == NULL) { + if (getGameType() == GType_SIMON2 && script_ptr == NULL) { scrollEvent(); } else { animateEvent(script_ptr, curZoneNum, cur_sprite); @@ -265,27 +260,6 @@ void AGOSEngine::animateEvent(const byte *code_ptr, uint16 curZoneNum, uint16 cu runVgaScript(); } -void AGOSEngine::panEvent(uint16 curZoneNum, uint16 cur_sprite, int32 param) { - _vgaCurSpriteId = cur_sprite; - _vgaCurZoneNum = curZoneNum; - - VgaSprite *vsp = findCurSprite(); - - param &= 0x10; - - int32 pan = (vsp->x - _scrollX + param) * 8 - 2560; - if (pan < -10000) - pan = -10000; - if (pan > 10000) - pan = 10000; - - //setSfxPan(param, pan); - - if (pan != 0) - addVgaEvent(10, NULL, _vgaCurSpriteId, _vgaCurZoneNum); /* pan event */ - debug(0, "panEvent: param %d pan %d", param, pan); -} - void AGOSEngine::scrollEvent() { if (_scrollCount == 0) return; diff --git a/engines/agos/vga.cpp b/engines/agos/vga.cpp index c5282e48ac..2da9c96e78 100644 --- a/engines/agos/vga.cpp +++ b/engines/agos/vga.cpp @@ -92,8 +92,6 @@ void AGOSEngine::setupElvira1VideoOpcodes(VgaOpcodeProc *op) { op[8] = &AGOSEngine::vc8_ifObjectIsAt; op[9] = &AGOSEngine::vc9_ifObjectStateIs; op[10] = &AGOSEngine::vc10_draw; - op[11] = &AGOSEngine::vc11_onStop; - op[13] = &AGOSEngine::vc12_delay; op[14] = &AGOSEngine::vc13_addToSpriteX; op[15] = &AGOSEngine::vc14_addToSpriteY; @@ -117,17 +115,13 @@ void AGOSEngine::setupElvira1VideoOpcodes(VgaOpcodeProc *op) { op[33] = &AGOSEngine::vc32_saveScreen; op[34] = &AGOSEngine::vc33_setMouseOn; op[35] = &AGOSEngine::vc34_setMouseOff; - op[38] = &AGOSEngine::vc35_clearWindow; - op[40] = &AGOSEngine::vc36_setWindowImage; op[41] = &AGOSEngine::vc37_pokePalette; - op[51] = &AGOSEngine::vc38_ifVarNotZero; op[52] = &AGOSEngine::vc39_setVar; op[53] = &AGOSEngine::vc40; op[54] = &AGOSEngine::vc41; - op[56] = &AGOSEngine::vc42_delayIfNotEQ; } @@ -682,11 +676,6 @@ void AGOSEngine::vc10_draw() { } } -void AGOSEngine::vc11_onStop() { - uint a = vcReadNextWord(); - debug(0, "vc11_onStop: stub (%d)", a); -} - void AGOSEngine::vc12_delay() { VgaSprite *vsp = findCurSprite(); uint16 num; diff --git a/engines/agos/vga_e2.cpp b/engines/agos/vga_e2.cpp index 4474dc4c3e..fa454db4d9 100644 --- a/engines/agos/vga_e2.cpp +++ b/engines/agos/vga_e2.cpp @@ -34,7 +34,6 @@ namespace AGOS { void AGOSEngine::setupElvira2VideoOpcodes(VgaOpcodeProc *op) { setupCommonVideoOpcodes(op); - op[11] = &AGOSEngine::vc11_onStop; op[17] = &AGOSEngine::vc17_waitEnd; op[19] = &AGOSEngine::vc19_loop; op[22] = &AGOSEngine::vc22_setPaletteOld; diff --git a/engines/agos/vga_ff.cpp b/engines/agos/vga_ff.cpp index c3dbd4b7cd..0e4ea37562 100644 --- a/engines/agos/vga_ff.cpp +++ b/engines/agos/vga_ff.cpp @@ -31,7 +31,6 @@ namespace AGOS { void AGOSEngine::setupFeebleVideoOpcodes(VgaOpcodeProc *op) { setupSimon2VideoOpcodes(op); - op[53] = &AGOSEngine::vc53_panSFX; op[75] = &AGOSEngine::vc75_setScale; op[76] = &AGOSEngine::vc76_setScaleXOffs; op[77] = &AGOSEngine::vc77_setScaleYOffs; @@ -44,29 +43,6 @@ void AGOSEngine::setupFeebleVideoOpcodes(VgaOpcodeProc *op) { op[84] = &AGOSEngine::vc84_stopSoundLoop; } -void AGOSEngine::vc53_panSFX() { - VgaSprite *vsp = findCurSprite(); - int pan; - - uint16 sound = vcReadNextWord(); - int16 xoffs = vcReadNextWord(); - int16 vol = vcReadNextWord(); - - pan = (vsp->x - _scrollX + xoffs) * 8 - 2560; - if (pan < -10000) - pan = -10000; - if (pan > 10000) - pan = 10000; - - loadSound(sound, 0, vol, 1); - - if (xoffs != 2) - xoffs |= 0x10; - - addVgaEvent(10, NULL, _vgaCurSpriteId, _vgaCurZoneNum, xoffs); /* pan event */ - debug(0, "vc53_panSFX: snd %d xoffs %d vol %d", sound, xoffs, vol); -} - int AGOSEngine::getScale(int16 y, int16 x) { int16 z; -- cgit v1.2.3