mirror of
https://github.com/jeremysrand/BuGS.git
synced 2025-01-01 01:30:27 +00:00
Fix bug leading to crash when trying to add centipede body segments. I needed to have a nop instruction after the self-modifying long jump. I am writing 4 bytes of the address into the long jump which only uses a 3 byte address and I was corrupting the next instruction. Inserting a nop ensures no corruption happens.
This commit is contained in:
parent
f5d1aa9ee6
commit
3b541f8482
23
BuGS/game.s
23
BuGS/game.s
@ -296,18 +296,17 @@ checkKey_slow anop
|
||||
|
||||
checkKey_centipede anop
|
||||
jsl addHeadSegment
|
||||
jsl addHeadSegment
|
||||
jsl addHeadSegment
|
||||
jsl addHeadSegment
|
||||
jsl addHeadSegment
|
||||
jsl addHeadSegment
|
||||
jsl addHeadSegment
|
||||
jsl addHeadSegment
|
||||
jsl addHeadSegment
|
||||
jsl addHeadSegment
|
||||
jsl addHeadSegment
|
||||
jmp addHeadSegment
|
||||
; jmp addBodySegment
|
||||
jsl addBodySegment
|
||||
jsl addBodySegment
|
||||
jsl addBodySegment
|
||||
jsl addBodySegment
|
||||
jsl addBodySegment
|
||||
jsl addBodySegment
|
||||
jsl addBodySegment
|
||||
jsl addBodySegment
|
||||
jsl addBodySegment
|
||||
jsl addBodySegment
|
||||
jmp addBodySegment
|
||||
|
||||
|
||||
waitForKey entry
|
||||
|
@ -52,16 +52,23 @@ drawSegments_head anop
|
||||
jsl segmentHeadJump
|
||||
|
||||
drawSegments_handleTiles anop
|
||||
_dirtyGameTileWithX segmentTileOffsetsUL
|
||||
_dirtyGameTileWithX segmentTileOffsetsUR
|
||||
_dirtyGameTileWithX segmentTileOffsetsLL
|
||||
_dirtyGameTileWithX segmentTileOffsetsLR
|
||||
lda #TILE_STATE_DIRTY
|
||||
ldy segmentTileOffsetsUL,x
|
||||
sta tileDirty,y
|
||||
|
||||
ldy segmentTileOffsetsUR,x
|
||||
sta tileDirty,y
|
||||
|
||||
ldy segmentTileOffsetsLL,x
|
||||
sta tileDirty,y
|
||||
|
||||
ldy segmentTileOffsetsLR,x
|
||||
sta tileDirty,y
|
||||
|
||||
drawSegments_skipSegment anop
|
||||
dex
|
||||
dex
|
||||
bmi drawSegments_done
|
||||
bra drawSegments_nextSegment
|
||||
bpl drawSegments_nextSegment
|
||||
|
||||
drawSegments_done anop
|
||||
rtl
|
||||
@ -89,8 +96,8 @@ segmentHeadJump_noShift anop
|
||||
|
||||
segmentHeadJump_jumpInst anop
|
||||
jmp >leftHead1
|
||||
nop
|
||||
|
||||
|
||||
segmentBodyJump entry
|
||||
lda segmentScreenShifts,x
|
||||
beq segmentBodyJump_noShift
|
||||
@ -113,7 +120,7 @@ segmentBodyJump_noShift anop
|
||||
|
||||
segmentBodyJump_jumpInst anop
|
||||
jmp >leftHead1
|
||||
|
||||
nop
|
||||
|
||||
updateSegments entry
|
||||
lda segmentSpriteShift
|
||||
|
@ -65,15 +65,6 @@ _drawDirtyGameRow_skip&tileOffset anop
|
||||
aif &tileOffset<&lastTileOffset,.drawDirtyGameRowLoop
|
||||
|
||||
mend
|
||||
|
||||
; This macro uses the X register as an index into the tile offsets. This is
|
||||
; needed for segments because each segment has their own dirty tile offsets.
|
||||
macro
|
||||
_dirtyGameTileWithX &tileOffset
|
||||
ldy &tileOffset,x
|
||||
lda #TILE_STATE_DIRTY
|
||||
sta tileDirty,y
|
||||
mend
|
||||
|
||||
|
||||
macro
|
||||
|
Loading…
Reference in New Issue
Block a user