JSR Returning to wrong place in code
#6
From a first quick look you're doing a PHA for "save spell ID". The NotSummon branch is ok (one PHX, one PLX). However the IsSummon has zero push two pull (PLA, PLP) at the end and NotSummon eventually end there too to at CharNextSpell. What you do in fact is restoring the flags according to the stack value preceding your initial PHA. Is the PLP really neccesary? If you really need to restore the flags or clear them do something like the following:

This clear all flags
Code:
LDA #$00
PHA
PLP

Edit: Adding a PHP at beginning of your custom code should work too.
Reply


Messages In This Thread
RE: JSR Returning to wrong place in code - by madsiur - 12-01-2016, 01:23 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Map graphics error and wrong location name Gestahl 4 5,689 03-04-2020, 05:09 PM
Last Post: Gestahl
  Wake Up animation is wrong doofenH 2 2,363 02-01-2020, 06:20 PM
Last Post: C-Dude
Dark Knight FF6 SNES vs GBA code differences? Royaken 2 2,590 11-01-2019, 07:32 PM
Last Post: Royaken
  Peer Sprite Viewer (what am I doing wrong?) romraptor 7 5,415 08-22-2019, 03:04 PM
Last Post: romraptor
  Sorry if this is the wrong place need help Zinchi 2 2,622 11-12-2017, 10:13 PM
Last Post: Zinchi
  Event Hacking - What am I doing wrong? PowerPanda 7 6,738 05-04-2017, 07:29 PM
Last Post: PowerPanda
  asm hacking: "faking" short jumps from your code (in a new bank) to old code Eggers 2 3,911 04-16-2016, 07:18 PM
Last Post: madsiur
  Magic Control Code sleepydude 16 14,317 09-19-2015, 02:41 PM
Last Post: Tenkarider
  Sprite Armor Code Royaken 2 3,577 05-30-2015, 11:26 AM
Last Post: Catone
  How to Place your Custom Boss Hack and how to hide Ayamatsuno148 1 2,705 02-11-2014, 11:49 AM
Last Post: SSJ Rick

Forum Jump:


Users browsing this thread: 1 Guest(s)