Made formatting for new code in M6532 class match what was already there

(just an OCD thing).  Updated changelog for new RIOT changes.
This commit is contained in:
Stephen Anthony 2017-03-14 19:32:33 -02:30
parent 05b10bec6b
commit 59a6f8f9d1
2 changed files with 13 additions and 9 deletions

View File

@ -19,6 +19,11 @@
- YStart autodetection - YStart autodetection
- ... - ...
* Much improved RIOT timer emulation never before seen in any emulator.
Special thanks to DirtyHairy for the implementation, and alex_79 for
finding documentation that finally describes in more detail how the
M6532 chip actually works.
* Fixed bug with SaveKey and AtariVox not properly closing their memory * Fixed bug with SaveKey and AtariVox not properly closing their memory
files before starting another instance of the same ROM, when the ROM files before starting another instance of the same ROM, when the ROM
was opened in the ROM launcher. was opened in the ROM launcher.

View File

@ -111,23 +111,26 @@ void M6532::updateEmulation()
mySubTimer = (cycles + mySubTimer) % myDivider; mySubTimer = (cycles + mySubTimer) % myDivider;
if (!myTimerWrapped) { if(!myTimerWrapped)
{
uInt32 timerTicks = (cycles + subTimer) / myDivider; uInt32 timerTicks = (cycles + subTimer) / myDivider;
if (timerTicks > myTimer) { if(timerTicks > myTimer)
{
cycles -= ((myTimer + 1) * myDivider - subTimer); cycles -= ((myTimer + 1) * myDivider - subTimer);
myTimer = 0xFF; myTimer = 0xFF;
myTimerWrapped = true; myTimerWrapped = true;
myInterruptFlag |= TimerBit; myInterruptFlag |= TimerBit;
} else { }
else
{
myTimer -= timerTicks; myTimer -= timerTicks;
cycles = 0; cycles = 0;
} }
} }
if (myTimerWrapped) { if(myTimerWrapped)
myTimer = (myTimer - cycles) & 0xFF; myTimer = (myTimer - cycles) & 0xFF;
}
myLastCycle = mySystem->cycles(); myLastCycle = mySystem->cycles();
} }
@ -163,9 +166,7 @@ uInt8 M6532::peek(uInt16 addr)
// system. However, certain cartridges (notably 4A50) can mirror // system. However, certain cartridges (notably 4A50) can mirror
// the RAM address space, making it necessary to chain accesses. // the RAM address space, making it necessary to chain accesses.
if((addr & 0x1080) == 0x0080 && (addr & 0x0200) == 0x0000) if((addr & 0x1080) == 0x0080 && (addr & 0x0200) == 0x0000)
{
return myRAM[addr & 0x007f]; return myRAM[addr & 0x007f];
}
switch(addr & 0x07) switch(addr & 0x07)
{ {
@ -201,9 +202,7 @@ uInt8 M6532::peek(uInt16 addr)
{ {
// Timer Flag is always cleared when accessing INTIM // Timer Flag is always cleared when accessing INTIM
myInterruptFlag &= ~TimerBit; myInterruptFlag &= ~TimerBit;
myTimerWrapped = false; myTimerWrapped = false;
return myTimer; return myTimer;
} }