User Tools

Site Tools


base:sprite_interleave

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
base:sprite_interleave [2020-10-15 17:16] – created raistlinbase:sprite_interleave [2020-10-26 18:00] (current) raistlin
Line 6: Line 6:
  
 When using large arrays of sprites, eg. an 8x10 array, it can be tricky to do this without having gaps or glitches. Annoyingly, C64 sprites are 21 pixels tall - so it's not possible to have this array without at least one row of sprites being around a bad line - where there simply aren't enough cycles to update all the sprite values. When using large arrays of sprites, eg. an 8x10 array, it can be tricky to do this without having gaps or glitches. Annoyingly, C64 sprites are 21 pixels tall - so it's not possible to have this array without at least one row of sprites being around a bad line - where there simply aren't enough cycles to update all the sprite values.
 +
 +----
 +{{:base:thedive-and-mementomori.png}}
 +----
 +
  
 This becomes especially problematic when you're dealing with varying D011 - eg. in the intro sequence of "The Dive" where we have a bitmap upscroller behind a sprite array. This becomes especially problematic when you're dealing with varying D011 - eg. in the intro sequence of "The Dive" where we have a bitmap upscroller behind a sprite array.
Line 41: Line 46:
 We also need to "roll" the sprite data for each row as well. We also need to "roll" the sprite data for each row as well.
  
 +----
 +{{:base:spriteinterleave.png}}
 +----
  
 === Updating Sprite Values === === Updating Sprite Values ===
Line 72: Line 80:
  
 <code> <code>
-      LDA #64 + 4 +      LDX #64 + 4 
-      LDX #$fb +      LDA #$fb 
-      SAX ScreenAddr + $3f8 + 0; <-- SAX will write "A & X" .. ie. 64 here +      SAX ScreenAddr + $3f8 + 0; <-- SAX will write "& A" .. ie. 64 here 
-      STA ScreenAddr + $3f8 + 4+      STX ScreenAddr + $3f8 + 4
       INX       INX
       SAX ScreenAddr + $3f8 + 1       SAX ScreenAddr + $3f8 + 1
-      STA ScreenAddr + $3f8 + 5+      STX ScreenAddr + $3f8 + 5
       INX       INX
       SAX ScreenAddr + $3f8 + 2       SAX ScreenAddr + $3f8 + 2
-      STA ScreenAddr + $3f8 + 6+      STX ScreenAddr + $3f8 + 6
       INX       INX
       SAX ScreenAddr + $3f8 + 3       SAX ScreenAddr + $3f8 + 3
-      STA ScreenAddr + $3f8 + 7+      STX ScreenAddr + $3f8 + 7
 </code> </code>
  
base/sprite_interleave.1602774989.txt.gz · Last modified: 2020-10-15 17:16 by raistlin