Mechanics (NES)

From Dr. Mario
Revision as of 20:01, 15 August 2020 by Dmwit (talk | contribs) (Created page with "== Gravity == While pills are under player control, they are slowly forced down the playfield even if the player does not request downward motion. Every ten pills, this speed...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Gravity

While pills are under player control, they are slowly forced down the playfield even if the player does not request downward motion. Every ten pills, this speed increases.

In detail: the game tracks two variables, coarse speed and fine speed. The coarse speed is user-selected from three options, called LOW, MED, and HI in the game UI. These names correspond to a number:

UI Name LOW MED HI
Coarse speed 15 25 31

The fine speed begins at 0 at level start. Between the 8th and 9th pills, it increases by one, then increases by one every 10 pills after that, until it reaches 49, where it plateaus. The speed at which the pill drops is computed (as a number of frames the game allows you to wait before forcing the pill down one row) by adding the coarse and fine speeds, then using the result to index into the following table:

Combined speed 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
NTSC frames per row 70 68 66 64 62 60 58 56 54 52 50 48 46 44 42 40 38 36 34 32 30 28 26 24 22 20 19 18 17 16 15 14 13 12 11 10 10 9 9 8 8 7 7 6 6 6 6 6 6 6 6 6 6 6 6 5 5 5 5 5 4 4 4 4 4 3 3 3 3 3 2 2 2 2 2 2 2 2 2 2 1
PAL frames per row 57 55 54 52 50 49 47 45 44 42 40 39 37 35 34 32 30 29 27 25 24 22 20 19 17 16 15 14 13 12 11 10 10 9 8 7 7 6 6 6 5 5 5 5 4 4 4 4 4 4 3 3 3 3 3 3 3 3 3 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1

For example, suppose you have locked 24 pills on a level, and are playing at MED speed. The coarse speed is 25 (for MED); the fine speed is 2 (because it increased after pills 8 and 18); the combined speed is 27 (=25+2); and the frames per row is 18 for NTSC or 14 for PAL.

The rows of the above table are stored in game memory (and so can be modified with judicious use of game genie codes or other memory hacks); see Memory addresses for details on where to look. For technical reasons, the frames per row table is stored with all values one smaller than those shown here. (For example, the NTSC table begins 69, 67, 65, ...; not 70, 68, 66, ....)

Why didn't they make LOW speed have index 0 and just shift the table down? It is a mystery. Probably they experimented with different values for the coarse speed lookup table for a while, and just never cleaned it up once they'd settled on a selection.