diff --git a/.gitignore b/.gitignore index bce69f10c3..71e7b81344 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,5 @@ Windows/x64 Windows/ipch Memstick android/ui_atlas.zim +__testoutput.txt +__testerror.txt diff --git a/Core/MIPS/MIPSIntVFPU.cpp b/Core/MIPS/MIPSIntVFPU.cpp index a2bffc4a16..9fb3ffa8e2 100644 --- a/Core/MIPS/MIPSIntVFPU.cpp +++ b/Core/MIPS/MIPSIntVFPU.cpp @@ -323,13 +323,14 @@ namespace MIPSInt void Int_Viim(u32 op) { int vt = _VT; - int imm = op&0xFFFF; + s32 imm = (s16)(op&0xFFFF); + u16 uimm16 = (op&0xFFFF); //V(vt) = (float)imm; int type = (op >> 23) & 7; if (type == 6) V(vt) = (float)imm; else if (type == 7) - V(vt) = Float16ToFloat32((u16)imm); + V(vt) = Float16ToFloat32((u16)uimm16); else _dbg_assert_msg_(CPU,0,"Trying to interpret instruction that can't be interpreted"); @@ -1040,7 +1041,7 @@ namespace MIPSInt static const float constants[32] = { 0, - std::numeric_limits::infinity(), // or max() ?? pspautotests seem to indicate inf + std::numeric_limits::max(), // or max() ?? pspautotests seem to indicate inf sqrtf(2.0f), sqrtf(0.5f), 2.0f/sqrtf((float)M_PI), diff --git a/gentest.py b/gentest.py index ce8a780190..0d819ec2e8 100644 --- a/gentest.py +++ b/gentest.py @@ -37,6 +37,10 @@ def gen_test(test): prx_path = TEST_ROOT + test + ".prx" expected_path = TEST_ROOT + test + ".expected" + if not os.path.exists(prx_path): + print "You must compile the test into a PRX first (" + prx_path + ")" + return + # First, write a command file for PSPSH f = open("cmdfile.txt", "w") @@ -50,7 +54,7 @@ def gen_test(test): if os.path.exists(OUTFILE): # Should check for size as well... - shutil.move(OUTFILE, expected_path) + shutil.copyfile(OUTFILE, expected_path) print "Expected file written: " + expected_path else: print "ERROR: No " + OUTFILE + " was written, can't write .expected" diff --git a/pspautotests b/pspautotests index 31c46f50c5..696aad4df5 160000 --- a/pspautotests +++ b/pspautotests @@ -1 +1 @@ -Subproject commit 31c46f50c5175f480dd93c61e3dc738fe179b760 +Subproject commit 696aad4df5ff0e4cd26dd46b705ca1c2fe57ccfd diff --git a/test.py b/test.py index aa37077516..da9eb7ba2c 100644 --- a/test.py +++ b/test.py @@ -105,9 +105,12 @@ def run_tests(test_list, args): for test in test_list: # Try prx first expected_filename = TEST_ROOT + test + ".expected" + elf_filename = TEST_ROOT + test + ".prx" + print elf_filename if not os.path.exists(elf_filename): + print "WARNING: no prx, trying elf" elf_filename = TEST_ROOT + test + ".elf" if not os.path.exists(elf_filename): @@ -138,12 +141,9 @@ def run_tests(test_list, args): for i in range(0, min(len(output_lines), len(expected_lines))): if output_lines[i] != expected_lines[i]: - #print "First different line (output vs expected):" - #print output_lines[i] - #print " --- expected: ---" - #print expected_lines[i] + print "%i < %s" % (i, output_lines[i]) + print "%i > %s" % (i, expected_lines[i]) different = True - break if len(output_lines) != len(expected_lines): print "*** Different number of lines!" @@ -153,11 +153,11 @@ def run_tests(test_list, args): print " " + test + " - passed!" tests_passed.append(test) else: - print "============== output from failed " + test + " :" - print output - print "============== expected output:" - print expected_output - print "===============================" + #print "============== output from failed " + test + " :" + #print output + #print "============== expected output:" + #print expected_output + #print "===============================" tests_failed.append(test) print "%i tests passed, %i tests failed." % (