Newbie Still Doesn't Understand Code
#23
With the benefit of hindsight, I can answer myself.

(10-12-2016, 10:51 AM)Turbotastic Wrote: All right, I was playing around with NOP-ing pieces of the code with various degrees of success*, and I became curious about something.

Despite the fact that the "default" view is the normal pool of available spells, both the code and my tests seem to indicate that the Spell + Cost view when pressing Y mode is actually the primary mode (and thus any changes must be made there first), while the view the player sees by default is actually the secondary view. Is this actually the case, or am I making a distinction where there is none?


You're making a distinction where there is none, because you don't understand how the code works and why the change you made did have an effect.

The spell availability in "Y mode" is based on whether that specific spell is known or not. However, this is likely the secondary mode, as it occurs after the branch away from the main code. Basically, the game treats the menu normally unless Y is pressed. Given how simplified the menu is and that its appearance is determined through used of the existing subroutines, you can gather this is the secondary mode if you plan to distinguish them like that.

There is duplicate code to determine whether to blank out a spell as you have noticed, but this is because the conditions for "Y mode" derive from the percentage of spells known and uses that as a barometer for blanking out a slot. That is the code you affected. As was mentioned, yes, it could be done more efficiently, but that's an irrelevant detail. "Y mode" doesn't contain any display option for partially known spells and just either makes the spell available or not.

The key fact is that you haven't grasped is that while "Y mode" is on/off in terms of spell display, the regular menu is made of subroutines which determine how a spell is displayed (on/off/partial). Basically, you are going to have to hop around the various subroutines to actually figure out the order they are applied. Even with documentation, this isn't straightforward. That spell generation (or more accurately, spell elimination) procedure is what you are going to have to hijack as well.  Once you figure out how to do that, modifying "Y mode" will be simpler in comparison.

(10-12-2016, 10:51 AM)Turbotastic Wrote: *My short-term goal was to allow spells to be available even if they aren't in the actor's spell list. I had limited success on that front. I NOPed C3/4FE0-C3/4FE3 andC3/4FE7-C3/4FEA and all the spells became usable when I pressed Y.  When I NOP-ed C3/4FD5, though, removing the branch granted access to the spells...but removed the ability to see the spells without the MP cost next to them.

You essentially rendered the menu acting like Y is pressed all the time by removing the branch. However, you did not change the behavior of magic list population outside of that limited scenario. You need to figure out the place or places that this occurs, then work with that simplified menu later.

Although you did make some baby steps, you are going to have to look at the code more broadly than serially, line by line. You have to figure out the process, not just the general guidelines and overall rules, of how the list builds itself.
Reply


Messages In This Thread
RE: Newbie Still Doesn't Understand Code - by dn - 09-21-2016, 12:06 PM
RE: Newbie Still Doesn't Understand Code - by Turbotastic - 08-09-2017, 10:05 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
Dark Knight FF6 SNES vs GBA code differences? Royaken 2 2,583 11-01-2019, 07:32 PM
Last Post: Royaken
  Newbie Question - Granting Playable Character Status Immunity Turbotastic 2 3,624 04-04-2017, 07:28 PM
Last Post: Turbotastic
  Newbie Finally Figures Something Out (NOT a help request) Turbotastic 8 10,097 09-29-2016, 08:32 AM
Last Post: Tenkarider
  asm hacking: "faking" short jumps from your code (in a new bank) to old code Eggers 2 3,904 04-16-2016, 07:18 PM
Last Post: madsiur
  A newbie's question Lateblooming 12 11,271 04-08-2016, 06:08 AM
Last Post: Lateblooming
  Trying to understand subroutines Kugawattan 24 22,717 12-08-2015, 10:48 PM
Last Post: Kugawattan
  Hexadecimal code doesn't match with Invoke Battle? Kugawattan 3 3,942 12-06-2015, 06:03 PM
Last Post: Kugawattan
  Magic Control Code sleepydude 16 14,312 09-19-2015, 02:41 PM
Last Post: Tenkarider
  Sprite Armor Code Royaken 2 3,574 05-30-2015, 11:26 AM
Last Post: Catone
  How do I add magic?(newbie help) Pingurules 5 5,796 03-19-2014, 06:33 PM
Last Post: madsiur

Forum Jump:


Users browsing this thread: 1 Guest(s)