getting closer and closer to the xfb copy loop in panda

This commit is contained in:
2026-05-13 11:27:28 +02:00
parent fc26f75118
commit 9c3a6789f6
9 changed files with 319 additions and 82 deletions
+6 -7
View File
@@ -4,7 +4,6 @@
#include <ircolib/file.hpp>
#include <ircolib/mem_access.hpp>
#include <array>
#include <print>
namespace weee::core {
bool load_dol(const std::string &path, mem &mem, broadway &broadway) {
@@ -22,22 +21,22 @@ bool load_dol(const std::string &path, mem &mem, broadway &broadway) {
} hdr;
for (size_t bin_index = 0; bin_index < 0xD8; bin_index += 4) {
if (ircolib::is_inside_range_ext(bin_index, 0, 0x1c)) // text file offsets
if (ircolib::is_inside_range(bin_index, 0, 0x1b)) // text file offsets
hdr.text[bin_index / 4].offset = std::byteswap(ircolib::read_access<ircolib::u32>(bin, bin_index));
if (ircolib::is_inside_range_ext(bin_index, 0x1c, 0x48)) // data file offsets
if (ircolib::is_inside_range(bin_index, 0x1c, 0x47)) // data file offsets
hdr.data[(bin_index - 0x1c) / 4].offset = std::byteswap(ircolib::read_access<ircolib::u32>(bin, bin_index));
if (ircolib::is_inside_range_ext(bin_index, 0x48, 0x64)) // text loading addresses
if (ircolib::is_inside_range(bin_index, 0x48, 0x63)) // text loading addresses
hdr.text[(bin_index - 0x48) / 4].addr = std::byteswap(ircolib::read_access<ircolib::u32>(bin, bin_index));
if (ircolib::is_inside_range_ext(bin_index, 0x64, 0x90)) // data loading addresses
if (ircolib::is_inside_range(bin_index, 0x64, 0x8f)) // data loading addresses
hdr.data[(bin_index - 0x64) / 4].addr = std::byteswap(ircolib::read_access<ircolib::u32>(bin, bin_index));
if (ircolib::is_inside_range_ext(bin_index, 0x90, 0xac)) // text sizes
if (ircolib::is_inside_range(bin_index, 0x90, 0xab)) // text sizes
hdr.text[(bin_index - 0x90) / 4].size = std::byteswap(ircolib::read_access<ircolib::u32>(bin, bin_index));
if (ircolib::is_inside_range_ext(bin_index, 0xac, 0xd8)) // data sizes
if (ircolib::is_inside_range(bin_index, 0xac, 0xd7)) // data sizes
hdr.data[(bin_index - 0xac) / 4].size = std::byteswap(ircolib::read_access<ircolib::u32>(bin, bin_index));
}