Tip: Entering a door or pipe, activating a P-Switch or grabbing a star, completing the level, hitting a message block, and dying will cause issues on the title screen, such as causing musical glitches, or trapping the player in an endlessly-looping level.
This patch allows for several bonus levels for both Yoshi wings and getting 100 star coins instead of levels 100/000 and 1C8/0C8. The selection can be either random or pre-determined, an option which you can toggle in the .asm file. The number of levels is also variable.
Made on request for BootaNoBijuu.
08/05/2021 update: I overlooked a problem with choosing the original bonus levels option, the patch should work just fine now.
bonus, bonus game, bonus room, sa-1
This patch is competently assembled and largely okay, and this is honestly a very narrow reject overall. Custom 100-star bonus levels defer to the logic behind the original bonus game, which rather limits what can be done with the feature:
Crossing a goal tape or taking any exit within the bonus level displays the "BONUS GAME" screen, then spawns the player in another bonus level (or the same bonus level) per the patch logic.
The timer in a bonus level is always force-set to 000 unless the "bypass" box is checked in Lunar Magic; dying in a bonus level with time 000 displays a "TIME UP!" screen with garbled graphics.
Start + Select is disabled in bonus levels.
The original 100-star bonus game is one room with neither a goal nor an exit, with the game terminated by a special bonus game sprite. This patch arguably expands on what kinds of rooms may be used, but is still bound by vanilla expectations regarding room setup; one could validly argue that the patch works fine in this context, but having spoken with the author it was agreed to reject for now. The fix could be as simple as a user define to disable "vanilla behavior" that would keep the vanilla bonus game flags un-set. Even some kind of sample "exit bonus game" subroutine or sprite or something would make the feature much more usable. The alternate Yoshi wing levels behave just fine.
Otherwise, as far as nitpicks go, the "arbitrary RAM as index" feature seems a little obtuse, particularly for a non-coder. Doing it any other way would probably involve pre-baking a number of templates, though, and this way at least lays the groundwork for anybody who has a certain trigger condition in mind. The included random select is a totally solid alternative, though one should be aware of the limiting way in which SMW handles its RNG. There are a fair few optimizations that could be made if you're up to it (challenge: see if you can eliminate the usage of scratch RAM), and some FastROM mirrors would be nice to have as well.
Tested with Asar 1.81, Lunar Magic 3.30, SA-1 1.40, Snes9x 1.59.2.