annotate ym2612.h @ 1442:59e1dbb795a7

Update README in anticipation of 0.5.1 release
author Michael Pavone <pavone@retrodev.com>
date Fri, 25 Aug 2017 20:12:21 -0700
parents 4e5797b3935a
children ce1f93be0104
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
467
140af5509ce7 Added copyright notice to source files and added GPL license text in COPYING
Mike Pavone <pavone@retrodev.com>
parents: 451
diff changeset
1 /*
140af5509ce7 Added copyright notice to source files and added GPL license text in COPYING
Mike Pavone <pavone@retrodev.com>
parents: 451
diff changeset
2 Copyright 2013 Michael Pavone
483
3e1573fa22cf Implement turbo/slow motion feature that overclocks or underclocks the entire system at the push of a button
Mike Pavone <pavone@retrodev.com>
parents: 467
diff changeset
3 This file is part of BlastEm.
467
140af5509ce7 Added copyright notice to source files and added GPL license text in COPYING
Mike Pavone <pavone@retrodev.com>
parents: 451
diff changeset
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.
140af5509ce7 Added copyright notice to source files and added GPL license text in COPYING
Mike Pavone <pavone@retrodev.com>
parents: 451
diff changeset
5 */
288
a8ee7934a1f8 Add a YM2612 stub implementation with just timers and status registers so that games that depend on it can run.
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
6 #ifndef YM2612_H_
a8ee7934a1f8 Add a YM2612 stub implementation with just timers and status registers so that games that depend on it can run.
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
7 #define YM2612_H_
a8ee7934a1f8 Add a YM2612 stub implementation with just timers and status registers so that games that depend on it can run.
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
8
a8ee7934a1f8 Add a YM2612 stub implementation with just timers and status registers so that games that depend on it can run.
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
9 #include <stdint.h>
407
c3abc4ada43d Add support for logging YM2612 channels to WAVE files
Mike Pavone <pavone@retrodev.com>
parents: 403
diff changeset
10 #include <stdio.h>
1427
4e5797b3935a WIP - New savestate format
Michael Pavone <pavone@retrodev.com>
parents: 1308
diff changeset
11 #include "serialize.h"
288
a8ee7934a1f8 Add a YM2612 stub implementation with just timers and status registers so that games that depend on it can run.
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
12
a8ee7934a1f8 Add a YM2612 stub implementation with just timers and status registers so that games that depend on it can run.
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
13 #define NUM_PART_REGS (0xB7-0x30)
362
b7c3facee762 YM2612 WIP update
Mike Pavone <pavone@retrodev.com>
parents: 359
diff changeset
14 #define NUM_CHANNELS 6
b7c3facee762 YM2612 WIP update
Mike Pavone <pavone@retrodev.com>
parents: 359
diff changeset
15 #define NUM_OPERATORS (4*NUM_CHANNELS)
b7c3facee762 YM2612 WIP update
Mike Pavone <pavone@retrodev.com>
parents: 359
diff changeset
16
407
c3abc4ada43d Add support for logging YM2612 channels to WAVE files
Mike Pavone <pavone@retrodev.com>
parents: 403
diff changeset
17 #define YM_OPT_WAVE_LOG 1
c3abc4ada43d Add support for logging YM2612 channels to WAVE files
Mike Pavone <pavone@retrodev.com>
parents: 403
diff changeset
18
362
b7c3facee762 YM2612 WIP update
Mike Pavone <pavone@retrodev.com>
parents: 359
diff changeset
19 typedef struct {
b7c3facee762 YM2612 WIP update
Mike Pavone <pavone@retrodev.com>
parents: 359
diff changeset
20 uint32_t phase_counter;
b7c3facee762 YM2612 WIP update
Mike Pavone <pavone@retrodev.com>
parents: 359
diff changeset
21 uint16_t envelope;
371
0f8a759f1ff4 Use signed ints for things that represent signed values in YM2612 core
Mike Pavone <pavone@retrodev.com>
parents: 364
diff changeset
22 int16_t output;
362
b7c3facee762 YM2612 WIP update
Mike Pavone <pavone@retrodev.com>
parents: 359
diff changeset
23 uint16_t total_level;
b7c3facee762 YM2612 WIP update
Mike Pavone <pavone@retrodev.com>
parents: 359
diff changeset
24 uint16_t sustain_level;
b7c3facee762 YM2612 WIP update
Mike Pavone <pavone@retrodev.com>
parents: 359
diff changeset
25 uint8_t rates[4];
b7c3facee762 YM2612 WIP update
Mike Pavone <pavone@retrodev.com>
parents: 359
diff changeset
26 uint8_t key_scaling;
b7c3facee762 YM2612 WIP update
Mike Pavone <pavone@retrodev.com>
parents: 359
diff changeset
27 uint8_t multiple;
b7c3facee762 YM2612 WIP update
Mike Pavone <pavone@retrodev.com>
parents: 359
diff changeset
28 uint8_t detune;
739
2317bdca03b4 Add a basic YM-2612 command to the debugger. Fix negative detune values and get the correct precision for the multiplication step of phase inc calculation
Michael Pavone <pavone@retrodev.com>
parents: 535
diff changeset
29 uint8_t am;
362
b7c3facee762 YM2612 WIP update
Mike Pavone <pavone@retrodev.com>
parents: 359
diff changeset
30 uint8_t env_phase;
1301
babff81e4cfd Initial implementation of YM2612 SSG-EG mode
Michael Pavone <pavone@retrodev.com>
parents: 1300
diff changeset
31 uint8_t ssg;
babff81e4cfd Initial implementation of YM2612 SSG-EG mode
Michael Pavone <pavone@retrodev.com>
parents: 1300
diff changeset
32 uint8_t inverted;
362
b7c3facee762 YM2612 WIP update
Mike Pavone <pavone@retrodev.com>
parents: 359
diff changeset
33 } ym_operator;
288
a8ee7934a1f8 Add a YM2612 stub implementation with just timers and status registers so that games that depend on it can run.
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
34
a8ee7934a1f8 Add a YM2612 stub implementation with just timers and status registers so that games that depend on it can run.
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
35 typedef struct {
407
c3abc4ada43d Add support for logging YM2612 channels to WAVE files
Mike Pavone <pavone@retrodev.com>
parents: 403
diff changeset
36 FILE * logfile;
362
b7c3facee762 YM2612 WIP update
Mike Pavone <pavone@retrodev.com>
parents: 359
diff changeset
37 uint16_t fnum;
b7c3facee762 YM2612 WIP update
Mike Pavone <pavone@retrodev.com>
parents: 359
diff changeset
38 int16_t output;
527
7df7f493b3b6 Fix operator 1 self-feedback
Michael Pavone <pavone@retrodev.com>
parents: 483
diff changeset
39 int16_t op1_old;
362
b7c3facee762 YM2612 WIP update
Mike Pavone <pavone@retrodev.com>
parents: 359
diff changeset
40 uint8_t block_fnum_latch;
b7c3facee762 YM2612 WIP update
Mike Pavone <pavone@retrodev.com>
parents: 359
diff changeset
41 uint8_t block;
b7c3facee762 YM2612 WIP update
Mike Pavone <pavone@retrodev.com>
parents: 359
diff changeset
42 uint8_t keycode;
b7c3facee762 YM2612 WIP update
Mike Pavone <pavone@retrodev.com>
parents: 359
diff changeset
43 uint8_t algorithm;
b7c3facee762 YM2612 WIP update
Mike Pavone <pavone@retrodev.com>
parents: 359
diff changeset
44 uint8_t feedback;
b7c3facee762 YM2612 WIP update
Mike Pavone <pavone@retrodev.com>
parents: 359
diff changeset
45 uint8_t ams;
b7c3facee762 YM2612 WIP update
Mike Pavone <pavone@retrodev.com>
parents: 359
diff changeset
46 uint8_t pms;
b7c3facee762 YM2612 WIP update
Mike Pavone <pavone@retrodev.com>
parents: 359
diff changeset
47 uint8_t lr;
1300
4b893b02444e Basic implementation of CSM mode that should handle documented edge cases. Dodesn't handle the weird undocumented edge cases I don't have a good understanding of yet though
Michael Pavone <pavone@retrodev.com>
parents: 1002
diff changeset
48 uint8_t keyon;
362
b7c3facee762 YM2612 WIP update
Mike Pavone <pavone@retrodev.com>
parents: 359
diff changeset
49 } ym_channel;
b7c3facee762 YM2612 WIP update
Mike Pavone <pavone@retrodev.com>
parents: 359
diff changeset
50
b7c3facee762 YM2612 WIP update
Mike Pavone <pavone@retrodev.com>
parents: 359
diff changeset
51 typedef struct {
383
72933100c55c Initial implementation of channel 3 special mode
Mike Pavone <pavone@retrodev.com>
parents: 380
diff changeset
52 uint16_t fnum;
72933100c55c Initial implementation of channel 3 special mode
Mike Pavone <pavone@retrodev.com>
parents: 380
diff changeset
53 uint8_t block;
72933100c55c Initial implementation of channel 3 special mode
Mike Pavone <pavone@retrodev.com>
parents: 380
diff changeset
54 uint8_t block_fnum_latch;
72933100c55c Initial implementation of channel 3 special mode
Mike Pavone <pavone@retrodev.com>
parents: 380
diff changeset
55 uint8_t keycode;
72933100c55c Initial implementation of channel 3 special mode
Mike Pavone <pavone@retrodev.com>
parents: 380
diff changeset
56 } ym_supp;
72933100c55c Initial implementation of channel 3 special mode
Mike Pavone <pavone@retrodev.com>
parents: 380
diff changeset
57
451
b7c3b2d22858 Added support for saving savestates. Added gst savestate format test harness
Mike Pavone <pavone@retrodev.com>
parents: 424
diff changeset
58 #define YM_PART1_START 0x21
b7c3b2d22858 Added support for saving savestates. Added gst savestate format test harness
Mike Pavone <pavone@retrodev.com>
parents: 424
diff changeset
59 #define YM_PART2_START 0x30
b7c3b2d22858 Added support for saving savestates. Added gst savestate format test harness
Mike Pavone <pavone@retrodev.com>
parents: 424
diff changeset
60 #define YM_REG_END 0xB8
b7c3b2d22858 Added support for saving savestates. Added gst savestate format test harness
Mike Pavone <pavone@retrodev.com>
parents: 424
diff changeset
61 #define YM_PART1_REGS (YM_REG_END-YM_PART1_START)
b7c3b2d22858 Added support for saving savestates. Added gst savestate format test harness
Mike Pavone <pavone@retrodev.com>
parents: 424
diff changeset
62 #define YM_PART2_REGS (YM_REG_END-YM_PART2_START)
b7c3b2d22858 Added support for saving savestates. Added gst savestate format test harness
Mike Pavone <pavone@retrodev.com>
parents: 424
diff changeset
63
383
72933100c55c Initial implementation of channel 3 special mode
Mike Pavone <pavone@retrodev.com>
parents: 380
diff changeset
64 typedef struct {
364
62177cc39049 Incredibly broken YM2612 support plus a fix to Z80 bus request
Mike Pavone <pavone@retrodev.com>
parents: 362
diff changeset
65 int16_t *audio_buffer;
62177cc39049 Incredibly broken YM2612 support plus a fix to Z80 bus request
Mike Pavone <pavone@retrodev.com>
parents: 362
diff changeset
66 int16_t *back_buffer;
483
3e1573fa22cf Implement turbo/slow motion feature that overclocks or underclocks the entire system at the push of a button
Mike Pavone <pavone@retrodev.com>
parents: 467
diff changeset
67 uint64_t buffer_fraction;
3e1573fa22cf Implement turbo/slow motion feature that overclocks or underclocks the entire system at the push of a button
Mike Pavone <pavone@retrodev.com>
parents: 467
diff changeset
68 uint64_t buffer_inc;
380
1c8d74f2ab0b Make the PSG and YM2612 use the master clock internal with an increment based on clock divider so that they stay perflectly in sync. Run both the PSG and YM2612 whenver one of them needs to be run.
Mike Pavone <pavone@retrodev.com>
parents: 371
diff changeset
69 uint32_t clock_inc;
364
62177cc39049 Incredibly broken YM2612 support plus a fix to Z80 bus request
Mike Pavone <pavone@retrodev.com>
parents: 362
diff changeset
70 uint32_t buffer_pos;
483
3e1573fa22cf Implement turbo/slow motion feature that overclocks or underclocks the entire system at the push of a button
Mike Pavone <pavone@retrodev.com>
parents: 467
diff changeset
71 uint32_t sample_rate;
364
62177cc39049 Incredibly broken YM2612 support plus a fix to Z80 bus request
Mike Pavone <pavone@retrodev.com>
parents: 362
diff changeset
72 uint32_t sample_limit;
362
b7c3facee762 YM2612 WIP update
Mike Pavone <pavone@retrodev.com>
parents: 359
diff changeset
73 uint32_t current_cycle;
535
aaa77e351c24 Better emulation of the YM-2612 busy flag
Mike Pavone <pavone@retrodev.com>
parents: 527
diff changeset
74 //TODO: Condense the next two fields into one
362
b7c3facee762 YM2612 WIP update
Mike Pavone <pavone@retrodev.com>
parents: 359
diff changeset
75 uint32_t write_cycle;
535
aaa77e351c24 Better emulation of the YM-2612 busy flag
Mike Pavone <pavone@retrodev.com>
parents: 527
diff changeset
76 uint32_t busy_cycles;
965
5257e85364ed Implemented linear resampling and low pass filter for the YM2612
Michael Pavone <pavone@retrodev.com>
parents: 935
diff changeset
77 uint32_t lowpass_alpha;
362
b7c3facee762 YM2612 WIP update
Mike Pavone <pavone@retrodev.com>
parents: 359
diff changeset
78 ym_operator operators[NUM_OPERATORS];
b7c3facee762 YM2612 WIP update
Mike Pavone <pavone@retrodev.com>
parents: 359
diff changeset
79 ym_channel channels[NUM_CHANNELS];
b7c3facee762 YM2612 WIP update
Mike Pavone <pavone@retrodev.com>
parents: 359
diff changeset
80 uint16_t timer_a;
b7c3facee762 YM2612 WIP update
Mike Pavone <pavone@retrodev.com>
parents: 359
diff changeset
81 uint16_t timer_a_load;
364
62177cc39049 Incredibly broken YM2612 support plus a fix to Z80 bus request
Mike Pavone <pavone@retrodev.com>
parents: 362
diff changeset
82 uint16_t env_counter;
383
72933100c55c Initial implementation of channel 3 special mode
Mike Pavone <pavone@retrodev.com>
parents: 380
diff changeset
83 ym_supp ch3_supp[3];
965
5257e85364ed Implemented linear resampling and low pass filter for the YM2612
Michael Pavone <pavone@retrodev.com>
parents: 935
diff changeset
84 int16_t last_left;
5257e85364ed Implemented linear resampling and low pass filter for the YM2612
Michael Pavone <pavone@retrodev.com>
parents: 935
diff changeset
85 int16_t last_right;
845
3a18b5f63afc Small fix to how manual YM-2612 timer reloads work. Seems to better match a small test program and gets audio to match up in TM.EE's "I've got Italo Inside" track.
Michael Pavone <pavone@retrodev.com>
parents: 739
diff changeset
86 uint8_t timer_b;
3a18b5f63afc Small fix to how manual YM-2612 timer reloads work. Seems to better match a small test program and gets audio to match up in TM.EE's "I've got Italo Inside" track.
Michael Pavone <pavone@retrodev.com>
parents: 739
diff changeset
87 uint8_t sub_timer_b;
3a18b5f63afc Small fix to how manual YM-2612 timer reloads work. Seems to better match a small test program and gets audio to match up in TM.EE's "I've got Italo Inside" track.
Michael Pavone <pavone@retrodev.com>
parents: 739
diff changeset
88 uint8_t timer_b_load;
383
72933100c55c Initial implementation of channel 3 special mode
Mike Pavone <pavone@retrodev.com>
parents: 380
diff changeset
89 uint8_t ch3_mode;
364
62177cc39049 Incredibly broken YM2612 support plus a fix to Z80 bus request
Mike Pavone <pavone@retrodev.com>
parents: 362
diff changeset
90 uint8_t current_op;
62177cc39049 Incredibly broken YM2612 support plus a fix to Z80 bus request
Mike Pavone <pavone@retrodev.com>
parents: 362
diff changeset
91 uint8_t current_env_op;
451
b7c3b2d22858 Added support for saving savestates. Added gst savestate format test harness
Mike Pavone <pavone@retrodev.com>
parents: 424
diff changeset
92
362
b7c3facee762 YM2612 WIP update
Mike Pavone <pavone@retrodev.com>
parents: 359
diff changeset
93 uint8_t timer_control;
b7c3facee762 YM2612 WIP update
Mike Pavone <pavone@retrodev.com>
parents: 359
diff changeset
94 uint8_t dac_enable;
411
baf4688901f2 Initial stab at LFO phase modulation
Mike Pavone <pavone@retrodev.com>
parents: 407
diff changeset
95 uint8_t lfo_enable;
baf4688901f2 Initial stab at LFO phase modulation
Mike Pavone <pavone@retrodev.com>
parents: 407
diff changeset
96 uint8_t lfo_freq;
baf4688901f2 Initial stab at LFO phase modulation
Mike Pavone <pavone@retrodev.com>
parents: 407
diff changeset
97 uint8_t lfo_counter;
baf4688901f2 Initial stab at LFO phase modulation
Mike Pavone <pavone@retrodev.com>
parents: 407
diff changeset
98 uint8_t lfo_am_step;
baf4688901f2 Initial stab at LFO phase modulation
Mike Pavone <pavone@retrodev.com>
parents: 407
diff changeset
99 uint8_t lfo_pm_step;
1300
4b893b02444e Basic implementation of CSM mode that should handle documented edge cases. Dodesn't handle the weird undocumented edge cases I don't have a good understanding of yet though
Michael Pavone <pavone@retrodev.com>
parents: 1002
diff changeset
100 uint8_t csm_keyon;
362
b7c3facee762 YM2612 WIP update
Mike Pavone <pavone@retrodev.com>
parents: 359
diff changeset
101 uint8_t status;
b7c3facee762 YM2612 WIP update
Mike Pavone <pavone@retrodev.com>
parents: 359
diff changeset
102 uint8_t selected_reg;
b7c3facee762 YM2612 WIP update
Mike Pavone <pavone@retrodev.com>
parents: 359
diff changeset
103 uint8_t selected_part;
451
b7c3b2d22858 Added support for saving savestates. Added gst savestate format test harness
Mike Pavone <pavone@retrodev.com>
parents: 424
diff changeset
104 uint8_t part1_regs[YM_PART1_REGS];
b7c3b2d22858 Added support for saving savestates. Added gst savestate format test harness
Mike Pavone <pavone@retrodev.com>
parents: 424
diff changeset
105 uint8_t part2_regs[YM_PART2_REGS];
288
a8ee7934a1f8 Add a YM2612 stub implementation with just timers and status registers so that games that depend on it can run.
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
106 } ym2612_context;
a8ee7934a1f8 Add a YM2612 stub implementation with just timers and status registers so that games that depend on it can run.
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
107
848
7068a9db6dd0 Wrote a buggy tool for splitting VGM files by channel
Michael Pavone <pavone@retrodev.com>
parents: 845
diff changeset
108 enum {
7068a9db6dd0 Wrote a buggy tool for splitting VGM files by channel
Michael Pavone <pavone@retrodev.com>
parents: 845
diff changeset
109 REG_LFO = 0x22,
7068a9db6dd0 Wrote a buggy tool for splitting VGM files by channel
Michael Pavone <pavone@retrodev.com>
parents: 845
diff changeset
110 REG_TIMERA_HIGH = 0x24,
7068a9db6dd0 Wrote a buggy tool for splitting VGM files by channel
Michael Pavone <pavone@retrodev.com>
parents: 845
diff changeset
111 REG_TIMERA_LOW,
7068a9db6dd0 Wrote a buggy tool for splitting VGM files by channel
Michael Pavone <pavone@retrodev.com>
parents: 845
diff changeset
112 REG_TIMERB,
7068a9db6dd0 Wrote a buggy tool for splitting VGM files by channel
Michael Pavone <pavone@retrodev.com>
parents: 845
diff changeset
113 REG_TIME_CTRL,
7068a9db6dd0 Wrote a buggy tool for splitting VGM files by channel
Michael Pavone <pavone@retrodev.com>
parents: 845
diff changeset
114 REG_KEY_ONOFF,
7068a9db6dd0 Wrote a buggy tool for splitting VGM files by channel
Michael Pavone <pavone@retrodev.com>
parents: 845
diff changeset
115 REG_DAC = 0x2A,
7068a9db6dd0 Wrote a buggy tool for splitting VGM files by channel
Michael Pavone <pavone@retrodev.com>
parents: 845
diff changeset
116 REG_DAC_ENABLE,
7068a9db6dd0 Wrote a buggy tool for splitting VGM files by channel
Michael Pavone <pavone@retrodev.com>
parents: 845
diff changeset
117
7068a9db6dd0 Wrote a buggy tool for splitting VGM files by channel
Michael Pavone <pavone@retrodev.com>
parents: 845
diff changeset
118 REG_DETUNE_MULT = 0x30,
7068a9db6dd0 Wrote a buggy tool for splitting VGM files by channel
Michael Pavone <pavone@retrodev.com>
parents: 845
diff changeset
119 REG_TOTAL_LEVEL = 0x40,
7068a9db6dd0 Wrote a buggy tool for splitting VGM files by channel
Michael Pavone <pavone@retrodev.com>
parents: 845
diff changeset
120 REG_ATTACK_KS = 0x50,
7068a9db6dd0 Wrote a buggy tool for splitting VGM files by channel
Michael Pavone <pavone@retrodev.com>
parents: 845
diff changeset
121 REG_DECAY_AM = 0x60,
7068a9db6dd0 Wrote a buggy tool for splitting VGM files by channel
Michael Pavone <pavone@retrodev.com>
parents: 845
diff changeset
122 REG_SUSTAIN_RATE = 0x70,
7068a9db6dd0 Wrote a buggy tool for splitting VGM files by channel
Michael Pavone <pavone@retrodev.com>
parents: 845
diff changeset
123 REG_S_LVL_R_RATE = 0x80,
1301
babff81e4cfd Initial implementation of YM2612 SSG-EG mode
Michael Pavone <pavone@retrodev.com>
parents: 1300
diff changeset
124 REG_SSG_EG = 0x90,
848
7068a9db6dd0 Wrote a buggy tool for splitting VGM files by channel
Michael Pavone <pavone@retrodev.com>
parents: 845
diff changeset
125
7068a9db6dd0 Wrote a buggy tool for splitting VGM files by channel
Michael Pavone <pavone@retrodev.com>
parents: 845
diff changeset
126 REG_FNUM_LOW = 0xA0,
7068a9db6dd0 Wrote a buggy tool for splitting VGM files by channel
Michael Pavone <pavone@retrodev.com>
parents: 845
diff changeset
127 REG_BLOCK_FNUM_H = 0xA4,
7068a9db6dd0 Wrote a buggy tool for splitting VGM files by channel
Michael Pavone <pavone@retrodev.com>
parents: 845
diff changeset
128 REG_FNUM_LOW_CH3 = 0xA8,
7068a9db6dd0 Wrote a buggy tool for splitting VGM files by channel
Michael Pavone <pavone@retrodev.com>
parents: 845
diff changeset
129 REG_BLOCK_FN_CH3 = 0xAC,
7068a9db6dd0 Wrote a buggy tool for splitting VGM files by channel
Michael Pavone <pavone@retrodev.com>
parents: 845
diff changeset
130 REG_ALG_FEEDBACK = 0xB0,
7068a9db6dd0 Wrote a buggy tool for splitting VGM files by channel
Michael Pavone <pavone@retrodev.com>
parents: 845
diff changeset
131 REG_LR_AMS_PMS = 0xB4
7068a9db6dd0 Wrote a buggy tool for splitting VGM files by channel
Michael Pavone <pavone@retrodev.com>
parents: 845
diff changeset
132 };
7068a9db6dd0 Wrote a buggy tool for splitting VGM files by channel
Michael Pavone <pavone@retrodev.com>
parents: 845
diff changeset
133
1002
8d032a368dd5 Made low pass filter frequency configurable
Michael Pavone <pavone@retrodev.com>
parents: 965
diff changeset
134 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, uint32_t lowpass_cutoff);
1308
1b3fe6e03e7b Reset YM2612 whenver the Z80 is reset. Fixes issue with stuck notes in Fantastic Dizzy and Kid Chameleon
Michael Pavone <pavone@retrodev.com>
parents: 1301
diff changeset
135 void ym_reset(ym2612_context *context);
884
252dfd29831d Selecting a second game from the menu now works
Michael Pavone <pavone@retrodev.com>
parents: 848
diff changeset
136 void ym_free(ym2612_context *context);
483
3e1573fa22cf Implement turbo/slow motion feature that overclocks or underclocks the entire system at the push of a button
Mike Pavone <pavone@retrodev.com>
parents: 467
diff changeset
137 void ym_adjust_master_clock(ym2612_context * context, uint32_t master_clock);
288
a8ee7934a1f8 Add a YM2612 stub implementation with just timers and status registers so that games that depend on it can run.
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
138 void ym_run(ym2612_context * context, uint32_t to_cycle);
a8ee7934a1f8 Add a YM2612 stub implementation with just timers and status registers so that games that depend on it can run.
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
139 void ym_address_write_part1(ym2612_context * context, uint8_t address);
a8ee7934a1f8 Add a YM2612 stub implementation with just timers and status registers so that games that depend on it can run.
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
140 void ym_address_write_part2(ym2612_context * context, uint8_t address);
a8ee7934a1f8 Add a YM2612 stub implementation with just timers and status registers so that games that depend on it can run.
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
141 void ym_data_write(ym2612_context * context, uint8_t value);
a8ee7934a1f8 Add a YM2612 stub implementation with just timers and status registers so that games that depend on it can run.
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
142 uint8_t ym_read_status(ym2612_context * context);
424
7e8e179116af Add support for loading GST format savestates
Mike Pavone <pavone@retrodev.com>
parents: 411
diff changeset
143 uint8_t ym_load_gst(ym2612_context * context, FILE * gstfile);
451
b7c3b2d22858 Added support for saving savestates. Added gst savestate format test harness
Mike Pavone <pavone@retrodev.com>
parents: 424
diff changeset
144 uint8_t ym_save_gst(ym2612_context * context, FILE * gstfile);
739
2317bdca03b4 Add a basic YM-2612 command to the debugger. Fix negative detune values and get the correct precision for the multiplication step of phase inc calculation
Michael Pavone <pavone@retrodev.com>
parents: 535
diff changeset
145 void ym_print_channel_info(ym2612_context *context, int channel);
930
f33e8d88ab6f Add yt debug command for printing YM-2612 timer info. Fix AMS shift values.
Michael Pavone <pavone@retrodev.com>
parents: 884
diff changeset
146 void ym_print_timer_info(ym2612_context *context);
1427
4e5797b3935a WIP - New savestate format
Michael Pavone <pavone@retrodev.com>
parents: 1308
diff changeset
147 void ym_serialize(ym2612_context *context, serialize_buffer *buf);
4e5797b3935a WIP - New savestate format
Michael Pavone <pavone@retrodev.com>
parents: 1308
diff changeset
148 void ym_deserialize(deserialize_buffer *buf, void *vcontext);
288
a8ee7934a1f8 Add a YM2612 stub implementation with just timers and status registers so that games that depend on it can run.
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
149
a8ee7934a1f8 Add a YM2612 stub implementation with just timers and status registers so that games that depend on it can run.
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
150 #endif //YM2612_H_
a8ee7934a1f8 Add a YM2612 stub implementation with just timers and status registers so that games that depend on it can run.
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
151