Mercurial > repos > blastem
comparison psg.h @ 2243:0d1d5dccdd28
Initial implementation of oscilloscope debug view
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Tue, 22 Nov 2022 17:57:02 -0800 |
parents | 2648081f3100 |
children | 74112041b2c7 |
comparison
equal
deleted
inserted
replaced
2240:8e8db9141209 | 2243:0d1d5dccdd28 |
---|---|
8 | 8 |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 #include "serialize.h" | 10 #include "serialize.h" |
11 #include "render_audio.h" | 11 #include "render_audio.h" |
12 #include "vgm.h" | 12 #include "vgm.h" |
13 #include "oscilloscope.h" | |
13 | 14 |
14 typedef struct { | 15 typedef struct { |
15 audio_source *audio; | 16 audio_source *audio; |
16 vgm_writer *vgm; | 17 vgm_writer *vgm; |
18 oscilloscope *scope; | |
17 uint32_t clock_inc; | 19 uint32_t clock_inc; |
18 uint32_t cycles; | 20 uint32_t cycles; |
19 uint16_t lsfr; | 21 uint16_t lsfr; |
20 uint16_t counter_load[4]; | 22 uint16_t counter_load[4]; |
21 uint16_t counters[4]; | 23 uint16_t counters[4]; |
22 uint8_t volume[4]; | 24 uint8_t volume[4]; |
23 uint8_t output_state[4]; | 25 uint8_t output_state[4]; |
26 uint8_t scope_channel[4]; | |
24 uint8_t noise_out; | 27 uint8_t noise_out; |
25 uint8_t noise_use_tone; | 28 uint8_t noise_use_tone; |
26 uint8_t noise_type; | 29 uint8_t noise_type; |
27 uint8_t latch; | 30 uint8_t latch; |
28 uint8_t pan; | 31 uint8_t pan; |
29 } psg_context; | 32 } psg_context; |
30 | 33 |
31 | 34 |
32 void psg_init(psg_context * context, uint32_t master_clock, uint32_t clock_div); | 35 void psg_init(psg_context * context, uint32_t master_clock, uint32_t clock_div); |
36 void psg_enable_scope(psg_context *context, oscilloscope *scope); | |
33 void psg_free(psg_context *context); | 37 void psg_free(psg_context *context); |
34 void psg_adjust_master_clock(psg_context * context, uint32_t master_clock); | 38 void psg_adjust_master_clock(psg_context * context, uint32_t master_clock); |
35 void psg_write(psg_context * context, uint8_t value); | 39 void psg_write(psg_context * context, uint8_t value); |
36 void psg_run(psg_context * context, uint32_t cycles); | 40 void psg_run(psg_context * context, uint32_t cycles); |
37 void psg_vgm_log(psg_context *context, uint32_t master_clock, vgm_writer *vgm); | 41 void psg_vgm_log(psg_context *context, uint32_t master_clock, vgm_writer *vgm); |