Submission #6159: Jiseed's Genesis Phantasy Star IV "macro glitch" in 20:33.04

Console Sega Genesis Emulator Bizhawk 2.3
Game Version USA Frame Count 73887
ROM Filename Phantasy Star Frame Rate 59.922751013550524
Branch macro glitch Rerecord Count 14518
Unknown Authors Jiseed
Game Phantasy Star IV
Submitted by Jiseed on 11/22/2018 2:55:01 AM

Submission Comments
With the accidental discovery of the negative menu glitch during an RTA attempt, the seemingly solid code of Phantasy Star IV was slowly picked away at until we arrived at the current any% run. Using these discoveries as a foundation, this TAS beats the game in just over twenty minutes.


- Negative Menus: If you press B 17 frames after an A or C input in the message/battle speed menus it goes into negative menus, as the game counts it as closed, but then closes it again. What happens afterwards is determined by a number of variables, such as: Tile it was performed on, which character is in the lead, whether or not a battle has been initiated before the glitch is performed, etc. There are tons of things that affect it, but also exceptions to the rules too. If used in succession it will almost certainly softlock the game. This is used one time in the TAS in order to stop the game from crashing.
- Macro Glitch: Very similar to the negative menus, except it is done via the macro menu, specifically from the skills page. However, being that it originates from the actual player menu there are many practical applications for it. For this to be initiated, the glitch must be performed 3 times in succession, each with a different frame to press B on (12,10,13 respectively).
- Walk Through Objects (aka. Gryz skip): After executing the macro glitch, provided you've met the right conditions, you can press B and return to the menu. If you press B the correct amount of times at the menu, then select a character who has Ryuka/a Telepipe and use it, the sound will play and a blank window will pop up immediately freeing you up for movement. After this has taken place, you can walk through objects such as chests or npcs. This is used in Molcum in order to skip going to Zema.
- Save Warping: Once you've initiated the walk through objects glitch, the reason you can walk through stuff is because the game is confused and thinks you're on the world map. Specifically, it swaps your co-ordinates on the map you're on, with those on the world map. If you save, or if a cutscene completes, it will put you on the coordinates you saved on but you will be on the world map. This allows us to skip doing the Bioplant plot, thereby skipping getting Rika. It is also used to skip the cave between Aiedo and Kadary.
- Glitched Macro Abilities: After doing the Macro Glitch, you can choose the tech window and it will store it in memory. If you perform the Macro Glitch a second time, but press B after, it will bring up a list of "techniques" which are based on the skills of the last person who was used in the Macro Glitch. Alys' Vortex skill allows us to access Nawat, an end game technique. In order to leave the negative menus that happen once its performed, you simply have to have 3 tabs of items, and scroll right in a separate macro. This will fix the negative menus. While this glitched macro is of paramount importance in an RTA run, due to luck manipulation in the TAS the actual spell itself is used only once. It has a far more important use later on.
- Character 255: Because we skip Rika, the game is extremely confused after the Demi cutscene. I'm not exactly sure why the game adds Character 255 to the party afterwards, but I believe it has something to do with the expectation that you would have three party members when you in fact have only two. This puts Demi behind 255, making it so she cannot be used in combat. Most importantly, it corrupts all macros made before 255 joins the party. 255's name will crash the game unless specific dialogues are opened before the menu is. This can be bypassed by having no text be shown in the menu (by using the Negative Menus).
- Byte Shift: This is the biggest discovery out of all the glitches, and by far the least understood. When using the corrupted macros given to you after 255 joins the party and you have at least five party members, it will initiate a byte shift in the SRAM IF CONDITIONS ARE CORRECT. The conditions that must be met for this particular set up are: Chaz must be level 4 and in the front of the party, the fight has to be on the beach background of Motavia, the characters behind 255 must be Demi and Rune and the macro used must be one that has been used for glitched abilities and have a macro below it that has Gryz using an item above Chaz's attack. The one used in this TAS shifts all bytes by 8. More details on this specific set up are in the route. The biggest improvements I can see in the future for this run would be from a better understanding of this glitch, and how to manipulate it.


- Piata: Same as normal for the most part. Igglanova is skipped using the Earth stun + running away. The 100 meseta chest is picked up for the byte shift later, as well as for much needed funds.
- Molcum & Krup: A departure from the norm here, we skip going to Zema and instead head to Molcum (for the telepipe warp) and then to Krup. In Krup we buy 3 telepipes and 1 escapipe before exiting and unequipping some items. These are extremely important for the byte shift and the order must be consistent. We exit the shopping menu prematurely because doing so stops us from having to do a save and load before using the walk through objects glitch in Molcum. The next two items we buy are a telepipe and an escapipe, these are also important for the byte shift. The rest of the items bought are for after the byte shift occurs, and to fill up the inventory for the glitched ability later.
Once the shopping is done, telepipe to Molcum, and the walk through objects glitch is performed using the telepipe in the first slot. This is a bit faster than normal because it goes straight to the item for whatever reason, and only one B input is needed in order to get the correct negative menu value for the glitch to occur. Once Rune joins the party, you'll see after the cutscene that the characters are now in the middle of the ocean due to the previous glitch. A quick Ryuka back to Molcum, and we perform a save warp, getting us to Aiedo.
- Kadary & Tonoe: Another save warp in Aiedo puts us right next to Kadary. We need an encounter in order to get Chaz up to level 4 for the shadowblade underflow. There are 10 safe steps upon an area transition that cannot have encounters so multiple steps are needed. A fight with two Speard and one Tech User is manipulated. One character has to die, hopefully Hahn, to get the exp required for Chaz. Unfortunately Alys has to take the heat here as every manipulation to have Hahn die to the Speard cost many more frames than this one did, either later on or in the fight itself. Once this is done, we head into Kadary to rest up and recover Chaz's TP as well as add it to the Ryuka list. In order for the game to proceed after Demi joins, Rune cannot be in the party. So we dump him off in Tonoe and get Gryz.
- Zio's Fort: Very good manipulation on the fight to get the Shadowblade, probably the best of all the fights. Once upstairs we create the macros for the byte shift and for the fight, as well as equip Chaz with the Shadowblade (and unequipping his armor to add items to the inventory to escape the negative menus). Juza is manipulated pretty well here, got all the Tsus' average damage to above 467 in order for him to be finished off by Gryz's Nawat. Its important for Chaz to die here, as we cant have him getting more XP.
- Krup Reloaded & Ladea Tower: The spot saved at is important for the byte shift. Saving and loading is required for escapipe usage in Ladea Tower. Walking out is also required over using a telepipe as we dont have an extra telepipe, and if we did it wouldn't be faster because we'd have to save and load again anyways. Encounter manipulation is pretty noticeable in the Land Rover (can you hear the spots it takes place?). Ladea is pretty simple, but there are a lot of delayed frames due to the high encounter rate. Once Rune "joins" we go to the spot in the corner as it is the only spot that will not crash the game if you enter negative menus. Using it here allows us to enter the menu without displaying names (which will hardlock the game), and escapipe out. This would not have worked if we didn't save and load.
- Byte Shift: The moment of truth. An encounter with a Fanbite is manipulated by the sea, their single target attack is extremely fast and allows for a quick shift. Heres a quick breakdown of what important stuff happens:
  1. Items 3-7 are shifted into our party, this means we have Alys (Dagger), 2x Hahn (Hunt Knife), Seth (Leather Shield) and Telepipe(!).
  2. Event flags are shifted backwards, things we did earlier on will have a big effect on the rest of the run.
  3. Ryuka data is corrupted, it now has our saved y position as the index we go to. For those interested, it is now Dezolis.
Seeing as the event flags have shifted, we are sent back to Piata as if we had never completed the Igglanova event.
- Piata 2: There are 2 reasons the item order was important. We need a combination of 3 characters in the front of the party consisting of either Chaz, Hahn or Alys in order for the Igglanova cutscene to not freeze and Alys' C dialogue will stop Telepipe from locking the game when the menu opens. Telepipe has a unique ability. He will destroy an object in the room he enters ala Rune's Flaeli in the cutscene. In the first room of Piata Academy you can see him Thanos one of the NPCs. However, its more important for the run in that he also gets rid of the object that prevents you from passing Hahn in order to reach the basement, which skips a ton of dialogue. Igglanova is the same as before, with easier manipulation because Seth's Mindblast is way better than Chaz's Earth. Alys C dialogue is called up in order to use an escapipe. Dialogue with the Principal again, and his dialogue afterwards is used to stop the menu from locking. Its fastest for whatever reason to get rid of Telepipe here, so thats done, and we use a telepipe to go to "PIATA" aka Dezolis. (as a side note, its required to do this stuff again because we cannot reach The Edge otherwise. The game checks every frame you're on Motavia's overworld to see if its complete and if its not it will throw you back to Piata.)
- Dezolis: We need to open up the Spaceport in order to get back to The Edge. Quick walk/ride through the motions and its done. However, the byte shift strikes again here. If you remember the 100 Meseta chest we opened at the start, the event flag for it being open shifts to the "reunion" cutscene just after obtaining the Elysdeon. This plays through and opens the edge. Its also important to note that we have to get rid of Telepipe for this cutscene, as he destroys Raja and stops the game from continuing. Well worth the watch. (Another note, we can trigger the edge to be open by grabbing the antidote in Piata basement as well. However, it changes the Principal's dialogue and makes it so the Igglanova event is unable to be completed, keeping you trapped in Piata forever)
- The Edge: This is the only dungeon where frames were saved in the walk after I redid RNG manipulation. A whole one frame. We make our way down to The Profound Darkness and... we complete the game. Without fighting the boss. This is due to the byte shift, of course. A chest which is open by default in the Bioplant (thus always being triggered) shifts into the "Profound Darkness" byte setting it to her being defeated.

Possible Improvements:

RNG Manipulation. I'm still a bit of a novice at this, and while I did my best there are certainly spots where things could potentially be faster. Getting a good Hahn death near Kadary would save about 7 frames. If its actually possible to get 4 Speard on the overworld, that would potentially save 1 second. These among other things.
Byte Shift: There is a lot left to discover with this. There are so many variables in its execution and each with different results. I once called up the Seth transformation cutscene (which crashed afterwards), which leads me to think there might be a credit warp somewhere. I was never able to reproduce this effect though.
- Thanks to Veo and Mor_mot for all their work on figuring out the routing for the byte shift stuff. Thanks to Lory for his disassembly which was a big help ( Also thanks to Janus, his TAS was what got me to do a no backtrack Gryz byte shift. Big thanks to the Phantasy Star RTA community as well, wouldn't have done this without you guys.

ThunderAxe31: Judging.
ThunderAxe31: From what I could gather, this run is well made, as of the current game knowledge and techniques.
It's also very entertaining to watch. Even people not familiar with the game would be able to notice that something weird is going on during the movie, in particular the repetition of the Igglanova event and the complete lack of the final boss battle. Lastly, I note that the audience reception was completely positive.
Accepting for Moons as a new branch.
feos: Pub.
feos: Finally changing the branch. See my post.

Last Edited by on 1/1/2022 6:13:47 PM
Page History Latest diff List Referrers