mirror of
https://github.com/TomHarte/CLK.git
synced 2025-03-03 11:31:47 +00:00
Corrects BIT. All 65816-applicable Wolfgang Lorenz tests now pass.
This commit is contained in:
parent
340ad093a6
commit
6892ac13e8
@ -45,14 +45,14 @@ template <Type type> class ConcreteAllRAMProcessor: public AllRAMProcessor, publ
|
|||||||
*value = memory_[address];
|
*value = memory_[address];
|
||||||
#ifdef BE_NOISY
|
#ifdef BE_NOISY
|
||||||
// if((address&0xff00) == 0x100) {
|
// if((address&0xff00) == 0x100) {
|
||||||
printf("%04x -> %02x\n", address, *value);
|
// printf("%04x -> %02x\n", address, *value);
|
||||||
// }
|
// }
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
memory_[address] = *value;
|
memory_[address] = *value;
|
||||||
#ifdef BE_NOISY
|
#ifdef BE_NOISY
|
||||||
// if((address&0xff00) == 0x100) {
|
// if((address&0xff00) == 0x100) {
|
||||||
printf("%04x <- %02x\n", address, *value);
|
// printf("%04x <- %02x\n", address, *value);
|
||||||
// }
|
// }
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -49,6 +49,11 @@ struct LazyFlags {
|
|||||||
zero_result = uint8_t(value | (value >> shift));
|
zero_result = uint8_t(value | (value >> shift));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Sets the N flag per the 8- or 16-bit value @c value; @c shift should be 0 to indicate an 8-bit value or 8 to indicate a 16-bit value.
|
||||||
|
void set_n(uint16_t value, int shift) {
|
||||||
|
negative_result = uint8_t(value >> shift);
|
||||||
|
}
|
||||||
|
|
||||||
void set(uint8_t flags) {
|
void set(uint8_t flags) {
|
||||||
carry = flags & Flag::Carry;
|
carry = flags & Flag::Carry;
|
||||||
negative_result = flags & Flag::Sign;
|
negative_result = flags & Flag::Sign;
|
||||||
|
@ -629,7 +629,8 @@ template <typename BusHandler> void Processor<BusHandler>::run_for(const Cycles
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case BIT:
|
case BIT:
|
||||||
flags_.set_nz(data_buffer_.value & a_.full, m_shift_);
|
flags_.set_n(data_buffer_.value, m_shift_);
|
||||||
|
flags_.set_z(data_buffer_.value & a_.full, m_shift_);
|
||||||
flags_.overflow = data_buffer_.value & Flag::Overflow;
|
flags_.overflow = data_buffer_.value & Flag::Overflow;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -556,7 +556,8 @@ struct CPU::WDC65816::ProcessorStorageConstructor {
|
|||||||
|
|
||||||
target(OperationPerform); // The branch instructions will all skip one or three
|
target(OperationPerform); // The branch instructions will all skip one or three
|
||||||
// of the next cycles, depending on the effect of
|
// of the next cycles, depending on the effect of
|
||||||
// the jump.
|
// the jump. It'll also calculate the correct target
|
||||||
|
// address, placing it into the data buffer.
|
||||||
|
|
||||||
target(CycleFetchPCThrowaway); // IO
|
target(CycleFetchPCThrowaway); // IO
|
||||||
target(CycleFetchPCThrowaway); // IO
|
target(CycleFetchPCThrowaway); // IO
|
||||||
|
Loading…
x
Reference in New Issue
Block a user