static void Emulate(EmulateSpecStruct* espec) { SOUND_Set68KActive(true); SOUND_SetClockRatio(0x80000000); SOUND_StartFrame(espec->SoundRate / espec->soundmultiplier, MDFN_GetSettingUI("ssfplay.resamp_quality")); espec->soundmultiplier = 1; SOUND_Update(588 * 512); espec->MasterCycles = 588 * 256; espec->SoundBufSize = SOUND_FlushOutput(espec->SoundBuf, espec->SoundBufMaxSize, espec->NeedSoundReverse); espec->NeedSoundReverse = false; SOUND_ResetTS(); if(!espec->skip) { espec->LineWidths[0] = ~0; Player_Draw(espec->surface, &espec->DisplayRect, 0, espec->SoundBuf, espec->SoundBufSize); } }
void HES_Draw(MDFN_Surface *surface, MDFN_Rect *DisplayRect, int16 *SoundBuf, int32 SoundBufSize) { extern uint16 pce_jp_data[5]; static uint8 last = 0; bool needreload = 0; uint8 newset = (pce_jp_data[0] ^ last) & pce_jp_data[0]; if(newset & 0x20) { CurrentSong++; needreload = 1; } if(newset & 0x80) { CurrentSong--; needreload = 1; } if(newset & 0x08) needreload = 1; if(newset & 0x10) { CurrentSong += 10; needreload = 1; } if(newset & 0x40) { CurrentSong -= 10; needreload = 1; } last = pce_jp_data[0]; if(needreload) PCE_Power(); Player_Draw(surface, DisplayRect, CurrentSong, SoundBuf, SoundBufSize); }
void HES_Update(EmulateSpecStruct *espec, uint16 jp_data) { static uint8 last = 0; bool needreload = 0; if((jp_data & 0x20) && !(last & 0x20)) { CurrentSong++; needreload = 1; } if((jp_data & 0x80) && !(last & 0x80)) { CurrentSong--; needreload = 1; } if((jp_data & 0x8) && !(last & 0x8)) needreload = 1; if((jp_data & 0x10) && !(last & 0x10)) { CurrentSong += 10; needreload = 1; } if((jp_data & 0x40) && !(last & 0x40)) { CurrentSong -= 10; needreload = 1; } last = jp_data; if(needreload) PCE_Power(); if(!espec->skip) Player_Draw(espec->surface, &espec->DisplayRect, CurrentSong, espec->SoundBuf, espec->SoundBufSize); }
static void Emulate(EmulateSpecStruct *espec) { espec->DisplayRect.x = 0; espec->DisplayRect.y = 0; espec->DisplayRect.w = 224; espec->DisplayRect.h = 144; if(espec->VideoFormatChanged) WSwan_SetPixelFormat(espec->surface->format); if(espec->SoundFormatChanged) WSwan_SetSoundRate(espec->SoundRate); uint16 butt_data = chee[0] | (chee[1] << 8); WSButtonStatus = butt_data; MDFNMP_ApplyPeriodicCheats(); while(!wsExecuteLine(espec->surface, espec->skip)) { } espec->SoundBufSize = WSwan_SoundFlush(espec->SoundBuf, espec->SoundBufMaxSize); espec->MasterCycles = v30mz_timestamp; v30mz_timestamp = 0; if(IsWSR) { bool needreload = FALSE; static uint16 last; Player_Draw(espec->surface, &espec->DisplayRect, WSRCurrentSong, espec->SoundBuf, espec->SoundBufSize); if((WSButtonStatus & 0x02) && !(last & 0x02)) { WSRCurrentSong++; needreload = 1; } if((WSButtonStatus & 0x08) && !(last & 0x08)) { WSRCurrentSong--; needreload = 1; } if((WSButtonStatus & 0x100) && !(last & 0x100)) needreload = 1; if((WSButtonStatus & 0x01) && !(last & 0x01)) { WSRCurrentSong += 10; needreload = 1; } if((WSButtonStatus & 0x04) && !(last & 0x04)) { WSRCurrentSong -= 10; needreload = 1; } last = WSButtonStatus; if(needreload) Reset(); } }