Views: 933,737,844
21 users online:  1UPdudes, AntiDuck, Azula16, Bad luck man, CapriSun64, Dbau, Hamilton64, Hwailaluta, MarioSonic4life, Mithrillionaire, Pancake001, Plasmariel, Ralshi02,  RussianMan, S.N.N.,  Sayuri, SJandCharlieTheCat,  TickTockClock, Vanessa, VecchiaZim, Wolfguy423 - Guests: 72 - Bots: 154 Users: 52,100 (2,119 active)
Latest: Polygloom
Tip: Test your levels as all forms of Mario that can access it (such as different powerups in your hack, or Yoshi).
Not logged in.
Yoshi State Block by Reinddeer
Forum Index - Valley of Bowser - Moderation Questions - Blocks - Yoshi State Block by Reinddeer
Pages: « 1 » Link
File Name: Yoshi State Block
Submitted: by Reinddeer
Authors: Reinddeer
Act As: Any
Includes GFX: No
Description: This block acts differently for Mario when he is on Yoshi and when he is not. I thought it might be useful as a contraption or level gimmick. Can also be used to de-cheese levels, like by preventing bringing a Yoshi back through a pipe. Includes a function that removes Yoshi if Yoshi the block. By default it acts as a cement block when riding Yoshi, and an air block when not.

If you downloaded this in the first day or so of this being published, please make sure you have the most recent version as I fixed some stuff and made a quality of life improvement.
The block works fine (although I don't think making you dismount Yoshi like you did is that convenient, since a lot of times that will happen and Yoshi won't be killed by the block), but there's quite a few issues (mostly because of unoptimization):
  • Code
    LDA $187A 			;Riding yoshi flag
    CMP #$00			;Is Mario riding yoshi
    BNE +				;If so, skip to plus
    LDY.b #!ActsLikeNoYoshi>>8	;Sets the blocks act as
    LDA.b #!ActsLikeNoYoshi
    STA $1693
    LDA $187A			;Riding yoshi flag
    CMP #$00			;Is Mario riding yoshi
    BEQ +				;If not, skip to plus
    LDY.b #!ActsLikeYoshi>>8	;Sets the blocks act as
    LDA.b #!ActsLikeYoshi
    STA $1693

    This block of code is duplicated, when it could be easily shared by the labels that use it: you can delete its first instance, and move the "MarioBelow: : MarioAbove: : MarioSide: : TopCorner:" labels before the second instance.
  • When comparing against 0, you don't need to use "CMP #$00" after an LDA, so you can remove all of those.
  • In the block of code I mentioned earlier, you're first checking if $187A contains 0, and if not you're branching: so after that, you're sure that it's different than 0, so no need to check again if it's equal to 0. This means you can remove the "LDA $187A : BEQ +", but make sure to put a RTL in its place, to prevent executing unintended code when $187A contains 0.
  • To force a button press, it's better to use "TSB $18", rather than "STA $18", because the latter will also affect the other button presses (disabling them for that frame).
  • (Minor) "LDA $009E" can be simply written as "LDA $9E", and the RTL between "MarioCape:" and "MarioFireball:" can be removed.
  • (Not required) It would be nice to add SA-1 compatibility. In this case it's a pretty simple task, you just need to add "|!addr" after $187A, $1693, $1DF9, and to use the appropriate defines for the sprite tables (e.g., !9E instead of $9E).
Pages: « 1 » Link
Forum Index - Valley of Bowser - Moderation Questions - Blocks - Yoshi State Block by Reinddeer

The purpose of this site is not to distribute copyrighted material, but to honor one of our favourite games.

Copyright © 2005 - 2021 - SMW Central
Legal Information - Privacy Policy - Link To Us


Follow Us On

  • YouTube
  • Twitch
  • Twitter


  • Super Mario Bros. X Community
  • Mario Fan Games Galaxy
  • sm64romhacks