I have an idea for displaying the control layout during Mame (via CPViewer or Johnny5). My apologies if someone has already thought of this.
Currently Johnny5 seems to be using set of batch files prior to running Mame with the appropriate CP generated in the background. There is also an AutoHotkey method that minimizes Mame and displays the CP. Unfortunately I dont think Mame stays paused using this method (correct me if I'm wrong).
CPViewer works as far as I can tell by modifying the actual Mame source. Another rather complicated method.
My idea is quite simple, and it's based on my experience from CoinDrop. With CoinDrop I can intercept & inject keypresses to Mame. With this, I can allow the 'p' button to pause Mame, then while paused allow another button to bring up the CP, or just bring up the CP (it could be optional exactly how and when the CP is displayed). The idea is to run my program in the background as a DLL attached to the Mame process which intercepts the pause key. When it recieves a pause key, it uses EnumWindows() to get the Titlebar name of Mame which contains the ROM name in square brackets eg. "MAME:1942 [1942]". With the ROM name, you can simply pass it on as a parameter to the appropriate viewer (CPViewer or Johnny5). Eg. "Johnny5 1942". It will launch, minimise Mame, display the CP and wait for a keypress. You press 'p' again, for example, the CP viewer closes and either my program maximises Mame or the CP viewer program does. Mame is shown, still paused.. press 'p' again and the game is unpaused and you continue on.
My apologies if this has been thought of before, but I would like to hear feedback from John and Howard about this if it has not.