From 942e57e826bfaf83a76f656adb0f8b8e30f1ec56 Mon Sep 17 00:00:00 2001 From: alpine9000 Date: Mon, 18 Apr 2016 19:31:24 +1000 Subject: [PATCH] Fast screen setup --- 028.game2/foreground.tmx | 2 +- 028.game2/game1.s | 13 +++++++------ 028.game2/items.s | 7 +++++-- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/028.game2/foreground.tmx b/028.game2/foreground.tmx index 48f96de..ee7de57 100644 --- a/028.game2/foreground.tmx +++ b/028.game2/foreground.tmx @@ -13,7 +13,7 @@ - eJxjYBgFo2AUjIKhA5wYUfmOjNjVESs/CugHQHGBHH9OjJjxOQpGwSgYBaNg+AMAVHkB0w== + eJxjYBgFIw04MQ60C0bBSAXUSHvoZjgSMJOQ/CigHwDFBXL8gfgDHT9DuTx0YkTFIxGQ4u+RGkbIYDQMRsFgAQAdzQRv diff --git a/028.game2/game1.s b/028.game2/game1.s index a859f64..894b94d 100644 --- a/028.game2/game1.s +++ b/028.game2/game1.s @@ -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 diff --git a/028.game2/items.s b/028.game2/items.s index 41b6f91..aa59af6 100644 --- a/028.game2/items.s +++ b/028.game2/items.s @@ -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<