diff --git a/graphics/door_anims/abandoned_ship.png b/graphics/door_anims/abandoned_ship.png index e46aca9ba9..0030246b4e 100644 Binary files a/graphics/door_anims/abandoned_ship.png and b/graphics/door_anims/abandoned_ship.png differ diff --git a/graphics/door_anims/abandoned_ship_room.png b/graphics/door_anims/abandoned_ship_room.png index a5284af7e1..006922f5b6 100644 Binary files a/graphics/door_anims/abandoned_ship_room.png and b/graphics/door_anims/abandoned_ship_room.png differ diff --git a/graphics/door_anims/battle_arena.png b/graphics/door_anims/battle_arena.png index ef66528156..ad3350a595 100644 Binary files a/graphics/door_anims/battle_arena.png and b/graphics/door_anims/battle_arena.png differ diff --git a/graphics/door_anims/battle_arena_lobby.png b/graphics/door_anims/battle_arena_lobby.png index b9a2134e3f..78c344070c 100644 Binary files a/graphics/door_anims/battle_arena_lobby.png and b/graphics/door_anims/battle_arena_lobby.png differ diff --git a/graphics/door_anims/battle_dome.png b/graphics/door_anims/battle_dome.png index 729385b3fc..4bc9fab94b 100644 Binary files a/graphics/door_anims/battle_dome.png and b/graphics/door_anims/battle_dome.png differ diff --git a/graphics/door_anims/battle_dome_corridor.png b/graphics/door_anims/battle_dome_corridor.png index 198ad9acca..78e77869ea 100644 Binary files a/graphics/door_anims/battle_dome_corridor.png and b/graphics/door_anims/battle_dome_corridor.png differ diff --git a/graphics/door_anims/battle_dome_lobby.png b/graphics/door_anims/battle_dome_lobby.png index bd4e4e895b..631cdecced 100644 Binary files a/graphics/door_anims/battle_dome_lobby.png and b/graphics/door_anims/battle_dome_lobby.png differ diff --git a/graphics/door_anims/battle_factory.png b/graphics/door_anims/battle_factory.png index 7ed6c876b8..1d74d8b580 100644 Binary files a/graphics/door_anims/battle_factory.png and b/graphics/door_anims/battle_factory.png differ diff --git a/graphics/door_anims/battle_frontier.png b/graphics/door_anims/battle_frontier.png index bf758c03ed..c3dcd43245 100644 Binary files a/graphics/door_anims/battle_frontier.png and b/graphics/door_anims/battle_frontier.png differ diff --git a/graphics/door_anims/battle_frontier_sliding.png b/graphics/door_anims/battle_frontier_sliding.png index a43cf519dd..1359f4725b 100644 Binary files a/graphics/door_anims/battle_frontier_sliding.png and b/graphics/door_anims/battle_frontier_sliding.png differ diff --git a/graphics/door_anims/battle_palace_lobby.png b/graphics/door_anims/battle_palace_lobby.png index f106ae960d..a4aa998d46 100644 Binary files a/graphics/door_anims/battle_palace_lobby.png and b/graphics/door_anims/battle_palace_lobby.png differ diff --git a/graphics/door_anims/battle_tent.png b/graphics/door_anims/battle_tent.png index a0a88e4c5f..b278e33109 100644 Binary files a/graphics/door_anims/battle_tent.png and b/graphics/door_anims/battle_tent.png differ diff --git a/graphics/door_anims/battle_tent_interior.png b/graphics/door_anims/battle_tent_interior.png index f8edb5a1a3..036ec9d5aa 100644 Binary files a/graphics/door_anims/battle_tent_interior.png and b/graphics/door_anims/battle_tent_interior.png differ diff --git a/graphics/door_anims/battle_tower.png b/graphics/door_anims/battle_tower.png index 3b9fe547c1..3ec2b59bb6 100644 Binary files a/graphics/door_anims/battle_tower.png and b/graphics/door_anims/battle_tower.png differ diff --git a/graphics/door_anims/battle_tower_corridor.png b/graphics/door_anims/battle_tower_corridor.png deleted file mode 100644 index 06ad24c9fc..0000000000 Binary files a/graphics/door_anims/battle_tower_corridor.png and /dev/null differ diff --git a/graphics/door_anims/battle_tower_elevator.png b/graphics/door_anims/battle_tower_elevator.png index 1d95b5b6aa..fed07182e2 100644 Binary files a/graphics/door_anims/battle_tower_elevator.png and b/graphics/door_anims/battle_tower_elevator.png differ diff --git a/graphics/door_anims/battle_tower_multi_corridor.png b/graphics/door_anims/battle_tower_multi_corridor.png index 145dea7a50..cb32fbc70b 100644 Binary files a/graphics/door_anims/battle_tower_multi_corridor.png and b/graphics/door_anims/battle_tower_multi_corridor.png differ diff --git a/graphics/door_anims/battle_tower_old.png b/graphics/door_anims/battle_tower_old.png index 645c006138..326763f565 100644 Binary files a/graphics/door_anims/battle_tower_old.png and b/graphics/door_anims/battle_tower_old.png differ diff --git a/graphics/door_anims/birchs_lab.png b/graphics/door_anims/birchs_lab.png index 69bd93f890..0df0383c92 100644 Binary files a/graphics/door_anims/birchs_lab.png and b/graphics/door_anims/birchs_lab.png differ diff --git a/graphics/door_anims/cable_club.png b/graphics/door_anims/cable_club.png index a1dfd7bc27..3b45cb1010 100644 Binary files a/graphics/door_anims/cable_club.png and b/graphics/door_anims/cable_club.png differ diff --git a/graphics/door_anims/contest.png b/graphics/door_anims/contest.png index dc466be116..8719b23ad4 100644 Binary files a/graphics/door_anims/contest.png and b/graphics/door_anims/contest.png differ diff --git a/graphics/door_anims/cycling_road.png b/graphics/door_anims/cycling_road.png index 0c22c91823..cb1fb30343 100644 Binary files a/graphics/door_anims/cycling_road.png and b/graphics/door_anims/cycling_road.png differ diff --git a/graphics/door_anims/fallarbor_light_roof.png b/graphics/door_anims/fallarbor_light_roof.png index 4c81ba10e7..a4c959f883 100644 Binary files a/graphics/door_anims/fallarbor_light_roof.png and b/graphics/door_anims/fallarbor_light_roof.png differ diff --git a/graphics/door_anims/general.png b/graphics/door_anims/general.png index fdab84132b..7c9b7d64dc 100644 Binary files a/graphics/door_anims/general.png and b/graphics/door_anims/general.png differ diff --git a/graphics/door_anims/gym.png b/graphics/door_anims/gym.png index fce0007514..065181a9d9 100644 Binary files a/graphics/door_anims/gym.png and b/graphics/door_anims/gym.png differ diff --git a/graphics/door_anims/lilycove.png b/graphics/door_anims/lilycove.png index ad5e43cc35..17a120a325 100644 Binary files a/graphics/door_anims/lilycove.png and b/graphics/door_anims/lilycove.png differ diff --git a/graphics/door_anims/lilycove_dept_store.png b/graphics/door_anims/lilycove_dept_store.png index 4f036c51db..7c64ab6da8 100644 Binary files a/graphics/door_anims/lilycove_dept_store.png and b/graphics/door_anims/lilycove_dept_store.png differ diff --git a/graphics/door_anims/lilycove_wooden.png b/graphics/door_anims/lilycove_wooden.png index 99b94e72db..7c3680c289 100644 Binary files a/graphics/door_anims/lilycove_wooden.png and b/graphics/door_anims/lilycove_wooden.png differ diff --git a/graphics/door_anims/mauville.png b/graphics/door_anims/mauville.png index 63167408ad..fec5f344fb 100644 Binary files a/graphics/door_anims/mauville.png and b/graphics/door_anims/mauville.png differ diff --git a/graphics/door_anims/mossdeep_space_center.png b/graphics/door_anims/mossdeep_space_center.png index 4f2ccb6ffd..c778b17183 100644 Binary files a/graphics/door_anims/mossdeep_space_center.png and b/graphics/door_anims/mossdeep_space_center.png differ diff --git a/graphics/door_anims/pacifidlog.png b/graphics/door_anims/pacifidlog.png index 3e05288255..841c31658d 100644 Binary files a/graphics/door_anims/pacifidlog.png and b/graphics/door_anims/pacifidlog.png differ diff --git a/graphics/door_anims/petalburg_gym.png b/graphics/door_anims/petalburg_gym.png new file mode 100644 index 0000000000..42a1e1dfde Binary files /dev/null and b/graphics/door_anims/petalburg_gym.png differ diff --git a/graphics/door_anims/poke_center.png b/graphics/door_anims/poke_center.png index 8658107149..8bf5cb146d 100644 Binary files a/graphics/door_anims/poke_center.png and b/graphics/door_anims/poke_center.png differ diff --git a/graphics/door_anims/pokemon_league.png b/graphics/door_anims/pokemon_league.png index cac740f561..34419ac0ad 100644 Binary files a/graphics/door_anims/pokemon_league.png and b/graphics/door_anims/pokemon_league.png differ diff --git a/graphics/door_anims/rustboro_gray.png b/graphics/door_anims/rustboro_gray.png index 2cf62b6dac..99211c11a9 100644 Binary files a/graphics/door_anims/rustboro_gray.png and b/graphics/door_anims/rustboro_gray.png differ diff --git a/graphics/door_anims/rustboro_tan.png b/graphics/door_anims/rustboro_tan.png index d8a1b185e7..7a0ba149c6 100644 Binary files a/graphics/door_anims/rustboro_tan.png and b/graphics/door_anims/rustboro_tan.png differ diff --git a/graphics/door_anims/safari_zone.png b/graphics/door_anims/safari_zone.png index 89807f843f..eae6a0e3e5 100644 Binary files a/graphics/door_anims/safari_zone.png and b/graphics/door_anims/safari_zone.png differ diff --git a/graphics/door_anims/sootopolis.png b/graphics/door_anims/sootopolis.png index faac1f59db..3b3833daaa 100644 Binary files a/graphics/door_anims/sootopolis.png and b/graphics/door_anims/sootopolis.png differ diff --git a/graphics/door_anims/sootopolis_peaked_roof.png b/graphics/door_anims/sootopolis_peaked_roof.png index b4ccfb5f99..7d8ea1f33e 100644 Binary files a/graphics/door_anims/sootopolis_peaked_roof.png and b/graphics/door_anims/sootopolis_peaked_roof.png differ diff --git a/graphics/door_anims/trainer_hill_lobby_elevator.png b/graphics/door_anims/trainer_hill_lobby_elevator.png index aeb7eaf260..bdd1c3b271 100644 Binary files a/graphics/door_anims/trainer_hill_lobby_elevator.png and b/graphics/door_anims/trainer_hill_lobby_elevator.png differ diff --git a/graphics/door_anims/unknown.png b/graphics/door_anims/unused_battle_frontier.png similarity index 100% rename from graphics/door_anims/unknown.png rename to graphics/door_anims/unused_battle_frontier.png diff --git a/include/constants/metatile_labels.h b/include/constants/metatile_labels.h index 3c484e39a2..ff10f52ee1 100644 --- a/include/constants/metatile_labels.h +++ b/include/constants/metatile_labels.h @@ -99,6 +99,7 @@ #define METATILE_PetalburgGym_SlidingDoor_Frame2 0x21A #define METATILE_PetalburgGym_SlidingDoor_Frame3 0x21B #define METATILE_PetalburgGym_SlidingDoor_Frame4 0x21C +#define METATILE_PetalburgGym_Door 0x224 // gTileset_MossdeepGym from R/S #define METATILE_RS_MossdeepGym_RedArrow_Right 0x204 @@ -128,7 +129,6 @@ // gTileset_BattleFrontier #define METATILE_BattleFrontier_Door_Elevator 0x20E -#define METATILE_BattleFrontier_Door_Corridor 0x224 #define METATILE_BattleFrontier_Door_MultiCorridor 0x2AD #define METATILE_BattleFrontier_CorridorOpenDoor_Top 0x207 #define METATILE_BattleFrontier_CorridorOpenDoor_Bottom 0x20F diff --git a/spritesheet_rules.mk b/spritesheet_rules.mk index 9fb184638a..87293669c7 100644 --- a/spritesheet_rules.mk +++ b/spritesheet_rules.mk @@ -674,3 +674,6 @@ $(FLDEFFGFXDIR)/secret_power_tree.4bpp: %.4bpp: %.png $(FLDEFFGFXDIR)/record_mix_lights.4bpp: %.4bpp: %.png $(GFX) $< $@ -mwidth 4 -mheight 1 + +graphics/door_anims/battle_tower_multi_corridor.4bpp: %.4bpp: %.png + $(GFX) $< $@ -mwidth 2 -mheight 4 diff --git a/src/field_camera.c b/src/field_camera.c index 0a00dcbee9..ae7b2bbb16 100644 --- a/src/field_camera.c +++ b/src/field_camera.c @@ -212,13 +212,13 @@ void CurrentMapDrawMetatileAt(int x, int y) } } -void DrawDoorMetatileAt(int x, int y, u16 *arr) +void DrawDoorMetatileAt(int x, int y, u16 *tiles) { int offset = MapPosToBgTilemapOffset(&sFieldCameraOffset, x, y); if (offset >= 0) { - DrawMetatile(METATILE_LAYER_TYPE_COVERED, arr, offset); + DrawMetatile(METATILE_LAYER_TYPE_COVERED, tiles, offset); sFieldCameraOffset.copyBGToVRAM = TRUE; } } diff --git a/src/field_door.c b/src/field_door.c index 988ea615d0..756d0dabf1 100644 --- a/src/field_door.c +++ b/src/field_door.c @@ -18,7 +18,7 @@ struct DoorGraphics u8 sound; u8 size; const void *tiles; - const void *palette; + const void *palettes; }; struct DoorAnimFrame @@ -74,7 +74,7 @@ static const u8 sDoorAnimTiles_PokemonLeague[] = INCBIN_U8("graphics/door_anims/ static const u16 sDoorNullPalette20[16] = {}; static const u8 sDoorAnimTiles_Pacifidlog[] = INCBIN_U8("graphics/door_anims/pacifidlog.4bpp"); static const u16 sDoorNullPalette21[16] = {}; -static const u8 sDoorAnimTiles_BattleTowerCorridor[] = INCBIN_U8("graphics/door_anims/battle_tower_corridor.4bpp"); +static const u8 sDoorAnimTiles_PetalburgGym[] = INCBIN_U8("graphics/door_anims/petalburg_gym.4bpp"); static const u16 sDoorNullPalette22[16] = {}; static const u8 sDoorAnimTiles_CyclingRoad[] = INCBIN_U8("graphics/door_anims/cycling_road.4bpp"); static const u16 sDoorNullPalette23[16] = {}; @@ -98,7 +98,7 @@ static const u8 sDoorAnimTiles_BattleTowerOld[] = INCBIN_U8("graphics/door_anims static const u16 sDoorNullPalette32[16] = {}; static const u8 sDoorAnimTiles_BattleTowerElevator[] = INCBIN_U8("graphics/door_anims/battle_tower_elevator.4bpp"); static const u16 sDoorNullPalette33[16] = {}; -static const u8 sDoorAnimTiles_34[] = INCBIN_U8("graphics/door_anims/unknown.4bpp"); +static const u8 sDoorAnimTiles_UnusedBattleFrontier[] = INCBIN_U8("graphics/door_anims/unused_battle_frontier.4bpp"); static const u16 sDoorNullPalette34[16] = {}; static const u8 sDoorAnimTiles_BattleDome[] = INCBIN_U8("graphics/door_anims/battle_dome.4bpp"); static const u16 sDoorNullPalette35[16] = {}; @@ -190,7 +190,7 @@ static const u8 sDoorAnimPalettes_Mauville[] = {7, 7, 7, 7, 7, 7, 7, 7}; static const u8 sDoorAnimPalettes_Verdanturf[] = {6, 6, 5, 5, 5, 5, 5, 5}; static const u8 sDoorAnimPalettes_LilycoveWooden[] = {5, 5, 5, 5, 5, 5, 5, 5}; static const u8 sDoorAnimPalettes_Contest[] = {1, 1, 1, 1, 1, 1, 1, 1}; -static const u8 sDoorAnimPalettes_BattleTowerCorridor[] = {6, 6, 6, 6, 6, 6, 6, 6}; +static const u8 sDoorAnimPalettes_PetalburgGym[] = {6, 6, 6, 6, 6, 6, 6, 6}; static const u8 sDoorAnimPalettes_CyclingRoad[] = {7, 7, 7, 7, 7, 7, 7, 7}; static const u8 sDoorAnimPalettes_LilycoveDeptStore[] = {5, 5, 5, 5, 5, 5, 5, 5}; static const u8 sDoorAnimPalettes_SafariZone[] = {9, 9, 9, 9, 9, 9, 9, 9}; @@ -202,7 +202,7 @@ static const u8 sDoorAnimPalettes_AbandonedShipRoom[] = {7, 7, 7, 7, 7, 7, 7, 7} static const u8 sDoorAnimPalettes_LilycoveDeptStoreElevator[] = {6, 6, 7, 7, 7, 7, 7, 7}; static const u8 sDoorAnimPalettes_BattleTowerOld[] = {9, 9, 9, 9, 9, 9, 9, 9}; static const u8 sDoorAnimPalettes_BattleTowerElevator[] = {7, 7, 7, 7, 7, 7, 7, 7}; -static const u8 sDoorAnimPalettes_34[] = {9, 9, 9, 9, 9, 9, 9, 9}; +static const u8 sDoorAnimPalettes_UnusedBattleFrontier[] = {9, 9, 9, 9, 9, 9, 9, 9}; static const u8 sDoorAnimPalettes_BattleDome[] = {1, 1, 1, 1, 1, 1, 1, 1}; static const u8 sDoorAnimPalettes_BattleFactory[] = {9, 9, 9, 9, 9, 9, 9, 9}; static const u8 sDoorAnimPalettes_BattleTower[] = {0, 0, 0, 0, 0, 0, 0, 0}; @@ -244,7 +244,7 @@ static const struct DoorGraphics sDoorAnimGraphicsTable[] = {METATILE_Sootopolis_Door, DOOR_SOUND_NORMAL, 1, sDoorAnimTiles_Sootopolis, sDoorAnimPalettes_Sootopolis}, {METATILE_EverGrande_Door_PokemonLeague, DOOR_SOUND_SLIDING, 1, sDoorAnimTiles_PokemonLeague, sDoorAnimPalettes_PokemonLeague}, {METATILE_Pacifidlog_Door, DOOR_SOUND_NORMAL, 1, sDoorAnimTiles_Pacifidlog, sDoorAnimPalettes_Pacifidlog}, - {METATILE_BattleFrontier_Door_Corridor, DOOR_SOUND_NORMAL, 1, sDoorAnimTiles_BattleTowerCorridor, sDoorAnimPalettes_BattleTowerCorridor}, + {METATILE_PetalburgGym_Door, DOOR_SOUND_NORMAL, 1, sDoorAnimTiles_PetalburgGym, sDoorAnimPalettes_PetalburgGym}, {METATILE_Mauville_Door_CyclingRoad, DOOR_SOUND_NORMAL, 1, sDoorAnimTiles_CyclingRoad, sDoorAnimPalettes_CyclingRoad}, {METATILE_Lilycove_Door_DeptStore, DOOR_SOUND_SLIDING, 1, sDoorAnimTiles_LilycoveDeptStore, sDoorAnimPalettes_LilycoveDeptStore}, {METATILE_Lilycove_Door_SafariZone, DOOR_SOUND_SLIDING, 1, sDoorAnimTiles_SafariZone, sDoorAnimPalettes_SafariZone}, @@ -256,7 +256,9 @@ static const struct DoorGraphics sDoorAnimGraphicsTable[] = {METATILE_Shop_Door_Elevator, DOOR_SOUND_SLIDING, 1, sDoorAnimTiles_LilycoveDeptStoreElevator, sDoorAnimPalettes_LilycoveDeptStoreElevator}, {METATILE_Dewford_Door_BattleTower, DOOR_SOUND_SLIDING, 1, sDoorAnimTiles_BattleTowerOld, sDoorAnimPalettes_BattleTowerOld}, {METATILE_BattleFrontier_Door_Elevator, DOOR_SOUND_SLIDING, 1, sDoorAnimTiles_BattleTowerElevator, sDoorAnimPalettes_BattleTowerElevator}, - {0x3B0, /* TODO: Missing metatile ID */ DOOR_SOUND_SLIDING, 1, sDoorAnimTiles_34, sDoorAnimPalettes_34}, + // The metatile for this door doesn't seem to correspond to a door in any Emerald tileset. Given the surrounding door animations, it was likely cut from the Battle Frontier. + // From the palettes array we know it uses palette 9, and the door's shadow looks correct using either the Battle Tent or Battle Frontier Outside's 9th palette. + {0x3B0, DOOR_SOUND_SLIDING, 1, sDoorAnimTiles_UnusedBattleFrontier, sDoorAnimPalettes_UnusedBattleFrontier}, {METATILE_BattleFrontierOutsideWest_Door_BattleDome, DOOR_SOUND_SLIDING, 1, sDoorAnimTiles_BattleDome, sDoorAnimPalettes_BattleDome}, {METATILE_BattleFrontierOutsideWest_Door_BattleFactory, DOOR_SOUND_SLIDING, 1, sDoorAnimTiles_BattleFactory, sDoorAnimPalettes_BattleFactory}, {METATILE_BattleFrontierOutsideEast_Door_BattleTower, DOOR_SOUND_SLIDING, 1, sDoorAnimTiles_BattleTower, sDoorAnimPalettes_BattleTower}, @@ -278,52 +280,71 @@ static const struct DoorGraphics sDoorAnimGraphicsTable[] = {}, }; +// NOTE: The tiles of a door's animation must be copied to VRAM because they are not already part of any given tileset. +// This means that if there are any pre-existing tiles in this copied region that are visible when the door +// animation is played they will be overwritten. +#define DOOR_TILE_START_SIZE1 (NUM_TILES_TOTAL - 8) +#define DOOR_TILE_START_SIZE2 (NUM_TILES_TOTAL - 16) + static void CopyDoorTilesToVram(const struct DoorGraphics *gfx, const struct DoorAnimFrame *frame) { if (gfx->size == 2) - CpuFastSet(gfx->tiles + frame->offset, (void *)(VRAM + 0x7E00), 0x80); + CpuFastCopy(gfx->tiles + frame->offset, (void *)(VRAM + TILE_OFFSET_4BPP(DOOR_TILE_START_SIZE2)), 16 * TILE_SIZE_4BPP); else - CpuFastSet(gfx->tiles + frame->offset, (void *)(VRAM + 0x7F00), 0x40); + CpuFastCopy(gfx->tiles + frame->offset, (void *)(VRAM + TILE_OFFSET_4BPP(DOOR_TILE_START_SIZE1)), 8 * TILE_SIZE_4BPP); } -static void door_build_blockdef(u16 *a, u16 b, const u8 *c) +static void BuildDoorTiles(u16 *tiles, u16 tileNum, const u8 *paletteNums) { int i; - u16 unk; + u16 tile; + // Only the first 4 tiles of each metatile (bottom layer) actually use the door tiles for (i = 0; i < 4; i++) { - unk = *(c++) << 12; - a[i] = unk | (b + i); + tile = *(paletteNums++) << 12; + tiles[i] = tile | (tileNum + i); } + + // The remaining layers are left as tile 0 (with the same palette) for (; i < 8; i++) { - unk = *(c++) << 12; - a[i] = unk; + tile = *(paletteNums++) << 12; + tiles[i] = tile; } } -static void DrawCurrentDoorAnimFrame(const struct DoorGraphics *gfx, u32 x, u32 y, const u8 *pal) +static void DrawCurrentDoorAnimFrame(const struct DoorGraphics *gfx, u32 x, u32 y, const u8 *paletteNums) { - u16 arr[24]; + u16 tiles[24]; if (gfx->size == 2) { - door_build_blockdef(&arr[8], 0x3F0, pal); - DrawDoorMetatileAt(x, y - 1, &arr[8]); - door_build_blockdef(&arr[8], 0x3F4, pal + 4); - DrawDoorMetatileAt(x, y, &arr[8]); - door_build_blockdef(&arr[8], 0x3F8, pal); - DrawDoorMetatileAt(x + 1, y - 1, &arr[8]); - door_build_blockdef(&arr[8], 0x3FC, pal + 4); - DrawDoorMetatileAt(x + 1, y, &arr[8]); + // Top left metatile + BuildDoorTiles(&tiles[8], DOOR_TILE_START_SIZE2 + 0, &paletteNums[0]); + DrawDoorMetatileAt(x, y - 1, &tiles[8]); + + // Bottom left metatile + BuildDoorTiles(&tiles[8], DOOR_TILE_START_SIZE2 + 4, &paletteNums[4]); + DrawDoorMetatileAt(x, y, &tiles[8]); + + // Top right metatile + BuildDoorTiles(&tiles[8], DOOR_TILE_START_SIZE2 + 8, &paletteNums[0]); + DrawDoorMetatileAt(x + 1, y - 1, &tiles[8]); + + // Bottom right metatile + BuildDoorTiles(&tiles[8], DOOR_TILE_START_SIZE2 + 12, &paletteNums[4]); + DrawDoorMetatileAt(x + 1, y, &tiles[8]); } else { - door_build_blockdef(&arr[0], 0x3F8, pal); - DrawDoorMetatileAt(x, y - 1, &arr[0]); - door_build_blockdef(&arr[0], 0x3FC, pal + 4); - DrawDoorMetatileAt(x, y, &arr[0]); + // Top metatile + BuildDoorTiles(&tiles[0], DOOR_TILE_START_SIZE1 + 0, &paletteNums[0]); + DrawDoorMetatileAt(x, y - 1, &tiles[0]); + + // Bottom metatile + BuildDoorTiles(&tiles[0], DOOR_TILE_START_SIZE1 + 4, &paletteNums[4]); + DrawDoorMetatileAt(x, y, &tiles[0]); } } @@ -350,9 +371,9 @@ static void DrawDoor(const struct DoorGraphics *gfx, const struct DoorAnimFrame else { CopyDoorTilesToVram(gfx, frame); - DrawCurrentDoorAnimFrame(gfx, x, y, gfx->palette); + DrawCurrentDoorAnimFrame(gfx, x, y, gfx->palettes); if (ShouldUseMultiCorridorDoor()) - DrawCurrentDoorAnimFrame(gfx, gSpecialVar_0x8004 + MAP_OFFSET, gSpecialVar_0x8005 + MAP_OFFSET, gfx->palette); + DrawCurrentDoorAnimFrame(gfx, gSpecialVar_0x8004 + MAP_OFFSET, gSpecialVar_0x8005 + MAP_OFFSET, gfx->palettes); } }