summaryrefslogtreecommitdiff
path: root/src/code
diff options
context:
space:
mode:
authorcadmic <cadmic24@gmail.com>2024-09-07 01:43:23 -0700
committerGitHub <noreply@github.com>2024-09-07 17:43:23 +0900
commit35cfc075909e5244fe42a3c6ae30ac33e721d33d (patch)
tree257ec39f0aaf60ae6133358aba2fccb7806d93fc /src/code
parent3a9ebfbbad15294c1546074c4b64da0289e8a334 (diff)
[ntsc-1.2] Match z_map_exp.c, z_map_mark.c (#2140)
* Match z_map_exp.c, z_map_mark.c * Format * DMA_REQUEST_SYNC -> DmaMgr_RequestSync * Remove Gfx forward declaration
Diffstat (limited to 'src/code')
-rw-r--r--src/code/z_map_exp.c36
-rw-r--r--src/code/z_map_mark.c15
2 files changed, 51 insertions, 0 deletions
diff --git a/src/code/z_map_exp.c b/src/code/z_map_exp.c
index 79f625c39..cf37a9164 100644
--- a/src/code/z_map_exp.c
+++ b/src/code/z_map_exp.c
@@ -2,6 +2,9 @@
#include "terminal.h"
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#include "assets/textures/parameter_static/parameter_static.h"
+#if PLATFORM_N64
+#include "n64dd.h"
+#endif
MapData* gMapData;
@@ -160,10 +163,22 @@ void Map_InitData(PlayState* play, s16 room) {
"Deku Tree Dungeon MAP Texture DMA(%x) scene_id_offset=%d VREG(30)=%d\n"),
room, mapIndex, VREG(30));
PRINTF(VT_RST);
+
+#if PLATFORM_N64
+ if ((B_80121220 != NULL) && (B_80121220->unk_28 != NULL) && B_80121220->unk_28(play)) {
+ } else {
+ DmaMgr_RequestSync(play->interfaceCtx.mapSegment,
+ (uintptr_t)_map_i_staticSegmentRomStart +
+ ((gMapData->dgnMinimapTexIndexOffset[mapIndex] + room) * MAP_I_TEX_SIZE),
+ MAP_I_TEX_SIZE);
+ }
+#else
DMA_REQUEST_SYNC(play->interfaceCtx.mapSegment,
(uintptr_t)_map_i_staticSegmentRomStart +
((gMapData->dgnMinimapTexIndexOffset[mapIndex] + room) * MAP_I_TEX_SIZE),
MAP_I_TEX_SIZE, "../z_map_exp.c", 346);
+#endif
+
R_COMPASS_OFFSET_X = gMapData->roomCompassOffsetX[mapIndex][room];
R_COMPASS_OFFSET_Y = gMapData->roomCompassOffsetY[mapIndex][room];
Map_SetFloorPalettesData(play, VREG(30));
@@ -221,6 +236,16 @@ void Map_InitRoomData(PlayState* play, s16 room) {
void Map_Destroy(PlayState* play) {
MapMark_ClearPointers(play);
+
+#if PLATFORM_N64
+ if ((B_80121220 != NULL) && (B_80121220->unk_24 != NULL)) {
+ B_80121220->unk_24();
+ }
+ if ((B_80121220 != NULL) && (B_80121220->unk_1C != NULL)) {
+ B_80121220->unk_1C(&gMapData);
+ }
+#endif
+
gMapData = NULL;
}
@@ -230,6 +255,12 @@ void Map_Init(PlayState* play) {
gMapData = &gMapDataTable;
+#if PLATFORM_N64
+ if ((B_80121220 != NULL) && (B_80121220->unk_18 != NULL)) {
+ B_80121220->unk_18(&gMapData);
+ }
+#endif
+
interfaceCtx->unk_258 = -1;
interfaceCtx->unk_25A = -1;
@@ -303,6 +334,11 @@ void Map_Init(PlayState* play) {
R_COMPASS_OFFSET_X = gMapData->dgnCompassInfo[mapIndex][2];
R_COMPASS_OFFSET_Y = gMapData->dgnCompassInfo[mapIndex][3];
R_MAP_TEX_INDEX = R_MAP_TEX_INDEX_BASE = gMapData->dgnTexIndexBase[mapIndex];
+#if PLATFORM_N64
+ if ((B_80121220 != NULL) && (B_80121220->unk_20 != NULL)) {
+ B_80121220->unk_20(gMapData);
+ }
+#endif
Map_InitRoomData(play, play->roomCtx.curRoom.num);
MapMark_Init(play);
}
diff --git a/src/code/z_map_mark.c b/src/code/z_map_mark.c
index 4fc7d7cfa..ae654c22d 100644
--- a/src/code/z_map_mark.c
+++ b/src/code/z_map_mark.c
@@ -1,6 +1,9 @@
#include "global.h"
#include "terminal.h"
#include "assets/textures/parameter_static/parameter_static.h"
+#if PLATFORM_N64
+#include "n64dd.h"
+#endif
typedef struct MapMarkInfo {
/* 0x00 */ void* texture;
@@ -52,9 +55,21 @@ void MapMark_Init(PlayState* play) {
? (void*)((uintptr_t)overlay->vramTable -
(intptr_t)((uintptr_t)overlay->vramStart - (uintptr_t)overlay->loadedRamAddr))
: NULL);
+
+#if PLATFORM_N64
+ if ((B_80121220 != NULL) && (B_80121220->unk_2C != NULL)) {
+ B_80121220->unk_2C(&sLoadedMarkDataTable);
+ }
+#endif
}
void MapMark_ClearPointers(PlayState* play) {
+#if PLATFORM_N64
+ if ((B_80121220 != NULL) && (B_80121220->unk_30 != NULL)) {
+ B_80121220->unk_30(&sLoadedMarkDataTable);
+ }
+#endif
+
sMapMarkDataOvl.loadedRamAddr = NULL;
sLoadedMarkDataTable = NULL;
}