Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into bochs_vbe
Browse files Browse the repository at this point in the history
  • Loading branch information
Cacodemon345 committed Apr 26, 2024
2 parents deb384d + 68ec5c5 commit 4c1c457
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 7 deletions.
13 changes: 10 additions & 3 deletions src/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,9 +314,10 @@ load_machine(void)
}
}

cpu_override = ini_section_get_int(cat, "cpu_override", 0);
cpu_f = NULL;
p = ini_section_get_string(cat, "cpu_family", NULL);
cpu_override = ini_section_get_int(cat, "cpu_override", 0);
cpu_override_interpreter = ini_section_get_int(cat, "cpu_override_interpreter", 0);
cpu_f = NULL;
p = ini_section_get_string(cat, "cpu_family", NULL);
if (p) {
/* Migrate CPU family changes. */
if ((!strcmp(machines[machine].internal_name, "deskpro386") ||
Expand Down Expand Up @@ -1626,6 +1627,8 @@ config_load(void)
dpi_scale = 1;
do_auto_pause = 0;

cpu_override_interpreter = 0;

fpu_type = fpu_get_type(cpu_f, cpu, "none");
gfxcard[0] = video_get_video_from_internal_name("cga");
vid_api = plat_vidapi("default");
Expand Down Expand Up @@ -1948,6 +1951,10 @@ save_machine(void)
ini_section_set_int(cat, "cpu_override", cpu_override);
else
ini_section_delete_var(cat, "cpu_override");
if (cpu_override_interpreter)
ini_section_set_int(cat, "cpu_override_interpreter", cpu_override);
else
ini_section_delete_var(cat, "cpu_override_interpreter");

/* Downgrade compatibility with the previous CPU model system. */
ini_section_delete_var(cat, "cpu_manufacturer");
Expand Down
3 changes: 2 additions & 1 deletion src/cpu/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ int cpu_64bitbus;
int cpu_cyrix_alignment;
int cpu_cpurst_on_sr;
int cpu_use_exec = 0;
int cpu_override_interpreter;
int CPUID;

int is186;
Expand Down Expand Up @@ -1804,7 +1805,7 @@ cpu_set(void)
#endif
/* Use exec386 for CPU_IBM486SLC because it can reach 100 MHz. */
if ((cpu_s->cpu_type == CPU_IBM486SLC) || (cpu_s->cpu_type == CPU_IBM486BL) ||
cpu_iscyrix || (cpu_s->cpu_type > CPU_486DLC)) {
cpu_iscyrix || (cpu_s->cpu_type > CPU_486DLC) || cpu_override_interpreter) {
cpu_exec = exec386;
cpu_use_exec = 1;
} else
Expand Down
1 change: 1 addition & 0 deletions src/cpu/cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -830,6 +830,7 @@ extern int lock_legal_f6[8];
extern int lock_legal_fe[8];

extern int in_lock;
extern int cpu_override_interpreter;

extern int is_lock_legal(uint32_t fetchdat);

Expand Down
10 changes: 7 additions & 3 deletions src/video/vid_mga.c
Original file line number Diff line number Diff line change
Expand Up @@ -1562,14 +1562,14 @@ mystique_ctrl_read_b(uint32_t addr, void *priv)
switch (addr & 0x3fff) {
case REG_FIFOSTATUS:
fifocount = FIFO_SIZE - FIFO_ENTRIES;
if (fifocount > 64)
fifocount = 64;
if (fifocount > (mystique->type <= MGA_1064SG ? 32 : 64))
fifocount = (mystique->type <= MGA_1064SG ? 32 : 64);
ret = fifocount;
break;
case REG_FIFOSTATUS + 1:
if (FIFO_EMPTY)
ret |= 2;
else if (FIFO_ENTRIES >= 64)
else if (FIFO_ENTRIES >= (mystique->type <= MGA_1064SG ? 32 : 64))
ret |= 1;
break;
case REG_FIFOSTATUS + 2:
Expand All @@ -1583,6 +1583,10 @@ mystique_ctrl_read_b(uint32_t addr, void *priv)
ret |= REG_STATUS_VSYNCSTS;
if (ret & 1)
mystique->softrap_status_read = 1;
if (mystique->softrap_status_read == 0 && !(ret & 1)) {
mystique->softrap_status_read = 1;
ret |= 1;
}
break;
case REG_STATUS + 1:
ret = (mystique->status >> 8) & 0xff;
Expand Down

0 comments on commit 4c1c457

Please sign in to comment.