From c83691edc2f07651dd5348ad46a2896f826a2e25 Mon Sep 17 00:00:00 2001 From: red031000 Date: Thu, 30 Nov 2023 04:50:27 +0000 Subject: [PATCH 1/9] start decompiling blackout.c --- arm9/arm9.lsf | 3 +- arm9/asm/{unk_02048120.s => blackout_asm.s} | 59 ++------------------- arm9/src/blackout_src.c | 59 +++++++++++++++++++++ include/blackout.h | 20 +++++++ 4 files changed, 85 insertions(+), 56 deletions(-) rename arm9/asm/{unk_02048120.s => blackout_asm.s} (82%) create mode 100644 arm9/src/blackout_src.c create mode 100644 include/blackout.h diff --git a/arm9/arm9.lsf b/arm9/arm9.lsf index 5a4f36ba9..6dc99f735 100644 --- a/arm9/arm9.lsf +++ b/arm9/arm9.lsf @@ -187,7 +187,8 @@ Static arm9 Object encounter.o Object unk_02047500.o Object unk_020476CC.o - Object unk_02048120.o + Object blackout_src.o + Object blackout_asm.o Object unk_020484A8.o Object unk_02048904.o Object script_pokemon_util.o diff --git a/arm9/asm/unk_02048120.s b/arm9/asm/blackout_asm.s similarity index 82% rename from arm9/asm/unk_02048120.s rename to arm9/asm/blackout_asm.s index b5c29fbf3..cabf995a2 100644 --- a/arm9/asm/unk_02048120.s +++ b/arm9/asm/blackout_asm.s @@ -2,61 +2,10 @@ .include "global.inc" .extern gSystem - - .section .rodata - - .global UNK_020F4628 -UNK_020F4628: ; 0x020F4628 - .byte 0x03, 0x04, 0x05, 0x19, 0x0F, 0x0D, 0x01, 0x00 - - .global UNK_020F4630 -UNK_020F4630: ; 0x020F4630 - .byte 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - - .global UNK_020F4640 -UNK_020F4640: ; 0x020F4640 - .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - .byte 0x01, 0x00, 0x1F, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - - .global UNK_020F465C -UNK_020F465C: ; 0x020F465C - .byte 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - .byte 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - .byte 0x01, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00 + .extern Blackout_WindowTemplate .text - thumb_func_start sub_02048120 -sub_02048120: ; 0x02048120 - push {r4, lr} - sub sp, #0x8 - add r4, r0, #0x0 - ldr r0, _02048158 ; =UNK_020F465C - bl GX_SetBanks - ldr r0, _0204815C ; =UNK_020F4630 - bl SetBothScreensModesAndDisable - ldr r2, _02048160 ; =UNK_020F4640 - add r0, r4, #0x0 - mov r1, #0x3 - mov r3, #0x0 - bl InitBgFromTemplate - mov r0, #0x20 - str r0, [sp, #0x0] - mov r0, #0xb - mov r3, #0x1a - str r0, [sp, #0x4] - mov r0, #0xe - mov r1, #0x6 - mov r2, #0x0 - lsl r3, r3, #0x4 - bl GfGfxLoader_GXLoadPal - add sp, #0x8 - pop {r4, pc} - .balign 4 -_02048158: .word UNK_020F465C -_0204815C: .word UNK_020F4630 -_02048160: .word UNK_020F4640 - thumb_func_start sub_02048164 sub_02048164: ; 0x02048164 push {r4-r6, lr} @@ -79,7 +28,7 @@ _0204817A: mov r0, #0xb bl BgConfig_Alloc str r0, [r4, #0x8] - bl sub_02048120 + bl Blackout_InitDisplays mov r2, #0x52 mov r0, #0x1 mov r1, #0x1a @@ -92,7 +41,7 @@ _0204817A: str r0, [r4, #0x20] add r1, r4, #0x0 ldr r0, [r4, #0x8] - ldr r2, _02048208 ; =UNK_020F4628 + ldr r2, _02048208 ; =Blackout_WindowTemplate add r1, #0xc bl AddWindow add r0, r5, #0x0 @@ -129,7 +78,7 @@ _020481F2: bl TaskManager_Call pop {r4-r6, pc} nop -_02048208: .word UNK_020F4628 +_02048208: .word Blackout_WindowTemplate _0204820C: .word 0x0000019E _02048210: .word sub_02048214 diff --git a/arm9/src/blackout_src.c b/arm9/src/blackout_src.c new file mode 100644 index 000000000..15802b3e2 --- /dev/null +++ b/arm9/src/blackout_src.c @@ -0,0 +1,59 @@ +#include "blackout.h" +#include "bg_window.h" +#include "graphic/font.naix" +#include "gf_gfx_loader.h" + +/*static*/ void Blackout_InitDisplays(BgConfig *bgConfig); + +static const struct GraphicsBanks Blackout_GraphicsBanks = { + .bg = GX_VRAM_BG_128_B, + .bgextpltt = GX_VRAM_BGEXTPLTT_NONE, + .subbg = GX_VRAM_SUB_BG_128_C, + .subbgextpltt = GX_VRAM_SUB_BGEXTPLTT_NONE, + .obj = GX_VRAM_OBJ_64_E, + .objextpltt = GX_VRAM_OBJEXTPLTT_NONE, + .subobj = GX_VRAM_SUB_OBJ_16_I, + .subobjextpltt = GX_VRAM_SUB_OBJEXTPLTT_NONE, + .tex = GX_VRAM_TEX_0_A, + .texpltt = GX_VRAM_TEXPLTT_01_FG, +}; + +static const struct GraphicsModes Blackout_GraphicsModes = { + .dispMode = GX_DISPMODE_GRAPHICS, + .bgMode = GX_BGMODE_0, + .subMode = GX_BGMODE_0, + ._2d3dMode = GX_BG0_AS_2D, +}; + +static const BgTemplate Blackout_BgTemplate = { + .x = 0, + .y = 0, + .bufferSize = 0x800, + .baseTile = 0, + .size = GF_BG_SCR_SIZE_256x256, + .colorMode = GX_BG_COLORMODE_16, + .screenBase = GX_BG_SCRBASE_0xf800, + .charBase = GX_BG_CHARBASE_0x00000, + .bgExtPltt = GX_BG_EXTPLTT_01, + .priority = 1, + .areaOver = GX_BG_AREAOVER_XLU, + .dummy = 0, + .mosaic = FALSE +}; + +/*static*/ const WindowTemplate Blackout_WindowTemplate = { + .bgId = GF_BG_LYR_MAIN_3, + .left = 4, + .top = 5, + .width = 25, + .height = 15, + .palette = 13, + .baseTile = 0x01 +}; + +/*static*/ void Blackout_InitDisplays(BgConfig *bgConfig) { + GfGfx_SetBanks(&Blackout_GraphicsBanks); + SetBothScreensModesAndDisable(&Blackout_GraphicsModes); + InitBgFromTemplate(bgConfig, GF_BG_LYR_MAIN_3, &Blackout_BgTemplate, GF_BG_TYPE_TEXT); + GfGfxLoader_GXLoadPal(NARC_GRAPHIC_FONT, NARC_font_narc_0006_NCLR, GF_PAL_LOCATION_MAIN_BG, GF_PAL_SLOT_OFFSET_13, 0x20, HEAP_ID_FIELD); +} diff --git a/include/blackout.h b/include/blackout.h new file mode 100644 index 000000000..5a606a957 --- /dev/null +++ b/include/blackout.h @@ -0,0 +1,20 @@ +#ifndef POKEDIAMOND_BLACKOUT_H +#define POKEDIAMOND_BLACKOUT_H + +#include "global.h" +#include "field_system.h" +#include "message_format.h" +#include "msgdata.h" +#include "task.h" + +typedef struct BlackoutScreenEnvironment { + s32 state; + FieldSystem *fieldSystem; + BgConfig *bgConfig; + Window window; + MsgData *msgData; + MessageFormat *msgFmt; +} BlackoutScreenEnvironment; + + +#endif //POKEDIAMOND_BLACKOUT_H From 72bdeab878b3a66512cde798adce02b57c06a302 Mon Sep 17 00:00:00 2001 From: red031000 Date: Thu, 14 Dec 2023 15:35:37 +0000 Subject: [PATCH 2/9] Blackout_DrawMessage --- arm9/arm9.lsf | 2 +- arm9/asm/blackout_asm.s | 84 +-------------- arm9/asm/unk_0201B1A8.s | 2 +- arm9/asm/unk_02022318.s | 2 +- arm9/asm/unk_02035068.s | 2 +- arm9/asm/unk_020484A8.s | 2 +- arm9/asm/unk_02053750.s | 12 +-- arm9/asm/unk_0206C700.s | 14 +-- arm9/asm/unk_0206DE24.s | 6 +- arm9/asm/unk_0206F3FC.s | 12 +-- arm9/asm/unk_02073710.s | 4 +- arm9/asm/unk_020772F0.s | 30 +++--- arm9/asm/unk_02079C70.s | 12 +-- arm9/asm/unk_0207C328.s | 4 +- arm9/asm/unk_0207EF6C.s | 2 +- arm9/asm/unk_020859C0.s | 16 +-- arm9/asm/unk_02086084.s | 8 +- arm9/asm/unk_02086414.s | 16 +-- arm9/asm/unk_02086FA8.s | 8 +- arm9/asm/unk_02089498.s | 8 +- arm9/asm/unk_02089960.s | 8 +- arm9/global.inc | 18 ++-- arm9/overlays/05/asm/ov05_021D74E0.s | 12 +-- arm9/overlays/05/asm/ov05_021DC0B8.s | 60 +++++------ arm9/overlays/05/asm/ov05_021E3444.s | 8 +- arm9/overlays/05/asm/ov05_021E8860.s | 8 +- arm9/overlays/05/asm/ov05_021E88E8.s | 38 +++---- arm9/overlays/05/asm/ov05_021F5518.s | 14 +-- arm9/overlays/06/asm/overlay_06.s | 30 +++--- arm9/overlays/07/asm/overlay_07.s | 16 +-- arm9/overlays/09/asm/overlay_09.s | 8 +- arm9/overlays/11/asm/ov11_0222D5C0_1.s | 36 +++---- arm9/overlays/11/asm/ov11_0222D5C0_3.s | 10 +- arm9/overlays/12/asm/overlay_12.s | 84 +++++++-------- arm9/overlays/14/asm/overlay_14.s | 12 +-- arm9/overlays/15/asm/overlay_15.s | 10 +- arm9/overlays/16/asm/overlay_16.s | 20 ++-- arm9/overlays/17/asm/overlay_17.s | 40 +++---- arm9/overlays/18/asm/overlay_18.s | 66 ++++++------ arm9/overlays/20/asm/ov20_02252C5C.s | 4 +- arm9/overlays/51/asm/overlay_51.s | 18 ++-- arm9/overlays/53/asm/overlay_53.s | 10 +- arm9/overlays/54/asm/overlay_54.s | 10 +- arm9/overlays/55/asm/overlay_55.s | 16 +-- arm9/overlays/56/asm/overlay_56.s | 22 ++-- arm9/overlays/57/asm/overlay_57.s | 12 +-- arm9/overlays/58/asm/overlay_58.s | 10 +- arm9/overlays/59/src/ov59_Intro.c | 123 +++++++++++----------- arm9/overlays/59/src/ov59_TV.c | 35 +++--- arm9/overlays/60/asm/overlay_60.s | 12 +-- arm9/overlays/61/asm/overlay_61.s | 12 +-- arm9/overlays/62/asm/overlay_62.s | 40 +++---- arm9/overlays/63/asm/ov63_021D74E0.s | 78 +++++++------- arm9/overlays/63/asm/ov63_021D8890.s | 60 +++++------ arm9/overlays/63/asm/ov63_021DA640.s | 2 +- arm9/overlays/63/asm/ov63_021DAE5C.s | 4 +- arm9/overlays/64/asm/overlay_64.s | 12 +-- arm9/overlays/65/asm/overlay_65.s | 28 ++--- arm9/overlays/66/asm/overlay_66.s | 14 +-- arm9/overlays/67/asm/overlay_67.s | 12 +-- arm9/overlays/68/asm/overlay_68.s | 12 +-- arm9/overlays/69/asm/overlay_69.s | 6 +- arm9/overlays/70/asm/overlay_70.s | 4 +- arm9/overlays/71/asm/overlay_71.s | 18 ++-- arm9/overlays/73/asm/overlay_73.s | 36 +++---- arm9/overlays/74/asm/overlay_74.s | 12 +-- arm9/overlays/75/asm/overlay_75.s | 14 +-- arm9/overlays/76/asm/overlay_76.s | 10 +- arm9/overlays/77/asm/overlay_77.s | 26 ++--- arm9/overlays/78/asm/overlay_78.s | 8 +- arm9/overlays/80/asm/overlay_80.s | 54 +++++----- arm9/overlays/81/asm/overlay_81.s | 58 +++++----- arm9/overlays/82/asm/overlay_82.s | 26 ++--- arm9/overlays/83/asm/overlay_83.s | 60 +++++------ arm9/overlays/84/asm/overlay_84_thumb1.s | 12 +-- arm9/overlays/84/asm/overlay_84_thumb2.s | 22 ++-- arm9/overlays/85/asm/overlay_85.s | 26 ++--- arm9/overlays/86/asm/overlay_86.s | 8 +- arm9/src/bg_window.c | 44 ++++---- arm9/src/blackout_src.c | 42 +++++++- arm9/src/communication_error.c | 15 +-- arm9/src/error_message_reset.c | 17 +-- arm9/src/{GX_layers.c => gf_gfx_planes.c} | 50 ++++----- arm9/src/render_window.c | 2 +- arm9/src/save_data_read_error.c | 29 ++--- arm9/src/save_data_write_error.c | 15 +-- arm9/src/unk_0204AF24.c | 5 +- arm9/src/wfc_user_info_warning.c | 33 +++--- include/GX_layers.h | 45 -------- include/bg_window.h | 4 +- include/constants/rgb.h | 11 ++ include/gf_gfx_planes.h | 45 ++++++++ 92 files changed, 1013 insertions(+), 1034 deletions(-) rename arm9/src/{GX_layers.c => gf_gfx_planes.c} (53%) delete mode 100644 include/GX_layers.h create mode 100644 include/constants/rgb.h create mode 100644 include/gf_gfx_planes.h diff --git a/arm9/arm9.lsf b/arm9/arm9.lsf index 6dc99f735..9731395c8 100644 --- a/arm9/arm9.lsf +++ b/arm9/arm9.lsf @@ -70,7 +70,7 @@ Static arm9 Object unk_0201CC08.o Object unk_0201D040.o Object unk_0201E00C.o - Object GX_layers.o + Object gf_gfx_planes.o Object camera.o Object unk_0201F06C.o Object unk_020208B8.o diff --git a/arm9/asm/blackout_asm.s b/arm9/asm/blackout_asm.s index cabf995a2..5f2d404ed 100644 --- a/arm9/asm/blackout_asm.s +++ b/arm9/asm/blackout_asm.s @@ -2,88 +2,12 @@ .include "global.inc" .extern gSystem - .extern Blackout_WindowTemplate + .extern Blackout_DrawMessage .text - thumb_func_start sub_02048164 -sub_02048164: ; 0x02048164 - push {r4-r6, lr} - add r5, r0, #0x0 - add r6, r1, #0x0 - mov r0, #0xb - mov r1, #0x24 - bl AllocFromHeap - add r4, r0, #0x0 - bne _0204817A - bl GF_AssertFail -_0204817A: - add r0, r4, #0x0 - mov r1, #0x0 - mov r2, #0x24 - bl memset - mov r0, #0x0 - str r0, [r4, #0x0] - str r5, [r4, #0x4] - mov r0, #0xb - bl BgConfig_Alloc - str r0, [r4, #0x8] - bl Blackout_InitDisplays - mov r2, #0x52 - mov r0, #0x1 - mov r1, #0x1a - lsl r2, r2, #0x2 - mov r3, #0xb - bl NewMsgDataFromNarc - str r0, [r4, #0x1c] - mov r0, #0xb - bl MessageFormat_New - str r0, [r4, #0x20] - add r1, r4, #0x0 - ldr r0, [r4, #0x8] - ldr r2, _02048208 ; =Blackout_WindowTemplate - add r1, #0xc - bl AddWindow - add r0, r5, #0x0 - bl FieldSystem_GetSaveData - bl Save_PlayerData_GetProfileAddr - add r2, r0, #0x0 - ldr r0, [r4, #0x20] - mov r1, #0x0 - bl BufferPlayersName - ldr r0, [r5, #0x1c] - ldr r1, [r0, #0x0] - ldr r0, _0204820C ; =0x0000019E - cmp r1, r0 - bne _020481E6 - mov r2, #0x0 - add r0, r4, #0x0 - mov r1, #0x4 - add r3, r2, #0x0 - bl sub_020482F4 - b _020481F2 -_020481E6: - mov r2, #0x0 - add r0, r4, #0x0 - mov r1, #0x3 - add r3, r2, #0x0 - bl sub_020482F4 -_020481F2: - add r0, r4, #0x0 - add r0, #0xc - bl CopyWindowToVram - ldr r1, _02048210 ; =sub_02048214 - add r0, r6, #0x0 - add r2, r4, #0x0 - bl TaskManager_Call - pop {r4-r6, pc} - nop -_02048208: .word Blackout_WindowTemplate -_0204820C: .word 0x0000019E -_02048210: .word sub_02048214 - - thumb_func_start sub_02048214 -sub_02048214: ; 0x02048214 + thumb_func_start Task_ShowPrintedBlackoutMessage +Task_ShowPrintedBlackoutMessage: ; 0x02048214 push {r3-r4, lr} sub sp, #0xc bl TaskManager_GetEnvironment @@ -333,7 +257,7 @@ _0204840C: bl SetBlendBrightness add r0, r6, #0x0 add r1, r5, #0x0 - bl sub_02048164 + bl Blackout_DrawMessage ldr r0, [r4, #0x0] add r0, r0, #0x1 str r0, [r4, #0x0] diff --git a/arm9/asm/unk_0201B1A8.s b/arm9/asm/unk_0201B1A8.s index 929c36bd5..20ac50a38 100644 --- a/arm9/asm/unk_0201B1A8.s +++ b/arm9/asm/unk_0201B1A8.s @@ -199,7 +199,7 @@ sub_0201B314: ; 0x0201B314 push {r3, lr} mov r0, #0x1 add r1, r0, #0x0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r0, _0201B380 ; =0x04000008 mov r1, #0x3 ldrh r2, [r0, #0x0] diff --git a/arm9/asm/unk_02022318.s b/arm9/asm/unk_02022318.s index 4bb798c04..098f068ac 100644 --- a/arm9/asm/unk_02022318.s +++ b/arm9/asm/unk_02022318.s @@ -99,7 +99,7 @@ sub_020223D4: ; 0x020223D4 push {r3, lr} mov r0, #0x1 add r1, r0, #0x0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r0, _02022438 ; =0x04000008 mov r1, #0x3 ldrh r2, [r0, #0x0] diff --git a/arm9/asm/unk_02035068.s b/arm9/asm/unk_02035068.s index d50c56e4c..3451fcc16 100644 --- a/arm9/asm/unk_02035068.s +++ b/arm9/asm/unk_02035068.s @@ -1406,7 +1406,7 @@ _02035B2C: str r2, [r0, r1] mov r0, #0x10 mov r1, #0x1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes add sp, #0xb4 pop {r4-r7, pc} .balign 4 diff --git a/arm9/asm/unk_020484A8.s b/arm9/asm/unk_020484A8.s index a2309dd09..81a5b8447 100644 --- a/arm9/asm/unk_020484A8.s +++ b/arm9/asm/unk_020484A8.s @@ -345,7 +345,7 @@ sub_02048764: ; 0x02048764 add r0, r1, #0x0 bl InitWindow ldr r0, _020487D4 ; =UNK_020F46B0 - bl GX_SetBanks + bl GfGfx_SetBanks ldr r2, _020487D8 ; =0x04000304 ldrh r1, [r2, #0x0] lsr r0, r2, #0xb diff --git a/arm9/asm/unk_02053750.s b/arm9/asm/unk_02053750.s index 742e548ae..f7226f6aa 100644 --- a/arm9/asm/unk_02053750.s +++ b/arm9/asm/unk_02053750.s @@ -308,10 +308,10 @@ _02053912: bl BG_LoadPlttData mov r0, #0x1 mov r1, #0x0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes mov r0, #0x2 mov r1, #0x0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes mov r1, #0x57 lsl r1, r1, #0x2 add r0, r4, #0x0 @@ -488,7 +488,7 @@ _02053A78: bge _02053B30 mov r0, #0x1 mov r1, #0x0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes mov r0, #0x6 lsl r0, r0, #0x6 ldr r1, [r4, r0] @@ -559,7 +559,7 @@ _02053B00: _02053B16: mov r0, #0x2 mov r1, #0x0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes mov r0, #0x62 lsl r0, r0, #0x2 ldr r0, [r4, r0] @@ -878,10 +878,10 @@ sub_02053D70: ; 0x02053D70 str r0, [r4, #0x0] mov r0, #0x10 mov r1, #0x1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0x10 mov r1, #0x1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes pop {r4, pc} thumb_func_start sub_02053D94 diff --git a/arm9/asm/unk_0206C700.s b/arm9/asm/unk_0206C700.s index 6b486315f..8c45f1a53 100644 --- a/arm9/asm/unk_0206C700.s +++ b/arm9/asm/unk_0206C700.s @@ -2237,7 +2237,7 @@ sub_0206D9B4: ; 0x0206D9B4 sub sp, #0xb8 add r5, r0, #0x0 add r4, r1, #0x0 - bl GX_DisableEngineALayers + bl GfGfx_DisableEngineAPlanes ldr r6, _0206DC28 ; =UNK_020F8354 add r3, sp, #0x3c mov r2, #0x5 @@ -2247,7 +2247,7 @@ _0206D9C6: sub r2, r2, #0x1 bne _0206D9C6 add r0, sp, #0x3c - bl GX_SetBanks + bl GfGfx_SetBanks mov r1, #0x6 mov r2, #0x2 mov r0, #0x0 @@ -2323,7 +2323,7 @@ _0206DA26: orr r2, r0 strh r2, [r1, #0x0] add r1, r0, #0x0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r6, _0206DC38 ; =UNK_020F8338 add r3, sp, #0x10 ldmia r6!, {r0-r1} @@ -2507,10 +2507,10 @@ _0206DA26: mov r1, #0xa0 add r0, #0x75 strb r1, [r0, #0x0] - bl GX_BothDispOn + bl GfGfx_BothDispOn mov r0, #0x10 mov r1, #0x1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r0, _0206DC44 ; =sub_0206DD08 add r1, r5, #0x0 bl Main_SetVBlankIntrCB @@ -2532,10 +2532,10 @@ sub_0206DC48: ; 0x0206DC48 add r4, r0, #0x0 mov r0, #0x1 mov r1, #0x0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0x2 mov r1, #0x0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes add r0, r4, #0x0 mov r1, #0x1 bl FreeBgTilemapBuffer diff --git a/arm9/asm/unk_0206DE24.s b/arm9/asm/unk_0206DE24.s index 44546b84f..0fdc25845 100644 --- a/arm9/asm/unk_0206DE24.s +++ b/arm9/asm/unk_0206DE24.s @@ -9,8 +9,8 @@ thumb_func_start sub_0206DE24 sub_0206DE24: ; 0x0206DE24 push {r3, lr} - bl GX_DisableEngineALayers - bl GX_DisableEngineBLayers + bl GfGfx_DisableEngineAPlanes + bl GfGfx_DisableEngineBPlanes mov r2, #0x1 lsl r2, r2, #0x1a ldr r1, [r2, #0x0] @@ -69,7 +69,7 @@ sub_0206DE94: ; 0x0206DE94 push {r3, lr} mov r0, #0x1 add r1, r0, #0x0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r0, _0206DF00 ; =0x04000008 mov r1, #0x3 ldrh r2, [r0, #0x0] diff --git a/arm9/asm/unk_0206F3FC.s b/arm9/asm/unk_0206F3FC.s index 5458f8191..685ccf73e 100644 --- a/arm9/asm/unk_0206F3FC.s +++ b/arm9/asm/unk_0206F3FC.s @@ -124,8 +124,8 @@ sub_0206F3FC: ; 0x0206F3FC add r1, r0, #0x0 bl Main_SetVBlankIntrCB bl sub_02015F1C - bl GX_DisableEngineALayers - bl GX_DisableEngineBLayers + bl GfGfx_DisableEngineAPlanes + bl GfGfx_DisableEngineBPlanes mov r0, #0x1 lsl r0, r0, #0x1a ldr r2, [r0, #0x0] @@ -289,7 +289,7 @@ _0206F564: bne _0206F582 mov r0, #0x1 mov r1, #0x0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes _0206F582: ldr r0, _0206F5A8 ; =sub_0206FB58 add r1, r4, #0x0 @@ -1064,7 +1064,7 @@ _0206FB8A: sub r2, r2, #0x1 bne _0206FB8A add r0, sp, #0x0 - bl GX_SetBanks + bl GfGfx_SetBanks add sp, #0x28 pop {r4, pc} .balign 4 @@ -1213,10 +1213,10 @@ sub_0206FCD4: ; 0x0206FCD4 add r4, r0, #0x0 mov r0, #0x1f mov r1, #0x0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0x13 mov r1, #0x0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes add r0, r4, #0x0 mov r1, #0x5 bl FreeBgTilemapBuffer diff --git a/arm9/asm/unk_02073710.s b/arm9/asm/unk_02073710.s index cf1510112..4abcbb68b 100644 --- a/arm9/asm/unk_02073710.s +++ b/arm9/asm/unk_02073710.s @@ -129,10 +129,10 @@ sub_02073710: ; 0x02073710 add r4, r0, #0x0 mov r0, #0x10 mov r1, #0x1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0x10 mov r1, #0x1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes mov r0, #0x20 mov r1, #0xc bl sub_0201C24C diff --git a/arm9/asm/unk_020772F0.s b/arm9/asm/unk_020772F0.s index 01e2e1ecb..570a33a18 100644 --- a/arm9/asm/unk_020772F0.s +++ b/arm9/asm/unk_020772F0.s @@ -714,8 +714,8 @@ _020772FE: add r1, r0, #0x0 bl Main_SetVBlankIntrCB bl sub_02015F1C - bl GX_DisableEngineALayers - bl GX_DisableEngineBLayers + bl GfGfx_DisableEngineAPlanes + bl GfGfx_DisableEngineBPlanes mov r2, #0x1 lsl r2, r2, #0x1a ldr r1, [r2, #0x0] @@ -846,7 +846,7 @@ _020772FE: ldr r0, _020774A8 ; =gSystem + 0x60 mov r1, #0x1 strb r1, [r0, #0x5] - bl GX_SwapDisplay + bl GfGfx_SwapDisplay ldr r0, [r5, #0x0] add r0, r0, #0x1 str r0, [r5, #0x0] @@ -1587,7 +1587,7 @@ _02077A0C: ldr r0, _02077A80 ; =gSystem + 0x60 mov r1, #0x0 strb r1, [r0, #0x5] - bl GX_SwapDisplay + bl GfGfx_SwapDisplay mov r0, #0x1 add sp, #0x14 pop {r4-r7, pc} @@ -1697,7 +1697,7 @@ _02077B2E: sub r2, r2, #0x1 bne _02077B2E add r0, sp, #0x0 - bl GX_SetBanks + bl GfGfx_SetBanks add sp, #0x28 pop {r4, pc} .balign 4 @@ -1855,32 +1855,32 @@ sub_02077C84: ; 0x02077C84 lsl r1, r4, #0x18 mov r0, #0x1 lsr r1, r1, #0x18 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes lsl r1, r4, #0x18 mov r0, #0x2 lsr r1, r1, #0x18 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes lsl r1, r4, #0x18 mov r0, #0x4 lsr r1, r1, #0x18 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0x8 mov r1, #0x0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes lsl r1, r4, #0x18 mov r0, #0x10 lsr r1, r1, #0x18 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes lsl r1, r4, #0x18 mov r0, #0x1 lsr r1, r1, #0x18 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes mov r0, #0x2 mov r1, #0x0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes mov r0, #0x10 mov r1, #0x0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes pop {r4, pc} thumb_func_start sub_02077CD4 @@ -2875,10 +2875,10 @@ _020784FA: bl sub_02078530 mov r0, #0x10 mov r1, #0x1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0x10 mov r1, #0x1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes add sp, #0x5c pop {r4-r7, pc} nop diff --git a/arm9/asm/unk_02079C70.s b/arm9/asm/unk_02079C70.s index 83493879b..d0f0334ff 100644 --- a/arm9/asm/unk_02079C70.s +++ b/arm9/asm/unk_02079C70.s @@ -61,8 +61,8 @@ sub_02079C7C: ; 0x02079C7C add r1, r0, #0x0 bl Main_SetVBlankIntrCB bl sub_02015F1C - bl GX_DisableEngineALayers - bl GX_DisableEngineBLayers + bl GfGfx_DisableEngineAPlanes + bl GfGfx_DisableEngineBPlanes mov r1, #0x1 lsl r1, r1, #0x1a ldr r0, [r1, #0x0] @@ -157,7 +157,7 @@ sub_02079C7C: ; 0x02079C7C ldr r0, _02079DB0 ; =sub_02079F24 add r1, r5, #0x0 bl Main_SetVBlankIntrCB - bl GX_BothDispOn + bl GfGfx_BothDispOn mov r1, #0x0 mov r0, #0x3d add r2, r1, #0x0 @@ -381,7 +381,7 @@ _02079F62: sub r2, r2, #0x1 bne _02079F62 add r0, sp, #0x0 - bl GX_SetBanks + bl GfGfx_SetBanks add sp, #0x28 pop {r4, pc} .balign 4 @@ -514,8 +514,8 @@ _0207A088: .word UNK_020FA634 sub_0207A08C: ; 0x0207A08C push {r4, lr} add r4, r0, #0x0 - bl GX_DisableEngineALayers - bl GX_DisableEngineBLayers + bl GfGfx_DisableEngineAPlanes + bl GfGfx_DisableEngineBPlanes add r0, r4, #0x0 mov r1, #0x5 bl FreeBgTilemapBuffer diff --git a/arm9/asm/unk_0207C328.s b/arm9/asm/unk_0207C328.s index 454fd8c1d..eb5cf33a3 100644 --- a/arm9/asm/unk_0207C328.s +++ b/arm9/asm/unk_0207C328.s @@ -274,10 +274,10 @@ sub_0207C328: ; 0x0207C328 add r4, r0, #0x0 mov r0, #0x10 mov r1, #0x1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0x10 mov r1, #0x1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes mov r0, #0x20 mov r1, #0x13 bl sub_0201C24C diff --git a/arm9/asm/unk_0207EF6C.s b/arm9/asm/unk_0207EF6C.s index a12bebdef..353184f9a 100644 --- a/arm9/asm/unk_0207EF6C.s +++ b/arm9/asm/unk_0207EF6C.s @@ -145,7 +145,7 @@ sub_0207EF6C: ; 0x0207EF6C str r0, [r1, #0x40] mov r0, #0x1 add r1, r0, #0x0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r1, _0207F004 ; =0x04000008 mov r0, #0x3 ldrh r2, [r1, #0x0] diff --git a/arm9/asm/unk_020859C0.s b/arm9/asm/unk_020859C0.s index 59fb20b2c..4c036745a 100644 --- a/arm9/asm/unk_020859C0.s +++ b/arm9/asm/unk_020859C0.s @@ -445,28 +445,28 @@ sub_02085C08: ; 0x02085C08 add r4, r0, #0x0 mov r0, #0x1 mov r1, #0x0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0x2 mov r1, #0x0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0x4 mov r1, #0x0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0x8 mov r1, #0x0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0x1 mov r1, #0x0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes mov r0, #0x2 mov r1, #0x0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes mov r0, #0x4 mov r1, #0x0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes mov r0, #0x8 mov r1, #0x0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes add r0, r4, #0x0 add r0, #0xe4 ldr r0, [r0, #0x0] diff --git a/arm9/asm/unk_02086084.s b/arm9/asm/unk_02086084.s index 60b64c930..de039e7df 100644 --- a/arm9/asm/unk_02086084.s +++ b/arm9/asm/unk_02086084.s @@ -171,16 +171,16 @@ sub_020861DC: ; 0x020861DC bl sub_020223BC mov r0, #0x1 mov r1, #0x0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0x2 mov r1, #0x0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0x3 mov r1, #0x0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0x4 mov r1, #0x0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes ldr r0, [r4, #0x8] mov r1, #0x0 bl PaletteData_FreeBuffers diff --git a/arm9/asm/unk_02086414.s b/arm9/asm/unk_02086414.s index cfd47860c..ce530f58b 100644 --- a/arm9/asm/unk_02086414.s +++ b/arm9/asm/unk_02086414.s @@ -97,8 +97,8 @@ UNK_020FD078: ; 0x020FD078 thumb_func_start sub_02086414 sub_02086414: ; 0x02086414 push {r3, lr} - bl GX_DisableEngineALayers - bl GX_DisableEngineBLayers + bl GfGfx_DisableEngineAPlanes + bl GfGfx_DisableEngineBPlanes mov r2, #0x1 lsl r2, r2, #0x1a ldr r1, [r2, #0x0] @@ -158,7 +158,7 @@ sub_02086488: ; 0x02086488 push {r3, lr} mov r0, #0x1 add r1, r0, #0x0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r0, _020864F4 ; =0x04000008 mov r1, #0x3 ldrh r2, [r0, #0x0] @@ -251,7 +251,7 @@ sub_0208654C: ; 0x0208654C push {r3-r5, lr} sub sp, #0xa8 add r4, r0, #0x0 - bl GX_DisableEngineALayers + bl GfGfx_DisableEngineAPlanes ldr r5, _02086650 ; =UNK_020FCEBC add r3, sp, #0x2c mov r2, #0x5 @@ -261,7 +261,7 @@ _0208655C: sub r2, r2, #0x1 bne _0208655C add r0, sp, #0x2c - bl GX_SetBanks + bl GfGfx_SetBanks mov r1, #0x6 mov r2, #0x2 mov r0, #0x0 @@ -337,11 +337,11 @@ _020865BC: orr r2, r0 strh r2, [r1, #0x0] add r1, r0, #0x0 - bl GX_EngineAToggleLayers - bl GX_BothDispOn + bl GfGfx_EngineATogglePlanes + bl GfGfx_BothDispOn mov r0, #0x10 mov r1, #0x1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r5, _02086660 ; =UNK_020FCE60 add r3, sp, #0x0 ldmia r5!, {r0-r1} diff --git a/arm9/asm/unk_02086FA8.s b/arm9/asm/unk_02086FA8.s index 483a2a871..3a7373b62 100644 --- a/arm9/asm/unk_02086FA8.s +++ b/arm9/asm/unk_02086FA8.s @@ -850,7 +850,7 @@ _02087636: bl sub_0200C61C mov r0, #0x2 mov r1, #0x0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r0, [r4, #0x64] add r0, r0, #0x1 str r0, [r4, #0x64] @@ -984,7 +984,7 @@ _0208774C: bne _02087810 mov r0, #0x2 mov r1, #0x1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes add r0, r4, #0x0 mov r1, #0x0 bl sub_02086F98 @@ -1105,7 +1105,7 @@ _02087844: bl sub_02086B70 mov r0, #0x2 mov r1, #0x0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r0, [r4, #0x64] add r0, r0, #0x1 str r0, [r4, #0x64] @@ -1232,7 +1232,7 @@ _0208794C: bl sub_02086F98 mov r0, #0x2 mov r1, #0x1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r0, [r4, #0x6c] mov r1, #0x0 bl sub_0200C644 diff --git a/arm9/asm/unk_02089498.s b/arm9/asm/unk_02089498.s index aa656566b..21c43832e 100644 --- a/arm9/asm/unk_02089498.s +++ b/arm9/asm/unk_02089498.s @@ -105,8 +105,8 @@ _020894FC: add r0, r6, #0x0 add r1, r0, #0x0 bl Main_SetHBlankIntrCB - bl GX_DisableEngineALayers - bl GX_DisableEngineBLayers + bl GfGfx_DisableEngineAPlanes + bl GfGfx_DisableEngineBPlanes mov r2, #0x1 lsl r2, r2, #0x1a ldr r1, [r2, #0x0] @@ -127,7 +127,7 @@ _020894FC: ldr r0, _020895EC ; =sub_02089610 add r1, r4, #0x0 bl Main_SetVBlankIntrCB - bl GX_BothDispOn + bl GfGfx_BothDispOn mov r0, #0x6 mov r1, #0x1 str r0, [sp, #0x0] @@ -225,7 +225,7 @@ _02089628: sub r2, r2, #0x1 bne _02089628 add r0, sp, #0x34 - bl GX_SetBanks + bl GfGfx_SetBanks ldr r0, [r4, #0x0] bl BgConfig_Alloc add r3, sp, #0x24 diff --git a/arm9/asm/unk_02089960.s b/arm9/asm/unk_02089960.s index 00223fee8..50f96c02a 100644 --- a/arm9/asm/unk_02089960.s +++ b/arm9/asm/unk_02089960.s @@ -87,8 +87,8 @@ _020899B8: add r0, r4, #0x0 add r1, r0, #0x0 bl Main_SetHBlankIntrCB - bl GX_DisableEngineALayers - bl GX_DisableEngineBLayers + bl GfGfx_DisableEngineAPlanes + bl GfGfx_DisableEngineBPlanes mov r2, #0x1 lsl r2, r2, #0x1a ldr r1, [r2, #0x0] @@ -106,7 +106,7 @@ _020899B8: bl sub_02089A6C add r0, r6, #0x0 bl sub_02089B80 - bl GX_BothDispOn + bl GfGfx_BothDispOn mov r0, #0x1 str r0, [r5, #0x0] b _02089A34 @@ -165,7 +165,7 @@ _02089A78: sub r2, r2, #0x1 bne _02089A78 add r0, sp, #0x34 - bl GX_SetBanks + bl GfGfx_SetBanks ldr r0, [r4, #0x0] bl BgConfig_Alloc add r3, sp, #0x24 diff --git a/arm9/global.inc b/arm9/global.inc index e449eb6b2..10b77aa3d 100644 --- a/arm9/global.inc +++ b/arm9/global.inc @@ -1230,15 +1230,15 @@ .extern sub_0201E230 .extern sub_0201E258 .extern sub_0201E28C -.extern GX_SetBanks -.extern GX_DisableEngineALayers -.extern GX_EngineAToggleLayers -.extern GX_SetEngineALayers -.extern GX_DisableEngineBLayers -.extern GX_EngineBToggleLayers -.extern GX_BothDispOn -.extern GX_SwapDisplay -.extern GX_GetEngineALayers +.extern GfGfx_SetBanks +.extern GfGfx_DisableEngineAPlanes +.extern GfGfx_EngineATogglePlanes +.extern GfGfx_EngineASetPlanes +.extern GfGfx_DisableEngineBPlanes +.extern GfGfx_EngineBTogglePlanes +.extern GfGfx_BothDispOn +.extern GfGfx_SwapDisplay +.extern GfGfx_EngineAGetPlanes .extern Camera_History_New .extern Camera_History_Delete .extern Camera_New diff --git a/arm9/overlays/05/asm/ov05_021D74E0.s b/arm9/overlays/05/asm/ov05_021D74E0.s index 5d6248c8f..63a44494f 100644 --- a/arm9/overlays/05/asm/ov05_021D74E0.s +++ b/arm9/overlays/05/asm/ov05_021D74E0.s @@ -99,7 +99,7 @@ _021D757A: bl sub_0201B2EC bl ov05_021D7BA0 bl ov05_021D7B38 - bl GX_SwapDisplay + bl GfGfx_SwapDisplay mov r0, #4 bl BgConfig_Alloc str r0, [r4, #8] @@ -584,7 +584,7 @@ _021D7A0A: sub r2, r2, #1 bne _021D7A0A add r0, sp, #0 - bl GX_SetBanks + bl GfGfx_SetBanks add sp, #0x28 pop {r4, pc} .balign 4, 0 @@ -710,7 +710,7 @@ ov05_021D7B10: ; 0x021D7B10 add r4, r0, #0 mov r0, #0xf mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes add r0, r4, #0 mov r1, #1 bl FreeBgTilemapBuffer @@ -942,7 +942,7 @@ ov05_021D7CF0: ; 0x021D7CF0 add r5, r0, #0 mov r0, #1 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r0, _021D7D44 ; =gG3dDepthBufferingMode ldr r0, [r0] lsl r1, r0, #1 @@ -1097,8 +1097,8 @@ ov05_021D7E4C: ; 0x021D7E4C add r4, r0, #0 mov r0, #1 add r1, r0, #0 - bl GX_EngineAToggleLayers - bl GX_BothDispOn + bl GfGfx_EngineATogglePlanes + bl GfGfx_BothDispOn bl ov05_021DBABC str r0, [r4, #0x40] bl ov05_021D7B64 diff --git a/arm9/overlays/05/asm/ov05_021DC0B8.s b/arm9/overlays/05/asm/ov05_021DC0B8.s index eb4dee361..4651eabee 100644 --- a/arm9/overlays/05/asm/ov05_021DC0B8.s +++ b/arm9/overlays/05/asm/ov05_021DC0B8.s @@ -32,7 +32,7 @@ _021DC0CC: str r0, [r4, #0x10] mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes add r0, r4, #0 pop {r3, r4, r5, pc} @@ -681,7 +681,7 @@ _021DC5A2: strh r0, [r1] mov r0, #4 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r0, [r4] add r0, #8 bl ov05_021DC4AC @@ -1252,7 +1252,7 @@ _021DCA04: beq _021DCA30 mov r0, #4 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r2, _021DCA40 ; =0x0400000C mov r1, #3 ldrh r3, [r2] @@ -1336,7 +1336,7 @@ ov05_021DCA94: ; 0x021DCA94 beq _021DCAD2 mov r0, #4 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r0, _021DCB5C ; =0x0400000C mov r2, #3 ldrh r3, [r0] @@ -1436,7 +1436,7 @@ ov05_021DCB6C: ; 0x021DCB6C beq _021DCBA2 mov r0, #4 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r0, _021DCBD4 ; =0x0400000C mov r2, #3 ldrh r3, [r0] @@ -1967,7 +1967,7 @@ ov05_021DCF68: ; 0x021DCF68 beq _021DD00A mov r0, #4 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r1, #0xc mov r0, #0x42 lsl r0, r0, #2 @@ -5337,7 +5337,7 @@ _021DE8EE: strh r0, [r1] mov r0, #4 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r0, _021DEA68 ; =0x00000F62 mov r1, #1 add sp, #0x10 @@ -5395,7 +5395,7 @@ _021DE9A0: strh r0, [r1] mov r0, #4 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r0, _021DEA68 ; =0x00000F62 mov r1, #3 add sp, #0x10 @@ -6061,7 +6061,7 @@ _021DEF00: strh r1, [r5, r0] mov r0, #4 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes b _021DF08A _021DEF10: mov r2, #8 @@ -6119,7 +6119,7 @@ _021DEF54: strh r1, [r5, r0] mov r0, #4 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes b _021DF08A _021DEF8A: mov r0, #6 @@ -6192,7 +6192,7 @@ _021DF008: mov r0, #4 strh r0, [r5, r1] mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes b _021DF08A _021DF01E: add r0, r4, #0 @@ -6425,7 +6425,7 @@ _021DF1EC: strh r1, [r5, r0] mov r0, #4 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes b _021DF366 _021DF1FC: mov r2, #0xa @@ -6480,7 +6480,7 @@ _021DF240: strh r1, [r5, r0] mov r0, #4 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes b _021DF366 _021DF270: mov r1, #6 @@ -6548,7 +6548,7 @@ _021DF2E2: mov r0, #4 strh r0, [r5, r1] mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes b _021DF366 _021DF2F8: add r0, r4, #0 @@ -7339,7 +7339,7 @@ _021DF934: str r1, [r0] mov r0, #4 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r0, _021DFAA0 ; =0x00000F62 mov r1, #1 strh r1, [r5, r0] @@ -8366,7 +8366,7 @@ _021E0180: strh r1, [r5, r0] mov r0, #4 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes b _021E02E8 _021E0190: mov r2, #1 @@ -8428,7 +8428,7 @@ _021E01EE: strh r1, [r5, r0] mov r0, #4 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes b _021E02E8 _021E0212: mov r0, #6 @@ -8479,7 +8479,7 @@ _021E025C: add r1, #0xc8 str r2, [r1] mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes b _021E02E8 _021E027A: add r0, r4, #0 @@ -8918,7 +8918,7 @@ _021E05D4: bl ov05_021DC6D4 mov r0, #4 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r0, _021E06F0 ; =0x00000F62 mov r1, #3 strh r1, [r5, r0] @@ -9452,7 +9452,7 @@ _021E0A02: strh r0, [r1] mov r0, #4 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r0, _021E0AC4 ; =0x00000F62 mov r1, #1 strh r1, [r4, r0] @@ -9484,7 +9484,7 @@ _021E0A52: strh r0, [r1] mov r0, #4 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r0, _021E0AC4 ; =0x00000F62 mov r1, #3 strh r1, [r4, r0] @@ -9562,7 +9562,7 @@ _021E0AF2: bl ov05_021DC6D4 mov r0, #4 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r0, _021E0B94 ; =0x00000F62 mov r1, #1 strh r1, [r4, r0] @@ -9587,7 +9587,7 @@ _021E0B34: bl ov05_021DC6D4 mov r0, #4 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r0, _021E0B94 ; =0x00000F62 mov r1, #3 strh r1, [r4, r0] @@ -9687,7 +9687,7 @@ _021E0BC6: bl ov05_021DC6D4 mov r0, #4 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r0, _021E0D1C ; =0x00000F62 mov r1, #1 add sp, #0x10 @@ -9738,7 +9738,7 @@ _021E0C6A: bl ov05_021DC6D4 mov r0, #4 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r0, _021E0D1C ; =0x00000F62 mov r1, #3 add sp, #0x10 @@ -9880,7 +9880,7 @@ _021E0D4E: bl ov05_021DC6D4 mov r0, #4 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r0, _021E0EA8 ; =0x00000F62 mov r1, #1 add sp, #0x10 @@ -9931,7 +9931,7 @@ _021E0DF2: bl ov05_021DC6D4 mov r0, #4 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r0, _021E0EA8 ; =0x00000F62 mov r1, #3 add sp, #0x10 @@ -10072,7 +10072,7 @@ _021E0F0A: bne _021E0F98 mov r0, #4 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes add r0, r5, #0 bl ov05_021E1290 ldr r0, _021E0FA0 ; =0x00000F62 @@ -10083,7 +10083,7 @@ _021E0F0A: _021E0F2C: mov r0, #4 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r0, _021E0FA0 ; =0x00000F62 mov r1, #3 add sp, #8 @@ -10116,7 +10116,7 @@ _021E0F3E: _021E0F70: mov r0, #4 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes add r0, r5, #0 bl ov05_021E11EC cmp r0, #1 diff --git a/arm9/overlays/05/asm/ov05_021E3444.s b/arm9/overlays/05/asm/ov05_021E3444.s index 634a48532..8dafbfcdb 100644 --- a/arm9/overlays/05/asm/ov05_021E3444.s +++ b/arm9/overlays/05/asm/ov05_021E3444.s @@ -1058,7 +1058,7 @@ ov05_021E3C14: ; 0x021E3C14 bl SetBothScreensModesAndDisable mov r0, #1 add r1, r0, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r3, _021E3D14 ; =ov05_021F74AC add r2, sp, #0x38 ldmia r3!, {r0, r1} @@ -1087,7 +1087,7 @@ ov05_021E3C14: ; 0x021E3C14 bl BgClearTilemapBufferAndCommit mov r0, #2 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r3, _021E3D18 ; =ov05_021F7490 add r2, sp, #0x1c ldmia r3!, {r0, r1} @@ -1116,7 +1116,7 @@ ov05_021E3C14: ; 0x021E3C14 bl BgClearTilemapBufferAndCommit mov r0, #4 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r3, _021E3D1C ; =ov05_021F7474 add r2, sp, #0 ldmia r3!, {r0, r1} @@ -1145,7 +1145,7 @@ ov05_021E3C14: ; 0x021E3C14 bl BgClearTilemapBufferAndCommit mov r0, #8 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes add r0, r5, #0 bl sub_0200CAB4 add sp, #0x64 diff --git a/arm9/overlays/05/asm/ov05_021E8860.s b/arm9/overlays/05/asm/ov05_021E8860.s index c90d533e6..c7a576e22 100644 --- a/arm9/overlays/05/asm/ov05_021E8860.s +++ b/arm9/overlays/05/asm/ov05_021E8860.s @@ -11,13 +11,13 @@ ov05_021E8860: ; 0x021E8860 add r4, r1, #0 mov r0, #2 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #4 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #8 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes bl GX_ResetBankForBG mov r0, #4 add r1, r0, #0 @@ -61,7 +61,7 @@ ov05_021E88C0: ; 0x021E88C0 bl GX_SetBankForBG mov r0, #0xe mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r1, [r4] mov r0, #4 bl FreeToHeapExplicit diff --git a/arm9/overlays/05/asm/ov05_021E88E8.s b/arm9/overlays/05/asm/ov05_021E88E8.s index 43f6833b7..1e8ff9ab2 100644 --- a/arm9/overlays/05/asm/ov05_021E88E8.s +++ b/arm9/overlays/05/asm/ov05_021E88E8.s @@ -1172,7 +1172,7 @@ _021E91D4: blt _021E91D4 mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r0, [r7] add r0, r0, #1 str r0, [r7] @@ -1572,7 +1572,7 @@ _021E9536: blt _021E9536 mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r0, [r6] add r0, r0, #1 str r0, [r6] @@ -1939,7 +1939,7 @@ _021E9844: blt _021E9844 mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r0, [r7] add r0, r0, #1 str r0, [r7] @@ -2395,7 +2395,7 @@ _021E9C02: blt _021E9C02 mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #4 mov r1, #1 bl AllocWindows @@ -3030,7 +3030,7 @@ _021EA110: bl sub_020200A0 mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r0, [r5] add r0, r0, #1 str r0, [r5] @@ -3367,7 +3367,7 @@ _021EA430: blt _021EA430 mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #4 mov r1, #1 bl AllocWindows @@ -3948,7 +3948,7 @@ _021EA8B2: bl sub_02020398 mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r0, [r4] add r0, r0, #1 str r0, [r4] @@ -4234,7 +4234,7 @@ _021EAB5A: blt _021EAB5A mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r0, [r6] add r0, r0, #1 str r0, [r6] @@ -4541,7 +4541,7 @@ _021EADDC: blt _021EADDC mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r0, [sp, #0x14] ldr r0, [r0] add r1, r0, #1 @@ -5035,7 +5035,7 @@ _021EB18E: bl sub_02020238 mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #4 bl ov05_021E4688 str r0, [r4, #4] @@ -5332,13 +5332,13 @@ _021EB484: bne _021EB484 mov r0, #2 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #4 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #8 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r0, [r4] add sp, #0xc add r0, r0, #1 @@ -5510,13 +5510,13 @@ _021EB5E4: bl memset mov r0, #2 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #4 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #8 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r0, [r4] add sp, #0xc add r0, r0, #1 @@ -5841,7 +5841,7 @@ _021EB86A: bl ov05_021E35EC mov r0, #8 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r0, [r5] add r0, r0, #1 str r0, [r5] @@ -5937,7 +5937,7 @@ _021EB8E8: bl sub_02020238 mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r2, #0x11 ldr r1, [r4] add r0, sp, #0x24 @@ -6591,7 +6591,7 @@ _021EBE60: bl sub_02020064 mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r0, [r5] add r0, r0, #1 str r0, [r5] diff --git a/arm9/overlays/05/asm/ov05_021F5518.s b/arm9/overlays/05/asm/ov05_021F5518.s index 5999288d4..863af52f8 100644 --- a/arm9/overlays/05/asm/ov05_021F5518.s +++ b/arm9/overlays/05/asm/ov05_021F5518.s @@ -28,7 +28,7 @@ ov05_021F5518: ; 0x021F5518 bl SetBgPriority mov r0, #4 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r0, _021F5560 ; =0x00000648 bl PlaySE add sp, #4 @@ -240,7 +240,7 @@ ov05_021F56B8: ; 0x021F56B8 strh r1, [r0] mov r0, #4 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r1, _021F5714 ; =0x0400000C mov r0, #3 ldrh r2, [r1] @@ -265,7 +265,7 @@ ov05_021F56B8: ; 0x021F56B8 bl BgFillTilemapBufferAndCommit mov r0, #4 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes add r0, r4, #0 bl ov05_021F569C add sp, #8 @@ -285,7 +285,7 @@ ov05_021F571C: ; 0x021F571C strh r1, [r0] mov r0, #8 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r1, _021F5778 ; =0x0400000E mov r0, #3 ldrh r2, [r1] @@ -309,7 +309,7 @@ ov05_021F571C: ; 0x021F571C bl BgFillTilemapBufferAndCommit mov r0, #8 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes add r0, r4, #0 bl ov05_021F569C add sp, #8 @@ -450,7 +450,7 @@ _021F5856: bl SetBgPriority mov r0, #4 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes b _021F5980 _021F5872: ldr r0, [r4] @@ -520,7 +520,7 @@ _021F58EE: beq _021F5980 mov r0, #4 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r0, _021F5984 ; =0x04000050 mov r1, #0 strh r1, [r0] diff --git a/arm9/overlays/06/asm/overlay_06.s b/arm9/overlays/06/asm/overlay_06.s index 5145cfe61..59cd9285d 100644 --- a/arm9/overlays/06/asm/overlay_06.s +++ b/arm9/overlays/06/asm/overlay_06.s @@ -126,7 +126,7 @@ _0223977A: sub r2, r2, #1 bne _0223977A add r0, sp, #0 - bl GX_SetBanks + bl GfGfx_SetBanks add sp, #0x28 pop {r4, pc} .align 2, 0 @@ -148,7 +148,7 @@ ov06_02239790: ; 0x02239790 bl SetBothScreensModesAndDisable mov r0, #1 add r1, r0, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r5, _022397F0 ; =0x0224F1D8 add r3, sp, #0 ldmia r5!, {r0, r1} @@ -225,7 +225,7 @@ ov06_02239840: ; 0x02239840 add r4, r1, #0 add r5, r0, #0 add r0, r4, #4 - bl GX_SetBanks + bl GfGfx_SetBanks ldr r0, [r4] ldr r0, [r0, #8] bl ov06_02239864 @@ -249,7 +249,7 @@ ov06_0223986C: ; 0x0223986C bl ov05_021D7A20 mov r0, #1 add r1, r0, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes pop {r3, pc} thumb_func_start ov06_0223987C @@ -8949,7 +8949,7 @@ _0223DA88: .word 0x00000241 ov06_0223DA8C: ; 0x0223DA8C push {r4, lr} add r4, r0, #0 - bl GX_GetEngineALayers + bl GfGfx_EngineAGetPlanes mov r1, #0x8e lsl r1, r1, #2 str r0, [r4, r1] @@ -8988,16 +8988,16 @@ ov06_0223DA8C: ; 0x0223DA8C bl SetBgPriority mov r0, #0 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #1 add r1, r0, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #2 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #3 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes pop {r4, pc} nop _0223DB10: .word 0x00000235 @@ -9028,7 +9028,7 @@ ov06_0223DB1C: ; 0x0223DB1C mov r0, #0x8e lsl r0, r0, #2 ldr r0, [r4, r0] - bl GX_SetEngineALayers + bl GfGfx_EngineASetPlanes pop {r4, pc} nop _0223DB58: .word 0x00000235 @@ -10997,7 +10997,7 @@ _0223EBA8: blo _0223EBA8 mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes pop {r3, r4, r5, r6, r7, pc} nop _0223EBCC: .word ov06_0224F370 @@ -27738,7 +27738,7 @@ ov06_02246F0C: ; 0x02246F0C strh r0, [r2, #4] mov r0, #8 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes add r2, r5, #0 add r0, r4, #0 mov r1, #2 @@ -27771,7 +27771,7 @@ ov06_02246F0C: ; 0x02246F0C str r0, [r5, r1] mov r0, #8 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes pop {r3, r4, r5, pc} .align 2, 0 _02246FB4: .word 0x0400000A @@ -27782,7 +27782,7 @@ ov06_02246FB8: ; 0x02246FB8 add r4, r0, #0 mov r0, #8 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0x1e lsl r0, r0, #4 ldr r0, [r4, r0] @@ -27809,7 +27809,7 @@ ov06_02246FB8: ; 0x02246FB8 bl sub_02054590 mov r0, #8 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes pop {r4, pc} nop _02247008: .word 0x04000008 diff --git a/arm9/overlays/07/asm/overlay_07.s b/arm9/overlays/07/asm/overlay_07.s index 8d9f321a7..02d395439 100644 --- a/arm9/overlays/07/asm/overlay_07.s +++ b/arm9/overlays/07/asm/overlay_07.s @@ -110,7 +110,7 @@ _02211F1E: sub r2, r2, #1 bne _02211F1E add r0, sp, #0 - bl GX_SetBanks + bl GfGfx_SetBanks add sp, #0x28 pop {r4, pc} .align 2, 0 @@ -126,8 +126,8 @@ ov07_02211F34: ; 0x02211F34 add r1, r0, #0 bl Main_SetVBlankIntrCB bl sub_02015F1C - bl GX_DisableEngineALayers - bl GX_DisableEngineBLayers + bl GfGfx_DisableEngineAPlanes + bl GfGfx_DisableEngineBPlanes mov r0, #1 lsl r0, r0, #0x1a ldr r2, [r0] @@ -1358,7 +1358,7 @@ ov07_02212968: ; 0x02212968 bne _022129AC mov r0, #2 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #1 lsl r0, r0, #0x1a add r3, r0, #0 @@ -1750,7 +1750,7 @@ ov07_02212C04: ; 0x02212C04 bl sub_0200BF60 mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes add sp, #0x38 pop {r3, r4, r5, r6, r7, pc} nop @@ -1966,7 +1966,7 @@ ov07_02212D98: ; 0x02212D98 bl BgClearTilemapBufferAndCommit mov r0, #2 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes add sp, #0x64 pop {r4, r5, pc} nop @@ -1981,7 +1981,7 @@ ov07_02212E64: ; 0x02212E64 add r4, r0, #0 mov r0, #0x1f mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r0, [r4, #0xc] mov r1, #3 bl FreeBgTilemapBuffer @@ -3269,7 +3269,7 @@ ov07_022138F8: ; 0x022138F8 add r4, r0, #0 mov r0, #0x1e mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r0, [r4, #0xc] mov r1, #3 bl FreeBgTilemapBuffer diff --git a/arm9/overlays/09/asm/overlay_09.s b/arm9/overlays/09/asm/overlay_09.s index ce91ce84a..08b45a96c 100644 --- a/arm9/overlays/09/asm/overlay_09.s +++ b/arm9/overlays/09/asm/overlay_09.s @@ -2143,7 +2143,7 @@ ov09_02212F5C: ; 0x02212F5C add r4, r0, #0 mov r0, #0x1f mov r1, #0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes add r0, r4, #0 mov r1, #4 bl FreeBgTilemapBuffer @@ -8759,7 +8759,7 @@ ov09_02216734: ; 0x02216734 bl ov09_02217750 mov r0, #0x10 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes pop {r4, pc} thumb_func_start ov09_02216770 @@ -13962,7 +13962,7 @@ ov09_02219198: ; 0x02219198 add r4, r0, #0 mov r0, #0x17 mov r1, #0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes add r0, r4, #0 mov r1, #4 bl FreeBgTilemapBuffer @@ -15495,7 +15495,7 @@ ov09_02219DC8: ; 0x02219DC8 bl ov09_0221A244 mov r0, #0x10 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes pop {r4, pc} .align 2, 0 diff --git a/arm9/overlays/11/asm/ov11_0222D5C0_1.s b/arm9/overlays/11/asm/ov11_0222D5C0_1.s index 2268a3cb1..aaf71557e 100644 --- a/arm9/overlays/11/asm/ov11_0222D5C0_1.s +++ b/arm9/overlays/11/asm/ov11_0222D5C0_1.s @@ -386,7 +386,7 @@ ov11_0222D88C: ; 0x0222D88C bl ov11_02258450 mov r0, #0x10 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes mov r0, #0x67 lsl r0, r0, #2 ldr r0, [r4, r0] @@ -427,10 +427,10 @@ ov11_0222D944: ; 0x0222D944 bl RemoveWindow mov r0, #1 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #2 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r0, [r4, #4] mov r1, #1 bl FreeBgTilemapBuffer @@ -499,7 +499,7 @@ _0222D99A: orr r2, r0 strh r2, [r1] add r1, r0, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes add r0, r5, #0 bl ov11_02230E44 add r4, r0, #0 @@ -602,13 +602,13 @@ _0222D99A: ldrh r2, [r0] bic r2, r1 strh r2, [r0] - bl GX_BothDispOn + bl GfGfx_BothDispOn mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0x10 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes ldr r0, _0222DB4C ; =ov11_0222F01C add r1, r5, #0 bl Main_SetVBlankIntrCB @@ -1420,7 +1420,7 @@ ov11_0222E264: ; 0x0222E264 sub sp, #0x9c add r5, r0, #0 add r4, r1, #0 - bl GX_DisableEngineALayers + bl GfGfx_DisableEngineAPlanes mov r0, #0 bl SetMasterBrightnessNeutral mov r0, #1 @@ -1434,7 +1434,7 @@ _0222E282: sub r2, r2, #1 bne _0222E282 add r0, sp, #0x20 - bl GX_SetBanks + bl GfGfx_SetBanks mov r1, #6 mov r2, #2 mov r0, #0 @@ -1517,7 +1517,7 @@ _0222E2F0: orr r2, r0 strh r2, [r1] add r1, r0, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes add r0, r4, #0 bl ov11_02258450 add r0, r5, #0 @@ -1622,13 +1622,13 @@ _0222E2F0: ldrh r2, [r0] bic r2, r1 strh r2, [r0] - bl GX_BothDispOn + bl GfGfx_BothDispOn mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0x10 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes ldr r0, _0222E46C ; =ov11_0222F01C add r1, r5, #0 bl Main_SetVBlankIntrCB @@ -1706,10 +1706,10 @@ ov11_0222E4E8: ; 0x0222E4E8 add r4, r0, #0 mov r0, #1 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #2 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes add r0, r4, #0 mov r1, #1 bl FreeBgTilemapBuffer @@ -2995,7 +2995,7 @@ ov11_0222EF50: ; 0x0222EF50 push {r3, lr} mov r0, #1 add r1, r0, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r0, _0222EFBC ; =0x04000008 mov r1, #3 ldrh r2, [r0] @@ -3127,7 +3127,7 @@ _0222F056: sub r2, r2, #1 bne _0222F056 add r0, sp, #0x28 - bl GX_SetBanks + bl GfGfx_SetBanks _0222F064: ldr r1, _0222F0B8 ; =0x000023FB ldrb r2, [r4, r1] @@ -3146,7 +3146,7 @@ _0222F07A: sub r2, r2, #1 bne _0222F07A add r0, sp, #0 - bl GX_SetBanks + bl GfGfx_SetBanks _0222F088: add r0, r4, #0 add r0, #0x88 diff --git a/arm9/overlays/11/asm/ov11_0222D5C0_3.s b/arm9/overlays/11/asm/ov11_0222D5C0_3.s index de69a7a8f..38ff0d6ad 100644 --- a/arm9/overlays/11/asm/ov11_0222D5C0_3.s +++ b/arm9/overlays/11/asm/ov11_0222D5C0_3.s @@ -49,7 +49,7 @@ ov11_0222F29C: ; 0x0222F29C str r0, [r5, #8] add r0, r5, #0 bl sub_0206BFF0 - bl GX_DisableEngineALayers + bl GfGfx_DisableEngineAPlanes ldr r6, _0222F4C8 ; =ov11_0225DA40 add r3, sp, #0x40 mov r2, #5 @@ -59,7 +59,7 @@ _0222F30E: sub r2, r2, #1 bne _0222F30E add r0, sp, #0x40 - bl GX_SetBanks + bl GfGfx_SetBanks mov r1, #6 mov r2, #2 mov r0, #0 @@ -165,10 +165,10 @@ _0222F30E: add r2, r1, #0 add r3, r1, #0 bl PaletteData_FillPalette - bl GX_BothDispOn + bl GfGfx_BothDispOn mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0x13 str r0, [sp] mov r0, #0x1b @@ -813,7 +813,7 @@ ov11_0222F93C: ; 0x0222F93C bl WindowArray_Delete mov r0, #2 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r0, [r4, #4] mov r1, #1 bl FreeBgTilemapBuffer diff --git a/arm9/overlays/12/asm/overlay_12.s b/arm9/overlays/12/asm/overlay_12.s index c9b60f30b..13f314d1b 100644 --- a/arm9/overlays/12/asm/overlay_12.s +++ b/arm9/overlays/12/asm/overlay_12.s @@ -12,8 +12,8 @@ ov12_0222D5C0: ; 0x0222D5C0 add r1, r0, #0 bl Main_SetVBlankIntrCB bl sub_02015F1C - bl GX_DisableEngineALayers - bl GX_DisableEngineBLayers + bl GfGfx_DisableEngineAPlanes + bl GfGfx_DisableEngineBPlanes mov r1, #1 lsl r1, r1, #0x1a ldr r0, [r1] @@ -255,13 +255,13 @@ _0222D7BC: ldr r0, _0222D88C ; =0x00000824 mov r1, #1 strb r1, [r4, r0] - bl GX_BothDispOn + bl GfGfx_BothDispOn mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0x10 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes ldr r1, _0222D890 ; =0x0000046F mov r0, #6 mov r2, #1 @@ -448,10 +448,10 @@ ov12_0222D9B0: ; 0x0222D9B0 bl RemoveWindow mov r0, #1 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #2 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r0, [r4, #0x30] mov r1, #1 bl FreeBgTilemapBuffer @@ -589,7 +589,7 @@ ov12_0222DB50: ; 0x0222DB50 push {r4, r5, lr} sub sp, #0x8c add r4, r0, #0 - bl GX_DisableEngineALayers + bl GfGfx_DisableEngineAPlanes ldr r5, _0222DC70 ; =ov12_022449E8 add r3, sp, #0x10 mov r2, #5 @@ -599,7 +599,7 @@ _0222DB60: sub r2, r2, #1 bne _0222DB60 add r0, sp, #0x10 - bl GX_SetBanks + bl GfGfx_SetBanks mov r1, #6 mov r2, #2 mov r0, #0 @@ -706,7 +706,7 @@ _0222DBC0: strh r0, [r1] mov r0, #1 add r1, r0, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes add r0, r4, #0 bl ov12_022319A4 add sp, #0x8c @@ -1079,7 +1079,7 @@ ov12_0222DF30: ; 0x0222DF30 bne _0222DFBE mov r0, #4 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes add sp, #0x10 pop {r3, r4, r5, pc} _0222DF9A: @@ -3147,8 +3147,8 @@ ov12_0222EF04: ; 0x0222EF04 add r1, r0, #0 bl Main_SetVBlankIntrCB bl sub_02015F1C - bl GX_DisableEngineALayers - bl GX_DisableEngineBLayers + bl GfGfx_DisableEngineAPlanes + bl GfGfx_DisableEngineBPlanes mov r1, #1 lsl r1, r1, #0x1a ldr r0, [r1] @@ -3357,13 +3357,13 @@ ov12_0222EF04: ; 0x0222EF04 ldr r0, _0222F188 ; =0x000004F8 mov r1, #1 strb r1, [r5, r0] - bl GX_BothDispOn + bl GfGfx_BothDispOn mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0x10 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes mov r0, #0 bl sub_0200415C ldr r1, _0222F18C ; =0x0000046F @@ -3604,10 +3604,10 @@ ov12_0222F324: ; 0x0222F324 bl RemoveWindow mov r0, #1 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #2 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r0, [r4, #0x30] mov r1, #1 bl FreeBgTilemapBuffer @@ -3818,7 +3818,7 @@ ov12_0222F548: ; 0x0222F548 push {r3, r4, r5, lr} sub sp, #0xa8 add r4, r0, #0 - bl GX_DisableEngineALayers + bl GfGfx_DisableEngineAPlanes ldr r5, _0222F6A0 ; =ov12_02244B1C add r3, sp, #0x2c mov r2, #5 @@ -3828,7 +3828,7 @@ _0222F558: sub r2, r2, #1 bne _0222F558 add r0, sp, #0x2c - bl GX_SetBanks + bl GfGfx_SetBanks mov r1, #6 mov r2, #2 mov r0, #0 @@ -3934,7 +3934,7 @@ _0222F5B8: orr r2, r0 strh r2, [r1] add r1, r0, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r5, _0222F6B0 ; =ov12_02244AE0 add r3, sp, #0 ldmia r5!, {r0, r1} @@ -4987,8 +4987,8 @@ ov12_0222FE4C: ; 0x0222FE4C add r1, r0, #0 bl Main_SetVBlankIntrCB bl sub_02015F1C - bl GX_DisableEngineALayers - bl GX_DisableEngineBLayers + bl GfGfx_DisableEngineAPlanes + bl GfGfx_DisableEngineBPlanes mov r1, #1 lsl r1, r1, #0x1a ldr r0, [r1] @@ -5219,13 +5219,13 @@ ov12_0222FE4C: ; 0x0222FE4C ldr r0, _02230110 ; =0x00001154 mov r1, #1 strb r1, [r5, r0] - bl GX_BothDispOn + bl GfGfx_BothDispOn mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0x10 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes ldr r1, _02230114 ; =0x0000046F mov r0, #6 mov r2, #1 @@ -5442,10 +5442,10 @@ _02230296: blt _02230296 mov r0, #1 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #2 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r0, [r4, #0x74] mov r1, #1 bl FreeBgTilemapBuffer @@ -5764,7 +5764,7 @@ ov12_02230574: ; 0x02230574 push {r4, r5, lr} sub sp, #0x8c add r4, r0, #0 - bl GX_DisableEngineALayers + bl GfGfx_DisableEngineAPlanes ldr r5, _02230694 ; =ov12_02244C38 add r3, sp, #0x10 mov r2, #5 @@ -5774,7 +5774,7 @@ _02230584: sub r2, r2, #1 bne _02230584 add r0, sp, #0x10 - bl GX_SetBanks + bl GfGfx_SetBanks mov r1, #6 mov r2, #2 mov r0, #0 @@ -5881,7 +5881,7 @@ _022305E4: strh r0, [r1] mov r0, #1 add r1, r0, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes add r0, r4, #0 bl ov12_0223B41C add sp, #0x8c @@ -7479,7 +7479,7 @@ ov12_022312F4: ; 0x022312F4 push {r3, lr} mov r0, #1 add r1, r0, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r0, _02231360 ; =0x04000008 mov r1, #3 ldrh r2, [r0] @@ -41074,8 +41074,8 @@ ov12_02241210: ; 0x02241210 add r1, r0, #0 bl Main_SetVBlankIntrCB bl sub_02015F1C - bl GX_DisableEngineALayers - bl GX_DisableEngineBLayers + bl GfGfx_DisableEngineAPlanes + bl GfGfx_DisableEngineBPlanes mov r1, #1 lsl r1, r1, #0x1a ldr r0, [r1] @@ -41276,13 +41276,13 @@ ov12_02241210: ; 0x02241210 mov r1, #1 lsl r0, r0, #4 strb r1, [r5, r0] - bl GX_BothDispOn + bl GfGfx_BothDispOn mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0x10 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes ldr r1, _0224147C ; =0x0000046F mov r0, #6 mov r2, #1 @@ -41479,10 +41479,10 @@ _022415D4: blt _022415D4 mov r0, #1 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #2 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r0, [r4, #0x30] mov r1, #1 bl FreeBgTilemapBuffer @@ -41754,7 +41754,7 @@ ov12_02241864: ; 0x02241864 push {r3, r4, r5, lr} sub sp, #0xa8 add r4, r0, #0 - bl GX_DisableEngineALayers + bl GfGfx_DisableEngineAPlanes ldr r5, _022419BC ; =ov12_0224656C add r3, sp, #0x2c mov r2, #5 @@ -41764,7 +41764,7 @@ _02241874: sub r2, r2, #1 bne _02241874 add r0, sp, #0x2c - bl GX_SetBanks + bl GfGfx_SetBanks mov r1, #6 mov r2, #2 mov r0, #0 @@ -41870,7 +41870,7 @@ _022418D4: orr r2, r0 strh r2, [r1] add r1, r0, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r5, _022419CC ; =ov12_02246530 add r3, sp, #0 ldmia r5!, {r0, r1} diff --git a/arm9/overlays/14/asm/overlay_14.s b/arm9/overlays/14/asm/overlay_14.s index 3a13a5d5c..a865f237c 100644 --- a/arm9/overlays/14/asm/overlay_14.s +++ b/arm9/overlays/14/asm/overlay_14.s @@ -10495,8 +10495,8 @@ _021DC79C: mov r5, #1 bl Main_SetVBlankIntrCB bl sub_02015F1C - bl GX_DisableEngineALayers - bl GX_DisableEngineBLayers + bl GfGfx_DisableEngineAPlanes + bl GfGfx_DisableEngineBPlanes mov r1, #1 lsl r1, r1, #0x1a ldr r0, [r1] @@ -12835,7 +12835,7 @@ ov14_021DDA38: ; 0x021DDA38 add r5, r0, #0 ldr r0, _021DDB20 ; =ov14_021E63A4 add r4, r1, #0 - bl GX_SetBanks + bl GfGfx_SetBanks ldr r2, _021DDB24 ; =0x04000304 ldrh r1, [r2] lsr r0, r2, #0xb @@ -13061,10 +13061,10 @@ _021DDBF2: _021DDC48: mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0x10 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes bl GX_DispOn add sp, #0x10 pop {r3, r4, r5, pc} @@ -13083,7 +13083,7 @@ ov14_021DDC78: ; 0x021DDC78 bl G3X_InitMtxStack mov r0, #1 add r1, r0, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r0, _021DDCDC ; =0x04000008 mov r1, #3 ldrh r2, [r0] diff --git a/arm9/overlays/15/asm/overlay_15.s b/arm9/overlays/15/asm/overlay_15.s index f3b249ec3..f6313aa15 100644 --- a/arm9/overlays/15/asm/overlay_15.s +++ b/arm9/overlays/15/asm/overlay_15.s @@ -2817,8 +2817,8 @@ ov15_021D8998: ; 0x021D8998 ov15_021D89C0: ; 0x021D89C0 push {r3, r4, r5, lr} add r4, r1, #0 - bl GX_DisableEngineALayers - bl GX_DisableEngineBLayers + bl GfGfx_DisableEngineAPlanes + bl GfGfx_DisableEngineBPlanes mov r1, #1 lsl r1, r1, #0x1a ldr r0, [r1] @@ -2903,10 +2903,10 @@ ov15_021D89C0: ; 0x021D89C0 bl ov15_021DAEB4 mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0x10 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes bl GX_DispOn add r0, r4, #0 bl ov15_021D8998 @@ -3110,7 +3110,7 @@ ov15_021D8C30: ; 0x021D8C30 add r2, r0, #0 bl GX_SetGraphicsMode ldr r0, _021D8C98 ; =0x021DB964 - bl GX_SetBanks + bl GfGfx_SetBanks ldr r0, _021D8C9C ; =0x021DB8C8 bl SetBothScreensModesAndDisable mov r1, #0 diff --git a/arm9/overlays/16/asm/overlay_16.s b/arm9/overlays/16/asm/overlay_16.s index 16870d66d..3a31d4f58 100644 --- a/arm9/overlays/16/asm/overlay_16.s +++ b/arm9/overlays/16/asm/overlay_16.s @@ -1984,7 +1984,7 @@ _021D840E: sub r2, r2, #1 bne _021D840E add r0, sp, #0 - bl GX_SetBanks + bl GfGfx_SetBanks add sp, #0x28 pop {r4, pc} .align 2, 0 @@ -2207,10 +2207,10 @@ ov16_021D8534: ; 0x021D8534 str r0, [r5, r1] mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0x10 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes mov r0, #0x4f lsl r0, r0, #2 ldr r0, [r5, r0] @@ -3372,7 +3372,7 @@ ov16_021D8DC0: ; 0x021D8DC0 bl SetBgPriority mov r0, #1 add r1, r0, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r6, _021D8F1C ; =0x021FF4D8 add r3, sp, #0x54 ldmia r6!, {r0, r1} @@ -25839,7 +25839,7 @@ _021E3288: _021E329E: mov r0, #2 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r0, _021E32D0 ; =0x00000804 ldr r0, [r5, r0] bl FreeToHeap @@ -27619,7 +27619,7 @@ ov16_021E4094: ; 0x021E4094 add r0, r0, #4 str r1, [r6, r0] mov r0, #2 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes add r0, r6, #0 add r0, #0xc4 ldr r0, [r0] @@ -27658,7 +27658,7 @@ ov16_021E40D4: ; 0x021E40D4 bl G2x_SetBlendAlpha_ mov r0, #2 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes add r0, r6, #0 add r0, #0xc4 ldr r0, [r0] @@ -27725,7 +27725,7 @@ _021E4158: _021E4162: mov r0, #2 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0x81 add r1, r4, #0 lsl r0, r0, #4 @@ -27773,7 +27773,7 @@ _021E417E: bne _021E41CC mov r0, #2 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes pop {r3, r4, r5, r6, r7, pc} _021E41CC: add r0, r5, #0 @@ -51397,7 +51397,7 @@ ov16_021EF218: ; 0x021EF218 bl SetBgPriority mov r0, #1 add r1, r0, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes add r0, r5, #0 mov r1, #0 bl FreeBgTilemapBuffer diff --git a/arm9/overlays/17/asm/overlay_17.s b/arm9/overlays/17/asm/overlay_17.s index 976d5cb27..f46a2fa53 100644 --- a/arm9/overlays/17/asm/overlay_17.s +++ b/arm9/overlays/17/asm/overlay_17.s @@ -414,7 +414,7 @@ ov17_021D7794: ; 0x021D7794 ldr r0, _021D77B0 ; =gSystem + 0x60 mov r1, #1 strb r1, [r0, #5] - bl GX_SwapDisplay + bl GfGfx_SwapDisplay pop {r3, pc} nop _021D77B0: .word gSystem + 0x60 @@ -426,7 +426,7 @@ ov17_021D77B4: ; 0x021D77B4 ldr r0, _021D77D0 ; =gSystem + 0x60 mov r1, #0 strb r1, [r0, #5] - bl GX_SwapDisplay + bl GfGfx_SwapDisplay bl ov17_021D7E0C bl ov17_021D7E00 bl GX_ResetBankForTex @@ -1163,7 +1163,7 @@ _021D7D12: sub r2, r2, #1 bne _021D7D12 add r0, sp, #0 - bl GX_SetBanks + bl GfGfx_SetBanks add sp, #0x28 pop {r4, pc} .align 2, 0 @@ -1177,7 +1177,7 @@ ov17_021D7D28: ; 0x021D7D28 bl G3X_InitMtxStack mov r0, #1 add r1, r0, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r0, _021D7D9C ; =0x04000008 mov r1, #3 ldrh r2, [r0] @@ -1254,14 +1254,14 @@ ov17_021D7DB0: ; 0x021D7DB0 orr r0, r1 str r0, [r2] bl NNS_G2dInitOamManagerModule - bl GX_DisableEngineALayers - bl GX_DisableEngineBLayers + bl GfGfx_DisableEngineAPlanes + bl GfGfx_DisableEngineBPlanes mov r0, #0x1f mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0x13 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes add sp, #0x10 pop {r4, pc} .align 2, 0 @@ -1280,8 +1280,8 @@ ov17_021D7E00: ; 0x021D7E00 thumb_func_start ov17_021D7E0C ov17_021D7E0C: ; 0x021D7E0C push {r3, lr} - bl GX_DisableEngineALayers - bl GX_DisableEngineBLayers + bl GfGfx_DisableEngineAPlanes + bl GfGfx_DisableEngineBPlanes bl NNS_G2dInitOamManagerModule pop {r3, pc} thumb_func_end ov17_021D7E0C @@ -4497,19 +4497,19 @@ ov17_021D9778: ; 0x021D9778 bic r2, r3 strh r2, [r1, #6] mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #2 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #4 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #8 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0 bl SetMasterBrightnessNeutral pop {r4, pc} @@ -4535,16 +4535,16 @@ ov17_021D9800: ; 0x021D9800 bl sub_0201FD98 mov r0, #1 add r1, r0, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #2 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #4 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes pop {r4, pc} thumb_func_end ov17_021D9800 @@ -13824,7 +13824,7 @@ _021DDBBC: ldr r0, _021DDC2C ; =gSystem + 0x60 mov r1, #0 strb r1, [r0, #5] - bl GX_SwapDisplay + bl GfGfx_SwapDisplay add r0, r4, #0 add r0, #0x14 mov r1, #0xe diff --git a/arm9/overlays/18/asm/overlay_18.s b/arm9/overlays/18/asm/overlay_18.s index 72271ce1f..2af32746d 100644 --- a/arm9/overlays/18/asm/overlay_18.s +++ b/arm9/overlays/18/asm/overlay_18.s @@ -1467,7 +1467,7 @@ _0223A194: sub r2, r2, #1 bne _0223A194 add r0, sp, #0x80 - bl GX_SetBanks + bl GfGfx_SetBanks ldr r5, _0223A2A8 ; =0x02250000 add r3, sp, #0x70 add r2, r3, #0 @@ -1733,16 +1733,16 @@ ov18_0223A3D4: ; 0x0223A3D4 bl ov18_022396A0 mov r0, #1 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #2 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #4 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #8 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r2, #5 mov r0, #3 mov r1, #0x1d @@ -2128,16 +2128,16 @@ _0223A73A: bl BeginNormalPaletteFade mov r0, #1 add r1, r0, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #2 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #4 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #8 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r0, [r4] add sp, #0xc add r0, r0, #1 @@ -6124,10 +6124,10 @@ _0223C634: blt _0223C57A mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0x10 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes add sp, #0x64 pop {r4, r5, r6, r7, pc} .align 2, 0 @@ -14393,7 +14393,7 @@ _022404A4: bl SetBgPriority mov r0, #4 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0x10 bl sub_0204F774 ldr r0, _022404EC ; =0x022513A0 @@ -14652,7 +14652,7 @@ _02240672: ; jump table _0224068C: mov r0, #4 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes bl ov18_022400A0 str r0, [r4, #4] ldr r0, [r4] @@ -14793,7 +14793,7 @@ _0224079E: bl StartBrightnessTransition mov r0, #4 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #7 str r0, [r4] bl ov18_0223D638 @@ -17110,10 +17110,10 @@ _0224195E: _022419BE: mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0x10 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes add sp, #0x5c pop {r4, r5, r6, r7, pc} nop @@ -18293,10 +18293,10 @@ _0224227A: _02242308: mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0x10 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes add sp, #0x60 pop {r3, r4, r5, r6, r7, pc} .align 2, 0 @@ -18857,10 +18857,10 @@ _02242704: blt _02242704 mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0x10 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes add sp, #0x5c pop {r4, r5, r6, r7, pc} nop @@ -20398,10 +20398,10 @@ ov18_022432B4: ; 0x022432B4 bl sub_02020238 mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0x10 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes add sp, #0x5c pop {pc} nop @@ -21585,10 +21585,10 @@ _02243CBE: blt _02243C60 mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0x10 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes add sp, #0x5c pop {r4, r5, r6, r7, pc} nop @@ -22580,7 +22580,7 @@ _02244460: blt _02244460 mov r0, #0x10 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes ldr r0, [r4] add sp, #0x60 add r0, r0, #1 @@ -22594,16 +22594,16 @@ _022444A4: _022444AC: mov r0, #8 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes mov r0, #4 mov r1, #0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes mov r0, #2 mov r1, #0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes mov r0, #1 add r1, r0, #0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes mov r0, #4 mov r1, #0 bl BG_SetMaskColor @@ -23101,7 +23101,7 @@ ov18_0224486C: ; 0x0224486C bl InitBgFromTemplate mov r0, #1 mov r1, #0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes ldr r6, _02244990 ; =0x02250498 add r3, sp, #0x2c ldmia r6!, {r0, r1} @@ -23119,7 +23119,7 @@ ov18_0224486C: ; 0x0224486C bl InitBgFromTemplate mov r0, #2 mov r1, #0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes ldr r6, _02244994 ; =0x0225047C add r3, sp, #0x10 ldmia r6!, {r0, r1} @@ -23137,7 +23137,7 @@ ov18_0224486C: ; 0x0224486C bl InitBgFromTemplate mov r0, #8 mov r1, #0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes add r0, r5, #0 mov r1, #7 bl BgClearTilemapBufferAndCommit @@ -32427,7 +32427,7 @@ _02249184: str r2, [r0, r1] mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes add sp, #0xb4 pop {r4, r5, r6, r7, pc} nop diff --git a/arm9/overlays/20/asm/ov20_02252C5C.s b/arm9/overlays/20/asm/ov20_02252C5C.s index 026555fbc..1a9ce0677 100644 --- a/arm9/overlays/20/asm/ov20_02252C5C.s +++ b/arm9/overlays/20/asm/ov20_02252C5C.s @@ -358,10 +358,10 @@ ov20_02252ED0: ; 0x02252ED0 mov r0, #0x10 orr r0, r1 str r0, [r2] - bl GX_DisableEngineBLayers + bl GfGfx_DisableEngineBPlanes mov r0, #0x10 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes mov r0, #6 lsl r0, r0, #6 ldr r0, [r4, r0] diff --git a/arm9/overlays/51/asm/overlay_51.s b/arm9/overlays/51/asm/overlay_51.s index fe86e506d..087ebec30 100644 --- a/arm9/overlays/51/asm/overlay_51.s +++ b/arm9/overlays/51/asm/overlay_51.s @@ -49,19 +49,19 @@ _0225487A: bl ov51_02254944 mov r0, #0x10 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes mov r0, #1 add r1, r0, #0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes mov r0, #2 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes mov r0, #4 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes mov r0, #8 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes add r0, r4, #0 bl ov51_0225571C ldr r0, [r4] @@ -409,7 +409,7 @@ ov51_02254B54: ; 0x02254B54 bl BgClearTilemapBufferAndCommit mov r0, #1 mov r1, #0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes ldr r5, _02254C74 ; =0x0225578C add r3, sp, #0x48 ldmia r5!, {r0, r1} @@ -430,7 +430,7 @@ ov51_02254B54: ; 0x02254B54 bl BgClearTilemapBufferAndCommit mov r0, #2 mov r1, #0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes ldr r5, _02254C78 ; =0x022557C4 add r3, sp, #0x2c ldmia r5!, {r0, r1} @@ -451,7 +451,7 @@ ov51_02254B54: ; 0x02254B54 bl BgClearTilemapBufferAndCommit mov r0, #4 mov r1, #0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes ldr r5, _02254C7C ; =0x02255754 add r3, sp, #0x10 ldmia r5!, {r0, r1} @@ -469,7 +469,7 @@ ov51_02254B54: ; 0x02254B54 bl InitBgFromTemplate mov r0, #8 mov r1, #0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes mov r0, #0x60 mov r1, #0 str r0, [sp] diff --git a/arm9/overlays/53/asm/overlay_53.s b/arm9/overlays/53/asm/overlay_53.s index c2977b829..28c0ca275 100644 --- a/arm9/overlays/53/asm/overlay_53.s +++ b/arm9/overlays/53/asm/overlay_53.s @@ -22,8 +22,8 @@ _021D74F6: add r1, r0, #0 bl Main_SetVBlankIntrCB bl sub_02015F1C - bl GX_DisableEngineALayers - bl GX_DisableEngineBLayers + bl GfGfx_DisableEngineAPlanes + bl GfGfx_DisableEngineBPlanes mov r2, #1 lsl r2, r2, #0x1a ldr r1, [r2] @@ -462,7 +462,7 @@ _021D78DA: sub r2, r2, #1 bne _021D78DA add r0, sp, #0 - bl GX_SetBanks + bl GfGfx_SetBanks add sp, #0x28 pop {r4, pc} .align 2, 0 @@ -1289,10 +1289,10 @@ _021D7F74: blt _021D7F74 mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0x10 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes add sp, #0x64 pop {r4, r5, r6, r7, pc} .align 2, 0 diff --git a/arm9/overlays/54/asm/overlay_54.s b/arm9/overlays/54/asm/overlay_54.s index 942bd6499..88a44f3cd 100644 --- a/arm9/overlays/54/asm/overlay_54.s +++ b/arm9/overlays/54/asm/overlay_54.s @@ -22,8 +22,8 @@ _021D74F6: add r1, r0, #0 bl Main_SetVBlankIntrCB bl sub_02015F1C - bl GX_DisableEngineALayers - bl GX_DisableEngineBLayers + bl GfGfx_DisableEngineAPlanes + bl GfGfx_DisableEngineBPlanes mov r2, #1 lsl r2, r2, #0x1a ldr r1, [r2] @@ -428,7 +428,7 @@ _021D787E: sub r2, r2, #1 bne _021D787E add r0, sp, #0 - bl GX_SetBanks + bl GfGfx_SetBanks add sp, #0x28 pop {r4, pc} .align 2, 0 @@ -1045,10 +1045,10 @@ _021D7D4C: str r0, [sp, #0x38] mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0x10 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes add sp, #0x5c pop {r4, r5, r6, r7, pc} .align 2, 0 diff --git a/arm9/overlays/55/asm/overlay_55.s b/arm9/overlays/55/asm/overlay_55.s index 83073faca..ffd41927f 100644 --- a/arm9/overlays/55/asm/overlay_55.s +++ b/arm9/overlays/55/asm/overlay_55.s @@ -29,8 +29,8 @@ ov55_021D7504: ; 0x021D7504 add r1, r0, #0 bl Main_SetVBlankIntrCB bl sub_02015F1C - bl GX_DisableEngineALayers - bl GX_DisableEngineBLayers + bl GfGfx_DisableEngineAPlanes + bl GfGfx_DisableEngineBPlanes mov r2, #1 lsl r2, r2, #0x1a ldr r1, [r2] @@ -385,11 +385,11 @@ _021D7808: .word 0x00003FF8 thumb_func_start ov55_021D780C ov55_021D780C: ; 0x021D780C - ldr r3, _021D7814 ; =GX_SetBanks + ldr r3, _021D7814 ; =GfGfx_SetBanks ldr r0, _021D7818 ; =0x021DA458 bx r3 nop -_021D7814: .word GX_SetBanks +_021D7814: .word GfGfx_SetBanks _021D7818: .word ov55_021DA458 thumb_func_end ov55_021D780C @@ -1198,7 +1198,7 @@ _021D7EB8: blt _021D7E56 mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes add sp, #0x5c pop {r4, r5, r6, r7, pc} thumb_func_end ov55_021D7DA0 @@ -4017,7 +4017,7 @@ ov55_021D9574: ; 0x021D9574 bl G3X_InitMtxStack mov r0, #1 add r1, r0, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r0, _021D95D8 ; =0x04000008 mov r1, #3 ldrh r2, [r0] @@ -5576,11 +5576,11 @@ ov55_021DA27C: ; 0x021DA27C lsl r1, r4, #0x18 mov r0, #0xf lsr r1, r1, #0x18 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes lsl r1, r4, #0x18 mov r0, #1 lsr r1, r1, #0x18 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes pop {r4, pc} .align 2, 0 thumb_func_end ov55_021DA27C diff --git a/arm9/overlays/56/asm/overlay_56.s b/arm9/overlays/56/asm/overlay_56.s index 7cf28f4bf..8cb5577cc 100644 --- a/arm9/overlays/56/asm/overlay_56.s +++ b/arm9/overlays/56/asm/overlay_56.s @@ -253,8 +253,8 @@ ov56_02211FD4: ; 0x02211FD4 add r1, r0, #0 bl Main_SetVBlankIntrCB bl sub_02015F1C - bl GX_DisableEngineALayers - bl GX_DisableEngineBLayers + bl GfGfx_DisableEngineAPlanes + bl GfGfx_DisableEngineBPlanes mov r2, #1 lsl r2, r2, #0x1a ldr r1, [r2] @@ -385,10 +385,10 @@ _022120BE: str r2, [r4, r1] mov r0, #0xf mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0xf mov r1, #0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes add r0, r4, #0 bl ov56_0221244C add r0, r4, #0 @@ -603,7 +603,7 @@ _022122BE: sub r2, r2, #1 bne _022122BE add r0, sp, #0 - bl GX_SetBanks + bl GfGfx_SetBanks add sp, #0x28 pop {r4, pc} .align 2, 0 @@ -930,19 +930,19 @@ ov56_0221257C: ; 0x0221257C ldr r4, [r0] mov r0, #1 add r1, r0, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #2 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #4 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #8 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #1 add r1, r0, #0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes mov r2, #0 str r2, [sp] mov r0, #0x36 @@ -1293,7 +1293,7 @@ _02212848: blt _02212848 mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes add sp, #0x5c pop {r4, r5, r6, r7, pc} thumb_func_end ov56_022127D4 diff --git a/arm9/overlays/57/asm/overlay_57.s b/arm9/overlays/57/asm/overlay_57.s index 9c606ae68..df7a2692c 100644 --- a/arm9/overlays/57/asm/overlay_57.s +++ b/arm9/overlays/57/asm/overlay_57.s @@ -14,8 +14,8 @@ ov57_021D74E0: ; 0x021D74E0 mov r0, #0 add r1, r0, #0 bl Main_SetHBlankIntrCB - bl GX_DisableEngineALayers - bl GX_DisableEngineBLayers + bl GfGfx_DisableEngineAPlanes + bl GfGfx_DisableEngineBPlanes mov r2, #1 lsl r2, r2, #0x1a ldr r1, [r2] @@ -635,7 +635,7 @@ _021D7A1E: sub r2, r2, #1 bne _021D7A1E add r0, sp, #0 - bl GX_SetBanks + bl GfGfx_SetBanks add sp, #0x28 pop {r4, pc} .align 2, 0 @@ -1208,10 +1208,10 @@ ov57_021D7EDC: ; 0x021D7EDC add r4, r0, #0 mov r0, #0x1f mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0x13 mov r1, #0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes add r0, r4, #0 mov r1, #7 bl FreeBgTilemapBuffer @@ -3730,7 +3730,7 @@ _021D92CE: bl NARC_Delete mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes add sp, #0x3c pop {r4, r5, r6, r7, pc} nop diff --git a/arm9/overlays/58/asm/overlay_58.s b/arm9/overlays/58/asm/overlay_58.s index 997547fbf..dfa3010e3 100644 --- a/arm9/overlays/58/asm/overlay_58.s +++ b/arm9/overlays/58/asm/overlay_58.s @@ -28,8 +28,8 @@ _021D9A36: add r1, r0, #0 bl Main_SetVBlankIntrCB bl sub_02015F1C - bl GX_DisableEngineALayers - bl GX_DisableEngineBLayers + bl GfGfx_DisableEngineAPlanes + bl GfGfx_DisableEngineBPlanes mov r2, #1 lsl r2, r2, #0x1a ldr r1, [r2] @@ -315,7 +315,7 @@ _021D9CE6: sub r2, r2, #1 bne _021D9CE6 add r0, sp, #0 - bl GX_SetBanks + bl GfGfx_SetBanks add sp, #0x28 pop {r4, pc} .align 2, 0 @@ -1008,10 +1008,10 @@ ov58_021DA1C4: ; 0x021DA1C4 bl sub_02020238 mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0x10 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes add sp, #0x5c pop {r3, r4, pc} .align 2, 0 diff --git a/arm9/overlays/59/src/ov59_Intro.c b/arm9/overlays/59/src/ov59_Intro.c index fa2e8fb22..22a04009a 100644 --- a/arm9/overlays/59/src/ov59_Intro.c +++ b/arm9/overlays/59/src/ov59_Intro.c @@ -1,9 +1,10 @@ #include "global.h" #include "ov59_Intro.h" -#include "GX_layers.h" +#include "gf_gfx_planes.h" #include "PAD_pad.h" #include "bg_window.h" #include "brightness.h" +#include "constants/rgb.h" #include "constants/sndseq.h" #include "demo/intro/intro.naix" #include "game_init.h" @@ -422,8 +423,8 @@ BOOL ov59_IntroMain(struct OverlayManager *overlayManager, u32 *status) Main_SetVBlankIntrCB(NULL, NULL); Main_SetHBlankIntrCB(NULL, NULL); - GX_DisableEngineALayers(); - GX_DisableEngineBLayers(); + GfGfx_DisableEngineAPlanes(); + GfGfx_DisableEngineBPlanes(); GX_SetVisiblePlane(0); GXS_SetVisiblePlane(0); @@ -436,7 +437,7 @@ BOOL ov59_IntroMain(struct OverlayManager *overlayManager, u32 *status) Main_SetVBlankIntrCB((void (*)(void *))ov59_IntroDoGpuBgUpdate, data); - GX_BothDispOn(); + GfGfx_BothDispOn(); *status = 1; @@ -445,7 +446,7 @@ BOOL ov59_IntroMain(struct OverlayManager *overlayManager, u32 *status) case 1: if (ov59_MasterController(data) == TRUE) { - BeginNormalPaletteFade(0, 0, 0, GX_RGB_BLACK, 6, 1, data->heapId); + BeginNormalPaletteFade(0, 0, 0, RGB_BLACK, 6, 1, data->heapId); *status = 2; } @@ -454,7 +455,7 @@ BOOL ov59_IntroMain(struct OverlayManager *overlayManager, u32 *status) break; } - BeginNormalPaletteFade(0, 0, 0, GX_RGB_BLACK, 6, 1, data->heapId); + BeginNormalPaletteFade(0, 0, 0, RGB_BLACK, 6, 1, data->heapId); *status = 3; break; @@ -563,7 +564,7 @@ BOOL ov59_TestPokeballTouchLocation(void) void ov59_IntroSetupBg(ov59_IntroOverlayData *data) { struct GraphicsBanks graphicsBanks = ov59_021D9F18; - GX_SetBanks(&graphicsBanks); + GfGfx_SetBanks(&graphicsBanks); data->bgConfig = BgConfig_Alloc(data->heapId); struct GraphicsModes graphicsModes = ov59_021D9DCC; @@ -616,15 +617,15 @@ void ov59_IntroSetupBg(ov59_IntroOverlayData *data) InitBgFromTemplate(data->bgConfig, GF_BG_LYR_SUB_3, &bgTemplateSub, GF_BG_TYPE_TEXT); BgClearTilemapBufferAndCommit(data->bgConfig, GF_BG_LYR_SUB_3); - ToggleBgLayer(GF_BG_LYR_MAIN_0, GX_LAYER_TOGGLE_OFF); - ToggleBgLayer(GF_BG_LYR_MAIN_1, GX_LAYER_TOGGLE_OFF); - ToggleBgLayer(GF_BG_LYR_MAIN_2, GX_LAYER_TOGGLE_OFF); - ToggleBgLayer(GF_BG_LYR_MAIN_3, GX_LAYER_TOGGLE_OFF); + ToggleBgLayer(GF_BG_LYR_MAIN_0, GX_PLANE_TOGGLE_OFF); + ToggleBgLayer(GF_BG_LYR_MAIN_1, GX_PLANE_TOGGLE_OFF); + ToggleBgLayer(GF_BG_LYR_MAIN_2, GX_PLANE_TOGGLE_OFF); + ToggleBgLayer(GF_BG_LYR_MAIN_3, GX_PLANE_TOGGLE_OFF); - ToggleBgLayer(GF_BG_LYR_SUB_0, GX_LAYER_TOGGLE_OFF); - ToggleBgLayer(GF_BG_LYR_SUB_1, GX_LAYER_TOGGLE_OFF); - ToggleBgLayer(GF_BG_LYR_SUB_2, GX_LAYER_TOGGLE_OFF); - ToggleBgLayer(GF_BG_LYR_SUB_3, GX_LAYER_TOGGLE_OFF); + ToggleBgLayer(GF_BG_LYR_SUB_0, GX_PLANE_TOGGLE_OFF); + ToggleBgLayer(GF_BG_LYR_SUB_1, GX_PLANE_TOGGLE_OFF); + ToggleBgLayer(GF_BG_LYR_SUB_2, GX_PLANE_TOGGLE_OFF); + ToggleBgLayer(GF_BG_LYR_SUB_3, GX_PLANE_TOGGLE_OFF); ov59_LoadInitialTilemap(data); data->fadeCounter = 0; @@ -632,15 +633,15 @@ void ov59_IntroSetupBg(ov59_IntroOverlayData *data) void ov59_IntroDestroyBg(ov59_IntroOverlayData *data) { - ToggleBgLayer(GF_BG_LYR_MAIN_0, GX_LAYER_TOGGLE_OFF); - ToggleBgLayer(GF_BG_LYR_MAIN_1, GX_LAYER_TOGGLE_OFF); - ToggleBgLayer(GF_BG_LYR_MAIN_2, GX_LAYER_TOGGLE_OFF); - ToggleBgLayer(GF_BG_LYR_MAIN_3, GX_LAYER_TOGGLE_OFF); + ToggleBgLayer(GF_BG_LYR_MAIN_0, GX_PLANE_TOGGLE_OFF); + ToggleBgLayer(GF_BG_LYR_MAIN_1, GX_PLANE_TOGGLE_OFF); + ToggleBgLayer(GF_BG_LYR_MAIN_2, GX_PLANE_TOGGLE_OFF); + ToggleBgLayer(GF_BG_LYR_MAIN_3, GX_PLANE_TOGGLE_OFF); - ToggleBgLayer(GF_BG_LYR_SUB_0, GX_LAYER_TOGGLE_OFF); - ToggleBgLayer(GF_BG_LYR_SUB_1, GX_LAYER_TOGGLE_OFF); - ToggleBgLayer(GF_BG_LYR_SUB_2, GX_LAYER_TOGGLE_OFF); - ToggleBgLayer(GF_BG_LYR_SUB_3, GX_LAYER_TOGGLE_OFF); + ToggleBgLayer(GF_BG_LYR_SUB_0, GX_PLANE_TOGGLE_OFF); + ToggleBgLayer(GF_BG_LYR_SUB_1, GX_PLANE_TOGGLE_OFF); + ToggleBgLayer(GF_BG_LYR_SUB_2, GX_PLANE_TOGGLE_OFF); + ToggleBgLayer(GF_BG_LYR_SUB_3, GX_PLANE_TOGGLE_OFF); FreeBgTilemapBuffer(data->bgConfig, GF_BG_LYR_MAIN_0); FreeBgTilemapBuffer(data->bgConfig, GF_BG_LYR_MAIN_1); @@ -737,7 +738,7 @@ BOOL ov59_FadeController(ov59_IntroOverlayData *data, u32 bgId, u32 param2) { G2S_SetBlendAlpha(planeMask, (GXBlendPlaneMask)(GX_BLEND_PLANEMASK_BG3 | GX_BLEND_PLANEMASK_BG2 | GX_BLEND_PLANEMASK_BG1), data->alphaBlend1, data->alphaBlend2); } - ToggleBgLayer((u8)bgId, GX_LAYER_TOGGLE_ON); + ToggleBgLayer((u8)bgId, GX_PLANE_TOGGLE_ON); } else { @@ -782,7 +783,7 @@ BOOL ov59_FadeController(ov59_IntroOverlayData *data, u32 bgId, u32 param2) else { data->fadeCounter = 3; - ToggleBgLayer((u8)bgId, GX_LAYER_TOGGLE_OFF); + ToggleBgLayer((u8)bgId, GX_PLANE_TOGGLE_OFF); } break; case 3: @@ -948,7 +949,7 @@ BOOL ov59_DisplayControlAdventureMessage(ov59_IntroOverlayData *data, u32 msgNo, switch (data->displayControlMessageCounter) { case 0: - ToggleBgLayer(GF_BG_LYR_MAIN_0, GX_LAYER_TOGGLE_OFF); + ToggleBgLayer(GF_BG_LYR_MAIN_0, GX_PLANE_TOGGLE_OFF); data->string = String_New(1024, data->heapId); ReadMsgDataIntoString(data->msgData, msgNo, data->string); struct WindowTemplate template; @@ -1433,7 +1434,7 @@ BOOL ov59_MunchlaxJumpAnimation(ov59_IntroOverlayData *data, u32 *param1) BgSetPosTextAndCommit(data->bgConfig, GF_BG_LYR_MAIN_2, BG_POS_OP_SET_X, 0); BgSetPosTextAndCommit(data->bgConfig, GF_BG_LYR_MAIN_2, BG_POS_OP_SET_Y, -104); SetBgPriority(GF_BG_LYR_MAIN_2, 0); - ToggleBgLayer(GF_BG_LYR_SUB_1, GX_LAYER_TOGGLE_ON); + ToggleBgLayer(GF_BG_LYR_SUB_1, GX_PLANE_TOGGLE_ON); data->unkA8 = 0; data->unkAC = 8; data->unkB0 = 0; @@ -1459,7 +1460,7 @@ BOOL ov59_MunchlaxJumpAnimation(ov59_IntroOverlayData *data, u32 *param1) } else { - ToggleBgLayer(GF_BG_LYR_SUB_1, GX_LAYER_TOGGLE_OFF); + ToggleBgLayer(GF_BG_LYR_SUB_1, GX_PLANE_TOGGLE_OFF); data->unkB0 = 30; *param1 = 2; } @@ -1471,7 +1472,7 @@ BOOL ov59_MunchlaxJumpAnimation(ov59_IntroOverlayData *data, u32 *param1) } else { - ToggleBgLayer(GF_BG_LYR_MAIN_2, GX_LAYER_TOGGLE_ON); + ToggleBgLayer(GF_BG_LYR_MAIN_2, GX_PLANE_TOGGLE_ON); data->unkA8 = 0; data->unkAC = 9; data->unkB0 = 0; @@ -1858,9 +1859,9 @@ BOOL ov59_MasterController(ov59_IntroOverlayData *data) case 0: //load and fade from black sub_0200433C(2, SEQ_OPENING, 1); sub_02005350(SEQ_OPENING, 0); - ToggleBgLayer(GF_BG_LYR_MAIN_0, GX_LAYER_TOGGLE_ON); - ToggleBgLayer(GF_BG_LYR_SUB_3, GX_LAYER_TOGGLE_ON); - BeginNormalPaletteFade(0, 1, 1, GX_RGB_BLACK, 6, 1, data->heapId); + ToggleBgLayer(GF_BG_LYR_MAIN_0, GX_PLANE_TOGGLE_ON); + ToggleBgLayer(GF_BG_LYR_SUB_3, GX_PLANE_TOGGLE_ON); + BeginNormalPaletteFade(0, 1, 1, RGB_BLACK, 6, 1, data->heapId); data->controllerCounter = 1; break; @@ -1890,9 +1891,9 @@ BOOL ov59_MasterController(ov59_IntroOverlayData *data) data->spriteDataIndex0 = 1; data->spriteDataIndex1 = 0; ov59_LoadCharDataFromIndex(data); - ToggleBgLayer(GF_BG_LYR_MAIN_3, GX_LAYER_TOGGLE_ON); - ToggleBgLayer(GF_BG_LYR_MAIN_1, GX_LAYER_TOGGLE_ON); - BeginNormalPaletteFade(3, 1, 1, GX_RGB_BLACK, 16, 4, data->heapId); + ToggleBgLayer(GF_BG_LYR_MAIN_3, GX_PLANE_TOGGLE_ON); + ToggleBgLayer(GF_BG_LYR_MAIN_1, GX_PLANE_TOGGLE_ON); + BeginNormalPaletteFade(3, 1, 1, RGB_BLACK, 16, 4, data->heapId); data->controllerCounter = 4; break; @@ -1945,7 +1946,7 @@ BOOL ov59_MasterController(ov59_IntroOverlayData *data) break; case 8: //fade to black - BeginNormalPaletteFade(0, 0, 0, GX_RGB_BLACK, 6, 1, data->heapId); + BeginNormalPaletteFade(0, 0, 0, RGB_BLACK, 6, 1, data->heapId); data->controllerCounter = 9; break; @@ -1955,7 +1956,7 @@ BOOL ov59_MasterController(ov59_IntroOverlayData *data) break; } BgClearTilemapBufferAndCommit(data->bgConfig, GF_BG_LYR_MAIN_0); - ToggleBgLayer(GF_BG_LYR_MAIN_1, GX_LAYER_TOGGLE_OFF); + ToggleBgLayer(GF_BG_LYR_MAIN_1, GX_PLANE_TOGGLE_OFF); data->controllerCounter = data->nextControllerCounter; break; @@ -1964,7 +1965,7 @@ BOOL ov59_MasterController(ov59_IntroOverlayData *data) ov59_LoadMainScrnData(data); data->scrnDataIndexSub = 1; ov59_LoadSubScrnData(data); - BeginNormalPaletteFade(0, 1, 1, GX_RGB_BLACK, 6, 1, data->heapId); + BeginNormalPaletteFade(0, 1, 1, RGB_BLACK, 6, 1, data->heapId); data->controllerCounter = 11; break; @@ -2030,7 +2031,7 @@ BOOL ov59_MasterController(ov59_IntroOverlayData *data) break; case 19: //toggle layer 0 (no idea whats in here) - ToggleBgLayer(GF_BG_LYR_MAIN_0, GX_LAYER_TOGGLE_ON); + ToggleBgLayer(GF_BG_LYR_MAIN_0, GX_PLANE_TOGGLE_ON); data->controllerCounter = 20; break; @@ -2055,7 +2056,7 @@ BOOL ov59_MasterController(ov59_IntroOverlayData *data) #endif arr[0] = (u32)data->bgConfig; sub_020145C8(data->unk68, arr); - ToggleBgLayer(GF_BG_LYR_SUB_2, GX_LAYER_TOGGLE_ON); + ToggleBgLayer(GF_BG_LYR_SUB_2, GX_PLANE_TOGGLE_ON); data->scrnDataIndexSub = 3; ov59_LoadSubScrnData(data); data->controllerCounter = 22; @@ -2096,7 +2097,7 @@ BOOL ov59_MasterController(ov59_IntroOverlayData *data) break; } sub_020146C4(data->unk68); - BeginNormalPaletteFade(0, 0, 0, GX_RGB_BLACK, 6, 1, data->heapId); + BeginNormalPaletteFade(0, 0, 0, RGB_BLACK, 6, 1, data->heapId); data->controllerCounter = 25; break; @@ -2136,9 +2137,9 @@ BOOL ov59_MasterController(ov59_IntroOverlayData *data) ov59_LoadMainScrnData(data); data->scrnDataIndexSub = 0; ov59_LoadSubScrnData(data); - ToggleBgLayer(GF_BG_LYR_MAIN_1, GX_LAYER_TOGGLE_ON); + ToggleBgLayer(GF_BG_LYR_MAIN_1, GX_PLANE_TOGGLE_ON); BgSetPosTextAndCommit(data->bgConfig, GF_BG_LYR_MAIN_1, BG_POS_OP_SET_X, 0); - BeginNormalPaletteFade(0, 1, 1, GX_RGB_BLACK, 6, 1, data->heapId); + BeginNormalPaletteFade(0, 1, 1, RGB_BLACK, 6, 1, data->heapId); data->controllerCounter = 29; break; @@ -2163,7 +2164,7 @@ BOOL ov59_MasterController(ov59_IntroOverlayData *data) ov59_LoadMainScrnData(data); data->scrnDataIndexSub = 2; ov59_LoadSubScrnData(data); - BeginNormalPaletteFade(0, 1, 1, GX_RGB_BLACK, 6, 1, data->heapId); + BeginNormalPaletteFade(0, 1, 1, RGB_BLACK, 6, 1, data->heapId); data->controllerCounter = 32; break; @@ -2224,7 +2225,7 @@ BOOL ov59_MasterController(ov59_IntroOverlayData *data) break; case 39: //fade to black - BeginNormalPaletteFade(0, 0, 0, GX_RGB_BLACK, 6, 1, data->heapId); + BeginNormalPaletteFade(0, 0, 0, RGB_BLACK, 6, 1, data->heapId); data->controllerCounter = 40; break; @@ -2234,7 +2235,7 @@ BOOL ov59_MasterController(ov59_IntroOverlayData *data) break; } BgClearTilemapBufferAndCommit(data->bgConfig, GF_BG_LYR_MAIN_0); - ToggleBgLayer(GF_BG_LYR_MAIN_0, GX_LAYER_TOGGLE_ON); + ToggleBgLayer(GF_BG_LYR_MAIN_0, GX_PLANE_TOGGLE_ON); data->controllerCounter = 28; break; @@ -2255,7 +2256,7 @@ BOOL ov59_MasterController(ov59_IntroOverlayData *data) break; case 43: //fade to black - BeginNormalPaletteFade(4, 0, 0, GX_RGB_BLACK, 6, 1, data->heapId); + BeginNormalPaletteFade(4, 0, 0, RGB_BLACK, 6, 1, data->heapId); data->controllerCounter = 44; break; @@ -2267,8 +2268,8 @@ BOOL ov59_MasterController(ov59_IntroOverlayData *data) ov59_LoadPokeballButton(data); data->scrnDataIndexSub = 4; ov59_LoadSubScrnData(data); - ToggleBgLayer(GF_BG_LYR_SUB_2, GX_LAYER_TOGGLE_ON); - BeginNormalPaletteFade(4, 1, 1, GX_RGB_BLACK, 6, 1, data->heapId); + ToggleBgLayer(GF_BG_LYR_SUB_2, GX_PLANE_TOGGLE_ON); + BeginNormalPaletteFade(4, 1, 1, RGB_BLACK, 6, 1, data->heapId); data->controllerCounter = 45; break; @@ -2379,7 +2380,7 @@ BOOL ov59_MasterController(ov59_IntroOverlayData *data) case 54: //spawn munchlax and unflash ov59_DrawMunchlax(data); - ToggleBgLayer(GF_BG_LYR_SUB_2, GX_LAYER_TOGGLE_OFF); + ToggleBgLayer(GF_BG_LYR_SUB_2, GX_PLANE_TOGGLE_OFF); data->spriteDataIndex2 = 0; ov59_MunchlaxJumpAnimation(data, &data->spriteDataIndex2); data->scrnDataIndexSub = 0; @@ -2601,20 +2602,20 @@ BOOL ov59_MasterController(ov59_IntroOverlayData *data) break; case 77: //toggle bg layers and position, fade from black - ToggleBgLayer(GF_BG_LYR_MAIN_0, GX_LAYER_TOGGLE_ON); - ToggleBgLayer(GF_BG_LYR_MAIN_3, GX_LAYER_TOGGLE_ON); - ToggleBgLayer(GF_BG_LYR_SUB_3, GX_LAYER_TOGGLE_ON); + ToggleBgLayer(GF_BG_LYR_MAIN_0, GX_PLANE_TOGGLE_ON); + ToggleBgLayer(GF_BG_LYR_MAIN_3, GX_PLANE_TOGGLE_ON); + ToggleBgLayer(GF_BG_LYR_SUB_3, GX_PLANE_TOGGLE_ON); if (data->selectedGender == PLAYER_GENDER_MALE) { - ToggleBgLayer(GF_BG_LYR_MAIN_1, GX_LAYER_TOGGLE_ON); + ToggleBgLayer(GF_BG_LYR_MAIN_1, GX_PLANE_TOGGLE_ON); BgSetPosTextAndCommit(data->bgConfig, GF_BG_LYR_MAIN_1, BG_POS_OP_SET_X, 0); } else { - ToggleBgLayer(GF_BG_LYR_MAIN_2, GX_LAYER_TOGGLE_ON); + ToggleBgLayer(GF_BG_LYR_MAIN_2, GX_PLANE_TOGGLE_ON); BgSetPosTextAndCommit(data->bgConfig, GF_BG_LYR_MAIN_2, BG_POS_OP_SET_X, 0); } - BeginNormalPaletteFade(0, 1, 1, GX_RGB_BLACK, 6, 1, data->heapId); + BeginNormalPaletteFade(0, 1, 1, RGB_BLACK, 6, 1, data->heapId); data->controllerCounter = 78; break; @@ -2783,12 +2784,12 @@ BOOL ov59_MasterController(ov59_IntroOverlayData *data) break; case 93: //toggle layers and position, fade from black - ToggleBgLayer(GF_BG_LYR_MAIN_0, GX_LAYER_TOGGLE_ON); - ToggleBgLayer(GF_BG_LYR_MAIN_3, GX_LAYER_TOGGLE_ON); - ToggleBgLayer(GF_BG_LYR_SUB_3, GX_LAYER_TOGGLE_ON); - ToggleBgLayer(GF_BG_LYR_MAIN_1, GX_LAYER_TOGGLE_ON); + ToggleBgLayer(GF_BG_LYR_MAIN_0, GX_PLANE_TOGGLE_ON); + ToggleBgLayer(GF_BG_LYR_MAIN_3, GX_PLANE_TOGGLE_ON); + ToggleBgLayer(GF_BG_LYR_SUB_3, GX_PLANE_TOGGLE_ON); + ToggleBgLayer(GF_BG_LYR_MAIN_1, GX_PLANE_TOGGLE_ON); BgSetPosTextAndCommit(data->bgConfig, GF_BG_LYR_MAIN_1, BG_POS_OP_SET_X, 0); - BeginNormalPaletteFade(0, 1, 1, GX_RGB_BLACK, 6, 1, data->heapId); + BeginNormalPaletteFade(0, 1, 1, RGB_BLACK, 6, 1, data->heapId); data->controllerCounter = 94; break; diff --git a/arm9/overlays/59/src/ov59_TV.c b/arm9/overlays/59/src/ov59_TV.c index ec257fc53..a84a62e92 100644 --- a/arm9/overlays/59/src/ov59_TV.c +++ b/arm9/overlays/59/src/ov59_TV.c @@ -1,7 +1,8 @@ #include "global.h" #include "ov59_TV.h" -#include "GX_layers.h" +#include "gf_gfx_planes.h" #include "PAD_pad.h" +#include "constants/rgb.h" #include "constants/sndseq.h" #include "demo/intro/intro_tv.naix" #include "filesystem.h" @@ -150,8 +151,8 @@ BOOL ov59_TVMain(struct OverlayManager *overlayManager, u32 *status) Main_SetVBlankIntrCB(NULL, NULL); Main_SetHBlankIntrCB(NULL, NULL); - GX_DisableEngineALayers(); - GX_DisableEngineBLayers(); + GfGfx_DisableEngineAPlanes(); + GfGfx_DisableEngineBPlanes(); GX_SetVisiblePlane(0); GXS_SetVisiblePlane(0); @@ -163,7 +164,7 @@ BOOL ov59_TVMain(struct OverlayManager *overlayManager, u32 *status) Main_SetVBlankIntrCB((void (*)(void *))ov59_TVDoGpuBgUpdate, data); - GX_BothDispOn(); + GfGfx_BothDispOn(); data->unk24 = 60; @@ -193,7 +194,7 @@ BOOL ov59_TVMain(struct OverlayManager *overlayManager, u32 *status) } data->unk24 = 0; //?? - BeginNormalPaletteFade(0, 1, 1, GX_RGB_BLACK, 6, 1, data->heapId); + BeginNormalPaletteFade(0, 1, 1, RGB_BLACK, 6, 1, data->heapId); *status = 3; break; @@ -217,7 +218,7 @@ BOOL ov59_TVMain(struct OverlayManager *overlayManager, u32 *status) break; } - BeginNormalPaletteFade(0, 0, 0, GX_RGB_BLACK, 6, 1, data->heapId); + BeginNormalPaletteFade(0, 0, 0, RGB_BLACK, 6, 1, data->heapId); *status = 5; break; @@ -259,7 +260,7 @@ void ov59_TVDoGpuBgUpdate(ov59_TVOverlayData *data) void ov59_TVSetupGraphics(ov59_TVOverlayData *data) { const struct GraphicsBanks banks = ov59_021DA0D4; //sp #0x90 - GX_SetBanks(&banks); + GfGfx_SetBanks(&banks); data->bgConfig = BgConfig_Alloc(data->heapId); @@ -302,14 +303,14 @@ void ov59_TVSetupGraphics(ov59_TVOverlayData *data) void ov59_TVDestroyGraphics(ov59_TVOverlayData *data) { - ToggleBgLayer(GF_BG_LYR_MAIN_0, GX_LAYER_TOGGLE_OFF); - ToggleBgLayer(GF_BG_LYR_MAIN_1, GX_LAYER_TOGGLE_OFF); - ToggleBgLayer(GF_BG_LYR_MAIN_2, GX_LAYER_TOGGLE_OFF); - ToggleBgLayer(GF_BG_LYR_MAIN_3, GX_LAYER_TOGGLE_OFF); - ToggleBgLayer(GF_BG_LYR_SUB_0, GX_LAYER_TOGGLE_OFF); - ToggleBgLayer(GF_BG_LYR_SUB_1, GX_LAYER_TOGGLE_OFF); - ToggleBgLayer(GF_BG_LYR_SUB_2, GX_LAYER_TOGGLE_OFF); - ToggleBgLayer(GF_BG_LYR_SUB_3, GX_LAYER_TOGGLE_OFF); + ToggleBgLayer(GF_BG_LYR_MAIN_0, GX_PLANE_TOGGLE_OFF); + ToggleBgLayer(GF_BG_LYR_MAIN_1, GX_PLANE_TOGGLE_OFF); + ToggleBgLayer(GF_BG_LYR_MAIN_2, GX_PLANE_TOGGLE_OFF); + ToggleBgLayer(GF_BG_LYR_MAIN_3, GX_PLANE_TOGGLE_OFF); + ToggleBgLayer(GF_BG_LYR_SUB_0, GX_PLANE_TOGGLE_OFF); + ToggleBgLayer(GF_BG_LYR_SUB_1, GX_PLANE_TOGGLE_OFF); + ToggleBgLayer(GF_BG_LYR_SUB_2, GX_PLANE_TOGGLE_OFF); + ToggleBgLayer(GF_BG_LYR_SUB_3, GX_PLANE_TOGGLE_OFF); reg_G2_BLDCNT = 0; @@ -340,7 +341,7 @@ BOOL ov59_021D9C74(ov59_TVOverlayData *data, u32 msgNo, u32 param2, u32 param3) switch (data->unk0C) { case 0: - ToggleBgLayer(GF_BG_LYR_MAIN_2, GX_LAYER_TOGGLE_OFF); + ToggleBgLayer(GF_BG_LYR_MAIN_2, GX_PLANE_TOGGLE_OFF); struct String *string = String_New(1024, data->heapId); ReadMsgDataIntoString(data->msgData, msgNo, string); AddWindow(data->bgConfig, &data->window, &ov59_021DA04C); @@ -351,7 +352,7 @@ BOOL ov59_021D9C74(ov59_TVOverlayData *data, u32 msgNo, u32 param2, u32 param3) AddTextPrinterParameterized2(&data->window, 0, string, unk0, param3, 0, MakeFontColor(15, 2, 0), NULL); String_Delete(string); CopyWindowToVram(&data->window); - ToggleBgLayer(GF_BG_LYR_MAIN_2, GX_LAYER_TOGGLE_ON); + ToggleBgLayer(GF_BG_LYR_MAIN_2, GX_PLANE_TOGGLE_ON); data->unk24 = 240; data->unk0C = 1; break; diff --git a/arm9/overlays/60/asm/overlay_60.s b/arm9/overlays/60/asm/overlay_60.s index 0c3a7efd5..8c5d2f4ef 100644 --- a/arm9/overlays/60/asm/overlay_60.s +++ b/arm9/overlays/60/asm/overlay_60.s @@ -369,7 +369,7 @@ _021D77BE: sub r2, r2, #1 bne _021D77BE add r0, sp, #0 - bl GX_SetBanks + bl GfGfx_SetBanks add sp, #0x28 pop {r4, pc} .align 2, 0 @@ -438,8 +438,8 @@ _021D7848: add r1, r0, #0 bl Main_SetVBlankIntrCB bl sub_02015F1C - bl GX_DisableEngineALayers - bl GX_DisableEngineBLayers + bl GfGfx_DisableEngineAPlanes + bl GfGfx_DisableEngineBPlanes mov r2, #1 lsl r2, r2, #0x1a ldr r1, [r2] @@ -478,7 +478,7 @@ _021D78A2: bl sub_0201C24C mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes bl sub_02033F20 ldr r0, _021D78E4 ; =ov60_021D77D4 add r1, r4, #0 @@ -551,8 +551,8 @@ _021D7946: add r1, r0, #0 bl Main_SetVBlankIntrCB bl sub_02015F1C - bl GX_DisableEngineALayers - bl GX_DisableEngineBLayers + bl GfGfx_DisableEngineAPlanes + bl GfGfx_DisableEngineBPlanes mov r2, #1 lsl r2, r2, #0x1a ldr r1, [r2] diff --git a/arm9/overlays/61/asm/overlay_61.s b/arm9/overlays/61/asm/overlay_61.s index 2a8971314..8171a4962 100644 --- a/arm9/overlays/61/asm/overlay_61.s +++ b/arm9/overlays/61/asm/overlay_61.s @@ -557,8 +557,8 @@ _021D78FA: add r1, r0, #0 bl Main_SetVBlankIntrCB bl sub_02015F1C - bl GX_DisableEngineALayers - bl GX_DisableEngineBLayers + bl GfGfx_DisableEngineAPlanes + bl GfGfx_DisableEngineBPlanes mov r2, #1 lsl r2, r2, #0x1a ldr r1, [r2] @@ -593,7 +593,7 @@ _021D794E: bl Main_SetVBlankIntrCB mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0 bl SetMasterBrightnessNeutral mov r1, #4 @@ -681,8 +681,8 @@ _021D79FC: mov r0, #0 add r1, r0, #0 bl Main_SetVBlankIntrCB - bl GX_DisableEngineALayers - bl GX_DisableEngineBLayers + bl GfGfx_DisableEngineAPlanes + bl GfGfx_DisableEngineBPlanes mov r2, #1 lsl r2, r2, #0x1a ldr r1, [r2] @@ -907,7 +907,7 @@ _021D7BBA: sub r2, r2, #1 bne _021D7BBA add r0, sp, #0 - bl GX_SetBanks + bl GfGfx_SetBanks add sp, #0x28 pop {r4, pc} .align 2, 0 diff --git a/arm9/overlays/62/asm/overlay_62.s b/arm9/overlays/62/asm/overlay_62.s index d83f306c2..a73bfe89f 100644 --- a/arm9/overlays/62/asm/overlay_62.s +++ b/arm9/overlays/62/asm/overlay_62.s @@ -1755,7 +1755,7 @@ ov62_0222E2DC: ; 0x0222E2DC push {r3, lr} mov r0, #1 add r1, r0, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r0, _0222E348 ; =0x04000008 mov r1, #3 ldrh r2, [r0] @@ -3734,13 +3734,13 @@ _0222F26C: .word 0x0000FFFF thumb_func_start ov62_0222F270 ov62_0222F270: ; 0x0222F270 push {r3, lr} - bl GX_BothDispOn + bl GfGfx_BothDispOn mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0x10 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes pop {r3, pc} thumb_func_end ov62_0222F270 @@ -6022,10 +6022,10 @@ _0223042E: bl sub_02003210 mov r0, #0x10 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #4 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes mov r0, #7 mov r1, #1 bl SetBgPriority @@ -6111,7 +6111,7 @@ _0223050A: ; jump table _0223051A: mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r3, #0 str r3, [sp] mov r0, #0xa @@ -6296,7 +6296,7 @@ _02230692: bl ov08_02229A2C mov r0, #0x10 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes add r0, r4, #0 bl ov62_0223021C mov r0, #0x3e @@ -6395,7 +6395,7 @@ _0223072C: bl ov62_0222F7E0 mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0xf7 lsl r0, r0, #2 ldr r1, [r4, r0] @@ -6462,7 +6462,7 @@ _0223081A: _0223081C: mov r0, #0x10 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes add r0, r4, #0 mov r1, #1 bl ov62_022300DC @@ -6582,7 +6582,7 @@ _022308E4: bl ov62_022300DC mov r0, #1 mov r1, #0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes mov r0, #0xf7 lsl r0, r0, #2 ldr r1, [r4, r0] @@ -6655,7 +6655,7 @@ _0223093E: _022309B4: mov r0, #1 add r1, r0, #0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes mov r0, #0xf7 lsl r0, r0, #2 ldr r1, [r4, r0] @@ -6791,7 +6791,7 @@ _02230AC2: _02230AD4: mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r3, #0 str r3, [sp] mov r0, #0x10 @@ -6850,7 +6850,7 @@ _02230B40: bl SetBgPriority mov r0, #4 mov r1, #0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes add r0, r4, #0 mov r1, #0 bl ov62_0222F738 @@ -7322,8 +7322,8 @@ ov62_02230F3C: ; 0x02230F3C add r1, r0, #0 bl Main_SetVBlankIntrCB bl sub_02015F1C - bl GX_DisableEngineALayers - bl GX_DisableEngineBLayers + bl GfGfx_DisableEngineAPlanes + bl GfGfx_DisableEngineBPlanes mov r2, #1 lsl r2, r2, #0x1a ldr r1, [r2] @@ -7355,7 +7355,7 @@ ov62_02230F80: ; 0x02230F80 push {r4, r5, lr} sub sp, #0xfc add r4, r0, #0 - bl GX_DisableEngineALayers + bl GfGfx_DisableEngineAPlanes ldr r5, _022310B8 ; =ov62_02231238 add r3, sp, #0x10 mov r2, #5 @@ -7365,7 +7365,7 @@ _02230F90: sub r2, r2, #1 bne _02230F90 add r0, sp, #0x10 - bl GX_SetBanks + bl GfGfx_SetBanks mov r1, #6 mov r2, #2 mov r0, #0 @@ -7441,7 +7441,7 @@ _02230FF0: orr r2, r0 strh r2, [r1] add r1, r0, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r5, _022310C8 ; =ov62_022312E8 add r3, sp, #0x38 mov r2, #0xe @@ -7484,7 +7484,7 @@ _02231052: bl BgClearTilemapBufferAndCommit mov r0, #4 mov r1, #0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes add sp, #0xfc pop {r4, r5, pc} nop diff --git a/arm9/overlays/63/asm/ov63_021D74E0.s b/arm9/overlays/63/asm/ov63_021D74E0.s index e3ec3e347..e4a1e8c26 100644 --- a/arm9/overlays/63/asm/ov63_021D74E0.s +++ b/arm9/overlays/63/asm/ov63_021D74E0.s @@ -23,8 +23,8 @@ ov63_021D74E0: ; 0x021D74E0 mov r0, #0 add r1, r0, #0 bl Main_SetHBlankIntrCB - bl GX_DisableEngineALayers - bl GX_DisableEngineBLayers + bl GfGfx_DisableEngineAPlanes + bl GfGfx_DisableEngineBPlanes mov r2, #1 lsl r2, r2, #0x1a ldr r1, [r2] @@ -69,7 +69,7 @@ ov63_021D74E0: ; 0x021D74E0 ldr r0, _021D7598 ; =ov63_021D782C add r1, r4, #0 bl Main_SetVBlankIntrCB - bl GX_BothDispOn + bl GfGfx_BothDispOn mov r0, #1 pop {r4, pc} .align 2, 0 @@ -251,7 +251,7 @@ _021D76D4: strh r3, [r4, r1] mov r1, #0 str r0, [r2, #0x6c] - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes mov r0, #0 mov r1, #0x3c bl sub_020053CC @@ -420,7 +420,7 @@ _021D7842: sub r2, r2, #1 bne _021D7842 add r0, sp, #0 - bl GX_SetBanks + bl GfGfx_SetBanks add sp, #0x28 pop {r4, pc} .align 2, 0 @@ -795,28 +795,28 @@ ov63_021D7A48: ; 0x021D7A48 bl InitBgFromTemplate mov r0, #1 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #2 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #4 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #8 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #1 mov r1, #0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes mov r0, #2 mov r1, #0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes mov r0, #4 mov r1, #0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes mov r0, #8 mov r1, #0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes mov r0, #0 add r1, r0, #0 bl BG_SetMaskColor @@ -841,28 +841,28 @@ ov63_021D7B9C: ; 0x021D7B9C add r4, r0, #0 mov r0, #1 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #2 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #4 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #8 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #1 mov r1, #0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes mov r0, #2 mov r1, #0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes mov r0, #4 mov r1, #0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes mov r0, #8 mov r1, #0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes ldr r0, [r4, #4] mov r1, #4 bl FreeBgTilemapBuffer @@ -1031,7 +1031,7 @@ _021D7C52: ldr r0, _021D7D70 ; =gSystem + 0x60 mov r1, #1 strb r1, [r0, #5] - bl GX_SwapDisplay + bl GfGfx_SwapDisplay mov r0, #2 str r0, [r5, #4] mov r0, #1 @@ -1085,13 +1085,13 @@ _021D7DA4: ; jump table _021D7DB8: mov r0, #1 add r1, r0, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #8 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #2 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes ldr r1, _021D80F0 ; =0x00000116 add r0, r6, #0 strh r0, [r4, r1] @@ -1663,16 +1663,16 @@ _021D81DC: bne _021D824E mov r0, #4 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes mov r0, #2 mov r1, #0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes mov r0, #2 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #8 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes add r0, r4, #0 mov r1, #0x5a add r0, #0xa8 @@ -1736,22 +1736,22 @@ _021D8272: bl Camera_SetLookAtCamPos mov r0, #1 add r1, r0, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #8 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #8 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes mov r0, #4 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes mov r0, #2 add r1, r4, #0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes mov r0, #2 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes add r0, r4, #0 bl SetMasterBrightnessNeutral mov r0, #1 @@ -1791,19 +1791,19 @@ _021D82FC: bne _021D831A mov r0, #1 add r1, r0, #0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes b _021D8330 _021D831A: cmp r0, #0x10 bne _021D8330 mov r0, #1 add r1, r4, #0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes b _021D8330 _021D8328: mov r0, #1 add r1, r4, #0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes _021D8330: add r0, r5, #0 add r0, #0xa8 @@ -1855,7 +1855,7 @@ ov63_021D8360: ; 0x021D8360 strh r0, [r2] ldr r0, _021D83A4 ; =gSystem + 0x60 strb r3, [r0, #5] - bl GX_SwapDisplay + bl GfGfx_SwapDisplay mov r0, #1 pop {r4, r5, r6, pc} .align 2, 0 diff --git a/arm9/overlays/63/asm/ov63_021D8890.s b/arm9/overlays/63/asm/ov63_021D8890.s index ed1ee91c3..70ac0b0d6 100644 --- a/arm9/overlays/63/asm/ov63_021D8890.s +++ b/arm9/overlays/63/asm/ov63_021D8890.s @@ -16,7 +16,7 @@ _021D889A: sub r2, r2, #1 bne _021D889A add r0, sp, #0 - bl GX_SetBanks + bl GfGfx_SetBanks add sp, #0x28 pop {r4, pc} .align 2, 0 @@ -36,7 +36,7 @@ _021D88BA: sub r2, r2, #1 bne _021D88BA add r0, sp, #0 - bl GX_SetBanks + bl GfGfx_SetBanks add sp, #0x28 pop {r4, pc} .align 2, 0 @@ -56,7 +56,7 @@ _021D88DA: sub r2, r2, #1 bne _021D88DA add r0, sp, #0 - bl GX_SetBanks + bl GfGfx_SetBanks add sp, #0x28 pop {r4, pc} .align 2, 0 @@ -578,8 +578,8 @@ ov63_021D8D10: ; 0x021D8D10 mov r0, #0 add r1, r0, #0 bl Main_SetHBlankIntrCB - bl GX_DisableEngineALayers - bl GX_DisableEngineBLayers + bl GfGfx_DisableEngineAPlanes + bl GfGfx_DisableEngineBPlanes mov r0, #4 mov r1, #8 bl SetKeyRepeatTimers @@ -606,7 +606,7 @@ ov63_021D8D10: ; 0x021D8D10 strb r1, [r4, r0] ldr r0, _021D8D94 ; =gSystem + 0x60 strb r1, [r0, #5] - bl GX_SwapDisplay + bl GfGfx_SwapDisplay bl GetLCRNGSeed str r0, [r4, #0x14] mov r0, #0 @@ -985,10 +985,10 @@ ov63_021D8F38: ; 0x021D8F38 bl GfGfxLoader_GXLoadPal mov r0, #4 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #4 mov r1, #0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes mov r0, #0x10 str r0, [sp] ldr r0, _021D90C8 ; =0x04000050 @@ -1010,7 +1010,7 @@ ov63_021D8F38: ; 0x021D8F38 bl SetMasterBrightnessNeutral mov r0, #1 bl SetMasterBrightnessNeutral - bl GX_BothDispOn + bl GfGfx_BothDispOn add sp, #0x10 pop {r4, pc} nop @@ -1089,10 +1089,10 @@ _021D9148: blt _021D9208 mov r0, #2 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #2 mov r1, #0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes mov r0, #0x10 str r0, [sp] ldr r0, _021D9220 ; =0x04000050 @@ -1109,10 +1109,10 @@ _021D9148: bl G2x_SetBlendAlpha_ mov r0, #4 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #4 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes mov r2, #0 strb r2, [r4, #7] strb r2, [r4, #6] @@ -1546,7 +1546,7 @@ ov63_021D9498: ; 0x021D9498 str r0, [r5, #0x40] ldr r0, _021D9588 ; =gSystem + 0x60 strb r1, [r0, #5] - bl GX_SwapDisplay + bl GfGfx_SwapDisplay ldr r6, _021D958C ; =ov63_021DBDE8 ldr r7, _021D9590 ; =ov63_021DBAD0 mov r4, #0 @@ -1886,10 +1886,10 @@ _021D96F8: bl ov63_021DABCC mov r0, #0xe mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #1 mov r1, #0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes mov r0, #0 bl SetMasterBrightnessNeutral mov r0, #1 @@ -2171,7 +2171,7 @@ _021D9A42: blt _021D9B0C mov r0, #1 add r1, r0, #0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes mov r0, #2 str r0, [sp] mov r0, #8 @@ -2197,14 +2197,14 @@ _021D9A7A: bne _021D9A88 mov r0, #0x10 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes _021D9A88: ldr r0, _021D9DD0 ; =0x000003C5 cmp r5, r0 blt _021D9B0C mov r0, #7 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0x12 str r0, [sp] mov r1, #1 @@ -2319,13 +2319,13 @@ _021D9B72: bl G2x_SetBlendAlpha_ mov r0, #6 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #8 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #1 add r1, r0, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r1, #0 ldr r0, [r4, #0x10] add r2, r1, #0 @@ -2526,7 +2526,7 @@ _021D9D48: bl ov63_021DAD18 mov r0, #4 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r0, [r4, #0x10] mov r1, #0 mov r2, #1 @@ -2610,7 +2610,7 @@ _021D9DF8: bl ov63_021D9EA8 mov r0, #4 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #4 str r0, [sp] mov r1, #1 @@ -3172,13 +3172,13 @@ _021DA192: bl GfGfxLoader_LoadScrnData mov r0, #0xe mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #1 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #2 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes ldr r0, [r4, #0xc] mov r1, #3 mov r2, #1 @@ -3532,11 +3532,11 @@ ov63_021DA588: ; 0x021DA588 strb r2, [r0, #3] mov r2, #0 strb r2, [r0, #1] - ldr r3, _021DA59C ; =GX_EngineAToggleLayers + ldr r3, _021DA59C ; =GfGfx_EngineATogglePlanes add r0, r1, #0 bx r3 nop -_021DA59C: .word GX_EngineAToggleLayers +_021DA59C: .word GfGfx_EngineATogglePlanes thumb_func_end ov63_021DA588 thumb_func_start ov63_021DA5A0 @@ -3610,7 +3610,7 @@ _021DA618: blo _021DA630 mov r0, #1 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes _021DA630: add sp, #4 pop {r3, r4, r5, r6, pc} diff --git a/arm9/overlays/63/asm/ov63_021DA640.s b/arm9/overlays/63/asm/ov63_021DA640.s index 51a0fbbcf..a2a5db46e 100644 --- a/arm9/overlays/63/asm/ov63_021DA640.s +++ b/arm9/overlays/63/asm/ov63_021DA640.s @@ -460,7 +460,7 @@ _021DA9DC: blt _021DA9DC mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes add sp, #0x14 pop {r4, r5, r6, r7, pc} .align 2, 0 diff --git a/arm9/overlays/63/asm/ov63_021DAE5C.s b/arm9/overlays/63/asm/ov63_021DAE5C.s index f1634b47d..c8e551978 100644 --- a/arm9/overlays/63/asm/ov63_021DAE5C.s +++ b/arm9/overlays/63/asm/ov63_021DAE5C.s @@ -338,10 +338,10 @@ _021DB040: bl sub_02009CF0 mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0x10 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes add sp, #0x14 pop {r4, r5, r6, r7, pc} nop diff --git a/arm9/overlays/64/asm/overlay_64.s b/arm9/overlays/64/asm/overlay_64.s index cd0b2013d..b9e1bbefe 100644 --- a/arm9/overlays/64/asm/overlay_64.s +++ b/arm9/overlays/64/asm/overlay_64.s @@ -79,10 +79,10 @@ _021D755E: bl ov64_021D7970 mov r0, #1 add r1, r0, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #2 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes add r0, r5, #0 mov r1, #0x2f bl ov64_021D7A54 @@ -404,7 +404,7 @@ _021D7846: sub r2, r2, #1 bne _021D7846 add r0, sp, #0 - bl GX_SetBanks + bl GfGfx_SetBanks add sp, #0x28 pop {r4, pc} .align 2, 0 @@ -962,10 +962,10 @@ ov64_021D7C74: ; 0x021D7C74 str r0, [r5, r1] mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0x10 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes pop {r3, r4, r5, pc} .align 2, 0 thumb_func_end ov64_021D7C74 @@ -1940,7 +1940,7 @@ _021D8400: bl ov64_021D8864 mov r0, #2 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r0, [r4, #4] add sp, #0xc add r0, r0, #1 diff --git a/arm9/overlays/65/asm/overlay_65.s b/arm9/overlays/65/asm/overlay_65.s index 34632d4e2..fe99fcefc 100644 --- a/arm9/overlays/65/asm/overlay_65.s +++ b/arm9/overlays/65/asm/overlay_65.s @@ -114,8 +114,8 @@ _021D75A4: add r1, r0, #0 bl Main_SetVBlankIntrCB bl sub_02015F1C - bl GX_DisableEngineALayers - bl GX_DisableEngineBLayers + bl GfGfx_DisableEngineAPlanes + bl GfGfx_DisableEngineBPlanes mov r2, #1 lsl r2, r2, #0x1a ldr r1, [r2] @@ -221,8 +221,8 @@ _021D7684: mov r0, #0 add r1, r0, #0 bl Main_SetVBlankIntrCB - bl GX_DisableEngineALayers - bl GX_DisableEngineBLayers + bl GfGfx_DisableEngineAPlanes + bl GfGfx_DisableEngineBPlanes mov r2, #1 lsl r2, r2, #0x1a ldr r1, [r2] @@ -740,7 +740,7 @@ _021D7A76: sub r2, r2, #1 bne _021D7A76 add r0, sp, #0 - bl GX_SetBanks + bl GfGfx_SetBanks add sp, #0x28 pop {r4, pc} .align 2, 0 @@ -2574,10 +2574,10 @@ ov65_021D8850: ; 0x021D8850 _021D8908: mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0x10 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes add sp, #0x54 pop {r4, r5, r6, r7, pc} .align 2, 0 @@ -2771,8 +2771,8 @@ _021D8A88: add r1, r0, #0 bl Main_SetVBlankIntrCB bl sub_02015F1C - bl GX_DisableEngineALayers - bl GX_DisableEngineBLayers + bl GfGfx_DisableEngineAPlanes + bl GfGfx_DisableEngineBPlanes mov r2, #1 lsl r2, r2, #0x1a ldr r1, [r2] @@ -2882,8 +2882,8 @@ _021D8B68: mov r0, #0 add r1, r0, #0 bl Main_SetVBlankIntrCB - bl GX_DisableEngineALayers - bl GX_DisableEngineBLayers + bl GfGfx_DisableEngineAPlanes + bl GfGfx_DisableEngineBPlanes mov r2, #1 lsl r2, r2, #0x1a ldr r1, [r2] @@ -3055,7 +3055,7 @@ _021D8CC2: sub r2, r2, #1 bne _021D8CC2 add r0, sp, #0 - bl GX_SetBanks + bl GfGfx_SetBanks add sp, #0x28 pop {r4, pc} .align 2, 0 @@ -3491,7 +3491,7 @@ ov65_021D8FB0: ; 0x021D8FB0 _021D9040: mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes add sp, #0x44 pop {r3, r4, r5, r6, pc} .align 2, 0 @@ -5354,7 +5354,7 @@ ov65_021D9E98: ; 0x021D9E98 bl ov65_021DA000 mov r0, #1 add r1, r0, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r1, _021D9F4C ; =0x04000008 mov r0, #3 ldrh r2, [r1] diff --git a/arm9/overlays/66/asm/overlay_66.s b/arm9/overlays/66/asm/overlay_66.s index 0e04ff443..7336c6010 100644 --- a/arm9/overlays/66/asm/overlay_66.s +++ b/arm9/overlays/66/asm/overlay_66.s @@ -169,7 +169,7 @@ _021D7612: sub r2, r2, #1 bne _021D7612 add r0, sp, #0 - bl GX_SetBanks + bl GfGfx_SetBanks add sp, #0x28 pop {r4, pc} .align 2, 0 @@ -193,8 +193,8 @@ _021D763C: add r1, r0, #0 bl Main_SetVBlankIntrCB bl sub_02015F1C - bl GX_DisableEngineALayers - bl GX_DisableEngineBLayers + bl GfGfx_DisableEngineAPlanes + bl GfGfx_DisableEngineBPlanes mov r2, #1 lsl r2, r2, #0x1a ldr r1, [r2] @@ -319,10 +319,10 @@ ov66_021D7750: ; 0x021D7750 bl sub_0201CD04 mov r0, #0x1f mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0x1f mov r1, #0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes mov r0, #0 add r1, r0, #0 bl Main_SetVBlankIntrCB @@ -3630,10 +3630,10 @@ ov66_021D913C: ; 0x021D913C add r4, r0, #0 mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0x10 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes ldr r1, [r4, #4] mov r0, #0x20 bl sub_0201C24C diff --git a/arm9/overlays/67/asm/overlay_67.s b/arm9/overlays/67/asm/overlay_67.s index fb9bf9ef2..6844c375d 100644 --- a/arm9/overlays/67/asm/overlay_67.s +++ b/arm9/overlays/67/asm/overlay_67.s @@ -11,8 +11,8 @@ ov67_021D74E0: ; 0x021D74E0 add r1, r0, #0 bl Main_SetVBlankIntrCB bl sub_02015F1C - bl GX_DisableEngineALayers - bl GX_DisableEngineBLayers + bl GfGfx_DisableEngineAPlanes + bl GfGfx_DisableEngineBPlanes mov r0, #1 lsl r0, r0, #0x1a ldr r2, [r0] @@ -80,11 +80,11 @@ ov67_021D74E0: ; 0x021D74E0 ldr r0, _021D75CC ; =ov67_021D7660 add r1, r4, #0 bl Main_SetVBlankIntrCB - bl GX_BothDispOn + bl GfGfx_BothDispOn bl sub_02033E74 mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r1, #0 mov r0, #0x43 add r2, r1, #0 @@ -201,7 +201,7 @@ _021D768A: sub r2, r2, #1 bne _021D768A add r0, sp, #0 - bl GX_SetBanks + bl GfGfx_SetBanks add sp, #0x28 pop {r4, pc} .align 2, 0 @@ -312,7 +312,7 @@ _021D7778: .word ov67_021D9794 ov67_021D777C: ; 0x021D777C push {r4, lr} add r4, r0, #0 - bl GX_DisableEngineALayers + bl GfGfx_DisableEngineAPlanes add r0, r4, #0 mov r1, #3 bl FreeBgTilemapBuffer diff --git a/arm9/overlays/68/asm/overlay_68.s b/arm9/overlays/68/asm/overlay_68.s index 0334b08ef..2b9adc162 100644 --- a/arm9/overlays/68/asm/overlay_68.s +++ b/arm9/overlays/68/asm/overlay_68.s @@ -11,8 +11,8 @@ ov68_021D74E0: ; 0x021D74E0 add r1, r0, #0 bl Main_SetVBlankIntrCB bl sub_02015F1C - bl GX_DisableEngineALayers - bl GX_DisableEngineBLayers + bl GfGfx_DisableEngineAPlanes + bl GfGfx_DisableEngineBPlanes mov r2, #1 lsl r2, r2, #0x1a ldr r1, [r2] @@ -93,7 +93,7 @@ ov68_021D74E0: ; 0x021D74E0 bl sub_02033F20 mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #1 pop {r3, r4, r5, pc} .align 2, 0 @@ -213,7 +213,7 @@ _021D76AA: sub r2, r2, #1 bne _021D76AA add r0, sp, #0 - bl GX_SetBanks + bl GfGfx_SetBanks add sp, #0x28 pop {r4, pc} .align 2, 0 @@ -308,7 +308,7 @@ ov68_021D7774: ; 0x021D7774 add r4, r0, #0 mov r0, #0xf mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes add r0, r4, #0 mov r1, #3 bl FreeBgTilemapBuffer @@ -1447,7 +1447,7 @@ ov68_021D7FD8: ; 0x021D7FD8 str r0, [r1, #0x40] mov r0, #1 add r1, r0, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r1, _021D8068 ; =0x04000008 mov r0, #3 ldrh r2, [r1] diff --git a/arm9/overlays/69/asm/overlay_69.s b/arm9/overlays/69/asm/overlay_69.s index da9d0f426..bd004c0ce 100644 --- a/arm9/overlays/69/asm/overlay_69.s +++ b/arm9/overlays/69/asm/overlay_69.s @@ -738,7 +738,7 @@ ov69_0222DBAC: ; 0x0222DBAC bl BgConfig_Alloc str r0, [r4, #0x10] ldr r0, _0222DCF4 ; =0x0222F8CC - bl GX_SetBanks + bl GfGfx_SetBanks ldr r2, _0222DCF8 ; =0x04000304 ldr r0, _0222DCFC ; =0xFFFF7FFF ldrh r1, [r2] @@ -964,7 +964,7 @@ ov69_0222DD54: ; 0x0222DD54 bl NNS_GfdInitFrmPlttVramManager mov r0, #1 add r1, r0, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r0, _0222DDF8 ; =0x04000008 mov r1, #3 ldrh r2, [r0] @@ -1115,7 +1115,7 @@ ov69_0222DE98: ; 0x0222DE98 bl ov69_0222DF0C mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes add sp, #0x1c pop {r3, r4, pc} .align 2, 0 diff --git a/arm9/overlays/70/asm/overlay_70.s b/arm9/overlays/70/asm/overlay_70.s index 8f559e19a..088450f04 100644 --- a/arm9/overlays/70/asm/overlay_70.s +++ b/arm9/overlays/70/asm/overlay_70.s @@ -803,7 +803,7 @@ ov70_021D7AF4: ; 0x021D7AF4 sub sp, #0x10 add r5, r0, #0 ldr r0, _021D7BF8 ; =0x021D8284 - bl GX_SetBanks + bl GfGfx_SetBanks ldr r2, _021D7BFC ; =0x04000304 ldrh r1, [r2] lsr r0, r2, #0xb @@ -909,7 +909,7 @@ ov70_021D7AF4: ; 0x021D7AF4 bl G2x_SetBlendAlpha_ mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes add sp, #0x10 pop {r3, r4, r5, pc} .align 2, 0 diff --git a/arm9/overlays/71/asm/overlay_71.s b/arm9/overlays/71/asm/overlay_71.s index 565e70044..03bc23df1 100644 --- a/arm9/overlays/71/asm/overlay_71.s +++ b/arm9/overlays/71/asm/overlay_71.s @@ -12,8 +12,8 @@ ov71_0222D5C0: ; 0x0222D5C0 add r1, r0, #0 bl Main_SetVBlankIntrCB bl sub_02015F1C - bl GX_DisableEngineALayers - bl GX_DisableEngineBLayers + bl GfGfx_DisableEngineAPlanes + bl GfGfx_DisableEngineBPlanes mov r2, #1 lsl r2, r2, #0x1a ldr r1, [r2] @@ -131,7 +131,7 @@ ov71_0222D5C0: ; 0x0222D5C0 bl ToggleBgLayer mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r1, #0x5d lsl r1, r1, #2 ldr r1, [r4, r1] @@ -323,7 +323,7 @@ ov71_0222D820: ; 0x0222D820 bl ToggleBgLayer mov r0, #0x10 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes mov r0, #0 mov r1, #1 bl ToggleBgLayer @@ -338,7 +338,7 @@ ov71_0222D820: ; 0x0222D820 bl ToggleBgLayer mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes bl ov71_0222EA38 add r0, r4, #0 bl ov71_0222EA68 @@ -1175,7 +1175,7 @@ _0222DF92: str r0, [r4, #0x4c] mov r0, #0x10 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r0, _0222E0F8 ; =0x00002218 mov r1, #0 ldr r0, [r4, r0] @@ -1220,7 +1220,7 @@ _0222DFD6: bl ToggleBgLayer mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r0, [r4, #0x4c] add r0, r0, #1 str r0, [r4, #0x4c] @@ -1276,7 +1276,7 @@ _0222E054: bl ToggleBgLayer mov r0, #0x10 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes ldr r0, [r4, #0x4c] add r0, r0, #1 str r0, [r4, #0x4c] @@ -1856,7 +1856,7 @@ _0222E562: sub r2, r2, #1 bne _0222E562 add r0, sp, #0 - bl GX_SetBanks + bl GfGfx_SetBanks add sp, #0x28 pop {r4, pc} .align 2, 0 diff --git a/arm9/overlays/73/asm/overlay_73.s b/arm9/overlays/73/asm/overlay_73.s index 9b56d9653..1747fe0f2 100644 --- a/arm9/overlays/73/asm/overlay_73.s +++ b/arm9/overlays/73/asm/overlay_73.s @@ -325,7 +325,7 @@ _021D76D4: bl sub_02033E74 mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r0, _021D7804 ; =0x00001420 ldr r0, [r5, r0] cmp r0, #1 @@ -968,13 +968,13 @@ _021D7CD2: bl ov73_021DA730 mov r0, #1 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #2 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #4 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0xae mov r1, #0 lsl r0, r0, #2 @@ -2233,7 +2233,7 @@ ov73_021D8630: ; 0x021D8630 ldr r0, _021D8758 ; =gSystem + 0x60 mov r1, #1 strb r1, [r0, #5] - bl GX_SwapDisplay + bl GfGfx_SwapDisplay add sp, #8 pop {r4, pc} .align 2, 0 @@ -2302,7 +2302,7 @@ ov73_021D875C: ; 0x021D875C ldr r0, _021D880C ; =gSystem + 0x60 mov r1, #0 strb r1, [r0, #5] - bl GX_SwapDisplay + bl GfGfx_SwapDisplay pop {r4, pc} .align 2, 0 _021D87EC: .word 0x0000063C @@ -2425,7 +2425,7 @@ _021D88CE: sub r2, r2, #1 bne _021D88CE add r0, sp, #0 - bl GX_SetBanks + bl GfGfx_SetBanks add sp, #0x28 pop {r4, pc} .align 2, 0 @@ -2453,7 +2453,7 @@ ov73_021D88E4: ; 0x021D88E4 bl SetBothScreensModesAndDisable mov r0, #1 add r1, r0, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0 mov r1, #2 bl SetBgPriority @@ -2537,10 +2537,10 @@ ov73_021D89AC: ; 0x021D89AC bl ov73_021D92EC mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0x10 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes pop {r3, pc} .align 2, 0 thumb_func_end ov73_021D89AC @@ -5857,10 +5857,10 @@ _021DA266: bl ov73_021DA374 mov r0, #2 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #4 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #1 str r0, [r5, #0x28] pop {r4, r5, r6, pc} @@ -6067,10 +6067,10 @@ ov73_021DA408: ; 0x021DA408 blt _021DA432 mov r0, #2 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #4 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes add r0, r5, #0 bl sub_0200CAB4 mov r0, #0 @@ -6117,10 +6117,10 @@ _021DA446: bl CopyWindowToVram mov r0, #2 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #4 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes add sp, #0x10 pop {r4, r5, r6, pc} .align 2, 0 @@ -6150,10 +6150,10 @@ ov73_021DA4AC: ; 0x021DA4AC beq _021DA4D0 mov r0, #2 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #4 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r0, [r4, #0x2c] bl sub_0200CAB4 mov r0, #0 diff --git a/arm9/overlays/74/asm/overlay_74.s b/arm9/overlays/74/asm/overlay_74.s index 85e446bc2..a7b1ca7ef 100644 --- a/arm9/overlays/74/asm/overlay_74.s +++ b/arm9/overlays/74/asm/overlay_74.s @@ -190,8 +190,8 @@ _021D7644: add r1, r0, #0 bl Main_SetVBlankIntrCB bl sub_02015F1C - bl GX_DisableEngineALayers - bl GX_DisableEngineBLayers + bl GfGfx_DisableEngineAPlanes + bl GfGfx_DisableEngineBPlanes mov r2, #1 lsl r2, r2, #0x1a ldr r1, [r2] @@ -289,8 +289,8 @@ _021D7722: add r1, r0, #0 bl Main_SetVBlankIntrCB bl sub_02015F1C - bl GX_DisableEngineALayers - bl GX_DisableEngineBLayers + bl GfGfx_DisableEngineAPlanes + bl GfGfx_DisableEngineBPlanes mov r2, #1 lsl r2, r2, #0x1a ldr r1, [r2] @@ -329,7 +329,7 @@ _021D776E: sub r2, r2, #1 bne _021D776E add r0, sp, #0 - bl GX_SetBanks + bl GfGfx_SetBanks add sp, #0x28 pop {r4, pc} .align 2, 0 @@ -1746,7 +1746,7 @@ ov74_021D8200: ; 0x021D8200 bl sub_0200BD20 mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes add sp, #0x50 pop {r3, r4, r5, r6, r7, pc} nop diff --git a/arm9/overlays/75/asm/overlay_75.s b/arm9/overlays/75/asm/overlay_75.s index 1257ca509..b1678db71 100644 --- a/arm9/overlays/75/asm/overlay_75.s +++ b/arm9/overlays/75/asm/overlay_75.s @@ -12,8 +12,8 @@ ov75_021E6BA0: ; 0x021E6BA0 add r1, r0, #0 bl Main_SetVBlankIntrCB bl sub_02015F1C - bl GX_DisableEngineALayers - bl GX_DisableEngineBLayers + bl GfGfx_DisableEngineAPlanes + bl GfGfx_DisableEngineBPlanes mov r0, #1 lsl r0, r0, #0x1a ldr r2, [r0] @@ -558,7 +558,7 @@ _021E703E: sub r2, r2, #1 bne _021E703E add r0, sp, #0 - bl GX_SetBanks + bl GfGfx_SetBanks add sp, #0x28 pop {r4, pc} .align 2, 0 @@ -732,10 +732,10 @@ ov75_021E71BC: ; 0x021E71BC add r4, r0, #0 mov r0, #0x1f mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0x1b mov r1, #0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes add r0, r4, #0 mov r1, #7 bl FreeBgTilemapBuffer @@ -9844,10 +9844,10 @@ ov75_021EB9B4: ; 0x021EB9B4 add r4, r0, #0 mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0x10 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes mov r0, #0x20 mov r1, #6 bl sub_0201C24C diff --git a/arm9/overlays/76/asm/overlay_76.s b/arm9/overlays/76/asm/overlay_76.s index 9c5404e35..c8e78ce95 100644 --- a/arm9/overlays/76/asm/overlay_76.s +++ b/arm9/overlays/76/asm/overlay_76.s @@ -179,8 +179,8 @@ ov76_021D7638: ; 0x021D7638 add r1, r0, #0 bl Main_SetVBlankIntrCB bl sub_02015F1C - bl GX_DisableEngineALayers - bl GX_DisableEngineBLayers + bl GfGfx_DisableEngineAPlanes + bl GfGfx_DisableEngineBPlanes mov r2, #1 lsl r2, r2, #0x1a ldr r1, [r2] @@ -275,7 +275,7 @@ _021D771A: sub r2, r2, #1 bne _021D771A add r0, sp, #0 - bl GX_SetBanks + bl GfGfx_SetBanks add sp, #0x28 pop {r4, pc} .align 2, 0 @@ -370,7 +370,7 @@ ov76_021D77E4: ; 0x021D77E4 add r4, r0, #0 mov r0, #0x17 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes add r0, r4, #0 mov r1, #2 bl FreeBgTilemapBuffer @@ -2397,7 +2397,7 @@ ov76_021D8758: ; 0x021D8758 bl sub_0200BF60 mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes add sp, #0x4c pop {r4, r5, r6, r7, pc} nop diff --git a/arm9/overlays/77/asm/overlay_77.s b/arm9/overlays/77/asm/overlay_77.s index 076b5260a..c87badc51 100644 --- a/arm9/overlays/77/asm/overlay_77.s +++ b/arm9/overlays/77/asm/overlay_77.s @@ -13,8 +13,8 @@ ov77_021D74E0: ; 0x021D74E0 mov r0, #0 add r1, r0, #0 bl Main_SetHBlankIntrCB - bl GX_DisableEngineALayers - bl GX_DisableEngineBLayers + bl GfGfx_DisableEngineAPlanes + bl GfGfx_DisableEngineBPlanes mov r2, #1 lsl r2, r2, #0x1a ldr r1, [r2] @@ -79,7 +79,7 @@ _021D7540: bl BgConfig_Alloc ldr r1, _021D75F4 ; =0x0000C010 str r0, [r5, r1] - bl GX_BothDispOn + bl GfGfx_BothDispOn bl ResetAllTextPrinters ldr r2, [r5] mov r0, #8 @@ -97,7 +97,7 @@ _021D7540: ldr r0, _021D7600 ; =gSystem + 0x60 mov r1, #1 strb r1, [r0, #5] - bl GX_SwapDisplay + bl GfGfx_SwapDisplay mov r0, #4 mov r1, #8 bl SetKeyRepeatTimers @@ -185,16 +185,16 @@ _021D764C: bl BeginNormalPaletteFade mov r0, #4 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #4 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes mov r0, #8 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #8 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes mov r0, #1 str r0, [r5] b _021D7B66 @@ -805,16 +805,16 @@ ov77_021D7BAC: ; 0x021D7BAC mov r0, #4 mov r1, #0 ldr r5, [r4] - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #4 mov r1, #0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes mov r0, #8 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #8 mov r1, #0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes ldr r0, _021D7C14 ; =0x0000C2CC ldr r0, [r4, r0] bl Camera_Delete @@ -857,7 +857,7 @@ _021D7C2E: sub r2, r2, #1 bne _021D7C2E add r0, sp, #0 - bl GX_SetBanks + bl GfGfx_SetBanks add sp, #0x28 pop {r4, pc} .align 2, 0 diff --git a/arm9/overlays/78/asm/overlay_78.s b/arm9/overlays/78/asm/overlay_78.s index 499662117..64f26662c 100644 --- a/arm9/overlays/78/asm/overlay_78.s +++ b/arm9/overlays/78/asm/overlay_78.s @@ -271,8 +271,8 @@ ov78_021D7708: ; 0x021D7708 add r1, r0, #0 bl Main_SetVBlankIntrCB bl sub_02015F1C - bl GX_DisableEngineALayers - bl GX_DisableEngineBLayers + bl GfGfx_DisableEngineAPlanes + bl GfGfx_DisableEngineBPlanes mov r2, #1 lsl r2, r2, #0x1a ldr r1, [r2] @@ -295,7 +295,7 @@ ov78_021D7708: ; 0x021D7708 strh r0, [r2] ldr r0, _021D7768 ; =0x021D7888 bl G3X_SetEdgeColorTable - bl GX_SwapDisplay + bl GfGfx_SwapDisplay pop {r3, pc} nop _021D7758: .word 0xFFFFE0FF @@ -318,7 +318,7 @@ _021D7776: sub r2, r2, #1 bne _021D7776 add r0, sp, #0 - bl GX_SetBanks + bl GfGfx_SetBanks add sp, #0x28 pop {r4, pc} .align 2, 0 diff --git a/arm9/overlays/80/asm/overlay_80.s b/arm9/overlays/80/asm/overlay_80.s index 88d5df9c9..69497eb92 100644 --- a/arm9/overlays/80/asm/overlay_80.s +++ b/arm9/overlays/80/asm/overlay_80.s @@ -1375,8 +1375,8 @@ _0222DFE4: add r1, r0, #0 bl Main_SetVBlankIntrCB bl sub_02015F1C - bl GX_DisableEngineALayers - bl GX_DisableEngineBLayers + bl GfGfx_DisableEngineAPlanes + bl GfGfx_DisableEngineBPlanes mov r2, #1 lsl r2, r2, #0x1a ldr r1, [r2] @@ -1739,7 +1739,7 @@ _0222E322: sub r2, r2, #1 bne _0222E322 add r0, sp, #0 - bl GX_SetBanks + bl GfGfx_SetBanks add sp, #0x28 pop {r4, pc} .align 2, 0 @@ -2162,10 +2162,10 @@ ov80_0222E614: ; 0x0222E614 bl sub_02008AA4 mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0x10 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes add sp, #0x2c pop {r3, r4, pc} thumb_func_end ov80_0222E614 @@ -2725,10 +2725,10 @@ ov80_0222EA04: ; 0x0222EA04 bl BG_ClearCharDataRange mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0x10 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes add sp, #0x9c pop {r4, r5, pc} nop @@ -2767,13 +2767,13 @@ ov80_0222EB40: ; 0x0222EB40 add r4, r0, #0 mov r0, #1 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #2 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #4 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r0, _0222EB68 ; =0x00000D5C mov r1, #0 ldr r0, [r4, r0] @@ -3128,13 +3128,13 @@ ov80_0222EE24: ; 0x0222EE24 beq _0222EE5A mov r0, #1 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #2 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #4 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes add r0, r4, #0 mov r1, #7 mov r2, #0xb @@ -8739,10 +8739,10 @@ ov80_02231AB0: ; 0x02231AB0 bl BG_ClearCharDataRange mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0x10 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes add sp, #0x9c pop {r4, r5, pc} nop @@ -14322,10 +14322,10 @@ ov80_02234780: ; 0x02234780 bl BG_ClearCharDataRange mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0x10 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes add sp, #0x9c pop {r4, r5, pc} nop @@ -14411,7 +14411,7 @@ ov80_022348CC: ; 0x022348CC bl ToggleBgLayer mov r0, #0x10 mov r1, #0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes _02234944: ldr r0, [r5, #0x20] cmp r0, #9 @@ -17776,16 +17776,16 @@ ov80_02236284: ; 0x02236284 bl ov80_02236580 mov r0, #1 add r1, r0, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #2 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #1 add r1, r0, #0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes mov r0, #2 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes ldr r0, [r4] ldr r0, [r0, #0x20] bl sub_02033288 @@ -17889,7 +17889,7 @@ ov80_02236378: ; 0x02236378 bl InitBgFromTemplate mov r0, #1 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes add r0, r4, #0 mov r1, #0 bl BgClearTilemapBufferAndCommit @@ -17910,7 +17910,7 @@ ov80_02236378: ; 0x02236378 bl InitBgFromTemplate mov r0, #2 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r5, _0223645C ; =0x02237654 add r3, sp, #0x1c ldmia r5!, {r0, r1} @@ -17928,7 +17928,7 @@ ov80_02236378: ; 0x02236378 bl InitBgFromTemplate mov r0, #1 mov r1, #0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes add r0, r4, #0 mov r1, #4 bl BgClearTilemapBufferAndCommit @@ -17949,7 +17949,7 @@ ov80_02236378: ; 0x02236378 bl InitBgFromTemplate mov r0, #2 mov r1, #0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes mov r0, #0 mov r1, #0x20 add r2, r0, #0 @@ -17962,7 +17962,7 @@ ov80_02236378: ; 0x02236378 bl BG_ClearCharDataRange mov r0, #0x10 mov r1, #0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes add sp, #0x70 pop {r3, r4, r5, pc} nop diff --git a/arm9/overlays/81/asm/overlay_81.s b/arm9/overlays/81/asm/overlay_81.s index e4de5882d..7b7393c39 100644 --- a/arm9/overlays/81/asm/overlay_81.s +++ b/arm9/overlays/81/asm/overlay_81.s @@ -153,8 +153,8 @@ _02237F22: add r1, r0, #0 bl Main_SetVBlankIntrCB bl sub_02015F1C - bl GX_DisableEngineALayers - bl GX_DisableEngineBLayers + bl GfGfx_DisableEngineAPlanes + bl GfGfx_DisableEngineBPlanes mov r2, #1 lsl r2, r2, #0x1a ldr r1, [r2] @@ -2151,7 +2151,7 @@ ov81_02238E44: ; 0x02238E44 sub sp, #0x1c add r4, r0, #0 ldr r0, _02239040 ; =0x0223D054 - bl GX_SetBanks + bl GfGfx_SetBanks ldr r2, _02239044 ; =0x04000304 ldr r0, _02239048 ; =0xFFFF7FFF ldrh r1, [r2] @@ -2176,7 +2176,7 @@ ov81_02238E44: ; 0x02238E44 bl InitBgFromTemplate mov r0, #1 add r1, r0, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r2, _02239058 ; =0x04000008 mov r0, #3 ldrh r3, [r2] @@ -2344,10 +2344,10 @@ ov81_02238E44: ; 0x02238E44 bl ov81_02238B40 mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0x10 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes add r0, r4, #0 bl ov81_022393F4 ldr r0, _02239064 ; =0x04000050 @@ -3634,7 +3634,7 @@ ov81_022399FC: ; 0x022399FC sub sp, #0x10 add r4, r0, #0 ldr r0, _02239C78 ; =0x0223D0EC - bl GX_SetBanks + bl GfGfx_SetBanks ldr r2, _02239C7C ; =0x04000304 ldr r0, _02239C80 ; =0xFFFF7FFF ldrh r1, [r2] @@ -3872,10 +3872,10 @@ _02239C02: bl ToggleBgLayer mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0x10 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes add r0, r4, #0 add r0, #0xc0 mov r1, #3 @@ -4013,7 +4013,7 @@ ov81_02239CDC: ; 0x02239CDC bl NNS_GfdInitFrmPlttVramManager mov r0, #1 add r1, r0, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r1, _02239DDC ; =0x04000008 mov r0, #3 ldrh r2, [r1] @@ -5703,7 +5703,7 @@ ov81_0223AA68: ; 0x0223AA68 sub sp, #0x14 add r4, r0, #0 ldr r0, _0223ABAC ; =0x0223D158 - bl GX_SetBanks + bl GfGfx_SetBanks ldr r2, _0223ABB0 ; =0x04000304 ldr r0, _0223ABB4 ; =0xFFFF7FFF ldrh r1, [r2] @@ -5846,10 +5846,10 @@ _0223AAE8: bl BgSetPosTextAndCommit mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0x10 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes add sp, #0x14 pop {r4, r5, r6, r7, pc} .align 2, 0 @@ -5930,7 +5930,7 @@ ov81_0223ABD8: ; 0x0223ABD8 bl NNS_GfdInitFrmPlttVramManager mov r0, #1 add r1, r0, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r1, _0223ACCC ; =0x04000008 mov r0, #3 ldrh r2, [r1] @@ -6725,7 +6725,7 @@ ov81_0223B264: ; 0x0223B264 sub sp, #0x10 add r4, r0, #0 ldr r0, _0223B45C ; =0x0223D1EC - bl GX_SetBanks + bl GfGfx_SetBanks ldr r2, _0223B460 ; =0x04000304 ldrh r1, [r2] lsr r0, r2, #0xb @@ -6936,10 +6936,10 @@ ov81_0223B264: ; 0x0223B264 bl ov81_0223B4B0 mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0x10 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes add sp, #0x10 pop {r4, pc} .align 2, 0 @@ -7212,7 +7212,7 @@ ov81_0223B670: ; 0x0223B670 sub sp, #0x14 add r4, r0, #0 ldr r0, _0223B7C0 ; =0x0223D258 - bl GX_SetBanks + bl GfGfx_SetBanks ldr r2, _0223B7C4 ; =0x04000304 ldrh r1, [r2] lsr r0, r2, #0xb @@ -7355,10 +7355,10 @@ _0223B6F0: bl BgSetPosTextAndCommit mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0x10 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes bl sub_02033E74 mov r0, #1 mov r1, #0x39 @@ -7442,7 +7442,7 @@ ov81_0223B7E8: ; 0x0223B7E8 bl NNS_GfdInitFrmPlttVramManager mov r0, #1 add r1, r0, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r1, _0223B8E8 ; =0x04000008 mov r0, #3 ldrh r2, [r1] @@ -8374,7 +8374,7 @@ ov81_0223BF74: ; 0x0223BF74 sub sp, #0x10 add r4, r0, #0 ldr r0, _0223C18C ; =0x0223D2EC - bl GX_SetBanks + bl GfGfx_SetBanks ldr r2, _0223C190 ; =0x04000304 ldrh r1, [r2] lsr r0, r2, #0xb @@ -8596,10 +8596,10 @@ _0223C14A: bl ToggleBgLayer mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0x10 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes add sp, #0x10 pop {r3, r4, r5, pc} .align 2, 0 @@ -8694,7 +8694,7 @@ ov81_0223C1DC: ; 0x0223C1DC bl NNS_GfdInitFrmPlttVramManager mov r0, #1 add r1, r0, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r1, _0223C2E0 ; =0x04000008 mov r0, #3 ldrh r2, [r1] @@ -9208,7 +9208,7 @@ ov81_0223C658: ; 0x0223C658 sub sp, #0x1c add r4, r0, #0 ldr r0, _0223C808 ; =0x0223D374 - bl GX_SetBanks + bl GfGfx_SetBanks ldr r2, _0223C80C ; =0x04000304 ldrh r1, [r2] lsr r0, r2, #0xb @@ -9228,7 +9228,7 @@ ov81_0223C658: ; 0x0223C658 bl InitBgFromTemplate mov r0, #1 add r1, r0, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r2, _0223C81C ; =0x04000008 mov r0, #3 ldrh r3, [r2] @@ -9369,10 +9369,10 @@ ov81_0223C658: ; 0x0223C658 bl ov81_0223CBE0 mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0x10 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes mov r0, #0 str r0, [sp] ldr r0, _0223C824 ; =0x04000050 diff --git a/arm9/overlays/82/asm/overlay_82.s b/arm9/overlays/82/asm/overlay_82.s index e1859d700..bfa93a8e8 100644 --- a/arm9/overlays/82/asm/overlay_82.s +++ b/arm9/overlays/82/asm/overlay_82.s @@ -625,8 +625,8 @@ _0222DA48: add r1, r0, #0 bl Main_SetVBlankIntrCB bl sub_02015F1C - bl GX_DisableEngineALayers - bl GX_DisableEngineBLayers + bl GfGfx_DisableEngineAPlanes + bl GfGfx_DisableEngineBPlanes mov r2, #1 lsl r2, r2, #0x1a ldr r1, [r2] @@ -926,7 +926,7 @@ _0222DCEE: sub r2, r2, #1 bne _0222DCEE add r0, sp, #0 - bl GX_SetBanks + bl GfGfx_SetBanks add sp, #0x28 pop {r4, pc} .align 2, 0 @@ -1194,10 +1194,10 @@ _0222DED4: blt _0222DED4 mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0x10 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes bl sub_02033E74 add sp, #0x5c pop {r4, r5, r6, r7, pc} @@ -1382,16 +1382,16 @@ ov82_0222E050: ; 0x0222E050 bl ov82_0222E35C mov r0, #1 add r1, r0, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #2 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #1 add r1, r0, #0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes mov r0, #2 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes ldr r0, [r4] ldr r0, [r0, #0xc] bl sub_02033288 @@ -1506,7 +1506,7 @@ ov82_0222E15C: ; 0x0222E15C bl InitBgFromTemplate mov r0, #1 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes add r0, r4, #0 mov r1, #0 bl BgClearTilemapBufferAndCommit @@ -1527,7 +1527,7 @@ ov82_0222E15C: ; 0x0222E15C bl InitBgFromTemplate mov r0, #2 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r5, _0222E238 ; =0x0222F8B0 add r3, sp, #0x1c ldmia r5!, {r0, r1} @@ -1545,7 +1545,7 @@ ov82_0222E15C: ; 0x0222E15C bl InitBgFromTemplate mov r0, #1 mov r1, #0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes add r0, r4, #0 mov r1, #4 bl BgClearTilemapBufferAndCommit @@ -1566,7 +1566,7 @@ ov82_0222E15C: ; 0x0222E15C bl InitBgFromTemplate mov r0, #2 mov r1, #0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes mov r0, #0 mov r1, #0x20 add r2, r0, #0 diff --git a/arm9/overlays/83/asm/overlay_83.s b/arm9/overlays/83/asm/overlay_83.s index 2e9187593..303f83284 100644 --- a/arm9/overlays/83/asm/overlay_83.s +++ b/arm9/overlays/83/asm/overlay_83.s @@ -449,13 +449,13 @@ _0222D8B2: bl BgTilemapRectChangePalette mov r0, #1 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #4 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #2 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r1, #0x1e add r0, r1, #0 add r0, #0xfe @@ -500,13 +500,13 @@ _0222D94A: _0222D974: mov r0, #1 add r1, r0, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #4 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #2 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0x45 mov r1, #0xf lsl r0, r0, #2 @@ -624,7 +624,7 @@ _0222DA5C: ldmia r3!, {r0, r1} stmia r2!, {r0, r1} add r0, sp, #0x18 - bl GX_SetBanks + bl GfGfx_SetBanks add r0, sp, #8 bl SetBothScreensModesAndDisable mov r1, #0 @@ -2511,7 +2511,7 @@ _0222E960: ldmia r3!, {r0, r1} stmia r2!, {r0, r1} add r0, sp, #0x20 - bl GX_SetBanks + bl GfGfx_SetBanks add r0, sp, #0x10 bl SetBothScreensModesAndDisable mov r1, #0 @@ -3250,10 +3250,10 @@ _0222EFC2: bl ov83_0222EA88 mov r0, #1 add r1, r0, #0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes mov r0, #2 mov r1, #0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes mov r1, #0xc6 lsl r1, r1, #6 ldr r0, [r4, #4] @@ -3453,7 +3453,7 @@ ov83_0222F074: ; 0x0222F074 bl sub_0202AC98 mov r0, #1 mov r1, #0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes ldr r0, [r5, #4] add r1, r4, #0 bl ov83_022391EC @@ -6306,7 +6306,7 @@ ov83_022307B4: ; 0x022307B4 _022307C8: mov r0, #0x10 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r0, [r5] mov r1, #0 bl BgClearTilemapBufferAndCommit @@ -6517,8 +6517,8 @@ ov83_02230954: ; 0x02230954 mov r0, #0x56 bl BgConfig_Alloc str r0, [r4] - bl GX_DisableEngineALayers - bl GX_DisableEngineBLayers + bl GfGfx_DisableEngineAPlanes + bl GfGfx_DisableEngineBPlanes bl ov83_022331C0 ldr r0, [r4] bl ov83_02230258 @@ -7606,10 +7606,10 @@ _022312EC: bl ov83_022302B4 mov r0, #1 mov r1, #0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes mov r0, #2 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes add r1, r4, #0 ldr r0, [r4] add r1, #0xdc @@ -10478,7 +10478,7 @@ _0223299E: bl PlaySE mov r0, #0x10 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r0, _02232B7C ; =0x00002B70 mov r1, #0 add r0, r4, r0 @@ -10544,7 +10544,7 @@ _02232A20: bl ov83_0223243C mov r0, #0x10 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0xa str r0, [r5] b _02232CF4 @@ -10570,7 +10570,7 @@ _02232A56: bl DrawFrameAndWindow1 mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes add r0, r4, #0 bl ov83_022324A0 mov r0, #5 @@ -11433,7 +11433,7 @@ _022331CA: sub r2, r2, #1 bne _022331CA add r0, sp, #0 - bl GX_SetBanks + bl GfGfx_SetBanks add sp, #0x28 pop {r4, pc} .align 2, 0 @@ -15840,7 +15840,7 @@ ov83_022351F8: ; 0x022351F8 bl sub_02008AA4 mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes add sp, #0x2c pop {pc} thumb_func_end ov83_022351F8 @@ -17524,13 +17524,13 @@ _02235F48: sub r2, r2, #1 bne _02235F48 add r0, sp, #0x10 - bl GX_SetBanks + bl GfGfx_SetBanks ldr r0, [r4, #0x20] bl ov83_02235E68 ldr r0, _02235FB8 ; =gSystem + 0x60 mov r1, #1 strb r1, [r0, #5] - bl GX_SwapDisplay + bl GfGfx_SwapDisplay bl ResetAllTextPrinters mov r1, #0x1e mov r0, #0 @@ -17865,7 +17865,7 @@ _02236148: bl BgCommitTilemapBufferToVram mov r0, #2 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r1, #7 mov r0, #0 lsl r1, r1, #6 @@ -17945,7 +17945,7 @@ _022362C2: blt _022362C2 mov r0, #2 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r0, _0223632C ; =0x00000498 add r0, r6, r0 bl ov83_02236298 @@ -18094,7 +18094,7 @@ _022363E2: ldr r0, _0223644C ; =gSystem + 0x60 mov r1, #0 strb r1, [r0, #5] - bl GX_SwapDisplay + bl GfGfx_SwapDisplay ldr r0, [r6, #0x20] mov r1, #0 bl FreeBgTilemapBuffer @@ -18671,7 +18671,7 @@ _022368BA: bl Main_SetVBlankIntrCB mov r0, #0x10 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r0, [r4, #4] cmp r0, #1 bne _022368FA @@ -18898,7 +18898,7 @@ _02236A88: bl Main_SetVBlankIntrCB mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes add r0, r4, #0 mov r1, #0 bl ov83_02235C4C @@ -23555,12 +23555,12 @@ _02238CA8: bne _02238D1A mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes b _02238D22 _02238D1A: mov r0, #0x10 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes _02238D22: ldr r0, _02238D34 ; =ov83_02238F00 mov r1, #0 diff --git a/arm9/overlays/84/asm/overlay_84_thumb1.s b/arm9/overlays/84/asm/overlay_84_thumb1.s index 86b5aa0b6..b58b21848 100644 --- a/arm9/overlays/84/asm/overlay_84_thumb1.s +++ b/arm9/overlays/84/asm/overlay_84_thumb1.s @@ -38,8 +38,8 @@ _021D7516: add r1, r0, #0 bl Main_SetVBlankIntrCB bl sub_02015F1C - bl GX_DisableEngineALayers - bl GX_DisableEngineBLayers + bl GfGfx_DisableEngineAPlanes + bl GfGfx_DisableEngineBPlanes mov r2, #1 lsl r2, r2, #0x1a ldr r1, [r2] @@ -565,7 +565,7 @@ ov84_021D7968: ; 0x021D7968 bl BgConfig_Alloc str r0, [r4, #4] ldr r0, _021D7A60 ; =0x021DA68C - bl GX_SetBanks + bl GfGfx_SetBanks ldr r2, _021D7A64 ; =0x04000304 ldr r0, _021D7A68 ; =0xFFFF7FFF ldrh r1, [r2] @@ -768,7 +768,7 @@ ov84_021D7AC8: ; 0x021D7AC8 bl NNS_GfdInitFrmPlttVramManager mov r0, #1 add r1, r0, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r1, _021D7B50 ; =0x04000008 mov r0, #3 ldrh r2, [r1] @@ -1348,10 +1348,10 @@ ov84_021D7F94: ; 0x021D7F94 bl sub_020200D8 mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0x10 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes add sp, #0x30 pop {r4, pc} thumb_func_end ov84_021D7F94 diff --git a/arm9/overlays/84/asm/overlay_84_thumb2.s b/arm9/overlays/84/asm/overlay_84_thumb2.s index 81e44a0ea..aa91ca5ac 100644 --- a/arm9/overlays/84/asm/overlay_84_thumb2.s +++ b/arm9/overlays/84/asm/overlay_84_thumb2.s @@ -1314,7 +1314,7 @@ _021D8AEC: ; jump table _021D8AF4: mov r0, #1 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r1, #0 mov r0, #3 add r2, r1, #0 @@ -1362,7 +1362,7 @@ _021D8B4E: beq _021D8B66 mov r0, #1 add r1, r0, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes add sp, #4 mov r0, #1 pop {r3, r4, pc} @@ -1611,10 +1611,10 @@ _021D8D24: ; jump table _021D8D2C: mov r0, #1 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0x10 mov r1, #0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes mov r1, #0 mov r0, #3 add r2, r1, #0 @@ -1692,10 +1692,10 @@ _021D8DC8: beq _021D8DE6 mov r0, #1 add r1, r0, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0x10 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes mov r0, #1 pop {r3, r4, r5, pc} _021D8DE6: @@ -2473,7 +2473,7 @@ _021D93F4: ; jump table _021D93FC: mov r0, #1 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r1, #0 mov r0, #3 add r2, r1, #0 @@ -2521,7 +2521,7 @@ _021D9456: beq _021D946E mov r0, #1 add r1, r0, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes add sp, #4 mov r0, #1 pop {r3, r4, pc} @@ -3346,7 +3346,7 @@ _021D9AB4: ; jump table _021D9ABC: mov r0, #1 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r1, #0 mov r0, #3 add r2, r1, #0 @@ -3394,7 +3394,7 @@ _021D9B16: beq _021D9B2E mov r0, #1 add r1, r0, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes add sp, #4 mov r0, #1 pop {r3, r4, pc} @@ -3989,7 +3989,7 @@ _021D9FBE: beq _021DA068 mov r0, #1 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes ldr r0, [r4, #0x10] mov r1, #0 bl sub_020200A0 diff --git a/arm9/overlays/85/asm/overlay_85.s b/arm9/overlays/85/asm/overlay_85.s index a3bc0ce7d..cad659623 100644 --- a/arm9/overlays/85/asm/overlay_85.s +++ b/arm9/overlays/85/asm/overlay_85.s @@ -12,8 +12,8 @@ ov85_021D74E0: ; 0x021D74E0 add r1, r0, #0 bl Main_SetVBlankIntrCB bl sub_02015F1C - bl GX_DisableEngineALayers - bl GX_DisableEngineBLayers + bl GfGfx_DisableEngineAPlanes + bl GfGfx_DisableEngineBPlanes mov r2, #2 mov r0, #3 mov r1, #0x4f @@ -273,34 +273,34 @@ ov85_021D76FC: ; 0x021D76FC bl ov85_021D7930 mov r0, #1 add r1, r0, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #2 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #4 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #8 mov r1, #0 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #0x10 mov r1, #1 - bl GX_EngineAToggleLayers + bl GfGfx_EngineATogglePlanes mov r0, #1 mov r1, #0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes mov r0, #2 mov r1, #0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes mov r0, #4 mov r1, #0 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes mov r0, #8 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes mov r0, #0x10 mov r1, #1 - bl GX_EngineBToggleLayers + bl GfGfx_EngineBTogglePlanes ldr r0, _021D77D0 ; =0x04000008 mov r2, #3 ldrh r1, [r0] @@ -383,7 +383,7 @@ _021D7802: sub r2, r2, #1 bne _021D7802 add r0, sp, #0 - bl GX_SetBanks + bl GfGfx_SetBanks add sp, #0x28 pop {r4, pc} .align 2, 0 diff --git a/arm9/overlays/86/asm/overlay_86.s b/arm9/overlays/86/asm/overlay_86.s index e415958da..bac128445 100644 --- a/arm9/overlays/86/asm/overlay_86.s +++ b/arm9/overlays/86/asm/overlay_86.s @@ -43,8 +43,8 @@ ov86_021D74E0: ; 0x021D74E0 mov r0, #0 add r1, r0, #0 bl Main_SetHBlankIntrCB - bl GX_DisableEngineALayers - bl GX_DisableEngineBLayers + bl GfGfx_DisableEngineAPlanes + bl GfGfx_DisableEngineBPlanes mov r2, #1 lsl r2, r2, #0x1a ldr r1, [r2] @@ -65,7 +65,7 @@ ov86_021D74E0: ; 0x021D74E0 ldr r0, _021D7588 ; =ov86_021D76E0 add r1, r4, #0 bl Main_SetVBlankIntrCB - bl GX_BothDispOn + bl GfGfx_BothDispOn mov r0, #1 pop {r3, r4, r5, pc} nop @@ -262,7 +262,7 @@ _021D76F8: sub r2, r2, #1 bne _021D76F8 add r0, sp, #0x2c - bl GX_SetBanks + bl GfGfx_SetBanks ldr r0, [r4] bl BgConfig_Alloc add r3, sp, #0x1c diff --git a/arm9/src/bg_window.c b/arm9/src/bg_window.c index 0220dbefd..45f6c581a 100644 --- a/arm9/src/bg_window.c +++ b/arm9/src/bg_window.c @@ -1,6 +1,6 @@ #include "global.h" #include "bg_window.h" -#include "GX_layers.h" +#include "gf_gfx_planes.h" #include "game_init.h" #include "gx.h" #include "heap.h" @@ -109,17 +109,17 @@ void SetBothScreensModesAndDisable(const GraphicsModes *modes) { GX_SetBGScrOffset(GX_BGSCROFFSET_0x00000); GX_SetBGCharOffset(GX_BGCHAROFFSET_0x00000); - GX_DisableEngineALayers(); - GX_DisableEngineBLayers(); + GfGfx_DisableEngineAPlanes(); + GfGfx_DisableEngineBPlanes(); } void SetScreenModeAndDisable(const struct GraphicsModes *gfxModes, enum GFScreen screen) { if (screen == SCREEN_MAIN) { GX_SetGraphicsMode(gfxModes->dispMode, gfxModes->bgMode, gfxModes->_2d3dMode); - GX_DisableEngineALayers(); + GfGfx_DisableEngineAPlanes(); } else { GXS_SetGraphicsMode(gfxModes->subMode); - GX_DisableEngineBLayers(); + GfGfx_DisableEngineBPlanes(); } } @@ -128,21 +128,21 @@ void InitBgFromTemplate(BgConfig *bgConfig, u8 bgId, const BgTemplate *template, switch (bgId) { case GF_BG_LYR_MAIN_0: - GX_EngineAToggleLayers(GF_BG_LYR_MAIN_0_F, GX_LAYER_TOGGLE_ON); + GfGfx_EngineATogglePlanes(GF_BG_LYR_MAIN_0_F, GX_PLANE_TOGGLE_ON); G2_SetBG0Control((GXBGScrSizeText)screenSize, (GXBGColorMode)template->colorMode, (GXBGScrBase)template->screenBase, (GXBGCharBase)template->charBase, (GXBGExtPltt)template->bgExtPltt); G2_SetBG0Priority(template->priority); G2_BG0Mosaic(template->mosaic); break; case GF_BG_LYR_MAIN_1: - GX_EngineAToggleLayers(GF_BG_LYR_MAIN_1_F, GX_LAYER_TOGGLE_ON); + GfGfx_EngineATogglePlanes(GF_BG_LYR_MAIN_1_F, GX_PLANE_TOGGLE_ON); G2_SetBG1Control((GXBGScrSizeText)screenSize, (GXBGColorMode)template->colorMode, (GXBGScrBase)template->screenBase, (GXBGCharBase)template->charBase, (GXBGExtPltt)template->bgExtPltt); G2_SetBG1Priority(template->priority); G2_BG1Mosaic(template->mosaic); break; case GF_BG_LYR_MAIN_2: - GX_EngineAToggleLayers(GF_BG_LYR_MAIN_2_F, GX_LAYER_TOGGLE_ON); + GfGfx_EngineATogglePlanes(GF_BG_LYR_MAIN_2_F, GX_PLANE_TOGGLE_ON); switch (bgMode) { default: case GF_BG_TYPE_TEXT: @@ -160,7 +160,7 @@ void InitBgFromTemplate(BgConfig *bgConfig, u8 bgId, const BgTemplate *template, break; case GF_BG_LYR_MAIN_3: - GX_EngineAToggleLayers(GF_BG_LYR_MAIN_3_F, GX_LAYER_TOGGLE_ON); + GfGfx_EngineATogglePlanes(GF_BG_LYR_MAIN_3_F, GX_PLANE_TOGGLE_ON); switch (bgMode) { default: case GF_BG_TYPE_TEXT: @@ -178,21 +178,21 @@ void InitBgFromTemplate(BgConfig *bgConfig, u8 bgId, const BgTemplate *template, break; case GF_BG_LYR_SUB_0: - GX_EngineBToggleLayers(GF_BG_LYR_SUB_0_F, GX_LAYER_TOGGLE_ON); + GfGfx_EngineBTogglePlanes(GF_BG_LYR_SUB_0_F, GX_PLANE_TOGGLE_ON); G2S_SetBG0Control((GXBGScrSizeText)screenSize, (GXBGColorMode)template->colorMode, (GXBGScrBase)template->screenBase, (GXBGCharBase)template->charBase, (GXBGExtPltt)template->bgExtPltt); G2S_SetBG0Priority(template->priority); G2S_BG0Mosaic(template->mosaic); break; case GF_BG_LYR_SUB_1: - GX_EngineBToggleLayers(GF_BG_LYR_SUB_1_F, GX_LAYER_TOGGLE_ON); + GfGfx_EngineBTogglePlanes(GF_BG_LYR_SUB_1_F, GX_PLANE_TOGGLE_ON); G2S_SetBG1Control((GXBGScrSizeText)screenSize, (GXBGColorMode)template->colorMode, (GXBGScrBase)template->screenBase, (GXBGCharBase)template->charBase, (GXBGExtPltt)template->bgExtPltt); G2S_SetBG1Priority(template->priority); G2S_BG1Mosaic(template->mosaic); break; case GF_BG_LYR_SUB_2: - GX_EngineBToggleLayers(GF_BG_LYR_SUB_2_F, GX_LAYER_TOGGLE_ON); + GfGfx_EngineBTogglePlanes(GF_BG_LYR_SUB_2_F, GX_PLANE_TOGGLE_ON); switch (bgMode) { default: case GF_BG_TYPE_TEXT: @@ -210,7 +210,7 @@ void InitBgFromTemplate(BgConfig *bgConfig, u8 bgId, const BgTemplate *template, break; case GF_BG_LYR_SUB_3: - GX_EngineBToggleLayers(GF_BG_LYR_SUB_3_F, GX_LAYER_TOGGLE_ON); + GfGfx_EngineBTogglePlanes(GF_BG_LYR_SUB_3_F, GX_PLANE_TOGGLE_ON); switch (bgMode) { default: case GF_BG_TYPE_TEXT: @@ -557,32 +557,32 @@ void SetBgPriority(u8 bgId, u16 priority) { } } -void ToggleBgLayer(u8 bgId, GXLayerToggle toggle) +void ToggleBgLayer(u8 bgId, GXPlaneToggle toggle) { switch (bgId) { case GF_BG_LYR_MAIN_0: - GX_EngineAToggleLayers(GF_BG_LYR_MAIN_0_F, toggle); + GfGfx_EngineATogglePlanes(GF_BG_LYR_MAIN_0_F, toggle); break; case GF_BG_LYR_MAIN_1: - GX_EngineAToggleLayers(GF_BG_LYR_MAIN_1_F, toggle); + GfGfx_EngineATogglePlanes(GF_BG_LYR_MAIN_1_F, toggle); break; case GF_BG_LYR_MAIN_2: - GX_EngineAToggleLayers(GF_BG_LYR_MAIN_2_F, toggle); + GfGfx_EngineATogglePlanes(GF_BG_LYR_MAIN_2_F, toggle); break; case GF_BG_LYR_MAIN_3: - GX_EngineAToggleLayers(GF_BG_LYR_MAIN_3_F, toggle); + GfGfx_EngineATogglePlanes(GF_BG_LYR_MAIN_3_F, toggle); break; case GF_BG_LYR_SUB_0: - GX_EngineBToggleLayers(GF_BG_LYR_SUB_0_F, toggle); + GfGfx_EngineBTogglePlanes(GF_BG_LYR_SUB_0_F, toggle); break; case GF_BG_LYR_SUB_1: - GX_EngineBToggleLayers(GF_BG_LYR_SUB_1_F, toggle); + GfGfx_EngineBTogglePlanes(GF_BG_LYR_SUB_1_F, toggle); break; case GF_BG_LYR_SUB_2: - GX_EngineBToggleLayers(GF_BG_LYR_SUB_2_F, toggle); + GfGfx_EngineBTogglePlanes(GF_BG_LYR_SUB_2_F, toggle); break; case GF_BG_LYR_SUB_3: - GX_EngineBToggleLayers(GF_BG_LYR_SUB_3_F, toggle); + GfGfx_EngineBTogglePlanes(GF_BG_LYR_SUB_3_F, toggle); break; } } diff --git a/arm9/src/blackout_src.c b/arm9/src/blackout_src.c index 15802b3e2..5379188ca 100644 --- a/arm9/src/blackout_src.c +++ b/arm9/src/blackout_src.c @@ -1,9 +1,18 @@ #include "blackout.h" #include "bg_window.h" +#include "constants/maps.h" +#include "msgdata/msg.naix" +#include "msgdata/msg/narc_0328.h" #include "graphic/font.naix" #include "gf_gfx_loader.h" -/*static*/ void Blackout_InitDisplays(BgConfig *bgConfig); +static void Blackout_InitDisplays(BgConfig *bgConfig); +/*static*/ void Blackout_DrawMessage(FieldSystem *fieldSystem, TaskManager *taskManager); + +extern BOOL Task_ShowPrintedBlackoutMessage(TaskManager *taskManager); +extern void sub_020482F4(BlackoutScreenEnvironment *environment, s32 msgNo, u8 x, u8 y); + +extern SaveData *FieldSystem_GetSaveData(FieldSystem *fieldSystem); static const struct GraphicsBanks Blackout_GraphicsBanks = { .bg = GX_VRAM_BG_128_B, @@ -41,7 +50,7 @@ static const BgTemplate Blackout_BgTemplate = { .mosaic = FALSE }; -/*static*/ const WindowTemplate Blackout_WindowTemplate = { +static const WindowTemplate Blackout_WindowTemplate = { .bgId = GF_BG_LYR_MAIN_3, .left = 4, .top = 5, @@ -51,9 +60,36 @@ static const BgTemplate Blackout_BgTemplate = { .baseTile = 0x01 }; -/*static*/ void Blackout_InitDisplays(BgConfig *bgConfig) { +static void Blackout_InitDisplays(BgConfig *bgConfig) { GfGfx_SetBanks(&Blackout_GraphicsBanks); SetBothScreensModesAndDisable(&Blackout_GraphicsModes); InitBgFromTemplate(bgConfig, GF_BG_LYR_MAIN_3, &Blackout_BgTemplate, GF_BG_TYPE_TEXT); GfGfxLoader_GXLoadPal(NARC_GRAPHIC_FONT, NARC_font_narc_0006_NCLR, GF_PAL_LOCATION_MAIN_BG, GF_PAL_SLOT_OFFSET_13, 0x20, HEAP_ID_FIELD); } + +/*static*/ void Blackout_DrawMessage(FieldSystem *fieldSystem, TaskManager *taskManager) { + BlackoutScreenEnvironment *env = AllocFromHeap(HEAP_ID_FIELD, sizeof(BlackoutScreenEnvironment)); + + GF_ASSERT(env != NULL); + memset(env, 0, sizeof(BlackoutScreenEnvironment)); + env->state = 0; + env->fieldSystem = fieldSystem; + env->bgConfig = BgConfig_Alloc(HEAP_ID_FIELD); + + Blackout_InitDisplays(env->bgConfig); + env->msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0328_bin, HEAP_ID_FIELD); + env->msgFmt = MessageFormat_New(HEAP_ID_FIELD); + + AddWindow(env->bgConfig, &env->window, &Blackout_WindowTemplate); + + BufferPlayersName(env->msgFmt, 0, Save_PlayerData_GetProfileAddr(FieldSystem_GetSaveData(fieldSystem))); + if (fieldSystem->location->mapId == MAP_T01R0201) { + // {STRVAR_1 3, 0} scurried back\nhome, protecting the exhausted\nand fainted Pokémon from further\nharm... + sub_020482F4(env, narc_0328_00004, 0, 0); + } else { + // {STRVAR_1 3, 0} scurried to\na Pokémon Center, protecting\nthe exhausted and fainted\nPokémon from further harm... + sub_020482F4(env, narc_0328_00003, 0, 0); + } + CopyWindowToVram(&env->window); + TaskManager_Call(taskManager, Task_ShowPrintedBlackoutMessage, env); +} diff --git a/arm9/src/communication_error.c b/arm9/src/communication_error.c index 06f40e397..29c6d242d 100644 --- a/arm9/src/communication_error.c +++ b/arm9/src/communication_error.c @@ -1,6 +1,7 @@ #include "global.h" #include "bg_window.h" #include "communication_error.h" +#include "constants/rgb.h" #include "game_init.h" #include "MI_dma.h" #include "msgdata.h" @@ -99,8 +100,8 @@ void ShowCommunicationError(HeapID heapId, u32 error, u32 errorCode) { Main_SetVBlankIntrCB(NULL, NULL); Main_SetHBlankIntrCB(NULL, NULL); - GX_DisableEngineALayers(); - GX_DisableEngineBLayers(); + GfGfx_DisableEngineAPlanes(); + GfGfx_DisableEngineBPlanes(); GX_SetVisiblePlane(0); GXS_SetVisiblePlane(0); @@ -108,12 +109,12 @@ void ShowCommunicationError(HeapID heapId, u32 error, u32 errorCode) { gSystem.screensFlipped = FALSE; - GX_SwapDisplay(); + GfGfx_SwapDisplay(); G2_BlendNone(); G2S_BlendNone(); GX_SetVisibleWnd(0); GXS_SetVisibleWnd(0); - GX_SetBanks(&sCommunicationErrorGraphicsBanks); + GfGfx_SetBanks(&sCommunicationErrorGraphicsBanks); BgConfig* bgConfig = BgConfig_Alloc(heapId); SetBothScreensModesAndDisable(&sCommunicationErrorGraphicsModes); @@ -122,8 +123,8 @@ void ShowCommunicationError(HeapID heapId, u32 error, u32 errorCode) { LoadUserFrameGfx1(bgConfig, GF_BG_LYR_MAIN_0, 0x01F7, 2, 0, heapId); LoadFontPal0(GF_PAL_LOCATION_MAIN_BG, GF_PAL_SLOT_OFFSET_1, heapId); BG_ClearCharDataRange(GF_BG_LYR_MAIN_0, 0x20, 0, heapId); - BG_SetMaskColor(GF_BG_LYR_MAIN_0, GX_RGB(1, 1, 27)); - BG_SetMaskColor(GF_BG_LYR_SUB_0, GX_RGB(1, 1, 27)); + BG_SetMaskColor(GF_BG_LYR_MAIN_0, RGB(1, 1, 27)); + BG_SetMaskColor(GF_BG_LYR_SUB_0, RGB(1, 1, 27)); MsgData* errorMessageData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0200_bin, heapId); String* errorMessageStr = String_New(384, heapId); @@ -142,7 +143,7 @@ void ShowCommunicationError(HeapID heapId, u32 error, u32 errorCode) { String_Delete(errorMessageStr); // BUG: tmp_str is never destroyed. - GX_BothDispOn(); + GfGfx_BothDispOn(); SetMasterBrightnessNeutral(PM_LCD_TOP); SetMasterBrightnessNeutral(PM_LCD_BOTTOM); SetBlendBrightness(0, (GXBlendPlaneMask)(GX_BLEND_PLANEMASK_BD | GX_BLEND_PLANEMASK_OBJ | GX_BLEND_PLANEMASK_BG3 | GX_BLEND_PLANEMASK_BG2 | GX_BLEND_PLANEMASK_BG1 | GX_BLEND_PLANEMASK_BG0), SCREEN_MASK_MAIN | SCREEN_MASK_SUB); diff --git a/arm9/src/error_message_reset.c b/arm9/src/error_message_reset.c index d98c31015..459201375 100644 --- a/arm9/src/error_message_reset.c +++ b/arm9/src/error_message_reset.c @@ -1,6 +1,7 @@ #include "global.h" #include "error_message_reset.h" -#include "GX_layers.h" +#include "constants/rgb.h" +#include "gf_gfx_planes.h" #include "gx.h" #include "heap.h" #include "unk_02031734.h" @@ -97,8 +98,8 @@ void PrintErrorMessageAndReset() Main_SetVBlankIntrCB(NULL, NULL); Main_SetHBlankIntrCB(NULL, NULL); - GX_DisableEngineALayers(); - GX_DisableEngineBLayers(); + GfGfx_DisableEngineAPlanes(); + GfGfx_DisableEngineBPlanes(); GX_SetVisiblePlane(0); GXS_SetVisiblePlane(0); @@ -106,7 +107,7 @@ void PrintErrorMessageAndReset() SetKeyRepeatTimers(4, 8); gSystem.screensFlipped = FALSE; - GX_SwapDisplay(); + GfGfx_SwapDisplay(); G2_BlendNone(); G2S_BlendNone(); @@ -114,7 +115,7 @@ void PrintErrorMessageAndReset() GX_SetVisibleWnd(0); GXS_SetVisibleWnd(0); - GX_SetBanks(&sErrorMessageBanksConfig); + GfGfx_SetBanks(&sErrorMessageBanksConfig); ptr = BgConfig_Alloc(HEAP_ID_DEFAULT); SetBothScreensModesAndDisable(&sErrorMessageBgModeSet); @@ -125,8 +126,8 @@ void PrintErrorMessageAndReset() LoadFontPal0(GF_PAL_LOCATION_MAIN_BG, GF_PAL_SLOT_OFFSET_1, HEAP_ID_DEFAULT); BG_ClearCharDataRange(GF_BG_LYR_MAIN_0, 0x20, 0, HEAP_ID_DEFAULT); - BG_SetMaskColor(GF_BG_LYR_MAIN_0, GX_RGB(1, 1, 27)); - BG_SetMaskColor(GF_BG_LYR_SUB_0, GX_RGB(1, 1, 27)); + BG_SetMaskColor(GF_BG_LYR_MAIN_0, RGB(1, 1, 27)); + BG_SetMaskColor(GF_BG_LYR_SUB_0, RGB(1, 1, 27)); struct MsgData *msg_data = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0200_bin, HEAP_ID_DEFAULT); struct String *str = String_New(6 << 6, HEAP_ID_DEFAULT); @@ -141,7 +142,7 @@ void PrintErrorMessageAndReset() AddTextPrinterParameterized(&buf, 0, str, 0, 0, 0, NULL); String_Delete(str); - GX_BothDispOn(); + GfGfx_BothDispOn(); SetMasterBrightnessNeutral(PM_LCD_TOP); SetMasterBrightnessNeutral(PM_LCD_BOTTOM); SetBlendBrightness(0, (GXBlendPlaneMask)(GX_BLEND_PLANEMASK_BD | GX_BLEND_PLANEMASK_OBJ | GX_BLEND_PLANEMASK_BG3 | GX_BLEND_PLANEMASK_BG2 | GX_BLEND_PLANEMASK_BG1 | GX_BLEND_PLANEMASK_BG0), SCREEN_MASK_MAIN | SCREEN_MASK_SUB); diff --git a/arm9/src/GX_layers.c b/arm9/src/gf_gfx_planes.c similarity index 53% rename from arm9/src/GX_layers.c rename to arm9/src/gf_gfx_planes.c index 5ae258291..126a187c0 100644 --- a/arm9/src/GX_layers.c +++ b/arm9/src/gf_gfx_planes.c @@ -1,15 +1,15 @@ #include "global.h" -#include "GX_layers.h" +#include "gf_gfx_planes.h" #include "GX_vramcnt.h" #include "gx.h" #include "main.h" -/* TODO: rename - name implies that this is part of the SDK, when it is a GF custom */ +/* TODO: cleanup this file, it changed a lot in HG, so needs to be reflected here */ -static u32 EngineA_DISPCNT_LayerMask; -static u32 EngineB_DISPCNT_LayerMask; +static u32 sEngineAPlanes; +static u32 sEngineBPlanes; -void GX_SetBanks(const struct GraphicsBanks *banks) +void GfGfx_SetBanks(const struct GraphicsBanks *banks) { GX_ResetBankForBG(); GX_ResetBankForBGExtPltt(); @@ -35,69 +35,69 @@ void GX_SetBanks(const struct GraphicsBanks *banks) } -void GX_DisableEngineALayers() +void GfGfx_DisableEngineAPlanes() { - EngineA_DISPCNT_LayerMask = 0; + sEngineAPlanes = 0; } -void GX_EngineAToggleLayers(u32 layer_mask, GXLayerToggle layer_toggle) +void GfGfx_EngineATogglePlanes(u32 layer_mask, GXPlaneToggle layer_toggle) { - if (layer_toggle == GX_LAYER_TOGGLE_ON) + if (layer_toggle == GX_PLANE_TOGGLE_ON) { - if ((EngineA_DISPCNT_LayerMask & layer_mask) != 0) + if ((sEngineAPlanes & layer_mask) != 0) { return; } } else { - if ((EngineA_DISPCNT_LayerMask & layer_mask) == 0) + if ((sEngineAPlanes & layer_mask) == 0) { return; } } - GX_SetVisiblePlane(EngineA_DISPCNT_LayerMask ^= layer_mask); + GX_SetVisiblePlane(sEngineAPlanes ^= layer_mask); } -void GX_SetEngineALayers(u32 layer_mask) +void GfGfx_EngineASetPlanes(u32 layer_mask) { - EngineA_DISPCNT_LayerMask = layer_mask; + sEngineAPlanes = layer_mask; GX_SetVisiblePlane(layer_mask); } -void GX_DisableEngineBLayers() +void GfGfx_DisableEngineBPlanes() { - EngineB_DISPCNT_LayerMask = 0; + sEngineBPlanes = 0; } -void GX_EngineBToggleLayers(u32 layer_mask, GXLayerToggle layer_toggle) +void GfGfx_EngineBTogglePlanes(u32 layer_mask, GXPlaneToggle layer_toggle) { - if (layer_toggle == GX_LAYER_TOGGLE_ON) + if (layer_toggle == GX_PLANE_TOGGLE_ON) { - if ((EngineB_DISPCNT_LayerMask & layer_mask) != 0) + if ((sEngineBPlanes & layer_mask) != 0) { return; } } else { - if ((EngineB_DISPCNT_LayerMask & layer_mask) == 0) + if ((sEngineBPlanes & layer_mask) == 0) { return; } } - GXS_SetVisiblePlane(EngineB_DISPCNT_LayerMask ^= layer_mask); + GXS_SetVisiblePlane(sEngineBPlanes ^= layer_mask); } -void GX_BothDispOn() +void GfGfx_BothDispOn() { GX_DispOn(); GXS_DispOn(); } -void GX_SwapDisplay() +void GfGfx_SwapDisplay() { if (gSystem.screensFlipped == 0) { @@ -109,7 +109,7 @@ void GX_SwapDisplay() } } -u32 GX_GetEngineALayers() +u32 GfGfx_EngineAGetPlanes() { - return EngineA_DISPCNT_LayerMask; + return sEngineAPlanes; } diff --git a/arm9/src/render_window.c b/arm9/src/render_window.c index fff162664..dd33026b7 100644 --- a/arm9/src/render_window.c +++ b/arm9/src/render_window.c @@ -777,7 +777,7 @@ void sub_0200DE30(struct UnkStruct_0200CABC_2 *param0, u8 param1, u8 param2) ((u16 *)UNK_020ECEC0)[1] = (u16)((param2 + 5) * 8); param0->unk164 = ov05_021D9820(param0, UNK_020ECEC0); sub_0201FDEC(param0->unk000); - GX_EngineBToggleLayers(0x10, GX_LAYER_TOGGLE_ON); + GfGfx_EngineBTogglePlanes(0x10, GX_PLANE_TOGGLE_ON); } void sub_0200DE80(struct UnkStruct_0200CABC_2 *param0, u16 param1, u8 param2) diff --git a/arm9/src/save_data_read_error.c b/arm9/src/save_data_read_error.c index e85d8b178..56cc7da13 100644 --- a/arm9/src/save_data_read_error.c +++ b/arm9/src/save_data_read_error.c @@ -1,6 +1,7 @@ #include "global.h" #include "bg_window.h" #include "brightness.h" +#include "constants/rgb.h" #include "font.h" #include "game_init.h" #include "msgdata.h" @@ -69,8 +70,8 @@ void ShowSaveDataReadError(HeapID heapId) Main_SetVBlankIntrCB(NULL, NULL); Main_SetHBlankIntrCB(NULL, NULL); - GX_DisableEngineALayers(); - GX_DisableEngineBLayers(); + GfGfx_DisableEngineAPlanes(); + GfGfx_DisableEngineBPlanes(); GX_SetVisiblePlane(0); GXS_SetVisiblePlane(0); @@ -78,12 +79,12 @@ void ShowSaveDataReadError(HeapID heapId) gSystem.screensFlipped = FALSE; - GX_SwapDisplay(); + GfGfx_SwapDisplay(); G2_BlendNone(); G2S_BlendNone(); GX_SetVisibleWnd(0); GXS_SetVisibleWnd(0); - GX_SetBanks(&sSaveDataReadErrorGraphicsBanks); + GfGfx_SetBanks(&sSaveDataReadErrorGraphicsBanks); struct BgConfig* bg_config = BgConfig_Alloc(heapId); @@ -94,8 +95,8 @@ void ShowSaveDataReadError(HeapID heapId) LoadUserFrameGfx1(bg_config, GF_BG_LYR_MAIN_0, 0x01F7, 2, 0, heapId); LoadFontPal0(GF_PAL_LOCATION_MAIN_BG, GF_PAL_SLOT_OFFSET_1, heapId); BG_ClearCharDataRange(GF_BG_LYR_MAIN_0, 0x20, 0, heapId); - BG_SetMaskColor(GF_BG_LYR_MAIN_0, GX_RGB(1, 1, 27)); - BG_SetMaskColor(GF_BG_LYR_SUB_0, GX_RGB(1, 1, 27)); + BG_SetMaskColor(GF_BG_LYR_MAIN_0, RGB(1, 1, 27)); + BG_SetMaskColor(GF_BG_LYR_SUB_0, RGB(1, 1, 27)); struct MsgData* msg_data = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0005_bin, heapId); struct String* str = String_New(384, heapId); @@ -110,7 +111,7 @@ void ShowSaveDataReadError(HeapID heapId) AddTextPrinterParameterized(&window, 0, str, 0, 0, 0, NULL); String_Delete(str); - GX_BothDispOn(); + GfGfx_BothDispOn(); SetMasterBrightnessNeutral(PM_LCD_TOP); SetMasterBrightnessNeutral(PM_LCD_BOTTOM); SetBlendBrightness(0, (GXBlendPlaneMask)(GX_BLEND_PLANEMASK_BD | GX_BLEND_PLANEMASK_OBJ | GX_BLEND_PLANEMASK_BG3 | GX_BLEND_PLANEMASK_BG2 | GX_BLEND_PLANEMASK_BG1 | GX_BLEND_PLANEMASK_BG0), SCREEN_MASK_MAIN | SCREEN_MASK_SUB); @@ -132,8 +133,8 @@ void ShowGBACartRemovedError(HeapID heapId) Main_SetVBlankIntrCB(NULL, NULL); Main_SetHBlankIntrCB(NULL, NULL); - GX_DisableEngineALayers(); - GX_DisableEngineBLayers(); + GfGfx_DisableEngineAPlanes(); + GfGfx_DisableEngineBPlanes(); GX_SetVisiblePlane(0); GXS_SetVisiblePlane(0); @@ -141,12 +142,12 @@ void ShowGBACartRemovedError(HeapID heapId) gSystem.screensFlipped = FALSE; - GX_SwapDisplay(); + GfGfx_SwapDisplay(); G2_BlendNone(); G2S_BlendNone(); GX_SetVisibleWnd(0); GXS_SetVisibleWnd(0); - GX_SetBanks(&sSaveDataReadErrorGraphicsBanks); + GfGfx_SetBanks(&sSaveDataReadErrorGraphicsBanks); struct BgConfig* bg_config = BgConfig_Alloc(heapId); @@ -157,8 +158,8 @@ void ShowGBACartRemovedError(HeapID heapId) LoadUserFrameGfx1(bg_config, GF_BG_LYR_MAIN_0, 0x01F7, 2, 0, heapId); LoadFontPal0(GF_PAL_LOCATION_MAIN_BG, GF_PAL_SLOT_OFFSET_1, heapId); BG_ClearCharDataRange(GF_BG_LYR_MAIN_0, 0x20, 0, heapId); - BG_SetMaskColor(GF_BG_LYR_MAIN_0, GX_RGB(1, 1, 27)); - BG_SetMaskColor(GF_BG_LYR_SUB_0, GX_RGB(1, 1, 27)); + BG_SetMaskColor(GF_BG_LYR_MAIN_0, RGB(1, 1, 27)); + BG_SetMaskColor(GF_BG_LYR_SUB_0, RGB(1, 1, 27)); struct MsgData* msg_data = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0005_bin, heapId); struct String* str = String_New(384, heapId); @@ -173,7 +174,7 @@ void ShowGBACartRemovedError(HeapID heapId) AddTextPrinterParameterized(&window, 0, str, 0, 0, 0, NULL); String_Delete(str); - GX_BothDispOn(); + GfGfx_BothDispOn(); SetMasterBrightnessNeutral(PM_LCD_TOP); SetMasterBrightnessNeutral(PM_LCD_BOTTOM); SetBlendBrightness(0, (GXBlendPlaneMask)(GX_BLEND_PLANEMASK_BD | GX_BLEND_PLANEMASK_OBJ | GX_BLEND_PLANEMASK_BG3 | GX_BLEND_PLANEMASK_BG2 | GX_BLEND_PLANEMASK_BG1 | GX_BLEND_PLANEMASK_BG0), SCREEN_MASK_MAIN | SCREEN_MASK_SUB); diff --git a/arm9/src/save_data_write_error.c b/arm9/src/save_data_write_error.c index 6eec9035c..2d4ce9299 100644 --- a/arm9/src/save_data_write_error.c +++ b/arm9/src/save_data_write_error.c @@ -1,6 +1,7 @@ #include "global.h" #include "bg_window.h" #include "brightness.h" +#include "constants/rgb.h" #include "font.h" #include "game_init.h" #include "msgdata.h" @@ -77,8 +78,8 @@ void ShowSaveDataWriteError(HeapID heapId, u32 err_no) Main_SetVBlankIntrCB(NULL, NULL); Main_SetHBlankIntrCB(NULL, NULL); - GX_DisableEngineALayers(); - GX_DisableEngineBLayers(); + GfGfx_DisableEngineAPlanes(); + GfGfx_DisableEngineBPlanes(); GX_SetVisiblePlane(0); GXS_SetVisiblePlane(0); @@ -86,12 +87,12 @@ void ShowSaveDataWriteError(HeapID heapId, u32 err_no) gSystem.screensFlipped = FALSE; - GX_SwapDisplay(); + GfGfx_SwapDisplay(); G2_BlendNone(); G2S_BlendNone(); GX_SetVisibleWnd(0); GXS_SetVisibleWnd(0); - GX_SetBanks(&sSaveDataWriteErrorGraphicsBanks); + GfGfx_SetBanks(&sSaveDataWriteErrorGraphicsBanks); struct BgConfig* bg_config = BgConfig_Alloc(heapId); @@ -102,8 +103,8 @@ void ShowSaveDataWriteError(HeapID heapId, u32 err_no) LoadUserFrameGfx1(bg_config, GF_BG_LYR_MAIN_0, 0x01F7, 2, 0, heapId); LoadFontPal0(GF_PAL_LOCATION_MAIN_BG, GF_PAL_SLOT_OFFSET_1, heapId); BG_ClearCharDataRange(GF_BG_LYR_MAIN_0, 0x20, 0, heapId); - BG_SetMaskColor(GF_BG_LYR_MAIN_0, GX_RGB(1, 1, 27)); - BG_SetMaskColor(GF_BG_LYR_SUB_0, GX_RGB(1, 1, 27)); + BG_SetMaskColor(GF_BG_LYR_MAIN_0, RGB(1, 1, 27)); + BG_SetMaskColor(GF_BG_LYR_SUB_0, RGB(1, 1, 27)); struct MsgData* msg_data = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0006_bin, heapId); struct String* str = String_New(384, heapId); @@ -118,7 +119,7 @@ void ShowSaveDataWriteError(HeapID heapId, u32 err_no) AddTextPrinterParameterized(&window, 0, str, 0, 0, 0, NULL); String_Delete(str); - GX_BothDispOn(); + GfGfx_BothDispOn(); SetMasterBrightnessNeutral(PM_LCD_TOP); SetMasterBrightnessNeutral(PM_LCD_BOTTOM); SetBlendBrightness(0, (GXBlendPlaneMask)(GX_BLEND_PLANEMASK_BD | GX_BLEND_PLANEMASK_OBJ | GX_BLEND_PLANEMASK_BG3 | GX_BLEND_PLANEMASK_BG2 | GX_BLEND_PLANEMASK_BG1 | GX_BLEND_PLANEMASK_BG0), SCREEN_MASK_MAIN | SCREEN_MASK_SUB); diff --git a/arm9/src/unk_0204AF24.c b/arm9/src/unk_0204AF24.c index 338490ffb..53e4eef44 100644 --- a/arm9/src/unk_0204AF24.c +++ b/arm9/src/unk_0204AF24.c @@ -1,4 +1,5 @@ #include "global.h" +#include "constants/rgb.h" #include "gx.h" #include "unk_0204AF24.h" @@ -66,7 +67,7 @@ void CallTask_FadeToBlack(struct TaskManager *taskManager) GF_ASSERT(0); return; } - BeginNormalPaletteFade(0, 0, 0, GX_RGB_BLACK, 6, 1, HEAP_ID_4); //TODO: find constants for palette fade + BeginNormalPaletteFade(0, 0, 0, RGB_BLACK, 6, 1, HEAP_ID_4); //TODO: find constants for palette fade TaskManager_Call(taskManager, Task_ProcessFade, 0); } @@ -77,7 +78,7 @@ void CallTask_FadeFromBlack(struct TaskManager *taskManager) GF_ASSERT(0); return; } - BeginNormalPaletteFade(0, 1, 1, GX_RGB_BLACK, 6, 1, HEAP_ID_4); + BeginNormalPaletteFade(0, 1, 1, RGB_BLACK, 6, 1, HEAP_ID_4); TaskManager_Call(taskManager, Task_ProcessFade, 0); } diff --git a/arm9/src/wfc_user_info_warning.c b/arm9/src/wfc_user_info_warning.c index 0c9e17471..f4d030dd9 100644 --- a/arm9/src/wfc_user_info_warning.c +++ b/arm9/src/wfc_user_info_warning.c @@ -1,9 +1,10 @@ #include "global.h" #include "bg_window.h" +#include "constants/rgb.h" #include "filesystem.h" #include "font.h" #include "game_init.h" -#include "GX_layers.h" +#include "gf_gfx_planes.h" #include "main.h" #include "msgdata.h" #include "msgdata/msg.naix" @@ -76,8 +77,8 @@ void ShowWFCUserInfoWarning(HeapID heapId, u32 a1) Main_SetVBlankIntrCB(NULL, NULL); Main_SetHBlankIntrCB(NULL, NULL); - GX_DisableEngineALayers(); - GX_DisableEngineBLayers(); + GfGfx_DisableEngineAPlanes(); + GfGfx_DisableEngineBPlanes(); GX_SetVisiblePlane(0); GXS_SetVisiblePlane(0); @@ -85,12 +86,12 @@ void ShowWFCUserInfoWarning(HeapID heapId, u32 a1) gSystem.screensFlipped = 0; - GX_SwapDisplay(); + GfGfx_SwapDisplay(); G2_BlendNone(); G2S_BlendNone(); GX_SetVisibleWnd(0); GXS_SetVisibleWnd(0); - GX_SetBanks(&sWFCWarningMsgGraphicsBanks); + GfGfx_SetBanks(&sWFCWarningMsgGraphicsBanks); struct BgConfig* bg_config = BgConfig_Alloc(heapId); @@ -101,8 +102,8 @@ void ShowWFCUserInfoWarning(HeapID heapId, u32 a1) LoadUserFrameGfx1(bg_config, GF_BG_LYR_MAIN_0, 0x01F7, 2, 0, heapId); LoadFontPal0(GF_PAL_LOCATION_MAIN_BG, GF_PAL_SLOT_OFFSET_1, heapId); BG_ClearCharDataRange(GF_BG_LYR_MAIN_0, 0x20, 0, heapId); - BG_SetMaskColor(GF_BG_LYR_MAIN_0, GX_RGB(1, 1, 27)); - BG_SetMaskColor(GF_BG_LYR_SUB_0, GX_RGB(1, 1, 27)); + BG_SetMaskColor(GF_BG_LYR_MAIN_0, RGB(1, 1, 27)); + BG_SetMaskColor(GF_BG_LYR_SUB_0, RGB(1, 1, 27)); struct MsgData* warning_messages_data = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0613_bin, heapId); struct String* warning_message = String_New(384, heapId); @@ -115,7 +116,7 @@ void ShowWFCUserInfoWarning(HeapID heapId, u32 a1) AddTextPrinterParameterized(&window, 0, warning_message, 0, 0, 0, 0); String_Delete(warning_message); - GX_BothDispOn(); + GfGfx_BothDispOn(); SetMasterBrightnessNeutral(PM_LCD_TOP); SetMasterBrightnessNeutral(PM_LCD_BOTTOM); SetBlendBrightness(0, (GXBlendPlaneMask)(GX_BLEND_PLANEMASK_BD | GX_BLEND_PLANEMASK_OBJ | GX_BLEND_PLANEMASK_BG3 | GX_BLEND_PLANEMASK_BG2 | GX_BLEND_PLANEMASK_BG1 | GX_BLEND_PLANEMASK_BG0), SCREEN_MASK_MAIN | SCREEN_MASK_SUB); @@ -137,14 +138,14 @@ void ShowWFCUserInfoWarning(HeapID heapId, u32 a1) RemoveWindow(&window); DestroyMsgData(warning_messages_data); - ToggleBgLayer(GF_BG_LYR_MAIN_0, GX_LAYER_TOGGLE_OFF); - ToggleBgLayer(GF_BG_LYR_MAIN_1, GX_LAYER_TOGGLE_OFF); - ToggleBgLayer(GF_BG_LYR_MAIN_2, GX_LAYER_TOGGLE_OFF); - ToggleBgLayer(GF_BG_LYR_MAIN_3, GX_LAYER_TOGGLE_OFF); - ToggleBgLayer(GF_BG_LYR_SUB_0, GX_LAYER_TOGGLE_OFF); - ToggleBgLayer(GF_BG_LYR_SUB_1, GX_LAYER_TOGGLE_OFF); - ToggleBgLayer(GF_BG_LYR_SUB_2, GX_LAYER_TOGGLE_OFF); - ToggleBgLayer(GF_BG_LYR_SUB_3, GX_LAYER_TOGGLE_OFF); + ToggleBgLayer(GF_BG_LYR_MAIN_0, GX_PLANE_TOGGLE_OFF); + ToggleBgLayer(GF_BG_LYR_MAIN_1, GX_PLANE_TOGGLE_OFF); + ToggleBgLayer(GF_BG_LYR_MAIN_2, GX_PLANE_TOGGLE_OFF); + ToggleBgLayer(GF_BG_LYR_MAIN_3, GX_PLANE_TOGGLE_OFF); + ToggleBgLayer(GF_BG_LYR_SUB_0, GX_PLANE_TOGGLE_OFF); + ToggleBgLayer(GF_BG_LYR_SUB_1, GX_PLANE_TOGGLE_OFF); + ToggleBgLayer(GF_BG_LYR_SUB_2, GX_PLANE_TOGGLE_OFF); + ToggleBgLayer(GF_BG_LYR_SUB_3, GX_PLANE_TOGGLE_OFF); FreeBgTilemapBuffer(bg_config, GF_BG_LYR_MAIN_0); FreeToHeap(bg_config); diff --git a/include/GX_layers.h b/include/GX_layers.h deleted file mode 100644 index 40bae267c..000000000 --- a/include/GX_layers.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef POKEDIAMOND_GX_LAYERS_H -#define POKEDIAMOND_GX_LAYERS_H - - -#include "global.h" -#include "gx.h" - - -typedef enum { - GX_LAYER_TOGGLE_OFF, - GX_LAYER_TOGGLE_ON, -} GXLayerToggle; - -typedef struct GraphicsBanks -{ - s32 bg; - s32 bgextpltt; - s32 subbg; - s32 subbgextpltt; - s32 obj; - s32 objextpltt; - s32 subobj; - s32 subobjextpltt; - s32 tex; - s32 texpltt; -} GraphicsBanks; - -typedef struct GraphicsModes { - GXDispMode dispMode; - GXBGMode bgMode; - GXBGMode subMode; - GXBG0As _2d3dMode; -} GraphicsModes; - -void GX_SetBanks(const struct GraphicsBanks *banks); -void GX_DisableEngineALayers(void); -void GX_EngineAToggleLayers(u32 layer_mask, GXLayerToggle layer_toggle); -void GX_SetEngineALayers(u32 layer_mask); -void GX_DisableEngineBLayers(void); -void GX_EngineBToggleLayers(u32 layer_mask, GXLayerToggle layer_toggle); -void GX_BothDispOn(void); -void GX_SwapDisplay(void); -u32 GX_GetEngineALayers(void); - -#endif //POKEDIAMOND_GX_LAYERS_H diff --git a/include/bg_window.h b/include/bg_window.h index e2b5e4670..5f50d4542 100644 --- a/include/bg_window.h +++ b/include/bg_window.h @@ -3,7 +3,7 @@ #include "NNS_g2d.h" #include "global.h" -#include "GX_layers.h" +#include "gf_gfx_planes.h" #include "MI_uncompress.h" #include "OS_cache.h" #include "gx.h" @@ -213,7 +213,7 @@ void InitBgFromTemplate(BgConfig *bgConfig, u8 bgId, const BgTemplate *template, void SetBgControlParam(BgConfig *config, u8 bgId, enum GFBgCntSet attr, u8 value); void FreeBgTilemapBuffer(BgConfig *bgConfig, u8 bgId); void SetBgPriority(u8 bgId, u16 priority); -void ToggleBgLayer(u8 bgId, GXLayerToggle toggle); +void ToggleBgLayer(u8 bgId, GXPlaneToggle toggle); void BgSetPosTextAndCommit(BgConfig *bgConfig, u8 bgId, enum BgPosAdjustOp op, fx32 val); fx32 Bg_GetXpos(const BgConfig *bgConfig, enum GFBgLayer bgId); fx32 Bg_GetYpos(BgConfig *bgConfig, enum GFBgLayer bgId); diff --git a/include/constants/rgb.h b/include/constants/rgb.h new file mode 100644 index 000000000..6095fe0f1 --- /dev/null +++ b/include/constants/rgb.h @@ -0,0 +1,11 @@ +#ifndef POKEDIAMOND_CONSTANTS_RGB_H +#define POKEDIAMOND_CONSTANTS_RGB_H + +#include "GXcommon.h" //todo change the name of this thing + +#define RGB(r, g, b) (GX_RGB(r, g, b)) + +#define RGB_BLACK (RGB(0, 0, 0)) +#define RGB_WHITE (RGB(31, 31, 31)) + +#endif //POKEDIAMOND_CONSTANTS_RGB_H diff --git a/include/gf_gfx_planes.h b/include/gf_gfx_planes.h new file mode 100644 index 000000000..0d0b1c600 --- /dev/null +++ b/include/gf_gfx_planes.h @@ -0,0 +1,45 @@ +#ifndef POKEDIAMOND_GF_GX_PLANES_H +#define POKEDIAMOND_GF_GX_PLANES_H + + +#include "global.h" +#include "gx.h" + + +typedef enum { + GX_PLANE_TOGGLE_OFF, + GX_PLANE_TOGGLE_ON, +} GXPlaneToggle; + +typedef struct GraphicsBanks +{ + GXVRamBG bg; + GXVRamBGExtPltt bgextpltt; + GXVRamSubBG subbg; + GXVRamSubBGExtPltt subbgextpltt; + GXVRamOBJ obj; + GXVRamOBJExtPltt objextpltt; + GXVRamSubOBJ subobj; + GXVRamSubOBJExtPltt subobjextpltt; + GXVRamTex tex; + GXVRamTexPltt texpltt; +} GraphicsBanks; + +typedef struct GraphicsModes { + GXDispMode dispMode; + GXBGMode bgMode; + GXBGMode subMode; + GXBG0As _2d3dMode; +} GraphicsModes; + +void GfGfx_SetBanks(const struct GraphicsBanks *banks); +void GfGfx_DisableEngineAPlanes(void); +void GfGfx_EngineATogglePlanes(u32 layer_mask, GXPlaneToggle layer_toggle); +void GfGfx_EngineASetPlanes(u32 layer_mask); +void GfGfx_DisableEngineBPlanes(void); +void GfGfx_EngineBTogglePlanes(u32 layer_mask, GXPlaneToggle layer_toggle); +void GfGfx_BothDispOn(void); +void GfGfx_SwapDisplay(void); +u32 GfGfx_EngineAGetPlanes(void); + +#endif //POKEDIAMOND_GF_GX_PLANES_H From 7cbd2d4e827eafe1cb8bf4d30134d46a1d6e443e Mon Sep 17 00:00:00 2001 From: red031000 Date: Fri, 15 Dec 2023 13:50:37 +0000 Subject: [PATCH 3/9] Task_ShowPrintedBlackoutMessage --- arm9/asm/blackout_asm.s | 110 --------------------------------------- arm9/src/blackout_src.c | 45 +++++++++++++++- arm9/src/gf_gfx_loader.c | 2 +- 3 files changed, 45 insertions(+), 112 deletions(-) diff --git a/arm9/asm/blackout_asm.s b/arm9/asm/blackout_asm.s index 5f2d404ed..ff2178fb8 100644 --- a/arm9/asm/blackout_asm.s +++ b/arm9/asm/blackout_asm.s @@ -6,116 +6,6 @@ .text - thumb_func_start Task_ShowPrintedBlackoutMessage -Task_ShowPrintedBlackoutMessage: ; 0x02048214 - push {r3-r4, lr} - sub sp, #0xc - bl TaskManager_GetEnvironment - add r4, r0, #0x0 - ldr r0, [r4, #0x0] - cmp r0, #0x4 - bhi _020482EA - add r0, r0, r0 - add r0, pc - ldrh r0, [r0, #0x6] - lsl r0, r0, #0x10 - asr r0, r0, #0x10 - add pc, r0 -_02048230: ; jump table (using 16-bit offset) - .short _0204823A - _02048230 - 2; case 0 - .short _02048258 - _02048230 - 2; case 1 - .short _02048268 - _02048230 - 2; case 2 - .short _02048298 - _02048230 - 2; case 3 - .short _020482B2 - _02048230 - 2; case 4 -_0204823A: - mov r0, #0x8 - str r0, [sp, #0x0] - mov r1, #0x1 - str r1, [sp, #0x4] - mov r0, #0x20 - str r0, [sp, #0x8] - mov r0, #0x3 - mov r2, #0x2a - mov r3, #0x0 - bl BeginNormalPaletteFade - ldr r0, [r4, #0x0] - add r0, r0, #0x1 - str r0, [r4, #0x0] - b _020482EA -_02048258: - bl IsPaletteFadeFinished - cmp r0, #0x0 - beq _020482EA - ldr r0, [r4, #0x0] - add r0, r0, #0x1 - str r0, [r4, #0x0] - b _020482EA -_02048268: - ldr r0, _020482F0 ; =gSystem - ldr r1, [r0, #0x48] - mov r0, #0x1 - tst r0, r1 - bne _02048278 - mov r0, #0x2 - tst r0, r1 - beq _020482EA -_02048278: - mov r0, #0x8 - str r0, [sp, #0x0] - mov r0, #0x1 - str r0, [sp, #0x4] - mov r0, #0x20 - str r0, [sp, #0x8] - mov r0, #0x0 - add r1, r0, #0x0 - add r2, r0, #0x0 - add r3, r0, #0x0 - bl BeginNormalPaletteFade - ldr r0, [r4, #0x0] - add r0, r0, #0x1 - str r0, [r4, #0x0] - b _020482EA -_02048298: - bl IsPaletteFadeFinished - cmp r0, #0x0 - beq _020482EA - add r0, r4, #0x0 - add r0, #0xc - mov r1, #0x0 - bl FillWindowPixelBuffer - ldr r0, [r4, #0x0] - add r0, r0, #0x1 - str r0, [r4, #0x0] - b _020482EA -_020482B2: - add r0, r4, #0x0 - add r0, #0xc - mov r1, #0x0 - bl ClearFrameAndWindow2 - add r0, r4, #0x0 - add r0, #0xc - bl RemoveWindow - ldr r0, [r4, #0x20] - bl MessageFormat_Delete - ldr r0, [r4, #0x1c] - bl DestroyMsgData - ldr r0, [r4, #0x8] - mov r1, #0x3 - bl FreeBgTilemapBuffer - ldr r0, [r4, #0x8] - bl FreeToHeap - add r0, r4, #0x0 - bl FreeToHeap - add sp, #0xc - mov r0, #0x1 - pop {r3-r4, pc} -_020482EA: - mov r0, #0x0 - add sp, #0xc - pop {r3-r4, pc} - .balign 4 -_020482F0: .word gSystem - thumb_func_start sub_020482F4 sub_020482F4: ; 0x020482F4 push {r4-r7, lr} diff --git a/arm9/src/blackout_src.c b/arm9/src/blackout_src.c index 5379188ca..487844fa7 100644 --- a/arm9/src/blackout_src.c +++ b/arm9/src/blackout_src.c @@ -1,16 +1,21 @@ #include "blackout.h" #include "bg_window.h" #include "constants/maps.h" +#include "constants/rgb.h" #include "msgdata/msg.naix" #include "msgdata/msg/narc_0328.h" #include "graphic/font.naix" #include "gf_gfx_loader.h" +#include "PAD_pad.h" +#include "render_window.h" static void Blackout_InitDisplays(BgConfig *bgConfig); /*static*/ void Blackout_DrawMessage(FieldSystem *fieldSystem, TaskManager *taskManager); +static BOOL Task_ShowPrintedBlackoutMessage(TaskManager *taskManager); -extern BOOL Task_ShowPrintedBlackoutMessage(TaskManager *taskManager); extern void sub_020482F4(BlackoutScreenEnvironment *environment, s32 msgNo, u8 x, u8 y); +extern void BeginNormalPaletteFade(u32 pattern, u32 typeTop, u32 typeBottom, u16 colour, u32 duration, u32 framesPer, HeapID heapId); +extern BOOL IsPaletteFadeFinished(void); extern SaveData *FieldSystem_GetSaveData(FieldSystem *fieldSystem); @@ -93,3 +98,41 @@ static void Blackout_InitDisplays(BgConfig *bgConfig) { CopyWindowToVram(&env->window); TaskManager_Call(taskManager, Task_ShowPrintedBlackoutMessage, env); } + +static BOOL Task_ShowPrintedBlackoutMessage(TaskManager *taskManager) { + BlackoutScreenEnvironment *env = TaskManager_GetEnvironment(taskManager); + switch (env->state) { + case 0: + BeginNormalPaletteFade(3, 1, 42, RGB_BLACK, 8, 1, HEAP_ID_32); + env->state++; + break; + case 1: + if (IsPaletteFadeFinished()) { + env->state++; + } + break; + case 2: + if (gSystem.newKeys & PAD_BUTTON_A || gSystem.newKeys & PAD_BUTTON_B) { + BeginNormalPaletteFade(0, 0, 0, RGB_BLACK, 8, 1, HEAP_ID_32); + env->state++; + } + break; + case 3: + if (IsPaletteFadeFinished()) { + FillWindowPixelBuffer(&env->window, 0); + env->state++; + } + break; + case 4: + ClearFrameAndWindow2(&env->window, FALSE); + RemoveWindow(&env->window); + MessageFormat_Delete(env->msgFmt); + DestroyMsgData(env->msgData); + FreeBgTilemapBuffer(env->bgConfig, GF_BG_LYR_MAIN_3); + FreeToHeap(env->bgConfig); + FreeToHeap(env); + return TRUE; + } + + return FALSE; +} diff --git a/arm9/src/gf_gfx_loader.c b/arm9/src/gf_gfx_loader.c index 80ed4d26f..5e442bc2d 100644 --- a/arm9/src/gf_gfx_loader.c +++ b/arm9/src/gf_gfx_loader.c @@ -96,7 +96,7 @@ void GfGfxLoader_GXLoadPalWithSrcOffset(NarcId narcId, s32 memberNo, enum GFPalL } } -u32 GfGfxLoader_LoadWholePalette(NarcId narcId, s32 memberId, u32 layer, u32 baseAddr, u32 szByte, BOOL isCompressed, HeapID heapId) +u32 GfGfxLoader_LoadWholePalette(NarcId narcId, s32 memberId, u32 layer, u32 baseAddr, u32 szByte, BOOL isCompressed, HeapID heapId) //todo: change this to new format { static void (*const load_funcs[])(void *, u32, u32) = { GX_LoadOBJ, From e18f0bc85d59c04a9056c3b44be30e330f05413a Mon Sep 17 00:00:00 2001 From: red031000 Date: Fri, 15 Dec 2023 22:26:08 +0000 Subject: [PATCH 4/9] Blackout_PrintMessage --- arm9/asm/blackout_asm.s | 63 ------------------------------- arm9/global.inc | 2 +- arm9/overlays/15/asm/overlay_15.s | 2 +- arm9/overlays/16/asm/overlay_16.s | 8 ++-- arm9/overlays/47/asm/overlay_47.s | 4 +- arm9/overlays/55/asm/overlay_55.s | 2 +- arm9/overlays/59/src/ov59_Intro.c | 4 +- arm9/overlays/59/src/ov59_TV.c | 6 +-- arm9/src/blackout_src.c | 26 +++++++++++-- arm9/src/font.c | 2 +- arm9/src/list_menu.c | 14 ++----- include/font.h | 11 +----- include/text.h | 5 +++ 13 files changed, 47 insertions(+), 102 deletions(-) diff --git a/arm9/asm/blackout_asm.s b/arm9/asm/blackout_asm.s index ff2178fb8..113ceb545 100644 --- a/arm9/asm/blackout_asm.s +++ b/arm9/asm/blackout_asm.s @@ -1,73 +1,10 @@ .include "asm/macros.inc" .include "global.inc" - .extern gSystem .extern Blackout_DrawMessage .text - thumb_func_start sub_020482F4 -sub_020482F4: ; 0x020482F4 - push {r4-r7, lr} - sub sp, #0x14 - add r5, r0, #0x0 - mov r0, #0x1 - str r1, [sp, #0x10] - lsl r0, r0, #0xa - mov r1, #0xb - add r7, r3, #0x0 - bl String_New - add r6, r0, #0x0 - mov r0, #0x1 - lsl r0, r0, #0xa - mov r1, #0xb - bl String_New - add r4, r0, #0x0 - add r0, r5, #0x0 - add r0, #0xc - mov r1, #0x0 - bl FillWindowPixelBuffer - ldr r0, [r5, #0x1c] - ldr r1, [sp, #0x10] - add r2, r6, #0x0 - bl ReadMsgDataIntoString - ldr r0, [r5, #0x20] - add r1, r4, #0x0 - add r2, r6, #0x0 - bl StringExpandPlaceholders - mov r0, #0x0 - add r1, r4, #0x0 - add r2, r0, #0x0 - bl sub_02002F08 - add r3, r0, #0x0 - str r7, [sp, #0x0] - mov r0, #0xff - str r0, [sp, #0x4] - ldr r0, _02048378 ; =0x000F0200 - mov r1, #0x0 - str r0, [sp, #0x8] - add r0, r5, #0x0 - str r1, [sp, #0xc] - ldrb r5, [r5, #0x13] - add r0, #0xc - add r2, r4, #0x0 - lsl r5, r5, #0x3 - sub r3, r5, r3 - lsl r3, r3, #0x18 - lsr r3, r3, #0x19 - sub r3, r3, #0x4 - lsl r3, r3, #0x18 - lsr r3, r3, #0x18 - bl AddTextPrinterParameterized2 - add r0, r6, #0x0 - bl String_Delete - add r0, r4, #0x0 - bl String_Delete - add sp, #0x14 - pop {r4-r7, pc} - .balign 4 -_02048378: .word 0x000F0200 - thumb_func_start FieldTask_BlackOut FieldTask_BlackOut: ; 0x0204837C push {r3-r7, lr} diff --git a/arm9/global.inc b/arm9/global.inc index 10b77aa3d..5203fc01d 100644 --- a/arm9/global.inc +++ b/arm9/global.inc @@ -239,7 +239,7 @@ .extern GetFontAttribute .extern LoadFontPal0 .extern LoadFontPal1 -.extern sub_02002F08 +.extern FontID_String_GetWidthMultiline .extern sub_02002F40 .extern sub_02002F90 .extern sub_02002F9C diff --git a/arm9/overlays/15/asm/overlay_15.s b/arm9/overlays/15/asm/overlay_15.s index f6313aa15..bfc5b3823 100644 --- a/arm9/overlays/15/asm/overlay_15.s +++ b/arm9/overlays/15/asm/overlay_15.s @@ -7762,7 +7762,7 @@ ov15_021DB100: ; 0x021DB100 add r1, r6, #0 mov r2, #0 add r7, r3, #0 - bl sub_02002F08 + bl FontID_String_GetWidthMultiline mov r1, #0x58 sub r0, r1, r0 lsr r0, r0, #1 diff --git a/arm9/overlays/16/asm/overlay_16.s b/arm9/overlays/16/asm/overlay_16.s index 3a31d4f58..7b3777d14 100644 --- a/arm9/overlays/16/asm/overlay_16.s +++ b/arm9/overlays/16/asm/overlay_16.s @@ -17091,7 +17091,7 @@ _021DF394: mov r0, #0 add r1, r6, #0 add r2, r0, #0 - bl sub_02002F08 + bl FontID_String_GetWidthMultiline mov r1, #0xd0 sub r0, r1, r0 lsr r4, r0, #1 @@ -17143,7 +17143,7 @@ ov16_021DF3E4: ; 0x021DF3E4 mov r0, #0 add r1, r6, #0 add r2, r0, #0 - bl sub_02002F08 + bl FontID_String_GetWidthMultiline mov r1, #0xd0 sub r0, r1, r0 lsr r5, r0, #1 @@ -29933,7 +29933,7 @@ ov16_021E51AC: ; 0x021E51AC mov r0, #0 add r1, r4, #0 add r2, r0, #0 - bl sub_02002F08 + bl FontID_String_GetWidthMultiline cmp r0, #0xf0 bhs _021E51D8 lsr r1, r0, #1 @@ -34543,7 +34543,7 @@ ov16_021E739C: ; 0x021E739C mov r0, #0 add r1, r4, #0 add r2, r0, #0 - bl sub_02002F08 + bl FontID_String_GetWidthMultiline cmp r0, #0xf0 bhs _021E73C8 lsr r1, r0, #1 diff --git a/arm9/overlays/47/asm/overlay_47.s b/arm9/overlays/47/asm/overlay_47.s index d80dd2457..5132aebd2 100644 --- a/arm9/overlays/47/asm/overlay_47.s +++ b/arm9/overlays/47/asm/overlay_47.s @@ -1233,7 +1233,7 @@ ov47_02255184: ; 0x02255184 mov r0, #0 ldr r1, [r4, #0x5c] add r2, r0, #0 - bl sub_02002F08 + bl FontID_String_GetWidthMultiline mov r1, #0xc0 sub r0, r1, r0 lsr r3, r0, #1 @@ -1353,7 +1353,7 @@ ov47_02255250: ; 0x02255250 mov r0, #0 ldr r1, [r4, #0x5c] add r2, r0, #0 - bl sub_02002F08 + bl FontID_String_GetWidthMultiline mov r1, #0xc0 sub r0, r1, r0 lsr r3, r0, #1 diff --git a/arm9/overlays/55/asm/overlay_55.s b/arm9/overlays/55/asm/overlay_55.s index ffd41927f..d3594307f 100644 --- a/arm9/overlays/55/asm/overlay_55.s +++ b/arm9/overlays/55/asm/overlay_55.s @@ -3703,7 +3703,7 @@ _021D92CE: mov r0, #0 ldr r1, [r1] add r2, r0, #0 - bl sub_02002F08 + bl FontID_String_GetWidthMultiline mov r1, #0xa8 sub r0, r1, r0 mov r1, #0 diff --git a/arm9/overlays/59/src/ov59_Intro.c b/arm9/overlays/59/src/ov59_Intro.c index 22a04009a..2ca28ee2a 100644 --- a/arm9/overlays/59/src/ov59_Intro.c +++ b/arm9/overlays/59/src/ov59_Intro.c @@ -961,7 +961,7 @@ BOOL ov59_DisplayControlAdventureMessage(ov59_IntroOverlayData *data, u32 msgNo, template.height = (u8)(count * 2); AddWindow(data->bgConfig, &data->window, &template); FillWindowPixelRect(&data->window, 0, 0, 0, 192, 192); - AddTextPrinterParameterized2(&data->window, 0, data->string, 0, 0, 0, MakeFontColor(1, 2, 0), NULL); + AddTextPrinterParameterized2(&data->window, 0, data->string, 0, 0, TEXT_SPEED_INSTANT, MAKE_TEXT_COLOR(1, 2, 0), NULL); } else { @@ -970,7 +970,7 @@ BOOL ov59_DisplayControlAdventureMessage(ov59_IntroOverlayData *data, u32 msgNo, template.height = (u8)height; AddWindow(data->bgConfig, &data->window, &template); FillWindowPixelRect(&data->window, 0, 0, 0, 192, 192); - AddTextPrinterParameterized2(&data->window, 0, data->string, 0, 0, 0, MakeFontColor(15, 2, 0), NULL); + AddTextPrinterParameterized2(&data->window, 0, data->string, 0, 0, TEXT_SPEED_INSTANT, MAKE_TEXT_COLOR(15, 2, 0), NULL); } String_Delete(data->string); data->displayControlMessageCounter = 1; diff --git a/arm9/overlays/59/src/ov59_TV.c b/arm9/overlays/59/src/ov59_TV.c index a84a62e92..83d68b4bb 100644 --- a/arm9/overlays/59/src/ov59_TV.c +++ b/arm9/overlays/59/src/ov59_TV.c @@ -346,10 +346,10 @@ BOOL ov59_021D9C74(ov59_TVOverlayData *data, u32 msgNo, u32 param2, u32 param3) ReadMsgDataIntoString(data->msgData, msgNo, string); AddWindow(data->bgConfig, &data->window, &ov59_021DA04C); FillWindowPixelRect(&data->window, 0, 0, 0, 256, 192); - u32 unk0 = (u32)sub_02002F08(0, string, 0); + u32 width = FontID_String_GetWidthMultiline(0, string, 0); - unk0 = (256 - unk0 ) / 2; - AddTextPrinterParameterized2(&data->window, 0, string, unk0, param3, 0, MakeFontColor(15, 2, 0), NULL); + width = (256 - width) / 2; + AddTextPrinterParameterized2(&data->window, 0, string, width, param3, TEXT_SPEED_INSTANT, MAKE_TEXT_COLOR(15, 2, 0), NULL); String_Delete(string); CopyWindowToVram(&data->window); ToggleBgLayer(GF_BG_LYR_MAIN_2, GX_PLANE_TOGGLE_ON); diff --git a/arm9/src/blackout_src.c b/arm9/src/blackout_src.c index 487844fa7..2bcddf88d 100644 --- a/arm9/src/blackout_src.c +++ b/arm9/src/blackout_src.c @@ -8,12 +8,13 @@ #include "gf_gfx_loader.h" #include "PAD_pad.h" #include "render_window.h" +#include "text.h" static void Blackout_InitDisplays(BgConfig *bgConfig); /*static*/ void Blackout_DrawMessage(FieldSystem *fieldSystem, TaskManager *taskManager); static BOOL Task_ShowPrintedBlackoutMessage(TaskManager *taskManager); +static void Blackout_PrintMessage(BlackoutScreenEnvironment *environment, s32 msgNo, u8 x, u8 y); -extern void sub_020482F4(BlackoutScreenEnvironment *environment, s32 msgNo, u8 x, u8 y); extern void BeginNormalPaletteFade(u32 pattern, u32 typeTop, u32 typeBottom, u16 colour, u32 duration, u32 framesPer, HeapID heapId); extern BOOL IsPaletteFadeFinished(void); @@ -90,10 +91,10 @@ static void Blackout_InitDisplays(BgConfig *bgConfig) { BufferPlayersName(env->msgFmt, 0, Save_PlayerData_GetProfileAddr(FieldSystem_GetSaveData(fieldSystem))); if (fieldSystem->location->mapId == MAP_T01R0201) { // {STRVAR_1 3, 0} scurried back\nhome, protecting the exhausted\nand fainted Pokémon from further\nharm... - sub_020482F4(env, narc_0328_00004, 0, 0); + Blackout_PrintMessage(env, narc_0328_00004, 0, 0); } else { // {STRVAR_1 3, 0} scurried to\na Pokémon Center, protecting\nthe exhausted and fainted\nPokémon from further harm... - sub_020482F4(env, narc_0328_00003, 0, 0); + Blackout_PrintMessage(env, narc_0328_00003, 0, 0); } CopyWindowToVram(&env->window); TaskManager_Call(taskManager, Task_ShowPrintedBlackoutMessage, env); @@ -136,3 +137,22 @@ static BOOL Task_ShowPrintedBlackoutMessage(TaskManager *taskManager) { return FALSE; } + +static void Blackout_PrintMessage(BlackoutScreenEnvironment *environment, s32 msgNo, u8 x, u8 y) { + String *tmpStr = String_New(1024, HEAP_ID_FIELD); + String *finStr = String_New(1024, HEAP_ID_FIELD); + + FillWindowPixelBuffer(&environment->window, 0); + ReadMsgDataIntoString(environment->msgData, msgNo, tmpStr); + StringExpandPlaceholders(environment->msgFmt, finStr, tmpStr); + + u32 width = FontID_String_GetWidthMultiline(0, finStr, 0); + x = (environment->window.width * 8 - width); + x /= 2; + x -= 4; + + AddTextPrinterParameterized2(&environment->window, 0, finStr, x, y, TEXT_SPEED_NOTRANSFER, MAKE_TEXT_COLOR(15, 2, 0), NULL); + + String_Delete(tmpStr); + String_Delete(finStr); +} diff --git a/arm9/src/font.c b/arm9/src/font.c index f886f61c7..d08ea7e20 100644 --- a/arm9/src/font.c +++ b/arm9/src/font.c @@ -173,7 +173,7 @@ void LoadFontPal1(enum GFPalLoadLocation location, enum GFPalSlotOffset palSlotO GfGfxLoader_GXLoadPal(NARC_GRAPHIC_FONT, NARC_font_narc_0007_NCLR, location, palSlotOffset, 0x20, heapId); } -s32 sub_02002F08(u32 param0, struct String *str, u32 param2) +u32 FontID_String_GetWidthMultiline(u32 param0, struct String *str, u32 param2) { GF_ASSERT(UNK_02106FC8->unk94[param0] != NULL); diff --git a/arm9/src/list_menu.c b/arm9/src/list_menu.c index 9d7224057..3f65d5ef2 100644 --- a/arm9/src/list_menu.c +++ b/arm9/src/list_menu.c @@ -30,15 +30,7 @@ struct ListMenu * ListMenuInit(const struct ListMenuTemplate * template, u16 cur list->overrideEnabled = FALSE; if (list->template.totalItems < list->template.maxShowed) list->template.maxShowed = list->template.totalItems; - ListMenuCursorSetColor( - list->cursor, -// MakeFontColor(list->template.cursorPal, list->template.cursorShadowPal, list->fillValue) - (u32)( - ((u32)(list->template.cursorPal << 24) >> 8) - | ((u32)(list->template.cursorShadowPal << 24) >> 16) - | ((u32)(list->template.fillValue << 24) >> 24) - ) - ); + ListMenuCursorSetColor(list->cursor, MAKE_TEXT_COLOR(list->template.cursorPal, list->template.cursorShadowPal, list->template.fillValue)); FillWindowPixelBuffer(list->template.window, list->template.fillValue); ListMenuPrintEntries(list, list->cursorPos, 0, list->template.maxShowed); ListMenuDrawCursor(list); @@ -312,11 +304,11 @@ void ListMenuPrint(struct ListMenu * list, struct String * str, u8 x, u8 y) { if (list->overrideEnabled) { - AddTextPrinterParameterized3(list->template.window, list->fontId, str, x, y, 0xFF, MakeFontColor(list->cursorPal, list->cursorShadowPal, list->fillValue), list->lettersSpacing, 0, NULL); + AddTextPrinterParameterized3(list->template.window, list->fontId, str, x, y, 0xFF, MAKE_TEXT_COLOR(list->cursorPal, list->cursorShadowPal, list->fillValue), list->lettersSpacing, 0, NULL); } else { - AddTextPrinterParameterized3(list->template.window, list->template.fontId, str, x, y, 0xFF, MakeFontColor(list->template.cursorPal, list->template.cursorShadowPal, list->template.fillValue), list->template.lettersSpacing, 0, NULL); + AddTextPrinterParameterized3(list->template.window, list->template.fontId, str, x, y, 0xFF, MAKE_TEXT_COLOR(list->template.cursorPal, list->template.cursorShadowPal, list->template.fillValue), list->template.lettersSpacing, 0, NULL); } } } diff --git a/include/font.h b/include/font.h index 9a9496cf3..9b6507b63 100644 --- a/include/font.h +++ b/include/font.h @@ -4,15 +4,6 @@ #include "global.h" #include "text.h" -static inline u32 MakeFontColor(u32 fgPal, u32 shdwPal, u32 bgPal) -{ - return (u32)( - ((u32)(fgPal << 24) >> 8) - | ((u32)(shdwPal << 24) >> 16) - | ((u32)(bgPal << 24) >> 24) - ); -} - struct UnkStruct_02002C14_sub { const char buf[0x80]; @@ -41,7 +32,7 @@ u32 sub_02002E14(u32 param0, struct String *str, u32 param2); s32 GetFontAttribute(u8 fontId, s32 attr); void LoadFontPal0(enum GFPalLoadLocation location, enum GFPalSlotOffset palSlotOffset, HeapID heapId); void LoadFontPal1(enum GFPalLoadLocation location, enum GFPalSlotOffset palSlotOffset, HeapID heapId); -s32 sub_02002F08(u32 param0, struct String *str, u32 param2); +u32 FontID_String_GetWidthMultiline(u32 param0, struct String *str, u32 param2); u32 sub_02002F40(u32 param0, struct String *str, u32 param2, u32 param3); u32 sub_02002F58(const u16 *str); u32 sub_02002F90(struct String *str); diff --git a/include/text.h b/include/text.h index 53b270547..b8eafbe3e 100644 --- a/include/text.h +++ b/include/text.h @@ -4,6 +4,11 @@ #include "global.h" #include "bg_window.h" +#define MAKE_TEXT_COLOR(fg, sh, bg) ((((fg) & 0xFF) << 16) | (((sh) & 0xFF) << 8) | (((bg) & 0xFF) << 0)) + +#define TEXT_SPEED_INSTANT 0 // Transfers to VRAM +#define TEXT_SPEED_NOTRANSFER 0xFF // Defers VRAM transfer + union StrbufForPrint { struct String * wrapped; From 01d130008eeafd5b4d3d72d78046b6f4987603af Mon Sep 17 00:00:00 2001 From: red031000 Date: Fri, 15 Dec 2023 22:40:06 +0000 Subject: [PATCH 5/9] update palette offset enum --- arm9/overlays/19/src/overlay_19.c | 2 +- arm9/overlays/59/src/ov59_Intro.c | 22 ++++++++++----------- arm9/overlays/59/src/ov59_TV.c | 4 ++-- arm9/src/bg_window.c | 2 +- arm9/src/blackout_src.c | 2 +- arm9/src/communication_error.c | 2 +- arm9/src/error_message_reset.c | 2 +- arm9/src/save_data_read_error.c | 4 ++-- arm9/src/save_data_write_error.c | 2 +- arm9/src/text_02054590.c | 4 ++-- arm9/src/wfc_user_info_warning.c | 2 +- include/bg_window.h | 32 +++++++++++++++---------------- 12 files changed, 40 insertions(+), 40 deletions(-) diff --git a/arm9/overlays/19/src/overlay_19.c b/arm9/overlays/19/src/overlay_19.c index 0713539b8..eeafb68d6 100644 --- a/arm9/overlays/19/src/overlay_19.c +++ b/arm9/overlays/19/src/overlay_19.c @@ -30,7 +30,7 @@ void ov19_02252440(struct BgConfig * bgConfig) InitBgFromTemplate(bgConfig, GF_BG_LYR_SUB_0, &ov19_02252508, GF_BG_TYPE_TEXT); GfGfxLoader_LoadCharData(NARC_GRAPHIC_POKETCH, NARC_poketch_narc_0010_NCGR_lz, bgConfig, GF_BG_LYR_SUB_0, 0, 0, TRUE, HEAP_ID_8); GfGfxLoader_LoadScrnData(NARC_GRAPHIC_POKETCH, NARC_poketch_narc_0011_NSCR_lz, bgConfig, GF_BG_LYR_SUB_0, 0, 0, TRUE, HEAP_ID_8); - GfGfxLoader_GXLoadPal(NARC_GRAPHIC_POKETCH, NARC_poketch_narc_0012_NCLR, GF_PAL_LOCATION_SUB_BG, GF_PAL_SLOT_OFFSET_0, 0x20, HEAP_ID_8); + GfGfxLoader_GXLoadPal(NARC_GRAPHIC_POKETCH, NARC_poketch_narc_0012_NCLR, GF_PAL_LOCATION_SUB_BG, GF_PAL_SLOT_0_OFFSET, 0x20, HEAP_ID_8); GXS_SetVisibleWnd(GX_WNDMASK_NONE); GXS_SetVisiblePlane(GX_PLANEMASK_BG0); } diff --git a/arm9/overlays/59/src/ov59_Intro.c b/arm9/overlays/59/src/ov59_Intro.c index 2ca28ee2a..f0fa5cd6c 100644 --- a/arm9/overlays/59/src/ov59_Intro.c +++ b/arm9/overlays/59/src/ov59_Intro.c @@ -593,8 +593,8 @@ void ov59_IntroSetupBg(ov59_IntroOverlayData *data) sub_0200CD68(data->bgConfig, 0, 994, 4, 0, data->heapId); LoadUserFrameGfx1(data->bgConfig, GF_BG_LYR_MAIN_0, 985, 3, 0, data->heapId); - LoadFontPal0(GF_PAL_LOCATION_MAIN_BG, GF_PAL_SLOT_OFFSET_5, data->heapId); - LoadFontPal1(GF_PAL_LOCATION_MAIN_BG, GF_PAL_SLOT_OFFSET_6, data->heapId); + LoadFontPal0(GF_PAL_LOCATION_MAIN_BG, GF_PAL_SLOT_5_OFFSET, data->heapId); + LoadFontPal1(GF_PAL_LOCATION_MAIN_BG, GF_PAL_SLOT_6_OFFSET, data->heapId); struct BgTemplate bgTemplateSub = ov59_021D9EBC; bgTemplateSub.screenBase = GX_BG_SCRBASE_0x7800; @@ -1026,8 +1026,8 @@ void ov59_LoadInitialTilemap(ov59_IntroOverlayData *data) mainPal = NARC_intro_main_background_pearl_NCLR; subPal = NARC_intro_sub_background_pearl_NCLR; } - GfGfxLoader_GXLoadPal(NARC_DEMO_INTRO_INTRO, mainPal, GF_PAL_LOCATION_MAIN_BG, GF_PAL_SLOT_OFFSET_0, 0x60, data->heapId); - GfGfxLoader_GXLoadPal(NARC_DEMO_INTRO_INTRO, subPal, GF_PAL_LOCATION_SUB_BG, GF_PAL_SLOT_OFFSET_0, 0xa0, data->heapId); + GfGfxLoader_GXLoadPal(NARC_DEMO_INTRO_INTRO, mainPal, GF_PAL_LOCATION_MAIN_BG, GF_PAL_SLOT_0_OFFSET, 0x60, data->heapId); + GfGfxLoader_GXLoadPal(NARC_DEMO_INTRO_INTRO, subPal, GF_PAL_LOCATION_SUB_BG, GF_PAL_SLOT_0_OFFSET, 0xa0, data->heapId); ov59_LoadMainScrnData(data); ov59_LoadCharDataFromIndex(data); ov59_LoadSubScrnData(data); @@ -1051,14 +1051,14 @@ void ov59_LoadCharDataFromIndex(ov59_IntroOverlayData *data) if (data->spriteDataIndex0 != 0 && data->spriteDataIndex0 < 12) { GfGfxLoader_LoadCharData(NARC_DEMO_INTRO_INTRO, graphicsPaletteMap.map[data->spriteDataIndex0].charNum, data->bgConfig, GF_BG_LYR_MAIN_1, 0, 0, FALSE, data->heapId); - GfGfxLoader_GXLoadPal(NARC_DEMO_INTRO_INTRO, graphicsPaletteMap.map[data->spriteDataIndex0].palNum, GF_PAL_LOCATION_MAIN_BG, GF_PAL_SLOT_OFFSET_7, 0x20, data->heapId); + GfGfxLoader_GXLoadPal(NARC_DEMO_INTRO_INTRO, graphicsPaletteMap.map[data->spriteDataIndex0].palNum, GF_PAL_LOCATION_MAIN_BG, GF_PAL_SLOT_7_OFFSET, 0x20, data->heapId); GfGfxLoader_LoadScrnData(NARC_DEMO_INTRO_INTRO, NARC_intro_character_screen_NSCR, data->bgConfig, GF_BG_LYR_MAIN_1, 0, 0, FALSE, data->heapId); ov59_TilemapChangePalette(data, GF_BG_LYR_MAIN_1, 7); } if (data->spriteDataIndex1 != 0 && data->spriteDataIndex1 < 12) { GfGfxLoader_LoadCharData(NARC_DEMO_INTRO_INTRO, graphicsPaletteMap.map[data->spriteDataIndex1].charNum, data->bgConfig, GF_BG_LYR_MAIN_2, 0, 0, FALSE, data->heapId); - GfGfxLoader_GXLoadPal(NARC_DEMO_INTRO_INTRO, graphicsPaletteMap.map[data->spriteDataIndex1].palNum, GF_PAL_LOCATION_MAIN_BG, GF_PAL_SLOT_OFFSET_8, 0x20, data->heapId); + GfGfxLoader_GXLoadPal(NARC_DEMO_INTRO_INTRO, graphicsPaletteMap.map[data->spriteDataIndex1].palNum, GF_PAL_LOCATION_MAIN_BG, GF_PAL_SLOT_8_OFFSET, 0x20, data->heapId); GfGfxLoader_LoadScrnData(NARC_DEMO_INTRO_INTRO, NARC_intro_character_screen_NSCR, data->bgConfig, GF_BG_LYR_MAIN_2, 0, 0, FALSE, data->heapId); ov59_TilemapChangePalette(data, GF_BG_LYR_MAIN_2, 8); } @@ -1100,16 +1100,16 @@ void ov59_DrawMunchlax(ov59_IntroOverlayData *data) ov59_TilemapChangePalette(data, GF_BG_LYR_MAIN_2, 9); BG_ClearCharDataRange(GF_BG_LYR_MAIN_2, 32, 0, data->heapId); BG_LoadCharTilesData(data->bgConfig, GF_BG_LYR_MAIN_2, charData, 0xc80, 1); - BG_LoadPlttData(GF_BG_LYR_MAIN_2, plttData, 32, GF_PAL_SLOT_OFFSET_8); //r2 and r3 regswap - BG_LoadPlttData(GF_BG_LYR_MAIN_2, ov59_021D9ED8, 32, GF_PAL_SLOT_OFFSET_9); + BG_LoadPlttData(GF_BG_LYR_MAIN_2, plttData, 32, GF_PAL_SLOT_8_OFFSET); //r2 and r3 regswap + BG_LoadPlttData(GF_BG_LYR_MAIN_2, ov59_021D9ED8, 32, GF_PAL_SLOT_9_OFFSET); FillBgTilemapRect(data->bgConfig, GF_BG_LYR_SUB_1, 0, 0, 0, 32, 24, 10); LoadRectToBgTilemapRect(data->bgConfig, GF_BG_LYR_SUB_1, src, 11, 7, 10, 10); ov59_TilemapChangePalette(data, GF_BG_LYR_SUB_1, 10); BG_ClearCharDataRange(GF_BG_LYR_SUB_1, 32, 0, data->heapId); BG_LoadCharTilesData(data->bgConfig, GF_BG_LYR_SUB_1, charData, 0xc80, 1); - BG_LoadPlttData(GF_BG_LYR_SUB_1, plttData, 32, GF_PAL_SLOT_OFFSET_10); - BG_LoadPlttData(GF_BG_LYR_SUB_1, ov59_021D9ED8, 32, GF_PAL_SLOT_OFFSET_10); + BG_LoadPlttData(GF_BG_LYR_SUB_1, plttData, 32, GF_PAL_SLOT_10_OFFSET); + BG_LoadPlttData(GF_BG_LYR_SUB_1, ov59_021D9ED8, 32, GF_PAL_SLOT_10_OFFSET); FreeToHeap(plttData); FreeToHeap(charData); FreeToHeap(src); @@ -1271,7 +1271,7 @@ void ov59_LoadPokeballButton(ov59_IntroOverlayData *data) { GfGfxLoader_LoadScrnData(NARC_DEMO_INTRO_INTRO, NARC_intro_narc_0038_NSCR, data->bgConfig, GF_BG_LYR_SUB_2, 0, 0, FALSE, data->heapId); ov59_TilemapChangePalette(data, GF_BG_LYR_SUB_2, 9); - GfGfxLoader_GXLoadPal(NARC_DEMO_INTRO_INTRO, NARC_intro_narc_0039_NCLR, GF_PAL_LOCATION_SUB_BG, GF_PAL_SLOT_OFFSET_7, 0x60, data->heapId); + GfGfxLoader_GXLoadPal(NARC_DEMO_INTRO_INTRO, NARC_intro_narc_0039_NCLR, GF_PAL_LOCATION_SUB_BG, GF_PAL_SLOT_7_OFFSET, 0x60, data->heapId); BG_ClearCharDataRange(GF_BG_LYR_SUB_2, 0x20, 0, data->heapId); GfGfxLoader_LoadCharData(NARC_DEMO_INTRO_INTRO, NARC_intro_pokeball_button_1_NCGR, data->bgConfig, GF_BG_LYR_SUB_2, 0x20, 0, FALSE, data->heapId); } diff --git a/arm9/overlays/59/src/ov59_TV.c b/arm9/overlays/59/src/ov59_TV.c index 83d68b4bb..bb278ec59 100644 --- a/arm9/overlays/59/src/ov59_TV.c +++ b/arm9/overlays/59/src/ov59_TV.c @@ -291,9 +291,9 @@ void ov59_TVSetupGraphics(ov59_TVOverlayData *data) GfGfxLoader_LoadCharData(NARC_DEMO_INTRO_INTRO_TV, NARC_intro_tv_narc_0000_NCGR, data->bgConfig, GF_BG_LYR_MAIN_3, 0, 0, FALSE, data->heapId); GfGfxLoader_LoadScrnData(NARC_DEMO_INTRO_INTRO_TV, NARC_intro_tv_narc_0003_NSCR, data->bgConfig, GF_BG_LYR_MAIN_3, 0, 0, FALSE, data->heapId); - GfGfxLoader_GXLoadPal(NARC_DEMO_INTRO_INTRO_TV, NARC_intro_tv_narc_0006_NCLR, GF_PAL_LOCATION_MAIN_BG, GF_PAL_SLOT_OFFSET_0, 0, data->heapId); + GfGfxLoader_GXLoadPal(NARC_DEMO_INTRO_INTRO_TV, NARC_intro_tv_narc_0006_NCLR, GF_PAL_LOCATION_MAIN_BG, GF_PAL_SLOT_0_OFFSET, 0, data->heapId); - LoadFontPal0(GF_PAL_LOCATION_MAIN_BG, GF_PAL_SLOT_OFFSET_1, data->heapId); + LoadFontPal0(GF_PAL_LOCATION_MAIN_BG, GF_PAL_SLOT_1_OFFSET, data->heapId); BG_SetMaskColor(GF_BG_LYR_MAIN_0, 0); BG_SetMaskColor(GF_BG_LYR_SUB_0, 0); diff --git a/arm9/src/bg_window.c b/arm9/src/bg_window.c index 45f6c581a..ff9fb9c38 100644 --- a/arm9/src/bg_window.c +++ b/arm9/src/bg_window.c @@ -865,7 +865,7 @@ void BG_LoadPlttData(u32 location, void *plttData, u32 size, enum GFPalSlotOffse } void BG_SetMaskColor(u8 bgId, u16 value) { - BG_LoadPlttData(bgId, &value, sizeof(u16), GF_PAL_SLOT_OFFSET_0); + BG_LoadPlttData(bgId, &value, sizeof(u16), GF_PAL_SLOT_0_OFFSET); } static u16 GetTileMapIndexFromCoords(u8 x, u8 y, u8 size) { diff --git a/arm9/src/blackout_src.c b/arm9/src/blackout_src.c index 2bcddf88d..2bfecc0ca 100644 --- a/arm9/src/blackout_src.c +++ b/arm9/src/blackout_src.c @@ -70,7 +70,7 @@ static void Blackout_InitDisplays(BgConfig *bgConfig) { GfGfx_SetBanks(&Blackout_GraphicsBanks); SetBothScreensModesAndDisable(&Blackout_GraphicsModes); InitBgFromTemplate(bgConfig, GF_BG_LYR_MAIN_3, &Blackout_BgTemplate, GF_BG_TYPE_TEXT); - GfGfxLoader_GXLoadPal(NARC_GRAPHIC_FONT, NARC_font_narc_0006_NCLR, GF_PAL_LOCATION_MAIN_BG, GF_PAL_SLOT_OFFSET_13, 0x20, HEAP_ID_FIELD); + GfGfxLoader_GXLoadPal(NARC_GRAPHIC_FONT, NARC_font_narc_0006_NCLR, GF_PAL_LOCATION_MAIN_BG, GF_PAL_SLOT_13_OFFSET, 0x20, HEAP_ID_FIELD); } /*static*/ void Blackout_DrawMessage(FieldSystem *fieldSystem, TaskManager *taskManager) { diff --git a/arm9/src/communication_error.c b/arm9/src/communication_error.c index 29c6d242d..51ba394a6 100644 --- a/arm9/src/communication_error.c +++ b/arm9/src/communication_error.c @@ -121,7 +121,7 @@ void ShowCommunicationError(HeapID heapId, u32 error, u32 errorCode) { InitBgFromTemplate(bgConfig, 0, &sCommunicationErrorBgTemplate, GX_BGMODE_0); BgClearTilemapBufferAndCommit(bgConfig, GF_BG_LYR_MAIN_0); LoadUserFrameGfx1(bgConfig, GF_BG_LYR_MAIN_0, 0x01F7, 2, 0, heapId); - LoadFontPal0(GF_PAL_LOCATION_MAIN_BG, GF_PAL_SLOT_OFFSET_1, heapId); + LoadFontPal0(GF_PAL_LOCATION_MAIN_BG, GF_PAL_SLOT_1_OFFSET, heapId); BG_ClearCharDataRange(GF_BG_LYR_MAIN_0, 0x20, 0, heapId); BG_SetMaskColor(GF_BG_LYR_MAIN_0, RGB(1, 1, 27)); BG_SetMaskColor(GF_BG_LYR_SUB_0, RGB(1, 1, 27)); diff --git a/arm9/src/error_message_reset.c b/arm9/src/error_message_reset.c index 459201375..782b0cd80 100644 --- a/arm9/src/error_message_reset.c +++ b/arm9/src/error_message_reset.c @@ -124,7 +124,7 @@ void PrintErrorMessageAndReset() LoadUserFrameGfx1(ptr, GF_BG_LYR_MAIN_0, 503, 2, 0, HEAP_ID_DEFAULT); - LoadFontPal0(GF_PAL_LOCATION_MAIN_BG, GF_PAL_SLOT_OFFSET_1, HEAP_ID_DEFAULT); + LoadFontPal0(GF_PAL_LOCATION_MAIN_BG, GF_PAL_SLOT_1_OFFSET, HEAP_ID_DEFAULT); BG_ClearCharDataRange(GF_BG_LYR_MAIN_0, 0x20, 0, HEAP_ID_DEFAULT); BG_SetMaskColor(GF_BG_LYR_MAIN_0, RGB(1, 1, 27)); BG_SetMaskColor(GF_BG_LYR_SUB_0, RGB(1, 1, 27)); diff --git a/arm9/src/save_data_read_error.c b/arm9/src/save_data_read_error.c index 56cc7da13..9632ba1f7 100644 --- a/arm9/src/save_data_read_error.c +++ b/arm9/src/save_data_read_error.c @@ -93,7 +93,7 @@ void ShowSaveDataReadError(HeapID heapId) InitBgFromTemplate(bg_config, 0, &sSaveDataReadErrorBgTemplate, 0); BgClearTilemapBufferAndCommit(bg_config, GF_BG_LYR_MAIN_0); LoadUserFrameGfx1(bg_config, GF_BG_LYR_MAIN_0, 0x01F7, 2, 0, heapId); - LoadFontPal0(GF_PAL_LOCATION_MAIN_BG, GF_PAL_SLOT_OFFSET_1, heapId); + LoadFontPal0(GF_PAL_LOCATION_MAIN_BG, GF_PAL_SLOT_1_OFFSET, heapId); BG_ClearCharDataRange(GF_BG_LYR_MAIN_0, 0x20, 0, heapId); BG_SetMaskColor(GF_BG_LYR_MAIN_0, RGB(1, 1, 27)); BG_SetMaskColor(GF_BG_LYR_SUB_0, RGB(1, 1, 27)); @@ -156,7 +156,7 @@ void ShowGBACartRemovedError(HeapID heapId) InitBgFromTemplate(bg_config, 0, &sSaveDataReadErrorBgTemplate, 0); BgClearTilemapBufferAndCommit(bg_config, GF_BG_LYR_MAIN_0); LoadUserFrameGfx1(bg_config, GF_BG_LYR_MAIN_0, 0x01F7, 2, 0, heapId); - LoadFontPal0(GF_PAL_LOCATION_MAIN_BG, GF_PAL_SLOT_OFFSET_1, heapId); + LoadFontPal0(GF_PAL_LOCATION_MAIN_BG, GF_PAL_SLOT_1_OFFSET, heapId); BG_ClearCharDataRange(GF_BG_LYR_MAIN_0, 0x20, 0, heapId); BG_SetMaskColor(GF_BG_LYR_MAIN_0, RGB(1, 1, 27)); BG_SetMaskColor(GF_BG_LYR_SUB_0, RGB(1, 1, 27)); diff --git a/arm9/src/save_data_write_error.c b/arm9/src/save_data_write_error.c index 2d4ce9299..9bd162843 100644 --- a/arm9/src/save_data_write_error.c +++ b/arm9/src/save_data_write_error.c @@ -101,7 +101,7 @@ void ShowSaveDataWriteError(HeapID heapId, u32 err_no) InitBgFromTemplate(bg_config, 0, &sSaveDataWriteErrorBgTemplate, 0); BgClearTilemapBufferAndCommit(bg_config, GF_BG_LYR_MAIN_0); LoadUserFrameGfx1(bg_config, GF_BG_LYR_MAIN_0, 0x01F7, 2, 0, heapId); - LoadFontPal0(GF_PAL_LOCATION_MAIN_BG, GF_PAL_SLOT_OFFSET_1, heapId); + LoadFontPal0(GF_PAL_LOCATION_MAIN_BG, GF_PAL_SLOT_1_OFFSET, heapId); BG_ClearCharDataRange(GF_BG_LYR_MAIN_0, 0x20, 0, heapId); BG_SetMaskColor(GF_BG_LYR_MAIN_0, RGB(1, 1, 27)); BG_SetMaskColor(GF_BG_LYR_SUB_0, RGB(1, 1, 27)); diff --git a/arm9/src/text_02054590.c b/arm9/src/text_02054590.c index 631774574..59189acd9 100644 --- a/arm9/src/text_02054590.c +++ b/arm9/src/text_02054590.c @@ -12,8 +12,8 @@ void sub_02054590(enum GFPalLoadLocation location, u32 param1) { ResetAllTextPrinters(); } - LoadFontPal0(location, GF_PAL_SLOT_OFFSET_13, HEAP_ID_4); - LoadFontPal1(location, GF_PAL_SLOT_OFFSET_12, HEAP_ID_4); + LoadFontPal0(location, GF_PAL_SLOT_13_OFFSET, HEAP_ID_4); + LoadFontPal1(location, GF_PAL_SLOT_12_OFFSET, HEAP_ID_4); } void sub_020545B8(struct BgConfig *param0, struct Window *param1, u32 param2) diff --git a/arm9/src/wfc_user_info_warning.c b/arm9/src/wfc_user_info_warning.c index f4d030dd9..3900748e6 100644 --- a/arm9/src/wfc_user_info_warning.c +++ b/arm9/src/wfc_user_info_warning.c @@ -100,7 +100,7 @@ void ShowWFCUserInfoWarning(HeapID heapId, u32 a1) InitBgFromTemplate(bg_config, 0, &sWFCWarningMsgBgTemplate, 0); BgClearTilemapBufferAndCommit(bg_config, GF_BG_LYR_MAIN_0); LoadUserFrameGfx1(bg_config, GF_BG_LYR_MAIN_0, 0x01F7, 2, 0, heapId); - LoadFontPal0(GF_PAL_LOCATION_MAIN_BG, GF_PAL_SLOT_OFFSET_1, heapId); + LoadFontPal0(GF_PAL_LOCATION_MAIN_BG, GF_PAL_SLOT_1_OFFSET, heapId); BG_ClearCharDataRange(GF_BG_LYR_MAIN_0, 0x20, 0, heapId); BG_SetMaskColor(GF_BG_LYR_MAIN_0, RGB(1, 1, 27)); BG_SetMaskColor(GF_BG_LYR_SUB_0, RGB(1, 1, 27)); diff --git a/include/bg_window.h b/include/bg_window.h index 5f50d4542..0e47b74a4 100644 --- a/include/bg_window.h +++ b/include/bg_window.h @@ -132,22 +132,22 @@ enum GFPalLoadLocation { }; enum GFPalSlotOffset { - GF_PAL_SLOT_OFFSET_0 = 0x00, - GF_PAL_SLOT_OFFSET_1 = 0x20, - GF_PAL_SLOT_OFFSET_2 = 0x40, - GF_PAL_SLOT_OFFSET_3 = 0x60, - GF_PAL_SLOT_OFFSET_4 = 0x80, - GF_PAL_SLOT_OFFSET_5 = 0xA0, - GF_PAL_SLOT_OFFSET_6 = 0xC0, - GF_PAL_SLOT_OFFSET_7 = 0xE0, - GF_PAL_SLOT_OFFSET_8 = 0x100, - GF_PAL_SLOT_OFFSET_9 = 0x120, - GF_PAL_SLOT_OFFSET_10 = 0x140, - GF_PAL_SLOT_OFFSET_11 = 0x160, - GF_PAL_SLOT_OFFSET_12 = 0x180, - GF_PAL_SLOT_OFFSET_13 = 0x1A0, - GF_PAL_SLOT_OFFSET_14 = 0X1C0, - GF_PAL_SLOT_OFFSET_15 = 0X1E0 + GF_PAL_SLOT_0_OFFSET = 0x00, + GF_PAL_SLOT_1_OFFSET = 0x20, + GF_PAL_SLOT_2_OFFSET = 0x40, + GF_PAL_SLOT_3_OFFSET = 0x60, + GF_PAL_SLOT_4_OFFSET = 0x80, + GF_PAL_SLOT_5_OFFSET = 0xA0, + GF_PAL_SLOT_6_OFFSET = 0xC0, + GF_PAL_SLOT_7_OFFSET = 0xE0, + GF_PAL_SLOT_8_OFFSET = 0x100, + GF_PAL_SLOT_9_OFFSET = 0x120, + GF_PAL_SLOT_10_OFFSET = 0x140, + GF_PAL_SLOT_11_OFFSET = 0x160, + GF_PAL_SLOT_12_OFFSET = 0x180, + GF_PAL_SLOT_13_OFFSET = 0x1A0, + GF_PAL_SLOT_14_OFFSET = 0X1C0, + GF_PAL_SLOT_15_OFFSET = 0X1E0 }; enum GFBgType { From 6fb4680e208a10efe1b6f1676c2075ebbf63d967 Mon Sep 17 00:00:00 2001 From: red031000 Date: Sat, 16 Dec 2023 13:47:49 +0000 Subject: [PATCH 6/9] correct some bad types and rename some funcs --- arm9/asm/blackout_asm.s | 22 ++++++++++----------- arm9/asm/scrcmd_7.s | 2 +- arm9/asm/unk_02034D7C.s | 4 ++-- arm9/asm/unk_02034E84.s | 8 ++++---- arm9/asm/unk_02048904.s | 4 ++-- arm9/asm/unk_0204AB0C.s | 2 +- arm9/asm/unk_020607D4.s | 2 +- arm9/asm/unk_02063888.s | 2 +- arm9/global.inc | 12 ++++++------ arm9/overlays/06/asm/overlay_06.s | 6 +++--- arm9/overlays/11/asm/ov11_0224D550.s | 2 +- arm9/overlays/16/asm/overlay_16.s | 2 +- arm9/overlays/17/asm/overlay_17.s | 2 +- arm9/overlays/56/asm/overlay_56.s | 2 +- arm9/overlays/59/src/ov59_Intro.c | 2 +- arm9/overlays/63/asm/ov63_021D74E0.s | 4 ++-- arm9/overlays/69/asm/overlay_69.s | 2 +- arm9/src/encounter.c | 4 ++-- arm9/src/scrcmd.c | 4 ++-- arm9/src/scrcmd_sound.c | 20 +++++-------------- arm9/src/unk_020040F4.c | 29 +++++++++++++--------------- arm9/src/unk_020051F4.c | 2 +- include/unk_020040F4.h | 20 +++++++++---------- include/unk_020051F4.h | 2 +- 24 files changed, 74 insertions(+), 87 deletions(-) diff --git a/arm9/asm/blackout_asm.s b/arm9/asm/blackout_asm.s index 113ceb545..1ca774603 100644 --- a/arm9/asm/blackout_asm.s +++ b/arm9/asm/blackout_asm.s @@ -5,8 +5,8 @@ .text - thumb_func_start FieldTask_BlackOut -FieldTask_BlackOut: ; 0x0204837C + thumb_func_start Task_BlackOut +Task_BlackOut: ; 0x0204837C push {r3-r7, lr} sub sp, #0x18 add r5, r0, #0x0 @@ -36,15 +36,15 @@ _020483B0: ldr r0, [r6, #0xc] bl Save_LocalFieldData_Get add r7, r0, #0x0 - bl sub_02034DFC + bl LocalFieldData_GetBlackoutSpawn add r1, sp, #0x4 str r0, [sp, #0x0] - bl sub_02034EC4 + bl GetDeathWarpData add r0, r7, #0x0 bl LocalFieldData_GetSpecialSpawnWarpPtr add r1, r0, #0x0 ldr r0, [sp, #0x0] - bl sub_02034E90 + bl GetSpecialSpawnWarpData add r0, r5, #0x0 add r1, sp, #0x4 bl sub_02049160 @@ -57,7 +57,7 @@ _020483B0: _020483E8: mov r0, #0x0 mov r1, #0x14 - bl sub_020053CC + bl GF_SndStartFadeOutBGM ldr r0, [r4, #0x0] add r0, r0, #0x1 str r0, [r4, #0x0] @@ -105,7 +105,7 @@ _02048442: add r7, r0, #0x0 ldr r0, [r6, #0xc] bl Save_LocalFieldData_Get - bl sub_02034DFC + bl LocalFieldData_GetBlackoutSpawn cmp r7, r0 bne _0204846E mov r2, #0x0 @@ -137,12 +137,12 @@ _02048488: _02048490: .word 0x000007E4 _02048494: .word 0x000007E5 - thumb_func_start CallFieldTask_BlackOut -CallFieldTask_BlackOut: ; 0x02048498 + thumb_func_start CallTask_BlackOut +CallTask_BlackOut: ; 0x02048498 ldr r3, _020484A0 ; =TaskManager_Call - ldr r1, _020484A4 ; =FieldTask_BlackOut + ldr r1, _020484A4 ; =Task_BlackOut mov r2, #0x0 bx r3 .balign 4 _020484A0: .word TaskManager_Call -_020484A4: .word FieldTask_BlackOut +_020484A4: .word Task_BlackOut diff --git a/arm9/asm/scrcmd_7.s b/arm9/asm/scrcmd_7.s index 51bf53d82..c2852a62b 100644 --- a/arm9/asm/scrcmd_7.s +++ b/arm9/asm/scrcmd_7.s @@ -503,7 +503,7 @@ ScrCmd_Unk00EA: ; 0x02041AB4 ScrCmd_Unk00EB: ; 0x02041AD4 push {r3, lr} ldr r0, [r0, #0x74] - bl CallFieldTask_BlackOut + bl CallTask_BlackOut mov r0, #0x1 pop {r3, pc} diff --git a/arm9/asm/unk_02034D7C.s b/arm9/asm/unk_02034D7C.s index 32f67fcf3..5e263d2e0 100644 --- a/arm9/asm/unk_02034D7C.s +++ b/arm9/asm/unk_02034D7C.s @@ -102,8 +102,8 @@ LocalFieldData_SetWeatherType: ; 0x02034DF4 bx lr .balign 4 - thumb_func_start sub_02034DFC -sub_02034DFC: ; 0x02034DFC + thumb_func_start LocalFieldData_GetBlackoutSpawn +LocalFieldData_GetBlackoutSpawn: ; 0x02034DFC add r0, #0x68 ldrh r0, [r0, #0x0] bx lr diff --git a/arm9/asm/unk_02034E84.s b/arm9/asm/unk_02034E84.s index ec31b0ded..38d9b58c9 100644 --- a/arm9/asm/unk_02034E84.s +++ b/arm9/asm/unk_02034E84.s @@ -86,8 +86,8 @@ sub_02034E8C: ; 0x02034E8C mov r0, #0x1 bx lr - thumb_func_start sub_02034E90 -sub_02034E90: ; 0x02034E90 + thumb_func_start GetSpecialSpawnWarpData +GetSpecialSpawnWarpData: ; 0x02034E90 push {r4, lr} add r4, r1, #0x0 bl sub_02034E78 @@ -112,8 +112,8 @@ _02034EB8: .word UNK_020F2224 + 6 _02034EBC: .word UNK_020F2224 + 8 _02034EC0: .word UNK_020F2224 + 10 - thumb_func_start sub_02034EC4 -sub_02034EC4: ; 0x02034EC4 + thumb_func_start GetDeathWarpData +GetDeathWarpData: ; 0x02034EC4 push {r4, lr} add r4, r1, #0x0 bl sub_02034E78 diff --git a/arm9/asm/unk_02048904.s b/arm9/asm/unk_02048904.s index 52e39900f..aabb281c9 100644 --- a/arm9/asm/unk_02048904.s +++ b/arm9/asm/unk_02048904.s @@ -2144,7 +2144,7 @@ _020499D0: _020499E2: mov r0, #0x0 mov r1, #0x1e - bl sub_020053CC + bl GF_SndStartFadeOutBGM ldr r0, [r4, #0x0] add r0, r0, #0x1 str r0, [r4, #0x0] @@ -2305,7 +2305,7 @@ _02049B2C: bne _02049BDC mov r0, #0x0 mov r1, #0x1e - bl sub_020053CC + bl GF_SndStartFadeOutBGM ldr r0, [r4, #0x0] add r0, r0, #0x1 str r0, [r4, #0x0] diff --git a/arm9/asm/unk_0204AB0C.s b/arm9/asm/unk_0204AB0C.s index a5b5c20c3..8699d39bf 100644 --- a/arm9/asm/unk_0204AB0C.s +++ b/arm9/asm/unk_0204AB0C.s @@ -362,7 +362,7 @@ sub_0204AD60: ; 0x0204AD60 beq _0204AD88 mov r0, #0x0 mov r1, #0x28 - bl sub_020053CC + bl GF_SndStartFadeOutBGM _0204AD88: pop {r4-r6, pc} .balign 4 diff --git a/arm9/asm/unk_020607D4.s b/arm9/asm/unk_020607D4.s index 42716f242..e68237b82 100644 --- a/arm9/asm/unk_020607D4.s +++ b/arm9/asm/unk_020607D4.s @@ -330,7 +330,7 @@ _02060A4E: bl BeginNormalPaletteFade mov r0, #0x0 mov r1, #0x6 - bl sub_020053CC + bl GF_SndStartFadeOutBGM mov r0, #0x3 strb r0, [r4, #0x0] b _02060B00 diff --git a/arm9/asm/unk_02063888.s b/arm9/asm/unk_02063888.s index 79cdad3b6..17ccd059d 100644 --- a/arm9/asm/unk_02063888.s +++ b/arm9/asm/unk_02063888.s @@ -81,7 +81,7 @@ _020638F8: _02063920: add r0, r6, #0x0 add r1, sp, #0x8 - bl sub_02034E90 + bl GetSpecialSpawnWarpData ldr r0, [sp, #0x14] mov r2, #0x1 str r0, [sp, #0x0] diff --git a/arm9/global.inc b/arm9/global.inc index 5203fc01d..043cee13c 100644 --- a/arm9/global.inc +++ b/arm9/global.inc @@ -344,7 +344,7 @@ .extern sub_02005308 .extern sub_02005350 .extern sub_0200538C -.extern sub_020053CC +.extern GF_SndStartFadeOutBGM .extern sub_02005404 .extern sub_02005410 .extern sub_0200541C @@ -2556,7 +2556,7 @@ .extern sub_02034DE8 .extern LocalFieldData_GetWeatherType .extern LocalFieldData_SetWeatherType -.extern sub_02034DFC +.extern LocalFieldData_GetBlackoutSpawn .extern LocalFieldData_SetBlackoutSpawn .extern sub_02034E0C .extern sub_02034E10 @@ -2569,8 +2569,8 @@ .extern sub_02034E48 .extern sub_02034E60 .extern sub_02034E8C -.extern sub_02034E90 -.extern sub_02034EC4 +.extern GetSpecialSpawnWarpData +.extern GetDeathWarpData .extern sub_02034EF8 .extern sub_02034F1C .extern sub_02034F40 @@ -3474,8 +3474,8 @@ .extern sub_020480C8 .extern sub_020480D8 .extern sub_020480E4 -.extern FieldTask_BlackOut -.extern CallFieldTask_BlackOut +.extern Task_BlackOut +.extern CallTask_BlackOut .extern CallTask_GameClear .extern sub_020489DC .extern sub_020489FC diff --git a/arm9/overlays/06/asm/overlay_06.s b/arm9/overlays/06/asm/overlay_06.s index 59cd9285d..96740bec4 100644 --- a/arm9/overlays/06/asm/overlay_06.s +++ b/arm9/overlays/06/asm/overlay_06.s @@ -452,7 +452,7 @@ _022399EA: ; jump table _022399FA: mov r0, #0 mov r1, #1 - bl sub_020053CC + bl GF_SndStartFadeOutBGM ldr r0, [r4, #0xc] add r0, r0, #1 str r0, [r4, #0xc] @@ -39279,9 +39279,9 @@ ov06_0224C888: ; 0x0224C888 ldr r1, [r4, #8] cmp r1, #2 bne _0224C8B2 - bl sub_02034DFC + bl LocalFieldData_GetBlackoutSpawn add r1, sp, #0 - bl sub_02034E90 + bl GetSpecialSpawnWarpData ldr r2, [r4, #8] add r0, r5, #0 add r1, sp, #0 diff --git a/arm9/overlays/11/asm/ov11_0224D550.s b/arm9/overlays/11/asm/ov11_0224D550.s index 010e2c1f1..e4d7f4172 100644 --- a/arm9/overlays/11/asm/ov11_0224D550.s +++ b/arm9/overlays/11/asm/ov11_0224D550.s @@ -10984,7 +10984,7 @@ _02252DDE: bl sub_02007E98 mov r0, #0 mov r1, #0x10 - bl sub_020053CC + bl GF_SndStartFadeOutBGM ldrb r0, [r5, #6] add r0, r0, #1 strb r0, [r5, #6] diff --git a/arm9/overlays/16/asm/overlay_16.s b/arm9/overlays/16/asm/overlay_16.s index 7b3777d14..980d67130 100644 --- a/arm9/overlays/16/asm/overlay_16.s +++ b/arm9/overlays/16/asm/overlay_16.s @@ -40997,7 +40997,7 @@ _021EA400: _021EA40C: mov r0, #0 mov r1, #3 - bl sub_020053CC + bl GF_SndStartFadeOutBGM ldr r0, [r4] add r0, r0, #1 str r0, [r4] diff --git a/arm9/overlays/17/asm/overlay_17.s b/arm9/overlays/17/asm/overlay_17.s index f46a2fa53..61bfe3cae 100644 --- a/arm9/overlays/17/asm/overlay_17.s +++ b/arm9/overlays/17/asm/overlay_17.s @@ -2729,7 +2729,7 @@ _021D89B8: ; jump table _021D89E2: mov r0, #0x2a mov r1, #0x1e - bl sub_020053CC + bl GF_SndStartFadeOutBGM ldr r0, [r4] add r0, r0, #1 str r0, [r4] diff --git a/arm9/overlays/56/asm/overlay_56.s b/arm9/overlays/56/asm/overlay_56.s index 8cb5577cc..f9dd352c5 100644 --- a/arm9/overlays/56/asm/overlay_56.s +++ b/arm9/overlays/56/asm/overlay_56.s @@ -8517,7 +8517,7 @@ ov56_0221617C: ; 0x0221617C bne _022161A8 mov r0, #0 mov r1, #0x1e - bl sub_020053CC + bl GF_SndStartFadeOutBGM b _022161C8 _022161A8: cmp r4, #0x10 diff --git a/arm9/overlays/59/src/ov59_Intro.c b/arm9/overlays/59/src/ov59_Intro.c index f0fa5cd6c..1cc8565b2 100644 --- a/arm9/overlays/59/src/ov59_Intro.c +++ b/arm9/overlays/59/src/ov59_Intro.c @@ -2865,7 +2865,7 @@ BOOL ov59_MasterController(ov59_IntroOverlayData *data) { break; } - sub_020053CC(0, 50); //fade music + GF_SndStartFadeOutBGM(0, 50); //fade music data->controllerCounter = 102; break; diff --git a/arm9/overlays/63/asm/ov63_021D74E0.s b/arm9/overlays/63/asm/ov63_021D74E0.s index e4a1e8c26..c1f04785d 100644 --- a/arm9/overlays/63/asm/ov63_021D74E0.s +++ b/arm9/overlays/63/asm/ov63_021D74E0.s @@ -212,7 +212,7 @@ _021D768C: strh r1, [r4, r0] mov r0, #0 mov r1, #0x3c - bl sub_020053CC + bl GF_SndStartFadeOutBGM ldr r0, _021D77AC ; =0x000005F4 bl PlaySE mov r0, #4 @@ -254,7 +254,7 @@ _021D76D4: bl GfGfx_EngineBTogglePlanes mov r0, #0 mov r1, #0x3c - bl sub_020053CC + bl GF_SndStartFadeOutBGM mov r0, #5 str r0, [r5] b _021D779C diff --git a/arm9/overlays/69/asm/overlay_69.s b/arm9/overlays/69/asm/overlay_69.s index bd004c0ce..7e71301ed 100644 --- a/arm9/overlays/69/asm/overlay_69.s +++ b/arm9/overlays/69/asm/overlay_69.s @@ -329,7 +329,7 @@ _0222D87E: bl BeginNormalPaletteFade mov r0, #0 mov r1, #0x1e - bl sub_020053CC + bl GF_SndStartFadeOutBGM ldr r0, [r4] add r0, r0, #1 str r0, [r4] diff --git a/arm9/src/encounter.c b/arm9/src/encounter.c index db43fcaf9..30240e5a1 100644 --- a/arm9/src/encounter.c +++ b/arm9/src/encounter.c @@ -27,7 +27,7 @@ extern void sub_02047FA4(BattleSetup *setup, FieldSystem *fieldSystem); extern BattleSetup *ov06_02244558(u32 param0, FieldSystem *fieldSystem); extern s32 sub_020475A0(BattleSetup *battleSetup); extern s32 sub_020475B0(BattleSetup *battleSetup); -extern BOOL FieldTask_BlackOut(TaskManager *taskManager); +extern BOOL Task_BlackOut(TaskManager *taskManager); extern void sub_0205DD40(u32 param0); extern u32 sub_0205E128(u32 param0); extern void sub_0205DED4(FieldSystem *fieldSystem, u32 winFlag, u32 param2); @@ -379,7 +379,7 @@ static BOOL Task_WildEncounter(TaskManager *taskManager) { if (IsBattleResultWin(encounter->setup->winFlag) == FALSE) { WildEncounter_Delete(encounter); sub_0205DD40(fieldSystem->unk90); - TaskManager_Jump(taskManager, FieldTask_BlackOut, NULL); + TaskManager_Jump(taskManager, Task_BlackOut, NULL); return FALSE; } diff --git a/arm9/src/scrcmd.c b/arm9/src/scrcmd.c index 6066d0bb0..7c1fd9d39 100644 --- a/arm9/src/scrcmd.c +++ b/arm9/src/scrcmd.c @@ -249,7 +249,7 @@ extern u16 sub_02053678(u32 trainerId, PlayerGender playerGender, u32 param2); extern u16 sub_020536D0(PlayerGender playerGender, u16 param1, u16 param2); extern void sub_02049EA4(TaskManager *taskManager); extern void LocalFieldData_SetBlackoutSpawn(LocalFieldData *localFieldData, u16 spawnPoint); -extern void CallFieldTask_BlackOut(TaskManager *taskManager); +extern void CallTask_BlackOut(TaskManager *taskManager); extern void HealParty(Party *playerParty); extern void sub_02050024(void); extern u32 sub_02031810(void); @@ -3248,7 +3248,7 @@ BOOL ScrCmd_SetPlayerAvatar(ScriptContext *ctx) { //0156 } BOOL ScrCmd_DummyBlackOut(ScriptContext *ctx) { //014B - CallFieldTask_BlackOut(ctx->taskManager); + CallTask_BlackOut(ctx->taskManager); return TRUE; } diff --git a/arm9/src/scrcmd_sound.c b/arm9/src/scrcmd_sound.c index 7b4c4747d..d14e80b09 100644 --- a/arm9/src/scrcmd_sound.c +++ b/arm9/src/scrcmd_sound.c @@ -2,25 +2,15 @@ #include "scrcmd.h" #include "constants/sndseq.h" #include "unk_020040F4.h" +#include "unk_020051F4.h" #include "sound_chatot.h" //todo make compatible with the headers extern BOOL sub_02005CBC(void); -extern void PlaySound(u16); extern void FieldSystem_SetSavedMusicId(struct FieldSystem *fieldSystem, u16); extern u16 sub_0204ABA8(struct FieldSystem *fieldSystem, u32); -extern void sub_0200521C(u16); -extern void sub_02005308(u32, u16); -extern void sub_02005350(u32, u32); -extern void sub_0200538C(u32, u16, u32); -extern void sub_020053CC(u16, u16); -extern BOOL sub_02005404(void); extern u16 sub_02005410(u16); -extern void PlaySE(u16); -extern void sub_020054F0(u16, u32); -extern BOOL sub_02005508(u16); -extern void sub_02005578(u16); extern BOOL sub_02005670(void); BOOL ScrCmd_Unk02AE(struct ScriptContext *ctx) //02AE @@ -42,7 +32,7 @@ BOOL ScrCmd_PlayBgm(struct ScriptContext *ctx) //0050 BOOL ScrCmd_StopBgm(struct ScriptContext *ctx) //0051 { ScriptReadHalfword(ctx); - u32 unk0 = sub_02004124(); + u16 unk0 = sub_02004124(); sub_02005350(unk0, 0); return FALSE; } @@ -65,7 +55,7 @@ BOOL ScrCmd_FadeOutBgm(struct ScriptContext *ctx) //0054 u16 unk1 = ScriptReadHalfword(ctx); u16 unk2 = ScriptReadHalfword(ctx); - sub_020053CC(unk1, unk2); + GF_SndStartFadeOutBGM(unk1, unk2); SetupNativeScript(ctx, sub_02041464); return TRUE; @@ -75,7 +65,7 @@ BOOL sub_02041464(struct ScriptContext* ctx) { #pragma unused(ctx) - if(!sub_02005404()) + if(sub_02005404() == 0) return TRUE; else return FALSE; @@ -142,7 +132,7 @@ BOOL ScrCmd_PlayFanfareWait(struct ScriptContext* ctx) //004B BOOL sub_02041540(struct ScriptContext* ctx) { - if(!sub_02005508((u16)ctx->data[0])) + if(sub_02005508((u16)ctx->data[0]) == 0) return TRUE; else return FALSE; diff --git a/arm9/src/unk_020040F4.c b/arm9/src/unk_020040F4.c index 8614a3db9..e64a0e6f5 100644 --- a/arm9/src/unk_020040F4.c +++ b/arm9/src/unk_020040F4.c @@ -2,6 +2,7 @@ #include "unk_020040F4.h" #include "OS_cache.h" #include "sound.h" +#include "unk_020051F4.h" #include "unk_0202F150.h" #include "SPI_mic.h" @@ -13,8 +14,6 @@ const u8 UNK_020ECB8C[] = { 2, 3, 4, 5, 6, 7, 8, 9, 10 }; extern void sub_02005454(); extern void sub_0200541C(); -extern void sub_0200521C(int); -extern void sub_0200538C(u32, u16, u32); extern void NNS_SndPlayerPause(u32 *, u8); extern void NNS_SndPlayerMoveVolume(u32 *, s32, s32); extern void NNS_SndPlayerSetInitialVolume(u32 *, s32); @@ -43,12 +42,10 @@ extern void NNS_SndCaptureStopEffect(); extern void NNS_SndPlayerSetTrackPitch(u32 *, u32, s32); extern void NNS_SndPlayerSetTrackPan(u32 *, u32, s32); extern void NNS_SndSetMonoFlag(u32 param0); -extern void sub_020053CC(u32, u32); extern u32 NNS_SndArcGetFileAddress(u32); extern u32 SND_GetWaveDataAddress(u32, u32); extern u32 NNS_SndPlayerGetTick(u32 *); extern void NNS_SndPlayerSetAllocatableChannel(u32, u32); -extern BOOL sub_02005404(void); extern void NNS_SndPlayerSetPlayerVolume(u32, u8); void sub_020040F4(u8 param0) @@ -308,7 +305,7 @@ void sub_020044A8(s32 param0) GF_Snd_SaveState(ptr3); } -void sub_020044D4(int seqNo, u32 param1) +void sub_020044D4(u16 seqNo, u32 param1) { #pragma unused(param1) @@ -403,7 +400,7 @@ void sub_020045C4(int seqNo, u32 param1) GF_Snd_SaveState((int *)sub_02003D38(26)); } -void sub_02004648(int param0, u32 param1) +void sub_02004648(u16 param0, u32 param1) { #pragma unused(param1) sub_02003D38(23); @@ -416,7 +413,7 @@ void sub_02004648(int param0, u32 param1) sub_0200521C(param0); } -void sub_02004680(int param0, u32 param1) +void sub_02004680(u16 param0, u32 param1) { #pragma unused(param1) sub_02003D38(23); @@ -426,7 +423,7 @@ void sub_02004680(int param0, u32 param1) sub_0200521C(param0); } -void sub_020046A0(int param0, u32 param1) +void sub_020046A0(u16 param0, u32 param1) { #pragma unused(param1) sub_02003D38(23); @@ -436,7 +433,7 @@ void sub_020046A0(int param0, u32 param1) sub_0200521C(param0); } -void sub_020046C4(int param0, u32 param1) +void sub_020046C4(u16 param0, u32 param1) { #pragma unused(param1) sub_02003D38(23); @@ -453,7 +450,7 @@ void sub_020046E8(s32 param0) GF_Snd_SaveState((int *)sub_02003D38(27)); } -void sub_02004704(s32 param0, int param1, u32 param2) +void sub_02004704(s32 param0, u16 param1, u32 param2) { #pragma unused(param2) sub_02003D38(23); @@ -462,7 +459,7 @@ void sub_02004704(s32 param0, int param1, u32 param2) sub_0200521C(param1); } -void sub_02004724(int param0) +void sub_02004724(u16 param0) { GetSoundDataPointer(); sub_020051AC(); @@ -1020,7 +1017,7 @@ void sub_02004DBC(u8 param0) *(u8 *)sub_02003D38(18) = param0; } -u32 sub_02004DCC(u32 param0, u16 param1, u32 param2, u32 param3, u8 param4, u32 param5) +u32 sub_02004DCC(u32 param0, u16 param1, u16 param2, u32 param3, u8 param4, u32 param5) { u8 *ptr = sub_02003D38(21); @@ -1032,7 +1029,7 @@ u32 sub_02004DCC(u32 param0, u16 param1, u32 param2, u32 param3, u8 param4, u32 } u32 sub_02004E08( - u32 param0, u16 param1, u32 param2, u32 param3, u32 param35, u8 param4, u32 param5) + u32 param0, u16 param1, u16 param2, u32 param3, u32 param35, u8 param4, u32 param5) { u32 *ptr = sub_02003D38(8); @@ -1043,13 +1040,13 @@ u32 sub_02004E08( return 1; } -void sub_02004E44(u32 param0, u16 param1, u32 param2, u32 param3, u8 param4, u32 param5) +void sub_02004E44(u32 param0, u16 param1, u16 param2, u32 param3, u8 param4, u32 param5) { #pragma unused(param0) #pragma unused(param5) u32 *ptr = sub_02003D38(2); - sub_020053CC(0, param2); + GF_SndStartFadeOutBGM(0, param2); sub_02004110(0); sub_02004130(param1); sub_02004D84(param3); @@ -1344,7 +1341,7 @@ void sub_0200516C(u32 param0) void sub_020051AC(void) { - if (sub_02005404() == FALSE && GF_SndPlayerGetSeqNo(GetSoundPlayer(0)) != -1 && + if (sub_02005404() == 0 && GF_SndPlayerGetSeqNo(GetSoundPlayer(0)) != -1 && sub_02004124() != 0x47e) { diff --git a/arm9/src/unk_020051F4.c b/arm9/src/unk_020051F4.c index b3d25aa64..9b9560ce1 100644 --- a/arm9/src/unk_020051F4.c +++ b/arm9/src/unk_020051F4.c @@ -143,7 +143,7 @@ void sub_0200538C(s32 param0, u16 param1, u32 param2) sub_02003CE8(3); } -void sub_020053CC(s32 param0, s32 param1) +void GF_SndStartFadeOutBGM(u16 param0, u16 param1) { u8 r6 = sub_020048D0(sub_02004124()); if (r6 == 0xff) diff --git a/include/unk_020040F4.h b/include/unk_020040F4.h index a5f47b456..84bb02dc5 100644 --- a/include/unk_020040F4.h +++ b/include/unk_020040F4.h @@ -43,16 +43,16 @@ void sub_0200415C(u8 param0); BOOL sub_02004180(s32 param0); BOOL sub_0200433C(u8 param0, u16 param1, u32 param2); void sub_020044A8(s32 param0); -void sub_020044D4(int seqNo, u32 param1); +void sub_020044D4(u16 seqNo, u32 param1); void sub_02004568(int seqNo, u16 param1); void sub_020045C4(int seqNo, u32 param1); -void sub_02004648(int param0, u32 param1); -void sub_02004680(int param0, u32 param1); -void sub_020046A0(int param0, u32 param1); -void sub_020046C4(int param0, u32 param1); +void sub_02004648(u16 param0, u32 param1); +void sub_02004680(u16 param0, u32 param1); +void sub_020046A0(u16 param0, u32 param1); +void sub_020046C4(u16 param0, u32 param1); void sub_020046E8(s32 param0); -void sub_02004704(s32 param0, int param1, u32 param2); -void sub_02004724(int param0); +void sub_02004704(s32 param0, u16 param1, u32 param2); +void sub_02004724(u16 param0); void sub_02004738(void); int sub_02004748(s32 param0); void sub_020047C8(u8 param0, u8 param1); @@ -98,10 +98,10 @@ void sub_02004D84(u32 param0); u16 sub_02004D94(void); u8 *sub_02004DB4(void); void sub_02004DBC(u8 param0); -u32 sub_02004DCC(u32 param0, u16 param1, u32 param2, u32 param3, u8 param4, u32 param5); +u32 sub_02004DCC(u32 param0, u16 param1, u16 param2, u32 param3, u8 param4, u32 param5); u32 sub_02004E08( - u32 param0, u16 param1, u32 param2, u32 param3, u32 param35, u8 param4, u32 param5); -void sub_02004E44(u32 param0, u16 param1, u32 param2, u32 param3, u8 param4, u32 param5); + u32 param0, u16 param1, u16 param2, u32 param3, u32 param35, u8 param4, u32 param5); +void sub_02004E44(u32 param0, u16 param1, u16 param2, u32 param3, u8 param4, u32 param5); u32 sub_02004E80(u32 param0); u32 sub_02004E8C(u32 *param0); u32 sub_02004E98(s32 param0); diff --git a/include/unk_020051F4.h b/include/unk_020051F4.h index a8391a8f2..d621979bf 100644 --- a/include/unk_020051F4.h +++ b/include/unk_020051F4.h @@ -13,7 +13,7 @@ u32 sub_02005308(u32 param0, u16 param1); void sub_02005350(u16 param0, u32 param1); void sub_02005374(); void sub_0200538C(s32 param0, u16 param1, u32 param2); -void sub_020053CC(s32 param0, s32 param1); +void GF_SndStartFadeOutBGM(u16 param0, u16 param1); u16 sub_02005404(); u16 sub_02005410(u16 param0); void sub_0200541C(); From c855d1d445a8dade267b28991540d8c7f2ed8042 Mon Sep 17 00:00:00 2001 From: red031000 Date: Sat, 16 Dec 2023 14:43:25 +0000 Subject: [PATCH 7/9] finish blackout.c --- arm9/arm9.lsf | 3 +- arm9/asm/blackout_asm.s | 148 ------------------------ arm9/asm/unk_02034D7C.s | 2 +- arm9/asm/unk_02034E84.s | 4 +- arm9/asm/unk_02048904.s | 16 +-- arm9/asm/unk_0204C1B4.s | 2 +- arm9/asm/unk_020607D4.s | 2 +- arm9/asm/unk_0206367C.s | 4 +- arm9/global.inc | 6 +- arm9/overlays/06/asm/overlay_06.s | 4 +- arm9/overlays/12/asm/overlay_12.s | 6 +- arm9/overlays/16/asm/overlay_16.s | 2 +- arm9/overlays/17/asm/overlay_17.s | 2 +- arm9/overlays/63/asm/ov63_021D74E0.s | 4 +- arm9/overlays/69/asm/overlay_69.s | 2 +- arm9/src/{blackout_src.c => blackout.c} | 77 +++++++++++- arm9/src/encounter.c | 2 +- arm9/src/scrcmd.c | 2 +- arm9/src/scrcmd_sound.c | 2 +- arm9/src/sound.c | 15 +-- arm9/src/unk_020040F4.c | 2 +- arm9/src/unk_020051F4.c | 6 +- arm9/src/unk_0204AF24.c | 2 +- include/blackout.h | 2 + include/save_local_field_data.h | 8 ++ include/script.h | 5 +- include/unk_020051F4.h | 4 +- 27 files changed, 130 insertions(+), 204 deletions(-) delete mode 100644 arm9/asm/blackout_asm.s rename arm9/src/{blackout_src.c => blackout.c} (61%) create mode 100644 include/save_local_field_data.h diff --git a/arm9/arm9.lsf b/arm9/arm9.lsf index 9731395c8..42b8cd0fb 100644 --- a/arm9/arm9.lsf +++ b/arm9/arm9.lsf @@ -187,8 +187,7 @@ Static arm9 Object encounter.o Object unk_02047500.o Object unk_020476CC.o - Object blackout_src.o - Object blackout_asm.o + Object blackout.o Object unk_020484A8.o Object unk_02048904.o Object script_pokemon_util.o diff --git a/arm9/asm/blackout_asm.s b/arm9/asm/blackout_asm.s deleted file mode 100644 index 1ca774603..000000000 --- a/arm9/asm/blackout_asm.s +++ /dev/null @@ -1,148 +0,0 @@ - .include "asm/macros.inc" - .include "global.inc" - - .extern Blackout_DrawMessage - - .text - - thumb_func_start Task_BlackOut -Task_BlackOut: ; 0x0204837C - push {r3-r7, lr} - sub sp, #0x18 - add r5, r0, #0x0 - bl TaskManager_GetFieldSystem - add r6, r0, #0x0 - add r0, r5, #0x0 - bl TaskManager_GetStatePtr - add r4, r0, #0x0 - ldr r0, [r4, #0x0] - cmp r0, #0x6 - bhi _02048488 - add r0, r0, r0 - add r0, pc - ldrh r0, [r0, #0x6] - lsl r0, r0, #0x10 - asr r0, r0, #0x10 - add pc, r0 -_020483A2: ; jump table (using 16-bit offset) - .short _020483B0 - _020483A2 - 2; case 0 - .short _020483E8 - _020483A2 - 2; case 1 - .short _020483F8 - _020483A2 - 2; case 2 - .short _0204840C - _020483A2 - 2; case 3 - .short _02048434 - _020483A2 - 2; case 4 - .short _02048442 - _020483A2 - 2; case 5 - .short _02048482 - _020483A2 - 2; case 6 -_020483B0: - ldr r0, [r6, #0xc] - bl Save_LocalFieldData_Get - add r7, r0, #0x0 - bl LocalFieldData_GetBlackoutSpawn - add r1, sp, #0x4 - str r0, [sp, #0x0] - bl GetDeathWarpData - add r0, r7, #0x0 - bl LocalFieldData_GetSpecialSpawnWarpPtr - add r1, r0, #0x0 - ldr r0, [sp, #0x0] - bl GetSpecialSpawnWarpData - add r0, r5, #0x0 - add r1, sp, #0x4 - bl sub_02049160 - add r0, r6, #0x0 - bl sub_020637F0 - ldr r0, [r4, #0x0] - add r0, r0, #0x1 - str r0, [r4, #0x0] - b _02048488 -_020483E8: - mov r0, #0x0 - mov r1, #0x14 - bl GF_SndStartFadeOutBGM - ldr r0, [r4, #0x0] - add r0, r0, #0x1 - str r0, [r4, #0x0] - b _02048488 -_020483F8: - bl sub_02005404 - cmp r0, #0x0 - bne _02048488 - bl sub_0204AB0C - ldr r0, [r4, #0x0] - add r0, r0, #0x1 - str r0, [r4, #0x0] - b _02048488 -_0204840C: - mov r0, #0xf - mvn r0, r0 - mov r1, #0x37 - mov r2, #0x1 - bl SetBlendBrightness - mov r0, #0xf - mvn r0, r0 - mov r1, #0x3f - mov r2, #0x2 - bl SetBlendBrightness - add r0, r6, #0x0 - add r1, r5, #0x0 - bl Blackout_DrawMessage - ldr r0, [r4, #0x0] - add r0, r0, #0x1 - str r0, [r4, #0x0] - b _02048488 -_02048434: - add r0, r5, #0x0 - bl CallTask_RestoreOverworld - ldr r0, [r4, #0x0] - add r0, r0, #0x1 - str r0, [r4, #0x0] - b _02048488 -_02048442: - mov r0, #0x0 - mov r1, #0x3f - mov r2, #0x3 - bl SetBlendBrightness - bl sub_02034E8C - add r7, r0, #0x0 - ldr r0, [r6, #0xc] - bl Save_LocalFieldData_Get - bl LocalFieldData_GetBlackoutSpawn - cmp r7, r0 - bne _0204846E - mov r2, #0x0 - ldr r1, _02048490 ; =0x000007E4 - add r0, r5, #0x0 - add r3, r2, #0x0 - bl QueueScript - b _0204847A -_0204846E: - mov r2, #0x0 - ldr r1, _02048494 ; =0x000007E5 - add r0, r5, #0x0 - add r3, r2, #0x0 - bl QueueScript -_0204847A: - ldr r0, [r4, #0x0] - add r0, r0, #0x1 - str r0, [r4, #0x0] - b _02048488 -_02048482: - add sp, #0x18 - mov r0, #0x1 - pop {r3-r7, pc} -_02048488: - mov r0, #0x0 - add sp, #0x18 - pop {r3-r7, pc} - nop -_02048490: .word 0x000007E4 -_02048494: .word 0x000007E5 - - thumb_func_start CallTask_BlackOut -CallTask_BlackOut: ; 0x02048498 - ldr r3, _020484A0 ; =TaskManager_Call - ldr r1, _020484A4 ; =Task_BlackOut - mov r2, #0x0 - bx r3 - .balign 4 -_020484A0: .word TaskManager_Call -_020484A4: .word Task_BlackOut diff --git a/arm9/asm/unk_02034D7C.s b/arm9/asm/unk_02034D7C.s index 5e263d2e0..c4863ca17 100644 --- a/arm9/asm/unk_02034D7C.s +++ b/arm9/asm/unk_02034D7C.s @@ -39,7 +39,7 @@ sub_02034D98: ; 0x02034D98 add r0, r4, #0x0 add r0, #0x8c bl sub_02055468 - bl sub_02034E8C + bl GetMomSpawnId add r4, #0x68 strh r0, [r4, #0x0] pop {r4, pc} diff --git a/arm9/asm/unk_02034E84.s b/arm9/asm/unk_02034E84.s index 38d9b58c9..be838749c 100644 --- a/arm9/asm/unk_02034E84.s +++ b/arm9/asm/unk_02034E84.s @@ -81,8 +81,8 @@ _02034E88: sub r0, r0, #0x1 pop {r3, pc} - thumb_func_start sub_02034E8C -sub_02034E8C: ; 0x02034E8C + thumb_func_start GetMomSpawnId +GetMomSpawnId: ; 0x02034E8C mov r0, #0x1 bx lr diff --git a/arm9/asm/unk_02048904.s b/arm9/asm/unk_02048904.s index aabb281c9..a75af32a3 100644 --- a/arm9/asm/unk_02048904.s +++ b/arm9/asm/unk_02048904.s @@ -949,7 +949,7 @@ _02049080: str r0, [r4, #0x0] b _020490B6 _02049090: - bl sub_02005404 + bl GF_SndGetFadeTimer cmp r0, #0x0 bne _020490B6 ldr r1, [r4, #0x4] @@ -1142,7 +1142,7 @@ _02049206: str r0, [r4, #0x0] b _0204923C _02049216: - bl sub_02005404 + bl GF_SndGetFadeTimer cmp r0, #0x0 bne _0204923C ldr r1, [r4, #0x4] @@ -1309,7 +1309,7 @@ _0204934A: str r0, [r4, #0x0] b _02049390 _02049364: - bl sub_02005404 + bl GF_SndGetFadeTimer cmp r0, #0x0 bne _02049390 ldr r1, [r5, #0x0] @@ -1542,7 +1542,7 @@ _02049512: str r0, [r4, #0x0] b _02049570 _0204952C: - bl sub_02005404 + bl GF_SndGetFadeTimer cmp r0, #0x0 bne _02049570 ldr r1, [r6, #0x0] @@ -1756,7 +1756,7 @@ _020496BC: str r0, [r4, #0x0] b _02049712 _020496CC: - bl sub_02005404 + bl GF_SndGetFadeTimer cmp r0, #0x0 bne _02049712 ldr r1, [r5, #0x0] @@ -2188,7 +2188,7 @@ _02049A14: str r0, [r4, #0x0] b _02049AB2 _02049A42: - bl sub_02005404 + bl GF_SndGetFadeTimer cmp r0, #0x0 bne _02049AB2 mov r0, #0x0 @@ -2346,7 +2346,7 @@ _02049B76: str r0, [r4, #0x0] b _02049BDC _02049B9C: - bl sub_02005404 + bl GF_SndGetFadeTimer cmp r0, #0x0 bne _02049BDC mov r0, #0x0 @@ -2825,7 +2825,7 @@ _02049F58: str r0, [r4, #0x0] b _02049F8E _02049F68: - bl sub_02005404 + bl GF_SndGetFadeTimer cmp r0, #0x0 bne _02049F8E ldr r1, [r4, #0x4] diff --git a/arm9/asm/unk_0204C1B4.s b/arm9/asm/unk_0204C1B4.s index ece4bbd21..a34f8bdbf 100644 --- a/arm9/asm/unk_0204C1B4.s +++ b/arm9/asm/unk_0204C1B4.s @@ -326,7 +326,7 @@ _0204C416: str r0, [r4, #0x0] b _0204C458 _0204C41E: - bl sub_02005404 + bl GF_SndGetFadeTimer cmp r0, #0x0 bne _0204C458 ldr r1, [r6, #0x0] diff --git a/arm9/asm/unk_020607D4.s b/arm9/asm/unk_020607D4.s index e68237b82..be379733c 100644 --- a/arm9/asm/unk_020607D4.s +++ b/arm9/asm/unk_020607D4.s @@ -338,7 +338,7 @@ _02060A74: bl IsPaletteFadeFinished cmp r0, #0x0 beq _02060A84 - bl sub_02005404 + bl GF_SndGetFadeTimer cmp r0, #0x0 beq _02060A8A _02060A84: diff --git a/arm9/asm/unk_0206367C.s b/arm9/asm/unk_0206367C.s index 36087884f..d9e8374a1 100644 --- a/arm9/asm/unk_0206367C.s +++ b/arm9/asm/unk_0206367C.s @@ -170,8 +170,8 @@ sub_020637E0: ; 0x020637E0 pop {r3, pc} .balign 4 - thumb_func_start sub_020637F0 -sub_020637F0: ; 0x020637F0 + thumb_func_start FieldSystem_ClearFollowingTrainer +FieldSystem_ClearFollowingTrainer: ; 0x020637F0 push {r4, lr} ldr r0, [r0, #0xc] bl Save_VarsFlags_Get diff --git a/arm9/global.inc b/arm9/global.inc index 043cee13c..7fa4472ce 100644 --- a/arm9/global.inc +++ b/arm9/global.inc @@ -345,7 +345,7 @@ .extern sub_02005350 .extern sub_0200538C .extern GF_SndStartFadeOutBGM -.extern sub_02005404 +.extern GF_SndGetFadeTimer .extern sub_02005410 .extern sub_0200541C .extern sub_02005454 @@ -2568,7 +2568,7 @@ .extern Save_LocalFieldData_Get .extern sub_02034E48 .extern sub_02034E60 -.extern sub_02034E8C +.extern GetMomSpawnId .extern GetSpecialSpawnWarpData .extern GetDeathWarpData .extern sub_02034EF8 @@ -4685,7 +4685,7 @@ .extern sub_020637A8 .extern sub_020637C4 .extern sub_020637E0 -.extern sub_020637F0 +.extern FieldSystem_ClearFollowingTrainer .extern sub_02063808 .extern sub_02063888 .extern sub_020638BC diff --git a/arm9/overlays/06/asm/overlay_06.s b/arm9/overlays/06/asm/overlay_06.s index 96740bec4..0f7f389d6 100644 --- a/arm9/overlays/06/asm/overlay_06.s +++ b/arm9/overlays/06/asm/overlay_06.s @@ -458,7 +458,7 @@ _022399FA: str r0, [r4, #0xc] b _02239AA4 _02239A0A: - bl sub_02005404 + bl GF_SndGetFadeTimer cmp r0, #0 bne _02239AA4 ldr r0, [r4, #0xc] @@ -517,7 +517,7 @@ _02239A72: str r0, [r4, #0xc] b _02239AA4 _02239A84: - bl sub_02005404 + bl GF_SndGetFadeTimer cmp r0, #0 bne _02239AA4 ldr r0, [r4, #0xc] diff --git a/arm9/overlays/12/asm/overlay_12.s b/arm9/overlays/12/asm/overlay_12.s index 13f314d1b..5b1a8182f 100644 --- a/arm9/overlays/12/asm/overlay_12.s +++ b/arm9/overlays/12/asm/overlay_12.s @@ -36965,7 +36965,7 @@ _0223F308: strb r0, [r4, #0x10] pop {r3, r4, r5, pc} _0223F318: - bl sub_02005404 + bl GF_SndGetFadeTimer cmp r0, #0 bne _0223F3A0 ldrb r0, [r4, #0x10] @@ -47042,7 +47042,7 @@ _02244132: strb r0, [r4, #0x10] pop {r4, r5, r6, r7, pc} _0224415A: - bl sub_02005404 + bl GF_SndGetFadeTimer cmp r0, #0 bne _022441B2 mov r0, #6 @@ -47738,7 +47738,7 @@ _0224469E: bl IsBrightnessTransitionActive cmp r0, #1 bne _02244700 - bl sub_02005404 + bl GF_SndGetFadeTimer cmp r0, #0 bne _02244700 ldr r0, [r4] diff --git a/arm9/overlays/16/asm/overlay_16.s b/arm9/overlays/16/asm/overlay_16.s index 980d67130..1d5c7315a 100644 --- a/arm9/overlays/16/asm/overlay_16.s +++ b/arm9/overlays/16/asm/overlay_16.s @@ -41019,7 +41019,7 @@ _021EA42E: _021EA438: cmp r0, #1 bne _021EA458 - bl sub_02005404 + bl GF_SndGetFadeTimer cmp r0, #0 bne _021EA458 mov r0, #1 diff --git a/arm9/overlays/17/asm/overlay_17.s b/arm9/overlays/17/asm/overlay_17.s index 61bfe3cae..b90cfe8e9 100644 --- a/arm9/overlays/17/asm/overlay_17.s +++ b/arm9/overlays/17/asm/overlay_17.s @@ -2735,7 +2735,7 @@ _021D89E2: str r0, [r4] b _021D8C64 _021D89F2: - bl sub_02005404 + bl GF_SndGetFadeTimer cmp r0, #0 beq _021D89FC _021D89FA: diff --git a/arm9/overlays/63/asm/ov63_021D74E0.s b/arm9/overlays/63/asm/ov63_021D74E0.s index c1f04785d..f1b39ffc0 100644 --- a/arm9/overlays/63/asm/ov63_021D74E0.s +++ b/arm9/overlays/63/asm/ov63_021D74E0.s @@ -268,7 +268,7 @@ _021D76FA: ldr r2, [r4] add r0, #0xb4 bl ov63_021D8260 - bl sub_02005404 + bl GF_SndGetFadeTimer cmp r0, #0 bne _021D779C ldr r0, _021D77A8 ; =0x00000495 @@ -298,7 +298,7 @@ _021D773C: ldr r2, [r4] add r0, #0xb4 bl ov63_021D8260 - bl sub_02005404 + bl GF_SndGetFadeTimer cmp r0, #0 bne _021D779C ldr r0, _021D77A8 ; =0x00000495 diff --git a/arm9/overlays/69/asm/overlay_69.s b/arm9/overlays/69/asm/overlay_69.s index 7e71301ed..6cdc55965 100644 --- a/arm9/overlays/69/asm/overlay_69.s +++ b/arm9/overlays/69/asm/overlay_69.s @@ -338,7 +338,7 @@ _0222D8A6: bl IsPaletteFadeFinished cmp r0, #0 beq _0222D8BC - bl sub_02005404 + bl GF_SndGetFadeTimer cmp r0, #0 bne _0222D8BC add sp, #0xc diff --git a/arm9/src/blackout_src.c b/arm9/src/blackout.c similarity index 61% rename from arm9/src/blackout_src.c rename to arm9/src/blackout.c index 2bfecc0ca..2b13232a8 100644 --- a/arm9/src/blackout_src.c +++ b/arm9/src/blackout.c @@ -1,5 +1,6 @@ #include "blackout.h" #include "bg_window.h" +#include "brightness.h" #include "constants/maps.h" #include "constants/rgb.h" #include "msgdata/msg.naix" @@ -8,17 +9,30 @@ #include "gf_gfx_loader.h" #include "PAD_pad.h" #include "render_window.h" +#include "save_local_field_data.h" +#include "script.h" //TODO: temp include, remove when structs are split #include "text.h" +#include "unk_020051F4.h" +#include "unk_0204AF24.h" static void Blackout_InitDisplays(BgConfig *bgConfig); -/*static*/ void Blackout_DrawMessage(FieldSystem *fieldSystem, TaskManager *taskManager); +static void Blackout_DrawMessage(FieldSystem *fieldSystem, TaskManager *taskManager); static BOOL Task_ShowPrintedBlackoutMessage(TaskManager *taskManager); static void Blackout_PrintMessage(BlackoutScreenEnvironment *environment, s32 msgNo, u8 x, u8 y); extern void BeginNormalPaletteFade(u32 pattern, u32 typeTop, u32 typeBottom, u16 colour, u32 duration, u32 framesPer, HeapID heapId); extern BOOL IsPaletteFadeFinished(void); - extern SaveData *FieldSystem_GetSaveData(FieldSystem *fieldSystem); +extern LocalFieldData *Save_LocalFieldData_Get(SaveData *save); +extern u16 LocalFieldData_GetBlackoutSpawn(LocalFieldData *localFieldData); +extern void GetDeathWarpData(u16 spawnId, Location *dest); +extern void GetSpecialSpawnWarpData(u16 spawnId, Location *dest); +extern Location *LocalFieldData_GetSpecialSpawnWarpPtr(LocalFieldData *localFieldData); +extern void sub_02049160(TaskManager *taskManager, Location *location); +extern void FieldSystem_ClearFollowingTrainer(FieldSystem *fieldSystem); +extern void QueueScript(TaskManager *taskManager, u16 script, LocalMapObject *lastInteracted, void *param3); +extern void sub_0204AB0C(void); +extern u16 GetMomSpawnId(void); static const struct GraphicsBanks Blackout_GraphicsBanks = { .bg = GX_VRAM_BG_128_B, @@ -73,7 +87,7 @@ static void Blackout_InitDisplays(BgConfig *bgConfig) { GfGfxLoader_GXLoadPal(NARC_GRAPHIC_FONT, NARC_font_narc_0006_NCLR, GF_PAL_LOCATION_MAIN_BG, GF_PAL_SLOT_13_OFFSET, 0x20, HEAP_ID_FIELD); } -/*static*/ void Blackout_DrawMessage(FieldSystem *fieldSystem, TaskManager *taskManager) { +static void Blackout_DrawMessage(FieldSystem *fieldSystem, TaskManager *taskManager) { BlackoutScreenEnvironment *env = AllocFromHeap(HEAP_ID_FIELD, sizeof(BlackoutScreenEnvironment)); GF_ASSERT(env != NULL); @@ -156,3 +170,60 @@ static void Blackout_PrintMessage(BlackoutScreenEnvironment *environment, s32 ms String_Delete(tmpStr); String_Delete(finStr); } + +BOOL Task_BlackOut(TaskManager *taskManager) { + FieldSystem *fieldSystem = TaskManager_GetFieldSystem(taskManager); + u32 *state = TaskManager_GetStatePtr(taskManager); + LocalFieldData *localFieldData; + Location deathWarp; + u16 deathSpawn; + + switch (*state) { + case 0: + localFieldData = Save_LocalFieldData_Get(fieldSystem->saveData); + deathSpawn = LocalFieldData_GetBlackoutSpawn(localFieldData); + GetDeathWarpData(deathSpawn, &deathWarp); + GetSpecialSpawnWarpData(deathSpawn, LocalFieldData_GetSpecialSpawnWarpPtr(localFieldData)); + sub_02049160(taskManager, &deathWarp); + FieldSystem_ClearFollowingTrainer(fieldSystem); + (*state)++; + break; + case 1: + GF_SndStartFadeOutBGM(0, 20); + (*state)++; + break; + case 2: + if (GF_SndGetFadeTimer() == 0) { + sub_0204AB0C(); + (*state)++; + } + break; + case 3: + SetBlendBrightness(-16, (GXBlendPlaneMask)(GX_BLEND_PLANEMASK_BD | GX_BLEND_PLANEMASK_OBJ | GX_BLEND_PLANEMASK_BG2 | GX_BLEND_PLANEMASK_BG1 | GX_BLEND_PLANEMASK_BG0), SCREEN_MASK_MAIN); + SetBlendBrightness(-16, (GXBlendPlaneMask)(GX_BLEND_PLANEMASK_BD | GX_BLEND_PLANEMASK_OBJ | GX_BLEND_PLANEMASK_BG3 | GX_BLEND_PLANEMASK_BG2 | GX_BLEND_PLANEMASK_BG1 | GX_BLEND_PLANEMASK_BG0), SCREEN_MASK_SUB); + Blackout_DrawMessage(fieldSystem, taskManager); + (*state)++; + break; + case 4: + CallTask_RestoreOverworld(taskManager); + (*state)++; + break; + case 5: + SetBlendBrightness(0, (GXBlendPlaneMask)(GX_BLEND_PLANEMASK_BD | GX_BLEND_PLANEMASK_OBJ | GX_BLEND_PLANEMASK_BG3 | GX_BLEND_PLANEMASK_BG2 | GX_BLEND_PLANEMASK_BG1 | GX_BLEND_PLANEMASK_BG0), SCREEN_MASK_MAIN | SCREEN_MASK_SUB); + if (GetMomSpawnId() == LocalFieldData_GetBlackoutSpawn(Save_LocalFieldData_Get(fieldSystem->saveData))) { + QueueScript(taskManager, 0x7E4, NULL, NULL); + } else { + QueueScript(taskManager, 0x7E5, NULL, NULL); + } + (*state)++; + break; + case 6: + return TRUE; + } + + return FALSE; +} + +void CallTask_BlackOut(TaskManager *taskManager) { + TaskManager_Call(taskManager, Task_BlackOut, NULL); +} diff --git a/arm9/src/encounter.c b/arm9/src/encounter.c index 30240e5a1..08ed1451f 100644 --- a/arm9/src/encounter.c +++ b/arm9/src/encounter.c @@ -1,5 +1,6 @@ #include "global.h" #include "encounter.h" +#include "blackout.h" #include "constants/battle.h" #include "constants/game_stats.h" #include "save_vars_flags.h" @@ -27,7 +28,6 @@ extern void sub_02047FA4(BattleSetup *setup, FieldSystem *fieldSystem); extern BattleSetup *ov06_02244558(u32 param0, FieldSystem *fieldSystem); extern s32 sub_020475A0(BattleSetup *battleSetup); extern s32 sub_020475B0(BattleSetup *battleSetup); -extern BOOL Task_BlackOut(TaskManager *taskManager); extern void sub_0205DD40(u32 param0); extern u32 sub_0205E128(u32 param0); extern void sub_0205DED4(FieldSystem *fieldSystem, u32 winFlag, u32 param2); diff --git a/arm9/src/scrcmd.c b/arm9/src/scrcmd.c index 7c1fd9d39..607f7b603 100644 --- a/arm9/src/scrcmd.c +++ b/arm9/src/scrcmd.c @@ -3,6 +3,7 @@ #include "PAD_pad.h" #include "bag.h" #include "bg_window.h" +#include "blackout.h" #include "camera.h" #include "constants/global_fieldmap.h" #include "constants/items.h" @@ -249,7 +250,6 @@ extern u16 sub_02053678(u32 trainerId, PlayerGender playerGender, u32 param2); extern u16 sub_020536D0(PlayerGender playerGender, u16 param1, u16 param2); extern void sub_02049EA4(TaskManager *taskManager); extern void LocalFieldData_SetBlackoutSpawn(LocalFieldData *localFieldData, u16 spawnPoint); -extern void CallTask_BlackOut(TaskManager *taskManager); extern void HealParty(Party *playerParty); extern void sub_02050024(void); extern u32 sub_02031810(void); diff --git a/arm9/src/scrcmd_sound.c b/arm9/src/scrcmd_sound.c index d14e80b09..7d90d2dd5 100644 --- a/arm9/src/scrcmd_sound.c +++ b/arm9/src/scrcmd_sound.c @@ -65,7 +65,7 @@ BOOL sub_02041464(struct ScriptContext* ctx) { #pragma unused(ctx) - if(sub_02005404() == 0) + if(GF_SndGetFadeTimer() == 0) return TRUE; else return FALSE; diff --git a/arm9/src/sound.c b/arm9/src/sound.c index c0d410df0..d1dfd2476 100644 --- a/arm9/src/sound.c +++ b/arm9/src/sound.c @@ -3,6 +3,7 @@ #include "SPI_mic.h" #include "SPI_pm.h" #include "unk_020040F4.h" +#include "unk_020051F4.h" #include "sound_chatot.h" static struct SoundData sSoundDataBuffer; @@ -17,10 +18,6 @@ void sub_02004088(struct SoundData *); void sub_020040A4(struct SoundData *); void sub_020040DC(void); -extern void sub_0200521C(int); -extern void sub_0200538C(int, int, int); -extern BOOL sub_02005404(void); - void InitSoundData(struct SaveChatotSoundClip * chatot, struct Options * options) { struct SoundData * sdat = GetSoundDataPointer(); @@ -59,26 +56,26 @@ void sub_02003C40(void) sub_02003CE8(2); break; case 3: - if (!sub_02005404()) + if (GF_SndGetFadeTimer() == 0) sub_02003CE8(2); break; case 4: - if (!sub_02005404()) + if (GF_SndGetFadeTimer() == 0) sub_02003CE8(2); break; case 5: - if (!sub_02005404() && !sub_02004D94()) + if (GF_SndGetFadeTimer() == 0 && !sub_02004D94()) { sub_020040DC(); sub_0200521C(sdat->unk_BCD0E); } break; case 6: - if (!sub_02005404() && !sub_02004D94()) + if (GF_SndGetFadeTimer() == 0 && !sub_02004D94()) { sub_020040DC(); sub_0200521C(sdat->unk_BCD0E); - sub_0200538C(0x7F, (int)sdat->unk_BCD08, 0); + sub_0200538C(0x7F, sdat->unk_BCD08, 0); } break; } diff --git a/arm9/src/unk_020040F4.c b/arm9/src/unk_020040F4.c index e64a0e6f5..ae879f1d8 100644 --- a/arm9/src/unk_020040F4.c +++ b/arm9/src/unk_020040F4.c @@ -1341,7 +1341,7 @@ void sub_0200516C(u32 param0) void sub_020051AC(void) { - if (sub_02005404() == 0 && GF_SndPlayerGetSeqNo(GetSoundPlayer(0)) != -1 && + if (GF_SndGetFadeTimer() == 0 && GF_SndPlayerGetSeqNo(GetSoundPlayer(0)) != -1 && sub_02004124() != 0x47e) { diff --git a/arm9/src/unk_020051F4.c b/arm9/src/unk_020051F4.c index 9b9560ce1..58e2ebd92 100644 --- a/arm9/src/unk_020051F4.c +++ b/arm9/src/unk_020051F4.c @@ -124,7 +124,7 @@ void sub_02005374() sub_02003CE8(0); } -void sub_0200538C(s32 param0, u16 param1, u32 param2) +void sub_0200538C(s32 param0, u32 param1, u32 param2) { u8 r0 = sub_020048D0(sub_02004124()); if (r0 == 0xff) @@ -151,7 +151,7 @@ void GF_SndStartFadeOutBGM(u16 param0, u16 param1) return; } - if (!sub_02005404()) + if (GF_SndGetFadeTimer() == 0) { GF_SndPlayerMoveVolume(sub_02004018(r6), param0, param1); sub_02004D74(param1); @@ -160,7 +160,7 @@ void GF_SndStartFadeOutBGM(u16 param0, u16 param1) sub_02003CE8(4); } -u16 sub_02005404() +u16 GF_SndGetFadeTimer() { return *(u16 *)sub_02003D38(6); } diff --git a/arm9/src/unk_0204AF24.c b/arm9/src/unk_0204AF24.c index 53e4eef44..79dd85d73 100644 --- a/arm9/src/unk_0204AF24.c +++ b/arm9/src/unk_0204AF24.c @@ -38,7 +38,7 @@ BOOL sub_0204AF6C(struct TaskManager *taskManager) return FALSE; } -void CallTask_RestoreOverworld(struct TaskManager *taskManager) //TODO: RestoreOverworld +void CallTask_RestoreOverworld(struct TaskManager *taskManager) { struct FieldSystem *fieldSystem = TaskManager_GetFieldSystem(taskManager); if(sub_0203739C(fieldSystem)) diff --git a/include/blackout.h b/include/blackout.h index 5a606a957..826e5e1ca 100644 --- a/include/blackout.h +++ b/include/blackout.h @@ -16,5 +16,7 @@ typedef struct BlackoutScreenEnvironment { MessageFormat *msgFmt; } BlackoutScreenEnvironment; +BOOL Task_BlackOut(TaskManager *taskManager); +void CallTask_BlackOut(TaskManager *taskManager); #endif //POKEDIAMOND_BLACKOUT_H diff --git a/include/save_local_field_data.h b/include/save_local_field_data.h new file mode 100644 index 000000000..2199962e3 --- /dev/null +++ b/include/save_local_field_data.h @@ -0,0 +1,8 @@ +#ifndef POKEDIAMOND_SAVE_LOCAL_FIELD_DATA_H +#define POKEDIAMOND_SAVE_LOCAL_FIELD_DATA_H + +typedef struct LocalFieldData { + +} LocalFieldData; //TODO: populate + +#endif //POKEDIAMOND_SAVE_LOCAL_FIELD_DATA_H diff --git a/include/script.h b/include/script.h index af797cda9..b1a644376 100644 --- a/include/script.h +++ b/include/script.h @@ -6,6 +6,7 @@ #include "camera.h" #include "fashion_case.h" #include "field_player_avatar.h" +#include "save_local_field_data.h" #include "msgdata.h" #include "render_window.h" #include "save.h" @@ -67,10 +68,6 @@ typedef struct ScrCmdUnkStruct00F4 { void *unk2C; } ScrCmdUnkStruct00F4; //todo identify and move to own file -typedef struct LocalFieldData { - -} LocalFieldData; //todo fill out and move to own file - typedef struct RoamerSaveData { } RoamerSaveData; //todo: fill out and move to own file diff --git a/include/unk_020051F4.h b/include/unk_020051F4.h index d621979bf..36dfd8ebe 100644 --- a/include/unk_020051F4.h +++ b/include/unk_020051F4.h @@ -12,9 +12,9 @@ u32 sub_020052B8(u16 param0, u32 param1, int playerNo); u32 sub_02005308(u32 param0, u16 param1); void sub_02005350(u16 param0, u32 param1); void sub_02005374(); -void sub_0200538C(s32 param0, u16 param1, u32 param2); +void sub_0200538C(s32 param0, u32 param1, u32 param2); void GF_SndStartFadeOutBGM(u16 param0, u16 param1); -u16 sub_02005404(); +u16 GF_SndGetFadeTimer(); u16 sub_02005410(u16 param0); void sub_0200541C(); void sub_02005454(); From a767ee6aa0e0123169a6841ab30ca5dc836d9494 Mon Sep 17 00:00:00 2001 From: red031000 Date: Sat, 16 Dec 2023 15:19:29 +0000 Subject: [PATCH 8/9] copy some review changes from hg --- arm9/asm/scrcmd_7.s | 2 +- arm9/asm/unk_02038C78.s | 2 +- arm9/global.inc | 6 +++--- arm9/src/blackout.c | 26 +++++++++++++------------- arm9/src/encounter.c | 2 +- arm9/src/scrcmd.c | 4 ++-- include/blackout.h | 4 ++-- include/scrcmd.h | 2 +- 8 files changed, 24 insertions(+), 24 deletions(-) diff --git a/arm9/asm/scrcmd_7.s b/arm9/asm/scrcmd_7.s index c2852a62b..652bad947 100644 --- a/arm9/asm/scrcmd_7.s +++ b/arm9/asm/scrcmd_7.s @@ -503,7 +503,7 @@ ScrCmd_Unk00EA: ; 0x02041AB4 ScrCmd_Unk00EB: ; 0x02041AD4 push {r3, lr} ldr r0, [r0, #0x74] - bl CallTask_BlackOut + bl CallTask_Blackout mov r0, #0x1 pop {r3, pc} diff --git a/arm9/asm/unk_02038C78.s b/arm9/asm/unk_02038C78.s index 77bdfe3ad..0810254dc 100644 --- a/arm9/asm/unk_02038C78.s +++ b/arm9/asm/unk_02038C78.s @@ -480,7 +480,7 @@ gScriptCmdTable: ; 0x020F355C .word ScrCmd_SpecialMart .word ScrCmd_GoodsMart .word ScrCmd_SealsMart - .word ScrCmd_DummyBlackOut + .word ScrCmd_DummyBlackout .word ScrCmd_SetSpawn .word ScrCmd_GetPlayerGender .word ScrCmd_HealParty diff --git a/arm9/global.inc b/arm9/global.inc index 7fa4472ce..8877fb44e 100644 --- a/arm9/global.inc +++ b/arm9/global.inc @@ -2949,7 +2949,7 @@ .extern ScrCmd_Unk0155 .extern ScrCmd_Unk029C .extern ScrCmd_SetPlayerAvatar -.extern ScrCmd_DummyBlackOut +.extern ScrCmd_DummyBlackout .extern ScrCmd_SetSpawn .extern ScrCmd_GetPlayerGender .extern ScrCmd_HealParty @@ -3474,8 +3474,8 @@ .extern sub_020480C8 .extern sub_020480D8 .extern sub_020480E4 -.extern Task_BlackOut -.extern CallTask_BlackOut +.extern Task_Blackout +.extern CallTask_Blackout .extern CallTask_GameClear .extern sub_020489DC .extern sub_020489FC diff --git a/arm9/src/blackout.c b/arm9/src/blackout.c index 2b13232a8..41dcdc2a9 100644 --- a/arm9/src/blackout.c +++ b/arm9/src/blackout.c @@ -34,7 +34,7 @@ extern void QueueScript(TaskManager *taskManager, u16 script, LocalMapObject *la extern void sub_0204AB0C(void); extern u16 GetMomSpawnId(void); -static const struct GraphicsBanks Blackout_GraphicsBanks = { +static const struct GraphicsBanks sBlackoutGraphicsBanks = { .bg = GX_VRAM_BG_128_B, .bgextpltt = GX_VRAM_BGEXTPLTT_NONE, .subbg = GX_VRAM_SUB_BG_128_C, @@ -47,14 +47,14 @@ static const struct GraphicsBanks Blackout_GraphicsBanks = { .texpltt = GX_VRAM_TEXPLTT_01_FG, }; -static const struct GraphicsModes Blackout_GraphicsModes = { +static const struct GraphicsModes sBlackoutGraphicsModes = { .dispMode = GX_DISPMODE_GRAPHICS, .bgMode = GX_BGMODE_0, .subMode = GX_BGMODE_0, ._2d3dMode = GX_BG0_AS_2D, }; -static const BgTemplate Blackout_BgTemplate = { +static const BgTemplate sBlackoutBgTemplate = { .x = 0, .y = 0, .bufferSize = 0x800, @@ -70,7 +70,7 @@ static const BgTemplate Blackout_BgTemplate = { .mosaic = FALSE }; -static const WindowTemplate Blackout_WindowTemplate = { +static const WindowTemplate sBlackoutWindowTemplate = { .bgId = GF_BG_LYR_MAIN_3, .left = 4, .top = 5, @@ -81,9 +81,9 @@ static const WindowTemplate Blackout_WindowTemplate = { }; static void Blackout_InitDisplays(BgConfig *bgConfig) { - GfGfx_SetBanks(&Blackout_GraphicsBanks); - SetBothScreensModesAndDisable(&Blackout_GraphicsModes); - InitBgFromTemplate(bgConfig, GF_BG_LYR_MAIN_3, &Blackout_BgTemplate, GF_BG_TYPE_TEXT); + GfGfx_SetBanks(&sBlackoutGraphicsBanks); + SetBothScreensModesAndDisable(&sBlackoutGraphicsModes); + InitBgFromTemplate(bgConfig, GF_BG_LYR_MAIN_3, &sBlackoutBgTemplate, GF_BG_TYPE_TEXT); GfGfxLoader_GXLoadPal(NARC_GRAPHIC_FONT, NARC_font_narc_0006_NCLR, GF_PAL_LOCATION_MAIN_BG, GF_PAL_SLOT_13_OFFSET, 0x20, HEAP_ID_FIELD); } @@ -100,14 +100,14 @@ static void Blackout_DrawMessage(FieldSystem *fieldSystem, TaskManager *taskMana env->msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0328_bin, HEAP_ID_FIELD); env->msgFmt = MessageFormat_New(HEAP_ID_FIELD); - AddWindow(env->bgConfig, &env->window, &Blackout_WindowTemplate); + AddWindow(env->bgConfig, &env->window, &sBlackoutWindowTemplate); BufferPlayersName(env->msgFmt, 0, Save_PlayerData_GetProfileAddr(FieldSystem_GetSaveData(fieldSystem))); if (fieldSystem->location->mapId == MAP_T01R0201) { - // {STRVAR_1 3, 0} scurried back\nhome, protecting the exhausted\nand fainted Pokémon from further\nharm... + // {STRVAR_1 3, 0} scurried back home, protecting the exhausted and fainted Pokémon from further harm... Blackout_PrintMessage(env, narc_0328_00004, 0, 0); } else { - // {STRVAR_1 3, 0} scurried to\na Pokémon Center, protecting\nthe exhausted and fainted\nPokémon from further harm... + // {STRVAR_1 3, 0} scurried to a Pokémon Center, protecting the exhausted and fainted Pokémon from further harm... Blackout_PrintMessage(env, narc_0328_00003, 0, 0); } CopyWindowToVram(&env->window); @@ -171,7 +171,7 @@ static void Blackout_PrintMessage(BlackoutScreenEnvironment *environment, s32 ms String_Delete(finStr); } -BOOL Task_BlackOut(TaskManager *taskManager) { +BOOL Task_Blackout(TaskManager *taskManager) { FieldSystem *fieldSystem = TaskManager_GetFieldSystem(taskManager); u32 *state = TaskManager_GetStatePtr(taskManager); LocalFieldData *localFieldData; @@ -224,6 +224,6 @@ BOOL Task_BlackOut(TaskManager *taskManager) { return FALSE; } -void CallTask_BlackOut(TaskManager *taskManager) { - TaskManager_Call(taskManager, Task_BlackOut, NULL); +void CallTask_Blackout(TaskManager *taskManager) { + TaskManager_Call(taskManager, Task_Blackout, NULL); } diff --git a/arm9/src/encounter.c b/arm9/src/encounter.c index 08ed1451f..ea95caeb4 100644 --- a/arm9/src/encounter.c +++ b/arm9/src/encounter.c @@ -379,7 +379,7 @@ static BOOL Task_WildEncounter(TaskManager *taskManager) { if (IsBattleResultWin(encounter->setup->winFlag) == FALSE) { WildEncounter_Delete(encounter); sub_0205DD40(fieldSystem->unk90); - TaskManager_Jump(taskManager, Task_BlackOut, NULL); + TaskManager_Jump(taskManager, Task_Blackout, NULL); return FALSE; } diff --git a/arm9/src/scrcmd.c b/arm9/src/scrcmd.c index 607f7b603..2f0f0fe4b 100644 --- a/arm9/src/scrcmd.c +++ b/arm9/src/scrcmd.c @@ -3247,8 +3247,8 @@ BOOL ScrCmd_SetPlayerAvatar(ScriptContext *ctx) { //0156 return FALSE; } -BOOL ScrCmd_DummyBlackOut(ScriptContext *ctx) { //014B - CallTask_BlackOut(ctx->taskManager); +BOOL ScrCmd_DummyBlackout(ScriptContext *ctx) { //014B + CallTask_Blackout(ctx->taskManager); return TRUE; } diff --git a/include/blackout.h b/include/blackout.h index 826e5e1ca..2c04e86f3 100644 --- a/include/blackout.h +++ b/include/blackout.h @@ -16,7 +16,7 @@ typedef struct BlackoutScreenEnvironment { MessageFormat *msgFmt; } BlackoutScreenEnvironment; -BOOL Task_BlackOut(TaskManager *taskManager); -void CallTask_BlackOut(TaskManager *taskManager); +BOOL Task_Blackout(TaskManager *taskManager); +void CallTask_Blackout(TaskManager *taskManager); #endif //POKEDIAMOND_BLACKOUT_H diff --git a/include/scrcmd.h b/include/scrcmd.h index b22bb20ad..f7123327c 100644 --- a/include/scrcmd.h +++ b/include/scrcmd.h @@ -285,7 +285,7 @@ BOOL ScrCmd_Unk0154(ScriptContext *ctx); BOOL ScrCmd_Unk0155(ScriptContext *ctx); BOOL ScrCmd_Unk029C(ScriptContext *ctx); BOOL ScrCmd_SetPlayerAvatar(ScriptContext *ctx); -BOOL ScrCmd_DummyBlackOut(ScriptContext *ctx); +BOOL ScrCmd_DummyBlackout(ScriptContext *ctx); BOOL ScrCmd_SetSpawn(ScriptContext *ctx); BOOL ScrCmd_GetPlayerGender(ScriptContext *ctx); BOOL ScrCmd_HealParty(ScriptContext *ctx); From 3e12acd6afc1a285f403f23b90d3f6d0d52af604 Mon Sep 17 00:00:00 2001 From: red031000 Date: Sun, 17 Dec 2023 04:02:17 +0000 Subject: [PATCH 9/9] use state enums --- arm9/src/blackout.c | 42 ++++++++++++++++++++++++++++++------------ 1 file changed, 30 insertions(+), 12 deletions(-) diff --git a/arm9/src/blackout.c b/arm9/src/blackout.c index 41dcdc2a9..a2e09402e 100644 --- a/arm9/src/blackout.c +++ b/arm9/src/blackout.c @@ -114,31 +114,39 @@ static void Blackout_DrawMessage(FieldSystem *fieldSystem, TaskManager *taskMana TaskManager_Call(taskManager, Task_ShowPrintedBlackoutMessage, env); } +enum { + STATE_SHOW_PRINTED_BLACKOUT_FADE_IN, + STATE_SHOW_PRINTED_BLACKOUT_FADE_IN_WAIT, + STATE_SHOW_PRINTED_BLACKOUT_FADE_OUT_INPUT, + STATE_SHOW_PRINTED_BLACKOUT_FADE_OUT_WAIT, + STATE_SHOW_PRINTED_BLACKOUT_CLEANUP, +}; + static BOOL Task_ShowPrintedBlackoutMessage(TaskManager *taskManager) { BlackoutScreenEnvironment *env = TaskManager_GetEnvironment(taskManager); switch (env->state) { - case 0: + case STATE_SHOW_PRINTED_BLACKOUT_FADE_IN: BeginNormalPaletteFade(3, 1, 42, RGB_BLACK, 8, 1, HEAP_ID_32); env->state++; break; - case 1: + case STATE_SHOW_PRINTED_BLACKOUT_FADE_IN_WAIT: if (IsPaletteFadeFinished()) { env->state++; } break; - case 2: + case STATE_SHOW_PRINTED_BLACKOUT_FADE_OUT_INPUT: if (gSystem.newKeys & PAD_BUTTON_A || gSystem.newKeys & PAD_BUTTON_B) { BeginNormalPaletteFade(0, 0, 0, RGB_BLACK, 8, 1, HEAP_ID_32); env->state++; } break; - case 3: + case STATE_SHOW_PRINTED_BLACKOUT_FADE_OUT_WAIT: if (IsPaletteFadeFinished()) { FillWindowPixelBuffer(&env->window, 0); env->state++; } break; - case 4: + case STATE_SHOW_PRINTED_BLACKOUT_CLEANUP: ClearFrameAndWindow2(&env->window, FALSE); RemoveWindow(&env->window); MessageFormat_Delete(env->msgFmt); @@ -171,6 +179,16 @@ static void Blackout_PrintMessage(BlackoutScreenEnvironment *environment, s32 ms String_Delete(finStr); } +enum { + STATE_BLACKOUT_TASK_INIT, + STATE_BLACKOUT_TASK_SOUND_FADE, + STATE_BLACKOUT_TASK_SOUND_FADE_WAIT, + STATE_BLACKOUT_TASK_DRAW, + STATE_BLACKOUT_TASK_RESTORE_OVERWORLD, + STATE_BLACKOUT_TASK_QUEUE_SCRIPT, + STATE_BLACKOUT_TASK_EXIT +}; + BOOL Task_Blackout(TaskManager *taskManager) { FieldSystem *fieldSystem = TaskManager_GetFieldSystem(taskManager); u32 *state = TaskManager_GetStatePtr(taskManager); @@ -179,7 +197,7 @@ BOOL Task_Blackout(TaskManager *taskManager) { u16 deathSpawn; switch (*state) { - case 0: + case STATE_BLACKOUT_TASK_INIT: localFieldData = Save_LocalFieldData_Get(fieldSystem->saveData); deathSpawn = LocalFieldData_GetBlackoutSpawn(localFieldData); GetDeathWarpData(deathSpawn, &deathWarp); @@ -188,27 +206,27 @@ BOOL Task_Blackout(TaskManager *taskManager) { FieldSystem_ClearFollowingTrainer(fieldSystem); (*state)++; break; - case 1: + case STATE_BLACKOUT_TASK_SOUND_FADE: GF_SndStartFadeOutBGM(0, 20); (*state)++; break; - case 2: + case STATE_BLACKOUT_TASK_SOUND_FADE_WAIT: if (GF_SndGetFadeTimer() == 0) { sub_0204AB0C(); (*state)++; } break; - case 3: + case STATE_BLACKOUT_TASK_DRAW: SetBlendBrightness(-16, (GXBlendPlaneMask)(GX_BLEND_PLANEMASK_BD | GX_BLEND_PLANEMASK_OBJ | GX_BLEND_PLANEMASK_BG2 | GX_BLEND_PLANEMASK_BG1 | GX_BLEND_PLANEMASK_BG0), SCREEN_MASK_MAIN); SetBlendBrightness(-16, (GXBlendPlaneMask)(GX_BLEND_PLANEMASK_BD | GX_BLEND_PLANEMASK_OBJ | GX_BLEND_PLANEMASK_BG3 | GX_BLEND_PLANEMASK_BG2 | GX_BLEND_PLANEMASK_BG1 | GX_BLEND_PLANEMASK_BG0), SCREEN_MASK_SUB); Blackout_DrawMessage(fieldSystem, taskManager); (*state)++; break; - case 4: + case STATE_BLACKOUT_TASK_RESTORE_OVERWORLD: CallTask_RestoreOverworld(taskManager); (*state)++; break; - case 5: + case STATE_BLACKOUT_TASK_QUEUE_SCRIPT: SetBlendBrightness(0, (GXBlendPlaneMask)(GX_BLEND_PLANEMASK_BD | GX_BLEND_PLANEMASK_OBJ | GX_BLEND_PLANEMASK_BG3 | GX_BLEND_PLANEMASK_BG2 | GX_BLEND_PLANEMASK_BG1 | GX_BLEND_PLANEMASK_BG0), SCREEN_MASK_MAIN | SCREEN_MASK_SUB); if (GetMomSpawnId() == LocalFieldData_GetBlackoutSpawn(Save_LocalFieldData_Get(fieldSystem->saveData))) { QueueScript(taskManager, 0x7E4, NULL, NULL); @@ -217,7 +235,7 @@ BOOL Task_Blackout(TaskManager *taskManager) { } (*state)++; break; - case 6: + case STATE_BLACKOUT_TASK_EXIT: return TRUE; }