summaryrefslogtreecommitdiff
path: root/src/fieldmap.c
diff options
context:
space:
mode:
authorPikalaxALT <PikalaxALT@users.noreply.github.com>2020-03-16 07:51:08 -0400
committerGitHub <noreply@github.com>2020-03-16 07:51:08 -0400
commitf44f89a463d7280a95094e8f37a56873a90da843 (patch)
tree194662b15b39fb223bd20b17ea696ff525ebab0d /src/fieldmap.c
parent4a7c1d888a9f90b9102f469aab12beeab89ffff6 (diff)
parente1f7efb8e67fb5587a8baf20f421c20e134e8b24 (diff)
Merge pull request #300 from ultima-soul/event_object_movement
Decompile/port event_object_movement
Diffstat (limited to 'src/fieldmap.c')
-rw-r--r--src/fieldmap.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/fieldmap.c b/src/fieldmap.c
index d7fe28c84..3d308f165 100644
--- a/src/fieldmap.c
+++ b/src/fieldmap.c
@@ -28,7 +28,7 @@ static bool8 sub_8059658(u8 direction, s32 x, s32 y, struct MapConnection *conne
static bool8 sub_80596BC(s32 x, s32 src_width, s32 dest_width, s32 offset);
struct BackupMapLayout VMap;
-static EWRAM_DATA u16 gBackupMapLayout[VIRTUAL_MAP_SIZE] = {};
+EWRAM_DATA u16 gBackupMapData[VIRTUAL_MAP_SIZE] = {};
EWRAM_DATA struct MapHeader gMapHeader = {};
EWRAM_DATA struct Camera gCamera = {};
static EWRAM_DATA struct ConnectionFlags gMapConnectionFlags = {};
@@ -79,8 +79,8 @@ void InitMapFromSavedGame(void)
static void InitMapLayoutData(struct MapHeader * mapHeader)
{
const struct MapLayout * mapLayout = mapHeader->mapLayout;
- CpuFastFill(0x03FF03FF, gBackupMapLayout, sizeof(gBackupMapLayout));
- VMap.map = gBackupMapLayout;
+ CpuFastFill(0x03FF03FF, gBackupMapData, sizeof(gBackupMapData));
+ VMap.map = gBackupMapData;
VMap.Xsize = mapLayout->width + 15;
VMap.Ysize = mapLayout->height + 14;
AGB_ASSERT_EX(VMap.Xsize * VMap.Ysize <= VIRTUAL_MAP_SIZE, ABSPATH("fieldmap.c"), 158);
@@ -458,7 +458,7 @@ u32 MapGridGetMetatileAttributeAt(s16 x, s16 y, u8 attr)
return GetBehaviorByMetatileIdAndMapLayout(gMapHeader.mapLayout, metatileId, attr);
}
-u32 MapGridGetMetatileBehaviorAt(s32 x, s32 y)
+u32 MapGridGetMetatileBehaviorAt(s16 x, s16 y)
{
return MapGridGetMetatileAttributeAt(x, y, 0);
}
@@ -540,7 +540,7 @@ void save_serialize_map(void)
{
for (j = x; j < x + 15; j++)
{
- *mapView++ = gBackupMapLayout[width * i + j];
+ *mapView++ = gBackupMapData[width * i + j];
}
}
}
@@ -581,7 +581,7 @@ static void LoadSavedMapView(void)
{
for (j = x; j < x + 15; j++)
{
- gBackupMapLayout[j + width * i] = *mapView;
+ gBackupMapData[j + width * i] = *mapView;
mapView++;
}
}
@@ -636,7 +636,7 @@ static void sub_8059250(u8 a1)
desti = width * (y + y0);
srci = (y + r8) * 15 + r9;
src = &mapView[srci + i];
- dest = &gBackupMapLayout[x0 + desti + j];
+ dest = &gBackupMapData[x0 + desti + j];
*dest = *src;
i++;
j++;