If you print something using printf, and then turn display on and show background then hide it and turn display off, and if you use printf again after all this, it won't work. In order to make it work, you need to add gprint, using \n with gprint will not go to the next line, but add a special character. If it tells you that it doesn't know gprint, then check if you at least have these :
#include <gb/gb.h>
#include <gb/drawing.h>