Cmm2: Game: ChemiChaos - Fix the Mix, Save the Lab!


Author Message
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 11636
Posted: 09:10am 31 Jan 2021      

  Quote  Running this program highlighted an interesting problem.


If I understand correctly this is a simple programming bug which others have encountered.

It is essential that all resources used in an interrupt routine are set up and ready before the interrupt is enabled. Enabling interrupts should be the last thing before the main program loop starts.

For example an interrupt routine could use a global variable that hasn't yet been DIMmed. This isn't something the firmware can cater for. All interrupts are disable when a program is run but if an interrupt condition exists then it will fire as soon as the interrupt is enabled