News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: Tales of Phantasia Sprite Issue?  (Read 2985 times)

justin3009

  • Hero Member
  • *****
  • Posts: 1650
  • Welp
    • View Profile
Tales of Phantasia Sprite Issue?
« on: August 29, 2011, 08:35:49 am »
So I've stumbled upon a rather interesting issue.  I've modified the sprite load routine so that whenever the value in X is below 0E (00 to 0D is basically PC's only), it'll load a different area for the sprite data.  This works fantastically well, in the menu anyway.  Cless works, Mint, Chester, Arche and Lia all seem to work perfectly fine with no wrong details.  But when it comes to Klarth and Rambard in-game, not in the menu, things go crazy.

Klarth's sprites will.. well look at the image.  And Rambard's sprites simply don't ever show up.  Yet in the menu, they show up perfectly fine.

- Working on Left, Broken on Right.

I'm not absolutely sure what's causing this, but here's what I have as the code.

Code: [Select]
$F0/282E 18          CLC                     A:0A00 X:000A Y:0000 P:envmxdizc
$F0/282F 65 26       ADC $26    [$00:0026]   A:0A00 X:000A Y:0000 P:envmxdizc
$F0/2831 E0 0E 00    CPX #$000E              A:0A06 X:000A Y:0000 P:envmxdizc - Checks if X is below 0E
$F0/2834 90 14       BCC $14    [$284A]      A:0A06 X:000A Y:0000 P:eNvmxdizc - If so,  jump to 284A and load the new location for Sprite Data.
$F0/284A AA          TAX                     A:0A06 X:000A Y:0000 P:eNvmxdizc
$F0/284B BF 5E 28 F0 LDA $F0285E,x[$F0:3264] A:0A06 X:0A06 Y:0000 P:envmxdizc
$F0/284F 85 10       STA $10    [$00:0010]   A:0700 X:0A06 Y:0000 P:envmxdizc
$F0/2851 BF 60 28 F0 LDA $F02860,x[$F0:3266] A:0700 X:0A06 Y:0000 P:envmxdizc
$F0/2855 85 12       STA $12    [$00:0012]   A:0045 X:0A06 Y:0000 P:envmxdizc
$F0/2857 BF 62 28 F0 LDA $F02862,x[$F0:3268] A:0045 X:0A06 Y:0000 P:envmxdizc

That's really all there is in the custom routine.  It works perfect in the menus and for most of the part outside the menu, but Klarth and Rambard just seem to blow up.

« Last Edit: August 29, 2011, 08:51:03 am by justin3009 »
'We have to find some way to incorporate the general civilians in the plot.'

'We'll kill off children in the Juuban district with an infection where they cough up blood and are found hanging themselves from cherry blossom trees.'

Nightcrawler

  • Hero Member
  • *****
  • Posts: 5787
    • View Profile
    • Nightcrawler's Translation Corporation
Re: Tales of Phantasia Sprite Issue?
« Reply #1 on: August 29, 2011, 11:14:01 am »
What does VSNES tell you? Should be easy to diagnose with a quick savestate and VSNES. You'll see what's in VRAM, the attributes of the sprite, and can figure out what's wrong from there. Once you figure out what went wrong, you can use that information for some breakpoints to see how the incorrect values got there.
TransCorp - Over 20 years of community dedication.
Dual Orb 2, Wozz, Emerald Dragon, Tenshi No Uta, Glory of Heracles IV SFC/SNES Translations

justin3009

  • Hero Member
  • *****
  • Posts: 1650
  • Welp
    • View Profile
Re: Tales of Phantasia Sprite Issue?
« Reply #2 on: August 29, 2011, 11:21:55 am »
Well from the looks of it in the Savestate, it's loading the sprites absolutely normally.  But I have to literally flip Klarth's sprites upside down and then they appear correctly in game.  I have no clue what would cause it to load Klarth's sprites upside down while the others remain normal.  That's such a strange issue.

Edit: Well, I found a solution but it's not the one I like.  I redid the code so it checks if the PC value is 8 and below (PC's 1-4)  If so, load them in a new area.  Otherwise, load the rest normally.  Doing that, I'm able to cut out Cless, Mint, Arche and Chester's animation data in the original area.  Which is more than enough in all honesty, so now everything is working pretty perfectly.
« Last Edit: August 29, 2011, 01:15:11 pm by justin3009 »
'We have to find some way to incorporate the general civilians in the plot.'

'We'll kill off children in the Juuban district with an infection where they cough up blood and are found hanging themselves from cherry blossom trees.'

RedScorpion

  • Full Member
  • ***
  • Posts: 111
    • View Profile
    • Snes-Projects
Re: Tales of Phantasia Sprite Issue?
« Reply #3 on: September 02, 2011, 06:47:02 am »
hi,

what is the differenz between your engine mod and the original?

Are there any adventages ? If yes, which?

kind regards

red

justin3009

  • Hero Member
  • *****
  • Posts: 1650
  • Welp
    • View Profile
Re: Tales of Phantasia Sprite Issue?
« Reply #4 on: September 02, 2011, 07:42:32 am »
There isn't much yet.

This one will have some reorganization to look more like the GBA version.  If I'm able to pull it off, updated sprites and animations.  Also, probably changed enemy stats and a new playable character restricted to the SNES version only.

There's also going to be some change in dialogue among other features.

Edit: I went back with this issue and figured out finally what was going on.  There was another part of the equation that I completely missed to load sprites.  Since I moved which PC's are being loaded, it was loading the wrong area since I had to change the pointers.  Found the extra area, altered the code to fit what it should and now PC's can be moved back to where they were and it'll work again.  Now I can restructure my data a bit more.
« Last Edit: September 03, 2011, 10:14:56 am by justin3009 »
'We have to find some way to incorporate the general civilians in the plot.'

'We'll kill off children in the Juuban district with an infection where they cough up blood and are found hanging themselves from cherry blossom trees.'