changeset 2433:2907c3312423

Fix byte reads of ADPCM ports. Fixes hangs in Sanchoume no Tama and Sailor Moon Sailor Stars - Tokimeki Party
author Michael Pavone <pavone@retrodev.com>
date Thu, 08 Feb 2024 20:24:37 -0800
parents 18816c5c11d4
children 2ee25a487e2b
files genesis.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/genesis.c	Wed Feb 07 20:03:23 2024 -0800
+++ b/genesis.c	Thu Feb 08 20:24:37 2024 -0800
@@ -1517,12 +1517,12 @@
 		//printf("uPD7759 data read @ %u\n", m68k->current_cycle);
 		sync_sound_pico(gen, m68k->current_cycle);
 		tmp = pico_pcm_data_read(gen->adpcm);
-		return (location & 1) ? tmp >> 8 : tmp;
+		return (location & 1) ? tmp : tmp >> 8;
 	case 9:
 		//printf("uPD7759 contro/status read @ %u\n", m68k->current_cycle);
 		sync_sound_pico(gen, m68k->current_cycle);
 		tmp = pico_pcm_ctrl_read(gen->adpcm);
-		return (location & 1) ? tmp >> 8 : tmp;
+		return (location & 1) ? tmp : tmp >> 8;
 		return 0;
 	default:
 		printf("Unknown Pico IO read %X @ %u\n", location, m68k->current_cycle);