-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwaves.asm
81 lines (63 loc) · 1.8 KB
/
waves.asm
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
; No params
update_waves
jsr move_waves
jsr draw_waves
rts
; No params
move_waves
lda SharkVelocityX
nega
adda WaveOffsetX
sta WaveOffsetX
cmpa #0
bge move_waves_left
cmpa #-64
bge move_waves_over
move_waves_right
lda WaveOffsetX
adda #64
sta WaveOffsetX
jmp move_waves_over
move_waves_left
lda WaveOffsetX
adda #-64
sta WaveOffsetX
move_waves_over
rts
; No params
draw_waves
lda WavePositionY ; to 0 (y)
ldb #-127 ; to 0 (x)
jsr Moveto_d ; move the vector beam the
lda #0 ; to 0 (y)
ldb WaveOffsetX ; to 0 (x)
jsr Moveto_d ; move the vector beam the
lda #WAVE_COUNT
sta CurrentWave
draw_single_wave
ldx #wave_list ; load the address of the to be ; drawn vector list to X
jsr Draw_VLc ; draw the line now
lda CurrentWave
deca
sta CurrentWave
cmpa #0
bne draw_single_wave
draw_waves_over
lda #0 ; to 0 (y)
ldb #-128 ; to 0 (x)
jsr Moveto_d ; move the vector beam the
lda #0 ; to 0 (y)
ldb #-128 ; to 0 (x)
jsr Moveto_d ; move the vector beam the
lda #0 ; to 0 (y)
ldb #-64 ; to 0 (x)
jsr Moveto_d ; move the vector beam the
lda #0 ; to 0 (y)
ldb WaveOffsetX ; to 0 (x)
negb
jsr Moveto_d ; move the vector beam the
lda WavePositionY ; to 0 (y)
nega
ldb #127 ; to 0 (x)
jsr Moveto_d ; move the vector beam the
rts