--------------------------------------------------------------------------------
The Real Lost Levels

Based on more than a decade of research by James Haley.
--------------------------------------------------------------------------------

Way back in the early 90's I was convinced that the Chocolate Factory rumor was
true. The Chocolate Factory was supposedly this little mini-game hidden in the
original Super Mario Bros. for NES that had a million different ridiculous
methods of being found. Needless to say, there was no such thing. But I spent a
good chunk of my later childhood searching for it using the Game Genie, and as
a result I found a lot of really cool codes. Some of those are the warp codes
which I like to term "the REAL Lost Levels". This is what this document covers.
To make use of this, you will either need a real NES, a real Game Genie, and
a copy of either Super Mario Bros. or the Super Mario Bros/Duck Hunt double
game pak, OR, an emulator with decent Game Genie or raw patch code support.


Game Genie Code Usage:
----------------------

YSAOPE + YEAOZA + ??????

Note: It does no good to try any code that is not listed here. This is an
exhaustive list of all values that can be written into the address specified by
the third code. Changing any of the other letters, or changing letters to values
not listed here, will change the address the code affects rather than the value.
This will usually crash the game or have some kind of bizarre effect unrelated
to the level you are visiting.

Patch Code Conversion:
----------------------

Apply the code to address 9087 and use the Num column as the value.
In FCE Ultra, make sure the "Read Substitute" check box is selected.


Why's it work and what's it doing?
----------------------------------

YSAOPE and YEAOZA set the game to start on the level specified in 9087 instead
of 1-1 as it usually does. There is no range checking, so it will use any value
written here as a world number. Indexing into its internal tables out of range
causes the game to select one of its existing levels (in MOST cases), but it
gets the wrong palette/music/object set/etc, so you end up with things like
underwater or underground versions of castles, or coin heavens that are
underwater and have rotating firebars in them. A few of the offsets end up
causing the game to read data that's not even part of the real maps, and these
are the most interesting areas. The prime ones are listed here:

* "E-1", the Fortress of Mystery. This is a black screen playing castle level 
music. There is a ? block in the upper left hand corner near where you start, 
and a Koopa Troopa to the far right. Both you and the Koopa fall into a hole. 
You continue doing this until you run out of lives.

* Bizarre Cloud World. This area is like nothing else, and has almost solid
clouds with Hammer Bros. running amok within them. You cannot get very far in
this area due to a pipe that blocks you. When you die, every life after that is
immediately lost due to the timer being set to zero.

* Stuck Castle #1. This place looks insane. Too bad you can't explore it since
your timer starts at zero, causing you to be unable to move. There is also an
underground version of this area, but when you get to the same place you start
in it as a castle, the game suddenly crashes :(

* Stuck Castle #2. This is a weird place that comes up quite often if you play
certain series of levels long enough. It has two levels, and a solid red 
background unlike anything ever used in the game. Even though you are stuck and
cannot move, a Buzzy Beetle makes his pokey way across the bottom of the screen.
There's also a coin block embedded in the center. There is also an underground
version of this area which can be gotten to directly with the code for world
W-1. The underground version doesn't have the beetle.

* Bizarre Underground Area. This starts out like it thinks it's a pipe
introduction, like the ones you get for worlds 1-2, 2-2, 4-2, etc. But there's
no pipe, and the area is filled with crazy stuff like Bullet Bill cannons
floating in mid-air. Mario walks quite a distance until he hits an unfortunately
placed block. You never gain control, and never die since there's no timer.

Some Misc. Notes
----------------
In any castle level that you can complete, even if the Princess appears, the
game will say "Thank you Mario, but our Princess is in another castle." This
is because the game code checks for World == 8 to give the Princess message
instead, and this isn't the case for any of these codes. However, you CAN press
B after the message is complete to return to the title screen and select a
level of the second quest. You'll start on that level as normal, but if you
beat that level or die, you return to the world for which you entered a code.
This works even for terrestrial, underground, and underwater variants of the
castles where there's no Bowser and the Princess is invisible. Careful though.
Hitting the axe in just the wrong way in some of the variant castles can cause
Mario to walk right forever instead of stopping to talk to the Princess!

In underwater versions of areas with flagpoles, you should not slide down the
flagpole. Catch it at the very bottom, because sometimes Mario will let go of it
too early and he will float past the block where he's supposed to stop. This 
will also make him walk right forever. In addition, do NOT stop the timer in a 
way that would give you fireworks. In most underwater areas, they will not work.
The game will wait forever instead, and you have to reset, or watch Mario's
air bubbles come out of the castle for all of eternity.

In levels with cantilevered platforms, the second platform of each set will not
function properly. Stepping on the first one can cause various adverse effects,
ranging from other sprites or parts of the level moving instead to the entire
game crashing. Either way, you're going to fall to your doom unless you work
around them entirely. This is a side-effect of the proper object sets not
getting loaded.

ANY level that ends with a pipe will suffer the Minus World effect. That is,
you cannot exit but will return to the beginning. Warp pipes can get you out,
but only temporarily, as you will return or go to some new weird area after
finishing the level you warped to, or after dying. All beanstalks and pipes 
within the levels are also nonfunctional and will return you to the beginning
of the map. This is due to pipe pointers not being loaded properly.

Related to this is also the fact that in all castles that are normally mazes,
the maze aspect of the maps is non-existant. That's right, you can just run
straight through them from one area to the next. In Bowser's Castle, you do
not and cannot use any pipes. Just keep going right. Watch out in 4-4; you can
get stuck if you don't go the proper way in the 2nd area.

A number of things from SMB2(J) (aka the Lost Levels) can be seen to have
existed as features of the original game engine through the use of these codes.
This includes the fact that Bullet Bill cannons don't fire underwater, Mario
cannot stomp ANY kind of enemy underwater or hit blocks underwater, Bloobers can
work just fine outside of water levels, etc. They didn't have to change or 
redesign any of that stuff; they just used it like it already was.

Sometimes the Princess will try to show up in non-castle levels. This usually
crashes the game immediately. Using another code I have that removes almost all
entities from all levels, I was able to get past this point in the underwater
version of 6-2, but there was absolutely nothing of interest beyond it.

And one final note. Because the game always thinks you're past World 5 when
using these codes, the levels are always "hard type." This means that any
extra enemies, firebars, Bullet Bill barrages, etc. will appear, and platforms 
are shorter than normal. In reference to world 1-1, this means that Pirahna
Plants will appear in all of the pipes. They usually do not appear on this
level due to a special case in the game code that works only for the real 1-1.


THE CODES
--------------------------------------------------------------------------------

Num GCode  GVal  World Description
--- ------ ----- ----- ---------------------------------------------------------
0   AEAPYA 0     1-1   World 1-1 (normal)
1   PEAPYA 1     2-1   World 2-1 (normal)
2   ZEAPYA 2     3-1   World 3-1 (normal)
3   LEAPYA 3     4-1   World 4-1 (normal)
4   GEAPYA 4     5-1   World 5-1 (normal)
5   IEAPYA 5     6-1   World 6-1 (normal)
6   TEAPYA 6     7-1   World 7-1 (normal)
7   YEAPYA 7     8-1   World 8-1 (normal)
8   AEAPYE 8     9-1   Underwater 6-2 (sometimes crashes, tries to show Princess)
9   PEAPYE 9     A-1   Underwater Coin Heaven (Type 2, night)
10  ZEAPYE 10    B-1   Underground 3-4
11  LEAPYE 11    C-1   Underwater 1-4
12  GEAPYE 12    D-1   Underwater 3-4
13  IEAPYE 13    E-1   "Fortress of Mystery" (Fall to your doom w/castle music)
14  TEAPYE 14    F-1   Underwater Coin Heaven (Type 2, night)
15  YEAPYE 15    G-1   World 1-2
16  AOAPYA 16    H-1   Underwater Pipe Bonus Area (similar to -1)
17  POAPYA 17    I-1   World 3-3
18  ZOAPYA 18    J-1   Underwater 3-4
19  LOAPYA 19    K-1   Terrestrial 3-4
20  GOAPYA 20    L-1   World 8-1
21  IOAPYA 21    M-1   World 3-3
22  TOAPYA 22    N-1   World 8-3
23  YOAPYA 23    O-1   Underwater Coin Heaven
24  AOAPYE 24    P-1   Underwater Coin Heaven (Type 1, day, turtles and firechain)
25  POAPYE 25    Q-1   Underwater 2-3
26  ZOAPYE 26    R-1   World 3-3
27  LOAPYE 27    S-1   World 8-1
28  GOAPYE 28    T-1   Coin Heaven
29  IOAPYE 29    U-1   Underwater 1-4
30  TOAPYE 30    V-1   World 3-3
31  YOAPYE 31    W-1   Underground version of Stuck Castle 2 (Two levels)
32  AXAPYA 32    X-1   World 8-4
33  PXAPYA 33    Y-1   Underwater 3-4
34  ZXAPYA 34    Z-1   Underwater 3-4
35  LXAPYA 35     -1   "Minus World" (2-2, 7-2)
36  GXAPYA 36          Underwater Coin Heaven (Type 2, night)
37  IXAPYA 37          World 1-2
38  TXAPYA 38          Underwater Pipe Bonus Area
39  YXAPYA 39    --1   World 3-3
40  AXAPYE 40    x-1   Underwater 1-1 Bonus Area
41  PXAPYE 41          Bizarre cloud world w/ Hammer Bros.
42  ZXAPYE 42    !-1   World 8-2
43  LXAPYE 43          World 3-3
44  GXAPYE 44          World 7-4
45  IXAPYE 45          World 2-2 (aka Minus World)
46  TXAPYE 46          World 7-2
47  YXAPYE 47          World 1-1 "Hard Type"
48  AUAPYA 48          Underwater 6-2 (w/glitches)
49  PUAPYA 49          1-1 "Hard Type" (pirahnas in pipes)
50  ZUAPYA 50          World 4-1
51  LUAPYA 51          CRASH
52  GUAPYA 52          World 3-1
53  IUAPYA 53          World 7-4
54  TUAPYA 54          Underwater 3-4
55  YUAPYA 55          CRASH
56  AUAPYE 56          World 1-3
57  PUAPYE 57          Normal Coin Heaven (Type 1)
58  ZUAPYE 58          Underwater 4-3
59  LUAPYE 59          World 1-2
60  GUAPYE 60          World 7-4
61  IUAPYE 61          Stuck Castle
62  TUAPYE 62          Underwater 2-4
63  YUAPYE 63          CRASH
64  AKAPYA 64          World 8-3 (->Terrestrial 2-4)
65  PKAPYA 65          World 2-1
66  ZKAPYA 66          Coin Heaven
67  LKAPYA 67          Underwater 1-1
68  GKAPYA 68          Underwater 6-3
69  IKAPYA 69          CRASH
70  TKAPYA 70          Terrestrial 7-4 (crashes)
71  YKAPYA 71          Terrestrial 3-4
72  AKAPYE 72          Underwater 3-4
73  PKAPYE 73          Underwater 4-3
74  ZKAPYE 74          World 4-3
75  LKAPYE 75          World 6-2 (-2 == Stuck Castle 2 [Two-level area with Beetle])
76  GKAPYE 76          Underwater 6-3
77  IKAPYE 77          World 2-1
78  TKAPYE 78          World 2-2 (aka Minus World)
79  YKAPYE 79          Underwater 3-4
80  ASAPYA 80          Underground 2-4
81  PSAPYA 81          World 1-3
82  ZSAPYA 82          World 2-3
83  LSAPYA 83          World 2-3
84  GSAPYA 84          World 2-3
85  ISAPYA 85          World 7-3
86  TSAPYA 86          World 2-1
87  YSAPYA 87          World 2-1
88  ASAPYE 88          World 2-1
89  PSAPYE 89          World 2-1
90  ZSAPYE 90          World 2-1
91  LSAPYE 91          World 2-1
92  GSAPYE 92          World 2-1
93  ISAPYE 93          World 2-1
94  TSAPYE 94          World 2-1
95  YSAPYE 95          World 2-1
96  AVAPYA 96          World 2-1
97  PVAPYA 97          World 2-1
98  ZVAPYA 98          World 2-1
99  LVAPYA 99          World 2-1
100 GVAPYA 100         World 2-1
101 IVAPYA 101         World 2-1
102 TVAPYA 102         World 2-1
103 YVAPYA 103         World 2-1
104 AVAPYE 104         World 2-1
105 PVAPYE 105         World 2-1
106 ZVAPYE 106         World 2-1
107 LVAPYE 107         World 2-1
108 GVAPYE 108         World 2-1
109 IVAPYE 109         World 2-1
110 TVAPYE 110         World 2-1
111 YVAPYE 111         World 2-1
112 ANAPYA 112         World 2-1
113 PNAPYA 113         World 2-1
114 ZNAPYA 114         World 2-1
115 LNAPYA 115         World 2-1
116 GNAPYA 116         World 1-1 (Hard type)
117 INAPYA 117         World 1-3
118 TNAPYA 118         World 6-3
119 YNAPYA 119         World 2-2 (aka Minus World)
120 ANAPYE 120         World 2-2
121 PNAPYE 121         Underwater 4-1
122 ZNAPYE 122         Underground 3-4
123 LNAPYE 123         World 8-3
124 GNAPYE 124         Underwater 1-1
125 INAPYE 125         CRASH
126 TNAPYE 126         Underground version of Stuck Castle 1 (crashes)
127 YNAPYE 127         World 6-3
128 EEAPYA -128        Underwater 4-3 (with Bowser)
129 OEAPYA -127        CRASH
130 XEAPYA -126        "Stuck" Castle (glitchy area)
131 UEAPYA -125        CRASH
132 KEAPYA -124        Bizarre cloud world with Hammer Bros.
133 SEAPYA -123        CRASH
134 VEAPYA -122        Underground 8-4 (Bowser's Castle)
135 NEAPYA -121        Underwater portion of Bowser's Castle
136 EEAPYE -120        Bizarre Underground Area (Mario automatically walks right)
137 OEAPYE -119        Underwater 3-4
138 XEAPYE -118        Underwater 1-1 (-2 == Underwater 8-3)
139 UEAPYE -117        Underwater 4-4
140 KEAPYE -116        World 6-1
141 SEAPYE -115        World 2-1
142 VEAPYE -114        CRASH
143 NEAPYE -113        World 2-1
144 EOAPYA -112        World 1-2
145 OOAPYA -111        Terrestrial 3-4
146 XOAPYA -110        Underwater 6-3
147 UOAPYA -109        CRASH
148 KOAPYA -108        World 4-1
149 SOAPYA -107        World 4-2
150 VOAPYA -106        World 8-4
151 NOAPYA -105        World 1-2
152 EOAPYE -104        Underwater 1-4
153 OOAPYE -103        CRASH
154 XOAPYE -102        World 8-3
155 UOAPYE -101        World 8-3
156 KOAPYE -100        World 8-3
157 SOAPYE -99         World 5-1 w/ 2 Entrance Pipes
158 VOAPYE -98         World 5-1
159 NOAPYE -97         World 5-1 w/ 2 Entrance Pipes
160 EXAPYA -96         World 5-1 w/ Entrance Pipe
161 OXAPYA -95         World 5-1
162 XXAPYA -94         World 5-1
163 UXAPYA -93         World 5-1
164 KXAPYA -92         Coin Heaven (Type 1)
165 SXAPYA -91         Coin Heaven (Type 1)
166 VXAPYA -90         Coin Heaven
167 NXAPYA -89         Coin Heaven
168 EXAPYE -88         Coin Heaven
169 OXAPYE -87         Coin Heaven (Type 1)
170 XXAPYE -86         Coin Heaven (Type 1)
171 UXAPYE -85         Coin Heaven (Type 1)
172 KXAPYE -84         Coin Heaven (Type 1)
173 SXAPYE -83         Coin Heaven (Type 1)
174 VXAPYE -82   .-1   World 4-3
175 NXAPYE -81         World 4-3
176 EUAPYA -80         World 4-3
177 OUAPYA -79         World 4-3
178 XUAPYA -78         World 4-3
179 UUAPYA -77         World 4-3
180 KUAPYA -76         World 4-3
181 SUAPYA -75         World 6-3
182 VUAPYA -74         World 2-1
183 NUAPYA -73         World 2-1
184 EUAPYE -72         World 4-3
185 OUAPYE -71         World 5-1 w/ 3 entrance pipes
186 XUAPYE -70         World 5-1 w/ 3 entrance pipes
187 UUAPYE -69         World 5-1
188 KUAPYE -68         Underwater 2-3
189 SUAPYE -67         CRASH
190 VUAPYE -66         CRASH
191 NUAPYE -65         Underwater 4-4
192 EKAPYA -64         Underwater 2-3
193 OKAPYA -63         World 2-2 (aka Minus World)
194 XKAPYA -62         World 7-1
195 UKAPYA -61         CRASH
196 KKAPYA -60         Underwater 3-4
197 SKAPYA -59         Underwater 3-4
198 VKAPYA -58         World 2-4
199 NKAPYA -57         World 2-3
200 EKAPYE -56         Underwater 8-3
201 OKAPYE -55         World 7-2
202 XKAPYE -54         CRASH
203 UKAPYE -53         World 2-3
204 KKAPYE -52         Underwater 4-4
205 SKAPYE -51         World 2-2 (aka Minus World)
206 VKAPYE -50         World 1-4
207 NKAPYE -49         Underwater 4-3
208 ESAPYA -48         Underwater 1-1 Bonus Area
209 OSAPYA -47         World 2-2 (aka Minus World)
210 XSAPYA -46         Underwater 4-2 6-7-8 Warp Zone
211 USAPYA -45         World 7-1
212 KSAPYA -44         Underwater 4-4
213 SSAPYA -43         Underwater 3-4
214 VSAPYA -42         Underwater part of Bowser's Castle
215 NSAPYA -41         World 3-1
216 ESAPYE -40         World 4-2
217 OSAPYE -39         World 2-3
218 XSAPYE -38         Underwater 1-1 Pipe Bonus Area
219 USAPYE -37         Underwater 4-4
220 KSAPYE -36         Underwater Coin Heaven (Type 1, day, turtles and firechain)
221 SSAPYE -35         Underwater 3-4
222 VSAPYE -34         World 5-1
223 NSAPYE -33         "Fortress of Mystery"
224 EVAPYA -32         CRASH
225 OVAPYA -31         CRASH
226 XVAPYA -30         Underwater 4-4
227 UVAPYA -29         World 4-2
228 KVAPYA -28         World 1-3
229 SVAPYA -27         Underwater 3-4
230 VVAPYA -26         World 7-1
231 NVAPYA -25         Underwater 4-4
232 EVAPYE -24         World 7-1
233 OVAPYE -23         World 4-2
234 XVAPYE -22         World 2-2 (aka Minus World)
235 UVAPYE -21         CRASH
236 KVAPYE -20         World 7-1
237 SVAPYE -19         World 4-3
238 VVAPYE -18         World 7-1
239 NVAPYE -17         Stuck Castle 1
240 ENAPYA -16         World 3-1
241 ONAPYA -15         World 4-2
242 XNAPYA -14         World 3-1
243 UNAPYA -13         World 8-1
244 KNAPYA -12         World 7-1
245 SNAPYA -11         Underwater 3-4
246 VNAPYA -10         World 3-3
247 NNAPYA -9          Underwater Coin Heaven (Type 1, turtles, firechain)
248 ENAPYE -8          Underwater 3-4
249 ONAPYE -7          CRASH
250 XNAPYE -6          CRASH
251 UNAPYE -5          Underwater 4-4
252 KNAPYE -4          World 3-2
253 SNAPYE -3          World 4-2 Warp Zone (6, 7, 8)
254 VNAPYE -2          Underwater 4-4
255 NNAPYE -1    0-1   Underwater 4-4