-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinitVars.asm
136 lines (99 loc) · 4.04 KB
/
initVars.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
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
initVars:
cld // clear decimal flag.
lda #$00 // borde y fondo negro
sta cborde
sta cfondo
lda #skiprtCant // inicializo skiprt (conteo hasta hacer un wait retrace)
sta skiprt
ldx #0 // contador hits jetpac 1 y 2
stx JP1hits
stx JP2hits
ldx #0
stx statusJP1
stx statusJP2
ldx #0 // utilizado en animacion de JP1 cuando muere
stx fallCounter
stx fallCounter2
lda #$05
sta spractive //activamos el sprite 0 y 2
lda #JP2Color
sta sprcolor2 // jetpac 2 color cyan
lda #TiempoInmune
sta JP2Inmunidad
lda #$02
sta sprcolorfuel // color combustible
lda #$02
sta sprcolorFire // fire color red
sta sprcolorFire2 // fire color red
lda #$0a
sta sprxpandX // expandimos X el disparo 1 y 2.
lda #ptrJPLeft
sta sprpoint2 // jet pac 1 mirando a la izquierda
lda #ptrJPFire
sta sprpointFire
sta sprpointFire2 // punteros de disparo
lda #ptrFuel
sta sprpointfuel
lda #$0 // fire flag
sta fire1
sta fire2
lda #gravity
sta gravityCounter
sta gravityCounter2
jsr updateJP1hits
jsr updateJP2hits
ldx #0
stx internalCounter
ldx #4
stx tick4
ldx #64
stx tick64
ldx #$80
stx JP1Jet
stx JP2Jet
ldx $a2 // inicializamos el generador de numeros aleatorios
stx random // con un valor de la variable TI (que esta en $a2)
ldx #0
stx statusFuel
ldx #delayEntreFuels
stx fuelCounter
{
// reseteamos los registros del SID
ldy #0
lda #0
sty sound_fire1_freq // seteo en 0 la freq de disparo
sty sound_fire2_freq
loop:
sta sidPtr,y
iny
cpy #25
bne loop
// configuramos canal 1
ldx #16+15 // volumen maximo
stx sid_vol // filtro seteado como pasa bajo
ldx #0
stx sid_ad1
ldx #100
stx sid_hfreq1
ldx #15*16+5 // volumen de sostenimiento max
stx sid_sr1 // poca relajacion
// configuramos canal 2
ldx #0
stx sid_ad2
ldx #100
stx sid_hfreq2
ldx #15*16+0 // volumen de sostenimiento MENOS
stx sid_sr2
ldx #0*16+2 // filtro voz 2, sin resonancia
stx 54295
ldx #40
stx 54294 // frecuencia resonancia en 40
// configuramos canal 3
ldx #0
stx sid_ad3
ldx #3
stx sid_hfreq3
ldx #15*16+9 // volumen de sostenimiento max
stx sid_sr3 // tiempo de relajacion medio
}
rts