mirror of
https://github.com/jpd002/Play-.git
synced 2025-04-28 13:47:57 +03:00
Add test for Yangus MAX's case.
Some checks failed
Build Windows / build_windows (x86_32, Visual Studio 16 2019, installer32.nsi, win32_msvc2019, Win32) (push) Has been cancelled
Build Windows / build_windows (x86_64, Visual Studio 16 2019, installer64.nsi, win64_msvc2019_64, x64) (push) Has been cancelled
Build Android / build_android (apk) (push) Has been cancelled
Build iOS / build_ios (push) Has been cancelled
Build JavaScript / build_js (push) Has been cancelled
Build Linux / build_linux (push) Has been cancelled
Build Linux ARM32 / build_linux_arm32 (push) Has been cancelled
Build Linux ARM64 / build_linux_arm64 (push) Has been cancelled
Build macOS / build_macos (push) Has been cancelled
Build Windows Psf / build_windows_psf (off, x86_64, Visual Studio 16 2019, installer64.nsi, x64) (push) Has been cancelled
Build Windows Psf / build_windows_psf (on, x86_64, Visual Studio 16 2019, installer64.nsi, x64) (push) Has been cancelled
Build Android / build_android (libretro) (push) Has been cancelled
Check Format / run_clangformat (push) Has been cancelled
Some checks failed
Build Windows / build_windows (x86_32, Visual Studio 16 2019, installer32.nsi, win32_msvc2019, Win32) (push) Has been cancelled
Build Windows / build_windows (x86_64, Visual Studio 16 2019, installer64.nsi, win64_msvc2019_64, x64) (push) Has been cancelled
Build Android / build_android (apk) (push) Has been cancelled
Build iOS / build_ios (push) Has been cancelled
Build JavaScript / build_js (push) Has been cancelled
Build Linux / build_linux (push) Has been cancelled
Build Linux ARM32 / build_linux_arm32 (push) Has been cancelled
Build Linux ARM64 / build_linux_arm64 (push) Has been cancelled
Build macOS / build_macos (push) Has been cancelled
Build Windows Psf / build_windows_psf (off, x86_64, Visual Studio 16 2019, installer64.nsi, x64) (push) Has been cancelled
Build Windows Psf / build_windows_psf (on, x86_64, Visual Studio 16 2019, installer64.nsi, x64) (push) Has been cancelled
Build Android / build_android (libretro) (push) Has been cancelled
Check Format / run_clangformat (push) Has been cancelled
This commit is contained in:
parent
0c6becf0fc
commit
b15a49e311
3 changed files with 26 additions and 1 deletions
|
@ -7,6 +7,7 @@ void CMinMaxTest::Execute(CTestVm& virtualMachine)
|
||||||
auto resultReg2 = CVuAssembler::VF17;
|
auto resultReg2 = CVuAssembler::VF17;
|
||||||
auto resultReg3 = CVuAssembler::VF18;
|
auto resultReg3 = CVuAssembler::VF18;
|
||||||
auto resultReg4 = CVuAssembler::VF19;
|
auto resultReg4 = CVuAssembler::VF19;
|
||||||
|
auto resultReg5 = CVuAssembler::VF20;
|
||||||
|
|
||||||
virtualMachine.Reset();
|
virtualMachine.Reset();
|
||||||
|
|
||||||
|
@ -29,7 +30,7 @@ void CMinMaxTest::Execute(CTestVm& virtualMachine)
|
||||||
CVuAssembler::Lower::NOP());
|
CVuAssembler::Lower::NOP());
|
||||||
|
|
||||||
//Inspired by Gran Turismo 4
|
//Inspired by Gran Turismo 4
|
||||||
//MINI/MAX needs to work properly with PS2's minimum & maximum float values
|
//MINI/MAX need to work properly with PS2's minimum & maximum float values
|
||||||
|
|
||||||
assembler.Write(
|
assembler.Write(
|
||||||
CVuAssembler::Upper::MINI(CVuAssembler::DEST_XYZW, resultReg3, CVuAssembler::VF1, CVuAssembler::VF4),
|
CVuAssembler::Upper::MINI(CVuAssembler::DEST_XYZW, resultReg3, CVuAssembler::VF1, CVuAssembler::VF4),
|
||||||
|
@ -39,6 +40,13 @@ void CMinMaxTest::Execute(CTestVm& virtualMachine)
|
||||||
CVuAssembler::Upper::MAX(CVuAssembler::DEST_XYZW, resultReg4, CVuAssembler::VF5, CVuAssembler::VF1),
|
CVuAssembler::Upper::MAX(CVuAssembler::DEST_XYZW, resultReg4, CVuAssembler::VF5, CVuAssembler::VF1),
|
||||||
CVuAssembler::Lower::NOP());
|
CVuAssembler::Lower::NOP());
|
||||||
|
|
||||||
|
//Inspired by Dragon Quest - Shounen Yangus to Fushigi no Dungeon
|
||||||
|
//MAX needs to compare denormal with 0 as bigger.
|
||||||
|
|
||||||
|
assembler.Write(
|
||||||
|
CVuAssembler::Upper::MAXbc(CVuAssembler::DEST_XYZW, resultReg5, CVuAssembler::VF1, CVuAssembler::VF0, CVuAssembler::BC_X),
|
||||||
|
CVuAssembler::Lower::NOP());
|
||||||
|
|
||||||
assembler.Write(
|
assembler.Write(
|
||||||
CVuAssembler::Upper::NOP() | CVuAssembler::Upper::E_BIT,
|
CVuAssembler::Upper::NOP() | CVuAssembler::Upper::E_BIT,
|
||||||
CVuAssembler::Lower::NOP());
|
CVuAssembler::Lower::NOP());
|
||||||
|
@ -93,4 +101,9 @@ void CMinMaxTest::Execute(CTestVm& virtualMachine)
|
||||||
TEST_VERIFY(virtualMachine.m_cpu.m_State.nCOP2[resultReg4].nV1 == Float::_Minus8);
|
TEST_VERIFY(virtualMachine.m_cpu.m_State.nCOP2[resultReg4].nV1 == Float::_Minus8);
|
||||||
TEST_VERIFY(virtualMachine.m_cpu.m_State.nCOP2[resultReg4].nV2 == Float::_64);
|
TEST_VERIFY(virtualMachine.m_cpu.m_State.nCOP2[resultReg4].nV2 == Float::_64);
|
||||||
TEST_VERIFY(virtualMachine.m_cpu.m_State.nCOP2[resultReg4].nV3 == 0x80);
|
TEST_VERIFY(virtualMachine.m_cpu.m_State.nCOP2[resultReg4].nV3 == 0x80);
|
||||||
|
|
||||||
|
TEST_VERIFY(virtualMachine.m_cpu.m_State.nCOP2[resultReg5].nV0 == Float::_1);
|
||||||
|
TEST_VERIFY(virtualMachine.m_cpu.m_State.nCOP2[resultReg5].nV1 == 0);
|
||||||
|
TEST_VERIFY(virtualMachine.m_cpu.m_State.nCOP2[resultReg5].nV2 == Float::_64);
|
||||||
|
TEST_VERIFY(virtualMachine.m_cpu.m_State.nCOP2[resultReg5].nV3 == 0x80);
|
||||||
}
|
}
|
||||||
|
|
|
@ -196,6 +196,17 @@ uint32 CVuAssembler::Upper::MAX(DEST dest, VF_REGISTER fd, VF_REGISTER fs, VF_RE
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint32 CVuAssembler::Upper::MAXbc(DEST dest, VF_REGISTER fd, VF_REGISTER fs, VF_REGISTER ft, BROADCAST bc)
|
||||||
|
{
|
||||||
|
uint32 result = 0x00000010;
|
||||||
|
result |= bc;
|
||||||
|
result |= (fd << 6);
|
||||||
|
result |= (fs << 11);
|
||||||
|
result |= (ft << 16);
|
||||||
|
result |= (dest << 21);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
uint32 CVuAssembler::Upper::MINI(DEST dest, VF_REGISTER fd, VF_REGISTER fs, VF_REGISTER ft)
|
uint32 CVuAssembler::Upper::MINI(DEST dest, VF_REGISTER fd, VF_REGISTER fs, VF_REGISTER ft)
|
||||||
{
|
{
|
||||||
uint32 result = 0x0000002F;
|
uint32 result = 0x0000002F;
|
||||||
|
|
|
@ -144,6 +144,7 @@ public:
|
||||||
static uint32 MULq(DEST, VF_REGISTER, VF_REGISTER);
|
static uint32 MULq(DEST, VF_REGISTER, VF_REGISTER);
|
||||||
static uint32 MULAbc(DEST, VF_REGISTER, VF_REGISTER, BROADCAST);
|
static uint32 MULAbc(DEST, VF_REGISTER, VF_REGISTER, BROADCAST);
|
||||||
static uint32 MAX(DEST, VF_REGISTER, VF_REGISTER, VF_REGISTER);
|
static uint32 MAX(DEST, VF_REGISTER, VF_REGISTER, VF_REGISTER);
|
||||||
|
static uint32 MAXbc(DEST, VF_REGISTER, VF_REGISTER, VF_REGISTER, BROADCAST);
|
||||||
static uint32 MINI(DEST, VF_REGISTER, VF_REGISTER, VF_REGISTER);
|
static uint32 MINI(DEST, VF_REGISTER, VF_REGISTER, VF_REGISTER);
|
||||||
static uint32 NOP();
|
static uint32 NOP();
|
||||||
static uint32 OPMULA(VF_REGISTER, VF_REGISTER);
|
static uint32 OPMULA(VF_REGISTER, VF_REGISTER);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue