diff --git a/owrando.asm b/owrando.asm index f285b0b..5b145cd 100644 --- a/owrando.asm +++ b/owrando.asm @@ -87,6 +87,7 @@ OWShuffle: inx : lda.l OWEdgeOffsets,x ;record id of first transition in table ;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 ldx $2134 ;x = offset to first record rep #$20 @@ -95,13 +96,12 @@ OWShuffle: .nextTransition pha jsr OWSearchTransition - lda $140 : bne .newDestination + bcs .newDestination pla : dec : bne .nextTransition : bra .noTransition .newDestination pla sep #$30 - stz $140 plx : lda $8a bra .return @@ -151,11 +151,11 @@ OWSearchTransition: sep #$20 : lda #OWWestEdges>>16 : phb : pha : plb : ldx #OWWestEdges : jsr OWNewDestination : plb ;x = address of table .matchfound - plx : pla : lda #$0001 : sta $140 : pha : phx - txa : !add #$0010 : tax : rts + plx : pla : lda #$0001 : pha : phx + txa : !add #$0010 : tax : sec : rts .exitloop - txa : !add #$0018 : tax : rts + txa : !add #$0018 : tax : clc : rts } OWNewDestination: {