So I just got done creating a working version of mpsleep for rom but my question is this, what would be better in prog_update, using while or a for loop? So far ive been using a for loop but im a bit paranoid that itll crash the game at some point because of too many progs setting into memory faster then it being deleted.
Both of these are functionally identical. In fact they may even compile to the same op codes (though that is implementation dependent). What I am more concerned with, is you accessing the next pointer out of the tmp after freeing it. You probably want to save the next pointer to a local variable at the start of the loop (like is used in a lot of code where the current item might be deleted). Also, as a note, you probably should insert pauses to the head of the list so they are not handled in the same update if they are inserted in the call to program_flow() here (maybe you are, but the code here does not show it either way). The issue of run away paused programs really would have to be handled elsewhere though.
That was an accidental copy and paste of tmp = tmp->next and yes pauses are set in program flow along with moving the new pointers around. I'm just trying to figure out which is safer for the update call.