diff --git a/equates.s b/equates.s index b0c19a1..17d2234 100644 --- a/equates.s +++ b/equates.s @@ -39,7 +39,7 @@ lastCompiledTerrainY = $75 ; The highest Y value that the compiled renderer must ; Terrain constants TERRAINWIDTH = 640 ; In pixels MAXTERRAINHEIGHT = 100 ; In pixels -COMPILEDTERRAINROW = TERRAINWIDTH/4+3 ; In words, +2 to make room for clipping jump at end of row +COMPILEDTERRAINROW = TERRAINWIDTH/4+3 ; In words, +3 to make room for clipping jump at end of row VISIBLETERRAINWIDTH = TERRAINWIDTH/4 ; In words- width minus jump return padding VISIBLETERRAINWINDOW = 80 ; In words MAXSPANSPERROW = 15 diff --git a/gamemanager.s b/gamemanager.s index 7f0e59b..8d9427c 100644 --- a/gamemanager.s +++ b/gamemanager.s @@ -31,7 +31,7 @@ beginGameplay: jsr generateTerrain ; Create players - lda #106;#56 + lda #56 ldy #0 jsr playerCreate @@ -48,35 +48,24 @@ beginGameplay: jsr compileTerrain jsr clipTerrain + jsl renderTerrainSpans gameplayLoop: - jsr syncVBL BORDER_COLOR #$0 - ; Render the terrain if needed - lda terrainDirty - beq gameplayLoopKbd - BORDER_COLOR #$3 - jsl renderTerrainSpans - jsr renderTerrain - - stz terrainDirty - BORDER_COLOR #$1 - - ; Render players - jsr renderPlayers - -gameplayLoopKbd: - lda projectileActive - bpl gameplayLoopShotTracking ; Skip input during shots + ;;;;;;;;;;; + ; Update + ; +; lda projectileActive +; bpl gameplayLoopShotTracking ; Skip input during shots ; Check for keys down jsr kbdScan ; Check for pause - lda paused - bne gameplayLoopEndFrame +; lda paused +; bne gameplayLoopEndFrame gameplayLoopScroll: @@ -99,20 +88,42 @@ gameplayLoopPower: gameplayLoopFire: lda fireRequested - beq gameplayLoopProjectiles + beq gameplayLoopRender jsr fire -gameplayLoopProjectiles: +gameplayLoopRender: sta KBDSTROBE - jsr unrenderProjectiles - jsr updateProjectilePhysics - jsr protectProjectiles - jsr renderProjectiles - jsr updateProjectileCollisions - lda turnRequested - beq gameplayLoopVictoryCondition - jsr endTurn + ;;;;;;;;;;; + ; Render + ; + + ; Render the terrain if needed +; lda terrainDirty +; beq gameplayLoopProjectiles + BORDER_COLOR #$3 + jsr unclipTerrain + jsl unrenderTerrainSpans + jsr clipTerrain + jsl renderTerrainSpans + jsr renderTerrain + + stz terrainDirty + BORDER_COLOR #$1 + + ; Render players +; jsr renderPlayers + +gameplayLoopProjectiles: +; jsr unrenderProjectiles +; jsr updateProjectilePhysics +; jsr protectProjectiles +; jsr renderProjectiles +; jsr updateProjectileCollisions + +; lda turnRequested +; beq gameplayLoopVictoryCondition +; jsr endTurn gameplayLoopVictoryCondition: lda gameOver @@ -127,8 +138,8 @@ gameplayLoopContinue: jmp gameplayLoop gameplayLoopShotTracking: - jsr trackActiveShot - bra gameplayLoopScroll +; jsr trackActiveShot +; bra gameplayLoopScroll ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -229,8 +240,8 @@ endGame: scrollMap: jsr unclipTerrain jsl unrenderTerrainSpans - jsr unrenderPlayers - jsr unrenderProjectiles +; jsr unrenderPlayers +; jsr unrenderProjectiles sta mapScrollPos asl @@ -243,9 +254,9 @@ scrollMap: lda #$ffff sta mapScrollRequested - jsr protectPlayers - jsr protectProjectiles - jsr renderPlayers +; jsr protectPlayers +; jsr protectProjectiles +; jsr renderPlayers lda #1 sta terrainDirty rts diff --git a/gscats.2mg b/gscats.2mg index 8519bc0..97a6314 100644 Binary files a/gscats.2mg and b/gscats.2mg differ