X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=pico%2Fsms.c;h=ac81c2b20a4d40a5b1285611ceb98b4c52174f14;hb=fda2f31020bf0d6cf7b5dd70ec01cf390b7e1483;hp=748c3265423ac74331b8931432ee650569ccac51;hpb=93f9619ed819dee07948416c98ca2f1c70a22666;p=picodrive.git diff --git a/pico/sms.c b/pico/sms.c index 748c326..ac81c2b 100644 --- a/pico/sms.c +++ b/pico/sms.c @@ -8,10 +8,8 @@ /* * TODO: * - start in a state as if BIOS ran - * - remaining status flags (OVR/COL) * - RAM support in mapper * - region support - * - SN76496 DAC-like usage * - H counter */ #include "pico_int.h" @@ -133,8 +131,9 @@ static void z80_sms_out(unsigned short a, unsigned char d) case 0x40: case 0x41: - if (PicoIn.opt & POPT_EN_PSG) - SN76496Write(d); + if ((d & 0x90) == 0x90 && Pico.snd.psg_line < Pico.m.scanline) + PsndDoPSG(Pico.m.scanline); + SN76496Write(d); break; case 0x80: @@ -300,12 +299,16 @@ void PicoFrameMS(void) } } + // 224 because of how it's done for MD... + if (y == 224 && PicoIn.sndOut) + PsndGetSamplesMS(); + cycles_aim += cycles_line; cycles_done += z80_run((cycles_aim - cycles_done) >> 8) << 8; } - if (PsndOut) - PsndGetSamplesMS(); + if (PicoIn.sndOut && Pico.snd.psg_line < lines) + PsndDoPSG(lines - 1); } void PicoFrameDrawOnlyMS(void) @@ -319,3 +322,4 @@ void PicoFrameDrawOnlyMS(void) PicoLineMode4(y); } +// vim:ts=2:sw=2:expandtab