Skip to content

Commit

Permalink
merge with master, update dungeon struct
Browse files Browse the repository at this point in the history
  • Loading branch information
DizzyEggg committed Oct 13, 2024
2 parents 74c5df2 + 5af37bd commit 0b4aafa
Show file tree
Hide file tree
Showing 15 changed files with 1,527 additions and 3,132 deletions.
3,071 changes: 0 additions & 3,071 deletions asm/code_803E724.s

This file was deleted.

10 changes: 5 additions & 5 deletions include/bg_palette_buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
#define GUARD_BG_PALETTE_BUFFER_H

void InitBGPaletteBuffer(void);
void nullsub_4(s32 index, u8 *colorArray, s32, u8 *);
void nullsub_5(void);
void SetBGPaletteBufferColorArray(s32 index, u8 *colorArray);
void SetBGPaletteBufferColorRGB(s32 index, u8 *colorArray, s32, u8 *);
void nullsub_4(s32 index, const u8 *colorArray, s32, u8 *);
void nullsub_5(s32 index, const u8 *colorArray);
void SetBGPaletteBufferColorArray(s32 index, const u8 *colorArray);
void SetBGPaletteBufferColorRGB(s32 index, const u8 *colorArray, s32, u8 *);
void TransferBGPaletteBuffer(void);

#endif // GUARD_BG_PALETTE_BUFFER_H
#endif // GUARD_BG_PALETTE_BUFFER_H
4 changes: 2 additions & 2 deletions include/code_8009804.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
struct unkStruct_202D240
{
u32 *unk0;
u32 *unk4;
const u32 *unk4;
u32 size;
};

Expand All @@ -19,7 +19,7 @@ void vram_related_8009804(void);

void InitFontPalette(void);
void sub_80098A0(void);
void sub_80098BC(u32 *, u32 *, u32);
void sub_80098BC(u32 *, const u32 *, u32);
void sub_80098F8(u32);
void sub_8009908(void);
void sub_80099C0(void);
Expand Down
2 changes: 1 addition & 1 deletion include/cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define GUARD_CPU_H

void CpuClear(void *, s32);
void CpuCopy(void *, void *, s32);
void CpuCopy(void *dest, const void *src, s32 size);
void nullsub_23(bool8);
void SetWindowTitle(u8 *);
void sub_800CDA8(u32);
Expand Down
75 changes: 40 additions & 35 deletions include/structs/str_dungeon.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,39 +82,44 @@ typedef struct DungeonMusicPlayer
// Size unknown?
typedef struct UnkDungeonGlobal_unk181E8_sub
{
/* 0x181E8 */ Position cameraPos;
/* 0x181EC */ Position cameraPosMirror;
/* 0x181F0 */ Position cameraPixelPos;
/* 0x181F4 */ Position cameraPixelPosMirror;
/* 0x181F8 */ Entity *cameraTarget;
u32 unk181FC;
u32 unk18200;
u32 unk18204;
u8 unk18208;
/* 0x18209 */ u8 visibilityRange; // Dungeon light level.
/* 0x1820A */ bool8 blinded; // Blacks out the screen when the player has the Blinker status.
u8 unk1820B;
u8 unk1820C;
u8 unk1820D;
u8 unk1820E;
u8 unk1820F;
/* 0x18210 */ bool8 hallucinating; // Displays Substitute and flower sprites when the player has the Cross-Eyed status.
u8 unk18211;
u8 unk18212;
u8 unk18213;
u8 unk18214;
u8 unk18215;
u8 fill18216;
u8 unk18217;
u8 unk18218;
u8 unk18219;
u8 unk1821A;
u8 unk1821B;
u8 unk1821C;
u8 fill1821D;
u8 fill1821E;
u8 fill1821F;
} UnkDungeonGlobal_unk181E8_sub;
/* 0x181E8 */ Position cameraPos; // x0
/* 0x181EC */ Position cameraPosMirror; // x4
/* 0x181F0 */ Position cameraPixelPos; // x8
/* 0x181F4 */ Position cameraPixelPosMirror; // xC
/* 0x181F8 */ Entity *cameraTarget; // x10
u32 unk181FC; // x14
u32 unk18200; // x18
u32 unk18204; // x1C
u8 unk18208; // x20
/* 0x18209 */ u8 visibilityRange; // x21 Dungeon light level.
/* 0x1820A */ bool8 blinded; // x22 Blacks out the screen when the player has the Blinker status.
u8 unk1820B; // x23
u8 unk1820C; // x24
u8 unk1820D; // x25
u8 unk1820E; // x26
u8 unk1820F; // x27
/* 0x18210 */ bool8 hallucinating; // x28 Displays Substitute and flower sprites when the player has the Cross-Eyed status.
u8 unk18211; // x29
u8 unk18212; // x2A
u8 unk18213; // x2B
u8 unk18214; // x2C
u8 unk18215; // x2D
u8 unk18216; // x2E
u8 unk18217; // x2F
u8 unk18218; // x30
u8 unk18219; // x31
u8 unk1821A; // x32
u8 unk1821B; // x33
u8 unk1821C; // x34
u8 fill1821D; // x35
s16 unk36; // x36
s16 unk38; // x38
s16 unk3A; // x3A
s16 unk3C; // x3C
s16 unk3E; // x3E
s16 unk40; // x40
s16 unk42; // x42
} UnkDungeonGlobal_unk181E8_sub; // x44

// Sizeof: 0x1C
typedef struct UnkDungeonGlobal_unk1C574
Expand Down Expand Up @@ -229,7 +234,7 @@ typedef struct Dungeon
u8 unk11;
s16 unk12;
s16 unk14;
u8 fill14[0xB8 - 0x16];
u32 unk18[(0xB8 - 0x18) / 4];
Entity *unkB8;
Entity *unkBC;
u8 fillC0[0x134 - 0xC0];
Expand Down Expand Up @@ -374,7 +379,7 @@ typedef struct Dungeon
/* 0x17B44 */ OpenedFile *sprites[MONSTER_MAX];
/* 0x181E4 */ OpenedFile *paletFile;
/* 0x181E8 */ UnkDungeonGlobal_unk181E8_sub unk181e8;
u8 fill18220[0x1C05E - 0x18220];
u8 fill18220[0x1C05E - 0x1822C];
u8 unk1C05E;
u8 fill1C05F[0x1C06C - 0x1C05F];
u32 unk1C06C;
Expand Down
4 changes: 2 additions & 2 deletions include/text1.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ void SelectCharmap(u32);
u32 UpdateFadeInTile(u32 a0);

u32 sub_80063B0(void);
void xxx_call_save_unk_text_struct_800641C(UnkTextStruct2 *a0, bool8 a1, bool8 a2);
void xxx_call_save_unk_text_struct_800641C(const UnkTextStruct2 *a0, bool8 a1, bool8 a2);

#endif // GUARD_TEXT1_H
#endif // GUARD_TEXT1_H
2 changes: 1 addition & 1 deletion ld_script.txt
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ SECTIONS {
src/code_803D110.o(.text);
asm/code_803D110.o(.text);
src/code_803E46C.o(.text);
asm/code_803E724.o(.text);
src/code_803E724.o(.text);
src/code_8040094.o(.text);
asm/code_8040094.o(.text);
src/code_8041AD0.o(.text);
Expand Down
8 changes: 4 additions & 4 deletions src/bg_palette_buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ void InitBGPaletteBuffer(void)
}

// 99.48% (r3/r4 regswap) https://decomp.me/scratch/7Yc8i
void SetBGPaletteBufferColorRGB(s32 index, u8 *colorArray, s32 a1, u8 *a2)
void SetBGPaletteBufferColorRGB(s32 index, const u8 *colorArray, s32 a1, u8 *a2)
{
#ifdef NONMATCHING
s32 var;
Expand All @@ -43,7 +43,7 @@ void SetBGPaletteBufferColorRGB(s32 index, u8 *colorArray, s32 a1, u8 *a2)
sBGPaletteBuffer[index] = var = ((a2[4 * colorArray[2] + 2] * a1 / 256 & 0x1F) << 10) | ((a2[4 * colorArray[1] + 1] * a1 / 256 & 0x1F) << 5) | (a2[4 * colorArray[0]] * a1 / 256 & 0x1F);
}

void SetBGPaletteBufferColorArray(s32 index, u8 *colorArray)
void SetBGPaletteBufferColorArray(s32 index, const u8 *colorArray)
{
sBGPaletteUsed[index / BG_PALETTE_BUFFER_CHUNK_SIZE] = TRUE;
sBGPaletteBuffer[index] = (colorArray[2] >> 3) << 10 | (colorArray[1] >> 3) << 5 | colorArray[0] >> 3;
Expand All @@ -55,11 +55,11 @@ void SetBGPaletteBufferColor(s32 index, u16 *color)
sBGPaletteBuffer[index] = *color;
}

void nullsub_4(s32 index, u8 *colorArray, s32 a1, u8 *a2)
void nullsub_4(s32 index, const u8 *colorArray, s32 a1, u8 *a2)
{
}

void nullsub_5(void)
void nullsub_5(s32 index, const u8 *colorArray)
{
}

Expand Down
2 changes: 1 addition & 1 deletion src/code_8009804.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ void sub_80098A0(void)
gUnknown_202D238[3] = 0;
}

void sub_80098BC(u32 *r0, u32 *r1, u32 r2)
void sub_80098BC(u32 *r0, const u32 *r1, u32 r2)
{
if (gUnknown_202D23C < 8) {
gUnknown_202D240[gUnknown_202D23C].unk0 = r0;
Expand Down
Loading

0 comments on commit 0b4aafa

Please sign in to comment.