Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- A Nightmare on Elm Street NES Door Manipulation
- by ZeroNoin
- The RNG of the doors when a game starts in A Nightmare on Elm Street NES has a big effect on a speedrun.
- What really helps here is an RNG buffer/manipulation to get the ideal RNG every or about every time.
- I observed how the RNG and lag works in the RAM and came up with placing certain inputs in certain spots when the system Powers On.
- The door RNG is determined by the value in RAM address $06FD end of the player number select screen.
- The RNG is decided for door RNG on the last frame of the fade to black on the player number select screen.
- The value in the RNG address is affected by the Frame Counter value in $0021 and by the Inputs values in $0030, $0031, and $0032.
- This means that Controller Inputs can affect the RNG.
- Values in these addresses persist through Resets, so the manipulation must be done from Power On.
- Since this game does not initialize these addresses, the manipulation will work differently on different consoles and emulators.
- The resulting door RNG value is stored in $06F7.
- Since there are 6 possible door combinations, the value ranges from 00 to 06.
- A value of 00 is necessary because it puts the door in order from left (where the game begins) to right.
- A value of 01 is bad because the runner will need to complete the first stage before finding that the run is dead.
- A value of 02, 03, 04, or 05 will result in a quick reset.
- There is a special black screen following the first screen of text after the game is Powered On.
- During this screen, the game lags 10 frames while it loads the title screen.
- The RNG does not change and is unaffected during this black screen.
- What is also special about this black screen is Start can be pressed and held during it all the way to a game start.
- This provides an 11-frame window for changing and buffering inputs through to a new game.
- Power On also works as a place to buffer inputs, as holding inputs before the system turns-on will buffer perfectly each time.
- The black screen following the title screen also lags, but only 4 frames, so it is much less useful.
- So there are two points to press and hold different inputs - before Power On and during the black screen.
- Start cannot be held before the black screen because that prevents it from automatically starting a game.
- Start must be first pressed and held during the black screen.
- Holding Up from either Power On or the black screen all the way to a game start is useful because it automatically enters the first door.
- The template for the instructions for the NoES door RNG manipulation are as follows:
- Press and hold 0 or more inputs not including Start.
- Power On.
- Wait for the black loading screen following the text screen.
- Press and hold Start and 0 or more inputs all the start of the game.
- I made an FCEUX Lua script for finding these input combinations using different initialized RAM settings.
- Before this script the best buffer I found is holding Up, Powering On, then at the black screen also holding Select, Start, and A.
- FCEUX Lua Script for finding input combinations:
- http://pastebin.com/ufmkSAE9
- Memory Initialization
- Most games initialize various values in the memory (RAM) to make the instructions execute more reliably.
- There are many games that do not initialize memory values including Nightmare on Elm Street NES.
- Another example is Final Fantasy 1 which does not initialize some of the randomness values (Nasir likely did this deliberately).
- Uninitialized memory has a consequence for manipulation because various consoles and emulators have different uninitialized memory values.
- This means that different manipulation inputs will be required for different consoles and emulators.
- It also means that many individual NES consoles may be difficult to work with this manipulation.
- FCEUX
- By default FCEUX alternates setting addresses at 0x00 and 0xFF every four addresses.
- So all the lines look like this:
- 00000000FFFFFFFF00000000FFFFFFFF
- The two best manipulations I have noticed for FCEUX (and my Toploader):
- Hold Up, Power On, at the black screen keep holding Up and also press and hold Select, Start, and A through to a game start.
- Hold nothing, Power On, at the black screen press and hold Left, Select, Start, and B to a game start.
- The bottom of this document includes the results of the FCEUX script for the default FCEUX and Toploader memory values.
- Toploader NES (NES 2)
- The Toploader NES seems to tend to initialize memory very similarly and perhaps identically to FCEUX.
- I have already managed to get some manipulations for FCEUX to work on my Toploader.
- I have about a 100% success rate using these manipulations on my Toploader:
- Hold Up, Power On, at the black screen keep holding Up and also press and hold Select, Start, and A through to a game start.
- Hold nothing, Power On, at the black screen press and hold Left, Select, Start, and B to a game start.
- I cannot be sure that most or all Toploaders work with this manipulation, but it seems much more likely with these consoles.
- AV Famicom (Famicom 2)
- I would imagine the AV Famicom would be similar to the Toploader, but do not know for sure.
- BizHawk
- By default Bizhawk sets all memory values to 0xFF for a Power On.
- So all the lines look like this:
- FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
- As a result of this the door RNG manipulation is incredibly easy in BizHawk.
- There are three easy options:
- Hold nothing, Power On, at the black screen press and hold Start through to a game start.
- Hold nothing, Power On, at the black screen press and hold Up and Start through to a game start.
- Hold Up, Power On, at the black screen keep holding Up and also press and hold Select and Start through to a game start.
- The BizHawk default memory can be simulated in the FCEUX Lua script by entering 0xFF for all the SET variables.
- Frontloader NES (NES 1)
- Memory initialization in individual NES Frontloaders is very unreliable.
- Different individual Frontloader consoles seem to initialize in different ways.
- They tend to initialize differently based on what values were in the memory prior to the Power On.
- And they tend to initialize differently based on the amount of time the console was off prior to the Power On.
- Having the console off for 1 second, 5 seconds, 10 seconds, 30 seconds, 1 minute, or 5 minutes can all each produce different results.
- Perhaps some individual Frontloaders have more reliable memory, and these were likely produced later in the NES era.
- I own a Frontloader that immediately clears memory for reliable FF1 manipulation, but I cannot get reliable NoES manipulation from it.
- First try some inputs that work for FCEUX, then some for BizHawk, and see if either will work for Frontloader.
- What may help in examining individual Frontloader memory is a Homebrew NES ROM for testing it.
- Famicom (Famicom 1)
- I would imagine the original Famicom would be similar to the Frontloader, but do not know for sure.
- Flash Cart
- PowerPak and EverDrive may or may not use NES console memory when loading games.
- And this loading may or may not produce the same behavior for NoES in every console using a certain model of flash cart.
- So far Skavenger216 found that using EverDrive on his Frontloader he could reliably get the manipulation.
- His inputs are holding Up while the game is loading on the EverDrive, then add and hold Select, Start, B, and A at the black screen.
- Homebrew NES Memory Initialization ROM
- Something that could potentially help in doing manipulation on many Frontloaders is a ROM that can display and set RAM addresses.
- It would be run on flash cart reading unitialized addresses and using a simple two-color text pattern table.
- A ROM could be made specific for NoES for the manipulation addresses of $0021, $0030, $0031, $0032, and $06FD.
- The ROM could also set the addresses after looking at them to values like 0x00 or 0xFF or to random values using random instructions.
- After setting the addresses, further Power cycles would see what happens to the addresses.
- This could be used to look for tendencies and/or reliable values that show in the addresses through Power cycles.
- These values can then be plugged into the Lua Script and inputs can be found that work with those values.
- A similar ROM could be used for clearing or setting the memory between FF1 or NoES attempts.
- Could a similar ROM be used for something that would be considered cheating in speedrunning is another question.
- Another option would be finding a game that initializes memory in a good way and using it to clear memory.
- I am not sure if flash carts use some of the console RAM when loading after a Power On, but this may need to be addressed.
- If flash carts have these problems, either different firmware or some re-written ROM chips may be necessary.
- Credits
- Skavenger216 for finding a reliable setup on his EverDrive with Frontloader, which might apply to all EverDrives on any console.
- I kind of overlooked the idea of potentially using the loading of flash carts to your advantage until Skavenger pointed things out.
- Manipulation Inputs for Address Values Common in Toploaders and by Default in FCEUX
- 325/5184 Possible Sets of Inputs Work (6.3%)
- Counter Set: 0 || Inputs Set: 0 0 0 || RNG Set: 255
- | || BST L |
- | ||ABST R|
- | R|| T D R|
- | R||A ST DL |
- | R||AB T DL |
- | L || STU R|
- | L || B TU L |
- | L ||A ST D |
- | L ||A ST D R|
- | L ||A ST DL |
- | L ||AB TU L |
- | D || STU R|
- | D || BST L |
- | D R|| TU |
- | D R|| ST R|
- | D R||A TU |
- | D R||AB T D |
- | D R||ABSTU L |
- | DL || T R|
- | DL || B T L |
- | DL ||A T |
- | DL ||AB T DL |
- | DL ||ABSTU |
- | U || T D R|
- | U || B T D |
- | U || BSTU L |
- | U ||A T D R|
- | U ||A STU |
- | U ||A STU L |
- | U ||ABSTU |
- | U R|| ST D |
- | U R||A T |
- | U R||AB TU |
- | U L || ST DL |
- | U L || B T L |
- | U L ||A T R|
- | U L ||A T L |
- | U L ||AB TU R|
- | U L ||ABST L |
- | S || T R|
- | S || BST DL |
- | S ||AB TU L |
- | S R||A ST |
- | S R||A STU L |
- | S L ||A ST R|
- | S L ||ABST D |
- | S L ||ABST DL |
- | S D || STU R|
- | S D || B T D R|
- | S D || BST D R|
- | S D ||A T |
- | S D ||A ST D |
- | S D ||AB TU L |
- | S D R|| T R|
- | S D R|| B T D R|
- | S D R|| B T DL |
- | S D R||A T D R|
- | S D R||ABSTU L |
- | S DL || ST R|
- | S DL || B T DL |
- | S DL || BST L |
- | S DL ||A TU |
- | S DL ||A ST |
- | S U || BST D |
- | S U ||ABST |
- | S U R||AB T D |
- | S U R||ABSTU |
- | S U R||ABSTU L |
- | S U L || STU L |
- | S U L || B TU |
- | S U L || BSTU L |
- | S U L ||A STU |
- | S U L ||ABST DL |
- | S U L ||ABSTU |
- | B || B TU R|
- | B || BST D R|
- | B ||A T L |
- | B ||A TU |
- | B ||A TU R|
- | B ||A TU L |
- | B ||ABST |
- | B R|| B TU L |
- | B R||A ST DL |
- | B R||ABST D |
- | B L ||A T L |
- | B L ||A ST |
- | B L ||A ST DL |
- | B L ||AB TU L |
- | B L ||ABSTU |
- | B L ||ABSTU L |
- | B D ||A T |
- | B D ||ABST L |
- | B D ||ABST D |
- | B D R|| B T |
- | B D R|| B TU L |
- | B D R|| BST D |
- | B D R||A TU R|
- | B D R||A ST |
- | B DL || ST |
- | B DL || BSTU |
- | B DL ||A T D R|
- | B DL ||A TU L |
- | B DL ||ABST L |
- | B U ||ABSTU |
- | B U ||ABSTU L |
- | B U R|| TU L |
- | B U R|| BSTU L |
- | B U R||A ST D |
- | B U R||AB T |
- | B U R||ABST D |
- | B U R||ABST DL |
- | B U L ||A T D |
- | B U L ||ABST D |
- | B U L ||ABSTU |
- | BS || ST R|
- | BS || BSTU |
- | BS ||AB T L |
- | BS R|| ST R|
- | BS R|| ST L |
- | BS R|| ST D R|
- | BS R|| BST R|
- | BS R|| BSTU |
- | BS R|| BSTU R|
- | BS R||A ST |
- | BS R||ABST L |
- | BS L || TU L |
- | BS L || BSTU R|
- | BS L ||A ST DL |
- | BS L ||AB TU L |
- | BS L ||ABST |
- | BS D || ST R|
- | BS D || BST D R|
- | BS D ||A T D R|
- | BS D ||A ST |
- | BS D ||A ST L |
- | BS D ||A STU R|
- | BS D ||AB T L |
- | BS D ||ABST L |
- | BS D ||ABSTU L |
- | BS D R|| ST R|
- | BS D R|| BSTU R|
- | BS D R||A TU |
- | BS D R||AB T L |
- | BS D R||AB TU |
- | BS D R||AB TU L |
- | BS D R||ABST L |
- | BS D R||ABSTU |
- | BS D R||ABSTU L |
- | BS DL || T L |
- | BS DL ||A T L |
- | BS DL ||A ST D R|
- | BS DL ||AB T |
- | BS DL ||AB TU |
- | BS U ||A T D R|
- | BS U ||A ST |
- | BS U ||A ST DL |
- | BS U ||A STU R|
- | BS U ||AB TU L |
- | BS U R||A ST |
- | BS U R||AB T D |
- | BS U R||ABST |
- | BS U R||ABSTU L |
- | BS U L || T R|
- | BS U L ||ABSTU L |
- |A || BST D R|
- |A || BSTU |
- |A ||A T D R|
- |A ||ABST L |
- |A R|| BSTU |
- |A R|| BSTU L |
- |A R||A ST D R|
- |A R||AB T DL |
- |A R||AB TU R|
- |A R||ABSTU |
- |A L || T R|
- |A L || T D R|
- |A L || ST L |
- |A L || STU R|
- |A L || B TU R|
- |A L || BSTU L |
- |A L ||A ST DL |
- |A D || T D R|
- |A D || TU R|
- |A D || B TU L |
- |A D ||A ST |
- |A D ||A ST R|
- |A D R|| ST |
- |A D R|| STU L |
- |A D R||A T L |
- |A D R||A ST D R|
- |A D R||AB TU |
- |A D R||AB TU R|
- |A D R||ABST D |
- |A DL || TU R|
- |A DL || BST L |
- |A DL ||A TU R|
- |A DL ||AB TU L |
- |A U || ST R|
- |A U || STU R|
- |A U ||A STU R|
- |A U R|| STU R|
- |A U R||A ST L |
- |A U L || BST L |
- |A U L ||A T D |
- |A U L ||AB T L |
- |A U L ||AB TU |
- |A U L ||AB TU L |
- |A U L ||ABST D |
- |A S || T R|
- |A S || TU R|
- |A S || ST L |
- |A S || BST L |
- |A S ||A TU L |
- |A S ||ABST D |
- |A S R|| T D R|
- |A S R|| ST DL |
- |A S R|| B TU R|
- |A S R|| BST DL |
- |A S R||A TU |
- |A S R||AB T D |
- |A S R||AB T DL |
- |A S L ||AB T DL |
- |A S D ||AB T |
- |A S D ||ABST DL |
- |A S D R|| ST D R|
- |A S D R|| B T R|
- |A S D R|| BST D |
- |A S D R||ABSTU L |
- |A S DL || B T R|
- |A S DL || BST D R|
- |A S DL ||ABSTU L |
- |A S U || T R|
- |A S U ||A ST D R|
- |A S U R|| T D R|
- |A S U R|| ST D |
- |A S U R|| ST D R|
- |A S U R||A ST |
- |A S U R||A ST L |
- |A S U R||A STU L |
- |A S U R||AB T L |
- |A S U R||ABST |
- |A S U L || BST DL |
- |A S U L ||A TU |
- |A S U L ||AB T D |
- |A S U L ||AB TU |
- |A S U L ||AB TU L |
- |AB || T D R|
- |AB || BSTU R|
- |AB ||AB T D |
- |AB ||ABST |
- |AB R|| T D R|
- |AB R|| B T DL |
- |AB R||ABST D |
- |AB R||ABST D R|
- |AB R||ABST DL |
- |AB L || T R|
- |AB L || TU R|
- |AB L || B T |
- |AB L ||A ST |
- |AB L ||AB T |
- |AB L ||ABST D |
- |AB D || T D R|
- |AB D ||A TU R|
- |AB D ||A ST D |
- |AB D ||AB T D |
- |AB D R|| BST R|
- |AB D R||A T L |
- |AB D R||AB T R|
- |AB DL || T D R|
- |AB DL || TU R|
- |AB DL || TU L |
- |AB DL || B TU R|
- |AB DL || BST D R|
- |AB DL ||A STU |
- |AB U || T D R|
- |AB U || STU |
- |AB U || BSTU |
- |AB U ||A T R|
- |AB U ||A ST DL |
- |AB U ||AB T D |
- |AB U R|| ST R|
- |AB U R|| B T DL |
- |AB U R|| BSTU L |
- |AB U R||A T D |
- |AB U R||AB T L |
- |AB U L || ST D R|
- |AB U L || B T D R|
- |AB U L || BST R|
- |AB U L ||A STU R|
- |AB U L ||ABSTU L |
- |ABS || BST D |
- |ABS R|| B T R|
- |ABS R|| B T D |
- |ABS R|| BST D R|
- |ABS R||A T L |
- |ABS R||A TU |
- |ABS L || TU R|
- |ABS L || ST L |
- |ABS L || STU L |
- |ABS L || B T D R|
- |ABS L || BSTU R|
- |ABS L ||A T R|
- |ABS L ||A ST D R|
- |ABS L ||AB TU R|
- |ABS L ||ABST D |
- |ABS D || B T R|
- |ABS D || BST R|
- |ABS D || BSTU L |
- |ABS D ||ABST D |
- |ABS D ||ABST DL |
- |ABS D R|| T R|
- |ABS D R|| STU R|
- |ABS DL || BSTU R|
- |ABS DL ||A T L |
- |ABS U || B T |
- |ABS U || B TU |
- |ABS U ||A TU |
- |ABS U ||A ST |
- |ABS U R||A TU R|
- |ABS U L || T D R|
- |ABS U L || ST |
- |ABS U L || BSTU |
- |ABS U L ||A T D |
- |ABS U L ||A TU L |
- |ABS U L ||AB TU |
- ZeroNoin
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement