summaryrefslogtreecommitdiff
path: root/ym2612.h
diff options
context:
space:
mode:
authorMichael Pavone <pavone@retrodev.com>2020-02-26 22:40:37 -0800
committerMichael Pavone <pavone@retrodev.com>2020-02-26 22:40:37 -0800
commit961cf431bb75e7a25805103da6efa3f41baf01c9 (patch)
treed870d7e769a5e9387dbd7e41d8e3f393f8fe59c8 /ym2612.h
parent94c3e706af264bad799db8cc51a51f86356c6481 (diff)
Implement selectable YM2612/YM3834 invalid status port behavior
Diffstat (limited to 'ym2612.h')
-rw-r--r--ym2612.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/ym2612.h b/ym2612.h
index 8694b3a..130c729 100644
--- a/ym2612.h
+++ b/ym2612.h
@@ -16,6 +16,7 @@
#define NUM_OPERATORS (4*NUM_CHANNELS)
#define YM_OPT_WAVE_LOG 1
+#define YM_OPT_3834 2
typedef struct {
int16_t *mod_src[2];
@@ -72,6 +73,9 @@ typedef struct {
uint32_t write_cycle;
uint32_t busy_start;
uint32_t busy_cycles;
+ uint32_t last_status_cycle;
+ uint32_t invalid_status_decay;
+ uint32_t status_address_mask;
int32_t volume_mult;
int32_t volume_div;
ym_operator operators[NUM_OPERATORS];
@@ -97,6 +101,7 @@ typedef struct {
uint8_t lfo_pm_step;
uint8_t csm_keyon;
uint8_t status;
+ uint8_t last_status;
uint8_t selected_reg;
uint8_t selected_part;
uint8_t part1_regs[YM_PART1_REGS];
@@ -139,7 +144,7 @@ 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, uint32_t cycle);
+uint8_t ym_read_status(ym2612_context * context, uint32_t cycle, uint32_t port);
uint8_t ym_load_gst(ym2612_context * context, FILE * gstfile);
uint8_t ym_save_gst(ym2612_context * context, FILE * gstfile);
void ym_print_channel_info(ym2612_context *context, int channel);