debug bgm player, sound code refactoring

git-svn-id: file:///home/notaz/opt/svn/PicoDrive/platform@598 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
notaz 2008-10-16 13:32:55 +00:00
parent 095a240bd9
commit 725d7f6c16
5 changed files with 79 additions and 31 deletions

View file

@ -69,7 +69,6 @@ void emu_textOut16(int x, int y, const char *text);
char *emu_makeRomId(void);
void emu_getGameName(char *str150);
void emu_findKeyBindCombos(void);
void emu_forcedFrame(int opts);
void emu_changeFastForward(int set_on);
void emu_RunEventsPico(unsigned int events);
void emu_DoTurbo(int *pad, int acts);
@ -77,9 +76,14 @@ void emu_packConfig(void);
void emu_unpackConfig(void);
void emu_shutdownMCD(void);
/* not in common */
extern const char * const keyNames[];
void emu_prepareDefaultConfig(void);
void emu_platformDebugCat(char *str);
void emu_forcedFrame(int opts);
void emu_startSound(void);
void emu_endSound(void);
void emu_waitSound(void);
#ifdef __cplusplus
} // extern "C"

View file

@ -343,6 +343,20 @@ int me_process(menu_entry *entries, int count, menu_id id, int is_next)
void SekStepM68k(void);
static void mplayer_loop(void)
{
emu_startSound();
while (1)
{
PDebugZ80Frame();
if (read_buttons_async(BTN_NORTH)) break;
emu_waitSound();
}
emu_endSound();
}
static void draw_text_debug(const char *str, int skip, int from)
{
const char *p;
@ -415,7 +429,7 @@ void debug_menu_loop(void)
}
menu_draw_end();
inp = read_buttons(BTN_EAST|BTN_SOUTH|BTN_WEST|BTN_L|BTN_R|BTN_UP|BTN_DOWN|BTN_LEFT|BTN_RIGHT);
inp = read_buttons(BTN_EAST|BTN_SOUTH|BTN_WEST|BTN_NORTH|BTN_L|BTN_R|BTN_UP|BTN_DOWN|BTN_LEFT|BTN_RIGHT);
if (inp & BTN_SOUTH) return;
if (inp & BTN_L) { mode--; if (mode < 0) mode = 3; }
if (inp & BTN_R) { mode++; if (mode > 3) mode = 0; }
@ -423,6 +437,10 @@ void debug_menu_loop(void)
{
case 0:
if (inp & BTN_EAST) SekStepM68k();
if (inp & BTN_NORTH) {
while (inp & BTN_NORTH) inp = read_buttons_async(BTN_NORTH);
mplayer_loop();
}
if ((inp & (BTN_WEST|BTN_LEFT)) == (BTN_WEST|BTN_LEFT)) {
mkdir("dumps", 0777);
PDebugDumpMem();