Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct checkData
- {
- bool isActive; //0
- short eventFlagMask; //2
- char stage[8]; //4
- char room; //12
- char startCode; //13
- };
- struct stag_info
- {
- /*0x00*/ float depthMin;
- /*0x04*/ float depthMax;
- /*0x09*/ char stageGroupID; //Determines if the stage is a dungeon, and if so, which one. 0x7 is Dragon Roost Cavern, 0x9 is the Forbidden Woods, 0xB is the Tower of the Gods, 0xD is the Earth Temple, and 0xF is the Wind Temple. The only differences that could be seen between them is that these IDs display the key counter in the UI and write the correct names into the space on the dungeon map screen.
- /*0x0A*/ short loadedParticleBank; //particle bank to load for the stage. Method of IDing a certain particle bank is currently unknown.
- /*0x0C*/ int someFlags;
- /*0x10*/ byte unknown2; //RGB data? I don't know for what though, nothing changed when I changed this. These three unknowns are usually set to 00 00 FF. That can be the default value to use for file creation, since it works
- /*0x11*/ byte unknown3;
- /*0x12*/ short drawRange;
- };
- struct scls_info
- {
- /*0x0*/ char stage[8]; //Name of destination worldspace
- /*0x8*/ byte startCode; //Spawn index to use to enter the destination map
- /*0x9*/ byte room; //Number of destination room
- /*0xA*/ byte wipe; //The old doc says this is "exitType," but I messed with it and found no changes?
- /*0xB*/ byte padding;
- };
- struct map_info
- {
- /*0x00*/ float fullMapImageScaleX;
- /*0x04*/ float fullMapImageScaleY;
- /*0x08*/ float fullMapSpaceScaleX;
- /*0x0C*/ float fullMapSpaceScaleY;
- /*0x10*/ float fullMapXCoord;
- /*0x14*/ float fullMapYCoord;
- /*0x18*/ float zoomedMapXScrolling1; //Something with scrolling, but that's also defined below?
- /*0x1C*/ float zoomedMapYScrolling1; //Does something like scrolling on y-axis
- /*0x20*/ float zoomedMapXScrolling2;
- /*0x24*/ float zoomedMapYScrolling2;
- /*0x28*/ float zoomedMapXCoord;
- /*0x2C*/ float zoomedMapYCoord;
- /*0x30*/ float zoomedMapScale; //That's what it appeared to affect, anyway
- /*0x34*/ byte unknown1; //Always 0x80?
- /*0x35*/ byte mapIndex; //number of the map image to use. For instance, using the first image would be 80, the second 81, and so on.
- /*0x36*/ byte quadrantCoordinates; //2 signed nybbles, ZX
- /*0x37*/ byte padding;
- };
- checkData l_checkData[6] =
- {
- checkData(true, 0x2A08, "", 0, 0), //Late Game
- checkData(true, 0x0F80, "sea", 0xB, 0x80), //Windfall
- checkData(true, 0x0801, "MajyuE", 0, 0), //Forsaken Fortress 1
- checkData(true, 0x0808, "MajyuE", 0, 0x12), //Forsaken Fortress 1 on Pirate Ship?
- checkData(true, 0x2401, "A_umikz", 0, 0xCC), //On the Ocean with the Pirates
- checkData(false, 0x0000, "sea", 0x2C, 0x80) //Outset
- }
- void dComIfGs_setGameStartStage_Fv()
- {
- int room;
- char startCode;
- char stage[8];
- float coordinates[3];
- map_info* mapInfo;
- stag_info* stagInfo;
- scls_info* sclsInfo;
- char stageGroupID;
- char stageType;
- checkData* l_checkDataIterator = &l_checkData;
- for (int i = 0; i < 5; ++i)
- {
- if (l_checkDataIterator->isActive == 1 && isEventBit(&g_dComIfG_gameInfo->eventFlags, l_checkDataIterator->eventFlagMask))
- break;
- l_checkDataIterator++;
- }
- if (strcmp(&l_checkDataIterator->stage, "") != 0)
- {
- strcpy(stage, &l_checkDataIterator->stage);
- room = l_checkDataIterator->room;
- startCode = l_checkDataIterator->startCode;
- }
- else
- {
- getStagInfo = g_dComIfG_gameInfo->stageData->getStagInfo;
- stagInfo = getStagInfo(&g_dComIfG_gameInfo->stageData);
- stageType = (stagInfo->someFlags >> 16) & 0x7;
- stageGroupID = (stagInfo->stageGroupID >> 1) & 0x7F;
- if (strcmp(&g_dComIfG_gameInfo->currentStage, "PShip") == 0)
- {
- strcpy(stage, "sea");
- room = (int)getEventReg_11dSv_event(&g_dComIfG_gameInfo->eventFlags, 0xC3FF);
- startCode = getEventReg_11dSv_event(&g_dComIfG_gameInfo->eventFlags, 0x85FF);
- dKy_set_nexttime(*(r2 - 0x79D0));
- }
- else if (stageType == 0x7)
- {
- r29 = g_dComIfG_gameInfo->address0x5B40;
- startCode = r29->address0x3594 & 0xFF;
- room = r29->address0x20A;
- if (room >= 0 && startCode != 0xFF && dComIfGs_checkSeaLandingEvent(room))
- {
- //On the ocean, no calculation needed?
- strcpy(stage, &g_dComIfG_gameInfo->currentStage);
- }
- else
- {
- //On the ocean, calculate spawn by geometry?
- r3 = g_dComIfG_gameInfo->address0x5B48; //803BDC50
- if (r3 != 0)
- {
- sclsInfo = dComIfGs_getMeshSceneList(r3 + 504);
- }
- else
- {
- sclsInfo = dComIfGs_getMeshSceneList(r29 + 504);
- }
- strcpy(stage, &sclsInfo->stage);
- room = (int)sclsInfo->room;
- startCode = sclsInfo->startCode;
- }
- }
- else if (stageType == 1 /*Normal Dungeon Room*/ || stageType == 6 /*Miniboss*/ || stageType == 3 /*Boss*/ || stageType == 8 || stageGroupID == 9)
- {
- //Dungeons
- sclsInfo = getSceneList(0);
- strcpy(stage, &sclsInfo->stage);
- room = (int)sclsInfo->room;
- startCode = sclsInfo->startCode;
- }
- else if (stageGroupID == 10)
- {
- //Beedle and Submarine
- float* oceanCoordinates = &g_dComIfG_gameInfo->oceanCoordinates;
- coordinates[0] = oceanCoordinates[0];
- coordinates[1] = oceanCoordinates[1];
- coordinates[2] = oceanCoordinates[2];
- sclsInfo = dComIfGd_getMeshSceneList(coordinates);
- strcpy(stage, &sclsInfo->stage);
- room = (int)sclsInfo->room;
- startCode = sclsInfo->startCode;
- }
- else if (stageGroupID >= 11 || stageGroupID == 13)
- {
- //Everything with a map
- strcpy(stage, "sea");
- getMapInfo = g_dComIfG_gameInfo->stageData->getMapInfo;
- mapInfo = getMapInfo(&g_dComIfG_gameInfo->stageData);
- assert(mapInfo != 0);
- room = (int)(7 * (dStage_mapInfo_GetOceanZ(mapInfo) + 3) + dStage_mapInfo_GetOceanX(mapInfo) + 4);
- startCode = 0;
- }
- else
- {
- //Default to Windfall
- strcpy(stage, "sea");
- room = 11;
- startCode = 0;
- }
- }
- set_25dSv_player_return_place(&g_dComIfG_gameInfo->saveStage, stage, room, startCode);
- }
Advertisement
Add Comment
Please, Sign In to add comment