Skip to content

Commit

Permalink
More oversight fixing
Browse files Browse the repository at this point in the history
  • Loading branch information
Cacodemon345 committed Jan 14, 2024
1 parent 3cf747d commit 55f03f6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/cpu/386_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -1492,7 +1492,7 @@ x86_int_sw(int num)
}
}

trap = 0;
trap &= ~1;
CPU_BLOCK_END();
}

Expand Down Expand Up @@ -1535,7 +1535,7 @@ x86_int_sw_rm(int num)
#endif

cycles -= timing_int_rm;
trap = 0;
trap &= ~1;
CPU_BLOCK_END();

return 0;
Expand Down
14 changes: 9 additions & 5 deletions src/cpu/386_dynarec.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ exec386_dynarec_int(void)
opcode = fetchdat & 0xFF;
fetchdat >>= 8;

trap = cpu_state.flags & T_FLAG;
trap |= cpu_state.flags & T_FLAG;

cpu_state.pc++;
x86_opcodes[(opcode | cpu_state.op32) & 0x3ff](fetchdat);
Expand Down Expand Up @@ -342,8 +342,9 @@ exec386_dynarec_int(void)

block_ended:
if (!cpu_state.abrt && trap) {
if (trap != 4)
dr[6] |= (trap == 2) ? 0x8000 : 0x4000;
if (trap & 2) dr[6] |= 0x8000;
if (trap & 1) dr[6] |= 0x4000;

trap = 0;
# ifndef USE_NEW_DYNAREC
oldcs = CS;
Expand Down Expand Up @@ -864,7 +865,7 @@ exec386(int32_t cycs)
#endif
opcode = fetchdat & 0xFF;
fetchdat >>= 8;
trap = cpu_state.flags & T_FLAG;
trap |= cpu_state.flags & T_FLAG;

cpu_state.pc++;
x86_opcodes[(opcode | cpu_state.op32) & 0x3ff](fetchdat);
Expand Down Expand Up @@ -908,12 +909,15 @@ exec386(int32_t cycs)
}
} else if (trap) {
flags_rebuild();
if (trap & 1)
dr[6] |= 0x4000;
if (trap & 2)
dr[6] |= 0x8000;
trap = 0;
#ifndef USE_NEW_DYNAREC
oldcs = CS;
#endif
cpu_state.oldpc = cpu_state.pc;
dr[6] |= 0x4000;
x86_int(1);
}

Expand Down
2 changes: 1 addition & 1 deletion src/cpu/x86seg.c
Original file line number Diff line number Diff line change
Expand Up @@ -2289,7 +2289,7 @@ taskswitch286(uint16_t seg, uint16_t *segdat, int is32)
rf_flag_no_clear = 1;

if (t_bit) {
trap = 2;
trap |= 2;
#ifdef USE_DYNAREC
cpu_block_end = 1;
#endif
Expand Down

0 comments on commit 55f03f6

Please sign in to comment.