Merge branch 'master' of https://github.com/86Box/86Box
This commit is contained in:
230
src/win/86Box.rc
230
src/win/86Box.rc
@@ -66,7 +66,8 @@ BEGIN
|
||||
POPUP "Re&nderer"
|
||||
BEGIN
|
||||
MENUITEM "&SDL (Software)", IDM_VID_SDL_SW
|
||||
MENUITEM "&SDL (Hardware)", IDM_VID_SDL_HW
|
||||
MENUITEM "SDL (&Hardware)", IDM_VID_SDL_HW
|
||||
MENUITEM "SDL (&OpenGL)", IDM_VID_SDL_OPENGL
|
||||
#ifdef USE_VNC
|
||||
MENUITEM "&VNC", IDM_VID_VNC
|
||||
#endif
|
||||
@@ -324,7 +325,7 @@ FONT 9, "Segoe UI"
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "OK",IDOK,246,235,50,14
|
||||
PUSHBUTTON "Cancel",IDCANCEL,307,235,50,14
|
||||
CONTROL "List2",IDC_SETTINGSCATLIST,"SysListView32",LVS_LIST |
|
||||
CONTROL "List2",IDC_SETTINGSCATLIST,"SysListView32",LVS_REPORT | LVS_NOCOLUMNHEADER |
|
||||
LVS_SHOWSELALWAYS | LVS_SINGLESEL | WS_BORDER | WS_TABSTOP,7,7,100,212
|
||||
CONTROL "",-1,"Static",SS_BLACKFRAME | SS_SUNKEN,1,226,373,1
|
||||
/* Leave this commented out until we get into localization. */
|
||||
@@ -335,45 +336,45 @@ BEGIN
|
||||
#endif
|
||||
END
|
||||
|
||||
DLG_CFG_MACHINE DIALOG DISCARDABLE 107, 0, 305, 199
|
||||
DLG_CFG_MACHINE DIALOG DISCARDABLE 107, 0, 305, 200
|
||||
STYLE DS_CONTROL | WS_CHILD
|
||||
FONT 9, "Segoe UI"
|
||||
BEGIN
|
||||
COMBOBOX IDC_COMBO_MACHINE_TYPE,71,7,189,120,CBS_DROPDOWNLIST |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
LTEXT "Machine type:",IDT_1708,7,8,60,10
|
||||
LTEXT "Machine type:",IDT_1708,7,9,60,10
|
||||
COMBOBOX IDC_COMBO_MACHINE,71,26,138,120,CBS_DROPDOWNLIST |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
LTEXT "Machine:",IDT_1701,7,27,60,10
|
||||
LTEXT "Machine:",IDT_1701,7,28,60,10
|
||||
PUSHBUTTON "Configure",IDC_CONFIGURE_MACHINE,214,26,46,12
|
||||
COMBOBOX IDC_COMBO_CPU_TYPE,71,44,110,120,CBS_DROPDOWNLIST |
|
||||
COMBOBOX IDC_COMBO_CPU_TYPE,71,45,110,120,CBS_DROPDOWNLIST |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
LTEXT "CPU type:",IDT_1702,7,45,59,10
|
||||
COMBOBOX IDC_COMBO_CPU,215,44,45,120,CBS_DROPDOWNLIST |
|
||||
LTEXT "CPU type:",IDT_1702,7,47,59,10
|
||||
COMBOBOX IDC_COMBO_CPU,215,45,45,120,CBS_DROPDOWNLIST |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
LTEXT "Speed:",IDT_1704,189,45,24,10
|
||||
COMBOBOX IDC_COMBO_FPU,71,63,189,120,CBS_DROPDOWNLIST | WS_VSCROLL |
|
||||
LTEXT "Speed:",IDT_1704,189,47,24,10
|
||||
COMBOBOX IDC_COMBO_FPU,71,64,189,120,CBS_DROPDOWNLIST | WS_VSCROLL |
|
||||
WS_TABSTOP
|
||||
LTEXT "FPU:",IDT_1707,7,63,59,10
|
||||
COMBOBOX IDC_COMBO_WS,71,82,189,120,CBS_DROPDOWNLIST | WS_VSCROLL |
|
||||
LTEXT "FPU:",IDT_1707,7,66,59,10
|
||||
COMBOBOX IDC_COMBO_WS,71,83,189,120,CBS_DROPDOWNLIST | WS_VSCROLL |
|
||||
WS_TABSTOP
|
||||
LTEXT "Wait states:",IDT_1703,7,83,60,10
|
||||
EDITTEXT IDC_MEMTEXT,70,101,45,12,ES_AUTOHSCROLL | ES_NUMBER
|
||||
LTEXT "Wait states:",IDT_1703,7,85,60,10
|
||||
EDITTEXT IDC_MEMTEXT,70,102,45,12,ES_AUTOHSCROLL | ES_NUMBER
|
||||
CONTROL "",IDC_MEMSPIN,"msctls_updown32",UDS_SETBUDDYINT |
|
||||
UDS_ALIGNRIGHT | UDS_ARROWKEYS | UDS_NOTHOUSANDS,113,101,
|
||||
12,12
|
||||
LTEXT "MB",IDT_1705,123,102,10,10
|
||||
LTEXT "Memory:",IDT_1706,7,102,30,10
|
||||
GROUPBOX "Time synchronization",IDC_TIME_SYNC,7,134,100,56
|
||||
LTEXT "MB",IDT_1705,123,104,10,10
|
||||
LTEXT "Memory:",IDT_1706,7,104,30,10
|
||||
GROUPBOX "Time synchronization",IDC_TIME_SYNC,7,135,100,56
|
||||
CONTROL "Disabled",IDC_RADIO_TS_DISABLED,"Button",
|
||||
BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,14,146,84,10
|
||||
BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,14,147,84,10
|
||||
CONTROL "Enabled (local time)", IDC_RADIO_TS_LOCAL,"Button",
|
||||
BS_AUTORADIOBUTTON | WS_TABSTOP,14,160,84,10
|
||||
BS_AUTORADIOBUTTON | WS_TABSTOP,14,161,84,10
|
||||
CONTROL "Enabled (UTC)", IDC_RADIO_TS_UTC,"Button",
|
||||
BS_AUTORADIOBUTTON | WS_TABSTOP,14,174,84,10
|
||||
BS_AUTORADIOBUTTON | WS_TABSTOP,14,175,84,10
|
||||
#ifdef USE_DYNAREC
|
||||
CONTROL "Dynamic Recompiler",IDC_CHECK_DYNAREC,"Button",
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,7,119,94,10
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,7,120,94,10
|
||||
#endif
|
||||
END
|
||||
|
||||
@@ -381,7 +382,7 @@ DLG_CFG_VIDEO DIALOG DISCARDABLE 107, 0, 267, 45
|
||||
STYLE DS_CONTROL | WS_CHILD
|
||||
FONT 9, "Segoe UI"
|
||||
BEGIN
|
||||
LTEXT "Video:",IDT_1707,7,8,48,10
|
||||
LTEXT "Video:",IDT_1707,7,9,48,10
|
||||
COMBOBOX IDC_COMBO_VIDEO,64,7,155,120,CBS_DROPDOWNLIST |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
PUSHBUTTON "Configure",IDC_CONFIGURE_VID,222,7,38,12
|
||||
@@ -394,11 +395,11 @@ DLG_CFG_INPUT DIALOG DISCARDABLE 107, 0, 267, 65
|
||||
STYLE DS_CONTROL | WS_CHILD
|
||||
FONT 9, "Segoe UI"
|
||||
BEGIN
|
||||
LTEXT "Mouse :",IDT_1709,7,8,57,10
|
||||
LTEXT "Mouse :",IDT_1709,7,9,57,10
|
||||
COMBOBOX IDC_COMBO_MOUSE,71,7,140,120,CBS_DROPDOWNLIST |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
PUSHBUTTON "Configure",IDC_CONFIGURE_MOUSE,214,7,46,12
|
||||
LTEXT "Joystick :",IDT_1710,7,26,58,10
|
||||
LTEXT "Joystick :",IDT_1710,7,27,58,10
|
||||
COMBOBOX IDC_COMBO_JOYSTICK,71,25,189,120,CBS_DROPDOWNLIST |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
PUSHBUTTON "Joystick 1...",IDC_JOY1,7,44,50,14
|
||||
@@ -407,73 +408,73 @@ BEGIN
|
||||
PUSHBUTTON "Joystick 4...",IDC_JOY4,209,44,50,14
|
||||
END
|
||||
|
||||
DLG_CFG_SOUND DIALOG DISCARDABLE 107, 0, 267, 199
|
||||
DLG_CFG_SOUND DIALOG DISCARDABLE 107, 0, 267, 201
|
||||
STYLE DS_CONTROL | WS_CHILD
|
||||
FONT 9, "Segoe UI"
|
||||
BEGIN
|
||||
COMBOBOX IDC_COMBO_SOUND,71,7,140,120,CBS_DROPDOWNLIST | WS_VSCROLL |
|
||||
WS_TABSTOP
|
||||
LTEXT "Sound card:",IDT_1711,7,8,59,10
|
||||
LTEXT "Sound card:",IDT_1711,7,9,59,10
|
||||
PUSHBUTTON "Configure",IDC_CONFIGURE_SND,214,7,46,12
|
||||
|
||||
COMBOBOX IDC_COMBO_MIDI,71,25,140,120,CBS_DROPDOWNLIST | WS_VSCROLL |
|
||||
COMBOBOX IDC_COMBO_MIDI,71,26,140,120,CBS_DROPDOWNLIST | WS_VSCROLL |
|
||||
WS_TABSTOP
|
||||
LTEXT "MIDI Out Device:",IDT_1712,7,26,59,10
|
||||
PUSHBUTTON "Configure",IDC_CONFIGURE_MIDI,214,25,46,12
|
||||
LTEXT "MIDI Out Device:",IDT_1712,7,28,59,10
|
||||
PUSHBUTTON "Configure",IDC_CONFIGURE_MIDI,214,26,46,12
|
||||
|
||||
COMBOBOX IDC_COMBO_MIDI_IN,71,43,140,120,CBS_DROPDOWNLIST | WS_VSCROLL |
|
||||
COMBOBOX IDC_COMBO_MIDI_IN,71,45,140,120,CBS_DROPDOWNLIST | WS_VSCROLL |
|
||||
WS_TABSTOP
|
||||
LTEXT "MIDI In Device:",IDT_1713,7,44,59,10
|
||||
PUSHBUTTON "Configure",IDC_CONFIGURE_MIDI_IN,214,43,46,12
|
||||
LTEXT "MIDI In Device:",IDT_1713,7,47,59,10
|
||||
PUSHBUTTON "Configure",IDC_CONFIGURE_MIDI_IN,214,45,46,12
|
||||
|
||||
CONTROL "Standalone MPU-401",IDC_CHECK_MPU401,"Button",
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,7,65,199,10
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,7,66,199,10
|
||||
PUSHBUTTON "Configure",IDC_CONFIGURE_MPU401,214,64,46,12
|
||||
|
||||
CONTROL "Innovation SSI-2001",IDC_CHECK_SSI,"Button",
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,7,83,94,10
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,7,84,95,10
|
||||
CONTROL "CMS / Game Blaster",IDC_CHECK_CMS,"Button",
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,147,83,94,10
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,147,84,95,10
|
||||
|
||||
CONTROL "Gravis Ultrasound",IDC_CHECK_GUS,"Button",
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,7,99,94,10
|
||||
PUSHBUTTON "Configure",IDC_CONFIGURE_GUS,214,99,46,12
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,7,101,94,10
|
||||
PUSHBUTTON "Configure",IDC_CONFIGURE_GUS,214,101,46,12
|
||||
|
||||
CONTROL "Use FLOAT32 sound",IDC_CHECK_FLOAT,"Button",
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,7,115,94,10
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,7,117,94,10
|
||||
END
|
||||
|
||||
DLG_CFG_NETWORK DIALOG DISCARDABLE 107, 0, 267, 63
|
||||
DLG_CFG_NETWORK DIALOG DISCARDABLE 107, 0, 267, 65
|
||||
STYLE DS_CONTROL | WS_CHILD
|
||||
FONT 9, "Segoe UI"
|
||||
BEGIN
|
||||
LTEXT "Network type:",IDT_1714,7,8,59,10
|
||||
LTEXT "Network type:",IDT_1714,7,9,59,10
|
||||
COMBOBOX IDC_COMBO_NET_TYPE,71,7,189,120,CBS_DROPDOWNLIST | WS_VSCROLL |
|
||||
WS_TABSTOP
|
||||
|
||||
LTEXT "PCap device:",IDT_1715,7,26,59,10
|
||||
COMBOBOX IDC_COMBO_PCAP,71,25,189,120,CBS_DROPDOWNLIST | WS_VSCROLL |
|
||||
LTEXT "PCap device:",IDT_1715,7,28,59,10
|
||||
COMBOBOX IDC_COMBO_PCAP,71,26,189,120,CBS_DROPDOWNLIST | WS_VSCROLL |
|
||||
WS_TABSTOP
|
||||
|
||||
LTEXT "Network adapter:",IDT_1716,7,44,59,10
|
||||
COMBOBOX IDC_COMBO_NET,71,43,140,120,CBS_DROPDOWNLIST | WS_VSCROLL |
|
||||
LTEXT "Network adapter:",IDT_1716,7,47,59,10
|
||||
COMBOBOX IDC_COMBO_NET,71,45,140,120,CBS_DROPDOWNLIST | WS_VSCROLL |
|
||||
WS_TABSTOP
|
||||
PUSHBUTTON "Configure",IDC_CONFIGURE_NET,214,43,46,12
|
||||
PUSHBUTTON "Configure",IDC_CONFIGURE_NET,214,44,46,12
|
||||
END
|
||||
|
||||
DLG_CFG_PORTS DIALOG DISCARDABLE 107, 0, 267, 135
|
||||
STYLE DS_CONTROL | WS_CHILD
|
||||
FONT 9, "Segoe UI"
|
||||
BEGIN
|
||||
LTEXT "LPT1 Device:",IDT_1717,7,8,61,10
|
||||
LTEXT "LPT1 Device:",IDT_1717,7,9,61,10
|
||||
COMBOBOX IDC_COMBO_LPT1,71,7,189,120,CBS_DROPDOWNLIST |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
|
||||
LTEXT "LPT2 Device:",IDT_1718,7,27,61,10
|
||||
LTEXT "LPT2 Device:",IDT_1718,7,28,61,10
|
||||
COMBOBOX IDC_COMBO_LPT2,71,26,189,120,CBS_DROPDOWNLIST |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
|
||||
LTEXT "LPT3 Device:",IDT_1719,7,46,61,10
|
||||
LTEXT "LPT3 Device:",IDT_1719,7,47,61,10
|
||||
COMBOBOX IDC_COMBO_LPT3,71,45,189,120,CBS_DROPDOWNLIST |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
|
||||
@@ -494,61 +495,32 @@ BEGIN
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,7,118,94,10
|
||||
END
|
||||
|
||||
DLG_CFG_PERIPHERALS DIALOG DISCARDABLE 107, 0, 267, 220
|
||||
DLG_CFG_STORAGE DIALOG DISCARDABLE 107, 0, 267, 111
|
||||
STYLE DS_CONTROL | WS_CHILD
|
||||
FONT 9, "Segoe UI"
|
||||
BEGIN
|
||||
LTEXT "SCSI Controller:",IDT_1717,7,8,48,10
|
||||
LTEXT "SCSI Controller:",IDT_1717,7,9,48,10
|
||||
COMBOBOX IDC_COMBO_SCSI,64,7,155,120,CBS_DROPDOWNLIST |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
PUSHBUTTON "Configure",IDC_CONFIGURE_SCSI,222,7,38,12
|
||||
|
||||
LTEXT "HD Controller:",IDT_1718,7,26,48,10
|
||||
COMBOBOX IDC_COMBO_HDC,64,25,155,120,CBS_DROPDOWNLIST |
|
||||
LTEXT "HD Controller:",IDT_1718,7,28,48,10
|
||||
COMBOBOX IDC_COMBO_HDC,64,26,155,120,CBS_DROPDOWNLIST |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
PUSHBUTTON "Configure",IDC_CONFIGURE_HDC,222,25,38,12
|
||||
PUSHBUTTON "Configure",IDC_CONFIGURE_HDC,222,26,38,12
|
||||
|
||||
LTEXT "FD Controller:",IDT_1768,7,44,48,10
|
||||
COMBOBOX IDC_COMBO_FDC,64,43,155,120,CBS_DROPDOWNLIST |
|
||||
LTEXT "FD Controller:",IDT_1768,7,47,48,10
|
||||
COMBOBOX IDC_COMBO_FDC,64,45,155,120,CBS_DROPDOWNLIST |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
PUSHBUTTON "Configure",IDC_CONFIGURE_FDC,222,43,38,12
|
||||
PUSHBUTTON "Configure",IDC_CONFIGURE_FDC,222,45,38,12
|
||||
|
||||
CONTROL "Tertiary IDE Controller",IDC_CHECK_IDE_TER,"Button",
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,7,62,199,10
|
||||
PUSHBUTTON "Configure",IDC_BUTTON_IDE_TER,222,61,38,12
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,7,66,199,10
|
||||
PUSHBUTTON "Configure",IDC_BUTTON_IDE_TER,222,64,38,12
|
||||
|
||||
CONTROL "Quaternary IDE Controller",IDC_CHECK_IDE_QUA,"Button",
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,7,80,199,10
|
||||
PUSHBUTTON "Configure",IDC_BUTTON_IDE_QUA,222,79,38,12
|
||||
|
||||
CONTROL "ISABugger device",IDC_CHECK_BUGGER,"Button",
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,7,98,94,10
|
||||
|
||||
CONTROL "POST card",IDC_CHECK_POSTCARD,"Button",
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,147,98,94,10
|
||||
|
||||
LTEXT "ISA RTC",IDT_1767,7,117,48,10
|
||||
COMBOBOX IDC_COMBO_ISARTC,64,116,155,120,
|
||||
CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
PUSHBUTTON "Configure",IDC_CONFIGURE_ISARTC,222,116,38,12
|
||||
|
||||
GROUPBOX "ISA Memory Expansion",IDC_GROUP_ISAMEM,7,136,255,70
|
||||
LTEXT "#1:",IDT_1763,12,148,21,10
|
||||
COMBOBOX IDC_COMBO_ISAMEM_1,25,147,190,120,
|
||||
CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
PUSHBUTTON "Configure",IDC_CONFIGURE_ISAMEM_1,217,147,38,12
|
||||
LTEXT "#2:",IDT_1764,12,162,21,10
|
||||
COMBOBOX IDC_COMBO_ISAMEM_2,25,161,190,120,
|
||||
CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
PUSHBUTTON "Configure",IDC_CONFIGURE_ISAMEM_2,217,161,38,12
|
||||
LTEXT "#3:",IDT_1765,12,176,21,10
|
||||
COMBOBOX IDC_COMBO_ISAMEM_3,25,175,190,120,
|
||||
CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
PUSHBUTTON "Configure",IDC_CONFIGURE_ISAMEM_3,217,175,38,12
|
||||
LTEXT "#4:",IDT_1766,12,190,21,10
|
||||
COMBOBOX IDC_COMBO_ISAMEM_4,25,189,190,120,
|
||||
CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
PUSHBUTTON "Configure",IDC_CONFIGURE_ISAMEM_4,217,189,38,12
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,7,85,199,10
|
||||
PUSHBUTTON "Configure",IDC_BUTTON_IDE_QUA,222,83,38,12
|
||||
END
|
||||
|
||||
DLG_CFG_HARD_DISKS DIALOG DISCARDABLE 107, 0, 267, 154
|
||||
@@ -575,13 +547,13 @@ BEGIN
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
END
|
||||
|
||||
DLG_CFG_HARD_DISKS_ADD DIALOG DISCARDABLE 0, 0, 219, 111
|
||||
DLG_CFG_HARD_DISKS_ADD DIALOG DISCARDABLE 0, 0, 219, 149
|
||||
STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Add Hard Disk"
|
||||
FONT 9, "Segoe UI"
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "OK",IDOK,55,89,50,14
|
||||
PUSHBUTTON "Cancel",IDCANCEL,112,89,50,14
|
||||
DEFPUSHBUTTON "OK",IDOK,55,127,50,14
|
||||
PUSHBUTTON "Cancel",IDCANCEL,112,127,50,14
|
||||
EDITTEXT IDC_EDIT_HD_FILE_NAME,7,16,153,12
|
||||
PUSHBUTTON "&Specify...",IDC_CFILE,167,16,44,12
|
||||
EDITTEXT IDC_EDIT_HD_SPT,183,34,28,12
|
||||
@@ -607,6 +579,12 @@ BEGIN
|
||||
LTEXT "ID:",IDT_1723,99,73,34,8
|
||||
COMBOBOX IDC_COMBO_HD_CHANNEL_IDE,134,71,77,12,CBS_DROPDOWNLIST |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
LTEXT "Image Format:",IDT_1774,7,92,50,12
|
||||
COMBOBOX IDC_COMBO_HD_IMG_FORMAT,58,90,153,12,CBS_DROPDOWNLIST |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
LTEXT "Block Size:",IDT_1775,7,111,50,12
|
||||
COMBOBOX IDC_COMBO_HD_BLOCK_SIZE,58,109,153,12,CBS_DROPDOWNLIST |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
LTEXT "Progress:",IDT_1752,7,7,204,9
|
||||
CONTROL "IMGCreateProgress",IDC_PBAR_IMG_CREATE,"msctls_progress32",PBS_SMOOTH |
|
||||
WS_BORDER,7,16,204,12
|
||||
@@ -685,6 +663,40 @@ BEGIN
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,218,205,44,10
|
||||
END
|
||||
|
||||
DLG_CFG_PERIPHERALS DIALOG DISCARDABLE 107, 0, 267, 154
|
||||
STYLE DS_CONTROL | WS_CHILD
|
||||
FONT 9, "Segoe UI"
|
||||
BEGIN
|
||||
LTEXT "ISA RTC:",IDT_1767,7,9,48,10
|
||||
COMBOBOX IDC_COMBO_ISARTC,64,7,155,120,
|
||||
CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
PUSHBUTTON "Configure",IDC_CONFIGURE_ISARTC,222,7,38,12
|
||||
|
||||
GROUPBOX "ISA Memory Expansion",IDC_GROUP_ISAMEM,7,28,253,93
|
||||
LTEXT "Card 1:",IDT_1763,16,45,48,10
|
||||
COMBOBOX IDC_COMBO_ISAMEM_1,73,43,137,120,
|
||||
CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
PUSHBUTTON "Configure",IDC_CONFIGURE_ISAMEM_1,213,43,38,12
|
||||
LTEXT "Card 2:",IDT_1764,16,64,48,10
|
||||
COMBOBOX IDC_COMBO_ISAMEM_2,73,62,137,120,
|
||||
CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
PUSHBUTTON "Configure",IDC_CONFIGURE_ISAMEM_2,213,62,38,12
|
||||
LTEXT "Card 3:",IDT_1765,16,83,48,10
|
||||
COMBOBOX IDC_COMBO_ISAMEM_3,73,81,137,120,
|
||||
CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
PUSHBUTTON "Configure",IDC_CONFIGURE_ISAMEM_3,213,81,38,12
|
||||
LTEXT "Card 4:",IDT_1766,16,102,48,10
|
||||
COMBOBOX IDC_COMBO_ISAMEM_4,73,100,137,120,
|
||||
CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
PUSHBUTTON "Configure",IDC_CONFIGURE_ISAMEM_4,213,100,38,12
|
||||
|
||||
CONTROL "ISABugger device",IDC_CHECK_BUGGER,"Button",
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,7,128,94,10
|
||||
|
||||
CONTROL "POST card",IDC_CHECK_POSTCARD,"Button",
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,147,128,94,10
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@@ -747,6 +759,7 @@ END
|
||||
249 ICON DISCARDABLE "win/icons/cdrom_disabled.ico"
|
||||
250 ICON DISCARDABLE "win/icons/zip_disabled.ico"
|
||||
251 ICON DISCARDABLE "win/icons/mo_disabled.ico"
|
||||
252 ICON DISCARDABLE "win/icons/storage_controllers.ico"
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
@@ -908,7 +921,7 @@ BEGIN
|
||||
2048 "86Box"
|
||||
IDS_2049 "Error"
|
||||
IDS_2050 "Fatal error"
|
||||
IDS_2051 "Are you sure you want to save the settings?"
|
||||
IDS_2051 "<reserved>"
|
||||
IDS_2052 "Press CTRL+ALT+PAGE DOWN to return to windowed mode."
|
||||
IDS_2053 "Speed"
|
||||
IDS_2054 "ZIP %03i %i (%s): %ls"
|
||||
@@ -932,11 +945,11 @@ BEGIN
|
||||
IDS_2068 "Sound"
|
||||
IDS_2069 "Network"
|
||||
IDS_2070 "Ports (COM & LPT)"
|
||||
IDS_2071 "Other peripherals"
|
||||
IDS_2071 "Storage controllers"
|
||||
IDS_2072 "Hard disks"
|
||||
IDS_2073 "Floppy & CD-ROM drives"
|
||||
IDS_2074 "Other removable devices"
|
||||
IDS_2075 "CD-ROM images (*.ISO;*.CUE)\0*.ISO;*.CUE\0All files (*.*)\0*.*\0"
|
||||
IDS_2075 "Other peripherals"
|
||||
IDS_2076 "Surface images (*.86F)\0*.86F\0"
|
||||
IDS_2077 "Click to capture mouse"
|
||||
IDS_2078 "Press F8+F12 to release mouse"
|
||||
@@ -986,9 +999,9 @@ BEGIN
|
||||
IDS_2118 "Internal controller"
|
||||
IDS_2119 "Exit"
|
||||
IDS_2120 "No ROMs found"
|
||||
IDS_2121 "Save changes\nThis will hard reset the emulated machine."
|
||||
IDS_2122 "Discard changes\nAll changes made to the settings will be lost."
|
||||
IDS_2123 "Cancel\nGo back to the Settings window."
|
||||
IDS_2121 "Do you want to save the settings?"
|
||||
IDS_2122 "This will hard reset the virtual machine."
|
||||
IDS_2123 "Save"
|
||||
IDS_2124 "About 86Box"
|
||||
IDS_2125 "86Box v" EMU_VERSION
|
||||
IDS_2126 "An emulator of old computers\n\nAuthors: Sarah Walker, Miran Grca, Fred N. van Kempen (waltje), SA1988, MoochMcGee, reenigne, leilei, JohnElliott, greatpsycho, and others.\n\nReleased under the GNU General Public License version 2. See LICENSE for more information."
|
||||
@@ -1021,10 +1034,12 @@ BEGIN
|
||||
IDS_2133 LIB_NAME_FLUIDSYNTH " is required for FluidSynth MIDI output."
|
||||
IDS_2134 "Entering fullscreen mode"
|
||||
IDS_2135 "Don't show this message again"
|
||||
IDS_2136 "Don't Exit"
|
||||
IDS_2136 "Don't exit"
|
||||
IDS_2137 "Reset"
|
||||
IDS_2138 "Don't Reset"
|
||||
IDS_2138 "Don't reset"
|
||||
IDS_2139 "MO images (*.IM?;*.MDI)\0*.IM?;*.MDI\0All files (*.*)\0*.*\0"
|
||||
IDS_2140 "CD-ROM images (*.ISO;*.CUE)\0*.ISO;*.CUE\0All files (*.*)\0*.*\0"
|
||||
IDS_2141 "%hs Device Configuration"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
@@ -1054,7 +1069,20 @@ BEGIN
|
||||
IDS_4118 "The selected file will be overwritten. Are you sure you want to use it?"
|
||||
IDS_4119 "Unsupported disk image"
|
||||
IDS_4120 "Overwrite"
|
||||
IDS_4121 "Don't Overwrite"
|
||||
IDS_4121 "Don't overwrite"
|
||||
IDS_4122 "Raw image (.img)"
|
||||
IDS_4123 "HDI image (.hdi)"
|
||||
IDS_4124 "HDX image (.hdx)"
|
||||
IDS_4125 "Fixed-size VHD (.vhd)"
|
||||
IDS_4126 "Dynamic-size VHD (.vhd)"
|
||||
IDS_4127 "Differencing VHD (.vhd)"
|
||||
IDS_4128 "Large blocks (2 MB)"
|
||||
IDS_4129 "Small blocks (512 KB)"
|
||||
IDS_4130 "VHD files (*.VHD)\0*.VHD\0All files (*.*)\0*.*\0"
|
||||
IDS_4131 "Select the parent VHD"
|
||||
IDS_4132 "This could mean that the parent image was modified after the differencing image was created.\n\nIt can also happen if the image files were moved or copied, or by a bug in the program that created this disk.\n\nDo you want to fix the timestamps?"
|
||||
IDS_4133 "Parent and child disk timestamps do not match"
|
||||
IDS_4134 "Could not fix VHD timestamp."
|
||||
|
||||
IDS_4352 "MFM/RLL"
|
||||
IDS_4353 "XTA"
|
||||
|
||||
@@ -303,7 +303,7 @@ endif
|
||||
# Nothing should need changing from here on.. #
|
||||
#########################################################################
|
||||
VPATH := $(EXPATH) . $(CODEGEN) cpu \
|
||||
cdrom chipset device disk floppy \
|
||||
cdrom chipset device disk disk/minivhd floppy \
|
||||
game machine mem printer \
|
||||
sio sound \
|
||||
sound/munt sound/munt/c_interface sound/munt/sha1 \
|
||||
@@ -509,10 +509,6 @@ ifeq ($(AMD_K5), y)
|
||||
OPTS += -DUSE_AMD_K5
|
||||
endif
|
||||
|
||||
ifeq ($(CL5422), y)
|
||||
OPTS += -DUSE_CL5422
|
||||
endif
|
||||
|
||||
ifeq ($(CYRIX_6X86), y)
|
||||
OPTS += -DUSE_CYRIX_6X86
|
||||
endif
|
||||
@@ -690,6 +686,10 @@ HDDOBJ := hdd.o \
|
||||
hdc_xtide.o hdc_ide.o \
|
||||
hdc_ide_opti611.o \
|
||||
hdc_ide_cmd640.o hdc_ide_sff8038i.o
|
||||
|
||||
MINIVHDOBJ := cwalk.o libxml2_encoding.o minivhd_convert.o \
|
||||
minivhd_create.o minivhd_io.o minivhd_manage.o \
|
||||
minivhd_struct_rw.o minivhd_util.o
|
||||
|
||||
CDROMOBJ := cdrom.o \
|
||||
cdrom_image_backend.o cdrom_image.o
|
||||
@@ -796,7 +796,7 @@ else
|
||||
endif
|
||||
|
||||
OBJ := $(MAINOBJ) $(CPUOBJ) $(CHIPSETOBJ) $(MCHOBJ) $(DEVOBJ) $(MEMOBJ) \
|
||||
$(FDDOBJ) $(GAMEOBJ) $(CDROMOBJ) $(ZIPOBJ) $(MOOBJ) $(HDDOBJ) \
|
||||
$(FDDOBJ) $(GAMEOBJ) $(CDROMOBJ) $(ZIPOBJ) $(MOOBJ) $(HDDOBJ) $(MINIVHDOBJ) \
|
||||
$(NETOBJ) $(PRINTOBJ) $(SCSIOBJ) $(SIOOBJ) $(SNDOBJ) $(VIDOBJ) \
|
||||
$(PLATOBJ) $(UIOBJ) $(FSYNTHOBJ) $(MUNTOBJ) $(DEVBROBJ) \
|
||||
$(DISCORDOBJ)
|
||||
@@ -813,7 +813,7 @@ endif
|
||||
ifneq ($(WX), n)
|
||||
LIBS += $(WX_LIBS) -lm
|
||||
endif
|
||||
LIBS += -lpng -lz -lwsock32 -lshell32 -liphlpapi -lpsapi -lSDL2 -limm32 -lhid -lsetupapi -loleaut32 -lversion -lwinmm -static -lstdc++
|
||||
LIBS += -lpng -lz -lwsock32 -lshell32 -liphlpapi -lpsapi -lSDL2 -limm32 -lhid -lsetupapi -loleaut32 -luxtheme -lversion -lwinmm -static -lstdc++
|
||||
ifneq ($(X64), y)
|
||||
LIBS += -Wl,--large-address-aware
|
||||
endif
|
||||
|
||||
BIN
src/win/icons/storage_controllers.ico
Normal file
BIN
src/win/icons/storage_controllers.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
121
src/win/win.c
121
src/win/win.c
@@ -21,6 +21,7 @@
|
||||
#define UNICODE
|
||||
#define NTDDI_VERSION 0x06010000
|
||||
#include <windows.h>
|
||||
#include <commctrl.h>
|
||||
#include <shlobj.h>
|
||||
#include <shobjidl.h>
|
||||
#include <fcntl.h>
|
||||
@@ -86,21 +87,14 @@ static const struct {
|
||||
void (*resize)(int x, int y);
|
||||
int (*pause)(void);
|
||||
void (*enable)(int enable);
|
||||
} vid_apis[2][RENDERERS_NUM] = {
|
||||
{
|
||||
{ "SDL_Software", 1, (int(*)(void*))sdl_inits, sdl_close, NULL, sdl_pause, sdl_enable },
|
||||
{ "SDL_Hardware", 1, (int(*)(void*))sdl_inith, sdl_close, NULL, sdl_pause, sdl_enable }
|
||||
void (*set_fs)(int fs);
|
||||
} vid_apis[RENDERERS_NUM] = {
|
||||
{ "SDL_Software", 1, (int(*)(void*))sdl_inits, sdl_close, NULL, sdl_pause, sdl_enable, sdl_set_fs },
|
||||
{ "SDL_Hardware", 1, (int(*)(void*))sdl_inith, sdl_close, NULL, sdl_pause, sdl_enable, sdl_set_fs },
|
||||
{ "SDL_OpenGL", 1, (int(*)(void*))sdl_initho, sdl_close, NULL, sdl_pause, sdl_enable, sdl_set_fs }
|
||||
#ifdef USE_VNC
|
||||
,{ "VNC", 0, vnc_init, vnc_close, vnc_resize, vnc_pause, NULL }
|
||||
,{ "VNC", 0, vnc_init, vnc_close, vnc_resize, vnc_pause, NULL, NULL }
|
||||
#endif
|
||||
},
|
||||
{
|
||||
{ "SDL_Software", 1, (int(*)(void*))sdl_inits_fs, sdl_close, sdl_resize, sdl_pause, sdl_enable },
|
||||
{ "SDL_Hardware", 1, (int(*)(void*))sdl_inith_fs, sdl_close, sdl_resize, sdl_pause, sdl_enable }
|
||||
#ifdef USE_VNC
|
||||
,{ "VNC", 0, vnc_init, vnc_close, vnc_resize, vnc_pause, NULL }
|
||||
#endif
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -679,8 +673,8 @@ plat_vidapi(char *name)
|
||||
if (!strcasecmp(name, "ddraw") || !strcasecmp(name, "sdl")) return(1);
|
||||
|
||||
for (i = 0; i < RENDERERS_NUM; i++) {
|
||||
if (vid_apis[0][i].name &&
|
||||
!strcasecmp(vid_apis[0][i].name, name)) return(i);
|
||||
if (vid_apis[i].name &&
|
||||
!strcasecmp(vid_apis[i].name, name)) return(i);
|
||||
}
|
||||
|
||||
/* Default value. */
|
||||
@@ -700,9 +694,12 @@ plat_vidapi_name(int api)
|
||||
break;
|
||||
case 1:
|
||||
break;
|
||||
case 2:
|
||||
name = "sdl_opengl";
|
||||
break;
|
||||
|
||||
#ifdef USE_VNC
|
||||
case 2:
|
||||
case 3:
|
||||
name = "vnc";
|
||||
break;
|
||||
#endif
|
||||
@@ -725,16 +722,16 @@ plat_setvid(int api)
|
||||
video_wait_for_blit();
|
||||
|
||||
/* Close the (old) API. */
|
||||
vid_apis[0][vid_api].close();
|
||||
vid_apis[vid_api].close();
|
||||
vid_api = api;
|
||||
|
||||
if (vid_apis[0][vid_api].local)
|
||||
if (vid_apis[vid_api].local)
|
||||
ShowWindow(hwndRender, SW_SHOW);
|
||||
else
|
||||
ShowWindow(hwndRender, SW_HIDE);
|
||||
|
||||
/* Initialize the (new) API. */
|
||||
i = vid_apis[0][vid_api].init((void *)hwndRender);
|
||||
i = vid_apis[vid_api].init((void *)hwndRender);
|
||||
endblit();
|
||||
if (! i) return(0);
|
||||
|
||||
@@ -750,11 +747,11 @@ plat_setvid(int api)
|
||||
void
|
||||
plat_vidsize(int x, int y)
|
||||
{
|
||||
if (!vid_api_inited || !vid_apis[video_fullscreen][vid_api].resize) return;
|
||||
if (!vid_api_inited || !vid_apis[vid_api].resize) return;
|
||||
|
||||
startblit();
|
||||
video_wait_for_blit();
|
||||
vid_apis[video_fullscreen][vid_api].resize(x, y);
|
||||
vid_apis[vid_api].resize(x, y);
|
||||
endblit();
|
||||
}
|
||||
|
||||
@@ -762,59 +759,93 @@ plat_vidsize(int x, int y)
|
||||
void
|
||||
plat_vidapi_enable(int enable)
|
||||
{
|
||||
if (!vid_api_inited || !vid_apis[video_fullscreen][vid_api].enable) return;
|
||||
int i = 1;
|
||||
|
||||
if (!vid_api_inited || !vid_apis[vid_api].enable)
|
||||
return;
|
||||
|
||||
startblit();
|
||||
video_wait_for_blit();
|
||||
vid_apis[video_fullscreen][vid_api].enable(enable);
|
||||
endblit();
|
||||
vid_apis[vid_api].enable(enable != 0);
|
||||
|
||||
if (! i)
|
||||
return;
|
||||
|
||||
if (enable)
|
||||
device_force_redraw();
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
get_vidpause(void)
|
||||
{
|
||||
return(vid_apis[video_fullscreen][vid_api].pause());
|
||||
return(vid_apis[vid_api].pause());
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
plat_setfullscreen(int on)
|
||||
{
|
||||
HWND *hw;
|
||||
RECT rect;
|
||||
int temp_x, temp_y;
|
||||
int dpi = win_get_dpi(hwndMain);
|
||||
|
||||
/* Want off and already off? */
|
||||
if (!on && !video_fullscreen) return;
|
||||
|
||||
/* Want on and already on? */
|
||||
if (on && video_fullscreen) return;
|
||||
/* Are we changing from the same state to the same state? */
|
||||
if ((!!on) == (!!video_fullscreen))
|
||||
return;
|
||||
|
||||
if (on && video_fullscreen_first) {
|
||||
video_fullscreen |= 2;
|
||||
if (ui_msgbox_header(MBX_INFO | MBX_DONTASK, (wchar_t *) IDS_2134, (wchar_t *) IDS_2052) == 10) {
|
||||
video_fullscreen_first = 0;
|
||||
config_save();
|
||||
}
|
||||
video_fullscreen &= 1;
|
||||
}
|
||||
|
||||
/* OK, claim the video. */
|
||||
startblit();
|
||||
video_wait_for_blit();
|
||||
|
||||
plat_vidapi_enable(0);
|
||||
|
||||
win_mouse_close();
|
||||
|
||||
/* Close the current mode, and open the new one. */
|
||||
vid_apis[video_fullscreen][vid_api].close();
|
||||
video_fullscreen = on;
|
||||
hw = (video_fullscreen) ? &hwndMain : &hwndRender;
|
||||
vid_apis[video_fullscreen][vid_api].init((void *) *hw);
|
||||
video_fullscreen = on | 2;
|
||||
if (vid_apis[vid_api].set_fs)
|
||||
vid_apis[vid_api].set_fs(on);
|
||||
if (!on) {
|
||||
plat_resize(scrnsz_x, scrnsz_y);
|
||||
if (vid_resize) {
|
||||
/* scale the screen base on DPI */
|
||||
if (dpi_scale) {
|
||||
temp_x = MulDiv(unscaled_size_x, dpi, 96);
|
||||
temp_y = MulDiv(unscaled_size_y, dpi, 96);
|
||||
} else {
|
||||
temp_x = unscaled_size_x;
|
||||
temp_y = unscaled_size_y;
|
||||
}
|
||||
/* Main Window. */
|
||||
ResizeWindowByClientArea(hwndMain, temp_x, temp_y + sbar_height);
|
||||
|
||||
/* Render window. */
|
||||
MoveWindow(hwndRender, 0, 0, temp_x, temp_y, TRUE);
|
||||
GetWindowRect(hwndRender, &rect);
|
||||
|
||||
/* Status bar. */
|
||||
MoveWindow(hwndSBAR, 0, rect.bottom, temp_x, 17, TRUE);
|
||||
|
||||
if (mouse_capture)
|
||||
ClipCursor(&rect);
|
||||
|
||||
scrnsz_x = unscaled_size_x;
|
||||
scrnsz_y = unscaled_size_y;
|
||||
}
|
||||
}
|
||||
video_fullscreen &= 1;
|
||||
video_force_resize_set(1);
|
||||
if (!on)
|
||||
doresize = 1;
|
||||
|
||||
win_mouse_init();
|
||||
|
||||
plat_vidapi_enable(1);
|
||||
|
||||
/* Release video and make it redraw the screen. */
|
||||
endblit();
|
||||
device_force_redraw();
|
||||
|
||||
/* Send a CTRL break code so CTRL does not get stuck. */
|
||||
@@ -823,6 +854,10 @@ plat_setfullscreen(int on)
|
||||
/* Finally, handle the host's mouse cursor. */
|
||||
/* win_log("%s full screen, %s cursor\n", on ? "enter" : "leave", on ? "hide" : "show"); */
|
||||
show_cursor(video_fullscreen ? 0 : -1);
|
||||
|
||||
/* This is needed for OpenGL. */
|
||||
plat_vidapi_enable(0);
|
||||
plat_vidapi_enable(1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -412,7 +412,7 @@ deviceconfig_dlgproc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
ws[c] = 0;
|
||||
}
|
||||
|
||||
if (!file_dlg(hdlg, ws, s, 0))
|
||||
if (!file_dlg(hdlg, ws, s, NULL, 0))
|
||||
SendMessage(h, WM_SETTEXT, 0, (LPARAM)wopenfilestring);
|
||||
}
|
||||
break;
|
||||
@@ -454,7 +454,8 @@ deviceconfig_inst_open(HWND hwnd, const device_t *device, int inst)
|
||||
|
||||
*data++ = 0; /*no menu*/
|
||||
*data++ = 0; /*predefined dialog box class*/
|
||||
data += MultiByteToWideChar(CP_ACP, 0, "Device Configuration", -1, data, 120);
|
||||
|
||||
data += wsprintf(data, plat_get_string(IDS_2141), device->name) + 1;
|
||||
|
||||
*data++ = 9; /*Point*/
|
||||
data += MultiByteToWideChar(CP_ACP, 0, "Segoe UI", -1, data, 120);
|
||||
@@ -499,7 +500,7 @@ deviceconfig_inst_open(HWND hwnd, const device_t *device, int inst)
|
||||
item->cx = 140;
|
||||
item->cy = 150;
|
||||
|
||||
item->style = WS_CHILD | WS_VISIBLE | CBS_DROPDOWN | WS_VSCROLL;
|
||||
item->style = WS_CHILD | WS_VISIBLE | CBS_DROPDOWNLIST | WS_VSCROLL;
|
||||
|
||||
data = (uint16_t *)(item + 1);
|
||||
*data++ = 0xFFFF;
|
||||
@@ -514,7 +515,7 @@ deviceconfig_inst_open(HWND hwnd, const device_t *device, int inst)
|
||||
/*Static text*/
|
||||
item = (DLGITEMTEMPLATE *)data;
|
||||
item->x = 10;
|
||||
item->y = y;
|
||||
item->y = y + 2;
|
||||
item->id = id++;
|
||||
|
||||
item->cx = 60;
|
||||
@@ -561,7 +562,7 @@ deviceconfig_inst_open(HWND hwnd, const device_t *device, int inst)
|
||||
/*Static text*/
|
||||
item = (DLGITEMTEMPLATE *)data;
|
||||
item->x = 10;
|
||||
item->y = y;
|
||||
item->y = y + 2;
|
||||
item->id = id++;
|
||||
|
||||
item->cx = 60;
|
||||
@@ -628,7 +629,7 @@ deviceconfig_inst_open(HWND hwnd, const device_t *device, int inst)
|
||||
/*Static text*/
|
||||
item = (DLGITEMTEMPLATE *)data;
|
||||
item->x = 10;
|
||||
item->y = y;
|
||||
item->y = y + 2;
|
||||
item->id = id++;
|
||||
|
||||
item->cx = 60;
|
||||
@@ -659,8 +660,8 @@ deviceconfig_inst_open(HWND hwnd, const device_t *device, int inst)
|
||||
dlg->cdit = (id - IDC_CONFIG_BASE) + 2;
|
||||
|
||||
item = (DLGITEMTEMPLATE *)data;
|
||||
item->x = 20;
|
||||
item->y = y;
|
||||
item->x = 100;
|
||||
item->y = y + 5;
|
||||
item->cx = 50;
|
||||
item->cy = 14;
|
||||
item->id = IDOK; /* OK button identifier */
|
||||
@@ -677,8 +678,8 @@ deviceconfig_inst_open(HWND hwnd, const device_t *device, int inst)
|
||||
data++;
|
||||
|
||||
item = (DLGITEMTEMPLATE *)data;
|
||||
item->x = 80;
|
||||
item->y = y;
|
||||
item->x = 160;
|
||||
item->y = y + 5;
|
||||
item->cx = 50;
|
||||
item->cy = 14;
|
||||
item->id = IDCANCEL; /* OK button identifier */
|
||||
@@ -691,7 +692,7 @@ deviceconfig_inst_open(HWND hwnd, const device_t *device, int inst)
|
||||
data += MultiByteToWideChar(CP_ACP, 0, "Cancel", -1, data, 50);
|
||||
*data++ = 0; /* no creation data */
|
||||
|
||||
dlg->cy = y + 20;
|
||||
dlg->cy = y + 25;
|
||||
|
||||
device_set_context(&config_device, device, inst);
|
||||
|
||||
|
||||
@@ -100,13 +100,14 @@ ui_msgbox_ex(int flags, void *header, void *message, void *btn1, void *btn2, voi
|
||||
|
||||
case MBX_QUESTION: /* question */
|
||||
case MBX_QUESTION_YN:
|
||||
case MBX_QUESTION_OK:
|
||||
if (!btn1) /* replace default "OK" button with "Yes" button */
|
||||
tdconfig.dwCommonButtons = TDCBF_YES_BUTTON;
|
||||
tdconfig.dwCommonButtons = (flags & MBX_QUESTION_OK) ? TDCBF_OK_BUTTON : TDCBF_YES_BUTTON;
|
||||
|
||||
if (btn2) /* "No" button */
|
||||
tdbuttons[tdconfig.cButtons++] = tdb_no;
|
||||
else
|
||||
tdconfig.dwCommonButtons |= TDCBF_NO_BUTTON;
|
||||
tdconfig.dwCommonButtons |= (flags & MBX_QUESTION_OK) ? TDCBF_CANCEL_BUTTON : TDCBF_NO_BUTTON;
|
||||
|
||||
if (flags & MBX_QUESTION) {
|
||||
if (btn3) /* "Cancel" button */
|
||||
@@ -114,6 +115,9 @@ ui_msgbox_ex(int flags, void *header, void *message, void *btn1, void *btn2, voi
|
||||
else
|
||||
tdconfig.dwCommonButtons |= TDCBF_CANCEL_BUTTON;
|
||||
}
|
||||
|
||||
if (flags & MBX_WARNING)
|
||||
tdconfig.pszMainIcon = TD_WARNING_ICON;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -152,7 +156,7 @@ ui_msgbox_ex(int flags, void *header, void *message, void *btn1, void *btn2, voi
|
||||
|
||||
|
||||
int
|
||||
file_dlg_w(HWND hwnd, WCHAR *f, WCHAR *fn, int save)
|
||||
file_dlg_w(HWND hwnd, WCHAR *f, WCHAR *fn, WCHAR *title, int save)
|
||||
{
|
||||
OPENFILENAME ofn;
|
||||
BOOL r;
|
||||
@@ -177,7 +181,9 @@ file_dlg_w(HWND hwnd, WCHAR *f, WCHAR *fn, int save)
|
||||
ofn.lpstrInitialDir = NULL;
|
||||
ofn.Flags = OFN_PATHMUSTEXIST;
|
||||
if (! save)
|
||||
ofn.Flags |= OFN_FILEMUSTEXIST;
|
||||
ofn.Flags |= OFN_FILEMUSTEXIST;
|
||||
if (title)
|
||||
ofn.lpstrTitle = title;
|
||||
|
||||
/* Display the Open dialog box. */
|
||||
if (save)
|
||||
@@ -199,37 +205,44 @@ file_dlg_w(HWND hwnd, WCHAR *f, WCHAR *fn, int save)
|
||||
|
||||
|
||||
int
|
||||
file_dlg(HWND hwnd, WCHAR *f, char *fn, int save)
|
||||
file_dlg(HWND hwnd, WCHAR *f, char *fn, char *title, int save)
|
||||
{
|
||||
WCHAR ufn[512];
|
||||
WCHAR ufn[512], title_buf[512];
|
||||
|
||||
mbstowcs(ufn, fn, strlen(fn) + 1);
|
||||
if (title)
|
||||
mbstowcs(title_buf, title, sizeof title_buf);
|
||||
|
||||
return(file_dlg_w(hwnd, f, ufn, save));
|
||||
return(file_dlg_w(hwnd, f, ufn, title ? title_buf : NULL, save));
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
file_dlg_mb(HWND hwnd, char *f, char *fn, int save)
|
||||
file_dlg_mb(HWND hwnd, char *f, char *fn, char *title, int save)
|
||||
{
|
||||
WCHAR uf[512], ufn[512];
|
||||
WCHAR uf[512], ufn[512], title_buf[512];
|
||||
|
||||
mbstowcs(uf, f, strlen(fn) + 1);
|
||||
mbstowcs(ufn, fn, strlen(fn) + 1);
|
||||
if (title)
|
||||
mbstowcs(title_buf, title, sizeof title_buf);
|
||||
|
||||
return(file_dlg_w(hwnd, uf, ufn, save));
|
||||
return(file_dlg_w(hwnd, uf, ufn, title ? title_buf : NULL, save));
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
file_dlg_w_st(HWND hwnd, int id, WCHAR *fn, int save)
|
||||
file_dlg_w_st(HWND hwnd, int id, WCHAR *fn, char *title, int save)
|
||||
{
|
||||
return(file_dlg_w(hwnd, plat_get_string(id), fn, save));
|
||||
WCHAR title_buf[512];
|
||||
if (title)
|
||||
mbstowcs(title_buf, title, sizeof title_buf);
|
||||
return(file_dlg_w(hwnd, plat_get_string(id), fn, title ? title_buf : NULL, save));
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
file_dlg_st(HWND hwnd, int id, char *fn, int save)
|
||||
{
|
||||
return(file_dlg(hwnd, plat_get_string(id), fn, save));
|
||||
file_dlg_st(HWND hwnd, int id, char *fn, char *title, int save)
|
||||
{
|
||||
return(file_dlg(hwnd, plat_get_string(id), fn, title, save));
|
||||
}
|
||||
|
||||
@@ -413,7 +413,7 @@ media_menu_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
wp = 1;
|
||||
/* FALLTHROUGH */
|
||||
case IDM_FLOPPY_IMAGE_EXISTING:
|
||||
ret = file_dlg_w_st(hwnd, IDS_2109, floppyfns[id], 0);
|
||||
ret = file_dlg_w_st(hwnd, IDS_2109, floppyfns[id], NULL, 0);
|
||||
if (! ret) {
|
||||
floppy_mount(id, wopenfilestring, wp);
|
||||
}
|
||||
@@ -424,7 +424,7 @@ media_menu_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
break;
|
||||
|
||||
case IDM_FLOPPY_EXPORT_TO_86F:
|
||||
ret = file_dlg_w_st(hwnd, IDS_2076, floppyfns[id], 1);
|
||||
ret = file_dlg_w_st(hwnd, IDS_2076, floppyfns[id], NULL, 1);
|
||||
if (! ret) {
|
||||
plat_pause(1);
|
||||
ret = d86f_export(id, wopenfilestring);
|
||||
@@ -450,7 +450,7 @@ media_menu_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
break;
|
||||
|
||||
case IDM_CDROM_IMAGE:
|
||||
if (!file_dlg_w_st(hwnd, IDS_2075, cdrom[id].image_path, 0)) {
|
||||
if (!file_dlg_w_st(hwnd, IDS_2140, cdrom[id].image_path, NULL, 0)) {
|
||||
cdrom_mount(id, wopenfilestring);
|
||||
}
|
||||
break;
|
||||
@@ -463,7 +463,7 @@ media_menu_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
wp = 1;
|
||||
/* FALLTHROUGH */
|
||||
case IDM_ZIP_IMAGE_EXISTING:
|
||||
ret = file_dlg_w_st(hwnd, IDS_2058, zip_drives[id].image_path, 0);
|
||||
ret = file_dlg_w_st(hwnd, IDS_2058, zip_drives[id].image_path, NULL, 0);
|
||||
if (! ret)
|
||||
zip_mount(id, wopenfilestring, wp);
|
||||
break;
|
||||
@@ -484,7 +484,7 @@ media_menu_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
wp = 1;
|
||||
/* FALLTHROUGH */
|
||||
case IDM_MO_IMAGE_EXISTING:
|
||||
ret = file_dlg_w_st(hwnd, IDS_2116, mo_drives[id].image_path, 0);
|
||||
ret = file_dlg_w_st(hwnd, IDS_2116, mo_drives[id].image_path, NULL, 0);
|
||||
if (! ret)
|
||||
mo_mount(id, wopenfilestring, wp);
|
||||
break;
|
||||
|
||||
@@ -777,7 +777,7 @@ NewFloppyDialogProcedure(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
return TRUE;
|
||||
|
||||
case IDC_CFILE:
|
||||
if (!file_dlg_w(hdlg, plat_get_string(is_mo ? IDS_2139 : (is_zip ? IDS_2055 : IDS_2062)), L"", 1)) {
|
||||
if (!file_dlg_w(hdlg, plat_get_string(is_mo ? IDS_2139 : (is_zip ? IDS_2055 : IDS_2062)), L"", NULL, 1)) {
|
||||
if (!wcschr(wopenfilestring, L'.')) {
|
||||
if (wcslen(wopenfilestring) && (wcslen(wopenfilestring) <= 256)) {
|
||||
twcs = &wopenfilestring[wcslen(wopenfilestring)];
|
||||
|
||||
@@ -75,20 +75,63 @@
|
||||
|
||||
#define RENDERER_FULL_SCREEN 1
|
||||
#define RENDERER_HARDWARE 2
|
||||
#define RENDERER_OPENGL 4
|
||||
|
||||
|
||||
static SDL_Window *sdl_win = NULL;
|
||||
static SDL_Renderer *sdl_render = NULL;
|
||||
static SDL_Texture *sdl_tex = NULL;
|
||||
static HWND sdl_parent_hwnd = NULL;
|
||||
static HWND sdl_hwnd = NULL;
|
||||
static int sdl_w, sdl_h;
|
||||
static int sdl_fs;
|
||||
static int sdl_fs, sdl_flags = -1;
|
||||
static int cur_w, cur_h;
|
||||
static int cur_wx = 0, cur_wy = 0, cur_ww =0, cur_wh = 0;
|
||||
static volatile int sdl_enabled = 0;
|
||||
static SDL_mutex* sdl_mutex = NULL;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
const void *magic;
|
||||
Uint32 id;
|
||||
char *title;
|
||||
SDL_Surface *icon;
|
||||
int x, y;
|
||||
int w, h;
|
||||
int min_w, min_h;
|
||||
int max_w, max_h;
|
||||
Uint32 flags;
|
||||
Uint32 last_fullscreen_flags;
|
||||
|
||||
/* Stored position and size for windowed mode */
|
||||
SDL_Rect windowed;
|
||||
|
||||
SDL_DisplayMode fullscreen_mode;
|
||||
|
||||
float brightness;
|
||||
Uint16 *gamma;
|
||||
Uint16 *saved_gamma; /* (just offset into gamma) */
|
||||
|
||||
SDL_Surface *surface;
|
||||
SDL_bool surface_valid;
|
||||
|
||||
SDL_bool is_hiding;
|
||||
SDL_bool is_destroying;
|
||||
|
||||
void *shaper;
|
||||
|
||||
SDL_HitTest hit_test;
|
||||
void *hit_test_data;
|
||||
|
||||
void *data;
|
||||
|
||||
void *driverdata;
|
||||
|
||||
SDL_Window *prev;
|
||||
SDL_Window *next;
|
||||
} SDL_Window_Ex;
|
||||
|
||||
|
||||
#ifdef ENABLE_SDL_LOG
|
||||
int sdl_do_log = ENABLE_SDL_LOG;
|
||||
|
||||
@@ -137,6 +180,7 @@ sdl_stretch(int *w, int *h, int *x, int *y)
|
||||
|
||||
switch (video_fullscreen_scale) {
|
||||
case FULLSCR_SCALE_FULL:
|
||||
default:
|
||||
*w = sdl_w;
|
||||
*h = sdl_h;
|
||||
*x = 0;
|
||||
@@ -181,8 +225,6 @@ sdl_stretch(int *w, int *h, int *x, int *y)
|
||||
*y = (int) dy;
|
||||
break;
|
||||
}
|
||||
|
||||
sdl_reinit_texture();
|
||||
}
|
||||
|
||||
|
||||
@@ -190,49 +232,23 @@ static void
|
||||
sdl_blit(int x, int y, int y1, int y2, int w, int h)
|
||||
{
|
||||
SDL_Rect r_src;
|
||||
void *pixeldata;
|
||||
int pitch;
|
||||
int yy, ret;
|
||||
int ret;
|
||||
|
||||
if (!sdl_enabled) {
|
||||
video_blit_complete();
|
||||
return;
|
||||
}
|
||||
|
||||
if ((y1 == y2) || (h <= 0)) {
|
||||
video_blit_complete();
|
||||
return;
|
||||
}
|
||||
|
||||
if (render_buffer == NULL) {
|
||||
if (!sdl_enabled || (y1 == y2) || (h <= 0) || (render_buffer == NULL)) {
|
||||
video_blit_complete();
|
||||
return;
|
||||
}
|
||||
|
||||
SDL_LockMutex(sdl_mutex);
|
||||
|
||||
/*
|
||||
* TODO:
|
||||
* SDL_UpdateTexture() might be better here, as it is
|
||||
* (reportedly) slightly faster.
|
||||
*/
|
||||
SDL_LockTexture(sdl_tex, 0, &pixeldata, &pitch);
|
||||
|
||||
for (yy = y1; yy < y2; yy++) {
|
||||
if ((y + yy) >= 0 && (y + yy) < render_buffer->h)
|
||||
memcpy((uint32_t *) &(((uint8_t *)pixeldata)[yy * pitch]), &(render_buffer->line[y + yy][x]), w * 4);
|
||||
}
|
||||
|
||||
r_src.x = 0;
|
||||
r_src.y = y1;
|
||||
r_src.w = w;
|
||||
r_src.h = y2 - y1;
|
||||
SDL_UpdateTexture(sdl_tex, &r_src, &(render_buffer->dat)[y1 * w], w * 4);
|
||||
video_blit_complete();
|
||||
|
||||
SDL_UnlockTexture(sdl_tex);
|
||||
|
||||
if (sdl_fs) {
|
||||
sdl_log("sdl_blit(%i, %i, %i, %i, %i, %i) (%i, %i)\n", x, y, y1, y2, w, h, unscaled_size_x, efscrnsz_y);
|
||||
if (w == unscaled_size_x)
|
||||
sdl_resize(w, h);
|
||||
sdl_log("(%08X, %08X, %08X)\n", sdl_win, sdl_render, sdl_tex);
|
||||
}
|
||||
SDL_RenderClear(sdl_render);
|
||||
|
||||
r_src.x = 0;
|
||||
r_src.y = 0;
|
||||
@@ -244,14 +260,36 @@ sdl_blit(int x, int y, int y1, int y2, int w, int h)
|
||||
sdl_log("SDL: unable to copy texture to renderer (%s)\n", sdl_GetError());
|
||||
|
||||
SDL_RenderPresent(sdl_render);
|
||||
|
||||
SDL_UnlockMutex(sdl_mutex);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
sdl_destroy_window(void)
|
||||
{
|
||||
if (sdl_win != NULL) {
|
||||
SDL_DestroyWindow(sdl_win);
|
||||
sdl_win = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
sdl_destroy_texture(void)
|
||||
{
|
||||
/* SDL_DestroyRenderer also automatically destroys all associated textures. */
|
||||
if (sdl_render != NULL) {
|
||||
SDL_DestroyRenderer(sdl_render);
|
||||
sdl_render = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
sdl_close(void)
|
||||
{
|
||||
SDL_LockMutex(sdl_mutex);
|
||||
|
||||
/* Unregister our renderer! */
|
||||
video_setblit(NULL);
|
||||
|
||||
@@ -263,32 +301,10 @@ sdl_close(void)
|
||||
sdl_mutex = NULL;
|
||||
}
|
||||
|
||||
if (sdl_tex != NULL) {
|
||||
SDL_DestroyTexture(sdl_tex);
|
||||
sdl_tex = NULL;
|
||||
}
|
||||
|
||||
if (sdl_render != NULL) {
|
||||
SDL_DestroyRenderer(sdl_render);
|
||||
sdl_render = NULL;
|
||||
}
|
||||
|
||||
if (sdl_win != NULL) {
|
||||
SDL_DestroyWindow(sdl_win);
|
||||
sdl_win = NULL;
|
||||
}
|
||||
|
||||
if (sdl_hwnd != NULL) {
|
||||
plat_set_input(hwndMain);
|
||||
|
||||
ShowWindow(hwndRender, TRUE);
|
||||
|
||||
SetFocus(hwndMain);
|
||||
|
||||
if (sdl_fs)
|
||||
DestroyWindow(sdl_hwnd);
|
||||
sdl_hwnd = NULL;
|
||||
}
|
||||
sdl_destroy_texture();
|
||||
sdl_destroy_window();
|
||||
ImmAssociateContext(hwndMain, NULL);
|
||||
SetFocus(hwndMain);
|
||||
|
||||
if (sdl_parent_hwnd != NULL) {
|
||||
DestroyWindow(sdl_parent_hwnd);
|
||||
@@ -297,6 +313,7 @@ sdl_close(void)
|
||||
|
||||
/* Quit. */
|
||||
SDL_Quit();
|
||||
sdl_flags = -1;
|
||||
}
|
||||
|
||||
|
||||
@@ -320,13 +337,87 @@ sdl_select_best_hw_driver(void)
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
sdl_reinit_texture(void)
|
||||
{
|
||||
if (sdl_flags == -1)
|
||||
return;
|
||||
|
||||
sdl_destroy_texture();
|
||||
|
||||
if (sdl_flags & RENDERER_HARDWARE) {
|
||||
sdl_render = SDL_CreateRenderer(sdl_win, -1, SDL_RENDERER_ACCELERATED);
|
||||
SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "2");
|
||||
} else
|
||||
sdl_render = SDL_CreateRenderer(sdl_win, -1, SDL_RENDERER_SOFTWARE);
|
||||
|
||||
sdl_tex = SDL_CreateTexture(sdl_render, SDL_PIXELFORMAT_ARGB8888,
|
||||
SDL_TEXTUREACCESS_STREAMING, 2048, 2048);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
sdl_set_fs(int fs)
|
||||
{
|
||||
int w = 0, h = 0, x = 0, y = 0;
|
||||
RECT rect;
|
||||
|
||||
SDL_LockMutex(sdl_mutex);
|
||||
sdl_enabled = 0;
|
||||
sdl_destroy_texture();
|
||||
|
||||
if (fs) {
|
||||
ShowWindow(sdl_parent_hwnd, TRUE);
|
||||
SetParent(hwndRender, sdl_parent_hwnd);
|
||||
ShowWindow(hwndRender, TRUE);
|
||||
MoveWindow(sdl_parent_hwnd, 0, 0, sdl_w, sdl_h, TRUE);
|
||||
|
||||
/* Show the window, make it topmost, and give it focus. */
|
||||
w = unscaled_size_x;
|
||||
h = efscrnsz_y;
|
||||
sdl_stretch(&w, &h, &x, &y);
|
||||
MoveWindow(hwndRender, x, y, w, h, TRUE);
|
||||
ImmAssociateContext(sdl_parent_hwnd, NULL);
|
||||
SetFocus(sdl_parent_hwnd);
|
||||
|
||||
/* Redirect RawInput to this new window. */
|
||||
old_capture = mouse_capture;
|
||||
GetWindowRect(hwndRender, &rect);
|
||||
ClipCursor(&rect);
|
||||
mouse_capture = 1;
|
||||
} else {
|
||||
SetParent(hwndRender, hwndMain);
|
||||
ShowWindow(sdl_parent_hwnd, FALSE);
|
||||
ShowWindow(hwndRender, TRUE);
|
||||
ImmAssociateContext(hwndMain, NULL);
|
||||
SetFocus(hwndMain);
|
||||
mouse_capture = old_capture;
|
||||
|
||||
if (mouse_capture) {
|
||||
GetWindowRect(hwndRender, &rect);
|
||||
ClipCursor(&rect);
|
||||
} else
|
||||
ClipCursor(&oldclip);
|
||||
}
|
||||
|
||||
sdl_fs = fs;
|
||||
|
||||
if (fs)
|
||||
sdl_flags |= RENDERER_FULL_SCREEN;
|
||||
else
|
||||
sdl_flags &= ~RENDERER_FULL_SCREEN;
|
||||
|
||||
sdl_reinit_texture();
|
||||
sdl_enabled = 1;
|
||||
SDL_UnlockMutex(sdl_mutex);
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
sdl_init_common(int flags)
|
||||
{
|
||||
wchar_t temp[128];
|
||||
SDL_version ver;
|
||||
int w = 0, h = 0, x = 0, y = 0;
|
||||
RECT rect;
|
||||
|
||||
sdl_log("SDL: init (fs=%d)\n", fs);
|
||||
|
||||
@@ -340,114 +431,31 @@ sdl_init_common(int flags)
|
||||
return(0);
|
||||
}
|
||||
|
||||
if (flags & RENDERER_HARDWARE)
|
||||
sdl_select_best_hw_driver();
|
||||
|
||||
if (flags & RENDERER_FULL_SCREEN) {
|
||||
/* Get the size of the (current) desktop. */
|
||||
sdl_w = GetSystemMetrics(SM_CXSCREEN);
|
||||
sdl_h = GetSystemMetrics(SM_CYSCREEN);
|
||||
|
||||
/* Create the desktop-covering window. */
|
||||
_swprintf(temp, L"%s v%s", EMU_NAME_W, EMU_VERSION_W);
|
||||
sdl_parent_hwnd = CreateWindow(SUB_CLASS_NAME,
|
||||
temp,
|
||||
WS_POPUP,
|
||||
0, 0, sdl_w, sdl_h,
|
||||
HWND_DESKTOP,
|
||||
NULL,
|
||||
hinstance,
|
||||
NULL);
|
||||
|
||||
SetWindowPos(sdl_parent_hwnd, HWND_TOPMOST,
|
||||
0, 0, sdl_w, sdl_h, SWP_SHOWWINDOW);
|
||||
|
||||
/* Create the actual rendering window. */
|
||||
_swprintf(temp, L"%s v%s", EMU_NAME_W, EMU_VERSION_W);
|
||||
sdl_hwnd = CreateWindow(SUB_CLASS_NAME,
|
||||
temp,
|
||||
WS_POPUP,
|
||||
0, 0, sdl_w, sdl_h,
|
||||
sdl_parent_hwnd,
|
||||
NULL,
|
||||
hinstance,
|
||||
NULL);
|
||||
sdl_log("SDL: FS %dx%d window at %08lx\n", sdl_w, sdl_h, sdl_hwnd);
|
||||
|
||||
/* Redirect RawInput to this new window. */
|
||||
plat_set_input(sdl_hwnd);
|
||||
|
||||
SetFocus(sdl_hwnd);
|
||||
|
||||
/* Show the window, make it topmost, and give it focus. */
|
||||
w = unscaled_size_x;
|
||||
h = efscrnsz_y;
|
||||
sdl_stretch(&w, &h, &x, &y);
|
||||
SetWindowPos(sdl_hwnd, sdl_parent_hwnd,
|
||||
x, y, w, h, SWP_SHOWWINDOW);
|
||||
|
||||
/* Now create the SDL window from that. */
|
||||
sdl_win = SDL_CreateWindowFrom((void *)sdl_hwnd);
|
||||
|
||||
old_capture = mouse_capture;
|
||||
|
||||
GetWindowRect(sdl_hwnd, &rect);
|
||||
|
||||
ClipCursor(&rect);
|
||||
|
||||
mouse_capture = 1;
|
||||
} else {
|
||||
/* Create the SDL window from the render window. */
|
||||
sdl_win = SDL_CreateWindowFrom((void *)hwndRender);
|
||||
|
||||
mouse_capture = old_capture;
|
||||
|
||||
if (mouse_capture) {
|
||||
GetWindowRect(hwndRender, &rect);
|
||||
|
||||
ClipCursor(&rect);
|
||||
} else {
|
||||
ClipCursor(&oldclip);
|
||||
}
|
||||
if (flags & RENDERER_HARDWARE) {
|
||||
if (flags & RENDERER_OPENGL)
|
||||
SDL_SetHint(SDL_HINT_RENDER_DRIVER, "OpenGL");
|
||||
else
|
||||
sdl_select_best_hw_driver();
|
||||
}
|
||||
|
||||
/* Get the size of the (current) desktop. */
|
||||
sdl_w = GetSystemMetrics(SM_CXSCREEN);
|
||||
sdl_h = GetSystemMetrics(SM_CYSCREEN);
|
||||
|
||||
/* Create the desktop-covering window. */
|
||||
_swprintf(temp, L"%s v%s", EMU_NAME_W, EMU_VERSION_W);
|
||||
sdl_parent_hwnd = CreateWindow(SDL_CLASS_NAME, temp, WS_POPUP, 0, 0, sdl_w, sdl_h,
|
||||
HWND_DESKTOP, NULL, hinstance, NULL);
|
||||
ShowWindow(sdl_parent_hwnd, FALSE);
|
||||
|
||||
sdl_flags = flags;
|
||||
|
||||
if (sdl_win == NULL) {
|
||||
sdl_log("SDL: unable to CreateWindowFrom (%s)\n", SDL_GetError());
|
||||
sdl_close();
|
||||
return(0);
|
||||
}
|
||||
|
||||
/*
|
||||
* TODO:
|
||||
* SDL_RENDERER_SOFTWARE, because SDL tries to do funky stuff
|
||||
* otherwise (it turns off Win7 Aero and it looks like it's
|
||||
* trying to switch to fullscreen even though the window is
|
||||
* not a fullscreen window?)
|
||||
*/
|
||||
if (flags & RENDERER_HARDWARE) {
|
||||
sdl_render = SDL_CreateRenderer(sdl_win, -1, SDL_RENDERER_ACCELERATED);
|
||||
SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "2");
|
||||
} else
|
||||
sdl_render = SDL_CreateRenderer(sdl_win, -1, SDL_RENDERER_SOFTWARE);
|
||||
|
||||
if (sdl_render == NULL) {
|
||||
sdl_log("SDL: unable to create renderer (%s)\n", SDL_GetError());
|
||||
sdl_close();
|
||||
return(0);
|
||||
}
|
||||
|
||||
/*
|
||||
* TODO:
|
||||
* Actually the source is (apparently) XRGB8888, but the alpha
|
||||
* channel seems to be set to 255 everywhere, so ARGB8888 works
|
||||
* just as well.
|
||||
*/
|
||||
sdl_tex = SDL_CreateTexture(sdl_render, SDL_PIXELFORMAT_ARGB8888,
|
||||
SDL_TEXTUREACCESS_STREAMING, 2048, 2048);
|
||||
if (sdl_tex == NULL) {
|
||||
sdl_log("SDL: unable to create texture (%s)\n", SDL_GetError());
|
||||
sdl_close();
|
||||
return(0);
|
||||
}
|
||||
sdl_win = SDL_CreateWindowFrom((void *)hwndRender);
|
||||
sdl_set_fs(video_fullscreen & 1);
|
||||
|
||||
/* Make sure we get a clean exit. */
|
||||
atexit(sdl_close);
|
||||
@@ -455,10 +463,7 @@ sdl_init_common(int flags)
|
||||
/* Register our renderer! */
|
||||
video_setblit(sdl_blit);
|
||||
|
||||
sdl_fs = !!(flags & RENDERER_FULL_SCREEN);
|
||||
|
||||
sdl_enabled = 1;
|
||||
|
||||
sdl_mutex = SDL_CreateMutex();
|
||||
|
||||
return(1);
|
||||
@@ -480,28 +485,9 @@ sdl_inith(HWND h)
|
||||
|
||||
|
||||
int
|
||||
sdl_inits_fs(HWND h)
|
||||
sdl_initho(HWND h)
|
||||
{
|
||||
return sdl_init_common(RENDERER_FULL_SCREEN);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
sdl_inith_fs(HWND h)
|
||||
{
|
||||
return sdl_init_common(RENDERER_FULL_SCREEN | RENDERER_HARDWARE);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
sdl_reinit_texture()
|
||||
{
|
||||
if (sdl_render == NULL)
|
||||
return;
|
||||
|
||||
SDL_DestroyTexture(sdl_tex);
|
||||
sdl_tex = SDL_CreateTexture(sdl_render, SDL_PIXELFORMAT_ARGB8888,
|
||||
SDL_TEXTUREACCESS_STREAMING, 2048, 2048);
|
||||
return sdl_init_common(RENDERER_HARDWARE | RENDERER_OPENGL);
|
||||
}
|
||||
|
||||
|
||||
@@ -517,26 +503,52 @@ sdl_resize(int x, int y)
|
||||
{
|
||||
int ww = 0, wh = 0, wx = 0, wy = 0;
|
||||
|
||||
if (video_fullscreen & 2)
|
||||
return;
|
||||
|
||||
if ((x == cur_w) && (y == cur_h))
|
||||
return;
|
||||
|
||||
SDL_LockMutex(sdl_mutex);
|
||||
|
||||
ww = x;
|
||||
wh = y;
|
||||
|
||||
if (sdl_fs) {
|
||||
sdl_stretch(&ww, &wh, &wx, &wy);
|
||||
MoveWindow(sdl_hwnd, wx, wy, ww, wh, TRUE);
|
||||
MoveWindow(hwndRender, wx, wy, ww, wh, TRUE);
|
||||
}
|
||||
|
||||
cur_w = x;
|
||||
cur_h = y;
|
||||
|
||||
cur_wx = wx;
|
||||
cur_wy = wy;
|
||||
cur_ww = ww;
|
||||
cur_wh = wh;
|
||||
|
||||
SDL_SetWindowSize(sdl_win, cur_ww, cur_wh);
|
||||
SDL_SetWindowPosition(sdl_win, cur_wx, cur_wy);
|
||||
|
||||
sdl_reinit_texture();
|
||||
|
||||
SDL_UnlockMutex(sdl_mutex);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
sdl_enable(int enable)
|
||||
{
|
||||
sdl_enabled = enable;
|
||||
if (sdl_flags == -1)
|
||||
return;
|
||||
|
||||
SDL_LockMutex(sdl_mutex);
|
||||
sdl_enabled = !!enable;
|
||||
|
||||
if (enable == 1) {
|
||||
SDL_SetWindowSize(sdl_win, cur_ww, cur_wh);
|
||||
sdl_reinit_texture();
|
||||
}
|
||||
|
||||
SDL_UnlockMutex(sdl_mutex);
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
262
src/win/win_ui.c
262
src/win/win_ui.c
@@ -28,6 +28,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
#include <wchar.h>
|
||||
#include <86box/plat.h>
|
||||
#include <86box/86box.h>
|
||||
#include <86box/config.h>
|
||||
#include "../cpu/cpu.h"
|
||||
@@ -38,7 +39,6 @@
|
||||
#include <86box/nvr.h>
|
||||
#include <86box/video.h>
|
||||
#include <86box/vid_ega.h> // for update_overscan
|
||||
#include <86box/plat.h>
|
||||
#include <86box/plat_midi.h>
|
||||
#include <86box/plat_dynld.h>
|
||||
#include <86box/ui.h>
|
||||
@@ -216,6 +216,7 @@ ResetAllMenus(void)
|
||||
CheckMenuItem(menuMain, IDM_VID_RESIZE, MF_UNCHECKED);
|
||||
CheckMenuItem(menuMain, IDM_VID_SDL_SW, MF_UNCHECKED);
|
||||
CheckMenuItem(menuMain, IDM_VID_SDL_HW, MF_UNCHECKED);
|
||||
CheckMenuItem(menuMain, IDM_VID_SDL_OPENGL, MF_UNCHECKED);
|
||||
#ifdef USE_VNC
|
||||
CheckMenuItem(menuMain, IDM_VID_VNC, MF_UNCHECKED);
|
||||
#endif
|
||||
@@ -372,6 +373,85 @@ plat_power_off(void)
|
||||
}
|
||||
|
||||
|
||||
/* Catch WM_INPUT messages for 'current focus' window. */
|
||||
#if defined(__amd64__) || defined(__aarch64__)
|
||||
static LRESULT CALLBACK
|
||||
#else
|
||||
static BOOL CALLBACK
|
||||
#endif
|
||||
input_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch (message) {
|
||||
case WM_INPUT:
|
||||
if (infocus) {
|
||||
UINT size = 0;
|
||||
PRAWINPUT raw = NULL;
|
||||
|
||||
/* Here we read the raw input data */
|
||||
GetRawInputData((HRAWINPUT)lParam, RID_INPUT, NULL, &size, sizeof(RAWINPUTHEADER));
|
||||
raw = (PRAWINPUT)malloc(size);
|
||||
if (GetRawInputData((HRAWINPUT)lParam, RID_INPUT, raw, &size, sizeof(RAWINPUTHEADER)) == size) {
|
||||
switch(raw->header.dwType)
|
||||
{
|
||||
case RIM_TYPEKEYBOARD:
|
||||
keyboard_handle(raw);
|
||||
break;
|
||||
case RIM_TYPEMOUSE:
|
||||
win_mouse_handle(raw);
|
||||
break;
|
||||
case RIM_TYPEHID:
|
||||
win_joystick_handle(raw);
|
||||
break;
|
||||
}
|
||||
}
|
||||
free(raw);
|
||||
}
|
||||
break;
|
||||
case WM_SETFOCUS:
|
||||
infocus = 1;
|
||||
#ifndef NO_KEYBOARD_HOOK
|
||||
if (! hook_enabled) {
|
||||
hKeyboardHook = SetWindowsHookEx(WH_KEYBOARD_LL,
|
||||
LowLevelKeyboardProc,
|
||||
GetModuleHandle(NULL),
|
||||
0);
|
||||
hook_enabled = 1;
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
|
||||
case WM_KILLFOCUS:
|
||||
infocus = 0;
|
||||
plat_mouse_capture(0);
|
||||
#ifndef NO_KEYBOARD_HOOK
|
||||
if (hook_enabled) {
|
||||
UnhookWindowsHookEx(hKeyboardHook);
|
||||
hook_enabled = 0;
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
|
||||
case WM_LBUTTONUP:
|
||||
pclog("video_fullscreen = %i\n", video_fullscreen);
|
||||
if (! video_fullscreen)
|
||||
plat_mouse_capture(1);
|
||||
break;
|
||||
|
||||
case WM_MBUTTONUP:
|
||||
if (mouse_get_buttons() < 3)
|
||||
plat_mouse_capture(0);
|
||||
break;
|
||||
|
||||
default:
|
||||
return(1);
|
||||
/* return(CallWindowProc((WNDPROC)input_orig_proc,
|
||||
hwnd, message, wParam, lParam)); */
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
static LRESULT CALLBACK
|
||||
MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
@@ -382,6 +462,9 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
int temp_x, temp_y;
|
||||
|
||||
if (input_proc(hwnd, message, wParam, lParam) == 0)
|
||||
return(0);
|
||||
|
||||
switch (message) {
|
||||
case WM_CREATE:
|
||||
SetTimer(hwnd, TIMER_1SEC, 1000, NULL);
|
||||
@@ -418,7 +501,6 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
break;
|
||||
|
||||
case IDM_ACTION_RESET_CAD:
|
||||
pclog("-\n");
|
||||
pc_send_cad();
|
||||
break;
|
||||
|
||||
@@ -538,6 +620,7 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
case IDM_VID_SDL_SW:
|
||||
case IDM_VID_SDL_HW:
|
||||
case IDM_VID_SDL_OPENGL:
|
||||
#ifdef USE_VNC
|
||||
case IDM_VID_VNC:
|
||||
#endif
|
||||
@@ -570,6 +653,7 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
CheckMenuItem(hmenu, IDM_VID_SCALE_1X+scale, MF_UNCHECKED);
|
||||
scale = LOWORD(wParam) - IDM_VID_SCALE_1X;
|
||||
CheckMenuItem(hmenu, IDM_VID_SCALE_1X+scale, MF_CHECKED);
|
||||
reset_screen_size();
|
||||
device_force_redraw();
|
||||
video_force_resize_set(1);
|
||||
config_save();
|
||||
@@ -715,11 +799,10 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
GetWindowRect(hwndSBAR, &rect);
|
||||
sbar_height = rect.bottom - rect.top;
|
||||
rect_p = (RECT*)lParam;
|
||||
if (vid_resize) {
|
||||
if (vid_resize)
|
||||
MoveWindow(hwnd, rect_p->left, rect_p->top, rect_p->right - rect_p->left, rect_p->bottom - rect_p->top, TRUE);
|
||||
} else if (!user_resize) {
|
||||
else if (!user_resize)
|
||||
doresize = 1;
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_SIZE:
|
||||
@@ -730,6 +813,7 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
temp_y = (lParam >> 16);
|
||||
|
||||
if ((temp_x <= 0) || (temp_y <= 0)) {
|
||||
plat_vidapi_enable(0);
|
||||
minimized = 1;
|
||||
break;
|
||||
} else if (minimized == 1) {
|
||||
@@ -769,7 +853,7 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
window_h = rect.bottom - rect.top;
|
||||
save_window_pos = 1;
|
||||
}
|
||||
plat_vidapi_enable(1);
|
||||
plat_vidapi_enable(2);
|
||||
|
||||
config_save();
|
||||
break;
|
||||
@@ -936,6 +1020,14 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
#endif
|
||||
break;
|
||||
|
||||
case WM_ACTIVATE:
|
||||
if ((wParam != WA_INACTIVE) && !(video_fullscreen & 2)) {
|
||||
video_force_resize_set(1);
|
||||
plat_vidapi_enable(0);
|
||||
plat_vidapi_enable(1);
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_ENTERSIZEMOVE:
|
||||
user_resize = 1;
|
||||
break;
|
||||
@@ -956,6 +1048,38 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
static LRESULT CALLBACK
|
||||
SubWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch (message) {
|
||||
case WM_LBUTTONUP:
|
||||
if (! video_fullscreen)
|
||||
plat_mouse_capture(1);
|
||||
break;
|
||||
|
||||
case WM_MBUTTONUP:
|
||||
if (mouse_get_buttons() < 3)
|
||||
plat_mouse_capture(0);
|
||||
break;
|
||||
|
||||
default:
|
||||
return(DefWindowProc(hwnd, message, wParam, lParam));
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
static LRESULT CALLBACK
|
||||
SDLMainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
if (input_proc(hwnd, message, wParam, lParam) == 0)
|
||||
return(0);
|
||||
|
||||
return(DefWindowProc(hwnd, message, wParam, lParam));
|
||||
}
|
||||
|
||||
|
||||
static LRESULT CALLBACK
|
||||
SDLSubWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
return(DefWindowProc(hwnd, message, wParam, lParam));
|
||||
}
|
||||
@@ -1046,6 +1170,14 @@ ui_init(int nCmdShow)
|
||||
return(2);
|
||||
wincl.lpszClassName = SUB_CLASS_NAME;
|
||||
wincl.lpfnWndProc = SubWindowProcedure;
|
||||
if (! RegisterClassEx(&wincl))
|
||||
return(2);
|
||||
wincl.lpszClassName = SDL_CLASS_NAME;
|
||||
wincl.lpfnWndProc = SDLMainWindowProcedure;
|
||||
if (! RegisterClassEx(&wincl))
|
||||
return(2);
|
||||
wincl.lpszClassName = SDL_SUB_CLASS_NAME;
|
||||
wincl.lpfnWndProc = SDLSubWindowProcedure;
|
||||
if (! RegisterClassEx(&wincl))
|
||||
return(2);
|
||||
|
||||
@@ -1071,18 +1203,18 @@ ui_init(int nCmdShow)
|
||||
|
||||
ui_window_title(title);
|
||||
|
||||
/* Get the current DPI */
|
||||
dpi = win_get_dpi(hwndMain);
|
||||
/* Get the current DPI */
|
||||
dpi = win_get_dpi(hwndMain);
|
||||
|
||||
/* Check if we have a padded window frame */
|
||||
padded_frame = (GetSystemMetrics(SM_CXPADDEDBORDER) != 0);
|
||||
/* Check if we have a padded window frame */
|
||||
padded_frame = (GetSystemMetrics(SM_CXPADDEDBORDER) != 0);
|
||||
|
||||
/* Create the status bar window. */
|
||||
StatusBarCreate(hwndMain, IDC_STATUS, hinstance);
|
||||
|
||||
/* Get the actual height of the status bar */
|
||||
GetWindowRect(hwndSBAR, &sbar_rect);
|
||||
sbar_height = sbar_rect.bottom - sbar_rect.top;
|
||||
/* Get the actual height of the status bar */
|
||||
GetWindowRect(hwndSBAR, &sbar_rect);
|
||||
sbar_height = sbar_rect.bottom - sbar_rect.top;
|
||||
|
||||
/* Set up main window for resizing if configured. */
|
||||
if (vid_resize)
|
||||
@@ -1118,9 +1250,6 @@ ui_init(int nCmdShow)
|
||||
}
|
||||
keyboard_getkeymap();
|
||||
|
||||
/* Set up the main window for RawInput. */
|
||||
plat_set_input(hwndMain);
|
||||
|
||||
/* Load the accelerator table */
|
||||
haccel = LoadAccelerators(hinstance, ACCEL_NAME);
|
||||
if (haccel == NULL) {
|
||||
@@ -1139,7 +1268,7 @@ ui_init(int nCmdShow)
|
||||
ghMutex = CreateMutex(NULL, FALSE, NULL);
|
||||
|
||||
/* Create the Machine Rendering window. */
|
||||
hwndRender = CreateWindow(L"STATIC", NULL, WS_CHILD|SS_BITMAP,
|
||||
hwndRender = CreateWindow(/*L"STATIC"*/ SUB_CLASS_NAME, NULL, WS_CHILD|SS_BITMAP,
|
||||
0, 0, 1, 1, hwnd, NULL, hinstance, NULL);
|
||||
MoveWindow(hwndRender, 0, 0, scrnsz_x, scrnsz_y, TRUE);
|
||||
|
||||
@@ -1231,6 +1360,8 @@ ui_init(int nCmdShow)
|
||||
/* Close down the emulator. */
|
||||
do_stop();
|
||||
|
||||
UnregisterClass(SDL_SUB_CLASS_NAME, hinstance);
|
||||
UnregisterClass(SDL_CLASS_NAME, hinstance);
|
||||
UnregisterClass(SUB_CLASS_NAME, hinstance);
|
||||
UnregisterClass(CLASS_NAME, hinstance);
|
||||
|
||||
@@ -1374,100 +1505,3 @@ plat_mouse_capture(int on)
|
||||
mouse_capture = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Catch WM_INPUT messages for 'current focus' window. */
|
||||
static LONG_PTR input_orig_proc;
|
||||
static HWND input_orig_hwnd = NULL;
|
||||
#if defined(__amd64__) || defined(__aarch64__)
|
||||
static LRESULT CALLBACK
|
||||
#else
|
||||
static BOOL CALLBACK
|
||||
#endif
|
||||
input_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch (message) {
|
||||
case WM_INPUT:
|
||||
if (infocus) {
|
||||
UINT size = 0;
|
||||
PRAWINPUT raw = NULL;
|
||||
|
||||
/* Here we read the raw input data */
|
||||
GetRawInputData((HRAWINPUT)lParam, RID_INPUT, NULL, &size, sizeof(RAWINPUTHEADER));
|
||||
raw = (PRAWINPUT)malloc(size);
|
||||
if (GetRawInputData((HRAWINPUT)lParam, RID_INPUT, raw, &size, sizeof(RAWINPUTHEADER)) == size) {
|
||||
switch(raw->header.dwType)
|
||||
{
|
||||
case RIM_TYPEKEYBOARD:
|
||||
keyboard_handle(raw);
|
||||
break;
|
||||
case RIM_TYPEMOUSE:
|
||||
win_mouse_handle(raw);
|
||||
break;
|
||||
case RIM_TYPEHID:
|
||||
win_joystick_handle(raw);
|
||||
break;
|
||||
}
|
||||
}
|
||||
free(raw);
|
||||
}
|
||||
break;
|
||||
case WM_SETFOCUS:
|
||||
infocus = 1;
|
||||
#ifndef NO_KEYBOARD_HOOK
|
||||
if (! hook_enabled) {
|
||||
hKeyboardHook = SetWindowsHookEx(WH_KEYBOARD_LL,
|
||||
LowLevelKeyboardProc,
|
||||
GetModuleHandle(NULL),
|
||||
0);
|
||||
hook_enabled = 1;
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
|
||||
case WM_KILLFOCUS:
|
||||
infocus = 0;
|
||||
plat_mouse_capture(0);
|
||||
#ifndef NO_KEYBOARD_HOOK
|
||||
if (hook_enabled) {
|
||||
UnhookWindowsHookEx(hKeyboardHook);
|
||||
hook_enabled = 0;
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
|
||||
case WM_LBUTTONUP:
|
||||
if (! video_fullscreen)
|
||||
plat_mouse_capture(1);
|
||||
break;
|
||||
|
||||
case WM_MBUTTONUP:
|
||||
if (mouse_get_buttons() < 3)
|
||||
plat_mouse_capture(0);
|
||||
break;
|
||||
|
||||
default:
|
||||
return(CallWindowProc((WNDPROC)input_orig_proc,
|
||||
hwnd, message, wParam, lParam));
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
/* Set up a handler for the 'currently active' window. */
|
||||
void
|
||||
plat_set_input(HWND h)
|
||||
{
|
||||
/* If needed, rest the old one first. */
|
||||
if (input_orig_hwnd != NULL) {
|
||||
SetWindowLongPtr(input_orig_hwnd, GWLP_WNDPROC,
|
||||
(LONG_PTR)input_orig_proc);
|
||||
}
|
||||
|
||||
/* Redirect the window procedure so we can catch WM_INPUT. */
|
||||
input_orig_proc = GetWindowLongPtr(h, GWLP_WNDPROC);
|
||||
input_orig_hwnd = h;
|
||||
SetWindowLongPtr(h, GWLP_WNDPROC, (LONG_PTR)&input_proc);
|
||||
ImmAssociateContext(h, NULL);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user