system: disable BIOS hooks by default

This commit is contained in:
Jakub Czekański 2021-12-21 18:13:59 +01:00
parent 6fe429ee76
commit ea84c175d3
3 changed files with 17 additions and 1 deletions

View file

@ -21,6 +21,13 @@ newoption {
filter "options:enable-io-log" filter "options:enable-io-log"
defines "ENABLE_IO_LOG" defines "ENABLE_IO_LOG"
newoption {
trigger = "enable-bios-hooks",
description = "Enable BIOS hooks/log",
}
filter "options:enable-bios-hooks"
defines "ENABLE_BIOS_HOOKS"
newoption { newoption {
trigger = "asan", trigger = "asan",
description = "Build with Address Sanitizer enabled" description = "Build with Address Sanitizer enabled"

View file

@ -78,9 +78,10 @@ INLINE uint32_t CPU::fetchInstruction(uint32_t address) {
bool CPU::executeInstructions(int count) { bool CPU::executeInstructions(int count) {
for (int i = 0; i < count; i++) { for (int i = 0; i < count; i++) {
// HACK: BIOS hooks #ifdef ENABLE_BIOS_HOOKS
uint32_t maskedPc = PC & 0x1fff'ffff; uint32_t maskedPc = PC & 0x1fff'ffff;
if (maskedPc == 0xa0 || maskedPc == 0xb0 || maskedPc == 0xc0) sys->handleBiosFunction(); if (maskedPc == 0xa0 || maskedPc == 0xb0 || maskedPc == 0xc0) sys->handleBiosFunction();
#endif
saveStateForException(); saveStateForException();
checkForInterrupts(); checkForInterrupts();

View file

@ -33,6 +33,14 @@
* Enables IO access buffer log * Enables IO access buffer log
*/ */
/**
* #define ENABLE_BIOS_HOOKS
* Switch --enable-bios-hooks
* Default: false
*
* Enables BIOS syscall hooking/logging
*/
namespace bios { namespace bios {
struct Function; struct Function;
} }