| version 1.15, 2005/02/07 15:39:28 | version 1.20, 2007/01/08 07:52:01 | 
| Line 1 | Line 1 | 
 | #include        "compiler.h" | #include        "compiler.h" | 
 | #include        <windowsx.h> |  | 
 | #include        <commctrl.h> | #include        <commctrl.h> | 
 | #include        <prsht.h> | #include        <prsht.h> | 
 | #include        "strres.h" | #include        "strres.h" | 
 | #include        "resource.h" | #include        "resource.h" | 
 | #include        "np2.h" | #include        "np2.h" | 
 |  | #include        "oemtext.h" | 
 | #include        "dosio.h" | #include        "dosio.h" | 
 | #include        "joymng.h" | #include        "joymng.h" | 
 | #include        "sysmng.h" | #include        "sysmng.h" | 
| Line 20 | Line 20 | 
 | #include        "dipswbmp.h" | #include        "dipswbmp.h" | 
 |  |  | 
 |  |  | 
| static const char *sndioport[4] = {"0088", "0188", "0288", "0388"}; | static const TCHAR str_0088[] = _T("0088"); | 
| static const char *sndinterrupt[4] = {str_int0, str_int4, str_int5, str_int6}; | static const TCHAR str_0188[] = _T("0188"); | 
| static const char *sndromaddr[5] = {"C8000", "CC000", "D0000", "D4000", "N/C"}; | static const TCHAR str_0288[] = _T("0288"); | 
| static const char *sndid[8] = {"0x", "1x", "2x", "3x", "4x", "5x", "6x", "7x"}; | static const TCHAR str_0388[] = _T("0388"); | 
|  | static const TCHAR str_c8000[] = _T("C8000"); | 
|  | static const TCHAR str_cc000[] = _T("CC000"); | 
|  | static const TCHAR str_d0000[] = _T("D0000"); | 
|  | static const TCHAR str_d4000[] = _T("D4000"); | 
|  | static const TCHAR str_n0x[] = _T("0x"); | 
|  | static const TCHAR str_n1x[] = _T("1x"); | 
|  | static const TCHAR str_n2x[] = _T("2x"); | 
|  | static const TCHAR str_n3x[] = _T("3x"); | 
|  | static const TCHAR str_n4x[] = _T("4x"); | 
|  | static const TCHAR str_n5x[] = _T("5x"); | 
|  | static const TCHAR str_n6x[] = _T("6x"); | 
|  | static const TCHAR str_n7x[] = _T("7x"); | 
|  | static const TCHAR *sndioport[4] = | 
|  | {str_0088, str_0188, str_0288, str_0388}; | 
|  | static const TCHAR *sndinterrupt[4] = | 
|  | {str_int0, str_int4, str_int5, str_int6}; | 
|  | static const TCHAR *sndromaddr[5] = | 
|  | {str_c8000, str_cc000, str_d0000, str_d4000, str_nc}; | 
|  | static const TCHAR *sndid[8] = | 
|  | {str_n0x, str_n1x, str_n2x, str_n3x, | 
|  | str_n4x, str_n5x, str_n6x, str_n7x}; | 
 |  |  | 
| static const char str_sndopt[] = "Sound board option"; | static const TCHAR str_sndopt[] = _T("Sound board option"); | 
 |  |  | 
 |  |  | 
 | typedef struct { | typedef struct { | 
| Line 38  typedef struct { | Line 59  typedef struct { | 
 |  |  | 
 | static void slidersetvaluestr(HWND hWnd, const SLIDERTBL *item, UINT8 value) { | static void slidersetvaluestr(HWND hWnd, const SLIDERTBL *item, UINT8 value) { | 
 |  |  | 
| char    work[32]; | TCHAR   work[32]; | 
 |  |  | 
| wsprintf(work, str_d, value); | wsprintf(work, tchar_d, value); | 
 | SetDlgItemText(hWnd, item->resstr, work); | SetDlgItemText(hWnd, item->resstr, work); | 
 | } | } | 
 |  |  | 
 | static void slidersetvalue(HWND hWnd, const SLIDERTBL *item, UINT8 value) { | static void slidersetvalue(HWND hWnd, const SLIDERTBL *item, UINT8 value) { | 
 |  |  | 
| if (value > (UINT8)(item->max)) { | if (value > (UINT8)item->max) { | 
| value = (UINT8)(item->max); | value = (UINT8)item->max; | 
 | } | } | 
| else if (value < (UINT8)(item->min)) { | else if (value < (UINT8)item->min) { | 
| value = (UINT8)(item->min); | value = (UINT8)item->min; | 
 | } | } | 
 | SendDlgItemMessage(hWnd, item->res, TBM_SETPOS, TRUE, value); | SendDlgItemMessage(hWnd, item->res, TBM_SETPOS, TRUE, value); | 
 | slidersetvaluestr(hWnd, item, value); | slidersetvaluestr(hWnd, item, value); | 
| Line 68  static void sliderresetpos(HWND hWnd, co | Line 89  static void sliderresetpos(HWND hWnd, co | 
 | UINT8   value; | UINT8   value; | 
 |  |  | 
 | value = (UINT8)SendDlgItemMessage(hWnd, item->res, TBM_GETPOS, 0, 0); | value = (UINT8)SendDlgItemMessage(hWnd, item->res, TBM_GETPOS, 0, 0); | 
| if (value > (UINT8)(item->max)) { | if (value > (UINT8)item->max) { | 
| value = (UINT8)(item->max); | value = (UINT8)item->max; | 
 | } | } | 
| else if (value < (UINT8)(item->min)) { | else if (value < (UINT8)item->min) { | 
| value = (UINT8)(item->min); | value = (UINT8)item->min; | 
 | } | } | 
 | slidersetvaluestr(hWnd, item, value); | slidersetvaluestr(hWnd, item, value); | 
 | } | } | 
| Line 83  static UINT8 sliderrestore(HWND hWnd, co | Line 104  static UINT8 sliderrestore(HWND hWnd, co | 
 | UINT8   ret; | UINT8   ret; | 
 |  |  | 
 | value = (UINT8)SendDlgItemMessage(hWnd, item->res, TBM_GETPOS, 0, 0); | value = (UINT8)SendDlgItemMessage(hWnd, item->res, TBM_GETPOS, 0, 0); | 
| if (value > (UINT8)(item->max)) { | if (value > (UINT8)item->max) { | 
| value = (UINT8)(item->max); | value = (UINT8)item->max; | 
 | } | } | 
| else if (value < (UINT8)(item->min)) { | else if (value < (UINT8)item->min) { | 
| value = (UINT8)(item->min); | value = (UINT8)item->min; | 
 | } | } | 
 | ret = (*(item->value)) - value; | ret = (*(item->value)) - value; | 
 | if (ret) { | if (ret) { | 
| Line 221  static void setsnd26iopara(HWND hWnd, UI | Line 242  static void setsnd26iopara(HWND hWnd, UI | 
 |  |  | 
 | static UINT8 getsnd26io(HWND hWnd, UINT16 res) { | static UINT8 getsnd26io(HWND hWnd, UINT16 res) { | 
 |  |  | 
| char    work[8]; | TCHAR   work[8]; | 
 |  |  | 
| GetDlgItemText(hWnd, res, work, sizeof(work)); | GetDlgItemText(hWnd, res, work, NELEMENTS(work)); | 
 | return((UINT8)((work[1] == '1')?0x10:0x00)); | return((UINT8)((work[1] == '1')?0x10:0x00)); | 
 | } | } | 
 |  |  | 
| Line 235  static void setsnd26intpara(HWND hWnd, U | Line 256  static void setsnd26intpara(HWND hWnd, U | 
 |  |  | 
 | static UINT8 getsnd26int(HWND hWnd, UINT16 res) { | static UINT8 getsnd26int(HWND hWnd, UINT16 res) { | 
 |  |  | 
| char    work[8]; | TCHAR   work[8]; | 
 |  |  | 
| GetDlgItemText(hWnd, res, work, sizeof(work)); | GetDlgItemText(hWnd, res, work, NELEMENTS(work)); | 
 | switch(work[3]) { | switch(work[3]) { | 
 | case '0': | case '0': | 
 | return(0x00); | return(0x00); | 
| Line 264  static void setsnd26rompara(HWND hWnd, U | Line 285  static void setsnd26rompara(HWND hWnd, U | 
 |  |  | 
 | static UINT8 getsnd26rom(HWND hWnd, UINT16 res) { | static UINT8 getsnd26rom(HWND hWnd, UINT16 res) { | 
 |  |  | 
| char    work[8]; | TCHAR   work[8]; | 
 | UINT32  adrs; | UINT32  adrs; | 
 |  |  | 
| GetDlgItemText(hWnd, res, work, sizeof(work)); | GetDlgItemText(hWnd, res, work, NELEMENTS(work)); | 
| adrs = ((UINT32)milstr_solveHEX(work) - 0xc8000) >> 14; | adrs = ((UINT32)miltchar_solveHEX(work) - 0xc8000) >> 14; | 
 | if (adrs < 4) { | if (adrs < 4) { | 
 | return((UINT8)adrs); | return((UINT8)adrs); | 
 | } | } | 
| Line 436  static void setsnd86iopara(HWND hWnd, UI | Line 457  static void setsnd86iopara(HWND hWnd, UI | 
 |  |  | 
 | static UINT8 getsnd86io(HWND hWnd, UINT16 res) { | static UINT8 getsnd86io(HWND hWnd, UINT16 res) { | 
 |  |  | 
| char    work[8]; | TCHAR   work[8]; | 
 |  |  | 
| GetDlgItemText(hWnd, res, work, sizeof(work)); | GetDlgItemText(hWnd, res, work, NELEMENTS(work)); | 
 | return((UINT8)((work[1] == '1')?0x01:0x00)); | return((UINT8)((work[1] == '1')?0x01:0x00)); | 
 | } | } | 
 |  |  | 
| Line 450  static void setsnd86intpara(HWND hWnd, U | Line 471  static void setsnd86intpara(HWND hWnd, U | 
 |  |  | 
 | static UINT8 getsnd86int(HWND hWnd) { | static UINT8 getsnd86int(HWND hWnd) { | 
 |  |  | 
| char    work[8]; | TCHAR   work[8]; | 
 |  |  | 
| Edit_GetText(hWnd, work, sizeof(work)); | GetWindowText(hWnd, work, NELEMENTS(work)); | 
 | switch(work[3]) { | switch(work[3]) { | 
 | case '0': | case '0': | 
 | return(0x00); | return(0x00); | 
| Line 473  static void setsnd86idpara(HWND hWnd, UI | Line 494  static void setsnd86idpara(HWND hWnd, UI | 
 |  |  | 
 | static UINT8 getsnd86id(HWND hWnd) { | static UINT8 getsnd86id(HWND hWnd) { | 
 |  |  | 
| char    work[8]; | TCHAR   work[8]; | 
 |  |  | 
| Edit_GetText(hWnd, work, sizeof(work)); | GetWindowText(hWnd, work, NELEMENTS(work)); | 
 | return((~work[0] & 7) << 5); | return((~work[0] & 7) << 5); | 
 | } | } | 
 |  |  | 
| Line 513  static void snd86cmddipsw(HWND hWnd) { | Line 534  static void snd86cmddipsw(HWND hWnd) { | 
 | break; | break; | 
 |  |  | 
 | case 1: | case 1: | 
| Button_SetCheck(GetDlgItem(hWnd, IDC_SND86ROM), snd86 & 2); | SetDlgItemCheck(hWnd, IDC_SND86ROM, snd86 & 2); | 
 | break; | break; | 
 |  |  | 
 | case 2: | case 2: | 
| Line 522  static void snd86cmddipsw(HWND hWnd) { | Line 543  static void snd86cmddipsw(HWND hWnd) { | 
 | break; | break; | 
 |  |  | 
 | case 4: | case 4: | 
| Button_SetCheck(GetDlgItem(hWnd, IDC_SND86INT), snd86 & 0x10); | SetDlgItemCheck(hWnd, IDC_SND86INT, snd86 & 0x10); | 
 | break; | break; | 
 |  |  | 
 | case 5: | case 5: | 
| Line 544  static LRESULT CALLBACK Snd86optDlgProc( | Line 565  static LRESULT CALLBACK Snd86optDlgProc( | 
 | snd86 = np2cfg.snd86opt; | snd86 = np2cfg.snd86opt; | 
 | SETnLISTSTR(hWnd, IDC_SND86IO, sndioport+1, 2); | SETnLISTSTR(hWnd, IDC_SND86IO, sndioport+1, 2); | 
 | setsnd86iopara(GetDlgItem(hWnd, IDC_SND86IO), snd86); | setsnd86iopara(GetDlgItem(hWnd, IDC_SND86IO), snd86); | 
| Button_SetCheck(GetDlgItem(hWnd, IDC_SND86INT), snd86 & 0x10); | SetDlgItemCheck(hWnd, IDC_SND86INT, snd86 & 0x10); | 
 | SETLISTSTR(hWnd, IDC_SND86INTA, sndinterrupt); | SETLISTSTR(hWnd, IDC_SND86INTA, sndinterrupt); | 
 | setsnd86intpara(GetDlgItem(hWnd, IDC_SND86INTA), snd86); | setsnd86intpara(GetDlgItem(hWnd, IDC_SND86INTA), snd86); | 
 | SETLISTSTR(hWnd, IDC_SND86ID, sndid); | SETLISTSTR(hWnd, IDC_SND86ID, sndid); | 
 | setsnd86idpara(GetDlgItem(hWnd, IDC_SND86ID), snd86); | setsnd86idpara(GetDlgItem(hWnd, IDC_SND86ID), snd86); | 
| Button_SetCheck(GetDlgItem(hWnd, IDC_SND86ROM), snd86 & 2); | SetDlgItemCheck(hWnd, IDC_SND86ROM, snd86 & 2); | 
 |  |  | 
 | sub = GetDlgItem(hWnd, IDC_SND86DIP); | sub = GetDlgItem(hWnd, IDC_SND86DIP); | 
 | SetWindowLong(sub, GWL_STYLE, SS_OWNERDRAW + | SetWindowLong(sub, GWL_STYLE, SS_OWNERDRAW + | 
| Line 563  static LRESULT CALLBACK Snd86optDlgProc( | Line 584  static LRESULT CALLBACK Snd86optDlgProc( | 
 | break; | break; | 
 | case IDC_SND86INT: | case IDC_SND86INT: | 
 | set86jmp(hWnd, | set86jmp(hWnd, | 
| ((Button_GetCheck(GetDlgItem(hWnd, IDC_SND86INT))) | (GetDlgItemCheck(hWnd, IDC_SND86INT))?0x10:0x00, | 
| ?0x10:0x00), 0x10); | 0x10); | 
 | break; | break; | 
 | case IDC_SND86INTA: | case IDC_SND86INTA: | 
 | set86jmp(hWnd, | set86jmp(hWnd, | 
| Line 572  static LRESULT CALLBACK Snd86optDlgProc( | Line 593  static LRESULT CALLBACK Snd86optDlgProc( | 
 | break; | break; | 
 | case IDC_SND86ROM: | case IDC_SND86ROM: | 
 | set86jmp(hWnd, | set86jmp(hWnd, | 
| ((Button_GetCheck(GetDlgItem(hWnd, IDC_SND86ROM))) | (GetDlgItemCheck(hWnd, IDC_SND86ROM))?0x02:0x00, | 
| ?0x02:0x00), 0x02); | 0x02); | 
 | break; | break; | 
 | case IDC_SND86ID: | case IDC_SND86ID: | 
 | set86jmp(hWnd, | set86jmp(hWnd, | 
| Line 583  static LRESULT CALLBACK Snd86optDlgProc( | Line 604  static LRESULT CALLBACK Snd86optDlgProc( | 
 | case IDC_SND86DEF: | case IDC_SND86DEF: | 
 | snd86 = 0x7f; | snd86 = 0x7f; | 
 | setsnd86iopara(GetDlgItem(hWnd, IDC_SND86IO), snd86); | setsnd86iopara(GetDlgItem(hWnd, IDC_SND86IO), snd86); | 
| Button_SetCheck(GetDlgItem(hWnd, IDC_SND86INT), TRUE); | SetDlgItemCheck(hWnd, IDC_SND86INT, TRUE); | 
 | setsnd86intpara(GetDlgItem(hWnd, IDC_SND86INTA), snd86); | setsnd86intpara(GetDlgItem(hWnd, IDC_SND86INTA), snd86); | 
 | setsnd86idpara(GetDlgItem(hWnd, IDC_SND86ID), snd86); | setsnd86idpara(GetDlgItem(hWnd, IDC_SND86ID), snd86); | 
| Button_SetCheck(GetDlgItem(hWnd, IDC_SND86ROM), TRUE); | SetDlgItemCheck(hWnd, IDC_SND86ROM, TRUE); | 
 | InvalidateRect(GetDlgItem(hWnd, IDC_SND86DIP), NULL, TRUE); | InvalidateRect(GetDlgItem(hWnd, IDC_SND86DIP), NULL, TRUE); | 
 | break; | break; | 
 |  |  | 
| Line 624  static UINT8 spbvrc = 0; | Line 645  static UINT8 spbvrc = 0; | 
 |  |  | 
 | static void setspbVRch(HWND hWnd) { | static void setspbVRch(HWND hWnd) { | 
 |  |  | 
| Button_SetCheck(GetDlgItem(hWnd, IDC_SPBVRL), spbvrc & 1); | SetDlgItemCheck(hWnd, IDC_SPBVRL, spbvrc & 1); | 
| Button_SetCheck(GetDlgItem(hWnd, IDC_SPBVRR), spbvrc & 2); | SetDlgItemCheck(hWnd, IDC_SPBVRR, spbvrc & 2); | 
 | } | } | 
 |  |  | 
 | static void spbcreate(HWND hWnd) { | static void spbcreate(HWND hWnd) { | 
| Line 645  static void spbcreate(HWND hWnd) { | Line 666  static void spbcreate(HWND hWnd) { | 
 | MAKELONG(0, 24)); | MAKELONG(0, 24)); | 
 | SendDlgItemMessage(hWnd, IDC_SPBVRLEVEL, TBM_SETPOS, TRUE, | SendDlgItemMessage(hWnd, IDC_SPBVRLEVEL, TBM_SETPOS, TRUE, | 
 | np2cfg.spb_vrl); | np2cfg.spb_vrl); | 
| Button_SetCheck(GetDlgItem(hWnd, IDC_SPBREVERSE), np2cfg.spb_x); | SetDlgItemCheck(hWnd, IDC_SPBREVERSE, np2cfg.spb_x); | 
 |  |  | 
 | sub = GetDlgItem(hWnd, IDC_SPBJMP); | sub = GetDlgItem(hWnd, IDC_SPBJMP); | 
 | SetWindowLong(sub, GWL_STYLE, SS_OWNERDRAW + | SetWindowLong(sub, GWL_STYLE, SS_OWNERDRAW + | 
| Line 740  static UINT8 getspbVRch(HWND hWnd) { | Line 761  static UINT8 getspbVRch(HWND hWnd) { | 
 | UINT8   ret; | UINT8   ret; | 
 |  |  | 
 | ret = 0; | ret = 0; | 
| if (Button_GetCheck(GetDlgItem(hWnd, IDC_SPBVRL))) { | if (GetDlgItemCheck(hWnd, IDC_SPBVRL)) { | 
| ret++; | ret += 1; | 
 | } | } | 
| if (Button_GetCheck(GetDlgItem(hWnd, IDC_SPBVRR))) { | if (GetDlgItemCheck(hWnd, IDC_SPBVRR)) { | 
 | ret += 2; | ret += 2; | 
 | } | } | 
 | return(ret); | return(ret); | 
| Line 817  static LRESULT CALLBACK SPBoptDlgProc(HW | Line 838  static LRESULT CALLBACK SPBoptDlgProc(HW | 
 | update |= SYS_UPDATECFG; | update |= SYS_UPDATECFG; | 
 | } | } | 
 | opngen_setVR(np2cfg.spb_vrc, np2cfg.spb_vrl); | opngen_setVR(np2cfg.spb_vrc, np2cfg.spb_vrl); | 
| b = (UINT8)(Button_GetCheck(GetDlgItem(hWnd, IDC_SPBREVERSE)) | b = (UINT8)GetDlgItemCheck(hWnd, IDC_SPBREVERSE); | 
| ?1:0); |  | 
 | if (np2cfg.spb_x != b) { | if (np2cfg.spb_x != b) { | 
 | np2cfg.spb_x = b; | np2cfg.spb_x = b; | 
 | update |= SYS_UPDATECFG; | update |= SYS_UPDATECFG; | 
| Line 865  static const CHECKTBL pad1opt[13] = { | Line 885  static const CHECKTBL pad1opt[13] = { | 
 |  |  | 
 | static void checkbtnres_load(HWND hWnd, const CHECKTBL *item) { | static void checkbtnres_load(HWND hWnd, const CHECKTBL *item) { | 
 |  |  | 
| Button_SetCheck(GetDlgItem(hWnd, item->res), | SetDlgItemCheck(hWnd, item->res, (*(item->ptr)) & (1 << (item->bit))); | 
| (*(item->ptr)) & (1 << (item->bit))); |  | 
 | } | } | 
 |  |  | 
 | static UINT8 checkbtnres_store(HWND hWnd, const CHECKTBL *item) { | static UINT8 checkbtnres_store(HWND hWnd, const CHECKTBL *item) { | 
| Line 876  static UINT8 checkbtnres_store(HWND hWnd | Line 895  static UINT8 checkbtnres_store(HWND hWnd | 
 | UINT8   ret; | UINT8   ret; | 
 |  |  | 
 | bit = 1 << (item->bit); | bit = 1 << (item->bit); | 
| value = ((Button_GetCheck(GetDlgItem(hWnd, item->res)))?0xff:0) & bit; | value = GetDlgItemCheck(hWnd, item->res)?bit:0; | 
 | ret = ((*(item->ptr)) ^ value) & bit; | ret = ((*(item->ptr)) ^ value) & bit; | 
 | if (ret) { | if (ret) { | 
 | (*(item->ptr)) ^= bit; | (*(item->ptr)) ^= bit; | 
| Line 896  static LRESULT CALLBACK PAD1optDlgProc(H | Line 915  static LRESULT CALLBACK PAD1optDlgProc(H | 
 | checkbtnres_load(hWnd, pad1opt + i); | checkbtnres_load(hWnd, pad1opt + i); | 
 | } | } | 
 | if (np2oscfg.JOYPAD1 & 2) { | if (np2oscfg.JOYPAD1 & 2) { | 
| Button_Enable(GetDlgItem(hWnd, IDC_JOYPAD1), FALSE); | EnableWindow(GetDlgItem(hWnd, IDC_JOYPAD1), FALSE); | 
 | } | } | 
 | return(TRUE); | return(TRUE); | 
 |  |  | 
| Line 927  void dialog_sndopt(HWND hWnd) { | Line 946  void dialog_sndopt(HWND hWnd) { | 
 | PROPSHEETHEADER psh; | PROPSHEETHEADER psh; | 
 | HPROPSHEETPAGE  hpsp[6]; | HPROPSHEETPAGE  hpsp[6]; | 
 |  |  | 
| hinst = (HINSTANCE)GetWindowLong(hWnd, GWL_HINSTANCE); | hinst = (HINSTANCE)GetWindowLongPtr(hWnd, GWLP_HINSTANCE); | 
 |  |  | 
 | ZeroMemory(&psp, sizeof(psp)); | ZeroMemory(&psp, sizeof(psp)); | 
 | psp.dwSize = sizeof(PROPSHEETPAGE); | psp.dwSize = sizeof(PROPSHEETPAGE); | 
| Line 976  void dialog_sndopt(HWND hWnd) { | Line 995  void dialog_sndopt(HWND hWnd) { | 
 | // ---- | // ---- | 
 |  |  | 
 | #if defined(SUPPORT_S98) | #if defined(SUPPORT_S98) | 
| static const char s98ui_file[] = "NP2_%04d.S98"; | static const OEMCHAR s98ui_file[] = OEMTEXT("NP2_%04d.S98"); | 
| static const char s98ui_title[] = "Save as S98 log"; | static const TCHAR s98ui_title[] = _T("Save as S98 log"); | 
| static const char s98ui_ext[] = "s98"; | static const TCHAR s98ui_ext[] = _T("s98"); | 
| static const char s98ui_filter[] = "S98 log (*.s98)\0*.s98\0"; | static const TCHAR s98ui_filter[] = _T("S98 log (*.s98)\0*.s98\0"); | 
 | static const FILESEL s98ui = {s98ui_title, s98ui_ext, s98ui_filter, 1}; | static const FILESEL s98ui = {s98ui_title, s98ui_ext, s98ui_filter, 1}; | 
 |  |  | 
 | void dialog_s98(HWND hWnd) { | void dialog_s98(HWND hWnd) { | 
 |  |  | 
 | BOOL    check; | BOOL    check; | 
| char    path[MAX_PATH]; | OEMCHAR path[MAX_PATH]; | 
 |  |  | 
 | S98_close(); | S98_close(); | 
 | check = FALSE; | check = FALSE; | 
| file_cpyname(path, bmpfilefolder, sizeof(path)); | file_cpyname(path, bmpfilefolder, NELEMENTS(path)); | 
 | file_cutname(path); | file_cutname(path); | 
| file_catname(path, s98ui_file, sizeof(path)); | file_catname(path, s98ui_file, NELEMENTS(path)); | 
| if ((dlgs_selectwritenum(hWnd, &s98ui, path, sizeof(path))) && | if ((dlgs_selectwritenum(hWnd, &s98ui, path, NELEMENTS(path))) && | 
 | (S98_open(path) == SUCCESS)) { | (S98_open(path) == SUCCESS)) { | 
| file_cpyname(bmpfilefolder, path, sizeof(bmpfilefolder)); | file_cpyname(bmpfilefolder, path, NELEMENTS(bmpfilefolder)); | 
 | sysmng_update(SYS_UPDATEOSCFG); | sysmng_update(SYS_UPDATEOSCFG); | 
 | check = TRUE; | check = TRUE; | 
 | } | } | 
| Line 1006  void dialog_s98(HWND hWnd) { | Line 1025  void dialog_s98(HWND hWnd) { | 
 | // ---- | // ---- | 
 |  |  | 
 | #if defined(SUPPORT_WAVEREC) | #if defined(SUPPORT_WAVEREC) | 
| static const char wrui_file[] = "NP2_%04d.WAV"; | static const OEMCHAR wrui_file[] = OEMTEXT("NP2_%04d.WAV"); | 
| static const char wrui_title[] = "Save as Sound"; | static const TCHAR wrui_title[] = _T("Save as Sound"); | 
| static const char wrui_ext[] = "WAV"; | static const TCHAR wrui_ext[] = _T("WAV"); | 
| static const char wrui_filter[] = "Wave files (*.wav)\0*.wav\0"; | static const TCHAR wrui_filter[] = _T("Wave files (*.wav)\0*.wav\0"); | 
 | static const FILESEL wrui = {wrui_title, wrui_ext, wrui_filter, 1}; | static const FILESEL wrui = {wrui_title, wrui_ext, wrui_filter, 1}; | 
 |  |  | 
 | void dialog_waverec(HWND hWnd) { | void dialog_waverec(HWND hWnd) { | 
 |  |  | 
 | UINT8   check; | UINT8   check; | 
| char    path[MAX_PATH]; | OEMCHAR path[MAX_PATH]; | 
 |  |  | 
 | check = FALSE; | check = FALSE; | 
 | sound_recstop(); | sound_recstop(); | 
| file_cpyname(path, bmpfilefolder, sizeof(path)); | file_cpyname(path, bmpfilefolder, NELEMENTS(path)); | 
 | file_cutname(path); | file_cutname(path); | 
| file_catname(path, wrui_file, sizeof(path)); | file_catname(path, wrui_file, NELEMENTS(path)); | 
| if ((dlgs_selectwritenum(hWnd, &wrui, path, sizeof(path))) && | if ((dlgs_selectwritenum(hWnd, &wrui, path, NELEMENTS(path))) && | 
 | (sound_recstart(path) == SUCCESS)) { | (sound_recstart(path) == SUCCESS)) { | 
| file_cpyname(bmpfilefolder, path, sizeof(bmpfilefolder)); | file_cpyname(bmpfilefolder, path, NELEMENTS(bmpfilefolder)); | 
 | sysmng_update(SYS_UPDATEOSCFG); | sysmng_update(SYS_UPDATEOSCFG); | 
 | check = TRUE; | check = TRUE; | 
 | } | } |