Tidy EightBit library header usage (avoids compilation error with latest VS2019, "Memory.h")

Signed-off-by: Adrian Conlon <adrian.conlon@gmail.com>
This commit is contained in:
Adrian Conlon
2021-05-29 10:31:32 +01:00
parent b1ca06447f
commit d199adb027
18 changed files with 45 additions and 58 deletions

View File

@@ -1,5 +1,5 @@
#include "stdafx.h"
#include "Processor.h"
#include "../inc/Processor.h"
EightBit::Processor::Processor(Bus& bus)
: m_bus(bus) {
@@ -86,14 +86,6 @@ int EightBit::Processor::execute(const uint8_t value) {
return execute();
}
// http://graphics.stanford.edu/~seander/bithacks.html#FixedSignExtend
int8_t EightBit::Processor::signExtend(const int b, uint8_t x) noexcept {
const uint8_t m = bit(b - 1); // mask can be pre-computed if b is fixed
x = x & (bit(b) - 1); // (Skip this if bits in x above position b are already zero.)
const auto result = (x ^ m) - m;
return result;
}
void EightBit::Processor::jump(const register16_t destination) noexcept {
PC() = destination;
}