X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=Pico%2FPico.c;h=6d9d525e171bd6dfb4a3908e28c565166e85a4a8;hb=689fb2c0898deb6f87006dc5755516eb0ff6e647;hp=bc764b6b89c7aeb00105eabcb10c21d5b3ad9010;hpb=8022f53da61b8e70420a3bac97250119bbe26457;p=picodrive.git diff --git a/Pico/Pico.c b/Pico/Pico.c index bc764b6..6d9d525 100644 --- a/Pico/Pico.c +++ b/Pico/Pico.c @@ -17,7 +17,9 @@ int PicoSkipFrame=0; // skip rendering frame? int PicoRegionOverride = 0; // override the region detection 0: Auto, 1: Japan NTSC, 2: Japan PAL, 4: US, 8: Europe int PicoAutoRgnOrder = 0; int emustatus = 0; // rapid_ym2612, multi_ym_updates -void (*PicoWriteSound)(int len) = 0; // called once per frame at the best time to send sound buffer (PsndOut) to hardware +void (*PicoWriteSound)(int len) = NULL; // called at the best time to send sound buffer (PsndOut) to hardware +void (*PicoResetHook)(void) = NULL; +void (*PicoLineHook)(void) = NULL; struct PicoSRAM SRam = {0,}; int z80startCycle, z80stopCycle; // in 68k cycles @@ -139,6 +141,8 @@ int PicoReset(int hard) PsndReset(); // pal must be known here + if (PicoResetHook) PicoResetHook(); + if (PicoMCD & 1) { PicoResetMCD(hard); return 0; @@ -297,10 +301,10 @@ static void PicoRunZ80Simple(int line_from, int line_to) if ((line == 224 || line == line_sample) && PsndOut) getSamples(line); if (line == 32 && PsndOut) emustatus &= ~1; if (line >= line_from_r && line < line_to_r) - z80_run(228); + z80_run_nr(228); } } else if (line_to_r-line_from_r > 0) { - z80_run(228*(line_to_r-line_from_r)); + z80_run_nr(228*(line_to_r-line_from_r)); // samples will be taken by caller } }