The decompiled C++ tree moves to generated-src/ (classes.h, C++20); src/ is for code written by hand. A curated function defines the generated declaration and starts its comment with its address, and source_tree.py stops emitting that body. src/rng.cpp takes over RNG (SetSeed, the constructor, Next, RandomInt, RandomFloat, Shuffle) with the shift table read from the exe as a constexpr array; src/log.h names KAGE_LogMessage's levels (1 INFO, 2 NET, 4 WARN, 8 ERROR, 16 ASSERT, from its prefix jump table). CMakeLists.txt builds src/*.cpp against generated-src/classes.h (clean with -Wall -Wextra). structs.hpp and headers.py are retired: scripts/merge_fields.py writes the merged field list, classes.h checks the layout. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
583 lines
25 KiB
C++
583 lines
25 KiB
C++
#include "classes.h"
|
|
|
|
// 00436010
|
|
byte RoomDescriptor::Clear()
|
|
{
|
|
return (byte)this->Flags & 1;
|
|
}
|
|
|
|
// 00456560
|
|
uint RoomDescriptor::PressurePlatesTriggered()
|
|
{
|
|
return CONCAT31((uint3)(GHIDRA_UINT(this->Flags) >> 9),(char)(GHIDRA_UINT(this->Flags) >> 1)) & 0xffffff01;
|
|
}
|
|
|
|
// 00505c30
|
|
uint RoomDescriptor::HasWater()
|
|
{
|
|
return CONCAT31((uint3)(GHIDRA_UINT(this->Flags) >> 0xd),(char)(GHIDRA_UINT(this->Flags) >> 5)) & 0xffffff01;
|
|
}
|
|
|
|
// 005cd640
|
|
uint RoomDescriptor::SacrificeDone()
|
|
{
|
|
return CONCAT31((uint3)(GHIDRA_UINT(this->Flags) >> 10),(char)(GHIDRA_UINT(this->Flags) >> 2)) & 0xffffff01;
|
|
}
|
|
|
|
// 006ef590
|
|
RoomConfig_Room * RoomDescriptor::constructor()
|
|
{
|
|
void *pvVar1;
|
|
void *pvVar2;
|
|
undefined4 *gridSave;
|
|
int gridSavesLeft;
|
|
uint gridSaveOffset;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
undefined4 local_8;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00afb307;
|
|
local_10 = ExceptionList;
|
|
ExceptionList = &local_10;
|
|
this->GridIndex = -1;
|
|
this->SafeGridIndex = -1;
|
|
this->ListIndex = -1;
|
|
this->Dimension = 0;
|
|
this->Data = (void *)0x0;
|
|
this->OverrideData = (void *)0x0;
|
|
this->AllowedDoors = 0;
|
|
this->DisplayFlags = 0;
|
|
this->VisitedCount = 0;
|
|
this->Flags = 0;
|
|
this->TotalMoneySpent = 0;
|
|
this->ClearCount = 0;
|
|
this->GreedSubType = 0;
|
|
this->PoopCount = 0;
|
|
this->TKeeperCoinSpawns = 0;
|
|
this->PitsCount = 0;
|
|
this->DecorationSeed = 0;
|
|
this->SpawnSeed = 0;
|
|
this->AwardSeed = 0;
|
|
this->BossDeathSeed = 0;
|
|
(this->SavedGridEntities)._begin = (void *)0x0;
|
|
(this->SavedGridEntities)._end = (void *)0x0;
|
|
(this->SavedGridEntities)._capacity = (void *)0x0;
|
|
pvVar1 = operator_new(0x3823);
|
|
if (pvVar1 == (void *)0x0) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
pvVar2 = (void *)(GHIDRA_INT(pvVar1) + 0x23U & 0xffffffe0);
|
|
*(void **)(GHIDRA_INT(pvVar2) - 4) = pvVar1;
|
|
gridSavesLeft = 0x1c0;
|
|
(this->SavedGridEntities)._begin = pvVar2;
|
|
(this->SavedGridEntities)._capacity = (void *)(GHIDRA_INT(pvVar2) + 0x3800);
|
|
gridSave = (this->SavedGridEntities)._begin;
|
|
do {
|
|
*gridSave = 0;
|
|
gridSave[1] = 0;
|
|
gridSave[2] = 0;
|
|
gridSave[3] = 0;
|
|
gridSave[4] = 0x16a9de81;
|
|
gridSave[5] = 0;
|
|
*GHIDRA_CAST<undefined1 *>((gridSave + 6)) = 0;
|
|
gridSave[7] = 0x16a9de81;
|
|
gridSave = gridSave + 8;
|
|
gridSavesLeft = gridSavesLeft + -1;
|
|
} while (gridSavesLeft != 0);
|
|
(this->SavedGridEntities)._end = gridSave;
|
|
(this->SavedEntities)._begin = (void *)0x0;
|
|
(this->SavedEntities)._end = (void *)0x0;
|
|
(this->SavedEntities)._capacity = (void *)0x0;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))) = 0;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 1;
|
|
(this->RestrictedGridIndexes)._head = (void *)0x0;
|
|
(this->RestrictedGridIndexes)._size = 0;
|
|
pvVar1 = operator_new(0x14);
|
|
*(void **)pvVar1 = pvVar1;
|
|
*(void **)(GHIDRA_CAST<char *>(pvVar1) + 4) = pvVar1;
|
|
*(void **)(GHIDRA_CAST<char *>(pvVar1) + 8) = pvVar1;
|
|
*GHIDRA_CAST<undefined2 *>((GHIDRA_CAST<char *>(pvVar1) + 0xc)) = 0x101;
|
|
(this->RestrictedGridIndexes)._head = pvVar1;
|
|
(this->SavedEffects)._begin = (void *)0x0;
|
|
(this->SavedEffects)._end = (void *)0x0;
|
|
(this->SavedEffects)._capacity = (void *)0x0;
|
|
local_8 = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),3);
|
|
this->ShopItemIdx = -1;
|
|
this->ShopItemDiscountIdx = -1;
|
|
this->DeliriumDistance = 0;
|
|
this->Group = -1;
|
|
pvVar1 = (this->SavedEntities)._end;
|
|
pvVar2 = (this->SavedEntities)._begin;
|
|
if (pvVar2 != pvVar1) {
|
|
do {
|
|
invoke_pending_callbacks(pvVar2);
|
|
pvVar2 = (void *)(GHIDRA_INT(pvVar2) + 0x78);
|
|
} while (pvVar2 != pvVar1);
|
|
pvVar2 = (this->SavedEntities)._begin;
|
|
}
|
|
(this->SavedEntities)._end = pvVar2;
|
|
if (GHIDRA_UINT(((GHIDRA_INT((this->SavedEntities)._capacity) - GHIDRA_INT((this->SavedEntities)._begin)) / 0x78)) <
|
|
0x10) {
|
|
std::vector<EntitySaveState>::_Reallocate_exactly(0x10);
|
|
}
|
|
pvVar1 = (this->SavedEffects)._end;
|
|
pvVar2 = (this->SavedEffects)._begin;
|
|
if (pvVar2 != pvVar1) {
|
|
do {
|
|
invoke_pending_callbacks(pvVar2);
|
|
pvVar2 = (void *)(GHIDRA_INT(pvVar2) + 0x78);
|
|
} while (pvVar2 != pvVar1);
|
|
pvVar2 = (this->SavedEffects)._begin;
|
|
}
|
|
(this->SavedEffects)._end = pvVar2;
|
|
if (GHIDRA_UINT(((GHIDRA_INT((this->SavedEffects)._capacity) - GHIDRA_INT((this->SavedEffects)._begin)) / 0x78)) < 0x20
|
|
) {
|
|
std::vector<EntitySaveState>::_Reallocate_exactly(0x20);
|
|
}
|
|
pvVar1 = (this->RestrictedGridIndexes)._head;
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<std::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(&this->RestrictedGridIndexes,
|
|
(fuzzer_allocator<std::_Tree_node<unsigned_int,void*>_> *)&this->RestrictedGridIndexes,
|
|
*(_Tree_node<unsigned_int,void*> **)(GHIDRA_INT(pvVar1) + 4));
|
|
*(void **)(GHIDRA_CAST<char *>(pvVar1) + 4) = pvVar1;
|
|
gridSaveOffset = 0;
|
|
*(void **)pvVar1 = pvVar1;
|
|
*(void **)(GHIDRA_CAST<char *>(pvVar1) + 8) = pvVar1;
|
|
(this->RestrictedGridIndexes)._size = 0;
|
|
this->_doors[0] = -1;
|
|
this->_doors[1] = -1;
|
|
this->_doors[2] = -1;
|
|
this->_doors[3] = -1;
|
|
this->_doors[4] = -1;
|
|
this->_doors[5] = -1;
|
|
this->_doors[6] = -1;
|
|
this->_doors[7] = -1;
|
|
do {
|
|
*GHIDRA_CAST<undefined4 *>((gridSaveOffset + GHIDRA_INT((this->SavedGridEntities)._begin))) = 0;
|
|
gridSaveOffset = gridSaveOffset + 0x20;
|
|
} while (gridSaveOffset < 0x3800);
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x94)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x98)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x9c)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0xa0)))) = 0;
|
|
ExceptionList = local_10;
|
|
return GHIDRA_CAST<RoomConfig_Room *>(this);
|
|
}
|
|
|
|
// 006ef9c0
|
|
void RoomDescriptor::destructor()
|
|
{
|
|
std_set *restrictedGridIndexes;
|
|
|
|
std::vector<RoomEntry>::_Tidy();
|
|
restrictedGridIndexes = &this->RestrictedGridIndexes;
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<std::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(restrictedGridIndexes,(fuzzer_allocator<std::_Tree_node<unsigned_int,void*>_> *)restrictedGridIndexes,
|
|
*(_Tree_node<unsigned_int,void*> **)(GHIDRA_INT((this->RestrictedGridIndexes)._head) + 4));
|
|
operator_delete(restrictedGridIndexes->_head,0x14);
|
|
std::vector<RoomEntry>::_Tidy();
|
|
FUN_00708f90();
|
|
return;
|
|
}
|
|
|
|
// 0070c550
|
|
uint RoomDescriptor::ChallengeDone()
|
|
{
|
|
return CONCAT31((uint3)(GHIDRA_UINT(this->Flags) >> 0xb),(char)(GHIDRA_UINT(this->Flags) >> 3)) & 0xffffff01;
|
|
}
|
|
|
|
// 00738180
|
|
uint RoomDescriptor::SurpriseMiniboss()
|
|
{
|
|
return CONCAT31((uint3)(GHIDRA_UINT(this->Flags) >> 0xc),(char)(GHIDRA_UINT(this->Flags) >> 4)) & 0xffffff01;
|
|
}
|
|
|
|
// 007387d0
|
|
RoomDescriptor * RoomDescriptor::operator_assign(RoomDescriptor *other)
|
|
{
|
|
std_set *restrictedIndexes;
|
|
void *pvVar1;
|
|
std_vector *otherVector;
|
|
uint setSize;
|
|
|
|
otherVector = &other->SavedGridEntities;
|
|
this->GridIndex = other->GridIndex;
|
|
this->SafeGridIndex = other->SafeGridIndex;
|
|
this->ListIndex = other->ListIndex;
|
|
this->Dimension = other->Dimension;
|
|
this->Data = other->Data;
|
|
this->OverrideData = other->OverrideData;
|
|
this->AllowedDoors = other->AllowedDoors;
|
|
this->_doors[0] = other->_doors[0];
|
|
this->_doors[1] = other->_doors[1];
|
|
this->_doors[2] = other->_doors[2];
|
|
this->_doors[3] = other->_doors[3];
|
|
this->_doors[4] = other->_doors[4];
|
|
this->_doors[5] = other->_doors[5];
|
|
this->_doors[6] = other->_doors[6];
|
|
this->_doors[7] = other->_doors[7];
|
|
this->DisplayFlags = other->DisplayFlags;
|
|
this->VisitedCount = other->VisitedCount;
|
|
this->Flags = other->Flags;
|
|
this->TotalMoneySpent = other->TotalMoneySpent;
|
|
this->ClearCount = other->ClearCount;
|
|
this->GreedSubType = other->GreedSubType;
|
|
this->PoopCount = other->PoopCount;
|
|
this->TKeeperCoinSpawns = other->TKeeperCoinSpawns;
|
|
this->PitsCount = other->PitsCount;
|
|
this->DecorationSeed = other->DecorationSeed;
|
|
this->SpawnSeed = other->SpawnSeed;
|
|
this->AwardSeed = other->AwardSeed;
|
|
this->BossDeathSeed = other->BossDeathSeed;
|
|
if (&this->SavedGridEntities != otherVector) {
|
|
FUN_00708f90();
|
|
(this->SavedGridEntities)._begin = otherVector->_begin;
|
|
(this->SavedGridEntities)._end = (other->SavedGridEntities)._end;
|
|
(this->SavedGridEntities)._capacity = (other->SavedGridEntities)._capacity;
|
|
otherVector->_begin = (void *)0x0;
|
|
(other->SavedGridEntities)._end = (void *)0x0;
|
|
(other->SavedGridEntities)._capacity = (void *)0x0;
|
|
}
|
|
otherVector = &other->SavedEntities;
|
|
if (&this->SavedEntities != otherVector) {
|
|
std::vector<RoomEntry>::_Tidy();
|
|
(this->SavedEntities)._begin = otherVector->_begin;
|
|
(this->SavedEntities)._end = (other->SavedEntities)._end;
|
|
(this->SavedEntities)._capacity = (other->SavedEntities)._capacity;
|
|
otherVector->_begin = (void *)0x0;
|
|
(other->SavedEntities)._end = (void *)0x0;
|
|
(other->SavedEntities)._capacity = (void *)0x0;
|
|
}
|
|
restrictedIndexes = &this->RestrictedGridIndexes;
|
|
if (restrictedIndexes != &other->RestrictedGridIndexes) {
|
|
pvVar1 = restrictedIndexes->_head;
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<std::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(restrictedIndexes,(fuzzer_allocator<std::_Tree_node<unsigned_int,void*>_> *)restrictedIndexes,
|
|
*(_Tree_node<unsigned_int,void*> **)(GHIDRA_INT(pvVar1) + 4));
|
|
*(void **)(GHIDRA_CAST<char *>(pvVar1) + 4) = pvVar1;
|
|
*(void **)pvVar1 = pvVar1;
|
|
*(void **)(GHIDRA_CAST<char *>(pvVar1) + 8) = pvVar1;
|
|
(this->RestrictedGridIndexes)._size = 0;
|
|
pvVar1 = (this->RestrictedGridIndexes)._head;
|
|
(this->RestrictedGridIndexes)._head = (other->RestrictedGridIndexes)._head;
|
|
(other->RestrictedGridIndexes)._head = pvVar1;
|
|
setSize = (this->RestrictedGridIndexes)._size;
|
|
(this->RestrictedGridIndexes)._size = (other->RestrictedGridIndexes)._size;
|
|
(other->RestrictedGridIndexes)._size = setSize;
|
|
}
|
|
otherVector = &other->SavedEffects;
|
|
if (&this->SavedEffects != otherVector) {
|
|
std::vector<RoomEntry>::_Tidy();
|
|
(this->SavedEffects)._begin = otherVector->_begin;
|
|
(this->SavedEffects)._end = (other->SavedEffects)._end;
|
|
(this->SavedEffects)._capacity = (other->SavedEffects)._capacity;
|
|
otherVector->_begin = (void *)0x0;
|
|
(other->SavedEffects)._end = (void *)0x0;
|
|
(other->SavedEffects)._capacity = (void *)0x0;
|
|
}
|
|
*GHIDRA_CAST<undefined2 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x94)))) = *GHIDRA_CAST<undefined2 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((other)) + 0x94))));
|
|
*GHIDRA_CAST<undefined2 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x96)))) = *GHIDRA_CAST<undefined2 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((other)) + 0x96))));
|
|
*GHIDRA_CAST<undefined2 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x98)))) = *GHIDRA_CAST<undefined2 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((other)) + 0x98))));
|
|
*GHIDRA_CAST<undefined2 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x9a)))) = *GHIDRA_CAST<undefined2 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((other)) + 0x9a))));
|
|
*GHIDRA_CAST<undefined2 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x9c)))) = *GHIDRA_CAST<undefined2 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((other)) + 0x9c))));
|
|
*GHIDRA_CAST<undefined2 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x9e)))) = *GHIDRA_CAST<undefined2 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((other)) + 0x9e))));
|
|
*GHIDRA_CAST<undefined2 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0xa0)))) = *GHIDRA_CAST<undefined2 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((other)) + 0xa0))));
|
|
*GHIDRA_CAST<undefined2 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0xa2)))) = *GHIDRA_CAST<undefined2 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((other)) + 0xa2))));
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0xa4))) = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((other)) + 0xa4)));
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0xa5))) = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((other)) + 0xa5)));
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0xa6))) = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((other)) + 0xa6)));
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0xa7))) = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((other)) + 0xa7)));
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0xa8))) = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((other)) + 0xa8)));
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0xa9))) = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((other)) + 0xa9)));
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0xaa))) = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((other)) + 0xaa)));
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0xab))) = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((other)) + 0xab)));
|
|
this->ShopItemIdx = other->ShopItemIdx;
|
|
this->ShopItemDiscountIdx = other->ShopItemDiscountIdx;
|
|
this->DeliriumDistance = other->DeliriumDistance;
|
|
this->Group = other->Group;
|
|
return this;
|
|
}
|
|
|
|
// 00749040
|
|
RoomDescriptor * RoomDescriptor::copy_constructor(RoomDescriptor *other)
|
|
{
|
|
undefined4 *puVar1;
|
|
undefined4 uVar2;
|
|
int iVar3;
|
|
int iVar4;
|
|
int iVar5;
|
|
undefined4 uVar6;
|
|
undefined4 uVar7;
|
|
uint uVar8;
|
|
uint byteCount;
|
|
void *pvVar9;
|
|
undefined4 *dstGridEntity;
|
|
undefined4 *srcGridEntity;
|
|
void *local_1c;
|
|
undefined1 *puStack_18;
|
|
undefined4 local_14;
|
|
std_set *restrictedGridIndexes;
|
|
undefined4 *srcGridEnd;
|
|
|
|
local_14 = 0xffffffff;
|
|
puStack_18 = &LAB_00afdfc1;
|
|
local_1c = ExceptionList;
|
|
uVar8 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 0x10U;
|
|
ExceptionList = &local_1c;
|
|
this->GridIndex = other->GridIndex;
|
|
this->SafeGridIndex = other->SafeGridIndex;
|
|
this->ListIndex = other->ListIndex;
|
|
this->Dimension = other->Dimension;
|
|
this->Data = other->Data;
|
|
this->OverrideData = other->OverrideData;
|
|
this->AllowedDoors = other->AllowedDoors;
|
|
iVar3 = other->_doors[1];
|
|
iVar4 = other->_doors[2];
|
|
iVar5 = other->_doors[3];
|
|
this->_doors[0] = other->_doors[0];
|
|
this->_doors[1] = iVar3;
|
|
this->_doors[2] = iVar4;
|
|
this->_doors[3] = iVar5;
|
|
iVar3 = other->_doors[5];
|
|
iVar4 = other->_doors[6];
|
|
iVar5 = other->_doors[7];
|
|
this->_doors[4] = other->_doors[4];
|
|
this->_doors[5] = iVar3;
|
|
this->_doors[6] = iVar4;
|
|
this->_doors[7] = iVar5;
|
|
this->DisplayFlags = other->DisplayFlags;
|
|
this->VisitedCount = other->VisitedCount;
|
|
this->Flags = other->Flags;
|
|
this->TotalMoneySpent = other->TotalMoneySpent;
|
|
this->ClearCount = other->ClearCount;
|
|
this->GreedSubType = other->GreedSubType;
|
|
this->PoopCount = other->PoopCount;
|
|
this->TKeeperCoinSpawns = other->TKeeperCoinSpawns;
|
|
this->PitsCount = other->PitsCount;
|
|
this->DecorationSeed = other->DecorationSeed;
|
|
this->SpawnSeed = other->SpawnSeed;
|
|
this->AwardSeed = other->AwardSeed;
|
|
this->BossDeathSeed = other->BossDeathSeed;
|
|
(this->SavedGridEntities)._begin = (void *)0x0;
|
|
(this->SavedGridEntities)._end = (void *)0x0;
|
|
(this->SavedGridEntities)._capacity = (void *)0x0;
|
|
srcGridEnd = (other->SavedGridEntities)._end;
|
|
srcGridEntity = (other->SavedGridEntities)._begin;
|
|
if (srcGridEntity != srcGridEnd) {
|
|
byteCount = GHIDRA_INT(srcGridEnd) - GHIDRA_INT(srcGridEntity) >> 5;
|
|
if (0x7ffffff < byteCount) {
|
|
/* WARNING: Subroutine does not return */
|
|
FUN_0040cee0(uVar8);
|
|
}
|
|
byteCount = byteCount * 0x20;
|
|
pvVar9 = std::_Allocate(byteCount);
|
|
(this->SavedGridEntities)._begin = pvVar9;
|
|
(this->SavedGridEntities)._end = pvVar9;
|
|
(this->SavedGridEntities)._capacity = (void *)(GHIDRA_INT(pvVar9) + byteCount);
|
|
dstGridEntity = (this->SavedGridEntities)._begin;
|
|
do {
|
|
uVar2 = srcGridEntity[1];
|
|
uVar6 = srcGridEntity[2];
|
|
uVar7 = srcGridEntity[3];
|
|
*dstGridEntity = *srcGridEntity;
|
|
dstGridEntity[1] = uVar2;
|
|
dstGridEntity[2] = uVar6;
|
|
dstGridEntity[3] = uVar7;
|
|
puVar1 = srcGridEntity + 4;
|
|
uVar2 = srcGridEntity[5];
|
|
uVar6 = srcGridEntity[6];
|
|
uVar7 = srcGridEntity[7];
|
|
srcGridEntity = srcGridEntity + 8;
|
|
dstGridEntity[4] = *puVar1;
|
|
dstGridEntity[5] = uVar2;
|
|
dstGridEntity[6] = uVar6;
|
|
dstGridEntity[7] = uVar7;
|
|
dstGridEntity = dstGridEntity + 8;
|
|
} while (srcGridEntity != srcGridEnd);
|
|
(this->SavedGridEntities)._end = dstGridEntity;
|
|
}
|
|
local_14 = 0;
|
|
FUN_00752830(&other->SavedEntities);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 1;
|
|
restrictedGridIndexes = &this->RestrictedGridIndexes;
|
|
restrictedGridIndexes->_head = (void *)0x0;
|
|
(this->RestrictedGridIndexes)._size = 0;
|
|
pvVar9 = operator_new(0x14);
|
|
*(void **)pvVar9 = pvVar9;
|
|
*(void **)(GHIDRA_CAST<char *>(pvVar9) + 4) = pvVar9;
|
|
*(void **)(GHIDRA_CAST<char *>(pvVar9) + 8) = pvVar9;
|
|
*GHIDRA_CAST<undefined2 *>((GHIDRA_CAST<char *>(pvVar9) + 0xc)) = 0x101;
|
|
restrictedGridIndexes->_head = pvVar9;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 2;
|
|
std_set_uint_copy(restrictedGridIndexes,&other->RestrictedGridIndexes,GHIDRA_INT(this));
|
|
local_14 = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),3);
|
|
FUN_00752830(&other->SavedEffects);
|
|
uVar2 = *GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((other)) + 0x98))));
|
|
uVar6 = *GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((other)) + 0x9c))));
|
|
uVar7 = *GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((other)) + 0xa0))));
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x94)))) = *GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((other)) + 0x94))));
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x98)))) = uVar2;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x9c)))) = uVar6;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0xa0)))) = uVar7;
|
|
uVar2 = *GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((other)) + 0xa8))));
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0xa4)))) = *GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((other)) + 0xa4))));
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0xa8)))) = uVar2;
|
|
this->ShopItemIdx = other->ShopItemIdx;
|
|
this->ShopItemDiscountIdx = other->ShopItemDiscountIdx;
|
|
this->DeliriumDistance = other->DeliriumDistance;
|
|
this->Group = other->Group;
|
|
ExceptionList = local_1c;
|
|
return this;
|
|
}
|
|
|
|
// 00752e80
|
|
RoomDescriptor * RoomDescriptor::move_constructor(RoomDescriptor *other)
|
|
{
|
|
void *pvVar1;
|
|
void *pvVar2;
|
|
undefined4 swappedListSize;
|
|
int iVar4;
|
|
int iVar5;
|
|
int iVar6;
|
|
undefined4 uVar7;
|
|
undefined4 uVar8;
|
|
void *pvVar9;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
undefined4 local_8;
|
|
uint swappedListSize;
|
|
|
|
puStack_c = &LAB_00afe73b;
|
|
local_10 = ExceptionList;
|
|
ExceptionList = &local_10;
|
|
this->GridIndex = other->GridIndex;
|
|
this->SafeGridIndex = other->SafeGridIndex;
|
|
this->ListIndex = other->ListIndex;
|
|
this->Dimension = other->Dimension;
|
|
this->Data = other->Data;
|
|
this->OverrideData = other->OverrideData;
|
|
this->AllowedDoors = other->AllowedDoors;
|
|
iVar4 = other->_doors[1];
|
|
iVar5 = other->_doors[2];
|
|
iVar6 = other->_doors[3];
|
|
this->_doors[0] = other->_doors[0];
|
|
this->_doors[1] = iVar4;
|
|
this->_doors[2] = iVar5;
|
|
this->_doors[3] = iVar6;
|
|
iVar4 = other->_doors[5];
|
|
iVar5 = other->_doors[6];
|
|
iVar6 = other->_doors[7];
|
|
this->_doors[4] = other->_doors[4];
|
|
this->_doors[5] = iVar4;
|
|
this->_doors[6] = iVar5;
|
|
this->_doors[7] = iVar6;
|
|
this->DisplayFlags = other->DisplayFlags;
|
|
this->VisitedCount = other->VisitedCount;
|
|
this->Flags = other->Flags;
|
|
this->TotalMoneySpent = other->TotalMoneySpent;
|
|
this->ClearCount = other->ClearCount;
|
|
this->GreedSubType = other->GreedSubType;
|
|
this->PoopCount = other->PoopCount;
|
|
this->TKeeperCoinSpawns = other->TKeeperCoinSpawns;
|
|
this->PitsCount = other->PitsCount;
|
|
this->DecorationSeed = other->DecorationSeed;
|
|
this->SpawnSeed = other->SpawnSeed;
|
|
this->AwardSeed = other->AwardSeed;
|
|
this->BossDeathSeed = other->BossDeathSeed;
|
|
pvVar9 = (other->SavedGridEntities)._capacity;
|
|
pvVar1 = (other->SavedGridEntities)._end;
|
|
pvVar2 = (other->SavedGridEntities)._begin;
|
|
(other->SavedGridEntities)._capacity = (void *)0x0;
|
|
(other->SavedGridEntities)._end = (void *)0x0;
|
|
(other->SavedGridEntities)._begin = (void *)0x0;
|
|
(this->SavedGridEntities)._begin = pvVar2;
|
|
(this->SavedGridEntities)._end = pvVar1;
|
|
(this->SavedGridEntities)._capacity = pvVar9;
|
|
pvVar9 = (other->SavedEntities)._capacity;
|
|
pvVar1 = (other->SavedEntities)._end;
|
|
pvVar2 = (other->SavedEntities)._begin;
|
|
(other->SavedEntities)._capacity = (void *)0x0;
|
|
(other->SavedEntities)._end = (void *)0x0;
|
|
(other->SavedEntities)._begin = (void *)0x0;
|
|
(this->SavedEntities)._begin = pvVar2;
|
|
(this->SavedEntities)._end = pvVar1;
|
|
(this->SavedEntities)._capacity = pvVar9;
|
|
local_8 = 1;
|
|
(this->RestrictedGridIndexes)._head = (void *)0x0;
|
|
(this->RestrictedGridIndexes)._size = 0;
|
|
pvVar9 = operator_new(0x14);
|
|
*(void **)pvVar9 = pvVar9;
|
|
*(void **)(GHIDRA_CAST<char *>(pvVar9) + 4) = pvVar9;
|
|
*(void **)(GHIDRA_CAST<char *>(pvVar9) + 8) = pvVar9;
|
|
*GHIDRA_CAST<undefined2 *>((GHIDRA_CAST<char *>(pvVar9) + 0xc)) = 0x101;
|
|
(this->RestrictedGridIndexes)._head = pvVar9;
|
|
(this->RestrictedGridIndexes)._head = (other->RestrictedGridIndexes)._head;
|
|
(other->RestrictedGridIndexes)._head = pvVar9;
|
|
swappedListSize = (this->RestrictedGridIndexes)._size;
|
|
(this->RestrictedGridIndexes)._size = (other->RestrictedGridIndexes)._size;
|
|
(other->RestrictedGridIndexes)._size = swappedListSize;
|
|
pvVar9 = (other->SavedEffects)._end;
|
|
pvVar1 = (other->SavedEffects)._begin;
|
|
pvVar2 = (other->SavedEffects)._capacity;
|
|
(other->SavedEffects)._capacity = (void *)0x0;
|
|
(other->SavedEffects)._end = (void *)0x0;
|
|
(other->SavedEffects)._begin = (void *)0x0;
|
|
(this->SavedEffects)._begin = pvVar1;
|
|
(this->SavedEffects)._end = pvVar9;
|
|
(this->SavedEffects)._capacity = pvVar2;
|
|
swappedListSize = *GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((other)) + 0x98))));
|
|
uVar7 = *GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((other)) + 0x9c))));
|
|
uVar8 = *GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((other)) + 0xa0))));
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x94)))) = *GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((other)) + 0x94))));
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x98)))) = swappedListSize;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x9c)))) = uVar7;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0xa0)))) = uVar8;
|
|
swappedListSize = *GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((other)) + 0xa8))));
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0xa4)))) = *GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((other)) + 0xa4))));
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0xa8)))) = swappedListSize;
|
|
this->ShopItemIdx = other->ShopItemIdx;
|
|
this->ShopItemDiscountIdx = other->ShopItemDiscountIdx;
|
|
this->DeliriumDistance = other->DeliriumDistance;
|
|
this->Group = other->Group;
|
|
ExceptionList = local_10;
|
|
return this;
|
|
}
|
|
|
|
// 007e9190
|
|
uint RoomDescriptor::NoReward()
|
|
{
|
|
return CONCAT31((uint3)(GHIDRA_UINT(this->Flags) >> 0xf),(char)(GHIDRA_UINT(this->Flags) >> 7)) & 0xffffff01;
|
|
}
|
|
|
|
// 009adaf0
|
|
RoomDescriptor * RoomDescriptor::Init(uint seed)
|
|
{
|
|
int fillCount;
|
|
void **fillPtr;
|
|
|
|
this[4].RestrictedGridIndexes._size = 0;
|
|
this[4].SavedEffects._begin = (void *)0x0;
|
|
this[4].SavedEffects._end = (void *)0x0;
|
|
this[4].SavedEffects._capacity = (void *)0x0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[4])) + 0x94)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[4])) + 0x98)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[4])) + 0x9c)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[4])) + 0xa0)))) = 0;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[4])) + 0xa4)))) = 0;
|
|
fillPtr = &this->OverrideData;
|
|
for (fillCount = 0xa9; fillCount != 0; fillCount = fillCount + -1) {
|
|
*fillPtr = (void *)0xffffffff;
|
|
fillPtr = fillPtr + 1;
|
|
}
|
|
this->GridIndex = seed;
|
|
this->SafeGridIndex = 5;
|
|
this->ListIndex = 9;
|
|
this->Dimension = 7;
|
|
this->Data = (void *)0xffffffff;
|
|
this->Data = (void *)(GHIDRA_UINT(this->Data) & 0x1fff);
|
|
memset(&this[3].SavedEffects._capacity,0,0xa9);
|
|
return this;
|
|
}
|