Thanks for the video. Since I don't have a 16+ button gamepad encoder, it helps a lot.
It looks like it's the same problem mame had before. Mame's internal numbering is inconsistant, and (half) differs from DirectX's DirectInput's (aka dInput for short) numbering.
Nomenclature: You are using "button 16"
only if the numbering starts with zero. You are using "button 17" if starting with one (1), as shown in the control panel screen shot. I will call your pause button "button 17", since it's more normal to start with one. I will talk about button numbering starting with zero, too, and in these cases I'll call your button "button o16", with the small "o" in front of the number, otherwise I'll get even more confusing than I ofen do. If I'm quoting something the "o" will be inside parentheses, ie "button {o}16", since the normally used brakets to show stuff added to quotes makes
Okay, mame has internal names for buttons 1-16, and uses dInput's names for buttons greater than 16. So button 17, your pause button, is the first button to use its dInput name.
Mame internal names start with one, since it uses these name in the cfg files, the numbers used in cfg files also start at one
for buttons 1-16. However, the UI menu numbering starts at zero, as does the code used inside mame to generate the dInput names. IOW, the number you see in the UI menu when first changed (before exiting mame) is "Joy 1 Button {o}16", aka button 17.
And since mame doesn't have an internal name for button 17, it uses the name generated from dInput's name to save in the cfg file. And since these numbers start with zero, button 17 (aka button o16) has the same number in the name as the real button 16. IOW, mame is confusing button 16 with button o16 since it doesn't have that "o" to tell the difference.
I'll have to look at saving/loading the cfg files to be sure, but by the time it's saved, it's already "wrong". "
JOYCODE_1_BUTTON16" in the cfg is the same as "
Joy 1 Button {o}15" in the UI since the UI numbering starts with zero.
If I'm not making sense, it might help if you map button 1 to anything. The UI menu will show "
Joy 1 Button {o}0", but the cfg file will show "
JOYCODE_1_BUTTON1".
To sum up:
Mame confuses button 17 with button 16 when saving the cfg file, and so currently cannot use button 17. This is further confusing since the UI calls the buttons by different numbers.
For now, you can ry rewiring the button to any other button on the encoder than button 17 (if you have an unused one). I can't test it, but I think button 18 will show as "
JOYCODE_1_BUTTON17" in the cfg file