Decompile overlay 1 (Part 3) (#95)

* ZeldaArrangeBinary OK

* ZeldaMapBinary 26%

* UnkStruct_SceneChange1 -> EntranceInfo

* cleanup EntranceInfo ctors

* fix regressions

* ZeldaMapBinary 47%

* fix regressions

* ZeldaMapBinary 73%

* ZeldaMapBinary 89%

* ZeldaMapBinary 99%
This commit is contained in:
Yanis
2026-07-01 04:09:04 +02:00
committed by GitHub
parent 6ea40b4493
commit 4074a603d2
76 changed files with 1924 additions and 643 deletions
+37 -4
View File
@@ -9,6 +9,7 @@
#include <compressed_pair.hpp>
#include <msl_unk.hpp>
#include <mem.h>
#define TAG_UNK 0
@@ -195,7 +196,7 @@ namespace std {
return alloc().max_size();
}
size_t capacity() const {
volatile size_t capacity() const {
return capacity_.first();
}
@@ -207,10 +208,19 @@ namespace std {
size_ = n;
}
void move_construct_to_end(iterator begin, iterator end);
void move_construct_to_end(iterator begin, iterator end) {
for (iterator it = this->end(); begin < end; begin++) {
new(it) T(*begin);
it++;
size_++;
}
}
//! TODO: probably a fake match?
void reallocate_copy(size_t n) {
__vec_deleter<T, Allocator> tmp(alloc());
UnkMSLStruct1 unk = UnkMSLStruct1();
UnkMSLStruct1 unk2 = UnkMSLStruct1();
__vec_deleter<T, Allocator> tmp;
tmp.allocate(n);
tmp.move_construct_to_end(begin(), end());
optimize_after_moved_from();
@@ -219,6 +229,29 @@ namespace std {
swap(size_, tmp.size_);
}
void move_construct_to_end_alt(iterator begin, iterator end) {
move_construct_to_end_alt(begin, end, UnkMSLStruct1());
}
void move_construct_to_end_alt(iterator begin, iterator end, UnkMSLStruct1) {
size_t diff = end - begin;
memcpy(this->end(), begin, sizeof(T) * diff);
memset(begin, 0, sizeof(T) * diff);
size_ += diff;
}
//! TODO: non-matching (stack issues :)))))
void reallocate_copy_alt(size_t n) {
UnkMSLStruct1 unk2 = UnkMSLStruct1();
__vec_deleter<T, Allocator> tmp;
tmp.allocate(n);
tmp.move_construct_to_end_alt(begin(), end());
optimize_after_moved_from();
swap(cap(), tmp.cap());
swap(data_, tmp.data_);
swap(size_, tmp.size_);
}
void reserve(size_t n) {
if (n > cap()) {
reallocate_copy(n);
@@ -465,7 +498,7 @@ namespace std {
typedef _Constructor::const_iterator const_iterator;
vector() {}
~vector() { }
~vector() {}
void push_back(const_reference x) {
_Constructor::push_back(x);
+17
View File
@@ -53,7 +53,15 @@ extern "C" {
#define MUL_FX32(a, b) (fx32)((((s64) (a)) * ((s64) (b)) + 0x800) >> FX32_SHIFT)
#define DIV_FX32(a, b) (((a) << FX32_SHIFT) / (b))
// some kind of angle conversion? only used for angle values so far
#define MUL_FX32_FX64(a, b) (fx32)(((((a) * (b)) + 0x80000000000LL) >> 32))
#define UNK_FX_OPERATION_1(a) (MUL_FX32_FX64((u64) (a), 0xB60B60B60BLL) >> FX32_SHIFT)
#define MUL_FX32_U(a, b) (fx32)((((u64) (a)) * ((u64) (b)) + 0x800) >> FX32_SHIFT)
#define UNK_FX_OPERATION_2(a) MUL_FX32_U((u64) (a), FLOAT_TO_FX32(1.2f))
#define DEG_TO_ANG(n) ((n) * 0x10000 / 360)
#define DEG_TO_ANG_ALT(n) DEG_TO_ANG((u64) (n))
#define SIN(n) (gSinCosTable[2 * ((n) >> 4)])
#define COS(n) (gSinCosTable[2 * ((n) >> 4) + 1])
@@ -82,6 +90,15 @@ static inline void Vec2p_Copy(const Vec2p *src, Vec2p *dst) {
#endif
}
typedef union Vec2b {
struct {
/* 0 */ u8 x;
/* 4 */ u8 y;
/* 8 */
};
u8 coords[2];
} Vec2b;
typedef struct Mat2p {
/* 00 */ Vec2p xColumn;
/* 08 */ Vec2p yColumn;
+1 -1
View File
@@ -34,7 +34,7 @@ typedef volatile s8 vs8;
typedef volatile f32 vf32;
typedef volatile f64 vf64;
typedef u32 BOOL;
typedef s32 BOOL;
#define ATTRIBUTE_ALIGN(x) __attribute__((aligned(x)))