Merge branch '86Box:master' into master

This commit is contained in:
Ompronce
2021-09-03 14:19:52 -04:00
committed by GitHub
8 changed files with 1013 additions and 378 deletions

View File

@@ -26,6 +26,13 @@
#include <string.h>
#include <time.h>
#include <wchar.h>
#ifdef __APPLE__
#include <string.h>
#include <dispatch/dispatch.h>
#ifdef __aarch64__
#include <pthread.h>
#endif
#endif
#define HAVE_STDARG_H
#include <86box/86box.h>
@@ -385,7 +392,7 @@ pc_init(int argc, char *argv[])
char temp[128];
struct tm *info;
time_t now;
int c;
int c, vmrp = 0;
int ng = 0, lvmp = 0;
uint32_t *uid, *shwnd;
@@ -429,6 +436,7 @@ usage:
printf("-H or --hwnd id,hwnd - sends back the main dialog's hwnd\n");
#endif
printf("-L or --logfile path - set 'path' to be the logfile\n");
printf("-M or --vmrompath - ROM path is roms subdirectory inside the userfiles path\n");
printf("-N or --noconfirm - do not ask for confirmation on quit\n");
printf("-O or --dumpcfg - dump config file after loading\n");
printf("-P or --vmpath path - set 'path' to be root for vm\n");
@@ -438,6 +446,9 @@ usage:
printf("-Z or --lastvmpath - the last parameter is VM path rather than config\n");
printf("\nA config file can be specified. If none is, the default file will be used.\n");
return(0);
} else if (!strcasecmp(argv[c], "--vmrompath") ||
!strcasecmp(argv[c], "-M")) {
vmrp = 1;
} else if (!strcasecmp(argv[c], "--lastvmpath") ||
!strcasecmp(argv[c], "-Z")) {
lvmp = 1;
@@ -555,6 +566,13 @@ usage:
plat_dir_create(usr_path);
}
if (vmrp && (path2[0] == '\0')) {
strcpy(path2, usr_path);
plat_path_slash(path2);
strcat(path2, "roms");
plat_path_slash(path2);
}
/*
* If the user provided a path for ROMs, use that
* instead of the current working directory. We do
@@ -620,20 +638,20 @@ usage:
/* Make sure we have a trailing backslash. */
plat_path_slash(usr_path);
plat_path_slash(rom_path);
if (rom_path[0] != '\0')
plat_path_slash(rom_path);
/* At this point, we can safely create the full path name. */
plat_append_filename(cfg_path, usr_path, p);
/*
* Get the current directory's name
* Get the current directory's name
*
* At this point usr_path is perfectly initialized.
* If no --vmname parameter specified we'll use the
* working directory name as the VM's name.
*/
if (strlen(vm_name) == 0)
{
if (strlen(vm_name) == 0) {
char ltemp[1024] = { '\0'};
plat_get_dirname(ltemp, usr_path);
strcpy(vm_name, plat_get_filename(ltemp));
@@ -648,12 +666,13 @@ usage:
strftime(temp, sizeof(temp), "%Y/%m/%d %H:%M:%S", info);
pclog("#\n# %ls v%ls logfile, created %s\n#\n",
EMU_NAME_W, EMU_VERSION_W, temp);
pclog("# VM: %s\n#\n", vm_name);
pclog("# Emulator path: %s\n", exe_path);
pclog("# Userfiles path: %s\n", usr_path);
if (rom_path[0] != '\0')
pclog("# ROM path: %s\n", rom_path);
else
pclog("# ROM path: %sroms\\\n", usr_path);
pclog("# ROM path: %sroms\\\n", exe_path);
pclog("# Configuration file: %s\n#\n\n", cfg_path);
/*
* We are about to read the configuration file, which MAY
@@ -768,7 +787,13 @@ pc_init_modules(void)
mem_init();
#ifdef USE_DYNAREC
#if defined(__APPLE__) && defined(__aarch64__)
pthread_jit_write_protect_np(0);
#endif
codegen_init();
#if defined(__APPLE__) && defined(__aarch64__)
pthread_jit_write_protect_np(1);
#endif
#endif
keyboard_init();
@@ -1064,6 +1089,15 @@ pc_close(thread_t *ptr)
}
#ifdef __APPLE__
static void _ui_window_title(void *s)
{
ui_window_title((const wchar_t *) s);
free(s);
}
#endif
void
pc_run(void)
{
@@ -1092,7 +1126,12 @@ pc_run(void)
if (title_update) {
swprintf(temp, sizeof_w(temp), mouse_msg[!!mouse_capture], fps);
#ifdef __APPLE__
/* Needed due to modifying the UI on the non-main thread is a big no-no. */
dispatch_async_f(dispatch_get_main_queue(), wcsdup((const wchar_t *) temp), _ui_window_title);
#else
ui_window_title(temp);
#endif
title_update = 0;
}
}

View File

@@ -3,6 +3,9 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#if defined(__APPLE__) && defined(__aarch64__)
#include <pthread.h>
#endif
#include <wchar.h>
#include <math.h>
#ifndef INFINITY
@@ -31,6 +34,9 @@
#endif
#include "386_common.h"
#if defined(__APPLE__) && defined(__aarch64__)
#include <pthread.h>
#endif
#define CPU_BLOCK_END() cpu_block_end = 1

View File

@@ -264,6 +264,10 @@ extern float stg_getclock(int clock, void *p);
extern void tkd8001_ramdac_out(uint16_t addr, uint8_t val, void *p, svga_t *svga);
extern uint8_t tkd8001_ramdac_in(uint16_t addr, void *p, svga_t *svga);
extern void tvp3026_ramdac_out(uint16_t addr, int rs2, int rs3, uint8_t val, void *p, svga_t *svga);
extern uint8_t tvp3026_ramdac_in(uint16_t addr, int rs2, int rs3, void *p, svga_t *svga);
extern void tvp3026_recalctimings(void *p, svga_t *svga);
extern void tvp3026_hwcursor_draw(svga_t *svga, int displine);
#ifdef EMU_DEVICE_H
extern const device_t ati68860_ramdac_device;
@@ -292,4 +296,5 @@ extern const device_t stg_ramdac_device;
extern const device_t tkd8001_ramdac_device;
extern const device_t tseng_ics5301_ramdac_device;
extern const device_t tseng_ics5341_ramdac_device;
extern const device_t tvp3026_ramdac_device;
#endif

View File

@@ -325,7 +325,10 @@ extern const device_t s3_diamond_stealth_vram_isa_device;
extern const device_t s3_ami_86c924_isa_device;
extern const device_t s3_metheus_86c928_isa_device;
extern const device_t s3_metheus_86c928_vlb_device;
extern const device_t s3_v7mirage_86c801_isa_device;
extern const device_t s3_spea_mirage_86c801_isa_device;
extern const device_t s3_spea_mirage_86c805_vlb_device;
extern const device_t s3_mirocrystal_10sd_805_vlb_device;
extern const device_t s3_phoenix_86c801_isa_device;
extern const device_t s3_phoenix_86c805_vlb_device;
extern const device_t s3_bahamas64_vlb_device;
extern const device_t s3_bahamas64_pci_device;
@@ -335,10 +338,10 @@ extern const device_t s3_phoenix_trio32_vlb_device;
extern const device_t s3_phoenix_trio32_pci_device;
extern const device_t s3_diamond_stealth_se_vlb_device;
extern const device_t s3_diamond_stealth_se_pci_device;
extern const device_t s3_spea_mirage_p64_vlb_device;
extern const device_t s3_phoenix_trio64_vlb_device;
extern const device_t s3_phoenix_trio64_onboard_pci_device;
extern const device_t s3_phoenix_trio64_pci_device;
extern const device_t s3_phoenix_trio64vplus_vlb_device;
extern const device_t s3_phoenix_trio64vplus_pci_device;
extern const device_t s3_phoenix_trio64vplus_onboard_pci_device;
extern const device_t s3_phoenix_vision864_pci_device;
@@ -349,10 +352,11 @@ extern const device_t s3_diamond_stealth64_pci_device;
extern const device_t s3_diamond_stealth64_vlb_device;
extern const device_t s3_diamond_stealth64_964_pci_device;
extern const device_t s3_diamond_stealth64_964_vlb_device;
extern const device_t s3_mirovideo_40sv_968_pci_device;
extern const device_t s3_mirovideo_40sv_968_vlb_device;
extern const device_t s3_spea_mercury_p64v_pci_device;
extern const device_t s3_elsa_winner2000_pro_x_964_pci_device;
extern const device_t s3_elsa_winner2000_pro_x_964_vlb_device;
extern const device_t s3_elsa_winner2000_pro_x_pci_device;
extern const device_t s3_elsa_winner2000_pro_x_vlb_device;
extern const device_t s3_trio64v2_dx_pci_device;
/* S3 ViRGE */

View File

@@ -1643,8 +1643,6 @@ vid_init_200(amstrad_t *ams)
memset(vid, 0x00, sizeof(amsvid_t));
vid->emulation = device_get_config_int("video_emulation");
cga_palette = (device_get_config_int("display_type") << 1);
ams_inform(vid);
/* Default to CGA */
vid->dipswitches = 0x10;
@@ -1677,6 +1675,9 @@ vid_init_200(amstrad_t *ams)
cga_init(cga);
mda_init(mda);
cga_palette = (device_get_config_int("display_type") << 1);
ams_inform(vid);
/* Attribute 8 is white on black (on a real MDA it's black on black) */
mda_setcol(0x08, 0, 1, 15);
mda_setcol(0x88, 0, 1, 15);

View File

@@ -110,20 +110,20 @@ ctr_decrease_count(ctr_t *ctr)
{
if (ctr->bcd) {
ctr->units--;
if (ctr->units == 0xff) {
ctr->units = 9;
if (ctr->units == -1) {
ctr->units = -7;
ctr->tens--;
if (ctr->tens == 0xff) {
ctr->tens = 9;
if (ctr->tens == -1) {
ctr->tens = -7;
ctr->hundreds--;
if (ctr->hundreds == 0xff) {
ctr->hundreds = 9;
if (ctr->hundreds == -1) {
ctr->hundreds = -7;
ctr->thousands--;
if (ctr->thousands == 0xff) {
ctr->thousands = 9;
if (ctr->thousands == -1) {
ctr->thousands = -7;
ctr->myriads--;
if (ctr->myriads == 0xff)
ctr->myriads = 0; /* 0 - 1 should wrap around to 9999. */
if (ctr->myriads == -1)
ctr->myriads = -7; /* 0 - 1 should wrap around to 9999. */
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -53,7 +53,6 @@ static const VIDEO_CARD
video_cards[] = {
{ "none", NULL },
{ "internal", NULL },
{ "ami_s3_924", &s3_ami_86c924_isa_device },
{ "egawonder800", &atiega_device },
{ "mach64gx_isa", &mach64gx_isa_device },
{ "ati28800k", &ati28800k_device },
@@ -79,7 +78,6 @@ video_cards[] = {
{ "compaq_cga", &compaq_cga_device },
{ "compaq_cga_2", &compaq_cga_2_device },
{ "compaq_ega", &cpqega_device },
{ "stealthvram_isa", &s3_diamond_stealth_vram_isa_device },
{ "ega", &ega_device },
{ "g2_gc205", &g2_gc205_device },
{ "hercules", &hercules_device },
@@ -90,13 +88,11 @@ video_cards[] = {
{ "kasan16vga", &et4000_kasan_isa_device },
{ "mda", &mda_device },
{ "genius", &genius_device },
{ "metheus928_isa", &s3_metheus_86c928_isa_device },
{ "nga", &nga_device },
{ "ogc", &ogc_device },
{ "oti037c", &oti037c_device },
{ "oti067", &oti067_device },
{ "oti077", &oti077_device },
{ "orchid_s3_911", &s3_orchid_86c911_isa_device },
{ "pvga1a", &paradise_pvga1a_device },
{ "wd90c11", &paradise_wd90c11_device },
{ "wd90c30", &paradise_wd90c30_device },
@@ -104,8 +100,13 @@ video_cards[] = {
{ "pgc", &pgc_device },
{ "radius_isa", &radius_svga_multiview_isa_device },
{ "rtg3106", &realtek_rtg3106_device },
{ "stealthvram_isa", &s3_diamond_stealth_vram_isa_device },
{ "orchid_s3_911", &s3_orchid_86c911_isa_device },
{ "ami_s3_924", &s3_ami_86c924_isa_device },
{ "metheus928_isa", &s3_metheus_86c928_isa_device },
{ "px_86c801_isa", &s3_phoenix_86c801_isa_device },
{ "px_s3_v7_801_isa", &s3_spea_mirage_86c801_isa_device },
{ "sigma400", &sigma_device },
{ "px_s3_v7_801_isa", &s3_v7mirage_86c801_isa_device },
{ "tvga8900b", &tvga8900b_device },
{ "tvga8900d", &tvga8900d_device },
{ "tvga9000b", &tvga9000b_device },
@@ -133,28 +134,30 @@ video_cards[] = {
{ "cl_gd5480_pci", &gd5480_pci_device },
{ "ctl3d_banshee_pci", &creative_voodoo_banshee_device },
{ "stealth32_pci", &et4000w32p_pci_device },
{ "stealth64v_pci", &s3_diamond_stealth64_964_pci_device },
{ "elsawin2kprox_964_pci", &s3_elsa_winner2000_pro_x_964_pci_device },
{ "bahamas64_pci", &s3_bahamas64_pci_device },
{ "px_vision864_pci", &s3_phoenix_vision864_pci_device },
{ "stealthse_pci", &s3_diamond_stealth_se_pci_device },
{ "px_trio32_pci", &s3_phoenix_trio32_pci_device },
{ "stealth64d_pci", &s3_diamond_stealth64_pci_device },
{ "n9_9fx_pci", &s3_9fx_pci_device },
{ "px_trio64_pci", &s3_phoenix_trio64_pci_device },
{ "elsawin2kprox_pci", &s3_elsa_winner2000_pro_x_pci_device },
{ "mirovideo40sv_pci", &s3_mirovideo_40sv_968_pci_device },
{ "spea_mercury64p_pci", &s3_spea_mercury_p64v_pci_device },
{ "px_vision868_pci", &s3_phoenix_vision868_pci_device },
{ "px_trio64vplus_pci", &s3_phoenix_trio64vplus_pci_device },
{ "trio64v2dx_pci", &s3_trio64v2_dx_pci_device },
{ "stealth3d_2000_pci", &s3_virge_pci_device },
{ "stealth3d_3000_pci", &s3_virge_988_pci_device },
{ "stealth64d_pci", &s3_diamond_stealth64_pci_device },
{ "stealth64v_pci", &s3_diamond_stealth64_964_pci_device },
{ "stealthse_pci", &s3_diamond_stealth_se_pci_device },
{ "elsawin2kprox_964_pci", &s3_elsa_winner2000_pro_x_964_pci_device },
{ "elsawin2kprox_pci", &s3_elsa_winner2000_pro_x_pci_device },
#if defined(DEV_BRANCH) && defined(USE_MGA)
{ "mystique", &mystique_device },
{ "mystique_220", &mystique_220_device },
#endif
{ "n9_9fx_pci", &s3_9fx_pci_device },
{ "bahamas64_pci", &s3_bahamas64_pci_device },
{ "px_vision864_pci", &s3_phoenix_vision864_pci_device },
{ "px_vision868_pci", &s3_phoenix_vision868_pci_device },
{ "px_trio32_pci", &s3_phoenix_trio32_pci_device },
{ "px_trio64_pci", &s3_phoenix_trio64_pci_device },
{ "px_trio64vplus_pci", &s3_phoenix_trio64vplus_pci_device },
#if defined(DEV_BRANCH) && defined(USE_S3TRIO3D2X)
{ "trio3d2x", &s3_trio3d_2x_pci_device },
#endif
{ "trio64v2dx_pci", &s3_trio64v2_dx_pci_device },
{ "virge325_pci", &s3_virge_325_pci_device },
{ "virge375_pci", &s3_virge_375_pci_device },
{ "virge375_vbe20_pci", &s3_virge_375_4_pci_device },
@@ -179,21 +182,20 @@ video_cards[] = {
{ "cl_gd5430_vlb", &gd5430_vlb_device },
{ "stealth3d_2000_vlb", &s3_virge_vlb_device },
{ "stealth3d_3000_vlb", &s3_virge_988_vlb_device },
{ "stealth64d_vlb", &s3_diamond_stealth64_vlb_device },
{ "stealth64v_vlb", &s3_diamond_stealth64_964_vlb_device },
{ "stealthse_vlb", &s3_diamond_stealth_se_vlb_device },
{ "elsawin2kprox_964_vlb", &s3_elsa_winner2000_pro_x_964_vlb_device },
{ "elsawin2kprox_vlb", &s3_elsa_winner2000_pro_x_vlb_device },
{ "ht216_32", &ht216_32_standalone_device },
{ "metheus928_vlb", &s3_metheus_86c928_vlb_device },
{ "n9_9fx_vlb", &s3_9fx_vlb_device },
{ "bahamas64_vlb", &s3_bahamas64_vlb_device },
{ "mirocrystal10sd_vlb", &s3_mirocrystal_10sd_805_vlb_device },
{ "px_86c805_vlb", &s3_phoenix_86c805_vlb_device },
{ "stealth64v_vlb", &s3_diamond_stealth64_964_vlb_device },
{ "bahamas64_vlb", &s3_bahamas64_vlb_device },
{ "px_vision864_vlb", &s3_phoenix_vision864_vlb_device },
{ "px_vision868_vlb", &s3_phoenix_vision868_vlb_device },
{ "stealthse_vlb", &s3_diamond_stealth_se_vlb_device },
{ "px_trio32_vlb", &s3_phoenix_trio32_vlb_device },
{ "stealth64d_vlb", &s3_diamond_stealth64_vlb_device },
{ "n9_9fx_vlb", &s3_9fx_vlb_device },
{ "px_trio64_vlb", &s3_phoenix_trio64_vlb_device },
{ "px_trio64vplus_vlb", &s3_phoenix_trio64vplus_vlb_device },
{ "spea_miragep64_vlb", &s3_spea_mirage_p64_vlb_device },
{ "px_vision868_vlb", &s3_phoenix_vision868_vlb_device },
{ "ht216_32", &ht216_32_standalone_device },
{ "virge325_vlb", &s3_virge_325_vlb_device },
{ "virge375_vlb", &s3_virge_375_vlb_device },
{ "virge375_vbe20_vlb", &s3_virge_375_4_vlb_device },