In some emulators, mostly SNES9x 1.43, the HDMA effects (which control the HUD display) are occasionally one line too soon or too late, resulting in screens like
this.
That's what the Fix_HUD function is for. It should only be used in those parts of the recorded video that contain actual gameplay. To see where they begin despite fade-in or fade-out effects, set the brightness with the SetGamma function.
The AviSynth script would then look like this:
AVISource(...)
SetGamma(10) # disable when done
Replace(1000, 2000, Fix_Hud) # Space Colony
Replace(3000, 100000, Fix_Hud) # Zebes
# ...
function Fix_HUD(clip c, bool "HUD", bool "Main") {
# clears the first line of the screen's HUD and main playing area
# optional parameters control which parts are cleared
HUD = default(HUD , true)
Main = default(Main, true)
c
p1 = Crop(0, 0, 0, 31)
p2 = Crop(0, 31, 0, 0)
p1 = (HUD ) ? p1.Crop(0, 1, 0, 0).AddBorders(0, 1, 0, 0) : p1
p2 = (Main) ? p2.Crop(0, 1, 0, 0).AddBorders(0, 1, 0, 0) : p2
StackVertical(p1, p2)
}
function Replace(clip c, int i, int j, clip d) {
Assert(i >= 0, "Replace: parameter i is negative")
Assert(j >= 0, "Replace: parameter j is negative")
p1 = c.Trim(0 , -i)
p2 = d.Trim(i , j)
p3 = c.Trim(j + 1, 0)
p1 = (i == 0) ? c.Trim(0, -1).DeleteFrame(0) : p1
p3 = (j == 0) ? c.Trim(0, -1).DeleteFrame(0) : p3
p1 + p2 + p3
return (c.HasAudio) ? last.AudioDub(c) : last
}
function SetGamma(clip c, float Gamma) {c.Levels(0, Gamma, 255, 0, 255, true)}