/[projet1]/users/twilighte/Stormlord/Wave_PageAllignedStuff.s
Defence Force logotype

Contents of /users/twilighte/Stormlord/Wave_PageAllignedStuff.s

Parent Directory Parent Directory | Revision Log Revision Log


Revision 412 - (show annotations)
Thu Oct 7 20:50:23 2010 UTC (8 years, 5 months ago) by dbug
File size: 2654 byte(s)
Added Stormlord
1 ;Wave_PageAllignedStuff.s
2 ;These routines(pme) have calculated low addresses
3 ;So are page alligned and spaced 16 bytes apart.
4 ;To save space the gaps hold other subroutines,
5 ;music vars and tables
6
7 ;PageAllignedEffectCommands
8 ; .dsb 256-(*&255)
9
10 pmeLoopOrEnd ;XX00
11 ldy #00 ;2
12 lda (effect),y ;2
13 bpl pmeLoop ;2
14 jmp EndEffect ;3
15 pmeLoop tay ;1
16 rts ;1
17
18 prcEGPeriod
19 sta ayw_EGPeriod
20 rts
21
22 MusicTempoCount .byt 0
23
24 pmeNoiseOff ;XX10
25 lda ayw_Status ;3
26 ora NoiseBit,x ;3
27 sta ayw_Status ;3
28 rts ;1
29
30 prcBar inc BarFlag
31 sec
32 rts
33
34 PatternRow .byt 0
35
36 pmeEGOff ;XX20
37 lda ayw_Volume,x ;3
38 and #15 ;2
39 sta ayw_Volume,x ;3
40 lda #00 ;2
41 sta EGActiveFlag,x ;3
42 rts ;1
43
44 NewActivity .byt 0
45 PatternRestCount .byt 0
46
47 pmeToneOff ;XX30
48 lda ayw_Status ;3
49 ora ToneBit,x ;3
50 sta ayw_Status ;3
51 rts ;1
52
53 prcNoise
54 sta ayw_Noise
55 rts
56
57 ChannelID .byt 0
58 ListIndex .byt 0
59
60 pmeVolumeOFS ;XX40
61 clc
62 adc PatternVolume,x ;3
63 cmp #16 ;2
64 bcs EndEffect ;2
65 sta PatternVolume,x ;3
66 sta ayw_Volume,x ;3
67 rts ;1
68
69 MusicActivity .byt 0
70
71 pmeNoiseOFS ;XX50
72 clc
73 adc ayw_Noise ;3
74 and #31 ;2
75 sta ayw_Noise ;3
76 jsr NoiseOn ;3
77 rts ;1
78 EffectBit
79 ToneBit
80 .byt %00000001
81 .byt %00000010
82 .byt %00000100
83
84
85
86
87 pmeEGPerOFS ;XX60
88 clc
89 adc ayw_EGPeriod ;3
90 sta ayw_EGPeriod ;3
91 jmp EGOn ;3
92
93
94 EffectMask
95 ToneMask
96 .byt %11111110
97 .byt %11111101
98 .byt %11111011
99 OrnamentBit
100 NoiseBit
101 .byt %00001000
102 .byt %00010000
103 .byt %00100000
104
105
106 pmePitchOFS ;XX70
107 .(
108 ;A pitch offset is always relative to the Intermediate Pitch
109 sta Temp01
110 clc
111 adc IntermediatePitchLo
112 sta IntermediatePitchLo
113 bit Temp01
114 bmi skip2
115 bcc skip1
116 inc IntermediatePitchHi
117 jmp skip1
118 skip2 bcs skip1
119 dec IntermediatePitchHi
120 skip1 lda ayw_Status
121 .)
122 and ToneMask,x
123 sta ayw_Status
124 sec
125 rts
126
127 EndEffect lda MusicActivity
128 and EffectMask,x
129 sta MusicActivity
130 clc
131 rts
132
133 PatternNote
134 .dsb 3,0
135 PatternVolume
136 .dsb 3,0
137 EffectID
138 .dsb 3,0
139 ayRealRegister
140 .byt 0,2,4,1,3,5,6,7,8,9,10,11,12,13
141 EffectIndex
142 .dsb 3,0
143
144 NoiseOn lda ayw_Status
145 and NoiseMask,x
146 sta ayw_Status
147 rts
148
149 EGOn lda ayw_Volume,x
150 ora #16
151 sta ayw_Volume,x
152 sta EGActiveFlag,x
153 clc
154 rts
155
156 prcCom_Tempo
157 sta MusicTempoCount
158 ;Also store into compiled header
159 ldy #01
160 sta (header),y
161 rts

  ViewVC Help
Powered by ViewVC 1.1.26