void nide_set_selected() { for (int i=0;i<4;i++) { if (i==settings.mode) emu.SetMenuItemStyle(mids[i],MIS_Checked,MIS_Checked); else emu.SetMenuItemStyle(mids[i],0,MIS_Checked); } }
void EXPORT_CALL handle_SA2(u32 id,void* w,void* p) { if (settings.LimitFPS==2) settings.LimitFPS=0; else settings.LimitFPS=2; eminf.SetMenuItemStyle(config_stami,settings.LimitFPS==1?MIS_Checked:0,MIS_Checked); eminf.SetMenuItemStyle(config_stami2,settings.LimitFPS==2?MIS_Checked:0,MIS_Checked); SaveSettings(); }
//called when plugin is unloaded by emu , olny if dcInit is called (eg , not called to enumerate plugins) void FASTCALL Term() { TermAudio(); AICA_Term(); term_mem(); eminf.SetMenuItemStyle(config_scmi,0,MIS_Grayed); }
void EXPORT_CALL handle_GS(u32 id,void* w,void* p) { if (settings.GlobalMute) settings.GlobalMute=0; else settings.GlobalMute=1; eminf.SetMenuItemStyle(id,settings.GlobalMute?MIS_Checked:0,MIS_Checked); SaveSettings(); }
void EXPORT_CALL handle_DSP(u32 id,void* w,void* p) { if (settings.DSPEnabled) settings.DSPEnabled=0; else settings.DSPEnabled=1; eminf.SetMenuItemStyle(id,settings.DSPEnabled?MIS_Checked:0,MIS_Checked); SaveSettings(); }
//called when plugin is used by emu (you should do first time init here) s32 FASTCALL Init(aica_init_params* initp) { memcpy(&aica_params,initp,sizeof(aica_params)); init_mem(); AICA_Init(); InitAudio(); eminf.SetMenuItemStyle(config_scmi,MIS_Grayed,MIS_Grayed); return rv_ok; }
void EXPORT_CALL handle_UseDefImg(u32 id,void* w,void* p) { if (irsettings.LoadDefaultImage) irsettings.LoadDefaultImage=0; else irsettings.LoadDefaultImage=1; emu.SetMenuItemStyle(id,irsettings.LoadDefaultImage?MIS_Checked:0,MIS_Checked); irSaveSettings(); }
void EXPORT_CALL handle_PatchRegion(u32 id,void* w,void* p) { if (irsettings.PatchRegion) irsettings.PatchRegion=0; else irsettings.PatchRegion=1; emu.SetMenuItemStyle(id,irsettings.PatchRegion?MIS_Checked:0,MIS_Checked); irSaveSettings(); }
s32 FASTCALL OnLoad(emu_info* em) { memcpy(&eminf,em,sizeof(eminf)); LoadSettings(); config_scmi=eminf.AddMenuItem(em->RootMenu,-1,L"Config",handle_Config,0); config_stami=eminf.AddMenuItem(em->RootMenu,-1,L"Limit Speed && Sync audio",handle_SA,settings.LimitFPS==1); config_stami2=eminf.AddMenuItem(em->RootMenu,-1,L"Sync Audio",handle_SA2,settings.LimitFPS==2); eminf.AddMenuItem(em->RootMenu,-1,L"DSP Emulation",handle_DSP,settings.DSPEnabled); eminf.AddMenuItem(em->RootMenu,-1,L"Mute CDDA",handle_MCDDA,settings.CDDAMute); eminf.AddMenuItem(em->RootMenu,-1,L"Mute Sound",handle_GS,settings.GlobalMute); eminf.AddMenuItem(em->RootMenu,-1,0,0,0); eminf.AddMenuItem(em->RootMenu,-1,L"About",handle_About,0); eminf.AddMenuItem(em->DebugMenu,-1,L"AICA SGC Debugger",handle_ShowASD,0); return rv_ok; }
//called when plugin is used by emu (you should do first time init here) s32 FASTCALL irLoad(emu_info* emu_inf) { if (emu_inf==0) return rv_ok; memcpy(&emu,emu_inf,sizeof(emu)); emu.ConfigLoadStr("emu","shortname",iremu_name,0); irLoadSettings(); emu.AddMenuItem(emu.RootMenu,-1,"Swap Disc",handle_SwitchDisc,irsettings.LoadDefaultImage); emu.AddMenuItem(emu.RootMenu,-1,0,0,0); emu.AddMenuItem(emu.RootMenu,-1,"Use Default Image",handle_UseDefImg,irsettings.LoadDefaultImage); emu.AddMenuItem(emu.RootMenu,-1,"Select Default Image",handle_SelDefImg,0); emu.AddMenuItem(emu.RootMenu,-1,"Patch GDROM region",handle_PatchRegion,irsettings.PatchRegion); emu.AddMenuItem(emu.RootMenu,-1,0,0,0); emu.AddMenuItem(emu.RootMenu,-1,"About",irhandle_About,0); return rv_ok; }
//called when plugin is used by emu (you should do first time init here) s32 FASTCALL Load(emu_info* param) { memcpy(&emu,param,sizeof(emu)); LoadSettings(); mids[0]=emu.AddMenuItem(emu.RootMenu,-1,L"None",handle_mode<0>,0); mids[1]=emu.AddMenuItem(emu.RootMenu,-1,L"Modem",handle_mode<1>,0); mids[2]=emu.AddMenuItem(emu.RootMenu,-1,L"Lan Adapter",handle_mode<2>,0); mids[3]=emu.AddMenuItem(emu.RootMenu,-1,L"BBA",handle_mode<3>,0); nide_set_selected(); emu.AddMenuItem(emu.RootMenu,-1,0,0,settings.mode==0); emu.AddMenuItem(emu.RootMenu,-1,L"About",handle_about,0); return rv_ok; }
void cfgSetInt(char* key,int def) { wchar t[512]; mbstowcs(t,key,512); eminf.ConfigSaveInt(L"nullAica",t,def); }
int cfgGetInt(char* key,int def) { wchar t[512]; mbstowcs(t,key,512); return eminf.ConfigLoadInt(L"nullAica",t,def); }
void SaveSettings() { emu.ConfigSaveInt(L"nullExtDev",L"mode",settings.mode); emu.ConfigSaveInt(L"nullExtDev",L"adapter",settings.adapter); }
void LoadSettings() { settings.mode=max(0,min(emu.ConfigLoadInt(L"nullExtDev",L"mode",0),3)); settings.adapter=emu.ConfigLoadInt(L"nullExtDev",L"adapter",0); }