Decompile fn_21356 (CGameMode::sub_CEC6A0)

Batch #6828 by pedrao: 0 byte-identical, 1 confirmed by peer review.

- fn_21356 CGameMode::sub_CEC6A0: logic confirmed by peer review

Peer-reviewed-by: eAthena, Tanke
Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
This commit is contained in:
ragnarok-clanker 2026-10-31 01:38:58 +00:00
commit db7ed471c1
2 changed files with 66 additions and 0 deletions

View file

@ -348,6 +348,29 @@ public:
void AddUnknown0604(UIWindow* window);
void RequestAdminStatus();
void sub_CEB8E0();
unsigned sub_CEBF30(const std::vector<unsigned char>& data);
unsigned sub_CEC100(const std::vector<unsigned char>& data);
unsigned sub_CEC6A0(const std::vector<unsigned char>& data);
void sub_D2DB80(const unsigned char* record);
void sub_D3D2F0(const unsigned char* record);
void sub_D3F130(const unsigned char* record);
void sub_D24430(const unsigned char* record);
void sub_D350A0(const unsigned char* record);
void sub_D37A10(const unsigned char* record);
void sub_D40730(const unsigned char* record);
void sub_D41250(const unsigned char* record);
void sub_D51A90(const unsigned char* record);
void sub_D61390(const unsigned char* record);
void sub_D616B0(const unsigned char* record);
void sub_D619E0(const unsigned char* record);
void sub_D63720(const unsigned char* record);
void sub_D63A40(const unsigned char* record);
void sub_D63D70(const unsigned char* record);
void sub_D65FC0(const unsigned char* record);
void sub_D7B170(
int first, std::string text, int second, int third, int fourth, int fifth, int sixth, int seventh, int eighth,
int ninth, int tenth, int eleventh, int twelfth, int thirteenth, int fourteenth, int fifteenth
);
void Slot7(int value) override;
void PlaceWindowAtActor(UIWindow* window, CGameActor* actor);
bool UpdateReplayPause(bool resume);

View file

@ -408,6 +408,49 @@ void CGameMode::sub_CEB8E0() {
recorder.Record(static_cast<std::uint16_t>(record.length), &record, 0x2A, 0);
}
// OFFSET: 0x00CEBF30
// OFFSET: 0x00CEC100
// OFFSET: 0x00CEC6A0
// FUNCTION: fn_21356
unsigned CGameMode::sub_CEC6A0(const std::vector<unsigned char>& data) {
if (data.empty()) {
return 0xFFFFFFFFu;
}
unsigned offset = 6;
if (*reinterpret_cast<const std::int16_t*>(data.data()) == 17000) {
while (offset < data.size()) {
const short type = *reinterpret_cast<const short*>(data.data() + offset);
const std::uint32_t size = *reinterpret_cast<const std::uint32_t*>(data.data() + offset + 2);
offset += 6;
if (type == 0xCD) {
unsigned char* record = new unsigned char[0x10]();
std::memcpy(record, data.data() + offset, size);
offset += size;
this->sub_D41250(record);
delete[] record;
} else if (type == 0xCE) {
unsigned char* record = new unsigned char[0x61]();
std::memcpy(record, data.data() + offset, size);
offset += size;
this->sub_D40730(record);
delete[] record;
} else if (type == 0x4269) {
break;
} else {
offset += size;
}
}
} else {
offset = 0xFFFFFFFFu;
}
return offset;
}
// OFFSET: 0x00CEFE50
// FUNCTION: fn_21407
void CGameMode::ClearUnknown04DC() {