mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2026-03-13 02:41:37 +00:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user