*Custom FCEU for MM2
To cause the DeLay scroll more easily
Custom FCEU only for the delay scroll that I made is used.

Custom FCEU for MM2 rev.5 Download
 

*Scroll Process
The processing of the scroll is the following.

Trace Log is here.
 

*Processing at delay scroll generation
You pay attention to three parts where Scroll judgment routine($C7A1) is called.
RegisterY is decided depending on the value of $38 usually.
As a result, the scroll judgment is done.
However, Y might go mad when NMI is caused by "ChangeBank routine" that exists in Scroll jugdgment routine.

*Principle of delay scroll
NMI is a subroutine executed with the family computer without fail every 1/60 seconds.
For MegaMan2, it seems to be used for synchronous processing of the BGM and ScoudEffect.

NMI might be generated in a momentary frame of the scroll while processing the scroll
before the "Routine that waits for NMI" when the NMI and the main routine are a lot of numbers of instructions that are.

In addition, the scroll judgment goes mad when the position in which NMI is generated is exquisiteness.





*Delay scroll is caused
When the scroll judgment is expanded, the following processing is done.
The value of Y goes mad when NMI occurs in a specific part.
 

 


*Condition of delay scroll generation
In a word, the condition that the delay scroll is caused is as follows.
It is necessary to adjust the value of SCRL that shows the number of instructions from $C7A5 to the NMI generation($CFED).
Moreover, when the delay scroll is caused, it is necessary to adjust the value of value ResSE of Y register that is the return value of the SoundCode.

Pattern1
Tech that can be used:
delay scroll , delay death , delay CurrentBeginScreen changed , delay direction change , delay radder tech
Condition1 NMI occurs in ($C006-C019) while ChangeBank($C000) immediately before $C7A8 when the scroll is being processed.   (SCRL should be adjusted to 4-13. )
Condition2 A register decided from the return value of the SoundCode meets the requirement of the scroll requirement .  (ResSE should meet the scroll requirement . )

Pattern2
Tech that can be used:
delay death , delay CurrentBeginScreen changed , delay direction change , delay radder tech
Condition1 NMI occurs in ($C006-C019) while ChangeBank($C000) immediately before $C7A8 when the scroll is being processed.   (SCRL should be adjusted to 25-34. )



*The delay scroll trial (When suitably adjusting it)
You read "sample4.lua" by using Custom FCEU for MM2 rev.5.
Your delay scroll adjustment starts because regrettable replay is variously tried and put out by it.

It is a standard to adjust the value of SCRL < 60.


SCRL came out and the example in which 61 is regrettable came out.
You understand the display in the column of SCRL as (+48).
This means processing is 48 instructions insufficient.


Then, you push "Start" in front of two frames displayed as (+48).
Then, the character of (+1) was seen in the column of SCRL.
If you can add processing, this is a regrettable example of meeting Condition1(NMI occurs between $C006-C016. ).

The amount of instructions is often adjusted like this by pushing the button.
(Especially, because about 40 increases instructions, "start button" is considerably effective.)


When start + left is pushed, CustomFCEU is displayed in the column of SCRL=(0!).  You met Condition1 in Pattern1.
However, the delay right scroll was not caused.

This is because value RetSE(B400,Y) of A register used for the scroll judgment became $80 the return value of the SoundCode called by NMI is "$0B" unfortunately.
In a word, this example will not meet Condition2.

The bit mask that RetSE should fill is as follows.

Kind of delay scroll BitMask
delay down scroll(goto next screen)
delay up scroll(goto previous screen)
$40
delay down scroll(goto previous screen)
delay up scroll(goto next screen)
$80
delay right scroll $20

If RetSE is "FF", you meet all these scroll requirements.
You have the bit mask not filled at the delay death and the delay ladder tech.

To calculate RetSE , Let's examine the return value of SoundCode( SE ) .
The SoundCode is called without fail every one frame in MegaMan 2, and the value is displayed in SE in custom FCEU.
Processing as which the SoundCode return value called when delay scrolls is the same is used.
In a word, if you are taking notes of SE , RetSE can be presumed to some degree .

When the jump sound was mixed, we understood the SE was decided regardless of the frame.

FrameCount Return value of SoundCode(SE)
285-303(Any sound is not mixed) $1C
304-327(Any sound is not mixed) $0B
328-338(Any sound is not mixed) $1C
jump sound was mixed $00
$01
$0B
$0F


Next, let's see the contrast table of SE and RetSE.
The contrast table of other stages is in Custom FCEU for MM2 rev.5 if you are necessary.

Contrast table of SE and RetSE of CrashManStage
  00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
00 80 80 81 80 80 80 81 80 80 80 80 80 80 80 21 20
10 00 00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF


RetSE used for the scroll judgment is decided.

FrameCount  Return value of SoundCode(SE) RegisterA(RetSE)
285-303(Any sound is not mixed) $1C $FF
304-327(Any sound is not mixed) $0B $80
328-338(Any sound is not mixed) $1C $FF
jump sound was mixed $00 $80
$01 $80
$0B $80
$0F $20

Meeting the requirement of delay right scroll, 285-303,328-338(Any sound is not mixed) or frame to which $0F returns when jump sound is mixed.
The adjustment of the jump sound that matches the frame is difficult.
Then, It seems to be good that you adjust the enemy movement so that the delay right scroll may succeed(285-303frame)



SCRLmeets Condition1 in the 301 frame.
RetSE became FF as we expected it and Condition2 was met.

The deLay right scroll succeeded safely. :)
 

We devise it so that SCRL may become small.
When a small value goes out, we adjust the change of operation, and change of push button , and shifting the frame a little.

Only this is an adjustment method of an easy delay scroll.  :P

*Method of use for adjustment of delay(instructions)
You should remember the adjusting method of the amount of instructions.

  処理 処理内容
NMI NMI
The number of processing is displayed in the column of NMI in Custom FCEU for MM2 rev.5.

The amount of processing shows and 800-2000 and every frame show a considerable change.
Therefore, the important factor is very occupied by adjusting the amount of instructions.
Exsample:[NMI_dumping.txt]

The delay scroll will be tried aiming at the frame with heavy amount of processing of NMI(NMI=1200-2000) when the enemy is few and the amount of processing is little.

The processing of NMI includes the processing of BGM and SoundEffect.
A few increase and decrease is possible because of the sound in which shot sound and H are accumulated , and jump sound etc...
(However, you note that the return value of the RetSE might change. )

As for NMI, 400 instructions addition is possible by "Jump ,standby, standby, standby, standby, Jump".

If the amount of the about 200 instruction is insufficient ,
the amount of the instruction of the NMI in the vicinity of the frame is measured beforehand,the timing that touches the screen edge is made the frame that NMI is large(+200instructions) by adjusting timing that MegaMan enters the screen.

Then, you succeed roughly.
 

Main routine MegaMan's movement
You use it for fine-tuning.

An increase in the amount of instructions is large as 2follows.
*MegaMan turns around momentarily of the scroll.
*Moment when MegaMan is drawn in to ladder.
push button
You push the start button and the amount of 40instructions can be increased.

You push the shot button, push the right and left at the same time, and the amount of the instruction increases a little. (Even when you cannot shot.)

You use it well for the adjustment when the number of 10-50 instructions is insufficient.
 
Enemy's movement
It is very important when the amount of instructions is a little.

The frame to which you try to make the delay scroll succeed should be made a frame with large amount of the instruction of NMI , if the amount of the instruction is a little.
And, you pile up the frame with large amount of the instruction of the enemy with the frame with large amount of the instruction of NMI.

The example of use to our present TAS includes the example of aiming at the following, heavy frames.
*Turning around + carrot launching of rabbit
*Moment where two bats begin to move
*Moment when MechDragon kicks down block
 
Reading of map The delay down scroll in the bubble man stage,
We are using that timing in which the shutter on a screen right edge is just displayed makes processing heavy a little.

It is the processing amount increase technique that is called "Just scroll".
destruction of enemy
The amount of the instruction increases when the enemy is defeated.

The delay down scroll in the bubble man stage, enemy defeating + large two energy appears by the metal braid.

As for 1UP and large energy, the amount of the instruction is large.
object is put
The item1 is a promising item that can be one addition of the amount of the instruction of about 500.

Other arms are also effective according to some place.

 

*Explanation of delay technique according to kind

Name of technique Outline of technique Bit mask of necessary RetSE Scroll judgment at time usually Scroll judgment when you use technique
delay right scroll You touch a screen right edge (In the part that doesn't right scroll).

You "right scroll" to the next screen by delay.
$20 previous screen:always NG
next screen:NG
previous screen:always NG
next screen:OK(delay is used)
delay shutter scroll You touch the left end shutter of the screen.

You "right scroll" to the next screen by delay.
$20 previous screen:always NG
next screen:NG
previous screen:always NG
next screen:OK(delay is used)
delay down scroll When the screen under is a hole, you touch under the screen.

You "down scroll" to the previous/next screen by delay.
$80 $40 previous screen:NG
next screen:NG(hole)
previous screen:OK(delay is used)
next screen:NG
previous screen:NG
next screen:OK(delay is used)
delay up scroll You touch the ladder outside the screen (place that cannot be scrolled).

You "up scroll" to the previous/next screen by delay.

$80 $40 previous screen:NG
next screen:NG
previous screen:OK(delay is used)
next screen:NG
previous screen:NG
next screen:OK(delay is used)
delay death

You touch under the screen (place where the screen under scrolls).

delay judges the hole and MegaMan dies.

not $40 not $80 previous screen:NG
next screen:OK
previous screen:OK
next screen:NG
previous screen:NG
next screen:NG(delay is used)(hole)
previous screen:NG(delay is used)
next screen:NG(hole)
delay CurrentBeginScreen change(exsample) Place that returns to the previous screen by "down scroll" or "up scroll".

CurrentBeginScreen($14) is changed depending on delay
- previous screen:OK
Decision proccecing of $14:normal
previous screen:OK
Decision proccecing of $14:mad(delay is used)
delay direction change(example) Place that advance to the next screen by "down scroll" or "up scroll".

MegaMan return to previous screen by delay.
$80 previous screen:NG
next screen:OK
previous screen:OK(delay is used)
delay radder tech(example) 1:You jump outside the screen toward the ladder.
2:You cannot grip the ladder until becoming Y>244 and $F9=0xFF
3:You push "up" only by 1frame and the up scroll signal is deleted by delay at the moment!
Y coordinates of MegaMan become about 10.
4:The fall starts (Y:10..20..30) outside the screen if you do not input anything at next frame.
5:When Y coordinates becomes 30-40, you push "up".
6:When Megaman goes to next screen,looks like the ladder tech
not $40 not $80 previous screen:NG
next screen:OK
previous screen:OK
next screen:NG
previous screen:NG
next screen:NG(delay is used)(Ladder that doesn't up scroll)
previous screen:NG(delay is used)
next screen:NG(Ladder that doesn't up scroll)

 

*Method of raising success percentage of delay scroll more

The person who had read here should have considerably understood the delay scroll.  :)
I introduce the advanced method that FinalFighter and Mr. Pirohiko are using in this section.

Even if the amount of the instruction is a little, it is necessary to make the delay scroll succeed in world record TAS.
You do not succeed if you are not measuring the amount of the instruction in detail when the amount of the instruction is a little.

0:The kind of the scroll judgment that occurs in a part concerned is understood.
   *Can MegaMan goto next screen?
   *Can MegaMan goto previous screen?
   *delay CurrentBeginScreen changed is used?

1:You take notes of the frame to which the scroll judgment is done with TAS first.
45360frame in case of this scroll.
 

2:You go to a right edge in the same vicinity of the frame.
   It is the same stage, the same frame, and neither the enemy nor the object exist.
   You go to a screen right edge with the scroll judgment, and you make it to a right push.(The use of cheat is OK. )

3:The amount of the instruction of NMI is traced.
  When becoming the number of frames in the vicinity of the memo examined by 1,
    sample5.lua is read, and dump does the value of NMI of each frame.

   The NMI value of each frame is output to the dump directory.
    As a result, you learn the number of instructions of NMI of each frame.

  *The file output lua function of the value is a special function of CustomFCEU.

  Y=20,X=240(Cheat is used) and the scroll judgment is called while pushing the right and NMI is measured.

The example of the output result becomes the following .
(number of frame) cfed_d0d3=number of instructions of NMI
(72891) cfed_d0d3=988
(72892) cfed_d0d3=982
(72893) cfed_d0d3=997
(72894) cfed_d0d3=981
(72895) cfed_d0d3=981
(72896) cfed_d0d3=1125
(72897) cfed_d0d3=988
(72898) cfed_d0d3=1012
(72899) cfed_d0d3=995
(72900) cfed_d0d3=979
(72901) cfed_d0d3=979
(72902) cfed_d0d3=1227
(72903) cfed_d0d3=986
 

4:Beforehand, you are calculating RetSE in the vicinity of the frame by which you aim at the delay scroll.
  It is to examine the act of not doing and the frame that doesn't succeed beforehand.

  (1)SE value of each frame is examined.

FrameCount Return value of SoundCode(SE)
285-303(Any sound is not mixed) $1C
304-327(Any sound is not mixed) $0B
328-338(Any sound is not mixed) $1C
jump sound was mixed $00
$01
$0B
$0F

  (2)RetSE is calculated from SE.

Contrast table of SE and RetSE of CrashManStage
  00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
00 80 80 81 80 80 80 81 80 80 80 80 80 80 80 21 20
10 00 00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF
FrameCount  Return value of SoundCode(SE) RegisterA(RetSE)
285-303(Any sound is not mixed) $1C $FF
304-327(Any sound is not mixed) $0B $80
328-338(Any sound is not mixed) $1C $FF
jump sound was mixed $00 $80
$01 $80
$0B $80
$0F $20

    For instance, When H accumulation was done more than 4 frames in the Woodman stage,
    Even if you try to make the delay scroll (next screen) succeeded , you fail because SE has been changed depending on the sound of H.
    Therefore, it is necessary to use an increase in the number of instructions by the jump sound.

5:You first increase the amount of instructions and the SCRL  < 200 is put out.
    It is following whats that we use well.
    *The frame of which the enemy's heavy behavior goes out is matched to the timing of the scroll.
    *Jump sound maximum addition(jump,wait,wait,wait,wait,jump)
    *Shot sound
    *Item1 is put

6:You calculate the amount of the instruction of present MainRoutine.
    *You calculate by NMI of the dump result in front of 1 frame and present SCRL value, and you learn a rough amount of processing of a present Main routine.
     As a result, you learn the instructions of pure MainRoutine except NMI.

   10000 - ( NMI of the dump result in front of 1 frame  + present value of SCRL ) = Amount of instruction of Main routine
 

7:The frame at which you aim from the value of NMI is decided.
    *If it is displayed that the value of SCRL is "+500",  you aim at the part where about 500 is large NMI ,the delay scroll succeeds.
    *When the amount of the instruction of mainroutine is a little, you aim at the frame that NMI is very large. (about 1200 over)
    *The amount of the instruction by the enemy is too unnecessary if there is a frame that NMI is very large fortunately.

This indicates the value of SCRL of the frame when you press up.

Frame count NMI result
27519 929   press up    
27520 913   press up  
27521 913   SCRL=1612   press up
27522 1296     SCRL=1596  
27523 999       SCRL=1216

Because NMI is large(1296) when you push up to 27521 frames, you understand amount of 400 instruction decrease.
This is because NMI is an amount of the instruction of 1296 whose about 400 is larger than 913.

8:When the frame at which you aim is decided, you move the frame and the same action is done.
  Because the amount of the instruction of Main routine changes when an action here changes, this method is used so as not to change it.
  The adjustment that doesn't change the enemy movement is the following.
|
  *You adjust it at intervals of the start.
    Start -> Arms switch menu -> Start -> Operation1 -> Operation2...
    Start -> Arms switch menu -> (1frame wait) -> Start -> Operation1 -> Operation2...
    Start -> Arms switch menu -> (2frame wait) -> Start -> Operation1 -> Operation2...

  *The number of frames delay entering the screen.
   Scroll -> next screen -> Operation1 -> Operation2... -> You arrive at the scroll place
   (1frame wait) -> Scroll -> next screen -> Operation1 -> Operation2... -> You arrive at the scroll place
   (2frame wait) -> Scroll -> next screen -> Operation1 -> Operation2... -> You arrive at the scroll place

  *The number of frames delay going to the position where the enemy begins to move.
   Before seeing the enemy -> You move to the position in which the enemy is seen
   Before seeing the enemy -> (1frame wait) -> You move to the position in which the enemy is seen
   Before seeing the enemy -> (2frame wait) -> You move to the position in which the enemy is seen
 

 
It is at the moment heavy(instructions) in many cases when the enemy is few...


Heavy NMI is piled up to the instructions of the main by delaying entering the screen.
Then, it approaches 10000 processing in total. (in a word , SCRL=0)

We are using to NMI weight different according to the frame.(The number of instructions of NMI is decided with the frame. )
The number of instructions of mains is decided by our action (The number of instructions of Main routine is not decided with the frame. )


9:When a minimum value goes out by the SCRL value(60 or less), you fine-tune it.
If the  SCRL value of 60-10 or 1-3 is output, you are sure to succeed if you push the button or a prior action is changed a little.

10:When the scrolling screen is different from what you wanted to
When you delay scroll to the previous screen when you want to delay scroll to the next screen , if you add the amount of the instruction of about 40, it becomes the next screen scrolling.