summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/bg_window.h (renamed from include/unk_02016B94.h)177
-rw-r--r--include/gf_gfx_loader.h2
-rw-r--r--include/list_menu_cursor.h2
-rw-r--r--include/script.h2
-rw-r--r--include/script_buffers.h2
-rw-r--r--include/text.h2
-rw-r--r--include/text_02054590.h2
7 files changed, 130 insertions, 59 deletions
diff --git a/include/unk_02016B94.h b/include/bg_window.h
index df9fa25a..91026b4d 100644
--- a/include/unk_02016B94.h
+++ b/include/bg_window.h
@@ -17,7 +17,7 @@ struct BgTemplate
u32 bufferSize;
u32 unk0c;
- u8 unk10;
+ u8 size;
u8 colorMode;
u8 screenBase;
u8 charBase;
@@ -32,7 +32,7 @@ struct Bg
{
void *tilemapBuffer;
u32 bufferSize;
- u32 unk10;
+ u32 baseTile;
fx32 hOffset;
fx32 vOffset;
@@ -89,41 +89,112 @@ struct Window
void *pixelBuffer;
};
-struct BgConfig *FUN_02016B94(u32 heap_id);
-u32 FUN_02016BB8(u32 *param0);
-void FUN_02016BBC(const struct GraphicsModes *modes);
-void FUN_02016BF4(const struct GraphicsModes *param0, u32 param1);
-void FUN_02016C18(
- struct BgConfig *param0, u8 param1, const struct BgTemplate *template, u8 bgMode);
-void FUN_020170F4(struct BgConfig *config, u8 bgId, u32 attr, u8 value);
-u8 FUN_020177DC(u8 param0, u32 param1);
+enum GFBgLayer
+{
+ GF_BG_LYR_MAIN_0 = 0,
+ GF_BG_LYR_MAIN_1,
+ GF_BG_LYR_MAIN_2,
+ GF_BG_LYR_MAIN_3,
+ GF_BG_LYR_SUB_0,
+ GF_BG_LYR_SUB_1,
+ GF_BG_LYR_SUB_2,
+ GF_BG_LYR_SUB_3,
+ GF_BG_LYR_MAIN_CNT = 4,
+ GF_BG_LYR_SUB_CNT = 4,
+ GF_BG_LYR_MAIN_FIRST = GF_BG_LYR_MAIN_0,
+ GF_BG_LYR_SUB_FIRST = GF_BG_LYR_SUB_0,
+
+ GF_BG_LYR_MAIN_0_F = 1 << (GF_BG_LYR_MAIN_0 - GF_BG_LYR_MAIN_FIRST),
+ GF_BG_LYR_MAIN_1_F = 1 << (GF_BG_LYR_MAIN_1 - GF_BG_LYR_MAIN_FIRST),
+ GF_BG_LYR_MAIN_2_F = 1 << (GF_BG_LYR_MAIN_2 - GF_BG_LYR_MAIN_FIRST),
+ GF_BG_LYR_MAIN_3_F = 1 << (GF_BG_LYR_MAIN_3 - GF_BG_LYR_MAIN_FIRST),
+ GF_BG_LYR_SUB_0_F = 1 << (GF_BG_LYR_SUB_0 - GF_BG_LYR_SUB_FIRST),
+ GF_BG_LYR_SUB_1_F = 1 << (GF_BG_LYR_SUB_1 - GF_BG_LYR_SUB_FIRST),
+ GF_BG_LYR_SUB_2_F = 1 << (GF_BG_LYR_SUB_2 - GF_BG_LYR_SUB_FIRST),
+ GF_BG_LYR_SUB_3_F = 1 << (GF_BG_LYR_SUB_3 - GF_BG_LYR_SUB_FIRST),
+};
+
+enum GFBgType
+{
+ GF_BG_TYPE_TEXT = 0,
+ GF_BG_TYPE_AFFINE,
+ GF_BG_TYPE_256x16PLTT,
+};
+
+enum GFBgCntSet
+{
+ GF_BG_CNT_SET_COLOR_MODE = 0,
+ GF_BG_CNT_SET_SCREEN_BASE,
+ GF_BG_CNT_SET_CHAR_BASE,
+};
+
+enum GFBgScreenSize
+{
+ GF_BG_SCR_SIZE_128x128 = 0,
+ GF_BG_SCR_SIZE_256x256,
+ GF_BG_SCR_SIZE_256x512,
+ GF_BG_SCR_SIZE_512x256,
+ GF_BG_SCR_SIZE_512x512,
+ GF_BG_SCR_SIZE_1024x1024
+};
+
+enum BgPosAdjustOp
+{
+ // Text layers
+ BG_POS_OP_SET_X = 0,
+ BG_POS_OP_ADD_X,
+ BG_POS_OP_SUB_X,
+ BG_POS_OP_SET_Y,
+ BG_POS_OP_ADD_Y,
+ BG_POS_OP_SUB_Y,
+
+ // Affine layers
+ BG_POS_OP_SET_ROT = 0,
+ BG_POS_OP_ADD_ROT,
+ BG_POS_OP_SUB_ROT,
+ BG_POS_OP_SET_CENTERX = 9,
+ BG_POS_OP_ADD_CENTERX,
+ BG_POS_OP_SUB_CENTERX,
+ BG_POS_OP_SET_CENTERY,
+ BG_POS_OP_ADD_CENTERY,
+ BG_POS_OP_SUB_CENTERY,
+};
+
+struct BgConfig *BgConfig_Alloc(u32 heap_id);
+u32 BgConfig_GetHeapId(struct BgConfig *bgConfig);
+void SetBothScreensModesAndDisable(const struct GraphicsModes *modes);
+void SetScreenModeAndDisable(const struct GraphicsModes *gfxModes, u32 whichScreen);
+void InitBgFromTemplate(
+ struct BgConfig *bgConfig, u8 bgId, const struct BgTemplate *template, u8 bgMode);
+void SetBgControlParam(struct BgConfig *config, u8 bgId, u32 attr, u8 value);
+u8 TranslateGFBgModePairToGXScreenSize(u8 size, u32 bgMode);
void GetBgScreenDimensions(u32 screenSize, u8 *width_p, u8 *height_p);
-void FUN_020178A0(struct BgConfig *bgConfig, u32 bgId);
-void FUN_020178BC(u32 bgId, u16 priority);
+void FreeBgTilemapBuffer(struct BgConfig *bgConfig, u32 bgId);
+void SetBgPriority(u32 bgId, u16 priority);
void ToggleBgLayer(u32 bgId, GX_LayerToggle toggle);
-void FUN_020179E0(struct BgConfig *bgConfig, u32 bgId, u32 param2, fx32 val);
-fx32 FUN_02017B48(struct BgConfig *param0, u32 param1);
-fx32 FUN_02017B54(struct BgConfig *param0, u32 param1);
-void FUN_02017B60(struct BgConfig *param0,
- u32 param1,
- u32 param2,
- fx32 param3,
- struct Mtx22 *param4,
- fx32 param5,
- fx32 param6);
+void BgSetPosTextAndCommit(struct BgConfig *bgConfig, u32 bgId, u32 op, fx32 val);
+fx32 Bg_GetXpos(struct BgConfig *bgConfig, u32 bgId);
+fx32 Bg_GetYpos(struct BgConfig *bgConfig, u32 bgId);
+void Bg_SetTextDimAndAffineParams(struct BgConfig *bgConfig,
+ u32 bgId,
+ u32 txOp,
+ fx32 txVal,
+ struct Mtx22 *mtx,
+ fx32 centerX,
+ fx32 centerY);
void Bg_SetPosText(struct Bg *bg, u32 op, fx32 val);
-void FUN_02017BD0(struct BgConfig *param0,
- u32 param1,
- struct Mtx22 *param2,
- fx32 param3,
- fx32 param4);
-void FUN_02017C6C(struct BgConfig *param0, u32 param1);
-void FUN_02017C98(const void *param0, void *param1, u32 param2);
-void FUN_02017CD0(struct BgConfig *param0, u32 param1);
-void FUN_02017CE8(
- struct BgConfig *param0, u32 param1, u32 *param2, u32 param3, u32 param4);
+void SetBgAffine(struct BgConfig *bgConfig,
+ u32 bgId,
+ struct Mtx22 *mtx,
+ fx32 centerX,
+ fx32 centerY);
+void BgAffineReset(struct BgConfig *bgConfig, u32 bgId);
+void CopyOrUncompressTilemapData(const void *src, void *dest, u32 size);
+void BgCommitTilemapBufferToVram(struct BgConfig *bgConfig, u32 bgId);
+void BgCopyOrUncompressTilemapBufferRangeToVram(
+ struct BgConfig *bgConfig, u32 bgId, u32 *src, u32 size, u32 tileOffset);
void LoadBgVramScr(u32 bgId, void *buffer_p, u32 offset, u32 size);
-void FUN_02017DFC(struct BgConfig *param0, u32 param1, void *param2, u32 param3);
+void BG_LoadScreenTilemapData(struct BgConfig *bgConfig, u32 bgId, void *src, u32 numTiles);
void BG_LoadCharTilesData(
struct BgConfig *bgConfig, u32 bgId, u32 *charData, u32 offset, u32 numTiles);
void BG_LoadCharPixelData(
@@ -211,14 +282,14 @@ void BgTilemapRectChangePalette(struct BgConfig *bgConfig,
u8 width,
u8 height,
u8 paletteNum);
-void FUN_02018744(struct BgConfig *param0, u32 param1);
-void FUN_02018768(struct BgConfig *param0, u32 param1, u16 param2);
-void FUN_0201878C(struct BgConfig *param0, u32 param1, u16 param2);
-void *FUN_020187B0(u32 param0);
-void FUN_02018808(u8 *param0, u32 param1, u8 (*param2)[2], u8 param3);
-u8 (*FUN_02018848(u8 *param0, u32 param1, u8 param2, u32 heap_id))[2];
+void BgClearTilemapBufferAndCommit(struct BgConfig *bgConfig, u32 bgId);
+void BgFillTilemapBufferAndCommit(struct BgConfig *bgConfig, u32 bgId, u16 fillValue);
+void BgFillTilemapBufferAndSchedule(struct BgConfig *bgConfig, u32 bgId, u16 fillValue);
+void *BgGetCharPtr(u32 bgId);
+void Convert4bppTo8bppInternal(u8 *src4bpp, u32 size, u8 (*dest8bpp), u8 paletteNum);
+u8 *Convert4bppTo8bpp(u8 *src4Bpp, u32 size, u8 paletteNum, u32 heap_id);
void *GetBgTilemapBuffer(struct BgConfig *bgConfig, u8 bgId);
-u16 FUN_02018878(struct BgConfig *param0, u32 param1);
+u16 GetBgAffineRotation(struct BgConfig *bgConfig, u32 bgId);
u8 GetBgPriority(struct BgConfig *bgConfig, u32 bgId);
void BlitBitmapRect4Bit(const struct Bitmap *src,
const struct Bitmap *dst,
@@ -266,25 +337,25 @@ void AddWindow(struct BgConfig *bgConfig,
void RemoveWindow(struct Window *window);
void WindowArray_dtor(struct Window *windows, int count);
void CopyWindowToVram(struct Window *window);
-void FUN_02019220(struct Window *window);
+void ScheduleWindowCopyToVram(struct Window *window);
void PutWindowTilemap(struct Window *window);
void PutWindowTilemapRectAnchoredTopLeft(struct Window *window, u8 width, u8 height);
-void FUN_020192B8(struct Window *window);
+void ClearWindowTilemap(struct Window *window);
void PutWindowTilemap_TextMode(struct Window *param0);
void PutWindowTilemap_AffineMode(struct Window *window);
void ClearWindowTilemapText(struct Window *window);
void ClearWindowTilemapAffine(struct Window *window);
void CopyWindowToVram_TextMode(struct Window *window);
-void FUN_020194C8(struct Window *window);
+void ScheduleWindowCopyToVram_TextMode(struct Window *window);
void CopyWindowToVram_AffineMode(struct Window *window);
-void FUN_0201951C(struct Window *window);
-void FUN_02019548(struct Window *window);
-void FUN_02019570(struct Window *window);
-void FUN_0201958C(struct Window *window);
-void FUN_020195A8(struct Window *window);
-void FUN_020195D0(struct Window *window);
-void FUN_020195E4(struct Window *window);
-void FUN_0201960C(struct Window *window);
+void ScheduleWindowCopyToVram_AffineMode(struct Window *window);
+void CopyWindowPixelsToVram_TextMode(struct Window *window);
+void ClearWindowTilemapAndCopyToVram(struct Window *window);
+void ClearWindowTilemapAndScheduleTransfer(struct Window *window);
+void ClearWindowTilemapAndCopyToVram_TextMode(struct Window *window);
+void ClearWindowTilemapAndScheduleTransfer_TextMode(struct Window *window);
+void ClearWindowTilemapAndCopyToVram_AffineMode(struct Window *window);
+void ClearWindowTilemapAndScheduleTransfer_AffineMode(struct Window *window);
void FillWindowPixelBuffer(struct Window *window, u8 param1);
void BlitBitmapRectToWindow(struct Window *window,
const void *src,
@@ -339,7 +410,7 @@ void ScheduleSetBgAffineRotation(struct BgConfig *bgConfig, u32 bgId, u32 op, u1
void Bg_SetAffineRotation(struct Bg *bg, u32 op, u16 val);
void ScheduleSetBgAffinePos(struct BgConfig *bgConfig, u32 bgId, u32 op, fx32 value);
void Bg_SetAffinePos(struct Bg *bg, u32 op, fx32 val);
-u32 FUN_0201AFBC(struct BgConfig *bgConfig, u8 bgId, u8 x, u8 y, u16 *src);
-void FUN_0201B118(struct BgConfig *param0, u8 param1, u8 *param2);
+u32 DoesPixelAtScreenXYMatchPtrVal(struct BgConfig *bgConfig, u8 bgId, u8 x, u8 y, u16 *src);
+void ApplyFlipFlagsToTile(struct BgConfig *bgConfig, u8 flag, u8 *src);
#endif // POKEDIAMOND_UNK_02016B94_H
diff --git a/include/gf_gfx_loader.h b/include/gf_gfx_loader.h
index 3f23d1ff..cb7de269 100644
--- a/include/gf_gfx_loader.h
+++ b/include/gf_gfx_loader.h
@@ -1,7 +1,7 @@
#ifndef POKEDIAMOND_GF_GFX_LOADER_H
#define POKEDIAMOND_GF_GFX_LOADER_H
-#include "unk_02016B94.h"
+#include "bg_window.h"
u32 GfGfxLoader_LoadCharData(NarcId narcId, s32 memberNo, struct BgConfig * unkStruct02016B94_2, u32 a3, u32 a4, u32 szByte, BOOL isCompressed, u32 heap_id);
void GfGfxLoader_LoadScrnData(NarcId narcId, s32 memberNo, struct BgConfig * unkStruct02016B94_2, u32 a3, u32 a4, u32 szByte, BOOL isCompressed, u32 heap_id);
diff --git a/include/list_menu_cursor.h b/include/list_menu_cursor.h
index e4a4b6b9..a2337e9a 100644
--- a/include/list_menu_cursor.h
+++ b/include/list_menu_cursor.h
@@ -1,7 +1,7 @@
#ifndef POKEDIAMOND_LIST_MENU_CURSOR_H
#define POKEDIAMOND_LIST_MENU_CURSOR_H
-#include "unk_02016B94.h"
+#include "bg_window.h"
// TODO: Move to its own header, and fill it out
struct ListMenuCursor
diff --git a/include/script.h b/include/script.h
index 2f5e6540..75b65f90 100644
--- a/include/script.h
+++ b/include/script.h
@@ -4,7 +4,7 @@
#include "global.h"
#include "msgdata.h"
#include "save_block_2.h"
-#include "unk_02016B94.h"
+#include "bg_window.h"
struct ScriptContext;
diff --git a/include/script_buffers.h b/include/script_buffers.h
index 9a742545..b9f0e268 100644
--- a/include/script_buffers.h
+++ b/include/script_buffers.h
@@ -4,7 +4,7 @@
#include "pokemon.h"
#include "pokemon_storage_system.h"
#include "trainer_data.h"
-#include "unk_02016B94.h"
+#include "bg_window.h"
struct UnkStruct_0200AA80_sub_sub
{
diff --git a/include/text.h b/include/text.h
index c9984d75..034447c7 100644
--- a/include/text.h
+++ b/include/text.h
@@ -3,7 +3,7 @@
#include "global.h"
#include "font.h"
-#include "unk_02016B94.h"
+#include "bg_window.h"
#define CHAR_0 0x00A2
diff --git a/include/text_02054590.h b/include/text_02054590.h
index eaffb2a0..b2f4898b 100644
--- a/include/text_02054590.h
+++ b/include/text_02054590.h
@@ -3,7 +3,7 @@
#include "global.h"
#include "options.h"
-#include "unk_02016B94.h"
+#include "bg_window.h"
#include "string16.h"