diff --git a/gamemanager.s b/gamemanager.s index b33864c..5e5ef2c 100644 --- a/gamemanager.s +++ b/gamemanager.s @@ -122,7 +122,6 @@ gameplayLoopRender: BORDER_COLOR #$3 jsl renderTerrainSpans jsr renderTerrain - stz terrainDirty BORDER_COLOR #$1 @@ -337,7 +336,7 @@ fire: basePalette: ; Color 0 and 1 must both be sky blue. Compiled rendering uses PHD (which must contain $0000), ; and span rendering uses fill mode, so 0 can't be used there - .word $0aef,$0aef,$0080,$0861,$0c93,$0eb4,$0d66,$0f9a,$0777,$0f00,$0bbb,$ddd,$007b,$0ff0,$0000,$0fff + .word $0aef,$0080,$0080,$0861,$0c93,$0eb4,$0d66,$0f9a,$0777,$0f00,$0bbb,$ddd,$007b,$0ff0,$0000,$0fff statusBarPalette: .word $0888,$0aef,$0F00,$0861,$0c93,$0eb4,$0d66,$0f9a,$00f0,$0fff,$0bbb,$ddd,$007b,$0000,$0ff0,$0fff diff --git a/gscats.2mg b/gscats.2mg index 0571114..7886212 100644 Binary files a/gscats.2mg and b/gscats.2mg differ diff --git a/macros.s b/macros.s index 49e66ae..8cad5e7 100644 --- a/macros.s +++ b/macros.s @@ -206,6 +206,24 @@ nobrk: .endmacro +.macro DEADLOCK +deadlock: jmp deadlock +.endmacro + + +.macro BREAKLOCK + pha + lda breakpoint + beq nobrk + pla +deadlock: jmp deadlock + +nobrk: + pla +.endmacro + + + ;;;;;;;;;; ; Stack Macros diff --git a/terrain.s b/terrain.s index 99e6c84..651dd3e 100644 --- a/terrain.s +++ b/terrain.s @@ -199,7 +199,7 @@ unclipTerrain: SAVE_AXY phd - lda #(CLIPPEDTERRAINSTACK & $ff00) + lda #(CLIPPEDTERRAINSTACK & $f000) pha pld ; Point direct page at our clip data @@ -208,10 +208,14 @@ unclipTerrain: sbc mapScrollPos tay + sec ; Find stopping point for stack-relative addressing lda clippedTerrainStackPtr - and #$00ff + and #$0fff + sbc #7 ; 4 bytes past top of stack, +3 for starting offset + sta STACKPTR + + lda #$0fff-3 ; Start at the bottom of the stack tax - inx unclipTerrainLoop: lda 2,x @@ -227,11 +231,11 @@ unclipTerrainLoop: sbc #COMPILEDTERRAINROW+2 tay - inx - inx - inx - inx - cpx #$100 ; When x hits the top of the stack, we're done + dex ; Walk up the stack to reverse the data + dex + dex + dex + cpx STACKPT ; When x hits the top of the stack, we're done bne unclipTerrainLoop pld @@ -424,12 +428,12 @@ prepareRowRenderingLoop: lda playerData+GO_POSY,y sbc #GAMEOBJECTHEIGHT - cmp SCRATCHL2 - bcc prepareRowRenderingCompileMode - beq prepareRowRenderingCompileMode +; cmp SCRATCHL2 +; bcc prepareRowRenderingCompileMode +; beq prepareRowRenderingCompileMode - jsr enableFillMode - bra prepareRowRenderingLoopNext +; jsr enableFillMode +; bra prepareRowRenderingLoopNext prepareRowRenderingCompileMode: jsr disableFillMode @@ -441,6 +445,8 @@ prepareRowRenderingLoopNext: cpx #200-MAXTERRAINHEIGHT bne prepareRowRenderingLoop +prepareRowRenderingDone: +;HARDBRK RESTORE_AXY rts @@ -487,11 +493,11 @@ generateTerrainLoop: ; lda #2 ; sta compiledTerrain-4 rts - + compiledTerrain: .repeat COMPILEDTERRAINROW * MAXTERRAINHEIGHT - .byte $00 + .byte $42 .endrepeat compiledTerrainEnd: diff --git a/terrain_e1.s b/terrain_e1.s index 013a857..180535b 100644 --- a/terrain_e1.s +++ b/terrain_e1.s @@ -31,6 +31,7 @@ renderTerrainSpans: lda #MAXTERRAINHEIGHT-1 sec sbc lastCompiledTerrainY + beq renderTerrainRowSpansSkip ; All terrain needs compiled rendering renderTerrainSpansLoop: sta PARAML1 @@ -112,6 +113,8 @@ renderTerrainRowSpansDone: bne renderTerrainSpansLoop pea 0 ; Null-terminate the unrender cache + +renderTerrainRowSpansSkip: SLOWGRAPHICS RESTORE_DBR RESTORE_AXY