Tons of edge work:

--Refactor of scrolling
--Addition of edge math
--Tied linking doors to DR Flag
--Fixed vanilla linking doors
This commit is contained in:
aerinon
2020-03-31 11:00:49 -06:00
parent 8ceb1f4585
commit c968621ba3
13 changed files with 559 additions and 418 deletions

View File

@@ -15,15 +15,17 @@ cpy #$0003 : bne ++
++ asl : sta $00 : tya : lsr : tay : lda $00 : bra .loop
.done rts
;todo -- width in X?
;Divisor in Y. Width of division is in X for rounding toward middle
DivideByY:
.loop cpy #$0001 : beq .done
cpy #$0003 : bne ++
jsr DivideBy3 : bra .done
++ cpy #$0005 : bne ++
jsr DivideBy5 : bra .done
; todo -- alter - width
++ tyx : jsr DivideBy2 : sta $00 : tya : lsr : tay : lda $00 : bra .loop
++ jsr DivideBy2 : sta $00
tya : lsr : tay
txa : lsr : tax
lda $00 : bra .loop
.done rts
MultiBy3:
@@ -34,12 +36,13 @@ MultiBy5:
sta $00 : asl #2 : !add $00
rts
;width of divison in x
;width of divison in x: rounds toward X/2
DivideBy2:
sta $00
lsr : bcc .done
sta $02 : txa : lsr : cmp $00 : !bge .done
lda $02 : inc
sta $02 : txa : lsr : cmp $00 : !blt +
lda $02 : inc : bra .done
+ lda $02
.done rts
DivideBy3: