diff options
Diffstat (limited to 'sky')
40 files changed, 886 insertions, 886 deletions
diff --git a/sky/autoroute.cpp b/sky/autoroute.cpp index fc9ecbdad1..d158f6d69a 100644 --- a/sky/autoroute.cpp +++ b/sky/autoroute.cpp @@ -34,23 +34,23 @@ namespace Sky { #define ROUTE_GRID_SIZE (ROUTE_GRID_WIDTH*ROUTE_GRID_HEIGHT*2) #define WALK_JUMP 8 // walk in blocks of 8 -const int16 SkyAutoRoute::_routeDirections[4] = { -1, 1, -ROUTE_GRID_WIDTH, ROUTE_GRID_WIDTH }; -const uint16 SkyAutoRoute::_logicCommands[4] = { RIGHTY, LEFTY, DOWNY, UPY }; +const int16 AutoRoute::_routeDirections[4] = { -1, 1, -ROUTE_GRID_WIDTH, ROUTE_GRID_WIDTH }; +const uint16 AutoRoute::_logicCommands[4] = { RIGHTY, LEFTY, DOWNY, UPY }; -SkyAutoRoute::SkyAutoRoute(SkyGrid *pGrid) { +AutoRoute::AutoRoute(Grid *pGrid) { _grid = pGrid; _routeGrid = (uint16 *)malloc(ROUTE_GRID_SIZE); _routeBuf = (uint16 *)malloc(ROUTE_SPACE); } -SkyAutoRoute::~SkyAutoRoute(void) { +AutoRoute::~AutoRoute(void) { free(_routeGrid); free(_routeBuf); } -uint16 SkyAutoRoute::checkBlock(uint16 *blockPos) { +uint16 AutoRoute::checkBlock(uint16 *blockPos) { uint16 retVal = 0xFFFF; @@ -62,7 +62,7 @@ uint16 SkyAutoRoute::checkBlock(uint16 *blockPos) { return retVal; } -void SkyAutoRoute::clipCoordX(uint16 x, uint8 &blkX, int16 &initX) { +void AutoRoute::clipCoordX(uint16 x, uint8 &blkX, int16 &initX) { if (x < TOP_LEFT_X) { blkX = 0; initX = x - TOP_LEFT_X; @@ -75,7 +75,7 @@ void SkyAutoRoute::clipCoordX(uint16 x, uint8 &blkX, int16 &initX) { } } -void SkyAutoRoute::clipCoordY(uint16 y, uint8 &blkY, int16 &initY) { +void AutoRoute::clipCoordY(uint16 y, uint8 &blkY, int16 &initY) { if (y < TOP_LEFT_Y) { blkY = 0; initY = y - TOP_LEFT_Y; @@ -88,7 +88,7 @@ void SkyAutoRoute::clipCoordY(uint16 y, uint8 &blkY, int16 &initY) { } } -void SkyAutoRoute::initWalkGrid(uint8 screen, uint8 width) { +void AutoRoute::initWalkGrid(uint8 screen, uint8 width) { uint16 *wGridPos; uint8 stretch = 0; @@ -121,7 +121,7 @@ void SkyAutoRoute::initWalkGrid(uint8 screen, uint8 width) { } } -bool SkyAutoRoute::calcWalkGrid(uint8 startX, uint8 startY, uint8 destX, uint8 destY) { +bool AutoRoute::calcWalkGrid(uint8 startX, uint8 startY, uint8 destX, uint8 destY) { int16 directionX, directionY; uint8 roiX, roiY; // Rectangle Of Interest in the walk grid @@ -187,7 +187,7 @@ bool SkyAutoRoute::calcWalkGrid(uint8 startX, uint8 startY, uint8 destX, uint8 d return foundRoute; } -uint16 *SkyAutoRoute::makeRouteData(uint8 startX, uint8 startY, uint8 destX, uint8 destY) { +uint16 *AutoRoute::makeRouteData(uint8 startX, uint8 startY, uint8 destX, uint8 destY) { memset(_routeBuf, 0, ROUTE_SPACE); @@ -217,7 +217,7 @@ uint16 *SkyAutoRoute::makeRouteData(uint8 startX, uint8 startY, uint8 destX, uin return dataTrg; } -uint16 *SkyAutoRoute::checkInitMove(uint16 *data, int16 initStaX) { +uint16 *AutoRoute::checkInitMove(uint16 *data, int16 initStaX) { if (initStaX < 0) { data -= 2; *(data + 1) = RIGHTY; @@ -230,7 +230,7 @@ uint16 *SkyAutoRoute::checkInitMove(uint16 *data, int16 initStaX) { return data; } -uint16 SkyAutoRoute::autoRoute(Compact *cpt) { +uint16 AutoRoute::autoRoute(Compact *cpt) { uint8 cptScreen = (uint8)cpt->screen; uint8 cptWidth = (uint8)SkyCompact::getMegaSet(cpt, cpt->extCompact->megaSet)->gridWidth; diff --git a/sky/autoroute.h b/sky/autoroute.h index d3c575ac16..590a3b7a87 100644 --- a/sky/autoroute.h +++ b/sky/autoroute.h @@ -28,12 +28,12 @@ namespace Sky { struct Compact; -class SkyGrid; +class Grid; -class SkyAutoRoute { +class AutoRoute { public: - SkyAutoRoute(SkyGrid *pGrid); - ~SkyAutoRoute(void); + AutoRoute(Grid *pGrid); + ~AutoRoute(void); uint16 autoRoute(Compact *cpt); private: uint16 checkBlock(uint16 *blockPos); @@ -43,7 +43,7 @@ private: bool calcWalkGrid(uint8 startX, uint8 startY, uint8 destX, uint8 destY); uint16 *makeRouteData(uint8 startX, uint8 startY, uint8 destX, uint8 destY); uint16 *checkInitMove(uint16 *data, int16 initStaX); - SkyGrid *_grid; + Grid *_grid; uint16 *_routeGrid; uint16 *_routeBuf; static const int16 _routeDirections[4]; diff --git a/sky/compact.cpp b/sky/compact.cpp index 20e8ccaade..dedd370436 100644 --- a/sky/compact.cpp +++ b/sky/compact.cpp @@ -50,7 +50,7 @@ namespace Sky { #define MK32_A5(type, item) MK32(type, item[0]), MK32(type, item[1]), \ MK32(type, item[2]), MK32(type, item[3]), MK32(type, item[4]) -namespace SkyTalkAnims { +namespace TalkAnims { extern bool animTalkTableIsPointer[]; extern uint16 animTalkTableVal[]; extern void *animTalkTablePtr[]; @@ -78,7 +78,7 @@ uint16 *getGrafixPtr(Compact *cpt) { error("::getGrafixPtr: request for elem ptr %d. It's NULL.", cpt->grafixProg.ptrTarget); return buf + cpt->grafixProg.pos; case TALKTABLE: - buf = (uint16 *)SkyTalkAnims::animTalkTablePtr[cpt->grafixProg.ptrTarget]; + buf = (uint16 *)TalkAnims::animTalkTablePtr[cpt->grafixProg.ptrTarget]; return buf + cpt->grafixProg.pos; default: error("::getGrafixPtr: unknown grafixProg type for Compact cpt"); diff --git a/sky/compacts/savedata.cpp b/sky/compacts/savedata.cpp index 30a5cd9e8b..cdc261fb42 100644 --- a/sky/compacts/savedata.cpp +++ b/sky/compacts/savedata.cpp @@ -24,7 +24,7 @@ namespace Sky { -Compact *SkyControl::_saveLoadCpts[833] = { +Compact *Control::_saveLoadCpts[833] = { // 0compact.asm: // Z_compac.inc: &SkyCompact::forklift_cpt, @@ -981,7 +981,7 @@ Compact *SkyControl::_saveLoadCpts[833] = { &SkyCompact::info_button }; -uint16 *SkyControl::_saveLoadARs[19] = { +uint16 *Control::_saveLoadARs[19] = { SkyCompact::babs_auto, SkyCompact::burke_auto, SkyCompact::dan_auto, @@ -1003,7 +1003,7 @@ uint16 *SkyControl::_saveLoadARs[19] = { SkyCompact::minif_auto }; -uint8 SkyControl::_resetData288[0x39B8] = { +uint8 Control::_resetData288[0x39B8] = { 0x95, 0x66, 0x00, 0x00, 0xFF, 0xDD, 0x2A, 0xCD, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x02, 0x00, 0x01, 0xF0, 0x06, 0x00, 0x00, 0x00, 0xDC, 0x10, 0x03, 0xF0, 0x56, 0x10, 0x00, 0x00, 0xA5, 0xA4, 0x56, 0x10, 0xF3, 0x00, 0x58, 0x10, 0x13, 0x01, @@ -1930,7 +1930,7 @@ uint8 SkyControl::_resetData288[0x39B8] = { 0x1C, 0x00, 0x37, 0x10, 0x28, 0x10, 0x00, 0x00 }; -uint8 SkyControl::_resetDiff303[824] = { +uint8 Control::_resetDiff303[824] = { 0x04, 0x00, 0x2F, 0x01, 0xE9, 0x02, 0x76, 0x00, 0x1B, 0x00, 0x39, 0x31, 0x01, 0x00, 0xF2, 0x30, 0x01, 0x00, 0xF3, 0x30, 0x01, 0x00, 0xF4, 0x30, 0x01, 0x00, 0x3A, 0x31, 0x01, 0x00, 0x3B, 0x31, 0x01, 0x00, 0x3C, 0x31, 0x01, 0x00, 0xB7, 0x30, 0x01, 0x00, 0xB8, 0x30, 0x01, 0x00, 0xBD, 0x30, @@ -1985,7 +1985,7 @@ uint8 SkyControl::_resetDiff303[824] = { 0x35, 0x00, 0x34, 0x31, 0x1A, 0x00, 0x36, 0x31 }; -uint8 SkyControl::_resetDiff331[824] = { +uint8 Control::_resetDiff331[824] = { 0x04, 0x00, 0x4B, 0x01, 0xE9, 0x02, 0x76, 0x00, 0x1B, 0x00, 0x39, 0x31, 0x01, 0x00, 0xF2, 0x30, 0x01, 0x00, 0xF3, 0x30, 0x01, 0x00, 0xF4, 0x30, 0x01, 0x00, 0x3A, 0x31, 0x01, 0x00, 0x3B, 0x31, 0x01, 0x00, 0x3C, 0x31, 0x01, 0x00, 0xB7, 0x30, 0x01, 0x00, 0xB8, 0x30, 0x01, 0x00, 0xBD, 0x30, @@ -2040,7 +2040,7 @@ uint8 SkyControl::_resetDiff331[824] = { 0x35, 0x00, 0x34, 0x31, 0x1A, 0x00, 0x36, 0x31 }; -uint8 SkyControl::_resetDiff348[824] = { +uint8 Control::_resetDiff348[824] = { 0x04, 0x00, 0x5C, 0x01, 0xE9, 0x02, 0x76, 0x00, 0x1B, 0x00, 0x39, 0x31, 0x01, 0x00, 0xF2, 0x30, 0x01, 0x00, 0xF3, 0x30, 0x01, 0x00, 0xF4, 0x30, 0x01, 0x00, 0x3A, 0x31, 0x01, 0x00, 0x3B, 0x31, 0x01, 0x00, 0x3C, 0x31, 0x01, 0x00, 0xB7, 0x30, 0x01, 0x00, 0xB8, 0x30, 0x01, 0x00, 0xBD, 0x30, @@ -2095,7 +2095,7 @@ uint8 SkyControl::_resetDiff348[824] = { 0x35, 0x00, 0x34, 0x31, 0x1A, 0x00, 0x36, 0x31 }; -uint8 SkyControl::_resetDiffCd[856] = { +uint8 Control::_resetDiffCd[856] = { 0x04, 0x00, 0x70, 0x01, 0xE9, 0x02, 0x76, 0x00, 0x1B, 0x00, 0x39, 0x31, 0x01, 0x00, 0xF2, 0x30, 0x01, 0x00, 0xF3, 0x30, 0x01, 0x00, 0xF4, 0x30, 0x01, 0x00, 0x3A, 0x31, 0x01, 0x00, 0x3B, 0x31, 0x01, 0x00, 0x3C, 0x31, 0x01, 0x00, 0xB7, 0x30, 0x01, 0x00, 0xB8, 0x30, 0x01, 0x00, 0xBD, 0x30, diff --git a/sky/control.cpp b/sky/control.cpp index 9a6b63b618..367a908118 100644 --- a/sky/control.cpp +++ b/sky/control.cpp @@ -42,7 +42,7 @@ extern void force_keyboard(bool); namespace Sky { -SkyConResource::SkyConResource(void *pSpData, uint32 pNSprites, uint32 pCurSprite, uint16 pX, uint16 pY, uint32 pText, uint8 pOnClick, OSystem *system, uint8 *screen) { +ConResource::ConResource(void *pSpData, uint32 pNSprites, uint32 pCurSprite, uint16 pX, uint16 pY, uint32 pText, uint8 pOnClick, OSystem *system, uint8 *screen) { _spriteData = (dataFileHeader *)pSpData; _numSprites = pNSprites; @@ -55,7 +55,7 @@ SkyConResource::SkyConResource(void *pSpData, uint32 pNSprites, uint32 pCurSprit _screen = screen; } -bool SkyConResource::isMouseOver(uint32 mouseX, uint32 mouseY) { +bool ConResource::isMouseOver(uint32 mouseX, uint32 mouseY) { if ((mouseX >= _x) && (mouseY >= _y) && ((uint16)mouseX <= _x + _spriteData->s_width) && ((uint16)mouseY <= _y + _spriteData->s_height)) return true; @@ -63,7 +63,7 @@ bool SkyConResource::isMouseOver(uint32 mouseX, uint32 mouseY) { return false; } -void SkyConResource::drawToScreen(bool doMask) { +void ConResource::drawToScreen(bool doMask) { uint8 *screenPos = _y * GAME_SCREEN_WIDTH + _x + _screen; uint8 *updatePos = screenPos; @@ -89,18 +89,18 @@ void SkyConResource::drawToScreen(bool doMask) { _system->copy_rect(updatePos, GAME_SCREEN_WIDTH, _x, _y, _spriteData->s_width, _spriteData->s_height); } -SkyTextResource::SkyTextResource(void *pSpData, uint32 pNSprites, uint32 pCurSprite, uint16 pX, uint16 pY, uint32 pText, uint8 pOnClick, OSystem *system, uint8 *screen) : - SkyConResource(pSpData, pNSprites, pCurSprite, pX, pY, pText, pOnClick, system, screen) { +TextResource::TextResource(void *pSpData, uint32 pNSprites, uint32 pCurSprite, uint16 pX, uint16 pY, uint32 pText, uint8 pOnClick, OSystem *system, uint8 *screen) : + ConResource(pSpData, pNSprites, pCurSprite, pX, pY, pText, pOnClick, system, screen) { _oldScreen = (uint8 *)malloc(PAN_CHAR_HEIGHT * 3 * PAN_LINE_WIDTH); _oldY = 0; _oldX = GAME_SCREEN_WIDTH; } -SkyTextResource::~SkyTextResource(void) { +TextResource::~TextResource(void) { free(_oldScreen); } -void SkyTextResource::flushForRedraw(void) { +void TextResource::flushForRedraw(void) { if (_oldX < GAME_SCREEN_WIDTH) { uint16 cpWidth = (PAN_LINE_WIDTH > (GAME_SCREEN_WIDTH - _oldX))?(GAME_SCREEN_WIDTH - _oldX):(PAN_LINE_WIDTH); @@ -110,7 +110,7 @@ void SkyTextResource::flushForRedraw(void) { _oldX = GAME_SCREEN_WIDTH; } -void SkyTextResource::drawToScreen(bool doMask) { +void TextResource::drawToScreen(bool doMask) { doMask = true; uint16 cnty, cntx, cpWidth, cpHeight; @@ -152,21 +152,21 @@ void SkyTextResource::drawToScreen(bool doMask) { _system->copy_rect(_screen + _y * GAME_SCREEN_WIDTH + _x, GAME_SCREEN_WIDTH, _x, _y, cpWidth, cpHeight); } -SkyControlStatus::SkyControlStatus(SkyText *skyText, OSystem *system, uint8 *scrBuf) { +ControlStatus::ControlStatus(Text *skyText, OSystem *system, uint8 *scrBuf) { _skyText = skyText; _system = system; _screenBuf = scrBuf; _textData = NULL; - _statusText = new SkyTextResource(NULL, 2, 1, 64, 163, 0, DO_NOTHING, _system, _screenBuf); + _statusText = new TextResource(NULL, 2, 1, 64, 163, 0, DO_NOTHING, _system, _screenBuf); } -SkyControlStatus::~SkyControlStatus(void) { +ControlStatus::~ControlStatus(void) { if (_textData) free(_textData); delete _statusText; } -void SkyControlStatus::setToText(const char *newText) { +void ControlStatus::setToText(const char *newText) { char tmpLine[256]; strcpy(tmpLine, newText); if (_textData) { @@ -179,7 +179,7 @@ void SkyControlStatus::setToText(const char *newText) { _statusText->drawToScreen(WITH_MASK); } -void SkyControlStatus::setToText(uint16 textNum) { +void ControlStatus::setToText(uint16 textNum) { _skyText->getText(textNum); if (_textData) free(_textData); @@ -189,12 +189,12 @@ void SkyControlStatus::setToText(uint16 textNum) { _statusText->drawToScreen(WITH_MASK); } -void SkyControlStatus::drawToScreen(void) { +void ControlStatus::drawToScreen(void) { _statusText->flushForRedraw(); _statusText->drawToScreen(WITH_MASK); } -SkyControl::SkyControl(SkyScreen *screen, SkyDisk *disk, SkyMouse *mouse, SkyText *text, SkyMusicBase *music, SkyLogic *logic, SkySound *sound, OSystem *system, const char *savePath) { +Control::Control(Screen *screen, Disk *disk, Mouse *mouse, Text *text, MusicBase *music, Logic *logic, Sound *sound, OSystem *system, const char *savePath) { _skyScreen = screen; _skyDisk = disk; @@ -208,7 +208,7 @@ SkyControl::SkyControl(SkyScreen *screen, SkyDisk *disk, SkyMouse *mouse, SkyTex _memListRoot = NULL; } -SkyConResource *SkyControl::createResource(void *pSpData, uint32 pNSprites, uint32 pCurSprite, int16 pX, int16 pY, uint32 pText, uint8 pOnClick, uint8 panelType) { +ConResource *Control::createResource(void *pSpData, uint32 pNSprites, uint32 pCurSprite, int16 pX, int16 pY, uint32 pText, uint8 pOnClick, uint8 panelType) { if (pText) pText += 0x7000; if (panelType == MAINPANEL) { @@ -218,10 +218,10 @@ SkyConResource *SkyControl::createResource(void *pSpData, uint32 pNSprites, uint pX += SPNL_X; pY += SPNL_Y; } - return new SkyConResource(pSpData, pNSprites, pCurSprite, pX, pY, pText, pOnClick, _system, _screenBuf); + return new ConResource(pSpData, pNSprites, pCurSprite, pX, pY, pText, pOnClick, _system, _screenBuf); } -void SkyControl::removePanel(void) { +void Control::removePanel(void) { free(_screenBuf); free(_sprites.controlPanel); free(_sprites.button); @@ -239,7 +239,7 @@ void SkyControl::removePanel(void) { delete _statusBar; } -void SkyControl::initPanel(void) { +void Control::initPanel(void) { _screenBuf = (uint8 *)malloc(GAME_SCREEN_WIDTH * FULL_SCREEN_HEIGHT); memset(_screenBuf, 0, GAME_SCREEN_WIDTH * FULL_SCREEN_HEIGHT); @@ -285,7 +285,7 @@ void SkyControl::initPanel(void) { _bodge = createResource( _sprites.musicBodge, 2, 1, 98, 115, 0, DO_NOTHING, MAINPANEL); _yesNo = createResource( _sprites.yesNo, 1, 0, -2, 40, 0, DO_NOTHING, MAINPANEL); - _text = new SkyTextResource(NULL, 1, 0, 15, 137, 0, DO_NOTHING, _system, _screenBuf); + _text = new TextResource(NULL, 1, 0, 15, 137, 0, DO_NOTHING, _system, _screenBuf); _controlPanLookList[0] = _exitButton; _controlPanLookList[1] = _restorePanButton; _controlPanLookList[2] = _savePanButton; @@ -316,10 +316,10 @@ void SkyControl::initPanel(void) { _restorePanLookList[5] = _savePanLookList[5] = _quitButton; _restorePanLookList[6] = _autoSaveButton; - _statusBar = new SkyControlStatus(_skyText, _system, _screenBuf); + _statusBar = new ControlStatus(_skyText, _system, _screenBuf); } -void SkyControl::buttonControl(SkyConResource *pButton) { +void Control::buttonControl(ConResource *pButton) { char autoSave[] = "Restore Autosave"; if (pButton == NULL) { @@ -348,7 +348,7 @@ void SkyControl::buttonControl(SkyConResource *pButton) { _text->setXY(_mouseX + 12, _mouseY - 16); } -void SkyControl::drawTextCross(uint32 flags) { +void Control::drawTextCross(uint32 flags) { _bodge->drawToScreen(NO_MASK); if (!(flags & SF_ALLOW_SPEECH)) @@ -357,7 +357,7 @@ void SkyControl::drawTextCross(uint32 flags) { drawCross(173, 124); } -void SkyControl::drawCross(uint16 x, uint16 y) { +void Control::drawCross(uint16 x, uint16 y) { _text->flushForRedraw(); uint8 *bufPos, *crossPos; @@ -375,7 +375,7 @@ void SkyControl::drawCross(uint16 x, uint16 y) { _text->drawToScreen(WITH_MASK); } -void SkyControl::animClick(SkyConResource *pButton) { +void Control::animClick(ConResource *pButton) { if (pButton->_curSprite != pButton->_numSprites -1) { pButton->_curSprite++; @@ -392,7 +392,7 @@ void SkyControl::animClick(SkyConResource *pButton) { } } -void SkyControl::drawMainPanel(void) { +void Control::drawMainPanel(void) { memset(_screenBuf, 0, GAME_SCREEN_WIDTH * FULL_SCREEN_HEIGHT); _system->copy_rect(_screenBuf, GAME_SCREEN_WIDTH, 0, 0, GAME_SCREEN_WIDTH, FULL_SCREEN_HEIGHT); @@ -413,7 +413,7 @@ void SkyControl::drawMainPanel(void) { _statusBar->drawToScreen(); } -void SkyControl::doLoadSavePanel(void) { +void Control::doLoadSavePanel(void) { if (SkyEngine::isDemo()) return; // I don't think this can even happen initPanel(); @@ -443,7 +443,7 @@ void SkyControl::doLoadSavePanel(void) { _skyText->fnSetFont(_savedCharSet); } -void SkyControl::doControlPanel(void) { +void Control::doControlPanel(void) { if (SkyEngine::isDemo()) { return ; @@ -509,7 +509,7 @@ void SkyControl::doControlPanel(void) { _skyText->fnSetFont(_savedCharSet); } -uint16 SkyControl::handleClick(SkyConResource *pButton) { +uint16 Control::handleClick(ConResource *pButton) { char quitDos[] = "Quit to DOS?"; @@ -584,11 +584,11 @@ uint16 SkyControl::handleClick(SkyConResource *pButton) { } return 0; default: - error("SkyControl::handleClick: unknown routine: %X",pButton->_onClick); + error("Control::handleClick: unknown routine: %X",pButton->_onClick); } } -bool SkyControl::getYesNo(char *text) { +bool Control::getYesNo(char *text) { bool retVal = false; bool quitPanel = false; @@ -605,7 +605,7 @@ bool SkyControl::getYesNo(char *text) { } else dlgTextDat = NULL; - SkyTextResource *dlgText = new SkyTextResource(dlgTextDat, 1, 0, MPNL_X+2, textY, 0, DO_NOTHING, _system, _screenBuf); + TextResource *dlgText = new TextResource(dlgTextDat, 1, 0, MPNL_X+2, textY, 0, DO_NOTHING, _system, _screenBuf); dlgText->drawToScreen(WITH_MASK); while (!quitPanel) { @@ -640,7 +640,7 @@ bool SkyControl::getYesNo(char *text) { return retVal; } -uint16 SkyControl::doMusicSlide(void) { +uint16 Control::doMusicSlide(void) { int ofsY = _slide2->_y - _mouseY; uint8 volume; @@ -666,7 +666,7 @@ uint16 SkyControl::doMusicSlide(void) { return 0; } -uint16 SkyControl::doSpeedSlide(void) { +uint16 Control::doSpeedSlide(void) { int ofsY = _slide->_y - _mouseY; uint16 speedDelay = _slide->_y - (MPNL_Y + 93); @@ -695,7 +695,7 @@ uint16 SkyControl::doSpeedSlide(void) { return SPEED_CHANGED; } -uint16 SkyControl::toggleFx(SkyConResource *pButton) { +uint16 Control::toggleFx(ConResource *pButton) { SkyEngine::_systemVars.systemFlags ^= SF_FX_OFF; if (SkyEngine::_systemVars.systemFlags & SF_FX_OFF) { @@ -713,7 +713,7 @@ uint16 SkyControl::toggleFx(SkyConResource *pButton) { return TOGGLED; } -uint16 SkyControl::toggleText(void) { +uint16 Control::toggleText(void) { uint32 flags = SkyEngine::_systemVars.systemFlags & TEXT_FLAG_MASK; SkyEngine::_systemVars.systemFlags &= ~TEXT_FLAG_MASK; @@ -737,7 +737,7 @@ uint16 SkyControl::toggleText(void) { return TOGGLED; } -void SkyControl::toggleMusic(void) { +void Control::toggleMusic(void) { if (SkyEngine::_systemVars.systemFlags & SF_MUS_OFF) { SkyEngine::_systemVars.systemFlags &= ~SF_MUS_OFF; @@ -750,7 +750,7 @@ void SkyControl::toggleMusic(void) { } } -uint16 SkyControl::shiftDown(uint8 speed) { +uint16 Control::shiftDown(uint8 speed) { if (speed == SLOW) { if (_firstText >= MAX_SAVE_GAMES - MAX_ON_SCREEN) return 0; @@ -765,7 +765,7 @@ uint16 SkyControl::shiftDown(uint8 speed) { return SHIFTED; } -uint16 SkyControl::shiftUp(uint8 speed) { +uint16 Control::shiftUp(uint8 speed) { if (speed == SLOW) { if (_firstText > 0) _firstText--; @@ -778,7 +778,7 @@ uint16 SkyControl::shiftUp(uint8 speed) { return SHIFTED; } -bool SkyControl::autoSaveExists(void) { +bool Control::autoSaveExists(void) { bool test = false; SaveFile *f; @@ -797,13 +797,13 @@ bool SkyControl::autoSaveExists(void) { return test; } -uint16 SkyControl::saveRestorePanel(bool allowSave) { +uint16 Control::saveRestorePanel(bool allowSave) { _keyPressed = 0; buttonControl(NULL); _text->drawToScreen(WITH_MASK); // flush text restore buffer - SkyConResource **lookList; + ConResource **lookList; uint16 cnt; uint8 lookListLen; if (allowSave) { @@ -926,14 +926,14 @@ uint16 SkyControl::saveRestorePanel(bool allowSave) { return clickRes; } -bool SkyControl::checkKeyList(uint8 key) { +bool Control::checkKeyList(uint8 key) { static const uint8 charList[14] = " ,().='-&+!?\""; for (uint chCnt = 0; chCnt < ARRAYSIZE(charList); chCnt++) if (charList[chCnt] == key) return true; return false; } -void SkyControl::handleKeyPress(uint8 key, uint8 *textBuf) { +void Control::handleKeyPress(uint8 key, uint8 *textBuf) { if (key == 8) { // backspace for (uint8 cnt = 0; cnt < 6; cnt++) @@ -960,7 +960,7 @@ void SkyControl::handleKeyPress(uint8 key, uint8 *textBuf) { } } -void SkyControl::setUpGameSprites(uint8 *nameBuf, dataFileHeader **nameSprites, uint16 firstNum, uint16 selectedGame) { +void Control::setUpGameSprites(uint8 *nameBuf, dataFileHeader **nameSprites, uint16 firstNum, uint16 selectedGame) { char cursorChar[2] = "-"; nameBuf += firstNum * MAX_TEXT_LEN; @@ -984,9 +984,9 @@ void SkyControl::setUpGameSprites(uint8 *nameBuf, dataFileHeader **nameSprites, } } -void SkyControl::showSprites(dataFileHeader **nameSprites, bool allowSave) { +void Control::showSprites(dataFileHeader **nameSprites, bool allowSave) { - SkyConResource *drawResource = new SkyConResource(NULL, 1, 0, 0, 0, 0, 0, _system, _screenBuf); + ConResource *drawResource = new ConResource(NULL, 1, 0, 0, 0, 0, 0, _system, _screenBuf); for (uint16 cnt = 0; cnt < MAX_ON_SCREEN; cnt++) { drawResource->setSprite(nameSprites[cnt]); drawResource->setXY(GAME_NAME_X, GAME_NAME_Y + cnt * PAN_CHAR_HEIGHT); @@ -1006,7 +1006,7 @@ void SkyControl::showSprites(dataFileHeader **nameSprites, bool allowSave) { delete drawResource; } -void SkyControl::loadDescriptions(uint8 *destBuf) { +void Control::loadDescriptions(uint8 *destBuf) { memset(destBuf, 0, MAX_SAVE_GAMES * MAX_TEXT_LEN); @@ -1038,21 +1038,21 @@ void SkyControl::loadDescriptions(uint8 *destBuf) { delete mgr; } -bool SkyControl::loadSaveAllowed(void) { +bool Control::loadSaveAllowed(void) { if (SkyEngine::_systemVars.systemFlags & SF_CHOOSING) return false; // texts get lost during load/save, so don't allow it during choosing - if (SkyLogic::_scriptVariables[SCREEN] >= 101) + if (Logic::_scriptVariables[SCREEN] >= 101) return false; // same problem with LINC terminals - if ((SkyLogic::_scriptVariables[SCREEN] >= 82) && - (SkyLogic::_scriptVariables[SCREEN] != 85) && - (SkyLogic::_scriptVariables[SCREEN] < 90)) + if ((Logic::_scriptVariables[SCREEN] >= 82) && + (Logic::_scriptVariables[SCREEN] != 85) && + (Logic::_scriptVariables[SCREEN] < 90)) return false; // don't allow saving in final rooms return true; } -void SkyControl::saveDescriptions(uint8 *srcBuf) { +void Control::saveDescriptions(uint8 *srcBuf) { uint8 *tmpBuf = (uint8 *)malloc(MAX_SAVE_GAMES * MAX_TEXT_LEN); uint8 *tmpPos = tmpBuf; @@ -1081,7 +1081,7 @@ void SkyControl::saveDescriptions(uint8 *srcBuf) { free(tmpBuf); } -void SkyControl::doAutoSave(void) { +void Control::doAutoSave(void) { char fName[20]; if (SkyEngine::isCDVersion()) strcpy(fName, "SKY-VM-CD.ASD"); @@ -1105,7 +1105,7 @@ void SkyControl::doAutoSave(void) { free(saveData); } -uint16 SkyControl::saveGameToFile(void) { +uint16 Control::saveGameToFile(void) { char fName[20]; sprintf(fName,"SKY-VM.%03d", _selectedGame); @@ -1135,7 +1135,7 @@ uint16 SkyControl::saveGameToFile(void) { #define STOSD(ptr, val) { *(uint32 *)(ptr) = TO_LE_32(val); (ptr) += 4; } #define STOSW(ptr, val) { *(uint16 *)(ptr) = TO_LE_16(val); (ptr) += 2; } -void SkyControl::stosMegaSet(uint8 **destPos, MegaSet *mega) { +void Control::stosMegaSet(uint8 **destPos, MegaSet *mega) { STOSW(*destPos, mega->gridWidth); STOSW(*destPos, mega->colOffset); STOSW(*destPos, mega->colWidth); @@ -1143,7 +1143,7 @@ void SkyControl::stosMegaSet(uint8 **destPos, MegaSet *mega) { // anims, stands, turnTable } -void SkyControl::stosStr(uint8 **destPos, Compact *cpt, uint16 type) { +void Control::stosStr(uint8 **destPos, Compact *cpt, uint16 type) { uint16 strLen = 0; if (type & SAVE_GRAFX) { STOSW(*destPos, cpt->grafixProg.ptrType); @@ -1163,7 +1163,7 @@ void SkyControl::stosStr(uint8 **destPos, Compact *cpt, uint16 type) { } } -void SkyControl::stosCompact(uint8 **destPos, Compact *cpt) { +void Control::stosCompact(uint8 **destPos, Compact *cpt) { uint16 saveType = 0; if (cpt->extCompact) { saveType |= SAVE_EXT; @@ -1246,7 +1246,7 @@ void SkyControl::stosCompact(uint8 **destPos, Compact *cpt) { } } -uint32 SkyControl::prepareSaveData(uint8 *destBuf) { +uint32 Control::prepareSaveData(uint8 *destBuf) { uint32 cnt; memset(destBuf, 0, 4); // space for data size @@ -1262,7 +1262,7 @@ uint32 SkyControl::prepareSaveData(uint8 *destBuf) { STOSD(destPos, _savedMouse); STOSD(destPos, SkyEngine::_systemVars.currentPalette); for (cnt = 0; cnt < 838; cnt++) - STOSD(destPos, SkyLogic::_scriptVariables[cnt]); + STOSD(destPos, Logic::_scriptVariables[cnt]); uint32 *loadedFilesList = _skyDisk->giveLoadedFilesList(); for (cnt = 0; cnt < 60; cnt++) @@ -1289,14 +1289,14 @@ uint32 SkyControl::prepareSaveData(uint8 *destBuf) { #undef STOSD #undef STOSW -void SkyControl::appendMemList(uint16 *pMem) { +void Control::appendMemList(uint16 *pMem) { AllocedMem *newMem = new AllocedMem; newMem->mem = pMem; newMem->next = _memListRoot; _memListRoot = newMem; } -void SkyControl::freeMemList(void) { +void Control::freeMemList(void) { AllocedMem *block = _memListRoot; AllocedMem *temp; while (block) { @@ -1312,7 +1312,7 @@ void SkyControl::freeMemList(void) { #define LODSD(strPtr, val) { val = READ_LE_UINT32(strPtr); (strPtr) += 4; } #define LODSW(strPtr, val) { val = READ_LE_UINT16(strPtr); (strPtr) += 2; } -void SkyControl::lodsMegaSet(uint8 **srcPos, MegaSet *mega) { +void Control::lodsMegaSet(uint8 **srcPos, MegaSet *mega) { LODSW(*srcPos, mega->gridWidth); LODSW(*srcPos, mega->colOffset); LODSW(*srcPos, mega->colWidth); @@ -1320,7 +1320,7 @@ void SkyControl::lodsMegaSet(uint8 **srcPos, MegaSet *mega) { // anims, stands, turnTable } -void SkyControl::lodsCompact(uint8 **srcPos, Compact *cpt) { +void Control::lodsCompact(uint8 **srcPos, Compact *cpt) { uint16 saveType, cnt; LODSW(*srcPos, saveType); @@ -1423,10 +1423,10 @@ void SkyControl::lodsCompact(uint8 **srcPos, Compact *cpt) { } } -uint16 SkyControl::parseSaveData(uint8 *srcBuf) { +uint16 Control::parseSaveData(uint8 *srcBuf) { uint32 reloadList[60]; - uint32 oldSection = SkyLogic::_scriptVariables[CUR_SECTION]; + uint32 oldSection = Logic::_scriptVariables[CUR_SECTION]; uint32 cnt; uint8 *srcPos = srcBuf; @@ -1465,7 +1465,7 @@ uint16 SkyControl::parseSaveData(uint8 *srcBuf) { LODSD(srcPos, palette); for (cnt = 0; cnt < 838; cnt++) - LODSD(srcPos, SkyLogic::_scriptVariables[cnt]); + LODSD(srcPos, Logic::_scriptVariables[cnt]); for (cnt = 0; cnt < 60; cnt++) LODSD(srcPos, reloadList[cnt]); @@ -1490,7 +1490,7 @@ uint16 SkyControl::parseSaveData(uint8 *srcBuf) { SkyEngine::_systemVars.systemFlags |= SF_GAME_RESTORED; if (!SkyEngine::isDemo()) { _skyLogic->fnLeaveSection(oldSection, 0, 0); - _skyLogic->fnEnterSection(SkyLogic::_scriptVariables[CUR_SECTION], 0, 0); + _skyLogic->fnEnterSection(Logic::_scriptVariables[CUR_SECTION], 0, 0); } _skyDisk->refreshFilesList(reloadList); SkyEngine::_systemVars.currentMusic = (uint16)music; @@ -1505,7 +1505,7 @@ uint16 SkyControl::parseSaveData(uint8 *srcBuf) { #undef LODSD #undef LODSW -uint16 SkyControl::restoreGameFromFile(bool autoSave) { +uint16 Control::restoreGameFromFile(bool autoSave) { char fName[20]; if (autoSave) { @@ -1545,7 +1545,7 @@ uint16 SkyControl::restoreGameFromFile(bool autoSave) { return res; } -uint16 SkyControl::quickXRestore(uint16 slot) { +uint16 Control::quickXRestore(uint16 slot) { uint16 result; initPanel(); _mouseClicked = false; @@ -1589,7 +1589,7 @@ uint16 SkyControl::quickXRestore(uint16 slot) { return result; } -uint16 *SkyControl::lz77decode(uint16 *data) { +uint16 *Control::lz77decode(uint16 *data) { uint32 size = READ_LE_UINT32(data); data += 2; uint16 *outBuf = (uint16*)malloc(size << 1); @@ -1625,7 +1625,7 @@ uint16 *SkyControl::lz77decode(uint16 *data) { return outBuf; } -void SkyControl::applyDiff(uint16 *data, uint16 *diffData, uint16 len) { +void Control::applyDiff(uint16 *data, uint16 *diffData, uint16 len) { for (uint16 cnt = 0; cnt < len; cnt++) { data += READ_LE_UINT16(diffData); diffData++; @@ -1635,7 +1635,7 @@ void SkyControl::applyDiff(uint16 *data, uint16 *diffData, uint16 len) { } } -void SkyControl::restartGame(void) { +void Control::restartGame(void) { if (SkyEngine::_systemVars.gameVersion <= 267) return; // no restart for floppy demo @@ -1669,7 +1669,7 @@ void SkyControl::restartGame(void) { SkyEngine::_systemVars.pastIntro = true; } -void SkyControl::delay(unsigned int amount) { +void Control::delay(unsigned int amount) { OSystem::Event event; @@ -1725,7 +1725,7 @@ void SkyControl::delay(unsigned int amount) { } while (cur < start + amount); } -void SkyControl::showGameQuitMsg(bool useScreen) { +void Control::showGameQuitMsg(bool useScreen) { SkyEngine::_systemVars.quitting = true; _skyText->fnSetFont(0); @@ -1762,7 +1762,7 @@ void SkyControl::showGameQuitMsg(bool useScreen) { _system->quit(); } -char SkyControl::_quitTexts[16][35] = { +char Control::_quitTexts[16][35] = { "Game over player one", "BE VIGILANT", "Das Spiel ist aus.", @@ -1781,7 +1781,7 @@ char SkyControl::_quitTexts[16][35] = { "BE VIGILANT", }; -uint8 SkyControl::_crossImg[594] = { +uint8 Control::_crossImg[594] = { 0xFF, 0xFF, 0xFF, 0xFF, 0x09, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0B, 0x61, 0xFF, 0xFF, 0xFF, 0xFF, 0x4F, 0x4D, 0x61, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, diff --git a/sky/control.h b/sky/control.h index 2c7e55f069..44e545a6e3 100644 --- a/sky/control.h +++ b/sky/control.h @@ -29,13 +29,13 @@ class OSystem; namespace Sky { -class SkyDisk; -class SkyScreen; -class SkyLogic; -class SkyMouse; -class SkyText; -class SkyMusicBase; -class SkySound; +class Disk; +class Screen; +class Logic; +class Mouse; +class Text; +class MusicBase; +class Sound; struct Compact; struct dataFileHeader; struct MegaSet; @@ -126,10 +126,10 @@ struct AllocedMem { AllocedMem *next; }; -class SkyConResource { +class ConResource { public: - SkyConResource(void *pSpData, uint32 pNSprites, uint32 pCurSprite, uint16 pX, uint16 pY, uint32 pText, uint8 pOnClick, OSystem *system, uint8 *screen); - virtual ~SkyConResource(void) {}; + ConResource(void *pSpData, uint32 pNSprites, uint32 pCurSprite, uint16 pX, uint16 pY, uint32 pText, uint8 pOnClick, OSystem *system, uint8 *screen); + virtual ~ConResource(void) {}; void setSprite(void *pSpData) { _spriteData = (dataFileHeader*)pSpData; }; void setText(uint32 pText) { if (pText) _text = pText + 0x7000; else _text = 0; }; void setXY(uint16 x, uint16 y) { _x = x; _y = y; }; @@ -146,10 +146,10 @@ public: private: }; -class SkyTextResource : public SkyConResource { +class TextResource : public ConResource { public: - SkyTextResource(void *pSpData, uint32 pNSprites, uint32 pCurSprite, uint16 pX, uint16 pY, uint32 pText, uint8 pOnClick, OSystem *system, uint8 *screen); - virtual ~SkyTextResource(void); + TextResource(void *pSpData, uint32 pNSprites, uint32 pCurSprite, uint16 pX, uint16 pY, uint32 pText, uint8 pOnClick, OSystem *system, uint8 *screen); + virtual ~TextResource(void); virtual void drawToScreen(bool doMask); void flushForRedraw(void); private: @@ -157,24 +157,24 @@ private: uint8 *_oldScreen; }; -class SkyControlStatus { +class ControlStatus { public: - SkyControlStatus(SkyText *skyText, OSystem *system, uint8 *scrBuf); - ~SkyControlStatus(void); + ControlStatus(Text *skyText, OSystem *system, uint8 *scrBuf); + ~ControlStatus(void); void setToText(const char *newText); void setToText(uint16 textNum); void drawToScreen(void); private: - SkyTextResource *_statusText; + TextResource *_statusText; dataFileHeader *_textData; - SkyText *_skyText; + Text *_skyText; OSystem *_system; uint8 *_screenBuf; }; -class SkyControl { +class Control { public: - SkyControl(SkyScreen *screen, SkyDisk *disk, SkyMouse *mouse, SkyText *text, SkyMusicBase *music, SkyLogic *logic, SkySound *sound, OSystem *system, const char *savePath); + Control(Screen *screen, Disk *disk, Mouse *mouse, Text *text, MusicBase *music, Logic *logic, Sound *sound, OSystem *system, const char *savePath); void doControlPanel(void); void doLoadSavePanel(void); void restartGame(void); @@ -191,13 +191,13 @@ private: void delay(unsigned int amount); - void animClick(SkyConResource *pButton); + void animClick(ConResource *pButton); bool getYesNo(char *text); - void buttonControl(SkyConResource *pButton); - uint16 handleClick(SkyConResource *pButton); + void buttonControl(ConResource *pButton); + uint16 handleClick(ConResource *pButton); uint16 doMusicSlide(void); uint16 doSpeedSlide(void); - uint16 toggleFx(SkyConResource *pButton); + uint16 toggleFx(ConResource *pButton); uint16 toggleText(void); void toggleMusic(void); uint16 shiftDown(uint8 speed); @@ -242,13 +242,13 @@ private: void appendMemList(uint16 *pMem); void freeMemList(void); - SkyScreen *_skyScreen; - SkyDisk *_skyDisk; - SkyMouse *_skyMouse; - SkyText *_skyText; - SkyMusicBase *_skyMusic; - SkyLogic *_skyLogic; - SkySound *_skySound; + Screen *_skyScreen; + Disk *_skyDisk; + Mouse *_skyMouse; + Text *_skyText; + MusicBase *_skyMusic; + Logic *_skyLogic; + Sound *_skySound; OSystem *_system; int _mouseX, _mouseY; bool _mouseClicked; @@ -275,25 +275,25 @@ private: uint32 _savedCharSet; uint16 _enteredTextWidth; - SkyConResource *createResource(void *pSpData, uint32 pNSprites, uint32 pCurSprite, int16 pX, int16 pY, uint32 pText, uint8 pOnClick, uint8 panelType); + ConResource *createResource(void *pSpData, uint32 pNSprites, uint32 pCurSprite, int16 pX, int16 pY, uint32 pText, uint8 pOnClick, uint8 panelType); dataFileHeader *_textSprite; - SkyTextResource *_text; + TextResource *_text; - SkyConResource *_controlPanel, *_exitButton, *_slide, *_slide2, *_slode; - SkyConResource *_restorePanButton, *_savePanButton, *_dosPanButton, *_restartPanButton, *_fxPanButton, *_musicPanButton; - SkyConResource *_bodge, *_yesNo; - SkyConResource *_controlPanLookList[9]; + ConResource *_controlPanel, *_exitButton, *_slide, *_slide2, *_slode; + ConResource *_restorePanButton, *_savePanButton, *_dosPanButton, *_restartPanButton, *_fxPanButton, *_musicPanButton; + ConResource *_bodge, *_yesNo; + ConResource *_controlPanLookList[9]; //- Save/restore panel - SkyConResource *_savePanel; - SkyConResource *_saveButton, *_downFastButton, *_downSlowButton; - SkyConResource *_upFastButton, *_upSlowButton, *_quitButton, *_restoreButton; - SkyConResource *_autoSaveButton; + ConResource *_savePanel; + ConResource *_saveButton, *_downFastButton, *_downSlowButton; + ConResource *_upFastButton, *_upSlowButton, *_quitButton, *_restoreButton; + ConResource *_autoSaveButton; - SkyConResource *_savePanLookList[6], *_restorePanLookList[7]; + ConResource *_savePanLookList[6], *_restorePanLookList[7]; - SkyControlStatus *_statusBar; + ControlStatus *_statusBar; static char _quitTexts[16][35]; static uint8 _crossImg[594]; diff --git a/sky/debug.cpp b/sky/debug.cpp index 60ecfd8fdb..d83075e0fa 100644 --- a/sky/debug.cpp +++ b/sky/debug.cpp @@ -210,22 +210,22 @@ static const char *section_0_compacts[] = { static const char *logic_table_names[] = { "return", - "SkyLogic::script", - "SkyLogic::auto_route", - "SkyLogic::ar_anim", - "SkyLogic::ar_turn", - "SkyLogic::alt", - "SkyLogic::anim", - "SkyLogic::turn", - "SkyLogic::cursor", - "SkyLogic::talk", - "SkyLogic::listen", - "SkyLogic::stopped", - "SkyLogic::choose", - "SkyLogic::frames", - "SkyLogic::pause", - "SkyLogic::wait_sync", - "SkyLogic::simple_anim", + "Logic::script", + "Logic::auto_route", + "Logic::ar_anim", + "Logic::ar_turn", + "Logic::alt", + "Logic::anim", + "Logic::turn", + "Logic::cursor", + "Logic::talk", + "Logic::listen", + "Logic::stopped", + "Logic::choose", + "Logic::frames", + "Logic::pause", + "Logic::wait_sync", + "Logic::simple_anim", }; static const char opcode_par[] = { @@ -1234,7 +1234,7 @@ static const char *scriptVars[] = { "man_loc3", }; -void SkyDebug::fetchCompact(uint32 a) { +void Debug::fetchCompact(uint32 a) { uint32 sectionNum = (a & 0xf000) >> 12; uint32 compactNum = (a & 0x0fff); @@ -1244,11 +1244,11 @@ void SkyDebug::fetchCompact(uint32 a) { debug(8, "Loading Compact %d from section %d", compactNum, sectionNum); } -void SkyDebug::logic(uint32 logic) { +void Debug::logic(uint32 logic) { debug(6, "LOGIC: %s", logic_table_names[logic]); } -void SkyDebug::script(uint32 command, uint16 *scriptData) { +void Debug::script(uint32 command, uint16 *scriptData) { debug(6, "SCRIPT: %s", opcodes[command]); if (command == 0 || command == 6) debug(6, " %s", scriptVars[READ_LE_UINT16(scriptData)/4]); @@ -1261,7 +1261,7 @@ void SkyDebug::script(uint32 command, uint16 *scriptData) { debug(6, ""); } -void SkyDebug::mcode(uint32 mcode, uint32 a, uint32 b, uint32 c) { +void Debug::mcode(uint32 mcode, uint32 a, uint32 b, uint32 c) { debug(6, "MCODE: %s(%d, %d, %d)", mcodes[mcode], a, b, c); } diff --git a/sky/debug.h b/sky/debug.h index ad8ac6d014..1e6917ebce 100644 --- a/sky/debug.h +++ b/sky/debug.h @@ -27,7 +27,7 @@ namespace Sky { -class SkyDebug { +class Debug { public: static void fetchCompact(uint32 a); static void logic(uint32 logic); diff --git a/sky/disk.cpp b/sky/disk.cpp index de17debe83..edc2709ffd 100644 --- a/sky/disk.cpp +++ b/sky/disk.cpp @@ -33,7 +33,7 @@ namespace Sky { static const char *dataFilename = "sky.dsk"; static const char *dinnerFilename = "sky.dnr"; -SkyDisk::SkyDisk(const Common::String &gameDataPath) { +Disk::Disk(const Common::String &gameDataPath) { _prefRoot = NULL; _dataDiskHandle = new File(); @@ -64,7 +64,7 @@ SkyDisk::SkyDisk(const Common::String &gameDataPath) { memset(_loadedFilesList, 0, 60 * 4); } -SkyDisk::~SkyDisk(void) { +Disk::~Disk(void) { PrefFile *fEntry = _prefRoot; while (fEntry) { @@ -79,7 +79,7 @@ SkyDisk::~SkyDisk(void) { delete _dataDiskHandle; } -void SkyDisk::flushPrefetched(void) { +void Disk::flushPrefetched(void) { PrefFile *fEntry = _prefRoot; while (fEntry) { @@ -91,14 +91,14 @@ void SkyDisk::flushPrefetched(void) { _prefRoot = NULL; } -bool SkyDisk::fileExists(uint16 fileNr) { +bool Disk::fileExists(uint16 fileNr) { return (getFileInfo(fileNr) != NULL); } //load in file file_nr to address dest //if dest == NULL, then allocate memory for this file -uint8 *SkyDisk::loadFile(uint16 fileNr, uint8 *dest) { +uint8 *Disk::loadFile(uint16 fileNr, uint8 *dest) { uint8 cflag; int32 bytesRead; @@ -233,7 +233,7 @@ uint8 *SkyDisk::loadFile(uint16 fileNr, uint8 *dest) { return _compDest; } -void SkyDisk::prefetchFile(uint16 fileNr) { +void Disk::prefetchFile(uint16 fileNr) { PrefFile **fEntry = &_prefRoot; bool found = false; @@ -242,7 +242,7 @@ void SkyDisk::prefetchFile(uint16 fileNr) { fEntry = &((*fEntry)->next); } if (found) { - debug(1,"SkyDisk::prefetchFile: File %d was already prefetched",fileNr); + debug(1,"Disk::prefetchFile: File %d was already prefetched",fileNr); return ; } uint8 *temp = loadFile(fileNr, NULL); @@ -253,7 +253,7 @@ void SkyDisk::prefetchFile(uint16 fileNr) { (*fEntry)->next = NULL; } -uint8 *SkyDisk::givePrefetched(uint16 fileNr, uint32 *fSize) { +uint8 *Disk::givePrefetched(uint16 fileNr, uint32 *fSize) { PrefFile **fEntry = &_prefRoot; bool found = false; @@ -273,7 +273,7 @@ uint8 *SkyDisk::givePrefetched(uint16 fileNr, uint32 *fSize) { return retPtr; } -uint8 *SkyDisk::getFileInfo(uint16 fileNr) { +uint8 *Disk::getFileInfo(uint16 fileNr) { uint16 i; uint16 *dnrTbl16Ptr = (uint16 *)_dinnerTableArea; @@ -290,7 +290,7 @@ uint8 *SkyDisk::getFileInfo(uint16 fileNr) { return 0; } -void SkyDisk::fnCacheChip(uint32 list) { +void Disk::fnCacheChip(uint32 list) { // fnCacheChip is called after fnCacheFast uint16 cnt = 0; @@ -304,7 +304,7 @@ void SkyDisk::fnCacheChip(uint32 list) { fnCacheFiles(); } -void SkyDisk::fnCacheFast(uint32 list) { +void Disk::fnCacheFast(uint32 list) { if (list == 0) return; uint8 cnt = 0; @@ -315,7 +315,7 @@ void SkyDisk::fnCacheFast(uint32 list) { } while (fList[cnt-1]); } -void SkyDisk::fnCacheFiles(void) { +void Disk::fnCacheFiles(void) { uint16 lCnt, bCnt, targCnt; targCnt = lCnt = 0; @@ -360,13 +360,13 @@ void SkyDisk::fnCacheFiles(void) { _loadedFilesList[targCnt] = 0; SkyEngine::_itemList[_buildList[bCnt] & 2047] = (void**)loadFile(_buildList[bCnt] & 0x7FFF, NULL); if (!SkyEngine::_itemList[_buildList[bCnt] & 2047]) - warning("fnCacheFiles: SkyDisk::loadFile() returned NULL for file %d",_buildList[bCnt] & 0x7FFF); + warning("fnCacheFiles: Disk::loadFile() returned NULL for file %d",_buildList[bCnt] & 0x7FFF); bCnt++; } _buildList[0] = 0; } -void SkyDisk::refreshFilesList(uint32 *list) { +void Disk::refreshFilesList(uint32 *list) { uint8 cnt = 0; while (_loadedFilesList[cnt]) { @@ -384,7 +384,7 @@ void SkyDisk::refreshFilesList(uint32 *list) { _loadedFilesList[cnt] = 0; } -void SkyDisk::fnMiniLoad(uint16 fileNum) { +void Disk::fnMiniLoad(uint16 fileNum) { uint16 cnt = 0; while (_loadedFilesList[cnt]) { @@ -396,7 +396,7 @@ void SkyDisk::fnMiniLoad(uint16 fileNum) { SkyEngine::_itemList[fileNum & 2047] = (void**)loadFile(fileNum, NULL); } -void SkyDisk::fnFlushBuffers(void) { +void Disk::fnFlushBuffers(void) { // dump all loaded sprites uint8 lCnt = 0; @@ -408,7 +408,7 @@ void SkyDisk::fnFlushBuffers(void) { _loadedFilesList[0] = 0; } -void SkyDisk::dumpFile(uint16 fileNr) { +void Disk::dumpFile(uint16 fileNr) { char buf[128]; File out; byte* filePtr; @@ -427,7 +427,7 @@ void SkyDisk::dumpFile(uint16 fileNr) { free(filePtr); } -uint32 SkyDisk::determineGameVersion() { +uint32 Disk::determineGameVersion() { //determine game version based on number of entries in dinner table switch (_dinnerTableEntries) { case 243: diff --git a/sky/disk.h b/sky/disk.h index 448e954ccf..65f77da347 100644 --- a/sky/disk.h +++ b/sky/disk.h @@ -39,10 +39,10 @@ struct PrefFile { PrefFile *next; }; -class SkyDisk { +class Disk { public: - SkyDisk(const Common::String &gameDataPath); - ~SkyDisk(void); + Disk(const Common::String &gameDataPath); + ~Disk(void); uint8 *loadFile(uint16 fileNr, uint8 *dest); bool fileExists(uint16 fileNr); diff --git a/sky/grid.cpp b/sky/grid.cpp index 1a62d27d44..57422bc41e 100644 --- a/sky/grid.cpp +++ b/sky/grid.cpp @@ -28,7 +28,7 @@ namespace Sky { #define GRID_FILE_START 60000 -int8 SkyGrid::_gridConvertTable[] = { +int8 Grid::_gridConvertTable[] = { 0, //0 1, //1 @@ -129,18 +129,18 @@ int8 SkyGrid::_gridConvertTable[] = { 69, //96 }; -SkyGrid::SkyGrid(SkyDisk *pDisk) { +Grid::Grid(Disk *pDisk) { _gameGrids = (uint8 *)malloc(TOT_NO_GRIDS * GRID_SIZE); _skyDisk = pDisk; } -SkyGrid::~SkyGrid(void) { +Grid::~Grid(void) { free(_gameGrids); } -void SkyGrid::loadGrids(void) { +void Grid::loadGrids(void) { // no endian conversion necessary as I'm using uint8* instead of uint32* for (uint8 cnt = 0; cnt < TOT_NO_GRIDS; cnt++) @@ -148,18 +148,18 @@ void SkyGrid::loadGrids(void) { if (!SkyEngine::isDemo()) { // single disk demos never get that far // Reloading the grids can sometimes cause problems eg when reichs door is // open the door grid bit gets replaced so you can't get back in (or out) - if (SkyLogic::_scriptVariables[REICH_DOOR_FLAG]) + if (Logic::_scriptVariables[REICH_DOOR_FLAG]) removeGrid(256, 280, 1, &SkyCompact::reich_door_20); } } -bool SkyGrid::getGridValues(Compact *cpt, uint32 *resBitNum, uint32 *resWidth) { +bool Grid::getGridValues(Compact *cpt, uint32 *resBitNum, uint32 *resWidth) { uint16 width = SkyCompact::getMegaSet(cpt, cpt->extCompact->megaSet)->gridWidth; return getGridValues(cpt->xcood, cpt->ycood, width, cpt, resBitNum, resWidth); } -bool SkyGrid::getGridValues(uint32 x, uint32 y, uint32 width, Compact *cpt, uint32 *resBitNum, uint32 *resWidth) { +bool Grid::getGridValues(uint32 x, uint32 y, uint32 width, Compact *cpt, uint32 *resBitNum, uint32 *resWidth) { uint32 bitPos; if (y < TOP_LEFT_Y) return false; // off screen @@ -194,14 +194,14 @@ bool SkyGrid::getGridValues(uint32 x, uint32 y, uint32 width, Compact *cpt, uint return true; } -void SkyGrid::removeObjectFromWalk(Compact *cpt) { +void Grid::removeObjectFromWalk(Compact *cpt) { uint32 bitNum, width; if (getGridValues(cpt, &bitNum, &width)) removeObjectFromWalk(bitNum, width); } -void SkyGrid::removeObjectFromWalk(uint32 bitNum, uint32 width) { +void Grid::removeObjectFromWalk(uint32 bitNum, uint32 width) { for (uint32 cnt = 0; cnt < width; cnt++) { _gameGrids[bitNum >> 3] &= ~(1 << (bitNum & 0x7)); @@ -211,14 +211,14 @@ void SkyGrid::removeObjectFromWalk(uint32 bitNum, uint32 width) { } } -void SkyGrid::objectToWalk(Compact *cpt) { +void Grid::objectToWalk(Compact *cpt) { uint32 bitNum, width; if (getGridValues(cpt, &bitNum, &width)) objectToWalk(bitNum, width); } -void SkyGrid::objectToWalk(uint32 bitNum, uint32 width) { +void Grid::objectToWalk(uint32 bitNum, uint32 width) { for (uint32 cnt = 0; cnt < width; cnt++) { _gameGrids[bitNum >> 3] |= (1 << (bitNum & 0x7)); @@ -228,21 +228,21 @@ void SkyGrid::objectToWalk(uint32 bitNum, uint32 width) { } } -void SkyGrid::plotGrid(uint32 x, uint32 y, uint32 width, Compact *cpt) { +void Grid::plotGrid(uint32 x, uint32 y, uint32 width, Compact *cpt) { uint32 resBitPos, resWidth; if (getGridValues(x, y, width-1, cpt, &resBitPos, &resWidth)) objectToWalk(resBitPos, resWidth); } -void SkyGrid::removeGrid(uint32 x, uint32 y, uint32 width, Compact *cpt) { +void Grid::removeGrid(uint32 x, uint32 y, uint32 width, Compact *cpt) { uint32 resBitPos, resWidth; if (getGridValues(x, y, width, cpt, &resBitPos, &resWidth)) removeObjectFromWalk(resBitPos, resWidth); } -uint8 *SkyGrid::giveGrid(uint32 pScreen) +uint8 *Grid::giveGrid(uint32 pScreen) { return _gameGrids + GRID_SIZE * _gridConvertTable[pScreen]; } diff --git a/sky/grid.h b/sky/grid.h index 43b9530839..fb473c4093 100644 --- a/sky/grid.h +++ b/sky/grid.h @@ -28,12 +28,12 @@ namespace Sky { struct Compact; -class SkyDisk; +class Disk; -class SkyGrid { +class Grid { public: - SkyGrid(SkyDisk *pDisk); - ~SkyGrid(void); + Grid(Disk *pDisk); + ~Grid(void); // grid.asm routines void loadGrids(void); @@ -56,7 +56,7 @@ public: private: static int8 _gridConvertTable[]; uint8 *_gameGrids; - SkyDisk *_skyDisk; + Disk *_skyDisk; }; } // End of namespace Sky diff --git a/sky/hufftext.cpp b/sky/hufftext.cpp index 56a2a3adf4..5fea2cc685 100644 --- a/sky/hufftext.cpp +++ b/sky/hufftext.cpp @@ -23,7 +23,7 @@ namespace Sky { -const HuffTree SkyText::_huffTree_00109[] = { +const HuffTree Text::_huffTree_00109[] = { { 1, 22, 0 }, { 2, 9, 0 }, { 3, 6, 0 }, @@ -193,7 +193,7 @@ const HuffTree SkyText::_huffTree_00109[] = { { 0, 0, 0x7C } }; -const HuffTree SkyText::_huffTree_00267[] = { +const HuffTree Text::_huffTree_00267[] = { { 1, 20, 0 }, { 2, 7, 0 }, { 3, 6, 0 }, @@ -383,7 +383,7 @@ const HuffTree SkyText::_huffTree_00267[] = { { 0, 0, 0x7c }, }; -const HuffTree SkyText::_huffTree_00288[] = { +const HuffTree Text::_huffTree_00288[] = { { 1, 20, 0 }, { 2, 7, 0 }, { 3, 4, 0 }, @@ -575,7 +575,7 @@ const HuffTree SkyText::_huffTree_00288[] = { { 0, 0, 0x7c }, }; -const HuffTree SkyText::_huffTree_00303[] = { +const HuffTree Text::_huffTree_00303[] = { { 1, 22, 0 }, { 2, 9, 0 }, { 3, 6, 0 }, @@ -777,7 +777,7 @@ const HuffTree SkyText::_huffTree_00303[] = { { 0, 0, 0x7c }, }; -const HuffTree SkyText::_huffTree_00331[] = { +const HuffTree Text::_huffTree_00331[] = { { 1, 20, 0 }, { 2, 7, 0 }, { 3, 4, 0 }, @@ -1009,7 +1009,7 @@ const HuffTree SkyText::_huffTree_00331[] = { { 0, 0, 0x7c }, }; -const HuffTree SkyText::_huffTree_00348[] = { +const HuffTree Text::_huffTree_00348[] = { { 1, 20, 0 }, { 2, 7, 0 }, { 3, 4, 0 }, @@ -1257,7 +1257,7 @@ const HuffTree SkyText::_huffTree_00348[] = { { 0, 0, 0x7C }, }; -const HuffTree SkyText::_huffTree_00365[] = { +const HuffTree Text::_huffTree_00365[] = { { 1, 20, 0 }, { 2, 7, 0 }, { 3, 4, 0 }, @@ -1505,7 +1505,7 @@ const HuffTree SkyText::_huffTree_00365[] = { { 0, 0, 0x7C }, }; -const HuffTree SkyText::_huffTree_00368[] = { +const HuffTree Text::_huffTree_00368[] = { { 1, 20, 0 }, { 2, 7, 0 }, { 3, 4, 0 }, @@ -1753,7 +1753,7 @@ const HuffTree SkyText::_huffTree_00368[] = { { 0, 0, 0x7C }, }; -const HuffTree SkyText::_huffTree_00372[] = { +const HuffTree Text::_huffTree_00372[] = { { 1, 20, 0 }, { 2, 7, 0 }, { 3, 4, 0 }, diff --git a/sky/intro.cpp b/sky/intro.cpp index 8a11643593..63103f1370 100644 --- a/sky/intro.cpp +++ b/sky/intro.cpp @@ -229,7 +229,7 @@ namespace Sky { #define CD_105 60098 -uint16 SkyIntro::_mainIntroSeq[] = { +uint16 Intro::_mainIntroSeq[] = { DELAY, 3000, // keep virgin screen up FADEDOWN, SHOWSCREEN, 60112, // revo screen + palette @@ -243,7 +243,7 @@ uint16 SkyIntro::_mainIntroSeq[] = { SEQEND }; -uint16 SkyIntro::_cdIntroSeq[] = { +uint16 Intro::_cdIntroSeq[] = { PLAYVOICE, 59500, LOADBG, 59499, LOOPBG, @@ -549,7 +549,7 @@ uint16 SkyIntro::_cdIntroSeq[] = { SEQEND }; -uint16 SkyIntro::_floppyIntroSeq[] = { +uint16 Intro::_floppyIntroSeq[] = { SHOWSCREEN, 60081, FADEUP, 60080, DOFLIRT, 60082, @@ -610,7 +610,7 @@ uint16 SkyIntro::_floppyIntroSeq[] = { SEQEND }; -SkyIntro::SkyIntro(SkyDisk *disk, SkyScreen *screen, SkyMusicBase *music, SkySound *sound, SkyText *text, SoundMixer *mixer, OSystem *system) { +Intro::Intro(Disk *disk, Screen *screen, MusicBase *music, Sound *sound, Text *text, SoundMixer *mixer, OSystem *system) { _skyDisk = disk; _skyScreen = screen; @@ -625,7 +625,7 @@ SkyIntro::SkyIntro(SkyDisk *disk, SkyScreen *screen, SkyMusicBase *music, SkySou _quitProg = false; } -SkyIntro::~SkyIntro(void) { +Intro::~Intro(void) { _mixer->stopAll(); _skyDisk->flushPrefetched(); @@ -638,7 +638,7 @@ SkyIntro::~SkyIntro(void) { free(_bgBuf); } -bool SkyIntro::doIntro(bool floppyIntro) { +bool Intro::doIntro(bool floppyIntro) { if (!SkyEngine::isCDVersion()) floppyIntro = true; @@ -670,7 +670,7 @@ bool SkyIntro::doIntro(bool floppyIntro) { return true; } -bool SkyIntro::nextPart(uint16 *&data) { +bool Intro::nextPart(uint16 *&data) { uint8 *vData = NULL; // return false means cancel intro @@ -760,7 +760,7 @@ bool SkyIntro::nextPart(uint16 *&data) { return true; } -bool SkyIntro::floppyScrollFlirt(void) { +bool Intro::floppyScrollFlirt(void) { uint8 *scrollScreen = (uint8*)malloc(FRAME_SIZE * 2); memset(scrollScreen, 0, FRAME_SIZE); @@ -804,7 +804,7 @@ bool SkyIntro::floppyScrollFlirt(void) { return doContinue; } -bool SkyIntro::commandFlirt(uint16 *&data) { +bool Intro::commandFlirt(uint16 *&data) { _skyScreen->startSequence(*data++); while ((*data != COMMANDEND) || _skyScreen->sequenceRunning()) { @@ -844,7 +844,7 @@ bool SkyIntro::commandFlirt(uint16 *&data) { return true; } -void SkyIntro::showTextBuf(void) { +void Intro::showTextBuf(void) { uint16 x = ((dataFileHeader*)_textBuf)->s_x; uint16 y = ((dataFileHeader*)_textBuf)->s_y; @@ -867,7 +867,7 @@ void SkyIntro::showTextBuf(void) { _system->copy_rect(screenBuf, GAME_SCREEN_WIDTH, x, y, width, height); } -void SkyIntro::restoreScreen(void) { +void Intro::restoreScreen(void) { uint16 x = ((dataFileHeader*)_saveBuf)->s_x; uint16 y = ((dataFileHeader*)_saveBuf)->s_y; @@ -883,7 +883,7 @@ void SkyIntro::restoreScreen(void) { _system->copy_rect(_saveBuf + sizeof(dataFileHeader), width, x, y, width, height); } -bool SkyIntro::escDelay(uint32 msecs) { +bool Intro::escDelay(uint32 msecs) { OSystem::Event event; do { diff --git a/sky/intro.h b/sky/intro.h index 3bd77c5f01..3f9066b15a 100644 --- a/sky/intro.h +++ b/sky/intro.h @@ -28,16 +28,16 @@ namespace Sky { -class SkyDisk; -class SkyScreen; -class SkyMusicBase; -class SkySound; -class SkyText; +class Disk; +class Screen; +class MusicBase; +class Sound; +class Text; -class SkyIntro { +class Intro { public: - SkyIntro(SkyDisk *disk, SkyScreen *screen, SkyMusicBase *music, SkySound *sound, SkyText *text, SoundMixer *mixer, OSystem *system); - ~SkyIntro(void); + Intro(Disk *disk, Screen *screen, MusicBase *music, Sound *sound, Text *text, SoundMixer *mixer, OSystem *system); + ~Intro(void); bool doIntro(bool floppyIntro); bool _quitProg; private: @@ -45,11 +45,11 @@ private: static uint16 _floppyIntroSeq[]; static uint16 _cdIntroSeq[]; - SkyDisk *_skyDisk; - SkyScreen *_skyScreen; - SkyMusicBase *_skyMusic; - SkySound *_skySound; - SkyText *_skyText; + Disk *_skyDisk; + Screen *_skyScreen; + MusicBase *_skyMusic; + Sound *_skySound; + Text *_skyText; OSystem *_system; SoundMixer *_mixer; diff --git a/sky/logic.cpp b/sky/logic.cpp index bbbc571d00..6d701e708b 100644 --- a/sky/logic.cpp +++ b/sky/logic.cpp @@ -42,38 +42,38 @@ namespace Sky { -uint32 SkyLogic::_scriptVariables[838]; +uint32 Logic::_scriptVariables[838]; -typedef void (SkyLogic::*LogicTable) (); +typedef void (Logic::*LogicTable) (); static const LogicTable logicTable[] = { - &SkyLogic::nop, - &SkyLogic::logicScript, // 1 script processor - &SkyLogic::autoRoute, // 2 Make a route - &SkyLogic::arAnim, // 3 Follow a route - &SkyLogic::arTurn, // 4 Mega turns araound - &SkyLogic::alt, // 5 Set up new get-to script - &SkyLogic::anim, // 6 Follow a sequence - &SkyLogic::turn, // 7 Mega turning - &SkyLogic::cursor, // 8 id tracks the pointer - &SkyLogic::talk, // 9 count down and animate - &SkyLogic::listen, // 10 player waits for talking id - &SkyLogic::stopped, // 11 wait for id to move - &SkyLogic::choose, // 12 wait for player to click - &SkyLogic::frames, // 13 animate just frames - &SkyLogic::pause, // 14 Count down to 0 and go - &SkyLogic::waitSync, // 15 Set to l_script when sync!=0 - &SkyLogic::simpleAnim, // 16 Module anim without x,y's + &Logic::nop, + &Logic::logicScript, // 1 script processor + &Logic::autoRoute, // 2 Make a route + &Logic::arAnim, // 3 Follow a route + &Logic::arTurn, // 4 Mega turns araound + &Logic::alt, // 5 Set up new get-to script + &Logic::anim, // 6 Follow a sequence + &Logic::turn, // 7 Mega turning + &Logic::cursor, // 8 id tracks the pointer + &Logic::talk, // 9 count down and animate + &Logic::listen, // 10 player waits for talking id + &Logic::stopped, // 11 wait for id to move + &Logic::choose, // 12 wait for player to click + &Logic::frames, // 13 animate just frames + &Logic::pause, // 14 Count down to 0 and go + &Logic::waitSync, // 15 Set to l_script when sync!=0 + &Logic::simpleAnim, // 16 Module anim without x,y's }; -SkyLogic::SkyLogic(SkyScreen *skyScreen, SkyDisk *skyDisk, SkyText *skyText, SkyMusicBase *skyMusic, SkyMouse *skyMouse, SkySound *skySound) { +Logic::Logic(Screen *skyScreen, Disk *skyDisk, Text *skyText, MusicBase *skyMusic, Mouse *skyMouse, Sound *skySound) { _skyScreen = skyScreen; _skyDisk = skyDisk; _skyText = skyText; _skyMusic = skyMusic; _skySound = skySound; _skyMouse = skyMouse; - _skyGrid = new SkyGrid(_skyDisk); - _skyAutoRoute = new SkyAutoRoute(_skyGrid); + _skyGrid = new Grid(_skyDisk); + _skyAutoRoute = new AutoRoute(_skyGrid); memset(_objectList, 0, 30 * sizeof(uint32)); @@ -85,7 +85,7 @@ SkyLogic::SkyLogic(SkyScreen *skyScreen, SkyDisk *skyDisk, SkyText *skyText, Sky initScriptVariables(); } -bool SkyLogic::checkProtection(void) { +bool Logic::checkProtection(void) { if (!_scriptVariables[ENTER_DIGITS]) return false; if (_scriptVariables[CONSOLE_TYPE] == 5) { // reactor code @@ -99,7 +99,7 @@ bool SkyLogic::checkProtection(void) { } } -void SkyLogic::engine() { +void Logic::engine() { uint16 *logicList = (uint16 *)SkyEngine::fetchCompact(_scriptVariables[LOGIC_LIST_NO]); while (uint16 id = *logicList++) { // 0 means end of list @@ -121,7 +121,7 @@ void SkyLogic::engine() { if (_compact->status & (1 << 7)) _skyGrid->removeObjectFromWalk(_compact); - SkyDebug::logic(_compact->logic); + Debug::logic(_compact->logic); (this->*logicTable[_compact->logic]) (); if (_compact->status & (1 << 7)) @@ -134,14 +134,14 @@ void SkyLogic::engine() { } } -void SkyLogic::nop() {} +void Logic::nop() {} /** * This function is basicly a wrapper around the real script engine. It runs * the script engine until a script has finished. * @see script() */ -void SkyLogic::logicScript() { +void Logic::logicScript() { /// Process the current mega's script /// If the script finishes then drop back a level @@ -159,7 +159,7 @@ void SkyLogic::logicScript() { } } -void SkyLogic::autoRoute() { +void Logic::autoRoute() { _compact->downFlag = _skyAutoRoute->autoRoute(_compact); if (_compact->downFlag != 1) { // route ok @@ -174,7 +174,7 @@ void SkyLogic::autoRoute() { return; } -void SkyLogic::arAnim() { +void Logic::arAnim() { /// Follow a route /// Mega should be in getToMode @@ -304,7 +304,7 @@ void SkyLogic::arAnim() { logicScript(); } -void SkyLogic::mainAnim() { +void Logic::mainAnim() { /// Extension of arAnim() _compact->extCompact->waitingFor = 0; // clear possible zero-zero skip @@ -360,7 +360,7 @@ void SkyLogic::mainAnim() { _compact->ycood += animList[(S_AR_Y + arAnimIndex)/2]; // update y coordinate } -void SkyLogic::arTurn() { +void Logic::arTurn() { _compact->frame = *_compact->extCompact->turnProg++; if (!*_compact->extCompact->turnProg) { // turn done? @@ -370,7 +370,7 @@ void SkyLogic::arTurn() { } } -void SkyLogic::alt() { +void Logic::alt() { /// change the current script _compact->logic = L_SCRIPT; *SkyCompact::getSub(_compact, _compact->mode) = _compact->extCompact->alt; @@ -378,7 +378,7 @@ void SkyLogic::alt() { logicScript(); } -void SkyLogic::anim() { +void Logic::anim() { /// Follow an animation sequence //uint16 *grafixProg = _compact->grafixProg; @@ -413,7 +413,7 @@ void SkyLogic::anim() { logicScript(); } -void SkyLogic::turn() { +void Logic::turn() { if (*_compact->extCompact->turnProg) { _compact->frame = *_compact->extCompact->turnProg++; return; @@ -426,7 +426,7 @@ void SkyLogic::turn() { logicScript(); } -void SkyLogic::cursor() { +void Logic::cursor() { _skyText->logicCursor(_compact, _skyMouse->giveMouseX(), _skyMouse->giveMouseY()); } @@ -485,7 +485,7 @@ static uint16 clickTable[46] = { 12289 }; -void SkyLogic::talk() { +void Logic::talk() { // first count through the frames // just frames - nothing tweeky // the speech finishes when the timer runs out & @@ -566,7 +566,7 @@ void SkyLogic::talk() { } } -void SkyLogic::listen() { +void Logic::listen() { /// Stay in this mode until id in getToFlag leaves L_TALK mode Compact *cpt = SkyEngine::fetchCompact(_compact->flag); @@ -578,7 +578,7 @@ void SkyLogic::listen() { logicScript(); } -void SkyLogic::stopped() { +void Logic::stopped() { /// waiting for another mega to move or give-up trying /// /// this mode will always be set up from a special script @@ -601,7 +601,7 @@ void SkyLogic::stopped() { logicScript(); } -void SkyLogic::choose() { +void Logic::choose() { // Remain in this mode until player selects some text if (!_scriptVariables[THE_CHOSEN_ONE]) return; @@ -614,7 +614,7 @@ void SkyLogic::choose() { logicScript(); } -void SkyLogic::frames() { +void Logic::frames() { if (!_compact->sync) simpleAnim(); else { @@ -624,7 +624,7 @@ void SkyLogic::frames() { } } -void SkyLogic::pause() { +void Logic::pause() { if (--_compact->flag) return; @@ -633,7 +633,7 @@ void SkyLogic::pause() { return; } -void SkyLogic::waitSync() { +void Logic::waitSync() { /// checks c_sync, when its non 0 /// the id is put back into script mode // use this instead of loops in the script @@ -645,7 +645,7 @@ void SkyLogic::waitSync() { logicScript(); } -void SkyLogic::simpleAnim() { +void Logic::simpleAnim() { /// follow an animation sequence module whilst ignoring the coordinate data uint16 *grafixProg = SkyCompact::getGrafixPtr(_compact); @@ -681,7 +681,7 @@ void SkyLogic::simpleAnim() { logicScript(); } -bool SkyLogic::collide(Compact *cpt) { +bool Logic::collide(Compact *cpt) { MegaSet *m1 = SkyCompact::getMegaSet(_compact, _compact->extCompact->megaSet); MegaSet *m2 = SkyCompact::getMegaSet(cpt, cpt->extCompact->megaSet); @@ -765,14 +765,14 @@ bool SkyLogic::collide(Compact *cpt) { } } -void SkyLogic::runGetOff() { +void Logic::runGetOff() { uint32 getOff = _scriptVariables[GET_OFF]; _scriptVariables[GET_OFF] = 0; if (getOff) script((uint16)(getOff & 0xffff), (uint16)(getOff >> 16)); } -void SkyLogic::stopAndWait() { +void Logic::stopAndWait() { _compact->mode += 4; uint16 *scriptNo = SkyCompact::getSub(_compact, _compact->mode); @@ -785,140 +785,140 @@ void SkyLogic::stopAndWait() { logicScript(); } -void SkyLogic::checkModuleLoaded(uint16 moduleNo) { +void Logic::checkModuleLoaded(uint16 moduleNo) { if (!_moduleList[moduleNo]) _moduleList[moduleNo] = (uint16 *)_skyDisk->loadFile((uint16)moduleNo + F_MODULE_0, NULL); } -void SkyLogic::push(uint32 a) { +void Logic::push(uint32 a) { if (_stackPtr > ARRAYSIZE(_stack) - 2) error("Stack overflow"); _stack[_stackPtr++] = a; } -uint32 SkyLogic::pop() { +uint32 Logic::pop() { if (_stackPtr < 1 || _stackPtr > ARRAYSIZE(_stack) - 1) error("No items on Stack to pop"); return _stack[--_stackPtr]; } -typedef bool (SkyLogic::*McodeTable) (uint32, uint32, uint32); +typedef bool (Logic::*McodeTable) (uint32, uint32, uint32); static McodeTable mcodeTable[] = { - &SkyLogic::fnCacheChip, - &SkyLogic::fnCacheFast, - &SkyLogic::fnDrawScreen, - &SkyLogic::fnAr, - &SkyLogic::fnArAnimate, - &SkyLogic::fnIdle, - &SkyLogic::fnInteract, - &SkyLogic::fnStartSub, - &SkyLogic::fnTheyStartSub, - &SkyLogic::fnAssignBase, - &SkyLogic::fnDiskMouse, - &SkyLogic::fnNormalMouse, - &SkyLogic::fnBlankMouse, - &SkyLogic::fnCrossMouse, - &SkyLogic::fnCursorRight, - &SkyLogic::fnCursorLeft, - &SkyLogic::fnCursorDown, - &SkyLogic::fnOpenHand, - &SkyLogic::fnCloseHand, - &SkyLogic::fnGetTo, - &SkyLogic::fnSetToStand, - &SkyLogic::fnTurnTo, - &SkyLogic::fnArrived, - &SkyLogic::fnLeaving, - &SkyLogic::fnSetAlternate, - &SkyLogic::fnAltSetAlternate, - &SkyLogic::fnKillId, - &SkyLogic::fnNoHuman, - &SkyLogic::fnAddHuman, - &SkyLogic::fnAddButtons, - &SkyLogic::fnNoButtons, - &SkyLogic::fnSetStop, - &SkyLogic::fnClearStop, - &SkyLogic::fnPointerText, - &SkyLogic::fnQuit, - &SkyLogic::fnSpeakMe, - &SkyLogic::fnSpeakMeDir, - &SkyLogic::fnSpeakWait, - &SkyLogic::fnSpeakWaitDir, - &SkyLogic::fnChooser, - &SkyLogic::fnHighlight, - &SkyLogic::fnTextKill, - &SkyLogic::fnStopMode, - &SkyLogic::fnWeWait, - &SkyLogic::fnSendSync, - &SkyLogic::fnSendFastSync, - &SkyLogic::fnSendRequest, - &SkyLogic::fnClearRequest, - &SkyLogic::fnCheckRequest, - &SkyLogic::fnStartMenu, - &SkyLogic::fnUnhighlight, - &SkyLogic::fnFaceId, - &SkyLogic::fnForeground, - &SkyLogic::fnBackground, - &SkyLogic::fnNewBackground, - &SkyLogic::fnSort, - &SkyLogic::fnNoSpriteEngine, - &SkyLogic::fnNoSpritesA6, - &SkyLogic::fnResetId, - &SkyLogic::fnToggleGrid, - &SkyLogic::fnPause, - &SkyLogic::fnRunAnimMod, - &SkyLogic::fnSimpleMod, - &SkyLogic::fnRunFrames, - &SkyLogic::fnAwaitSync, - &SkyLogic::fnIncMegaSet, - &SkyLogic::fnDecMegaSet, - &SkyLogic::fnSetMegaSet, - &SkyLogic::fnMoveItems, - &SkyLogic::fnNewList, - &SkyLogic::fnAskThis, - &SkyLogic::fnRandom, - &SkyLogic::fnPersonHere, - &SkyLogic::fnToggleMouse, - &SkyLogic::fnMouseOn, - &SkyLogic::fnMouseOff, - &SkyLogic::fnFetchX, - &SkyLogic::fnFetchY, - &SkyLogic::fnTestList, - &SkyLogic::fnFetchPlace, - &SkyLogic::fnCustomJoey, - &SkyLogic::fnSetPalette, - &SkyLogic::fnTextModule, - &SkyLogic::fnChangeName, - &SkyLogic::fnMiniLoad, - &SkyLogic::fnFlushBuffers, - &SkyLogic::fnFlushChip, - &SkyLogic::fnSaveCoods, - &SkyLogic::fnPlotGrid, - &SkyLogic::fnRemoveGrid, - &SkyLogic::fnEyeball, - &SkyLogic::fnCursorUp, - &SkyLogic::fnLeaveSection, - &SkyLogic::fnEnterSection, - &SkyLogic::fnRestoreGame, - &SkyLogic::fnRestartGame, - &SkyLogic::fnNewSwingSeq, - &SkyLogic::fnWaitSwingEnd, - &SkyLogic::fnSkipIntroCode, - &SkyLogic::fnBlankScreen, - &SkyLogic::fnPrintCredit, - &SkyLogic::fnLookAt, - &SkyLogic::fnLincTextModule, - &SkyLogic::fnTextKill2, - &SkyLogic::fnSetFont, - &SkyLogic::fnStartFx, - &SkyLogic::fnStopFx, - &SkyLogic::fnStartMusic, - &SkyLogic::fnStopMusic, - &SkyLogic::fnFadeDown, - &SkyLogic::fnFadeUp, - &SkyLogic::fnQuitToDos, - &SkyLogic::fnPauseFx, - &SkyLogic::fnUnPauseFx, - &SkyLogic::fnPrintf + &Logic::fnCacheChip, + &Logic::fnCacheFast, + &Logic::fnDrawScreen, + &Logic::fnAr, + &Logic::fnArAnimate, + &Logic::fnIdle, + &Logic::fnInteract, + &Logic::fnStartSub, + &Logic::fnTheyStartSub, + &Logic::fnAssignBase, + &Logic::fnDiskMouse, + &Logic::fnNormalMouse, + &Logic::fnBlankMouse, + &Logic::fnCrossMouse, + &Logic::fnCursorRight, + &Logic::fnCursorLeft, + &Logic::fnCursorDown, + &Logic::fnOpenHand, + &Logic::fnCloseHand, + &Logic::fnGetTo, + &Logic::fnSetToStand, + &Logic::fnTurnTo, + &Logic::fnArrived, + &Logic::fnLeaving, + &Logic::fnSetAlternate, + &Logic::fnAltSetAlternate, + &Logic::fnKillId, + &Logic::fnNoHuman, + &Logic::fnAddHuman, + &Logic::fnAddButtons, + &Logic::fnNoButtons, + &Logic::fnSetStop, + &Logic::fnClearStop, + &Logic::fnPointerText, + &Logic::fnQuit, + &Logic::fnSpeakMe, + &Logic::fnSpeakMeDir, + &Logic::fnSpeakWait, + &Logic::fnSpeakWaitDir, + &Logic::fnChooser, + &Logic::fnHighlight, + &Logic::fnTextKill, + &Logic::fnStopMode, + &Logic::fnWeWait, + &Logic::fnSendSync, + &Logic::fnSendFastSync, + &Logic::fnSendRequest, + &Logic::fnClearRequest, + &Logic::fnCheckRequest, + &Logic::fnStartMenu, + &Logic::fnUnhighlight, + &Logic::fnFaceId, + &Logic::fnForeground, + &Logic::fnBackground, + &Logic::fnNewBackground, + &Logic::fnSort, + &Logic::fnNoSpriteEngine, + &Logic::fnNoSpritesA6, + &Logic::fnResetId, + &Logic::fnToggleGrid, + &Logic::fnPause, + &Logic::fnRunAnimMod, + &Logic::fnSimpleMod, + &Logic::fnRunFrames, + &Logic::fnAwaitSync, + &Logic::fnIncMegaSet, + &Logic::fnDecMegaSet, + &Logic::fnSetMegaSet, + &Logic::fnMoveItems, + &Logic::fnNewList, + &Logic::fnAskThis, + &Logic::fnRandom, + &Logic::fnPersonHere, + &Logic::fnToggleMouse, + &Logic::fnMouseOn, + &Logic::fnMouseOff, + &Logic::fnFetchX, + &Logic::fnFetchY, + &Logic::fnTestList, + &Logic::fnFetchPlace, + &Logic::fnCustomJoey, + &Logic::fnSetPalette, + &Logic::fnTextModule, + &Logic::fnChangeName, + &Logic::fnMiniLoad, + &Logic::fnFlushBuffers, + &Logic::fnFlushChip, + &Logic::fnSaveCoods, + &Logic::fnPlotGrid, + &Logic::fnRemoveGrid, + &Logic::fnEyeball, + &Logic::fnCursorUp, + &Logic::fnLeaveSection, + &Logic::fnEnterSection, + &Logic::fnRestoreGame, + &Logic::fnRestartGame, + &Logic::fnNewSwingSeq, + &Logic::fnWaitSwingEnd, + &Logic::fnSkipIntroCode, + &Logic::fnBlankScreen, + &Logic::fnPrintCredit, + &Logic::fnLookAt, + &Logic::fnLincTextModule, + &Logic::fnTextKill2, + &Logic::fnSetFont, + &Logic::fnStartFx, + &Logic::fnStopFx, + &Logic::fnStartMusic, + &Logic::fnStopMusic, + &Logic::fnFadeDown, + &Logic::fnFadeUp, + &Logic::fnQuitToDos, + &Logic::fnPauseFx, + &Logic::fnUnPauseFx, + &Logic::fnPrintf }; static const uint32 forwardList1b[] = { @@ -1114,7 +1114,7 @@ static const uint32 forwardList5b[] = { DISCONNECT_FOSTER }; -void SkyLogic::initScriptVariables() { +void Logic::initScriptVariables() { for (int i = 0; i < ARRAYSIZE(_scriptVariables); i++) _scriptVariables[i] = 0; @@ -1157,7 +1157,7 @@ void SkyLogic::initScriptVariables() { memcpy(_scriptVariables + 505, forwardList5b, sizeof(forwardList5b)); } -uint16 SkyLogic::mouseScript(uint32 scrNum, Compact *scriptComp) { +uint16 Logic::mouseScript(uint32 scrNum, Compact *scriptComp) { Compact *tmpComp = _compact; _compact = scriptComp; @@ -1176,7 +1176,7 @@ uint16 SkyLogic::mouseScript(uint32 scrNum, Compact *scriptComp) { * * @return 0 if script finished. Else offset where to continue. */ -uint16 SkyLogic::script(uint16 scriptNo, uint16 offset) { +uint16 Logic::script(uint16 scriptNo, uint16 offset) { script: /// process a script /// low level interface to interpreter @@ -1203,7 +1203,7 @@ script: for (;;) { command = READ_LE_UINT16(scriptData++); // get a command - SkyDebug::script(command, scriptData); + Debug::script(command, scriptData); switch (command) { case 0: // push_variable @@ -1283,7 +1283,7 @@ script: } uint16 mcode = READ_LE_UINT16(scriptData++)/4; // get mcode number - SkyDebug::mcode(mcode, a, b, c); + Debug::mcode(mcode, a, b, c); Compact *saveCpt = _compact; bool ret = (this->*mcodeTable[mcode]) (a, b, c); @@ -1352,25 +1352,25 @@ script: } } -bool SkyLogic::fnCacheChip(uint32 a, uint32 b, uint32 c) { +bool Logic::fnCacheChip(uint32 a, uint32 b, uint32 c) { _skySound->fnStopFx(); _skyDisk->fnCacheChip(a); return true; } -bool SkyLogic::fnCacheFast(uint32 a, uint32 b, uint32 c) { +bool Logic::fnCacheFast(uint32 a, uint32 b, uint32 c) { _skyDisk->fnCacheFast(a); return true; } -bool SkyLogic::fnDrawScreen(uint32 a, uint32 b, uint32 c) { +bool Logic::fnDrawScreen(uint32 a, uint32 b, uint32 c) { debug(5, "Call: fnDrawScreen(%X, %X)",a,b); SkyEngine::_systemVars.currentPalette = a; _skyScreen->fnDrawScreen(a, b); return true; } -bool SkyLogic::fnAr(uint32 x, uint32 y, uint32 c) { +bool Logic::fnAr(uint32 x, uint32 y, uint32 c) { _compact->downFlag = 1; // assume failure in-case logic is interupted by speech (esp Joey) _compact->extCompact->arTargetX = (uint16)x; @@ -1383,19 +1383,19 @@ bool SkyLogic::fnAr(uint32 x, uint32 y, uint32 c) { return false; // drop out of script } -bool SkyLogic::fnArAnimate(uint32 a, uint32 b, uint32 c) { +bool Logic::fnArAnimate(uint32 a, uint32 b, uint32 c) { _compact->mood = 0; // high level 'not stood still' _compact->logic = L_AR_ANIM; return false; // drop out of script } -bool SkyLogic::fnIdle(uint32 a, uint32 b, uint32 c) { +bool Logic::fnIdle(uint32 a, uint32 b, uint32 c) { // set the player idling _compact->logic = 0; return true; } -bool SkyLogic::fnInteract(uint32 targetId, uint32 b, uint32 c) { +bool Logic::fnInteract(uint32 targetId, uint32 b, uint32 c) { _compact->mode += 4; // next level up _compact->logic = L_SCRIPT; Compact *cpt = SkyEngine::fetchCompact(targetId); @@ -1406,14 +1406,14 @@ bool SkyLogic::fnInteract(uint32 targetId, uint32 b, uint32 c) { return false; } -bool SkyLogic::fnStartSub(uint32 scr, uint32 b, uint32 c) { +bool Logic::fnStartSub(uint32 scr, uint32 b, uint32 c) { _compact->mode += 4; *SkyCompact::getSub(_compact, _compact->mode) = (uint16)(scr & 0xffff); *SkyCompact::getSub(_compact, _compact->mode + 2) = (uint16)(scr >> 16); return false; } -bool SkyLogic::fnTheyStartSub(uint32 mega, uint32 scr, uint32 c) { +bool Logic::fnTheyStartSub(uint32 mega, uint32 scr, uint32 c) { Compact *cpt = SkyEngine::fetchCompact(mega); cpt->mode += 4; *SkyCompact::getSub(cpt, cpt->mode) = (uint16)(scr & 0xffff); @@ -1421,7 +1421,7 @@ bool SkyLogic::fnTheyStartSub(uint32 mega, uint32 scr, uint32 c) { return true; } -bool SkyLogic::fnAssignBase(uint32 id, uint32 scr, uint32 c) { +bool Logic::fnAssignBase(uint32 id, uint32 scr, uint32 c) { Compact *cpt = SkyEngine::fetchCompact(id); cpt->mode = C_BASE_MODE; cpt->logic = L_SCRIPT; @@ -1430,22 +1430,22 @@ bool SkyLogic::fnAssignBase(uint32 id, uint32 scr, uint32 c) { return true; } -bool SkyLogic::fnDiskMouse(uint32 a, uint32 b, uint32 c) { +bool Logic::fnDiskMouse(uint32 a, uint32 b, uint32 c) { _skyMouse->spriteMouse(MOUSE_DISK, 11, 11); return true; } -bool SkyLogic::fnNormalMouse(uint32 a, uint32 b, uint32 c) { +bool Logic::fnNormalMouse(uint32 a, uint32 b, uint32 c) { _skyMouse->spriteMouse(MOUSE_NORMAL, 0, 0); return true; } -bool SkyLogic::fnBlankMouse(uint32 a, uint32 b, uint32 c) { +bool Logic::fnBlankMouse(uint32 a, uint32 b, uint32 c) { _skyMouse->spriteMouse(MOUSE_BLANK, 0, 0); return true; } -bool SkyLogic::fnCrossMouse(uint32 a, uint32 b, uint32 c) { +bool Logic::fnCrossMouse(uint32 a, uint32 b, uint32 c) { if (_scriptVariables[OBJECT_HELD]) _skyMouse->fnOpenCloseHand(false); else @@ -1453,37 +1453,37 @@ bool SkyLogic::fnCrossMouse(uint32 a, uint32 b, uint32 c) { return true; } -bool SkyLogic::fnCursorRight(uint32 a, uint32 b, uint32 c) { +bool Logic::fnCursorRight(uint32 a, uint32 b, uint32 c) { _skyMouse->spriteMouse(MOUSE_RIGHT, 9, 4); return true; } -bool SkyLogic::fnCursorLeft(uint32 a, uint32 b, uint32 c) { +bool Logic::fnCursorLeft(uint32 a, uint32 b, uint32 c) { _skyMouse->spriteMouse(MOUSE_LEFT, 0, 5); return true; } -bool SkyLogic::fnCursorDown(uint32 a, uint32 b, uint32 c) { +bool Logic::fnCursorDown(uint32 a, uint32 b, uint32 c) { _skyMouse->spriteMouse(MOUSE_DOWN, 9, 4); return true; } -bool SkyLogic::fnCursorUp(uint32 a, uint32 b, uint32 c) { +bool Logic::fnCursorUp(uint32 a, uint32 b, uint32 c) { _skyMouse->spriteMouse(MOUSE_UP, 9, 4); return true; } -bool SkyLogic::fnOpenHand(uint32 a, uint32 b, uint32 c) { +bool Logic::fnOpenHand(uint32 a, uint32 b, uint32 c) { _skyMouse->fnOpenCloseHand(true); return true; } -bool SkyLogic::fnCloseHand(uint32 a, uint32 b, uint32 c) { +bool Logic::fnCloseHand(uint32 a, uint32 b, uint32 c) { _skyMouse->fnOpenCloseHand(false); return true; } -bool SkyLogic::fnGetTo(uint32 targetPlaceId, uint32 mode, uint32 c) { +bool Logic::fnGetTo(uint32 targetPlaceId, uint32 mode, uint32 c) { _compact->upFlag = (uint16)mode; // save mode for action script _compact->mode += 4; // next level up Compact *cpt = SkyEngine::fetchCompact(_compact->place); @@ -1507,7 +1507,7 @@ bool SkyLogic::fnGetTo(uint32 targetPlaceId, uint32 mode, uint32 c) { return false; // drop out of script } -bool SkyLogic::fnSetToStand(uint32 a, uint32 b, uint32 c) { +bool Logic::fnSetToStand(uint32 a, uint32 b, uint32 c) { _compact->mood = 1; // high level stood still _compact->grafixProg.ptrType = COMPACTELEM; @@ -1524,7 +1524,7 @@ bool SkyLogic::fnSetToStand(uint32 a, uint32 b, uint32 c) { return false; // drop out of script } -bool SkyLogic::fnTurnTo(uint32 dir, uint32 b, uint32 c) { +bool Logic::fnTurnTo(uint32 dir, uint32 b, uint32 c) { /// turn compact to direction dir uint16 curDir = _compact->extCompact->dir; // get current direction @@ -1543,13 +1543,13 @@ bool SkyLogic::fnTurnTo(uint32 dir, uint32 b, uint32 c) { return false; // drop out of script } -bool SkyLogic::fnArrived(uint32 scriptVar, uint32 b, uint32 c) { +bool Logic::fnArrived(uint32 scriptVar, uint32 b, uint32 c) { _compact->extCompact->leaving = (uint16)(scriptVar & 0xffff); _scriptVariables[scriptVar/4]++; return true; } -bool SkyLogic::fnLeaving(uint32 a, uint32 b, uint32 c) { +bool Logic::fnLeaving(uint32 a, uint32 b, uint32 c) { _compact->extCompact->atWatch = 0; if (_compact->extCompact->leaving) { @@ -1560,20 +1560,20 @@ bool SkyLogic::fnLeaving(uint32 a, uint32 b, uint32 c) { return true; // keep going } -bool SkyLogic::fnSetAlternate(uint32 scr, uint32 b, uint32 c) { +bool Logic::fnSetAlternate(uint32 scr, uint32 b, uint32 c) { _compact->extCompact->alt = (uint16)(scr & 0xffff); _compact->logic = L_ALT; return false; } -bool SkyLogic::fnAltSetAlternate(uint32 target, uint32 scr, uint32 c) { +bool Logic::fnAltSetAlternate(uint32 target, uint32 scr, uint32 c) { Compact *cpt = SkyEngine::fetchCompact(target); cpt->extCompact->alt = (uint16)(scr & 0xffff); cpt->logic = L_ALT; return false; } -bool SkyLogic::fnKillId(uint32 id, uint32 b, uint32 c) { +bool Logic::fnKillId(uint32 id, uint32 b, uint32 c) { if (id) { Compact *cpt = SkyEngine::fetchCompact(id); if (cpt->status & (1 << 7)) @@ -1583,7 +1583,7 @@ bool SkyLogic::fnKillId(uint32 id, uint32 b, uint32 c) { return true; } -bool SkyLogic::fnNoHuman(uint32 a, uint32 b, uint32 c) { +bool Logic::fnNoHuman(uint32 a, uint32 b, uint32 c) { if (!_scriptVariables[MOUSE_STOP]) { _scriptVariables[MOUSE_STATUS] &= 1; runGetOff(); @@ -1592,47 +1592,47 @@ bool SkyLogic::fnNoHuman(uint32 a, uint32 b, uint32 c) { return true; } -bool SkyLogic::fnAddHuman(uint32 a, uint32 b, uint32 c) { +bool Logic::fnAddHuman(uint32 a, uint32 b, uint32 c) { return _skyMouse->fnAddHuman(); } -bool SkyLogic::fnAddButtons(uint32 a, uint32 b, uint32 c) { +bool Logic::fnAddButtons(uint32 a, uint32 b, uint32 c) { _scriptVariables[MOUSE_STATUS] |= 4; return true; } -bool SkyLogic::fnNoButtons(uint32 a, uint32 b, uint32 c) { +bool Logic::fnNoButtons(uint32 a, uint32 b, uint32 c) { //remove the mouse buttons _scriptVariables[MOUSE_STATUS] &= 0xFFFFFFFB; return true; } -bool SkyLogic::fnSetStop(uint32 a, uint32 b, uint32 c) { +bool Logic::fnSetStop(uint32 a, uint32 b, uint32 c) { _scriptVariables[MOUSE_STOP] |= 1; return true; } -bool SkyLogic::fnClearStop(uint32 a, uint32 b, uint32 c) { +bool Logic::fnClearStop(uint32 a, uint32 b, uint32 c) { _scriptVariables[MOUSE_STOP] = 0; return true; } -bool SkyLogic::fnPointerText(uint32 a, uint32 b, uint32 c) { +bool Logic::fnPointerText(uint32 a, uint32 b, uint32 c) { _skyText->fnPointerText(a, _skyMouse->giveMouseX(), _skyMouse->giveMouseY()); return true; } -bool SkyLogic::fnQuit(uint32 a, uint32 b, uint32 c) { +bool Logic::fnQuit(uint32 a, uint32 b, uint32 c) { return false; } -bool SkyLogic::fnSpeakMe(uint32 targetId, uint32 mesgNum, uint32 animNum) { +bool Logic::fnSpeakMe(uint32 targetId, uint32 mesgNum, uint32 animNum) { stdSpeak(SkyEngine::fetchCompact(targetId), mesgNum, animNum, 0); return false; //drop out of script } -bool SkyLogic::fnSpeakMeDir(uint32 targetId, uint32 mesgNum, uint32 animNum) { +bool Logic::fnSpeakMeDir(uint32 targetId, uint32 mesgNum, uint32 animNum) { //must be player so don't cause script to drop out //this function sets the directional option whereby //the anim chosen is linked to c_dir @@ -1640,7 +1640,7 @@ bool SkyLogic::fnSpeakMeDir(uint32 targetId, uint32 mesgNum, uint32 animNum) { return fnSpeakMe(targetId, mesgNum, animNum); } -bool SkyLogic::fnSpeakWait(uint32 id, uint32 message, uint32 animation) { +bool Logic::fnSpeakWait(uint32 id, uint32 message, uint32 animation) { // non player mega char speaks // player will wait for it to finish before continuing script processing _compact->flag = (uint16)(id & 0xffff); @@ -1648,7 +1648,7 @@ bool SkyLogic::fnSpeakWait(uint32 id, uint32 message, uint32 animation) { return fnSpeakMe(id, message, animation); } -bool SkyLogic::fnSpeakWaitDir(uint32 a, uint32 b, uint32 c) { +bool Logic::fnSpeakWaitDir(uint32 a, uint32 b, uint32 c) { /* non player mega chr$ speaks S2(20Jan93tw) the player will wait for it to finish before continuing script processing @@ -1677,7 +1677,7 @@ bool SkyLogic::fnSpeakWaitDir(uint32 a, uint32 b, uint32 c) { return false; } -bool SkyLogic::fnChooser(uint32 a, uint32 b, uint32 c) { +bool Logic::fnChooser(uint32 a, uint32 b, uint32 c) { // setup the text questions to be clicked on // read from TEXT1 until 0 @@ -1733,7 +1733,7 @@ bool SkyLogic::fnChooser(uint32 a, uint32 b, uint32 c) { return false; } -bool SkyLogic::fnHighlight(uint32 itemNo, uint32 pen, uint32 c) { +bool Logic::fnHighlight(uint32 itemNo, uint32 pen, uint32 c) { pen -= 11; pen ^= 1; pen += 241; @@ -1743,7 +1743,7 @@ bool SkyLogic::fnHighlight(uint32 itemNo, uint32 pen, uint32 c) { return true; } -bool SkyLogic::fnTextKill(uint32 a, uint32 b, uint32 c) { +bool Logic::fnTextKill(uint32 a, uint32 b, uint32 c) { /// Kill of text items that are mouse detectable uint32 id = FIRST_TEXT_COMPACT; @@ -1757,12 +1757,12 @@ bool SkyLogic::fnTextKill(uint32 a, uint32 b, uint32 c) { return true; } -bool SkyLogic::fnStopMode(uint32 a, uint32 b, uint32 c) { +bool Logic::fnStopMode(uint32 a, uint32 b, uint32 c) { _compact->logic = L_STOPPED; return false; } -bool SkyLogic::fnWeWait(uint32 id, uint32 b, uint32 c) { +bool Logic::fnWeWait(uint32 id, uint32 b, uint32 c) { /// We have hit another mega /// we are going to wait for it to move @@ -1771,31 +1771,31 @@ bool SkyLogic::fnWeWait(uint32 id, uint32 b, uint32 c) { return true; // not sure about this } -bool SkyLogic::fnSendSync(uint32 mega, uint32 sync, uint32 c) { +bool Logic::fnSendSync(uint32 mega, uint32 sync, uint32 c) { Compact *cpt = SkyEngine::fetchCompact(mega); cpt->sync = (uint16)(sync & 0xffff); return false; } -bool SkyLogic::fnSendFastSync(uint32 mega, uint32 sync, uint32 c) { +bool Logic::fnSendFastSync(uint32 mega, uint32 sync, uint32 c) { Compact *cpt = SkyEngine::fetchCompact(mega); cpt->sync = (uint16)(sync & 0xffff); return true; } -bool SkyLogic::fnSendRequest(uint32 target, uint32 scr, uint32 c) { +bool Logic::fnSendRequest(uint32 target, uint32 scr, uint32 c) { Compact *cpt = SkyEngine::fetchCompact(target); cpt->extCompact->request = (uint16)(scr & 0xffff); return false; } -bool SkyLogic::fnClearRequest(uint32 target, uint32 b, uint32 c) { +bool Logic::fnClearRequest(uint32 target, uint32 b, uint32 c) { Compact *cpt = SkyEngine::fetchCompact(target); cpt->extCompact->request = 0; return true; } -bool SkyLogic::fnCheckRequest(uint32 a, uint32 b, uint32 c) { +bool Logic::fnCheckRequest(uint32 a, uint32 b, uint32 c) { /// check for interaction request if (!_compact->extCompact->request) @@ -1810,7 +1810,7 @@ bool SkyLogic::fnCheckRequest(uint32 a, uint32 b, uint32 c) { return false; // drop from script } -bool SkyLogic::fnStartMenu(uint32 firstObject, uint32 b, uint32 c) { +bool Logic::fnStartMenu(uint32 firstObject, uint32 b, uint32 c) { /// initialise the top menu bar // firstObject is o0 for game menu, k0 for linc @@ -1882,14 +1882,14 @@ bool SkyLogic::fnStartMenu(uint32 firstObject, uint32 b, uint32 c) { return true; } -bool SkyLogic::fnUnhighlight(uint32 item, uint32 b, uint32 c) { +bool Logic::fnUnhighlight(uint32 item, uint32 b, uint32 c) { Compact *cpt = SkyEngine::fetchCompact(item); cpt->frame--; cpt->getToFlag = 0; return true; } -bool SkyLogic::fnFaceId(uint32 otherId, uint32 b, uint32 c) { +bool Logic::fnFaceId(uint32 otherId, uint32 b, uint32 c) { /// return the direction to turn to face another id /// pass back result in c_just_flag @@ -1924,7 +1924,7 @@ bool SkyLogic::fnFaceId(uint32 otherId, uint32 b, uint32 c) { return true; } -bool SkyLogic::fnForeground(uint32 sprite, uint32 b, uint32 c) { +bool Logic::fnForeground(uint32 sprite, uint32 b, uint32 c) { /// Make sprite a foreground sprite Compact *cpt = SkyEngine::fetchCompact(sprite); cpt->status &= 0xfff8; @@ -1932,14 +1932,14 @@ bool SkyLogic::fnForeground(uint32 sprite, uint32 b, uint32 c) { return true; } -bool SkyLogic::fnBackground(uint32 a, uint32 b, uint32 c) { +bool Logic::fnBackground(uint32 a, uint32 b, uint32 c) { /// Make us a background sprite _compact->status &= 0xfff8; _compact->status |= ST_BACKGROUND; return true; } -bool SkyLogic::fnNewBackground(uint32 sprite, uint32 b, uint32 c) { +bool Logic::fnNewBackground(uint32 sprite, uint32 b, uint32 c) { /// Make sprite a background sprite Compact *cpt = SkyEngine::fetchCompact(sprite); cpt->status &= 0xfff8; @@ -1947,21 +1947,21 @@ bool SkyLogic::fnNewBackground(uint32 sprite, uint32 b, uint32 c) { return true; } -bool SkyLogic::fnSort(uint32 mega, uint32 b, uint32 c) { +bool Logic::fnSort(uint32 mega, uint32 b, uint32 c) { Compact *cpt = SkyEngine::fetchCompact(mega); cpt->status &= 0xfff8; cpt->status |= ST_SORT; return true; } -bool SkyLogic::fnNoSpriteEngine(uint32 a, uint32 b, uint32 c) { +bool Logic::fnNoSpriteEngine(uint32 a, uint32 b, uint32 c) { /// stop the compact printing /// remove foreground, background & sort _compact->status &= 0xfff8; return true; } -bool SkyLogic::fnNoSpritesA6(uint32 us, uint32 b, uint32 c) { +bool Logic::fnNoSpritesA6(uint32 us, uint32 b, uint32 c) { /// stop the compact printing /// remove foreground, background & sort Compact *cpt = SkyEngine::fetchCompact(us); @@ -1969,7 +1969,7 @@ bool SkyLogic::fnNoSpritesA6(uint32 us, uint32 b, uint32 c) { return true; } -bool SkyLogic::fnResetId(uint32 id, uint32 resetBlock, uint32 c) { +bool Logic::fnResetId(uint32 id, uint32 resetBlock, uint32 c) { /// used when a mega is to be restarted /// eg - when a smaller mega turn to larger /// - a mega changes rooms... @@ -1992,20 +1992,20 @@ bool SkyLogic::fnResetId(uint32 id, uint32 resetBlock, uint32 c) { return true; } -bool SkyLogic::fnToggleGrid(uint32 a, uint32 b, uint32 c) { +bool Logic::fnToggleGrid(uint32 a, uint32 b, uint32 c) { /// Toggle a mega's grid plotting _compact->status ^= ST_GRID_PLOT; return true; } -bool SkyLogic::fnPause(uint32 cycles, uint32 b, uint32 c) { +bool Logic::fnPause(uint32 cycles, uint32 b, uint32 c) { /// Set mega to L_PAUSE _compact->flag = (uint16)(cycles & 0xffff); _compact->logic = L_PAUSE; return false; // drop out of script } -bool SkyLogic::fnRunAnimMod(uint32 animNo, uint32 b, uint32 c) { +bool Logic::fnRunAnimMod(uint32 animNo, uint32 b, uint32 c) { _compact->grafixProg.ptrType = COMPACT; _compact->grafixProg.ptrTarget = animNo; _compact->grafixProg.pos = 0; @@ -2021,7 +2021,7 @@ bool SkyLogic::fnRunAnimMod(uint32 animNo, uint32 b, uint32 c) { return false; // drop from script } -bool SkyLogic::fnSimpleMod(uint32 animSeqNo, uint32 b, uint32 c) { +bool Logic::fnSimpleMod(uint32 animSeqNo, uint32 b, uint32 c) { _compact->grafixProg.ptrType = COMPACT; _compact->grafixProg.ptrTarget = animSeqNo; @@ -2037,7 +2037,7 @@ bool SkyLogic::fnSimpleMod(uint32 animSeqNo, uint32 b, uint32 c) { return false; } -bool SkyLogic::fnRunFrames(uint32 sequenceNo, uint32 b, uint32 c) { +bool Logic::fnRunFrames(uint32 sequenceNo, uint32 b, uint32 c) { _compact->grafixProg.ptrType = COMPACT; _compact->grafixProg.ptrTarget = sequenceNo; _compact->grafixProg.pos = 0; @@ -2052,7 +2052,7 @@ bool SkyLogic::fnRunFrames(uint32 sequenceNo, uint32 b, uint32 c) { return false; } -bool SkyLogic::fnAwaitSync(uint32 a, uint32 b, uint32 c) { +bool Logic::fnAwaitSync(uint32 a, uint32 b, uint32 c) { if (_compact->sync) return true; @@ -2060,23 +2060,23 @@ bool SkyLogic::fnAwaitSync(uint32 a, uint32 b, uint32 c) { return false; } -bool SkyLogic::fnIncMegaSet(uint32 a, uint32 b, uint32 c) { +bool Logic::fnIncMegaSet(uint32 a, uint32 b, uint32 c) { _compact->extCompact->megaSet += NEXT_MEGA_SET; return true; } -bool SkyLogic::fnDecMegaSet(uint32 a, uint32 b, uint32 c) { +bool Logic::fnDecMegaSet(uint32 a, uint32 b, uint32 c) { _compact->extCompact->megaSet -= NEXT_MEGA_SET; return true; } -bool SkyLogic::fnSetMegaSet(uint32 mega, uint32 setNo, uint32 c) { +bool Logic::fnSetMegaSet(uint32 mega, uint32 setNo, uint32 c) { Compact *cpt = SkyEngine::fetchCompact(mega); cpt->extCompact->megaSet = (uint16) (setNo * NEXT_MEGA_SET); return true; } -bool SkyLogic::fnMoveItems(uint32 listNo, uint32 screenNo, uint32 c) { +bool Logic::fnMoveItems(uint32 listNo, uint32 screenNo, uint32 c) { /// Move a list of id's to another screen uint16 *p = SkyCompact::move_list[listNo]; for (int i = 0; i < 2; i++) { @@ -2088,14 +2088,14 @@ bool SkyLogic::fnMoveItems(uint32 listNo, uint32 screenNo, uint32 c) { return true; } -bool SkyLogic::fnNewList(uint32 a, uint32 b, uint32 c) { +bool Logic::fnNewList(uint32 a, uint32 b, uint32 c) { /// Reset the chooser list for (int i = 0; i < 16; i++) _scriptVariables[TEXT1 + i] = 0; return true; } -bool SkyLogic::fnAskThis(uint32 textNo, uint32 animNo, uint32 c) { +bool Logic::fnAskThis(uint32 textNo, uint32 animNo, uint32 c) { // find first free position uint32 *p = _scriptVariables + TEXT1; while (*p) @@ -2105,50 +2105,50 @@ bool SkyLogic::fnAskThis(uint32 textNo, uint32 animNo, uint32 c) { return true; } -bool SkyLogic::fnRandom(uint32 a, uint32 b, uint32 c) { +bool Logic::fnRandom(uint32 a, uint32 b, uint32 c) { _scriptVariables[RND] = _rnd.getRandomNumber(65536) & a; return true; } -bool SkyLogic::fnPersonHere(uint32 id, uint32 room, uint32 c) { +bool Logic::fnPersonHere(uint32 id, uint32 room, uint32 c) { Compact *cpt = SkyEngine::fetchCompact(id); _scriptVariables[RESULT] = cpt->screen == room ? 1 : 0; return true; } -bool SkyLogic::fnToggleMouse(uint32 a, uint32 b, uint32 c) { +bool Logic::fnToggleMouse(uint32 a, uint32 b, uint32 c) { SkyEngine::fetchCompact(a)->status ^= ST_MOUSE; return true; } -bool SkyLogic::fnMouseOn(uint32 a, uint32 b, uint32 c) { +bool Logic::fnMouseOn(uint32 a, uint32 b, uint32 c) { //switch on the mouse highlight Compact *cpt = SkyEngine::fetchCompact(a); cpt->status |= ST_MOUSE; return true; } -bool SkyLogic::fnMouseOff(uint32 a, uint32 b, uint32 c) { +bool Logic::fnMouseOff(uint32 a, uint32 b, uint32 c) { //switch on (off??) the mouse highlight Compact *cpt = SkyEngine::fetchCompact(a); cpt->status &= ~ST_MOUSE; return true; } -bool SkyLogic::fnFetchX(uint32 id, uint32 b, uint32 c) { +bool Logic::fnFetchX(uint32 id, uint32 b, uint32 c) { Compact *cpt = SkyEngine::fetchCompact(id); _scriptVariables[RESULT] = cpt->xcood; return true; } -bool SkyLogic::fnFetchY(uint32 id, uint32 b, uint32 c) { +bool Logic::fnFetchY(uint32 id, uint32 b, uint32 c) { Compact *cpt = SkyEngine::fetchCompact(id); _scriptVariables[RESULT] = cpt->ycood; return true; } -bool SkyLogic::fnTestList(uint32 id, uint32 x, uint32 y) { +bool Logic::fnTestList(uint32 id, uint32 x, uint32 y) { _scriptVariables[RESULT] = 0; // assume fail uint16 *list = (uint16 *)SkyEngine::fetchCompact(id); @@ -2160,13 +2160,13 @@ bool SkyLogic::fnTestList(uint32 id, uint32 x, uint32 y) { return true; } -bool SkyLogic::fnFetchPlace(uint32 id, uint32 b, uint32 c) { +bool Logic::fnFetchPlace(uint32 id, uint32 b, uint32 c) { Compact *cpt = SkyEngine::fetchCompact(id); _scriptVariables[RESULT] = cpt->place; return true; } -bool SkyLogic::fnCustomJoey(uint32 id, uint32 b, uint32 c) { +bool Logic::fnCustomJoey(uint32 id, uint32 b, uint32 c) { /// return id's x & y coordinate & c_mood (i.e. stood still yes/no) /// used by Joey-Logic - done in code like this because scripts can't /// get access to another megas compact as easily @@ -2180,54 +2180,54 @@ bool SkyLogic::fnCustomJoey(uint32 id, uint32 b, uint32 c) { return true; } -bool SkyLogic::fnSetPalette(uint32 a, uint32 b, uint32 c) { +bool Logic::fnSetPalette(uint32 a, uint32 b, uint32 c) { _skyScreen->setPaletteEndian((uint8 *)SkyEngine::fetchCompact(a)); SkyEngine::_systemVars.currentPalette = a; return true; } -bool SkyLogic::fnTextModule(uint32 a, uint32 b, uint32 c) { +bool Logic::fnTextModule(uint32 a, uint32 b, uint32 c) { _skyText->fnTextModule(a, b); return true; } -bool SkyLogic::fnChangeName(uint32 id, uint32 textNo, uint32 c) { +bool Logic::fnChangeName(uint32 id, uint32 textNo, uint32 c) { Compact *cpt = SkyEngine::fetchCompact(id); cpt->cursorText = (uint16) textNo; return true; } -bool SkyLogic::fnMiniLoad(uint32 a, uint32 b, uint32 c) { +bool Logic::fnMiniLoad(uint32 a, uint32 b, uint32 c) { _skyDisk->fnMiniLoad((uint16)a); return true; } -bool SkyLogic::fnFlushBuffers(uint32 a, uint32 b, uint32 c) { +bool Logic::fnFlushBuffers(uint32 a, uint32 b, uint32 c) { _skyDisk->fnFlushBuffers(); return true; } -bool SkyLogic::fnFlushChip(uint32 a, uint32 b, uint32 c) { +bool Logic::fnFlushChip(uint32 a, uint32 b, uint32 c) { // this should be done automatically return true; } -bool SkyLogic::fnSaveCoods(uint32 a, uint32 b, uint32 c) { +bool Logic::fnSaveCoods(uint32 a, uint32 b, uint32 c) { _skyMouse->fnSaveCoods(); return true; } -bool SkyLogic::fnPlotGrid(uint32 x, uint32 y, uint32 width) { +bool Logic::fnPlotGrid(uint32 x, uint32 y, uint32 width) { _skyGrid->plotGrid(x, y, width, _compact); return true; } -bool SkyLogic::fnRemoveGrid(uint32 x, uint32 y, uint32 width) { +bool Logic::fnRemoveGrid(uint32 x, uint32 y, uint32 width) { _skyGrid->removeGrid(x, y, width, _compact); return true; } -bool SkyLogic::fnEyeball(uint32 id, uint32 b, uint32 c) { +bool Logic::fnEyeball(uint32 id, uint32 b, uint32 c) { // set 'result' to frame no. pointing to foster, according to table used // eg. FN_eyeball (id_eye_90_table); @@ -2246,7 +2246,7 @@ bool SkyLogic::fnEyeball(uint32 id, uint32 b, uint32 c) { return true; } -bool SkyLogic::fnLeaveSection(uint32 sectionNo, uint32 b, uint32 c) { +bool Logic::fnLeaveSection(uint32 sectionNo, uint32 b, uint32 c) { if (SkyEngine::isDemo()) _skyControl->showGameQuitMsg(); @@ -2258,7 +2258,7 @@ bool SkyLogic::fnLeaveSection(uint32 sectionNo, uint32 b, uint32 c) { return true; } -bool SkyLogic::fnEnterSection(uint32 sectionNo, uint32 b, uint32 c) { +bool Logic::fnEnterSection(uint32 sectionNo, uint32 b, uint32 c) { if (SkyEngine::isDemo() && (sectionNo > 2)) _skyControl->showGameQuitMsg(); @@ -2282,44 +2282,44 @@ bool SkyLogic::fnEnterSection(uint32 sectionNo, uint32 b, uint32 c) { return true; } -bool SkyLogic::fnRestoreGame(uint32 a, uint32 b, uint32 c) { +bool Logic::fnRestoreGame(uint32 a, uint32 b, uint32 c) { _skyControl->doLoadSavePanel(); return false; } -bool SkyLogic::fnRestartGame(uint32 a, uint32 b, uint32 c) { +bool Logic::fnRestartGame(uint32 a, uint32 b, uint32 c) { _skyControl->restartGame(); return false; } -bool SkyLogic::fnNewSwingSeq(uint32 a, uint32 b, uint32 c) { +bool Logic::fnNewSwingSeq(uint32 a, uint32 b, uint32 c) { // only certain files work on pc. (huh?! something we should take care of?) if ((a == 85) || (a == 106) || (a == 75) || (a == 15)) { _skyScreen->startSequenceItem((uint16)a); } else { - debug(1,"SkyLogic::fnNewSwingSeq: ignored seq %d",a); + debug(1,"Logic::fnNewSwingSeq: ignored seq %d",a); } return true; } -bool SkyLogic::fnWaitSwingEnd(uint32 a, uint32 b, uint32 c) { +bool Logic::fnWaitSwingEnd(uint32 a, uint32 b, uint32 c) { _skyScreen->waitForSequence(); return true; } -bool SkyLogic::fnSkipIntroCode(uint32 a, uint32 b, uint32 c) { +bool Logic::fnSkipIntroCode(uint32 a, uint32 b, uint32 c) { SkyEngine::_systemVars.pastIntro = true; return true; } -bool SkyLogic::fnBlankScreen(uint32 a, uint32 b, uint32 c) { +bool Logic::fnBlankScreen(uint32 a, uint32 b, uint32 c) { _skyScreen->clearScreen(); return true; } -bool SkyLogic::fnPrintCredit(uint32 a, uint32 b, uint32 c) { +bool Logic::fnPrintCredit(uint32 a, uint32 b, uint32 c) { lowTextManager_t creditText = _skyText->lowTextManager(a , 240, 0, 248, true); Compact *credCompact = SkyEngine::fetchCompact(creditText.compactNum); @@ -2332,7 +2332,7 @@ bool SkyLogic::fnPrintCredit(uint32 a, uint32 b, uint32 c) { return true; } -bool SkyLogic::fnLookAt(uint32 a, uint32 b, uint32 c) { +bool Logic::fnLookAt(uint32 a, uint32 b, uint32 c) { struct lowTextManager_t textInfo = _skyText->lowTextManager(a, 240, 0, 248, true); Compact *textCpt = SkyEngine::fetchCompact(textInfo.compactNum); @@ -2355,7 +2355,7 @@ bool SkyLogic::fnLookAt(uint32 a, uint32 b, uint32 c) { return true; } -bool SkyLogic::fnLincTextModule(uint32 textPos, uint32 textNo, uint32 buttonAction) { +bool Logic::fnLincTextModule(uint32 textPos, uint32 textNo, uint32 buttonAction) { uint16 cnt; if (buttonAction & 0x8000) @@ -2380,7 +2380,7 @@ bool SkyLogic::fnLincTextModule(uint32 textPos, uint32 textNo, uint32 buttonActi return true; } -bool SkyLogic::fnTextKill2(uint32 a, uint32 b, uint32 c) { +bool Logic::fnTextKill2(uint32 a, uint32 b, uint32 c) { /// Kill all text items uint32 id = FIRST_TEXT_COMPACT; @@ -2393,79 +2393,79 @@ bool SkyLogic::fnTextKill2(uint32 a, uint32 b, uint32 c) { return true; } -bool SkyLogic::fnSetFont(uint32 font, uint32 b, uint32 c) { +bool Logic::fnSetFont(uint32 font, uint32 b, uint32 c) { _skyText->fnSetFont(font); return true; } -bool SkyLogic::fnStartFx(uint32 sound, uint32 b, uint32 c) { +bool Logic::fnStartFx(uint32 sound, uint32 b, uint32 c) { _skySound->fnStartFx(sound, (uint8)(b & 1)); return true; } -bool SkyLogic::fnStopFx(uint32 a, uint32 b, uint32 c) { +bool Logic::fnStopFx(uint32 a, uint32 b, uint32 c) { _skySound->fnStopFx(); return true; } -bool SkyLogic::fnStartMusic(uint32 a, uint32 b, uint32 c) { +bool Logic::fnStartMusic(uint32 a, uint32 b, uint32 c) { if (!(SkyEngine::_systemVars.systemFlags & SF_MUS_OFF)) _skyMusic->startMusic((uint16)a); SkyEngine::_systemVars.currentMusic = (uint16)a; return true; } -bool SkyLogic::fnStopMusic(uint32 a, uint32 b, uint32 c) { +bool Logic::fnStopMusic(uint32 a, uint32 b, uint32 c) { _skyMusic->startMusic(0); SkyEngine::_systemVars.currentMusic = 0; return true; } -bool SkyLogic::fnFadeDown(uint32 a, uint32 b, uint32 c) { +bool Logic::fnFadeDown(uint32 a, uint32 b, uint32 c) { _skyScreen->fnFadeDown(a); return true; } -bool SkyLogic::fnFadeUp(uint32 a, uint32 b, uint32 c) { +bool Logic::fnFadeUp(uint32 a, uint32 b, uint32 c) { SkyEngine::_systemVars.currentPalette = a; _skyScreen->fnFadeUp(a,b); return true; } -bool SkyLogic::fnQuitToDos(uint32 a, uint32 b, uint32 c) { +bool Logic::fnQuitToDos(uint32 a, uint32 b, uint32 c) { _skyControl->showGameQuitMsg(); // calls _system->quit() return true; } -bool SkyLogic::fnPauseFx(uint32 a, uint32 b, uint32 c) { +bool Logic::fnPauseFx(uint32 a, uint32 b, uint32 c) { _skySound->fnPauseFx(); return true; } -bool SkyLogic::fnUnPauseFx(uint32 a, uint32 b, uint32 c) { +bool Logic::fnUnPauseFx(uint32 a, uint32 b, uint32 c) { _skySound->fnUnPauseFx(); return true; } -bool SkyLogic::fnPrintf(uint32 a, uint32 b, uint32 c) { +bool Logic::fnPrintf(uint32 a, uint32 b, uint32 c) { printf("fnPrintf: %d", a); return true; } -void SkyLogic::stdSpeak(Compact *target, uint32 textNum, uint32 animNum, uint32 base) { +void Logic::stdSpeak(Compact *target, uint32 textNum, uint32 animNum, uint32 base) { uint16 *animPtr; animNum += target->extCompact->megaSet / NEXT_MEGA_SET; animNum &= 0xFF; - if (SkyTalkAnims::animTalkTableIsPointer[animNum]) { //is it a pointer? - //animPtr = (uint16 *)SkyTalkAnims::animTalkTablePtr[animNum]; + if (TalkAnims::animTalkTableIsPointer[animNum]) { //is it a pointer? + //animPtr = (uint16 *)TalkAnims::animTalkTablePtr[animNum]; target->grafixProg.ptrType = TALKTABLE; target->grafixProg.ptrTarget = animNum; } else { //then it must be a value - //animPtr = (uint16 *)SkyEngine::fetchCompact(SkyTalkAnims::animTalkTableVal[animNum]); + //animPtr = (uint16 *)SkyEngine::fetchCompact(TalkAnims::animTalkTableVal[animNum]); target->grafixProg.ptrType = COMPACT; - target->grafixProg.ptrTarget = SkyTalkAnims::animTalkTableVal[animNum]; + target->grafixProg.ptrTarget = TalkAnims::animTalkTableVal[animNum]; } target->grafixProg.pos = 0; animPtr = SkyCompact::getGrafixPtr(target); diff --git a/sky/logic.h b/sky/logic.h index 9b39134746..439d0e2b14 100644 --- a/sky/logic.h +++ b/sky/logic.h @@ -80,28 +80,28 @@ enum scriptVariableOffsets { LINC_DIGIT_9 = 655 }; -class SkyAutoRoute; -class SkyControl; -class SkyDisk; -class SkyGrid; -class SkyMouse; -class SkyMusicBase; -class SkyScreen; -class SkySound; -class SkyText; +class AutoRoute; +class Control; +class Disk; +class Grid; +class Mouse; +class MusicBase; +class Screen; +class Sound; +class Text; -class SkyLogic { +class Logic { public: - SkyLogic( - SkyScreen *skyScreen, - SkyDisk *skyDisk, - SkyText *skyText, - SkyMusicBase *skyMusic, - SkyMouse *skyMouse, - SkySound *skySound); + Logic( + Screen *skyScreen, + Disk *skyDisk, + Text *skyText, + MusicBase *skyMusic, + Mouse *skyMouse, + Sound *skySound); void engine(); bool checkProtection(void); - void useControlInstance(SkyControl *control) { _skyControl = control; }; + void useControlInstance(Control *control) { _skyControl = control; }; void nop(); void logicScript(); @@ -242,7 +242,7 @@ public: void stdSpeak(Compact *target, uint32 textNum, uint32 animNum, uint32 base); static uint32 _scriptVariables[838]; - SkyGrid *_skyGrid; + Grid *_skyGrid; protected: void push(uint32); @@ -266,14 +266,14 @@ protected: Common::RandomSource _rnd; - SkyScreen *_skyScreen; - SkyDisk *_skyDisk; - SkyText *_skyText; - SkyMusicBase *_skyMusic; - SkySound *_skySound; - SkyAutoRoute *_skyAutoRoute; - SkyMouse *_skyMouse; - SkyControl *_skyControl; + Screen *_skyScreen; + Disk *_skyDisk; + Text *_skyText; + MusicBase *_skyMusic; + Sound *_skySound; + AutoRoute *_skyAutoRoute; + Mouse *_skyMouse; + Control *_skyControl; }; } // End of namespace Sky diff --git a/sky/mouse.cpp b/sky/mouse.cpp index 54da741034..95e95dc2f1 100644 --- a/sky/mouse.cpp +++ b/sky/mouse.cpp @@ -34,7 +34,7 @@ namespace Sky { #define NO_MAIN_OBJECTS 24 #define NO_LINC_OBJECTS 21 -uint32 SkyMouse::_mouseMainObjects[24] = { +uint32 Mouse::_mouseMainObjects[24] = { 65, 9, 66, @@ -61,7 +61,7 @@ uint32 SkyMouse::_mouseMainObjects[24] = { 38 }; -uint32 SkyMouse::_mouseLincObjects[21] = { +uint32 Mouse::_mouseLincObjects[21] = { 24625, 24649, 24827, @@ -85,7 +85,7 @@ uint32 SkyMouse::_mouseLincObjects[21] = { 24829 }; -SkyMouse::SkyMouse(OSystem *system, SkyDisk *skyDisk) { +Mouse::Mouse(OSystem *system, Disk *skyDisk) { _skyDisk = skyDisk; _system = system; @@ -100,22 +100,22 @@ SkyMouse::SkyMouse(OSystem *system, SkyDisk *skyDisk) { fixMouseTransparency(_objectMouseData, _skyDisk->_lastLoadedFileSize); } -SkyMouse::~SkyMouse( ){ +Mouse::~Mouse( ){ free (_miceData); free (_objectMouseData); } -void SkyMouse::replaceMouseCursors(uint16 fileNo) { +void Mouse::replaceMouseCursors(uint16 fileNo) { _skyDisk->loadFile(fileNo, _objectMouseData); fixMouseTransparency(_objectMouseData, _skyDisk->_lastLoadedFileSize); } -bool SkyMouse::fnAddHuman(void) { +bool Mouse::fnAddHuman(void) { //reintroduce the mouse so that the human can control the player //could still be switched out at high-level - if (!SkyLogic::_scriptVariables[MOUSE_STOP]) { - SkyLogic::_scriptVariables[MOUSE_STATUS] |= 6; //cursor & mouse + if (!Logic::_scriptVariables[MOUSE_STOP]) { + Logic::_scriptVariables[MOUSE_STATUS] |= 6; //cursor & mouse if (_mouseY < 2) //stop mouse activating top line _mouseY = 2; @@ -129,41 +129,41 @@ bool SkyMouse::fnAddHuman(void) { //get off may contain script to remove mouse pointer text //surely this script should be run just in case //I am going to try it anyway - if (SkyLogic::_scriptVariables[GET_OFF]) - _skyLogic->script((uint16)SkyLogic::_scriptVariables[GET_OFF],(uint16)(SkyLogic::_scriptVariables[GET_OFF] >> 16)); + if (Logic::_scriptVariables[GET_OFF]) + _skyLogic->script((uint16)Logic::_scriptVariables[GET_OFF],(uint16)(Logic::_scriptVariables[GET_OFF] >> 16)); - SkyLogic::_scriptVariables[SPECIAL_ITEM] = 0xFFFFFFFF; - SkyLogic::_scriptVariables[GET_OFF] = RESET_MOUSE; + Logic::_scriptVariables[SPECIAL_ITEM] = 0xFFFFFFFF; + Logic::_scriptVariables[GET_OFF] = RESET_MOUSE; } return true; } -void SkyMouse::fnSaveCoods(void) { - SkyLogic::_scriptVariables[SAFEX] = _mouseX + TOP_LEFT_X; - SkyLogic::_scriptVariables[SAFEY] = _mouseY + TOP_LEFT_Y; +void Mouse::fnSaveCoods(void) { + Logic::_scriptVariables[SAFEX] = _mouseX + TOP_LEFT_X; + Logic::_scriptVariables[SAFEY] = _mouseY + TOP_LEFT_Y; } -void SkyMouse::lockMouse(void) { +void Mouse::lockMouse(void) { SkyEngine::_systemVars.systemFlags |= SF_MOUSE_LOCKED; } -void SkyMouse::unlockMouse(void) { +void Mouse::unlockMouse(void) { SkyEngine::_systemVars.systemFlags &= ~SF_MOUSE_LOCKED; } -void SkyMouse::restoreMouseData(uint16 frameNum) { - warning("Stub: SkyMouse::restoreMouseData"); +void Mouse::restoreMouseData(uint16 frameNum) { + warning("Stub: Mouse::restoreMouseData"); } -void SkyMouse::drawNewMouse() { - warning("Stub: SkyMouse::drawNewMouse"); +void Mouse::drawNewMouse() { + warning("Stub: Mouse::drawNewMouse"); //calculateMouseValues(); //saveMouseData(); //drawMouse(); } -void SkyMouse::waitMouseNotPressed(void) { +void Mouse::waitMouseNotPressed(void) { bool mousePressed = true; OSystem::Event event; @@ -179,7 +179,7 @@ void SkyMouse::waitMouseNotPressed(void) { //original sky uses different colors for transparency than our backends do, //so we simply swap our "transparent"-white with another one. -void SkyMouse::fixMouseTransparency(byte *mouseData, uint32 size) { +void Mouse::fixMouseTransparency(byte *mouseData, uint32 size) { uint32 curPos = sizeof(struct dataFileHeader); uint32 cursorSize = ((struct dataFileHeader *)mouseData)->s_sp_size; @@ -196,7 +196,7 @@ void SkyMouse::fixMouseTransparency(byte *mouseData, uint32 size) { } } -void SkyMouse::spriteMouse(uint16 frameNum, uint8 mouseX, uint8 mouseY) { +void Mouse::spriteMouse(uint16 frameNum, uint8 mouseX, uint8 mouseY) { _currentCursor = frameNum; @@ -212,24 +212,24 @@ void SkyMouse::spriteMouse(uint16 frameNum, uint8 mouseX, uint8 mouseY) { else _system->show_mouse(true); } -void SkyMouse::mouseEngine(uint16 mouseX, uint16 mouseY) { +void Mouse::mouseEngine(uint16 mouseX, uint16 mouseY) { _mouseX = mouseX; _mouseY = mouseY; - _logicClick = (_mouseB > 0); // click signal is available for SkyLogic for one gamecycle + _logicClick = (_mouseB > 0); // click signal is available for Logic for one gamecycle - if (!SkyLogic::_scriptVariables[MOUSE_STOP]) { - if (SkyLogic::_scriptVariables[MOUSE_STATUS] & (1 << 1)) { + if (!Logic::_scriptVariables[MOUSE_STOP]) { + if (Logic::_scriptVariables[MOUSE_STATUS] & (1 << 1)) { pointerEngine(mouseX + TOP_LEFT_X, mouseY + TOP_LEFT_Y); - if (SkyLogic::_scriptVariables[MOUSE_STATUS] & (1 << 2)) //buttons enabled? + if (Logic::_scriptVariables[MOUSE_STATUS] & (1 << 2)) //buttons enabled? buttonEngine1(); } } _mouseB = 0; //don't save up buttons } -void SkyMouse::pointerEngine(uint16 xPos, uint16 yPos) { - uint32 currentListNum = SkyLogic::_scriptVariables[MOUSE_LIST_NO]; +void Mouse::pointerEngine(uint16 xPos, uint16 yPos) { + uint32 currentListNum = Logic::_scriptVariables[MOUSE_LIST_NO]; uint16 *currentList; do { currentList = (uint16 *)SkyEngine::fetchCompact(currentListNum); @@ -237,18 +237,18 @@ void SkyMouse::pointerEngine(uint16 xPos, uint16 yPos) { uint16 itemNum = *currentList; Compact *itemData = SkyEngine::fetchCompact(itemNum); currentList++; - if ((itemData->screen == SkyLogic::_scriptVariables[SCREEN]) && (itemData->status & 16)) { + if ((itemData->screen == Logic::_scriptVariables[SCREEN]) && (itemData->status & 16)) { if (itemData->xcood + ((int16)itemData->mouseRelX) > xPos) continue; if (itemData->xcood + ((int16)itemData->mouseRelX) + itemData->mouseSizeX < xPos) continue; if (itemData->ycood + ((int16)itemData->mouseRelY) > yPos) continue; if (itemData->ycood + ((int16)itemData->mouseRelY) + itemData->mouseSizeY < yPos) continue; // we've hit the item - if (SkyLogic::_scriptVariables[SPECIAL_ITEM] == itemNum) + if (Logic::_scriptVariables[SPECIAL_ITEM] == itemNum) return; - SkyLogic::_scriptVariables[SPECIAL_ITEM] = itemNum; - if (SkyLogic::_scriptVariables[GET_OFF]) - _skyLogic->mouseScript(SkyLogic::_scriptVariables[GET_OFF], itemData); - SkyLogic::_scriptVariables[GET_OFF] = itemData->mouseOff; + Logic::_scriptVariables[SPECIAL_ITEM] = itemNum; + if (Logic::_scriptVariables[GET_OFF]) + _skyLogic->mouseScript(Logic::_scriptVariables[GET_OFF], itemData); + Logic::_scriptVariables[GET_OFF] = itemData->mouseOff; if (itemData->mouseOn) _skyLogic->mouseScript(itemData->mouseOn, itemData); return; @@ -257,35 +257,35 @@ void SkyMouse::pointerEngine(uint16 xPos, uint16 yPos) { if (*currentList == 0xFFFF) currentListNum = currentList[1]; } while (*currentList != 0); - if (SkyLogic::_scriptVariables[SPECIAL_ITEM] != 0) { - SkyLogic::_scriptVariables[SPECIAL_ITEM] = 0; + if (Logic::_scriptVariables[SPECIAL_ITEM] != 0) { + Logic::_scriptVariables[SPECIAL_ITEM] = 0; - if (SkyLogic::_scriptVariables[GET_OFF]) - _skyLogic->script((uint16)SkyLogic::_scriptVariables[GET_OFF],(uint16)(SkyLogic::_scriptVariables[GET_OFF] >> 16)); - SkyLogic::_scriptVariables[GET_OFF] = 0; + if (Logic::_scriptVariables[GET_OFF]) + _skyLogic->script((uint16)Logic::_scriptVariables[GET_OFF],(uint16)(Logic::_scriptVariables[GET_OFF] >> 16)); + Logic::_scriptVariables[GET_OFF] = 0; } } -void SkyMouse::buttonPressed(uint8 button) { +void Mouse::buttonPressed(uint8 button) { _mouseB = button; } -void SkyMouse::buttonEngine1(void) { +void Mouse::buttonEngine1(void) { //checks for clicking on special item //"compare the size of this routine to S1 mouse_button" if (_mouseB) { //anything pressed? - SkyLogic::_scriptVariables[BUTTON] = _mouseB; - if (SkyLogic::_scriptVariables[SPECIAL_ITEM]) { //over anything? - Compact *item = SkyEngine::fetchCompact(SkyLogic::_scriptVariables[SPECIAL_ITEM]); + Logic::_scriptVariables[BUTTON] = _mouseB; + if (Logic::_scriptVariables[SPECIAL_ITEM]) { //over anything? + Compact *item = SkyEngine::fetchCompact(Logic::_scriptVariables[SPECIAL_ITEM]); if (item->mouseClick) _skyLogic->mouseScript(item->mouseClick, item); } } } -uint16 SkyMouse::findMouseCursor(uint32 itemNum) { +uint16 Mouse::findMouseCursor(uint32 itemNum) { uint8 cnt; for (cnt = 0; cnt < NO_MAIN_OBJECTS; cnt++) { @@ -301,13 +301,13 @@ uint16 SkyMouse::findMouseCursor(uint32 itemNum) { return 0; } -void SkyMouse::fnOpenCloseHand(bool open) { +void Mouse::fnOpenCloseHand(bool open) { - if ((!open) && (!SkyLogic::_scriptVariables[OBJECT_HELD])) { + if ((!open) && (!Logic::_scriptVariables[OBJECT_HELD])) { spriteMouse(1, 0, 0); return; } - uint16 cursor = findMouseCursor(SkyLogic::_scriptVariables[OBJECT_HELD]) << 1; + uint16 cursor = findMouseCursor(Logic::_scriptVariables[OBJECT_HELD]) << 1; if (open) cursor++; @@ -321,7 +321,7 @@ void SkyMouse::fnOpenCloseHand(bool open) { spriteMouse(0, 5, 5); } -bool SkyMouse::wasClicked(void) { +bool Mouse::wasClicked(void) { if (_logicClick) { _logicClick = false; diff --git a/sky/mouse.h b/sky/mouse.h index 61ba24272b..8ca02b8a7f 100644 --- a/sky/mouse.h +++ b/sky/mouse.h @@ -29,15 +29,15 @@ class OSystem; namespace Sky { -class SkyDisk; -class SkyLogic; +class Disk; +class Logic; -class SkyMouse { +class Mouse { public: - SkyMouse(OSystem *system, SkyDisk *skyDisk); - ~SkyMouse(void); + Mouse(OSystem *system, Disk *skyDisk); + ~Mouse(void); void mouseEngine(uint16 mouseX, uint16 mouseY); void replaceMouseCursors(uint16 fileNo); @@ -50,7 +50,7 @@ public: void restoreMouseData(uint16 frameNum); void drawNewMouse(void); void spriteMouse(uint16 frameNum, uint8 mouseX, uint8 mouseY); - void useLogicInstance(SkyLogic *skyLogic) { _skyLogic = skyLogic; }; + void useLogicInstance(Logic *skyLogic) { _skyLogic = skyLogic; }; void buttonPressed(uint8 button); void waitMouseNotPressed(void); uint16 giveMouseX(void) { return _mouseX; }; @@ -80,8 +80,8 @@ protected: static uint32 _mouseLincObjects[21]; OSystem *_system; - SkyDisk *_skyDisk; - SkyLogic *_skyLogic; + Disk *_skyDisk; + Logic *_skyLogic; }; } // End of namespace Sky diff --git a/sky/music/adlibchannel.cpp b/sky/music/adlibchannel.cpp index 0d3802a23d..057f366fee 100644 --- a/sky/music/adlibchannel.cpp +++ b/sky/music/adlibchannel.cpp @@ -26,7 +26,7 @@ namespace Sky { -SkyAdlibChannel::SkyAdlibChannel(FM_OPL *opl, uint8 *pMusicData, uint16 startOfData) { +AdlibChannel::AdlibChannel(FM_OPL *opl, uint8 *pMusicData, uint16 startOfData) { _opl = opl; _musicData = pMusicData; _channelData.startOfData = startOfData; @@ -77,12 +77,12 @@ SkyAdlibChannel::SkyAdlibChannel(FM_OPL *opl, uint8 *pMusicData, uint16 startOfD _musicVolume = 0x100; } -bool SkyAdlibChannel::isActive(void) { +bool AdlibChannel::isActive(void) { return _channelData.channelActive != 0; } -void SkyAdlibChannel::updateVolume(uint16 pVolume) { +void AdlibChannel::updateVolume(uint16 pVolume) { _musicVolume = pVolume; } @@ -91,7 +91,7 @@ void SkyAdlibChannel::updateVolume(uint16 pVolume) { asm driver did (_musicData[0xF5F..0x105E]), so the cache is indeed shared by all instances of the class. */ -void SkyAdlibChannel::setRegister(uint8 regNum, uint8 value) { +void AdlibChannel::setRegister(uint8 regNum, uint8 value) { if (_adlibRegMirror[regNum] != value) { OPLWriteReg (_opl, regNum, value); @@ -99,7 +99,7 @@ void SkyAdlibChannel::setRegister(uint8 regNum, uint8 value) { } } -void SkyAdlibChannel::stopNote(void) { +void AdlibChannel::stopNote(void) { if (_channelData.note & 0x20) { _channelData.note &= ~0x20; @@ -107,7 +107,7 @@ void SkyAdlibChannel::stopNote(void) { } } -int32 SkyAdlibChannel::getNextEventTime(void) { +int32 AdlibChannel::getNextEventTime(void) { int32 retV = 0; uint8 cnt, lVal; for (cnt = 0; cnt < 4; cnt++) { @@ -122,7 +122,7 @@ int32 SkyAdlibChannel::getNextEventTime(void) { } -uint8 SkyAdlibChannel::process(uint16 aktTime) { +uint8 AdlibChannel::process(uint16 aktTime) { if (!_channelData.channelActive) { return 0; @@ -156,12 +156,12 @@ uint8 SkyAdlibChannel::process(uint16 aktTime) { case 10: //com90_error(); case 11: //com90_doLodsb(); case 13: //com90_do_two_Lodsb(); - error("SkyChannel: dummy music routine 0x%02X was called",opcode); + error("Channel: dummy music routine 0x%02X was called",opcode); _channelData.channelActive = 0; break; default: // these opcodes aren't implemented in original music driver - error("SkyChannel: Not existent routine 0x%02X was called",opcode); + error("Channel: Not existent routine 0x%02X was called",opcode); _channelData.channelActive = 0; break; } @@ -190,7 +190,7 @@ uint8 SkyAdlibChannel::process(uint16 aktTime) { return returnVal; } -void SkyAdlibChannel::setupInstrument(uint8 opcode) { +void AdlibChannel::setupInstrument(uint8 opcode) { uint16 nextNote; if (_channelData.tremoVibro) { @@ -211,7 +211,7 @@ void SkyAdlibChannel::setupInstrument(uint8 opcode) { _channelData.note = (uint8)((nextNote >> 8) | 0x20); } -void SkyAdlibChannel::setupChannelVolume(uint8 volume) { +void AdlibChannel::setupChannelVolume(uint8 volume) { uint8 resultOp; uint32 resVol = ((volume + 1) * (_channelData.instrumentData->totOutLev_Op2 + 1)) << 1; @@ -234,7 +234,7 @@ void SkyAdlibChannel::setupChannelVolume(uint8 volume) { setRegister(0x40 | _channelData.adlibReg1, resultOp); } -void SkyAdlibChannel::adlibSetupInstrument(void) { +void AdlibChannel::adlibSetupInstrument(void) { setRegister(0x60 | _channelData.adlibReg1, _channelData.instrumentData->ad_Op1); setRegister(0x60 | _channelData.adlibReg2, _channelData.instrumentData->ad_Op2); @@ -253,7 +253,7 @@ void SkyAdlibChannel::adlibSetupInstrument(void) { #define ENDIAN16(x) (x) #endif -uint16 SkyAdlibChannel::getNextNote(uint8 param) { +uint16 AdlibChannel::getNextNote(uint8 param) { int16 freqIndex = ((int16)_channelData.freqOffset) - 0x40; if (freqIndex >= 0x3F) freqIndex++; @@ -270,20 +270,20 @@ uint16 SkyAdlibChannel::getNextNote(uint8 param) { //- command 90h routines -void SkyAdlibChannel::com90_caseNoteOff(void) { +void AdlibChannel::com90_caseNoteOff(void) { if (_musicData[_channelData.eventDataPtr] == _channelData.lastCommand) stopNote(); _channelData.eventDataPtr++; } -void SkyAdlibChannel::com90_stopChannel(void) { +void AdlibChannel::com90_stopChannel(void) { stopNote(); _channelData.channelActive = 0; } -void SkyAdlibChannel::com90_setupInstrument(void) { +void AdlibChannel::com90_setupInstrument(void) { _channelData.channelVolume = 0x7F; _channelData.freqOffset = 0x40; @@ -293,14 +293,14 @@ void SkyAdlibChannel::com90_setupInstrument(void) { adlibSetupInstrument(); } -uint8 SkyAdlibChannel::com90_updateTempo(void) { +uint8 AdlibChannel::com90_updateTempo(void) { uint8 retV = _musicData[_channelData.eventDataPtr]; _channelData.eventDataPtr++; return retV; } -void SkyAdlibChannel::com90_getFreqOffset(void) { +void AdlibChannel::com90_getFreqOffset(void) { _channelData.freqOffset = _musicData[_channelData.eventDataPtr]; _channelData.eventDataPtr++; @@ -313,29 +313,29 @@ void SkyAdlibChannel::com90_getFreqOffset(void) { } } -void SkyAdlibChannel::com90_getChannelVolume(void) { +void AdlibChannel::com90_getChannelVolume(void) { _channelData.channelVolume = _musicData[_channelData.eventDataPtr]; _channelData.eventDataPtr++; } -void SkyAdlibChannel::com90_getTremoVibro(void) { +void AdlibChannel::com90_getTremoVibro(void) { _channelData.tremoVibro = _musicData[_channelData.eventDataPtr]; _channelData.eventDataPtr++; } -void SkyAdlibChannel::com90_rewindMusic(void) { +void AdlibChannel::com90_rewindMusic(void) { _channelData.eventDataPtr = _channelData.startOfData; } -void SkyAdlibChannel::com90_keyOff(void) { +void AdlibChannel::com90_keyOff(void) { stopNote(); } -void SkyAdlibChannel::com90_setStartOfData(void) { +void AdlibChannel::com90_setStartOfData(void) { _channelData.startOfData = _channelData.eventDataPtr; } diff --git a/sky/music/adlibchannel.h b/sky/music/adlibchannel.h index ab942992fb..879ba97e08 100644 --- a/sky/music/adlibchannel.h +++ b/sky/music/adlibchannel.h @@ -58,9 +58,9 @@ typedef struct { uint16 frequency; } AdlibChannelType; -class SkyAdlibChannel : public SkyChannelBase { +class AdlibChannel : public ChannelBase { public: - SkyAdlibChannel (FM_OPL *opl, uint8 *pMusicData, uint16 startOfData); + AdlibChannel (FM_OPL *opl, uint8 *pMusicData, uint16 startOfData); virtual void stopNote(void); virtual uint8 process(uint16 aktTime); virtual void updateVolume(uint16 pVolume); diff --git a/sky/music/adlibmusic.cpp b/sky/music/adlibmusic.cpp index cc4e6cf9ee..b799ff9377 100644 --- a/sky/music/adlibmusic.cpp +++ b/sky/music/adlibmusic.cpp @@ -26,13 +26,13 @@ namespace Sky { -void SkyAdlibMusic::passMixerFunc(void *param, int16 *buf, uint len) { +void AdlibMusic::passMixerFunc(void *param, int16 *buf, uint len) { - ((SkyAdlibMusic*)param)->premixerCall(buf, len); + ((AdlibMusic*)param)->premixerCall(buf, len); } -SkyAdlibMusic::SkyAdlibMusic(SoundMixer *pMixer, SkyDisk *pSkyDisk, OSystem *system) - : SkyMusicBase(pSkyDisk, system) { +AdlibMusic::AdlibMusic(SoundMixer *pMixer, Disk *pDisk, OSystem *system) + : MusicBase(pDisk, system) { _driverFileBase = 60202; _mixer = pMixer; @@ -46,20 +46,20 @@ SkyAdlibMusic::SkyAdlibMusic(SoundMixer *pMixer, SkyDisk *pSkyDisk, OSystem *sys _mixer->setupPremix(passMixerFunc, this); } -SkyAdlibMusic::~SkyAdlibMusic(void) { +AdlibMusic::~AdlibMusic(void) { _mixer->setupPremix(0, 0); // YM3812Shutdown(); } -void SkyAdlibMusic::setVolume(uint8 volume) { +void AdlibMusic::setVolume(uint8 volume) { _musicVolume = volume; for (uint8 cnt = 0; cnt < _numberOfChannels; cnt++) _channels[cnt]->updateVolume(volume | 128); } -void SkyAdlibMusic::premixerCall(int16 *data, uint len) { +void AdlibMusic::premixerCall(int16 *data, uint len) { if (_musicData == NULL) { // no music loaded @@ -93,7 +93,7 @@ void SkyAdlibMusic::premixerCall(int16 *data, uint len) { } } -void SkyAdlibMusic::setupPointers(void) { +void AdlibMusic::setupPointers(void) { if (SkyEngine::_systemVars.gameVersion == 109) { // disk demo uses a different adlib driver version, some offsets have changed @@ -112,18 +112,18 @@ void SkyAdlibMusic::setupPointers(void) { _nextMusicPoll = 0; } -void SkyAdlibMusic::setupChannels(uint8 *channelData) { +void AdlibMusic::setupChannels(uint8 *channelData) { _numberOfChannels = channelData[0]; channelData++; for (uint8 cnt = 0; cnt < _numberOfChannels; cnt++) { uint16 chDataStart = ((channelData[(cnt << 1) | 1] << 8) | channelData[cnt << 1]) + _musicDataLoc; - _channels[cnt] = new SkyAdlibChannel(_opl, _musicData, chDataStart); + _channels[cnt] = new AdlibChannel(_opl, _musicData, chDataStart); _channels[cnt]->updateVolume(_musicVolume | 128); } } -void SkyAdlibMusic::startDriver(void) { +void AdlibMusic::startDriver(void) { uint16 cnt = 0; while (_initSequence[cnt] || _initSequence[cnt+1]) { diff --git a/sky/music/adlibmusic.h b/sky/music/adlibmusic.h index 37c362dac0..55342fcd9f 100644 --- a/sky/music/adlibmusic.h +++ b/sky/music/adlibmusic.h @@ -29,10 +29,10 @@ class SoundMixer; namespace Sky { -class SkyAdlibMusic : public SkyMusicBase { +class AdlibMusic : public MusicBase { public: - SkyAdlibMusic(SoundMixer *pMixer, SkyDisk *pSkyDisk, OSystem *system); - ~SkyAdlibMusic(void); + AdlibMusic(SoundMixer *pMixer, Disk *pDisk, OSystem *system); + ~AdlibMusic(void); virtual void setVolume(uint8 volume); private: FM_OPL *_opl; diff --git a/sky/music/gmchannel.cpp b/sky/music/gmchannel.cpp index 2ffcf67ea5..3493c27d2f 100644 --- a/sky/music/gmchannel.cpp +++ b/sky/music/gmchannel.cpp @@ -25,7 +25,7 @@ namespace Sky { -SkyGmChannel::SkyGmChannel(uint8 *pMusicData, uint16 startOfData, MidiDriver *pMidiDrv, byte *pInstMap, uint8 *veloTab) { +GmChannel::GmChannel(uint8 *pMusicData, uint16 startOfData, MidiDriver *pMidiDrv, byte *pInstMap, uint8 *veloTab) { _musicData = pMusicData; _midiDrv = pMidiDrv; @@ -41,12 +41,12 @@ SkyGmChannel::SkyGmChannel(uint8 *pMusicData, uint16 startOfData, MidiDriver *pM _lastVolume = 0xFF; } -bool SkyGmChannel::isActive(void) { +bool GmChannel::isActive(void) { return _channelData.channelActive != 0; } -void SkyGmChannel::updateVolume(uint16 pVolume) { +void GmChannel::updateVolume(uint16 pVolume) { _musicVolume = pVolume; if (_musicVolume > 0) @@ -57,12 +57,12 @@ void SkyGmChannel::updateVolume(uint16 pVolume) { } } -void SkyGmChannel::stopNote(void) { +void GmChannel::stopNote(void) { _midiDrv->send((0xB0 | _channelData.midiChannelNumber) | 0x7B00 | 0 | 0x79000000); } -int32 SkyGmChannel::getNextEventTime(void) { +int32 GmChannel::getNextEventTime(void) { int32 retV = 0; uint8 cnt, lVal; @@ -78,7 +78,7 @@ int32 SkyGmChannel::getNextEventTime(void) { } -uint8 SkyGmChannel::process(uint16 aktTime) { +uint8 GmChannel::process(uint16 aktTime) { if (!_channelData.channelActive) return 0; @@ -112,12 +112,12 @@ uint8 SkyGmChannel::process(uint16 aktTime) { case 4: //com90_dummy(); case 7: //com90_skipTremoVibro(); case 10: //com90_error(); - error("SkyChannel: dummy music routine 0x%02X was called",opcode); + error("Channel: dummy music routine 0x%02X was called",opcode); _channelData.channelActive = 0; break; default: // these opcodes aren't implemented in original music driver - error("SkyChannel: Not existent routine 0x%02X was called",opcode); + error("Channel: Not existent routine 0x%02X was called",opcode); _channelData.channelActive = 0; break; } @@ -139,66 +139,66 @@ uint8 SkyGmChannel::process(uint16 aktTime) { //- command 90h routines -void SkyGmChannel::com90_caseNoteOff(void) { +void GmChannel::com90_caseNoteOff(void) { _midiDrv->send((0x90 | _channelData.midiChannelNumber) | (_musicData[_channelData.eventDataPtr] << 8)); _channelData.eventDataPtr++; } -void SkyGmChannel::com90_stopChannel(void) { +void GmChannel::com90_stopChannel(void) { stopNote(); _channelData.channelActive = 0; } -void SkyGmChannel::com90_setupInstrument(void) { +void GmChannel::com90_setupInstrument(void) { _midiDrv->send((0xC0 | _channelData.midiChannelNumber) | (_mt32_to_gm[_musicData[_channelData.eventDataPtr]] << 8)); _channelData.eventDataPtr++; } -uint8 SkyGmChannel::com90_updateTempo(void) { +uint8 GmChannel::com90_updateTempo(void) { uint8 retV = _musicData[_channelData.eventDataPtr]; _channelData.eventDataPtr++; return retV; } -void SkyGmChannel::com90_getPitch(void) { +void GmChannel::com90_getPitch(void) { _midiDrv->send((0xE0 | _channelData.midiChannelNumber) | 0 | (_musicData[_channelData.eventDataPtr] << 16)); _channelData.eventDataPtr++; } -void SkyGmChannel::com90_getChannelVolume(void) { +void GmChannel::com90_getChannelVolume(void) { _lastVolume = _musicData[_channelData.eventDataPtr]; uint8 newVol = (uint8)((_musicData[_channelData.eventDataPtr++] * _musicVolume) >> 7); _midiDrv->send((0xB0 | _channelData.midiChannelNumber) | 0x700 | (newVol << 16)); } -void SkyGmChannel::com90_rewindMusic(void) { +void GmChannel::com90_rewindMusic(void) { _channelData.eventDataPtr = _channelData.startOfData; } -void SkyGmChannel::com90_keyOff(void) { +void GmChannel::com90_keyOff(void) { _midiDrv->send((0x90 | _channelData.midiChannelNumber) | (_channelData.note << 8) | 0); } -void SkyGmChannel::com90_setStartOfData(void) { +void GmChannel::com90_setStartOfData(void) { _channelData.startOfData = _channelData.eventDataPtr; } -void SkyGmChannel::com90_getChannelPanValue(void) { +void GmChannel::com90_getChannelPanValue(void) { _midiDrv->send((0xB0 | _channelData.midiChannelNumber) | 0x0A00 | (_musicData[_channelData.eventDataPtr] << 16)); _channelData.eventDataPtr++; } -void SkyGmChannel::com90_getChannelControl(void) { +void GmChannel::com90_getChannelControl(void) { uint8 conNum = _musicData[_channelData.eventDataPtr]; uint8 conDat = _musicData[_channelData.eventDataPtr + 1]; diff --git a/sky/music/gmchannel.h b/sky/music/gmchannel.h index 17c5a0f261..97b0796c01 100644 --- a/sky/music/gmchannel.h +++ b/sky/music/gmchannel.h @@ -37,9 +37,9 @@ typedef struct { uint8 channelActive; } MidiChannelType; -class SkyGmChannel : public SkyChannelBase { +class GmChannel : public ChannelBase { public: - SkyGmChannel(uint8 *pMusicData, uint16 startOfData, MidiDriver *pMidiDrv, byte *pInstMap, uint8 *veloTab); + GmChannel(uint8 *pMusicData, uint16 startOfData, MidiDriver *pMidiDrv, byte *pInstMap, uint8 *veloTab); virtual void stopNote(void); virtual uint8 process(uint16 aktTime); virtual void updateVolume(uint16 pVolume); diff --git a/sky/music/gmmusic.cpp b/sky/music/gmmusic.cpp index c4278c9c46..5d36d6bb98 100644 --- a/sky/music/gmmusic.cpp +++ b/sky/music/gmmusic.cpp @@ -27,13 +27,13 @@ namespace Sky { -void SkyGmMusic::passTimerFunc(void *param) { +void GmMusic::passTimerFunc(void *param) { - ((SkyGmMusic*)param)->timerCall(); + ((GmMusic*)param)->timerCall(); } -SkyGmMusic::SkyGmMusic(MidiDriver *pMidiDrv, SkyDisk *pSkyDisk, OSystem *system) - : SkyMusicBase(pSkyDisk, system) { +GmMusic::GmMusic(MidiDriver *pMidiDrv, Disk *pDisk, OSystem *system) + : MusicBase(pDisk, system) { _driverFileBase = 60200; _midiDrv = pMidiDrv; @@ -45,7 +45,7 @@ SkyGmMusic::SkyGmMusic(MidiDriver *pMidiDrv, SkyDisk *pSkyDisk, OSystem *system) _ignoreNextPoll = false; } -SkyGmMusic::~SkyGmMusic(void) { +GmMusic::~GmMusic(void) { _midiDrv->setTimerCallback(NULL, NULL); if (_currentMusic) stopMusic(); @@ -56,7 +56,7 @@ SkyGmMusic::~SkyGmMusic(void) { delete _midiDrv; } -void SkyGmMusic::setVolume(uint8 volume) { +void GmMusic::setVolume(uint8 volume) { uint8 sysEx[6]; _musicVolume = volume; @@ -66,7 +66,7 @@ void SkyGmMusic::setVolume(uint8 volume) { _midiDrv->sysEx(sysEx, 6); } -void SkyGmMusic::timerCall(void) { +void GmMusic::timerCall(void) { // midi driver polls hundred times per sec. We only want 50 times. _ignoreNextPoll = !_ignoreNextPoll; @@ -76,7 +76,7 @@ void SkyGmMusic::timerCall(void) { pollMusic(); } -void SkyGmMusic::setupPointers(void) { +void GmMusic::setupPointers(void) { if (SkyEngine::_systemVars.gameVersion == 109) { _musicDataLoc = (_musicData[0x79C] << 8) | _musicData[0x79B]; @@ -87,24 +87,24 @@ void SkyGmMusic::setupPointers(void) { } } -void SkyGmMusic::setupChannels(uint8 *channelData) { +void GmMusic::setupChannels(uint8 *channelData) { _numberOfChannels = channelData[0]; channelData++; for (uint8 cnt = 0; cnt < _numberOfChannels; cnt++) { uint16 chDataStart = ((channelData[(cnt << 1) | 1] << 8) | channelData[cnt << 1]) + _musicDataLoc; - _channels[cnt] = new SkyGmChannel(_musicData, chDataStart, _midiDrv, _mt32_to_gm, _veloTab); + _channels[cnt] = new GmChannel(_musicData, chDataStart, _midiDrv, _mt32_to_gm, _veloTab); _channels[cnt]->updateVolume(_musicVolume); } } -void SkyGmMusic::startDriver(void) { +void GmMusic::startDriver(void) { //_midiDrv->send(0xFF); //ALSA can't handle this. // skip all sysEx as it can't be handled anyways. } -byte SkyGmMusic::_mt32_to_gm[128] = { +byte GmMusic::_mt32_to_gm[128] = { // 0 1 2 3 4 5 6 7 8 9 A B C D E F 0, 1, 0, 2, 4, 4, 5, 3, 16, 17, 18, 16, 16, 19, 20, 21, // 0x 6, 6, 6, 7, 7, 7, 8, 112, 62, 62, 63, 63, 38, 38, 39, 39, // 1x @@ -116,7 +116,7 @@ byte SkyGmMusic::_mt32_to_gm[128] = { 47, 117, 127, 118, 118, 116, 115, 119, 115, 112, 55, 124, 123, 0, 14, 117, // 7x }; -uint8 SkyGmMusic::_veloTab[128] = { +uint8 GmMusic::_veloTab[128] = { 0x00, 0x40, 0x41, 0x41, 0x42, 0x42, 0x43, 0x43, 0x44, 0x44, 0x45, 0x45, 0x46, 0x46, 0x47, 0x47, 0x48, 0x48, 0x49, 0x49, 0x4A, 0x4A, 0x4B, 0x4B, 0x4C, 0x4C, 0x4D, 0x4D, 0x4E, 0x4E, diff --git a/sky/music/gmmusic.h b/sky/music/gmmusic.h index ab836ed98f..df77787266 100644 --- a/sky/music/gmmusic.h +++ b/sky/music/gmmusic.h @@ -28,10 +28,10 @@ class MidiDriver; namespace Sky { -class SkyGmMusic : public SkyMusicBase { +class GmMusic : public MusicBase { public: - SkyGmMusic(MidiDriver *pMidiDrv, SkyDisk *pSkyDisk, OSystem *system); - ~SkyGmMusic(void); + GmMusic(MidiDriver *pMidiDrv, Disk *pDisk, OSystem *system); + ~GmMusic(void); virtual void setVolume(uint8 volume); private: static void passTimerFunc(void *param); diff --git a/sky/music/mt32music.cpp b/sky/music/mt32music.cpp index c65615f372..c0e1bea4ce 100644 --- a/sky/music/mt32music.cpp +++ b/sky/music/mt32music.cpp @@ -26,13 +26,13 @@ namespace Sky { -void SkyMT32Music::passTimerFunc(void *param) { +void MT32Music::passTimerFunc(void *param) { - ((SkyMT32Music*)param)->timerCall(); + ((MT32Music*)param)->timerCall(); } -SkyMT32Music::SkyMT32Music(MidiDriver *pMidiDrv, SkyDisk *pSkyDisk, OSystem *system) - : SkyMusicBase(pSkyDisk, system) { +MT32Music::MT32Music(MidiDriver *pMidiDrv, Disk *pDisk, OSystem *system) + : MusicBase(pDisk, system) { _driverFileBase = 60200; _midiDrv = pMidiDrv; @@ -46,14 +46,14 @@ SkyMT32Music::SkyMT32Music(MidiDriver *pMidiDrv, SkyDisk *pSkyDisk, OSystem *sys _dummyMap[cnt] = cnt; } -SkyMT32Music::~SkyMT32Music(void) { +MT32Music::~MT32Music(void) { _midiDrv->close(); _midiDrv->setTimerCallback(NULL, NULL); delete _midiDrv; } -void SkyMT32Music::timerCall(void) { +void MT32Music::timerCall(void) { // midi driver polls hundred times per sec. We only want 50 times. _ignoreNextPoll = !_ignoreNextPoll; @@ -63,7 +63,7 @@ void SkyMT32Music::timerCall(void) { pollMusic(); } -void SkyMT32Music::setVolume(uint8 volume) { +void MT32Music::setVolume(uint8 volume) { uint8 sysEx[10] = "\x41\x10\x16\x12\x10\x00\x16\x00\x00"; _musicVolume = volume; sysEx[7] = (volume > 100) ? 100 : volume; @@ -74,25 +74,25 @@ void SkyMT32Music::setVolume(uint8 volume) { _midiDrv->sysEx(sysEx, 9); } -void SkyMT32Music::setupPointers(void) { +void MT32Music::setupPointers(void) { _musicDataLoc = (_musicData[0x7DD] << 8) | _musicData[0x7DC]; _sysExSequence = ((_musicData[0x7E1] << 8) | _musicData[0x7E0]) + _musicData; } -void SkyMT32Music::setupChannels(uint8 *channelData) { +void MT32Music::setupChannels(uint8 *channelData) { _numberOfChannels = channelData[0]; channelData++; for (uint8 cnt = 0; cnt < _numberOfChannels; cnt++) { uint16 chDataStart = ((channelData[(cnt << 1) | 1] << 8) | channelData[cnt << 1]) + _musicDataLoc; - _channels[cnt] = new SkyGmChannel(_musicData, chDataStart, _midiDrv, _dummyMap, _dummyMap); + _channels[cnt] = new GmChannel(_musicData, chDataStart, _midiDrv, _dummyMap, _dummyMap); } } #define MIDI_PACK(a,b,c,d) ((a) | ((b) << 8) | ((c) << 16) | ((d) << 24)) -bool SkyMT32Music::processPatchSysEx(uint8 *sysExData) { +bool MT32Music::processPatchSysEx(uint8 *sysExData) { uint8 sysExBuf[15]; uint8 crc = 0; @@ -117,7 +117,7 @@ bool SkyMT32Music::processPatchSysEx(uint8 *sysExData) { return true; } -void SkyMT32Music::startDriver(void) { +void MT32Music::startDriver(void) { // setup timbres and patches using SysEx data uint8* sysExData = _sysExSequence; diff --git a/sky/music/mt32music.h b/sky/music/mt32music.h index 928651b4ea..05d5fde89c 100644 --- a/sky/music/mt32music.h +++ b/sky/music/mt32music.h @@ -28,10 +28,10 @@ class MidiDriver; namespace Sky { -class SkyMT32Music : public SkyMusicBase { +class MT32Music : public MusicBase { public: - SkyMT32Music(MidiDriver *pMidiDrv, SkyDisk *pSkyDisk, OSystem *system); - ~SkyMT32Music(void); + MT32Music(MidiDriver *pMidiDrv, Disk *pDisk, OSystem *system); + ~MT32Music(void); private: static void passTimerFunc(void *param); void timerCall(void); diff --git a/sky/music/musicbase.cpp b/sky/music/musicbase.cpp index 1843be84d3..74083431cb 100644 --- a/sky/music/musicbase.cpp +++ b/sky/music/musicbase.cpp @@ -25,11 +25,11 @@ namespace Sky { -SkyMusicBase::SkyMusicBase(SkyDisk *pSkyDisk, OSystem *system) { +MusicBase::MusicBase(Disk *pDisk, OSystem *system) { _musicData = NULL; _allowedCommands = 0; - _skyDisk = pSkyDisk; + _skyDisk = pDisk; _currentMusic = 0; _musicVolume = 127; _system = system; @@ -37,13 +37,13 @@ SkyMusicBase::SkyMusicBase(SkyDisk *pSkyDisk, OSystem *system) { _mutex = _system->create_mutex(); } -SkyMusicBase::~SkyMusicBase(void) { +MusicBase::~MusicBase(void) { if (_musicData) free(_musicData); } -void SkyMusicBase::loadSection(uint8 pSection) { +void MusicBase::loadSection(uint8 pSection) { _system->lock_mutex(_mutex); if (_currentMusic) @@ -65,7 +65,7 @@ void SkyMusicBase::loadSection(uint8 pSection) { _system->unlock_mutex(_mutex); } -bool SkyMusicBase::musicIsPlaying(void) { +bool MusicBase::musicIsPlaying(void) { for (uint8 cnt = 0; cnt < _numberOfChannels; cnt++) if (_channels[cnt]->isActive()) @@ -73,7 +73,7 @@ bool SkyMusicBase::musicIsPlaying(void) { return false; } -void SkyMusicBase::musicCommand(uint16 command) { +void MusicBase::musicCommand(uint16 command) { if (_musicData == NULL) { debug(1,"Got music command but driver is not yet loaded"); @@ -85,16 +85,16 @@ void SkyMusicBase::musicCommand(uint16 command) { } switch(command >> 8) { case 0: - debug(1,"SkyMusic: got call to startAdlibDriver(). Not necessary in this implementation."); + debug(1,"Music: got call to startAdlibDriver(). Not necessary in this implementation."); break; case 1: - debug(1,"SkyMusic: got call to stopDriver(). Not necessary in this implementation."); + debug(1,"Music: got call to stopDriver(). Not necessary in this implementation."); break; case 2: - debug(1,"SkyMusic: got call to SetTempo(). Tempo is fixed in this implementation."); + debug(1,"Music: got call to SetTempo(). Tempo is fixed in this implementation."); break; case 3: - debug(1,"SkyMusic: ignored direct call to driverPoll()."); + debug(1,"Music: ignored direct call to driverPoll()."); break; case 4: startMusic(command & 0xFF); @@ -113,14 +113,14 @@ void SkyMusicBase::musicCommand(uint16 command) { } } -void SkyMusicBase::setFMVolume(uint16 param) { +void MusicBase::setFMVolume(uint16 param) { _musicVolume = param; for (uint8 cnt = 0; cnt < _numberOfChannels; cnt++) _channels[cnt]->updateVolume(_musicVolume); } -void SkyMusicBase::stopMusic(void) { +void MusicBase::stopMusic(void) { for (uint8 cnt = 0; cnt < _numberOfChannels; cnt++) { _channels[cnt]->stopNote(); @@ -129,7 +129,7 @@ void SkyMusicBase::stopMusic(void) { _numberOfChannels = 0; } -void SkyMusicBase::updateTempo(void) { +void MusicBase::updateTempo(void) { uint16 tempoMul = _musicTempo0 * _musicTempo1; uint16 divisor = 0x4446390/ 23864; @@ -137,7 +137,7 @@ void SkyMusicBase::updateTempo(void) { _tempo |= (((tempoMul%divisor) << 16) | (tempoMul / divisor)) / divisor; } -void SkyMusicBase::loadNewMusic(void) { +void MusicBase::loadNewMusic(void) { uint16 musicPos; if (_onNextPoll.musicToProcess > _musicData[_musicDataLoc]) { @@ -163,7 +163,7 @@ void SkyMusicBase::loadNewMusic(void) { } } -void SkyMusicBase::pollMusic(void) { +void MusicBase::pollMusic(void) { _system->lock_mutex(_mutex); uint8 newTempo; diff --git a/sky/music/musicbase.h b/sky/music/musicbase.h index 43e993cef2..5e2b665737 100644 --- a/sky/music/musicbase.h +++ b/sky/music/musicbase.h @@ -30,7 +30,7 @@ class OSystem; namespace Sky { -class SkyDisk; +class Disk; #define FILES_PER_SECTION 4 @@ -39,7 +39,7 @@ typedef struct { uint8 musicToProcess; } Actions; -class SkyChannelBase { +class ChannelBase { public: virtual void stopNote(void) = 0; virtual uint8 process(uint16 aktTime) = 0; @@ -48,10 +48,10 @@ public: private: }; -class SkyMusicBase { +class MusicBase { public: - SkyMusicBase(SkyDisk *pSkyDisk, OSystem *system); - virtual ~SkyMusicBase(void); + MusicBase(Disk *pDisk, OSystem *system); + virtual ~MusicBase(void); void loadSection(uint8 pSection); void musicCommand(uint16 command); void startMusic(uint16 param) { _onNextPoll.musicToProcess = param & 0xF; }; // 4 @@ -63,7 +63,7 @@ public: protected: OSystem *_system; - SkyDisk *_skyDisk; + Disk *_skyDisk; uint8 *_musicData; uint8 _allowedCommands; uint16 _musicDataLoc; @@ -76,7 +76,7 @@ protected: uint32 _tempo; // calculated from musicTempo0 and musicTempo1 uint32 _aktTime; Actions _onNextPoll; - SkyChannelBase *_channels[10]; + ChannelBase *_channels[10]; OSystem::MutexRef _mutex; virtual void setupPointers(void) = 0; diff --git a/sky/screen.cpp b/sky/screen.cpp index 9967daec02..a9abb4e97e 100644 --- a/sky/screen.cpp +++ b/sky/screen.cpp @@ -30,7 +30,7 @@ namespace Sky { -uint8 SkyScreen::_top16Colours[16*3] = { +uint8 Screen::_top16Colours[16*3] = { 0, 0, 0, 38, 38, 38, 63, 63, 63, @@ -49,7 +49,7 @@ uint8 SkyScreen::_top16Colours[16*3] = { 63, 63, 63 }; -SkyScreen::SkyScreen(OSystem *pSystem, SkyDisk *pDisk) { +Screen::Screen(OSystem *pSystem, Disk *pDisk) { _system = pSystem; _skyDisk = pDisk; @@ -84,13 +84,13 @@ SkyScreen::SkyScreen(OSystem *pSystem, SkyDisk *pDisk) { _seqInfo.running = false; } -SkyScreen::~SkyScreen(void) { +Screen::~Screen(void) { free(_gameGrid); if (_currentScreen) free(_currentScreen); } -void SkyScreen::clearScreen(void) { +void Screen::clearScreen(void) { memset(_currentScreen, 0, FULL_SCREEN_WIDTH * FULL_SCREEN_HEIGHT); _system->copy_rect(_currentScreen, GAME_SCREEN_WIDTH, 0, 0, GAME_SCREEN_WIDTH, GAME_SCREEN_HEIGHT); @@ -98,14 +98,14 @@ void SkyScreen::clearScreen(void) { } //set a new palette, pal is a pointer to dos vga rgb components 0..63 -void SkyScreen::setPalette(uint8 *pal) { +void Screen::setPalette(uint8 *pal) { convertPalette(pal, _palette); _system->set_palette(_palette, 0, GAME_COLOURS); _system->update_screen(); } -void SkyScreen::setPaletteEndian(uint8 *pal) { +void Screen::setPaletteEndian(uint8 *pal) { #ifdef SCUMM_BIG_ENDIAN uint8 endPalette[256 * 3]; @@ -119,7 +119,7 @@ void SkyScreen::setPaletteEndian(uint8 *pal) { _system->update_screen(); } -void SkyScreen::halvePalette(void) { +void Screen::halvePalette(void) { uint8 halfPalette[1024]; for (uint8 cnt = 0; cnt < GAME_COLOURS; cnt++) { @@ -131,31 +131,31 @@ void SkyScreen::halvePalette(void) { _system->set_palette(halfPalette, 0, GAME_COLOURS); } -void SkyScreen::setPalette(uint16 fileNum) { +void Screen::setPalette(uint16 fileNum) { uint8 *tmpPal = _skyDisk->loadFile(fileNum, NULL); if (tmpPal) { setPalette(tmpPal); free(tmpPal); - } else warning("SkyScreen::setPalette: can't load file nr. %d",fileNum); + } else warning("Screen::setPalette: can't load file nr. %d",fileNum); } -void SkyScreen::showScreen(uint16 fileNum) { +void Screen::showScreen(uint16 fileNum) { if (_currentScreen) free(_currentScreen); _currentScreen = _skyDisk->loadFile(fileNum, NULL); if (_currentScreen) showScreen(_currentScreen); - else warning("SkyScreen::showScreen: can't load file nr. %d",fileNum); + else warning("Screen::showScreen: can't load file nr. %d",fileNum); } -void SkyScreen::showScreen(uint8 *pScreen) { +void Screen::showScreen(uint8 *pScreen) { _system->copy_rect(pScreen, 320, 0, 0, GAME_SCREEN_WIDTH, GAME_SCREEN_HEIGHT); _system->update_screen(); } -void SkyScreen::convertPalette(uint8 *inPal, uint8* outPal) { //convert 3 byte 0..63 rgb to 4byte 0..255 rgbx +void Screen::convertPalette(uint8 *inPal, uint8* outPal) { //convert 3 byte 0..63 rgb to 4byte 0..255 rgbx int i; @@ -167,14 +167,14 @@ void SkyScreen::convertPalette(uint8 *inPal, uint8* outPal) { //convert 3 byte 0 } } -void SkyScreen::recreate(void) { +void Screen::recreate(void) { // check the game grid for changed blocks - if (!SkyLogic::_scriptVariables[LAYER_0_ID]) return ; + if (!Logic::_scriptVariables[LAYER_0_ID]) return ; uint8 *gridPos = _gameGrid; - uint8 *screenData = (uint8 *)SkyEngine::fetchItem(SkyLogic::_scriptVariables[LAYER_0_ID]); + uint8 *screenData = (uint8 *)SkyEngine::fetchItem(Logic::_scriptVariables[LAYER_0_ID]); if (!screenData) { - error("SkyScreen::recreate():\nSkyEngine::fetchItem(SkyLogic::_scriptVariables[LAYER_0_ID](%X)) returned NULL",SkyLogic::_scriptVariables[LAYER_0_ID]); + error("Screen::recreate():\nSkyEngine::fetchItem(Logic::_scriptVariables[LAYER_0_ID](%X)) returned NULL",Logic::_scriptVariables[LAYER_0_ID]); } uint8 *screenPos = _currentScreen; @@ -200,7 +200,7 @@ void SkyScreen::recreate(void) { } } -void SkyScreen::flip(bool doUpdate) { +void Screen::flip(bool doUpdate) { uint32 copyX, copyWidth; copyX = copyWidth = 0; @@ -224,7 +224,7 @@ void SkyScreen::flip(bool doUpdate) { _system->update_screen(); } -void SkyScreen::fnDrawScreen(uint32 palette, uint32 scroll) { +void Screen::fnDrawScreen(uint32 palette, uint32 scroll) { // set up the new screen fnFadeDown(scroll); @@ -235,7 +235,7 @@ void SkyScreen::fnDrawScreen(uint32 palette, uint32 scroll) { fnFadeUp(palette, scroll); } -void SkyScreen::fnFadeDown(uint32 scroll) { +void Screen::fnFadeDown(uint32 scroll) { if (scroll && (!(SkyEngine::_systemVars.systemFlags & SF_NO_SCROLL))) { // scrolling is performed by fnFadeUp. It's just prepared here @@ -254,7 +254,7 @@ void SkyScreen::fnFadeDown(uint32 scroll) { } } -void SkyScreen::palette_fadedown_helper(uint32 *pal, uint num) { +void Screen::palette_fadedown_helper(uint32 *pal, uint num) { byte *p = (byte *)pal; do { @@ -274,16 +274,16 @@ void SkyScreen::palette_fadedown_helper(uint32 *pal, uint num) { } while (--num); } -void SkyScreen::paletteFadeUp(uint16 fileNr) { +void Screen::paletteFadeUp(uint16 fileNr) { uint8 *pal = _skyDisk->loadFile(fileNr, NULL); if (pal) { paletteFadeUp(pal); free(pal); - } else warning("SkyScreen::paletteFadeUp: Can't load palette #%d",fileNr); + } else warning("Screen::paletteFadeUp: Can't load palette #%d",fileNr); } -void SkyScreen::paletteFadeUp(uint8 *pal) { +void Screen::paletteFadeUp(uint8 *pal) { byte tmpPal[1024]; @@ -301,7 +301,7 @@ void SkyScreen::paletteFadeUp(uint8 *pal) { } } -void SkyScreen::fnFadeUp(uint32 palNum, uint32 scroll) { +void Screen::fnFadeUp(uint32 palNum, uint32 scroll) { //_currentScreen points to new screen, //_scrollScreen points to graphic showing old room @@ -312,7 +312,7 @@ void SkyScreen::fnFadeUp(uint32 palNum, uint32 scroll) { if ((scroll == 0) || (SkyEngine::_systemVars.systemFlags & SF_NO_SCROLL)) { uint8 *palette = (uint8 *)SkyEngine::fetchCompact(palNum); if (palette == NULL) - error("SkyScreen::fnFadeUp: can't fetch compact %X", palNum); + error("Screen::fnFadeUp: can't fetch compact %X", palNum); #ifdef SCUMM_BIG_ENDIAN byte tmpPal[256 * 3]; for (uint16 cnt = 0; cnt < 256*3; cnt++) @@ -323,8 +323,8 @@ void SkyScreen::fnFadeUp(uint32 palNum, uint32 scroll) { #endif } else if (scroll == 123) { // scroll left (going right) - if (!_currentScreen) error("SkyScreen::fnFadeUp[Scroll L]: _currentScreen is NULL"); - if (!_scrollScreen) error("SkyScreen::fnFadeUp[Scroll L]: _scrollScreen is NULL"); + if (!_currentScreen) error("Screen::fnFadeUp[Scroll L]: _currentScreen is NULL"); + if (!_scrollScreen) error("Screen::fnFadeUp[Scroll L]: _scrollScreen is NULL"); uint8 *scrNewPtr, *scrOldPtr; for (uint8 scrollCnt = 0; scrollCnt < (GAME_SCREEN_WIDTH / SCROLL_JUMP) - 1; scrollCnt++) { scrNewPtr = _currentScreen + scrollCnt * SCROLL_JUMP; @@ -342,8 +342,8 @@ void SkyScreen::fnFadeUp(uint32 palNum, uint32 scroll) { free(_scrollScreen); } else if (scroll == 321) { // scroll right (going left) - if (!_currentScreen) error("SkyScreen::fnFadeUp[Scroll R]: _currentScreen is NULL"); - if (!_scrollScreen) error("SkyScreen::fnFadeUp[Scroll R]: _scrollScreen is NULL"); + if (!_currentScreen) error("Screen::fnFadeUp[Scroll R]: _currentScreen is NULL"); + if (!_scrollScreen) error("Screen::fnFadeUp[Scroll R]: _scrollScreen is NULL"); uint8 *scrNewPtr, *scrOldPtr; for (uint8 scrollCnt = 0; scrollCnt < (GAME_SCREEN_WIDTH / SCROLL_JUMP) - 1; scrollCnt++) { scrNewPtr = _currentScreen + GAME_SCREEN_WIDTH - (scrollCnt + 1) * SCROLL_JUMP; @@ -362,7 +362,7 @@ void SkyScreen::fnFadeUp(uint32 palNum, uint32 scroll) { } } -void SkyScreen::waitForTimer(void) { +void Screen::waitForTimer(void) { _gotTick = false; while (!_gotTick) { @@ -373,7 +373,7 @@ void SkyScreen::waitForTimer(void) { } } -void SkyScreen::waitForSequence(void) { +void Screen::waitForSequence(void) { while (_seqInfo.running) { OSystem::Event event; @@ -382,14 +382,14 @@ void SkyScreen::waitForSequence(void) { } } -void SkyScreen::handleTimer(void) { +void Screen::handleTimer(void) { _gotTick = true; if (_seqInfo.running) processSequence(); } -void SkyScreen::startSequence(uint16 fileNum) { +void Screen::startSequence(uint16 fileNum) { _seqInfo.seqData = _skyDisk->loadFile(fileNum, NULL); _seqInfo.framesLeft = _seqInfo.seqData[0]; @@ -399,7 +399,7 @@ void SkyScreen::startSequence(uint16 fileNum) { _seqInfo.runningItem = false; } -void SkyScreen::startSequenceItem(uint16 itemNum) { +void Screen::startSequenceItem(uint16 itemNum) { _seqInfo.seqData = (uint8 *)SkyEngine::fetchItem(itemNum); _seqInfo.framesLeft = _seqInfo.seqData[0] - 1; @@ -409,7 +409,7 @@ void SkyScreen::startSequenceItem(uint16 itemNum) { _seqInfo.runningItem = true; } -void SkyScreen::stopSequence() { +void Screen::stopSequence() { _seqInfo.running = false; waitForTimer(); @@ -419,7 +419,7 @@ void SkyScreen::stopSequence() { _seqInfo.seqData = _seqInfo.seqDataPos = NULL; } -void SkyScreen::processSequence(void) { +void Screen::processSequence(void) { uint32 screenPos = 0; @@ -495,24 +495,24 @@ void SkyScreen::processSequence(void) { //- sprites.asm routines -void SkyScreen::spriteEngine(void) { +void Screen::spriteEngine(void) { doSprites(BACK); sortSprites(); doSprites(FORE); } -void SkyScreen::sortSprites(void) { +void Screen::sortSprites(void) { StSortList sortList[30]; uint32 currDrawList = DRAW_LIST_NO; uint32 loadDrawList; bool nextDrawList = false; - while (SkyLogic::_scriptVariables[currDrawList]) { + while (Logic::_scriptVariables[currDrawList]) { // big_sort_loop uint32 spriteCnt = 0; - loadDrawList = SkyLogic::_scriptVariables[currDrawList]; + loadDrawList = Logic::_scriptVariables[currDrawList]; currDrawList++; do { // a_new_draw_list: @@ -526,7 +526,7 @@ void SkyScreen::sortSprites(void) { // process_this_id: Compact *spriteComp = SkyEngine::fetchCompact(drawListData[0]); if ((spriteComp->status & 4) && // is it sortable playfield?(!?!) - (spriteComp->screen == SkyLogic::_scriptVariables[SCREEN])) { // on current screen + (spriteComp->screen == Logic::_scriptVariables[SCREEN])) { // on current screen dataFileHeader *spriteData = (dataFileHeader *)SkyEngine::fetchItem(spriteComp->frame >> 6); if (!spriteData) { @@ -569,13 +569,13 @@ void SkyScreen::sortSprites(void) { } } -void SkyScreen::doSprites(uint8 layer) { +void Screen::doSprites(uint8 layer) { uint16 drawListNum = DRAW_LIST_NO; uint32 idNum; uint16* drawList; - while (SkyLogic::_scriptVariables[drawListNum]) { // std sp loop - idNum = SkyLogic::_scriptVariables[drawListNum]; + while (Logic::_scriptVariables[drawListNum]) { // std sp loop + idNum = Logic::_scriptVariables[drawListNum]; drawListNum++; drawList = (uint16 *)SkyEngine::fetchCompact(idNum); @@ -587,7 +587,7 @@ void SkyScreen::doSprites(uint8 layer) { Compact *spriteData = SkyEngine::fetchCompact(drawList[0]); drawList++; if ((spriteData->status & (1 << layer)) && - (spriteData->screen == SkyLogic::_scriptVariables[SCREEN])) { + (spriteData->screen == Logic::_scriptVariables[SCREEN])) { uint8 *toBeDrawn = (uint8 *)SkyEngine::fetchItem(spriteData->frame >> 6); if (!toBeDrawn) { debug(9, "Spritedata %d not loaded", spriteData->frame >> 6); @@ -606,10 +606,10 @@ void SkyScreen::doSprites(uint8 layer) { } } -void SkyScreen::drawSprite(uint8 *spriteInfo, Compact *sprCompact) { +void Screen::drawSprite(uint8 *spriteInfo, Compact *sprCompact) { if (spriteInfo == NULL) { - warning("SkyScreen::drawSprite Can't draw sprite. Data %d was not loaded", sprCompact->frame >> 6); + warning("Screen::drawSprite Can't draw sprite. Data %d was not loaded", sprCompact->frame >> 6); sprCompact->status = 0; return ; } @@ -670,7 +670,7 @@ void SkyScreen::drawSprite(uint8 *spriteInfo, Compact *sprCompact) { return; } if ((_sprX + _sprWidth > 320) || (_sprY + _sprHeight > 192)) { - warning("SkyScreen::drawSprite fatal error: got x = %d, y = %d, w = %d, h = %d",_sprX, _sprY, _sprWidth, _sprHeight); + warning("Screen::drawSprite fatal error: got x = %d, y = %d, w = %d, h = %d",_sprX, _sprY, _sprWidth, _sprHeight); _sprWidth = 0; return ; } @@ -694,7 +694,7 @@ void SkyScreen::drawSprite(uint8 *spriteInfo, Compact *sprCompact) { _sprHeight -= _sprY; } -void SkyScreen::vectorToGame(uint8 gridVal) { +void Screen::vectorToGame(uint8 gridVal) { if (_sprWidth == 0) return ; uint8 *trgGrid = _gameGrid + _sprY * GRID_X +_sprX; @@ -705,14 +705,14 @@ void SkyScreen::vectorToGame(uint8 gridVal) { } } -void SkyScreen::vertMaskSub(uint16 *grid, uint32 gridOfs, uint8 *screenPtr, uint32 layerId) { +void Screen::vertMaskSub(uint16 *grid, uint32 gridOfs, uint8 *screenPtr, uint32 layerId) { for (uint32 cntx = 0; cntx < _sprHeight; cntx++) { // start_x | block_loop if (grid[gridOfs]) { if (!(FROM_LE_16(grid[gridOfs]) & 0x8000)) { uint32 gridVal = FROM_LE_16(grid[gridOfs]) - 1; gridVal *= GRID_W * GRID_H; - uint8 *dataSrc = (uint8 *)SkyEngine::fetchItem(SkyLogic::_scriptVariables[layerId]) + gridVal; + uint8 *dataSrc = (uint8 *)SkyEngine::fetchItem(Logic::_scriptVariables[layerId]) + gridVal; uint8 *dataTrg = screenPtr; for (uint32 grdCntY = 0; grdCntY < GRID_H; grdCntY++) { for (uint32 grdCntX = 0; grdCntX < GRID_W; grdCntX++) @@ -727,7 +727,7 @@ void SkyScreen::vertMaskSub(uint16 *grid, uint32 gridOfs, uint8 *screenPtr, uint } // next_x } -void SkyScreen::verticalMask(void) { +void Screen::verticalMask(void) { if (_sprWidth == 0) return ; uint32 startGridOfs = (_sprY + _sprHeight - 1) * GRID_X + _sprX; @@ -738,9 +738,9 @@ void SkyScreen::verticalMask(void) { uint8 *screenPtr = startScreenPtr; for (uint32 widCnt = 0; widCnt < _sprWidth; widCnt++) { // x_loop uint32 nLayerCnt = layerCnt; - while (SkyLogic::_scriptVariables[nLayerCnt + 3]) { + while (Logic::_scriptVariables[nLayerCnt + 3]) { uint16 *scrGrid; - scrGrid = (uint16 *)SkyEngine::fetchItem(SkyLogic::_scriptVariables[layerCnt + 3]); + scrGrid = (uint16 *)SkyEngine::fetchItem(Logic::_scriptVariables[layerCnt + 3]); if (scrGrid[gridOfs]) { vertMaskSub(scrGrid, gridOfs, screenPtr, layerCnt); break; @@ -753,7 +753,7 @@ void SkyScreen::verticalMask(void) { } } -void SkyScreen::paintBox(uint16 x, uint16 y) { +void Screen::paintBox(uint16 x, uint16 y) { uint8 *screenPos = _currentScreen + y * GAME_SCREEN_WIDTH + x; memset(screenPos, 255, 8); @@ -764,7 +764,7 @@ void SkyScreen::paintBox(uint16 x, uint16 y) { memset(screenPos + 7 * GAME_SCREEN_WIDTH, 255, 7); } -void SkyScreen::showGrid(uint8 *gridBuf) { +void Screen::showGrid(uint8 *gridBuf) { uint32 gridData = 0; uint8 bitsLeft = 0; diff --git a/sky/screen.h b/sky/screen.h index 54f11d163e..50434bae8d 100644 --- a/sky/screen.h +++ b/sky/screen.h @@ -30,7 +30,7 @@ class OSystem; namespace Sky { -class SkyDisk; +class Disk; class SkyEngine; struct Compact; struct dataFileHeader; @@ -49,10 +49,10 @@ typedef struct { dataFileHeader *sprite; } StSortList; -class SkyScreen { +class Screen { public: - SkyScreen(OSystem *pSystem, SkyDisk *pDisk); - ~SkyScreen(void); + Screen(OSystem *pSystem, Disk *pDisk); + ~Screen(void); void setPalette(uint8 *pal); void setPaletteEndian(uint8 *pal); void setPalette(uint16 fileNum); @@ -89,7 +89,7 @@ public: private: OSystem *_system; - SkyDisk *_skyDisk; + Disk *_skyDisk; static uint8 _top16Colours[16*3]; uint8 _palette[1024]; uint32 _currentPalette; diff --git a/sky/sky.cpp b/sky/sky.cpp index bd9f748b88..e6b396f536 100644 --- a/sky/sky.cpp +++ b/sky/sky.cpp @@ -157,18 +157,18 @@ void SkyEngine::doCheat(uint8 num) { switch(num) { case 1: warning("executed cheat: get jammer"); - SkyLogic::_scriptVariables[258] = 42; // got_jammer - SkyLogic::_scriptVariables[240] = 69; // got_sponsor + Logic::_scriptVariables[258] = 42; // got_jammer + Logic::_scriptVariables[240] = 69; // got_sponsor break; case 2: warning("executed cheat: computer room"); - SkyLogic::_scriptVariables[479] = 2; // card_status - SkyLogic::_scriptVariables[480] = 1; // card_fix + Logic::_scriptVariables[479] = 2; // card_status + Logic::_scriptVariables[480] = 1; // card_fix break; case 3: warning("executed cheat: get to burke"); - SkyLogic::_scriptVariables[190] = 42; // knows_port + Logic::_scriptVariables[190] = 42; // knows_port break; case 4: warning("executed cheat: get to reactor section"); - SkyLogic::_scriptVariables[451] = 42; // foreman_friend + Logic::_scriptVariables[451] = 42; // foreman_friend _skyLogic->fnSendSync(8484, 1, 0); // send sync to RAD suit (put in locker) _skyLogic->fnKillId(ID_ANITA_SPY, 0, 0); // stop anita from getting to you break; @@ -208,7 +208,7 @@ void SkyEngine::go() { bool introSkipped = false; if (!_quickLaunch) { if (_systemVars.gameVersion > 267) {// don't do intro for floppydemos - _skyIntro = new SkyIntro(_skyDisk, _skyScreen, _skyMusic, _skySound, _skyText, _mixer, _system); + _skyIntro = new Intro(_skyDisk, _skyScreen, _skyMusic, _skySound, _skyText, _mixer, _system); introSkipped = !_skyIntro->doIntro(_floppyIntro); if (_skyIntro->_quitProg) { delete _skyIntro; @@ -253,21 +253,21 @@ void SkyEngine::go() { } void SkyEngine::initialise(void) { - _skyDisk = new SkyDisk(_gameDataPath); - _skySound = new SkySound(_mixer, _skyDisk, ConfMan.getInt("sfx_volume")); + _skyDisk = new Disk(_gameDataPath); + _skySound = new Sound(_mixer, _skyDisk, ConfMan.getInt("sfx_volume")); _systemVars.gameVersion = _skyDisk->determineGameVersion(); int midiDriver = GameDetector::detectMusicDriver(MDT_ADLIB | MDT_NATIVE | MDT_PREFER_NATIVE); if (midiDriver == MD_ADLIB) { _systemVars.systemFlags |= SF_SBLASTER; - _skyMusic = new SkyAdlibMusic(_mixer, _skyDisk, _system); + _skyMusic = new AdlibMusic(_mixer, _skyDisk, _system); } else { _systemVars.systemFlags |= SF_ROLAND; if (ConfMan.getBool("native_mt32")) - _skyMusic = new SkyMT32Music(GameDetector::createMidi(midiDriver), _skyDisk, _system); + _skyMusic = new MT32Music(GameDetector::createMidi(midiDriver), _skyDisk, _system); else - _skyMusic = new SkyGmMusic(GameDetector::createMidi(midiDriver), _skyDisk, _system); + _skyMusic = new GmMusic(GameDetector::createMidi(midiDriver), _skyDisk, _system); } if (isCDVersion()) { @@ -286,20 +286,20 @@ void SkyEngine::initialise(void) { _systemVars.systemFlags |= SF_PLAY_VOCS; _systemVars.gameSpeed = 50; - _skyText = new SkyText(_skyDisk); - _skyMouse = new SkyMouse(_system, _skyDisk); - _skyScreen = new SkyScreen(_system, _skyDisk); + _skyText = new Text(_skyDisk); + _skyMouse = new Mouse(_system, _skyDisk); + _skyScreen = new Screen(_system, _skyDisk); initVirgin(); initItemList(); loadFixedItems(); - _skyLogic = new SkyLogic(_skyScreen, _skyDisk, _skyText, _skyMusic, _skyMouse, _skySound); + _skyLogic = new Logic(_skyScreen, _skyDisk, _skyText, _skyMusic, _skyMouse, _skySound); _skyMouse->useLogicInstance(_skyLogic); // initialize timer *after* _skyScreen has been initialized. _timer->installTimerProc(&timerHandler, 1000000 / 50, this); //call 50 times per second - _skyControl = new SkyControl(_skyScreen, _skyDisk, _skyMouse, _skyText, _skyMusic, _skyLogic, _skySound, _system, getSavePath()); + _skyControl = new Control(_skyScreen, _skyDisk, _skyMouse, _skyText, _skyMusic, _skyLogic, _skySound, _system, getSavePath()); _skyLogic->useControlInstance(_skyControl); if (_systemVars.gameVersion == 288) @@ -427,7 +427,7 @@ void SkyEngine::gotTimerTick(void) { } Compact *SkyEngine::fetchCompact(uint32 a) { - SkyDebug::fetchCompact(a); + Debug::fetchCompact(a); uint32 sectionNum = (a & 0xf000) >> 12; uint32 compactNum = (a & 0x0fff); @@ -42,15 +42,15 @@ struct SystemVars { }; struct Compact; -class SkySound; -class SkyDisk; -class SkyText; -class SkyLogic; -class SkyMouse; -class SkyScreen; -class SkyControl; -class SkyMusicBase; -class SkyIntro; +class Sound; +class Disk; +class Text; +class Logic; +class Mouse; +class Screen; +class Control; +class MusicBase; +class Intro; class SkyEngine : public Engine { void errorString(const char *buf_input, char *buf_output); @@ -69,16 +69,16 @@ protected: int _sdl_mouse_x, _sdl_mouse_y; - SkySound *_skySound; - SkyDisk *_skyDisk; - SkyText *_skyText; - SkyLogic *_skyLogic; - SkyMouse *_skyMouse; - SkyScreen *_skyScreen; - SkyControl *_skyControl; + Sound *_skySound; + Disk *_skyDisk; + Text *_skyText; + Logic *_skyLogic; + Mouse *_skyMouse; + Screen *_skyScreen; + Control *_skyControl; - SkyMusicBase *_skyMusic; - SkyIntro *_skyIntro; + MusicBase *_skyMusic; + Intro *_skyIntro; public: SkyEngine(GameDetector *detector, OSystem *syst); @@ -105,7 +105,7 @@ protected: uint32 _lastSaveTime; - SkyText *getSkyText(); + Text *getText(); void initialise(); void initItemList(); diff --git a/sky/sound.cpp b/sky/sound.cpp index 197e4335f7..b877c14c80 100644 --- a/sky/sound.cpp +++ b/sky/sound.cpp @@ -54,7 +54,7 @@ struct Sfx { #pragma END_PACK_STRUCTS #endif -uint16 SkySound::_speechConvertTable[8] = { +uint16 Sound::_speechConvertTable[8] = { 0, //;Text numbers to file numbers 600, //; 553 lines in section 0 600+500, //; 488 lines in section 1 @@ -1010,14 +1010,14 @@ static Sfx *musicList[] = { &fx_25_weld // 394 my anchor weld bodge }; -SfxQueue SkySound::_sfxQueue[MAX_QUEUED_FX] = { +SfxQueue Sound::_sfxQueue[MAX_QUEUED_FX] = { { 0, 0, 0, 0}, { 0, 0, 0, 0}, { 0, 0, 0, 0}, { 0, 0, 0, 0} }; -SkySound::SkySound(SoundMixer *mixer, SkyDisk *pDisk, uint8 pVolume) { +Sound::Sound(SoundMixer *mixer, Disk *pDisk, uint8 pVolume) { _skyDisk = pDisk; _soundData = NULL; _mixer = mixer; @@ -1025,13 +1025,13 @@ SkySound::SkySound(SoundMixer *mixer, SkyDisk *pDisk, uint8 pVolume) { _mainSfxVolume = pVolume; } -SkySound::~SkySound(void) { +Sound::~Sound(void) { _mixer->stopAll(); if (_soundData) free(_soundData); } -void SkySound::playSound(uint32 id, byte *sound, uint32 size, PlayingSoundHandle *handle) { +void Sound::playSound(uint32 id, byte *sound, uint32 size, PlayingSoundHandle *handle) { byte flags = 0; flags |= SoundMixer::FLAG_UNSIGNED|SoundMixer::FLAG_AUTOFREE; @@ -1043,7 +1043,7 @@ void SkySound::playSound(uint32 id, byte *sound, uint32 size, PlayingSoundHandle _mixer->playRaw(handle, buffer, size, 11025, flags, id); } -void SkySound::loadSection(uint8 pSection) { +void Sound::loadSection(uint8 pSection) { fnStopFx(); _mixer->stopAll(); @@ -1076,7 +1076,7 @@ void SkySound::loadSection(uint8 pSection) { _sfxQueue[cnt].count = 0; } -void SkySound::playSound(uint16 sound, uint16 volume, uint8 channel) { +void Sound::playSound(uint16 sound, uint16 volume, uint8 channel) { if (channel == 0) _mixer->stopID(SOUND_CH0); @@ -1084,12 +1084,12 @@ void SkySound::playSound(uint16 sound, uint16 volume, uint8 channel) { _mixer->stopID(SOUND_CH1); if (!_soundData) { - warning("SkySound::playSound(%04X, %04X) called with a section having been loaded", sound, volume); + warning("Sound::playSound(%04X, %04X) called with a section having been loaded", sound, volume); return; } if (sound > _soundsTotal) { - debug(5, "SkySound::playSound %d ignored, only %d sfx in file", sound, _soundsTotal); + debug(5, "Sound::playSound %d ignored, only %d sfx in file", sound, _soundsTotal); return ; } @@ -1120,13 +1120,13 @@ void SkySound::playSound(uint16 sound, uint16 volume, uint8 channel) { _mixer->playRaw(&_ingameSound1, _soundData + dataOfs, dataSize, sampleRate, flags, SOUND_CH1, volume, 0, loopSta, loopEnd); } -void SkySound::fnStartFx(uint32 sound, uint8 channel) { +void Sound::fnStartFx(uint32 sound, uint8 channel) { _saveSounds[channel] = 0xFFFF; if (sound < 256 || sound > MAX_FX_NUMBER || (SkyEngine::_systemVars.systemFlags & SF_FX_OFF)) return; - uint8 screen = (uint8)(SkyLogic::_scriptVariables[SCREEN] & 0xff); + uint8 screen = (uint8)(Logic::_scriptVariables[SCREEN] & 0xff); if (sound == 278 && screen == 25) // is this weld in room 25 sound= 394; @@ -1173,7 +1173,7 @@ void SkySound::fnStartFx(uint32 sound, uint8 channel) { playSound(sfx->soundNo, volume, channel); } -void SkySound::checkFxQueue(void) { +void Sound::checkFxQueue(void) { for (uint8 cnt = 0; cnt < MAX_QUEUED_FX; cnt++) { if (_sfxQueue[cnt].count) { _sfxQueue[cnt].count--; @@ -1183,7 +1183,7 @@ void SkySound::checkFxQueue(void) { } } -void SkySound::restoreSfx(void) { +void Sound::restoreSfx(void) { // queue sfx, so they will be started when the player exits the control panel memset(_sfxQueue, 0, sizeof(_sfxQueue)); @@ -1203,17 +1203,17 @@ void SkySound::restoreSfx(void) { } } -void SkySound::fnStopFx(void) { +void Sound::fnStopFx(void) { _mixer->stopID(SOUND_CH0); _mixer->stopID(SOUND_CH1); _saveSounds[0] = _saveSounds[1] = 0xFFFF; } -void SkySound::stopSpeech(void) { +void Sound::stopSpeech(void) { _mixer->stopID(SOUND_SPEECH); } -bool SkySound::startSpeech(uint16 textNum) { +bool Sound::startSpeech(uint16 textNum) { if (!(SkyEngine::_systemVars.systemFlags & SF_ALLOW_SPEECH)) return false; @@ -1236,13 +1236,13 @@ bool SkySound::startSpeech(uint16 textNum) { return true; } -void SkySound::fnPauseFx(void) { +void Sound::fnPauseFx(void) { _mixer->pauseID(SOUND_CH0, true); _mixer->pauseID(SOUND_CH1, true); } -void SkySound::fnUnPauseFx(void) { +void Sound::fnUnPauseFx(void) { _mixer->pauseID(SOUND_CH0, false); _mixer->pauseID(SOUND_CH1, false); diff --git a/sky/sound.h b/sky/sound.h index ae835d2451..91e2337d3a 100644 --- a/sky/sound.h +++ b/sky/sound.h @@ -28,7 +28,7 @@ namespace Sky { -class SkyDisk; +class Disk; enum { SOUND_CH0 = 0, @@ -44,7 +44,7 @@ struct SfxQueue { #define MAX_QUEUED_FX 4 -class SkySound { +class Sound { protected: public: @@ -62,8 +62,8 @@ protected: void playSound(uint32 id, byte *sound, uint32 size, PlayingSoundHandle *handle); public: - SkySound(SoundMixer *mixer, SkyDisk *pDisk, uint8 pVolume); - ~SkySound(void); + Sound(SoundMixer *mixer, Disk *pDisk, uint8 pVolume); + ~Sound(void); void loadSection(uint8 pSection); void playSound(uint16 sound, uint16 volume, uint8 channel); @@ -79,7 +79,7 @@ public: uint8 _soundsTotal; private: - SkyDisk *_skyDisk; + Disk *_skyDisk; uint16 _sfxBaseOfs; uint8 *_soundData; uint8 *_sampleRates, *_sfxInfo; diff --git a/sky/talks.h b/sky/talks.h index 978e0c194b..f5124461a5 100644 --- a/sky/talks.h +++ b/sky/talks.h @@ -24,7 +24,7 @@ namespace Sky { -namespace SkyTalkAnims { +namespace TalkAnims { uint16 show_mag[] = { 68*64, diff --git a/sky/text.cpp b/sky/text.cpp index ae728d45ce..cbc5f43fa5 100644 --- a/sky/text.cpp +++ b/sky/text.cpp @@ -36,7 +36,7 @@ namespace Sky { #define CHAR_SET_HEADER 128 #define MAX_NO_LINES 10 -SkyText::SkyText(SkyDisk *skyDisk) { +Text::Text(Disk *skyDisk) { _skyDisk = skyDisk; initHuffTree(); @@ -68,14 +68,14 @@ SkyText::SkyText(SkyDisk *skyDisk) { _preAfterTableArea = NULL; } -SkyText::~SkyText(void) { +Text::~Text(void) { if (_controlCharacterSet.addr) free(_controlCharacterSet.addr); if (_linkCharacterSet.addr) free(_linkCharacterSet.addr); if (_preAfterTableArea) free(_preAfterTableArea); } -void SkyText::patchChar(byte *charSetPtr, int width, int height, int c, const uint16 *data) { +void Text::patchChar(byte *charSetPtr, int width, int height, int c, const uint16 *data) { byte *ptr = charSetPtr + (CHAR_SET_HEADER + (height << 2) * c); charSetPtr[c] = width; @@ -88,7 +88,7 @@ void SkyText::patchChar(byte *charSetPtr, int width, int height, int c, const ui } } -void SkyText::patchLINCCharset() { +void Text::patchLINCCharset() { // The LINC terminal charset looks strange in some cases. This // function attempts to patch up the worst blemishes. @@ -220,7 +220,7 @@ void SkyText::patchLINCCharset() { } } -void SkyText::fnSetFont(uint32 fontNr) { +void Text::fnSetFont(uint32 fontNr) { struct charSet *newCharSet; @@ -244,19 +244,19 @@ void SkyText::fnSetFont(uint32 fontNr) { _dtCharSpacing = newCharSet->charSpacing; } -void SkyText::fnTextModule(uint32 textInfoId, uint32 textNo) { +void Text::fnTextModule(uint32 textInfoId, uint32 textNo) { fnSetFont(1); uint16* msgData = (uint16 *)SkyEngine::fetchCompact(textInfoId); lowTextManager_t textId = lowTextManager(textNo, msgData[1], msgData[2], 209, false); - SkyLogic::_scriptVariables[RESULT] = textId.compactNum; + Logic::_scriptVariables[RESULT] = textId.compactNum; Compact *textCompact = SkyEngine::fetchCompact(textId.compactNum); textCompact->xcood = msgData[3]; textCompact->ycood = msgData[4]; fnSetFont(0); } -void SkyText::getText(uint32 textNr) { //load text #"textNr" into textBuffer +void Text::getText(uint32 textNr) { //load text #"textNr" into textBuffer if (patchMessage(textNr)) return ; @@ -329,12 +329,12 @@ void SkyText::getText(uint32 textNr) { //load text #"textNr" into textBuffer } while(textChar); } -void SkyText::fnPointerText(uint32 pointedId, uint16 mouseX, uint16 mouseY) { +void Text::fnPointerText(uint32 pointedId, uint16 mouseX, uint16 mouseY) { Compact *ptrComp = SkyEngine::fetchCompact(pointedId); lowTextManager_t text = lowTextManager(ptrComp->cursorText, TEXT_MOUSE_WIDTH, L_CURSOR, 242, false); - SkyLogic::_scriptVariables[CURSOR_ID] = text.compactNum; - if (SkyLogic::_scriptVariables[MENU]) { + Logic::_scriptVariables[CURSOR_ID] = text.compactNum; + if (Logic::_scriptVariables[MENU]) { _mouseOfsY = TOP_LEFT_Y - 2; if (mouseX < 150) _mouseOfsX = TOP_LEFT_X + 24; else _mouseOfsX = TOP_LEFT_X - 8 - _lowTextWidth; @@ -347,14 +347,14 @@ void SkyText::fnPointerText(uint32 pointedId, uint16 mouseX, uint16 mouseY) { logicCursor(textCompact, mouseX, mouseY); } -void SkyText::logicCursor(Compact *textCompact, uint16 mouseX, uint16 mouseY) { +void Text::logicCursor(Compact *textCompact, uint16 mouseX, uint16 mouseY) { textCompact->xcood = (uint16)(mouseX + _mouseOfsX); textCompact->ycood = (uint16)(mouseY + _mouseOfsY); if (textCompact->ycood < TOP_LEFT_Y) textCompact->ycood = TOP_LEFT_Y; } -bool SkyText::getTBit() { +bool Text::getTBit() { if (_shiftBits) { (_shiftBits)--; @@ -366,12 +366,12 @@ bool SkyText::getTBit() { return (bool)(((_inputValue) >> (_shiftBits)) & 1); } -displayText_t SkyText::displayText(uint8 *dest, bool centre, uint16 pixelWidth, uint8 color) { +displayText_t Text::displayText(uint8 *dest, bool centre, uint16 pixelWidth, uint8 color) { //Render text in _textBuffer in buffer *dest return displayText(this->_textBuffer, dest, centre, pixelWidth, color); } -displayText_t SkyText::displayText(char *textPtr, uint8 *dest, bool centre, uint16 pixelWidth, uint8 color) { +displayText_t Text::displayText(char *textPtr, uint8 *dest, bool centre, uint16 pixelWidth, uint8 color) { //Render text pointed to by *textPtr in buffer *dest @@ -489,7 +489,7 @@ displayText_t SkyText::displayText(char *textPtr, uint8 *dest, bool centre, uint return ret; } -void SkyText::makeGameCharacter(uint8 textChar, uint8 *charSetPtr, uint8 *&dest, uint8 color) { +void Text::makeGameCharacter(uint8 textChar, uint8 *charSetPtr, uint8 *&dest, uint8 color) { bool maskBit, dataBit; uint8 charWidth = (uint8)((*(charSetPtr + textChar)) + 1 - _dtCharSpacing); @@ -533,7 +533,7 @@ void SkyText::makeGameCharacter(uint8 textChar, uint8 *charSetPtr, uint8 *&dest, } -lowTextManager_t SkyText::lowTextManager(uint32 textNum, uint16 width, uint16 logicNum, uint8 color, bool centre) { +lowTextManager_t Text::lowTextManager(uint32 textNum, uint16 width, uint16 logicNum, uint8 color, bool centre) { getText(textNum); @@ -561,7 +561,7 @@ lowTextManager_t SkyText::lowTextManager(uint32 textNum, uint16 width, uint16 lo cpt->logic = logicNum; cpt->status = ST_LOGIC | ST_FOREGROUND | ST_RECREATE; - cpt->screen = (uint16) SkyLogic::_scriptVariables[SCREEN]; + cpt->screen = (uint16) Logic::_scriptVariables[SCREEN]; struct lowTextManager_t ret; ret.textData = _dtData; @@ -570,7 +570,7 @@ lowTextManager_t SkyText::lowTextManager(uint32 textNum, uint16 width, uint16 lo return ret; } -void SkyText::changeTextSpriteColour(uint8 *sprData, uint8 newCol) { +void Text::changeTextSpriteColour(uint8 *sprData, uint8 newCol) { dataFileHeader *header = (dataFileHeader *)sprData; sprData += sizeof(dataFileHeader); @@ -578,7 +578,7 @@ void SkyText::changeTextSpriteColour(uint8 *sprData, uint8 newCol) { if (sprData[cnt] >= 241) sprData[cnt] = newCol; } -void SkyText::initHuffTree() { +void Text::initHuffTree() { switch (SkyEngine::_systemVars.gameVersion) { case 109: _huffTree = _huffTree_00109; @@ -612,7 +612,7 @@ void SkyText::initHuffTree() { } } -char SkyText::getTextChar() { +char Text::getTextChar() { int pos = 0; for (;;) { if (getTBit() == 0) @@ -625,7 +625,7 @@ char SkyText::getTextChar() { } } -bool SkyText::patchMessage(uint32 textNum) { +bool Text::patchMessage(uint32 textNum) { uint16 patchIdx = _patchLangIdx[SkyEngine::_systemVars.language]; uint16 patchNum = _patchLangNum[SkyEngine::_systemVars.language]; @@ -638,7 +638,7 @@ bool SkyText::patchMessage(uint32 textNum) { return false; } -const PatchMessage SkyText::_patchedMessages[NUM_PATCH_MSG] = { +const PatchMessage Text::_patchedMessages[NUM_PATCH_MSG] = { { 28724, "Testo e Parlato" }, // - italian { 28707, "Solo Testo" }, { 28693, "Solo Parlato" }, @@ -648,7 +648,7 @@ const PatchMessage SkyText::_patchedMessages[NUM_PATCH_MSG] = { { 28686, "Musikvolym" } }; -const uint16 SkyText::_patchLangIdx[8] = { +const uint16 Text::_patchLangIdx[8] = { 0xFFFF, // SKY_ENGLISH 0xFFFF, // SKY_GERMAN 0xFFFF, // SKY_FRENCH @@ -659,7 +659,7 @@ const uint16 SkyText::_patchLangIdx[8] = { 0xFFFF // SKY_SPANISH }; -const uint16 SkyText::_patchLangNum[8] = { +const uint16 Text::_patchLangNum[8] = { 0, // SKY_ENGLISH 0, // SKY_GERMAN 0, // SKY_FRENCH diff --git a/sky/text.h b/sky/text.h index 9c4566f120..ea6bbb725e 100644 --- a/sky/text.h +++ b/sky/text.h @@ -28,7 +28,7 @@ namespace Sky { struct Compact; -class SkyDisk; +class Disk; struct HuffTree { unsigned char lChild; @@ -43,10 +43,10 @@ struct PatchMessage { char text[100]; }; -class SkyText { +class Text { public: - SkyText(SkyDisk *skyDisk); - ~SkyText(void); + Text(Disk *skyDisk); + ~Text(void); void getText(uint32 textNr); struct displayText_t displayText(uint8 *dest, bool centre, uint16 pixelWidth, uint8 color); struct displayText_t displayText(char *textPtr, uint8 *dest, bool centre, uint16 pixelWidth, uint8 color); @@ -67,7 +67,7 @@ protected: void patchLINCCharset(); bool patchMessage(uint32 textNum); - SkyDisk *_skyDisk; + Disk *_skyDisk; uint8 _inputValue; uint8 _shiftBits; uint8 *_textItemPtr; |