annotate psg.h @ 989:d70000fdff0b

Implemented IR and undefined bits of info word for address error exception frames
author Michael Pavone <pavone@retrodev.com>
date Wed, 27 Apr 2016 21:39:17 -0700
parents e6dc30231b83
children 8d032a368dd5
rev   line source
pavone@467 1 /*
pavone@467 2 Copyright 2013 Michael Pavone
pavone@483 3 This file is part of BlastEm.
pavone@467 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.
pavone@467 5 */
pavone@354 6 #ifndef PSG_CONTEXT_H_
pavone@354 7 #define PSG_CONTEXT_H_
pavone@354 8
pavone@354 9 #include <stdint.h>
pavone@354 10
pavone@354 11 typedef struct {
pavone@354 12 int16_t *audio_buffer;
pavone@354 13 int16_t *back_buffer;
pavone@483 14 uint64_t buffer_fraction;
pavone@483 15 uint64_t buffer_inc;
pavone@354 16 uint32_t buffer_pos;
pavone@380 17 uint32_t clock_inc;
pavone@354 18 uint32_t cycles;
pavone@483 19 uint32_t sample_rate;
pavone@354 20 uint32_t samples_frame;
pavone@964 21 int32_t lowpass_alpha;
pavone@354 22 uint16_t lsfr;
pavone@354 23 uint16_t counter_load[4];
pavone@354 24 uint16_t counters[4];
pavone@838 25 int16_t accum;
pavone@963 26 int16_t last_sample;
pavone@354 27 uint8_t volume[4];
pavone@354 28 uint8_t output_state[4];
pavone@354 29 uint8_t noise_out;
pavone@354 30 uint8_t noise_use_tone;
pavone@354 31 uint8_t noise_type;
pavone@354 32 uint8_t latch;
pavone@354 33 } psg_context;
pavone@354 34
pavone@354 35
pavone@380 36 void psg_init(psg_context * context, uint32_t sample_rate, uint32_t master_clock, uint32_t clock_div, uint32_t samples_frame);
pavone@884 37 void psg_free(psg_context *context);
pavone@483 38 void psg_adjust_master_clock(psg_context * context, uint32_t master_clock);
pavone@354 39 void psg_write(psg_context * context, uint8_t value);
pavone@354 40 void psg_run(psg_context * context, uint32_t cycles);
pavone@354 41
pavone@354 42 #endif //PSG_CONTEXT_H_
pavone@354 43