Add const data and pksdir to dungeon map

This commit is contained in:
DizzyEggg 2025-03-08 19:14:00 +01:00
parent 2c79110bad
commit e3df01cece
5 changed files with 117 additions and 97 deletions

View File

@ -2,76 +2,6 @@
.section .rodata
#.incbin "baserom.gba", 0xF59C4, 0x4
.string "pksdir0\0"
.global gUnknown_80F6490
gUnknown_80F6490: @ 80F6490
@ replacing .incbin "baserom.gba", 0x000f6490, 0x24
.byte 0x00, 0x00, 0x00, 0x0
.byte 0x0f, 0x00, 0x00, 0x00
.byte 0xff, 0x00, 0x00, 0x00
.byte 0xff, 0x0f, 0x00, 0x00
.byte 0xff, 0xff, 0x00, 0x00
.byte 0xff, 0xff, 0x0f, 0x00
.byte 0xff, 0xff, 0xff, 0x00
.byte 0xff, 0xff, 0xff, 0x0f
.byte 0xff, 0xff, 0xff, 0xff
.global gUnknown_80F64B4
gUnknown_80F64B4: @ 80F64B4
@ replacing .incbin "baserom.gba", 0x000f64b4, 0x24
.byte 0x5a, 0x00, 0x00, 0x00
.byte 0x50, 0x00, 0x00, 0x00
.byte 0x46, 0x00, 0x00, 0x00
.byte 0x3c, 0x00, 0x00, 0x00
.byte 0x32, 0x00, 0x00, 0x00
.byte 0x28, 0x00, 0x00, 0x00
.byte 0x1e, 0x00, 0x00, 0x00
.byte 0x14, 0x00, 0x00, 0x00
.byte 0x0a, 0x00, 0x00, 0x00
.global gUnknown_80F64D8
gUnknown_80F64D8: @ 80F64D8
@ replacing .incbin "baserom.gba", 0x000f64d8, 0x24
.byte 0x91, 0xf2, 0x90, 0xf2, 0x8f, 0xf2, 0x8e, 0xf2, 0x8d, 0xf2, 0x8c, 0xf2, 0x8b, 0xf2, 0x8a, 0xf2, 0x89, 0xf2, 0xc8, 0xf2, 0xc7, 0xf2, 0xc6, 0xf2, 0xc5, 0xf2, 0xc4, 0xf2, 0xc3, 0xf2, 0xc2, 0xf2
.byte 0xc1, 0xf2, 0xc0, 0xf2
.global gUnknown_80F64FC
gUnknown_80F64FC: @ 80F64FC
@ replacing .incbin "baserom.gba", 0x000f64fc, 0x24
.byte 0x84, 0x03, 0x00, 0x00, 0x20, 0x03, 0x00, 0x00, 0xbc, 0x02, 0x00, 0x00, 0x58, 0x02, 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, 0x90, 0x01, 0x00, 0x00, 0x2c, 0x01, 0x00, 0x00, 0xc8, 0x00, 0x00, 0x00
.byte 0x64, 0x00, 0x00, 0x00
.global gUnknown_80F6520
gUnknown_80F6520: @ 80F6520
@ replacing .incbin "baserom.gba", 0x000f6520, 0x24
.byte 0x5a, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x46, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00
.byte 0x0a, 0x00, 0x00, 0x00
.global gUnknown_80F6544
gUnknown_80F6544: @ 80F6544
@ replacing .incbin "baserom.gba", 0x000f6544, 0x24
.byte 0x91, 0xf2, 0x90, 0xf2, 0x8f, 0xf2, 0x8e, 0xf2, 0x8d, 0xf2, 0x8c, 0xf2, 0x8b, 0xf2, 0x8a, 0xf2, 0x89, 0xf2, 0xc8, 0xf2, 0xc7, 0xf2, 0xc6, 0xf2, 0xc5, 0xf2, 0xc4, 0xf2, 0xc3, 0xf2, 0xc2, 0xf2
.byte 0xc1, 0xf2, 0xc0, 0xf2
.global gUnknown_80F6568
gUnknown_80F6568: @ 80F6568
@ replacing .incbin "baserom.gba", 0x000f6568, 0x88
.byte 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff
.byte 0x01, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0x02, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0x02, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0x02, 0x00, 0x00, 0x00, 0xfd, 0xff, 0xff, 0xff
.byte 0x03, 0x00, 0x00, 0x00, 0xfd, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0xfd, 0xff, 0xff, 0xff, 0x04, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0x04, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff
.byte 0x04, 0x00, 0x00, 0x00, 0xfb, 0xff, 0xff, 0xff, 0x04, 0x00, 0x00, 0x00, 0xfb, 0xff, 0xff, 0xff, 0x04, 0x00, 0x00, 0x00, 0xfb, 0xff, 0xff, 0xff, 0x04, 0x00, 0x00, 0x00, 0xfb, 0xff, 0xff, 0xff
.byte 0x70, 0x6b, 0x73, 0x64, 0x69, 0x72, 0x30, 0x00
.global gUnknown_80F65F0
gUnknown_80F65F0: @ 80F65F0
@ replacing .incbin "baserom.gba", 0x000f65f0, 0x14
.byte 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x07, 0x04, 0x04
.global gUnknown_80F6604
gUnknown_80F6604: @ 80F6604
@ replacing .incbin "baserom.gba", 0x000f6604, 0x20
.string "zmappat\0"
.string "pksdir0\0"
.string "pksdir0\0"
.string "pksdir0\0"

62
data/data_80F59C8_0.s Normal file
View File

@ -0,0 +1,62 @@
#include "constants/status.h"
.section .rodata
#.incbin "baserom.gba", 0xF59C4, 0x4
.string "pksdir0\0"
.global gUnknown_80F6490
gUnknown_80F6490: @ 80F6490
@ replacing .incbin "baserom.gba", 0x000f6490, 0x24
.byte 0x00, 0x00, 0x00, 0x0
.byte 0x0f, 0x00, 0x00, 0x00
.byte 0xff, 0x00, 0x00, 0x00
.byte 0xff, 0x0f, 0x00, 0x00
.byte 0xff, 0xff, 0x00, 0x00
.byte 0xff, 0xff, 0x0f, 0x00
.byte 0xff, 0xff, 0xff, 0x00
.byte 0xff, 0xff, 0xff, 0x0f
.byte 0xff, 0xff, 0xff, 0xff
.global gUnknown_80F64B4
gUnknown_80F64B4: @ 80F64B4
@ replacing .incbin "baserom.gba", 0x000f64b4, 0x24
.byte 0x5a, 0x00, 0x00, 0x00
.byte 0x50, 0x00, 0x00, 0x00
.byte 0x46, 0x00, 0x00, 0x00
.byte 0x3c, 0x00, 0x00, 0x00
.byte 0x32, 0x00, 0x00, 0x00
.byte 0x28, 0x00, 0x00, 0x00
.byte 0x1e, 0x00, 0x00, 0x00
.byte 0x14, 0x00, 0x00, 0x00
.byte 0x0a, 0x00, 0x00, 0x00
.global gUnknown_80F64D8
gUnknown_80F64D8: @ 80F64D8
@ replacing .incbin "baserom.gba", 0x000f64d8, 0x24
.byte 0x91, 0xf2, 0x90, 0xf2, 0x8f, 0xf2, 0x8e, 0xf2, 0x8d, 0xf2, 0x8c, 0xf2, 0x8b, 0xf2, 0x8a, 0xf2, 0x89, 0xf2, 0xc8, 0xf2, 0xc7, 0xf2, 0xc6, 0xf2, 0xc5, 0xf2, 0xc4, 0xf2, 0xc3, 0xf2, 0xc2, 0xf2
.byte 0xc1, 0xf2, 0xc0, 0xf2
.global gUnknown_80F64FC
gUnknown_80F64FC: @ 80F64FC
@ replacing .incbin "baserom.gba", 0x000f64fc, 0x24
.byte 0x84, 0x03, 0x00, 0x00, 0x20, 0x03, 0x00, 0x00, 0xbc, 0x02, 0x00, 0x00, 0x58, 0x02, 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, 0x90, 0x01, 0x00, 0x00, 0x2c, 0x01, 0x00, 0x00, 0xc8, 0x00, 0x00, 0x00
.byte 0x64, 0x00, 0x00, 0x00
.global gUnknown_80F6520
gUnknown_80F6520: @ 80F6520
@ replacing .incbin "baserom.gba", 0x000f6520, 0x24
.byte 0x5a, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x46, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00
.byte 0x0a, 0x00, 0x00, 0x00
.global gUnknown_80F6544
gUnknown_80F6544: @ 80F6544
@ replacing .incbin "baserom.gba", 0x000f6544, 0x24
.byte 0x91, 0xf2, 0x90, 0xf2, 0x8f, 0xf2, 0x8e, 0xf2, 0x8d, 0xf2, 0x8c, 0xf2, 0x8b, 0xf2, 0x8a, 0xf2, 0x89, 0xf2, 0xc8, 0xf2, 0xc7, 0xf2, 0xc6, 0xf2, 0xc5, 0xf2, 0xc4, 0xf2, 0xc3, 0xf2, 0xc2, 0xf2
.byte 0xc1, 0xf2, 0xc0, 0xf2
.global gUnknown_80F6568
gUnknown_80F6568: @ 80F6568
@ replacing .incbin "baserom.gba", 0x000f6568, 0x88
.byte 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff
.byte 0x01, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0x02, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0x02, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0x02, 0x00, 0x00, 0x00, 0xfd, 0xff, 0xff, 0xff
.byte 0x03, 0x00, 0x00, 0x00, 0xfd, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0xfd, 0xff, 0xff, 0xff, 0x04, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0x04, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff
.byte 0x04, 0x00, 0x00, 0x00, 0xfb, 0xff, 0xff, 0xff, 0x04, 0x00, 0x00, 0x00, 0xfb, 0xff, 0xff, 0xff, 0x04, 0x00, 0x00, 0x00, 0xfb, 0xff, 0xff, 0xff, 0x04, 0x00, 0x00, 0x00, 0xfb, 0xff, 0xff, 0xff

View File

@ -538,6 +538,9 @@ SECTIONS {
src/code_803D110.o(.rodata);
data/data_80F59C8_3.o(.rodata);
src/code_803E724.o(.rodata);
data/data_80F59C8_0.o(.rodata);
src/dungeon_map.o(.rodata);
src/code_8040094_1.o(.rodata);
data/data_80F59C8.o(.rodata);
src/dungeon_message.o(.rodata);
src/dungeon_move.o(.rodata);

View File

@ -1,4 +1,5 @@
#include "global.h"
#include "globaldata.h"
#include "dungeon_message.h"
#include "dungeon_random.h"
#include "structs/dungeon_entity.h"

View File

@ -1,4 +1,5 @@
#include "global.h"
#include "globaldata.h"
#include "dungeon_map.h"
#include "structs/dungeon_entity.h"
#include "structs/str_dungeon.h"
@ -16,8 +17,8 @@
#include "trap.h"
#include "text.h"
#include "constants/dungeon.h"
#include "constants/trap.h"
extern const char gUnknown_80F6604; // "zmappat"
extern struct FileArchive gDungeonFileArchive;
extern DungeonPos gPlayerDotMapPosition;
extern s32 gUnknown_202EDD0;
@ -28,8 +29,6 @@ extern bool8 sub_8094C48(void);
extern bool8 sub_8045804(Entity *ent);
extern bool8 DoesNotHaveShadedMap(void);
extern const u8 gUnknown_80F65F0[];
struct UnkStruct1
{
u32 **unk0;
@ -41,12 +40,59 @@ struct DungeonMapGfx
RGB *pal;
};
enum {
MAP_GFX_NOTHING,
MAP_GFX_UNK1, // Appears to be nothing too
MAP_GFX_ENEMY,
MAP_GFX_ITEM,
MAP_GFX_TRAP,
MAP_GFX_SPECIAL_STAIRS,
MAP_GFX_STAIRS,
MAP_GFX_WONDER_TILE,
MAP_GFX_PLAYER,
MAP_GFX_WHITE_SQUARE, // Possibly unused? It's like Stairs, but white instead of blue
MAP_GFX_ALLY,
MAP_GFX_GREEN_DOT, // Used when hallucinating
};
#define MAP_GFX_TERRAIN_TILES_VISITED 0x10
#define MAP_GFX_TERRAIN_TILES_REVEALED 0x20
#define MAP_GFX_TERRAIN_LINE_UP 0x1
#define MAP_GFX_TERRAIN_LINE_RIGHT 0x2
#define MAP_GFX_TERRAIN_LINE_DOWN 0x4
#define MAP_GFX_TERRAIN_LINE_LEFT 0x8
EWRAM_DATA bool8 gShowMonsterDotsInDungeonMap = FALSE;
EWRAM_DATA bool8 gShowDungeonMap = FALSE;
EWRAM_DATA static u8 sPlayerDotFrames = 0;
EWRAM_DATA static OpenedFile *sDungeonMapGfxFile = NULL;
EWRAM_DATA static void *sDungeonMapVramDst = NULL;
// All traps look the same on Map, except for the Wonder Tile.
static const u8 sTrapToMapGfxId[NUM_TRAPS] =
{
[TRAP_TRIP_TRAP] = MAP_GFX_TRAP,
[TRAP_MUD_TRAP] = MAP_GFX_TRAP,
[TRAP_STICKY_TRAP] = MAP_GFX_TRAP,
[TRAP_GRIMY_TRAP] = MAP_GFX_TRAP,
[TRAP_SUMMON_TRAP] = MAP_GFX_TRAP,
[TRAP_PITFALL_TRAP] = MAP_GFX_TRAP,
[TRAP_WARP_TRAP] = MAP_GFX_TRAP,
[TRAP_WHIRLWIND_TRAP] = MAP_GFX_TRAP,
[TRAP_SPIN_TRAP] = MAP_GFX_TRAP,
[TRAP_SLUMBER_TRAP] = MAP_GFX_TRAP,
[TRAP_SLOW_TRAP] = MAP_GFX_TRAP,
[TRAP_SEAL_TRAP] = MAP_GFX_TRAP,
[TRAP_POISON_TRAP] = MAP_GFX_TRAP,
[TRAP_SELFDESTRUCT_TRAP] = MAP_GFX_TRAP,
[TRAP_EXPLOSION_TRAP] = MAP_GFX_TRAP,
[TRAP_PP_ZERO_TRAP] = MAP_GFX_TRAP,
[TRAP_CHESTNUT_TRAP] = MAP_GFX_TRAP,
[TRAP_WONDER_TILE] = MAP_GFX_WONDER_TILE,
[TRAP_POKEMON_TRAP] = MAP_GFX_TRAP,
[TRAP_SPIKE_TRAP] = MAP_GFX_TRAP,
};
void SetDungeonMapToNotShown(void)
{
gShowDungeonMap = FALSE;
@ -54,7 +100,7 @@ void SetDungeonMapToNotShown(void)
void OpenDungeonMapFile(void)
{
sDungeonMapGfxFile = OpenFileAndGetFileDataPtr(&gUnknown_80F6604, &gDungeonFileArchive);
sDungeonMapGfxFile = OpenFileAndGetFileDataPtr("zmappat", &gDungeonFileArchive);
}
void InitDungeonMap(bool8 a0)
@ -117,28 +163,6 @@ void LoadDungeonMapPalette(void)
}
}
enum {
MAP_GFX_NOTHING,
MAP_GFX_UNK1, // Appears to be nothing too
MAP_GFX_ENEMY,
MAP_GFX_ITEM,
MAP_GFX_TRAP,
MAP_GFX_SPECIAL_STAIRS,
MAP_GFX_STAIRS,
MAP_GFX_WONDER_TILE,
MAP_GFX_PLAYER,
MAP_GFX_WHITE_SQUARE, // Possibly unused? It's like Stairs, but white instead of blue
MAP_GFX_ALLY,
MAP_GFX_GREEN_DOT, // Used when hallucinating
};
#define MAP_GFX_TERRAIN_TILES_VISITED 0x10
#define MAP_GFX_TERRAIN_TILES_REVEALED 0x20
#define MAP_GFX_TERRAIN_LINE_UP 0x1
#define MAP_GFX_TERRAIN_LINE_RIGHT 0x2
#define MAP_GFX_TERRAIN_LINE_DOWN 0x4
#define MAP_GFX_TERRAIN_LINE_LEFT 0x8
void ShowDungeonMapAtPos(s32 x, s32 y)
{
s32 yAdd = 0;
@ -259,7 +283,7 @@ void ShowDungeonMapAtPos(s32 x, s32 y)
if (entType == ENTITY_TRAP) {
if (entity->isVisible || showHiddenTraps) {
Trap *trap = GetTrapData(entity);
mapGfxType = gUnknown_80F65F0[trap->id];
mapGfxType = sTrapToMapGfxId[trap->id];
lookForMapObject = FALSE;
}
}