From: kub Date: Fri, 25 Sep 2020 19:22:40 +0000 (+0200) Subject: audio, improve YM2413 handling X-Git-Tag: v2.00~684 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=81d54be15d09402a213a4669493525f3f5c7ba72;p=picodrive.git audio, improve YM2413 handling --- diff --git a/pico/sms.c b/pico/sms.c index 5ddbebd2..d4b412b3 100644 --- a/pico/sms.c +++ b/pico/sms.c @@ -108,21 +108,21 @@ static unsigned char z80_sms_in(unsigned short a) elprintf(EL_IO, "z80 port %04x read", a); if((a&0xff)>= 0xf0){ - switch((a&0xff)) - { - case 0xf0: - // FM reg port - break; - case 0xf1: - // FM data port - break; - case 0xf2: - // bit 0 = 1 active FM Pac - if (PicoIn.opt & POPT_EN_YM2413){ + if (PicoIn.opt & POPT_EN_YM2413){ + switch((a&0xff)) + { + case 0xf0: + // FM reg port + break; + case 0xf1: + // FM data port + break; + case 0xf2: + // bit 0 = 1 active FM Pac d = ymflag; //printf("read FM Check = %02x\n", d); + break; } - break; } } else{ @@ -171,25 +171,25 @@ static void z80_sms_out(unsigned short a, unsigned char d) elprintf(EL_IO, "z80 port %04x write %02x", a, d); if((a&0xff)>= 0xf0){ - switch((a&0xff)) - { - case 0xf0: - // FM reg port - YM2413_regWrite(d); - //printf("write FM register = %02x\n", d); - break; - case 0xf1: - // FM data port - YM2413_dataWrite(d); - //printf("write FM data = %02x\n", d); - break; - case 0xf2: - // bit 0 = 1 active FM Pac - if (PicoIn.opt & POPT_EN_YM2413){ + if (PicoIn.opt & POPT_EN_YM2413){ + switch((a&0xff)) + { + case 0xf0: + // FM reg port + YM2413_regWrite(d); + //printf("write FM register = %02x\n", d); + break; + case 0xf1: + // FM data port + YM2413_dataWrite(d); + //printf("write FM data = %02x\n", d); + break; + case 0xf2: + // bit 0 = 1 active FM Pac ymflag = d; //printf("write FM Check = %02x\n", d); - } - break; + break; + } } } else{