summaryrefslogtreecommitdiff
path: root/src/scene
diff options
context:
space:
mode:
Diffstat (limited to 'src/scene')
-rw-r--r--src/scene/berry_blender.c22
-rw-r--r--src/scene/contest_painting.c9
-rw-r--r--src/scene/egg_hatch.c10
-rw-r--r--src/scene/hall_of_fame.c102
-rw-r--r--src/scene/intro.c1
5 files changed, 72 insertions, 72 deletions
diff --git a/src/scene/berry_blender.c b/src/scene/berry_blender.c
index 7ffcc5185..b5d36ad1e 100644
--- a/src/scene/berry_blender.c
+++ b/src/scene/berry_blender.c
@@ -20,6 +20,7 @@
#include "menu_cursor.h"
#include "trig.h"
#include "pokeblock.h"
+#include "ewram.h"
//needed to match Blender_ControlHitPitch
struct MusicPlayerInfo
@@ -207,7 +208,6 @@ extern void de_sub_8073110();
extern struct MusicPlayerInfo gMPlay_SE2;
extern struct MusicPlayerInfo gMPlay_BGM;
-extern u8 ewram[];
extern u16 gScriptItemId;
extern u8 gUnknown_020297ED;
extern u8 byte_3002A68;
@@ -828,7 +828,7 @@ static bool8 sub_804E2EC(void)
switch (gBerryBlenderData->field_1)
{
case 0:
- LZDecompressWram(gUnknown_08E6C100, &ewram[0x10000]);
+ LZDecompressWram(gUnknown_08E6C100, ewram10000);
gBerryBlenderData->field_1++;
break;
case 1:
@@ -843,7 +843,7 @@ static bool8 sub_804E2EC(void)
break;
case 2:
{
- void* offsetRead = &ewram[0x10000];
+ void* offsetRead = ewram10000;
void* offsetWrite = (void*)(VRAM);
u32 size = 0x2000;
while (TRUE)
@@ -862,16 +862,16 @@ static bool8 sub_804E2EC(void)
}
break;
case 3:
- LZDecompressWram(gUnknown_08E6C920, &ewram[0x10000]);
+ LZDecompressWram(gUnknown_08E6C920, ewram10000);
gBerryBlenderData->field_1++;
break;
case 4:
- LZDecompressWram(gUnknown_08E6D354, &ewram[0x13000]);
+ LZDecompressWram(gUnknown_08E6D354, ewram13000);
gBerryBlenderData->field_1++;
break;
case 5:
{
- void* offsetRead = &ewram[0x10000];
+ void* offsetRead = ewram10000;
void* offsetWrite = (void*)(VRAM + 0xE000);
DmaCopy16(3, offsetRead, offsetWrite, 0x1000);
@@ -880,7 +880,7 @@ static bool8 sub_804E2EC(void)
break;
case 6:
{
- void* offsetRead = &ewram[0x11000];
+ void* offsetRead = ewram11000;
void* offsetWrite = (void*)(VRAM + 0xF000);
DmaCopy16(3, offsetRead, offsetWrite, 0x1000);
@@ -890,7 +890,7 @@ static bool8 sub_804E2EC(void)
case 7:
{
u16 i;
- u16* palStore = (u16*)(&ewram[0x13000]);
+ u16* palStore = (u16*)(ewram13000);
void* offsetRead;
void* offsetWrite;
@@ -898,7 +898,7 @@ static bool8 sub_804E2EC(void)
{
*(palStore + i) |= 0x100;
}
- offsetRead = &ewram[0x13000];
+ offsetRead = ewram13000;
offsetWrite = (void*)(VRAM + 0x6000);
DmaCopy16(3, offsetRead, offsetWrite, 0x500);
LoadPalette(sBlenderOuterPal, 0x80, 0x20);
@@ -937,7 +937,7 @@ void sub_804E538(void)
{
u8* field6F; //this temp value is needed to match
- gBerryBlenderData = (struct BerryBlenderData*)(&ewram[0x18000]);
+ gBerryBlenderData = eBerryBlenderData;
field6F = &gBerryBlenderData->field_6F;
gBerryBlenderData->field_0 = 0;
@@ -1111,7 +1111,7 @@ void sub_804E990(void)
s32 i;
REG_DISPCNT = 0;
- gBerryBlenderData = (struct BerryBlenderData*)(&ewram[0x18000]);
+ gBerryBlenderData = eBerryBlenderData;
gBerryBlenderData->field_0 = 0;
gBerryBlenderData->field_134 = 0;
for (i = 0; i < BLENDER_MAX_PLAYERS; i++)
diff --git a/src/scene/contest_painting.c b/src/scene/contest_painting.c
index 928b59760..9df2d56da 100644
--- a/src/scene/contest_painting.c
+++ b/src/scene/contest_painting.c
@@ -12,8 +12,7 @@
#include "strings.h"
#include "text.h"
#include "unknown_task.h"
-
-extern u8 ewram[];
+#include "ewram.h"
static u8 gUnknown_03000750;
static u16 gUnknown_03000752;
@@ -184,15 +183,15 @@ static void ShowContestPainting(void)
case 2:
SeedRng(gMain.vblankCounter1);
InitKeys();
- ContestPaintingInitWindow(ewram[0x15DDF]);
+ ContestPaintingInitWindow(ewram15DDF);
gMain.state++;
break;
case 3:
- sub_8107090(ewram[0x15DDE], ewram[0x15DDF]);
+ sub_8107090(ewram15DDE, ewram15DDF);
gMain.state++;
break;
case 4:
- ContestPaintingPrintCaption(ewram[0x15DDE], ewram[0x15DDF]);
+ ContestPaintingPrintCaption(ewram15DDE, ewram15DDF);
LoadPalette(gUnknown_083F6140, 0, 1 * 2);
DmaClear32(3, PLTT, 0x400);
BeginFastPaletteFade(2);
diff --git a/src/scene/egg_hatch.c b/src/scene/egg_hatch.c
index 032dcd284..d363e4bcd 100644
--- a/src/scene/egg_hatch.c
+++ b/src/scene/egg_hatch.c
@@ -20,8 +20,8 @@
#include "trig.h"
#include "rng.h"
#include "trade.h"
+#include "ewram.h"
-extern u8 ewram[];
extern struct SpriteTemplate gUnknown_02024E8C;
struct EggHatchData
@@ -416,7 +416,7 @@ static u8 EggHatchCreateMonSprite(u8 a0, u8 switchID, u8 pokeID)
{
u16 species = GetMonData(mon, MON_DATA_SPECIES);
u32 pid = GetMonData(mon, MON_DATA_PERSONALITY);
- HandleLoadSpecialPokePic(&gMonFrontPicTable[species], gMonFrontPicCoords[species].coords, gMonFrontPicCoords[species].y_offset,(u32)(&ewram[0]), gUnknown_081FAF4C[2 * a0 + 1], species, pid);
+ HandleLoadSpecialPokePic(&gMonFrontPicTable[species], gMonFrontPicCoords[species].coords, gMonFrontPicCoords[species].y_offset, ewram0_6, gUnknown_081FAF4C[2 * a0 + 1], species, pid);
LoadCompressedObjectPalette(GetMonSpritePalStruct(mon));
}
break;
@@ -460,7 +460,7 @@ static void CB2_EggHatch_0(void)
{
case 0:
REG_DISPCNT = 0;
- gEggHatchData = (struct EggHatchData*)(&ewram[0x18000]);
+ gEggHatchData = eEggHatchData;
gEggHatchData->eggPartyID = gSpecialVar_0x8004;
gEggHatchData->eggShardVelocityID = 0;
ResetTasks();
@@ -479,8 +479,8 @@ static void CB2_EggHatch_0(void)
break;
case 2:
LZDecompressVram(&gUnknown_08D00000, (void*)(VRAM));
- CpuSet(&gUnknown_08D00524, &ewram[0], 0x800);
- DmaCopy16(3, &ewram[0], (void*)(VRAM + 0x2800), 0x500);
+ CpuSet(&gUnknown_08D00524, ewram0_7, 0x800);
+ DmaCopy16(3, ewram0_7, (void*)(VRAM + 0x2800), 0x500);
LoadCompressedPalette(&gUnknown_08D004E0, 0, 0x20);
gMain.state++;
break;
diff --git a/src/scene/hall_of_fame.c b/src/scene/hall_of_fame.c
index 6f7df576b..72bd051da 100644
--- a/src/scene/hall_of_fame.c
+++ b/src/scene/hall_of_fame.c
@@ -17,10 +17,10 @@
#include "decompress.h"
#include "rng.h"
#include "trig.h"
+#include "ewram.h"
static EWRAM_DATA u32 sUnknown_0203931C = 0;
-extern u8 ewram[];
extern bool8 gUnknown_02039324; // has hall of fame records
extern void (*gGameContinueCallback)(void);
extern struct MusicPlayerInfo gMPlay_BGM;
@@ -156,69 +156,69 @@ static const struct OamData sOamData_840B598 =
void* const gUnknown_0840B5A0[] =
{
- &ewram[0x08000],
- &ewram[0x0A000],
- &ewram[0x0C000],
- &ewram[0x0E000],
- &ewram[0x10000],
- &ewram[0x14000],
- &ewram[0x18000]
+ ewram8000,
+ ewramA000,
+ ewramC000,
+ ewramE000,
+ ewram10000,
+ ewram14000,
+ ewram18000_2
};
static const struct SpriteFrameImage sSpriteImageTable_840B5BC[] =
{
- {&ewram[0x8000], 0x800},
- {&ewram[0x8800], 0x800},
- {&ewram[0x9000], 0x800},
- {&ewram[0x9800], 0x800}
+ {ewram8000, 0x800},
+ {ewram8800, 0x800},
+ {ewram9000, 0x800},
+ {ewram9800, 0x800}
};
static const struct SpriteFrameImage sSpriteImageTable_840B5DC[] =
{
- {&ewram[0xA000], 0x800},
- {&ewram[0xA800], 0x800},
- {&ewram[0xB000], 0x800},
- {&ewram[0xB800], 0x800}
+ {ewramA000, 0x800},
+ {ewramA800, 0x800},
+ {ewramB000, 0x800},
+ {ewramB800, 0x800}
};
static const struct SpriteFrameImage sSpriteImageTable_840B5FC[] =
{
- {&ewram[0xC000], 0x800},
- {&ewram[0xC800], 0x800},
- {&ewram[0xD000], 0x800},
- {&ewram[0xD800], 0x800}
+ {ewramC000, 0x800},
+ {ewramC800, 0x800},
+ {ewramD000, 0x800},
+ {ewramD800, 0x800}
};
static const struct SpriteFrameImage sSpriteImageTable_840B61C[] =
{
- {&ewram[0xE000], 0x800},
- {&ewram[0xE800], 0x800},
- {&ewram[0xF000], 0x800},
- {&ewram[0xF800], 0x800}
+ {ewramE000, 0x800},
+ {ewramE800, 0x800},
+ {ewramF000, 0x800},
+ {ewramF800, 0x800}
};
static const struct SpriteFrameImage sSpriteImageTable_840B63C[] =
{
- {&ewram[0x10000], 0x800},
- {&ewram[0x10800], 0x800},
- {&ewram[0x11000], 0x800},
- {&ewram[0x11800], 0x800}
+ {ewram10000, 0x800},
+ {ewram10800, 0x800},
+ {ewram11000, 0x800},
+ {ewram11800, 0x800}
};
static const struct SpriteFrameImage sSpriteImageTable_840B65C[] =
{
- {&ewram[0x14000], 0x800},
- {&ewram[0x14800], 0x800},
- {&ewram[0x15000], 0x800},
- {&ewram[0x15800], 0x800}
+ {ewram14000, 0x800},
+ {ewram14800, 0x800},
+ {ewram15000, 0x800},
+ {ewram15800, 0x800}
};
static const struct SpriteFrameImage sSpriteImageTable_840B67C[] =
{
- {&ewram[0x18000], 0x800},
- {&ewram[0x18800], 0x800},
- {&ewram[0x19000], 0x800},
- {&ewram[0x19800], 0x800}
+ {ewram18000_2, 0x800},
+ {ewram18800, 0x800},
+ {ewram19000, 0x800},
+ {ewram19800, 0x800}
};
static const struct SpriteFrameImage* const sUnknown_0840B69C[7] =
@@ -486,7 +486,7 @@ static void sub_8141FC4(void)
static void sub_8141FF8(u8 taskID)
{
u16 i, j;
- struct HallofFameMons* fameMons = (struct HallofFameMons*)(&ewram[0x1C000]);
+ struct HallofFameMons* fameMons = eHallOfFameMons1;
gTasks[taskID].tPokesNumber = 0; // valid pokes
for (i = 0; i < 6; i++)
@@ -530,13 +530,13 @@ static void sub_8141FF8(u8 taskID)
static void sub_814217C(u8 taskID)
{
u16 i;
- struct HallofFameMons* fameMons = (struct HallofFameMons*)(&ewram[0x1C000]);
- struct HallofFameMons* lastSavedTeam = (struct HallofFameMons*)(&ewram[0x1E000]);
+ struct HallofFameMons* fameMons = eHallOfFameMons1;
+ struct HallofFameMons* lastSavedTeam = eHallOfFameMons2;
if (gUnknown_02039324 == FALSE)
{
for (i = 0; i < 0x2000; i++)
- ewram[i + 0x1E000] = 0;
+ ewram1E000(i) = 0;
}
else
sub_8125EC8(3);
@@ -548,8 +548,8 @@ static void sub_814217C(u8 taskID)
}
if (i >= HALL_OF_FAME_MAX_TEAMS)
{
- struct HallofFameMons* r5 = (struct HallofFameMons*)(&ewram[0x1E000]);
- struct HallofFameMons* r6 = (struct HallofFameMons*)(&ewram[0x1E000]);
+ struct HallofFameMons* r5 = eHallOfFameMons2;
+ struct HallofFameMons* r6 = eHallOfFameMons2;
r5++;
for (i = 0; i < HALL_OF_FAME_MAX_TEAMS - 1; i++, r6++, r5++)
{
@@ -592,7 +592,7 @@ static void sub_8142320(u8 taskID)
u8 spriteID;
s16 xPos, yPos, field4, field6;
- struct HallofFameMons* fameMons = (struct HallofFameMons*)(&ewram[0x1C000]);
+ struct HallofFameMons* fameMons = eHallOfFameMons1;
u16 currPokeID = gTasks[taskID].tDisplayedPoke;
struct HallofFameMon* currMon = &fameMons->mons[currPokeID];
@@ -623,7 +623,7 @@ static void sub_8142320(u8 taskID)
static void sub_8142404(u8 taskID)
{
- struct HallofFameMons* fameMons = (struct HallofFameMons*)(&ewram[0x1C000]);
+ struct HallofFameMons* fameMons = eHallOfFameMons1;
u16 currPokeID = gTasks[taskID].tDisplayedPoke;
struct HallofFameMon* currMon = &fameMons->mons[currPokeID];
@@ -639,7 +639,7 @@ static void sub_8142404(u8 taskID)
static void sub_8142484(u8 taskID)
{
- struct HallofFameMons* fameMons = (struct HallofFameMons*)(&ewram[0x1C000]);
+ struct HallofFameMons* fameMons = eHallOfFameMons1;
u16 currPokeID = gTasks[taskID].tDisplayedPoke;
struct HallofFameMon* currMon = &fameMons->mons[currPokeID];
@@ -808,7 +808,7 @@ void sub_81428CC(void)
REG_BLDY = 0;
sub_81435B8();
- fameMons = (struct HallofFameMons*)(&ewram[0x1C000]);
+ fameMons = eHallOfFameMons1;
fameMons->mons[0] = sDummyFameMon;
sub_80C5CD4(fameMons);
@@ -847,7 +847,7 @@ static void sub_8142A28(u8 taskID)
u16 *vram1, *vram2;
u16 i;
- struct HallofFameMons* savedTeams = (struct HallofFameMons*)(&ewram[0x1E000]);
+ struct HallofFameMons* savedTeams = eHallOfFameMons2;
for (i = 0; i < HALL_OF_FAME_MAX_TEAMS; i++, savedTeams++)
{
if (savedTeams->mons[0].species == 0)
@@ -872,7 +872,7 @@ static void sub_8142A28(u8 taskID)
static void sub_8142B04(u8 taskID)
{
- struct HallofFameMons* savedTeams = (struct HallofFameMons*)(&ewram[0x1E000]);
+ struct HallofFameMons* savedTeams = eHallOfFameMons2;
struct HallofFameMon* currMon;
u16 i;
u8* stringPtr;
@@ -937,7 +937,7 @@ static void sub_8142B04(u8 taskID)
static void sub_8142CC8(u8 taskID)
{
- struct HallofFameMons* savedTeams = (struct HallofFameMons*)(&ewram[0x1E000]);
+ struct HallofFameMons* savedTeams = eHallOfFameMons2;
struct HallofFameMon* currMon;
u16 i;
u16 currMonID;
@@ -1025,7 +1025,7 @@ static void sub_8142F78(u8 taskID)
struct HallofFameMons* fameMons;
CpuSet(gPlttBufferFaded, gPlttBufferUnfaded, 0x200);
- fameMons = (struct HallofFameMons*)(&ewram[0x1C000]);
+ fameMons = eHallOfFameMons1;
fameMons->mons[0] = sDummyFameMon;
sub_80C5E38(fameMons);
gTasks[taskID].func = sub_8142FCC;
@@ -1258,7 +1258,7 @@ static void sub_81433E0(void)
*((u16*)(VRAM + 0x3000) + i) = 2;
}
- offsetWrite4 = (u32)(&ewram[0]);
+ offsetWrite4 = ewram0_6;
size4 = 0x4000;
while (TRUE)
{
diff --git a/src/scene/intro.c b/src/scene/intro.c
index af9b565a3..04173b86a 100644
--- a/src/scene/intro.c
+++ b/src/scene/intro.c
@@ -1207,6 +1207,7 @@ static void Task_IntroWaitToSetupPart3DoubleFight(u8 taskId)
gTasks[taskId].func = Task_IntroLoadPart3Streaks;
}
+// TODO: use ewram define instead
extern u8 ewram[][32];
static void Task_IntroLoadPart3Streaks(u8 taskId)