Users browsing this thread: 2 Guest(s)
Determinging sprite assembly
08-28-2016, 02:50 PM
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.
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.
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.
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)
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
09-21-2016, 01:41 PM
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.
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.
« Next Oldest | Next Newest »
Users browsing this thread: 2 Guest(s)