This submission beats "Dragon Quest (J)" in about 6:20, using "Stone of Sunlight glitch". I used the Famicom version because the NES version doesn't have this glitch.
NOTE: I'm not sure if this movie syncs on a real console. For example, in this movie, the game reads PPU write-only registers as data.
At first, I made a movie on FCEUX, but we replaced it with this SubNesHawk movie for accuracy. I believe we have to use SubNesHawk to make a verifiable movie of this game, because this game sometimes polls multiple inputs in a frame.

Game objectives

  • Emulator used: BizHawk 2.9 (SubNesHawk core)
  • Aims for fastest time
  • Major skip glitch

About the glitch

"Stone of Sunlight glitch" is originally found by cheap. I will describe it as possible as I can.
First, you can take chests unlimitedly if you fill up the "open-chest" array (address $2A-$39). To do so, take some chests in a dungeon and die before exiting. Then the array is not re-initialized, so you can fill up the array before you take all chests in Tantegel Castle. (Note that the capacity of the array is 8 elements, and the array always has 3 elements for the chests in the throne room in Tantegel Castle)
In this situation, if you take the chest containing "Stones of Sunlight", a glitch occurs and the game displays a string "12345". This is harmless by itself. But if your inventory is full, the game corrupts the window buffer ($0400-$07BF). And, the window buffer is corrupted a bit more if you open and close the inventory window.
After corrupting the window buffer as above, scrolling the message window (dropping an item, using a cursed item, talking, etc.) causes a significant glitch and the game reads the beginning of zeropage memory as text script commands. Furthermore, the game treats zeropage memory as window buffer and corrupts it by message scrolling process.
By the way, the "beat Dragonlord" flag exists at bit2 of $E4. So, if you can manipulate this address, you can beat the game just by going to the front of the king. But sometimes the game is softlocked by the glitch. Moreover, the address $E5 (message speed) is also often corrupted. If the message speed value is too large, conversations take so long time.
As I said, the game reads zeropage memory as text script commands. So, you can write some script commands at some addresses (e.g. $47 (input), $4F (nmi counter), $50 (sprite animation counter)...).
When the game corrupts zeropage memory by message scrolling, it writes via the pointer $42. And this pointer is also corrupted by the glitch. I found that the game writes 0 to $42 in many cases. In such cases, the game corrupts only the beginning of zeropage, so you cannot change $E4. To corrupt memory over $42, you need to write a large value to $42. To do so, write some script commands which emits multiple characters. For script commands, see Data Crystal.
Unfortunately, I haven't yet found a method to control this glitch precisely. It is difficult to analyze since it works like self-modifying code.
rat926 uploads some examples of this glitch (movie files are available from the description texts):
Sometimes the hero name is corrupted by the glitch, and this tends to freeze the game when you talk to the king. But, you can sometimes avoid the freeze by opening and closing the menu beforehand (it partially fixed the corrupted hero name). This technique is found by pirohiko.

About the run

The hero's stats depend on his name. I named him "は" for the reasons below:
  • He has 15 HP, so he can walk through poisonous marsh with only one herb.
  • He has 3 agility, so enemies can easily surprise him (useful for deathwarp).
  • You can minimize cursor movements in the name screen.
I go to Rimuldar and buy a key. And I return to Tantegel by deathwarp.
I go to Rock Mountain Cave, open 5 chests, and fill up the inventory. And I deathwarp back to Tantegel. Note that the "open-chest" array is filled up.
I go to the basement of Tantegel, and execute Stone of Sunlight glitch. I set $47 (input) to 0xAF (word "にじのしずく"), and set $50 to 0x70 (word "ラダトーム").
The game enables the "beat Dragonlord" flag. The message speed value is still 0. And I go to the front of the king and beat the game.
Note: In the first FCEUX movie, I mistaked the path in the bottom floor of Rock Mountain Cave, but this issue is fixed in the submission movie. (Thanks to juef for pointing out this.)

Possible improvements

This movie is just a resync of a NesHawk movie. In theory, you will be able to manipulate the RNG more efficiently taking advantage of subframe inputs. (For reference, I put a Lua script to resync a NesHawk movie for SubNesHawk.)

Samsara: I've tentatively added the "game end glitch" branch (EDIT: I actually did this time! I certainly didn't forget to do so on my first edit!!!), but I'm also dropping my judgement claim in order to let someone with more technical prowess judge the run more accurately. My fondness for TASes of this game remains the same, however.

feos: Claiming for judging.
feos: It's not often that a submission triggers improvements in emulation, but I've reached out to the nesdev people and got a test ROM that will allow us to see how consoles work with reading write-only PPU registers (which this movie relies on). While we're waiting for more console tests of it, I'm delaying this submission.
Note that it doesn't mean that we will require emulation to be so good that this run will start syncing on console. Due to how console behavior on this front seems to be non-deterministic, and different from device to device, I want to accept this run (its SubNESHawk resync) if it's determined that this movie will work in principle if things align correctly, even if we can't find a console it will sync on.
feos: Replacing with a SubNESHawk resync and accepting as a new branch.
We've done due research, and based on the available info, nobody (not even NESDev gurus) claimed that this movie relies on an emulator glitch, even if it doesn't sync on the consoles we were able to try it on. We can't keep scrutinizing it further hoping to find a reason to reject, because reject reasons need to be way more apparent.

despoa: Processing...


TASVideoAgent
They/Them
Moderator
Joined: 8/3/2004
Posts: 15628
Location: 127.0.0.1
This topic is for the purpose of discussing #8072: TaoTao's NES Dragon Warrior "game end glitch" in 06:19.51
Player (13)
Joined: 6/17/2006
Posts: 510
Easy Yes vote for me due to 621621621621621621621621621621621621621621621621621621621621621621621621 I am concerned about the possibility of an emulation inaccuracy affecting this run though. This should be verified in my opinion.
Bigbass
He/Him
Moderator
Joined: 2/2/2021
Posts: 194
Location: Midwest
I performed three attempts to console verify this movie. Unfortunately all three attempts desynced in the same way, consistently. At approx 1:28 (of the encode video), on the 2nd green tile after exiting the city, I get an encounter with some kind of red blob (lol idk what the enemies are in this game). After fighting for a few moments, it exits the battle, moves around a bit, and then encounters a blue blob. The location of the encounters and seemingly the battles themselves, all appear to be consistent between attempts. I do not have the equipment necessary to initialize Work RAM; although given the consistency of the desyncs, I feel it's unlikely that initializing RAM would help (unless this is one of the rare cases where the Everdrive menu happens to consistently set values that the game depends on for RNG). In the past, I've tried and failed to verify the existing publication of this game, too. Perhaps it could be something on my end, some quirk that my device doesn't handle, honestly I don't know.
TAS Verifications | Mastodon | Github | Discord: @bigbass
Active player (437)
Joined: 4/21/2004
Posts: 3517
Location: Stockholm, Sweden
If there's something strange, in your neighborhood, who ya gonna call? AKTAN!!!!
Nitrogenesis wrote:
Guys I come from the DidyKnogRacist communite, and you are all wrong, tihs is the run of the mileniun and everyone who says otherwise dosnt know any bater! I found this run vary ease to masturbate too!!!! Don't fuck with me, I know this game so that mean I'm always right!StupedfackincommunityTASVideoz!!!!!!
Arc wrote:
I enjoyed this movie in which hands firmly gripping a shaft lead to balls deep in multiple holes.
natt wrote:
I don't want to get involved in this discussion, but as a point of fact C# is literally the first goddamn thing on that fucking page you linked did you even fucking read it
Cooljay wrote:
Mayor Haggar and Cody are such nice people for the community. Metro City's hospitals reached an all time new record of incoming patients due to their great efforts :P
Experienced player (942)
Joined: 9/18/2008
Posts: 154
Location: Japan
Bigbass, thank you for the verification!
Bigbass wrote:
At approx 1:28 (of the encode video), on the 2nd green tile after exiting the city, I get an encounter with some kind of red blob (lol idk what the enemies are in this game). After fighting for a few moments, it exits the battle, moves around a bit, and then encounters a blue blob. The location of the encounters and seemingly the battles themselves, all appear to be consistent between attempts.
They are probably Red Slime and Slime in the NES version. This game updates the RNG every frame. Additionally, you can pause the game to manipulate the RNG. While the game is paused, the game polls inputs and updates the RNG in a loop. So, an emulator will need cycle-wise accuracy to emulate this game exactly.
Bigbass wrote:
I do not have the equipment necessary to initialize Work RAM; although given the consistency of the desyncs, I feel it's unlikely that initializing RAM would help (unless this is one of the rare cases where the Everdrive menu happens to consistently set values that the game depends on for RNG). In the past, I've tried and failed to verify the existing publication of this game, too. Perhaps it could be something on my end, some quirk that my device doesn't handle, honestly I don't know.
I think this game does not depend on an uninitialized RAM state. On startup, this game initializes only zeropage and OAM buffer page, but the rest of the memory is almost temporary buffers. If this movie is not verifiable even before the glitch is performed, it will be out of question to verify the glitch itself. So, if nobody can verify this movie, maybe it should be rejected, but I put this into the hands of a judge.
Editor, Publisher, Player (47)
Joined: 10/15/2021
Posts: 377
Is it possible to pull this glitch off on NESHawk? I think that is supposed to be cycle-accurate.
Experienced player (942)
Joined: 9/18/2008
Posts: 154
Location: Japan
despoa wrote:
Is it possible to pull this glitch off on NESHawk? I think that is supposed to be cycle-accurate.
It is possible to perform this glitch on NESHawk. But this is a very slow case (message speed value is 0x5F). For now, I haven't found a fast case (like this movie) on NESHawk. On FCEUX, in fast cases, the game tends to read the PPU register area (including mirror) as data. And NesHawk might behave differently in such cases.
juef
He/Him
Player (155)
Joined: 1/29/2007
Posts: 208
Location: Québec, Canada
Is the Mountain Cave bottom floor layout the same as in the US version? I believe the path that first grabs the two side-by-side chests is slightly shorter.
Experienced player (942)
Joined: 9/18/2008
Posts: 154
Location: Japan
juef wrote:
Is the Mountain Cave bottom floor layout the same as in the US version? I believe the path that first grabs the two side-by-side chests is slightly shorter.
Oh, that was my mistake. Thank you for pointing out. The map is the same as in the US version. And indeed your path is shorter by 2 steps. I want to fix this, but I'm not sure if I can reproduce the glitch later. For now, I will add this to the submission text.
Experienced player (942)
Joined: 9/18/2008
Posts: 154
Location: Japan
It seems that pirohiko reproduced a fast glitch case (like this movie) on a real console. Note that he uses "cartridge half-insertion" technique (it corrupts data loaded from CHR-ROM). In this video, he moves to the coordinate (0xFE, 0xFE). But it might be difficult for regular TAS. Because you will warp out of the map when your coordinate is out of bounds. (Bounds are at address $13, $14) In this video, I think that the warp portal data in CHR-ROM is not properly loaded and the warp process is skipped.
Experienced player (942)
Joined: 9/18/2008
Posts: 154
Location: Japan
Still I cannot reproduce this movie exactly on NesHawk, but I was able to reproduce a similar fast glitch case on NesHawk. Here is the encode: Link to video But I don't know whether it syncs on a real console. Bigbass says that he could not verify a NesHawk movie without the glitch. EDIT: Now I think that we have to at least use SubNesHawk to make a verifiable movie of this game. When the game is in the title scene, or the game is paused, the game continues to poll input in a loop without waiting for VBLANK. So, frame-based movies are unlikely to sync on a real console. I'm considering to make another movie on SubNesHawk when I have time. EDIT: I resynced the movie above for SubNesHawk. According to Bigbass, it syncs before performing the glitch on a real console, but desyncs after the glitch. In this movie, during performing the glitch, the game reads some text script commands from the PPU write-only registers. (You can confirm this with this Lua script) I guess that NesHawk's emulation might be still incomplete in such cases. (Or, it might be impossible to deterministically emulate such cases in the first place)
Site Admin, Skilled player (1255)
Joined: 4/17/2010
Posts: 11495
Location: Lake Char­gogg­a­gogg­man­chaugg­a­gogg­chau­bun­a­gung­a­maugg
Can you try reproducing this glitch on Mesen?
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
Experienced player (942)
Joined: 9/18/2008
Posts: 154
Location: Japan
feos wrote:
Can you try reproducing this glitch on Mesen?
Yes, I'll try it. But it might take some time since I have no experience making movies on Mesen. I'll use the HEAD commit of NovaSquirrel/Mesen-X. If you have any recommendations for other versions, please let me know.
Site Admin, Skilled player (1255)
Joined: 4/17/2010
Posts: 11495
Location: Lake Char­gogg­a­gogg­man­chaugg­a­gogg­chau­bun­a­gung­a­maugg
https://github.com/SourMesen/Mesen2 is newer, and I don't know if it supports rerecording.
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
Experienced player (942)
Joined: 9/18/2008
Posts: 154
Location: Japan
feos wrote:
https://github.com/SourMesen/Mesen2 is newer, and I don't know if it supports rerecording.
Thank you. I have noticed this, but it seems to be under very active development and not documented yet. So for now, I'll try with Mesen-X. On FCEUX and BizHawk, I achieved fast glitch cases with lua scripting, but I don't know it works well with Mesen family.
Site Admin, Skilled player (1255)
Joined: 4/17/2010
Posts: 11495
Location: Lake Char­gogg­a­gogg­man­chaugg­a­gogg­chau­bun­a­gung­a­maugg
How do I make a fceux version of your script that shows which PPU register mirror addresses were read? I'm trying
Language: lua

memory.registerexecute(0xBD29, function() local script_ptr = memory.readbyte(0x99) if 0x2000 <= script_ptr and script_ptr <= 0x3FFF then print(string.format( "%d: $%04X $%04X $%02X", emu.framecount(), script_ptr, 0x2000 + (script_ptr % 8), memory.readbyte(script_ptr) )) end end)
and it does nothing.
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
Experienced player (942)
Joined: 9/18/2008
Posts: 154
Location: Japan
feos wrote:
How do I make a fceux version of your script that shows which PPU register mirror addresses were read?
Language: lua

local script_ptr = memory.readbyte(0x99)
This does not read script pointer, but lower 8-bit of it. Please try memory.readbyte(0x99) + 0x100 * memory.readbyte(0x9A). EDIT: IIRC, the game also reads script commands at addresses other than 0xBD29. I recommend to use the trace logger.
Experienced player (942)
Joined: 9/18/2008
Posts: 154
Location: Japan
I still haven't been able to reproduce a fast glitch case on Mesen. It is easy to reproduce the glitch itself on Mesen. But for now, all cases either result in a softlock or fail to enable the "beat Dragonlord" flag. It is a bit difficult to search for a fast glitch case on Mesen, including Mesen2, because they don't seem to support rerecording. And, I wasn't able to write a botting script for Mesen as it appears that Mesen's Lua API is not designed for botting purposes. I'll try it manually when I have time, but please don't expect too much.
Site Admin, Skilled player (1255)
Joined: 4/17/2010
Posts: 11495
Location: Lake Char­gogg­a­gogg­man­chaugg­a­gogg­chau­bun­a­gung­a­maugg
Can you just edit memory to simulate successful botting, as a proof of concept for whatever depends on it?
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
Alyosha
He/Him
Editor, Emulator Coder, Expert player (3828)
Joined: 11/30/2014
Posts: 2834
Location: US
Here's a few possibly useful notes about this: - Mesen has a different power on state than NESHawk, they are not directly compatible for careful timing cases like reading from ppu. - You can change the cpu / ppu alignment in Mesen, this may or may not give more chances at success. - BigBass' test was done from reset, which isn't the same as doing the test from power on. - I briefly looked at where the ppu registers were being read, and it looks like it happens during rendering. Even if the test was done during power on, this gives a very low chance of success, probably worse than 1/8. I would try myself, but I have neither the game nor an adapter to play famicom games on my NES. - Reading from ppu write only registers has not in general been carefully tested.
Experienced player (942)
Joined: 9/18/2008
Posts: 154
Location: Japan
feos wrote:
Can you just edit memory to simulate successful botting, as a proof of concept for whatever depends on it?
I tried it, but Mesen didn't behave in the same way as FCEUX/NesHawk. (But, it read script commands from the ppu registers.) For reference, I put scripts to edit memory. * FCEUX: a script to save memory, a script to load memory (use the movie of this submission) * NesHawk: a script to save memory, a script to load memory (use the movie I uploaded above)
Site Admin, Skilled player (1255)
Joined: 4/17/2010
Posts: 11495
Location: Lake Char­gogg­a­gogg­man­chaugg­a­gogg­chau­bun­a­gung­a­maugg
lidnariq made a test ROM for PPU open bus decay. Can people with NES run it and maybe film the results? https://discord.com/channels/352252932953079811/450038053159960577/1098031542091141150 https://cdn.discordapp.com/attachments/450038053159960577/1098031541738799124/ppudecay.nes
Read the screen as an array of tests: XX-YYYY where XX is the byte precharged onto PPU open bus, and YYYY is how many loop iterations it look before PPU open bus changed its contents. Each loop is 15 CPU cycles
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
Bigbass
He/Him
Moderator
Joined: 2/2/2021
Posts: 194
Location: Midwest
feos wrote:
lidnariq made a test ROM for PPU open bus decay. Can people with NES run it and maybe film the results?
Link to video
TAS Verifications | Mastodon | Github | Discord: @bigbass
Site Admin, Skilled player (1255)
Joined: 4/17/2010
Posts: 11495
Location: Lake Char­gogg­a­gogg­man­chaugg­a­gogg­chau­bun­a­gung­a­maugg
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
Alyosha
He/Him
Editor, Emulator Coder, Expert player (3828)
Joined: 11/30/2014
Posts: 2834
Location: US
Link to video Here is a video of the original version. Note that this uses mapper 2 rather than mapper 7 in the original since I didn't have a mapper 7 dev board. There's no bank switching and both use CHR RAM so seems reasonable.