Are you making controller changes? Reassigning keys and such? Best way to do that is via MAME, it'll populate that file for you.
advmame.rc is very confusing in this application, because there are two versions in two different directories, and it's not always clear which one needs to be...