1 2
8 9
TiKevin83
He/Him
Ambassador, Moderator, Site Developer, Player (158)
Joined: 3/17/2018
Posts: 359
Location: Holland, MI
Something that may help this research: https://github.com/kaspermeerts/supermarioland It looks like there has been some amount of disassembly work on this game.
Editor, Expert player (2380)
Joined: 5/15/2007
Posts: 3963
Location: Germany
Just for future reference, there was some talk on Twitter a while ago (can't find it right now), that a Japanese RTA player managed to get the scroll glitch in 4-2, which caused the dropping platform at the end to be displaced so Mario could fall straight down, saving a bit of time. Although the glitch is very rare and lag-dependent, it may be possible to do it in a new TAS.
Editor, Expert player (2380)
Joined: 5/15/2007
Posts: 3963
Location: Germany
A while ago, TiKevin83 resynced and also console-verified the current normal mode TAS here. Since I had previously proven that the normal mode TAS can still be improved, I looked into implementing the improvement in the resynced bk2 movie file. I don't know how TiKevin83 managed to resync the normal mode run VBM because I had to add idle frames after every level and didn't get the same bonus game as in my "known improvement" VBM. After adding a "Pause, nothing, nothing, Unpause" input after 3-3's scoring finished, I managed to get a fireflower bonus game anyway. It didn't save 7 frames like anticipated, but actually 20 frames over the resynced bk2. The resynced bk2 kills the 1-3 boss and fades white from the bonus screen on frame 8496. The new bk2 which does not kill the boss fades white from the bonus screen on frame 8476. There are also these facts which played a role into getting more improvements: - I managed to find a 3 frame improvement in 1-3 by optimizing the pyramid section in the middle - For now, due to observations I made with the frame rules, I will assume that omitting the boss is faster than killing him. - I found that selecting a different color pattern during boot-up changes bonus game luck. So I went through world 1 without inserting any idle frames and then got a fireflower by pressing Down+B at frame 12 during boot-up. This made the bonus game fade-out at 8470, therefore saving 26 frames. - I still have to optimize world 1 for points before I can continue. - With the current movie, the Down+B input is the only color pattern that will give a flower in 1-3 bonus game. - If you use different button combinations during boot-up, one after the other, then it will give the result as if you had only pressed the last one. Sometimes it will give a start screen that is delayed by 1Frame so the movie desyncs. Therefore, selecting a color pattern multiple times will not give more control over the bonus game luck.
-----

Press on frame 12:	Outcome:		
< A			Ladder-2up 		(2, f, 3, 1)
^ A			Ladder-flower 		
> A			(late start screen)
v A			Ladder-2up		
< B			1up
^ B			2up
> B			1up
v B			Flower (Success!)
<			2up			(3, 1, 2, f)
^			(undesired outcome not noted)
>			Ladder-2up		(2, f, 3, 1)
v			(undesired outcome not noted)
press nothing		(undesired outcome not noted)

-----

Press on frame 12: <A
Press on frame 14: >B
Outcome:	1up

Press on frame 12: ^A
Press on frame 14: vB
Outcome:	(late start screen)

Press on frame 12: <
Press on frame 14: vB
Outcome:	(late start screen)

Press on frame 12: vB
Press on frame 14: <
Outcome: 	2up

Press on frame 12: ^a
Press on frame 14: >
Outcome:	Ladder-2up

Press on frame 12: <
Press on frame 14: >
Press on frame 16: va
Outcome:	 Ladder-2up
Found another 2 frame improvement, by taking mush and fireflower in 1-1 instead of 1-2. Maybe the obtaining of mush or fireflower in 1-2 was suboptimal. Getting Flower in 1-1 is better for getting points. Unfortunately, with the 2 frame improvement, I had to find a new suitable color pattern but there was no color pattern that gave a bonus game with fireflower. So I will have to insert an idle frame or two. EDiT: It seems the 2 frame improvement got defeated by the frame rule in 1-3. So I didn't save any more time, but this is good anyway. I found points improvements and there are possibly more color patterns that will get fireflower in 1-3 and maybe in world 2.
TiKevin83
He/Him
Ambassador, Moderator, Site Developer, Player (158)
Joined: 3/17/2018
Posts: 359
Location: Holland, MI
It was less of a resync and more a rewrite, yeah the lag was completely different everywhere and it threw off the bonus games. The bk2s for 1.0 and 1.1 should still be in userfiles. To make sure, you're using console mode GBA?
Editor, Expert player (2380)
Joined: 5/15/2007
Posts: 3963
Location: Germany
TiKevin83 wrote:
To make sure, you're using console mode GBA?
I'm using mode GBC mode. Oh, that might explain why there was such a time gap between the two movies. The boot-up on GBA takes a bit longer. Should the GBC mode be used because it is fastest? Or should the GBA mode be used to be able to play it back on console?
TiKevin83
He/Him
Ambassador, Moderator, Site Developer, Player (158)
Joined: 3/17/2018
Posts: 359
Location: Holland, MI
Yeah I won't be able to verify any further improvement unless console mode is GBA since the BIOS is slightly different - feel free to use whichever is fastest, there's no hard requirement to use a version that verifies and my verification was never submittable since it had no gameplay improvements
Emulator Coder, Judge, Experienced player (974)
Joined: 2/26/2020
Posts: 840
Location: California
MUGG wrote:
TiKevin83 wrote:
To make sure, you're using console mode GBA?
I'm using mode GBC mode. Oh, that might explain why there was such a time gap between the two movies. The boot-up on GBA takes a bit longer. Should the GBC mode be used because it is fastest? Or should the GBA mode be used to be able to play it back on console?
Using one console or the other for purely for a faster boot time is not considered a gameplay improvement here. You wouldn't be penalized for using GBA mode. Up to you for which mode you want to use.
Editor, Expert player (2380)
Joined: 5/15/2007
Posts: 3963
Location: Germany
Ok. For now I will continue working on a new run, but I'm not promising anything here... I will decide which mode to use. I guess it is possible to switch between the two (GBA and GBC) easily and the bonus luck can be adjusted quickly. At least until we get to 2-3's bonus game. So it doesn't matter for now.
Tikevin83 GBC modeTikevin83 GBA modeGBC by muggGBA by mugg
Idle frames usedUnknownUnknown1 on title screen2 on title screen
Color palette useddefaultdefaultdefaultdefault
Frame # Title screen visible203217203217
Frame # 1-3 fade to white830983238283*8297**
Frame # Bonus game faded out8496851084708484
1-3 Boss killed?yesyesnono
Score after 1-340,85040,85033,75033,750
(All movie files use ROM version 1.0 and Bizhawk 2.7-Gambatte core.) *8281 is possible, but the bonus game couldn't be manipulated. **8295 is possible, but the bonus game couldn't be manipulated. It looks like the 26 frame gap didn't come from any mode difference. I compared my GBC mode run to your movie file set to GBC. Todo: Try idle frames in other places.
Joined: 2/13/2022
Posts: 1
Location: Nova Scotia
MUGG wrote:
Just for future reference, there was some talk on Twitter a while ago (can't find it right now), that a Japanese RTA player managed to get the scroll glitch in 4-2, which caused the dropping platform at the end to be displaced so Mario could fall straight down, saving a bit of time. Although the glitch is very rare and lag-dependent, it may be possible to do it in a new TAS.
Found 3 examples, if you're still interested. https://www.youtube.com/watch?v=BfxDRLrz2eo https://twitter.com/edosoa/status/1233609718762881025 https://clips.twitch.tv/KitschySpicyEyeballKappaWealth
Editor, Expert player (2380)
Joined: 5/15/2007
Posts: 3963
Location: Germany
Got an odd scroll bug while TASing. There was not a single lag frame during the level. The text is shifted to the left one row so it looks like it's related to the previously known scroll bug - which omits a vertical row during the level but here, the vertical row is omitted right at the end of the level. It's not looking to be a timesaver. I changed the level to make the scrollbug not happen and the bonus game would still start at the same framecount.
Editor, Expert player (2380)
Joined: 5/15/2007
Posts: 3963
Location: Germany
I'm going to need to understand scroll bug better, in order to attempt it in the later levels. After I discovered my visualisation luascript doesn't run correctly due to syntax errors that have somehow slipped into that post, I tried to fix the script but now it will output information that's different from before (when compared to the screenshot I had posted). When running the "seemingly fixed" script, I noticed the information output is different between v1.0 and v1.1 of the game. V1.0 (Every few frames of running right) V1.1 (Every few frames of running right) Not sure what to make of this. Unfortunately, I'm not very good at this. Help on this would be very appreciated. My goal is a luascript that will do one or more of these things: - Detect when the scroll bug has occured - Visualize with a red vertical line which row has been omitted - For non-bug frames with writes to $FFEA, should show information like how many cycles have passed in that frame and how many cycles it should have been to make the bug frame occur (if that makes sense) Here is the script with syntax errors "seemingly fixed". Here is a movie file with the scroll bug happening.
Sand
He/Him
Player (145)
Joined: 6/26/2018
Posts: 192
MUGG wrote:
After I discovered my visualisation luascript doesn't run correctly due to syntax errors that have somehow slipped into that post… Here is the script with syntax errors "seemingly fixed".
Language: diff

-for n=1,table.getn(addressList) do +for n=1,#addressList do
I don't think it was a syntax error, exactly. It's just that the old script used the table.getn function, which was deprecated in Lua 5.1 and removed in Lua 5.2. BizHawk currently uses Lua 5.4. You fixed it correctly by changing it to use the # operator.
MUGG wrote:
I tried to fix the script but now it will output information that's different from before (when compared to the screenshot I had posted). When running the "seemingly fixed" script, I noticed the information output is different between v1.0 and v1.1 of the game. V1.0 (Every few frames of running right) V1.1 (Every few frames of running right)
If I understand you right, there are two problems:
  1. After you made changes to the script, it produces different output than it used to, for the same version of the game.
  2. The updated script produces different output for v1.0 and v1.1.
On point (1), I'm not sure what the cause could be. I looked at the differences between the old and new script in Post #462326 and https://pastebin.com/qjMjp6ZP. The only significant change seems to be that, in addition to an onmemoryexecute handler, the script installs onmemoryread and onmemorywrite handlers for each address in addressList. On point (2), the script is looking for the execution of specific addresses, and it would not be surprising for code addresses to be different in different versions of the game. You'll need a separate table of addresses for each different version. From a quick check, judging by the text labels in addressList, it looks like the current table is tuned for the 1.1 version. For example, the "READ FFEA" and "READ FFE9" entries:
Language: lua

[2]={0x2258,0xFFFFE000,"READ FFEA"}, [3]={0x225D,0xFFFFE000,"READ FFE9"},
match up with the listed addresses in the 1.1 ROM:
0x2258:	ld	a, [0xffea]
0x225a:	cp	0x01
0x225c:	ret	nZ
0x225d:	ld	a, [0xffe9]
But in the 1.0 ROM, those instructions appear a few bytes earlier, at addresses 0x224f and 0x2254:
0x224f:	ld	a, [0xffea]
0x2251:	cp	0x01
0x2253:	ret	nZ
0x2254:	ld	a, [0xffe9]
Editor, Expert player (2380)
Joined: 5/15/2007
Posts: 3963
Location: Germany
I don't think it was a syntax error, exactly. It's just that the old script used the table.getn function, which was deprecated in Lua 5.1 and removed in Lua 5.2. BizHawk currently uses Lua 5.4. You fixed it correctly by changing it to use the # operator.
I was talking about lines like
if MouseX>280 and MouseX<290>130 and MouseY<138 then
that I had to correct to
if MouseX>280 and MouseX<290 and MouseY>130 and MouseY<138 then
and the code for the arrowUp clickable button was missing altogether. I added onmemoryread and onmemorywrite for no particular reason. Now that I think about it, I'm sure the original script only checked for executed bytes, not reads or writes.
On point (2), the script is looking for the execution of specific addresses, and it would not be surprising for code addresses to be different in different versions of the game. You'll need a separate table of addresses for each different version.
Yes, you are right. I will try to make a new script soon. Thank you. My new hard mode run is currently in 3-2. Theoretically, the scroll bug could save time in some of the later levels, e.g.
  • in 3-3 - if one of the vertical walls could be removed and
  • in 4-2 - if one of the vertical breakable walls could be removed to move on quicker, but regardless of where it happens in the level, it would allow to skip the falling platform at the end of the level.
Editor, Expert player (2380)
Joined: 5/15/2007
Posts: 3963
Location: Germany
New script, unfinished but it's functional. It can be used with both game versions. https://pastebin.com/63CdSW6w It will show how many cycles have passed since the beginning of a frame, for any instance where $FFEA is written to with 0x00, 0x01, 0x02 or 0x03. I will finish it and research the scroll bug with it, hopefully leading to some information.
Editor, Expert player (2380)
Joined: 5/15/2007
Posts: 3963
Location: Germany
Improved script https://pastebin.com/55Leqbrp It will visually show on the screen when a bug frame has occured. The script will print information to the console if PRINT_INFO is set to true in line 5. The script recognized a scroll bug mid level in 4-1 and the one I got at the end of 1-3 and there have been no false alarms. The 4-1 one (bk2)
   FRAME 420  Cy:35112  **LAG**

Execu $0040 (VBLANK INTERRUPT)   cycle: 0
Execu $2258 (READ $FFEA)         cycle: 52
Execu $0050 (TIMER INTERRUPT)    cycle: 9408

   FRAME 421  Cy:35110

Execu $0040 (VBLANK INTERRUPT)   cycle: 0
Execu $2258 (READ $FFEA)         cycle: 52
Write $FFEA (01)                 cycle: 2084
Execu $0050 (TIMER INTERRUPT)    cycle: 7062

   FRAME 422  Cy:35114  **LAG**

Execu $0040 (VBLANK INTERRUPT)   cycle: 0
Execu $2258 (READ $FFEA)         cycle: 52
Execu $2254 (READ $FFE9)         cycle: 66
Write $FFE9 (5F)                 cycle: 90
Write $FFEA (02)                 cycle: 1872
Execu $0050 (TIMER INTERRUPT)    cycle: 4720

   FRAME 423  Cy:35112

Execu $0040 (VBLANK INTERRUPT)   cycle: 0
Execu $2258 (READ $FFEA)         cycle: 52
Write $FFEA (03)                 cycle: 1246
Write $FFEA (00)                 cycle: 1276
Execu $0050 (TIMER INTERRUPT)    cycle: 2374

   FRAME 424  Cy:35112

Execu $0040 (VBLANK INTERRUPT)   cycle: 0
Execu $2258 (READ $FFEA)         cycle: 52
Execu $0050 (TIMER INTERRUPT)    cycle: 770
Execu $0050 (TIMER INTERRUPT)    cycle: 32800

   FRAME 425  Cy:35110  **LAG**

Execu $0040 (VBLANK INTERRUPT)   cycle: 0
Execu $2258 (READ $FFEA)         cycle: 52
Execu $0050 (TIMER INTERRUPT)    cycle: 30454

   FRAME 426  Cy:35114

Execu $0040 (VBLANK INTERRUPT)   cycle: 0
Execu $2258 (READ $FFEA)         cycle: 52
Execu $0050 (TIMER INTERRUPT)    cycle: 28114

   FRAME 427  Cy:35114

Execu $0040 (VBLANK INTERRUPT)   cycle: 0
Execu $2258 (READ $FFEA)         cycle: 52
Execu $0050 (TIMER INTERRUPT)    cycle: 25768

   FRAME 428  Cy:35110  **LAG**

Execu $0040 (VBLANK INTERRUPT)   cycle: 0
Execu $2258 (READ $FFEA)         cycle: 52
Execu $0050 (TIMER INTERRUPT)    cycle: 23422

   FRAME 429  Cy:35110

Execu $0040 (VBLANK INTERRUPT)   cycle: 0
Execu $2258 (READ $FFEA)         cycle: 52
Write $FFEA (01)                 cycle: 2702
Execu $0050 (TIMER INTERRUPT)    cycle: 21080

   FRAME 430  Cy:35112

Execu $0040 (VBLANK INTERRUPT)   cycle: 0
Execu $2258 (READ $FFEA)         cycle: 52
Execu $2254 (READ $FFE9)         cycle: 66
Write $FFE9 (40)                 cycle: 92
Write $FFEA (02)                 cycle: 1874
Execu $0050 (TIMER INTERRUPT)    cycle: 18738
Write $FFEA (03)                 cycle: 20664
Write $FFEA (00)                 cycle: 20694

   FRAME 431  Cy:35114  **LAG**

Execu $0040 (VBLANK INTERRUPT)   cycle: 0
Execu $2258 (READ $FFEA)         cycle: 52
Execu $0050 (TIMER INTERRUPT)    cycle: 16392

   FRAME 432  Cy:35110

Execu $0040 (VBLANK INTERRUPT)   cycle: 0
Execu $2258 (READ $FFEA)         cycle: 52
Execu $0050 (TIMER INTERRUPT)    cycle: 14048

   FRAME 433  Cy:35114

Execu $0040 (VBLANK INTERRUPT)   cycle: 0
Execu $2258 (READ $FFEA)         cycle: 52
Execu $0050 (TIMER INTERRUPT)    cycle: 11704

   FRAME 434  Cy:35110

Execu $0040 (VBLANK INTERRUPT)   cycle: 0
Execu $2258 (READ $FFEA)         cycle: 52
Execu $0050 (TIMER INTERRUPT)    cycle: 9360

   FRAME 435  Cy:35114  **LAG**

Execu $0040 (VBLANK INTERRUPT)   cycle: 0
Execu $2258 (READ $FFEA)         cycle: 52
Execu $0050 (TIMER INTERRUPT)    cycle: 7016

   FRAME 436  Cy:35110

Execu $0040 (VBLANK INTERRUPT)   cycle: 0
Execu $2258 (READ $FFEA)         cycle: 52
Execu $0050 (TIMER INTERRUPT)    cycle: 4670

   FRAME 437  Cy:35106  **LAG**

Execu $0040 (VBLANK INTERRUPT)   cycle: 0
Execu $2258 (READ $FFEA)         cycle: 52
Execu $0050 (TIMER INTERRUPT)    cycle: 2330
Execu $0050 (TIMER INTERRUPT)    cycle: 35098

   FRAME 438  Cy:35120

Execu $0040 (VBLANK INTERRUPT)   cycle: 92
Execu $2258 (READ $FFEA)         cycle: 144
Write $FFEA (01)                 cycle: 3592
Execu $0050 (TIMER INTERRUPT)    cycle: 32758

   FRAME 439  Cy:35110

Execu $0040 (VBLANK INTERRUPT)   cycle: 0
Execu $2258 (READ $FFEA)         cycle: 52
Execu $2254 (READ $FFE9)         cycle: 66
Write $FFE9 (41)                 cycle: 90
Write $FFEA (02)                 cycle: 1872
Execu $0050 (TIMER INTERRUPT)    cycle: 30408
Write $FFEA (03)                 cycle: 32686
Write $FFEA (00)                 cycle: 32716

   FRAME 440  Cy:35116  **LAG**

Execu $0040 (VBLANK INTERRUPT)   cycle: 0
Execu $2258 (READ $FFEA)         cycle: 52
Execu $0050 (TIMER INTERRUPT)    cycle: 28064

   FRAME 441  Cy:35112

Execu $0040 (VBLANK INTERRUPT)   cycle: 0
Execu $2258 (READ $FFEA)         cycle: 52
Execu $0050 (TIMER INTERRUPT)    cycle: 25716

   FRAME 442  Cy:35108

Execu $0040 (VBLANK INTERRUPT)   cycle: 0
Execu $2258 (READ $FFEA)         cycle: 52
Execu $0050 (TIMER INTERRUPT)    cycle: 23374

   FRAME 443  Cy:35114  **LAG**

Execu $0040 (VBLANK INTERRUPT)   cycle: 0
Execu $2258 (READ $FFEA)         cycle: 52
Execu $0050 (TIMER INTERRUPT)    cycle: 21032

   FRAME 444  Cy:35118

Execu $0040 (VBLANK INTERRUPT)   cycle: 0
Execu $2258 (READ $FFEA)         cycle: 52
Execu $0050 (TIMER INTERRUPT)    cycle: 18686

   FRAME 445  Cy:35106

Execu $0040 (VBLANK INTERRUPT)   cycle: 0
Execu $2258 (READ $FFEA)         cycle: 52
Write $FFEA (01)                 cycle: 7104
Execu $0050 (TIMER INTERRUPT)    cycle: 16336

   FRAME 446  Cy:35110

Execu $0040 (VBLANK INTERRUPT)   cycle: 0
Execu $2258 (READ $FFEA)         cycle: 52
Execu $2254 (READ $FFE9)         cycle: 66
Write $FFE9 (42)                 cycle: 90
Write $FFEA (02)                 cycle: 1872
Execu $0050 (TIMER INTERRUPT)    cycle: 14000
Write $FFEA (03)                 cycle: 15926
Write $FFEA (00)                 cycle: 15956

   FRAME 447  Cy:35114  **LAG**

Execu $0040 (VBLANK INTERRUPT)   cycle: 0
Execu $2258 (READ $FFEA)         cycle: 52
Execu $0050 (TIMER INTERRUPT)    cycle: 11656

   FRAME 448  Cy:35118

Execu $0040 (VBLANK INTERRUPT)   cycle: 0
Execu $2258 (READ $FFEA)         cycle: 52
Execu $0050 (TIMER INTERRUPT)    cycle: 9310

   FRAME 449  Cy:35104

Execu $0040 (VBLANK INTERRUPT)   cycle: 0
Execu $2258 (READ $FFEA)         cycle: 52
Execu $0050 (TIMER INTERRUPT)    cycle: 6962

   FRAME 450  Cy:35114  **LAG**

Execu $0040 (VBLANK INTERRUPT)   cycle: 0
Execu $2258 (READ $FFEA)         cycle: 52
Execu $0050 (TIMER INTERRUPT)    cycle: 4626

   FRAME 451  Cy:35102

Execu $0040 (VBLANK INTERRUPT)   cycle: 0
Execu $2258 (READ $FFEA)         cycle: 52
Execu $0050 (TIMER INTERRUPT)    cycle: 2278
Execu $0050 (TIMER INTERRUPT)    cycle: 35046

   FRAME 452  Cy:35120

Execu $0040 (VBLANK INTERRUPT)   cycle: 44
Execu $2258 (READ $FFEA)         cycle: 96
Execu $0050 (TIMER INTERRUPT)    cycle: 32714

   FRAME 453  Cy:35114

Execu $0040 (VBLANK INTERRUPT)   cycle: 0
Execu $2258 (READ $FFEA)         cycle: 52
Write $FFEA (01)                 cycle: 1088
Execu $0050 (TIMER INTERRUPT)    cycle: 30362
Write $FFEA (03)                 cycle: 32430
Write $FFEA (00)                 cycle: 32460

   FRAME 454  Cy:35110

Execu $0040 (VBLANK INTERRUPT)   cycle: 0
Execu $2258 (READ $FFEA)         cycle: 52
Execu $0050 (TIMER INTERRUPT)    cycle: 28016

   FRAME 455  Cy:35112

Execu $0040 (VBLANK INTERRUPT)   cycle: 0
Execu $2258 (READ $FFEA)         cycle: 52
Execu $0050 (TIMER INTERRUPT)    cycle: 25674

   FRAME 456  Cy:35114

Execu $0040 (VBLANK INTERRUPT)   cycle: 0
Execu $2258 (READ $FFEA)         cycle: 52
Execu $0050 (TIMER INTERRUPT)    cycle: 23330

   FRAME 457  Cy:35114

Execu $0040 (VBLANK INTERRUPT)   cycle: 0
Execu $2258 (READ $FFEA)         cycle: 52
Execu $0050 (TIMER INTERRUPT)    cycle: 20984

   FRAME 458  Cy:35110

Execu $0040 (VBLANK INTERRUPT)   cycle: 0
Execu $2258 (READ $FFEA)         cycle: 52
Execu $0050 (TIMER INTERRUPT)    cycle: 18638
Write $FFEA (01)                 cycle: 22812

   FRAME 459  Cy:35112

Execu $0040 (VBLANK INTERRUPT)   cycle: 0
Execu $2258 (READ $FFEA)         cycle: 52
Execu $2254 (READ $FFE9)         cycle: 66
Write $FFE9 (43)                 cycle: 90
Write $FFEA (02)                 cycle: 1872
Execu $0050 (TIMER INTERRUPT)    cycle: 16296
Write $FFEA (03)                 cycle: 18346
Write $FFEA (00)                 cycle: 18376


new row rendered on 422, 430, 439, 446 (no bug frames)
451 has lag and two timer interrupts
    the first one at cycle 2330 ("no bug frame" would have a write to $ffea here)
453 usual structure but without write to $ffe9
459 next row rendered
The 1-3 one (bk2)
   FRAME 57985  Cy:35112

Execu $0040 (VBLANK INTERRUPT)   cycle: 0
Execu $2258 (READ $FFEA)         cycle: 52
Execu $0050 (TIMER INTERRUPT)    cycle: 19360

   FRAME 57986  Cy:35112

Execu $0040 (VBLANK INTERRUPT)   cycle: 0
Execu $2258 (READ $FFEA)         cycle: 52
Write $FFEA (01)                 cycle: 2616
Execu $0050 (TIMER INTERRUPT)    cycle: 17016

   FRAME 57987  Cy:35112

Execu $0040 (VBLANK INTERRUPT)   cycle: 0
Execu $2258 (READ $FFEA)         cycle: 52
Execu $2254 (READ $FFE9)         cycle: 66
Write $FFE9 (48)                 cycle: 90
Write $FFEA (02)                 cycle: 1872
Write $FFEA (03)                 cycle: 3084
Write $FFEA (00)                 cycle: 3114
Execu $0050 (TIMER INTERRUPT)    cycle: 14670

   FRAME 57988  Cy:35112

Execu $0040 (VBLANK INTERRUPT)   cycle: 0
Execu $2258 (READ $FFEA)         cycle: 52
Execu $0050 (TIMER INTERRUPT)    cycle: 12328

   FRAME 57989  Cy:35112

Execu $0040 (VBLANK INTERRUPT)   cycle: 0
Execu $2258 (READ $FFEA)         cycle: 52
Execu $0050 (TIMER INTERRUPT)    cycle: 9982

   FRAME 57990  Cy:35112

Execu $0040 (VBLANK INTERRUPT)   cycle: 0
Execu $2258 (READ $FFEA)         cycle: 52
Execu $0050 (TIMER INTERRUPT)    cycle: 7638

   FRAME 57991  Cy:35112

Execu $0040 (VBLANK INTERRUPT)   cycle: 0
Execu $2258 (READ $FFEA)         cycle: 52
Write $FFEA (01)                 cycle: 2558
Execu $0050 (TIMER INTERRUPT)    cycle: 5298

   FRAME 57992  Cy:35112

Execu $0040 (VBLANK INTERRUPT)   cycle: 0
Execu $2258 (READ $FFEA)         cycle: 52
Execu $2254 (READ $FFE9)         cycle: 66
Write $FFE9 (49)                 cycle: 90
Write $FFEA (02)                 cycle: 1872
Execu $0050 (TIMER INTERRUPT)    cycle: 2954
Write $FFEA (03)                 cycle: 9832
Write $FFEA (00)                 cycle: 9862

   FRAME 57993  Cy:35112

Execu $0040 (VBLANK INTERRUPT)   cycle: 0
Execu $2258 (READ $FFEA)         cycle: 52
Execu $0050 (TIMER INTERRUPT)    cycle: 798
Execu $0050 (TIMER INTERRUPT)    cycle: 33376

   FRAME 57994  Cy:35112

Execu $0040 (VBLANK INTERRUPT)   cycle: 0
Execu $2258 (READ $FFEA)         cycle: 52
Execu $0050 (TIMER INTERRUPT)    cycle: 31032

   FRAME 57995  Cy:35112

Execu $0040 (VBLANK INTERRUPT)   cycle: 0
Execu $2258 (READ $FFEA)         cycle: 52
Execu $0050 (TIMER INTERRUPT)    cycle: 28688

   FRAME 57996  Cy:35112

Execu $0040 (VBLANK INTERRUPT)   cycle: 0
Execu $2258 (READ $FFEA)         cycle: 52
Execu $0050 (TIMER INTERRUPT)    cycle: 26344

   FRAME 57997  Cy:35112

Execu $0040 (VBLANK INTERRUPT)   cycle: 0
Execu $2258 (READ $FFEA)         cycle: 52
Write $FFEA (01)                 cycle: 2580
Execu $0050 (TIMER INTERRUPT)    cycle: 23998

   FRAME 57998  Cy:35112

Execu $0040 (VBLANK INTERRUPT)   cycle: 0
Execu $2258 (READ $FFEA)         cycle: 52
Execu $2254 (READ $FFE9)         cycle: 66
Write $FFE9 (4A)                 cycle: 90
Write $FFEA (02)                 cycle: 1872
Write $FFEA (03)                 cycle: 3084
Write $FFEA (00)                 cycle: 3114
Execu $0050 (TIMER INTERRUPT)    cycle: 21656

   FRAME 57999  Cy:35112

Execu $0040 (VBLANK INTERRUPT)   cycle: 0
Execu $2258 (READ $FFEA)         cycle: 52
Execu $0050 (TIMER INTERRUPT)    cycle: 19310

   FRAME 58000  Cy:35112

Execu $0040 (VBLANK INTERRUPT)   cycle: 0
Execu $2258 (READ $FFEA)         cycle: 52
Execu $0050 (TIMER INTERRUPT)    cycle: 16970

   FRAME 58001  Cy:35112

Execu $0040 (VBLANK INTERRUPT)   cycle: 0
Execu $2258 (READ $FFEA)         cycle: 52
Execu $0050 (TIMER INTERRUPT)    cycle: 14624

   FRAME 58002  Cy:35112

Execu $0040 (VBLANK INTERRUPT)   cycle: 0
Execu $2258 (READ $FFEA)         cycle: 52
Write $FFEA (01)                 cycle: 2990
Execu $0050 (TIMER INTERRUPT)    cycle: 12280

   FRAME 58003  Cy:35112

Execu $0040 (VBLANK INTERRUPT)   cycle: 0
Execu $2258 (READ $FFEA)         cycle: 52
Execu $2254 (READ $FFE9)         cycle: 66
Write $FFE9 (4B)                 cycle: 90
Write $FFEA (02)                 cycle: 1872
Write $FFEA (03)                 cycle: 3084
Write $FFEA (00)                 cycle: 3114
Execu $0050 (TIMER INTERRUPT)    cycle: 9936

   FRAME 58004  Cy:35112

Execu $0040 (VBLANK INTERRUPT)   cycle: 0
Execu $2258 (READ $FFEA)         cycle: 52
Execu $0050 (TIMER INTERRUPT)    cycle: 7592

   FRAME 58005  Cy:35112

Execu $0040 (VBLANK INTERRUPT)   cycle: 0
Execu $2258 (READ $FFEA)         cycle: 52
Execu $0050 (TIMER INTERRUPT)    cycle: 5248

   FRAME 58006  Cy:35110

Execu $0040 (VBLANK INTERRUPT)   cycle: 0
Execu $2258 (READ $FFEA)         cycle: 52
Execu $0050 (TIMER INTERRUPT)    cycle: 2904

   FRAME 58007  Cy:35118

Execu $0040 (VBLANK INTERRUPT)   cycle: 0
Execu $2258 (READ $FFEA)         cycle: 52
Execu $0050 (TIMER INTERRUPT)    cycle: 798
Execu $0050 (TIMER INTERRUPT)    cycle: 33330

   FRAME 58008  Cy:35108

Execu $0040 (VBLANK INTERRUPT)   cycle: 0
Execu $2258 (READ $FFEA)         cycle: 52
Write $FFEA (01)                 cycle: 1712
Execu $0050 (TIMER INTERRUPT)    cycle: 30980
Write $FFEA (03)                 cycle: 33006
Write $FFEA (00)                 cycle: 33036


new row rendered on f987, f992, f998, f003
f007 has two timer interrupts (but no lag)
f008 usual structure but without write to $ffe9
I'm not going to try it in 3-3 because I don't have fireflower before the vertical wall section and there is no lag. Unless I bring fireflower beforehand, the bug is probably not possible. So if anything I'm trying it in 4-2. Since it took quite some time to get the bug just once in testing with tons of lag in 4-1, I think the chances of getting it in the TAS are too slim. It might happen by chance though.
Editor, Expert player (2380)
Joined: 5/15/2007
Posts: 3963
Location: Germany
I managed to get the bug by running a modified version of the linked script which repeatedly runs forward and jumps after delaying for increasing amounts of frames, while in a laggy situation. The laggy situation wasted a lot of time but due to the missing falling platform in the end, it reaches the goal at exactly the same frame as the optimized no-bug version. I'm convinced I can get it much faster eventually and save time with it. I'll keep trying. Link to video Modified luascript You have to change booleans at the beginning of the script. Currently it's set to have Mario delay, then start running/shooting, then jump. Upcoming input in the next ~200 frames in TAStudio has to be cleared and Mario has to be on the ground, obviously. The script running can be observed in the middle of the video. You will want to add client.pause() in line 86 or 223 so the script stops when the bug happens. This kind of test could be done in many places of the level. Of course it would be best to get the bug with the least amount of lag possible but it's already frustratingly hard to get the bug at all since it's very rare.
Editor, Expert player (2380)
Joined: 5/15/2007
Posts: 3963
Location: Germany
By running the above script and also a version that randomly lets go of Right or B, I managed to get 3 results with the bug. They all take about 13 frames of delay (by idling and lag) and finish the level about 25 frames faster than the no-bug version. I'm glad about saving this much time but it needs optimizing. It should be possible to trigger the bug with only 1 or 2 delay frames. In one of the above-mentioned results, I was shooting and the bug happened before the first lag frame even happened - but the 13 lag frames that happened after that were unavoidable. The script currently running looks like this This being the responsible code:
Language: Lua

local waitframes = emu.framecount() +1 tastudio.onbranchload(function() (...) vary3 = math.random(22,45) vary4 = math.random(0,3) vary5 = math.random(0,7) end) (...) if run_test[6] then -- Have Mario on the ground, clear upcoming 200 frames in tastudio -- script will do inputs at set chance -- start this at 86282 local vary1 = math.random(1,80) local vary2 = math.random(1,50) local press_b = true local press_a = false local press_right = true -- star block jump if emu.framecount() >= waitframes + vary4 and emu.framecount() < waitframes + vary4 + 10 then press_a = true else press_a = false end -- ending jump if memory.read_u8(0xFFF3) > 0x83 then press_a = true end -- b kill if emu.framecount() == waitframes + 17 + vary5 then press_b = false end -- random if not press_a then if not (math.random(1,1000) < (980-vary1)) then if emu.framecount() > waitframes + 10 then press_right = false end end if emu.framecount() > waitframes + 17 + vary5 then if math.random(1,1000) > (980-vary2) and (emu.framecount() > waitframes + 16 + vary3) then press_b = false end end end tastudio.submitinputchange(emu.framecount(), "A", press_a) tastudio.submitinputchange(emu.framecount(), "B", press_b) tastudio.submitinputchange(emu.framecount(), "Right", press_right) if emu.framecount() > waitframes + 155 or emu.lagcount() > 407 then savestate.loadslot(5) end tastudio.applyinputchanges() end
If anyone wants to help with this, it would be much appreciated. EDIT: The script came out with a 0 lag, 7 idle frames scenario overnight. That's pretty good!
Skilled player (1778)
Joined: 9/17/2009
Posts: 5008
Location: ̶C̶a̶n̶a̶d̶a̶ "Kanatah"
MUGG wrote:
By running the above script and also a version that randomly lets go of Right or B, I managed to get 3 results with the bug. They all take about 13 frames of delay (by idling and lag) and finish the level about 25 frames faster than the no-bug version.
Nice! Can you only do this 1 time per stage, or multiple times?
Editor, Expert player (2380)
Joined: 5/15/2007
Posts: 3963
Location: Germany
Nice! Can you only do this 1 time per stage, or multiple times?
Theoretically you can do this as often as you want but since the bug is rare you can only do it a few times. The bug can theoretically be used to remove walls such as in 3-3 or at the pipe section in 4-2 to move on quicker. But I'm not bringing fireflower into 3-3 so I can't create lag to make the bug happen - even if I did, shooting might not create any lag. And in 4-2 the location where the bug has to happen is not convenient - I would probably have to idle or lag more than the time I could save back. So for now I'm just aiming for the bug "anywhere" in 4-2 to remove the falling platform at the end.
EDIT: The script came out with a 0 lag, 7 idle frames scenario overnight. That's pretty good!
This saves 35 frames. It reaches the goal at framecount 87396 whereas the no-bug version reaches it at 87431. I might try a few other places to maybe come out with even less idle frames but other than that I'm content with this outcome.
1 2
8 9

1746725016