diff options
Diffstat (limited to 'src/engine')
-rw-r--r-- | src/engine/link.c | 2 | ||||
-rw-r--r-- | src/engine/text.c | 226 | ||||
-rw-r--r-- | src/engine/trade.c | 52 |
3 files changed, 141 insertions, 139 deletions
diff --git a/src/engine/link.c b/src/engine/link.c index 850201ccb..7f7e48083 100644 --- a/src/engine/link.c +++ b/src/engine/link.c @@ -954,7 +954,7 @@ static u16 LinkTestCalcBlockChecksum(void *data, u16 size) static void PrintHexDigit(u8 tileNum, u8 x, u8 y) { - u16 *tilemap = (u16 *)BG_SCREEN_ADDR(gLinkTestBGInfo.screenBaseBlock); + u16 *tilemap = BG_SCREEN_ADDR(gLinkTestBGInfo.screenBaseBlock); tilemap[(32 * y) + x] = (gLinkTestBGInfo.paletteNum << 12) | (tileNum + 1); } diff --git a/src/engine/text.c b/src/engine/text.c index 87903608f..9bb33f3c2 100644 --- a/src/engine/text.c +++ b/src/engine/text.c @@ -396,6 +396,8 @@ extern const u32 gFont4LatinGlyphs[]; extern const u32 gFont3JapaneseGlyphs[]; extern const u32 gFont4JapaneseGlyphs[]; +// Getting rid of the u8 recasting will make the ROM no longer match due to +// a const being required to pass the elements directly to the rodata structs. static const struct Font sFonts[] = { // Japanese fonts @@ -405,15 +407,15 @@ static const struct Font sFonts[] = { 4, (u8 *)gFont3JapaneseGlyphs, 64, 512 }, { 1, (u8 *)gFont4JapaneseGlyphs, 32, 0 }, { 2, (u8 *)gFont4JapaneseGlyphs, 32, 0 }, - { 3, (u8 *)sBrailleGlyphs, 8, 0 }, + { 3, (u8 *)sBrailleGlyphs, 8, 0 }, // Latin - { 0, (u8 *)sFont0LatinGlyphs, 16, 8 }, - { 1, (u8 *)sFont1LatinGlyphs, 8, 0 }, - { 2, (u8 *)sFont1LatinGlyphs, 8, 0 }, - { 0, (u8 *)gFont3LatinGlyphs, 64, 32 }, - { 1, (u8 *)gFont4LatinGlyphs, 32, 0 }, - { 2, (u8 *)gFont4LatinGlyphs, 32, 0 }, - { 3, (u8 *)sBrailleGlyphs, 8, 0 }, + { 0, (u8 *)sFont0LatinGlyphs, 16, 8 }, + { 1, (u8 *)sFont1LatinGlyphs, 8, 0 }, + { 2, (u8 *)sFont1LatinGlyphs, 8, 0 }, + { 0, (u8 *)gFont3LatinGlyphs, 64, 32 }, + { 1, (u8 *)gFont4LatinGlyphs, 32, 0 }, + { 2, (u8 *)gFont4LatinGlyphs, 32, 0 }, + { 3, (u8 *)sBrailleGlyphs, 8, 0 }, }; static const u8 sTextSpeedDelays[] = { 6, 3, 1 }; // slow, mid, fast @@ -492,8 +494,8 @@ const struct WindowConfig gWindowConfig_81E6C3C = 0, // tilemap top coordinate 30, // width 20, // height - (u8 *)BG_CHAR_ADDR(2), // tile data - (u16 *)BG_SCREEN_ADDR(31), // tilemap + BG_CHAR_ADDR(2), // tile data + BG_SCREEN_ADDR(31), // tilemap }; const struct WindowConfig gWindowConfig_81E6C58 = @@ -513,8 +515,8 @@ const struct WindowConfig gWindowConfig_81E6C58 = 0, // tilemap top coordinate 26, // width 20, // height - (u8 *)BG_CHAR_ADDR(0), // tile data - (u16 *)BG_SCREEN_ADDR(24), // tilemap + BG_CHAR_ADDR(0), // tile data + BG_SCREEN_ADDR(24), // tilemap }; const struct WindowConfig gWindowConfig_81E6C74 = @@ -555,8 +557,8 @@ const struct WindowConfig gWindowConfig_81E6C90 = 0, // tilemap top coordinate 30, // width 20, // height - (u8 *)BG_CHAR_ADDR(1), // tile data - (u16 *)BG_SCREEN_ADDR(30), // tilemap + BG_CHAR_ADDR(1), // tile data + BG_SCREEN_ADDR(30), // tilemap }; const struct WindowConfig gWindowConfig_81E6CAC = @@ -597,8 +599,8 @@ const struct WindowConfig gWindowConfig_81E6CC8 = 0, // tilemap top coordinate 30, // width 20, // height - (u8 *)BG_CHAR_ADDR(2), // tile data - (u16 *)BG_SCREEN_ADDR(15), // tilemap + BG_CHAR_ADDR(2), // tile data + BG_SCREEN_ADDR(15), // tilemap }; const struct WindowConfig gWindowConfig_81E6CE4 = @@ -618,8 +620,8 @@ const struct WindowConfig gWindowConfig_81E6CE4 = 0, // tilemap top coordinate 30, // width 20, // height - (u8 *)BG_CHAR_ADDR(2), // tile data - (u16 *)BG_SCREEN_ADDR(31), // tilemap + BG_CHAR_ADDR(2), // tile data + BG_SCREEN_ADDR(31), // tilemap }; const struct WindowConfig gWindowConfig_81E6D00 = @@ -639,8 +641,8 @@ const struct WindowConfig gWindowConfig_81E6D00 = 0, // tilemap top coordinate 30, // width 20, // height - (u8 *)BG_CHAR_ADDR(0), // tile data - (u16 *)BG_SCREEN_ADDR(31), // tilemap + BG_CHAR_ADDR(0), // tile data + BG_SCREEN_ADDR(31), // tilemap }; const struct WindowConfig gWindowConfig_81E6D1C = @@ -660,8 +662,8 @@ const struct WindowConfig gWindowConfig_81E6D1C = 0, // tilemap top coordinate 30, // width 20, // height - (u8 *)BG_CHAR_ADDR(0), // tile data - (u16 *)BG_SCREEN_ADDR(31), // tilemap + BG_CHAR_ADDR(0), // tile data + BG_SCREEN_ADDR(31), // tilemap }; const struct WindowConfig gWindowConfig_81E6D38 = @@ -702,8 +704,8 @@ const struct WindowConfig gWindowConfig_81E6D54 = 0, // tilemap top coordinate 30, // width 20, // height - (u8 *)BG_CHAR_ADDR(3), // tile data - (u16 *)BG_SCREEN_ADDR(15), // tilemap + BG_CHAR_ADDR(3), // tile data + BG_SCREEN_ADDR(15), // tilemap }; const struct WindowConfig gWindowConfig_81E6D70 = @@ -723,8 +725,8 @@ const struct WindowConfig gWindowConfig_81E6D70 = 0, // tilemap top coordinate 30, // width 20, // height - (u8 *)BG_CHAR_ADDR(3), // tile data - (u16 *)BG_SCREEN_ADDR(15), // tilemap + BG_CHAR_ADDR(3), // tile data + BG_SCREEN_ADDR(15), // tilemap }; const struct WindowConfig gWindowConfig_81E6D8C = @@ -744,8 +746,8 @@ const struct WindowConfig gWindowConfig_81E6D8C = 0, // tilemap top coordinate 30, // width 20, // height - (u8 *)BG_CHAR_ADDR(0), // tile data - (u16 *)BG_SCREEN_ADDR(14), // tilemap + BG_CHAR_ADDR(0), // tile data + BG_SCREEN_ADDR(14), // tilemap }; const struct WindowConfig gWindowConfig_81E6DA8 = @@ -765,8 +767,8 @@ const struct WindowConfig gWindowConfig_81E6DA8 = 0, // tilemap top coordinate 30, // width 20, // height - (u8 *)BG_CHAR_ADDR(0), // tile data - (u16 *)BG_SCREEN_ADDR(11), // tilemap + BG_CHAR_ADDR(0), // tile data + BG_SCREEN_ADDR(11), // tilemap }; const struct WindowConfig WindowConfig_TrainerCard_Back_Values = @@ -786,8 +788,8 @@ const struct WindowConfig WindowConfig_TrainerCard_Back_Values = 0, // tilemap top coordinate 30, // width 20, // height - (u8 *)BG_CHAR_ADDR(2), // tile data - (u16 *)BG_SCREEN_ADDR(30), // tilemap + BG_CHAR_ADDR(2), // tile data + BG_SCREEN_ADDR(30), // tilemap }; const struct WindowConfig WindowConfig_TrainerCard_Back_Labels = @@ -807,8 +809,8 @@ const struct WindowConfig WindowConfig_TrainerCard_Back_Labels = 0, // tilemap top coordinate 30, // width 20, // height - (u8 *)BG_CHAR_ADDR(2), // tile data - (u16 *)BG_SCREEN_ADDR(30), // tilemap + BG_CHAR_ADDR(2), // tile data + BG_SCREEN_ADDR(30), // tilemap }; const struct WindowConfig gWindowConfig_81E6DFC = @@ -828,8 +830,8 @@ const struct WindowConfig gWindowConfig_81E6DFC = 0, // tilemap top coordinate 30, // width 20, // height - (u8 *)BG_CHAR_ADDR(2), // tile data - (u16 *)BG_SCREEN_ADDR(31), // tilemap + BG_CHAR_ADDR(2), // tile data + BG_SCREEN_ADDR(31), // tilemap }; const struct WindowConfig gWindowConfig_81E6E18 = @@ -849,8 +851,8 @@ const struct WindowConfig gWindowConfig_81E6E18 = 0, // tilemap top coordinate 30, // width 20, // height - (u8 *)BG_CHAR_ADDR(2), // tile data - (u16 *)BG_SCREEN_ADDR(31), // tilemap + BG_CHAR_ADDR(2), // tile data + BG_SCREEN_ADDR(31), // tilemap }; const struct WindowConfig gWindowConfig_81E6E34 = @@ -870,8 +872,8 @@ const struct WindowConfig gWindowConfig_81E6E34 = 0, // tilemap top coordinate 30, // width 20, // height - (u8 *)BG_CHAR_ADDR(0), // tile data - (u16 *)BG_SCREEN_ADDR(31), // tilemap + BG_CHAR_ADDR(0), // tile data + BG_SCREEN_ADDR(31), // tilemap }; const struct WindowConfig gWindowConfig_81E6E50 = @@ -891,8 +893,8 @@ const struct WindowConfig gWindowConfig_81E6E50 = 0, // tilemap top coordinate 30, // width 20, // height - (u8 *)BG_CHAR_ADDR(2), // tile data - (u16 *)BG_SCREEN_ADDR(28), // tilemap + BG_CHAR_ADDR(2), // tile data + BG_SCREEN_ADDR(28), // tilemap }; const struct WindowConfig gWindowConfig_81E6E6C = @@ -912,8 +914,8 @@ const struct WindowConfig gWindowConfig_81E6E6C = 0, // tilemap top coordinate 30, // width 20, // height - (u8 *)BG_CHAR_ADDR(2), // tile data - (u16 *)BG_SCREEN_ADDR(30), // tilemap + BG_CHAR_ADDR(2), // tile data + BG_SCREEN_ADDR(30), // tilemap }; const struct WindowConfig gWindowConfig_81E6E88 = @@ -933,8 +935,8 @@ const struct WindowConfig gWindowConfig_81E6E88 = 0, // tilemap top coordinate 30, // width 20, // height - (u8 *)BG_CHAR_ADDR(0), // tile data - (u16 *)BG_SCREEN_ADDR(31), // tilemap + BG_CHAR_ADDR(0), // tile data + BG_SCREEN_ADDR(31), // tilemap }; const struct WindowConfig gWindowConfig_81E6EA4 = @@ -954,8 +956,8 @@ const struct WindowConfig gWindowConfig_81E6EA4 = 0, // tilemap top coordinate 30, // width 20, // height - (u8 *)BG_CHAR_ADDR(0), // tile data - (u16 *)BG_SCREEN_ADDR(28), // tilemap + BG_CHAR_ADDR(0), // tile data + BG_SCREEN_ADDR(28), // tilemap }; const struct WindowConfig gWindowConfig_81E6EC0 = @@ -975,8 +977,8 @@ const struct WindowConfig gWindowConfig_81E6EC0 = 0, // tilemap top coordinate 30, // width 20, // height - (u8 *)BG_CHAR_ADDR(2), // tile data - (u16 *)BG_SCREEN_ADDR(29), // tilemap + BG_CHAR_ADDR(2), // tile data + BG_SCREEN_ADDR(29), // tilemap }; const struct WindowConfig gWindowConfig_81E6EDC = @@ -996,8 +998,8 @@ const struct WindowConfig gWindowConfig_81E6EDC = 0, // tilemap top coordinate 30, // width 20, // height - (u8 *)BG_CHAR_ADDR(0), // tile data - (u16 *)BG_SCREEN_ADDR(28), // tilemap + BG_CHAR_ADDR(0), // tile data + BG_SCREEN_ADDR(28), // tilemap }; const struct WindowConfig gWindowConfig_81E6EF8 = @@ -1017,8 +1019,8 @@ const struct WindowConfig gWindowConfig_81E6EF8 = 0, // tilemap top coordinate 30, // width 20, // height - (u8 *)BG_CHAR_ADDR(2), // tile data - (u16 *)BG_SCREEN_ADDR(29), // tilemap + BG_CHAR_ADDR(2), // tile data + BG_SCREEN_ADDR(29), // tilemap }; const struct WindowConfig gWindowConfig_81E6F14 = @@ -1038,8 +1040,8 @@ const struct WindowConfig gWindowConfig_81E6F14 = 0, // tilemap top coordinate 30, // width 20, // height - (u8 *)BG_CHAR_ADDR(0), // tile data - (u16 *)BG_SCREEN_ADDR(28), // tilemap + BG_CHAR_ADDR(0), // tile data + BG_SCREEN_ADDR(28), // tilemap }; const struct WindowConfig gWindowConfig_81E6F30 = @@ -1059,8 +1061,8 @@ const struct WindowConfig gWindowConfig_81E6F30 = 0, // tilemap top coordinate 30, // width 20, // height - (u8 *)BG_CHAR_ADDR(2), // tile data - (u16 *)BG_SCREEN_ADDR(29), // tilemap + BG_CHAR_ADDR(2), // tile data + BG_SCREEN_ADDR(29), // tilemap }; const struct WindowConfig gWindowConfig_81E6F4C = @@ -1080,8 +1082,8 @@ const struct WindowConfig gWindowConfig_81E6F4C = 0, // tilemap top coordinate 30, // width 20, // height - (u8 *)BG_CHAR_ADDR(0), // tile data - (u16 *)BG_SCREEN_ADDR(30), // tilemap + BG_CHAR_ADDR(0), // tile data + BG_SCREEN_ADDR(30), // tilemap }; const struct WindowConfig gWindowConfig_81E6F68 = @@ -1101,8 +1103,8 @@ const struct WindowConfig gWindowConfig_81E6F68 = 0, // tilemap top coordinate 30, // width 20, // height - (u8 *)BG_CHAR_ADDR(2), // tile data - (u16 *)BG_SCREEN_ADDR(13), // tilemap + BG_CHAR_ADDR(2), // tile data + BG_SCREEN_ADDR(13), // tilemap }; const struct WindowConfig gWindowConfig_81E6F84 = @@ -1122,8 +1124,8 @@ const struct WindowConfig gWindowConfig_81E6F84 = 0, // tilemap top coordinate 30, // width 20, // height - (u8 *)BG_CHAR_ADDR(2), // tile data - (u16 *)BG_SCREEN_ADDR(31), // tilemap + BG_CHAR_ADDR(2), // tile data + BG_SCREEN_ADDR(31), // tilemap }; const struct WindowConfig gWindowConfig_81E6FA0 = @@ -1143,8 +1145,8 @@ const struct WindowConfig gWindowConfig_81E6FA0 = 0, // tilemap top coordinate 30, // width 20, // height - (u8 *)BG_CHAR_ADDR(0), // tile data - (u16 *)BG_SCREEN_ADDR(24), // tilemap + BG_CHAR_ADDR(0), // tile data + BG_SCREEN_ADDR(24), // tilemap }; const struct WindowConfig gWindowConfig_81E6FBC = @@ -1164,8 +1166,8 @@ const struct WindowConfig gWindowConfig_81E6FBC = 0, // tilemap top coordinate 30, // width 20, // height - (u8 *)BG_CHAR_ADDR(0), // tile data - (u16 *)BG_SCREEN_ADDR(30), // tilemap + BG_CHAR_ADDR(0), // tile data + BG_SCREEN_ADDR(30), // tilemap }; const struct WindowConfig gWindowConfig_81E6FD8 = @@ -1185,8 +1187,8 @@ const struct WindowConfig gWindowConfig_81E6FD8 = 0, // tilemap top coordinate 30, // width 20, // height - (u8 *)BG_CHAR_ADDR(0), // tile data - (u16 *)BG_SCREEN_ADDR(24), // tilemap + BG_CHAR_ADDR(0), // tile data + BG_SCREEN_ADDR(24), // tilemap }; const struct WindowConfig gWindowConfig_81E6FF4 = @@ -1206,8 +1208,8 @@ const struct WindowConfig gWindowConfig_81E6FF4 = 0, // tilemap top coordinate 30, // width 20, // height - (u8 *)BG_CHAR_ADDR(0), // tile data - (u16 *)BG_SCREEN_ADDR(24), // tilemap + BG_CHAR_ADDR(0), // tile data + BG_SCREEN_ADDR(24), // tilemap }; const struct WindowConfig gWindowConfig_81E7010 = @@ -1227,8 +1229,8 @@ const struct WindowConfig gWindowConfig_81E7010 = 0, // tilemap top coordinate 30, // width 20, // height - (u8 *)BG_CHAR_ADDR(0), // tile data - (u16 *)BG_SCREEN_ADDR(30), // tilemap + BG_CHAR_ADDR(0), // tile data + BG_SCREEN_ADDR(30), // tilemap }; const struct WindowConfig gWindowConfig_81E702C = @@ -1248,8 +1250,8 @@ const struct WindowConfig gWindowConfig_81E702C = 0, // tilemap top coordinate 30, // width 20, // height - (u8 *)BG_CHAR_ADDR(2), // tile data - (u16 *)BG_SCREEN_ADDR(15), // tilemap + BG_CHAR_ADDR(2), // tile data + BG_SCREEN_ADDR(15), // tilemap }; const struct WindowConfig gWindowConfig_81E7048 = @@ -1269,8 +1271,8 @@ const struct WindowConfig gWindowConfig_81E7048 = 0, // tilemap top coordinate 16, // width 32, // height - (u8 *)BG_CHAR_ADDR(2), // tile data - (u16 *)BG_SCREEN_ADDR(14), // tilemap + BG_CHAR_ADDR(2), // tile data + BG_SCREEN_ADDR(14), // tilemap }; const struct WindowConfig gWindowConfig_81E7064 = @@ -1290,8 +1292,8 @@ const struct WindowConfig gWindowConfig_81E7064 = 0, // tilemap top coordinate 30, // width 20, // height - (u8 *)BG_CHAR_ADDR(2), // tile data - (u16 *)BG_SCREEN_ADDR(14), // tilemap + BG_CHAR_ADDR(2), // tile data + BG_SCREEN_ADDR(14), // tilemap }; const struct WindowConfig gWindowConfig_81E7080 = @@ -1311,8 +1313,8 @@ const struct WindowConfig gWindowConfig_81E7080 = 0, // tilemap top coordinate 30, // width 20, // height - (u8 *)BG_CHAR_ADDR(0), // tile data - (u16 *)BG_SCREEN_ADDR(30), // tilemap + BG_CHAR_ADDR(0), // tile data + BG_SCREEN_ADDR(30), // tilemap }; const struct WindowConfig gWindowConfig_81E709C = @@ -1332,8 +1334,8 @@ const struct WindowConfig gWindowConfig_81E709C = 0, // tilemap top coordinate 30, // width 20, // height - (u8 *)BG_CHAR_ADDR(0), // tile data - (u16 *)BG_SCREEN_ADDR(31), // tilemap + BG_CHAR_ADDR(0), // tile data + BG_SCREEN_ADDR(31), // tilemap }; const struct WindowConfig gWindowConfig_81E70B8 = @@ -1353,8 +1355,8 @@ const struct WindowConfig gWindowConfig_81E70B8 = 0, // tilemap top coordinate 30, // width 20, // height - (u8 *)BG_CHAR_ADDR(0), // tile data - (u16 *)BG_SCREEN_ADDR(30), // tilemap + BG_CHAR_ADDR(0), // tile data + BG_SCREEN_ADDR(30), // tilemap }; const struct WindowConfig gWindowConfig_81E70D4 = @@ -1374,8 +1376,8 @@ const struct WindowConfig gWindowConfig_81E70D4 = 0, // tilemap top coordinate 30, // width 20, // height - (u8 *)BG_CHAR_ADDR(0), // tile data - (u16 *)BG_SCREEN_ADDR(30), // tilemap + BG_CHAR_ADDR(0), // tile data + BG_SCREEN_ADDR(30), // tilemap }; const struct WindowConfig gWindowConfig_81E70F0 = @@ -1416,8 +1418,8 @@ const struct WindowConfig gWindowConfig_81E710C = 0, // tilemap top coordinate 30, // width 20, // height - (u8 *)BG_CHAR_ADDR(0), // tile data - (u16 *)BG_SCREEN_ADDR(31), // tilemap + BG_CHAR_ADDR(0), // tile data + BG_SCREEN_ADDR(31), // tilemap }; const struct WindowConfig gWindowConfig_81E7128 = @@ -1437,8 +1439,8 @@ const struct WindowConfig gWindowConfig_81E7128 = 0, // tilemap top coordinate 30, // width 20, // height - (u8 *)BG_CHAR_ADDR(2), // tile data - (u16 *)BG_SCREEN_ADDR(31), // tilemap + BG_CHAR_ADDR(2), // tile data + BG_SCREEN_ADDR(31), // tilemap }; const struct WindowConfig gWindowConfig_81E7144 = @@ -1458,8 +1460,8 @@ const struct WindowConfig gWindowConfig_81E7144 = 0, // tilemap top coordinate 30, // width 20, // height - (u8 *)BG_CHAR_ADDR(2), // tile data - (u16 *)BG_SCREEN_ADDR(31), // tilemap + BG_CHAR_ADDR(2), // tile data + BG_SCREEN_ADDR(31), // tilemap }; const struct WindowConfig gWindowConfig_81E7160 = @@ -1479,8 +1481,8 @@ const struct WindowConfig gWindowConfig_81E7160 = 0, // tilemap top coordinate 30, // width 20, // height - (u8 *)BG_CHAR_ADDR(1), // tile data - (u16 *)BG_SCREEN_ADDR(10), // tilemap + BG_CHAR_ADDR(1), // tile data + BG_SCREEN_ADDR(10), // tilemap }; const struct WindowConfig gWindowConfig_81E717C = @@ -1500,8 +1502,8 @@ const struct WindowConfig gWindowConfig_81E717C = 0, // tilemap top coordinate 30, // width 20, // height - (u8 *)BG_CHAR_ADDR(3), // tile data - (u16 *)BG_SCREEN_ADDR(31), // tilemap + BG_CHAR_ADDR(3), // tile data + BG_SCREEN_ADDR(31), // tilemap }; const struct WindowConfig gWindowConfig_81E7198 = @@ -1521,8 +1523,8 @@ const struct WindowConfig gWindowConfig_81E7198 = 0, // tilemap top coordinate 30, // width 20, // height - (u8 *)BG_CHAR_ADDR(2), // tile data - (u16 *)BG_SCREEN_ADDR(15), // tilemap + BG_CHAR_ADDR(2), // tile data + BG_SCREEN_ADDR(15), // tilemap }; const struct WindowConfig gWindowConfig_81E71B4 = @@ -1542,8 +1544,8 @@ const struct WindowConfig gWindowConfig_81E71B4 = 0, // tilemap top coordinate 30, // width 20, // height - (u8 *)BG_CHAR_ADDR(2), // tile data - (u16 *)BG_SCREEN_ADDR(15), // tilemap + BG_CHAR_ADDR(2), // tile data + BG_SCREEN_ADDR(15), // tilemap }; const struct WindowConfig gWindowConfig_81E71D0 = @@ -1563,8 +1565,8 @@ const struct WindowConfig gWindowConfig_81E71D0 = 0, // tilemap top coordinate 30, // width 20, // height - (u8 *)BG_CHAR_ADDR(1), // tile data - (u16 *)BG_SCREEN_ADDR(28), // tilemap + BG_CHAR_ADDR(1), // tile data + BG_SCREEN_ADDR(28), // tilemap }; const struct WindowConfig gWindowConfig_81E71EC = @@ -1584,8 +1586,8 @@ const struct WindowConfig gWindowConfig_81E71EC = 0, // tilemap top coordinate 30, // width 20, // height - (u8 *)BG_CHAR_ADDR(1), // tile data - (u16 *)BG_SCREEN_ADDR(30), // tilemap + BG_CHAR_ADDR(1), // tile data + BG_SCREEN_ADDR(30), // tilemap }; const struct WindowConfig gWindowConfig_81E7208 = @@ -1605,8 +1607,8 @@ const struct WindowConfig gWindowConfig_81E7208 = 0, // tilemap top coordinate 30, // width 20, // height - (u8 *)BG_CHAR_ADDR(2), // tile data - (u16 *)BG_SCREEN_ADDR(28), // tilemap + BG_CHAR_ADDR(2), // tile data + BG_SCREEN_ADDR(28), // tilemap }; const struct WindowConfig gWindowConfig_81E7224 = @@ -1626,8 +1628,8 @@ const struct WindowConfig gWindowConfig_81E7224 = 0, // tilemap top coordinate 30, // width 20, // height - (u8 *)BG_CHAR_ADDR(0), // tile data - (u16 *)BG_SCREEN_ADDR(31), // tilemap + BG_CHAR_ADDR(0), // tile data + BG_SCREEN_ADDR(31), // tilemap }; const struct WindowConfig gWindowConfig_81E7240 = @@ -1647,8 +1649,8 @@ const struct WindowConfig gWindowConfig_81E7240 = 0, // tilemap top coordinate 30, // width 20, // height - (u8 *)BG_CHAR_ADDR(2), // tile data - (u16 *)BG_SCREEN_ADDR(30), // tilemap + BG_CHAR_ADDR(2), // tile data + BG_SCREEN_ADDR(30), // tilemap }; const struct WindowConfig gWindowConfig_81E725C = diff --git a/src/engine/trade.c b/src/engine/trade.c index fdc764e87..8bc293b95 100644 --- a/src/engine/trade.c +++ b/src/engine/trade.c @@ -1088,7 +1088,7 @@ static void sub_8047EC0(void) ResetSpriteData(); FreeAllSpritePalettes(); ResetTasks(); - sub_804A964(&gUnknown_03004824->unk_00c8, (void *)BG_SCREEN_ADDR(5)); + sub_804A964(&gUnknown_03004824->unk_00c8, BG_SCREEN_ADDR(5)); SetVBlankCallback(sub_80489F4); InitMenuWindow(&gWindowConfig_81E6CE4); SetUpWindowConfig(&gWindowConfig_81E6F84); @@ -1268,7 +1268,7 @@ static void sub_80484F4(void) ResetSpriteData(); FreeAllSpritePalettes(); ResetTasks(); - sub_804A964(&gUnknown_03004824->unk_00c8, (void *)BG_SCREEN_ADDR(5)); + sub_804A964(&gUnknown_03004824->unk_00c8, BG_SCREEN_ADDR(5)); SetVBlankCallback(sub_80489F4); InitMenuWindow(&gWindowConfig_81E6CE4); SetUpWindowConfig(&gWindowConfig_81E6F84); @@ -1484,12 +1484,12 @@ static void sub_8048B0C(u8 a0) } for (i = 0; i < 0x400; i ++) gUnknown_03004824->unk_00c8.unk_12[i] = gUnknown_08EA15C8[i]; - dest = (u16 *)BG_SCREEN_ADDR(6); + dest = BG_SCREEN_ADDR(6); DmaCopy16(3, gTradeStripesBG2Tilemap, dest, 0x800); break; case 1: src = gTradeStripesBG3Tilemap; - dest = (u16 *)BG_SCREEN_ADDR(7); + dest = BG_SCREEN_ADDR(7); DmaCopy16(3, src, dest, 0x800); sub_804A6DC(0); sub_804A6DC(1); @@ -1853,7 +1853,7 @@ static void sub_8049088(void) { u8 string[28]; StringCopy(string, gTradeText_TradeOkayPrompt); - sub_804ACD8(string, (u8 *)BG_CHAR_ADDR(4) + gUnknown_03004824->unk_007e * 32, 20); + sub_804ACD8(string, BG_CHAR_ADDR(4) + gUnknown_03004824->unk_007e * 32, 20); } static void sub_80490BC(u8 mpId, u8 a1) @@ -2111,7 +2111,7 @@ static void sub_8049680(void) DrawTextWindow(&gUnknown_03004824->window, 24, 14, 29, 19); InitYesNoMenu(24, 14, 4); gUnknown_03004824->unk_007b = 4; - sub_804ACD8(gUnknown_0820C14C[4], (u8 *)(BG_CHAR_ADDR(4) + 32 * gUnknown_03004824->unk_007e), 20); + sub_804ACD8(gUnknown_0820C14C[4], BG_CHAR_ADDR(4) + 32 * gUnknown_03004824->unk_007e, 20); } } if (gMain.newKeys & R_BUTTON) @@ -2130,7 +2130,7 @@ static void sub_8049804(void) sub_804A80C(); gUnknown_03004824->unk_007b = 0; gSprites[gUnknown_03004824->tradeMenuCursorSpriteIdx].invisible = FALSE; - sub_804ACD8(gUnknown_0820C14C[1], (u8 *)(BG_CHAR_ADDR(4) + 32 * gUnknown_03004824->unk_007e), 20); + sub_804ACD8(gUnknown_0820C14C[1], BG_CHAR_ADDR(4) + 32 * gUnknown_03004824->unk_007e, 20); } static void sub_8049860(void) @@ -2498,7 +2498,7 @@ static void sub_8049ED4(u8 a0) gUnknown_03004824->unk_0080[a0] ++; break; case 4: - sub_804ACD8(gUnknown_0820C14C[5], (u8 *)(BG_CHAR_ADDR(4) + 32 * gUnknown_03004824->unk_007e), 20); + sub_804ACD8(gUnknown_0820C14C[5], BG_CHAR_ADDR(4) + 32 * gUnknown_03004824->unk_007e, 20); sub_804A51C(a0, whichPokemon, gUnknown_0820C3D1[a0][0] + 4, gUnknown_0820C3D1[a0][1] + 1, gUnknown_0820C3D1[a0][0], gUnknown_0820C3D1[a0][1]); gUnknown_03004824->unk_0080[a0] ++; break; @@ -3362,7 +3362,7 @@ static void sub_804A840(u8 whichParty) sub_804A740(1); sub_804A938(&gUnknown_03004824->unk_00c8); } - sub_804ACD8(gUnknown_0820C14C[1], (u8 *)(BG_CHAR_ADDR(4) + 32 * gUnknown_03004824->unk_007e), 20); + sub_804ACD8(gUnknown_0820C14C[1], BG_CHAR_ADDR(4) + 32 * gUnknown_03004824->unk_007e, 20); gUnknown_03004824->unk_0080[whichParty] = 0; } @@ -4037,7 +4037,7 @@ static void sub_804B41C(void) gMain.state ++; LZDecompressVram(gUnknown_08D00000, (void *)VRAM); CpuCopy16(gUnknown_08D00524, ewram, 0x1000); - DmaCopy16Defvars(3, ewram, (void *)BG_SCREEN_ADDR(5), 0x500); + DmaCopy16Defvars(3, ewram, BG_SCREEN_ADDR(5), 0x500); LoadCompressedPalette(gUnknown_08D004E0, 0, 32); gUnknown_03004828->unk_00b6 = 0; gUnknown_03004828->unk_00c4 = 0; @@ -4678,8 +4678,8 @@ static void sub_804BBE8(u8 a0) { case 0: LoadPalette(gUnknown_0820C9F8, 0x10, 0xa0); - DmaCopyLarge16(3, gUnknown_0820CA98, (void *)BG_CHAR_ADDR(1), 0x1300, 0x1000); - DmaCopy16Defvars(3, gUnknown_0820F798, (void *)BG_SCREEN_ADDR(18), 0x1000); + DmaCopyLarge16(3, gUnknown_0820CA98, BG_CHAR_ADDR(1), 0x1300, 0x1000); + DmaCopy16Defvars(3, gUnknown_0820F798, BG_SCREEN_ADDR(18), 0x1000); gUnknown_03004828->bg2vofs = 0; gUnknown_03004828->bg2hofs = 0xb4; REG_DISPCNT = DISPCNT_MODE_0 | DISPCNT_OBJ_1D_MAP | DISPCNT_BG0_ON | DISPCNT_BG1_ON | DISPCNT_BG2_ON | DISPCNT_OBJ_ON; @@ -4691,15 +4691,15 @@ static void sub_804BBE8(u8 a0) REG_BG1VOFS = 0x15c; REG_BG1CNT = BGCNT_PRIORITY(2) | BGCNT_CHARBASE(0) | BGCNT_SCREENBASE(5) | BGCNT_TXT256x512; - DmaCopy16Defvars(3, gUnknown_08210798, (void *)BG_SCREEN_ADDR(5), 0x1000); - DmaCopyLarge16(3, gUnknown_0820CA98, (void *)BG_CHAR_ADDR(0), 0x1300, 0x1000); + DmaCopy16Defvars(3, gUnknown_08210798, BG_SCREEN_ADDR(5), 0x1000); + DmaCopyLarge16(3, gUnknown_0820CA98, BG_CHAR_ADDR(0), 0x1300, 0x1000); REG_DISPCNT = DISPCNT_MODE_1 | DISPCNT_OBJ_1D_MAP | DISPCNT_BG1_ON | DISPCNT_OBJ_ON; break; case 2: gUnknown_03004828->bg1vofs = 0; gUnknown_03004828->bg1hofs = 0; REG_DISPCNT = DISPCNT_MODE_1 | DISPCNT_OBJ_1D_MAP | DISPCNT_BG1_ON | DISPCNT_OBJ_ON; - DmaCopy16Defvars(3, gUnknown_08211798, (void *)BG_SCREEN_ADDR(5), 0x800); + DmaCopy16Defvars(3, gUnknown_08211798, BG_SCREEN_ADDR(5), 0x800); break; case 3: REG_DISPCNT = DISPCNT_MODE_0 | DISPCNT_OBJ_1D_MAP | DISPCNT_BG1_ON | DISPCNT_OBJ_ON; @@ -4708,8 +4708,8 @@ static void sub_804BBE8(u8 a0) gUnknown_03004828->unk_010c = 0x78; gUnknown_03004828->unk_010e = -0x46; gUnknown_03004828->unk_011c = 0; - DmaCopyLarge16(3, gUnknown_0820DD98, (void *)BG_CHAR_ADDR(1), 0x1a00, 0x1000); - DmaCopy16Defvars(3, gUnknown_08211F98, (void *)BG_SCREEN_ADDR(18), 0x100); + DmaCopyLarge16(3, gUnknown_0820DD98, BG_CHAR_ADDR(1), 0x1a00, 0x1000); + DmaCopy16Defvars(3, gUnknown_08211F98, BG_SCREEN_ADDR(18), 0x100); break; case 4: REG_DISPCNT = DISPCNT_MODE_1 | DISPCNT_OBJ_1D_MAP | DISPCNT_BG2_ON | DISPCNT_OBJ_ON; @@ -4719,20 +4719,20 @@ static void sub_804BBE8(u8 a0) gUnknown_03004828->unk_0118 = 0x20; gUnknown_03004828->unk_011a = 0x400; gUnknown_03004828->unk_011c = 0; - DmaCopyLarge16(3, gUnknown_08213738, (void *)BG_CHAR_ADDR(1), 0x2040, 0x1000); - DmaCopy16Defvars(3, gUnknown_08215778, (void *)BG_SCREEN_ADDR(18), 0x100); + DmaCopyLarge16(3, gUnknown_08213738, BG_CHAR_ADDR(1), 0x2040, 0x1000); + DmaCopy16Defvars(3, gUnknown_08215778, BG_SCREEN_ADDR(18), 0x100); break; case 5: gUnknown_03004828->bg1vofs = 0; gUnknown_03004828->bg1hofs = 0; REG_BG1CNT = BGCNT_PRIORITY(2) | BGCNT_CHARBASE(0) | BGCNT_SCREENBASE(5); - LZDecompressVram(gUnknown_08D00000, (void *)BG_CHAR_ADDR(0)); + LZDecompressVram(gUnknown_08D00000, BG_CHAR_ADDR(0)); CpuCopy16(gUnknown_08D00524, buffer = (u16 *)ewram, 0x1000); LoadCompressedPalette(gUnknown_08D004E0, 0x70, 0x20); FillPalette(0, 0, 2); for (i = 0; i < 0x280; i ++) buffer[i] |= 0x7000; - DmaCopy16Defvars(3, ewram, (void *)BG_SCREEN_ADDR(5), 0x500); + DmaCopy16Defvars(3, ewram, BG_SCREEN_ADDR(5), 0x500); MenuZeroFillWindowRect(2, 15, 27, 18); break; case 6: @@ -4745,16 +4745,16 @@ static void sub_804BBE8(u8 a0) gUnknown_03004828->unk_010c = 0x78; gUnknown_03004828->unk_010e = 0x50; gUnknown_03004828->unk_011c = 0; - DmaCopyLarge16(3, gUnknown_08213738, (void *)BG_CHAR_ADDR(1), 0x2040, 0x1000); - DmaCopy16Defvars(3, gUnknown_08215778, (void *)BG_SCREEN_ADDR(18), 0x100); + DmaCopyLarge16(3, gUnknown_08213738, BG_CHAR_ADDR(1), 0x2040, 0x1000); + DmaCopy16Defvars(3, gUnknown_08215778, BG_SCREEN_ADDR(18), 0x100); break; case 7: gUnknown_03004828->bg2vofs = 0; gUnknown_03004828->bg2hofs = 0; REG_BG2CNT = BGCNT_PRIORITY(2) | BGCNT_CHARBASE(1) | BGCNT_SCREENBASE(18) | BGCNT_TXT512x256; LoadPalette(gUnknown_0820C9F8, 0x10, 0xa0); - DmaCopyLarge16(3, gUnknown_0820CA98, (void *)BG_CHAR_ADDR(1), 0x1300, 0x1000); - DmaCopy16Defvars(3, gUnknown_0820F798, (void *)BG_SCREEN_ADDR(18), 0x1000); + DmaCopyLarge16(3, gUnknown_0820CA98, BG_CHAR_ADDR(1), 0x1300, 0x1000); + DmaCopy16Defvars(3, gUnknown_0820F798, BG_SCREEN_ADDR(18), 0x1000); break; } } @@ -5708,7 +5708,7 @@ void sub_804E22C(void) LZDecompressVram(gUnknown_08D00000, (u8 *)VRAM); CpuCopy16(gUnknown_08D00524, ewram, 0x1000); src = (const u16 *)ewram; - dest = (u16 *)(BG_SCREEN_ADDR(5)); + dest = BG_SCREEN_ADDR(5); DmaCopy16(3, src, dest, 0x500) LoadCompressedPalette(gUnknown_08D004E0, 0, 32); REG_BG1CNT = BGCNT_PRIORITY(2) | BGCNT_SCREENBASE(5); |