Determinging sprite assembly
#1
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.
Reply
#2
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
Reply
#3
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.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Altering text via assembly without breaking things Kenefactor 3 3,081 12-06-2019, 12:15 AM
Last Post: madsiur
  Assembly Programming the_randomizer 37 45,197 09-24-2016, 03:55 PM
Last Post: PinkMawile
  Sword Swing Assembly Question Zeemis 2 4,167 07-03-2011, 04:01 PM
Last Post: Zeemis
  My Assembly Notes Zeemis 1 3,199 03-04-2011, 07:49 PM
Last Post: Angelo26

Forum Jump:


Users browsing this thread: 1 Guest(s)