mirror of
https://github.com/pret/pmd-sky.git
synced 2026-09-28 13:24:02 -05:00
decompile LoadBackgroundAttributes
This commit is contained in:
File diff suppressed because it is too large
Load Diff
2535
asm/include/overlay_11_022EBC18.inc
Normal file
2535
asm/include/overlay_11_022EBC18.inc
Normal file
File diff suppressed because it is too large
Load Diff
64854
asm/overlay_11.s
64854
asm/overlay_11.s
File diff suppressed because it is too large
Load Diff
64798
asm/overlay_11_022EBC18.s
Normal file
64798
asm/overlay_11_022EBC18.s
Normal file
File diff suppressed because it is too large
Load Diff
22
include/overlay_11_022EBB40.h
Normal file
22
include/overlay_11_022EBB40.h
Normal 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
|
||||
2
main.lsf
2
main.lsf
@@ -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
34
src/overlay_11_022EBB40.c
Normal 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();
|
||||
}
|
||||
Reference in New Issue
Block a user