You've already forked HackerSM64
mirror of
https://github.com/HackerN64/HackerSM64.git
synced 2026-01-21 10:35:32 -08:00
Improved WiiVC check to avoid false positives & added functions to read and manipulate fcr31 (#669)
* Added functions to access and manipulate the fcr31 register * Improved WiiVC emulator check to avoid false positives * Updated comments * Moved float.h to include directory
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
#include <ultra64.h>
|
||||
#include <string.h>
|
||||
#include "emutest_vc.h"
|
||||
#include "float.h"
|
||||
#include "types.h"
|
||||
|
||||
extern OSMesgQueue gSIEventMesgQueue;
|
||||
@@ -90,18 +91,22 @@ void detect_emulator() {
|
||||
}
|
||||
|
||||
/*
|
||||
* This check forces RTZ bug on vc
|
||||
* If console is N64/adequate Emu round-to-nearest (RTN) rounding mode is used
|
||||
* If console is VC round-to-zero (RTZ) mode is used
|
||||
* This check forces RZ bug on vc
|
||||
* If console is N64/adequate Emu, the current rounding mode, which is initialized to round-to-nearest (RN), is used
|
||||
* If console is VC round-to-zero (RZ) mode is always used
|
||||
*
|
||||
* The double value 0.9999999999999999 used is 0x3FEFFFFFFFFFFFFF in binary
|
||||
* Exponent=01111111110, Mantissa=1111111111111111111111111111111111111111111111111111
|
||||
* RTZ will output not 1.0f, RTN will output exactly 1.0f
|
||||
* RZ will output not 1.0f, RN will output exactly 1.0f
|
||||
*/
|
||||
const FloatRoundingMode roundingMode = fcr_get_rounding_mode();
|
||||
fcr_set_rounding_mode(FRC_RM_ROUND_TO_NEAREST);
|
||||
if (1.0f != round_double_to_float(0.9999999999999999)) {
|
||||
gEmulator = EMU_WIIVC;
|
||||
fcr_set_rounding_mode(roundingMode);
|
||||
return;
|
||||
}
|
||||
fcr_set_rounding_mode(roundingMode);
|
||||
|
||||
// Perform a read from unmapped PIF ram.
|
||||
// On console and well behaved emulators, this echos back the lower half of
|
||||
|
||||
Reference in New Issue
Block a user