diff --git a/Atari/gr_basics.asm b/Atari/gr_basics.asm index 1716a74..5effad7 100644 --- a/Atari/gr_basics.asm +++ b/Atari/gr_basics.asm @@ -275,8 +275,32 @@ NoMountain ;-------------------------------------------------- ; Calculate mountaintable from screen data ; for speedup SoilDown, etc. - mwa #0 temp ; byte in screen line - mwa #mountaintable modify + +; Range alignment to full bytes. + lda RangeLeft + and #%11111000 + sta RangeLeft + adw RangeRight #7 + lda RangeRight + and #%11111000 + sta RangeRight + cpw RangeLeft RangeRight + jcs NothingToFall + ; convert range to bytes + mwa RangeLeft temp + lsr temp+1 ; temp / 8 + ror temp + lsr temp ; max range is 511 ! (9 bits) + lsr temp ; temp+1 = 0 + mva RangeRight temp+1 + mva RangeRight+1 temp2 + lsr temp2 ; temp+1 / 8 + ror temp+1 + lsr temp+1 ; max range is 511 ! (9 bits) + lsr temp+1 ; temp+1 = 0 + + ; mwa #0 temp+1 ; byte in screen line + adw RangeLeft #mountaintable modify HorizontalByteLoop lda #0 ldy #7 @@ -315,9 +339,9 @@ NoPixel adw modify #8 inc temp lda temp - cmp #screenBytes + cmp temp+1 bne HorizontalByteLoop ; next column of bytes - +NothingToFall rts .endp ;-------------------------------------------------- diff --git a/game.asm b/game.asm index 3376ec5..e2199f5 100644 --- a/game.asm +++ b/game.asm @@ -598,9 +598,7 @@ TextAfterBFG sta ydraw+1 ; there is 0 left in A, so... TODO: bad code above. revisit ;cleanup of the soil fall down ranges (left and right) - sta RangeRight - sta RangeRight+1 - mwa #screenwidth RangeLeft + jsr ClearScreenSoilRange ; We are randomizing the weapon now. ; jumping into the middle of the explosion diff --git a/scorch.xex b/scorch.xex index eda21da..fb392db 100644 Binary files a/scorch.xex and b/scorch.xex differ