Cite as
“Final Fantasy - Mystic Quest (USA) (Rev 1)”
Licence
proprietary; never redistributed (docs/data-policy.md#roms)
Credit
Square (developer and publisher)
Notes
No-Intro "Final Fantasy - Mystic Quest (USA) (Rev 1)", the North American release in its 1.1 revision. Headerless 512 KB LoROM image; internal title "FF MYSTIC QUEST", 8 KB of SRAM. Bank $00 is file offsets 0x0000-0x7FFF, and each bank's $8000-$FFFF follows ($01:8000 is 0x8000).

Cited on

Claims (15)

Each of the 81 monsters, from the Brownie to the Dark King, has a 14-byte record at $02:C275 (HP as a word, then four stats, which terriblesecret names strength, defense, speed and magic, then eight more bytes), a 3-byte record at $02:C17C (its level, then its experience and gold, each stored as a third), and a 16-byte name at $0C:CBA0. When a battle loads a monster, the game copies its name, sets its level, sets current and maximum HP to the HP word, copies the four stats, copies bytes 6-7 to two places, bytes 8-11 to four, and bytes 12 and 13 to one place each, and and sets offset $2F to $80 for monster $42 (Behemoth) and every monster after it, $00 before it. HP runs from 50 (Brownie) to 40,000 (Dark King), levels from 1 to 40 (Dark King), and experience up to 762 (Stone Golem).0x14275-0x146e20x1417c-0x1426e0x64ba0-0x650afCode
Each of the 81 monsters has a 9-byte attack record at $02:C6FF: a profile number in the first byte's low four bits, then eight bytes, which read as item and attack numbers name attacks in the shared name table ($FF in the empty ones; the code that reads them isn't traced). When a battle loads a monster, the game copies the profile's eight bytes from the 16 profiles at $02:C9EA to offset $44 of its battle record and the whole 9-byte record to offset $57.0x146ff-0x149d70x64120-0x64b6fCode
The 16 attack profiles at $02:C9EA hold eight bytes each; a monster's attack record names its profile (ffmq-tables/monster-attacks), and the loader copies it to offset $44. In 10 of them the bytes' low seven bits sum to 100 (profiles 0, 1, 2, 8, 10, 11, 12, 13, 14, 15); the rest sum to 80, 102, 98, 102, 78, 104. Profiles 11, 12, 13, 14, 15 set the top bit on one byte.0x149ea-0x14a69Code
Each of the 234 formations at $02:CA6A is 4 bytes: three monster slots and a flags byte. A slot of $FF is empty; otherwise its low seven bits are the monster number. Each slot's top bit is kept apart for that slot ($80 for an empty one), and the flags byte's bits 4 and 5 are kept apart too; what those do isn't read. Bit 7 of the flags byte skips the first-strike roll and bit 6 stops the party running (ffmq/first-strike, ffmq/run).0x14a6a-0x14e11Code
The 207 battle numbers each have three formations at $02:CE12. When a battle starts, the game draws a number from 0 to 100 and takes the first formation for 0-33, the second for 34-67, and the third for 68-100. Computed: the third comes up 33 times in 101 and the others 34; battle number $FF skips the draw and uses the formation already in $0515. Battle numbers 0-19 are the 20 battlefields (ffmq/battlefields).0x14e12-0x1507eCode
The 15 weapons, items $20-$2E from the Steel Sword to the Ninja Star, have 8-byte records at $02:BC00. When a weapon's action is set up, the game takes bytes 0-1 as a word, bytes 2-5 into four places (keeping the low six bits of bytes 3 and 4, and folding their top two bits into a derived byte), byte 6 into one place, and byte 7 split into its two nibbles. terriblesecret names byte 0 the element, byte 1 the status, byte 2 the power and byte 7 a stat boost.0x13c00-0x13c770x10bf2-0x10c05Code
The 157 monster attacks, numbers $40-$DC from Sword to an unnamed last entry, have 7-byte records at $02:BC78. The game takes bytes 0-1 as a word, bytes 2-5 into four places (byte 3's low six bits are the effect routine its battle code dispatches on, and its top two bits and byte 4's go into a derived byte), and byte 6 split into nibbles. terriblesecret names byte 0 the element, 1 the status, 2 the power, 3 the effect and 5 the targeting.0x13c78-0x140c20x10bf2-0x10c05Code
The 12 spells, items $14-$1F from Exit to Flare, have 7-byte records at $02:C0C3 in the attack format: bytes 0-1 a word, bytes 2-5 into four places (byte 3's low six bits the effect routine), and byte 6 into one place. terriblesecret's attack fields name them: element, status, power, effect, sound effect, targeting.0x140c3-0x141160x10bf2-0x10c05Code
The four consumables, items $10-$13 (Cure Potion, Heal Potion, Seed, Refresher), have 4-byte records at $02:C117, which the game copies into the same four places as an attack's bytes 2-5: byte 1's low six bits are the effect routine.0x14117-0x141260x10bf2-0x10c05Code
The 17 pieces of armor, items $2F-$3F (helmets, armor, shields, and the Charm, Magic Ring and Cupid Locket), have 5-byte records at $02:C127. The game takes bytes 0-1 as a word, then splits each of bytes 2, 3 and 4 into its two nibbles. Byte 2 runs in blocks: 0x80 for 3 (Steel Helm, Moon Helm, Apollo Helm); 0x00 for 6 (Steel Armor, Noble Armor, Gaia's Armor, Relica Armor, Mystic Robe, Flame Armor); 0x20 for 5 (Black Robe, Steel Shield, Venus Shield, Aegis Shield, Ether Shield); 0x10 for 3 (Charm, Magic Ring, Cupid Locket). terriblesecret names byte 0 the element and byte 1 the status.0x14127-0x1417b0x10bf2-0x10c05Code
The 9 character records at $0C:D0B0, 80 bytes each, are Benjamin's starting record and two for each companion, Kaeli, Tristam, Phoebe and Reuben, the second at a higher level. A new game copies record 0 to Benjamin's place at $1000; a script command copies the record it names, whole, to the companion's place at $1080 (ffmq/companion-records). By terriblesecret's field names, which the copies and the level-up fit, each holds the level ($10), current and maximum HP ($14, $16), the three kinds of magic points ($18-$1A, with maxima at $1B-$1D), the four stats as level gives them ($4C-$4F) and with equipment ($22-$25), and accuracy ($40), which Benjamin's level-up sets to 75 plus half the level.0x650b0-0x6537fCode
Each of the 20 battlefields, battle numbers 0-19, has a count of battles at $0C:D4D0, which a new game copies to $0FD4, and a reward word at $07:EFA1. Every battlefield starts at 10. After a won battle with a number below 20, the game takes one off that battlefield's count and shows the number left; at zero it gives the reward: with the top bit set, the low 15 bits times 3 in experience; with bit 14, the item in the low byte; otherwise the low 14 bits times 3 in gold. The battlefield names are Archipelago's, not the game's: Archipelago's object ids 1-20 are taken as battle numbers 0-19 because their types (experience, item, gold) follow the reward words in the same order, and the official guide's numbered battlefields -2-, -5-, -19- and -20- have the rewards of battle numbers 1, 4, 18 and 19.0x654d0-0x654e30x3efa1-0x3efc8Code
The main loop runs the run check when bit 6 of $1020, in Benjamin's record, is set; what sets that bit isn't read. The run fails outright when the formation's flags byte has bit 6 set, and succeeds outright in round 0 after the party won the first strike. Otherwise the game takes the party's speed (Benjamin's, averaged with the companion's when both can act) and the monsters' average speed: the speeds of those that can act, summed from 1 instead of 0 when the first monster can't act, over their number. It draws a random byte modulo ⌊average ÷ 5⌋ × round + 1 (rounds counted from 0; the product and the + 1 kept to 8 bits), and the run succeeds when (average − draw) mod 256 is below the party's speed, so a draw larger than the average wraps to 256 + average − draw. A failed run gives the monsters a round to themselves. Computed: in round 0 the draw is 0, so the run succeeds only when the party is faster.0x10223-0x102250x10230-0x102320x102ee-0x102f8Code
After a won battle, each monster present adds 3 times its experience byte to the battle's experience and 3 times its gold byte to its gold (ffmq-tables/monsters). The code would use 6 for a gold byte of $42-$49 and 10 for $4A or more, but no monster's gold byte is above 10.0x10965-0x1096e0x1417c-0x1426eCode
When Benjamin's experience reaches the figure at $0510, he goes up one level, to at most 41: his maximum HP rises by 40 and his current HP is scaled by the new maximum over the old; his maximum white magic rises by 1, black by 1 whenever half his level (rounded down) rises, and wizard whenever a quarter of it does; his level stats rise by 3 attack, 2 defense, 2 speed and 1 magic, and offset $40 becomes 75 plus half his level. The check runs once after a battle's rewards and once after a battlefield's experience reward.0x10765-0x107660x107f9-0x107fa0x16b3-0x16e3Code