mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-05 15:27:46 -04:00
debug bgm player, sound code refactoring
git-svn-id: file:///home/notaz/opt/svn/PicoDrive@598 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
parent
40644bfedd
commit
7b3f44c6b6
12 changed files with 161 additions and 86 deletions
41
pico/debug.c
41
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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue