yui 2015-11-22 14:34:32 +00:00
parent d7e3c867e0
commit 94fbced9b0
11 changed files with 84 additions and 14 deletions

View File

@ -124,6 +124,7 @@ static const MENUPRM res_cfg[] = {
static const OEMCHAR str_buffmt[] = OEMTEXT("%ums");
#if !defined(DISABLE_SOUND)
static void setbufstr(void) {
UINT val;
@ -139,6 +140,7 @@ static void setbufstr(void) {
OEMSPRINTF(work, str_buffmt, val);
menudlg_settext(DID_BUFSTR, work);
}
#endif /* !defined(DISABLE_SOUND) */
#if !defined(SIZE_QVGA)
static void setskipen(UINT en) {
@ -164,11 +166,14 @@ static void setskipstr(void) {
static void dlginit(void) {
#if !defined(DISABLE_SOUND)
MENUID id;
#endif /* !defined(DISABLE_SOUND) */
menudlg_appends(res_cfg, NELEMENTS(res_cfg));
menudlg_setval(DID_Z80A, 1);
#if !defined(DISABLE_SOUND)
if (xmilcfg.samplingrate < ((11025 + 22050) / 2)) {
id = DID_RATE11;
}
@ -181,6 +186,12 @@ static void dlginit(void) {
menudlg_setval(id, 1);
menudlg_setval(DID_BUFFER, xmilcfg.delayms);
setbufstr();
#else /* !defined(DISABLE_SOUND) */
menudlg_setenable(DID_RATE11, FALSE);
menudlg_setenable(DID_RATE22, FALSE);
menudlg_setenable(DID_RATE44, FALSE);
menudlg_setenable(DID_BUFFER, FALSE);
#endif /* !defined(DISABLE_SOUND) */
#if !defined(SIZE_QVGA)
menudlg_setval(DID_SKIPLINE, xmilcfg.skipline);
@ -200,6 +211,7 @@ static void dlgupdate(void) {
update = 0;
#if !defined(DISABLE_SOUND)
if (menudlg_getval(DID_RATE11)) {
val = 11025;
}
@ -227,6 +239,7 @@ static void dlgupdate(void) {
update |= SYS_UPDATECFG;
corestat.soundrenewal = 1;
}
#endif /* !defined(DISABLE_SOUND) */
#if !defined(SIZE_QVGA)
renewalflg = FALSE;
@ -270,9 +283,11 @@ int dlgcfg_cmd(int msg, MENUID id, long param) {
menubase_close();
break;
#if !defined(DISABLE_SOUND)
case DID_BUFFER:
setbufstr();
break;
#endif /* !defined(DISABLE_SOUND) */
#if !defined(SIZE_QVGA)
case DID_SKIPLINE:

View File

@ -29,13 +29,15 @@ static const PFTBL iniitem[] = {
{"skipline", PFTYPE_BOOL, &xmilcfg.skipline, 0},
{"skplight", PFTYPE_UINT16, &xmilcfg.skiplight, 0},
#if !defined(DISABLE_SOUND)
{"SampleHz", PFTYPE_UINT16, &xmilcfg.samplingrate, 0},
{"Latencys", PFTYPE_UINT16, &xmilcfg.delayms, 0},
#if defined(SUPPORT_OPM)
{"OPMsound", PFTYPE_BOOL, &xmilcfg.SOUND_SW, 0},
#endif //defined(SUPPORT_OPM)
{"Seek_Snd", PFTYPE_BOOL, &xmilcfg.MOTOR, 0},
{"Seek_Vol", PFMAX_UINT8, &xmilcfg.MOTORVOL, 100},
#endif /* !defined(DISABLE_SOUND) */
#if defined(SUPPORT_TURBOZ) || defined(SUPPORT_OPM)
{"OPMsound", PFTYPE_BOOL, &xmilcfg.SOUND_SW, 0},
#endif /* defined(SUPPORT_TURBOZ) || defined(SUPPORT_OPM) */
{"MouseInt", PFTYPE_BOOL, &xmilcfg.MOUSE_SW, 0},
{"btnRAPID", PFTYPE_BOOL, &xmilcfg.BTN_RAPID, 0},

View File

@ -158,17 +158,19 @@ static void sys_cmd(MENUID id) {
break;
#endif
#if defined(SUPPORT_OPM)
#if defined(SUPPORT_TURBOZ) || defined(SUPPORT_OPM)
case MID_FMBOARD:
xmilcfg.SOUND_SW ^= 1;
update = SYS_UPDATECFG;
break;
#endif // defined(SUPPORT_OPM)
#endif /* defined(SUPPORT_TURBOZ) || defined(SUPPORT_OPM) */
#if !defined(DISABLE_SOUND)
case MID_SEEKSND:
xmilcfg.MOTOR ^= 1;
update |= SYS_UPDATECFG;
break;
#endif /* !defined(DISABLE_SOUND) */
case MID_JOYX:
xmilcfg.BTN_MODE ^= 1;
@ -254,10 +256,12 @@ BRESULT sysmenu_menuopen(UINT menutype, int x, int y) {
menusys_setcheck(MID_JOY1, (b == 1));
menusys_setcheck(MID_JOY2, (b == 2));
menusys_setcheck(MID_MOUSEKEY, (b == 3));
#if defined(SUPPORT_OPM)
#if defined(SUPPORT_TURBOZ) || defined(SUPPORT_OPM)
menusys_setcheck(MID_FMBOARD, (xmilcfg.SOUND_SW & 1));
#endif // defined(SUPPORT_OPM)
#endif /* defined(SUPPORT_TURBOZ) || defined(SUPPORT_OPM) */
#if !defined(DISABLE_SOUND)
menusys_setcheck(MID_SEEKSND, (xmilcfg.MOTOR & 1));
#endif /* !defined(DISABLE_SOUND) */
menusys_setcheck(MID_JOYX, (xmilcfg.BTN_MODE & 1));
menusys_setcheck(MID_RAPID, (xmilcfg.BTN_RAPID & 1));
return(menusys_open(x, y));

View File

@ -135,7 +135,9 @@ static const MSYSITEM s_device[] = {
{str_joykey2, NULL, MID_JOY2, 0},
// {str_mousekey, NULL, MID_MOUSEKEY, 0},
{NULL, NULL, MID_STATIC, MENU_SEPARATOR},
#if defined(SUPPORT_TURBOZ) || defined(SUPPORT_OPM)
{str_fmboard, NULL, MID_FMBOARD, 0},
#endif /* defined(SUPPORT_TURBOZ) || defined(SUPPORT_OPM) */
{str_joystick, NULL, MID_JOYSTICK, MENU_GRAY},
{str_mouse, NULL, MID_MOUSE, MENU_GRAY},
{NULL, NULL, MID_STATIC, MENU_SEPARATOR},
@ -143,7 +145,9 @@ static const MSYSITEM s_device[] = {
static const MSYSITEM s_other[] = {
{str_bmpsave, NULL, MID_BMPSAVE, MENU_GRAY},
{str_opmlog, NULL, MID_OPMLOG, MENU_GRAY},
#if defined(SUPPORT_X1F)
{str_opmlog, NULL, MID_OPMLOG, 0},
#endif /* defined(SUPPORT_X1F) */
{str_clockdisp, NULL, MID_DISPCLOCK, MENU_GRAY},
{str_framedisp, NULL, MID_DISPFRAME, MENU_GRAY},
{str_joyrev, NULL, MID_JOYX, 0},

View File

@ -25,12 +25,20 @@ static void cfgcreate(HWND hWnd) {
dlgs_setlistuint32(hWnd, IDC_SAMPLERATE, ratehz, NELEMENTS(ratehz));
#if !defined(DISABLE_SOUND)
OEMSPRINTF(work, str_u, xmilcfg.samplingrate);
SetDlgItemText(hWnd, IDC_SAMPLERATE, work);
OEMSPRINTF(work, str_u, xmilcfg.delayms);
SetDlgItemText(hWnd, IDC_SNDBUFFER, work);
OEMSPRINTF(work, str_u, xmilcfg.MOTORVOL);
SetDlgItemText(hWnd, IDC_SEEKVOL, work);
#else // !defined(DISABLE_SOUND)
static UINT s_nSoundIDs[] = {IDC_SAMPLERATE, IDC_SNDBUFFER, IDC_SEEKVOL};
for (size_t i = 0; i < _countof(s_nSoundIDs); i++)
{
EnableWindow(GetDlgItem(hWnd, s_nSoundIDs[i]), FALSE);
}
#endif // !defined(DISABLE_SOUND)
SetDlgItemCheck(hWnd, IDC_SKIPLINE, xmilcfg.skipline);
SendDlgItemMessage(hWnd, IDC_SKIPLIGHT, TBM_SETRANGE, TRUE,
@ -54,13 +62,14 @@ static void lightstr(HWND hWnd) {
static void cfgupdate(HWND hWnd) {
UINT updateflag;
OEMCHAR work[32];
UINT16 wval;
UINT8 bval;
BOOL renewalflg;
updateflag = 0;
#if !defined(DISABLE_SOUND)
OEMCHAR work[32];
GetDlgItemText(hWnd, IDC_SAMPLERATE, work, NELEMENTS(work));
wval = (UINT16)LIMITS(milstr_solveINT(work), 11025, 55500);
if (xmilcfg.samplingrate != wval) {
@ -85,6 +94,7 @@ static void cfgupdate(HWND hWnd) {
soundmng_pcmvolume(SOUND_PCMSEEK1, bval);
updateflag |= SYS_UPDATEOSCFG;
}
#endif // !defined(DISABLE_SOUND)
renewalflg = FALSE;
bval = GetDlgItemCheck(hWnd, IDC_SKIPLINE);

View File

@ -10,8 +10,9 @@ LRESULT CALLBACK AboutDialogProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp);
void dialog_changefdd(HWND hWnd, REG8 drv);
void dialog_newdisk(HWND hWnd);
void dialog_writebmp(HWND hWnd);
#if defined(SUPPORT_X1F)
void dialog_x1f(HWND hWnd);
#endif // defined(SUPPORT_X1F)
#if 0
void dialog_scropt(HWND hWnd);

View File

@ -328,11 +328,15 @@ static const PFTBL s_IniItems[] =
PFVAL("skipline", PFTYPE_BOOL, &xmilcfg.skipline),
PFVAL("skplight", PFTYPE_UINT16, &xmilcfg.skiplight),
#if !defined(DISABLE_SOUND)
PFVAL("SampleHz", PFTYPE_UINT16, &xmilcfg.samplingrate),
PFVAL("Latencys", PFTYPE_UINT16, &xmilcfg.delayms),
PFVAL("OPMsound", PFTYPE_BOOL, &xmilcfg.SOUND_SW),
PFVAL("Seek_Snd", PFTYPE_BOOL, &xmilcfg.MOTOR),
PFMAX("Seek_Vol", PFTYPE_UINT8, &xmilcfg.MOTORVOL, 100),
#endif // !defined(DISABLE_SOUND)
#if defined(SUPPORT_TURBOZ) || defined(SUPPORT_OPM)
PFVAL("OPMsound", PFTYPE_BOOL, &xmilcfg.SOUND_SW),
#endif // defined(SUPPORT_TURBOZ) || defined(SUPPORT_OPM)
PFVAL("MouseInt", PFTYPE_BOOL, &xmilcfg.MOUSE_SW),
PFVAL("btnRAPID", PFTYPE_BOOL, &xmilcfg.BTN_RAPID),

View File

@ -185,8 +185,14 @@ void menu_initialize()
{
HMENU hMenu = GetMenu(hWndMain);
#if defined(SUPPORT_TURBOZ) || defined(SUPPORT_OPM)
InsertMenuString(hMenu, IDM_JOYSTICK, MF_BYCOMMAND | MF_STRING, IDM_FMBOARD);
#endif // defined(SUPPORT_TURBOZ) || defined(SUPPORT_OPM)
#if defined(SUPPORT_X1F)
InsertMenuString(hMenu, IDM_DISPCLOCK, MF_BYCOMMAND | MF_STRING, IDM_OPMLOG);
#endif // defined(SUPPORT_X1F)
#if defined(SUPPORT_WAVEREC)
InsertMenuString(hMenu, IDM_DISPCLOCK, MF_BYCOMMAND | MF_STRING, IDM_WAVEREC);
InsertMenuString(hMenu, IDM_DISPCLOCK, MF_BYCOMMAND | MF_STRING, IDM_WAVEREC);
#endif
if (xmiloscfg.Z80SAVE)
@ -317,11 +323,13 @@ void menu_setkey(UINT8 value) {
CheckMenuItem(hmenu, IDM_JOY2, MFCHECK(value == 2));
}
#if defined(SUPPORT_TURBOZ) || defined(SUPPORT_OPM)
void menu_setsound(UINT8 value) {
xmilcfg.SOUND_SW = value;
CheckMenuItem(extclass_gethmenu(hWndMain), IDM_FMBOARD, MFCHECK(value));
}
#endif // defined(SUPPORT_TURBOZ) || defined(SUPPORT_OPM)
void menu_enablejoystick(bool bEnabled)
{
@ -343,17 +351,21 @@ void menu_setmouse(UINT8 value) {
CheckMenuItem(extclass_gethmenu(hWndMain), IDM_MOUSE, MFCHECK(value));
}
#if !defined(DISABLE_SOUND)
void menu_setmotorflg(UINT8 value) {
value &= 1;
xmilcfg.MOTOR = value;
CheckMenuItem(extclass_gethmenu(hWndMain), IDM_SEEKSND, MFCHECK(value));
}
#endif // !defined(DISABLE_SOUND)
#if defined(SUPPORT_X1F)
void menu_opmlog(UINT8 value) {
CheckMenuItem(extclass_gethmenu(hWndMain), IDM_OPMLOG, MFCHECK(value));
}
#endif // defined(SUPPORT_X1F)
void menu_setdispclk(UINT8 value) {

View File

@ -25,12 +25,18 @@ void menu_setraster(UINT8 value);
void menu_setwaitflg(UINT8 value);
void menu_setframe(UINT8 value);
void menu_setkey(UINT8 value);
#if defined(SUPPORT_TURBOZ) || defined(SUPPORT_OPM)
void menu_setsound(UINT8 value);
#endif // defined(SUPPORT_TURBOZ) || defined(SUPPORT_OPM)
void menu_enablejoystick(bool bEnabled);
void menu_setjoystick(UINT8 value);
void menu_setmouse(UINT8 value);
#if !defined(DISABLE_SOUND)
void menu_setmotorflg(UINT8 value);
#endif // !defined(DISABLE_SOUND)
#if defined(SUPPORT_X1F)
void menu_opmlog(UINT8 value);
#endif // defined(SUPPORT_X1F)
void menu_setdispclk(UINT8 value);
void menu_setbtnmode(UINT8 value);
void menu_setbtnrapid(UINT8 value);

View File

@ -376,10 +376,12 @@ static void xmilcmd(HWND hWnd, UINT cmd) {
menu_setkey(2);
break;
#if defined(SUPPORT_TURBOZ) || defined(SUPPORT_OPM)
case IDM_FMBOARD:
menu_setsound(xmilcfg.SOUND_SW ^ 1);
update = SYS_UPDATECFG;
break;
#endif // defined(SUPPORT_TURBOZ) || defined(SUPPORT_OPM)
case IDM_JOYSTICK:
menu_setjoystick(xmiloscfg.JOYSTICK ^ 1);
@ -392,10 +394,12 @@ static void xmilcmd(HWND hWnd, UINT cmd) {
update = SYS_UPDATECFG;
break;
#if !defined(DISABLE_SOUND)
case IDM_SEEKSND:
menu_setmotorflg(xmilcfg.MOTOR ^ 1);
update = SYS_UPDATECFG;
break;
#endif // !defined(DISABLE_SOUND)
case IDM_WIDTH40:
crtc_forcesetwidth(40);
@ -415,11 +419,13 @@ static void xmilcmd(HWND hWnd, UINT cmd) {
winuileave();
break;
#if defined(SUPPORT_X1F)
case IDM_OPMLOG:
winuienter();
dialog_x1f(hWnd);
winuileave();
break;
#endif // defined(SUPPORT_X1F)
case IDM_DISPCLOCK:
menu_setdispclk(xmiloscfg.DISPCLK ^ 1);
@ -855,10 +861,14 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInst,
menu_setwaitflg(xmiloscfg.NOWAIT);
menu_setframe(xmiloscfg.DRAW_SKIP);
menu_setkey(0);
#if defined(SUPPORT_TURBOZ) || defined(SUPPORT_OPM)
menu_setsound(xmilcfg.SOUND_SW);
#endif // defined(SUPPORT_TURBOZ) || defined(SUPPORT_OPM)
menu_setjoystick(xmiloscfg.JOYSTICK);
menu_setmouse(xmilcfg.MOUSE_SW);
#if !defined(DISABLE_SOUND)
menu_setmotorflg(xmilcfg.MOTOR);
#endif // !defined(DISABLE_SOUND)
menu_setdispclk(xmiloscfg.DISPCLK);
menu_setbtnmode(xmilcfg.BTN_MODE);
menu_setbtnrapid(xmilcfg.BTN_RAPID);
@ -892,10 +902,12 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInst,
juliet_prepare();
// juliet2_reset();
if (soundmng_initialize() == SUCCESS) {
#if !defined(DISABLE_SOUND)
soundmng_pcmload(SOUND_PCMSEEK, OEMTEXT("fddseek.wav"), 0);
soundmng_pcmload(SOUND_PCMSEEK1, OEMTEXT("fddseek1.wav"), 0);
soundmng_pcmvolume(SOUND_PCMSEEK, xmilcfg.MOTORVOL);
soundmng_pcmvolume(SOUND_PCMSEEK1, xmilcfg.MOTORVOL);
#endif // !defined(DISABLE_SOUND)
}
sysmng_initialize();

View File

@ -116,7 +116,6 @@ BEGIN
MENUITEM "JoyKey-&1", IDM_JOY1
MENUITEM "Joykey-&2", IDM_JOY2
MENUITEM SEPARATOR
MENUITEM "&FM Board", IDM_FMBOARD
MENUITEM "&Joystick", IDM_JOYSTICK
MENUITEM "&MOUSE", IDM_MOUSE
MENUITEM SEPARATOR
@ -125,7 +124,6 @@ BEGIN
POPUP "&Other"
BEGIN
MENUITEM "&BMP Save...", IDM_BMPSAVE
MENUITEM "&OPM LOG...", IDM_OPMLOG
MENUITEM "&Clock Disp", IDM_DISPCLOCK
MENUITEM "&Frame Disp", IDM_DISPFRAME
MENUITEM "Joy Re&verse", IDM_JOYX
@ -339,6 +337,8 @@ END
STRINGTABLE DISCARDABLE
BEGIN
IDM_TURBOZ "turbo&Z"
IDM_FMBOARD "&FM Board"
IDM_OPMLOG "&OPM LOG..."
IDM_WAVEREC "&Wave Record..."
END