c64-livecoding/wip-hugo/routines/memory/line/line.s
hugova 4d12f20a6e A Fix for D that gets the wrong initial value and the branch logic in line_* checked for the wrong value.
A new proc, line.s that can chose whitch line_* to use
A small test program in source.s
Wrote a smal test program in source.s  (all looks good exept line_up_inv)
2025-03-03 22:08:00 +01:00

41 lines
633 B
ArmAsm

.proc line; X_pos =< X_end skall alltid gälla
dx = $fe
dy = $69
;;dx
SEC
LDA X_end
SBC X_pos
STA dx
SEC
LDA Y_pos
SBC Y_end
STA dy
BCC down ;normal Y_pos < Y_end
up:; Y_pos > Y_end
STA dy
CMP dx
BCC shallow; dy < dx
steep:
jsr line_up_inv
RTS
shallow: ;dy =< dx
jsr line_up
RTS
down:
EOR #$ff ; Fix bit underflow
STA dy
CMP dx
BCC shallow_; dy < dx
steep_:
jsr line_down_inv
RTS
shallow_: ;dy < dx
jsr line_down
RTS
.endproc
.include "line_down.s"
.include "line_down_inv.s"
.include "line_up.s"
.include "line_up_inv.s"