A decade later and I'm back working on the TAS for Flying Dragon. This time I've learned 6502 and have figured out how the timed and fixed enemy spawns work, which targets will appear in the fights, and how to find the enemy AI code that triggers ⭐️ hits in the fights that have them.
I've done a lot of working optimizing the side scrolling sections based on where it's most efficient to get the 5 normal enemies to spawn per boss, but I imagine there are still a few frames to pick up in the first two stages. The third stage adds the ability to fire your "Cosmic Saucers" while jumping which helps avoid ~11 frames of punching animation each time, but the majority of the stage has pits which interfere with enemy and boss spawning so I have to be especially stingy with moving to the right until I unlock that ability from the third boss.
I believe the martial arts sections are very well optimized; if it looks like I do something silly it's usually because enemies will dodge or block certain attacks and you can't change those outcomes by waiting for the next frame or anything else simple. Many of the Hiryu-No-Ken hits are actually being dodged, but frame perfect input sometimes allows you to connect with the attack anyway: if an enemy is jumping, they should not be hit when they land in ordinary game play. One difficulty with this game is that the martial arts fights carry some state into the next fight, even across side scrolling levels, so if I improve an early fight I have to fix up all of the subsequent fights.
I've been playing on
Hiryuu no Ken - Ougi no Sho (Japan).nes
because that's what the world-record speedrun uses (see
https://www.speedrun.com/flying_dragon_the_secret_scroll), it has better SFX, and I believe the training sequence is faster. The WR up to this point takes ~32,000 frames and the TAS is up to 23,856 frames. The WR in total is ~62,700 frames, but there are more martial arts fights in the second half of the game, so I expect to be able to come in well under the 47,000 frames that I'm on track for.
FCEUX inputs for the first half of the game:
User file #https://tasvideos.org/UserFiles/Info/639199335019967706