Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news


  

Author Topic: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App  (Read 51011 times)

0 Members and 1 Guest are viewing this topic.

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 8415
  • ...
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #80 on: January 20, 2013, 02:30:45 pm »
For P2, I inject the proper byte value into the system memory. 

It works, but because I haven't found the memory address that is called at the beginning of the render loop, model 2 fights me and constantly sets it back to the original position.  The end result is a cursor that flickers a little because it keeps momentarily moving back to the top corner of the screen. 

Would someone using Act labs guns without the crosshairs turned on notice anything?
In other words do all shots still go where P2's gun is pointed?


I know you aren't interested, but for anyone who might be:
Raw input doesn't have to be enabled to get the weird joystick controlled crosshairs on the screen in vcop.
They are activated by pressing P2, button 2.
It also changes the game to unlimited ammo and P1 has rapid fire if the trigger is held.
It accepts input from virtual joysticks (vjoy) as well as real ones.
I still couldn't get them to show up in HOTD.

If you're this close to having the game work as it should, I guess I won't mess with it much more.  :)
« Last Edit: January 20, 2013, 03:19:59 pm by BadMouth »

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16758
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #81 on: January 20, 2013, 06:48:02 pm »
Well I'm talking about the game crosshair, not model 2's  What happens is maybe 1 shot out of 25 happens in the upper corner instead of where it should.   Maybe more on the VCop games, although it's less of an issue for them as I can set the position as the trigger is fired making it hit 100% of the time.  It's the analog games that are tricky. 

Actually if I could find where model 2's crosshair code is, I think I could fix it.  This is something we can all work on really. 
I thought I had found it as the postion was in pixels instead of a hex value, but altering it didn't help.  It's just one of those things where you have to play around in the memory with Art Money for ages, which unfortunately I haven't had time to do. 


Yeah I found all kinds of wieredness with the leftover analog code.  It's been causing issue to where I'll have to use a memory hack for the triggers in some games because mapping it in m2 causes the issues you were talking about. 

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16758
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #82 on: January 20, 2013, 10:37:07 pm »
If you've been following the mamehooker wip I just fixed it's dde communication. 

I wanted to test my troubleshooter app to see if it could send data to mamehooker reliably.  I set the timeout to something ridiculous like 1 millisecond, to keep things form bogging down and to my suprise mamehooker never lost a single transmisson!  I tried it with gunblade, which has those rapid gun recoils, so I figure everything else is fair game as well. 

Anyway, things are shaping up! 

retrorepair

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 242
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #83 on: January 21, 2013, 11:27:18 am »
Quote
For P2, I inject the proper byte value into the system memory. 

It works, but because I haven't found the memory address that is called at the beginning of the render loop, model 2 fights me and constantly sets it back to the original position.  The end result is a cursor that flickers a little because it keeps momentarily moving back to the top corner of the screen. 

Now my troubleshooter app doesn't have any hardcoded values... we can go back once this magical address is discovered, change the ini, and it will work properly.  I think with our previous experimentation we found that it's in a random place each time, and yet it's relative to model 2's address in memory.  That's a bit tricker to work out, but it's still doable.

This is about as far as I got before I gave up. Artmoney or Cheat Code Engine couldn't seem to locate the address writing to the analog data (I tested with Gunblade) so as you say any code injected was just immediately overwritten. Your troubleshooter app seems to have had better luck than Lua though. I never tried with the lightgun games.

I'll take another look and see if I come up with anything but last time I only seemed to find what you already have.

In regards to lamp outputs, I've attached what I have found so far. I didn't try everything, mostly just the racing games. I also included my autohotkey script which interfaces to the pacdrive. Not much use but for completeness etc. I was going to tidy it up and release it but as things are now underway with mamehooker.. ;)

FYI all the racing games use the same values for lamps, 4 for start lamp, 128 for leader lamp etc. The guns games and probably others use different values for some (think start lamp in vcop for example is 12?).
« Last Edit: January 21, 2013, 11:31:10 am by retrorepair »

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16758
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #84 on: January 21, 2013, 12:09:07 pm »
Yeah that's pretty standard sega stuff.  They cram all the output data into a single byte (or sometimes two if it's a crazy game) so that it can quickly be sent to the output hardware board.  Sega's been doing interactive hardware since the dawn of the arcades and they really understand how to do it right.  Compare that to 90's Midway games, where the output byte is a pulsing, strobing mess and you really start to appreciate it.  ;)

The individual outputs are detected via bitmasking.  Comparing a bitmask of 4 to the total number is almost always start 1, 8 is start 2, ect.....


I've got most of them already. 


Desert Gun is particularly interesting.  It's got one feedback motor for the machine gun and a stronger motor for the cannon.  Since the typical xbox 360 controller has a strong motor on one side and a weak one on the other, it should make for some very authentic feedback. 

RamjetR

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 144
    • My Youtube Channel
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #85 on: January 21, 2013, 06:19:13 pm »
I didn't get a chance to mention over the christmas period, but I managed to get cheat engine to nop the instructions overwriting the x/y coordinates in the emulator. With that stopped, there shouldn't be any reason external x/y injection should not now work.

*****Edit****
Wow, much has happened in the last page or so.... ummm ok, where to Start [Insert Coin] Everyone cries! Bad pun's indeed

There are many ways to skin a cat in the quest to include working 2p Shooters for M2.

Vandale, thanks for proving to everyone that joysticks do infact work. Even if the data is sourced from the Wiimotes through PPJoy. Oddly enough, when I managed to do it, the normal crosshairs moved correctly? I didn't have a circle reticle, but that said I wasn't using any specific script but a basic dual wiimote to joystick script. Honestly, I thought I must have dreamed it at one point but I even grabbed the girlfriend and showed her and we played a couple of games (with the wiimote upside down because I hadn't remapped the buttons).

Memory injection is probably going to be the cleanest method in the long run. Given that people's machines will have multiple inputs and it's quite specific and even luck to get the ID's of the raw input devices correct when changing hardware around regularly for multi emulation machine setups. The OS is just gonna fight you with the hardware ID changing when devices are plugged in and removed. Howard is working mega hard on memory injection and if the modifications to Troubleshooter works out well, then it'll be a simple 1 application for many programs result. It'll just be nice and clean. As mentioned above Howard, I have some code being executed by the emulator itself (not the emulated ROM) which access's the X/Y Writes to the emulated game NOP'ed and it stops the crosshairs fine... so I can pass that on for you and we can make a trainer for the emulator to auto run as a hack to lock out it's control of the aiming.

On a side note, since I've been playing with Arduino's a bit lately, I'd even made a prototype sketch to pull joystick X/Y's from the system, send it over Com10 to the arduino and report it back through the same USB connector as a HID mouse with relative input data. It does work, but not an ideal fix since you'd need to buy and program your own arduino usb key, an P2 dongle so to speak lol. Interesting little gadget and especially cool if your into making your own HID input devices. It's a completely different kinda approach but been a fun learning exercise with arduino's over the last fortnight.

Great to see progress even if I'm not 100% available to help more... seriously... I need more time to do everything that needs to be done in a day. Spend 20 of the last 48 hours painting the brother in law's house... 
« Last Edit: January 21, 2013, 07:18:40 pm by RamjetR »
Gentlemen.... Start your engines!
My Youtube Channel http://www.youtube.com/user/ramjetr?feature=mhee
Try my RamjetM2Borderless V0.7 utility for your M2Emulator shooting games here https://docs.google.com/open?id=0B-P3wlCiYEm3RzhCZk1NcFR3blE
Try my Sega Model 2 Output Utility RamjetVR V1.4 https://docs.google.com/file/d/0B-P3wlCiYEm3VHhBMXNxZGVIQk0/edit

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16758
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #86 on: January 21, 2013, 08:36:46 pm »
Yeah man if you could go into detail as to what you've found out that would be extremely helpful. 

Right now I'm just trying to get the troubleshooter finished.  It works just fine, but I've simply been using hardcoded values for testing.  I have to actually make the thing configurable and user-friendly now, which takes FOREVER.  ;)

Mine is going to work differently from the original though.  It was setup as a system process, which, while automatic, is a bit intrusive if you ask me.  I'm setting this one up to simply be launched with a command line string sort of like a rom name.  You'll make an ini for each "rom" that contains all the useful info and a path and exe (the pc game) that can optionally be launched for you.  Obviously this isn't necessary for model 2, we can have the lua script launch the troubleshooter, but for pc lightgun games like house of the dead III this just seems like a cleaner method. 

That also gives us the added benefit of being able to add support for other stuff later on.  The troubleshooter 2 will have optional support to inject positional values as well as reading memory locations and translating them to outputs for mamehooker.  So you could also use it to send outputs to mh for a pc game, or add mamehooker suport for an oddball emulator like daphne.   

**Update**

I finished the joystick configuration, so that's done.

I also finished the output reading function. 

So what's left is to remove the hard codings on the memory injection fucntions and and raw mouse functions.  Then I need to do minor junk like allow for key redirecting, check for title bar captions/classes and allow for exit keys. 
« Last Edit: January 21, 2013, 11:24:02 pm by Howard_Casto »

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16758
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #87 on: January 22, 2013, 12:00:20 am »
Sometimes a picture is worth a thousand words:

http://img43.imageshack.us/img43/4200/outputsk.jpg

On the far left is model2 displaying Gunblade's output test menu.  The gray box in the middle is the troubleshooter app (yes I know it's a mess).  Note that it has read the output regions from M2 and is displaying them in the bottom right corner.  And on the far right is good old mamehooker running as if a mame game was active.  Note that all across the board, the outputs are in sync. 

Mamehooker is pitching a fit when the first set of outputs are sent so I've gotta figure out what's going on there, but other than that it's working perfectly.  So yeah this is a good test of mh's dde functions before I release it. 

retrorepair

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 242
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #88 on: January 22, 2013, 12:11:53 am »
Great work as ever Howard, looking very cool!

Mamehooker is pitching a fit when the first set of outputs are sent

I've actually noticed this with mamehooker and mame. The outputs don't work at all for about 20-30 seconds after mame's loaded but then everything freezes and it all works after that. Only from first boot of the computer though. After that it's fine between other games.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16758
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #89 on: January 22, 2013, 12:43:37 am »
Great work as ever Howard, looking very cool!

Mamehooker is pitching a fit when the first set of outputs are sent

I've actually noticed this with mamehooker and mame. The outputs don't work at all for about 20-30 seconds after mame's loaded but then everything freezes and it all works after that. Only from first boot of the computer though. After that it's fine between other games.

Yeah that's a different issue all-together that I've run across.  Mame uses window messages to send me data right?  Well the proces that handles this seems sluggish to boot up or something.  I'm not sure what it is, but afaik it's not on my end. 

Anyway I found the issue.  If you've been following the mamehooker thread you know that I've added support for multiple emulators.  The bug was related to that.  Each emulator gets it's own folder in the ini folder now.  When writing a new ini file for the newly discovered outputs, I forgot to check if the folder actually exists first.  OOPS!

That's one of the nasty things about DDE communcation btw.  As a client it's really stable (and all things talking to mamehooker use it in client mode) but as a server, your program will crash and close whenever an error is raised before the dialog box pops up.  So whenever I'm troubleshooting mamehooker with DDE active, I can't check for debugging.   :banghead:


I've got a question for you guys in regards to lightguns, maybe some of you can chime in. 

I'm looking at the rawmouse code and it's relative (UGH) instead of absolute, but I'm thinking that I don't need to read the positional data from rawmouse anyway.  The act labs (and similar) guns shared the system cursor correct?  And mame simply set p1 or p2's cursor position to the system mouse position whenever p1 or p2s trigger was pulled correct?

I guess what I'm asking is are there any dual lightguns out there that show up as mice and constantly update their position?  Like maybe an IR gun?

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16758
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #90 on: January 22, 2013, 03:04:37 am »
You guys better be glad I can't sleep tonight. 

I was just poking around in the memory space and found the force-feedback byte for Sega Rally Championship!

The method they are using is almost identical to outrun.  You've got a force value, 1-8, and then a directional value, telling how far the car is turned.  I haven't figured out the masking yet, but it looks fairly simple to me.  Of course I found the lamps as well.  RetroRepair's lua script helped me find those. 

I would sure like to get the outputs for all the other games as well.  I looked at some of the scripts you guys had uploaded and it looks like those values found are the changing ones.  I've been trying very hard to find the static values as they are just easier to work with. 

Known outputs thus far:

VCop
VCop2
Gunblade NY
Rail Chase 2
HOTD
Sega Rally Championship. 

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 8415
  • ...
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #91 on: January 22, 2013, 10:56:01 am »
You guys better be glad I can't sleep tonight. 

When I wake up in the morning and I see that you've posted in one of these threads "Today",  I know you were up late getting something done.  :lol

I'm looking at the rawmouse code and it's relative (UGH) instead of absolute, but I'm thinking that I don't need to read the positional data from rawmouse anyway.  The act labs (and similar) guns shared the system cursor correct? .......
I guess what I'm asking is are there any dual lightguns out there that show up as mice and constantly update their position?  Like maybe an IR gun? 

I have two act labs guns on my old setup.  They show up as individual HID mice in device manager. 
Knowing whether they share the system cursor is a bit over my head, but if there is a test I can do to figure that out, I will.

I seem to remember the first generation of act labs guns required a switch to be flipped on P2's gun and then the trigger and button would register as mouse button 3 and 4 (P1's registering as mouse buttons 1 & 2).  That sounds like they were sharing the mouse in windows, but mine don't work that way.
They work the same way two mice work when hooked up.  Either can control the pointer on the desktop.

With mice or aim-traks (IR gun), the MAME generated crosshairs track constantly, not just when the trigger is pulled.
I only have one aim-trak, so I'm not sure what happens on the desktop when both guns are pointed at the screen trying to controll the cursor.
Perhaps someone with two Aim-Traks can weigh in?

EDIT:

From MAME 0.104u5 what's new:
Quote
Derrick Renaud updated Windows input code: Now using RAWMOUSE mode if available. This means you can now use multiple mice in Windows XP. Lightgun support has not been changed yet.
  Added back DX7 support for the windows input system to support multiple mice. It was set to DX5 in 104u2.
  Removed the system mouse from the list of available mice on non-XP systems. This allows you to now properly select the individual mouse.
« Last Edit: January 22, 2013, 11:33:50 am by BadMouth »

DarthMarino

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 487
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #92 on: January 22, 2013, 11:07:09 am »
^If you point both Aimtraks at the desktop, you see both cursors but they appear to flash very quickly. Both function fine though.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16758
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #93 on: January 22, 2013, 12:06:16 pm »
So the aim tracks show up as mice then.  Ugh that's what I was afraid of.  That means I'm going to have to store two virtual pos positions (in pixels) in the troubleshooter and move them as the guns are moved.  This in of itself isn't a big deal, but if I want to emulate the system mouse for p1, I have to know the cursor's initial position.  I guess I could set it to the center of the screen before I do any of my calculations. 

Anyway, on the Sega Rally dept, I figured out the bitmasking or lack thereof.  It's exactly like outrun's data format only slighly larger. 

I thought I might share so that you guys can understand why it's sometimes so hard to find the values in a memory editor. 

There's a single btye 4 bytes over from the lamp bytes.  It contains all FF data.  Inside the byte you've got 1-26 degrees of force giving a value of 1-26 in the byte.  That's simple enough but the direction is as follows:

Any value between 128 and 154 means the wheel is turning left.  So to get the left force you subtract 128 IF and only if the total value is between 128 and 154.  This gives you a leftward direction and a force value of 1 to 26.  Any value between 192 and 218 means the wheel is turning right.  So again, IF and only if the total byte value is in that range, you subtract 192 from it to get the power level.  Ok that's not too bad right?  Well wrong..... when the wheel is idle, it toggles between 128 and 192, the two lowest values.  I think this is a simulation to make the wheel hard to turn at a standing start, but in practice this will make things drift on a pc FF wheel.  So I have to ignore these values and set the direction to 0 (not turning) when either of those values are present.  To top all of that off, the driver board test menu in the service menu doesn't work as you would think.  You think that pressing the gas button ups the total force so you can see it in a memory editor as you are increasing the stars in the menu right?  Wrong.  That's the force multiplier, which multiplies by the current wheel direction to get force. And you guessed it, if you aren't turning the wheel as you are increasing the stars, the value doesn't change in memory. 

I just wanted to point all of that out because this may be why we can't find the true values in daytona... they are simply unrecgonizable. 

Trnzaddict

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 93
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #94 on: January 22, 2013, 08:39:12 pm »
Howard, so are you working on a troubleshooter app to add 2 mice to Model 2 gun games? I've been following this thread for a couple of weeks now but it seems the focus was for glovepie but for actual mice like the Aimtraks, you would be making alot of people around the net very happy campers if this was possible.

RamjetR

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 144
    • My Youtube Channel
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #95 on: January 22, 2013, 10:36:40 pm »
Howard,

There is a whole heap of FF data not just from the wheel but the entire car axis, yaw, acceleration forces available in the struct around the rpm and speed information I extract for the Symprojects dashboard in my cabinet. That's how I get the data out for xsim to display my Speedometer in Daytona and Sega Rally. I haven't explained any of this information that my current VR program gathers because it at the time was all surplus to anyone who wanted purely to emulate the original ROM on original hardware? If you want more information on the directional forces within the games, I can grab the artmoney files which show quite indepth FF data... I haven't built a motion platform yet... (yet) but the larger plan is to export this to X-Sim to drive a small motion platform at home.

Anywho.... back to VCOP... ok so I did this poking around with the actual emulator.exe and it appears that P1 X/Y coordinates are injected into the game from the code blocks in the CheatEngine file I've attached. Now, if you run the emulator, attach cheat engine with this profile you'll see in advanced options (click bottom status bar) that there is two lines of code I highlighted. You can show this in the disassembler to show the bytes of data which corrospond to the screen location of the mouse. The instructions at ;

emulator.exe+B5824
mov [00559CB0],edx (Y axis)

and

emulator.exe+B5835
mov [00559CAC],ecx (X Axis)

Directly influence the location of the bullet hit without effecting the crosshair. Now just after this in assembly there is another copy/paste of the same variables being mov'ed into the locations which effect the crosshair locations.

Within this area; I didn't map all of it since it's all located in a close structure... is Player 2 information. Exactly the same result.

To test it out, bring up the advanced options and right click on each of the bottom two code lines and "replace with code that does nothing" i.e. NOP... This will stall the updates of the mouse location and returns to the original code after skipping.

The cool bit is that it functions in all of the M2 shooters I've tried it with.

Here I've been researching into code injection where by we can allocate a small amount of ram for code to be injected and possibly hand over through LUA script which is more open for joystick or other device handling some updated X/Y coordinates.

Two approaches here perhaps then, you can halt the X/Y updates that the emulator forces on the game and externally inject your own. Or, use the same script which stops the mouse handling and inject it internally to the process.

It's been quite a journey to find this inside the running emulator.exe and this should clear you to do it however you want without fighting the emulator itself.

Ramjet
« Last Edit: January 22, 2013, 10:38:32 pm by RamjetR »
Gentlemen.... Start your engines!
My Youtube Channel http://www.youtube.com/user/ramjetr?feature=mhee
Try my RamjetM2Borderless V0.7 utility for your M2Emulator shooting games here https://docs.google.com/open?id=0B-P3wlCiYEm3RzhCZk1NcFR3blE
Try my Sega Model 2 Output Utility RamjetVR V1.4 https://docs.google.com/file/d/0B-P3wlCiYEm3VHhBMXNxZGVIQk0/edit

RamjetR

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 144
    • My Youtube Channel
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #96 on: January 22, 2013, 10:45:48 pm »
Also... here is a program called Dienum

From memory I think I got it from a Logitech support page years ago? But it lists all of your attached input devices by number which correspond to the device ID you need to put into the emulator.ini for the raw input. Should take out some of the guess work out of setting your end up...

Ramjet
« Last Edit: January 22, 2013, 11:16:31 pm by RamjetR »
Gentlemen.... Start your engines!
My Youtube Channel http://www.youtube.com/user/ramjetr?feature=mhee
Try my RamjetM2Borderless V0.7 utility for your M2Emulator shooting games here https://docs.google.com/open?id=0B-P3wlCiYEm3RzhCZk1NcFR3blE
Try my Sega Model 2 Output Utility RamjetVR V1.4 https://docs.google.com/file/d/0B-P3wlCiYEm3VHhBMXNxZGVIQk0/edit

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16758
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #97 on: January 23, 2013, 12:02:44 am »
All very helpful man, thanks. 

Here is the stumbling block I'm currently on. 

You know where all of these memory engines use the format   emulator.exe+address  ?  I can't figure out where to find the exe's location in memory anymore.  The trick I used to use apparently doesn't work as of Vista and beyond.  Obviously there is SOME way to do it because apps like ArtMoney and the Cheat Engine do it.  I just don't know how. 

If we can find that, then I can make the program much cleaner.  Since M2 doesn't protect anything I can simply re-write the pointer you mentioned to our own memory space and set things up there.  No need for lua or anything. 

Now of course there are lazier ways to do it..  I think the getrampointer function in lua could let use print out a text file with all the needed addresses but I'd hate to resort to that.  Any hacking experts please chime in, because my expertise is wrapping, not direct memory manipulation. 

RamjetR

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 144
    • My Youtube Channel
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #98 on: January 23, 2013, 12:10:01 am »
How are you addressing the exe? I'm not sure on the Syntax, but I thought to address an executable you enclosed the exe with [emulator.exe]+0x"offset"

The system should resolve the base address of the executable for you shouldn't it?

Gentlemen.... Start your engines!
My Youtube Channel http://www.youtube.com/user/ramjetr?feature=mhee
Try my RamjetM2Borderless V0.7 utility for your M2Emulator shooting games here https://docs.google.com/open?id=0B-P3wlCiYEm3RzhCZk1NcFR3blE
Try my Sega Model 2 Output Utility RamjetVR V1.4 https://docs.google.com/file/d/0B-P3wlCiYEm3VHhBMXNxZGVIQk0/edit

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16758
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #99 on: January 23, 2013, 12:40:24 am »
Eh not exactly. 

In vb (or c for that matter) I first find the window of the exe I wish to mess with (really simple to do). 

Then I use a "getprocessid" api call and get the process id. 

THEN I create a new process using the same PID, which allows me read/write access to the memory of the emulator. I use generic "readprocessmemory" and "writeprocessmemory" api calls... it's the safest way to manipulate memory in windows.   Now for static addresses like the outputs on gunbalde this works fine, but at no point (afaik) am I given the address of the actual exe, so I don't have that starting point for these dynamic addresses you gave me.  And since it's a exe+ entry in the cheat engine, that means it's different each time. 


I think there is a way to do it via some sort of clever counting when you enumerate processes.  I just don't have a good clear example of it. 

RamjetR

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 144
    • My Youtube Channel
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #100 on: January 23, 2013, 01:02:46 am »
ooOOoooooh lol, sorry I misunderstood... the dynamic address I gave you there actually has a line number... the base address of the exe is 0x40000 (which appears to be quite a common entry point). But as you know that address is captive to the exe session and not the absolute address... but like doing a static read with the other offsets as it's mapped the same way.

If I'm understanding what your asking correctly (and never assume that I do lol) then where the line reads emulator.exe+B5824 the actual program address is 0x40000+B5824 = 004b5824

Since your opening a process with the same PID, then this is the address you have should have to read and write... Now this is how I've come to understand it. From many months of noob forum posts and expert replies... I may be right, I may likely be wrong.
« Last Edit: January 23, 2013, 01:15:18 am by RamjetR »
Gentlemen.... Start your engines!
My Youtube Channel http://www.youtube.com/user/ramjetr?feature=mhee
Try my RamjetM2Borderless V0.7 utility for your M2Emulator shooting games here https://docs.google.com/open?id=0B-P3wlCiYEm3RzhCZk1NcFR3blE
Try my Sega Model 2 Output Utility RamjetVR V1.4 https://docs.google.com/file/d/0B-P3wlCiYEm3VHhBMXNxZGVIQk0/edit

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16758
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #101 on: January 23, 2013, 01:39:03 am »
Again, I'm no memory expert, but I think the best way to put that 0x40000 address is it's the section in memory where the exe is stored, not the specific address.  I tried plugging that in just to make sure I wasn't mistaken, but it doesn't work. 

This is evident by the fact that I can run m2 and have it print the actual address of a dynamic value via the GetRamPtr function and they will be different each launch.  These are the values I acutally need because I can plug them in and they work, but only during that specific launch. 


I've been going in circles tonight trying to figure out how to get the value I need... it might not be possible.  I'll work on the program more later this week, only I'll concentrate on the parts I DO know how to impliment for the time being. 

vandale

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 318
  • Id 10 and t error
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #102 on: January 23, 2013, 05:51:13 am »
Hi guys.

I have been using a glovepie script called MouseParty which allows 4 mice on windows 7. If I edit the script down to 2 mice assigned to device 0 and 6 (usb mouse and macbook touchpad) then assign those devices in the M2 ini, I then get control over both red and blue cross hairs and can play 2 player independantly with trigger, reload and scores working correctly on each player.

Would the simple solution be a mashup of this MouseParty script and Howards Wiimote script thus allowing 2 wiimotes to act like mice on any chosed device ID which then configured in m2's ini to suit the specific device ID's you chose?

I have no glovepie script writing skills so cannot test my theory.

Come to think of it, if act labs guns act like mice then there is no reason why just using the MouseParty script wont work for those guns.

I can post a vid if need be?
Thanks

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 8415
  • ...
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #103 on: January 23, 2013, 07:15:04 am »
Hi guys.

I have been using a glovepie script called MouseParty which allows 4 mice on windows 7. If I edit the script down to 2 mice assigned to device 0 and 6 (usb mouse and macbook touchpad) then assign those devices in the M2 ini, I then get control over both red and blue cross hairs and can play 2 player independantly with trigger, reload and scores working correctly on each player.

Two real mice (or touchpads) have always worked.  The rawinput M2 uses from real mice is "relative" meaning it only knows which direction and how far the mouse moves, but doesn't know where it started or where it is in space.  The mouse is incapable of reporting exactly where it is, only direction and distance.  You can pick it up and set it down in a different place on the desk and it makes no difference.

For guns, we need to know the "absolute" position where the gun is pointed.  Just knowing how far and what direction it moved doesn't work because M2 doesn't know where it started.  Even if you started the game with the gun pointed directly center every time, when you go offscreen, it would get screwed up.  It doesn't matter with mice or touchpads because you're not aligning them with anything on the screen.

Howard is attempting to do something similar to the original Troubleshooter program (whose author has been MIA for many years).
Here is a page that explains the issue and how the solution works:
http://thetroubleshooter.home.mindspring.com/howitworks.htm


There was a company that showed a "coffee table" pc recently with a huge touchscreen that multiple people could use at once.
I think it ran a custom version of windows 8.  So there's hope that future versions of windows will do away with only having one system mouse.
« Last Edit: January 23, 2013, 09:07:09 am by BadMouth »

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 8415
  • ...
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #104 on: January 23, 2013, 09:13:41 am »
Just to make sure that I wasn't blowing a valid option out of the water, I checked out mouseparty.
http://www.mouse-party.com

Quote
Be sure you can control the windows mouse cursor with all mice connected. Test this on your desktop before playing a Mouse Party game. If all mice connected can control the cursor, and you have Windows XP, you should be ready to go. If there is a mouse that cannot control the cursor, that mouse will not be able to join the party.

Since all mice are controlling the same cursor, they are still all reporting as the same (just one) system mouse.
The game software is probably just rapidly switching between IDs.
Same old problem.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16758
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #105 on: January 23, 2013, 12:53:22 pm »
Yeah I know people are trying to be helpful and I really really appreciate it but I think there is a misconception as to what you can and cannot do in windows in regards to mice. 

Now for READING mice we can use raw mouse or direct input to read multiple mice at once... in relative mode only unfortuantely.  We can also get the exact position of the system mouse. 

As for WRITING, we can't write to any mouse other than the system mouse.  Microsfot considers moving the mouse at the hardware level a secuirty risk and thus makes it impossible.    People think that because they see two cursors on the screen that windows is reading two mice...... it isn't.  A custom program is manually drawing icons based upon the movement of the two mice. 

So any solution to where we make some other hardware device show up as two mice simply isn't going to work unless it's a hardware driver, because windows won't let you fake any mice other than the system mouse. 

Some things I'm admittedly not very good at (ahem memory hacking) but other things I would consider myself an expert at.  Faking inputs and keypresses would be one of those things.  I started in this hobby making wrappers to automate the launching of problem emulators via faking inputs and that was (dear god) over 16 years ago. 


That being said, I think I can work with relative mode in raw mouse in regards to fixing issues with existing lightgun "mice".  Mame does a fairly decent job of it.  It simply involves some tricky math so I was seeking another way.  As for devices that show up as joysticks... well they are always going to be joysticks, so we have to deal with them differently. 

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16758
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #106 on: January 23, 2013, 01:57:55 pm »
I'm trying to figure out a rawmouse solution and as I don't have any true lightguns anymore I could use some help. 

I've attached my extremely crude raw mouse tester.  When you click the button your system mouse will be hidden and the first two mice on your system will be represented by the red and blue squares.  Now for true mice it's easy enough, but I don't know how it's going to react to an absolute mouse.  (Aka a lightgun or touchscreen).

Could you guys check that for me?  The position when you fire your lightgun might not be exact, because I haven't compensated for resolution and what have you, but it should be consistant. 

Please try it and let me know the results. 


Oh and press Escape to exit it btw.  ;)

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 8415
  • ...
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #107 on: January 23, 2013, 02:16:22 pm »
Won't have time tonight, but I will dedicate tomorrow night to testing this with the Act Labs guns.

I have a single AIM-Trak and a few touchscreens I'll fiddle with if anything can be learned from it.

Endprodukt

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 619
  • I want to build my own arcade controls!
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #108 on: January 23, 2013, 04:02:23 pm »
I have two lightguns and will test it for you. What information do you actually need?

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16758
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #109 on: January 23, 2013, 07:32:01 pm »
You don't really need two as I'm reading only the first two mice on your system.  The first will be the actual mouse and the second will be your first lightgun. 


I just need to you check things visually to see if they are working right.  In other words fire a few shots and see if the cursors I made go where they are supposed to and if not how to they behave, ect.....

Endprodukt

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 619
  • I want to build my own arcade controls!
AW: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #110 on: January 23, 2013, 07:55:21 pm »
Tried it out but it didn't work as expected. Problem could be that the gun isn't mouse 2 on my system because of my trackball and spinner. Coordinates do change though while moving the gun . Disconnecting the spinner and trackball didn't help either.

vandale

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 318
  • Id 10 and t error
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #111 on: January 23, 2013, 08:22:36 pm »
Hi guys.

I have been using a glovepie script called MouseParty which allows 4 mice on windows 7. If I edit the script down to 2 mice assigned to device 0 and 6 (usb mouse and macbook touchpad) then assign those devices in the M2 ini, I then get control over both red and blue cross hairs and can play 2 player independantly with trigger, reload and scores working correctly on each player.

Two real mice (or touchpads) have always worked.  The rawinput M2 uses from real mice is "relative" meaning it only knows which direction and how far the mouse moves, but doesn't know where it started or where it is in space.  The mouse is incapable of reporting exactly where it is, only direction and distance.  You can pick it up and set it down in a different place on the desk and it makes no difference.

For guns, we need to know the "absolute" position where the gun is pointed.  Just knowing how far and what direction it moved doesn't work because M2 doesn't know where it started.  Even if you started the game with the gun pointed directly center every time, when you go offscreen, it would get screwed up.  It doesn't matter with mice or touchpads because you're not aligning them with anything on the screen.

Howard is attempting to do something similar to the original Troubleshooter program (whose author has been MIA for many years).
Here is a page that explains the issue and how the solution works:
http://thetroubleshooter.home.mindspring.com/howitworks.htm


There was a company that showed a "coffee table" pc recently with a huge touchscreen that multiple people could use at once.
I think it ran a custom version of windows 8.  So there's hope that future versions of windows will do away with only having one system mouse.

Hi Badmouth. I understand that for light guns but I am only wanting to use Wiimotes so acuracy is not an issue as I use the cross hair to line up the shot anyway. Howards Wiimote script has good calibration feature and it is very accurate on my setup so using the cross hairs that are already built into M2 will work a treat for my setup.

So my thinking was if mouse party worked fine on my two mouse devices then a simple 2 mouse wiimote script mashed together with Howards mame script would be sufficient. Obviously this doesnt work for act labs etc.

So my needs are somewhat different than what you guys are actually trying to acheive. Good work on progress so far though.

Howard, do you know of a dual mouse wiimote script that allows you to assign what input ID you have hijacked? I have searched high and low and oly come up with singles.
Thanks
Gene

TIGER8855

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 66
  • I want to build my own arcade controls!
Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #112 on: January 23, 2013, 09:07:42 pm »
Howard,

There is a whole heap of FF data not just from the wheel but the entire car axis, yaw, acceleration forces available in the struct around the rpm and speed information I extract for the Symprojects dashboard in my cabinet. That's how I get the data out for xsim to display my Speedometer in Daytona and Sega Rally. I haven't explained any of this information that my current VR program gathers because it at the time was all surplus to anyone who wanted purely to emulate the original ROM on original hardware?

Ramjet

Slightly off topic but does anyone have a link to theRamjetR VR program for use with model 2? I had a link to it previously but the link is now dead.

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 8415
  • ...
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #113 on: January 23, 2013, 09:17:51 pm »
Had a change of plans and was able to do some testing with a pair of Act Labs and a single Aim-Trak.
Uploading shaky video to youtube now, but it's taking forever.

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 8415
  • ...
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #114 on: January 23, 2013, 09:28:50 pm »
So my needs are somewhat different than what you guys are actually trying to acheive.

Actually, what they are trying to acheive is more relevant to Wii controllers, than Act Labs guns.
I'm the odd man out with the old CRT guns. 

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 8415
  • ...
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #115 on: January 23, 2013, 10:12:34 pm »
All apologies for the video quality.   I should have thought to reduce the resolution to 640x480 to make the numbers more legible.
I will in future tests.

On my laptop, the blue and red blocks are controlled separately by the touchpad and mouse, and track in an expected, controlled manner.

Round 1: two act labs guns - blue block jump to the position the mouse clicked on the command button, but otherwise doesn't move.
Red block disappears (assuming it flies offscreen)
vbx & vby register numbers when trigger is held and snap back to zero when trigger is released.

Act Labs rawtest 1


Round 2: more of the same with two act labs guns

Act Labs rawtest 2


Round 3: Aim-Trak (while act labs guns still plugged in)

AimTrak rawtest 1


Round 4: No video (done while other videos were uploading)  Trackball and Aim-Trak, Act Labs guns unplugged.
              Aim-Trak behaves same as last video.  Trackball controlls red square in expected controlled manner.

If you need me to get some specific numbers or something, just let me know.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16758
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #116 on: January 23, 2013, 11:14:18 pm »
Ok that's helpful and very interesting, thanks. 


Notice the lLastX and lLastY values?  They are in the 6 digits with those guns hooked up.  On my machine with a regular old mouse, any movement would be like +1 for about a pixel or +8 for a really big movement.

In other words, all the guns, even the aimtrack are giving absolute mouse positions.    This is actually a good thing!  It makes things much easier for me.  Now we simply need to determine the data format.  Could be Mickeys, could be twips, could be CPI (the mouse equivelent of dpi).  ONce we get that I can tack on a multiplier and they should track properly.  As for trackballs and real mice, I'm not particularly concerned.  They just nudge the cursor anyway so I can setup a user-defined multiplier for them.  I can't replicate how a windows cursor behaves anyway, they have "mouse ballistics" applied to them to make movement smoother. 

I'll look up some match functions and add those for the next go. 

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16758
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #117 on: January 23, 2013, 11:49:32 pm »
Ok give this bad boy a shot. 

I've removed the generic multiplier I had on the absolute tracking, hopefully that'll keep the cursor from disappearing. 

I've also wrote a bit of code to show you your screen dimesnions in different formats.  Hopefully with that we can determine which format it's using. 

vandale

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 318
  • Id 10 and t error
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #118 on: January 24, 2013, 03:08:35 am »
Ok give this bad boy a shot. 

I've removed the generic multiplier I had on the absolute tracking, hopefully that'll keep the cursor from disappearing. 

I've also wrote a bit of code to show you your screen dimesnions in different formats.  Hopefully with that we can determine which format it's using.

My mouse moves the red square and my touchpad moves the right square. How would I get the 2 wiimotes to control these squares independently?
Thanks

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16758
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #119 on: January 24, 2013, 01:22:34 pm »
You wouldn't....  you should read my post above about how you CANNOT fake dual mice.  This is for reading actual mice-based devices. 

  
 

Sitemap 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31