@telengard
Did you ever figure out how to set/unset the framebuffer settings after launching advmame?
Unfortunately no. I reported the issue back in April of this year, but unfortunately the same behavior still exists in the latest AdvanceMAME 3.9. Currently, I believe the only solution is to reboot RetroPie after AdvanceMAME has been launched during a session to reset the framebuffer.
Like any big project with limited contributors, bug reports known to affect more users are often prioritized. That being the case, it might help for those affected here to add a comment to the thread. Nothing pushy of course. Just a simple "same here" type statement would do the job.