Banner
Views: 843,849,409
Time:
29 users online: AmperSam, AnasMario130, BrownBuddy, CalHal, chickaDEE Magazine, cybershell12, dogemaster, Eduard, EnzoLipe1, G3rminho, Infinity, kamekku14,  KevinM, KiloMinimo, Kusrry, LOLRyan2006 the Goombud, Mario and yoshi, MeteorSmasher4, msi810, NathanWarford,  Ninja Boy, qantuum, Ralshi02, RollingRigatonis, Romano338, SamuM6pdt, SiameseTwins, SuperHack64,  Tahixham - Guests: 72 - Bots: 75 Users: 46,378 (2,815 active)
Latest: RandomBlox47
Tip: Don't put levels in overworlds that don't match (like a snowy level in a desert).Not logged in.
The Classic Piranha Plant Tutorial
Forum Index - SMW Hacking - SMW Hacking Help - Tutorials - Old Tutorials - The Classic Piranha Plant Tutorial
Pages: « 1 2 3 »
Tutorial updated on June 6th, 2010!
The old Classic Piranha Plant Fix patches don't seem to be in the Patches section anymore, so I'll assume they were removed. It also seems that there's a way to avoid the once-necessary hex edits, so this tutorial has undergone some large changes.

This is a tutorial on how to repair the graphics and implement the Classic Piranha Plant sprite in any level of your hack. This is something I struggled with for months, but I managed to figure everything out. I do not want anyone else to go through what I did, so I'm laying this out in plain English for anyone who needs it.

What you will need:
1. Lunar Magic
2. A Super Mario World ROM, clean or otherwise
3. Xkas GUI (found in the Tools section)
4. YY-CHR (also found in the Tools section, right near the bottom)
5. The Piranha Plant Fix Patch Fix patch (PPFPF), found in the Patches section
6. ZSNES (Tools section)

1a. Listen carefully. The first thing you need to do is open your ROM in Lunar Magic, go up to the Toolbar at the top, and click the red mushroom that says Extract GFX from ROM... when the cursor is placed over it. This will create a folder labelled GFX in the same directory as your ROM.

1b. Next, run your ROM in ZSNES and make a savestate (hit Esc. during play and select Save State). The .zst file will be saved in the same place as your ROM.

1c. Next, unpack the files that come with YY-CHR. Click on the file labelled yychr.ENG and rename it to match your computer's current language settings. Most people will use yychr.ENU (for American English), but a few will use .ENC (Canadian English). There is a text file that comes with YY-CHR which lists the various language tags. These tags need to be set, or else you won't be able to read anything in YY-CHR.

2a. Now, make a back-up copy of your ROM and make a new folder called ASM (or whatever you want to call it). Put your ROM, the PPFPF, and Xkas GUI in there. Double-click the patch, and a window in Notepad should open. There are two small changes we need to make to the patch, and the below image will guide you.



Why did we just change those values? Well, to put it simply, the Piranha Plant's stem has been accessing the wrong graphics page, and changing and applying this patch corrects this.

(Thanks to Koops for the image and imjake9 for pointing this out to me.)

2b. Now, open Xkas GUI and select your ROM and the patch in the appropriate fields. Then, go to Tools and select Set Freespace, or else the patch won't work. Note that Freespace can only be set if your ROM has been run and saved at least once in Lunar Magic. Finally, click Insert to patch the ROM!

2c. Re-open your ROM in Lunar Magic, go to a level of your choice, and place a Classic Piranha Plant somewhere (it doesn't matter where). Run the ROM in ZSNES and go to the level with your Piranha Plant in it. If you've followed my instructions thus far, then the stem for the plant should have changed. It doesn't look like a stem, yet, so we're not quite done.

3a. The last thing we need to do is open YY-CHR and go to the GFX file we created at the beginning of this whole process. You should see a file labelled AllGFX.bin (if you don't, re-open your ROM in Lunar Magic, go to the Options dialogue and click Use Joined GFX files. Then, use the red mushroom to re-extract the graphics).

3b. Once AllGFX.bin is opened, go to Palettes>Load Emulator State File... and select the .zst file in the same directory as your ROM. Finally, go to where it says 2BPP NES and scroll down the menu until you find 4BPP SNES. Now, the graphics in the large left window should look about right. Very near the top of the list, close to the 'Nintendo Presents' symbol, is a Piranha Plant head with a fish stem. Look familiar? Right click the stem (and ONLY the stem) and select Edit>Cut. Now, scroll down the graphics list a bit until you see a piece of vine tile (it is in the right-most column, a few screens below the stem we just deleted). Copy this tile to the clipboard, then return to the Piranha Plant sprite and paste the vine where the fish had been. Save and exit YY-CHR.

4. Finally, open the ROM in Lunar Magic and click on the green mushroom tool that says 'Insert GFX to ROM'. Congratulations, you're done! Run the ROM with your emulator to make sure that the stem looks correct. Be aware that the stem will NEVER look right in Lunar Magic; only during play will it show up right.

You should know that, now that the graphics and patch have been applied, Upside-down Piranha Plants can now be used in any level, too. That's quite a profit, if I do say so.

If anything went wrong during the process, double back and make sure you followed every step. Always keep a back-up copy of your ROM in case you make a mistake or something glitches up. Otherwise, this should have worked, and you can now enjoy the amazing sprite that Nintendo neglected to finish. Good work!
I've known this, but this a good tutorial for those who can't figure out how to fix the Piranha Plants. Good work! (I'm also glad this isn't one of those tutorials that say, "Get the patch, find freespace, and patch." This one actually has effort put in it.)

However, you should tell how to use regular xkas, as well as how to find freespace.
This is not a tutorial about Xkas; there are several of those in this forum. Neither of these patches requires freespace, and my intention was to simply tell people how to patch what is necessary for the Classic Piranha Plant.

If they want a full Xkas guide, they ought to look elsewhere (no offense!)
I highly suggest using this single patch instead of both of the other ones.

http://www.smwcentral.net/download.php?id=619&type=patches

This one is MUCH more compatible with other patches, but it needs freespace.

--------------------
I own a community of TF2 servers!

ASMT - A new revolutionary ASM system, aka 65c816 ASseMbly Thing
SMWCP - SMW Central Presents a Product- tion long name

frog

http://esolangs.org/wiki/MarioLANG
That's a good point. I was unaware that the old patches had compatibility issures. Thank you very much.
I would also like to take this opportunity to answer a common question many people have about the Piranha Plant:

Why can't I keep a red stem?

For those of you who don't know, if you replace the plant's fish graphics in YY-CHR without applying the fix patch(es), the Piranha Plant will appear to have a normal-looking, red stem. Even though some hackers like to keep this stem because they like the way it looks, the red stem can cause a VRAM (visual-RAM) error. The fix patch(es) NEED to be applied, if the bold, italicized, underlined, and capitalized text didn't quite get your attention.
Originally posted by Camerin Neede
the red stem can cause a VRAM (visual-RAM) error.

This seems to be pretty much common knowledge as far as I know, but is there anyone who knows what exactly that VRAM error does? I have heard rumours about it is caused due to the sprite storing the stem's YXPPCCCT data to the wrong address, which means that there would be a chance of it messing up one of the other processing sprites, but I haven't seen this error myself or found anything about it in all.log.

--------------------
My YouTube channel
Get the official ASMT resource pack here!

From the Fix-All patch:

org $018E8D ;x908D, Piranha Plant Fix #1 (restores Classic Piranha Plants)
db $20,$C0,$FF,$EA,$EA,$EA,$EA,$EA,$EA,$EA
;B9 0B 03 29 F1 09 0B 99 0B 03

org $01FFC0 ;x101C0, Piranha Plant Fix #1 (restores Classic Piranha Plants)
db $B5,$9E,$C9,$1A,$F0,$0B,$B9,$0B,$03,$29,$F1,$09,$0B,$99,$0B,$03,$60,$B9,$07,$03,$29,$F1,$09,$0B,$99,$07,$03,$60

If you disassemble that, you get

org $018E8D
JSR $FFC0
NOP #7 (should have been BRA $05 NOP #5)

org $01FFC0
LDA $9E,x
CMP #$1A
BEQ $0B
LDA $030B,y
AND #$F1
ORA #$0B
STA $030B,y
RTS
LDA $0307,y
AND #$F1
ORA #$0B
STA $0307,y
RTS

And if we look at $018E8D in all.log, we see this:

CODE_018E8D: B9 0B 03 LDA.W OAM_Tile3Prop,Y ; |
CODE_018E90: 29 F1 AND.B #$F1 ; |
CODE_018E92: 09 0B ORA.B #$0B ; |
CODE_018E94: 99 0B 03 STA.W OAM_Tile3Prop,Y ; /

Apparently, the normal code sets the tile properties of a tile and stores them to $030B,y, and the fix makes them go to $030B,y if the Piranha Plant is an upside-down one, but $0307,y if it is rightside-up.

On a semi-related note, how exactly did Romi use a square tile to hide his Piranha Plant sprite? I'm wondering about that...instead of changing the priority of the sprite, he used a third (and possibly fourth) tile to hide the sprite. Now that I look at the code in more detail, though, I think I know how he did it. That third tile had lowest priority, and he set its XY position by keeping track of the sprite's original Y position, subtracting $1C from that number, and storing the result to $0301,y. I think I'll use that technique when I make my "all-encompassing" Piranha Plant sprite.
Yeah, sprite vs sprite priority is based on the OAM order and nothing else. So, you could put a low priority sprite tile over a high one, and thus "hide" the high priority sprite tile behind the BG/FG.


Lots of funky effects from this as you can imagine.
I've never seen this VRAM error the red stem causes. I've heard that it's a very rare glitch.

Even still, if my Wii had a 1/100 chance of glitching up each time I used it, I would no doubt be afraid to turn it on. Is this the same logic the hack moderators use?
ok I need help I've done all the steps in this tutorial and the graphics still don't show up in the game unless the sprite GFX is set to underground but it shows up in lunar magic. what do I do?


Originally posted by über micro
ok I need help I've done all the steps in this tutorial and the graphics still don't show up in the game unless the sprite GFX is set to underground but it shows up in lunar magic. what do I do?

I completely skipped the Translhextion part and used the Piranha Plant Fix Patch Fix patch instead. It worked for me.

--------------------
MARIO in MAINLAND Progress

Mario in Mainland will be in the next C3.
It worked in ALL levels or just the ones with the sprite GFX set to underground?
Does the new patch change the bytes automatically?

Also, did you follow the tutorial step-by-step? If you apply the patch(es) after changing the byte at x101D7, something gets overwritten. The patch needs to be applied, and then the byte is to be changed.


Originally posted by über micro
It worked in ALL levels or just the ones with the sprite GFX set to underground?

I've tested it on the Banzai Bill set and Pokey set.

@Canerin Neede: Yes, everything except Translhextion. Well, when I looked in the hex editor I use (which means it's not Translhextion) the bytes did change, so obviously it must have.

--------------------
MARIO in MAINLAND Progress

Mario in Mainland will be in the next C3.
Yes I followed step by step the only thing i didnt do is I used regular xkas.


Originally posted by über micro
Yes I followed step by step the only thing i didnt do is I used regular xkas.

I used xkas GUI. Try that.

--------------------
MARIO in MAINLAND Progress

Mario in Mainland will be in the next C3.
well I did use that first but when I loaded the ROM in lunar magic it said "Corrected 1 Fatal Error" and something about the sprite tileset and the there was a whole bunch of sprites all over the place and when I tried to delete them the program froze up and had to close so I tried it again and it did the same thing. so I used regular xkas instead.
I think I need to do a test-run with this new patch to see what it actually does. It isn't as though I doubt any of you, but I only teach what I know, and I don't know this patch.

(Thank God I have an infinite supply of clean ROMS.)

p.s. I've never been ninja'd before...until now.

EDIT: The test-run was completed. All the patch did for me was, as it was advertized, combine the effects of the first two patches. I'm not saying that it doesn't make the hex edit, but the graphics that appeared were glitched (the test was conducted in level 105, so I saw Banzai Bill tiles).
Is there a different version of xkas GUI besides 2.2.3 because thats what I was using.
Pages: « 1 2 3 »
Forum Index - SMW Hacking - SMW Hacking Help - Tutorials - Old Tutorials - The Classic Piranha Plant Tutorial

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

Copyright © 2005 - 2020 - 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