comparison ym2612.h @ 1909:508522f08e4d

Initial stab at VGM logging support
author Michael Pavone <pavone@retrodev.com>
date Fri, 27 Mar 2020 00:03:58 -0700
parents 8312e574100a
children 0d1d5dccdd28
comparison
equal deleted inserted replaced
1908:c3d49c338224 1909:508522f08e4d
8 8
9 #include <stdint.h> 9 #include <stdint.h>
10 #include <stdio.h> 10 #include <stdio.h>
11 #include "serialize.h" 11 #include "serialize.h"
12 #include "render_audio.h" 12 #include "render_audio.h"
13 #include "vgm.h"
13 14
14 #define NUM_PART_REGS (0xB7-0x30) 15 #define NUM_PART_REGS (0xB7-0x30)
15 #define NUM_CHANNELS 6 16 #define NUM_CHANNELS 6
16 #define NUM_OPERATORS (4*NUM_CHANNELS) 17 #define NUM_OPERATORS (4*NUM_CHANNELS)
17 18
66 #define YM_PART1_REGS (YM_REG_END-YM_PART1_START) 67 #define YM_PART1_REGS (YM_REG_END-YM_PART1_START)
67 #define YM_PART2_REGS (YM_REG_END-YM_PART2_START) 68 #define YM_PART2_REGS (YM_REG_END-YM_PART2_START)
68 69
69 typedef struct { 70 typedef struct {
70 audio_source *audio; 71 audio_source *audio;
72 vgm_writer *vgm;
71 uint32_t clock_inc; 73 uint32_t clock_inc;
72 uint32_t current_cycle; 74 uint32_t current_cycle;
73 uint32_t write_cycle; 75 uint32_t write_cycle;
74 uint32_t busy_start; 76 uint32_t busy_start;
75 uint32_t busy_cycles; 77 uint32_t busy_cycles;
142 void ym_adjust_cycles(ym2612_context *context, uint32_t deduction); 144 void ym_adjust_cycles(ym2612_context *context, uint32_t deduction);
143 void ym_run(ym2612_context * context, uint32_t to_cycle); 145 void ym_run(ym2612_context * context, uint32_t to_cycle);
144 void ym_address_write_part1(ym2612_context * context, uint8_t address); 146 void ym_address_write_part1(ym2612_context * context, uint8_t address);
145 void ym_address_write_part2(ym2612_context * context, uint8_t address); 147 void ym_address_write_part2(ym2612_context * context, uint8_t address);
146 void ym_data_write(ym2612_context * context, uint8_t value); 148 void ym_data_write(ym2612_context * context, uint8_t value);
149 void ym_vgm_log(ym2612_context *context, uint32_t master_clock, vgm_writer *vgm);
147 uint8_t ym_read_status(ym2612_context * context, uint32_t cycle, uint32_t port); 150 uint8_t ym_read_status(ym2612_context * context, uint32_t cycle, uint32_t port);
148 uint8_t ym_load_gst(ym2612_context * context, FILE * gstfile); 151 uint8_t ym_load_gst(ym2612_context * context, FILE * gstfile);
149 uint8_t ym_save_gst(ym2612_context * context, FILE * gstfile); 152 uint8_t ym_save_gst(ym2612_context * context, FILE * gstfile);
150 void ym_print_channel_info(ym2612_context *context, int channel); 153 void ym_print_channel_info(ym2612_context *context, int channel);
151 void ym_print_timer_info(ym2612_context *context); 154 void ym_print_timer_info(ym2612_context *context);