diff ym2612.h @ 1904:8312e574100a

Implement selectable YM2612/YM3834 invalid status port behavior
author Michael Pavone <pavone@retrodev.com>
date Wed, 26 Feb 2020 22:40:37 -0800
parents 32a3aa7b4a45
children 508522f08e4d
line wrap: on
line diff
--- a/ym2612.h	Tue Feb 25 20:03:04 2020 -0800
+++ b/ym2612.h	Wed Feb 26 22:40:37 2020 -0800
@@ -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 @@
 	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 @@
 	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_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);