Some watchdog basics

This commit is contained in:
Darkress
2023-06-17 20:05:58 +02:00
parent f2423d0d71
commit 2b1f8871d2
5 changed files with 59 additions and 14 deletions

View File

@@ -54,7 +54,8 @@ public class Memory
setDataFromIndirectAddress(indirectAddress, data);
return;
}
if(address == 0x01) //Reset PrescalerCounter if change on Option or Timer Register
if(address == 0x01 && !Timer.getPrescalerAssignment()) //Reset PrescalerCounter if change on Option or Timer
// Register
{
Timer.resetTimeToTimerIncrease();
Timer.setCyclesToTimerIncrease(Timer.getCyclesToTimerIncrease() - 1); //Decrease by one to account for
@@ -86,7 +87,7 @@ public class Memory
private static void setDataFromIndirectAddress(int address, int data)
{
if(address == 0x81 || address == 0x01) //Reset PrescalerCounter if change on Option or Timer Register
if((address == 0x81 || address == 0x01) && !Timer.getPrescalerAssignment()) //Reset PrescalerCounter if change on Option or Timer Register
{
Timer.resetTimeToTimerIncrease();
Timer.setCyclesToTimerIncrease(Timer.getCyclesToTimerIncrease() - 1); //Decrease by one to account for