Mercurial > repos > blastem
comparison psg.h @ 487:c08a4efeee7f opengl
Update opengl branch from default. Fix build breakage unrelated to merge
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Sat, 26 Oct 2013 22:38:47 -0700 |
parents | 3e1573fa22cf |
children | 9a5dc22297f2 |
comparison
equal
deleted
inserted
replaced
449:7696d824489d | 487:c08a4efeee7f |
---|---|
1 /* | |
2 Copyright 2013 Michael Pavone | |
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. | |
5 */ | |
1 #ifndef PSG_CONTEXT_H_ | 6 #ifndef PSG_CONTEXT_H_ |
2 #define PSG_CONTEXT_H_ | 7 #define PSG_CONTEXT_H_ |
3 | 8 |
4 #include <stdint.h> | 9 #include <stdint.h> |
5 | 10 |
6 typedef struct { | 11 typedef struct { |
7 int16_t *audio_buffer; | 12 int16_t *audio_buffer; |
8 int16_t *back_buffer; | 13 int16_t *back_buffer; |
9 double buffer_fraction; | 14 uint64_t buffer_fraction; |
10 double buffer_inc; | 15 uint64_t buffer_inc; |
11 uint32_t buffer_pos; | 16 uint32_t buffer_pos; |
12 uint32_t clock_inc; | 17 uint32_t clock_inc; |
13 uint32_t cycles; | 18 uint32_t cycles; |
19 uint32_t sample_rate; | |
14 uint32_t samples_frame; | 20 uint32_t samples_frame; |
15 uint16_t lsfr; | 21 uint16_t lsfr; |
16 uint16_t counter_load[4]; | 22 uint16_t counter_load[4]; |
17 uint16_t counters[4]; | 23 uint16_t counters[4]; |
18 uint8_t volume[4]; | 24 uint8_t volume[4]; |
23 uint8_t latch; | 29 uint8_t latch; |
24 } psg_context; | 30 } psg_context; |
25 | 31 |
26 | 32 |
27 void psg_init(psg_context * context, uint32_t sample_rate, uint32_t master_clock, uint32_t clock_div, uint32_t samples_frame); | 33 void psg_init(psg_context * context, uint32_t sample_rate, uint32_t master_clock, uint32_t clock_div, uint32_t samples_frame); |
34 void psg_adjust_master_clock(psg_context * context, uint32_t master_clock); | |
28 void psg_write(psg_context * context, uint8_t value); | 35 void psg_write(psg_context * context, uint8_t value); |
29 void psg_run(psg_context * context, uint32_t cycles); | 36 void psg_run(psg_context * context, uint32_t cycles); |
30 | 37 |
31 #endif //PSG_CONTEXT_H_ | 38 #endif //PSG_CONTEXT_H_ |
32 | 39 |