From 008e5f9c4d12effd7973fd29ef3b513053f76b99 Mon Sep 17 00:00:00 2001 From: alpine9000 Date: Sat, 7 May 2016 17:51:21 +1000 Subject: [PATCH] skipped frame counter, a4k sprite sync, audio wait bug fix --- 028.bs/game1.s | 52 ++++++++++++++++++++++--------------------------- 028.bs/items.s | 8 ++++---- 028.bs/macros.i | 10 ++++++---- 3 files changed, 33 insertions(+), 37 deletions(-) diff --git a/028.bs/game1.s b/028.bs/game1.s index 019a193..1abba4f 100644 --- a/028.bs/game1.s +++ b/028.bs/game1.s @@ -81,7 +81,7 @@ Entry: jsr InitialiseItems -Reset: +Reset: lea livesCounterText,a0 bsr DecrementCounter move.w #218,d0 @@ -169,27 +169,29 @@ FadeInLoop: jsr InitialisePlayer jsr EnableItemSprites - lea frameCounterText,a0 - bsr ResetCounter - lea verticalBlankCounterText,a0 - bsr ResetCounter - + move.l #0,verticalBlankCount + move.l #1,frameCount bra GameLoop .c1: bra FadeInLoop GameLoop: - if 0 - lea frameCounterText,a0 - bsr IncrementCounter - lea frameCounterText,a1 - move.w #31,d0 - jsr RenderCounter - lea verticalBlankCounterText,a1 - move.w #101,d0 - jsr RenderCounter - endif + move.l verticalBlankCount,d0 + move.l frameCount,d1 + cmp.l d1,d0 + beq .noSkippedFrames + addq #1,d0 + cmp.l d1,d0 + beq .noSkippedFrames + move.l frameCount,verticalBlankCount + lea skippedFramesCounterText,a0 + jsr IncrementCounter + lea skippedFramesCounterText,a1 + move.w #110,d0 + jsr RenderCounter +.noSkippedFrames: + add.l #1,frameCount move.l frameCount,d6 @@ -783,8 +785,6 @@ Level3InterruptHandler: .verticalBlank: move.w #INTF_VERTB,INTREQ(a6) ; clear interrupt bit add.l #1,verticalBlankCount - lea verticalBlankCounterText,a0 - bsr IncrementCounter jsr SetupSpriteData jsr P61_Music .checkCopper: @@ -893,6 +893,11 @@ gameOverMessage: dc.b 0 align 4 +skippedFramesCounterText: + dc.b "0000" + dc.b 0 + align 4 + livesCounterText: dc.b "00" livesCounterShortText: @@ -900,17 +905,6 @@ livesCounterShortText: dc.b 0 align 4 -frameCounterText: - dc.b "0000" - dc.b 0 - align 4 - -verticalBlankCounterText: - dc.b "0000" - dc.b 0 - align 4 - - copperList: panelCopperListBpl1Ptr: dc.w BPL1PTL,0 diff --git a/028.bs/items.s b/028.bs/items.s index cec14ce..0e8ac45 100644 --- a/028.bs/items.s +++ b/028.bs/items.s @@ -23,7 +23,7 @@ ScrollItemSprites: move.l foregroundScrollPixels,d0 cmp.w #0,ITEM_SPRITE(a1) beq .skip - sub.w d0,ITEM_X(a1) + sub.w d0,ITEM_X(a1) cmp.w #160<