void KillDBUFFER(DBUFFER *db) { // Free memory used by packet buffer free(db->pb); // Free memory used by ordering table tags free(db->ot->org); // Free memory used by ordering table free(db->ot); } In InitProgram() change order of ResetGraph()/PadInit() and SetVideoMode(). SetVideoMode should be first library call. In CloseProgram() add KillDBUFFER(). In InitObjectList() take out InitObjectFreeNodes(), put InitObjectfreeNodes() in initialisation of main program. Add cheats_on to LSGAME_DATA. Cannot add cheats_on=0 in StartGame(), Loadgame calls start game, need to do it in MenuPlayGame(). Change % in animation AnimateSprite(), to if(++s->current_frame>s->max_frames) s->current_frame=0;