Added emulator detection (#651)

* Added emulator detection

* Fixed missing assignments

* Disable interrupts around the count factor test

* Added more comments to emutest

* Changed PJ64 enum values so the versions work as a bitfield

* Updated README

* Fixed comments

* Updated enum values so you can safely AND and OR all emulator version flags together

* Remove redundant gIsConsole, gIsVC, and gCacheEmulated global variables

* Changed console check to be more future proof against Ares

* Use assembly file instead of casting to a function pointer

* Moved round_double_to_float back to its own compilation unit

* Moved the ParallelN64 check before the Ares check for better future-proofing

* Align pj64_get_count_factor_asm with cache lines... not that it actually matters for pj64

* Adjusted some comments

* Made emulator check thread-safe on emulators that emulate PI timings

* Added gIsConsole macro for backwards compatibility

* Added cen64 to INSTANT_INPUT_BLACKLIST

* Updated comment
This commit is contained in:
Matt Pharoah authored and GitHub committed 2023-08-28 18:03:26 -04:00
1 parent 0138b8ea53
commit febcb71ea3
20 files changed
+278 -92

No files matched your search

+3 -2
View File
@@ -1,6 +1,7 @@
#include <ultra64.h>
#include "macros.h"
#include <PR/gs2dex.h>
#include "game/emutest.h"
#ifndef S2D_CONFIG_H
#define S2D_CONFIG_H
@@ -88,11 +89,11 @@ extern char *proutSprintf(char *dst, const char *src, size_t count);
#define TEX_BITDEPTH 8
#define seg2virt segmented_to_virtual
#define gIsEmulator (!gIsConsole)
#define gIsEmulator (!(gEmulator & EMU_CONSOLE))
// Texture resolution (pixels on the texture per pixel on the framebuffer)
#define TEX_RES 1
#define _NUM_CACHE (4096 / (TEX_WIDTH * TEX_HEIGHT * (TEX_BITDEPTH / 8)))
#endif
#endif