fi, en, (sv, ja, hu, yi) | avatar by https://twitter.com/udonkimuchikaki


libera.chat, irc.sortix.org
nortti
microblog (that is, a blog with small entries)
microblog.ahti.space/nortti

rgmechex
@rgmechex

In the video I just put out about obtaining Lakitu's cloud in the item box, I mentioned that the Starman was actually intended to be in the item box at some point during development.

While you can't legitimately get one in the final release, there is still a bit of code leftover related to the Starman in a couple ways.

First, in the item box. Normally, items in the item box are just static. Even though the Fire Flower flips back and forth horizontally when out in the level, it doesn't move in the item box. However, the Starman was specifically coded to animate, and it still does if you use a glitch to get one.

A Starman flickers in the item box It's a little dull looking, don't you think?

Here is the code that is responsible for checking for the Starman specifically, and choosing one of four object palettes depending on the current display frame.

; 00901E: Draw the reserve item in the status bar
   LDA #!OBJOffscreen      ;\ By default, the object
   STA OAMTileYPos,Y       ;/ is offscreen
   STY $00                 ; Y holds the OAM slot
   LDY PlayerItembox
   BEQ ++                  ; if no item, return
   LDA ItemBoxOBJProps-1,Y ;\ OAM attribute byte
   STA $00                 ;/ goes in $00
   CPY #3
   BNE +                   ; skip forward if not Starman
   LDA TrueFrame           ;\
   LSR A                   ;| Starman animation frame
   AND #%00000011          ;/
   PHY
   TAY
   LDA ItemBoxStarProps,Y  ;\
   PLY                     ;| Overwrite attribute
   STA $00                 ;/ byte
 + LDY $01
   LDA #120                ; X pos of object
   STA OAMTileXPos,Y
   LDA #15                 ; Y pos of object
   STA OAMTileYPos,Y
   LDA #%00110000          ;\ OAM attributes
   ORA $00                 ;| give object highest
   STA OAMTileAttr,Y       ;/ priority always
   LDX PlayerItembox
   LDA ItemBoxOBJNos-1,X   ;\ OAM tile based off
   STA OAMTileNo,Y         ;/ of item box item
   TYA
   LSR #2
   TAY
   LDA #%10
   STA OAMTileSize,Y       ; 16x16 object
++ RTS

...

; $008D8F: Item box object properties
ItemBoxOBJNos:             ; tile number per sprite
   db $24,$26,$48,$0E
ItemBoxStarProps:          ; attributes for Starman
   db %00000000,%00000010,%00000100,%00000010
ItemBoxOBJProps:           ; attributes per sprite
   db %00001000,%00001010,%00000000,%00000100

The Starman attributes needed to be shifted left once before stored to OAM in order for it to look the same as it does in the level.

This animated Starman appears slightly differently than ordinary Starman--you can tell by releasing it from the item box that it animates faster with a different palette.

Mario watches a Starman fall from the item box off the bottom of the screen It gains some life before plummeting to the center of the world.

There's another unused feature in the game regarding invincibility, and that has to do with getting items at the end of the level via the goal tape.

Normally, carrying an item through the goal with either get you a copy of the powerup that Mario has already, or a 1up depending on the item. This entire mechanic was planned to be much more extensive (and I will possibly make a video about it), but in short, it was going to be possible to get a Starman from the goal as well. We can use out-of-bounds powerup indices to glitch a Starman out of it though. By using powerup incrementation to set Mario's powerup status to 4 (not 0-3 to correspond to small, big, fire, or cape), we can get a Starman just by carrying any ordinary item through the goal tape.

Glitchy orange Mario carries a red shell through the goal and a Starman appears, giving Mario a cape Of course, collecting a Starman with this powerup status gives Mario a cape instead of invincibility!

Whenever a Starman is spawned at the goal tape like this, a special unused memory address is set to 1. Getting invincibility after clearing the level isn't very helpful, so this was supposed to be yet another way to "hold on" to this powerup.

This memory address is shifted to the left once every time you enter a level or new room (even in the final game, just that the value is always zero). When the highest bit is set (after 7 level or room entries), Mario just gains invincibility on the spot.

Mario entering Yoshi's Island 2 with invincibility right away Had to enter and exit this level 6 times first for this to work.

This does seem to be an incomplete feature, as there is no "powerup" sound effect or other indication you got the Starman effect other than the music changing abruptly. Who knows what they were going for here?


Also, since this is a shorter article this week, here is another bonus fact about items that come out of the item box: they don't despawn if they go off the bottom of the screen. They will forever take up a sprite slot as they fall through the bottom of the level and wrap around to the top. You'll need to find a way to bypass the time limit (unless you are in a level that doesn't have one), since it takes about 20 minutes for it to do so.

Since this is dependent on the "blink and fall" flag, this does not occur for the cape feather, since it ignores this flag. The mushroom, fire flower, 1up, Starman, and moving coin do this though.


You can support Retro Game Mechanics Explained on Patreon here! Any and all support is greatly appreciated!


You must log in to comment.

in reply to @rgmechex's post:

I seem to remember something like, the palette the item box starman uses was just a typo, and the correct palette is the next one! Or something like that -- I can't find where I heard that.