psx: fix multitap flaking out after reboot

This commit is contained in:
zeromus 2017-05-20 16:07:05 -05:00
parent 05bf7e46d4
commit adff0d707c
2 changed files with 11 additions and 1 deletions

Binary file not shown.

View File

@ -60,6 +60,15 @@ static bool PrevInterlaced;
static Deinterlacer deint;
static EmulateSpecStruct espec;
template<typename T> inline void reconstruct(T* t) {
t->~T();
new(t) T();
}
template<typename T, typename A> inline void reconstruct(T* t, A a) {
t->~T();
new(t) T(a);
}
namespace MDFN_IEN_PSX
{
@ -1082,11 +1091,12 @@ struct {
void Initialize()
{
for(int i=0;i<2;i++)
for(int i=0;i<10;i++)
{
ports[i].type = ePeripheralType_None;
memset(ports[i].buffer,0,sizeof(ports[i].buffer));
}
reconstruct(FIO);
}
//TODO: "Take care to call ->Power() only if the device actually changed."