-
Notifications
You must be signed in to change notification settings - Fork 3
/
anglecalc.s
140 lines (135 loc) · 7.26 KB
/
anglecalc.s
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
;APSFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
rot:
;x' = x * cos(angle) - y * sin(angle)
;y' = x * sin(angle) + y * cos(angle)
move.l #0,d0
move.l #0,d1
move.l #0,d2
move.l #0,d3
move.l #0,d4
move.l #0,d5
move.w #10,d4
lea sintable1,a2
angles:
move.w (a2,d4.w*2),d3 ; sin angle to d3
move.l d3,sinAngle
add.w #90,d4
move.w (a3,d4.w*2),d5
move.l d5,cosAngle
move.l cosAngle,d2
move.l sinAngle,d3
move.w #100,d0 ;x to d0
move.w #100,d1 ;y to d1
mulu.l d0,d2 ; x * cosAngle
mulu.l d1,d3 ; y * sinAngle
asr.l #8,d2
asr.l #8,d3
sub.w d2,d3
move.l d3,x1
rts
Sintable1:
DC.W $0100,$0200,$0400,$0500,$0700,$0900,$0A00,$0C00,$0D00,$0F00
DC.W $1000,$1200,$1400,$1500,$1700,$1800,$1A00,$1B00,$1D00,$1F00
DC.W $2000,$2200,$2300,$2500,$2600,$2800,$2900,$2B00,$2D00,$2E00
DC.W $3000,$3100,$3300,$3400,$3600,$3700,$3900,$3A00,$3C00,$3D00
DC.W $3F00,$4000,$4200,$4400,$4500,$4700,$4800,$4A00,$4B00,$4D00
DC.W $4E00,$5000,$5100,$5300,$5400,$5600,$5700,$5800,$5A00,$5B00
DC.W $5D00,$5E00,$6000,$6100,$6300,$6400,$6600,$6700,$6800,$6A00
DC.W $6B00,$6D00,$6E00,$7000,$7100,$7200,$7400,$7500,$7700,$7800
DC.W $7900,$7B00,$7C00,$7D00,$7F00,$8000,$8200,$8300,$8400,$8600
DC.W $8700,$8800,$8A00,$8B00,$8C00,$8E00,$8F00,$9000,$9100,$9300
DC.W $9400,$9500,$9700,$9800,$9900,$9A00,$9C00,$9D00,$9E00,$9F00
DC.W $A100,$A200,$A300,$A400,$A500,$A700,$A800,$A900,$AA00,$AB00
DC.W $AD00,$AE00,$AF00,$B000,$B100,$B200,$B300,$B400,$B600,$B700
DC.W $B800,$B900,$BA00,$BB00,$BC00,$BD00,$BE00,$BF00,$C000,$C100
DC.W $C200,$C300,$C400,$C500,$C600,$C700,$C800,$C900,$CA00,$CB00
DC.W $CC00,$CD00,$CE00,$CF00,$D000,$D100,$D200,$D300,$D400,$D400
DC.W $D500,$D600,$D700,$D800,$D900,$DA00,$DA00,$DB00,$DC00,$DD00
DC.W $DE00,$DE00,$DF00,$E000,$E100,$E100,$E200,$E300,$E400,$E400
DC.W $E500,$E600,$E600,$E700,$E800,$E800,$E900,$EA00,$EA00,$EB00
DC.W $EC00,$EC00,$ED00,$ED00,$EE00,$EF00,$EF00,$F000,$F000,$F100
DC.W $F100,$F200,$F200,$F300,$F300,$F400,$F400,$F500,$F500,$F600
DC.W $F600,$F700,$F700,$F700,$F800,$F800,$F900,$F900,$F900,$FA00
DC.W $FA00,$FA00,$FB00,$FB00,$FB00,$FC00,$FC00,$FC00,$FC00,$FD00
DC.W $FD00,$FD00,$FD00,$FE00,$FE00,$FE00,$FE00,$FE00,$FF00,$FF00
DC.W $FF00,$FF00,$FF00,$FF00,$FF00,$FF00,$0000,$0000,$0000,$0000
DC.W $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
DC.W $0000,$0000,$0000,$0000,$0000,$0000,$FF00,$FF00,$FF00,$FF00
DC.W $FF00,$FF00,$FF00,$FF00,$FE00,$FE00,$FE00,$FE00,$FE00,$FD00
DC.W $FD00,$FD00,$FD00,$FC00,$FC00,$FC00,$FC00,$FB00,$FB00,$FB00
DC.W $FA00,$FA00,$FA00,$F900,$F900,$F900,$F800,$F800,$F700,$F700
DC.W $F700,$F600,$F600,$F500,$F500,$F400,$F400,$F300,$F300,$F200
DC.W $F200,$F100,$F100,$F000,$F000,$EF00,$EF00,$EE00,$ED00,$ED00
DC.W $EC00,$EC00,$EB00,$EA00,$EA00,$E900,$E800,$E800,$E700,$E600
DC.W $E600,$E500,$E400,$E400,$E300,$E200,$E100,$E100,$E000,$DF00
DC.W $DE00,$DE00,$DD00,$DC00,$DB00,$DA00,$DA00,$D900,$D800,$D700
DC.W $D600,$D500,$D400,$D400,$D300,$D200,$D100,$D000,$CF00,$CE00
DC.W $CD00,$CC00,$CB00,$CA00,$C900,$C800,$C700,$C600,$C500,$C400
DC.W $C300,$C200,$C100,$C000,$BF00,$BE00,$BD00,$BC00,$BB00,$BA00
DC.W $B900,$B800,$B700,$B600,$B400,$B300,$B200,$B100,$B000,$AF00
DC.W $AE00,$AC00,$AB00,$AA00,$A900,$A800,$A700,$A500,$A400,$A300
DC.W $A200,$A100,$9F00,$9E00,$9D00,$9C00,$9A00,$9900,$9800,$9700
DC.W $9500,$9400,$9300,$9100,$9000,$8F00,$8E00,$8C00,$8B00,$8A00
DC.W $8800,$8700,$8600,$8400,$8300,$8200,$8000,$7F00,$7D00,$7C00
DC.W $7B00,$7900,$7800,$7700,$7500,$7400,$7200,$7100,$7000,$6E00
DC.W $6D00,$6B00,$6A00,$6800,$6700,$6600,$6400,$6300,$6100,$6000
DC.W $5E00,$5D00,$5B00,$5A00,$5800,$5700,$5600,$5400,$5300,$5100
DC.W $5000,$4E00,$4D00,$4B00,$4A00,$4800,$4700,$4500,$4400,$4200
DC.W $4000,$3F00,$3D00,$3C00,$3A00,$3900,$3700,$3600,$3400,$3300
DC.W $3100,$3000,$2E00,$2D00,$2B00,$2900,$2800,$2600,$2500,$2300
DC.W $2200,$2000,$1F00,$1D00,$1B00,$1A00,$1800,$1700,$1500,$1400
DC.W $1200,$1000,$0F00,$0D00,$0C00,$0A00,$0900,$0700,$0500,$0400
DC.W $0200,$0100,$FF00,$FE00,$FC00,$FB00,$F900,$F700,$F600,$F400
DC.W $F300,$F100,$F000,$EE00,$EC00,$EB00,$E900,$E800,$E600,$E500
DC.W $E300,$E100,$E000,$DE00,$DD00,$DB00,$DA00,$D800,$D700,$D500
DC.W $D300,$D200,$D000,$CF00,$CD00,$CC00,$CA00,$C900,$C700,$C600
DC.W $C400,$C300,$C100,$C000,$BE00,$BC00,$BB00,$B900,$B800,$B600
DC.W $B500,$B300,$B200,$B000,$AF00,$AD00,$AC00,$AA00,$A900,$A800
DC.W $A600,$A500,$A300,$A200,$A000,$9F00,$9D00,$9C00,$9A00,$9900
DC.W $9800,$9600,$9500,$9300,$9200,$9000,$8F00,$8E00,$8C00,$8B00
DC.W $8900,$8800,$8700,$8500,$8400,$8300,$8100,$8000,$7E00,$7D00
DC.W $7C00,$7A00,$7900,$7800,$7600,$7500,$7400,$7200,$7100,$7000
DC.W $6F00,$6D00,$6C00,$6B00,$6900,$6800,$6700,$6600,$6400,$6300
DC.W $6200,$6100,$5F00,$5E00,$5D00,$5C00,$5B00,$5900,$5800,$5700
DC.W $5600,$5500,$5300,$5200,$5100,$5000,$4F00,$4E00,$4D00,$4C00
DC.W $4A00,$4900,$4800,$4700,$4600,$4500,$4400,$4300,$4200,$4100
DC.W $4000,$3F00,$3E00,$3D00,$3C00,$3B00,$3A00,$3900,$3800,$3700
DC.W $3600,$3500,$3400,$3300,$3200,$3100,$3000,$2F00,$2E00,$2D00
DC.W $2C00,$2C00,$2B00,$2A00,$2900,$2800,$2700,$2600,$2600,$2500
DC.W $2400,$2300,$2200,$2200,$2100,$2000,$1F00,$1F00,$1E00,$1D00
DC.W $1C00,$1C00,$1B00,$1A00,$1A00,$1900,$1800,$1800,$1700,$1600
DC.W $1600,$1500,$1400,$1400,$1300,$1300,$1200,$1100,$1100,$1000
DC.W $1000,$0F00,$0F00,$0E00,$0E00,$0D00,$0D00,$0C00,$0C00,$0B00
DC.W $0B00,$0A00,$0A00,$0900,$0900,$0900,$0800,$0800,$0700,$0700
DC.W $0700,$0600,$0600,$0600,$0500,$0500,$0500,$0400,$0400,$0400
DC.W $0400,$0300,$0300,$0300,$0300,$0200,$0200,$0200,$0200,$0200
DC.W $0100,$0100,$0100,$0100,$0100,$0100,$0100,$0100,$0000,$0000
DC.W $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
DC.W $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000,$0100,$0100
DC.W $0100,$0100,$0100,$0100,$0100,$0100,$0200,$0200,$0200,$0200
DC.W $0200,$0300,$0300,$0300,$0300,$0400,$0400,$0400,$0400,$0500
DC.W $0500,$0500,$0600,$0600,$0600,$0700,$0700,$0700,$0800,$0800
DC.W $0900,$0900,$0900,$0A00,$0A00,$0B00,$0B00,$0C00,$0C00,$0D00
DC.W $0D00,$0E00,$0E00,$0F00,$0F00,$1000,$1000,$1100,$1100,$1200
DC.W $1300,$1300,$1400,$1400,$1500,$1600,$1600,$1700,$1800,$1800
DC.W $1900,$1A00,$1A00,$1B00,$1C00,$1C00,$1D00,$1E00,$1F00,$1F00
DC.W $2000,$2100,$2200,$2200,$2300,$2400,$2500,$2600,$2600,$2700
DC.W $2800,$2900,$2A00,$2B00,$2C00,$2C00,$2D00,$2E00,$2F00,$3000
DC.W $3100,$3200,$3300,$3400,$3500,$3600,$3700,$3800,$3900,$3A00
DC.W $3B00,$3C00,$3D00,$3E00,$3F00,$4000,$4100,$4200,$4300,$4400
DC.W $4500,$4600,$4700,$4800,$4900,$4A00,$4C00,$4D00,$4E00,$4F00
DC.W $5000,$5100,$5200,$5400,$5500,$5600,$5700,$5800,$5900,$5B00
DC.W $5C00,$5D00,$5E00,$5F00,$6100,$6200,$6300,$6400,$6600,$6700
DC.W $6800,$6900,$6B00,$6C00,$6D00,$6F00,$7000,$7100,$7200,$7400
DC.W $7500,$7600,$7800,$7900,$7A00,$7C00,$7D00,$7E00,$8000,$8100
DC.W $8300,$8400,$8500,$8700,$8800,$8900,$8B00,$8C00,$8E00,$8F00
DC.W $9000,$9200,$9300,$9500,$9600,$9800,$9900,$9A00,$9C00,$9D00
DC.W $9F00,$A000,$A200,$A300,$A500,$A600,$A800,$A900,$AA00,$AC00
DC.W $AD00,$AF00,$B000,$B200,$B300,$B500,$B600,$B800,$B900,$BB00
DC.W $BC00,$BE00,$C000,$C100,$C300,$C400,$C600,$C700,$C900,$CA00
DC.W $CC00,$CD00,$CF00,$D000,$D200,$D300,$D500,$D700,$D800,$DA00
DC.W $DB00,$DD00,$DE00,$E000,$E100,$E300,$E500,$E600,$E800,$E900
DC.W $EB00,$EC00,$EE00,$F000,$F100,$F300,$F400,$F600,$F700,$F900
DC.W $FB00,$FC00,$FE00,$FF00
sinAngle: dc.l 0
cosAngle: dc.l 0