summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYamaArashi <shadow962@live.com>2016-05-30 11:57:24 -0700
committerYamaArashi <shadow962@live.com>2016-05-30 11:57:24 -0700
commitfebe47474996705f3338da4fe90981d2b321d2ee (patch)
treec40675866fc685804da1cb2ef1a939f08e4f24ae
parent957c53e49567088fd3c8ffc09f82b1e91439988e (diff)
prep for link code
-rw-r--r--asm/rom4.s8
-rw-r--r--include/gba/io_reg.h11
-rw-r--r--include/text.h64
-rw-r--r--src/text.c10
4 files changed, 83 insertions, 10 deletions
diff --git a/asm/rom4.s b/asm/rom4.s
index 6e10f0b48..503ad955e 100644
--- a/asm/rom4.s
+++ b/asm/rom4.s
@@ -4155,8 +4155,8 @@ _08054D20: .4byte 0x04000050
_08054D24: .4byte gUnknown_081E29E0
_08054D28: .4byte 0x04000052
_08054D2C: .4byte 0x0000070d
-_08054D30: .4byte gBGHorizontalOffsetRegs
-_08054D34: .4byte gBGVerticalOffsetRegs
+_08054D30: .4byte gBGHOffsetRegs
+_08054D34: .4byte gBGVOffsetRegs
_08054D38: .4byte gBGControlRegs
_08054D3C: .4byte 0x00001d41
_08054D40: .4byte 0x00001e43
@@ -11124,10 +11124,10 @@ _08057AE0:
pop {r0}
bx r0
.align 2, 0
-_08057AE8: .4byte gBGHorizontalOffsetRegs
+_08057AE8: .4byte gBGHOffsetRegs
_08057AEC: .4byte 0x03000590
_08057AF0: .4byte 0x03000598
-_08057AF4: .4byte gBGVerticalOffsetRegs
+_08057AF4: .4byte gBGVOffsetRegs
_08057AF8: .4byte 0x0300059a
_08057AFC: .4byte 0x040000d4
_08057B00: .4byte 0x020219cc
diff --git a/include/gba/io_reg.h b/include/gba/io_reg.h
index 44d6b932d..87c167ab6 100644
--- a/include/gba/io_reg.h
+++ b/include/gba/io_reg.h
@@ -335,7 +335,7 @@
// I/O registers
-#define REG_DISPCNT (*(vu32 *)REG_ADDR_DISPCNT)
+#define REG_DISPCNT (*(vu16 *)REG_ADDR_DISPCNT)
#define REG_DISPSTAT (*(vu16 *)REG_ADDR_DISPSTAT)
#define REG_VCOUNT (*(vu16 *)REG_ADDR_VCOUNT)
#define REG_BG0CNT (*(vu16 *)REG_ADDR_BG0CNT)
@@ -453,6 +453,15 @@
#define DISPCNT_MODE_5 0x0005
#define DISPCNT_OBJ_1D_MAP 0x0040
#define DISPCNT_FORCED_BLANK 0x0080
+#define DISPCNT_BG0_ON 0x0100
+#define DISPCNT_BG1_ON 0x0200
+#define DISPCNT_BG2_ON 0x0400
+#define DISPCNT_BG3_ON 0x0800
+#define DISPCNT_BG_ALL_ON 0x0F00
+#define DISPCNT_OBJ_ON 0x1000
+#define DISPCNT_WIN0_ON 0x2000
+#define DISPCNT_WIN1_ON 0x4000
+#define DISPCNT_OBJWIN_ON 0x8000
// DISPSTAT
#define DISPSTAT_VBLANK 0x0001 // in V-Blank
diff --git a/include/text.h b/include/text.h
index 4f9bdee5a..43480d9db 100644
--- a/include/text.h
+++ b/include/text.h
@@ -11,6 +11,70 @@
#define PLACEHOLDER_BEGIN 0xFD // string placeholder
#define EOS 0xFF // end of string
+extern vu16 *const gBGControlRegs[];
+extern vu16 *const gBGHOffsetRegs[];
+extern vu16 *const gBGVOffsetRegs[];
+
+extern struct WindowConfig gWindowConfig_81E6C3C;
+extern struct WindowConfig gWindowConfig_81E6C58;
+extern struct WindowConfig gWindowConfig_81E6C74;
+extern struct WindowConfig gWindowConfig_81E6C90;
+extern struct WindowConfig gWindowConfig_81E6CAC;
+extern struct WindowConfig gWindowConfig_81E6CC8;
+extern struct WindowConfig gWindowConfig_81E6CE4;
+extern struct WindowConfig gWindowConfig_81E6D00;
+extern struct WindowConfig gWindowConfig_81E6D1C;
+extern struct WindowConfig gWindowConfig_81E6D38;
+extern struct WindowConfig gWindowConfig_81E6D54;
+extern struct WindowConfig gWindowConfig_81E6D70;
+extern struct WindowConfig gWindowConfig_81E6D8C;
+extern struct WindowConfig gWindowConfig_81E6DA8;
+extern struct WindowConfig gWindowConfig_81E6DC4;
+extern struct WindowConfig gWindowConfig_81E6DE0;
+extern struct WindowConfig gWindowConfig_81E6DFC;
+extern struct WindowConfig gWindowConfig_81E6E18;
+extern struct WindowConfig gWindowConfig_81E6E34;
+extern struct WindowConfig gWindowConfig_81E6E50;
+extern struct WindowConfig gWindowConfig_81E6E6C;
+extern struct WindowConfig gWindowConfig_81E6E88;
+extern struct WindowConfig gWindowConfig_81E6EA4;
+extern struct WindowConfig gWindowConfig_81E6EC0;
+extern struct WindowConfig gWindowConfig_81E6EDC;
+extern struct WindowConfig gWindowConfig_81E6EF8;
+extern struct WindowConfig gWindowConfig_81E6F14;
+extern struct WindowConfig gWindowConfig_81E6F30;
+extern struct WindowConfig gWindowConfig_81E6F4C;
+extern struct WindowConfig gWindowConfig_81E6F68;
+extern struct WindowConfig gWindowConfig_81E6F84;
+extern struct WindowConfig gWindowConfig_81E6FA0;
+extern struct WindowConfig gWindowConfig_81E6FBC;
+extern struct WindowConfig gWindowConfig_81E6FD8;
+extern struct WindowConfig gWindowConfig_81E6FF4;
+extern struct WindowConfig gWindowConfig_81E7010;
+extern struct WindowConfig gWindowConfig_81E702C;
+extern struct WindowConfig gWindowConfig_81E7048;
+extern struct WindowConfig gWindowConfig_81E7064;
+extern struct WindowConfig gWindowConfig_81E7080;
+extern struct WindowConfig gWindowConfig_81E709C;
+extern struct WindowConfig gWindowConfig_81E70B8;
+extern struct WindowConfig gWindowConfig_81E70D4;
+extern struct WindowConfig gWindowConfig_81E70F0;
+extern struct WindowConfig gWindowConfig_81E710C;
+extern struct WindowConfig gWindowConfig_81E7128;
+extern struct WindowConfig gWindowConfig_81E7144;
+extern struct WindowConfig gWindowConfig_81E7160;
+extern struct WindowConfig gWindowConfig_81E717C;
+extern struct WindowConfig gWindowConfig_81E7198;
+extern struct WindowConfig gWindowConfig_81E71B4;
+extern struct WindowConfig gWindowConfig_81E71D0;
+extern struct WindowConfig gWindowConfig_81E71EC;
+extern struct WindowConfig gWindowConfig_81E7208;
+extern struct WindowConfig gWindowConfig_81E7224;
+extern struct WindowConfig gWindowConfig_81E7240;
+extern struct WindowConfig gWindowConfig_81E725C;
+extern struct WindowConfig gWindowConfig_81E7278;
+extern struct WindowConfig gWindowConfig_81E7294;
+
u8 GetExtCtrlCodeLength(u8 code);
#endif // GUARD_TEXT_H
diff --git a/src/text.c b/src/text.c
index 5a0d04c9c..497f50dbb 100644
--- a/src/text.c
+++ b/src/text.c
@@ -255,7 +255,7 @@ extern u16 gUnknown_020239F8;
extern u8 gUnknown_0203869A;
extern u8 gTileBuffer[];
-vu16 * const gBGControlRegs[] =
+vu16 *const gBGControlRegs[] =
{
&REG_BG0CNT,
&REG_BG1CNT,
@@ -263,7 +263,7 @@ vu16 * const gBGControlRegs[] =
&REG_BG3CNT,
};
-vu16 * const gBGHorizontalOffsetRegs[] =
+vu16 *const gBGHOffsetRegs[] =
{
&REG_BG0HOFS,
&REG_BG1HOFS,
@@ -271,7 +271,7 @@ vu16 * const gBGHorizontalOffsetRegs[] =
&REG_BG3HOFS,
};
-vu16 * const gBGVerticalOffsetRegs[] =
+vu16 *const gBGVOffsetRegs[] =
{
&REG_BG0VOFS,
&REG_BG1VOFS,
@@ -1785,8 +1785,8 @@ const struct WindowConfig gWindowConfig_81E7294 =
static void UpdateBGRegs(struct WindowConfig *winConfig)
{
u8 bgNum = winConfig->bgNum;
- *gBGHorizontalOffsetRegs[bgNum] = 0;
- *gBGVerticalOffsetRegs[bgNum] = 0;
+ *gBGHOffsetRegs[bgNum] = 0;
+ *gBGVOffsetRegs[bgNum] = 0;
*gBGControlRegs[bgNum] = winConfig->priority | (winConfig->screenBaseBlock << 8) | (winConfig->charBaseBlock << 2);
}