/* JSRF Decompilation: JSRF/Core.hpp Game and GameObj classes that form the foundation of the JSRF game code. */ #pragma bss_seg(".data") #include "Core.hpp" // Declarations for symbols not yet defined in their own source files // Remove these once they've been delinked! void readInput(); // Address: 0x00011000 // Matching: no GameObj::~GameObj() { g_game->gameObjCnt -= 1; } // Address: 0x00011070 // Matching: no void GameObj::recursiveExecDefault() { } // Address: 0x000110A0 // Matching: no void GameObj::drawListDefault( GameObjFlags flagFilterAny1, int drawArg1, int drawArg2, GameObjFlags flagFilterAll, unsigned otherBitfieldFilterAny, GameObjFlags flagFilterNone, GameObjFlags flagFilterAny2 ) { } // Address: 0x00011220 // Matching: no void GameObj::drawTreeDefault1() { } // Address: 0x00011260 // Matching: no void GameObj::drawTreeDefault2() { } // Address: 0x000112A0 // Matching: no void GameObj::recursiveExecEvent() { } // Address: 0x000112D0 // Matching: no void GameObj::drawListEvent( GameObjFlags flagFilterAny1, int drawArg1, int drawArg2, GameObjFlags flagFilterAll, unsigned otherBitfieldFilterAny, GameObjFlags flagFilterNone, GameObjFlags flagFilterAny2 ) { } // Address: 0x00011450 // Matching: no void GameObj::drawTreeEvent1() { } // Address: 0x00011490 // Matching: no void GameObj::drawTreeEvent2() { } // Address: 0x000114D0 // Matching: no void GameObj::recursiveExecCoveredPause() { } // Address: 0x00011500 // Matching: no void GameObj::drawListCoveredPause( GameObjFlags flagFilterAny1, int drawArg1, int drawArg2, GameObjFlags flagFilterAll, unsigned otherBitfieldFilterAny, GameObjFlags flagFilterNone, GameObjFlags flagFilterAny2 ) { } // Address: 0x00011680 // Matching: no void GameObj::drawTreeCoveredPause1() { } // Address: 0x000116C0 // Matching: no void GameObj::drawTreeCoveredPause2() { } // Address: 0x00011700 // Matching: no void GameObj::recursiveExecFreezeCam() { } // Address: 0x00011730 // Matching: no void GameObj::drawListFreezeCam( GameObjFlags flagFilterAny1, int drawArg1, int drawArg2, GameObjFlags flagFilterAll, unsigned otherBitfieldFilterAny, GameObjFlags flagFilterNone, GameObjFlags flagFilterAny2 ) { } // Address: 0x000118B0 // Matching: no void GameObj::drawTreeFreezeCam1() { } // Address: 0x000118F0 // Matching: no void GameObj::drawTreeFreezeCam2() { } // Address: 0x00011930 // Matching: no void GameObj::recursiveExecUncoveredPause() { } // Address: 0x00011960 // Matching: no void GameObj::drawListUncoveredPause( GameObjFlags flagFilterAny1, int drawArg1, int drawArg2, GameObjFlags flagFilterAll, unsigned otherBitfieldFilterAny, GameObjFlags flagFilterNone, GameObjFlags flagFilterAny2 ) { } // Address: 0x00011AE0 // Matching: no void GameObj::drawTreeUncoveredPause1() { } // Address: 0x00011B20 // Matching: no void GameObj::drawTreeUncoveredPause2() { } // Address: 0x00011B60 // Matching: no void GameObj::addToSiblings(GameObj * sibling, GameObj * parent) { } // Address: 0x00011B90 // Matching: no void GameObj::destructChildren(GameObj * firstChild) { } // Address: 0x00011BD0 // Matching: yes GameObj * GameObj::getParent() { return this->parent; } // Address: 0x00011BE0 // Matching: no void GameObj::removeFromObjList(GameObj * obj) { if (obj->flags > -1) { } } // Address: 0x00011C20 // Matching: no void GameObj::removeChildrenFromObjList(GameObj * firstChild) { if (firstChild != NULL) do { if (firstChild->flags > -1) { firstChild->flags = GameObjFlags(firstChild->flags | GOF_DELETEAFTEREXEC); g_game->removeFromDrawList(firstChild); g_game->unsetObj(firstChild->index); } this->removeChildrenFromObjList(firstChild->firstChild); firstChild = firstChild->nextSibling; } while (firstChild != NULL); } // Address: 0x00011C80 // Matching: yes void GameObj::drawDefault(int unknown) {} // Address: 0x00011C90 // Matching: yes void GameObj::execDefault() {} // Eliminated by link time code generation (aliased with 0x00011C90) void GameObj::postExecDefault() {} // Eliminated by link time code generation (aliased with 0x00011C90) void GameObj::execEvent() {} // Eliminated by link time code generation (aliased with 0x00011C90) void GameObj::postExecEvent() {} // Eliminated by link time code generation (aliased with 0x00011C80) void GameObj::drawEvent(int unknown) {} // Eliminated by link time code generation (aliased with 0x00011C90) void GameObj::execCoveredPause() {} // Eliminated by link time code generation (aliased with 0x00011C90) void GameObj::postExecCoveredPause() {} // Eliminated by link time code generation (aliased with 0x00011C80) void GameObj::drawCoveredPause(int unknown) {} // Eliminated by link time code generation (aliased with 0x00011C90) void GameObj::execFreezeCam() {} // Eliminated by link time code generation (aliased with 0x00011C90) void GameObj::postExecFreezeCam() {} // Eliminated by link time code generation (aliased with 0x00011C80) void GameObj::drawFreezeCam(int unknown) {} // Eliminated by link time code generation (aliased with 0x00011C90) void GameObj::execUncoveredPause() {} // Eliminated by link time code generation (aliased with 0x00011C90) void GameObj::postExecUncoveredPause() {} // Eliminated by link time code generation (aliased with 0x00011C80) void GameObj::drawUncoveredPause(int unknown) {} // Address: 0x00011CA0 // Matching: no void DrawTree::copySomeVectors() { } // Address: 0x00011D00 // Matching: no void GameObj::recursivePostExecDefault() { } // Address: 0x00011D00 // Matching: no void GameObj::recursivePostExecEvent() { } // Address: 0x00011E40 // Matching: no void GameObj::recursivePostExecCoveredPause() { } // Address: 0x00011EE0 // Matching: no void GameObj::recursivePostExecFreezeCam() { } // Address: 0x00011F80 // Matching: no void GameObj::recursivePostExecUncoveredPause() { } // Address: 0x00012020 // Matching: no void GameObj::setParent(GameObj * parent) { } // Address: 0x00012100 // Matching: no GameObj::GameObj(GameObj * parent, GameObjIndex index, GameObjFlags flags) { g_game->setObj(index, this); this->parent = NULL; this->firstChild = NULL; this->prevSibling = NULL; this->nextSibling = NULL; this->index = index; this->flags = flags; this->setParent(parent); this->sortKey = 0; this->otherBitfield = 1; g_game->gameObjCnt += 1; } // Address: 0x00012170 // Matching: yes DrawTree::DrawTree(GameObj * parent, GameObjIndex index, GameObjFlags flags) : GameObj(parent, index, flags) { this->otherBitfield = 7; this->someIndex = 0; } // Address: 0x000121D0 // Matching: no DrawTree::~DrawTree() {} // Address: 0x000121E0 // Matching: no PlayerObj::PlayerObj(GameObj * parent, GameObjIndex index, GameObjFlags flags) : GameObj(parent, index, flags) { this->unknown0x44 = 0; this->unknown0x48 = 0; } // Eliminated by link time code generation (aliased with 0x000121D0) PlayerObj::~PlayerObj() {} // Address: 0x00012210 // Matching: no Game::Game(unsigned * unknown1, unsigned unknown2) { } // Address: 0x00012390 // Matching: no Game::~Game() { } // Address: 0x000123E0 // Matching: no void Game::exec() { } // Address: 0x00012580 // Matching: no void Game::drawObj(GameObj * obj, int unknown) { } // Address: 0x000125E0 // Matching: no void Game::drawList_( GameObjFlags flagFilterAny1, int drawArg1, int drawArg2, GameObjFlags flagFilterAll, unsigned otherBitfieldFilterAny, GameObjFlags flagFilterNone, GameObjFlags flagFilterAny2 ) { } // Address: 0x00012680 // Matching: no void Game::drawTree1(GameObj * obj) { } // Address: 0x000126D0 // Matching: no void Game::setCoveredPauseNextFrame(BOOL val) { } // Address: 0x000126F0 // Matching: no void Game::setEventNextFrame(BOOL val) { } // Address: 0x00012710 // Matching: no void Game::setFreezeCamNextFrame(BOOL val) { } // Address: 0x00012730 // Matching: no void Game::setUncoveredPauseNextFrame(BOOL val) { } // Address: 0x00012750 // Matching: yes void Game::enableDrawChildren() { this->drawChildren = TRUE; } // Address: 0x00012760 // Matching: yes void Game::enableSkipDraw() { this->skipDraw = TRUE; } // Address: 0x00012770 // Matching: no void Game::fatal() { } // Address: 0x000127B0 // Matching: yes void Game::setDrawMode(DrawMode mode) { this->drawMode = mode; } // Address: 0x000127C0 // Matching: yes void Game::setGlobal(GlobalIndex index, unsigned val) { this->globals[index] = val; } // Address: 0x000127E0 // Matching: yes unsigned Game::getGlobal(GlobalIndex index) { return this->globals[index]; } // Address: 0x000127F0 // Matching: no void Game::addToDrawList(GameObj * obj) { } // Address: 0x00012840 // Matching: no void Game::removeFromDrawList(GameObj * obj) { } // Address: 0x00012870 // Matching: yes void Game::setObj(GameObjIndex index, GameObj * obj) { if (0 <= index && index < OBJ_CNT) this->objects[index] = obj; } // Address: 0x00012890 // Matching: yes void Game::unsetObj(GameObjIndex index) { if (0 <= index && this->objects[index] != NULL) this->objects[index] = NULL; } // Address: 0x000128C0 // Matching: yes GameObj * Game::getObj(GameObjIndex index) { return 0 <= index ? this->objects[index] : NULL; } // Address: 0x000128E0 // Matching: yes int Game::allocObjIndex(GameObjIndex min, GameObjIndex max) { if (min <= max) do if (this->objects[min] == NULL) return min; else min = GameObjIndex(min + 1); while (min <= max); return -1; } // Address: 0x00012910 // Matching: yes BOOL Game::objIndexAvail(GameObjIndex index) { return this->objects[index] == NULL; } // Address: 0x00012930 // Matching: yes void Game::swapObjs(GameObjIndex index1, GameObjIndex index2) { GameObj * tmp = this->objects[index1]; this->objects[index1] = this->objects[index2]; this->objects[index2] = tmp; if (this->objects[index1] != NULL) this->objects[index1]->index = index1; if (this->objects[index2] != NULL) this->objects[index2]->index = index2; } // Address: 0x00012980 // Matching: no void Game::clearScreen() { } // Address: 0x000129B0 // Matching: yes void Game::enableSomeExtraDrawListCode() { this->runSomeExtraDrawListCode = TRUE; } // Address: 0x000129C0 // Matching: yes void Game::setLogosStarted(BOOL val) { this->logosStarted = val; } // Address: 0x000129D0 // Matching: yes void Game::clearDrawPriorityList() { this->drawPriorityListHead = NULL; this->drawPriorityListEndNext = &g_game->drawPriorityListHead; } // Address: 0x000129F0 // Matching: yes GameObj * Game::getDrawPriorityListHead() { return this->drawPriorityListHead; } // Address: 0x00012A00 // Matching: yes void Game::appendToDrawPriorityList(GameObj * obj) { obj->drawPriorityListNext = NULL; *this->drawPriorityListEndNext = obj; this->drawPriorityListEndNext = &obj->drawPriorityListNext; } // Address: 0x00012A20 // Matching: no void Game::sortDrawPriorityListSingleLevel(char sortKeyBitOffset) { for ( unsigned i = 0; i < sizeof this->drawPriorityListsByKeyHeads/sizeof *this->drawPriorityListsByKeyHeads; i++ ) this->drawPriorityListsByKeyHeads[i] = NULL; } // Address: 0x00012AC0 // Matching: yes void Game::setFallbackBgColour(D3DCOLOR colour, BOOL useFallback) { this->useFallbackBgColour = useFallback; this->bgColourFallback = colour; } // Address: 0x00012AE0 // Matching: no RootExecObj::RootExecObj(GameObj * parent, GameObjIndex index, GameObjFlags flags) : GameObj(parent, index, flags) { } // Address: 0x00012BE0 // Matching: no RootExecObj::~RootExecObj() { } // Address: 0x00012C10 // Matching: no void Game::initRootExecObj() { } // Address: 0x00012C80 // Matching: no void Game::drawList(GameObjFlags flagFilterAll, BOOL unknown) { } // Address: 0x000131A0 // Matching: no void Game::sortDrawPriorityList() { this->sortDrawPriorityListSingleLevel(0x00); this->sortDrawPriorityListSingleLevel(0x08); this->sortDrawPriorityListSingleLevel(0x10); this->sortDrawPriorityListSingleLevel(0x18); } // Address: 0x000131F0 // Matching: no void Game::drawObjs() { } // Address: 0x00013930 // Matching: no void Game::draw() { } // Address: 0x00013A80 // Matching: no void Game::frame() { readInput(); } // Address: 0x00013F80 // Matching: yes int Game::mainLoop() { if (this->initState >= 0) while (true) { if (!this->fatalErr) this->frame(); else { readInput(); Sleep(0x10); } } else return -1; } // Address: 0x00013FC0 // Matching: no void removeFromObjListByIndex(GameObjIndex index) { GameObj * obj = g_game->getObj(index); if (obj != NULL) { obj->removeFromObjList(obj); obj->removeChildrenFromObjList(obj->firstChild); } }