decompile LoadBackgroundAttributes

This commit is contained in:
DizzyEggg
2025-07-22 18:20:09 +02:00
parent 5874668e8e
commit fe4dacaa42
7 changed files with 67792 additions and 65353 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

64798
asm/overlay_11_022EBC18.s Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,22 @@
#ifndef PMDSKY_OVERLAY_11_022EBB40_H
#define PMDSKY_OVERLAY_11_022EBB40_H
#define BG_NAME_LEN 8
struct bg_list_entry_sub_struct {
char name[BG_NAME_LEN + 2]; // Null-terminated string
};
#define BPA_MAX_ENTRIES 8
// Represents an entry in the bg_list.dat file, after being loaded by LoadBgListEntry
struct bg_list_entry {
struct bg_list_entry_sub_struct bpl;
struct bg_list_entry_sub_struct bpc;
struct bg_list_entry_sub_struct bma;
struct bg_list_entry_sub_struct others_bpa[BPA_MAX_ENTRIES];
};
void LoadBackgroundAttributes(struct bg_list_entry* entry, int bgId);
#endif //PMDSKY_OVERLAY_11_022EBB40_H

View File

@@ -184,6 +184,8 @@ Overlay OVY_11
{
After OVY_10
Object asm/overlay_11.o
Object src/overlay_11_022EBB40.o
Object asm/overlay_11_022EBC18.o
}
Overlay OVY_12
{

34
src/overlay_11_022EBB40.c Normal file
View File

@@ -0,0 +1,34 @@
#include "overlay_11_022EBB40.h"
#include "file_rom.h"
extern void FileClose(struct file_stream* file);
extern const char ov11_02320C44[];
#define FILE_BG_LIST_ENTRY_SIZE (BG_NAME_LEN * (BPA_MAX_ENTRIES + 3))
void LoadBackgroundAttributes(struct bg_list_entry* entry, int bgId)
{
s32 i;
struct file_stream file;
FileRom_InitDataTransfer();
FileRom_Veneer_FileInit(&file);
FileRom_HandleOpen(&file, ov11_02320C44);
FileRom_HandleSeek(&file, FILE_BG_LIST_ENTRY_SIZE * bgId, 0);
FileRom_HandleRead(&file, entry->bpl.name, BG_NAME_LEN);
entry->bpl.name[BG_NAME_LEN] = '\0';
FileRom_HandleRead(&file, entry->bpc.name, BG_NAME_LEN);
entry->bpc.name[BG_NAME_LEN] = '\0';
FileRom_HandleRead(&file, entry->bma.name, BG_NAME_LEN);
entry->bma.name[BG_NAME_LEN] = '\0';
for (i = 0; i < BPA_MAX_ENTRIES; i++) {
FileRom_HandleRead(&file, entry->others_bpa[i].name, BG_NAME_LEN);
entry->others_bpa[i].name[BG_NAME_LEN] = '\0';
}
FileClose(&file);
FileRom_StopDataTransfer();
}