fread(mem, 1, size, f);
fclose(f);
_tunlink(path);
- _tcscat(path, _T(".gz"));
+ if (_tcschr(path, '.')) {
+ path[_tcslen(path) - 1] = 'z';
+ } else {
+ _tcscat(path, _T(".gz"));
+ }
_tunlink(path);
f = _tfopen(path, _T("wb"));
int fd = fileno(f);
fclose(f);
free(mem);
} else {
- _tcscat(path, _T(".gz"));
+ if (_tcschr(path, '.')) {
+ path[_tcslen(path) - 1] = 'z';
+ } else {
+ _tcscat(path, _T(".gz"));
+ }
_tunlink(path);
}
}
compressfile(fname, 2);
}
+static void deletefile(const TCHAR *path, const TCHAR *name)
+{
+ TCHAR path2[1000];
+ _tcscpy(path2, path);
+ _tcscat(path2, name);
+ _tcscat(path2, _T(".dat"));
+ _tunlink(path2);
+ _tcscpy(path2, path);
+ _tcscat(path2, name);
+ _tcscat(path2, _T(".daz"));
+ _tunlink(path2);
+}
+
+
static uae_u8 *modify_reg(uae_u8 *dst, struct regstruct *regs, uae_u8 type, uae_u32 *valp)
{
int mode = type & CT_DATA_MASK;
}
free(ipath);
- _stprintf(path + _tcslen(path), _T("%lu_%s/"), currprefs.cpu_model, testname);
+ _stprintf(path + _tcslen(path), _T("%u_%s/"), (currprefs.cpu_model - 68000) / 10, testname);
_wmkdir(path);
xorshiftstate = 1;
}
free(lmem_rom_name);
save_memory(path, _T("lmem.dat"), low_memory_temp, low_memory_size);
+ } else {
+ deletefile(path, _T("lmem"));
}
if (test_high_memory_start != 0xffffffff) {
}
free(hmem_rom_name);
save_memory(path, _T("hmem.dat"), high_memory_temp, high_memory_size);
+ } else {
+ deletefile(path, _T("hmem"));
}
save_memory(path, _T("tmem.dat"), test_memory_temp, test_memory_size);
; basic instruction test
; includes trace SR flag (T)
-[test=Basic]
+[test=BASIC]
cpu=68000-68010
enabled=0
feature_sr_mask=0x8000
min_opcode_test_rounds=100
; source EA address error
-[test=AE_SRC]
+[test=AESRC]
enabled=0
cpu=68000-68010
-feature_target_src_ea=0x87fff1,0x7111
+feature_target_src_ea=0x37fff1,0x7111
feature_target_dst_ea=
mode=all
; destination EA address error (MOVE, MOVEM)
-[test=AE_DST]
+[test=AEDST]
enabled=0
cpu=68000-68010
feature_target_src_ea=
-feature_target_dst_ea=0x87fff1,0x7111
-mode=all
+feature_target_dst_ea=0x37fff1,0x7111
+verbose=0
+mode=move,movea,mvmel,mvmle
; user stack address error
-[test=ODD_STK]
+[test=ODDSTK]
enabled=0
cpu=68000-68010
feature_usp=2
+verbose=0
mode=rts,rtd,rtr,jsr,bsr,link,unlk,pea
; exception vector address error
-[test=ODD_EXC]
+[test=ODDEXC]
enabled=0
cpu=68000-68010
feature_exception_vectors=0x000123
+verbose=0
mode=mv2sr.w,mvusp2r,mvr2usp,illegal,chk,trap,trapv,divu,divs,orsr.w
; interrupt exception with odd interrupt vectors
-[test=ODD_IRQ]
+[test=ODDIRQ]
enabled=0
cpu=68000-68010
mode=nop,ext,swap
feature_exception_vectors=0x000123
; prefetch bus error (requires extra hardware)
-[test=BE_PR]
+[test=BEPR]
enabled=0
cpu=68000-68010
feature_safe_memory_start=0x880000
mode=all
; source EA read bus error (requires extra hardware)
-[test=BE_SRC]
+[test=BESRC]
enabled=0
cpu=68000-68010
feature_safe_memory_start=0x880000
mode=all
; destination EA read bus error (requires extra hardware)
-[test=BE_DST]
+[test=BEDST]
enabled=0
cpu=68000-68010
feature_safe_memory_start=0x880000
mode=all
; source EA (=RMW instructions like NOT have only source EA) write bus error (requires extra hardware)
-[test=BE_SRCW]
+[test=BESRCW]
enabled=0
cpu=68000-68010
feature_safe_memory_start=0x900000
;mode=all
; destination EA write bus error (requires extra hardware)
-[test=BE_DSTW]
+[test=BEDSTW]
enabled=0
cpu=68000-68010
feature_safe_memory_start=0x900000
; basic tests
; with all SR T1, T0 and M combinations
-[test=Basic]
+[test=BASIC]
enabled=0
cpu=68020-68060
feature_sr_mask=0xf000
[test=IRQ]
enabled=0
cpu=68020-68060
-mode=jsr,jmp,bsr,bcc,dbcc,nop,exg,swap,stop,mvsr2,mv2sr,andsr,eorsr,orsr
+mode=jsr,jmp,bsr,bcc,dbcc,nop,exg,swap,stop,mvsr2,mv2sr,andsr,eorsr,orsr,illegal,trapcc,trapv,moves
min_opcode_test_rounds=100
feature_interrupts=1
; 68020+ addressing mode tests
-[test=FFEXT_SRC]
+[test=EXTSRC]
enabled=0
cpu=68020-68060
feature_addressing_modes_src=Ad8rf,PC8rf
min_opcode_test_rounds=5000
mode=not,move
-[test=FFEXT_DST]
+[test=EXTDST]
enabled=0
cpu=68020-68060
feature_addressing_modes_dst=Ad8rf,PC8rf
mode=all
; user stack address error
-[test=ODD_STK]
+[test=ODDSTK]
enabled=0
cpu=68020-68060
feature_sr_mask=0xd000
mode=rts,rtd,rtr,jsr,bsr,link,unlk,pea
; exception vector address error
-[test=ODD_EXC]
+[test=ODDEXC]
enabled=0
cpu=68020-68060
feature_sr_mask=0xd000
mode=mv2sr.w,mvsr2.w,mvusp2r,mvr2usp,illegal,chk,trap,trapv,orsr.w,eorsr.w,andsr.w,divu,divs,divul,divsl
; interrupt exception with odd interrupt vectors
-[test=ODD_IRQ]
+[test=ODDIRQ]
enabled=0
cpu=68020-68060
feature_sr_mask=0xd000
; basic test
; no arithmetic exceptions, unsupported instructions or datatypes, denormals or unnormals.
-[test=BasicFPU]
+[test=FBASIC]
enabled=0
verbose=1
cpu=68020-68060
; logarithmic, trigonometric and misc
; no arithmetic exceptions, unsupported instructions or datatypes, denormals or unnormals.
-[test=ComplexFPU]
+[test=FCPX]
enabled=0
verbose=1
cpu=68020-68030
mode=flog10,flogn,flognp1,fsin,fsincos,fsinh,ftan,ftanh,ftentox
; non-arithmetic instructions (FMOVEM also includes FMOVE to/from control register)
-[test=intFPU]
+[test=FINT]
enabled=0
verbose=1
cpu=68020-68060
; packed datatype
; no exceptions
-[test=PackedFPU]
+[test=FPACK]
enabled=0
cpu=68020-68060
fpu=68882
mode=fmove,fint,fintrz,fneg,fabs,fdiv,fadd,fmul,fsgldiv,fsglmul,fsub,fcmp,ftst,fsqrt
; FPU illegal or unimplemented instructions
-[test=IllgFPU]
+[test=FILLG]
enabled=0
verbose=1
cpu=68020-68060
int unpackoffset = 0;
int size = 0;
- sprintf(fname, "%s%s.gz", path, file);
+ strcpy(fname, path);
+ strcat(fname, file);
+ if (strchr(file, '.')) {
+ fname[strlen(fname) - 1] = 'z';
+ } else {
+ strcat(fname, ".gz");
+ }
FILE *f = fopen(fname, "rb");
if (f) {
fseek(f, 0, SEEK_END);
groupd = opendir(path);
}
- int cpumodel = 68000 + (cpu_lvl == 5 ? 6 : cpu_lvl) * 10;
+ int cpumodel = cpu_lvl == 5 ? 6 : cpu_lvl;
sprintf(cpustr, "%u_", cpumodel);
char *pathptr = path + strlen(path);
#endif
low_memory_back = calloc(1, 32768);
+ if (!low_memory_back) {
+ printf("Couldn't allocate low_memory_back.\n");
+ return 0;
+ }
if (!low_memory_temp) {
low_memory_temp = calloc(1, 32768);
+ if (!low_memory_temp) {
+ printf("Couldn't allocate low_memory_temp.\n");
+ return 0;
+ }
}
if (high_memory_size > 0) {
high_memory_back = calloc(1, high_memory_size);
+ if (!high_memory_back) {
+ printf("Couldn't allocate high_memory_back.\n");
+ return 0;
+ }
}
if (!_stricmp(opcode, "all")) {