mirror of
https://github.com/JaCzekanski/Avocado.git
synced 2024-05-20 12:57:38 -04:00
system: disable BIOS hooks by default
This commit is contained in:
parent
6fe429ee76
commit
ea84c175d3
|
@ -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"
|
||||||
|
|
|
@ -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();
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue