ok i am using it
and it has bugs. please help me.
In my game the field is setup like a grid so that instead of adding the extra speed, you have to multiply it.
Here is my multiply code:
Code:
multiply: ;******
;must give num_0
;must give num_1
;
;answer will be stored in product and productd
;******
ldx num_1
lda num_0
multiply_again: dex
beq multiply_end
adc num_0
jmp multiply_again
multiply_end: sta product
rts
It works fine multiplying small numbers.
and here is my speed up code:
Code:
;**************
; movement_speed start
;**************
lda y_portion_decimal
sta num_0
lda #<m_s_bullet0
sta num_1
clc
jsr multiply
lda product
sta bullettable+1 ;y_portion_decimal
lda y_portion
sta num_0
lda #>m_s_bullet0
sta num_1
jsr multiply
lda product
sta look2
sta bullettable ;y_portion
lda x_portion_decimal
sta num_0
lda #<m_s_bullet0
sta num_1
clc
jsr multiply
lda product
sta bullettable+3 ;x_portion_decimal
lda x_portion
sta num_0
lda #>m_s_bullet0
sta num_1
jsr multiply
lda product
sta bullettable+2 ;x_portion
;**************
; movement_speed end
;**************
Now, the way i've multiplied the decimal number part and the whole number part, i think that's wrong because i worked out 2.3 times 4.5 on paper and it had lots of carries. Big carries that increased the digit range by two.. (2.3 x 4.5 = 103.5) So im not sure about multiplying, if it's correct or horribly wrong.
i still sometimes think the multiplying is correct because, when firing to the north west, the bullet goes really fast like normal. But, firing to the south east makes the bullet go as fast as the ship (as fast as it was before the speeding up code).
If the multiplying is wrong, im not sure what to do.