Fast screen setup

This commit is contained in:
alpine9000
2016-04-18 19:31:24 +10:00
parent dcf1eea88b
commit 942e57e826
3 changed files with 13 additions and 9 deletions
+1 -1
View File
@@ -13,7 +13,7 @@
</layer>
<layer name="items" width="100" height="8">
<data encoding="base64" compression="zlib">
eJxjYBgFo2AUjIKhA5wYUfmOjNjVESs/CugHQHGBHH9OjJjxOQpGwSgYBaNg+AMAVHkB0w==
eJxjYBgFIw04MQ60C0bBSAXUSHvoZjgSMJOQ/CigHwDFBXL8gfgDHT9DuTx0YkTFIxGQ4u+RGkbIYDQMRsFgAQAdzQRv
</data>
</layer>
</map>
+7 -6
View File
@@ -13,6 +13,7 @@
xdef itemsMap
xdef mapSize
xdef moving
xdef foregroundScrollPixels
byteMap:
dc.l Entry
@@ -57,8 +58,8 @@ MainLoop:
SetupBoardLoop:
add.l #1,frameCount
move.l frameCount,d6
;; move.l #FOREGROUND_SCROLL_PIXELS*15,foregroundScrollPixels
move.l #FOREGROUND_SCROLL_PIXELS,foregroundScrollPixels
move.l #(FOREGROUND_SCROLL_PIXELS*16)-1,foregroundScrollPixels
;; move.l #FOREGROUND_SCROLL_PIXELS,foregroundScrollPixels
;; jsr WaitVerticalBlank
bsr HoriScrollPlayfield
jsr SwitchBuffers ; takes bitplane pointer offset in d0
@@ -67,8 +68,8 @@ SetupBoardLoop:
bsr Update
bsr RenderNextForegroundFrame
;; bsr RenderNextBackgroundFrame
cmp.l #FOREGROUND_PLAYAREA_WIDTH_WORDS*15,frameCount
;; cmp.l #FOREGROUND_PLAYAREA_WIDTH_WORDS,frameCount
;; cmp.l #FOREGROUND_PLAYAREA_WIDTH_WORDS*15,frameCount
cmp.l #FOREGROUND_PLAYAREA_WIDTH_WORDS,frameCount
bge .gotoGameLoop
bra SetupBoardLoop
@@ -80,8 +81,8 @@ GameLoop:
add.l #1,frameCount
move.l frameCount,d6
cmp.l #FOREGROUND_PLAYAREA_WIDTH_WORDS*15+25,d6
;; cmp.l #FOREGROUND_PLAYAREA_WIDTH_WORDS+25,d6
;; cmp.l #FOREGROUND_PLAYAREA_WIDTH_WORDS*15+25,d6
cmp.l #FOREGROUND_PLAYAREA_WIDTH_WORDS+25,d6
bne .c1
move.w #(DMAF_SPRITE|DMAF_BLITTER|DMAF_SETCLR!DMAF_COPPER!DMAF_RASTER!DMAF_MASTER),DMACON(a6)
jsr InitialisePig
+5 -2
View File
@@ -5,7 +5,9 @@
xdef RenderItemSprite
ScrollItemSprites:
sub.w #1,itemX
;; sub.w #1,itemX
move.l foregroundScrollPixels,d0
sub.w d0,itemX
rts
SetupItemSpriteData:
@@ -25,6 +27,7 @@ SetupItemSpriteData:
mulu.w #64+12,d0
add.l d0,a0
move.w itemLagX,d0
lsr.w #FOREGROUND_SCROLL_SHIFT_CONVERT,d0 ; convert to pixels
move.w itemX,itemLagX
add.w #32,d0
move.w d0,d1
@@ -56,7 +59,7 @@ RenderItemSprite:
cmpi.w #0,(a3)
beq .dontAddSprite
move.l #deadSprite,currentItemSprite
move.w #337,itemX
move.w #337<<FOREGROUND_SCROLL_SHIFT_CONVERT,itemX
mulu.w #16,d2
move.w #255-12,d3
sub.w d2,d3