Banner
Views: 934,413,023
Time:
23 users online:  Anorakun, Bullymario, codfish1002, Dark Prince, eduard11, Fernand1527,  Fernap, Galactic Spear, Hamilton64, Hat Kid, Infinity, Luis Carrasquero,  MarioFanGamer, MarioSonic4life,  MarkAlarm, nicknicknick2020, Stivi,  Tahixham, The Central Scrutinizer, twicepipes, VLSkoot, Worl, Yoshi Master - Guests: 117 - Bots: 113 Users: 52,124 (2,115 active)
Latest: AmnesiaSilence
Tip: If you give a Muncher tile custom graphics, it will still act like a coin when a silver P-switch is active, whether it looks like a coin or not. ExAnimation solves this problem.
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.
Screenshots:
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
    +
    RTL

    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


Menu

Follow Us On

  • YouTube
  • Twitch
  • Twitter

Affiliates

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