REP instructions now correctly issue a Debug exception after every iteration, fixes NT 3.x on 386 CPU's;

Fixed a string bug in the Settings dialog (Joysticks combo box).
This commit is contained in:
OBattler
2017-07-24 15:21:17 +02:00
parent ff23ccb2a2
commit 36fcf10388
4 changed files with 41 additions and 2 deletions

View File

@@ -17,6 +17,8 @@
#include "386_common.h"
extern int trap;
extern uint16_t *mod1add[2][8];
extern uint32_t *mod1seg[8];

View File

@@ -167,6 +167,9 @@ static int opREP_MOVSB_ ## size(uint32_t fetchdat)
int reads = 0, writes = 0, total_cycles = 0; \
int cycles_end = cycles - ((is386 && cpu_use_dynarec) ? 1000 : 100); \
\
if (trap) \
cycles_end = cycles+1; \
\
while (CNT_REG > 0) \
{ \
uint8_t temp; \
@@ -199,6 +202,9 @@ static int opREP_MOVSW_ ## size(uint32_t fetchdat)
int reads = 0, writes = 0, total_cycles = 0; \
int cycles_end = cycles - ((is386 && cpu_use_dynarec) ? 1000 : 100); \
\
if (trap) \
cycles_end = cycles+1; \
\
while (CNT_REG > 0) \
{ \
uint16_t temp; \
@@ -231,6 +237,9 @@ static int opREP_MOVSL_ ## size(uint32_t fetchdat)
int reads = 0, writes = 0, total_cycles = 0; \
int cycles_end = cycles - ((is386 && cpu_use_dynarec) ? 1000 : 100); \
\
if (trap) \
cycles_end = cycles+1; \
\
while (CNT_REG > 0) \
{ \
uint32_t temp; \
@@ -265,6 +274,9 @@ static int opREP_STOSB_ ## size(uint32_t fetchdat)
int writes = 0, total_cycles = 0; \
int cycles_end = cycles - ((is386 && cpu_use_dynarec) ? 1000 : 100); \
\
if (trap) \
cycles_end = cycles+1; \
\
while (CNT_REG > 0) \
{ \
CHECK_WRITE_REP(&_es, DEST_REG, DEST_REG); \
@@ -292,6 +304,9 @@ static int opREP_STOSW_ ## size(uint32_t fetchdat)
int writes = 0, total_cycles = 0; \
int cycles_end = cycles - ((is386 && cpu_use_dynarec) ? 1000 : 100); \
\
if (trap) \
cycles_end = cycles+1; \
\
while (CNT_REG > 0) \
{ \
CHECK_WRITE_REP(&_es, DEST_REG, DEST_REG+1); \
@@ -319,6 +334,9 @@ static int opREP_STOSL_ ## size(uint32_t fetchdat)
int writes = 0, total_cycles = 0; \
int cycles_end = cycles - ((is386 && cpu_use_dynarec) ? 1000 : 100); \
\
if (trap) \
cycles_end = cycles+1; \
\
while (CNT_REG > 0) \
{ \
CHECK_WRITE_REP(&_es, DEST_REG, DEST_REG+3); \
@@ -347,6 +365,9 @@ static int opREP_LODSB_ ## size(uint32_t fetchdat)
int reads = 0, total_cycles = 0; \
int cycles_end = cycles - ((is386 && cpu_use_dynarec) ? 1000 : 100); \
\
if (trap) \
cycles_end = cycles+1; \
\
while (CNT_REG > 0) \
{ \
AL = readmemb(cpu_state.ea_seg->base, SRC_REG); if (cpu_state.abrt) return 1; \
@@ -373,6 +394,9 @@ static int opREP_LODSW_ ## size(uint32_t fetchdat)
int reads = 0, total_cycles = 0; \
int cycles_end = cycles - ((is386 && cpu_use_dynarec) ? 1000 : 100); \
\
if (trap) \
cycles_end = cycles+1; \
\
while (CNT_REG > 0) \
{ \
AX = readmemw(cpu_state.ea_seg->base, SRC_REG); if (cpu_state.abrt) return 1; \
@@ -399,6 +423,9 @@ static int opREP_LODSL_ ## size(uint32_t fetchdat)
int reads = 0, total_cycles = 0; \
int cycles_end = cycles - ((is386 && cpu_use_dynarec) ? 1000 : 100); \
\
if (trap) \
cycles_end = cycles+1; \
\
while (CNT_REG > 0) \
{ \
EAX = readmeml(cpu_state.ea_seg->base, SRC_REG); if (cpu_state.abrt) return 1; \
@@ -510,6 +537,9 @@ static int opREP_SCASB_ ## size(uint32_t fetchdat)
int reads = 0, total_cycles = 0, tempz; \
int cycles_end = cycles - ((is386 && cpu_use_dynarec) ? 1000 : 100); \
\
if (trap) \
cycles_end = cycles+1; \
\
tempz = FV; \
while ((CNT_REG > 0) && (FV == tempz)) \
{ \
@@ -540,6 +570,9 @@ static int opREP_SCASW_ ## size(uint32_t fetchdat)
int reads = 0, total_cycles = 0, tempz; \
int cycles_end = cycles - ((is386 && cpu_use_dynarec) ? 1000 : 100); \
\
if (trap) \
cycles_end = cycles+1; \
\
tempz = FV; \
while ((CNT_REG > 0) && (FV == tempz)) \
{ \
@@ -570,6 +603,9 @@ static int opREP_SCASL_ ## size(uint32_t fetchdat)
int reads = 0, total_cycles = 0, tempz; \
int cycles_end = cycles - ((is386 && cpu_use_dynarec) ? 1000 : 100); \
\
if (trap) \
cycles_end = cycles+1; \
\
tempz = FV; \
while ((CNT_REG > 0) && (FV == tempz)) \
{ \