2 ; Copyright (C) 2010 Kent Hansen.
4 ; This program is free software; you can redistribute it and/or modify
5 ; it under the terms of the GNU General Public License as published by
6 ; the Free Software Foundation; either version 3 of the License, or
7 ; (at your option) any later version.
9 ; This program is distributed in the hope that it will be useful,
10 ; but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ; GNU General Public License for more details.
14 ; You should have received a copy of the GNU General Public License
15 ; along with this program. If not, see <http://www.gnu.org/licenses/>.
18 .
include "common/ppubuffer.h"
19 .
include "sound/mixer.h"
28 .
public update_ampdisplay
30 .extrn
sound_status:byte
31 .extrn
volume_table:byte
33 .
proc update_ampdisplay_step
34 ; Only one channel's display is updated per frame.
40 lda
@@channel_offsets,y
42 .ifndef NO_MUTABLE_CHANNELS
45 lda mixer.tonals.period.lo
,x
46 ora mixer.tonals.period.hi
,x
48 lda mixer.envelopes.master
,x
49 .ifndef NO_MUTABLE_CHANNELS
51 lda #
0 ; the channel is muted
55 ora mixer.envelopes.vol.
int,x
60 lda volume_table
,y
; 0..15
75 lda
@@display_tiles+0,y
76 jsr put_ppu_string_byte
77 lda
@@display_tiles+1,y
78 jsr put_ppu_string_byte
81 lda
@@display_tiles+2,y
82 jsr put_ppu_string_byte
83 lda
@@display_tiles+3,y
84 jsr put_ppu_string_byte
95 .
db sizeof tonal_state
* 0
96 .
db sizeof tonal_state
* 1
97 .
db sizeof tonal_state
* 2
98 .
db sizeof tonal_state
* 3
99 .
db sizeof tonal_state
* 4
115 .
db $88,$88,$88,$88 ; 0
116 .
db $88,$88,$88,$89 ; 1
117 .
db $88,$88,$88,$8A ; 2
118 .
db $88,$88,$88,$8B ; 3
119 .
db $88,$88,$88,$8C ; 4
120 .
db $88,$88,$89,$8C ; 5
121 .
db $88,$88,$8A,$8C ; 6
122 .
db $88,$88,$8B,$8C ; 7
123 .
db $88,$88,$8C,$8C ; 8
124 .
db $88,$89,$8C,$8C ; 9
125 .
db $88,$8A,$8C,$8C ; 10
126 .
db $88,$8B,$8C,$8C ; 11
127 .
db $88,$8C,$8C,$8C ; 12
128 .
db $89,$8C,$8C,$8C ; 13
129 .
db $8A,$8C,$8C,$8C ; 14
130 .
db $8B,$8C,$8C,$8C ; 15
131 .
db $8C,$8C,$8C,$8C ; 16
135 .
proc update_ampdisplay
136 jsr update_ampdisplay_step
137 jmp update_ampdisplay_step