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
Lightguns Arcade1Up Try the site in https mode 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 136711 times)

0 Members and 1 Guest are viewing this topic.

RamjetR

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 144
  • Last login:July 04, 2021, 03:27:58 am
    • My Youtube Channel
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #40 on: September 11, 2012, 06:52:18 pm »
Either I've plugged em in wrong, or you found some of those dynamic addresses.  I've found those as well.... when you reload model 2 they aren't the same. 

I'm curious, how did you manage to find them in artmoney if it gives a different address?

Anyway, we can still work with that.  As you know, lua has a getramptr function.... we can write that to a file and let external programs pick it up and manipulate accordingly.

Blimey you were busy overnight lol.

The addresses I found work every time with artmoney... I have Getramptr exporting to a file now. But it's almost just as easy also put in the addresses for anything else you want to monitor or change. I'll be updating my RamjetVR program to do this rather than manually exporting data to a file and reading it externally constantly (although there was little to no overhead on doing that, but it hammers the HDD if windows commits the file to the disk which I struggle to prove if it yet does actually write the file)

Ok, how Sega seems to write their program structures is with offsets from the primary group of values. ummm trying to explain this properly, for the example of the values in VCOP, here's the process of what I did to find them.

1 - With VCOP running and Artmoney open.
2 - Entered the Service Menu of VCOP and went to Gun Calibration
3 - Did a calibration and it displays the number for the min and max area's hit by the gun shooting at the cal points. I think it was b5 and 4c7 or something like that.
4 - Did a RAM search on the calibrated values in RAM which would get me to the area where the gun calibration is being performed.
5 - Added the first value which looks "about" right and right clicked to monitor memory address area.
6 - Adjust RAM Refresh rate to 20ms so that the memory updates are reasonably close to real time for me to watch them.
7 - To find the P1 axis, I just moved the mouse and watched the memory locations around that area for +/- change and stopping when I moved the mouse. Noting that the original address didn't change because it was the committed calibration value and not the actual mouse locations. I knew I was close, so when watching I noticed a slight delay on which locations were getting an X and Y update first, because as you know there are several copies of the XY in memory. The one that updates first was the one receiving the original mouse input. Once that was spotted easily, lock in the P1 Axis locations.
8 - I exit out of service menu and went to the game and threw in a couple credits and started the game....
9 - Monitoring the memory area I noticed several patterns in addition to the mouse movement... Watch for toggling memory locations, values that change to different numbers and return again in a pattern.
10- Noticed a Value changing from 12 to 00 and back again in time with the Start button flashing. I started player 1 and the values changed... started player 2 and it went to 00.... let it go back to the beginning where P1 and P2 can press start and it returned to 0C.... Lock in the Player start flashing output.... memory found.
11- Remember I'm monitoring memory as it's running live here as it's often easier to spot a pattern than it is to pause and go looking for what is most of the time unknown values. So I started Right Clicking (Reload) and noticed a memory toggling in time with my finger pressing. Grabbed a second mouse and noted the value changed from 00 - 01 - 02 - 03 depending on which player or both we're asking for a reload.
12- As I'm monitoring memory locations I then also start collecting patterns of memory addresses that change and repeat when the game screen changes, ie Attract, player start, game select, mode select, car select, Single player Race or Multiplayer race (as the values can be difference in the same location if it's talking to other cabinets) etc etc...

It's more of a skill of knowing what to look for rather than knowing what value to look for and knowing the difference between what is original source data and how it copies it to use elsewhere in the game for other calculations.

I'd also use CheatEngine for digging deeper into dynamic memory as you can give it a memory location 0x50blahblahblah for example, and ask it to monitor what other memory/process will access that memory location... so if you've found a copy and it changes each time in memory, then you can find out what is addressing that location and often that will provide you with the structure base address offset. Allowing you to go back in memory to find the original data.

When Sega programmed these back in the day, it was all assembly language (which I do today for microprocessors). So with Cheat engine, you can dissassemble the running code and look up the opcodes from the CPU and see what all the CPU registries and stack information is doing at that time, what is being done to the code and where it is placing it after the opcode is executed.

If only I knew windows programming as well as I do assembly language lol!

 
« Last Edit: September 11, 2012, 07:21:22 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: 19399
  • Last login:March 16, 2024, 05:59:16 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #41 on: September 11, 2012, 07:28:28 pm »
Well that's essentially how I do it, but I'm wondering how you actually found those values. 

I've found the memory monitor to be fairly useless because it's so darn hard to navigate.  It's great if you the address is a few bytes here or there from where you start it, but if it's a ways off it can be daunting to find it.

I know a *little* assembly... probably just enough to get me into trouble. 

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:March 16, 2024, 05:59:16 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #42 on: September 12, 2012, 10:43:56 am »
I realized something last night and I think I know why you are saying that the address you found is statice and I'm saying its dynamic.  You are using the Model 2 helper functions built into art money aren't you.   Those automatically translate the dynamic addresses to static ones relative to the emulator. 

I haven't been using those because it seems like an external program is the way to go.  Lua doesn't have all the tools we need... or at least I can't find enough documentation for lua to know if it has all the tools we need.  ;)

retrorepair

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 252
  • Last login:April 14, 2023, 04:49:58 pm
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #43 on: September 12, 2012, 05:17:04 pm »
Hold up, so does this mean lua can actually see the output addresses even if it can't do the math to decode them?

I think it probably is possible in lua but being able to read from those is the main thing right? Once you have those you can get an external program to do the decoding. For things like lamps and recoil you'd need an external program anyway and though I hate to add another thing to mamehookers to do list it seems a pretty logical choice.

Great work all round by the way.
My arcade racing setup:
My Youtube Channel: http://www.youtube.com/user/RetroRepair
My Twitter: http://twitter.com/retrorepair

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:March 16, 2024, 05:59:16 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #44 on: September 12, 2012, 06:31:36 pm »
Not exactly....

It's like this: 

Model2 emulator specifically has some functions written to read the virtual memory addresses of the roms of the game loaded into the emulator.  Because of this we can read the memory of the running game.  But there aren't any functions for anything else, so we can't for example read the memory of the actual emulator program. 

The memory hacking program we are using has some utilites to read things like the lua script does.... basically it takes the address of the emulator.exe in memory and adds an offset. Which works just fine as long as a new version of the emulator doesn't come out.

So we have some things in the emulators memory that we need to address (like mouse position ect) that we CAN'T get from lua, and some things like the value of variable in the game, which we can.  And then we have things like the game outputs, which we can't get to via lua even though we should be able to because those areas of the game's rom weren't properly mapped. 

Long story short, most values are external to model 2 and we can just directly access them.  A few are found via a emulator offset (aka the lua scripting) but lua will output the real address and has the option to write it to file, so we are good either way.

As for mamehooker, I'm taking a different route.... stay tuned on that.

RamjetR

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 144
  • Last login:July 04, 2021, 03:27:58 am
    • My Youtube Channel
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #45 on: September 13, 2012, 10:09:33 pm »
Hi Howard,

Yes, thats exactly what I'm using. Since everything in Model 2 "world" is happening in it's own virtualized RAM 0x50000 onwards, there seemed little issue using the automatic emulator profiles for artmoney. This was preferable infact as when operating in LUA, the 0x5xxxx values are always consistant and can be exported using the (getrampointer)+(memorylocation offset). Static memory locations every time :)

@Retro
LUA is running underneath the emulator as as such has only been given access to specific area's of the virtualized memory. Namely RAM and some ROM areas. I/O's in the PCB is an actual physical port number and aren't actually emulated rather than where inputs need to be gathered, are manually injected by the emulator into the running process and the OPcodes the CPU is calling for I/O is being intercepted by the emulator and fed with the information it needs since the I/O ports don't actually exist. If that makes sense?

The conditions that the game use to send the ports are however in RAM as they are generated from the running of the ROM dynamically and are somewhere waiting in code to be sent to the IO port. That part we can read. The recent break though is in seeing where the inputs are being handled in RAM and it coincides with where the outputs also appear to be handled. So atleast we're getting closer to actual real outputs rather than writing elaborate code to emulate what the output would be given the inputs available.

Ramjet
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

retrorepair

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 252
  • Last login:April 14, 2023, 04:49:58 pm
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #46 on: December 08, 2012, 01:41:35 am »
Ok, so since I'm quite ill and can't really gather the energy to do anything physical I figured I'd have a look at gunblade and see if I could find some I/O to tap into.

I found a bit more than that, near as I can tell, every game has it's I/O totally exposed EXCEPT Daytona  ::) Pretty certain now there's no way to access the outputs for this which is odd since VCOP has them. Maybe it was all handled on the drive board which is fudged somehow?

I've attached several files from what I've managed to work out, just a few for now. Both artmoney tables with memory locations and lua scripts to demonstrate the value's function.

Sega Rally - Wasn't hard, there's only 3 :)
Indy500 - Wasn't hard to find but took a while to map out which value does what
STCC - Likewise. Memory locations are different but values are identical to Indy500
Gunblade - Outputs are there as well as recoil and analog inputs :) Would be nice to know what to do with the analog inputs though. Can't believe ElSemi only allowed mouse input for an analog joystick game  ::) Read the lua for explainations on this one

How we missed all of these when we were working on the VR app I've no idea but here they are, so no more messing around "faking" it with most of them at least.
My arcade racing setup:
My Youtube Channel: http://www.youtube.com/user/RetroRepair
My Twitter: http://twitter.com/retrorepair

RamjetR

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 144
  • Last login:July 04, 2021, 03:27:58 am
    • My Youtube Channel
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #47 on: December 18, 2012, 05:06:54 pm »
I know how we missed them.... primary work was spent on and almost exclusive to Daytona USA. It was then just assumed that others were the same once we were looking for the same virtual memory conditions as what we got from Daytona.

That said, some of those scripts don't appear to work for me? Had a quick look yesterday at them and STCC for example seems to map the bios outputs ok, but once in game the memory location is invalid and not updated?

All the Shooter games have their outputs easily mapped but I reckon this is due to the revision of the hardware that ran all the shooter games being similar. Whilst the Drivers are slightly different.

I have some time of over the christmas holidays to look into finishing off the bits and pieces of code I've had little time to work on this year.

Ramjet
« Last Edit: December 18, 2012, 05:18:36 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

retrorepair

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 252
  • Last login:April 14, 2023, 04:49:58 pm
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #48 on: December 24, 2012, 09:29:25 am »
Not sure how but that artmoney file has the wrong address for STCC, it should be 0020B214. Remember with STCC also (as with many or all M2 games) the start lamp only flashes when the game is set to freeplay or it's coined up and leader lamps only work when networked (except indy500).

No idea if different regions/revisions change things but I'd say it's unlikely in most cases.

For some reason on STCC, the start lamp, rev limit and leader lamps all work in game but the VR zoom lamps don't. I can confirm they didn't on my real twin setup either (original hardware) which is odd. As with the emulator, they worked fine in the test menu. Setting the thing to DX didn't help, I assume it was either rushed out so quickly they didn't hook them up for in game or there's an option in the test menu that needs to be set which I've not found.

As for Daytona, it seems Howard's theory about XOR type tables could well apply to that one game. Virtua Racing in MAME is the same (apparently the outputs are XOR'd together in 16 byte blocks) and considering the similarities between VR and Daytona hardware that's more than likely the case. This is way over my head though. Here's the thread, there's some pretty interesting info on networking here too: MAME World Thread

I also think rather than calling the pacdrive dll directly it'd be best to interface outputs to mame hooker for the sake of keeping things universal as in support for other devices etc. There is an AHK library for DDE but I couldn't get it to work just yet. If it could be gotten to work though it'd be a piece of cake. Just a shame DDE can't be used in Lua (that I've found anyway).

As inefficient as it may be it seems the only real way to communicate with another app from Lua is through writing to a text file (it'll only write to it when a state changes anyway so it's not the end of the world) so for this special case it'd be useful if MH could read outputs from a text file. It'd certainly save having to run another intermediate program as well as having to drop in a lua file.
« Last Edit: December 24, 2012, 09:42:17 am by retrorepair »
My arcade racing setup:
My Youtube Channel: http://www.youtube.com/user/RetroRepair
My Twitter: http://twitter.com/retrorepair

retrorepair

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 252
  • Last login:April 14, 2023, 04:49:58 pm
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #49 on: December 24, 2012, 09:46:18 am »
Oh yeah, if you add this line to m2network.ini on each machine:

Code: [Select]
FrameSync=1
network works 100% apparently. You still need gigabit ethernet. Would have been nice if that was documented someplace (knowing me I just missed it in the M2emu docs but I don't think I did).
« Last Edit: December 24, 2012, 09:52:22 am by retrorepair »
My arcade racing setup:
My Youtube Channel: http://www.youtube.com/user/RetroRepair
My Twitter: http://twitter.com/retrorepair

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:March 16, 2024, 05:59:16 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #50 on: December 25, 2012, 03:12:58 am »
Hey guys, Merry Christmas!

Just got done with a session of NSMB U so I thought I'd chime in for a sec. 

Didn't get nearly as much done as I wanted unfortunately... last minute gifts/headaches and a mild cold kept my head out of the game last week.  I should have plenty of time this coming week though, so I'll get mamehooker out and go from there. 

DDE is crazy annoying to code for.  In most languages it flat out won't work unless your code is compiled, so while a ahk script probably won't do anything, a ahk exe will.  There are other options available in the next release though, so just sit tight. 

ArtMoney has different "modes" basically relative to the exe address in memory and absolute. 


We'll figure it out, just be patient. 

RamjetR

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 144
  • Last login:July 04, 2021, 03:27:58 am
    • My Youtube Channel
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #51 on: January 01, 2013, 04:03:21 pm »
A bit belated but Merry Christmas and Happy New Year! I haven't done much at all either over the christmas period. A new nephew arrived, and the 2yro niece (who just loves me like a best friend) won't leave my side the whole time. So I've been doing alot of baby sitting, BF3ing (where I can) and Arduino tinkering. Did you know that a clever little New Zealand man called Darran has released some code and hack for arduino to make it report USB compliant HID code? Make your own Mouse/Joystick anyone? Relatively simple to do and with a bit more buggering around perhaps it can be my very own LED output controller too? I get distracted easily... and I know you all know what I mean by that!

Retro, the real STCC DX cabinet I have in the garage now will actually work the VR Lamps up and down whilst in game. It flashes Red Blue according to the upper and lower views selected. I copied the actual sequence for the last version of the VR program. If there are games that don't output all of the IO's from the same address, and can't be found elsewhere... then the emulation we have is likely sufficient enough. I can speed up this process significantly now (that I've learned a bit more coding). Real IO information would make things simpler, but if it can't then 99% of all other features can be derived from game conditions.

Thanks for the tip on the Framesync, I'll try that a bit later as in true fashion the girlfriend is dragging me out and about. probably to baby sit and maybe buy a new TV? ... Maybe....

Haven't a clue what DDE is btw... arrgh ok, gotta go. Back laters.

Ramjet
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

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9226
  • Last login:March 25, 2024, 08:10:48 pm
  • ...
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #52 on: January 11, 2013, 09:16:54 am »
In case you guys don't see this in the Main forum:
http://forum.arcadecontrols.com/index.php/topic,104484.msg1326289.html#msg1326289

Someone claims to have 2 wii controllers working in M2Emulator using Howard's Glovepie scripts.

I tried to get joysticks(positional guns) working with every older version of M2Emulator that I could find, but had no success.
I'm thinking M2Emulator is picking up rawinput from somewhere other than the final virtual gamepad in the chain,
but I'm nowhere near as knowledgeable about any of the software involved as you guys are.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:March 16, 2024, 05:59:16 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #53 on: January 11, 2013, 04:13:08 pm »
Let's put it this way... if that worked I'd be really really suprised. 

My scripts turn the wiimotes into joysticks, they don't show up as mice... also they are scripted to pretty much only work in mame.  They actually go intert if you try to use them in other games other than a visual indicator (which I guess could move the cursor). 

I actually made some scripts prior to the method we are working on now.  I could get the p2 cursor to move, but it would constantly snap back to the default position.  So the games were quite playable, but because of that snap back you'd get gunfire randomly in the wrong place, so it would kill your accuracy score.  Maybe that's the issue he's referring to?

vandale

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 408
  • Last login:October 10, 2023, 04:01:16 am
  • Id 10 and t error
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #54 on: January 12, 2013, 05:30:26 am »
Hi, the post about 2 wiimotes working in M2 was me :) I can assure you the script I mentioned in the other post works in M2, both players, same time with correct trigger and reloading button assignments.

No I am not getting snap back that you mention.

The issue I have is the cross hair doesnt track with the wiimote movement, i have to over compensate to get the cross hair moving in the direction I need. Same script in MAME and the cross hair tracks perfect. Also another weird scenario in M2 that i dont get in mame is P1's trigger button works but if I keep it held down it then auto fires at an incredible rate and auto reloads as well?

Its an awesome script. My wiimotes auto connect anytime I want and stay calibrated. I use them in Model 3 Jurassic park also no issues.

Its M2 that I really want working, HOTD and Virtua Cop!

I can put up a video of this if you want?

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:March 16, 2024, 05:59:16 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #55 on: January 12, 2013, 05:06:15 pm »
It would, so I can undestand exactly what is going on. 

Also please re-post your specs here just for clarity for everyone else.  I saw in the other thread you mentioned something about a MAC?  You wouldn't be running windows via emulation would you, because the reason we can't move individual mice via software is largely due to a bug in windows itself. 

vandale

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 408
  • Last login:October 10, 2023, 04:01:16 am
  • Id 10 and t error
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #56 on: January 14, 2013, 02:14:10 am »
It would, so I can undestand exactly what is going on. 

Also please re-post your specs here just for clarity for everyone else.  I saw in the other thread you mentioned something about a MAC?  You wouldn't be running windows via emulation would you, because the reason we can't move individual mice via software is largely due to a bug in windows itself.

Hi. No windows emulation, its just Windows 7 32bit ultimate on a 2009 MacBook Pro.

Specs as per other post:
Macbook pro bootcamp windows 7 Ultimate 32 bit
Standard microsoft Bluetooth stack (auto connects to wiimotes)
Glovepie free
MAME Wii Lightgun Glovepie Script by HowardC Version 1.5
PP joy (takes wiimote input and converts to windows gamepads)
M2 v1.0
Virtua Cop
M2 Ini set as:
[Input]
XInput=0         ;Enable support for Xbox360 compatible devices
EnableFF=0         ;Enable Force Feedback Effects
HoldGears=0         ;Set to 1 to return to Neutral in driving games when the gear shift key is released
UseRawInput=1         ;Read mouse through Rawinput, allowing 2 mice
RawDevP1=3         ;Assign specific RawInput devices to players. If you have more than 2 mice
RawDevP2=4         ;set which one is assigned to each player (0-based)

Video in a few mins
Thanks

vandale

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 408
  • Last login:October 10, 2023, 04:01:16 am
  • Id 10 and t error
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #57 on: January 14, 2013, 06:50:47 am »
very poor quality video

http://tinyurl.com/a9w7vag

look for the small circle cross hairs

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:March 16, 2024, 05:59:16 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #58 on: January 14, 2013, 07:44:18 am »
Ok second question.... how many mice are hooked up to your mame cab?   (If it's running off the laptop include the touch pad).  The reason I'm asking is that you've got the raw mice ids set to 3 and 4. 

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9226
  • Last login:March 25, 2024, 08:10:48 pm
  • ...
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #59 on: January 14, 2013, 09:24:31 am »
Didn't see the other cursor coming.
Mind blown.
:blowup:


Do the crosshairs on the positional gun games track?
(Gunblade NY, Rail Chase 2, Behind Enemy Lines)
I'm talking about the ones that were part of the original games, not the ones added by M2Emulator.


vandale

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 408
  • Last login:October 10, 2023, 04:01:16 am
  • Id 10 and t error
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #60 on: January 15, 2013, 04:52:19 am »
Ok second question.... how many mice are hooked up to your mame cab?   (If it's running off the laptop include the touch pad).  The reason I'm asking is that you've got the raw mice ids set to 3 and 4.

1 USB mouse connected. Touchpad/keyboard disabled in device manager as this is an insurance write off unit with liquid damage to keyboard and touchpad.

No matter what id's I set the ini file it still works on both wiimotes independantly

Thanks

vandale

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 408
  • Last login:October 10, 2023, 04:01:16 am
  • Id 10 and t error
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #61 on: January 15, 2013, 04:55:32 am »
Didn't see the other cursor coming.
Mind blown.
:blowup:


Do the crosshairs on the positional gun games track?
(Gunblade NY, Rail Chase 2, Behind Enemy Lines)
I'm talking about the ones that were part of the original games, not the ones added by M2Emulator.

No the original cross hairs do not track, only the small circles added by M2.

I was thinking, if I run a wiimote dual mouse script then there is no reason why this wont work and it may improve the tracking. Will see how I go.
Thanks
Gene

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:March 16, 2024, 05:59:16 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #62 on: January 15, 2013, 04:51:40 pm »
Unfortunately I think what you are seeing is a graphics error and nothing more. 

As I stated previously, my scripts aren't designed to work outside of mame.  They show these fake (and essentially useless) cursors in anything else.  Take the fact that you've turned off visual themes and directx/ogl doesn't like these fake cursors and what you are propbably seeing is a corrupted pointer "stripped" of it's icon.  I could be wrong on this of course, but from my own testing, I think that is what you are seeing. 

A dual mice script won't work in windows 7 (or anything really) due to changes in windows.  While we can detect movement in individual mice hardware, we can't fake it.  Don't let those pointers fool you, they aren't real.

I've done extensive testing on model 2, and outside of using two real mice, or injecting data into the memory locations, you can't run two wiimotes (or anything for that matter) at once.  I wanted to make sure I hadn't missed anything though, which is why I asked you all of those questions.  Feel free to experiment, but I doubt you'll find the answers you seek. 

vandale

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 408
  • Last login:October 10, 2023, 04:01:16 am
  • Id 10 and t error
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #63 on: January 15, 2013, 10:07:07 pm »
Unfortunately I think what you are seeing is a graphics error and nothing more. 

As I stated previously, my scripts aren't designed to work outside of mame.  They show these fake (and essentially useless) cursors in anything else.  Take the fact that you've turned off visual themes and directx/ogl doesn't like these fake cursors and what you are propbably seeing is a corrupted pointer "stripped" of it's icon.  I could be wrong on this of course, but from my own testing, I think that is what you are seeing. 

A dual mice script won't work in windows 7 (or anything really) due to changes in windows.  While we can detect movement in individual mice hardware, we can't fake it.  Don't let those pointers fool you, they aren't real.

I've done extensive testing on model 2, and outside of using two real mice, or injecting data into the memory locations, you can't run two wiimotes (or anything for that matter) at once.  I wanted to make sure I hadn't missed anything though, which is why I asked you all of those questions.  Feel free to experiment, but I doubt you'll find the answers you seek.

Hi, the small circles do work as cross hairs when I run my digital joysticks in m2, they shoot from different guns and work independantly so I am not sure why you are rejecting this as working when it clearly does work, even the individual scores go up for both P1 and P2.

The issue with the wiimote is they dont track with the cross hair properly but do if you over compensate, the question isnt whether they are connected and work indpeendantly in M2 as they do. Will post a link in a few mins of the 2 joysticks working.

Thanks

vandale

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 408
  • Last login:October 10, 2023, 04:01:16 am
  • Id 10 and t error
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #64 on: January 15, 2013, 10:39:49 pm »
vid

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9226
  • Last login:March 25, 2024, 08:10:48 pm
  • ...
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #65 on: January 15, 2013, 10:47:29 pm »
RamJetR remembered having two wiimotes working long ago, but has been unable to recreate it.
He's done many great things, but I had my doubts that he was remembering correctly.  ;D

I don't doubt either of you now.  The question is where M2 is getting the input from.
Perhaps analog joystick input is supported in these games, but certain conditions (which we don't know) must be met.

Please continue posting vids and info about your setup and thanks for what you've posted so far.
 :cheers:

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9226
  • Last login:March 25, 2024, 08:10:48 pm
  • ...
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #66 on: January 15, 2013, 11:16:56 pm »
Holy crap just duplicated this in Virtua Cop! (kinda)

I am using a real dual analog gamepad, not wiimotes or ppjoy.
I had raw input set to 0 in the ini file.
Then launched the game and mapped the joystick directions (used the second analog stick for player 2).
Then changed raw input to 1 and launched it again.

The weird cursors didn't appear until I entered coins and pressed start.
At one point they disappeard.  It seemed to coincide with pressing one of the other buttons on the controller, but I'm not sure.
I never could get them back during that game, but the next time I launched the emulator, they were back.
They work independently and each player's fire button works and goes to the spot of the weird cursor.

Gave gunblade a quick try and couldn't get them to appear.

Unfortuneatly I need sleep and am already late to bed.
.....but it does work in Virtua Cop anyway.

EDIT: Virtua Cop 2 works as well, but the crosshairs are X's instead of O's
         The cursors only move during gameplay.  They stop responding when you die and jump to the upper left corner of the screen when you press start to continue (as if they are being reset).

EDIT2: Seems to only work on Virtua Cop and Virtua Cop 2  :-\
           I tried HOTD, Gunblade & Behind Enemy Lines.  Rail Chase is missing from my laptop for some unknown reason.

For Act Labs guns anyway, if there is a way to have the virtual joysticks snap to the point on the screen where the gun is fired before registering the shot, then we are in business.  It wouldn't need to inject the coordinates directly into the program like the troubleshooter does.  You'd have the odd cursors in the last place you shot, but it would be a small price to play for 2 player virtua cop IMO.

Accurate tracking with an IR gun would be a whole different can of worms.  :-\


I just wanna play Gunblade NY with my big positional gun!!!!!   :angry:

« Last Edit: January 15, 2013, 11:53:07 pm by BadMouth »

vandale

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 408
  • Last login:October 10, 2023, 04:01:16 am
  • Id 10 and t error
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #67 on: January 16, 2013, 06:40:35 am »
Holy crap just duplicated this in Virtua Cop! (kinda)

I am using a real dual analog gamepad, not wiimotes or ppjoy.
I had raw input set to 0 in the ini file.
Then launched the game and mapped the joystick directions (used the second analog stick for player 2).
Then changed raw input to 1 and launched it again.

The weird cursors didn't appear until I entered coins and pressed start.
At one point they disappeard.  It seemed to coincide with pressing one of the other buttons on the controller, but I'm not sure.
I never could get them back during that game, but the next time I launched the emulator, they were back.
They work independently and each player's fire button works and goes to the spot of the weird cursor.

Gave gunblade a quick try and couldn't get them to appear.

Unfortuneatly I need sleep and am already late to bed.
.....but it does work in Virtua Cop anyway.

EDIT: Virtua Cop 2 works as well, but the crosshairs are X's instead of O's
         The cursors only move during gameplay.  They stop responding when you die and jump to the upper left corner of the screen when you press start to continue (as if they are being reset).

EDIT2: Seems to only work on Virtua Cop and Virtua Cop 2  :-\
           I tried HOTD, Gunblade & Behind Enemy Lines.  Rail Chase is missing from my laptop for some unknown reason.

For Act Labs guns anyway, if there is a way to have the virtual joysticks snap to the point on the screen where the gun is fired before registering the shot, then we are in business.  It wouldn't need to inject the coordinates directly into the program like the troubleshooter does.  You'd have the odd cursors in the last place you shot, but it would be a small price to play for 2 player virtua cop IMO.

Accurate tracking with an IR gun would be a whole different can of worms.  :-\


I just wanna play Gunblade NY with my big positional gun!!!!!   :angry:

YESSSSSS!!! Finally someone believes me :0

I get the funny circle cross hairs in HOD aswell and can play 2 player independant. I havnt tried VC2 though.

This is identical to how it works with my wiimotes. If the wiimote could be fixed to the circle and keep tracking in realtime rather than the digital method thats hard to see in my forst vid then sweet I would be happy with that.

Thanks


retrorepair

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 252
  • Last login:April 14, 2023, 04:49:58 pm
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #68 on: January 16, 2013, 06:50:19 am »
This is most likely some residual debug code for M2Emu and the lightgun games. The fact Gunblade doesn't show them gives a little weight to that. Does it happen in Railchase 2?
My arcade racing setup:
My Youtube Channel: http://www.youtube.com/user/RetroRepair
My Twitter: http://twitter.com/retrorepair

vandale

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 408
  • Last login:October 10, 2023, 04:01:16 am
  • Id 10 and t error
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #69 on: January 16, 2013, 06:59:26 am »
This is most likely some residual debug code for M2Emu and the lightgun games. The fact Gunblade doesn't show them gives a little weight to that. Does it happen in Railchase 2?

Or some early code before M2's developer went MIA

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:March 16, 2024, 05:59:16 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #70 on: January 16, 2013, 03:18:26 pm »
Yeah I'm not sure what everyone is getting so excited about.  Not working right is still the same as not working. 

Memory hacking is how this problem is going to be solved.  I'm already working on it, just not right now because I've still got video games to play from xmas. 

vandale

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 408
  • Last login:October 10, 2023, 04:01:16 am
  • Id 10 and t error
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #71 on: January 16, 2013, 11:04:32 pm »
Yeah I'm not sure what everyone is getting so excited about.  Not working right is still the same as not working. 

Memory hacking is how this problem is going to be solved.  I'm already working on it, just not right now because I've still got video games to play from xmas.

What a way to kill a thread

retrorepair

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 252
  • Last login:April 14, 2023, 04:49:58 pm
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #72 on: January 17, 2013, 06:28:36 am »
This wasn't your thread to begin with and also, he's right.

You can go ahead and prove him wrong if you want but honestly, it's nothing that can be exploited.
My arcade racing setup:
My Youtube Channel: http://www.youtube.com/user/RetroRepair
My Twitter: http://twitter.com/retrorepair

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9226
  • Last login:March 25, 2024, 08:10:48 pm
  • ...
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #73 on: January 17, 2013, 09:34:55 am »
I think there is a way to parlay this new discovery into a solution for Act Labs guns anyway.

I'm no dev, but I've cobbled together AHK scripts to do some crazy things and I think this is possible.
I have a million other things to do, but I'll probably tinker with this.
It hasn't been done before and it's on the edge of my skill level.  That makes it hard to resist working on.
I'll start a new thread if I get anywhere with it, but here is the general idea:

1. create fake dual analog joystick in ppjoy and in M2emulator map one stick to p1 and the other to p2, map each trigger to a gamepad button
2. Get mouse position when trigger is pulled (mouse button)
3. Have AHK set analog joystick position, then press gamepad button to fire

Which analog stick moves and which fire button gets pressed would depend on which act labs trigger was pulled.


This script looks promising:

Code: [Select]
MouseGetPos, MouseX, MouseY

; Values must be within 0-100 range
YVal := 100-Round(100*(A_ScreenHeight-MouseY)/A_ScreenHeight)
XVal := 100-Round(100*(A_ScreenWidth-MouseX)/A_ScreenWidth)

PPJ_SetAxis(2, Yval) ;Axis 2 is the Y axis
PPJ_SetAxis(1, Xval) ;Axis 1 is the X axis
}

Sounds like it does the joystick position as a percentage of the screen dimensions...sounds promising to me.

source:
http://www.autohotkey.com/board/topic/48827-ppjoy-library/

On a side note, doesn't the Aim-Trak have a "joystick mode" ?
« Last Edit: January 17, 2013, 09:39:57 am by BadMouth »

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:March 16, 2024, 05:59:16 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #74 on: January 17, 2013, 11:11:05 am »
Won't work bad mouth.  That's the main issue with model2.  It doesn't support analog or digital joysticks for gun games.  AT ALL.  It supports mice, and dual mice at that, but no joysticks other than the triggers (because they are also mapped to p1 button 1 in model 2). 

We can't fake the mice because m2 is using rawmouse.  Raw Mouse functions, read the position via the individual hardware drivers.  There isn't a way to fake this in windows, period.  The only way we could would be to make a fake mouse driver, which is far more involved than just using a memory hack to do it.  Of course you can fake the mouse for a single player game if you turn off rawmouse, but that kind of defeats the purpose. 

Messed with Model 2 inputs/outputs for over a month before the holidays hit, rest assured I tried pretty much everything.  The only thing that responded properly was injecting the values straight into memory and the reason I didn't release anything is because finding the initial memory location is a bit tricky (but possible). 



BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9226
  • Last login:March 25, 2024, 08:10:48 pm
  • ...
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #75 on: January 17, 2013, 11:27:40 am »
It doesn't support analog......joysticks for gun games.  AT ALL.

That's what I thought until I played Virtua Cop and Virtua Cop 2 using a logitech analog gamepad the day before yesterday.

The stick that was mapped to P1, moved the weird "0" P1 pointer. 
The stick that was mapped to P2, moved the weird "0" P2 pointer. (both are identical)

The button mapped to P1 Button1 fired bullets from P1's gun to the place where P1's pointer was.
The button mapped to P2 Button1 fired bullets from P2's gun to the place where P2's pointer was.

I did not figure out how to reload, but only messed with it a short time.

Moving the mouse had no effect on either the original or the weird debug crosshairs.

Mapping had to be done without RawInput enabled.
The sticks worked after launching the emulator again with RawInput enabled.
(although obivously it's enabling something other than raw input)

It did not work for me on the positinal gun games or HOTD.
vandale said it worked for him on HOTD.  I only tried it once.
I will give it another try tonight.

It may be leftover debug code or something, but it's there.


« Last Edit: January 17, 2013, 11:29:29 am by BadMouth »

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:March 16, 2024, 05:59:16 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #76 on: January 17, 2013, 12:19:36 pm »
*sigh*

But that's not "support" now is it?

As I said before, not working correctly is still the same as not working. 


Except for the debug cursors as you called them, I discovered all of this during my testing.  In the memory editor I could actually see the joystick positions, this isn't news to me that in some of the games it tracks the joysticks even though it doesn't do anything with them.  Again, the only solution that seems to work is memory hacking. 

vandale

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 408
  • Last login:October 10, 2023, 04:01:16 am
  • Id 10 and t error
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #77 on: January 17, 2013, 04:14:30 pm »
This wasn't your thread to begin with and also, he's right.

You can go ahead and prove him wrong if you want but honestly, it's nothing that can be exploited.

Thanks for your unnecessary comments.

By the way, I am not trying to prove anyone wrong, just like you I am a fan of old school games and replicating them as close to the original as possible, thought I could assistthis project as I didnt see anyone have 2 players working independantly like I had.


Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:March 16, 2024, 05:59:16 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #78 on: January 18, 2013, 08:26:38 pm »
This wasn't your thread to begin with and also, he's right.

You can go ahead and prove him wrong if you want but honestly, it's nothing that can be exploited.

Thanks for your unnecessary comments.

By the way, I am not trying to prove anyone wrong, just like you I am a fan of old school games and replicating them as close to the original as possible, thought I could assistthis project as I didnt see anyone have 2 players working independantly like I had.

You know, ramjet, retrorepair and myself are the only ones who have made any progess with adding functionality to M2, so you should really watch who you agitate.  Your initial comment about me killing the thread was the unnecessary one, so you are the pot calling the kettle black.   

If you had followed the thread then you would know that both ramjet and myself are working on this. I know it sucks to be patient, but sometimes you have to. 

 It isn't a matter of proving right and wrong, it's just you were saying "hey this works" when in fact it doesn't.  I mean you were asking about how the script is moving those cursors and I replied by simply saying "it isn't" and you kept insisting that it was.  I coded the scripts, I know what they can and cannot do.  And yes, you seem to have found an artifact of code inside M2, but as I explained to badmouth, that doesn't really help us because the joystick positions M2 is tracking aren't hooked up to the inputs in the games, and even if they were, they aren't present in all of the games.

I mean if you guys want to play around and see if you get lucky be my guest, but all of the methods you guys have suggested thus far I've already tried.  I just hate to see somebody pull their hair out trying to get something to work that most likely isn't.   

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:March 16, 2024, 05:59:16 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #79 on: January 20, 2013, 12:48:31 pm »
Ok getting back on a positive note.


I've been working on my "troubleshooter 2" app because it will use dde communication with mamehooker for outputs (optionally of course) and I want to make sure I don't have to add anything to the dde module before I release mamehooker. 

I've dual guns and joystick guns "sort of" working.  It's glitchy, but at least it's playable.  For P1's gun as a joystick it's really easy, I just fake the system mouse.  It works great 100% of the time.

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.