diff --git a/data/data2c.s b/data/data2c.s index 5bfea56ae..773124b6d 100644 --- a/data/data2c.s +++ b/data/data2c.s @@ -38,19 +38,3 @@ gUnknown_0831ACB0:: @ 831ACB0 .2byte 0x0100 .2byte 0xC000 .2byte 0x2800 - - .align 2 -gUnknown_0831ACB8:: @ 831ACB8 - .2byte 0x0000, 0x0005, 0xfffe, 0x0000 - - .align 2 -gUnknown_0831ACC0:: @ 831ACC0 - .4byte gUnknown_0831ACB8 - - .align 2 -gUnknown_0831ACC4:: @ 831ACC4 - .2byte 0xfff0, 0x0000, 0x0400, 0x0000, 0x0000, 0x0000, 0x3c00, 0x0000, 0x7ffe, 0x0001, 0x0000, 0x0000 - - .align 2 -gUnknown_0831ACDC:: @ 831ACDC - .4byte gUnknown_0831ACC4 diff --git a/data/unk_transition.s b/data/unk_transition.s deleted file mode 100644 index db5744d08..000000000 --- a/data/unk_transition.s +++ /dev/null @@ -1,18 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .section .rodata - - .align 2, 0 -gUnknown_0862AD54:: @ 862AD54 - .incbin "graphics/battle_transitions/frontier_transition.4bpp.lz" - -gUnknown_0862AF30:: @ 862AF30 - .incbin "graphics/battle_transitions/frontier_transition.bin" - -gUnknown_0862B0DC:: @ 862B0DC - .incbin "graphics/battle_transitions/frontier_transition_circles.4bpp.lz" - -gUnknown_0862B53C:: @ 862B53C - .incbin "graphics/battle_transitions/frontier_transition.gbapal" - .space 0x1c0 diff --git a/ld_script.txt b/ld_script.txt index 3c7ecd9ee..8996c8220 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -601,7 +601,6 @@ SECTIONS { src/rayquaza_scene.o(.rodata); src/walda_phrase.o(.rodata); src/gym_leader_rematch.o(.rodata); - data/unk_transition.o(.rodata); src/unk_transition.o(.rodata); data/text_input_strings.o(.rodata); data/fonts.o(.rodata); diff --git a/src/battle_main.c b/src/battle_main.c index 42f204508..458d0e306 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -283,6 +283,13 @@ u8 gNumberOfMovesToChoose; u8 gUnknown_03005D7C[MAX_BATTLERS_COUNT]; // rom const data + +// Unknown and unused data. Feel free to remove. +static const u16 gUnknown_0831ACB8[] = {0, 5, 0xfffe, 0}; +static const u16 *const gUnknown_0831ACC0 = gUnknown_0831ACB8; +static const u16 gUnknown_0831ACC4[] = {0xfff0, 0, 0x0400, 0, 0, 0, 0x3c00, 0, 0x7ffe, 1, 0, 0}; +static const u16 *const gUnknown_0831ACDC = gUnknown_0831ACC4; + static const s8 gUnknown_0831ACE0[] ={-32, -16, -16, -32, -32, 0, 0, 0}; // format: attacking type, defending type, damage multiplier diff --git a/src/gpu_regs.c b/src/gpu_regs.c index 2d48b304a..e5ff4fe8f 100644 --- a/src/gpu_regs.c +++ b/src/gpu_regs.c @@ -72,16 +72,20 @@ void SetGpuReg(u8 regOffset, u16 value) GPU_REG_BUF(regOffset) = value; vcount = REG_VCOUNT & 0xFF; - if ((vcount >= 161 && vcount <= 225) - || (REG_DISPCNT & DISPCNT_FORCED_BLANK)) { + if ((vcount >= 161 && vcount <= 225) || (REG_DISPCNT & DISPCNT_FORCED_BLANK)) + { CopyBufferedValueToGpuReg(regOffset); - } else { + } + else + { s32 i; sGpuRegBufferLocked = TRUE; - for (i = 0; i < GPU_REG_BUF_SIZE && sGpuRegWaitingList[i] != EMPTY_SLOT; i++) { - if (sGpuRegWaitingList[i] == regOffset) { + for (i = 0; i < GPU_REG_BUF_SIZE && sGpuRegWaitingList[i] != EMPTY_SLOT; i++) + { + if (sGpuRegWaitingList[i] == regOffset) + { sGpuRegBufferLocked = FALSE; return; } @@ -99,15 +103,20 @@ void SetGpuReg_ForcedBlank(u8 regOffset, u16 value) { GPU_REG_BUF(regOffset) = value; - if (REG_DISPCNT & DISPCNT_FORCED_BLANK) { + if (REG_DISPCNT & DISPCNT_FORCED_BLANK) + { CopyBufferedValueToGpuReg(regOffset); - } else { + } + else + { s32 i; sGpuRegBufferLocked = TRUE; - for (i = 0; i < GPU_REG_BUF_SIZE && sGpuRegWaitingList[i] != EMPTY_SLOT; i++) { - if (sGpuRegWaitingList[i] == regOffset) { + for (i = 0; i < GPU_REG_BUF_SIZE && sGpuRegWaitingList[i] != EMPTY_SLOT; i++) + { + if (sGpuRegWaitingList[i] == regOffset) + { sGpuRegBufferLocked = FALSE; return; } @@ -144,7 +153,8 @@ void ClearGpuRegBits(u8 regOffset, u16 mask) static void SyncRegIE(void) { - if (sShouldSyncRegIE) { + if (sShouldSyncRegIE) + { u16 temp = REG_IME; REG_IME = 0; REG_IE = sRegIE; diff --git a/src/unk_transition.c b/src/unk_transition.c index 220570851..7346e06ab 100644 --- a/src/unk_transition.c +++ b/src/unk_transition.c @@ -35,11 +35,13 @@ static bool8 sub_81DB290(struct Task *task); static bool8 sub_81DB328(struct Task *task); // const rom data -// TODO: move those from .s file to .c -extern const u32 gUnknown_0862AD54[]; -extern const u32 gUnknown_0862AF30[]; -extern const u32 gUnknown_0862B0DC[]; -extern const u16 gUnknown_0862B53C[]; +static const u32 gUnknown_0862AD54[] = INCBIN_U32("graphics/battle_transitions/frontier_transition.4bpp.lz"); +static const u32 gUnknown_0862AF30[] = INCBIN_U32("graphics/battle_transitions/frontier_transition.bin"); +static const u32 gUnknown_0862B0DC[] = INCBIN_U32("graphics/battle_transitions/frontier_transition_circles.4bpp.lz"); +static const u16 gUnknown_0862B53C[] = INCBIN_U16("graphics/battle_transitions/frontier_transition.gbapal"); + +// Unused Empty data. Feel free to delete. +static const u8 sFiller[0x1C0] = {0}; static const struct OamData sOamData_862B71C = {