diff options
author | Mike Pavone <pavone@retrodev.com> | 2013-10-26 22:38:47 -0700 |
---|---|---|
committer | Mike Pavone <pavone@retrodev.com> | 2013-10-26 22:38:47 -0700 |
commit | 7e61eaa7225bf025af42f88d0598aff8412f4144 (patch) | |
tree | bd19c2e555fc997065eba51715459185db566878 /ym2612.h | |
parent | 4788b58c7290ad4a4a161d6bc69bc184acc2ef66 (diff) | |
parent | b8dc9d69563379341f127af571b4bec1312f4ca0 (diff) |
Update opengl branch from default. Fix build breakage unrelated to merge
--HG--
branch : opengl
Diffstat (limited to 'ym2612.h')
-rw-r--r-- | ym2612.h | 22 |
1 files changed, 19 insertions, 3 deletions
@@ -1,3 +1,8 @@ +/* + Copyright 2013 Michael Pavone + This file is part of BlastEm. + BlastEm is free software distributed under the terms of the GNU General Public License version 3 or greater. See COPYING for full license text. +*/ #ifndef YM2612_H_ #define YM2612_H_ @@ -45,13 +50,20 @@ typedef struct { uint8_t keycode; } ym_supp; +#define YM_PART1_START 0x21 +#define YM_PART2_START 0x30 +#define YM_REG_END 0xB8 +#define YM_PART1_REGS (YM_REG_END-YM_PART1_START) +#define YM_PART2_REGS (YM_REG_END-YM_PART2_START) + typedef struct { int16_t *audio_buffer; int16_t *back_buffer; - double buffer_fraction; - double buffer_inc; + uint64_t buffer_fraction; + uint64_t buffer_inc; uint32_t clock_inc; uint32_t buffer_pos; + uint32_t sample_rate; uint32_t sample_limit; uint32_t current_cycle; uint32_t write_cycle; @@ -66,7 +78,7 @@ typedef struct { uint8_t ch3_mode; uint8_t current_op; uint8_t current_env_op; - + uint8_t timer_control; uint8_t dac_enable; uint8_t lfo_enable; @@ -77,15 +89,19 @@ typedef struct { uint8_t status; uint8_t selected_reg; uint8_t selected_part; + uint8_t part1_regs[YM_PART1_REGS]; + uint8_t part2_regs[YM_PART2_REGS]; } ym2612_context; void ym_init(ym2612_context * context, uint32_t sample_rate, uint32_t master_clock, uint32_t clock_div, uint32_t sample_limit, uint32_t options); +void ym_adjust_master_clock(ym2612_context * context, uint32_t master_clock); void ym_run(ym2612_context * context, uint32_t to_cycle); void ym_address_write_part1(ym2612_context * context, uint8_t address); void ym_address_write_part2(ym2612_context * context, uint8_t address); void ym_data_write(ym2612_context * context, uint8_t value); uint8_t ym_read_status(ym2612_context * context); uint8_t ym_load_gst(ym2612_context * context, FILE * gstfile); +uint8_t ym_save_gst(ym2612_context * context, FILE * gstfile); #endif //YM2612_H_ |