diff genesis.c @ 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 2d462aa78349
line wrap: on
line diff
--- a/genesis.c	Tue Feb 25 20:03:04 2020 -0800
+++ b/genesis.c	Wed Feb 26 22:40:37 2020 -0800
@@ -875,7 +875,7 @@
 				value = gen->zram[location & 0x1FFF];
 			} else if (location < 0x6000) {
 				sync_sound(gen, context->current_cycle);
-				value = ym_read_status(gen->ym, context->current_cycle);
+				value = ym_read_status(gen->ym, context->current_cycle, location);
 			} else {
 				value = 0xFF;
 			}
@@ -988,7 +988,7 @@
 	z80_context * context = vcontext;
 	genesis_context * gen = context->system;
 	sync_sound(gen, context->Z80_CYCLE);
-	return ym_read_status(gen->ym, context->Z80_CYCLE);
+	return ym_read_status(gen->ym, context->Z80_CYCLE, location);
 }
 
 static uint8_t z80_read_bank(uint32_t location, void * vcontext)
@@ -1420,6 +1420,10 @@
 	render_set_video_standard((gen->version_reg & HZ50) ? VID_PAL : VID_NTSC);
 	
 	gen->ym = malloc(sizeof(ym2612_context));
+	char *fm = tern_find_ptr_default(model, "fm", "discrete 2612");
+	if (!strcmp(fm + strlen(fm) -4, "3834")) {
+		system_opts |= YM_OPT_3834;
+	}
 	ym_init(gen->ym, gen->master_clock, MCLKS_PER_YM, system_opts);
 
 	gen->psg = malloc(sizeof(psg_context));