1
0
mirror of https://github.com/TomHarte/CLK.git synced 2026-04-25 11:17:26 +00:00

Fixed 'same value, then immediate increment, then proper counting increments' behaviour and ensured it takes one cycle to commit a value. Adjusted tests to match.

This commit is contained in:
Thomas Harte
2017-03-04 15:57:54 -05:00
parent 837cccdf83
commit e09b76bf32
2 changed files with 56 additions and 22 deletions
+1 -1
View File
@@ -51,7 +51,7 @@ template <class T> class MOS6532 {
if(address & 0x10)
{
timer_.writtenShift = timer_.activeShift = (decodedAddress - 0x04) * 3 + (decodedAddress / 0x07); // i.e. 0, 3, 6, 10
timer_.value = ((unsigned int)(value) << timer_.activeShift) | ((1 << timer_.activeShift)-1);
timer_.value = ((unsigned int)value << timer_.activeShift) + 2;
timer_.interrupt_enabled = !!(address&0x08);
interrupt_status_ &= ~InterruptFlag::Timer;
evaluate_interrupts();