Fixed vanilla/ID-0 transition bug

This commit is contained in:
codemann8
2021-04-24 15:09:13 -05:00
parent cd4949ce65
commit 619185e1e0

View File

@@ -87,6 +87,7 @@ OWShuffle:
inx : lda.l OWEdgeOffsets,x ;record id of first transition in table inx : lda.l OWEdgeOffsets,x ;record id of first transition in table
;multiply ^ by 26, 26bytes per record ;multiply ^ by 26, 26bytes per record
stz $211c ;ensure the next write to $211b counts as the first write
sta $211b : stz $211b : lda #26 : sta $211c : pla ;a = number of trans sta $211b : stz $211b : lda #26 : sta $211c : pla ;a = number of trans
ldx $2134 ;x = offset to first record ldx $2134 ;x = offset to first record
rep #$20 rep #$20
@@ -95,13 +96,12 @@ OWShuffle:
.nextTransition .nextTransition
pha pha
jsr OWSearchTransition jsr OWSearchTransition
lda $140 : bne .newDestination bcs .newDestination
pla : dec : bne .nextTransition : bra .noTransition pla : dec : bne .nextTransition : bra .noTransition
.newDestination .newDestination
pla pla
sep #$30 sep #$30
stz $140
plx : lda $8a plx : lda $8a
bra .return bra .return
@@ -151,11 +151,11 @@ OWSearchTransition:
sep #$20 : lda #OWWestEdges>>16 : phb : pha : plb : ldx #OWWestEdges : jsr OWNewDestination : plb ;x = address of table sep #$20 : lda #OWWestEdges>>16 : phb : pha : plb : ldx #OWWestEdges : jsr OWNewDestination : plb ;x = address of table
.matchfound .matchfound
plx : pla : lda #$0001 : sta $140 : pha : phx plx : pla : lda #$0001 : pha : phx
txa : !add #$0010 : tax : rts txa : !add #$0010 : tax : sec : rts
.exitloop .exitloop
txa : !add #$0018 : tax : rts txa : !add #$0018 : tax : clc : rts
} }
OWNewDestination: OWNewDestination:
{ {