Hello,
I am trying to to edit a little something in the MAME source. I have been able to follow most of the code, but there are some things that I just cannot seem to find. I am trying to find something related to the keyboard input to MAME.
This is what I plan to do. In "UI.C", there is the function "handler_ingame()"which monitors keys that do such things as exit MAME, pause, throttle, single-step forward, adjust volume, and bring up the in-game menu while MAME is emulating a rom. I want to add a function there that checks for an unused key in MAME. This function, in return, will send keystrokes back to the ROM, so the rom thinks they were typed on the keyboard.
After I add another key to check in "handler_ingame()," how do I go about sending keypresses back to the rom. I believe there is a buffer or something, but I cannot find the function that manages it.
I found where the DIRECTINPUT calls are translated into KEYCODES, VKCODES, MAMECODES, and ASCII CODES and then put into a structure called "code", but where does it go from there?
How does the rom get access to it.
When a rom requests to see if a key is pressed, what function does it call, and where is that function?
Let me just ask this, assuming that I have been on the wrong trail, can any point me into some direction as to where I can inject keystrokes into a rom.
Thank you to anybody who can help me out with this. I have read over all of the C files that I think handle this, but I am not a professional programmer by any means, and I believe I am overlooking something. Possibly the functions are right in my face, but the algorithms were a little over my head and I just didnt realize that I was looking at what I needed.
Much appreciated