Entry 77
The minimap: Mac Anu's plan, the field's and the dungeon's maps, SELECT and event 3's map lesson
Filescrates/piney-world/src/map/mod.rscrates/piney-world/src/map/sprite.rscrates/piney-world/src/map/town.rscrates/piney-world/src/map/field.rscrates/piney-world/src/map/dungeon.rscrates/piney-world/src/field_area.rscrates/piney-world/src/dungeon_area.rscrates/piney-game/src/world.rscrates/piney-game/src/area.rscrates/piney-game/src/area_host.rstools/test_map_rs.pydocs/engine/map.md
The user asked where the minimap was. Event 3 needs it too: lines 20-25 teach it. An agent has ported it for the town, the field and the dungeon. docs/engine/map.md has the detail.
What is drawn
- The town.
ROOTTOWN01::DrawMapdraws Mac Anu's plan (TEX_sr1map1), the six shop signs ofRT01ICONPOS, and the pulsing arrow (xallow0). - The field.
WORLD::DrawMiniMapand its six helpers draw over the height map thatGeneratepaints intofieldminimap. SELECT switches between the Default Map, the Overall Map and off. - The dungeon.
MakeMiniMapscans each room with rays through the port'sccHitCheckLM. ThenDUNGEON::DrawMaprepaints the map, labels the floor ("B 1") and marks the stairs.DUNGEON::ShowMapreveals a floor. - The sprites.
ccSprite's packets, flat and rotated, are ported under map/sprite.rs.
How it is driven
- The map button.
ChangeMapModetakes SELECT (assignPAD+0x840c, operation 13, the mode kept at save +0x842d-f). It runs before the world's frame, asccThGameCtrlchecks it beforeccPlayerMenuCheck. - The fade. The field UI's
SetMapAlpha(Request::MapAlpha) now fades the map, and the map'smapStatusgoes back to the UI. - The events.
map_onandshow_mapwork from the event hosts. By event 3's line 21 the map is at full alpha with the entrance and the red arrow, and line 25'sshow_mapsetsmapFlag.
Checked
- Against the game.
tools/test_map_rs.pyruns the game's own code in eemu besidemap_probe. It compares every sprite's fields, the order they are sent, and the vertices decoded from the GIF packets:- the town: 95 frames, 1,456 packets;
- field 14: 4,748 packets, and every texel of the painted height map;
- 9 other field types: 40,998 packets;
- 24 dungeons:
- 206 rooms' scans;
ShowMapstep by step on 24 second floors;- 288
DrawMapframes, with 2,594 packets and the repainted texture;
- the modes: 144
ChangeMapModecases, the alpha, andShowMapfor 126 areas and the town.
- Event 3 (runtime test):
event_3_shows_the_map. - Re-run in a clean worktree. The map, world, field, dungeon, field UI and merchant camera suites pass, with the workspace's tests, clippy, fmt and the docs check.
- Shots.
- Mac Anu's plan with its signs, and SELECT turning it off.
- Field 14's Default and Overall maps.
- The dungeon's B 1.
- Orca's "You see the Red Down Arrow on it?" with the arrow on the map.
Still unknown
- Portals, gimmicks and fountains are not fed in. Their drawing is ported and checked, but the entry control that places them is not ported yet. So event 3's
show_mapfinds no portals, and Fairy's Orb's "yellow areas" do not appear. - Not modelled around the button:menuClrWait,ccCheckGtHackAnm, the wiped-out party, andccGame.inBattle. - Unknown writers. What setsmapHideFlag(+0x42c) andWORLD_MAN.specialRoom(+0x160) is not known; the port keeps 0 and -1. - Game globals kept per map.RT01ICONPOSand the pulse angles are globals in the game but kept per map here, so a new area's pulse starts at 0. - Other towns. TheirDrawMapis not ported. - Not checked: - the special dungeon types 8 and 9, and story rooms of type 15 and up; - the labels' drawing (only the strings are compared).