Spell macro Mult_16 with a upper character
This commit is contained in:
parent
1d4efe6725
commit
3dfbe05938
8 changed files with 16 additions and 17 deletions
|
@ -81,7 +81,7 @@
|
|||
|
||||
;; Multiplication of 2
|
||||
;; a = a*2
|
||||
.macro mult_16 low_, hi_, NOT_ROL
|
||||
.macro Mult_16 low_, hi_, NOT_ROL
|
||||
;; IF NOT_ROL
|
||||
.ifblank fast_unsafe
|
||||
ASL low_
|
||||
|
|
|
@ -40,10 +40,10 @@
|
|||
LDA dx
|
||||
SBC dy
|
||||
STA >V
|
||||
mult_16 >V, <V
|
||||
Mult_16 >V, <V
|
||||
|
||||
;dy_2 = dy*2
|
||||
mult_16 >dy_2, <dy_2 ;>dy_2 = dy (same address)
|
||||
Mult_16 >dy_2, <dy_2 ;>dy_2 = dy (same address)
|
||||
|
||||
;; This is an Bresenham's line algorithm, se wikipedia bellow.
|
||||
;;https://en.wikipedia.org/wiki/Bresenham%27s_line_algorithm
|
||||
|
|
|
@ -26,9 +26,9 @@
|
|||
SEC
|
||||
SBC >V
|
||||
STA >V
|
||||
mult_16 >V, <V
|
||||
Mult_16 >V, <V
|
||||
|
||||
mult_16 >dx_2, <dx_2
|
||||
Mult_16 >dx_2, <dx_2
|
||||
|
||||
LDA >dx_2
|
||||
STA >D
|
||||
|
|
|
@ -26,9 +26,9 @@
|
|||
SEC
|
||||
SBC >V
|
||||
STA >V
|
||||
mult_16 >V, <V
|
||||
Mult_16 >V, <V
|
||||
|
||||
mult_16 >dy_2, <dy_2, !
|
||||
Mult_16 >dy_2, <dy_2, !
|
||||
|
||||
LDA >dy_2
|
||||
STA >D
|
||||
|
|
|
@ -27,9 +27,9 @@
|
|||
SEC
|
||||
SBC >V
|
||||
STA >V
|
||||
mult_16 >V, <V
|
||||
Mult_16 >V, <V
|
||||
|
||||
mult_16 >dx_2, <dx_2
|
||||
Mult_16 >dx_2, <dx_2
|
||||
|
||||
LDA >dx_2
|
||||
STA >D
|
||||
|
|
|
@ -30,7 +30,6 @@ loop:
|
|||
BNE loop
|
||||
;BPL loop; Branch if Y dont overflow
|
||||
;; Fix overflow
|
||||
;LDX #$23
|
||||
LDY #$00
|
||||
INC <A_start
|
||||
INC <B_start
|
||||
|
|
|
@ -62,16 +62,16 @@ end__:
|
|||
|
||||
;;We need to calculate C*40. 40 = 2*2*2*(2^2 +1)
|
||||
;; _*2^2
|
||||
mult_16 >C, <C
|
||||
mult_16 >C, <C
|
||||
Mult_16 >C, <C
|
||||
Mult_16 >C, <C
|
||||
|
||||
;; + _*1
|
||||
Add_16 >C, <C, >B, <B, !
|
||||
|
||||
;; *2*2*2
|
||||
mult_16 >C, <C
|
||||
mult_16 >C, <C
|
||||
mult_16 >C, <C
|
||||
Mult_16 >C, <C
|
||||
Mult_16 >C, <C
|
||||
Mult_16 >C, <C
|
||||
|
||||
Add_16 >btp_mem_pos, <btp_mem_pos, >C, <C, !
|
||||
|
||||
|
|
|
@ -28,8 +28,8 @@
|
|||
;; *10 = 2*2*2 + 2
|
||||
ASL code ;Will never owerflow 8byte
|
||||
LDY code
|
||||
mult_16 >petski_position, <petski_position ; May overflow 8byte (therefore using 16)
|
||||
mult_16 >petski_position, <petski_position ; May overflow 8byte (therefore using 16)
|
||||
Mult_16 >petski_position, <petski_position ; May overflow 8byte (therefore using 16)
|
||||
Mult_16 >petski_position, <petski_position ; May overflow 8byte (therefore using 16)
|
||||
;TYA
|
||||
;Add_16_A >petski_position, <petski_position, #$00
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue