-
Notifications
You must be signed in to change notification settings - Fork 0
Event Graphics Opcodes
Navigation: Home - Data formats - Event Graphics Opcodes
Corak ghost / Pegasus full illustration / castle scene engine: see 46-scripted-scene-graphics.md — those beats use
0x6FB8/0x64F8/ viewport overlay (0x316E), not event VM opcodes alone.
Which event.dat script opcodes (0x00..0x32) reach sprites, .32 sheets,
or .anm animation (not plain 8×8 text). Companion docs:
07-event-script-opcodes.md,
44-event-text-rendering.md,
30-event-to-string-path.md,
15-3d-view-and-game-screen.md.
ASM source: EXTRACTED/mm2.capstone.annotated.asm (dispatch @ 0x172CA,
table @ 0x17494).
| Question | Answer |
|---|---|
| Only opcode that loads a non-text graphic asset from the event VM |
OP_0B — service signboard .anm over the 3D viewport |
| Corak “spirit proclaims…” intro |
Not title-screen gfx; not OP_0B. Text lives in event.dat loc 60 string bank; playback is an overlay / castle-blob / scripted-scene path (text + optional music, no Corak sprite traced) |
| Guardian Pegasus outside (C2) |
Text only (OP_01 + OP_0B direction sign). No pegasus .32/.anm in overland or map-transition code |
| Title pegasus |
Separate boot path (intro.32 + introclips.32 @ 0x25FCE / 0x26A1E) — see 38-title-screen-and-intro-assets.md, 39-title-screen-animation.md
|
Classification: Sprite = .anm/planar sheet blit; Font chrome = control glyphs from font 8;
Indirect = handler delegates to another engine that draws gfx; None = text/state only.
| Op | Handler | Gfx? | Asset / mechanism | Placement | Example (loc · event) |
|---|---|---|---|---|---|
01–05
|
0x15924–0x15A46
|
Font chrome only | 8×8 font; OP_05/06 use divider glyphs (0x0E–0x15, 0x7E) |
Rows 3–22 over viewport / panel |
01 loc 00 evt 20 — gate y/n text |
06 |
0x15AEE |
Font chrome | Popup B draws box frame via -$7C62 before text |
Cells (7,7)–(19,14) | loc 08 evt 01 — “Dead Zone” sign |
07 |
0x15CE6 |
Side effect | In 3D mode (-$79E2==0), wait loop calls key_read_3d @ 0x1E9CE → torch -$7C20 blits from -$7A1E
|
Viewport wall torches | Any OP_07 after a text block in dungeon/town |
08 |
0x15D26 |
Same as 07
|
Wraps 0x15CE6(1) (scripted key replay) |
— | — |
0B |
0x15DB0 |
Sprite |
sign_sprite_load @ 0x316E → 0x9A30(id) loads .anm; mode $16 prep @ -$7BAE; sign_sprite_place @ 0x3266 → mode $17 overlay; table A4-$7538 (24 slots); handle A4-$79FE
|
Over 3D viewport (208×120 @ px 8,8); arg2 = placement index passed to sign_sprite_place(pos, $40, $20)
|
loc 00 evt 24 — OP_0B “Lock and Key LTD”; loc 11 evt 04 — Pegasus tile sign "<- Castle / Pinehurst"
|
0C |
0x15E12 |
Indirect |
-$7FDA map init → full 3D hood redraw (walls from env .32); no event overlay sprite |
New screen coords from args | loc 00 evt 20 — exit to overland map_transition(0x0B, 0x37)
|
0D |
0x15EC4 |
None in stub |
-$7E42(index) generic engine call; per-index table untraced
|
— | loc 08 evt 04 — engine_call(0x09) after sickness block |
0E |
0x160C2 |
Indirect | Shop/temple/inn handlers (0x1A132, 0x1C54A, …) — UI is mostly text; no VM blit in stub |
Service windows | loc 00 — exec_selector(0x01) tavern |
0F–11
|
— | None | Control flow | — | — |
12/13 |
0x16300/0x16386 |
Indirect |
-$7EDE / -$7F1A enter combat → 0x316E layers up to 24 monster .anm sprites (A4-$7538) |
Viewport slots | loc 22 evt 09 — crypt guardian encounter_setup
|
14 |
0x16398 |
None | Clears tile event flag | — | loc 11 evt 04 — after Pegasus speech |
15–20
|
— | None | Party bytes / effects | — | — |
21 |
0x16A34 |
Map gfx | Writes visual/collision bytes to -$55BA / -$54BA → permanent tile graphics on next draw |
Named (y,x)
|
loc 22 evt 04 — Corak's Cave barrier drop |
22–32
|
— | None | Predicates, vars, treasure bytes, password | — | — |
0D, 0E (stub only), 0F, 10, 11, 14, 15–20, 22–32 — surveyed via handler entry in mm2.capstone.annotated.asm and cross-refs in docs 07/17/28. None call -$7C20, mode $16/$17, or 0x9A30 except where noted above.
- Read
u8 str_idx,u8 posfrom script. -
0x15756(str_idx)→ sign id stored inA4-$55C8(maps string index → id using per-town tables @A4-$6C62…-$6C02and env idA4-$79E3). -
sign_sprite_place(-1, 0, 0)@0x3266— clear priorA4-$79FE. -
sign_sprite_load(id)@0x316E— if can't-see (A4-$79E1), clear viewport preset #8; else load sheet via0x9A30:subq #1@$31E8thenaddq #1@$9A4Cbefore the decimal loop — netid→"NN.anm"in scratch, gfx mode$16prep. -
sign_sprite_place(pos, $40, $20)— mode$17draws board over viewport. - Sets exit flag bit 2 (
A4-$7950).
Note on “mode $17”: doc 44 uses $17 for the graphics-library primitive mode inside -$7BAE @ 0x23C8C, not the OP_0B script arg2. Decoded scripts use mode=0x00 on the second byte; observed placement values include 0x00, 0x07, 0x09, 0x12, 0x31, etc. (placement index into A4-$7538, not a display mode).
When bit 2 set: sign_sprite_place(-1,0,0); buf_copy_rect restores viewport (8,8)–(215,127) from back buffer.
| Location | Event | Script fragment | String / role |
|---|---|---|---|
| 00 Middlegate | 24 |
OP_0B str[11], pos 0x00
|
“Lock and Key LTD” shop sign |
| 03 Vulcania | 2 |
OP_0B str[2] |
“Bestway Blacksmith” |
| 11 C2 overland | 04 |
OP_0B str[14], then OP_01 str[5] |
Direction sign + “Guardian Pegasus…” dialogue (text only) |
| 47 Woodhaven D1 | — |
OP_0B str[7], pos 0x31
|
“No ROBBERS!” dungeon class gate |
Middlegate map (7,4) [FIRST TIME]: “The spirit of Corak proclaims, ‘Fantastic adventure awaits you…’” (FAQ §3-2-2). Related strings also cover Feldecarb Fountain (15,15), Nordon (10,2), etc.
| Source | Content |
|---|---|
| event.dat loc 60 | String bank: str[8] = Corak proclamation; str[9] Nordon; str[23] Feldecarb Fountain; … (loc_60) |
| loc 60 decode | 0 bytes in the standard script pool; tile triplets look like placeholders for overlay/queued use |
| loc 00 Middlegate |
No trigger at (7,4); fountain at (15,15) evt 17 uses different copy (str[9] clairvoyance fountain, not Feldecarb) |
| Mechanism | Address | Role |
|---|---|---|
| Not title screen |
0x25FCE / 0x26A1E
|
Pegasus art is pre-game only (doc 38/39) |
Not OP_0B
|
— | No Corak .anm signboard tied to intro |
play_song_scripted |
0x64F8 |
Table A4-$73C4: text lines + -$7BE4 draw + wait; used @ 0x78E6 when A4-$79B2 == 2 (script id 3 on stack) — music + text, no sprite load |
| Queued dispatch | 0x176B6 |
Secondary event runner for overlay/castle records (08-event-runtime.md) |
| Castle blobs | loc 63 / 65 / 68 | Non-standard event.dat records; likely bytecode + triggers without 00 00 00 terminator |
first_time_flag |
A4-$79E9 |
Toggled @ 0x06EAC area — candidate gate for one-shot intro UI |
Conclusion: Corak intro is event-overlay text (loc 60 strings) delivered through castle/queued/scripted-scene engine paths, not the title attract loop and not OP_0B sprite placement. No Corak portrait sprite has been traced in any intro handler.
Event 04 @ tile (4,7) ENTER:
apply_party(…) → OP_0B str[14] "<- Castle / Pinehurst" → OP_01 str[5] "Greetings! I'm your Guardian Pegasus…" → wait_key → OP_14
-
OP_0B: wooden direction signboard.anm(same pipeline as inn/shop signs). -
OP_01: 8×8 text only. -
No
introclips.32/ pegasus body art.
| Place | Mechanism |
|---|---|
| B1 loc 06 | Password gate “What is my name?” — text blocks only |
| C3 loc 14 | Linguist decodes “The Pegasus is called Meenu” — OP_01/02 text |
| Title screen |
intro.32 + introclips.32 phases 0–4 — only here |
- Leaving Middlegate:
OP_0C→-$7FDA@0x15E12(standard map load + 3D draw). - Overland sector view:
overland_map_view@0x223A— scrolls map.dat tiles via-$7C20; no pegasus sheet. -
outdoor_3d_master/A4-$79E2: switches outdoor 3D presentation; still env wall.32sets, not pegasus overlay.
Conclusion: The winged-horse picture is title-screen-only. Outside, “Pegasus” is NPC dialogue + optional signboard, same as any town service tile.
-
OP_0Bpipeline (blocking for shop tiles):- Implement
0x15756string→sign-id tables perA4-$79E3env. - Load
NN.anmvia0x9A30naming convention; decode with existing.anmcodec. - Mode
$16prep + mode$17place @0x23C8C— placement math still OPEN (doc 44 §8). - 24-entry
A4-$7538slot table; cleanup viewport blit(8,8)–(215,127).
- Implement
-
OP_06framed signs — font chrome only (already in event text demos). -
OP_07wait — optional torch flicker if emulatingkey_read_3d(cosmetic). -
OP_12/13— route to combat renderer (0x316Eshared with sign loader for sheet handle).
| Feature | Engine path | Remake module |
|---|---|---|
| Title pegasus |
0x25FCE, 0x26A1E, 0x27096
|
TitleScreen.cpp (doc 39) — done
|
| Corak intro text | loc 60 strings + 0x64F8 / castle blob / queued @0x176B6
|
New scripted prologue state: load loc 60 bank, run text ops + scripted audio id 3; trace castle blob before pixel parity |
| Feldecarb / Nordon quest | loc 60 strings; some tiles on loc 00 | Quest controller referencing loc 60 indices; align with FAQ tile coords |
| Overland Pegasus NPC | loc 11 evt 04 | Text + OP_0B sign asset only |
- Do not reuse title
introclipscoords for in-game Pegasus. - Do not expect
OP_0Cor overland init to show a full-screen transition illustration.
| Resource | Use |
|---|---|
| 44-event-text-rendering.md |
OP_0B §3.8, mode $17 gap, cleanup blit |
| 28-town-services.md |
OP_0B + OP_0E shop tile coords |
| 06-gfx-loading.md |
.32/.anm loader -$7C2C
|
tools/decode_event.py |
Per-location disassembly |
game/build/event_demos/ |
Text opcode screenshots (OP_01–06, prompts) |
-
0x23C8C—sign_sprite_placepixel math (OP_0B arg2 → screen x/y). -
0x9A30— full sign-id →.anmindex table dump. -
Corak
(7,4)first-time — which record (loc 60 / castle 63/65 / embedded script) emitsstr[8]; trigger not in loc 00 triplet table. -
OP_0D-$7E42— complete per-index table (any hidden gfx calls). -
Feldecarb fountain — FAQ/loc 60
str[23]vs loc 00 evt 17 clairvoyance text mismatch (retail vs FAQ or era-gated overlay).
| Page | Why |
|---|---|
| Scripted Scene Graphics | Corak / Pegasus scenes |
| Title Screen Animation | Title pegasus overlays |
| GFX Loading | .32 asset table |
| Event Script Opcodes | OP_0B opcode trace |
- 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
- Amiga audio in exe ← Paula / DATA / remake
- Controls: Sounds / Walk Beep
- MM2 music format (superseded)
- Title/death audio paths (superseded)
- Known songs catalog (superseded)
- 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