-
Notifications
You must be signed in to change notification settings - Fork 0
Main Loop and Map
Vairn edited this page Jun 2, 2026
·
6 revisions
Navigation: Home - Runtime & engine - Main Loop and Map
This is the high-frequency control loop once runtime is active.
Flow shape:
- Poll event/timer bytes.
- Wait/pump input (
-$83C2path). - Fetch key (
-$842Epath). - Dispatch key through table (jump from
LAB_14AAfamily). - Handle mode transitions and refresh.
Hotkeys include at least C/M/O/P/Q branches into command handlers.
Triggered when mode/screen id changes:
- Skips reload if mode unchanged.
- Uses
A4-$EEF4as source pointer. - Copies multiple
0x100blocks into working tables (A4-$AB46,A4-$AA46, etc).
This is a major state/materialization step for map/event context.
Nested 16x16 tile draw loops:
- Tile source table at
A4-$AA46. - Draw calls through
-$83E0(A4). - Movement from key mapping in
A4-$864F:N -> 0x20S -> 0x21E -> 0x22W -> 0x23
- ESC (
0x1B) setsA4-$86B0and exits map loop.
After exit it re-enters session refresh (LAB_545E path).
- Docs Wiki Hub ← full doc index
- Getting Started ← read this first
- Overview
- Workspace Notes
- Open Questions
- Full Analysis
- Game Remake
- Startup and Init
- Runtime Memory Map
- Main Loop and Map
- Exploration Input and Options
- Party and Session
- Game State Struct
- Data Hunk mm2 data 00
- Time Era Calendar
- GFX Loading
- ANM TV Format
- PC DOS graphics
- SNES graphics
- 3D View and Game Screen
- Amiga 3D Render Process
- Scripted Scene Graphics
- Event Graphics Opcodes
- Title Screen Assets
- Title Screen Animation
- Format inventory
- items.dat
- monsters.dat
- roster.dat
- attrib.dat
- map.dat
- spells & item use
- event.dat
- Events by location ← 71 maps
- Events hub (numbered)
- Event Script Opcodes
-
Event Script DSL ←
.mm2evtauthoring - Event Text Rendering
- Event Graphics Opcodes
- Combat Overview
- Combat System
- Encounter Tables
- Spell Cast ASM
- monsters.dat abilities
- Spells and item use
- Town Services
- Spell Sources
- Character Mechanics
- Skills and Hirelings
- Commerce Formulas
- Commerce World Services
- Mount Farview Class Quest
- Class Quest HP Bug
- Event Runtime
- Event to String Path
- Embedded Exe Strings
- Copy Protection
- Time Era Calendar
- Game State Struct
- MM1 Overview ← hub + decode status
- MM1 MAZEDATA format
- MM1 to MM2 outdoor
- MM1 WALLPIX by sector
- MM1 art & graphics
- MM1 items / monsters (status)
- MM1 map walker ↗
- MM1 2D maps gallery
- MM1 WALLPIX gallery