]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
8.3 compatible filenames.
authorToni Wilen <twilen@winuae.net>
Wed, 8 Jul 2020 17:43:40 +0000 (20:43 +0300)
committerToni Wilen <twilen@winuae.net>
Wed, 8 Jul 2020 17:43:40 +0000 (20:43 +0300)
cputest.cpp
cputest/cputestgen.ini
cputest/main.c

index 9cb7fb4890d2e216b524937d27d6b163368b48a1..a1082580d73ccaf544b9403a2a4b83a635a5837e 100644 (file)
@@ -1830,7 +1830,11 @@ static void compressfile(TCHAR *path, int flags)
                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);
@@ -1840,7 +1844,11 @@ static void compressfile(TCHAR *path, int flags)
                fclose(f);
                free(mem);
        } else {
-               _tcscat(path, _T(".gz"));
+               if (_tcschr(path, '.')) {
+                       path[_tcslen(path) - 1] = 'z';
+               } else {
+                       _tcscat(path, _T(".gz"));
+               }
                _tunlink(path);
        }
 }
@@ -1868,6 +1876,20 @@ static void save_memory(const TCHAR *path, const TCHAR *name, uae_u8 *p, int siz
        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;
@@ -6323,7 +6345,7 @@ static int test(struct ini_data *ini, const TCHAR *sections, const TCHAR *testna
        }
        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;
@@ -6486,6 +6508,8 @@ static int test(struct ini_data *ini, const TCHAR *sections, const TCHAR *testna
                }
                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) {
@@ -6499,6 +6523,8 @@ static int test(struct ini_data *ini, const TCHAR *sections, const TCHAR *testna
                }
                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);
index 4d8d9e8c940ab78ad04ecf3266915fdd5cfe63b8..7429d9c60d0389272a3f2d92396351be3942d6be 100644 (file)
@@ -196,7 +196,7 @@ feature_sr_mask=0x8000
 
 ; basic instruction test
 ; includes trace SR flag (T)
-[test=Basic]
+[test=BASIC]
 cpu=68000-68010
 enabled=0
 feature_sr_mask=0x8000
@@ -212,37 +212,40 @@ mode=jsr,jmp,bsr,bcc,dbcc,nop,exg,swap,stop,mvsr2,mv2sr,andsr,eorsr,orsr
 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
@@ -250,7 +253,7 @@ feature_interrupts=1
 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
@@ -264,7 +267,7 @@ opcode_memory_start=0x87ffa0
 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
@@ -278,7 +281,7 @@ opcode_memory_start=0x87ffa0
 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
@@ -292,7 +295,7 @@ opcode_memory_start=0x87ffa0
 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
@@ -307,7 +310,7 @@ mode=moves
 ;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
@@ -337,7 +340,7 @@ mode=all
 
 ; basic tests
 ; with all SR T1, T0 and M combinations
-[test=Basic]
+[test=BASIC]
 enabled=0
 cpu=68020-68060
 feature_sr_mask=0xf000
@@ -347,12 +350,12 @@ mode=all
 [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
@@ -360,7 +363,7 @@ test_rounds=4
 min_opcode_test_rounds=5000
 mode=not,move
 
-[test=FFEXT_DST]
+[test=EXTDST]
 enabled=0
 cpu=68020-68060
 feature_addressing_modes_dst=Ad8rf,PC8rf
@@ -377,7 +380,7 @@ feature_exception3_instruction=2
 mode=all
 
 ; user stack address error
-[test=ODD_STK]
+[test=ODDSTK]
 enabled=0
 cpu=68020-68060
 feature_sr_mask=0xd000
@@ -385,7 +388,7 @@ feature_usp=2
 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
@@ -393,7 +396,7 @@ feature_exception_vectors=0x000123
 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
@@ -407,7 +410,7 @@ feature_exception_vectors=0x000123
 
 ; basic test
 ; no arithmetic exceptions, unsupported instructions or datatypes, denormals or unnormals.
-[test=BasicFPU]
+[test=FBASIC]
 enabled=0
 verbose=1
 cpu=68020-68060
@@ -418,7 +421,7 @@ mode=fmove,fsmove,fdmove,fint,fintrz,fneg,fsneg,fdneg,fabs,fsabs,fdabs,fdiv,fsdi
 
 ; 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
@@ -429,7 +432,7 @@ mode=facos,fasin,fatan,fatanh,fcos,fcosh,fetox,fetoxm1,ftwotox
 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
@@ -438,7 +441,7 @@ mode=fmovecr,fmovem,fdbcc,fbcc,ftrapcc,fscc
 
 ; packed datatype
 ; no exceptions
-[test=PackedFPU]
+[test=FPACK]
 enabled=0
 cpu=68020-68060
 fpu=68882
@@ -450,7 +453,7 @@ feature_forced_register=
 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
index f280c303cabcd266cb6601379099422ac9e98b4b..853d8c6bfe416d0ef62798b65fadb2e07c0c8b84 100644 (file)
@@ -588,7 +588,13 @@ static uae_u8 *load_file(const char *path, const char *file, uae_u8 *p, int *siz
        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);
@@ -3659,7 +3665,7 @@ int main(int argc, char *argv[])
                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);
 
@@ -3694,12 +3700,24 @@ int main(int argc, char *argv[])
 #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")) {