Users browsing this thread: 1 Guest(s)
Determinging sprite assembly

#1
Posts: 49
Threads: 3
Thanks Received: 3
Thanks Given: 1
Joined: Mar 2016
Reputation: 0
Status
None
How does the game determine which sprite assembly information to apply to each sprite?  C0CE3A contains the patterns for the actually assembly, but I can't figure out how it knows which one to apply.

For instance, sprites 0 through 21 use the first 516 bytes from that area then switches to a different section for sprites 22-25, then switches again.
There doesn't appear to be a table that it's looking up.
I've gone over the code that seems to load the images C06777, but I can't figure out how it determines when to stop.  Best I can tell, it's based off decrementing the memory at $18, but it looks like that's just set to 6 at C067A5.
  Find
Quote  

#2
Posts: 3,970
Threads: 279
Thanks Received: 236
Thanks Given: 58
Joined: Oct 2011
Reputation: 65
Status
Tissue-aware
Which entry the table loads seems to be based on $0876 (the C0/6879 instance may have already $0876 loaded when reaching that point):

Edit: Also, the C0/67E0-C0/67E9 equation is important because it is what determine the real X value. Using a debugger could help you.

Code:
C0/67DD:    B97608      LDA $0876,Y
C0/67E0:    293F00      AND #$003F
C0/67E3:    0A          ASL A
C0/67E4:    0A          ASL A
C0/67E5:    8512        STA $12
C0/67E7:    0A          ASL A
C0/67E8:    18          CLC
C0/67E9:    6512        ADC $12
C0/67EB:    AA          TAX
C0/67EC:    A00100      LDY #$0001
C0/67EF:    BF3ACEC0    LDA $C0CE3A,X

If you track down $0876, you'll see that twice it is loaded with a table that appear as garbage in the disassembly. I'm not sure if that is part of the answer but figuring out that table could help. That is the only thing I've found. Good luck! (I'm no sprite assembly expert)

Code:
C0/53A2:    BF2D58C0    LDA $C0582D,X
C0/53A6:    997708      STA $0877,Y
C0/53A9:    997608      STA $0876,Y

C0/465D:    BF2D58C0    LDA $C0582D,X
C0/4661:    997608      STA $0876,Y
C0/4664:    997708      STA $0877,Y
  Find
Quote  

#3
Posts: 49
Threads: 3
Thanks Received: 3
Thanks Given: 1
Joined: Mar 2016
Reputation: 0
Status
None
I did sort of figure this out. The answer is that is doesn't.
It knows where each sprite is, and how large a pose is, then determines where each pose is mathematically.
If a sprite doesn't have that many poses, it will just try to pull from the same position, either getting a later character or gibberish.
  Find
Quote  



Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite