#endif
}
+//NOTE: This is only used by the old execution core. Safe to nuke once it's stable.
void JERRYExecPIT(uint32 cycles)
{
//This is wrong too: Counters are *always* spinning! !!! FIX !!! [DONE]
#else
RemoveCallback(JERRYPIT1Callback);
- double usecs = (float)(JERRYPIT1Prescaler + 1) * (float)(JERRYPIT1Divider + 1) * RISC_CYCLE_IN_USEC;
- SetCallbackTime(JERRYPIT1Callback, usecs);
+
+ if (JERRYPIT1Prescaler | JERRYPIT1Divider)
+ {
+ double usecs = (float)(JERRYPIT1Prescaler + 1) * (float)(JERRYPIT1Divider + 1) * RISC_CYCLE_IN_USEC;
+ SetCallbackTime(JERRYPIT1Callback, usecs);
+ }
#endif
}
#else
RemoveCallback(JERRYPIT2Callback);
- double usecs = (float)(JERRYPIT2Prescaler + 1) * (float)(JERRYPIT2Divider + 1) * RISC_CYCLE_IN_USEC;
- SetCallbackTime(JERRYPIT2Callback, usecs);
+
+ if (JERRYPIT1Prescaler | JERRYPIT1Divider)
+ {
+ double usecs = (float)(JERRYPIT2Prescaler + 1) * (float)(JERRYPIT2Divider + 1) * RISC_CYCLE_IN_USEC;
+ SetCallbackTime(JERRYPIT2Callback, usecs);
+ }
#endif
}
return counter2Lo & 0xFF;
}
#else
+WriteLog("JERRY: Unhandled timer read (BYTE) at %08X...\n", offset);
#endif
}
// else if (offset >= 0xF10010 && offset <= 0xF10015)
//in the jerry_timer_n_counter variables... !!! FIX !!! [DONE]
else if ((offset >= 0xF10036) && (offset <= 0xF1003D))
{
+#ifndef NEW_TIMER_SYSTEM
// jerry_timer_1_counter = (JERRYPIT1Prescaler + 1) * (JERRYPIT1Divider + 1);
uint32 counter1Hi = (jerry_timer_1_counter / (JERRYPIT1Divider + 1)) - 1;
uint32 counter1Lo = (jerry_timer_1_counter % (JERRYPIT1Divider + 1)) - 1;
return counter2Lo;
}
// Unaligned word reads???
+#else
+WriteLog("JERRY: Unhandled timer read (WORD) at %08X...\n", offset);
+#endif
}
// else if ((offset >= 0xF10010) && (offset <= 0xF10015))
// return clock_word_read(offset);
}
else if (offset >= 0xF10000 && offset <= 0xF10007)
{
+#ifndef NEW_TIMER_SYSTEM
switch (offset & 0x07)
{
case 0:
JERRYPIT2Divider = (JERRYPIT2Divider & 0xFF00) | data;
JERRYResetPIT2();
}
+#else
+WriteLog("JERRY: Unhandled timer write (BYTE) at %08X...\n", offset);
+#endif
return;
}
/* else if ((offset >= 0xF10010) && (offset <= 0xF10015))
}
else if (offset >= 0xF10000 && offset <= 0xF10007)
{
+//#ifndef NEW_TIMER_SYSTEM
+#if 1
switch(offset & 0x07)
{
case 0:
JERRYResetPIT2();
}
// Need to handle (unaligned) cases???
+#else
+WriteLog("JERRY: Unhandled timer write %04X (WORD) at %08X by %s...\n", data, offset, whoName[who]);
+#endif
return;
}
/* else if (offset >= 0xF10010 && offset < 0xF10016)