X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=pico%2Fdebug.c;h=4751cf4f176fdb0147edc67081a2fedc9afb5ad6;hb=07ceafdb04502be69d06c3b54437fd4e8b88dfbe;hp=ac687f011cd93fda2294aaf5450bc55c99958023;hpb=1cfc5cc4ce06642b9bc45ca3b9d32793718e9455;p=picodrive.git diff --git a/pico/debug.c b/pico/debug.c index ac687f0..4751cf4 100644 --- a/pico/debug.c +++ b/pico/debug.c @@ -2,6 +2,7 @@ // (c) Copyright 2008 notaz, All rights reserved. #include "pico_int.h" +#include "sound/ym2612.h" #include "debug.h" #define bit(r, x) ((r>>x)&1) @@ -301,3 +302,43 @@ void PDebugDumpMem(void) } } +void PDebugZ80Frame(void) +{ + int lines, line_sample; + + if (Pico.m.pal) { + lines = 312; + line_sample = 68; + } else { + lines = 262; + line_sample = 93; + } + + z80_resetCycles(); + emustatus &= ~1; + + if (Pico.m.z80Run && !Pico.m.z80_reset && (PicoOpt&POPT_EN_Z80)) + PicoSyncZ80(line_sample*488); + if (ym2612.dacen && PsndDacLine <= line_sample) + PsndDoDAC(line_sample); + if (PsndOut) + PsndGetSamples(line_sample); + + if (Pico.m.z80Run && !Pico.m.z80_reset && (PicoOpt&POPT_EN_Z80)) { + PicoSyncZ80(224*488); + z80_int(); + } + if (ym2612.dacen && PsndDacLine <= 224) + PsndDoDAC(224); + if (PsndOut) + PsndGetSamples(224); + + // sync z80 + if (Pico.m.z80Run && !Pico.m.z80_reset && (PicoOpt&POPT_EN_Z80)) + PicoSyncZ80(Pico.m.pal ? 151809 : 127671); // cycles adjusted for converter + if (PsndOut && ym2612.dacen && PsndDacLine <= lines-1) + PsndDoDAC(lines-1); + + timers_cycle(); +} +