Users browsing this thread: 1 Guest(s)
Breakable Tools - Need Help

#2
Posts: 383
Threads: 34
Thanks Received: 10
Thanks Given: 13
Joined: Dec 2018
Reputation: 18
Status
Moog
Well, you don't need to worry about the SEP #$20 in this case. Serity's been teaching me about the stack variables and the accumulator and because you used PHP to push it, all that accumulator stuff will be reset with the PLP to pull it back.

I'm inclined to suggest that maybe you should explicitly set $32F4,X with the tool identity in the no_break branch. That would involve preserving that first A, though, before you even multiply it by 30... either in a scratch variable or by loading its value from the stack. The later requires an intimate knowledge of what's on the stack and how tall it is, though, so I'm not sure what value you'd use.

It uses the first in last out method, though... so perhaps it's as simply as LDA $02,S, because A was pushed onto the stack in the subroutine and then P was.

So... you could maybe try this for no_break:
Code:
no_break:
LDA #$10
TSB $B1        ;  set flag to re-add item to inventory at the end of the character's turn
SEP #$10       ;  Set 8-bit X and Y
TYX
LDA $02,S    ; Load A's original value from the stack?
STA $32F4,X    ;  Save as tool to add back to inventory, just to be safe.
LDA $3018,X
  Find
Quote  
[-] The following 1 user says Thank You to C-Dude for this post:
  • PowerPanda (07-05-2021)



Messages In This Thread
Breakable Tools - Need Help - by PowerPanda - 07-05-2021, 02:36 PM
RE: Breakable Tools - Need Help - by C-Dude - 07-05-2021, 03:31 PM
RE: Breakable Tools - Need Help - by PowerPanda - 07-05-2021, 05:36 PM
RE: Breakable Tools - Need Help - by C-Dude - 07-05-2021, 06:10 PM
RE: Breakable Tools - Need Help - by SirNewtonFig - 07-05-2021, 06:50 PM
RE: Breakable Tools - Need Help - by PowerPanda - 07-05-2021, 09:42 PM
RE: Breakable Tools - Need Help - by C-Dude - 07-06-2021, 12:00 AM
RE: Breakable Tools - Need Help - by Gi Nattak - 07-06-2021, 12:41 AM
RE: Breakable Tools - Need Help - by C-Dude - 07-06-2021, 01:27 AM
RE: Breakable Tools - Need Help - by PowerPanda - 07-06-2021, 10:31 AM
RE: Breakable Tools - Need Help - by Gi Nattak - 07-06-2021, 10:45 AM
RE: Breakable Tools - Need Help - by C-Dude - 07-06-2021, 03:16 PM
RE: Breakable Tools - Need Help - by SirNewtonFig - 07-07-2021, 06:54 AM
RE: Breakable Tools - Need Help - by PowerPanda - 07-07-2021, 09:51 AM
RE: Breakable Tools - Need Help - by Bropedio - 07-07-2021, 10:31 AM
RE: Breakable Tools - Need Help - by SirNewtonFig - 07-07-2021, 01:28 PM
RE: Breakable Tools - Need Help - by Subtraction - 07-07-2021, 11:38 AM
RE: Breakable Tools - Need Help - by PowerPanda - 07-07-2021, 04:10 PM
RE: Breakable Tools - Need Help - by C-Dude - 07-07-2021, 05:33 PM
RE: Breakable Tools - Need Help - by SirNewtonFig - 07-08-2021, 08:21 AM
RE: Breakable Tools - Need Help - by SirNewtonFig - 07-08-2021, 02:16 PM
RE: Breakable Tools - Need Help - by C-Dude - 07-08-2021, 05:31 PM
RE: Breakable Tools - Need Help - by Bropedio - 07-07-2021, 05:46 PM
RE: Breakable Tools - Need Help - by C-Dude - 07-07-2021, 06:18 PM
RE: Breakable Tools - Need Help - by PowerPanda - 07-07-2021, 09:24 PM
RE: Breakable Tools - Need Help - by C-Dude - 07-08-2021, 01:40 AM
RE: Breakable Tools - Need Help - by PowerPanda - 07-08-2021, 11:14 AM

Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite