Merge pull request #1571 from 86Box/master
Bring the branch up to par with master.
This commit is contained in:
@@ -45,6 +45,7 @@ MainMenu MENU DISCARDABLE
|
||||
BEGIN
|
||||
POPUP "&Action"
|
||||
BEGIN
|
||||
MENUITEM "&Keyboard requires capture", IDM_ACTION_KBD_REQ_CAPTURE
|
||||
MENUITEM "&Right CTRL is left ALT", IDM_ACTION_RCTRL_IS_LALT
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "&Hard Reset", IDM_ACTION_HRESET
|
||||
@@ -58,6 +59,8 @@ BEGIN
|
||||
END
|
||||
POPUP "&View"
|
||||
BEGIN
|
||||
MENUITEM "&Hide status bar", IDM_VID_HIDE_STATUS_BAR
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "&Resizeable window", IDM_VID_RESIZE
|
||||
MENUITEM "R&emember size && position", IDM_VID_REMEMBER
|
||||
MENUITEM SEPARATOR
|
||||
@@ -186,6 +189,34 @@ BEGIN
|
||||
MENUITEM SEPARATOR
|
||||
END
|
||||
|
||||
CassetteSubmenu MENU DISCARDABLE
|
||||
BEGIN
|
||||
POPUP ""
|
||||
BEGIN
|
||||
MENUITEM "&New image...", IDM_CASSETTE_IMAGE_NEW
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "&Existing image...", IDM_CASSETTE_IMAGE_EXISTING
|
||||
MENUITEM "Existing image (&Write-protected)...", IDM_CASSETTE_IMAGE_EXISTING_WP
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "&Record", IDM_CASSETTE_RECORD
|
||||
MENUITEM "&Play", IDM_CASSETTE_PLAY
|
||||
MENUITEM "&Rewind to the beginning", IDM_CASSETTE_REWIND
|
||||
MENUITEM "&Fast forward to the end", IDM_CASSETTE_FAST_FORWARD
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "E&ject", IDM_CASSETTE_EJECT
|
||||
END
|
||||
END
|
||||
|
||||
CartridgeSubmenu MENU DISCARDABLE
|
||||
BEGIN
|
||||
POPUP ""
|
||||
BEGIN
|
||||
MENUITEM "&Image...", IDM_CARTRIDGE_IMAGE
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "E&ject", IDM_CARTRIDGE_EJECT
|
||||
END
|
||||
END
|
||||
|
||||
FloppySubmenu MENU DISCARDABLE
|
||||
BEGIN
|
||||
POPUP ""
|
||||
@@ -548,32 +579,48 @@ BEGIN
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,7,118,94,10
|
||||
END
|
||||
|
||||
DLG_CFG_STORAGE DIALOG DISCARDABLE 107, 0, 267, 111
|
||||
DLG_CFG_STORAGE DIALOG DISCARDABLE 107, 0, 267, 203
|
||||
STYLE DS_CONTROL | WS_CHILD
|
||||
FONT 9, "Segoe UI"
|
||||
BEGIN
|
||||
LTEXT "SCSI Controller:",IDT_1717,7,9,64,10
|
||||
COMBOBOX IDC_COMBO_SCSI,64,7,155,120,CBS_DROPDOWNLIST |
|
||||
LTEXT "HD Controller:",IDT_1718,7,9,64,10
|
||||
COMBOBOX IDC_COMBO_HDC,64,7,155,120,CBS_DROPDOWNLIST |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
PUSHBUTTON "Configure",IDC_CONFIGURE_SCSI,222,7,38,12
|
||||
PUSHBUTTON "Configure",IDC_CONFIGURE_HDC,222,7,38,12
|
||||
|
||||
LTEXT "HD Controller:",IDT_1718,7,28,64,10
|
||||
COMBOBOX IDC_COMBO_HDC,64,26,155,120,CBS_DROPDOWNLIST |
|
||||
LTEXT "FD Controller:",IDT_1768,7,28,64,10
|
||||
COMBOBOX IDC_COMBO_FDC,64,26,155,120,CBS_DROPDOWNLIST |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
PUSHBUTTON "Configure",IDC_CONFIGURE_HDC,222,26,38,12
|
||||
|
||||
LTEXT "FD Controller:",IDT_1768,7,47,64,10
|
||||
COMBOBOX IDC_COMBO_FDC,64,45,155,120,CBS_DROPDOWNLIST |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
PUSHBUTTON "Configure",IDC_CONFIGURE_FDC,222,45,38,12
|
||||
PUSHBUTTON "Configure",IDC_CONFIGURE_FDC,222,26,38,12
|
||||
|
||||
CONTROL "Tertiary IDE Controller",IDC_CHECK_IDE_TER,"Button",
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,7,66,199,10
|
||||
PUSHBUTTON "Configure",IDC_BUTTON_IDE_TER,222,64,38,12
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,7,47,199,10
|
||||
PUSHBUTTON "Configure",IDC_BUTTON_IDE_TER,222,45,38,12
|
||||
|
||||
CONTROL "Quaternary IDE Controller",IDC_CHECK_IDE_QUA,"Button",
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,7,85,199,10
|
||||
PUSHBUTTON "Configure",IDC_BUTTON_IDE_QUA,222,83,38,12
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,7,66,199,10
|
||||
PUSHBUTTON "Configure",IDC_BUTTON_IDE_QUA,222,64,38,12
|
||||
|
||||
GROUPBOX "SCSI",IDC_GROUP_SCSI,7,85,253,93
|
||||
LTEXT "Controller 1:",IDT_1763,16,102,48,10
|
||||
COMBOBOX IDC_COMBO_SCSI_1,73,100,137,120,
|
||||
CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
PUSHBUTTON "Configure",IDC_CONFIGURE_SCSI_1,213,100,38,12
|
||||
LTEXT "Controller 2:",IDT_1764,16,121,48,10
|
||||
COMBOBOX IDC_COMBO_SCSI_2,73,119,137,120,
|
||||
CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
PUSHBUTTON "Configure",IDC_CONFIGURE_SCSI_2,213,119,38,12
|
||||
LTEXT "Controller 3:",IDT_1765,16,140,48,10
|
||||
COMBOBOX IDC_COMBO_SCSI_3,73,138,137,120,
|
||||
CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
PUSHBUTTON "Configure",IDC_CONFIGURE_SCSI_3,213,138,38,12
|
||||
LTEXT "Controller 4:",IDT_1766,16,159,48,10
|
||||
COMBOBOX IDC_COMBO_SCSI_4,73,157,137,120,
|
||||
CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
PUSHBUTTON "Configure",IDC_CONFIGURE_SCSI_4,213,157,38,12
|
||||
|
||||
CONTROL "Cassette",IDC_CHECK_CASSETTE,"Button",
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,7,185,94,10
|
||||
END
|
||||
|
||||
DLG_CFG_HARD_DISKS DIALOG DISCARDABLE 107, 0, 267, 154
|
||||
@@ -796,6 +843,7 @@ END
|
||||
81 ICON DISCARDABLE ICON_PATH "icons/hard_disk_active.ico"
|
||||
96 ICON DISCARDABLE ICON_PATH "icons/network.ico"
|
||||
97 ICON DISCARDABLE ICON_PATH "icons/network_active.ico"
|
||||
104 ICON DISCARDABLE ICON_PATH "icons/cartridge.ico"
|
||||
144 ICON DISCARDABLE ICON_PATH "icons/floppy_525_empty.ico"
|
||||
145 ICON DISCARDABLE ICON_PATH "icons/floppy_525_empty_active.ico"
|
||||
152 ICON DISCARDABLE ICON_PATH "icons/floppy_35_empty.ico"
|
||||
@@ -808,6 +856,7 @@ END
|
||||
185 ICON DISCARDABLE ICON_PATH "icons/mo_empty_active.ico"
|
||||
192 ICON DISCARDABLE ICON_PATH "icons/cassette_empty.ico"
|
||||
193 ICON DISCARDABLE ICON_PATH "icons/cassette_empty_active.ico"
|
||||
232 ICON DISCARDABLE ICON_PATH "icons/cartridge_empty.ico"
|
||||
240 ICON DISCARDABLE ICON_PATH "icons/machine.ico"
|
||||
241 ICON DISCARDABLE ICON_PATH "icons/display.ico"
|
||||
242 ICON DISCARDABLE ICON_PATH "icons/input_devices.ico"
|
||||
@@ -1107,13 +1156,17 @@ BEGIN
|
||||
IDS_2145 "You are loading an unsupported configuration"
|
||||
IDS_2146 "CPU type filtering based on selected machine is disabled for this emulated machine.\n\nThis makes it possible to choose a CPU that is otherwise incompatible with the selected machine. However, you may run into incompatibilities with the machine BIOS or other software.\n\nEnabling this setting is not officially supported and any bug reports filed may be closed as invalid."
|
||||
IDS_2147 "Continue"
|
||||
IDS_2148 "Cassette: %s"
|
||||
IDS_2149 "Cassette images (*.PCM;*.RAW;*.WAV;*.CAS)\0*.PCM;*.RAW;*.WAV;*.CAS\0All files (*.*)\0*.*\0"
|
||||
IDS_2150 "Cartridge %i: %ls"
|
||||
IDS_2151 "Cartridge images (*.A;*.B;*.JRC)\0*.A;*.B;*.JRC\0All files (*.*)\0*.*\0"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
IDS_4096 "Hard disk (%s)"
|
||||
IDS_4097 "%01i:%01i"
|
||||
IDS_4098 "%i"
|
||||
IDS_4098 "%01i"
|
||||
IDS_4099 "MFM/RLL or ESDI CD-ROM drives never existed"
|
||||
IDS_4100 "Custom..."
|
||||
IDS_4101 "Custom (large)..."
|
||||
@@ -1150,6 +1203,7 @@ BEGIN
|
||||
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_4135 "%01i:%02i"
|
||||
|
||||
IDS_4352 "MFM/RLL"
|
||||
IDS_4353 "XTA"
|
||||
@@ -1163,7 +1217,7 @@ BEGIN
|
||||
IDS_4610 "ESDI (%01i:%01i)"
|
||||
IDS_4611 "IDE (%01i:%01i)"
|
||||
IDS_4612 "ATAPI (%01i:%01i)"
|
||||
IDS_4613 "SCSI (ID %02i)"
|
||||
IDS_4613 "SCSI (%01i:%02i)"
|
||||
|
||||
IDS_5120 "CD-ROM %i (%s): %s"
|
||||
|
||||
@@ -1173,7 +1227,7 @@ BEGIN
|
||||
|
||||
IDS_5632 "Disabled"
|
||||
IDS_5637 "ATAPI (%01i:%01i)"
|
||||
IDS_5638 "SCSI (ID %02i)"
|
||||
IDS_5638 "SCSI (%01i:%02i)"
|
||||
|
||||
IDS_5888 "160 kB"
|
||||
IDS_5889 "180 kB"
|
||||
|
||||
BIN
src/win/icons/cartridge.ico
Normal file
BIN
src/win/icons/cartridge.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
BIN
src/win/icons/cartridge_empty.ico
Normal file
BIN
src/win/icons/cartridge_empty.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
@@ -69,6 +69,7 @@ HANDLE ghMutex;
|
||||
LCID lang_id; /* current language ID used */
|
||||
DWORD dwSubLangID;
|
||||
int acp_utf8; /* Windows supports UTF-8 codepage */
|
||||
volatile int cpu_thread_run = 1;
|
||||
|
||||
|
||||
/* Local data. */
|
||||
@@ -487,7 +488,7 @@ main_thread(void *param)
|
||||
title_update = 1;
|
||||
old_time = GetTickCount();
|
||||
drawits = frames = 0;
|
||||
while (!is_quit) {
|
||||
while (!is_quit && cpu_thread_run) {
|
||||
/* See if it is time to run a frame of code. */
|
||||
new_time = GetTickCount();
|
||||
drawits += (new_time - old_time);
|
||||
@@ -512,7 +513,7 @@ main_thread(void *param)
|
||||
// Sleep(1);
|
||||
|
||||
/* If needed, handle a screen resize. */
|
||||
if (doresize && !video_fullscreen) {
|
||||
if (doresize && !video_fullscreen && !is_quit) {
|
||||
if (vid_resize & 2)
|
||||
plat_resize(fixed_size_x, fixed_size_y);
|
||||
else
|
||||
@@ -520,6 +521,8 @@ main_thread(void *param)
|
||||
doresize = 0;
|
||||
}
|
||||
}
|
||||
|
||||
is_quit = 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -543,7 +546,7 @@ do_start(void)
|
||||
win_log("Main timer precision: %llu\n", timer_freq);
|
||||
|
||||
/* Start the emulator, really. */
|
||||
thMain = thread_create(main_thread, &is_quit);
|
||||
thMain = thread_create(main_thread, NULL);
|
||||
SetThreadPriority(thMain, THREAD_PRIORITY_HIGHEST);
|
||||
}
|
||||
|
||||
@@ -552,16 +555,17 @@ do_start(void)
|
||||
void
|
||||
do_stop(void)
|
||||
{
|
||||
is_quit = 1;
|
||||
/* Claim the video blitter. */
|
||||
startblit();
|
||||
|
||||
plat_delay_ms(100);
|
||||
|
||||
if (source_hwnd)
|
||||
PostMessage((HWND) (uintptr_t) source_hwnd, WM_HAS_SHUTDOWN, (WPARAM) 0, (LPARAM) hwndMain);
|
||||
vid_apis[vid_api].close();
|
||||
|
||||
pc_close(thMain);
|
||||
|
||||
thMain = NULL;
|
||||
|
||||
if (source_hwnd)
|
||||
PostMessage((HWND) (uintptr_t) source_hwnd, WM_HAS_SHUTDOWN, (WPARAM) 0, (LPARAM) hwndMain);
|
||||
}
|
||||
|
||||
|
||||
@@ -1072,7 +1076,10 @@ plat_setfullscreen(int on)
|
||||
GetClientRect(hwndMain, &rect);
|
||||
|
||||
temp_x = rect.right - rect.left + 1;
|
||||
temp_y = rect.bottom - rect.top + 1 - sbar_height;
|
||||
if (hide_status_bar)
|
||||
temp_y = rect.bottom - rect.top + 1;
|
||||
else
|
||||
temp_y = rect.bottom - rect.top + 1 - sbar_height;
|
||||
} else {
|
||||
if (dpi_scale) {
|
||||
temp_x = MulDiv((vid_resize & 2) ? fixed_size_x : unscaled_size_x, dpi, 96);
|
||||
@@ -1083,7 +1090,10 @@ plat_setfullscreen(int on)
|
||||
}
|
||||
|
||||
/* Main Window. */
|
||||
ResizeWindowByClientArea(hwndMain, temp_x, temp_y + sbar_height);
|
||||
if (hide_status_bar)
|
||||
ResizeWindowByClientArea(hwndMain, temp_x, temp_y);
|
||||
else
|
||||
ResizeWindowByClientArea(hwndMain, temp_x, temp_y + sbar_height);
|
||||
}
|
||||
|
||||
/* Render window. */
|
||||
|
||||
@@ -27,8 +27,12 @@
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <wchar.h>
|
||||
#include <86box/86box.h>
|
||||
#include <86box/config.h>
|
||||
#include <86box/timer.h>
|
||||
#include <86box/device.h>
|
||||
#include <86box/cassette.h>
|
||||
#include <86box/cartridge.h>
|
||||
#include <86box/fdd.h>
|
||||
#include <86box/hdd.h>
|
||||
#include <86box/scsi_device.h>
|
||||
@@ -41,6 +45,57 @@
|
||||
#include <86box/win.h>
|
||||
|
||||
|
||||
void
|
||||
cassette_mount(char *fn, uint8_t wp)
|
||||
{
|
||||
pc_cas_set_fname(cassette, NULL);
|
||||
memset(cassette_fname, 0, sizeof(cassette_fname));
|
||||
cassette_ui_writeprot = wp;
|
||||
pc_cas_set_fname(cassette, fn);
|
||||
if (fn != NULL)
|
||||
memcpy(cassette_fname, fn, MIN(511, strlen(fn)));
|
||||
ui_sb_update_icon_state(SB_CASSETTE, (fn == NULL) ? 1 : 0);
|
||||
media_menu_update_cassette();
|
||||
ui_sb_update_tip(SB_CASSETTE);
|
||||
config_save();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
cassette_eject(void)
|
||||
{
|
||||
pc_cas_set_fname(cassette, NULL);
|
||||
memset(cassette_fname, 0x00, sizeof(cassette_fname));
|
||||
ui_sb_update_icon_state(SB_CASSETTE, 1);
|
||||
media_menu_update_cassette();
|
||||
ui_sb_update_tip(SB_CASSETTE);
|
||||
config_save();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
cartridge_mount(uint8_t id, char *fn, uint8_t wp)
|
||||
{
|
||||
cart_close(id);
|
||||
cart_load(id, fn);
|
||||
ui_sb_update_icon_state(SB_CARTRIDGE | id, strlen(cart_fns[id]) ? 0 : 1);
|
||||
media_menu_update_cartridge(id);
|
||||
ui_sb_update_tip(SB_CARTRIDGE | id);
|
||||
config_save();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
cartridge_eject(uint8_t id)
|
||||
{
|
||||
cart_close(id);
|
||||
ui_sb_update_icon_state(SB_CARTRIDGE | id, 1);
|
||||
media_menu_update_cartridge(id);
|
||||
ui_sb_update_tip(SB_CARTRIDGE | id);
|
||||
config_save();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
floppy_mount(uint8_t id, char *fn, uint8_t wp)
|
||||
{
|
||||
@@ -53,6 +108,7 @@ floppy_mount(uint8_t id, char *fn, uint8_t wp)
|
||||
config_save();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
floppy_eject(uint8_t id)
|
||||
{
|
||||
|
||||
@@ -114,89 +114,92 @@ keyboard_handle(PRAWINPUT raw)
|
||||
static int recv_lalt = 0, recv_ralt = 0, recv_tab = 0;
|
||||
|
||||
RAWKEYBOARD rawKB = raw->data.keyboard;
|
||||
scancode = rawKB.MakeCode;
|
||||
scancode = rawKB.MakeCode;
|
||||
|
||||
/* If it's not a scan code that starts with 0xE1 */
|
||||
if (!(rawKB.Flags & RI_KEY_E1)) {
|
||||
if (rawKB.Flags & RI_KEY_E0)
|
||||
scancode |= 0x100;
|
||||
if (kbd_req_capture && !mouse_capture && !video_fullscreen)
|
||||
return;
|
||||
|
||||
/* Translate the scan code to 9-bit */
|
||||
scancode = convert_scan_code(scancode);
|
||||
/* If it's not a scan code that starts with 0xE1 */
|
||||
if (!(rawKB.Flags & RI_KEY_E1)) {
|
||||
if (rawKB.Flags & RI_KEY_E0)
|
||||
scancode |= 0x100;
|
||||
|
||||
/* Remap it according to the list from the Registry */
|
||||
if (scancode != scancode_map[scancode])
|
||||
pclog("Scan code remap: %03X -> %03X\n", scancode, scancode);
|
||||
scancode = scancode_map[scancode];
|
||||
/* Translate the scan code to 9-bit */
|
||||
scancode = convert_scan_code(scancode);
|
||||
|
||||
/* If it's not 0xFFFF, send it to the emulated
|
||||
keyboard.
|
||||
We use scan code 0xFFFF to mean a mapping that
|
||||
has a prefix other than E0 and that is not E1 1D,
|
||||
which is, for our purposes, invalid. */
|
||||
if ((scancode == 0x00F) &&
|
||||
!(rawKB.Flags & RI_KEY_BREAK) &&
|
||||
(recv_lalt || recv_ralt) &&
|
||||
!mouse_capture) {
|
||||
/* We received a TAB while ALT was pressed, while the mouse
|
||||
is not captured, suppress the TAB and send an ALT key up. */
|
||||
if (recv_lalt) {
|
||||
keyboard_input(0, 0x038);
|
||||
/* Extra key press and release so the guest is not stuck in the
|
||||
menu bar. */
|
||||
keyboard_input(1, 0x038);
|
||||
keyboard_input(0, 0x038);
|
||||
recv_lalt = 0;
|
||||
}
|
||||
if (recv_ralt) {
|
||||
keyboard_input(0, 0x138);
|
||||
/* Extra key press and release so the guest is not stuck in the
|
||||
menu bar. */
|
||||
keyboard_input(1, 0x138);
|
||||
keyboard_input(0, 0x138);
|
||||
recv_ralt = 0;
|
||||
}
|
||||
} else if (((scancode == 0x038) || (scancode == 0x138)) &&
|
||||
!(rawKB.Flags & RI_KEY_BREAK) &&
|
||||
recv_tab &&
|
||||
!mouse_capture) {
|
||||
/* We received an ALT while TAB was pressed, while the mouse
|
||||
is not captured, suppress the ALT and send a TAB key up. */
|
||||
keyboard_input(0, 0x00F);
|
||||
recv_tab = 0;
|
||||
} else {
|
||||
switch(scancode) {
|
||||
case 0x00F:
|
||||
recv_tab = !(rawKB.Flags & RI_KEY_BREAK);
|
||||
break;
|
||||
case 0x038:
|
||||
recv_lalt = !(rawKB.Flags & RI_KEY_BREAK);
|
||||
break;
|
||||
case 0x138:
|
||||
recv_ralt = !(rawKB.Flags & RI_KEY_BREAK);
|
||||
break;
|
||||
}
|
||||
/* Remap it according to the list from the Registry */
|
||||
if (scancode != scancode_map[scancode])
|
||||
pclog("Scan code remap: %03X -> %03X\n", scancode, scancode);
|
||||
scancode = scancode_map[scancode];
|
||||
|
||||
/* Translate right CTRL to left ALT if the user has so
|
||||
chosen. */
|
||||
if ((scancode == 0x11D) && rctrl_is_lalt)
|
||||
scancode = 0x038;
|
||||
|
||||
/* Normal scan code pass through, pass it through as is if
|
||||
it's not an invalid scan code. */
|
||||
if (scancode != 0xFFFF)
|
||||
keyboard_input(!(rawKB.Flags & RI_KEY_BREAK), scancode);
|
||||
/* If it's not 0xFFFF, send it to the emulated
|
||||
keyboard.
|
||||
We use scan code 0xFFFF to mean a mapping that
|
||||
has a prefix other than E0 and that is not E1 1D,
|
||||
which is, for our purposes, invalid. */
|
||||
if ((scancode == 0x00F) &&
|
||||
!(rawKB.Flags & RI_KEY_BREAK) &&
|
||||
(recv_lalt || recv_ralt) &&
|
||||
!mouse_capture) {
|
||||
/* We received a TAB while ALT was pressed, while the mouse
|
||||
is not captured, suppress the TAB and send an ALT key up. */
|
||||
if (recv_lalt) {
|
||||
keyboard_input(0, 0x038);
|
||||
/* Extra key press and release so the guest is not stuck in the
|
||||
menu bar. */
|
||||
keyboard_input(1, 0x038);
|
||||
keyboard_input(0, 0x038);
|
||||
recv_lalt = 0;
|
||||
}
|
||||
if (recv_ralt) {
|
||||
keyboard_input(0, 0x138);
|
||||
/* Extra key press and release so the guest is not stuck in the
|
||||
menu bar. */
|
||||
keyboard_input(1, 0x138);
|
||||
keyboard_input(0, 0x138);
|
||||
recv_ralt = 0;
|
||||
}
|
||||
} else if (((scancode == 0x038) || (scancode == 0x138)) &&
|
||||
!(rawKB.Flags & RI_KEY_BREAK) &&
|
||||
recv_tab &&
|
||||
!mouse_capture) {
|
||||
/* We received an ALT while TAB was pressed, while the mouse
|
||||
is not captured, suppress the ALT and send a TAB key up. */
|
||||
keyboard_input(0, 0x00F);
|
||||
recv_tab = 0;
|
||||
} else {
|
||||
if (rawKB.MakeCode == 0x1D) {
|
||||
scancode = scancode_map[0x100]; /* Translate E1 1D to 0x100 (which would
|
||||
otherwise be E0 00 but that is invalid
|
||||
anyway).
|
||||
Also, take a potential mapping into
|
||||
account. */
|
||||
} else
|
||||
scancode = 0xFFFF;
|
||||
switch(scancode) {
|
||||
case 0x00F:
|
||||
recv_tab = !(rawKB.Flags & RI_KEY_BREAK);
|
||||
break;
|
||||
case 0x038:
|
||||
recv_lalt = !(rawKB.Flags & RI_KEY_BREAK);
|
||||
break;
|
||||
case 0x138:
|
||||
recv_ralt = !(rawKB.Flags & RI_KEY_BREAK);
|
||||
break;
|
||||
}
|
||||
|
||||
/* Translate right CTRL to left ALT if the user has so
|
||||
chosen. */
|
||||
if ((scancode == 0x11D) && rctrl_is_lalt)
|
||||
scancode = 0x038;
|
||||
|
||||
/* Normal scan code pass through, pass it through as is if
|
||||
it's not an invalid scan code. */
|
||||
if (scancode != 0xFFFF)
|
||||
keyboard_input(!(rawKB.Flags & RI_KEY_BREAK), scancode);
|
||||
}
|
||||
} else {
|
||||
if (rawKB.MakeCode == 0x1D) {
|
||||
scancode = scancode_map[0x100]; /* Translate E1 1D to 0x100 (which would
|
||||
otherwise be E0 00 but that is invalid
|
||||
anyway).
|
||||
Also, take a potential mapping into
|
||||
account. */
|
||||
} else
|
||||
scancode = 0xFFFF;
|
||||
if (scancode != 0xFFFF)
|
||||
keyboard_input(!(rawKB.Flags & RI_KEY_BREAK), scancode);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
#include <86box/config.h>
|
||||
#include <86box/device.h>
|
||||
#include <86box/timer.h>
|
||||
#include <86box/cassette.h>
|
||||
#include <86box/cartridge.h>
|
||||
#include <86box/fdd.h>
|
||||
#include <86box/fdd_86f.h>
|
||||
#include <86box/hdc.h>
|
||||
@@ -22,18 +24,23 @@
|
||||
#include <86box/zip.h>
|
||||
#include <86box/win.h>
|
||||
|
||||
#define MACHINE_HAS_IDE (machines[machine].flags & MACHINE_IDE_QUAD)
|
||||
#define MACHINE_HAS_IDE (machines[machine].flags & MACHINE_IDE_QUAD)
|
||||
#define MACHINE_HAS_SCSI (machines[machine].flags & MACHINE_SCSI_DUAL)
|
||||
|
||||
#define FDD_FIRST 0
|
||||
#define CDROM_FIRST FDD_FIRST + FDD_NUM
|
||||
#define ZIP_FIRST CDROM_FIRST + CDROM_NUM
|
||||
#define MO_FIRST ZIP_FIRST + ZIP_NUM
|
||||
#define CASSETTE_FIRST 0
|
||||
#define CARTRIDGE_FIRST CASSETTE_FIRST + 1
|
||||
#define FDD_FIRST CARTRIDGE_FIRST + 2
|
||||
#define CDROM_FIRST FDD_FIRST + FDD_NUM
|
||||
#define ZIP_FIRST CDROM_FIRST + CDROM_NUM
|
||||
#define MO_FIRST ZIP_FIRST + ZIP_NUM
|
||||
|
||||
|
||||
static HMENU media_menu, stbar_menu;
|
||||
static HMENU menus[FDD_NUM + CDROM_NUM + ZIP_NUM + MO_NUM];
|
||||
static HMENU menus[1 + 2 + FDD_NUM + CDROM_NUM + ZIP_NUM + MO_NUM];
|
||||
|
||||
static char index_map[255];
|
||||
|
||||
|
||||
static void
|
||||
media_menu_set_ids(HMENU hMenu, int id)
|
||||
{
|
||||
@@ -51,6 +58,7 @@ media_menu_set_ids(HMENU hMenu, int id)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Loads the submenu from resource by name */
|
||||
static HMENU
|
||||
media_menu_load_resource(wchar_t *lpName)
|
||||
@@ -67,6 +75,51 @@ media_menu_load_resource(wchar_t *lpName)
|
||||
return actual;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
media_menu_set_name_cassette(void)
|
||||
{
|
||||
wchar_t name[512], fn[512];
|
||||
MENUITEMINFO mii = { 0 };
|
||||
|
||||
if (strlen(cassette_fname) == 0)
|
||||
_swprintf(name, plat_get_string(IDS_2148), plat_get_string(IDS_2057));
|
||||
else {
|
||||
mbstoc16s(fn, cassette_fname, sizeof_w(fn));
|
||||
_swprintf(name, plat_get_string(IDS_2148), fn);
|
||||
}
|
||||
|
||||
mii.cbSize = sizeof(mii);
|
||||
mii.fMask = MIIM_STRING;
|
||||
mii.dwTypeData = name;
|
||||
|
||||
SetMenuItemInfo(media_menu, (UINT_PTR)menus[CASSETTE_FIRST], FALSE, &mii);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
media_menu_set_name_cartridge(int drive)
|
||||
{
|
||||
wchar_t name[512], fn[512];
|
||||
MENUITEMINFO mii = { 0 };
|
||||
|
||||
if (strlen(cart_fns[drive]) == 0) {
|
||||
_swprintf(name, plat_get_string(IDS_2150),
|
||||
drive + 1, plat_get_string(IDS_2057));
|
||||
} else {
|
||||
mbstoc16s(fn, cart_fns[drive], sizeof_w(fn));
|
||||
_swprintf(name, plat_get_string(IDS_2150),
|
||||
drive + 1, fn);
|
||||
}
|
||||
|
||||
mii.cbSize = sizeof(mii);
|
||||
mii.fMask = MIIM_STRING;
|
||||
mii.dwTypeData = name;
|
||||
|
||||
SetMenuItemInfo(media_menu, (UINT_PTR)menus[CARTRIDGE_FIRST + drive], FALSE, &mii);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
media_menu_set_name_floppy(int drive)
|
||||
{
|
||||
@@ -91,6 +144,7 @@ media_menu_set_name_floppy(int drive)
|
||||
SetMenuItemInfo(media_menu, (UINT_PTR)menus[FDD_FIRST + drive], FALSE, &mii);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
media_menu_set_name_cdrom(int drive)
|
||||
{
|
||||
@@ -121,6 +175,7 @@ media_menu_set_name_cdrom(int drive)
|
||||
SetMenuItemInfo(media_menu, (UINT_PTR)menus[CDROM_FIRST + drive], FALSE, &mii);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
media_menu_set_name_zip(int drive)
|
||||
{
|
||||
@@ -150,6 +205,7 @@ media_menu_set_name_zip(int drive)
|
||||
SetMenuItemInfo(media_menu, (UINT_PTR)menus[ZIP_FIRST + drive], FALSE, &mii);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
media_menu_set_name_mo(int drive)
|
||||
{
|
||||
@@ -177,6 +233,53 @@ media_menu_set_name_mo(int drive)
|
||||
SetMenuItemInfo(media_menu, (UINT_PTR)menus[MO_FIRST + drive], FALSE, &mii);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
media_menu_update_cassette(void)
|
||||
{
|
||||
int i = CASSETTE_FIRST;
|
||||
|
||||
if (strlen(cassette_fname) == 0) {
|
||||
EnableMenuItem(menus[i], IDM_CASSETTE_EJECT, MF_BYCOMMAND | MF_GRAYED);
|
||||
EnableMenuItem(menus[i], IDM_CASSETTE_RECORD, MF_BYCOMMAND | MF_GRAYED);
|
||||
EnableMenuItem(menus[i], IDM_CASSETTE_PLAY, MF_BYCOMMAND | MF_GRAYED);
|
||||
CheckMenuItem(menus[i], IDM_CASSETTE_RECORD, MF_BYCOMMAND | MF_UNCHECKED);
|
||||
CheckMenuItem(menus[i], IDM_CASSETTE_PLAY, MF_BYCOMMAND | MF_UNCHECKED);
|
||||
EnableMenuItem(menus[i], IDM_CASSETTE_REWIND, MF_BYCOMMAND | MF_GRAYED);
|
||||
EnableMenuItem(menus[i], IDM_CASSETTE_FAST_FORWARD, MF_BYCOMMAND | MF_GRAYED);
|
||||
} else {
|
||||
EnableMenuItem(menus[i], IDM_CASSETTE_EJECT, MF_BYCOMMAND | MF_ENABLED);
|
||||
EnableMenuItem(menus[i], IDM_CASSETTE_RECORD, MF_BYCOMMAND | MF_ENABLED);
|
||||
EnableMenuItem(menus[i], IDM_CASSETTE_PLAY, MF_BYCOMMAND | MF_ENABLED);
|
||||
if (strcmp(cassette_mode, "save") == 0) {
|
||||
CheckMenuItem(menus[i], IDM_CASSETTE_RECORD, MF_BYCOMMAND | MF_CHECKED);
|
||||
CheckMenuItem(menus[i], IDM_CASSETTE_PLAY, MF_BYCOMMAND | MF_UNCHECKED);
|
||||
} else {
|
||||
CheckMenuItem(menus[i], IDM_CASSETTE_RECORD, MF_BYCOMMAND | MF_UNCHECKED);
|
||||
CheckMenuItem(menus[i], IDM_CASSETTE_PLAY, MF_BYCOMMAND | MF_CHECKED);
|
||||
}
|
||||
EnableMenuItem(menus[i], IDM_CASSETTE_REWIND, MF_BYCOMMAND | MF_ENABLED);
|
||||
EnableMenuItem(menus[i], IDM_CASSETTE_FAST_FORWARD, MF_BYCOMMAND | MF_ENABLED);
|
||||
}
|
||||
|
||||
media_menu_set_name_cassette();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
media_menu_update_cartridge(int id)
|
||||
{
|
||||
int i = CARTRIDGE_FIRST + id;
|
||||
|
||||
if (strlen(cart_fns[id]) == 0)
|
||||
EnableMenuItem(menus[i], IDM_CARTRIDGE_EJECT | id, MF_BYCOMMAND | MF_GRAYED);
|
||||
else
|
||||
EnableMenuItem(menus[i], IDM_CARTRIDGE_EJECT | id, MF_BYCOMMAND | MF_ENABLED);
|
||||
|
||||
media_menu_set_name_cartridge(id);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
media_menu_update_floppy(int id)
|
||||
{
|
||||
@@ -193,6 +296,7 @@ media_menu_update_floppy(int id)
|
||||
media_menu_set_name_floppy(id);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
media_menu_update_cdrom(int id)
|
||||
{
|
||||
@@ -220,6 +324,7 @@ media_menu_update_cdrom(int id)
|
||||
media_menu_set_name_cdrom(id);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
media_menu_update_zip(int id)
|
||||
{
|
||||
@@ -238,6 +343,7 @@ media_menu_update_zip(int id)
|
||||
media_menu_set_name_zip(id);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
media_menu_update_mo(int id)
|
||||
{
|
||||
@@ -256,6 +362,7 @@ media_menu_update_mo(int id)
|
||||
media_menu_set_name_mo(id);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
media_menu_load_submenus()
|
||||
{
|
||||
@@ -263,6 +370,14 @@ media_menu_load_submenus()
|
||||
|
||||
int curr = 0;
|
||||
|
||||
menus[curr] = media_menu_load_resource(CASSETTE_SUBMENU_NAME);
|
||||
media_menu_set_ids(menus[curr++], 0);
|
||||
|
||||
for(int i = 0; i < 2; i++) {
|
||||
menus[curr] = media_menu_load_resource(CARTRIDGE_SUBMENU_NAME);
|
||||
media_menu_set_ids(menus[curr++], i);
|
||||
}
|
||||
|
||||
for(int i = 0; i < FDD_NUM; i++) {
|
||||
menus[curr] = media_menu_load_resource(FLOPPY_SUBMENU_NAME);
|
||||
media_menu_set_ids(menus[curr++], i);
|
||||
@@ -284,42 +399,60 @@ media_menu_load_submenus()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static inline int
|
||||
is_valid_cartridge(void)
|
||||
{
|
||||
return ((machines[machine].flags & MACHINE_CARTRIDGE) ? 1 : 0);
|
||||
}
|
||||
|
||||
|
||||
static inline int
|
||||
is_valid_fdd(int i)
|
||||
{
|
||||
return fdd_get_type(i) != 0;
|
||||
}
|
||||
|
||||
|
||||
static inline int
|
||||
is_valid_cdrom(int i)
|
||||
{
|
||||
if ((cdrom[i].bus_type == CDROM_BUS_ATAPI) && !MACHINE_HAS_IDE && memcmp(hdc_get_internal_name(hdc_current), "ide", 3))
|
||||
return 0;
|
||||
if ((cdrom[i].bus_type == CDROM_BUS_SCSI) && !MACHINE_HAS_SCSI && (scsi_card_current == 0))
|
||||
if ((cdrom[i].bus_type == CDROM_BUS_SCSI) && !MACHINE_HAS_SCSI &&
|
||||
(scsi_card_current[0] == 0) && (scsi_card_current[1] == 0) &&
|
||||
(scsi_card_current[2] == 0) && (scsi_card_current[3] == 0))
|
||||
return 0;
|
||||
return cdrom[i].bus_type != 0;
|
||||
}
|
||||
|
||||
|
||||
static inline int
|
||||
is_valid_zip(int i)
|
||||
{
|
||||
if ((zip_drives[i].bus_type == ZIP_BUS_ATAPI) && !MACHINE_HAS_IDE && memcmp(hdc_get_internal_name(hdc_current), "ide", 3))
|
||||
return 0;
|
||||
if ((zip_drives[i].bus_type == ZIP_BUS_SCSI) && !MACHINE_HAS_SCSI && (scsi_card_current == 0))
|
||||
if ((zip_drives[i].bus_type == ZIP_BUS_SCSI) && !MACHINE_HAS_SCSI &&
|
||||
(scsi_card_current[0] == 0) && (scsi_card_current[1] == 0) &&
|
||||
(scsi_card_current[2] == 0) && (scsi_card_current[3] == 0))
|
||||
return 0;
|
||||
return zip_drives[i].bus_type != 0;
|
||||
}
|
||||
|
||||
|
||||
static inline int
|
||||
is_valid_mo(int i)
|
||||
{
|
||||
if ((mo_drives[i].bus_type == MO_BUS_ATAPI) && !MACHINE_HAS_IDE && memcmp(hdc_get_internal_name(hdc_current), "ide", 3))
|
||||
return 0;
|
||||
if ((mo_drives[i].bus_type == MO_BUS_SCSI) && !MACHINE_HAS_SCSI && (scsi_card_current == 0))
|
||||
if ((mo_drives[i].bus_type == MO_BUS_SCSI) && !MACHINE_HAS_SCSI &&
|
||||
(scsi_card_current[0] == 0) && (scsi_card_current[1] == 0) &&
|
||||
(scsi_card_current[2] == 0) && (scsi_card_current[3] == 0))
|
||||
return 0;
|
||||
return mo_drives[i].bus_type != 0;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
media_menu_reset()
|
||||
{
|
||||
@@ -332,6 +465,20 @@ media_menu_reset()
|
||||
/* Add new ones. */
|
||||
int curr = 0;
|
||||
|
||||
if(cassette_enable) {
|
||||
AppendMenu(media_menu, MF_POPUP | MF_STRING, (UINT_PTR)menus[curr], L"Test");
|
||||
media_menu_update_cassette();
|
||||
}
|
||||
curr++;
|
||||
|
||||
for(int i = 0; i < 2; i++) {
|
||||
if(is_valid_cartridge()) {
|
||||
AppendMenu(media_menu, MF_POPUP | MF_STRING, (UINT_PTR)menus[curr], L"Test");
|
||||
media_menu_update_cartridge(i);
|
||||
}
|
||||
curr++;
|
||||
}
|
||||
|
||||
for(int i = 0; i < FDD_NUM; i++) {
|
||||
if(is_valid_fdd(i)) {
|
||||
AppendMenu(media_menu, MF_POPUP | MF_STRING, (UINT_PTR)menus[curr], L"Test");
|
||||
@@ -365,6 +512,7 @@ media_menu_reset()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Initializes the Media menu in the main menu bar. */
|
||||
static void
|
||||
media_menu_main_init()
|
||||
@@ -388,6 +536,7 @@ media_menu_main_init()
|
||||
free(lpMenuName);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
media_menu_init()
|
||||
{
|
||||
@@ -405,6 +554,7 @@ media_menu_init()
|
||||
media_menu_reset();
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
media_menu_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
@@ -413,6 +563,60 @@ media_menu_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
id = LOWORD(wParam) & 0x00ff;
|
||||
|
||||
switch (LOWORD(wParam) & 0xff00) {
|
||||
case IDM_CASSETTE_IMAGE_NEW:
|
||||
ret = file_dlg_st(hwnd, IDS_2149, "", NULL, 1);
|
||||
if (! ret) {
|
||||
if (strlen(openfilestring) == 0)
|
||||
cassette_mount(NULL, wp);
|
||||
else
|
||||
cassette_mount(openfilestring, wp);
|
||||
}
|
||||
break;
|
||||
|
||||
case IDM_CASSETTE_RECORD:
|
||||
pc_cas_set_mode(cassette, 1);
|
||||
CheckMenuItem(menus[CASSETTE_FIRST], IDM_CASSETTE_RECORD, MF_BYCOMMAND | MF_CHECKED);
|
||||
CheckMenuItem(menus[CASSETTE_FIRST], IDM_CASSETTE_PLAY, MF_BYCOMMAND | MF_UNCHECKED);
|
||||
break;
|
||||
case IDM_CASSETTE_PLAY:
|
||||
pc_cas_set_mode(cassette, 0);
|
||||
CheckMenuItem(menus[CASSETTE_FIRST], IDM_CASSETTE_RECORD, MF_BYCOMMAND | MF_UNCHECKED);
|
||||
CheckMenuItem(menus[CASSETTE_FIRST], IDM_CASSETTE_PLAY, MF_BYCOMMAND | MF_CHECKED);
|
||||
break;
|
||||
case IDM_CASSETTE_REWIND:
|
||||
pc_cas_rewind(cassette);
|
||||
break;
|
||||
case IDM_CASSETTE_FAST_FORWARD:
|
||||
pc_cas_append(cassette);
|
||||
break;
|
||||
|
||||
case IDM_CASSETTE_IMAGE_EXISTING_WP:
|
||||
wp = 1;
|
||||
/* FALLTHROUGH */
|
||||
case IDM_CASSETTE_IMAGE_EXISTING:
|
||||
ret = file_dlg_st(hwnd, IDS_2149, cassette_fname, NULL, 0);
|
||||
if (! ret) {
|
||||
if (strlen(openfilestring) == 0)
|
||||
cassette_mount(NULL, wp);
|
||||
else
|
||||
cassette_mount(openfilestring, wp);
|
||||
}
|
||||
break;
|
||||
|
||||
case IDM_CASSETTE_EJECT:
|
||||
cassette_eject();
|
||||
break;
|
||||
|
||||
case IDM_CARTRIDGE_IMAGE:
|
||||
ret = file_dlg_st(hwnd, IDS_2151, cart_fns[id], NULL, 0);
|
||||
if (! ret)
|
||||
cartridge_mount(id, openfilestring, wp);
|
||||
break;
|
||||
|
||||
case IDM_CARTRIDGE_EJECT:
|
||||
cartridge_eject(id);
|
||||
break;
|
||||
|
||||
case IDM_FLOPPY_IMAGE_NEW:
|
||||
NewFloppyDialogCreate(hwnd, id, 0);
|
||||
break;
|
||||
@@ -422,9 +626,8 @@ media_menu_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
/* FALLTHROUGH */
|
||||
case IDM_FLOPPY_IMAGE_EXISTING:
|
||||
ret = file_dlg_st(hwnd, IDS_2109, floppyfns[id], NULL, 0);
|
||||
if (! ret) {
|
||||
if (! ret)
|
||||
floppy_mount(id, openfilestring, wp);
|
||||
}
|
||||
break;
|
||||
|
||||
case IDM_FLOPPY_EJECT:
|
||||
@@ -512,24 +715,42 @@ media_menu_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
return(1);
|
||||
}
|
||||
|
||||
|
||||
HMENU
|
||||
media_menu_get_cassette(void)
|
||||
{
|
||||
return menus[CASSETTE_FIRST];
|
||||
}
|
||||
|
||||
|
||||
HMENU
|
||||
media_menu_get_cartridge(int id)
|
||||
{
|
||||
return menus[CARTRIDGE_FIRST + id];
|
||||
}
|
||||
|
||||
|
||||
HMENU
|
||||
media_menu_get_floppy(int id)
|
||||
{
|
||||
return menus[FDD_FIRST + id];
|
||||
}
|
||||
|
||||
|
||||
HMENU
|
||||
media_menu_get_cdrom(int id)
|
||||
{
|
||||
return menus[CDROM_FIRST + id];
|
||||
}
|
||||
|
||||
|
||||
HMENU
|
||||
media_menu_get_zip(int id)
|
||||
{
|
||||
return menus[ZIP_FIRST + id];
|
||||
}
|
||||
|
||||
|
||||
HMENU
|
||||
media_menu_get_mo(int id)
|
||||
{
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
#include <86box/rom.h>
|
||||
#include <86box/device.h>
|
||||
#include <86box/timer.h>
|
||||
#include <86box/cassette.h>
|
||||
#include <86box/nvr.h>
|
||||
#include <86box/machine.h>
|
||||
#include <86box/gameport.h>
|
||||
@@ -103,7 +104,8 @@ static int temp_lpt_devices[3];
|
||||
static int temp_serial[4], temp_lpt[3];
|
||||
|
||||
/* Other peripherals category */
|
||||
static int temp_fdc_card, temp_hdc, temp_scsi_card, temp_ide_ter, temp_ide_qua;
|
||||
static int temp_fdc_card, temp_hdc, temp_ide_ter, temp_ide_qua, temp_cassette;
|
||||
static int temp_scsi_card[SCSI_BUS_MAX];
|
||||
static int temp_bugger;
|
||||
static int temp_postcard;
|
||||
static int temp_isartc;
|
||||
@@ -136,7 +138,7 @@ static int settings_list_to_midi[20], settings_list_to_midi_in[20];
|
||||
static int settings_list_to_hdc[20];
|
||||
|
||||
static int max_spt = 63, max_hpc = 255, max_tracks = 266305;
|
||||
static uint64_t mfm_tracking, esdi_tracking, xta_tracking, ide_tracking, scsi_tracking[2];
|
||||
static uint64_t mfm_tracking, esdi_tracking, xta_tracking, ide_tracking, scsi_tracking[8];
|
||||
static uint64_t size;
|
||||
static int hd_listview_items, hdc_id_to_listview_index[HDD_NUM];
|
||||
static int no_update = 0, existing = 0, chs_enabled = 0;
|
||||
@@ -368,22 +370,17 @@ win_settings_init(void)
|
||||
for (i = 0; i < 4; i++)
|
||||
temp_serial[i] = serial_enabled[i];
|
||||
|
||||
/* Other peripherals category */
|
||||
temp_scsi_card = scsi_card_current;
|
||||
/* Storage devices category */
|
||||
for (i = 0; i < SCSI_BUS_MAX; i++)
|
||||
temp_scsi_card[i] = scsi_card_current[i];
|
||||
temp_fdc_card = fdc_type;
|
||||
temp_hdc = hdc_current;
|
||||
temp_ide_ter = ide_ter_enabled;
|
||||
temp_ide_qua = ide_qua_enabled;
|
||||
temp_bugger = bugger_enabled;
|
||||
temp_postcard = postcard_enabled;
|
||||
temp_isartc = isartc_type;
|
||||
|
||||
/* ISA memory boards. */
|
||||
for (i = 0; i < ISAMEM_MAX; i++)
|
||||
temp_isamem[i] = isamem_type[i];
|
||||
temp_cassette = cassette_enable;
|
||||
|
||||
mfm_tracking = xta_tracking = esdi_tracking = ide_tracking = 0;
|
||||
for (i = 0; i < 2; i++)
|
||||
for (i = 0; i < 8; i++)
|
||||
scsi_tracking[i] = 0;
|
||||
|
||||
/* Hard disks category */
|
||||
@@ -431,6 +428,15 @@ win_settings_init(void)
|
||||
scsi_tracking[mo_drives[i].scsi_device_id >> 3] |= (1 << ((mo_drives[i].scsi_device_id & 0x07) << 3));
|
||||
}
|
||||
|
||||
/* Other peripherals category */
|
||||
temp_bugger = bugger_enabled;
|
||||
temp_postcard = postcard_enabled;
|
||||
temp_isartc = isartc_type;
|
||||
|
||||
/* ISA memory boards. */
|
||||
for (i = 0; i < ISAMEM_MAX; i++)
|
||||
temp_isamem[i] = isamem_type[i];
|
||||
|
||||
temp_deviceconfig = 0;
|
||||
}
|
||||
|
||||
@@ -484,19 +490,14 @@ win_settings_changed(void)
|
||||
for (j = 0; j < 4; j++)
|
||||
i = i || (temp_serial[j] != serial_enabled[j]);
|
||||
|
||||
/* Peripherals category */
|
||||
i = i || (scsi_card_current != temp_scsi_card);
|
||||
/* Storage devices category */
|
||||
for (j = 0; j < SCSI_BUS_MAX; j++)
|
||||
i = i || (temp_scsi_card[j] != scsi_card_current[j]);
|
||||
i = i || (fdc_type != temp_fdc_card);
|
||||
i = i || (hdc_current != temp_hdc);
|
||||
i = i || (temp_ide_ter != ide_ter_enabled);
|
||||
i = i || (temp_ide_qua != ide_qua_enabled);
|
||||
i = i || (temp_bugger != bugger_enabled);
|
||||
i = i || (temp_postcard != postcard_enabled);
|
||||
i = i || (temp_isartc != isartc_type);
|
||||
|
||||
/* ISA memory boards. */
|
||||
for (j = 0; j < ISAMEM_MAX; j++)
|
||||
i = i || (temp_isamem[j] != isamem_type[j]);
|
||||
i = i || (temp_cassette != cassette_enable);
|
||||
|
||||
/* Hard disks category */
|
||||
i = i || memcmp(hdd, temp_hdd, HDD_NUM * sizeof(hard_disk_t));
|
||||
@@ -513,6 +514,15 @@ win_settings_changed(void)
|
||||
i = i || memcmp(zip_drives, temp_zip_drives, ZIP_NUM * sizeof(zip_drive_t));
|
||||
i = i || memcmp(mo_drives, temp_mo_drives, MO_NUM * sizeof(mo_drive_t));
|
||||
|
||||
/* Other peripherals category */
|
||||
i = i || (temp_bugger != bugger_enabled);
|
||||
i = i || (temp_postcard != postcard_enabled);
|
||||
i = i || (temp_isartc != isartc_type);
|
||||
|
||||
/* ISA memory boards. */
|
||||
for (j = 0; j < ISAMEM_MAX; j++)
|
||||
i = i || (temp_isamem[j] != isamem_type[j]);
|
||||
|
||||
i = i || !!temp_deviceconfig;
|
||||
|
||||
return i;
|
||||
@@ -571,19 +581,14 @@ win_settings_save(void)
|
||||
for (i = 0; i < 4; i++)
|
||||
serial_enabled[i] = temp_serial[i];
|
||||
|
||||
/* Peripherals category */
|
||||
scsi_card_current = temp_scsi_card;
|
||||
/* Storage devices category */
|
||||
for (i = 0; i < SCSI_BUS_MAX; i++)
|
||||
scsi_card_current[i] = temp_scsi_card[i];
|
||||
hdc_current = temp_hdc;
|
||||
fdc_type = temp_fdc_card;
|
||||
ide_ter_enabled = temp_ide_ter;
|
||||
ide_qua_enabled = temp_ide_qua;
|
||||
bugger_enabled = temp_bugger;
|
||||
postcard_enabled = temp_postcard;
|
||||
isartc_type = temp_isartc;
|
||||
|
||||
/* ISA memory boards. */
|
||||
for (i = 0; i < ISAMEM_MAX; i++)
|
||||
isamem_type[i] = temp_isamem[i];
|
||||
cassette_enable = temp_cassette;
|
||||
|
||||
/* Hard disks category */
|
||||
memcpy(hdd, temp_hdd, HDD_NUM * sizeof(hard_disk_t));
|
||||
@@ -620,6 +625,15 @@ win_settings_save(void)
|
||||
mo_drives[i].priv = NULL;
|
||||
}
|
||||
|
||||
/* Other peripherals category */
|
||||
bugger_enabled = temp_bugger;
|
||||
postcard_enabled = temp_postcard;
|
||||
isartc_type = temp_isartc;
|
||||
|
||||
/* ISA memory boards. */
|
||||
for (i = 0; i < ISAMEM_MAX; i++)
|
||||
isamem_type[i] = temp_isamem[i];
|
||||
|
||||
/* Mark configuration as changed. */
|
||||
config_changed = 2;
|
||||
|
||||
@@ -1058,6 +1072,7 @@ static BOOL CALLBACK
|
||||
win_settings_video_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
int c = 0, d = 0;
|
||||
int e;
|
||||
|
||||
switch (message) {
|
||||
case WM_INITDIALOG:
|
||||
@@ -1095,7 +1110,8 @@ win_settings_video_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
}
|
||||
|
||||
settings_enable_window(hdlg, IDC_COMBO_VIDEO, !(machines[temp_machine].flags & MACHINE_VIDEO_ONLY));
|
||||
settings_enable_window(hdlg, IDC_CONFIGURE_VID, video_card_has_config(temp_gfxcard));
|
||||
e = settings_list_to_device[0][settings_get_cur_sel(hdlg, IDC_COMBO_VIDEO)];
|
||||
settings_enable_window(hdlg, IDC_CONFIGURE_VID, video_card_has_config(e));
|
||||
settings_enable_window(hdlg, IDC_CHECK_VOODOO, (machines[temp_machine].flags & MACHINE_BUS_PCI));
|
||||
settings_set_check(hdlg, IDC_CHECK_VOODOO, temp_voodoo);
|
||||
settings_enable_window(hdlg, IDC_BUTTON_VOODOO, (machines[temp_machine].flags & MACHINE_BUS_PCI) && temp_voodoo);
|
||||
@@ -1532,7 +1548,7 @@ static BOOL CALLBACK
|
||||
win_settings_storage_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
int c, d;
|
||||
int is_at;
|
||||
int e, is_at;
|
||||
LPTSTR lptsTemp;
|
||||
char *stransi;
|
||||
const device_t *scsi_dev, *fdc_dev;
|
||||
@@ -1613,7 +1629,8 @@ win_settings_storage_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
/*SCSI config*/
|
||||
c = d = 0;
|
||||
settings_reset_content(hdlg, IDC_COMBO_SCSI);
|
||||
for (e = 0; e < SCSI_BUS_MAX; e++)
|
||||
settings_reset_content(hdlg, IDC_COMBO_SCSI_1 + e);
|
||||
while (1) {
|
||||
generate_device_name(scsi_card_getdevice(c), scsi_card_get_internal_name(c), 1);
|
||||
|
||||
@@ -1624,13 +1641,17 @@ win_settings_storage_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
scsi_dev = scsi_card_getdevice(c);
|
||||
|
||||
if (device_is_valid(scsi_dev, machines[temp_machine].flags)) {
|
||||
if (c == 0)
|
||||
settings_add_string(hdlg, IDC_COMBO_SCSI, win_get_string(IDS_2103));
|
||||
else
|
||||
settings_add_string(hdlg, IDC_COMBO_SCSI, (LPARAM) device_name);
|
||||
for (e = 0; e < SCSI_BUS_MAX; e++) {
|
||||
if (c == 0)
|
||||
settings_add_string(hdlg, IDC_COMBO_SCSI_1 + e, win_get_string(IDS_2103));
|
||||
else
|
||||
settings_add_string(hdlg, IDC_COMBO_SCSI_1 + e, (LPARAM) device_name);
|
||||
|
||||
if ((c == 0) || (c == temp_scsi_card[e]))
|
||||
settings_set_cur_sel(hdlg, IDC_COMBO_SCSI_1 + e, d);
|
||||
}
|
||||
|
||||
settings_list_to_device[0][d] = c;
|
||||
if ((c == 0) || (c == temp_scsi_card))
|
||||
settings_set_cur_sel(hdlg, IDC_COMBO_SCSI, d);
|
||||
d++;
|
||||
}
|
||||
}
|
||||
@@ -1638,8 +1659,10 @@ win_settings_storage_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
c++;
|
||||
}
|
||||
|
||||
settings_enable_window(hdlg, IDC_COMBO_SCSI, d);
|
||||
settings_enable_window(hdlg, IDC_CONFIGURE_SCSI, scsi_card_has_config(temp_scsi_card));
|
||||
for (c = 0; c < SCSI_BUS_MAX; c++) {
|
||||
settings_enable_window(hdlg, IDC_COMBO_SCSI_1 + c, d);
|
||||
settings_enable_window(hdlg, IDC_CONFIGURE_SCSI_1 + c, scsi_card_has_config(temp_scsi_card[c]));
|
||||
}
|
||||
is_at = IS_AT(temp_machine);
|
||||
settings_enable_window(hdlg, IDC_CHECK_IDE_TER, is_at);
|
||||
settings_enable_window(hdlg, IDC_BUTTON_IDE_TER, is_at && temp_ide_ter);
|
||||
@@ -1647,6 +1670,7 @@ win_settings_storage_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
settings_enable_window(hdlg, IDC_BUTTON_IDE_QUA, is_at && temp_ide_qua);
|
||||
settings_set_check(hdlg, IDC_CHECK_IDE_TER, temp_ide_ter);
|
||||
settings_set_check(hdlg, IDC_CHECK_IDE_QUA, temp_ide_qua);
|
||||
settings_set_check(hdlg, IDC_CHECK_CASSETTE, temp_cassette);
|
||||
|
||||
free(stransi);
|
||||
free(lptsTemp);
|
||||
@@ -1675,14 +1699,16 @@ win_settings_storage_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
settings_enable_window(hdlg, IDC_CONFIGURE_HDC, hdc_has_config(temp_hdc));
|
||||
break;
|
||||
|
||||
case IDC_CONFIGURE_SCSI:
|
||||
temp_scsi_card = settings_list_to_device[0][settings_get_cur_sel(hdlg, IDC_COMBO_SCSI)];
|
||||
temp_deviceconfig |= deviceconfig_open(hdlg, (void *)scsi_card_getdevice(temp_scsi_card));
|
||||
case IDC_CONFIGURE_SCSI_1 ... IDC_CONFIGURE_SCSI_4:
|
||||
c = LOWORD(wParam) - IDC_CONFIGURE_SCSI_1;
|
||||
temp_scsi_card[c] = settings_list_to_device[0][settings_get_cur_sel(hdlg, IDC_COMBO_SCSI_1 + c)];
|
||||
temp_deviceconfig |= deviceconfig_inst_open(hdlg, (void *)scsi_card_getdevice(temp_scsi_card[c]), c + 1);
|
||||
break;
|
||||
|
||||
case IDC_COMBO_SCSI:
|
||||
temp_scsi_card = settings_list_to_device[0][settings_get_cur_sel(hdlg, IDC_COMBO_SCSI)];
|
||||
settings_enable_window(hdlg, IDC_CONFIGURE_SCSI, scsi_card_has_config(temp_scsi_card));
|
||||
case IDC_COMBO_SCSI_1 ... IDC_COMBO_SCSI_4:
|
||||
c = LOWORD(wParam) - IDC_COMBO_SCSI_1;
|
||||
temp_scsi_card[c] = settings_list_to_device[0][settings_get_cur_sel(hdlg, IDC_COMBO_SCSI_1 + c)];
|
||||
settings_enable_window(hdlg, IDC_CONFIGURE_SCSI_1 + c, scsi_card_has_config(temp_scsi_card[c]));
|
||||
break;
|
||||
|
||||
case IDC_CHECK_IDE_TER:
|
||||
@@ -1708,9 +1734,11 @@ win_settings_storage_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
case WM_SAVESETTINGS:
|
||||
temp_hdc = settings_list_to_hdc[settings_get_cur_sel(hdlg, IDC_COMBO_HDC)];
|
||||
temp_fdc_card = settings_list_to_fdc[settings_get_cur_sel(hdlg, IDC_COMBO_FDC)];
|
||||
temp_scsi_card = settings_list_to_device[0][settings_get_cur_sel(hdlg, IDC_COMBO_SCSI)];
|
||||
for (c = 0; c < SCSI_BUS_MAX; c++)
|
||||
temp_scsi_card[c] = settings_list_to_device[0][settings_get_cur_sel(hdlg, IDC_COMBO_SCSI_1 + c)];
|
||||
temp_ide_ter = settings_get_check(hdlg, IDC_CHECK_IDE_TER);
|
||||
temp_ide_qua = settings_get_check(hdlg, IDC_CHECK_IDE_QUA);
|
||||
temp_cassette = settings_get_check(hdlg, IDC_CHECK_CASSETTE);
|
||||
|
||||
default:
|
||||
return FALSE;
|
||||
@@ -1898,8 +1926,8 @@ add_locations(HWND hdlg)
|
||||
settings_add_string(hdlg, IDC_COMBO_HD_CHANNEL, (LPARAM) lptsTemp);
|
||||
}
|
||||
|
||||
for (i = 0; i < 16; i++) {
|
||||
wsprintf(lptsTemp, plat_get_string(IDS_4098), i);
|
||||
for (i = 0; i < 64; i++) {
|
||||
wsprintf(lptsTemp, plat_get_string(IDS_4135), i >> 4, i & 15);
|
||||
settings_add_string(hdlg, IDC_COMBO_HD_ID, (LPARAM) lptsTemp);
|
||||
}
|
||||
|
||||
@@ -1945,7 +1973,7 @@ next_free_scsi_id(uint8_t *id)
|
||||
{
|
||||
int64_t i;
|
||||
|
||||
for (i = 0; i < 16; i++) {
|
||||
for (i = 0; i < 64; i++) {
|
||||
if (!(scsi_tracking[i >> 3] & (0xffLL << ((i & 0x07) << 3LL)))) {
|
||||
*id = i;
|
||||
return;
|
||||
@@ -2128,7 +2156,7 @@ win_settings_hard_disks_update_item(HWND hdlg, int i, int column)
|
||||
wsprintf(szText, plat_get_string(IDS_4612), temp_hdd[i].ide_channel >> 1, temp_hdd[i].ide_channel & 1);
|
||||
break;
|
||||
case HDD_BUS_SCSI:
|
||||
wsprintf(szText, plat_get_string(IDS_4613), temp_hdd[i].scsi_id);
|
||||
wsprintf(szText, plat_get_string(IDS_4613), temp_hdd[i].scsi_id >> 4, temp_hdd[i].scsi_id >> 4 & 15);
|
||||
break;
|
||||
}
|
||||
lvI.pszText = szText;
|
||||
@@ -2202,7 +2230,7 @@ win_settings_hard_disks_recalc_list(HWND hdlg)
|
||||
wsprintf(szText, plat_get_string(IDS_4612), temp_hdd[i].ide_channel >> 1, temp_hdd[i].ide_channel & 1);
|
||||
break;
|
||||
case HDD_BUS_SCSI:
|
||||
wsprintf(szText, plat_get_string(IDS_4613), temp_hdd[i].scsi_id);
|
||||
wsprintf(szText, plat_get_string(IDS_4613), temp_hdd[i].scsi_id >> 4, temp_hdd[i].scsi_id >> 4 & 15);
|
||||
break;
|
||||
}
|
||||
lvI.pszText = szText;
|
||||
@@ -3577,7 +3605,7 @@ win_settings_cdrom_drives_recalc_list(HWND hdlg)
|
||||
lvI.iImage = 1;
|
||||
break;
|
||||
case CDROM_BUS_SCSI:
|
||||
wsprintf(szText, plat_get_string(fsid), temp_cdrom[i].scsi_device_id);
|
||||
wsprintf(szText, plat_get_string(fsid), temp_cdrom[i].scsi_device_id >> 4, temp_cdrom[i].scsi_device_id & 15);
|
||||
lvI.pszText = szText;
|
||||
lvI.iImage = 1;
|
||||
break;
|
||||
@@ -3634,7 +3662,7 @@ win_settings_mo_drives_recalc_list(HWND hdlg)
|
||||
lvI.iImage = 1;
|
||||
break;
|
||||
case MO_BUS_SCSI:
|
||||
wsprintf(szText, plat_get_string(fsid), temp_mo_drives[i].scsi_device_id);
|
||||
wsprintf(szText, plat_get_string(fsid), temp_mo_drives[i].scsi_device_id >> 4, temp_mo_drives[i].scsi_device_id & 15);
|
||||
lvI.pszText = szText;
|
||||
lvI.iImage = 1;
|
||||
break;
|
||||
@@ -3697,7 +3725,7 @@ win_settings_zip_drives_recalc_list(HWND hdlg)
|
||||
lvI.iImage = 1;
|
||||
break;
|
||||
case ZIP_BUS_SCSI:
|
||||
wsprintf(szText, plat_get_string(fsid), temp_zip_drives[i].scsi_device_id);
|
||||
wsprintf(szText, plat_get_string(fsid), temp_zip_drives[i].scsi_device_id >> 4, temp_zip_drives[i].scsi_device_id & 15);
|
||||
lvI.pszText = szText;
|
||||
lvI.iImage = 1;
|
||||
break;
|
||||
@@ -4008,7 +4036,7 @@ win_settings_cdrom_drives_update_item(HWND hdlg, int i)
|
||||
lvI.iImage = 1;
|
||||
break;
|
||||
case CDROM_BUS_SCSI:
|
||||
wsprintf(szText, plat_get_string(fsid), temp_cdrom[i].scsi_device_id);
|
||||
wsprintf(szText, plat_get_string(fsid), temp_cdrom[i].scsi_device_id >> 4, temp_cdrom[i].scsi_device_id & 15);
|
||||
lvI.pszText = szText;
|
||||
lvI.iImage = 1;
|
||||
break;
|
||||
@@ -4061,7 +4089,7 @@ win_settings_mo_drives_update_item(HWND hdlg, int i)
|
||||
lvI.iImage = 1;
|
||||
break;
|
||||
case MO_BUS_SCSI:
|
||||
wsprintf(szText, plat_get_string(fsid), temp_mo_drives[i].scsi_device_id);
|
||||
wsprintf(szText, plat_get_string(fsid), temp_mo_drives[i].scsi_device_id >> 4, temp_mo_drives[i].scsi_device_id & 15);
|
||||
lvI.pszText = szText;
|
||||
lvI.iImage = 1;
|
||||
break;
|
||||
@@ -4119,7 +4147,7 @@ win_settings_zip_drives_update_item(HWND hdlg, int i)
|
||||
lvI.iImage = 1;
|
||||
break;
|
||||
case ZIP_BUS_SCSI:
|
||||
wsprintf(szText, plat_get_string(fsid), temp_zip_drives[i].scsi_device_id);
|
||||
wsprintf(szText, plat_get_string(fsid), temp_zip_drives[i].scsi_device_id >> 4, temp_zip_drives[i].scsi_device_id & 15);
|
||||
lvI.pszText = szText;
|
||||
lvI.iImage = 1;
|
||||
break;
|
||||
@@ -4156,8 +4184,8 @@ cdrom_add_locations(HWND hdlg)
|
||||
settings_add_string(hdlg, IDC_COMBO_CD_SPEED, (LPARAM) lptsTemp);
|
||||
}
|
||||
|
||||
for (i = 0; i < 16; i++) {
|
||||
wsprintf(lptsTemp, plat_get_string(IDS_4098), i);
|
||||
for (i = 0; i < 64; i++) {
|
||||
wsprintf(lptsTemp, plat_get_string(IDS_4135), i >> 4, i & 15);
|
||||
settings_add_string(hdlg, IDC_COMBO_CD_ID, (LPARAM) lptsTemp);
|
||||
}
|
||||
|
||||
@@ -4224,8 +4252,8 @@ mo_add_locations(HWND hdlg)
|
||||
settings_add_string(hdlg, IDC_COMBO_MO_BUS, win_get_string(combo_id_to_string_id(i)));
|
||||
}
|
||||
|
||||
for (i = 0; i < 16; i++) {
|
||||
wsprintf(lptsTemp, plat_get_string(IDS_4098), i);
|
||||
for (i = 0; i < 64; i++) {
|
||||
wsprintf(lptsTemp, plat_get_string(IDS_4135), i >> 4, i & 15);
|
||||
settings_add_string(hdlg, IDC_COMBO_MO_ID, (LPARAM) lptsTemp);
|
||||
}
|
||||
|
||||
@@ -4303,8 +4331,8 @@ zip_add_locations(HWND hdlg)
|
||||
settings_add_string(hdlg, IDC_COMBO_ZIP_BUS, win_get_string(combo_id_to_string_id(i)));
|
||||
}
|
||||
|
||||
for (i = 0; i < 16; i++) {
|
||||
wsprintf(lptsTemp, plat_get_string(IDS_4098), i);
|
||||
for (i = 0; i < 64; i++) {
|
||||
wsprintf(lptsTemp, plat_get_string(IDS_4135), i >> 4, i & 15);
|
||||
settings_add_string(hdlg, IDC_COMBO_ZIP_ID, (LPARAM) lptsTemp);
|
||||
}
|
||||
|
||||
|
||||
@@ -34,6 +34,8 @@
|
||||
#include <86box/device.h>
|
||||
#include <86box/machine.h>
|
||||
#include <86box/timer.h>
|
||||
#include <86box/cassette.h>
|
||||
#include <86box/cartridge.h>
|
||||
#include <86box/hdd.h>
|
||||
#include <86box/hdc.h>
|
||||
#include <86box/fdd.h>
|
||||
@@ -177,6 +179,53 @@ ui_sb_update_icon_state(int tag, int state)
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
StatusBarCreateCassetteTip(int part)
|
||||
{
|
||||
WCHAR tempTip[512];
|
||||
WCHAR fn[512];
|
||||
|
||||
if (strlen(cassette_fname) == 0)
|
||||
_swprintf(tempTip, plat_get_string(IDS_2148), plat_get_string(IDS_2057));
|
||||
else {
|
||||
mbstoc16s(fn, cassette_fname, sizeof_w(fn));
|
||||
_swprintf(tempTip, plat_get_string(IDS_2148), fn);
|
||||
}
|
||||
|
||||
if (sbTips[part] != NULL) {
|
||||
free(sbTips[part]);
|
||||
sbTips[part] = NULL;
|
||||
}
|
||||
sbTips[part] = (WCHAR *)malloc((wcslen(tempTip) << 1) + 2);
|
||||
wcscpy(sbTips[part], tempTip);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
StatusBarCreateCartridgeTip(int part)
|
||||
{
|
||||
WCHAR tempTip[512];
|
||||
WCHAR fn[512];
|
||||
int drive = sb_part_meanings[part] & 0xf;
|
||||
|
||||
if (strlen(cart_fns[drive]) == 0) {
|
||||
_swprintf(tempTip, plat_get_string(IDS_2150),
|
||||
drive+1, plat_get_string(IDS_2057));
|
||||
} else {
|
||||
mbstoc16s(fn, cart_fns[drive], sizeof_w(fn));
|
||||
_swprintf(tempTip, plat_get_string(IDS_2150),
|
||||
drive+1, fn);
|
||||
}
|
||||
|
||||
if (sbTips[part] != NULL) {
|
||||
free(sbTips[part]);
|
||||
sbTips[part] = NULL;
|
||||
}
|
||||
sbTips[part] = (WCHAR *)malloc((wcslen(tempTip) << 1) + 2);
|
||||
wcscpy(sbTips[part], tempTip);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
StatusBarCreateFloppyTip(int part)
|
||||
{
|
||||
@@ -364,6 +413,14 @@ ui_sb_update_tip(int meaning)
|
||||
|
||||
if (part != 0xff) {
|
||||
switch(meaning & 0xf0) {
|
||||
case SB_CASSETTE:
|
||||
StatusBarCreateCassetteTip(part);
|
||||
break;
|
||||
|
||||
case SB_CARTRIDGE:
|
||||
StatusBarCreateCartridgeTip(part);
|
||||
break;
|
||||
|
||||
case SB_FLOPPY:
|
||||
StatusBarCreateFloppyTip(part);
|
||||
break;
|
||||
@@ -440,7 +497,7 @@ void
|
||||
ui_sb_update_panes(void)
|
||||
{
|
||||
int i, id;
|
||||
int mfm_int, xta_int, esdi_int, ide_int, scsi_int;
|
||||
int cart_int, mfm_int, xta_int, esdi_int, ide_int, scsi_int;
|
||||
int edge = 0;
|
||||
int c_mfm, c_esdi, c_xta;
|
||||
int c_ide, c_scsi;
|
||||
@@ -454,6 +511,7 @@ ui_sb_update_panes(void)
|
||||
sb_ready = 0;
|
||||
}
|
||||
|
||||
cart_int = (machines[machine].flags & MACHINE_CARTRIDGE) ? 1 : 0;
|
||||
mfm_int = (machines[machine].flags & MACHINE_MFM) ? 1 : 0;
|
||||
xta_int = (machines[machine].flags & MACHINE_XTA) ? 1 : 0;
|
||||
esdi_int = (machines[machine].flags & MACHINE_ESDI) ? 1 : 0;
|
||||
@@ -492,6 +550,10 @@ ui_sb_update_panes(void)
|
||||
memset(sb_map, 0xff, sizeof(sb_map));
|
||||
|
||||
sb_parts = 0;
|
||||
if (cassette_enable)
|
||||
sb_parts++;
|
||||
if (cart_int)
|
||||
sb_parts += 2;
|
||||
for (i=0; i<FDD_NUM; i++) {
|
||||
if (fdd_get_type(i) != 0)
|
||||
sb_parts++;
|
||||
@@ -503,8 +565,9 @@ ui_sb_update_panes(void)
|
||||
!ide_int && memcmp(hdc_name, "ide", 3))
|
||||
continue;
|
||||
|
||||
if ((cdrom[i].bus_type == CDROM_BUS_SCSI) &&
|
||||
!scsi_int && (scsi_card_current == 0))
|
||||
if ((cdrom[i].bus_type == CDROM_BUS_SCSI) && !scsi_int &&
|
||||
(scsi_card_current[0] == 0) && (scsi_card_current[1] == 0) &&
|
||||
(scsi_card_current[2] == 0) && (scsi_card_current[3] == 0))
|
||||
continue;
|
||||
if (cdrom[i].bus_type != 0)
|
||||
sb_parts++;
|
||||
@@ -515,8 +578,9 @@ ui_sb_update_panes(void)
|
||||
!ide_int && memcmp(hdc_name, "ide", 3))
|
||||
continue;
|
||||
|
||||
if ((zip_drives[i].bus_type == ZIP_BUS_SCSI) &&
|
||||
!scsi_int && (scsi_card_current == 0))
|
||||
if ((zip_drives[i].bus_type == ZIP_BUS_SCSI) && !scsi_int &&
|
||||
(scsi_card_current[0] == 0) && (scsi_card_current[1] == 0) &&
|
||||
(scsi_card_current[2] == 0) && (scsi_card_current[3] == 0))
|
||||
continue;
|
||||
if (zip_drives[i].bus_type != 0)
|
||||
sb_parts++;
|
||||
@@ -527,8 +591,9 @@ ui_sb_update_panes(void)
|
||||
!ide_int && memcmp(hdc_name, "ide", 3))
|
||||
continue;
|
||||
|
||||
if ((mo_drives[i].bus_type == MO_BUS_SCSI) &&
|
||||
!scsi_int && (scsi_card_current == 0))
|
||||
if ((mo_drives[i].bus_type == MO_BUS_SCSI) && !scsi_int &&
|
||||
(scsi_card_current[0] == 0) && (scsi_card_current[1] == 0) &&
|
||||
(scsi_card_current[2] == 0) && (scsi_card_current[3] == 0))
|
||||
continue;
|
||||
if (mo_drives[i].bus_type != 0)
|
||||
sb_parts++;
|
||||
@@ -545,7 +610,8 @@ ui_sb_update_panes(void)
|
||||
sb_parts++;
|
||||
if (c_ide && (ide_int || !memcmp(hdc_name, "xtide", 5) || !memcmp(hdc_name, "ide", 3)))
|
||||
sb_parts++;
|
||||
if (c_scsi && (scsi_int || (scsi_card_current != 0)))
|
||||
if (c_scsi && (scsi_int || (scsi_card_current[0] != 0) || (scsi_card_current[1] != 0) ||
|
||||
(scsi_card_current[2] != 0) || (scsi_card_current[3] != 0)))
|
||||
sb_parts++;
|
||||
if (do_net)
|
||||
sb_parts++;
|
||||
@@ -561,6 +627,22 @@ ui_sb_update_panes(void)
|
||||
memset(sbTips, 0, sb_parts * sizeof(WCHAR *));
|
||||
|
||||
sb_parts = 0;
|
||||
if (cassette_enable) {
|
||||
edge += icon_width;
|
||||
iStatusWidths[sb_parts] = edge;
|
||||
sb_part_meanings[sb_parts] = SB_CASSETTE;
|
||||
sb_map[SB_CASSETTE] = sb_parts;
|
||||
sb_parts++;
|
||||
}
|
||||
for (i=0; i<2; i++) {
|
||||
if (cart_int) {
|
||||
edge += icon_width;
|
||||
iStatusWidths[sb_parts] = edge;
|
||||
sb_part_meanings[sb_parts] = SB_CARTRIDGE | i;
|
||||
sb_map[SB_CARTRIDGE | i] = sb_parts;
|
||||
sb_parts++;
|
||||
}
|
||||
}
|
||||
for (i=0; i<FDD_NUM; i++) {
|
||||
if (fdd_get_type(i) != 0) {
|
||||
edge += icon_width;
|
||||
@@ -575,8 +657,9 @@ ui_sb_update_panes(void)
|
||||
if ((cdrom[i].bus_type == CDROM_BUS_ATAPI) &&
|
||||
!ide_int && memcmp(hdc_name, "ide", 3))
|
||||
continue;
|
||||
if ((cdrom[i].bus_type == CDROM_BUS_SCSI) &&
|
||||
!scsi_int && (scsi_card_current == 0))
|
||||
if ((cdrom[i].bus_type == CDROM_BUS_SCSI) && !scsi_int &&
|
||||
(scsi_card_current[0] == 0) && (scsi_card_current[1] == 0) &&
|
||||
(scsi_card_current[2] == 0) && (scsi_card_current[3] == 0))
|
||||
continue;
|
||||
if (cdrom[i].bus_type != 0) {
|
||||
edge += icon_width;
|
||||
@@ -591,8 +674,9 @@ ui_sb_update_panes(void)
|
||||
if ((zip_drives[i].bus_type == ZIP_BUS_ATAPI) &&
|
||||
!ide_int && memcmp(hdc_name, "ide", 3))
|
||||
continue;
|
||||
if ((zip_drives[i].bus_type == ZIP_BUS_SCSI) &&
|
||||
!scsi_int && (scsi_card_current == 0))
|
||||
if ((zip_drives[i].bus_type == ZIP_BUS_SCSI) && !scsi_int &&
|
||||
(scsi_card_current[0] == 0) && (scsi_card_current[1] == 0) &&
|
||||
(scsi_card_current[2] == 0) && (scsi_card_current[3] == 0))
|
||||
continue;
|
||||
if (zip_drives[i].bus_type != 0) {
|
||||
edge += icon_width;
|
||||
@@ -607,8 +691,9 @@ ui_sb_update_panes(void)
|
||||
if ((mo_drives[i].bus_type == MO_BUS_ATAPI) &&
|
||||
!ide_int && memcmp(hdc_name, "ide", 3))
|
||||
continue;
|
||||
if ((mo_drives[i].bus_type == MO_BUS_SCSI) &&
|
||||
!scsi_int && (scsi_card_current == 0))
|
||||
if ((mo_drives[i].bus_type == MO_BUS_SCSI) && !scsi_int &&
|
||||
(scsi_card_current[0] == 0) && (scsi_card_current[1] == 0) &&
|
||||
(scsi_card_current[2] == 0) && (scsi_card_current[3] == 0))
|
||||
continue;
|
||||
if (mo_drives[i].bus_type != 0) {
|
||||
edge += icon_width;
|
||||
@@ -646,7 +731,8 @@ ui_sb_update_panes(void)
|
||||
sb_map[SB_HDD | HDD_BUS_IDE] = sb_parts;
|
||||
sb_parts++;
|
||||
}
|
||||
if (c_scsi && (scsi_int || (scsi_card_current != 0))) {
|
||||
if (c_scsi && (scsi_int || (scsi_card_current[0] != 0) || (scsi_card_current[1] != 0) ||
|
||||
(scsi_card_current[2] != 0) || (scsi_card_current[3] != 0))) {
|
||||
edge += icon_width;
|
||||
iStatusWidths[sb_parts] = edge;
|
||||
sb_part_meanings[sb_parts] = SB_HDD | HDD_BUS_SCSI;
|
||||
@@ -677,6 +763,18 @@ ui_sb_update_panes(void)
|
||||
|
||||
for (i=0; i<sb_parts; i++) {
|
||||
switch (sb_part_meanings[i] & 0xf0) {
|
||||
case SB_CASSETTE: /* Cassette */
|
||||
sb_part_icons[i] = (strlen(cassette_fname) == 0) ? 128 : 0;
|
||||
sb_part_icons[i] |= 64;
|
||||
StatusBarCreateCassetteTip(i);
|
||||
break;
|
||||
|
||||
case SB_CARTRIDGE: /* Cartridge */
|
||||
sb_part_icons[i] = (strlen(cart_fns[sb_part_meanings[i] & 0xf]) == 0) ? 128 : 0;
|
||||
sb_part_icons[i] |= 104;
|
||||
StatusBarCreateCartridgeTip(i);
|
||||
break;
|
||||
|
||||
case SB_FLOPPY: /* Floppy */
|
||||
sb_part_icons[i] = (strlen(floppyfns[sb_part_meanings[i] & 0xf]) == 0) ? 128 : 0;
|
||||
sb_part_icons[i] |= fdd_type_to_icon(fdd_get_type(sb_part_meanings[i] & 0xf));
|
||||
@@ -750,6 +848,12 @@ StatusBarPopupMenu(HWND hwnd, POINT pt, int id)
|
||||
ClientToScreen(hwnd, (LPPOINT) &pt);
|
||||
|
||||
switch(sb_part_meanings[id] & 0xF0) {
|
||||
case SB_CASSETTE:
|
||||
menu = media_menu_get_cassette();
|
||||
break;
|
||||
case SB_CARTRIDGE:
|
||||
menu = media_menu_get_cartridge(sb_part_meanings[id] & 0x0F);
|
||||
break;
|
||||
case SB_FLOPPY:
|
||||
menu = media_menu_get_floppy(sb_part_meanings[id] & 0x0F);
|
||||
break;
|
||||
@@ -798,6 +902,7 @@ StatusBarLoadIcon(HINSTANCE hInst) {
|
||||
hIcon[i] = LoadImage(hInst, MAKEINTRESOURCE(i), IMAGE_ICON, x, x, LR_DEFAULTCOLOR);
|
||||
for (i = 96; i < 98; i++)
|
||||
hIcon[i] = LoadImage(hInst, MAKEINTRESOURCE(i), IMAGE_ICON, x, x, LR_DEFAULTCOLOR);
|
||||
hIcon[104] = LoadImage(hInst, MAKEINTRESOURCE(104), IMAGE_ICON, x, x, LR_DEFAULTCOLOR);
|
||||
for (i = 144; i < 146; i++)
|
||||
hIcon[i] = LoadImage(hInst, MAKEINTRESOURCE(i), IMAGE_ICON, x, x, LR_DEFAULTCOLOR);
|
||||
for (i = 152; i < 154; i++)
|
||||
@@ -810,6 +915,7 @@ StatusBarLoadIcon(HINSTANCE hInst) {
|
||||
hIcon[i] = LoadImage(hInst, MAKEINTRESOURCE(i), IMAGE_ICON, x, x, LR_DEFAULTCOLOR);
|
||||
for (i = 192; i < 194; i++)
|
||||
hIcon[i] = LoadImage(hInst, MAKEINTRESOURCE(i), IMAGE_ICON, x, x, LR_DEFAULTCOLOR);
|
||||
hIcon[232] = LoadImage(hInst, MAKEINTRESOURCE(232), IMAGE_ICON, x, x, LR_DEFAULTCOLOR);
|
||||
for (i = 243; i < 244; i++)
|
||||
hIcon[i] = LoadImage(hInst, MAKEINTRESOURCE(i), IMAGE_ICON, x, x, LR_DEFAULTCOLOR);
|
||||
}
|
||||
|
||||
@@ -44,15 +44,6 @@ thread_create(void (*func)(void *param), void *param)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
thread_kill(void *arg)
|
||||
{
|
||||
if (arg == NULL) return;
|
||||
|
||||
TerminateThread(arg, 0);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
thread_wait(thread_t *arg, int timeout)
|
||||
{
|
||||
|
||||
107
src/win/win_ui.c
107
src/win/win_ui.c
@@ -67,6 +67,8 @@ int infocus = 1, button_down = 0;
|
||||
int rctrl_is_lalt = 0;
|
||||
int user_resize = 0;
|
||||
int fixed_size_x = 0, fixed_size_y = 0;
|
||||
int kbd_req_capture = 0;
|
||||
int hide_status_bar = 0;
|
||||
|
||||
extern char openfilestring[512];
|
||||
extern WCHAR wopenfilestring[512];
|
||||
@@ -80,11 +82,9 @@ static int hook_enabled = 0;
|
||||
#endif
|
||||
static int manager_wm = 0;
|
||||
static int save_window_pos = 0, pause_state = 0;
|
||||
static int dpi = 96;
|
||||
static int padded_frame = 0;
|
||||
|
||||
|
||||
static int vis = -1;
|
||||
static int dpi = 96;
|
||||
static int padded_frame = 0;
|
||||
static int vis = -1;
|
||||
|
||||
/* Per Monitor DPI Aware v2 APIs, Windows 10 v1703+ */
|
||||
void* user32_handle = NULL;
|
||||
@@ -177,6 +177,7 @@ video_toggle_option(HMENU h, int *val, int id)
|
||||
device_force_redraw();
|
||||
}
|
||||
|
||||
#if defined(DEV_BRANCH) && defined(USE_OPENGL)
|
||||
/* Recursively finds and deletes target submenu */
|
||||
static int
|
||||
delete_submenu(HMENU parent, HMENU target)
|
||||
@@ -204,6 +205,7 @@ delete_submenu(HMENU parent, HMENU target)
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
show_render_options_menu()
|
||||
@@ -256,13 +258,8 @@ video_set_filter_menu(HMENU menu)
|
||||
static void
|
||||
ResetAllMenus(void)
|
||||
{
|
||||
#ifndef DEV_BRANCH
|
||||
/* FIXME: until we fix these.. --FvK */
|
||||
EnableMenuItem(menuMain, IDM_CONFIG_LOAD, MF_DISABLED);
|
||||
EnableMenuItem(menuMain, IDM_CONFIG_SAVE, MF_DISABLED);
|
||||
#endif
|
||||
|
||||
CheckMenuItem(menuMain, IDM_ACTION_RCTRL_IS_LALT, MF_UNCHECKED);
|
||||
CheckMenuItem(menuMain, IDM_ACTION_KBD_REQ_CAPTURE, MF_UNCHECKED);
|
||||
|
||||
CheckMenuItem(menuMain, IDM_UPDATE_ICONS, MF_UNCHECKED);
|
||||
|
||||
@@ -290,6 +287,7 @@ ResetAllMenus(void)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
CheckMenuItem(menuMain, IDM_VID_HIDE_STATUS_BAR, MF_UNCHECKED);
|
||||
CheckMenuItem(menuMain, IDM_VID_FORCE43, MF_UNCHECKED);
|
||||
CheckMenuItem(menuMain, IDM_VID_OVERSCAN, MF_UNCHECKED);
|
||||
CheckMenuItem(menuMain, IDM_VID_INVERT, MF_UNCHECKED);
|
||||
@@ -328,6 +326,7 @@ ResetAllMenus(void)
|
||||
CheckMenuItem(menuMain, IDM_VID_GRAY_RGB+4, MF_UNCHECKED);
|
||||
|
||||
CheckMenuItem(menuMain, IDM_ACTION_RCTRL_IS_LALT, rctrl_is_lalt ? MF_CHECKED : MF_UNCHECKED);
|
||||
CheckMenuItem(menuMain, IDM_ACTION_KBD_REQ_CAPTURE, kbd_req_capture ? MF_CHECKED : MF_UNCHECKED);
|
||||
|
||||
CheckMenuItem(menuMain, IDM_UPDATE_ICONS, update_icons ? MF_CHECKED : MF_UNCHECKED);
|
||||
|
||||
@@ -355,6 +354,7 @@ ResetAllMenus(void)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
CheckMenuItem(menuMain, IDM_VID_HIDE_STATUS_BAR, hide_status_bar ? MF_CHECKED : MF_UNCHECKED);
|
||||
CheckMenuItem(menuMain, IDM_VID_FORCE43, force_43?MF_CHECKED:MF_UNCHECKED);
|
||||
CheckMenuItem(menuMain, IDM_VID_OVERSCAN, enable_overscan?MF_CHECKED:MF_UNCHECKED);
|
||||
CheckMenuItem(menuMain, IDM_VID_INVERT, invert_display ? MF_CHECKED : MF_UNCHECKED);
|
||||
@@ -406,7 +406,8 @@ LowLevelKeyboardProc(int nCode, WPARAM wParam, LPARAM lParam)
|
||||
BOOL bControlKeyDown;
|
||||
KBDLLHOOKSTRUCT *p;
|
||||
|
||||
if (nCode < 0 || nCode != HC_ACTION || (!mouse_capture && !video_fullscreen))
|
||||
if (nCode < 0 || nCode != HC_ACTION ||
|
||||
(!mouse_capture && !video_fullscreen) || (kbd_req_capture && !mouse_capture && !video_fullscreen))
|
||||
return(CallNextHookEx(hKeyboardHook, nCode, wParam, lParam));
|
||||
|
||||
p = (KBDLLHOOKSTRUCT*)lParam;
|
||||
@@ -475,9 +476,10 @@ plat_power_off(void)
|
||||
|
||||
/* Cleanly terminate all of the emulator's components so as
|
||||
to avoid things like threads getting stuck. */
|
||||
do_stop();
|
||||
// do_stop();
|
||||
cpu_thread_run = 0;
|
||||
|
||||
exit(-1);
|
||||
// exit(-1);
|
||||
}
|
||||
|
||||
#ifdef MTR_ENABLED
|
||||
@@ -671,6 +673,12 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
config_save();
|
||||
break;
|
||||
|
||||
case IDM_ACTION_KBD_REQ_CAPTURE:
|
||||
kbd_req_capture ^= 1;
|
||||
CheckMenuItem(hmenu, IDM_ACTION_KBD_REQ_CAPTURE, kbd_req_capture ? MF_CHECKED : MF_UNCHECKED);
|
||||
config_save();
|
||||
break;
|
||||
|
||||
case IDM_ACTION_PAUSE:
|
||||
plat_pause(dopause ^ 1);
|
||||
CheckMenuItem(menuMain, IDM_ACTION_PAUSE, dopause ? MF_CHECKED : MF_UNCHECKED);
|
||||
@@ -694,6 +702,18 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
config_save();
|
||||
break;
|
||||
|
||||
case IDM_VID_HIDE_STATUS_BAR:
|
||||
hide_status_bar ^= 1;
|
||||
CheckMenuItem(hmenu, IDM_VID_HIDE_STATUS_BAR, hide_status_bar ? MF_CHECKED : MF_UNCHECKED);
|
||||
ShowWindow(hwndSBAR, hide_status_bar ? SW_HIDE : SW_SHOW);
|
||||
GetWindowRect(hwnd, &rect);
|
||||
if (hide_status_bar)
|
||||
MoveWindow(hwnd, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top - sbar_height, TRUE);
|
||||
else
|
||||
MoveWindow(hwnd, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top + sbar_height, TRUE);
|
||||
config_save();
|
||||
break;
|
||||
|
||||
case IDM_VID_RESIZE:
|
||||
vid_resize ^= 1;
|
||||
CheckMenuItem(hmenu, IDM_VID_RESIZE, (vid_resize & 1) ? MF_CHECKED : MF_UNCHECKED);
|
||||
@@ -712,7 +732,10 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
temp_y = unscaled_size_y;
|
||||
}
|
||||
|
||||
ResizeWindowByClientArea(hwnd, temp_x, temp_y + sbar_height);
|
||||
if (hide_status_bar)
|
||||
ResizeWindowByClientArea(hwnd, temp_x, temp_y);
|
||||
else
|
||||
ResizeWindowByClientArea(hwnd, temp_x, temp_y + sbar_height);
|
||||
|
||||
if (mouse_capture) {
|
||||
ClipCursor(&rect);
|
||||
@@ -998,7 +1021,10 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
}
|
||||
|
||||
/* Main Window. */
|
||||
ResizeWindowByClientArea(hwndMain, temp_x, temp_y + sbar_height);
|
||||
if (hide_status_bar)
|
||||
ResizeWindowByClientArea(hwndMain, temp_x, temp_y);
|
||||
else
|
||||
ResizeWindowByClientArea(hwndMain, temp_x, temp_y + sbar_height);
|
||||
} else if (!user_resize)
|
||||
doresize = 1;
|
||||
break;
|
||||
@@ -1028,14 +1054,29 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
if (!(pos->flags & SWP_NOSIZE) || !user_resize) {
|
||||
plat_vidapi_enable(0);
|
||||
|
||||
MoveWindow(hwndSBAR, 0, rect.bottom - sbar_height, sbar_height, rect.right, TRUE);
|
||||
MoveWindow(hwndRender, 0, 0, rect.right, rect.bottom - sbar_height, TRUE);
|
||||
if (hide_status_bar)
|
||||
MoveWindow(hwndRender, 0, 0, rect.right, rect.bottom, TRUE);
|
||||
else {
|
||||
MoveWindow(hwndSBAR, 0, rect.bottom - sbar_height, sbar_height, rect.right, TRUE);
|
||||
MoveWindow(hwndRender, 0, 0, rect.right, rect.bottom - sbar_height, TRUE);
|
||||
}
|
||||
|
||||
GetClientRect(hwndRender, &rect);
|
||||
if (rect.right != scrnsz_x || rect.bottom != scrnsz_y) {
|
||||
scrnsz_x = rect.right;
|
||||
scrnsz_y = rect.bottom;
|
||||
doresize = 1;
|
||||
if (dpi_scale) {
|
||||
temp_x = MulDiv(rect.right, 96, dpi);
|
||||
temp_y = MulDiv(rect.bottom, 96, dpi);
|
||||
|
||||
if (temp_x != scrnsz_x || temp_y != scrnsz_y) {
|
||||
scrnsz_x = temp_x;
|
||||
scrnsz_y = temp_y;
|
||||
doresize = 1;
|
||||
}
|
||||
} else {
|
||||
if (rect.right != scrnsz_x || rect.bottom != scrnsz_y) {
|
||||
scrnsz_x = rect.right;
|
||||
scrnsz_y = rect.bottom;
|
||||
doresize = 1;
|
||||
}
|
||||
}
|
||||
|
||||
plat_vidsize(rect.right, rect.bottom);
|
||||
@@ -1401,6 +1442,8 @@ ui_init(int nCmdShow)
|
||||
/* Get the actual height of the status bar */
|
||||
GetWindowRect(hwndSBAR, &sbar_rect);
|
||||
sbar_height = sbar_rect.bottom - sbar_rect.top;
|
||||
if (hide_status_bar)
|
||||
ShowWindow(hwndSBAR, SW_HIDE);
|
||||
|
||||
/* Set up main window for resizing if configured. */
|
||||
if (vid_resize == 1)
|
||||
@@ -1423,7 +1466,10 @@ ui_init(int nCmdShow)
|
||||
scrnsz_x = fixed_size_x;
|
||||
scrnsz_y = fixed_size_y;
|
||||
}
|
||||
ResizeWindowByClientArea(hwndMain, scrnsz_x, scrnsz_y + sbar_height);
|
||||
if (hide_status_bar)
|
||||
ResizeWindowByClientArea(hwndMain, scrnsz_x, scrnsz_y);
|
||||
else
|
||||
ResizeWindowByClientArea(hwndMain, scrnsz_x, scrnsz_y + sbar_height);
|
||||
}
|
||||
|
||||
/* Reset all menus to their defaults. */
|
||||
@@ -1528,10 +1574,10 @@ ui_init(int nCmdShow)
|
||||
fatal("bRet is -1\n");
|
||||
}
|
||||
|
||||
if (messages.message == WM_QUIT) {
|
||||
is_quit = 1;
|
||||
break;
|
||||
}
|
||||
/* On WM_QUIT, tell the CPU thread to stop running. That will then tell us
|
||||
to stop running as well. */
|
||||
if (messages.message == WM_QUIT)
|
||||
cpu_thread_run = 0;
|
||||
|
||||
if (! TranslateAccelerator(hwnd, haccel, &messages))
|
||||
{
|
||||
@@ -1667,7 +1713,10 @@ plat_resize(int x, int y)
|
||||
x = MulDiv(x, dpi, 96);
|
||||
y = MulDiv(y, dpi, 96);
|
||||
}
|
||||
ResizeWindowByClientArea(hwndMain, x, y + sbar_height);
|
||||
if (hide_status_bar)
|
||||
ResizeWindowByClientArea(hwndMain, x, y);
|
||||
else
|
||||
ResizeWindowByClientArea(hwndMain, x, y + sbar_height);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1677,7 +1726,7 @@ plat_mouse_capture(int on)
|
||||
{
|
||||
RECT rect;
|
||||
|
||||
if (mouse_type == MOUSE_TYPE_NONE)
|
||||
if (!kbd_req_capture && (mouse_type == MOUSE_TYPE_NONE))
|
||||
return;
|
||||
|
||||
if (on && !mouse_capture) {
|
||||
|
||||
Reference in New Issue
Block a user