Skip to content

Commit

Permalink
Fix single-step trap flag setting
Browse files Browse the repository at this point in the history
  • Loading branch information
Cacodemon345 committed Jan 14, 2024
1 parent 8c6fc11 commit 911deea
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/cpu/386.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ exec386_2386(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
4 changes: 2 additions & 2 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 @@ -871,7 +871,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
3 changes: 0 additions & 3 deletions src/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,6 @@ io_debug_check_addr(uint16_t addr)
int i = 0;
int set_trap = 0;

if (trap == 4)
return; /* Debug trap already pending. */

if (!(dr[7] & 0xFF))
return;

Expand Down
3 changes: 0 additions & 3 deletions src/mem/mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,6 @@ mem_debug_check_addr(uint32_t addr, int write)
int i = 0;
int set_trap = 0;

if (trap == 4)
return; /* Debug trap already pending. */

if (!(dr[7] & 0xFF))
return;

Expand Down

0 comments on commit 911deea

Please sign in to comment.