static UINT8 getspbVRch(HWND hWnd) { UINT8 ret; ret = 0; if (GetDlgItemCheck(hWnd, IDC_SPBVRL)) { ret += 1; } if (GetDlgItemCheck(hWnd, IDC_SPBVRR)) { ret += 2; } return(ret); }
static LRESULT CALLBACK Scropt2DlgProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp) { UINT8 b; UINT update; switch(msg) { case WM_INITDIALOG: if (!np2cfg.uPD72020) { SetDlgItemCheck(hWnd, IDC_GDC7220, TRUE); } else { SetDlgItemCheck(hWnd, IDC_GDC72020, TRUE); } SetDlgItemCheck(hWnd, gdcchip[np2cfg.grcg & 3], TRUE); SetDlgItemCheck(hWnd, IDC_PC980124, np2cfg.color16); return(TRUE); case WM_NOTIFY: if ((((NMHDR *)lp)->code) == (UINT)PSN_APPLY) { update = 0; b = GetDlgItemCheck(hWnd, IDC_GDC72020); if (np2cfg.uPD72020 != b) { np2cfg.uPD72020 = b; update |= SYS_UPDATECFG; gdc_restorekacmode(); gdcs.grphdisp |= GDCSCRN_ALLDRAW2; } for (b=0; (b<3) && (!GetDlgItemCheck(hWnd, gdcchip[b])); b++); if (np2cfg.grcg != b) { np2cfg.grcg = b; update |= SYS_UPDATECFG; gdcs.grphdisp |= GDCSCRN_ALLDRAW2; } b = GetDlgItemCheck(hWnd, IDC_PC980124); if (np2cfg.color16 != b) { np2cfg.color16 = b; update |= SYS_UPDATECFG; } sysmng_update(update); return(TRUE); } break; } return(FALSE); }
static void editdata_get_type(EDITDATA *ed, HWND hWnd) { WORD i; for(i = 0; i < NELEMENTS(edit_types); i++) { if(GetDlgItemCheck(hWnd, edit_types[i])) { ed->type = edit_types[i]; ed->codepage = edit_codepages[i]; } } }
static UINT8 checkbtnres_store(HWND hWnd, const CHECKTBL *item) { UINT8 value; UINT8 bit; UINT8 ret; bit = 1 << (item->bit); value = GetDlgItemCheck(hWnd, item->res)?bit:0; ret = ((*(item->ptr)) ^ value) & bit; if (ret) { (*(item->ptr)) ^= bit; } return(ret); }
static void mpuupdate(HWND hWnd) { union { OEMCHAR mmap[MAXPNAMELEN]; OEMCHAR mmdl[64]; OEMCHAR mdef[MAX_PATH]; OEMCHAR mdin[MAXPNAMELEN]; } s; UINT update; update = 0; if (np2cfg.mpuopt != mpu) { np2cfg.mpuopt = mpu; update |= SYS_UPDATECFG | SYS_UPDATEMIDI; } GetDlgItemText(hWnd, IDC_MPU98MMAP, s.mmap, NELEMENTS(s.mmap)); if (milstr_cmp(np2oscfg.mpu.mout, s.mmap)) { milstr_ncpy(np2oscfg.mpu.mout, s.mmap, NELEMENTS(np2oscfg.mpu.mout)); update |= SYS_UPDATEOSCFG | SYS_UPDATEMIDI; } GetDlgItemText(hWnd, IDC_MPU98MDIN, s.mdin, NELEMENTS(s.mdin)); if (milstr_cmp(np2oscfg.mpu.min, s.mdin)) { milstr_ncpy(np2oscfg.mpu.min, s.mdin, NELEMENTS(np2oscfg.mpu.min)); update |= SYS_UPDATEOSCFG | SYS_UPDATEMIDI; } GetDlgItemText(hWnd, IDC_MPU98MMDL, s.mmdl, NELEMENTS(s.mmdl)); if (milstr_cmp(np2oscfg.mpu.mdl, s.mmdl)) { milstr_ncpy(np2oscfg.mpu.mdl, s.mmdl, NELEMENTS(np2oscfg.mpu.mdl)); update |= SYS_UPDATEOSCFG | SYS_UPDATEMIDI; } np2oscfg.mpu.def_en = GetDlgItemCheck(hWnd, IDC_MPU98DEFE); if (cm_mpu98) { cm_mpu98->msg(cm_mpu98, COMMSG_MIMPIDEFEN, np2oscfg.mpu.def_en); } GetDlgItemText(hWnd, IDC_MPU98DEFF, s.mdef, NELEMENTS(s.mdef)); if (milstr_cmp(np2oscfg.mpu.def, s.mdef)) { milstr_ncpy(np2oscfg.mpu.def, s.mdef, NELEMENTS(np2oscfg.mpu.def)); if (cm_mpu98) { cm_mpu98->msg(cm_mpu98, COMMSG_MIMPIDEFFILE, (long)s.mdef); } update |= SYS_UPDATEOSCFG; } sysmng_update(update); }
static LRESULT CALLBACK SPBoptDlgProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp) { UINT8 b; UINT update; switch(msg) { case WM_INITDIALOG: spbcreate(hWnd); return(TRUE); case WM_COMMAND: switch(LOWORD(wp)) { case IDC_SPBIO: setspbjmp(hWnd, getsnd26io(hWnd, IDC_SPBIO), 0x10); break; case IDC_SPBINT: setspbjmp(hWnd, getsnd26int(hWnd, IDC_SPBINT), 0xc0); break; case IDC_SPBROM: setspbjmp(hWnd, getsnd26rom(hWnd, IDC_SPBROM), 0x07); break; case IDC_SPBDEF: spb = 0xd1; setsnd26io(hWnd, IDC_SPBIO, spb); setsnd26int(hWnd, IDC_SPBINT, spb); setsnd26rom(hWnd, IDC_SPBROM, spb); spbvrc = 0; setspbVRch(hWnd); InvalidateRect(GetDlgItem(hWnd, IDC_SPBJMP), NULL, TRUE); break; case IDC_SPBVRL: case IDC_SPBVRR: b = getspbVRch(hWnd); if ((spbvrc ^ b) & 3) { spbvrc = b; InvalidateRect(GetDlgItem(hWnd, IDC_SPBJMP), NULL, TRUE); } break; case IDC_SPBJMP: spbcmdjmp(hWnd); break; } break; case WM_NOTIFY: if ((((NMHDR *)lp)->code) == (UINT)PSN_APPLY) { update = 0; if (np2cfg.spbopt != spb) { np2cfg.spbopt = spb; update |= SYS_UPDATECFG; } if (np2cfg.spb_vrc != spbvrc) { np2cfg.spb_vrc = spbvrc; update |= SYS_UPDATECFG; } b = (UINT8)SendDlgItemMessage(hWnd, IDC_SPBVRLEVEL, TBM_GETPOS, 0, 0); if (np2cfg.spb_vrl != b) { np2cfg.spb_vrl = b; update |= SYS_UPDATECFG; } opngen_setVR(np2cfg.spb_vrc, np2cfg.spb_vrl); b = (UINT8)GetDlgItemCheck(hWnd, IDC_SPBREVERSE); if (np2cfg.spb_x != b) { np2cfg.spb_x = b; update |= SYS_UPDATECFG; } sysmng_update(update); return(TRUE); } break; case WM_DRAWITEM: if (LOWORD(wp) == IDC_SPBJMP) { dlgs_drawbmp(((LPDRAWITEMSTRUCT)lp)->hDC, dipswbmp_getsndspb(spb, spbvrc)); } return(FALSE); } return(FALSE); }
static LRESULT CALLBACK Snd86optDlgProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp) { HWND sub; switch(msg) { case WM_INITDIALOG: snd86 = np2cfg.snd86opt; dlgs_setcbitem(hWnd, IDC_SND86IO, cpIO86, NELEMENTS(cpIO86)); setsnd86io(hWnd, IDC_SND86IO, snd86); SetDlgItemCheck(hWnd, IDC_SND86INT, snd86 & 0x10); dlgs_setcbitem(hWnd, IDC_SND86INTA, cpInt86, NELEMENTS(cpInt86)); setsnd86int(hWnd, IDC_SND86INTA, snd86); dlgs_setcbitem(hWnd, IDC_SND86ID, cpID, NELEMENTS(cpID)); setsnd86id(hWnd, IDC_SND86ID, snd86); SetDlgItemCheck(hWnd, IDC_SND86ROM, snd86 & 2); sub = GetDlgItem(hWnd, IDC_SND86DIP); SetWindowLong(sub, GWL_STYLE, SS_OWNERDRAW + (GetWindowLong(sub, GWL_STYLE) & (~SS_TYPEMASK))); return(TRUE); case WM_COMMAND: switch(LOWORD(wp)) { case IDC_SND86IO: set86jmp(hWnd, getsnd86io(hWnd, IDC_SND86IO), 0x01); break; case IDC_SND86INT: set86jmp(hWnd, (GetDlgItemCheck(hWnd, IDC_SND86INT))?0x10:0x00, 0x10); break; case IDC_SND86INTA: set86jmp(hWnd, getsnd86int(hWnd, IDC_SND86INTA), 0x0c); break; case IDC_SND86ROM: set86jmp(hWnd, (GetDlgItemCheck(hWnd, IDC_SND86ROM))?0x02:0x00, 0x02); break; case IDC_SND86ID: set86jmp(hWnd, getsnd86id(hWnd, IDC_SND86ID), 0xe0); break; case IDC_SND86DEF: snd86 = 0x7f; setsnd86io(hWnd, IDC_SND86IO, snd86); SetDlgItemCheck(hWnd, IDC_SND86INT, TRUE); setsnd86int(hWnd, IDC_SND86INTA, snd86); setsnd86id(hWnd, IDC_SND86ID, snd86); SetDlgItemCheck(hWnd, IDC_SND86ROM, TRUE); InvalidateRect(GetDlgItem(hWnd, IDC_SND86DIP), NULL, TRUE); break; case IDC_SND86DIP: snd86cmddipsw(hWnd); break; } break; case WM_NOTIFY: if ((((NMHDR *)lp)->code) == (UINT)PSN_APPLY) { if (np2cfg.snd86opt != snd86) { np2cfg.snd86opt = snd86; sysmng_update(SYS_UPDATECFG); } return(TRUE); } break; case WM_DRAWITEM: if (LOWORD(wp) == IDC_SND86DIP) { dlgs_drawbmp(((LPDRAWITEMSTRUCT)lp)->hDC, dipswbmp_getsnd86(snd86)); } return(FALSE); } return(FALSE); }
LRESULT CALLBACK ClndDialogProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp) { TCHAR work[32]; UINT8 b; int i; HWND subwnd; switch (msg) { case WM_INITDIALOG: // 時間をセット。 calendar_getvir(cbuf); set_cal2dlg(hWnd, cbuf); if (np2cfg.calendar) { vircalendar(hWnd, FALSE); subwnd = GetDlgItem(hWnd, IDC_CLNDREAL); } else { vircalendar(hWnd, TRUE); subwnd = GetDlgItem(hWnd, IDC_CLNDVIR); } SendMessage(subwnd, BM_SETCHECK, TRUE, 0); SetFocus(subwnd); return(FALSE); case WM_COMMAND: switch(LOWORD(wp)) { case IDOK: b = (UINT8)GetDlgItemCheck(hWnd, IDC_CLNDREAL); if (np2cfg.calendar != b) { np2cfg.calendar = b; sysmng_update(SYS_UPDATECFG); } for (i=0; i<6; i++) { GetDlgItemText(hWnd, vircal[i].res, work, NELEMENTS(work)); b = getbcd(work, 2); if ((b >= vircal[i].min) && (b <= vircal[i].max)) { if (i == 1) { b = ((b & 0x10) * 10) + (b << 4); } cbuf[i] = b; } } calendar_set(cbuf); EndDialog(hWnd, IDOK); break; case IDCANCEL: EndDialog(hWnd, IDCANCEL); break; case IDC_CLNDVIR: vircalendar(hWnd, TRUE); return(FALSE); case IDC_CLNDREAL: vircalendar(hWnd, FALSE); return(FALSE); case IDC_SETNOW: calendar_getreal(cbuf); set_cal2dlg(hWnd, cbuf); return(FALSE); default: return(FALSE); } break; case WM_CLOSE: PostMessage(hWnd, WM_COMMAND, IDCANCEL, 0); break; default: return(FALSE); } return(TRUE); }
static void cfgupdate(HWND hWnd) { UINT update; TCHAR work[32]; UINT val; const OEMCHAR *str; update = 0; val = dlgs_getcbcur(hWnd, IDC_BASECLOCK, PCBASECLOCK20); if (np2cfg.baseclock != val) { np2cfg.baseclock = val; update |= SYS_UPDATECFG | SYS_UPDATECLOCK; } GetDlgItemText(hWnd, IDC_MULTIPLE, work, sizeof(work)); val = (UINT)miltchar_solveINT(work); if (val < 1) { val = 1; } else if (val > 32) { val = 32; } if (np2cfg.multiple != val) { np2cfg.multiple = val; update |= SYS_UPDATECFG | SYS_UPDATECLOCK; } if (GetDlgItemCheck(hWnd, IDC_MODELVM)) { str = str_VM; } else if (GetDlgItemCheck(hWnd, IDC_MODELEPSON)) { str = str_EPSON; } else { str = str_VX; } if (milstr_cmp(np2cfg.model, str)) { milstr_ncpy(np2cfg.model, str, NELEMENTS(np2cfg.model)); update |= SYS_UPDATECFG; } if (GetDlgItemCheck(hWnd, IDC_RATE11)) { val = 11025; } else if (GetDlgItemCheck(hWnd, IDC_RATE22)) { val = 22050; } else { val = 44100; } if (np2cfg.samplingrate != (UINT16)val) { np2cfg.samplingrate = (UINT16)val; update |= SYS_UPDATECFG | SYS_UPDATERATE; soundrenewal = 1; } GetDlgItemText(hWnd, IDC_SOUNDBUF, work, NELEMENTS(work)); val = (UINT)miltchar_solveINT(work); if (val < 40) { val = 40; } else if (val > 1000) { val = 1000; } if (np2cfg.delayms != (UINT16)val) { np2cfg.delayms = (UINT16)val; update |= SYS_UPDATECFG | SYS_UPDATESBUF; soundrenewal = 1; } val = GetDlgItemCheck(hWnd, IDC_ALLOWRESIZE); if (np2oscfg.thickframe != (UINT8)val) { np2oscfg.thickframe = (UINT8)val; update |= SYS_UPDATEOSCFG; } #if !defined(_WIN64) if (!(mmxflag & MMXFLAG_NOTSUPPORT)) { val = GetDlgItemCheck(hWnd, IDC_DISABLEMMX); if (np2oscfg.disablemmx != (UINT8)val) { np2oscfg.disablemmx = (UINT8)val; mmxflag &= ~MMXFLAG_DISABLE; mmxflag |= (val)?MMXFLAG_DISABLE:0; update |= SYS_UPDATEOSCFG; } } #endif val = GetDlgItemCheck(hWnd, IDC_COMFIRM); if (np2oscfg.comfirm != (UINT8)val) { np2oscfg.comfirm = (UINT8)val; update |= SYS_UPDATEOSCFG; } val = GetDlgItemCheck(hWnd, IDC_RESUME); if (np2oscfg.resume != (UINT8)val) { np2oscfg.resume = (UINT8)val; update |= SYS_UPDATEOSCFG; } sysmng_update(update); }
static LRESULT CALLBACK Scropt1DlgProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp) { TCHAR work[32]; UINT16 ret; UINT8 b; int renewal; switch(msg) { case WM_INITDIALOG: SetDlgItemCheck(hWnd, IDC_LCD, np2cfg.LCD_MODE & 1); EnableWindow(GetDlgItem(hWnd, IDC_LCDX), np2cfg.LCD_MODE & 1); SetDlgItemCheck(hWnd, IDC_LCDX, np2cfg.LCD_MODE & 2); SetDlgItemCheck(hWnd, IDC_SKIPLINE, np2cfg.skipline); SendDlgItemMessage(hWnd, IDC_SKIPLIGHT, TBM_SETRANGE, TRUE, MAKELONG(0, 255)); SendDlgItemMessage(hWnd, IDC_SKIPLIGHT, TBM_SETPOS, TRUE, np2cfg.skiplight); wsprintf(work, str_d, np2cfg.skiplight); SetDlgItemText(hWnd, IDC_LIGHTSTR, work); return(TRUE); case WM_COMMAND: switch(LOWORD(wp)) { case IDC_LCD: EnableWindow(GetDlgItem(hWnd, IDC_LCDX), GetDlgItemCheck(hWnd, IDC_LCD)); break; } break; case WM_HSCROLL: switch(GetDlgCtrlID((HWND)lp)) { case IDC_SKIPLIGHT: ret = (UINT16)SendDlgItemMessage(hWnd, IDC_SKIPLIGHT, TBM_GETPOS, 0, 0); wsprintf(work, str_d, ret); SetDlgItemText(hWnd, IDC_LIGHTSTR, work); break; } break; case WM_NOTIFY: if ((((NMHDR *)lp)->code) == (UINT)PSN_APPLY) { renewal = 0; b = GetDlgItemCheck(hWnd, IDC_SKIPLINE); if (np2cfg.skipline != b) { np2cfg.skipline = b; renewal = 1; } ret = (UINT16)SendDlgItemMessage(hWnd, IDC_SKIPLIGHT, TBM_GETPOS, 0, 0); if (ret > 255) { ret = 255; } if (np2cfg.skiplight != ret) { np2cfg.skiplight = ret; renewal = 1; } if (renewal) { pal_makeskiptable(); } b = GetDlgItemCheck(hWnd, IDC_LCD) | (GetDlgItemCheck(hWnd, IDC_LCDX) << 1); if (np2cfg.LCD_MODE != b) { np2cfg.LCD_MODE = b; pal_makelcdpal(); renewal = 1; } if (renewal) { scrndraw_redraw(); sysmng_update(SYS_UPDATECFG); } return(TRUE); } break; } return(FALSE); }
static void cfgupdate(HWND hWnd) { UINT update; TCHAR work[32]; UINT val; const TCHAR *str; update = 0; GetDlgItemText(hWnd, IDC_BASECLOCK, work, NELEMENTS(work)); if (work[0] == '1') { val = PCBASECLOCK20; } else { val = PCBASECLOCK25; } if (np2cfg.baseclock != val) { np2cfg.baseclock = val; update |= SYS_UPDATECFG | SYS_UPDATECLOCK; } GetDlgItemText(hWnd, IDC_MULTIPLE, work, NELEMENTS(work)); val = (UINT)milstr_solveINT(work); if (val < 1) { val = 1; } else if (val > 32) { val = 32; } if (np2cfg.multiple != val) { np2cfg.multiple = val; update |= SYS_UPDATECFG | SYS_UPDATECLOCK; } if (GetDlgItemCheck(hWnd, IDC_MODELVM)) { str = str_VM; } else if (GetDlgItemCheck(hWnd, IDC_MODELEPSON)) { str = str_EPSON; } else { str = str_VX; } if (milstr_cmp(np2cfg.model, str)) { milstr_ncpy(np2cfg.model, str, NELEMENTS(np2cfg.model)); update |= SYS_UPDATECFG; } if (GetDlgItemCheck(hWnd, IDC_RATE11)) { val = 11025; } else if (GetDlgItemCheck(hWnd, IDC_RATE22)) { val = 22050; } else { val = 44100; } if (np2cfg.samplingrate != (UINT16)val) { np2cfg.samplingrate = (UINT16)val; update |= SYS_UPDATECFG | SYS_UPDATERATE; soundrenewal = 1; } GetDlgItemText(hWnd, IDC_SOUNDBUF, work, NELEMENTS(work)); val = (UINT)milstr_solveINT(work); if (val < 40) { val = 40; } else if (val > 1000) { val = 1000; } if (np2cfg.delayms != (UINT16)val) { np2cfg.delayms = (UINT16)val; update |= SYS_UPDATECFG | SYS_UPDATESBUF; soundrenewal = 1; } sysmng_update(update); }