Mercurial > repos > blastem
comparison psg.c @ 505:b7b7a1cab44a
The local clone on my laptop got messed up and some changes had not been pushed. This commit represents the status of the working copy from that clone. It unfortunately contains some changes that I did not intend to commit yet, but this seems like the best option at the moment.
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Mon, 06 Jan 2014 22:54:05 -0800 |
parents | 3e1573fa22cf |
children | 6a14c5a95648 |
comparison
equal
deleted
inserted
replaced
504:7b0df1aaf384 | 505:b7b7a1cab44a |
---|---|
3 This file is part of BlastEm. | 3 This file is part of BlastEm. |
4 BlastEm is free software distributed under the terms of the GNU General Public License version 3 or greater. See COPYING for full license text. | 4 BlastEm is free software distributed under the terms of the GNU General Public License version 3 or greater. See COPYING for full license text. |
5 */ | 5 */ |
6 #include "psg.h" | 6 #include "psg.h" |
7 #include "render.h" | 7 #include "render.h" |
8 #include "blastem.h" | |
8 #include <string.h> | 9 #include <string.h> |
9 #include <stdlib.h> | 10 #include <stdlib.h> |
10 | 11 |
11 void psg_init(psg_context * context, uint32_t sample_rate, uint32_t master_clock, uint32_t clock_div, uint32_t samples_frame) | 12 void psg_init(psg_context * context, uint32_t sample_rate, uint32_t master_clock, uint32_t clock_div, uint32_t samples_frame) |
12 { | 13 { |
116 if (context->noise_out) { | 117 if (context->noise_out) { |
117 acc += volume_table[context->volume[3]]; | 118 acc += volume_table[context->volume[3]]; |
118 } | 119 } |
119 context->audio_buffer[context->buffer_pos++] = acc; | 120 context->audio_buffer[context->buffer_pos++] = acc; |
120 if (context->buffer_pos == context->samples_frame) { | 121 if (context->buffer_pos == context->samples_frame) { |
121 render_wait_psg(context); | 122 if (!headless) { |
123 render_wait_psg(context); | |
124 } | |
122 } | 125 } |
123 } | 126 } |
124 context->cycles += context->clock_inc; | 127 context->cycles += context->clock_inc; |
125 } | 128 } |
126 } | 129 } |