Ok I got the Virtual On Hack in place and it appears to work. I can jump now at least.
It still needs some finishing work. Right now only keyboard inputs are hooked up, I want to optionally allow for joysticks. Since it's possible that the user could use a single, two axis joystick, or two seperate joysticks, it will require a bit of special code.
Anyway, while working on that, I stumbled upon an idea to fix Behind Enemy Lines. You see each m2 game has three banks for the inputs, one for the start/coin/ect, one for p1's controls and another for p2. If I NOP any part of the mice input, it crashes m2, so that flat out won't work. It's one of the reasons getting reload to work was so tiring... reload is a mouse only input. But I started thinking... the gun games only use the player one bank for the triggers... player 2 just sits there. So I took the assembly code that reads bank1 and modified the pointer to read bank 2 instead. BAM! Truely redefinable trigger/reload inputs!
Now they show up a little wonky in M2:
M2 Description: Actual Input:
P2 Button 1 P1 Trigger
P2 Button 2 P2 Trigger
P2 Down P1 Reload/trigger 2
P2 Up P2 Reload/trigger 2
The import thing though is that they work. That essentially fixes BEL!
I'll have to write a special function though... as of now only NOPs are supported, I'll have the add the option in the NOP section to change each byte into a specific value.
I had thought about re-directing the memory space when ramjet suggested it, but sharing a space across two apps is potentially dangerous. If one of them screws up it could lead to a BSOD... or at least it could in Xp systems. But since I'm using an existing memory space within M2, it is much safer and I feel, doable.
Not only that but this trick should work for all the other lightgun/gun games as well. So no more fighting m2's mouse code or jerry-rigging the triggers, I can handle the whole she-bang on my end.
So yeah, I'm going to have to implement this function and change things a bit, it's going to take a few more days... but it should be well worth the wait.