Users browsing this thread: 1 Guest(s)
Summon Odin and Raiden through Magicite/Slots

#1
Posts: 831
Threads: 41
Thanks Received: 16
Thanks Given: 12
Joined: Nov 2009
Reputation: 18
Status
None
Title: Summon Odin and Raiden
Created By: Angelo
Download


Description: In the original FF3 SNES game, scoring three bars under the "slots" command or using the "magicite" item causes the game to summon a random esper. Any esper can be summoned, except Odin and Raiden. This patch removes that limitation, allowing for Odin and Raiden to be randomly called when using any of the above mentioned options.





The code affected is from the following area in C2 bank:
Code:
Pick a random Esper (not Odin or Raiden)
C2/37DC: A9 19        LDA #$19
C2/37DE: 20 65 4B     JSR $4B65   (0 to $18)
C2/37E1: C9 0B        CMP #$0B
C2/37E3: 90 02        BCC $37E7   (Branch if A < $0B)
C2/37E5: 1A           INC         (Add 2 if over $0B)
C2/37E6: 1A           INC
C2/37E7: 18           CLC
C2/37E8: 69 36        ADC #$36
C2/37EA: 60           RTS

The Changed code is as follows:
Code:
C2/37DC: A9 1B         LDA #$1B
C2/37DE: 20 65 4B     JSR $4B65   (0 to 20)
C2/37E1: EA EA         NOP
C2/37E3: EA EA         NOP
C2/37E5: EA             NOP        
C2/37E6: EA             NOP
C2/37E7: 18             CLC
C2/37E8: 69 36         ADC #$36
C2/37EA: 60             RTS

Please let me know if any conflicts arise from using this patch. If used, please give proper credit.
Quote  

#2
Posts: 2,768
Threads: 88
Thanks Received: 24
Thanks Given: 87
Joined: Jun 2009
Reputation: 25
Status
None
nice


"Sometimes ninjas do wrong to each other, and in dat way the force of tha earf' comes around da moon - and at that presence, da dirt, it overshadows the grass, so you're like, I can't cut dis grass, there's no sun comin' through. So in order to enable each other the two fruits have to look each other in da eye and understand we can only be right, as da ripe is wrong, you know what I mean?"

-HNIC
Quote  

#3
Posts: 3,969
Threads: 279
Thanks Received: 236
Thanks Given: 57
Joined: Oct 2011
Reputation: 65
Status
Tissue-aware
Good job!

What did you changed exacly? just curious since there is no readme with your file. I could look at the patch too but I prefer asking the author when I can...
  Find
Quote  

#4
Posts: 831
Threads: 41
Thanks Received: 16
Thanks Given: 12
Joined: Nov 2009
Reputation: 18
Status
None
I have been able to work on a variation of this "hack". It might not be a great discovery, but it's a great start for those who want to learn ASM.

After releasing this patch, the thought occurred to me: "Why didn't the original programmers adjusted the code in such a way that Odin can be summoned via magicite once you get his esper? And, why can't you summon raiden when you upgrade Odin?"

To answer the question, the new code now identifies which esper have you obtained: Odin or Raiden. Since this is only possible to know via event bits, those must be loaded along with the code that summons a random esper via the magicite (in the C2 Bank). You can expect one of the following three scenarios now to occur:

1. Use a magicite piece before obtaining Odin or Raiden - The code will simply select a random esper and summon it. Neither will be available at this time.
2. Use the magicite in battle after obtaining Odin the Esper - The code reads the event bit for obtaining Odin (now set), giving you the chance of randomly summoning Odin.
3. Use the magicite after upgrading Odin to Raiden - The code reads the event bit for obtaining Raiden (now active), and the code from point 2 above will now be bypassed. This will give you the chance of randomly summoning Raiden when using the magicite for the rest of the game.

The original code is replaced by NOP, as well as a JMP to C2/FAC0..
Code:
C2/37DC: 20 C0 FA     //JSR $FAC0
C2/37E0: EA              //NOP
C2/37E1: EA EA         //NOP
C2/37E3: EA EA         //NOP
C2/37E5: EA             //NOP
C2/37E6: EA             //NOP
C2/37E7: EA             //NOP
C2/37E8: EA EA         //NOP
C2/37EA: 60             //RTS

And the new code at C2/FAC0 is as follows...
Code:
C2/FAC0: A9 1B       // 1B is the total number of espers
C2/FAC2: 20 65 4B   // Generate a Random Number here
C2/FAC5: C9 0B       // Is it Odin?
C2/FAC7: F0 17       // BEQ FAE0
C2/FAC9: C9 0C      // Is it Raiden?
C2/FACB: F0 13      // BEQ FAE0
C2/FACD: 18          // CLC..If it's any other esper, do the next few lines
C2/FACE: 69 36      // ADC #$36
C2/FAD0: 60          // RTS

C2/FAE0: AF991E7E   // Load 7E/1E99 (Odin's bit is 1E99, bit 0...so Did the party get odin?)
C2/FAE4: 29 01      // AND #$01
C2/FAE6: C9 01      // Is it equal to 1?
C2/FAE8: F0 06      // BEQ FAF0 (If odin was obtained, we need to check raiden's bit too)
C2/FAEA: 1A        
C2/FAEB: 1A         // ELSE increment twice...this leavs shiva as a default but can be changed..
C2/FAEC: 18         // CLC..If it's any other esper, do the next few lines
C2/FAED: 69 36
C2/FAEF: 60

C2/FAF0: AFDB1E7E   // Load 7E/1EDB (We're here if we got odin..so Did the party get raiden?)
C2/FAF4: 29 20      // AND #$20
C2/FAF6: C9 20      // Is it equal to 20?
C2/FAF8: F0 06      // BEQ FB00 (We got odin and raiden, so summon raiden)
C2/FBFA: A9 0B      // Else...Load Odin
C2/FBFC: 18         // CLC..
C2/FAFD: 69 36      // ADC #$36
C2/FAFF: 60         // RTS

C2/FB00: A9 0C      // Load Raiden
C2/FB02: 18         // CLC..
C2/FA03: 69 36      // ADC #$36
C2/FA05: 60         // RTS

Note that when you are on case 1 - summoning via magicite before getting to Odin - whenever the game gets the ID for Odin, the option would be diverted and instead you'd get Shiva. This can be changed by replacing the increments of 1A by A9 XX. XX is the esper ID, and it starts with Ramuh at 00. You'd get Ramuh to be summoned by using A9 00.

The code might not be as optimal as possible, but I believe it gets the job done. If you have problems with this let me know.
Quote  
[-] The following 1 user says Thank You to Angelo26 for this post:
  • marcioseufi (07-05-2019)

#5
Posts: 763
Threads: 83
Thanks Received: 55
Thanks Given: 7
Joined: Apr 2015
Reputation: 22
Status
Obliviscence
Instead of loading Shiva, why not branch back to the C2/FAC0 to start the process over again? This way you would give each esper a new random chance, so you don't end up with lop-sided odds.

Code:
C2/FAE0: AF991E7E   // Load 7E/1E99 (Odin's bit is 1E99, bit 0...so Did the party get odin?)
C2/FAE4: 29 01      // AND #$01
C2/FAE6: C9 01      // Is it equal to 1?
C2/FAE8: F0 06      // BEQ FAF0 (If odin was obtained, we need to check raiden's bit too)
C2/FAEA: 18         // CLC
C2/FAEB: D0 D3      // Branch back to C2/FAC0 to pick new random esper

This way it can run the code until it doesn't pick Odin/Raiden.
  Find
Quote  

#6
Posts: 831
Threads: 41
Thanks Received: 16
Thanks Given: 12
Joined: Nov 2009
Reputation: 18
Status
None
That's a nice idea, Thanks for the suggestion! I'll try it and release a patch sometime soon.
Quote  



Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite