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 136727 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
Hi all,

I've been building a couple of racing cabinets and a mame machine for use with the Model 2 Emulator and come across several well documented issues with regards to Shooting games and loss of fullscreen when reloading.

So I thought I'd have a crack at coming up with a fix and in mostly an afternoon, come up with not only a fix. But finely tuned it to be as seamless as possible to install and just fit into everyone's front end software.

This program will enable users to run their favourite lightgun shooters on Nebula's Model 2 Emulator and off screen reload without the program Alt-Tabbing or accidently minimizing to desktop.

Games (ROMS) supported

Virtua Cop 1
Virtua Cop 2
House of the Dead
Rail Chase 2
Gunblade NY
Behind Enemy Lines

As I'd accidently hijacked a thread of BadMouth's (forum.arcadecontrols.com/index.php?topic=104484.0;all), I have created this thread to give the application it's own place for discussion and possible stickiness for others to find easily for the future.

Here is my RamjetM2Borderless program (Current Version 0.7):

https://docs.google.com/open?id=0B-P3wlCiYEm3RzhCZk1NcFR3blE  <- Hosted at my Google Drive. Click File>Download

And here is the readme description:

Code: [Select]
Welcome to the - RamjetM2Borderless V0.7 -  support for Sega Model 2 Emulator.
--------------------------------------------------------------------------

This is a readme file on how to use this software

This program will enable users to run their favourite lightgun shooters on Nebula's Model 2 Emulator and off screen reload without the program Alt-Tabbing or
accidently minimizing to desktop.

Games (ROMS) supported
----------------------

Virtua Cop 1
Virtua Cop 2
House of the Dead
Rail Chase 2
Gunblade NY
Behind Enemy Lines



My Youtube Channel - please visit my youtube channel and make contact with me there.
-----------------------------------
http://www.youtube.com/user/ramjetr
-----------------------------------

or visit the active forum where this is currently being discussed

--------------------------------------------------------
http://forum.arcadecontrols.com/index.php?topic=104484.0
--------------------------------------------------------

Sega Model 2 Emulator can be found here

------------------------------
http://nebula.emulatronia.com/
------------------------------

---------------------------------------
Contents of RamjetM2Borderless V0.7.zip
---------------------------------------

RamjetM2Borderless.exe - The main program that monitors and sets borderless only the active Model 2 Emulator games below. Version number is removed for ease of LUA launching
gunbladeNY.ico - The following icons are loaded into the task bar when the game has been detected and running.
HOTD.ico
RailChase2.ico
Sega2.ico
VCop1.ico
behindenemylines.ico
\Scripts - LUA scripts to be ran by the Model2Emulator, This will automatically launch the RamjetM2Borderless program for you when the game is launched.
bel.lua
vcop.lua
vcop2.lua
hotd.lua
rchase2.lua
gunblade.lua




Installation
------------

Extract the contents of this zip file into the root folder of your model2 emulator.


What do I run? and What will this program do?
---------------------------------------------

*** Updated ***

In this release there is a slight change for the usage of this program since.

Now included in the Zip file is a \Scripts folder with LUA scripts which will be auto executed by M2 Emulator when the ROM is launched. Within the script, it calls a command window
and launches the RamjetM2Borderless.exe to run in background. Unfortunately the M2 Emulator LUA script cannot hide the cmd window, however it will only appear very briefly as the
RamjetM2Bordlerless program will actively close the cmd window for you in the background once it's executed.

When running with a Front End, hopefully you won't see any of this happening behind the scene. Depending on how the Front End handles the blanking of the screen between launching and
showing the emulator, your milage may vary.

You'll see a new little White/Blue Sega icon appear in your task bar next to the clock. This will change icon depending on which game is detected to be running

It will constantly scan for a one of the above games to run and then force the active title bar matching that name to run without a border. This will remove
the Min,Max,X buttons from the active window. Once running it will kill the cmd window that was opened by M2 Emulator and minimize.

This app will now auto close when Model2Emulator is closed. Since it's being launched directly by the Model 2 emulator via the LUA scripts, there is no need to manually start this
program.


Changelog;

V0.7 - Updated by Mark 'Ramjet' Gallon 11/7/2012
  Found solution to not autoclosing in WinXP in this forum thread. Many Thanks go to 'Serenity' for sharing his/her solution.
  http://www.autohotkey.com/community/viewtopic.php?t=35438
  Program should now actively close the M2Emulator cmd window in all Windows OS correctly now :)

V0.6 - Updated by Mark 'Ramjet' Gallon 10/7/2012
  Changed how RamjetM2Borderless detects and close's the M2emulator cmd window that is opened when the game ROM launches it. Previously used a Postmessage to close a
  particular cmd window (which was kinda cool and tricky), but may have had problems on WinXP? Took it back to basics and used WinWait to check for the cmd window and
  WinClose to close down the cmd window. Worked on my WinXP and Win7 machines. Visit the forum above to comment and give feedback.
 
V0.5 - Updated by Mark 'Ramjet' Gallon 6/7/2012
  Added LUA scripts to Autolaunch RamjetM2Borderless for all shooting games.
  Automated the cmd window closure from M2 Emulators LUA script which launched this program automatically.
  Automated the exit of this app when M2 Emulator is no longer running.
  Added right-click to the taskbar icons for an Exit and About information.
  General clean up of old test code which had become distracting.
     

V0.4 - Updated by Mark 'Ramjet' Gallon 3/7/2012
  Added support for Behind Enemy Lines with icon in tasktray

V0.3 - Updated By Mark 'Ramjet' Gallon 1/7/2012
  Since I didn't do a ReadMe for the first test program... here is the total changelog
  Code and test borderless concept - Working!
  Added more game support (see top of txt) with auto detection
  Created Icons for the task bar on game detect (for fun)
  Wrote this ReadMe.txt


Whats left to do;

Maximise/Window Detection to work correctly... I'll explain, I'm trying to detect when the game is full screen to remove border's and reapply them when back in a window mode
But it appears that the Model 2 Emulator doesn't set this flag correctly and hence it won't detect the transition from window to fullscreen. Working on that.... For now it
will remove the borders from the window with the active title bar that matches the name of the game and keeps them gone for as long as the progam is running.

Working on making sure that the correct window has it's borders removed... if you accidently remove the border from something (see bug below) alt-f4 and re-open it.

Known bug
---------

**** Update : The bug below may only occur if you've manually launched the program and it's running whilst your doing other things with your PC. If the program is launched by
M2Emulator as it should be with the scripts, then the active window should only be the emulator and exited automatically. The occurance of the below mentioned bug should be all
but practically eliminated. ****

It will sometimes detect a window with the same title as the game as being the game running. ie watch a youtube video of "Virtua Cop" and internet explorer changes its
title to that name and tricks my program into thinking it's running and removes the title bar. Took me ages to figure out why it was doing that! Turned out I was
watching a youtube video whilst writing the code. Anyway, it's a feature... not a fault :) And not a bloody thing I can do to stop it... and it should restore itself when the
program is Alt-F4'd (windows shortcut for close) and restarted. Don't panic, it's not the end of the world.


Thanks
------

Big Thanks go out to elsemi and all who've worked so hard to bring Model 2 Memories to the home. The Model 2 Emulator is the inspiration to all of us to create and develope and
restore the fond memories of a gaming era past.

Thankyou!

Ramjet :D

Big thanks to DarthMarino, ABACABB and Shun for helping me test it and giving feedback.

DarthMarino was ever so helpful in shooting and posting his video working on an early version of the program for your viewing pleasure.
 


Please try out this app if your a shooter fan and love Model 2 games, I'd love to hear your feedback and comments or even just a simple thanks :)

If you feel like posting a video of your setup running full screen with this app below, I'd really appreciate seeing real results on real cabinets as I'm yet to buy my own set of guns and looking into who has the best experience with their gun solution.

So now that Model 2 Emulator work with your gun, there's no excuse not to play :)

Have a Great Day! and enjoy my app...
:D
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

Wade007

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 309
  • Last login:April 06, 2017, 01:33:35 pm
  • A MAME cabinet at home is heaven
    • bit.ly/1cWnoIC
    • Cheapskategamer.com
Very cool. Thanks so much. This is perfect timing. I'm just now gearing up to set up my lightgun games on all emulators including M2.

I downloaded your program and will give it a go.
Once I figure out how to install it (Read Me file right?) I'll post a comment on my results!!

Thanks again!!
My Super Arcade cabinet project:
Software blog article: http://bit.ly/1cWnoIC

Hardware blog article: http://bit.ly/1dWxjvP

YouTube video: http://bit.ly/1N818Xm

Super Arcade Cabinet Progress thread (Now Complete):
http://forum.arcadecontrols.com/index.php/topic,123292.0.html

Frontend Video Intro: http://bit.ly/1P9HPDN

Wade007

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 309
  • Last login:April 06, 2017, 01:33:35 pm
  • A MAME cabinet at home is heaven
    • bit.ly/1cWnoIC
    • Cheapskategamer.com
RamjetR,
Thanks again for the program. I have yet to hook my light guns back up to my cabinet CPU so I can't test out your program fully.

I will be using Arcade Guns. This was my review:
(http://www.cheapskategamer.com/pc_game_stories_and_news/true-light-gun-support-for-pc-gaming-the-arcade-guns%E2%84%A2-product-review/)

I wanted to post here to triple check that I installed your program correctly. Very excited to make sure it works!!!

I read the README file and unzipped the contents of the downloaded zip file into my root directory of Sega Model 2.
Therefore... in the same directory that holds my 'emulator_multicpu.exe' and 'emulator.exe', there is now a folder called "RamjetM2Borderless_V0.7".

Is that it???  ???

Do I need to copy and paste the .lua scripts (bel.lua, gunblade.lua, hotd.lua, rchase2.lua, vcop.lua, vcop2.lua) into the existing "scripts" folder of  M2? Or do they stay inside the RamJetM2Borderless_V0.7" scripts folder as they stand?

Please advise.

Thanks.

[EDIT]
OK, After reading through this thread I figured it out.
http://forum.arcadecontrols.com/index.php?topic=104484.40

I think I figured out how to install the program. You unzip the downloaded zipped file. All the contents inside the UNZIPPED folder go into the root directory of the M2 emulator except for the scripts. All the new .lua scripts in the newly unzipped "Scripts" folder are to be copied in the existing "Scripts" folder of the M2 emulator in the same directory. Uh...maybe update your README??

Sorry for being such a noob, but honestly it wasn't real clear in the README file. Especially for someone that isn't super familiar with how M2 works.

Now...after having gotten the program to work, I say "Brilliant Job RamjetR!!" I only tested using the default mouse-controlled reticule on the supported lightgun games, but it seemed to work great. And the program closed along with M2. Excellent!! Feels seamless.

As stated above, I have 2 Aim Trak based light guns from Arcade Guns.com. I will soon be hooking them up and running them through all the emulators I have loaded that support any lightgun games (MAME, M2, Supermodel 3, Demul, PC Ports). I'm very excited to use your program with M2. It definitely adds some solid functionality to the M2 emulator. Please...please keep me (us) updated here if there is a new updated release to your program. Excellent work!! Now if only we could get two lights guns to work at the same time (2 players) in M2.
« Last Edit: July 18, 2012, 01:31:39 am by Wade007 »
My Super Arcade cabinet project:
Software blog article: http://bit.ly/1cWnoIC

Hardware blog article: http://bit.ly/1dWxjvP

YouTube video: http://bit.ly/1N818Xm

Super Arcade Cabinet Progress thread (Now Complete):
http://forum.arcadecontrols.com/index.php/topic,123292.0.html

Frontend Video Intro: http://bit.ly/1P9HPDN

Aceisback

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 53
  • Last login:February 04, 2021, 07:45:41 pm
  • I want to build my own arcade controls!
I have been trying to get this fix working, but the borderless app does not load when I load a rom in M2. I have the app and ico files in the same directory as the M2 emulator exe files, and the lua files are in the scripts folder of the M2 directory. When I launch the emulator, the borderless exe is not executing. I can manually start the borderless exe file and then launch the M2 emulator and all is working. The borderless app even exits when I exit the M2 emulator. I am testing on Vista using the M2 ver 0.9 (can't get 1.0 to work, keeps crashing when I load a rom). I assume the scripts are working since the borderless app exits when I exit the emulator. I will be trying with a Win7 system soon, so not sure if it is Vista or an issue with the M2 emulator and script.

Any idea's? Hope this all makes sense.
Thanks!
Duane

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 #4 on: September 04, 2012, 08:30:01 pm »
Hi, sorry for the late reply... I went in for surgery a couple weeks ago and been laying low recovering for a while... anyhow, to answer your question.

I haven't tried V0.9 since V1.0 of the emulator is running fine. My only suggestion is that in V0.9, the LUA script isn't being ran when the game is launched because LUA wasn't supported in V0.9 of the emulator. Hence the reason why it's not running.

Like you say, the borderless program can be launched manually and it will work on V0.9, but if you want it automatic start with the emulator (for use in a front end say) then you'll need V1.0 of the Model 2 Emulator.

I've never had any issue with the V1.0 of the emulator however? Some people report it crashes like crazy, but it's been rock solid for me and I run it on everything from a i7 920 with a ATI 5870 to a Core Duo with Nvidia 9600GT laptop...

So to sum it up.... V0.9 of the Emulator doesn't support the LUA scripts.... V1.0 does and will run the borderless program on ROM start. If you need to stick with V0.9 then you'll have to run the borderless program first. Just the way it works I'm afraid :)

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

mike boss

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2645
  • Last login:October 22, 2021, 01:19:45 pm
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #5 on: September 05, 2012, 07:31:00 am »
I'm in the process of completing my latest MAME PC.
I'm looking forward to giving this a shot.
I know people say great things about Model 2.
If I have the older version of Model 2 can I simply just drop in the newer version over top ?
(IE - dump the files into my existing folder replacing them ?)
I plan on using this with MaLa , I hope that isn't an issue.

Great work.

Thanks for sharing with us.
« Last Edit: September 05, 2012, 08:53:36 am by mike boss »

mike boss

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2645
  • Last login:October 22, 2021, 01:19:45 pm
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #6 on: September 05, 2012, 06:06:29 pm »
Don't have my guns installed (yet), however I did DL and install the program.
I see the icons near my clock so I guess its working the way it should !
Awesome stuff.

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 #7 on: September 05, 2012, 10:22:18 pm »
Hi Mike,

yes you should be able to extract Model 2 emulator V1.0 over the top of previous versions...

My program will just extract into the root folder of your emulator and automatically should put everything in the right sub folders for you.

If you see a little white Sega Logo in the taskbar then the Borderless program is running and just waiting for a Shooter ROM to be loaded. Running a ROM in windowed mode you'll see the ICON change to match the ROM loaded. Otherwise if your in full screen, you'll probably never notice that happening.

I hope to see some youtube footage of your setup running nicely with my app :)

Note I'm still working (albeit slowely) on integrating Dual lightgun support into Model 2. But recently undergone surgery so, that may be a little longer than I hoped for...

Single Guns work great though now. :)
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

nipsmg

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1738
  • Last login:Today at 04:23:31 pm
  • ROONEY!! ERRGH!!
    • Arcadia
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #8 on: September 05, 2012, 11:50:37 pm »
RamjetR,

Thanks for the work you've been doing on this.  I've been following it closely.  Get your rest and recover.  Dual lightguns in M2 would be epic.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:Today at 05:29:33 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #9 on: September 06, 2012, 12:53:20 am »
Good work as always. 

Now that I've had a chance to look into lua scripting a little more I think we should be able to add mame-style outputs to model 2, although I'm not familiar enough with lua's functions to do specific code.  The outputs should be in "IOBASE" and I've already hooked up some of them in mame, so we should just be able to pull the values from there. 

If os.execute is in there, I'm sure postmessage and copydata are in there as well, which is all that is needed.  If not we can use mamehooker's command line/dde support to pump the messages through. 

I noticed in the docs that lua supports polling the joystick.  If it can poll analog values then the script I'm currently working on for dual wii lightguns in mame can be modified to support model 2. 

Just some things to think about.... feel better.

mike boss

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2645
  • Last login:October 22, 2021, 01:19:45 pm
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #10 on: September 06, 2012, 07:30:21 am »
@ RamjetR

I DL'd the newer version of Model2 and simply replaced the contents of the folder with the new files. That all went perfect !

I wasn't able to DL your files from the above link (as a zip), but I did DL the indivual files.
Put the scripts in the scripts folder and the rest I simply left in the Model 2 folder.
I think that is correct ?

Either way, I launched a game from MaLa then minimized it to see the icon in the taskbar.

Now I just need to get my Aim Traks into my GunCon2 shells and really rock N roll !
I can't wait til the dual gun support comes out, that will be awesome.


Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:Today at 05:29:33 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #11 on: September 06, 2012, 09:30:58 am »
I thought I would dig up my notes (as well as the notes in mame) to see what I had on model 2 outputs.

They are generally in the range of 0x01c00008 - 0x01c0000b, with those three bytes being more than enough for bit-wize control.

Here are the ones that are specifically documented, but in general the address of the start lamps is universal and if the game has gun outputs, the solenoid follows right after:

--------------------------------------------------------------------------------------------
0x01c00008 - 0x01c0000b=Rail Chase 2 Outputs
==============================
0x00040000 = Start 1 lamp
0x00080000 = Start 2 lamp



0x01c00008 - 0x01c0000b = Sega Rally C outputs
==============================================
0x00040000 = Start 1 lamp
0x00200000 = vr lamp
0x00800000 = leader lamp
---------------------------------------------------------------------------------------------------

I'm going to try to find the outputs for gunblade and railchase because they are the easiest.  I know you've used memory tricks to simulate outputs for some of the racing games, but those are probably in there as well, it just might take a bit of data manipulation.

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 #12 on: September 06, 2012, 05:28:38 pm »
When me and ramjetr were looking through the emus memory we found some consistent activity when cycling lamps in the test menu but the same address was silent in game on all the racing games at least.

Never tried gunblade but it seems possible it's actually there for that game. Lamp data may not be exposed but a solenoid output may be in the same address as ffb which is.

I'd be mega interested to see what you find, especially since a gunblade related project is something I'll be looking at soon.
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:Today at 05:29:33 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #13 on: September 06, 2012, 08:10:54 pm »
I've just started looking (spent about 20 min on it this morning) but thus far the outputs aren't where they are supposed to be, at least not in m2emulator they aren't.  If you can give me the addresses where you found activity then it would give me a starting point to work on it. 

In mame there's some psuedo encryption going on with model 2's i/o system.  The reason it isn't working in game is probably because sometimes you have to write a specific value when reading a specific value.  I think you can do that via lua, but I'm not sure.

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 #14 on: September 07, 2012, 06:08:13 am »
I wouldnt have expected that.

Lua can be locked down to various degrees (for commercial games for example to prevent cheating) but I'm fairly sure Elsemi left it wide open for m2emu so I think you can write to memory also.

I'll dig out the address if I still have a note of it. It was a while ago and I've had a hdd fall over since then. If I don't then ramjetr probably does.
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:Today at 05:29:33 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #15 on: September 07, 2012, 08:15:16 am »
Well encryption is probably the wrong term.  I was just really tired when I posted that and I couldn't get my words out.  It's more like there is a missing driver board.  It's useless for our purposes, but the game waits for it to respond after sending data.  If there isn't a response then it stops sending data. 

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 #16 on: September 07, 2012, 08:23:38 am »
That's odd if ffb works. Doesnt m2emu require a drive board rom? It must be implimented somehow. I know the lamps on m2 are handled by an IC on the CPU board though not the drive board. It's as far as I know a general purpose I/O IC labeled 315-5649.

I would assume it'd probably handle solenoid outputs also via a solid state relay. Gunblade doesn't send out a signal for each "jolt" though, just a continuous on signal since the gun has a motor that just goes round and round rather than a solenoid. Just like alien 3.
« Last Edit: September 07, 2012, 08:28:35 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:Today at 05:29:33 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #17 on: September 07, 2012, 08:38:46 am »
Afaik it's not a full-fledged driver board (that as you said is a gp ic) but it's some "stuff" on the physical end of the game.  Like at the motors and ect....  I'm in no way certain though, I'm just guessing based on my other mis-adventures in hooking up terribly designed sega hardware.  ;)

I'm not referring to gunblade and the like, rather the racing games.  It is possible that the lamps would fail if there is a generic i/o error though.  Also sega is terrible about shifting the addresses.  The address for the outputs in deluxe cabinet mode might not be in the same location as they are in standard cabinet mode.  I know afterburner did that and it drove me crazy.

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 #18 on: September 07, 2012, 08:38:41 pm »
Hi all :)

The memory addresses for all output/game conditions of all the games my VR program supports is available if you want them.

The IO PCB isn't emulated in the Sega Model 2 Emulator at all, or atleast if it is, it's not made accessible to users. I used CheatEngine and ArtMoney to find practically everything running in memory that is accessible to do with speed, acceleration, angle, steering, g-forces (which I assume the FFB is ran from by the emulator) etc.

From there I also gathered a mass of gamestate memory locations (which if not published took hours if not days of testing to discover reliably).

My output emulator VR thingy works but recreating the logical conditions from the ingame conditions that would normally be used to determine the outputs.

For example, I'd say;

If gamestate = 22 (ingame) and VRView = Yellow
Then enable output XX on PacDrive X etc etc

So essentially I monitored Hex code as it was running and reverse engineered what the game was doing to write a software equivalent of the IO PCB would have to do. It's all external to the emulator. And although I haven't done much to it for a month or so. It's pretty close to the real thing.

Monitoring the memory locations of the Service menu LAMP/Output test worked only when in service mode, and the locations it writes to in the emulator is met with a null location when monitored with CheatEngine or ArtMoney.

LUA does have OS.Execute, but using PostMessages is dependent on the version of LUA that was embedded. I've really found a lack of documentation of users writing Postmessages in LUA as most sample code online is for hacking WOW. The only reference I found to PostMessage in LUA was for a version of Girder, and at that time wasn't implemented into LUA.

I was meaning to contact you Howard in regards to getting AHK postmessages outputting to your Mamehooker correctly. Maybe a little co-dev here might speed things up a little and I'm learning higher level programming languages purely by having a go. I'm normally an assembly language programmer for microprocessors which is why I'm able to reverse engineer the Model 2 easier than writing the Windows equivalent higher language.

On a side note, yesterday I wrote a driver component to allow any AHK script to control and use those cheap LED name tags you get from novelty stores. I have mine at the moment updating Insert Coin/Credit/Running ROM information and planning to release a little utility to allow people to buy a $10 LED Name Tag and stick it on their cabinets for cool stuff... It's kinda funky.

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

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 #19 on: September 07, 2012, 08:51:42 pm »
I wouldnt have expected that.

Lua can be locked down to various degrees (for commercial games for example to prevent cheating) but I'm fairly sure Elsemi left it wide open for m2emu so I think you can write to memory also.

I'll dig out the address if I still have a note of it. It was a while ago and I've had a hdd fall over since then. If I don't then ramjetr probably does.

For Dual lightguns,

You can write to memory. However, you don't really need LUA internally to do that. The Memory locations for position are stored locally in RAM as the Mice are read. The good news is that this can be externally injected into the memory of M2 emulator since there isn't any anti-cheating code of any kind.

This means that by writing an X/Y positioning location information directly into the memory location of M2, you should be able to take ANY pointing device from windows and just inject the X/Y locations into the game and map a trigger button.

If anyone would like to give me a hand on doing this and I'm being held up with windows programming and accessing HID devices (still learning) ... :)

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

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:Today at 05:29:33 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #20 on: September 07, 2012, 09:00:39 pm »
Yeah we'll work on it.  What you've done is most impressive btw.... I've been following it, I've just been too busy to contribute.

I've been meaning to write an external dll that does the server-end of mame interop anyway.  Basically you would add it to any project and you would have the "SetOutputState" function that mame uses, which is ridiculously easy to use in code. 

My dll writing skills are virtually non-existant due to my preference to vb though (vb doesn't really do dlls) so it might take a while. 

I think unfortunately what Model2 is doing is over-writing the bytes that the outputs use.  They are inbetween the inputs, and also control other game functions, so the sloppy way to handle inputs is to just overwrite the whole area, which would kill the outputs.  I've also noticed other oddball stuff that the emulator does... like the proper i/o address for the guns x/y position as well as the trigger status is never accurate.  This leads me to believe that he simply bypassed the proper i/o position and just wrote directly to ram. 

I'm still interested in the addresses that you found actual lamp activity though.... I might be able to do some writes (which are apparently absent) in the io address which would jump start the outputs. 


Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:Today at 05:29:33 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #21 on: September 07, 2012, 09:08:54 pm »
For Dual lightguns,

You can write to memory. However, you don't really need LUA internally to do that. The Memory locations for position are stored locally in RAM as the Mice are read. The good news is that this can be externally injected into the memory of M2 emulator since there isn't any anti-cheating code of any kind.

This means that by writing an X/Y positioning location information directly into the memory location of M2, you should be able to take ANY pointing device from windows and just inject the X/Y locations into the game and map a trigger button.

If anyone would like to give me a hand on doing this and I'm being held up with windows programming and accessing HID devices (still learning) ... :)

Ramjet

Memory manipulation is fairly easy..... doing it without crashing things is the trick. ;)

I haven't used it much because for most applications, that borders on cracking and I like to do things in a cleaner way, but I can even do that stuff with vb.  I've already got tons of directinput code in my projects and one or two memory manipulation programs.  Just as a proof of concept, I can whip something up.... I just need the memory locations and the value format. 

If I wrote a simple program that allowed you to either map the x/y values to joystick axis or adjust them via keyboard keys that would probably be more than enough.  I can't think of anything that doesn't either show up as a joystick or keyboard aside from mice, which it already supports. 

**edit**  I've been meaning to do this anyway.  Via glovepie multiple wiimotes can pretty much only manipulate joysticks in vista/win 7 due to stupid secuirty additions.  So I was thinking of re-writing the "troubleshooter" for the old act-labs guns, only allow it to use joystick values as well.  There's an ini included with that app that has the memory addresses of pretty much all PC lightgun games.  Adding similar support for emulators would also be possible.
« Last Edit: September 07, 2012, 09:12:59 pm by Howard_Casto »

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:Today at 05:29:33 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #22 on: September 08, 2012, 11:30:12 am »
Since you haven't replied yet, I thought I would give it a go. 

Tried out that ArtMoney program you mentioned.... I like it a lot better than the memory stuff I normally use... very quick!

Finding the gun axes took all of 20 min.

All values are a single byte:

P1 X Axis (0-255) =  0058f7b4
P1 Y Axis (255-0 Inverted) = 0058f7b6

P2 X Axis (0-255) = 0058f7b5
P2 Y Axis (255-0 Inverted) = 0058f7b7

I haven't tried this on every game yet, but I tried it on gunblade and hotd and they used different guns so it should be universal.
I couldn't find the trigger values, probably because they aren't all hacked up like the cross hair is, but it doesn't matter because model 2 uses P1 Button 1 and P2 Button 1 as triggers also, and they are redefinable in the emulator settings. 

When I get a chance I'll work on making a proof of concept app that'll edit these locations.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:Today at 05:29:33 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #23 on: September 08, 2012, 12:56:29 pm »
I successfully wrote a little test app that injects the memory values into model 2 for dual guns.

It works but I worry about performance on lesser systems.  Model2 constantly hammers the values with the mouse data, so likewise I have to constantly re-write them in an infinate loop.  It takes up about 25% of my processor on my system and I'm running a quad. 

It might be possible to hook these addresses, but I haven't looked into it yet.  Hooking is always dangerous in terms of crashes, so I'd like to avoid it. 

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 #24 on: September 08, 2012, 01:03:56 pm »
I successfully wrote a little test app that injects the memory values into model 2 for dual guns.

It works but I worry about performance on lesser systems.  Model2 constantly hammers the values with the mouse data, so likewise I have to constantly re-write them in an infinate loop.  It takes up about 25% of my processor on my system and I'm running a quad. 

It might be possible to hook these addresses, but I haven't looked into it yet.  Hooking is always dangerous in terms of crashes, so I'd like to avoid it.

Any chance you'll make a version for the old act labs CRT guns that only writes values once each trigger pull?

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:Today at 05:29:33 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #25 on: September 08, 2012, 01:19:04 pm »
Probably, but you'd have to explain a bit more what you are talking about.

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 #26 on: September 08, 2012, 01:32:37 pm »
Probably, but you'd have to explain a bit more what you are talking about.

The old "true" light guns don't need to have mouse data constantly written because they only give their location when the trigger is pulled anyway.
The location just stays the same until the trigger is pulled again.
So an app specifically for them wouldn't need to put as much of an extra load on the processor.

I don't know how many people are still using the old CRT guns, but I still have them on my main setup.




Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:Today at 05:29:33 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #27 on: September 08, 2012, 02:07:07 pm »
Probably, but you'd have to explain a bit more what you are talking about.

The old "true" light guns don't need to have mouse data constantly written because they only give their location when the trigger is pulled anyway.
The location just stays the same until the trigger is pulled again.
So an app specifically for them wouldn't need to put as much of an extra load on the processor.

I don't know how many people are still using the old CRT guns, but I still have them on my main setup.

If I go a passive (non hooking) route then it would depend upon the game.  M2, as I've just mentioned constantly re-writes the cursor position... i'm sure many others do it that way as well.

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 #28 on: September 08, 2012, 06:25:06 pm »
Heya,

sorry I didn't reply... Girlfriends Dad's 60th Birthday party... you know how it goes... "Put down that laptop and come and enjoy the party, your being rude!" .... so... yknow.

I've been rewriting the memory locations manually like you howard, but it doesn't update the cursors crosshair for me. Has that been a problem for you?

Badmouth is right to some degree that for most shooters, VCOP HOTD etc.... if you have a well calibrated gun (and service menu calibrated for 4:3 since widescreen calibration will offset a non stretched gamescreen cursor) the using the X/Y position on Trigger will work nicely.  However, Gunblade and others which are more "Joystick" crosshair type guns, then aligning a crosshair will be important.

How did you go with the offsets for you memory locations when you restart the emulator? I had trouble externally reconfiguring each time it launches which is why I was doing most of testing with LUA internally.

Girlfriend is having people over for lunch/dinner today so I'll be pretty much unable to do anything this weekend (This year has been super crazy busy... I reckon I've only had a couple weekends to myself all year!).

Will get my ArtMoney tables zipped up for you and send you a link. They're pretty much all you need for the major Racing titles.


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:Today at 05:29:33 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #29 on: September 08, 2012, 06:58:44 pm »
Well which one are you talking about?  If you are talking about the fake one that the m2emulator uses no, it doesn't update that one.  But the one internal to the actual game updates, although it's a tad flickery because the position is constantly toggled back to the mouse pos via m2.  It's done inbetween frames, so your shots aren't off, but the flicker is bad.

In regards to the memory location, it's stored in two places... where the emulator reads it, which isn't static and where the game itself reads it, which is.  The values I posted above are the static ones... they should be the same every time you launch the emulator.  Or at least they are for me.   

The lua interface hasn't been particularly helpful for me... I think it's more locked out then we guessed because I can read some values via artmoney and they come up as an unchanging value via lua.  Same goes for writing.  It could be my inability to use the language properly though.  It would make a whole lot more sense to do it via lua as they could be injected at the start of the frame and hopefully the mouse wouldn't screw things up.

I've actually had much better luck with the joystick based games.  They use a simple 0-255, one byte value, so I can manipulate them easily.  I need to find the trigger byte though because apparently the second trigger for a lot of the games was never hooked up!  He's just using a straight hack to the mouse.

The true lightgun games are going to be a tad trickier.  They use a two byte positional value, which is OK, but there are all of these wierd offsets to contend with. 

Can model 2 save settings?  Because it would be a whole heck of a lot easier to go into the service menu, set the min/max values to something sensible and be done with it.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:Today at 05:29:33 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #30 on: September 08, 2012, 10:54:26 pm »
Somewhat related.... I pulled out the ini file for the old Troubleshooter application.   I plugged in the values that it had written down for house of the dead 3 and I could inject and manipulate them just fine!  So I'll go ahead and make a rudimentary troubleshooter replacement once I get time.  One that supports joysticks and keyboard keys as well as mice.  This is just something that's needed in this day and age as you can't manipulate multiple mice in windows anymore. 

I'll make it use the ini system and keep out any hardcoded values.  This way once we get further along with model 2 hacking it would simply take a few ini entries to support them. 

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 #31 on: September 09, 2012, 06:30:54 pm »
I've never used Troubleshooter, probably because I still don't have any lightguns... I really must pick a couple up because it'll make it so much easier to test than to battle putting together a working dual wiimote connection.

So is troubleshooter externally configurable for just injecting into memory of other programs? I thought the games were hardcoded in the utility but that said, I haven't looked hard into troubleshooter. That would be a more suitable fix wouldn't it?

The memory locations I find with ArtMoney (especially in the racing roms) have static memory locations in the emulated ROM RAM. But the location changes when reading/writing externally to the emulator.exe. Which is the emulator.exe +(offset)... but for the life of me I couldn't get a readprocessmemory function of AHK to work. Which is why I'm doing an IO file write for my current version of the RamjetVR program.

I should add you on skype and have a chat about it sometime? 

LUA reading and writing is a bit tricky, especially when it comes to number formats other than word and Dword bytes. I can find some values for RPM, angle and other things like that which are a Float number format, but the LUA which is embedded into Model 2 Emulator doesn't seem to want to read float values correctly.

Model 2 will save it's service menu settings just fine,  a recalibration of whatever max/min values that are being injected is going to be needed regardless. On a side note, I did manage to get dual wiimote lightguns working with model 2 some time ago with PPJoy and joystick settings. It worked nicely, but for some reason I didn't write down what I'd done and have failed to replicate it. But I do know I was required to set the controls in the emulator to the joystick in the config.

I'll spend some time looking into the memory locations this week. If you want to share your artmoney table so that we're not doubling up on work that'd be great... I'll send you a PM.

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

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:Today at 05:29:33 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #32 on: September 09, 2012, 11:57:33 pm »
I've never used Troubleshooter, probably because I still don't have any lightguns... I really must pick a couple up because it'll make it so much easier to test than to battle putting together a working dual wiimote connection.

So is troubleshooter externally configurable for just injecting into memory of other programs? I thought the games were hardcoded in the utility but that said, I haven't looked hard into troubleshooter. That would be a more suitable fix wouldn't it?

The memory locations I find with ArtMoney (especially in the racing roms) have static memory locations in the emulated ROM RAM. But the location changes when reading/writing externally to the emulator.exe. Which is the emulator.exe +(offset)... but for the life of me I couldn't get a readprocessmemory function of AHK to work. Which is why I'm doing an IO file write for my current version of the RamjetVR program.

I should add you on skype and have a chat about it sometime? 

LUA reading and writing is a bit tricky, especially when it comes to number formats other than word and Dword bytes. I can find some values for RPM, angle and other things like that which are a Float number format, but the LUA which is embedded into Model 2 Emulator doesn't seem to want to read float values correctly.

Model 2 will save it's service menu settings just fine,  a recalibration of whatever max/min values that are being injected is going to be needed regardless. On a side note, I did manage to get dual wiimote lightguns working with model 2 some time ago with PPJoy and joystick settings. It worked nicely, but for some reason I didn't write down what I'd done and have failed to replicate it. But I do know I was required to set the controls in the emulator to the joystick in the config.

I'll spend some time looking into the memory locations this week. If you want to share your artmoney table so that we're not doubling up on work that'd be great... I'll send you a PM.

Ramjet

Well troubleshooter was hardcoded AND configurable....  I'm not sure why he went to all the trouble of making up nice ini file if he was going to hardcode the gamelist, but oh well... we've got the memory locations and offsets for every pc lightgun game, so I can't complain.  Basically troubleshooter was created to fix pc games because never supported dual mice and various other issues.  You would get the game's controls to the keyboard (so the mouse wouldn't move things around) and it would inject the positional values into the games. 

The only problem was it was hardcoded to only support act-labs guns (the only ones out at the time) and only pointing devices that report an absolute position.  Also strangely enough on a few games that use the system mouse for the menu, like hotd3, he didn't hook the mouse, so you couldn't navigate menus properly. 

So if you are using a joystick-based lightgun, are using dual trackballs, or have a guncon, it didn't help you much. 


I doubt ahk scripts are going to work in this instance.  AHK is pretty powerful, but you are probably going to have issues with memory manipulation.  I know in other languages you can hook the pid of the exe and get your main offset that way.  That's how I'm doing it. 

I don't have skype unfortunately.  All kinds of IM services though. 

Dual joysticks would probably work on the pos-gun games, but I doubt that trick would work on the true lightgun games...... I'll give it a shot though.

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 #33 on: September 11, 2012, 02:45:17 am »
Finally found 20mins to sit down with artmoney and look at VCOP

Found the same axis as you did, (need to grab another mouse to check P2) but also found the Reload for P1 @ 0x501698 = 00 - > 01= Reload P1, 02= Reload P2, 03= Both players Reloading
Also found the Start Button flashing outputs @ 0x50169C. 2 bytes = 12= P1 + P2 Start Flash, 08 = P2 Flashing, 04 = P1 Flashing, 00 for both players in game. So there is an output ppl can hook up.

P1 Axis has an input and output addresses... looks like it works the same as the other games where there is an input address range and the game makes copies in other area's of RAM as it's being used to update and be manipulated by the ROM.

Updating the source address will also update the others correctly, needing only one location to change.

Packing up to go home from work now... if I don't get distracted with the new BF3 DLC tonight, I may spend a little more time on it.

I'll forward you my Artmoney table tomorrow once it's a little more populated.

Ramjet
« Last Edit: September 11, 2012, 02:50:23 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: 19399
  • Last login:Today at 05:29:33 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #34 on: September 11, 2012, 09:48:54 am »
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. 

We might have better luck in lua, I dunno. 

*update*

Hmm they do work within lua though. 

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.
« Last Edit: September 11, 2012, 10:00:50 am by Howard_Casto »

theonegoku

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 25
  • Last login:August 03, 2014, 09:59:42 pm
  • I want to build my own arcade controls!
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #35 on: September 11, 2012, 10:11:03 am »
I've never used Troubleshooter, probably because I still don't have any lightguns... I really must pick a couple up because it'll make it so much easier to test than to battle putting together a working dual wiimote connection.

So is troubleshooter externally configurable for just injecting into memory of other programs? I thought the games were hardcoded in the utility but that said, I haven't looked hard into troubleshooter. That would be a more suitable fix wouldn't it?

The memory locations I find with ArtMoney (especially in the racing roms) have static memory locations in the emulated ROM RAM. But the location changes when reading/writing externally to the emulator.exe. Which is the emulator.exe +(offset)... but for the life of me I couldn't get a readprocessmemory function of AHK to work. Which is why I'm doing an IO file write for my current version of the RamjetVR program.

I should add you on skype and have a chat about it sometime? 

LUA reading and writing is a bit tricky, especially when it comes to number formats other than word and Dword bytes. I can find some values for RPM, angle and other things like that which are a Float number format, but the LUA which is embedded into Model 2 Emulator doesn't seem to want to read float values correctly.

Model 2 will save it's service menu settings just fine,  a recalibration of whatever max/min values that are being injected is going to be needed regardless. On a side note, I did manage to get dual wiimote lightguns working with model 2 some time ago with PPJoy and joystick settings. It worked nicely, but for some reason I didn't write down what I'd done and have failed to replicate it. But I do know I was required to set the controls in the emulator to the joystick in the config.

I'll spend some time looking into the memory locations this week. If you want to share your artmoney table so that we're not doubling up on work that'd be great... I'll send you a PM.

Ramjet

Well troubleshooter was hardcoded AND configurable....  I'm not sure why he went to all the trouble of making up nice ini file if he was going to hardcode the gamelist, but oh well... we've got the memory locations and offsets for every pc lightgun game, so I can't complain.  Basically troubleshooter was created to fix pc games because never supported dual mice and various other issues.  You would get the game's controls to the keyboard (so the mouse wouldn't move things around) and it would inject the positional values into the games. 

The only problem was it was hardcoded to only support act-labs guns (the only ones out at the time) and only pointing devices that report an absolute position.  Also strangely enough on a few games that use the system mouse for the menu, like hotd3, he didn't hook the mouse, so you couldn't navigate menus properly. 

So if you are using a joystick-based lightgun, are using dual trackballs, or have a guncon, it didn't help you much. 


I doubt ahk scripts are going to work in this instance.  AHK is pretty powerful, but you are probably going to have issues with memory manipulation.  I know in other languages you can hook the pid of the exe and get your main offset that way.  That's how I'm doing it. 

I don't have skype unfortunately.  All kinds of IM services though. 

Dual joysticks would probably work on the pos-gun games, but I doubt that trick would work on the true lightgun games...... I'll give it a shot though.

Are you referring to the first version of Troubleshooter when it first came out? or the current version.  On the current version it does have some problems, stemming from the fact that you have to set your lightguns to "keyboard" instead of "mouse or lightgun" in games like HOTD3, like having to choose what path u want to take and pressing enter on the keyboard instead with the trigger.  But aside from that, I am able to navigate the menu screens with the mouse/lightgun with no problem.  I know it was made for act labs but it works just fine with other lightguns I have tried.  I am currently at work, but have a pic on my facebook of me using it with my new EMS Topgun 3 that I can attach real quick.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:Today at 05:29:33 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #36 on: September 11, 2012, 11:16:29 am »
Some of the lightguns out there behave like the actlabs guns and they work, others do not. 

Yeah that's what I'm talking about in hotd3... there's no reason to do it that way.  I've found that in most games you can easily manipulate the system mouse.  So the best way to do it imho would be to have the user set p1 to use the mouse and have the troubleshooter read the raw mouse values and inject them.  It won't work for every game, but it should work for hotd3. 

theonegoku

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 25
  • Last login:August 03, 2014, 09:59:42 pm
  • I want to build my own arcade controls!
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #37 on: September 11, 2012, 11:24:02 am »
Some of the lightguns out there behave like the actlabs guns and they work, others do not. 

Yeah that's what I'm talking about in hotd3... there's no reason to do it that way.  I've found that in most games you can easily manipulate the system mouse.  So the best way to do it imho would be to have the user set p1 to use the mouse and have the troubleshooter read the raw mouse values and inject them.  It won't work for every game, but it should work for hotd3.

Definitly agree, but luckily when its all in the cab, the cp will be right in front of me to simply hit the button, but when its on the keyboard it gets tedious for sure.  But anything is better than watching the crosshair jump around constantly until the trigger is pulled ;)

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:Today at 05:29:33 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #38 on: September 11, 2012, 02:44:26 pm »
Found another set of outputs.... these are external (artmoney) addresses though.  This might be why some of the games (daytona ect..) don't have accessable outputs.  I looked up the accessable addresses in model2 via the ramptr function and this address is over 0x100000 bytes below the lowest addressable section. 

0x559CA4 is the lamp outputs for HOTD

This address also seems to be the output address for gunblade, as well as the gun recoil, but it uses slightly different bit-shifting, so I'll have to figure out the individual outputs.

***Edit****

Looks like typical  SEGA bit-shifting.

So (as viewed as an integer and NOT a bit mask):

output 1 = +4
output 2 = +8
output 3 = +16
output 4 = +32
output 5 = +64
output 6 = +128

As a BitMask it looks like this

00123456

With the number representing the output number


This is pretty standard sega stuff... it just looks like the addresses were hidden from the lua scripting.
For some reason sega always ignores the first two bits (int +1 and int +2)
« Last Edit: September 11, 2012, 02:51:22 pm by Howard_Casto »

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:Today at 05:29:33 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #39 on: September 11, 2012, 02:59:59 pm »
Looks like VCOP2 uses the same address as well.... it would have been hard to find though because for whatever reason bits 1 and 2 are always set on that game, so you subtract three to the integer values

I hate to keep updating, but I'm bad about losing my files, so it's best to post.

Rail Chase 2 uses the same address as well.  The motion chair bytes are a few bytes over, but it's all bunkered without the I/O board anyway so there isn't any reason to investigate it. 

Behind enemy lines still eludes me, as it uses a different address, but it appears to use the same i/o system as daytona and the racers only it's much simpler due to the lack of outputs.  So if we can find it's address the true addresses for daytona and the like are most likely in the same place.
« Last Edit: September 11, 2012, 03:26:06 pm by Howard_Casto »