Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into pcmcia
Browse files Browse the repository at this point in the history
  • Loading branch information
Cacodemon345 committed Jun 13, 2024
2 parents 3ff32eb + 7664ca1 commit a5a1aa0
Show file tree
Hide file tree
Showing 15 changed files with 539 additions and 253 deletions.
6 changes: 3 additions & 3 deletions src/cdrom/cdrom_image_backend.c
Original file line number Diff line number Diff line change
Expand Up @@ -696,9 +696,9 @@ static int
cdi_cue_get_frame(uint64_t *frames, char **line)
{
char temp[128];
int min;
int sec;
int fr;
int min = 0;
int sec = 0;
int fr = 0;
int success;

success = cdi_cue_get_buffer(temp, line, 0);
Expand Down
2 changes: 2 additions & 0 deletions src/cpu/386_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ uint32_t dr[8];
uint32_t use32;
int stack32;

int cpu_init = 0;

uint32_t *eal_r;
uint32_t *eal_w;

Expand Down
17 changes: 16 additions & 1 deletion src/cpu/386_dynarec.c
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,9 @@ exec386_dynarec_int(void)
CPU_BLOCK_END();
}

if (cpu_init)
CPU_BLOCK_END();

if (cpu_state.abrt)
CPU_BLOCK_END();
if (smi_line)
Expand Down Expand Up @@ -414,7 +417,8 @@ exec386_dynarec_dyn(void)
int byte_offset = (phys_addr >> PAGE_BYTE_MASK_SHIFT) & PAGE_BYTE_MASK_OFFSET_MASK;
uint64_t byte_mask = 1ULL << (PAGE_BYTE_MASK_MASK & 0x3f);

if ((page->code_present_mask & mask) || (page->byte_code_present_mask[byte_offset] & byte_mask))
if ((page->code_present_mask & mask) ||
((page->mem != page_ff) && (page->byte_code_present_mask[byte_offset] & byte_mask)))
# else
if (page->code_present_mask[(phys_addr >> PAGE_MASK_INDEX_SHIFT) & PAGE_MASK_INDEX_MASK] & mask)
# endif
Expand Down Expand Up @@ -591,6 +595,9 @@ exec386_dynarec_dyn(void)
# endif
CPU_BLOCK_END();

if (cpu_init)
CPU_BLOCK_END();

if ((cpu_state.flags & T_FLAG) || (trap == 2))
CPU_BLOCK_END();
if (smi_line)
Expand Down Expand Up @@ -688,6 +695,9 @@ exec386_dynarec_dyn(void)
# endif
CPU_BLOCK_END();

if (cpu_init)
CPU_BLOCK_END();

if (cpu_state.flags & T_FLAG)
CPU_BLOCK_END();
if (smi_line)
Expand Down Expand Up @@ -767,6 +777,11 @@ exec386_dynarec(int32_t cycs)
exec386_dynarec_dyn();
}

if (cpu_init) {
cpu_init = 0;
resetx86();
}

if (cpu_state.abrt) {
flags_rebuild();
tempi = cpu_state.abrt & ABRT_MASK;
Expand Down
4 changes: 3 additions & 1 deletion src/cpu/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#define HAVE_STDARG_H
#include <86box/86box.h>
#include "cpu.h"
#include "x86.h"
#include "x87_sf.h"
#include <86box/device.h>
#include <86box/machine.h>
Expand Down Expand Up @@ -504,7 +505,8 @@ cpu_set(void)
acycs = 0;
#endif

soft_reset_pci = 0;
soft_reset_pci = 0;
cpu_init = 0;

cpu_alt_reset = 0;
unmask_a20_in_smm = 0;
Expand Down
2 changes: 2 additions & 0 deletions src/cpu/x86.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ extern int nmi_enable;
extern int oddeven;
extern int inttype;

extern int cpu_init;

extern uint32_t use32;
extern uint32_t rmdat;
extern uint32_t easeg;
Expand Down
3 changes: 2 additions & 1 deletion src/device/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ add_library(dev OBJECT bugger.c cassette.c cartridge.c hasp.c hwm.c hwm_lm75.c h
keyboard_at.c
mouse.c mouse_bus.c mouse_serial.c mouse_ps2.c nec_mate_unk.c phoenix_486_jumper.c
serial_passthrough.c
novell_cardkey.c)
novell_cardkey.c
mouse_microtouch_touchscreen.c)

if(NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang")
target_link_libraries(86Box atomic)
Expand Down
1 change: 1 addition & 0 deletions src/device/mouse.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ static mouse_t mouse_devices[] = {
{ &mouse_wacom_device },
{ &mouse_wacom_artpad_device },
#endif
{ &mouse_mtouch_device },
{ NULL }
// clang-format on
};
Expand Down
Loading

0 comments on commit a5a1aa0

Please sign in to comment.