comparison ym2612.h @ 364:62177cc39049

Incredibly broken YM2612 support plus a fix to Z80 bus request
author Mike Pavone <pavone@retrodev.com>
date Wed, 29 May 2013 00:57:19 -0700
parents b7c3facee762
children 0f8a759f1ff4
comparison
equal deleted inserted replaced
363:c708dea45f8b 364:62177cc39049
33 uint8_t pms; 33 uint8_t pms;
34 uint8_t lr; 34 uint8_t lr;
35 } ym_channel; 35 } ym_channel;
36 36
37 typedef struct { 37 typedef struct {
38 int16_t *audio_buffer;
39 int16_t *back_buffer;
40 double buffer_fraction;
41 double buffer_inc;
42 uint32_t buffer_pos;
43 uint32_t sample_limit;
38 uint32_t current_cycle; 44 uint32_t current_cycle;
39 uint32_t write_cycle; 45 uint32_t write_cycle;
40 ym_operator operators[NUM_OPERATORS]; 46 ym_operator operators[NUM_OPERATORS];
41 ym_channel channels[NUM_CHANNELS]; 47 ym_channel channels[NUM_CHANNELS];
42 uint16_t timer_a; 48 uint16_t timer_a;
43 uint16_t timer_a_load; 49 uint16_t timer_a_load;
50 uint16_t env_counter;
51 uint8_t current_op;
52 uint8_t current_env_op;
44 uint8_t timer_b; 53 uint8_t timer_b;
45 uint8_t timer_b_load; 54 uint8_t timer_b_load;
46 uint8_t timer_control; 55 uint8_t timer_control;
47 uint8_t dac_enable; 56 uint8_t dac_enable;
48 uint8_t status; 57 uint8_t status;
49 uint8_t selected_reg; 58 uint8_t selected_reg;
50 uint8_t selected_part; 59 uint8_t selected_part;
51 } ym2612_context; 60 } ym2612_context;
52 61
53 void ym_init(ym2612_context * context); 62 void ym_init(ym2612_context * context, uint32_t sample_rate, uint32_t clock_rate, uint32_t sample_limit);
54 void ym_run(ym2612_context * context, uint32_t to_cycle); 63 void ym_run(ym2612_context * context, uint32_t to_cycle);
55 void ym_address_write_part1(ym2612_context * context, uint8_t address); 64 void ym_address_write_part1(ym2612_context * context, uint8_t address);
56 void ym_address_write_part2(ym2612_context * context, uint8_t address); 65 void ym_address_write_part2(ym2612_context * context, uint8_t address);
57 void ym_data_write(ym2612_context * context, uint8_t value); 66 void ym_data_write(ym2612_context * context, uint8_t value);
58 uint8_t ym_read_status(ym2612_context * context); 67 uint8_t ym_read_status(ym2612_context * context);