Merge branch 'qt' of https://github.com/ts-korhonen/86Box into qt-toolbar

This commit is contained in:
ts-korhonen
2022-01-12 20:40:41 +02:00
7 changed files with 86 additions and 18 deletions

View File

@@ -21,7 +21,7 @@ System requirements and recommendations
Performance may vary depending on both host and guest configuration. Most emulation logic is executed in a single thread, therefore generally systems with better IPC (instructions per clock) should be able to emulate higher clock speeds. Performance may vary depending on both host and guest configuration. Most emulation logic is executed in a single thread, therefore generally systems with better IPC (instructions per clock) should be able to emulate higher clock speeds.
It is also recommended to use a manager application with 86Box for easier handling of multiple virtual machines. It is also recommended to use a manager application with 86Box for easier handling of multiple virtual machines.
* [WinBox for 86Box](https://github.com/laciba96/WinBox-for-86Box) by [Laci bá'](https://github.com/laciba96) * [WinBox for 86Box](https://github.com/86Box/WinBox-for-86Box) by Laci bá'
* The new manager with improved new user experience; installer, automatic updates of emulator files and more. * The new manager with improved new user experience; installer, automatic updates of emulator files and more.
* [86Box Manager](https://github.com/86Box/86BoxManager) by [daviunic](https://github.com/daviunic) (Overdoze) * [86Box Manager](https://github.com/86Box/86BoxManager) by [daviunic](https://github.com/daviunic) (Overdoze)
* The traditional 86Box manager with simple interface. * The traditional 86Box manager with simple interface.

View File

@@ -737,8 +737,8 @@ cdrom_read_disc_info_toc(cdrom_t *dev, unsigned char *b, unsigned char track, in
static int static int
track_type_is_valid(uint8_t id, int type, int flags, int audio, int mode2) track_type_is_valid(uint8_t id, int type, int flags, int audio, int mode2)
{ {
if (!(flags & 0x70)) { /* 0x00/0x08/0x80/0x88 are illegal modes */ if (!(flags & 0x70) && (flags & 0xf8)) { /* 0x08/0x80/0x88 are illegal modes */
cdrom_log("CD-ROM %i: [Any Mode] 0x00/0x08/0x80/0x88 are illegal modes\n", id); cdrom_log("CD-ROM %i: [Any Mode] 0x08/0x80/0x88 are illegal modes\n", id);
return 0; return 0;
} }
@@ -1031,8 +1031,8 @@ cdrom_readsector_raw(cdrom_t *dev, uint8_t *buffer, int sector, int ismsf, int c
memset(raw_buffer, 0, 2448); memset(raw_buffer, 0, 2448);
memset(extra_buffer, 0, 296); memset(extra_buffer, 0, 296);
if (!(cdrom_sector_flags & 0xf0)) { /* 0x00 and 0x08 are illegal modes */ if ((cdrom_sector_flags & 0xf8) == 0x08) { /* 0x08 is an illegal mode */
cdrom_log("CD-ROM %i: [Mode 1] 0x00 and 0x08 are illegal modes\n", dev->id); cdrom_log("CD-ROM %i: [Mode 1] 0x08 is an illegal mode\n", dev->id);
return 0; return 0;
} }

View File

@@ -299,6 +299,15 @@ MainWindow::MainWindow(QWidget *parent) :
ui->actionTake_screenshot->setShortcutVisibleInContextMenu(true); ui->actionTake_screenshot->setShortcutVisibleInContextMenu(true);
#endif #endif
video_setblit(qt_blit); video_setblit(qt_blit);
if (start_in_fullscreen) {
connect(ui->stackedWidget, &RendererStack::blitToRenderer, this, [this] () {
if (start_in_fullscreen) {
QTimer::singleShot(100, ui->actionFullscreen, &QAction::trigger);
start_in_fullscreen = 0;
}
});
}
} }
void MainWindow::closeEvent(QCloseEvent *event) { void MainWindow::closeEvent(QCloseEvent *event) {
@@ -984,6 +993,7 @@ void MainWindow::on_actionFullscreen_triggered() {
showFullScreen(); showFullScreen();
video_fullscreen = 1; video_fullscreen = 1;
} }
ui->stackedWidget->rendererWindow->onResize(width(), height());
} }
void MainWindow::getTitle_(wchar_t *title) void MainWindow::getTitle_(wchar_t *title)

View File

@@ -1623,7 +1623,22 @@ scsi_cdrom_command(scsi_common_t *sc, uint8_t *cdb)
dev->sector_len -= dev->sector_pos; dev->sector_len -= dev->sector_pos;
dev->sector_len++; dev->sector_len++;
msf = 1; msf = 1;
if ((cdb[9] & 0xf8) == 0x08) {
/* 0x08 is an illegal mode */
scsi_cdrom_invalid_field(dev);
return;
}
/* If all the flag bits are cleared, then treat it as a non-data command. */
if ((cdb[9] == 0x00) && ((cdb[10] & 0x07) == 0x00))
dev->sector_len = 0;
else if ((cdb[9] == 0x00) && ((cdb[10] & 0x07) != 0x00)) {
scsi_cdrom_invalid_field(dev);
return;
}
break; break;
case GPCMD_READ_CD_OLD: case GPCMD_READ_CD_OLD:
case GPCMD_READ_CD: case GPCMD_READ_CD:
@@ -1632,6 +1647,20 @@ scsi_cdrom_command(scsi_common_t *sc, uint8_t *cdb)
dev->sector_pos = (cdb[2] << 24) | (cdb[3] << 16) | (cdb[4] << 8) | cdb[5]; dev->sector_pos = (cdb[2] << 24) | (cdb[3] << 16) | (cdb[4] << 8) | cdb[5];
msf = 0; msf = 0;
if ((cdb[9] & 0xf8) == 0x08) {
/* 0x08 is an illegal mode */
scsi_cdrom_invalid_field(dev);
return;
}
/* If all the flag bits are cleared, then treat it as a non-data command. */
if ((cdb[9] == 0x00) && ((cdb[10] & 0x07) == 0x00))
dev->sector_len = 0;
else if ((cdb[9] == 0x00) && ((cdb[10] & 0x07) != 0x00)) {
scsi_cdrom_invalid_field(dev);
return;
}
break; break;
} }

View File

@@ -368,7 +368,7 @@ END
#define STR_SIZE_MB "Tamanho (MB):" #define STR_SIZE_MB "Tamanho (MB):"
#define STR_TYPE "Tipo:" #define STR_TYPE "Tipo:"
#define STR_IMG_FORMAT "Formato:" #define STR_IMG_FORMAT "Formato:"
#define STR_BLOCK_SIZE "Tamanho do bloco:" #define STR_BLOCK_SIZE "Bloco:"
#define STR_FLOPPY_DRIVES "Unidades de disquete:" #define STR_FLOPPY_DRIVES "Unidades de disquete:"
#define STR_TURBO "Turbo" #define STR_TURBO "Turbo"
@@ -478,7 +478,7 @@ BEGIN
IDS_2115 "Magneto-óptico %i (%ls): %ls" IDS_2115 "Magneto-óptico %i (%ls): %ls"
IDS_2116 "Imagens magneto-ópticas (*.IM?;*.MDI)\0*.IM?;*.MDI\0Todos os arquivos (*.*)\0*.*\0" IDS_2116 "Imagens magneto-ópticas (*.IM?;*.MDI)\0*.IM?;*.MDI\0Todos os arquivos (*.*)\0*.*\0"
IDS_2117 "Bem-vindo ao 86Box!" IDS_2117 "Bem-vindo ao 86Box!"
IDS_2118 "Controle interno" IDS_2118 "Controlador interno"
IDS_2119 "Sair" IDS_2119 "Sair"
IDS_2120 "Nenhum ROM encontrada" IDS_2120 "Nenhum ROM encontrada"
IDS_2121 "Você deseja salvar as configurações?" IDS_2121 "Você deseja salvar as configurações?"

View File

@@ -200,8 +200,9 @@ static void set_parent_binding(int enable)
* @param wParam * @param wParam
* @param lParam * @param lParam
* @param fullscreen * @param fullscreen
* @return Was message handled
*/ */
static void handle_window_messages(UINT message, WPARAM wParam, LPARAM lParam, int fullscreen) static int handle_window_messages(UINT message, WPARAM wParam, LPARAM lParam, int fullscreen)
{ {
switch (message) switch (message)
{ {
@@ -219,7 +220,7 @@ static void handle_window_messages(UINT message, WPARAM wParam, LPARAM lParam, i
/* Mouse events that enter and exit capture. */ /* Mouse events that enter and exit capture. */
PostMessage(parent, message, wParam, lParam); PostMessage(parent, message, wParam, lParam);
} }
break; return 1;
case WM_KEYDOWN: case WM_KEYDOWN:
case WM_KEYUP: case WM_KEYUP:
case WM_SYSKEYDOWN: case WM_SYSKEYDOWN:
@@ -228,7 +229,7 @@ static void handle_window_messages(UINT message, WPARAM wParam, LPARAM lParam, i
{ {
PostMessage(parent, message, wParam, lParam); PostMessage(parent, message, wParam, lParam);
} }
break; return 1;
case WM_INPUT: case WM_INPUT:
if (fullscreen) if (fullscreen)
{ {
@@ -256,8 +257,17 @@ static void handle_window_messages(UINT message, WPARAM wParam, LPARAM lParam, i
} }
free(raw); free(raw);
} }
break; return 1;
case WM_MOUSELEAVE:
if (fullscreen)
{
/* Leave fullscreen if mouse leaves the renderer window. */
PostMessage(GetAncestor(parent, GA_ROOT), WM_LEAVEFULLSCREEN, 0, 0);
}
return 0;
} }
return 0;
} }
/** /**
@@ -638,12 +648,13 @@ static void opengl_main(void* param)
/* Handle window messages */ /* Handle window messages */
MSG msg; MSG msg;
if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
{ {
if (msg.hwnd == window_hwnd) if (msg.hwnd != window_hwnd || !handle_window_messages(msg.message, msg.wParam, msg.lParam, fullscreen))
handle_window_messages(msg.message, msg.wParam, msg.lParam, fullscreen); {
TranslateMessage(&msg); TranslateMessage(&msg);
DispatchMessage(&msg); DispatchMessage(&msg);
}
} }
/* Wait for synchronized events for 1ms before going back to window events */ /* Wait for synchronized events for 1ms before going back to window events */
@@ -722,7 +733,14 @@ static void opengl_main(void* param)
{ {
SetForegroundWindow(window_hwnd); SetForegroundWindow(window_hwnd);
SetFocus(window_hwnd); SetFocus(window_hwnd);
/* Clip cursor to prevent it moving to another monitor. */
RECT rect;
GetWindowRect(window_hwnd, &rect);
ClipCursor(&rect);
} }
else
ClipCursor(NULL);
} }
if (fullscreen) if (fullscreen)

View File

@@ -43,7 +43,7 @@
#include <86box/ui.h> #include <86box/ui.h>
#include <86box/win.h> #include <86box/win.h>
#include <86box/version.h> #include <86box/version.h>
# include <86box/win_discord.h> #include <86box/discord.h>
#ifdef MTR_ENABLED #ifdef MTR_ENABLED
#include <minitrace/minitrace.h> #include <minitrace/minitrace.h>
@@ -97,7 +97,8 @@ static dllimp_t user32_imports[] = {
void* shell32_handle = NULL; void* shell32_handle = NULL;
static HRESULT (WINAPI *pSetCurrentProcessExplicitAppUserModelID)(PCWSTR AppID); static HRESULT (WINAPI *pSetCurrentProcessExplicitAppUserModelID)(PCWSTR AppID);
static dllimp_t shell32_imports[]= { static dllimp_t shell32_imports[]= {
{ "SetCurrentProcessExplicitAppUserModelID", &pSetCurrentProcessExplicitAppUserModelID } { "SetCurrentProcessExplicitAppUserModelID", &pSetCurrentProcessExplicitAppUserModelID },
{ NULL, NULL }
}; };
int int
@@ -960,6 +961,9 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
break; break;
case WM_WINDOWPOSCHANGED: case WM_WINDOWPOSCHANGED:
if (video_fullscreen & 1)
PostMessage(hwndMain, WM_LEAVEFULLSCREEN, 0, 0);
pos = (WINDOWPOS*)lParam; pos = (WINDOWPOS*)lParam;
GetClientRect(hwndMain, &rect); GetClientRect(hwndMain, &rect);
@@ -1159,6 +1163,13 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
} }
break; break;
case WM_ACTIVATEAPP:
/* Leave full screen on switching application except
for OpenGL Core and VNC renderers. */
if (video_fullscreen & 1 && wParam == FALSE && vid_api < 3)
PostMessage(hwndMain, WM_LEAVEFULLSCREEN, 0, 0);
break;
case WM_ENTERSIZEMOVE: case WM_ENTERSIZEMOVE:
user_resize = 1; user_resize = 1;
break; break;