diff --git a/src/Sprite.s b/src/Sprite.s index e8d685d..2eda837 100644 --- a/src/Sprite.s +++ b/src/Sprite.s @@ -143,6 +143,7 @@ _DoPhase1 bit #SPRITE_STATUS_REMOVED beq :no_clear + brk $02 lda _SpriteBits,y ; Clear from the sprite bitmap sta SpriteRemovedFlag ; Stick a non-zero value here diff --git a/src/Tool.s b/src/Tool.s index 1f4315f..ec94670 100644 --- a/src/Tool.s +++ b/src/Tool.s @@ -335,7 +335,7 @@ _TSRemoveSprite _TSEntry lda :spriteSlot,s - jsr _UpdateSprite + jsr _RemoveSprite _TSExit #0;#2 diff --git a/src/tiles/FastRenderer.s b/src/tiles/FastRenderer.s index 298c100..72f61d0 100644 --- a/src/tiles/FastRenderer.s +++ b/src/tiles/FastRenderer.s @@ -39,31 +39,6 @@ FastTileProcs dw _TBCopyDataFast,_TBCopyDataFast,_TBCopyDataFast,_TBCopyDataFa SpriteDispatch txy SpriteBitsToVBuffAddrs OneSpriteFast;OneSpriteFast;OneSpriteFast;OneSpriteFast - sta sprite_ptr0 - ldx TileStore+TS_TILE_ADDR,y - jsr _CopyTileDataToDP2 ; preserves Y - lda TileStore+TS_CODE_ADDR_HIGH,y ; load the bank of the target code field line - pha ; and put on the stack for later. Has TileStore bank in high byte. - ldx sprite_ptr0 ; address of sprite vbuff info - lda TileStore+TS_CODE_ADDR_LOW,y ; load the address of the code field - tay -; jmp _TBApplySpriteData2 - -_TBApplySpriteData2 -]line equ 0 - lup 8 - lda blttmp+{]line*4} - andl spritemask+{]line*SPRITE_PLANE_SPAN},x - oral spritedata+{]line*SPRITE_PLANE_SPAN},x - sta: $0004+{]line*$1000},y - - lda blttmp+{]line*4}+2 - andl spritemask+{]line*SPRITE_PLANE_SPAN}+2,x - oral spritedata+{]line*SPRITE_PLANE_SPAN}+2,x - sta: $0001+{]line*$1000},y -]line equ ]line+1 - --^ - rts ; Where there are sprites involved, the first step is to call a routine to copy the ; tile data into a temporary buffer. Then the sprite data is merged and placed into @@ -72,6 +47,39 @@ _TBApplySpriteData2 ; A = vbuff address ; Y = tile store address OneSpriteFast + sta sprite_ptr0 + ldx TileStore+TS_TILE_ADDR,y + jsr _CopyTileDataToDP2 ; preserves Y + lda TileStore+TS_CODE_ADDR_HIGH,y ; load the bank of the target code field line + pha ; and put on the stack for later. Has TileStore bank in high byte. + ldx sprite_ptr0 ; address of sprite vbuff info + lda TileStore+TS_CODE_ADDR_LOW,y ; load the address of the code field + tay + plb + +; jmp _TBApplySpriteData2 + +_TBApplySpriteData2 +]line equ 0 + lup 8 + lda blttmp+{]line*4} + andl spritemask+{]line*SPRITE_PLANE_SPAN},x + oral spritedata+{]line*SPRITE_PLANE_SPAN},x +; lda #$FFFF + sta: $0004+{]line*$1000},y + + lda blttmp+{]line*4}+2 + andl spritemask+{]line*SPRITE_PLANE_SPAN}+2,x + oral spritedata+{]line*SPRITE_PLANE_SPAN}+2,x +; lda #$FFFF + sta: $0001+{]line*$1000},y +]line equ ]line+1 + --^ + plb + rts + + +OneSpriteFastX tax ; address of the sprite data lda TileStore+TS_BASE_TILE_COPY,y ; copy routine (handles flips and other behaviors) stal osf_copy+1