summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/gba/defines.h3
-rw-r--r--src/battle/battle_2.c4
-rw-r--r--src/battle/battle_4.c4
-rw-r--r--src/battle/battle_bg.c92
-rw-r--r--src/battle/battle_interface.c14
-rw-r--r--src/battle/contest_link_80C2020.c74
-rw-r--r--src/contest.c4
-rw-r--r--src/contest_painting.c4
-rw-r--r--src/credits.c2
-rw-r--r--src/evolution_scene.c10
-rw-r--r--src/fieldmap.c4
-rw-r--r--src/fldeff_flash.c8
-rw-r--r--src/hall_of_fame.c4
-rw-r--r--src/intro.c6
-rw-r--r--src/option_menu.c2
-rw-r--r--src/pokeblock_feed.c2
-rw-r--r--src/rom_8077ABC.c10
17 files changed, 125 insertions, 122 deletions
diff --git a/include/gba/defines.h b/include/gba/defines.h
index 26e0c873f..e53ccfccf 100644
--- a/include/gba/defines.h
+++ b/include/gba/defines.h
@@ -17,6 +17,9 @@
#define INTR_CHECK (*(u16 *)0x3007FF8)
#define INTR_VECTOR (*(void **)0x3007FFC)
+#define EWRAM 0x2000000
+#define IWRAM 0x3000000
+
#define PLTT 0x5000000
#define PLTT_SIZE 0x400
diff --git a/src/battle/battle_2.c b/src/battle/battle_2.c
index 411a1ae46..833f71ac3 100644
--- a/src/battle/battle_2.c
+++ b/src/battle/battle_2.c
@@ -2514,7 +2514,7 @@ void debug_sub_8012688(void)
&gMonFrontPicTable[gCurrentMove],
gMonFrontPicCoords[gCurrentMove].coords,
gMonFrontPicCoords[gCurrentMove].y_offset,
- (void *)0x02000000,
+ (void *)EWRAM,
gUnknown_081FAF4C[1],
gCurrentMove);
LoadCompressedPalette(gMonPaletteTable[gCurrentMove].data, 272, 32);
@@ -2574,7 +2574,7 @@ void debug_sub_80129F8(u8 taskId)
&gMonFrontPicTable[gCurrentMove],
gMonFrontPicCoords[gCurrentMove].coords,
gMonFrontPicCoords[gCurrentMove].y_offset,
- (void *)0x02000000,
+ (void *)EWRAM,
gUnknown_081FAF4C[1],
gCurrentMove);
LoadCompressedPalette(gMonPaletteTable[gCurrentMove].data, 272, 32);
diff --git a/src/battle/battle_4.c b/src/battle/battle_4.c
index a84e16116..1e94b7fae 100644
--- a/src/battle/battle_4.c
+++ b/src/battle/battle_4.c
@@ -15735,8 +15735,8 @@ static void atkF2_displaydexinfo(void)
case 2:
if (!gPaletteFade.active && gMain.callback2 == BattleMainCB2 && !gTasks[gBattleCommunication[1]].isActive)
{
- LZDecompressVram(gBattleTerrainTiles_Building, (void*)(0x06008000));
- LZDecompressVram(gBattleTerrainTilemap_Building, (void*)(0x0600d000));
+ LZDecompressVram(gBattleTerrainTiles_Building, (void*)(VRAM + 0x8000));
+ LZDecompressVram(gBattleTerrainTilemap_Building, (void*)(VRAM + 0xD000));
LoadCompressedPalette(gBattleTerrainPalette_BattleTower, 0x20, 0x60);
REG_BG3CNT = 0x5a0b;
gBattle_BG3_X = 0x100;
diff --git a/src/battle/battle_bg.c b/src/battle/battle_bg.c
index 4928708e0..c3877ec1c 100644
--- a/src/battle/battle_bg.c
+++ b/src/battle/battle_bg.c
@@ -635,10 +635,10 @@ void sub_800DE30(u8 taskId)
void LoadBattleEntryBackground(void) {
if (gBattleTypeFlags & BATTLE_TYPE_LINK) {
- LZDecompressVram(gVersusFrameGfx, (void *)0x6004000);
- LZDecompressVram(gVersusFrameTilemap, (void *)0x600e000);
- LZDecompressVram(gVersusFrameTilemap, (void *)0x600f000);
- LZDecompressVram(gUnknown_08E5DC2C, (void *)0x6010000);
+ LZDecompressVram(gVersusFrameGfx, (void *)(VRAM + 0x4000));
+ LZDecompressVram(gVersusFrameTilemap, (void *)(VRAM + 0xE000));
+ LZDecompressVram(gVersusFrameTilemap, (void *)(VRAM + 0xF000));
+ LZDecompressVram(gUnknown_08E5DC2C, (void *)(VRAM + 0x10000));
LoadCompressedPalette(gVersusFramePal, 0x60, 0x20);
REG_BG1CNT = 0x5c04;
REG_WININ = 0x36;
@@ -648,47 +648,47 @@ void LoadBattleEntryBackground(void) {
LoadCompressedObjectPic(gUnknown_081F95A4);
return;
} else if (gBattleTypeFlags & (BATTLE_TYPE_EREADER_TRAINER | BATTLE_TYPE_BATTLE_TOWER | BATTLE_TYPE_LINK)) {
- LZDecompressVram(gBattleTerrainAnimTiles_Building, (void *)0x6004000);
- LZDecompressVram(gBattleTerrainAnimTilemap_Building, (void *)0x600e000);
+ LZDecompressVram(gBattleTerrainAnimTiles_Building, (void *)(VRAM + 0x4000));
+ LZDecompressVram(gBattleTerrainAnimTilemap_Building, (void *)(VRAM + 0xE000));
return;
} else if (gBattleTypeFlags & BATTLE_TYPE_KYOGRE_GROUDON) {
if (gGameVersion == VERSION_RUBY) {
- LZDecompressVram(gBattleTerrainAnimTiles_Cave, (void *)0x6004000);
- LZDecompressVram(gBattleTerrainAnimTilemap_Cave, (void *)0x600e000);
+ LZDecompressVram(gBattleTerrainAnimTiles_Cave, (void *)(VRAM + 0x4000));
+ LZDecompressVram(gBattleTerrainAnimTilemap_Cave, (void *)(VRAM + 0xE000));
return;
} else {
- LZDecompressVram(gBattleTerrainAnimTiles_Underwater, (void *)0x6004000);
- LZDecompressVram(gBattleTerrainAnimTilemap_Underwater, (void *)0x600e000);
+ LZDecompressVram(gBattleTerrainAnimTiles_Underwater, (void *)(VRAM + 0x4000));
+ LZDecompressVram(gBattleTerrainAnimTilemap_Underwater, (void *)(VRAM + 0xE000));
return;
}
} else if (gBattleTypeFlags & BATTLE_TYPE_TRAINER) {
if (gTrainers[gTrainerBattleOpponent].trainerClass == 0x19) {
- LZDecompressVram(gBattleTerrainAnimTiles_Building, (void *)0x6004000);
- LZDecompressVram(gBattleTerrainAnimTilemap_Building, (void *)0x600e000);
+ LZDecompressVram(gBattleTerrainAnimTiles_Building, (void *)(VRAM + 0x4000));
+ LZDecompressVram(gBattleTerrainAnimTilemap_Building, (void *)(VRAM + 0xE000));
return;
} else if (gTrainers[gTrainerBattleOpponent].trainerClass == 0x20) {
- LZDecompressVram(gBattleTerrainAnimTiles_Building, (void *)0x6004000);
- LZDecompressVram(gBattleTerrainAnimTilemap_Building, (void *)0x600e000);
+ LZDecompressVram(gBattleTerrainAnimTiles_Building, (void *)(VRAM + 0x4000));
+ LZDecompressVram(gBattleTerrainAnimTilemap_Building, (void *)(VRAM + 0xE000));
return;
}
}
if (sav1_map_get_battletype() == 0) {
- LZDecompressVram(gBattleTerrainTable[gBattleTerrain].entryTileset, (void *)0x6004000);
- LZDecompressVram(gBattleTerrainTable[gBattleTerrain].entryTilemap, (void *)0x600e000);
+ LZDecompressVram(gBattleTerrainTable[gBattleTerrain].entryTileset, (void *)(VRAM + 0x4000));
+ LZDecompressVram(gBattleTerrainTable[gBattleTerrain].entryTilemap, (void *)(VRAM + 0xE000));
return;
}
- LZDecompressVram(gBattleTerrainAnimTiles_Building, (void *)0x6004000);
- LZDecompressVram(gBattleTerrainAnimTilemap_Building, (void *)0x600e000);
+ LZDecompressVram(gBattleTerrainAnimTiles_Building, (void *)(VRAM + 0x4000));
+ LZDecompressVram(gBattleTerrainAnimTilemap_Building, (void *)(VRAM + 0xE000));
}
int LoadChosenBattleElement(u8 type) {
int ret = 0;
switch (type) {
case 0:
- LZDecompressVram(&gBattleTextboxTiles, (void *)0x6000000);
+ LZDecompressVram(&gBattleTextboxTiles, (void *)VRAM);
break;
case 1:
- CpuCopy16(gBattleTextboxTilemap, (void *)0x600c000, 0x1000);
+ CpuCopy16(gBattleTextboxTilemap, (void *)(VRAM + 0xC000), 0x1000);
break;
case 2:
LoadCompressedPalette(gBattleTextboxPalette, 0, 0x40);
@@ -697,106 +697,106 @@ int LoadChosenBattleElement(u8 type) {
if (!(gBattleTypeFlags & (BATTLE_TYPE_EREADER_TRAINER | BATTLE_TYPE_BATTLE_TOWER | BATTLE_TYPE_LINK))) {
if (gBattleTypeFlags & BATTLE_TYPE_KYOGRE_GROUDON) {
if (gGameVersion == VERSION_RUBY) {
- LZDecompressVram(gBattleTerrainTiles_Cave, (void *)0x6008000);
+ LZDecompressVram(gBattleTerrainTiles_Cave, (void *)(VRAM + 0x8000));
break;
} else {
- LZDecompressVram(gBattleTerrainTiles_Water, (void *)0x6008000);
+ LZDecompressVram(gBattleTerrainTiles_Water, (void *)(VRAM + 0x8000));
break;
}
} else {
if (gBattleTypeFlags & BATTLE_TYPE_TRAINER) {
if (gTrainers[gTrainerBattleOpponent].trainerClass == 0x19) {
- LZDecompressVram(gBattleTerrainTiles_Building, (void *)0x6008000);
+ LZDecompressVram(gBattleTerrainTiles_Building, (void *)(VRAM + 0x8000));
break;
} else if (gTrainers[gTrainerBattleOpponent].trainerClass == 0x20) {
- LZDecompressVram(gBattleTerrainTiles_Stadium, (void *)0x6008000);
+ LZDecompressVram(gBattleTerrainTiles_Stadium, (void *)(VRAM + 0x8000));
break;
}
}
switch (sav1_map_get_battletype()) {
case 0:
- LZDecompressVram(gBattleTerrainTable[gBattleTerrain].tileset, (void *)0x6008000);
+ LZDecompressVram(gBattleTerrainTable[gBattleTerrain].tileset, (void *)(VRAM + 0x8000));
break;
case 2:
- LZDecompressVram(gBattleTerrainTiles_Stadium, (void *)0x6008000);
+ LZDecompressVram(gBattleTerrainTiles_Stadium, (void *)(VRAM + 0x8000));
break;
case 3:
- LZDecompressVram(gBattleTerrainTiles_Stadium, (void *)0x6008000);
+ LZDecompressVram(gBattleTerrainTiles_Stadium, (void *)(VRAM + 0x8000));
break;
case 4:
- LZDecompressVram(gBattleTerrainTiles_Stadium, (void *)0x6008000);
+ LZDecompressVram(gBattleTerrainTiles_Stadium, (void *)(VRAM + 0x8000));
break;
case 5:
- LZDecompressVram(gBattleTerrainTiles_Stadium, (void *)0x6008000);
+ LZDecompressVram(gBattleTerrainTiles_Stadium, (void *)(VRAM + 0x8000));
break;
case 6:
- LZDecompressVram(gBattleTerrainTiles_Stadium, (void *)0x6008000);
+ LZDecompressVram(gBattleTerrainTiles_Stadium, (void *)(VRAM + 0x8000));
break;
case 7:
- LZDecompressVram(gBattleTerrainTiles_Stadium, (void *)0x6008000);
+ LZDecompressVram(gBattleTerrainTiles_Stadium, (void *)(VRAM + 0x8000));
break;
case 1:
case 8:
- LZDecompressVram(gBattleTerrainTiles_Building, (void *)0x6008000);
+ LZDecompressVram(gBattleTerrainTiles_Building, (void *)(VRAM + 0x8000));
break;
}
break;
}
} else {
- LZDecompressVram(gBattleTerrainTiles_Building, (void *)0x6008000);
+ LZDecompressVram(gBattleTerrainTiles_Building, (void *)(VRAM + 0x8000));
break;
}
case 4: // tilemap
if (!(gBattleTypeFlags & (BATTLE_TYPE_EREADER_TRAINER | BATTLE_TYPE_BATTLE_TOWER | BATTLE_TYPE_LINK))) {
if (gBattleTypeFlags & BATTLE_TYPE_KYOGRE_GROUDON) {
if (gGameVersion == 2) {
- LZDecompressVram(gBattleTerrainTilemap_Cave, (void *)0x600d000);
+ LZDecompressVram(gBattleTerrainTilemap_Cave, (void *)(VRAM + 0xD000));
break;
} else {
- LZDecompressVram(gBattleTerrainTilemap_Water, (void *)0x600d000);
+ LZDecompressVram(gBattleTerrainTilemap_Water, (void *)(VRAM + 0xD000));
break;
}
} else {
if (gBattleTypeFlags & BATTLE_TYPE_TRAINER) {
if (gTrainers[gTrainerBattleOpponent].trainerClass == 0x19) {
- LZDecompressVram(gBattleTerrainTilemap_Building, (void *)0x600d000);
+ LZDecompressVram(gBattleTerrainTilemap_Building, (void *)(VRAM + 0xD000));
break;
} else if (gTrainers[gTrainerBattleOpponent].trainerClass == 0x20) {
- LZDecompressVram(gBattleTerrainTilemap_Stadium, (void *)0x600d000);
+ LZDecompressVram(gBattleTerrainTilemap_Stadium, (void *)(VRAM + 0xD000));
break;
}
}
switch (sav1_map_get_battletype()) {
case 0:
- LZDecompressVram(gBattleTerrainTable[gBattleTerrain].tilemap, (void *)0x600d000);
+ LZDecompressVram(gBattleTerrainTable[gBattleTerrain].tilemap, (void *)(VRAM + 0xD000));
break;
case 2:
- LZDecompressVram(gBattleTerrainTilemap_Stadium, (void *)0x600d000);
+ LZDecompressVram(gBattleTerrainTilemap_Stadium, (void *)(VRAM + 0xD000));
break;
case 3:
- LZDecompressVram(gBattleTerrainTilemap_Stadium, (void *)0x600d000);
+ LZDecompressVram(gBattleTerrainTilemap_Stadium, (void *)(VRAM + 0xD000));
break;
case 4:
- LZDecompressVram(gBattleTerrainTilemap_Stadium, (void *)0x600d000);
+ LZDecompressVram(gBattleTerrainTilemap_Stadium, (void *)(VRAM + 0xD000));
break;
case 5:
- LZDecompressVram(gBattleTerrainTilemap_Stadium, (void *)0x600d000);
+ LZDecompressVram(gBattleTerrainTilemap_Stadium, (void *)(VRAM + 0xD000));
break;
case 6:
- LZDecompressVram(gBattleTerrainTilemap_Stadium, (void *)0x600d000);
+ LZDecompressVram(gBattleTerrainTilemap_Stadium, (void *)(VRAM + 0xD000));
break;
case 7:
- LZDecompressVram(gBattleTerrainTilemap_Stadium, (void *)0x600d000);
+ LZDecompressVram(gBattleTerrainTilemap_Stadium, (void *)(VRAM + 0xD000));
break;
case 1:
case 8:
- LZDecompressVram(gBattleTerrainTilemap_Building, (void *)0x600d000);
+ LZDecompressVram(gBattleTerrainTilemap_Building, (void *)(VRAM + 0xD000));
break;
}
break;
}
} else {
- LZDecompressVram(gBattleTerrainTilemap_Building, (void *)0x600d000);
+ LZDecompressVram(gBattleTerrainTilemap_Building, (void *)(VRAM + 0xD000));
break;
}
case 5: // palette
diff --git a/src/battle/battle_interface.c b/src/battle/battle_interface.c
index dedde2cb3..b91db9838 100644
--- a/src/battle/battle_interface.c
+++ b/src/battle/battle_interface.c
@@ -1350,11 +1350,11 @@ void sub_8044338(u8 a, struct Pokemon *pkmn)
int foo;
foo = gSprites[a].oam.tileNum + MACRO1(r7);
- CpuCopy32(r6, (u8 *)0x06010000 + foo * 32, 32);
+ CpuCopy32(r6, (u8 *)(VRAM + 0x10000) + foo * 32, 32);
r6 += 32;
foo = gSprites[a].oam.tileNum + 8 + MACRO1(r7);
- CpuCopy32(r6, (u8 *)0x06010000 + foo * 32, 32);
+ CpuCopy32(r6, (u8 *)(VRAM + 0x10000) + foo * 32, 32);
r6 += 32;
}
//_08044486
@@ -1370,12 +1370,12 @@ void sub_8044338(u8 a, struct Pokemon *pkmn)
if (r7 <= 1)
{
int foo = (gSprites[r5].oam.tileNum + 2 + r7);
- CpuCopy32(ewram0_9(1) + r7 * 0x40, (u8 *)0x06010000 + foo * 32, 32);
+ CpuCopy32(ewram0_9(1) + r7 * 0x40, (u8 *)(VRAM + 0x10000) + foo * 32, 32);
}
else
{
int foo = (r7 + gSprites[r5].oam.tileNum);
- CpuCopy32(ewram0_9(1) + r7 * 0x40, (u8 *)0x060100C0 + foo * 32, 32);
+ CpuCopy32(ewram0_9(1) + r7 * 0x40, (u8 *)(VRAM + 0x100C0) + foo * 32, 32);
}
}
}
@@ -1524,7 +1524,7 @@ _08044446:\n\
lsls r5, 6\n\
adds r0, r5\n\
lsls r0, 5\n\
- ldr r2, _08044500 @ =0x06010000\n\
+ ldr r2, _08044500 @ =(VRAM + 0x10000)\n\
adds r1, r0, r2\n\
adds r0, r6, 0\n\
mov r2, r10\n\
@@ -1538,7 +1538,7 @@ _08044446:\n\
adds r0, r4\n\
adds r0, r5\n\
lsls r0, 5\n\
- ldr r2, _08044500 @ =0x06010000\n\
+ ldr r2, _08044500 @ =(VRAM + 0x10000)\n\
adds r1, r0, r2\n\
adds r0, r6, 0\n\
mov r2, r10\n\
@@ -1596,7 +1596,7 @@ _080444DA:\n\
adds r0, r7, 0x2\n\
adds r1, r0\n\
lsls r1, 5\n\
- ldr r0, _08044500 @ =0x06010000\n\
+ ldr r0, _08044500 @ =(VRAM + 0x10000)\n\
adds r1, r0\n\
adds r0, r4, 0\n\
ldr r2, _080444F8 @ =REG_BG0CNT\n\
diff --git a/src/battle/contest_link_80C2020.c b/src/battle/contest_link_80C2020.c
index 2dde3895c..8269f424b 100644
--- a/src/battle/contest_link_80C2020.c
+++ b/src/battle/contest_link_80C2020.c
@@ -891,10 +891,10 @@ void sub_80C3158(const u8 *string, u8 spriteId)
sub_80034D4(eContestLink80C2020Struct2018068, gDisplayedStringBattle);
- CpuCopy32(&gUnknown_083D1624[0x0], (void *)0x6010000 + 32 * sp00[0], 32);
- CpuCopy32(&gUnknown_083D1624[0x40], (void *)0x6010000 + 32 * sp00[0] + 0x100, 32);
- CpuCopy32(&gUnknown_083D1624[0x40], (void *)0x6010000 + 32 * sp00[0] + 0x200, 32);
- CpuCopy32(&gUnknown_083D1624[0x20], (void *)0x6010000 + 32 * sp00[0] + 0x300, 32);
+ CpuCopy32(&gUnknown_083D1624[0x0], (void *)(VRAM + 0x10000) + 32 * sp00[0], 32);
+ CpuCopy32(&gUnknown_083D1624[0x40], (void *)(VRAM + 0x10000) + 32 * sp00[0] + 0x100, 32);
+ CpuCopy32(&gUnknown_083D1624[0x40], (void *)(VRAM + 0x10000) + 32 * sp00[0] + 0x200, 32);
+ CpuCopy32(&gUnknown_083D1624[0x20], (void *)(VRAM + 0x10000) + 32 * sp00[0] + 0x300, 32);
w = width / 8;
j = 0;
@@ -1415,27 +1415,27 @@ static inline s32 de_sub_80C39A8(s32 a0)
s32 result = 0;
if (gIsLinkContest & 0x1)
{
- sub_809D104((void *)0x0600E000, a0, 1, gUnknown_08E964B8, 9, 2, 8, 2);
+ sub_809D104((void *)(VRAM + 0xE000), a0, 1, gUnknown_08E964B8, 9, 2, 8, 2);
result = 8;
}
else if (gSpecialVar_ContestRank == 0)
{
- sub_809D104((void *)0x0600E000, a0, 1, gUnknown_08E964B8, 0, 0, 9, 2);
+ sub_809D104((void *)(VRAM + 0xE000), a0, 1, gUnknown_08E964B8, 0, 0, 9, 2);
result = 9;
}
else if (gSpecialVar_ContestRank == 1)
{
- sub_809D104((void *)0x0600E000, a0, 1, gUnknown_08E964B8, 9, 0, 8, 2);
+ sub_809D104((void *)(VRAM + 0xE000), a0, 1, gUnknown_08E964B8, 9, 0, 8, 2);
result = 8;
}
else if (gSpecialVar_ContestRank == 2)
{
- sub_809D104((void *)0x0600E000, a0, 1, gUnknown_08E964B8, 17, 0, 8, 2);
+ sub_809D104((void *)(VRAM + 0xE000), a0, 1, gUnknown_08E964B8, 17, 0, 8, 2);
result = 8;
}
else
{
- sub_809D104((void *)0x0600E000, a0, 1, gUnknown_08E964B8, 0, 2, 9, 2);
+ sub_809D104((void *)(VRAM + 0xE000), a0, 1, gUnknown_08E964B8, 0, 2, 9, 2);
result = 9;
}
return result;
@@ -1447,31 +1447,31 @@ static inline s32 de_sub_80C3A84(s32 a0, s32 * a1)
if (gSpecialVar_ContestCategory == 0)
{
*a1 = 0;
- sub_809D104((void *)0x0600E000, a0, 1, gUnknown_08E964B8, 17, 2, 10, 2);
+ sub_809D104((void *)(VRAM + 0xE000), a0, 1, gUnknown_08E964B8, 17, 2, 10, 2);
result = 10;
}
else if (gSpecialVar_ContestCategory == 1)
{
*a1 = 1;
- sub_809D104((void *)0x0600E000, a0, 1, gUnknown_08E964B8, 0, 4, 11, 2);
+ sub_809D104((void *)(VRAM + 0xE000), a0, 1, gUnknown_08E964B8, 0, 4, 11, 2);
result = 11;
}
else if (gSpecialVar_ContestCategory == 2)
{
*a1 = 2;
- sub_809D104((void *)0x0600E000, a0, 1, gUnknown_08E964B8, 11, 4, 10, 2);
+ sub_809D104((void *)(VRAM + 0xE000), a0, 1, gUnknown_08E964B8, 11, 4, 10, 2);
result = 10;
}
else if (gSpecialVar_ContestCategory == 3)
{
*a1 = 3;
- sub_809D104((void *)0x0600E000, a0, 1, gUnknown_08E964B8, 21, 4, 10, 2);
+ sub_809D104((void *)(VRAM + 0xE000), a0, 1, gUnknown_08E964B8, 21, 4, 10, 2);
result = 10;
}
else
{
*a1 = 4;
- sub_809D104((void *)0x0600E000, a0, 1, gUnknown_08E964B8, 0, 6, 10, 2);
+ sub_809D104((void *)(VRAM + 0xE000), a0, 1, gUnknown_08E964B8, 0, 6, 10, 2);
result = 10;
}
return result;
@@ -1484,8 +1484,8 @@ void sub_80C37E4(void)
de_sub_80C3A84(de_sub_80C39A8(5) + 5, &sp0);
for (i = 0; i < 0x80; i++)
{
- ((vu16 *)0x0600E000)[i] &= 0xFFF;
- ((vu16 *)0x0600E000)[i] |= sp0 << 12;;
+ ((vu16 *)(VRAM + 0xE000))[i] &= 0xFFF;
+ ((vu16 *)(VRAM + 0xE000))[i] |= sp0 << 12;;
}
}
#else
@@ -1707,27 +1707,27 @@ s16 de_sub_80C39A8(s32 a0)
s16 result;
if (gIsLinkContest & 1)
{
- sub_809D104((void *)0x0600E000, a0, 0, gUnknown_08E964B8, 11, 3, 8, 3);
+ sub_809D104((void *)(VRAM + 0xE000), a0, 0, gUnknown_08E964B8, 11, 3, 8, 3);
result = 8;
}
else if (gSpecialVar_ContestRank == 0)
{
- sub_809D104((void *)0x0600E000, a0, 0, gUnknown_08E964B8, 0, 0, 11, 3);
+ sub_809D104((void *)(VRAM + 0xE000), a0, 0, gUnknown_08E964B8, 0, 0, 11, 3);
result = 11;
}
else if (gSpecialVar_ContestRank == 1)
{
- sub_809D104((void *)0x0600E000, a0, 0, gUnknown_08E964B8, 11, 0, 10, 3);
+ sub_809D104((void *)(VRAM + 0xE000), a0, 0, gUnknown_08E964B8, 11, 0, 10, 3);
result = 10;
}
else if (gSpecialVar_ContestRank == 2)
{
- sub_809D104((void *)0x0600E000, a0, 0, gUnknown_08E964B8, 21, 0, 10, 3);
+ sub_809D104((void *)(VRAM + 0xE000), a0, 0, gUnknown_08E964B8, 21, 0, 10, 3);
result = 10;
}
else
{
- sub_809D104((void *)0x0600E000, a0, 0, gUnknown_08E964B8, 0, 3, 11, 3);
+ sub_809D104((void *)(VRAM + 0xE000), a0, 0, gUnknown_08E964B8, 0, 3, 11, 3);
result = 11;
}
return result;
@@ -1739,31 +1739,31 @@ s16 de_sub_80C3A84(s32 a0, s32 * a1)
if (gSpecialVar_ContestCategory == 0)
{
*a1 = 0;
- sub_809D104((void *)0x0600E000, a0, 0, gUnknown_08E964B8, 19, 3, 7, 3);
+ sub_809D104((void *)(VRAM + 0xE000), a0, 0, gUnknown_08E964B8, 19, 3, 7, 3);
result = 7;
}
else if (gSpecialVar_ContestCategory == 1)
{
*a1 = 1;
- sub_809D104((void *)0x0600E000, a0, 0, gUnknown_08E964B8, 0, 6, 7, 3);
+ sub_809D104((void *)(VRAM + 0xE000), a0, 0, gUnknown_08E964B8, 0, 6, 7, 3);
result = 7;
}
else if (gSpecialVar_ContestCategory == 2)
{
*a1 = 2;
- sub_809D104((void *)0x0600E000, a0, 0, gUnknown_08E964B8, 7, 6, 4, 3);
+ sub_809D104((void *)(VRAM + 0xE000), a0, 0, gUnknown_08E964B8, 7, 6, 4, 3);
result = 4;
}
else if (gSpecialVar_ContestCategory == 3)
{
*a1 = 3;
- sub_809D104((void *)0x0600E000, a0, 0, gUnknown_08E964B8, 11, 6, 6, 3);
+ sub_809D104((void *)(VRAM + 0xE000), a0, 0, gUnknown_08E964B8, 11, 6, 6, 3);
result = 6;
}
else
{
*a1 = 4;
- sub_809D104((void *)0x0600E000, a0, 0, gUnknown_08E964B8, 17, 6, 5, 3);
+ sub_809D104((void *)(VRAM + 0xE000), a0, 0, gUnknown_08E964B8, 17, 6, 5, 3);
result = 5;
}
return result;
@@ -1776,8 +1776,8 @@ void sub_80C37E4(void)
de_sub_80C3A84(de_sub_80C39A8(6) + 6, &sp0);
for (i = 0; i < 0x80; i++)
{
- ((vu16 *)0x0600E000)[i] &= 0xFFF;
- ((vu16 *)0x0600E000)[i] |= sp0 << 12;;
+ ((vu16 *)(VRAM + 0xE000))[i] &= 0xFFF;
+ ((vu16 *)(VRAM + 0xE000))[i] |= sp0 << 12;;
}
}
#endif
@@ -1848,10 +1848,10 @@ void sub_80C3A5C(u8 taskId)
if (--gTasks[taskId].data[11] == -1)
{
firstTileNum = gTasks[taskId].data[0] * 2 + 0x5043;
- *(vu16 *)(0x0600E142 + gTasks[taskId].data[1] * 192) = firstTileNum + 0x00;
- *(vu16 *)(0x0600E144 + gTasks[taskId].data[1] * 192) = firstTileNum + 0x01;
- *(vu16 *)(0x0600E182 + gTasks[taskId].data[1] * 192) = firstTileNum + 0x10;
- *(vu16 *)(0x0600E184 + gTasks[taskId].data[1] * 192) = firstTileNum + 0x11;
+ *(vu16 *)((VRAM + 0xE142) + gTasks[taskId].data[1] * 192) = firstTileNum + 0x00;
+ *(vu16 *)((VRAM + 0xE144) + gTasks[taskId].data[1] * 192) = firstTileNum + 0x01;
+ *(vu16 *)((VRAM + 0xE182) + gTasks[taskId].data[1] * 192) = firstTileNum + 0x10;
+ *(vu16 *)((VRAM + 0xE184) + gTasks[taskId].data[1] * 192) = firstTileNum + 0x11;
eContestLink80C2020Struct2018000.unk_05++;
DestroyTask(taskId);
PlaySE(SE_JYUNI);
@@ -1871,8 +1871,8 @@ void sub_80C3B30(u8 taskId)
{
for (k = 0; k < 30; k++)
{
- ((u16 *)(0x0600E100 + 2 * (96 * i + 32 * j)))[k] &= 0x0FFF;
- ((u16 *)(0x0600E100 + 2 * (96 * i + 32 * j)))[k] |= 0x9000;
+ ((u16 *)((VRAM + 0xE100) + 2 * (96 * i + 32 * j)))[k] &= 0x0FFF;
+ ((u16 *)((VRAM + 0xE100) + 2 * (96 * i + 32 * j)))[k] |= 0x9000;
}
}
gTasks[taskId].data[10] = i;
@@ -2182,7 +2182,7 @@ void sub_80C40D4(u8 arg0, u8 arg1)
x += 32 * (i * 3 + 5);
x -= arg1;
x--;
- *(vu16 *)(0x0600C000 + 2 * x) = 0x60B3;
+ *(vu16 *)((VRAM + 0xC000) + 2 * x) = 0x60B3;
taskId = CreateTask(sub_80C42C0, 10);
var0 = ((eContestLink80C2020Struct2018018[i].unk_08 << 16) / eContestLink80C2020Struct2018018[i].unk_11) * (arg1 + 1);
if ((var0 % 0x10000) >= 0x8000)
@@ -2209,7 +2209,7 @@ void sub_80C40D4(u8 arg0, u8 arg1)
x += 32 * (i * 3 + 6);
x -= arg1;
x--;
- *(vu16 *)(0x0600C000 + 2 * x) = tile;
+ *(vu16 *)((VRAM + 0xC000) + 2 * x) = tile;
taskId = CreateTask(sub_80C42C0, 10);
var0 = ((eContestLink80C2020Struct2018018[i].unk_0c << 16) / eContestLink80C2020Struct2018018[i].unk_12) * (arg1 + 1);
if ((var0 % 0x10000) >= 0x8000)
@@ -2551,7 +2551,7 @@ void sub_80C42C0(u8 taskId /*r12*/)
tile = 0x504C + r0;
else
tile = 0x5057 + r0;
- *(vu16 *)(0x0600E18E + 2 * (96 * r5 + i)) = tile;
+ *(vu16 *)((VRAM + 0xE18E) + 2 * (96 * r5 + i)) = tile;
}
}
}
diff --git a/src/contest.c b/src/contest.c
index 9652e999e..c41f25077 100644
--- a/src/contest.c
+++ b/src/contest.c
@@ -2459,7 +2459,7 @@ u8 unref_sub_80AE908(void)
&gMonFrontPicTable[species],
gMonFrontPicCoords[species].coords,
gMonFrontPicCoords[species].y_offset,
- (void *)0x02000000,
+ (void *)EWRAM,
gUnknown_081FAF4C[1],
species);
LoadCompressedPalette(gMonPaletteTable[species].data, 0x110, 32);
@@ -2485,7 +2485,7 @@ u8 sub_80AE9FC(u16 species, u32 otId, u32 personality)
&gMonBackPicTable[species],
gMonBackPicCoords[species].coords,
gMonBackPicCoords[species].y_offset,
- 0x02000000,
+ EWRAM,
gUnknown_081FAF4C[0],
species,
personality);
diff --git a/src/contest_painting.c b/src/contest_painting.c
index 0c5cdcd49..e3cc6cdae 100644
--- a/src/contest_painting.c
+++ b/src/contest_painting.c
@@ -341,7 +341,7 @@ static void sub_8106AC4(u16 species, u8 arg1)
&gMonFrontPicTable[species],
gMonFrontPicCoords[species].coords,
gMonFrontPicCoords[species].y_offset,
- 0x2000000,
+ EWRAM,
gUnknown_081FAF4C[1],
species,
(u32)gUnknown_03005E8C->personality
@@ -354,7 +354,7 @@ static void sub_8106AC4(u16 species, u8 arg1)
&gMonBackPicTable[species],
gMonBackPicCoords[species].coords,
gMonBackPicCoords[species].y_offset,
- 0x2000000,
+ EWRAM,
gUnknown_081FAF4C[0],
species,
(u32)gUnknown_03005E8C->personality
diff --git a/src/credits.c b/src/credits.c
index c0c53505d..daf6d2b5c 100644
--- a/src/credits.c
+++ b/src/credits.c
@@ -1561,7 +1561,7 @@ static u8 sub_81456B4(u16 species, u16 x, u16 y, u16 position)
&gMonFrontPicTable[species],
gMonFrontPicCoords[species].coords,
gMonFrontPicCoords[species].y_offset,
- 0x2000000,
+ EWRAM,
gUnknown_0840B5A0[position],
species,
personality,
diff --git a/src/evolution_scene.c b/src/evolution_scene.c
index a855efb1b..a51c08a0c 100644
--- a/src/evolution_scene.c
+++ b/src/evolution_scene.c
@@ -223,7 +223,7 @@ void EvolutionScene(struct Pokemon* mon, u16 speciesToEvolve, bool8 canStopEvo,
DecompressPicFromTable_2(&gMonFrontPicTable[currSpecies],
gMonFrontPicCoords[currSpecies].coords,
gMonFrontPicCoords[currSpecies].y_offset,
- (void*)(0x2000000),
+ (void*)EWRAM,
gUnknown_081FAF4C[1], currSpecies);
pokePal = (void*) GetMonSpritePalStructFromOtIdPersonality(currSpecies, TiD, PiD);
LoadCompressedPalette(*pokePal, 0x110, 0x20);
@@ -240,7 +240,7 @@ void EvolutionScene(struct Pokemon* mon, u16 speciesToEvolve, bool8 canStopEvo,
DecompressPicFromTable_2(&gMonFrontPicTable[speciesToEvolve],
gMonFrontPicCoords[speciesToEvolve].coords,
gMonFrontPicCoords[speciesToEvolve].y_offset,
- (void*)(0x2000000),
+ (void*)EWRAM,
gUnknown_081FAF4C[3], speciesToEvolve);
pokePal = (void*) GetMonSpritePalStructFromOtIdPersonality(speciesToEvolve, TiD, PiD);
LoadCompressedPalette(*pokePal, 0x120, 0x20);
@@ -320,7 +320,7 @@ static void CB2_EvolutionSceneLoadGraphics(void)
DecompressPicFromTable_2(&gMonFrontPicTable[postEvoSpecies],
gMonFrontPicCoords[postEvoSpecies].coords,
gMonFrontPicCoords[postEvoSpecies].y_offset,
- (void*)(0x2000000),
+ (void*)EWRAM,
gUnknown_081FAF4C[3], postEvoSpecies);
pokePal = (void*) GetMonSpritePalStructFromOtIdPersonality(postEvoSpecies, TiD, PiD);
LoadCompressedPalette(*pokePal, 0x120, 0x20);
@@ -390,7 +390,7 @@ static void CB2_TradeEvolutionSceneLoadGraphics(void)
DecompressPicFromTable_2(&gMonFrontPicTable[postEvoSpecies],
gMonFrontPicCoords[postEvoSpecies].coords,
gMonFrontPicCoords[postEvoSpecies].y_offset,
- (void*)(0x2000000),
+ (void*)EWRAM,
gUnknown_081FAF4C[3], postEvoSpecies);
pokePal = (void*) GetMonSpritePalStructFromOtIdPersonality(postEvoSpecies, TiD, PiD);
LoadCompressedPalette(*pokePal, 0x120, 0x20);
@@ -440,7 +440,7 @@ void TradeEvolutionScene(struct Pokemon* mon, u16 speciesToEvolve, u8 preEvoSpri
DecompressPicFromTable_2(&gMonFrontPicTable[speciesToEvolve],
gMonFrontPicCoords[speciesToEvolve].coords,
gMonFrontPicCoords[speciesToEvolve].y_offset,
- (void*)(0x2000000),
+ (void*)EWRAM,
gUnknown_081FAF4C[1], speciesToEvolve);
pokePal = (void*) GetMonSpritePalStructFromOtIdPersonality(speciesToEvolve, TiD, PiD);
LoadCompressedPalette(*pokePal, 0x120, 0x20);
diff --git a/src/fieldmap.c b/src/fieldmap.c
index 4b5149878..f9f857f89 100644
--- a/src/fieldmap.c
+++ b/src/fieldmap.c
@@ -910,8 +910,8 @@ void sub_8056CBC(struct Tileset *tileset, int offset, int size)
}
else
{
- LZ77UnCompVram(tileset->palettes, (void*)0x2000000);
- LoadPalette((void*)0x2000000, offset, size);
+ LZ77UnCompVram(tileset->palettes, (void*)EWRAM);
+ LoadPalette((void*)EWRAM, offset, size);
}
}
}
diff --git a/src/fldeff_flash.c b/src/fldeff_flash.c
index 22da8e501..a49802af1 100644
--- a/src/fldeff_flash.c
+++ b/src/fldeff_flash.c
@@ -220,8 +220,8 @@ static void sub_810CE5C(u8 taskId)
static void sub_810CE78(u8 taskId)
{
REG_DISPCNT = 0;
- LZ77UnCompVram(gCaveTransitionTiles, (void *)0x600C000);
- LZ77UnCompVram(gCaveTransitionTilemap, (void *)0x600F800);
+ LZ77UnCompVram(gCaveTransitionTiles, (void *)(VRAM + 0xC000));
+ LZ77UnCompVram(gCaveTransitionTilemap, (void *)(VRAM + 0xF800));
LoadPalette(gCaveTransitionPalette_White, 0xE0, 0x20);
LoadPalette(gUnknown_083F809C, 0xE0, 0x10);
REG_BLDCNT = 15937;
@@ -292,8 +292,8 @@ static void sub_810D00C(u8 taskId)
static void sub_810D028(u8 taskId)
{
REG_DISPCNT = 0;
- LZ77UnCompVram(gCaveTransitionTiles, (void *)0x600C000);
- LZ77UnCompVram(gCaveTransitionTilemap, (void *)0x600F800);
+ LZ77UnCompVram(gCaveTransitionTiles, (void *)(VRAM + 0xC000));
+ LZ77UnCompVram(gCaveTransitionTilemap, (void *)(VRAM + 0xF800));
REG_BLDCNT = 0;
REG_BLDALPHA = 0;
REG_BLDY = 0;
diff --git a/src/hall_of_fame.c b/src/hall_of_fame.c
index 5ee025eeb..74db6ac26 100644
--- a/src/hall_of_fame.c
+++ b/src/hall_of_fame.c
@@ -1298,7 +1298,7 @@ static u32 HallOfFame_LoadPokemonPic(u16 species, s16 posX, s16 posY, u16 pokeID
u8 spriteID;
const u8* pokePal;
- LoadSpecialPokePic(&gMonFrontPicTable[species], gMonFrontPicCoords[species].coords, gMonFrontPicCoords[species].y_offset, 0x2000000, gUnknown_0840B5A0[pokeID], species, pid, 1);
+ LoadSpecialPokePic(&gMonFrontPicTable[species], gMonFrontPicCoords[species].coords, gMonFrontPicCoords[species].y_offset, EWRAM, gUnknown_0840B5A0[pokeID], species, pid, 1);
pokePal = GetMonSpritePalFromOtIdPersonality(species, tid, pid);
LoadCompressedPalette(pokePal, 16 * pokeID + 256, 0x20);
@@ -1313,7 +1313,7 @@ static u32 HallOfFame_LoadTrainerPic(u16 trainerPicID, s16 posX, s16 posY, u16 a
{
u8 spriteID;
- DecompressPicFromTable_2(&gTrainerFrontPicTable[trainerPicID], gTrainerFrontPicCoords[trainerPicID].coords, gTrainerFrontPicCoords[trainerPicID].y_offset, (void*) 0x2000000, gUnknown_0840B5A0[a3], trainerPicID);
+ DecompressPicFromTable_2(&gTrainerFrontPicTable[trainerPicID], gTrainerFrontPicCoords[trainerPicID].coords, gTrainerFrontPicCoords[trainerPicID].y_offset, (void*)EWRAM, gUnknown_0840B5A0[a3], trainerPicID);
LoadCompressedPalette(gTrainerFrontPicPaletteTable[trainerPicID].data, 16 * a3 + 256, 0x20);
sub_8143680(a3, a3);
diff --git a/src/intro.c b/src/intro.c
index b444c518e..818c4ec54 100644
--- a/src/intro.c
+++ b/src/intro.c
@@ -1601,9 +1601,9 @@ static u16 sub_813CE88(u16 species, s16 x, s16 y, u16 d, u8 front)
u8 spriteId;
if (front)
- LoadSpecialPokePic(&gMonFrontPicTable[species], gMonFrontPicCoords[species].coords, gMonFrontPicCoords[species].y_offset, 0x2000000, gUnknown_0840B5A0[d], species, 0, 1);
+ LoadSpecialPokePic(&gMonFrontPicTable[species], gMonFrontPicCoords[species].coords, gMonFrontPicCoords[species].y_offset, EWRAM, gUnknown_0840B5A0[d], species, 0, 1);
else
- LoadSpecialPokePic(&gMonBackPicTable[species], gMonBackPicCoords[species].coords, gMonBackPicCoords[species].y_offset, 0x2000000, gUnknown_0840B5A0[d], species, 0, 0);
+ LoadSpecialPokePic(&gMonBackPicTable[species], gMonBackPicCoords[species].coords, gMonBackPicCoords[species].y_offset, EWRAM, gUnknown_0840B5A0[d], species, 0, 0);
lzPaletteData = GetMonSpritePalFromOtIdPersonality(species, 0, 0xFFFF);
LoadCompressedPalette(lzPaletteData, 0x100 + d * 0x10, 0x20);
sub_8143648(d, d);
@@ -1617,7 +1617,7 @@ static u8 sub_813CFA8(u16 a, u16 b, u16 c, u16 d)
{
u8 spriteId;
- DecompressPicFromTable_2(&gTrainerBackPicTable[a], gTrainerBackPicCoords[a].coords, gTrainerBackPicCoords[a].y_offset, (void *)0x2000000, gUnknown_0840B5A0[d], a);
+ DecompressPicFromTable_2(&gTrainerBackPicTable[a], gTrainerBackPicCoords[a].coords, gTrainerBackPicCoords[a].y_offset, (void *)EWRAM, gUnknown_0840B5A0[d], a);
LoadCompressedPalette(gTrainerBackPicPaletteTable[a].data, 0x100 + d * 0x10, 0x20);
sub_8143680(d, d);
gUnknown_02024E8C.anims = gUnknown_0840B064;
diff --git a/src/option_menu.c b/src/option_menu.c
index 2a5b0e534..6fc58b531 100644
--- a/src/option_menu.c
+++ b/src/option_menu.c
@@ -112,7 +112,7 @@ void CB2_InitOptionMenu(void)
break;
case 5:
LoadPalette(gUnknown_0839F5FC, 0x80, 0x40);
- CpuCopy16(gUnknown_0839F63C, (void *)0x0600BEE0, 0x40);
+ CpuCopy16(gUnknown_0839F63C, (void *)(VRAM + 0xBEE0), 0x40);
gMain.state++;
break;
case 6:
diff --git a/src/pokeblock_feed.c b/src/pokeblock_feed.c
index 588bc85c0..a4614f52d 100644
--- a/src/pokeblock_feed.c
+++ b/src/pokeblock_feed.c
@@ -616,7 +616,7 @@ static bool8 sub_8147B20(struct Pokemon* mon)
case 0:
species = GetMonData(mon, MON_DATA_SPECIES2);
PiD = GetMonData(mon, MON_DATA_PERSONALITY);
- HandleLoadSpecialPokePic(&gMonFrontPicTable[species], gMonFrontPicCoords[species].coords, gMonFrontPicCoords[species].y_offset, 0x2000000, gUnknown_081FAF4C[1], species, PiD);
+ HandleLoadSpecialPokePic(&gMonFrontPicTable[species], gMonFrontPicCoords[species].coords, gMonFrontPicCoords[species].y_offset, EWRAM, gUnknown_081FAF4C[1], species, PiD);
ewram1FFFF++;
break;
case 1:
diff --git a/src/rom_8077ABC.c b/src/rom_8077ABC.c
index 278e5e459..c19ec570b 100644
--- a/src/rom_8077ABC.c
+++ b/src/rom_8077ABC.c
@@ -1943,8 +1943,8 @@ u8 sub_8079F44(u16 species, bool8 isBackpic, u8 a3, s16 a4, s16 a5, u8 a6, u32 a
&gMonFrontPicTable[species],
gMonFrontPicCoords[species].coords,
gMonFrontPicCoords[species].y_offset,
- 0x2000000,
- (void *)0x2000000,
+ EWRAM,
+ (void *)EWRAM,
species,
a7,
1
@@ -1957,15 +1957,15 @@ u8 sub_8079F44(u16 species, bool8 isBackpic, u8 a3, s16 a4, s16 a5, u8 a6, u32 a
&gMonBackPicTable[species],
gMonBackPicCoords[species].coords,
gMonBackPicCoords[species].y_offset,
- 0x2000000,
- (void *)0x2000000,
+ EWRAM,
+ (void *)EWRAM,
species,
a7,
0
);
}
- DmaCopy32Defvars(3, (void *)0x2000000, (void *)(OBJ_VRAM0 + (sheet * 0x20)), 0x800);
+ DmaCopy32Defvars(3, (void *)EWRAM, (void *)(OBJ_VRAM0 + (sheet * 0x20)), 0x800);
if (!isBackpic)
sprite = CreateSprite(&gSpriteTemplate_837F5B0[a3], a4, a5 + gMonFrontPicCoords[species].y_offset, a6);