Merge branch '86Box:master' into master

This commit is contained in:
starfrost
2025-04-28 02:05:00 +01:00
committed by GitHub
11 changed files with 216 additions and 88 deletions

View File

@@ -0,0 +1,20 @@
#
# 86Box A hypervisor and IBM PC system emulator that specializes in
# running old operating systems and software designed for IBM
# PC systems and compatibles from 1981 through fairly recent
# system designs based on the PCI bus.
#
# This file is part of the 86Box distribution.
#
# CMake toolchain file defining GCC compiler flags
# for 64-bit x86 targets.
#
# Authors: David Hrdlička, <hrdlickadavid@outlook.com>
#
# Copyright 2021 David Hrdlička.
#
include(${CMAKE_CURRENT_LIST_DIR}/flags-gcc-x86_64.cmake)
set(CMAKE_C_COMPILER icx)
set(CMAKE_CXX_COMPILER icpx)

View File

@@ -0,0 +1,23 @@
#
# 86Box A hypervisor and IBM PC system emulator that specializes in
# running old operating systems and software designed for IBM
# PC systems and compatibles from 1981 through fairly recent
# system designs based on the PCI bus.
#
# This file is part of the 86Box distribution.
#
# CMake toolchain file defining Clang compiler flags
# for 64-bit x86 targets.
#
# Authors: David Hrdlička, <hrdlickadavid@outlook.com>
# dob205
#
# Copyright 2021 David Hrdlička.
# Copyright 2022 dob205.
#
include(${CMAKE_CURRENT_LIST_DIR}/flags-gcc-x86_64.cmake)
# Use the GCC-compatible Clang executables in order to use our flags
set(CMAKE_C_COMPILER clang)
set(CMAKE_CXX_COMPILER clang++)

View File

@@ -586,6 +586,55 @@ delete_nvr_file(uint8_t flash)
extern void device_find_all_descs(void);
static void
pc_show_usage(char *s)
{
char p[4096] = { 0 };
sprintf(p,
"\n%sUsage: 86box [options] [cfg-file]\n\n"
"Valid options are:\n\n"
"-? or --help\t\t\t- show this information\n"
"-C or --config path\t\t- set 'path' to be config file\n"
#ifdef _WIN32
"-D or --debug\t\t\t- force debug output logging\n"
#endif
#if 0
"-E or --nographic\t\t- forces the old behavior\n"
#endif
"-F or --fullscreen\t\t- start in fullscreen mode\n"
"-G or --lang langid\t\t- start with specified language\n"
"\t\t\t\t (e.g. en-US, or system)\n"
#ifdef _WIN32
"-H or --hwnd id,hwnd\t\t- sends back the main dialog's hwnd\n"
#endif
"-I or --image d:path\t\t- load 'path' as floppy image on drive d\n"
#ifdef USE_INSTRUMENT
"-J or --instrument name\t- set 'name' to be the profiling instrument\n"
#endif
"-L or --logfile pat\t\t- set 'path' to be the logfile\n"
"-M or --missing\t\t- dump missing machines and video cards\n"
"-N or --noconfirm\t\t- do not ask for confirmation on quit\n"
"-P or --vmpath path\t\t- set 'path' to be root for vm\n"
"-R or --rompath path\t\t- set 'path' to be ROM path\n"
#ifndef USE_SDL_UI
"-S or --settings\t\t\t- show only the settings dialog\n"
#endif
"-T or --testmode\t\t- test mode: execute the test mode entry\n"
"\t\t\t\t point on init/hard reset\n"
"-V or --vmname name\t\t- overrides the name of the running VM\n"
"-W or --nohook\t\t- disables keyboard hook\n"
"\t\t\t\t (compatibility-only outside Windows)\n"
"-X or --clear what\t\t- clears the 'what' (cmos/flash/both)\n"
"-Y or --donothing\t\t- do not show any UI or run the emulation\n"
"-Z or --lastvmpath\t\t- the last parameter is VM path rather\n"
"\t\t\t\t than config\n"
"\nA config file can be specified. If none is, the default file will be used.\n",
(s == NULL) ? "" : s);
ui_msgbox(MBX_ANSI | ((s == NULL) ? MBX_INFO : MBX_WARNING), p);
}
/*
* Perform initial startup of the PC.
*
@@ -609,6 +658,7 @@ pc_init(int argc, char *argv[])
time_t now;
int c;
int lvmp = 0;
int deprecated = 1;
#ifdef ENABLE_NG
int ng = 0;
#endif
@@ -666,44 +716,7 @@ usage:
}
}
ui_msgbox(MBX_INFO, L"\nUsage: 86box [options] [cfg-file]\n\n"
"Valid options are:\n\n"
"-? or --help\t\t\t- show this information\n"
"-C or --config path\t\t- set 'path' to be config file\n"
#ifdef _WIN32
"-D or --debug\t\t\t- force debug output logging\n"
#endif
#if 0
"-E or --nographic\t\t- forces the old behavior\n"
#endif
"-F or --fullscreen\t\t- start in fullscreen mode\n"
"-G or --lang langid\t\t- start with specified language\n"
"\t\t\t\t (e.g. en-US, or system)\n"
#ifdef _WIN32
"-H or --hwnd id,hwnd\t\t- sends back the main dialog's hwnd\n"
#endif
"-I or --image d:path\t\t- load 'path' as floppy image on drive d\n"
#ifdef USE_INSTRUMENT
"-J or --instrument name\t- set 'name' to be the profiling instrument\n"
#endif
"-L or --logfile pat\t\t- set 'path' to be the logfile\n"
"-M or --missing\t\t- dump missing machines and video cards\n"
"-N or --noconfirm\t\t- do not ask for confirmation on quit\n"
"-P or --vmpath path\t\t- set 'path' to be root for vm\n"
"-R or --rompath path\t\t- set 'path' to be ROM path\n"
#ifndef USE_SDL_UI
"-S or --settings\t\t\t- show only the settings dialog\n"
#endif
"-T or --testmode\t\t- test mode: execute the test mode entry\n"
"\t\t\t\t point on init/hard reset\n"
"-V or --vmname name\t\t- overrides the name of the running VM\n"
"-W or --nohook\t\t- disables keyboard hook\n"
"\t\t\t\t (compatibility-only outside Windows)\n"
"-X or --clear what\t\t- clears the 'what' (cmos/flash/both)\n"
"-Y or --donothing\t\t- do not show any UI or run the emulation\n"
"-Z or --lastvmpath\t\t- the last parameter is VM path rather\n"
"\t\t\t\t than config\n"
"\nA config file can be specified. If none is, the default file will be used.\n");
pc_show_usage(NULL);
return 0;
} else if (!strcasecmp(argv[c], "--lastvmpath") || !strcasecmp(argv[c], "-Z")) {
lvmp = 1;
@@ -730,6 +743,7 @@ usage:
goto usage;
ppath = argv[++c];
deprecated = 0;
} else if (!strcasecmp(argv[c], "--rompath") || !strcasecmp(argv[c], "-R")) {
if ((c + 1) == argc)
goto usage;
@@ -741,6 +755,7 @@ usage:
goto usage;
cfg = argv[++c];
deprecated = 0;
} else if (!strcasecmp(argv[c], "--image") || !strcasecmp(argv[c], "-I")) {
if ((c + 1) == argc)
goto usage;
@@ -839,11 +854,18 @@ usage:
ppath = argv[c++];
else
cfg = argv[c++];
deprecated = 0;
}
if (c != argc)
goto usage;
if (deprecated)
pc_show_usage("Running 86Box without a specified VM path and/or configuration\n"
"file has been deprected. Please specify one or use a manager\n"
"(Avalonia 86 is recommended).\n\n");
path_slash(usr_path);
path_slash(rom_path);

View File

@@ -306,6 +306,7 @@ struct ir_data_t;
x86seg *codegen_generate_ea(struct ir_data_t *ir, x86seg *op_ea_seg, uint32_t fetchdat, int op_ssegs, uint32_t *op_pc, uint32_t op_32, int stack_offset);
extern void codegen_check_seg_read(codeblock_t *block, struct ir_data_t *ir, x86seg *seg);
extern void codegen_check_seg_write(codeblock_t *block, struct ir_data_t *ir, x86seg *seg);
extern void codegen_check_regs(void);
extern int codegen_purge_purgable_list(void);
/*Delete a random code block to free memory. This is obviously quite expensive, and

View File

@@ -217,6 +217,7 @@ block_free_list_get(void)
void
codegen_init(void)
{
codegen_check_regs();
codegen_allocator_init();
codegen_backend_init();

View File

@@ -226,6 +226,20 @@ reg_is_native_size(ir_reg_t ir_reg)
return 0;
}
void
codegen_check_regs(void)
{
int i = 0;
for (i = 0; i < IREG_COUNT; i++) {
if (ireg_data[i].is_volatile == REG_VOLATILE)
continue;
if (ireg_data[i].p && ((uintptr_t)ireg_data[i].p - (uintptr_t)&cpu_state) >= sizeof(cpu_state)) {
fatal("Register number %d outside cpu_state!\n", i);
}
}
}
void
codegen_reg_reset(void)
{

View File

@@ -113,8 +113,6 @@ uint8_t is_smint = 0;
uint16_t io_port = 0x0000;
uint32_t io_val = 0x00000000;
uint32_t x87_op = 0x00000000;
int opcode_has_modrm[256] = {
1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, /*00*/
1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, /*10*/

View File

@@ -38,6 +38,7 @@
#include <86box/ppi.h>
#include <86box/timer.h>
#include <86box/gdbstub.h>
#include <86box/plat_fallthrough.h>
#include <86box/plat_unused.h>
/* Is the CPU 8088 or 8086. */
@@ -3438,10 +3439,13 @@ execx86(int cycs)
set_pzs(8);
break;
case 0xD6: /*SALC*/
wait(1, 0);
AL = (cpu_state.flags & C_FLAG) ? 0xff : 0x00;
wait(1, 0);
break;
if (!is_nec) {
wait(1, 0);
AL = (cpu_state.flags & C_FLAG) ? 0xff : 0x00;
wait(1, 0);
break;
}
fallthrough;
case 0xD7: /*XLATB*/
cpu_state.eaaddr = (BX + AL) & 0xffff;
access(4, 8);

View File

@@ -416,6 +416,8 @@ typedef struct {
uint16_t eflags;
uint32_t _smbase;
uint32_t x87_op;
} cpu_state_t;
#define in_smm cpu_state._in_smm
@@ -784,7 +786,7 @@ typedef struct {
uint32_t smhr;
} cyrix_t;
extern uint32_t x87_op;
#define x87_op cpu_state.x87_op
extern uint32_t addr64;
extern uint32_t addr64_2;

View File

@@ -272,6 +272,7 @@ reset_common(int hard)
msr.fcr = (1 << 8) | (1 << 9) | (1 << 12) | (1 << 16) | (1 << 19) | (1 << 21);
msw = 0;
new_ne = 0;
x87_op = 0;
ccr0 = ccr1 = ccr2 = ccr3 = ccr4 = ccr5 = ccr6 = ccr7 = 0;
ccr4 = 0x85;

View File

@@ -631,7 +631,7 @@ msgid " - PAUSED"
msgstr " - PAUSADO"
msgid "Press %s to return to windowed mode."
msgstr "Use %s para retornar ao modo janela"
msgstr "Use %s para retornar ao modo janela."
msgid "Speed"
msgstr "Velocidade"
@@ -847,7 +847,7 @@ msgid "86Box v"
msgstr "86Box versão"
msgid "An emulator of old computers\n\nAuthors: Miran Grča (OBattler), RichardG867, Jasmine Iwanek, TC1995, coldbrewed, Teemu Korhonen (Manaatti), Joakim L. Gilje, Adrien Moulin (elyosh), Daniel Balsom (gloriouscow), Cacodemon345, Fred N. van Kempen (waltje), Tiseno100, reenigne, and others.\n\nWith previous core contributions from Sarah Walker, leilei, JohnElliott, greatpsycho, and others.\n\nReleased under the GNU General Public License version 2 or later. See LICENSE for more information."
msgstr "Um emulador de computadores antigos\n\nAutores: Miran Grča (OBattler), RichardG867, Jasmine Iwanek, TC1995, coldbrewed, Teemu Korhonen (Manaatti), Joakim L. Gilje, Adrien Moulin (elyosh), Daniel Balsom (gloriouscow), Cacodemon345, Fred N. van Kempen (waltje), Tiseno100, reenigne, e outros.\n\nCom contribuições anteriores de Sarah Walker, leilei, JohnElliott, greatpsycho, e outros.\n\nTraduzido por: Altieres Lima da Silva\n\nLançado sob a Licença Pública Geral GNU, versão 2 ou posterior. Veja o arquivo LICENSE para mais informações."
msgstr "Um emulador de computadores antigos\n\nAutores: Miran Grča (OBattler), RichardG867, Jasmine Iwanek, TC1995, coldbrewed, Teemu Korhonen (Manaatti), Joakim L. Gilje, Adrien Moulin (elyosh), Daniel Balsom (gloriouscow), Cacodemon345, Fred N. van Kempen (waltje), Tiseno100, reenigne, e outros.\n\nCom contribuições anteriores de Sarah Walker, leilei, JohnElliott, greatpsycho, e outros.\n\nTraduzido por: Altieres Lima da Silva, Nelson K. Hennemann Filho\n\nLançado sob a Licença Pública Geral GNU, versão 2 ou posterior. Veja o arquivo LICENSE para mais informações."
msgid "Hardware not available"
msgstr "Hardware não disponível"
@@ -967,13 +967,13 @@ msgid "HDI or HDX images with a sector size other than 512 are not supported."
msgstr "Imagens HDI ou HDX com um tamanho de setor que não seja 512 não são suportadas."
msgid "Disk image file already exists"
msgstr "Esta imagem existe"
msgstr "A imagem de disco já existe"
msgid "Please specify a valid file name."
msgstr "Digite um nome de arquivo válido."
msgid "Disk image created"
msgstr "A imagem foi criada com sucesso"
msgstr "A imagem de disco foi criada"
msgid "Make sure the file exists and is readable."
msgstr "Certifique-se de que o arquivo existe e é legível."
@@ -982,7 +982,7 @@ msgid "Make sure the file is being saved to a writable directory."
msgstr "Certifique-se de que o arquivo está sendo salvo em um diretório gravável."
msgid "Disk image too large"
msgstr "A imagem do disco é muito grande"
msgstr "A imagem de disco é muito grande"
msgid "Remember to partition and format the newly-created drive."
msgstr "Lembre-se de particionar e formatar a unidade recém-criada."
@@ -1312,16 +1312,16 @@ msgid "This machine might have been moved or copied."
msgstr "Essa máquina pode ter sido movida ou copiada."
msgid "In order to ensure proper networking functionality, 86Box needs to know if this machine was moved or copied.\n\nSelect \"I Copied It\" if you are not sure."
msgstr "Para garantir a funcionalidade adequada da rede, o 86Box precisa saber se essa máquina foi movida ou copiada.\n\nSelecione \"A copiei\" se não tiver certeza."
msgstr "Para garantir a funcionalidade adequada da rede, o 86Box precisa saber se essa máquina foi movida ou copiada.\n\nSelecione \"Copiei\" se não tiver certeza."
msgid "I Moved It"
msgstr "O movi"
msgstr "Movi"
msgid "I Copied It"
msgstr "A copiei"
msgstr "Copiei"
msgid "86Box Monitor #"
msgstr "Monitor 86Box "
msgstr "Monitor 86Box #"
msgid "No MCA devices."
msgstr "Nenhum dispositivo MCA."
@@ -1483,7 +1483,7 @@ msgid "MIDI Clockout"
msgstr "Saída do relógio MIDI"
msgid "SoundFont"
msgstr "Fonte de som"
msgstr "SoundFont"
msgid "Output Gain"
msgstr "Ganho de saída"
@@ -1789,7 +1789,7 @@ msgid "4th Order"
msgstr "De 4ª ordem"
msgid "7th Order"
msgstr "De 7º order"
msgstr "De 7ª ordem"
msgid "Non-timed (original)"
msgstr "Sem cronômetro (original)"
@@ -1807,10 +1807,10 @@ msgid "Wheel"
msgstr "Roda"
msgid "Five + Wheel"
msgstr "Cinco + roda"
msgstr "Cinco + Roda"
msgid "Five + 2 Wheels"
msgstr ""
msgstr "Cinco + 2 Rodas"
msgid "A3 - SMT2 Serial / SMT3(R)V"
msgstr "A3 - SMT2 Serial / SMT3(R)V"
@@ -2035,7 +2035,7 @@ msgid "Baud Rate of Passthrough"
msgstr "Taxa de transmissão de passagem"
msgid "Named Pipe (Server)"
msgstr "Tubo nomeado (servidor)"
msgstr "Pipe nomeado (servidor)"
msgid "Host Serial Passthrough"
msgstr "Passagem da porta serial do host"
@@ -2053,28 +2053,28 @@ msgid "High performance impact"
msgstr "Alto impacto no desempenho"
msgid "[Generic] RAM Disk (max. speed)"
msgstr "[Generic] Disco RAM (velocidade máxima)"
msgstr "[Genérico] Disco RAM (velocidade máxima)"
msgid "[Generic] 1989 (3500 RPM)"
msgstr ""
msgstr "[Genérico] 1989 (3500 RPM)"
msgid "[Generic] 1992 (3600 RPM)"
msgstr ""
msgstr "[Genérico] 1992 (3600 RPM)"
msgid "[Generic] 1994 (4500 RPM)"
msgstr ""
msgstr "[Genérico] 1994 (4500 RPM)"
msgid "[Generic] 1996 (5400 RPM)"
msgstr ""
msgstr "[Genérico] 1996 (5400 RPM)"
msgid "[Generic] 1997 (5400 RPM)"
msgstr ""
msgstr "[Genérico] 1997 (5400 RPM)"
msgid "[Generic] 1998 (5400 RPM)"
msgstr ""
msgstr "[Genérico] 1998 (5400 RPM)"
msgid "[Generic] 2000 (7200 RPM)"
msgstr ""
msgstr "[Genérico] 2000 (7200 RPM)"
msgid "IBM 8514/A clone (ISA)"
msgstr "Clone IBM 8514/A (ISA)"
@@ -2095,64 +2095,106 @@ msgid "TrueType fonts in the \"roms/printer/fonts\" directory are required for t
msgstr "As fontes TrueType no diretório \"roms/printer/fonts\" são necessárias para a emulação da impressora matricial de pontos ESC/P genérica."
msgid "Inhibit multimedia keys"
msgstr ""
msgstr "Inibir teclas multimídia"
msgid "Ask for confirmation before saving settings"
msgstr ""
msgstr "Perguntar antes de salvar configurações"
msgid "Ask for confirmation before hard resetting"
msgstr ""
msgstr "Perguntar antes de reinicialização completa"
msgid "Ask for confirmation before quitting"
msgstr ""
msgstr "Perguntar antes de sair"
msgid "Display hotkey message when entering full-screen mode"
msgstr ""
msgstr "Mostrar mensagem de atalho quando entrar em tela cheia"
msgid "Options"
msgstr ""
msgstr "Opções"
msgid "Model"
msgstr ""
msgstr "Modelo"
msgid "Model:"
msgstr ""
msgstr "Modelo:"
msgid "Failed to initialize Vulkan renderer."
msgstr ""
msgstr "Falha ao inicializar o renderizador Vulkan."
msgid "GLSL Error"
msgstr ""
msgstr "Erro GLSL"
msgid "Could not load shader: %1"
msgstr ""
msgstr "Impossível carregar o shader: %1"
msgid "OpenGL version 3.0 or greater is required. Current GLSL version is %1.%2"
msgstr ""
msgstr "OpenGL versão 3.0 ou superior é exigido. Versão atual GLSL é %1.%2"
msgid "Could not load texture: %1"
msgstr ""
msgstr "Impossível carregar a textura: %1"
msgid "Could not compile shader:\n\n%1"
msgstr ""
msgstr "Impossível compilar o shader:\n\n%1"
msgid "Program not linked:\n\n%1"
msgstr ""
msgstr "Programa não linkado:\n\n%1"
msgid "Shader Manager"
msgstr ""
msgstr "Gerenciador de Shader"
msgid "Shader Configuration"
msgstr ""
msgstr "Configuração de Shader"
msgid "Add"
msgstr ""
msgstr "Adicionar"
msgid "Move up"
msgstr ""
msgstr "Mover para cima"
msgid "Move down"
msgstr ""
msgstr "Mover para baixo"
msgid "Could not load file %1"
msgstr ""
msgstr "Impossível carregar arquivo %1"
msgid "Key Bindings:"
msgstr "Atalhos:"
msgid "Action"
msgstr "Ação"
msgid "Keybind"
msgstr "Atalho"
msgid "Clear binding"
msgstr "Limpar atalho"
msgid "Bind"
msgstr "Vincular"
msgid "Bind Key"
msgstr "Vincular tecla"
msgid "Enter key combo:"
msgstr "Pressione combinação de teclas:"
msgid "Send Control+Alt+Del"
msgstr "Enviar Control+Alt+Del"
msgid "Send Control+Alt+Escape"
msgstr "Enviar Control+Alt+Escape"
msgid "Toggle fullscreen"
msgstr "Alternar tela cheia"
msgid "Screenshot"
msgstr "Captura de tela"
msgid "Release mouse pointer"
msgstr "Liberar ponteiro do mouse"
msgid "Toggle pause"
msgstr "Alternar pausa"
msgid "Toggle mute"
msgstr "Alternar mudo"