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 --- Bug Reports --- 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 63114 times)

0 Members and 1 Guest are viewing this topic.

Trnzaddict

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 130
  • Last login:November 23, 2019, 09:36:14 am
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #320 on: February 19, 2013, 08:52:13 am »
Howard fantastic job. A question though, you mentioned that this troubleshooter app will launch model 2 itself...if this going to be arcade front end friendly?

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 17899
  • Last login:Today at 01:28:39 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #321 on: February 19, 2013, 09:10:29 am »
Yes... I wouldn't be going through all of this trouble otherwise. 

M2, will actually be launched normally, but for pc games and the like, t2 will act as a wrapper.  You'll simply treat "troubleshooter.exe" as the emulator and pass a ini file argument as a "rom". 

So "troubleshooter.exe hotdpc" would launch the pc version of house of the dead. 

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 8596
  • Last login:Today at 06:41:21 am
  • ...
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #322 on: February 19, 2013, 09:13:35 am »
Speaking of icons.  We are going to need to figure out what kind of icon to use.  I tried the MAME ones, and they are a tad bulky imho.  The good news is lua is loading a alpha-based png texture, so translucency can be added.  I don't like the one's in m2, but I think something spindly like that would be best.  The user can make their own icons for that matter, I'm loading an external png in the lua script. 

There are the alternate crosshairs for MAME.  http://mrdo.mameworld.info/mame_artwork_supp.php
I also have PNGs from the Digital Leisure games, but don't remember what they looked like (I replaced them with blank PNGs, but still have the originals).
I planned to make laser dots when I get around to adding IR guns to my cab.

I should have time to make up a few different original sets tonight.
I haven't looked for the crosshairs in the M2 folder yet.  Are they just in there as a user accessible png?
If not, I'll need to know the dimensions and other pertinent info.

DarthMarino

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 499
  • Last login:Yesterday at 07:51:25 pm
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #323 on: February 19, 2013, 09:39:56 am »
^Is there any harm in making the crosshairs with 2 colors (maybe like a drop shadow).  I do notice occasionally you can lose it if you are aiming at an area that is the same color as your crosshair.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 17899
  • Last login:Today at 01:28:39 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #324 on: February 19, 2013, 11:07:38 am »
M2's internal crosshairs get broken with my hacks, so I'm making my own.  The lua scripting allows you to load a 32bit png and I can move said png around with the axis values in the game.  I tested this with vcop and gunblade (even though gunblade doesn't need them) it works great. 

So yeah you can make your crosshairs any way you want.  The only catch is that they aren't scaleable.  So I'm going to make the default ones a little on the small side so that they don't look awful at lower resolutions.  Mame's are 500x500 pixels!  And people say mame isn't getting bloated.  ;)  The thought was to make them 48x48.  If you want smaller ones you can simply put a smaller cursor inside the 48x48 image... the transparency won't matter.    Since it's an alpha channel they can be translucent as well.  I've found that helps a lot.  I'll post a script in plain text in the next post so you guys can play with it. 

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 17899
  • Last login:Today at 01:28:39 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #325 on: February 19, 2013, 11:14:54 am »
Here... take the below code, rename to "vcop.lua" and put it in your scripts folder. 

It will attempt to load two 48x48 pngs... cross1.png and cross2.png out of the model 2 folder.  If you don't make some pngs it will crash.  ;)


============================================================================================

require("model2");   -- Import model2 machine globals
--require("ReadLines"); -not used

function Init()
P1CH=Video_CreateSurfaceFromFile("cross1.png")
P2CH=Video_CreateSurfaceFromFile("cross2.png")

end

function PostDraw()

P1AX = (I960_ReadWord(0x501620))
P1AY = (I960_ReadWord(0x501610))
P2AX = (I960_ReadWord(0x501690))
P2AY = (I960_ReadWord(0x5015f8))


width,height = Video_GetScreenSize();   

XPOS = (P1AX - 131) / 495;
XPOS = XPOS * width;

YPOS = ((P1AY - 36) / 383)-1;
YPOS = height+(YPOS * height);


XPOS2 = (P2AX - 131) / 495;
XPOS2 = XPOS2 * width;

YPOS2 = ((P2AY - 36) / 383)-1;
YPOS2 = height+(YPOS2 * height);


--Video_DrawText(XPOS,YPOS,"+",0xff0000)
--Video_DrawText(XPOS2,YPOS2,"+",0x0000ff)

--Video_DrawText(20,20,XPOS,0xff0000)
--Video_DrawText(20,40,YPOS,0x0000ff)   

Video_DrawSurface(P1CH,XPOS-24,YPOS-24)
Video_DrawSurface(P2CH,XPOS2-24,YPOS2-24)

end

=========================================================================================================

Basically all this script does is read the memory addresses that have the x/y values in them.  Then it divides by their maximum values to get the percantage and multiplies the percantage by the screen width or height.  (Y axis has to be negated)  The the loaded cursors are drawn in that position minus 24 (half of 48).  Easy stuff, and we can modify it a lot, like having a key to toggle them on/off and saving the setting. 



Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 17899
  • Last login:Today at 01:28:39 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #326 on: February 19, 2013, 01:22:53 pm »
Alright.  I've got a working crosshair script for vcop2 now as well.  So that just leaves house of the dead. 

I'll go ahead and perfect my lua script for gunblade because it's needed for calibration, but I'm going to make it so that you have to toggle that one on.  It is useless for gameplay afterall. 

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 17899
  • Last login:Today at 01:28:39 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #327 on: February 19, 2013, 01:47:11 pm »
Alright... house of the dead now has a working script as well.

Honestly if I knew how easy it was to make my own cursors in lua, I would have never bothered looking for them in the memory. 

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 8596
  • Last login:Today at 06:41:21 am
  • ...
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #328 on: February 19, 2013, 06:09:42 pm »
24 bit icons attached

I tried out your lua script above.
The crosshairs are off from where El-Semi's were.
I'm guessing he adjusted to put the center at the tip of the pointer while yours is centerd on the entire pointer.
As long as the bullets go to the center of the crosshair, we're good.

The background is white because I saved the crosshair without the alpha channel.
This little script is going to be great for creating crosshairs.  Getting to see what they look like in game helps a lot.
« Last Edit: February 19, 2013, 06:33:52 pm by BadMouth »

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 17899
  • Last login:Today at 01:28:39 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #329 on: February 19, 2013, 07:25:13 pm »
Actually his is off and mine is accurate.  His is placed where the mouse cursor is, no exceptions.  Mine is placed where the game says the gun is. 

Even with calibration in the games, you'll find that his are always just a little off.  Mine still might need a bit of tweaking, but at least they are polling the right values. 

I've got a couple as well I made... they are a little too dim for virtua cop 2 because of that obnoxious yellow circle that goes around the enemies, but I prefer them for hotd. 


Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 17899
  • Last login:Today at 01:28:39 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #330 on: February 19, 2013, 07:25:52 pm »
And P2

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 17899
  • Last login:Today at 01:28:39 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #331 on: February 19, 2013, 07:35:09 pm »
Btw most of these games had pc ports.  We could grab a screenshot off the net and make "official" cursors as well. 

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 8596
  • Last login:Today at 06:41:21 am
  • ...
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #332 on: February 19, 2013, 08:04:06 pm »
I'm diggin' having the crosshairs I want.

Not sure if it is an issue or not, but when in the calibration screen (in fullscreen mode) and I move the crosshair off the right side of the screen,
a windows style pointer appears a few inches from the edge of the screen.  If I move it to an area in the bottom right corner of the screen, it turns into the hand with index finger pointer.  It also happens on the screen where you enter your initials. 

Those screens also have a the blue image that appears where a shot is fired following my pointer around.

I'm just using a mouse and not using RamjetR's app.
« Last Edit: February 19, 2013, 08:11:26 pm by BadMouth »

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 17899
  • Last login:Today at 01:28:39 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #333 on: February 20, 2013, 05:24:04 am »
Well ramjet's app is what fixes those issues.  Again, bad coding unfortuantely.  He made his dx surface fullscreen, but forgot to make the window itself fullscreen. 

The blue splotch is supposed to be there and is part of the game, that's to aid in calibration. 

RamjetR

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 144
  • Last login:October 25, 2018, 05:03:25 pm
    • My Youtube Channel
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #334 on: February 20, 2013, 06:13:57 am »
Well ramjet's app is what fixes those issues.  Again, bad coding unfortuantely.  He made his dx surface fullscreen, but forgot to make the window itself fullscreen. 

The blue splotch is supposed to be there and is part of the game, that's to aid in calibration.

What he said... Actually I think I had calibration issues when the scene is forced to widescreen, but the min max firing zone wasn't extended outside the 4:3 aspect? At the time I thought most people would be putting this into a cabinet with a CRT so I left the settings default to 4:3 to avoid confusion. That said, I didn't put much time into testing that... The app was just a fix for the M2 focus problem.

The blue and red splotches are in the gun calibration screen and it's easiest to move the target to a particular corner and move the splotch to line up with the crosshair.

Howard, I looked and looked again... even used the CT file I had which modified the crosshairs, but for some reason it didn't work since. Honestly, the crosshairs you have are more accurate anyway and drawn every screen update so probably smoother.

I haven't done anything M2 in atleast a week and with call again from tomorrow (we're down to barebone staff at work) I likely won't have any time for the week to come either. What time I do have available I'm installing my home automation setup and writing/learning HTML interface for Android to arduino/wireless transceivers/IR transceivers. Once that is done, then I'll integrate the home security web camera's and PIR sensors. I've been a bit distracted lately as I've just bought an engagement ring and planning to propose very soon and it's been a bit nerve racking to find the right one and working my arse off to pay for it. Thank god for Howards insomnia hey! :P

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: 17899
  • Last login:Today at 01:28:39 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #335 on: February 20, 2013, 06:46:28 am »
Well since mine goes by the gun values and multiplies them by the screen resolution, there shouldn't be any widescreen issues.  Or rather I should say all save one.  If you are running the games on a 16x9 monitor, you need to run them at a 4:3 resolution if you intended to play them in the original aspect.  I can put a 4:3 fix in the lua scripts, but honestly it isn't worth it. 

I'm almost certain that somebody is going to run into calibration issues once this is released... it's the nature of the beast unfortunately.  You've got the in-game calibration.  The calibration of the physical guns, and if it turns out we have issues, I'll implement calibration for the troubleshooter itself.  Lightguns are a pain in the ass really.


Actually, I'm sleeping fairly regularly again.  Note that it's 6am here and I just got up a few minutes ago.   Which is good for me, but it means things might slow down. 

I took a few minutes this morning and started hooking up the cfg menu for the troubleshooter.  It now successfully READS all of the cfg files and also writes to the exe launch options.  What's left on that end is to hook up a few misc options I haven't gotten around to yet, make a custom setup window for VON, and make a model 2 setup section, because basically m2 has to be "installed" unlike the pc games.  On the internal end of things I've still got to add optional joystick support for VON, and thow my mouse code in there.  The mouse code works fine, so it won't be an issue, but bugs can always arise when you are transferring code. 

Good luck on the proposal!

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 8596
  • Last login:Today at 06:41:21 am
  • ...
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #336 on: February 20, 2013, 10:08:21 am »
(probably a useless post, but oh well)

Regarding the issue with the windows pointer appearing:
It was indeed on a widescreen(laptop stretched) to fullscreen.  I don't know what the resolution was set to in M2, but it was probably a 4:3 one.
Not a setup I normally play on.  Sounds like you guys have a handle on it.

Regarding the blue splotch following the crosshairs:
makes sense.  with my Act Labs guns, I pull the trigger and it puts the splotch where I aimed.  It stays there until I pull the trigger again because the position isn't updated again until I pull the trigger.  A side effect of using a mouse or IR gun.
« Last Edit: February 20, 2013, 11:06:34 am by BadMouth »

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 17899
  • Last login:Today at 01:28:39 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #337 on: February 20, 2013, 12:07:27 pm »
Found a few more minutes this afternoon. 

Hooked up all the VON joystick stuff save optional analog axis.  I found a bug regarding having the same input hooked up to both a joystick button and keyboard key.  I fixed it for von, but for the lightgun games I'll have to test this evening to see if they need fixed as well. 

If I can get the VON stuff and this potential bug squashed tonight, I'll add in the mouse code and start testing it tomorrow. 

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 17899
  • Last login:Today at 01:28:39 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #338 on: February 20, 2013, 04:09:53 pm »
Ok I got the VON stuff hooked up. 

Confirmed the bug unfortunately.  It has to do with the fact that I allow joystick/mouse and keyboard inputs to work at the same time.  I'll have to rework how I'm handling things a little. 

On a side note, after getting the von stuff working and play testing a few rounds, I have concluded that it's an awful game.  I wonder why I bothered.  ;)

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 8596
  • Last login:Today at 06:41:21 am
  • ...
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #339 on: February 20, 2013, 09:55:44 pm »
laser dots attached if you want to include them with the troubleshooter.
Two sizes and three colors.
The blue sucks, but I thought someone might insist on having blue for P2.

edekoning

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 524
  • Last login:November 19, 2019, 03:00:46 pm
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #340 on: February 21, 2013, 05:07:30 am »
On a side note, after getting the von stuff working and play testing a few rounds, I have concluded that it's an awful game.  I wonder why I bothered.  ;)

Whaaaat? VON is one of my all time favorite arcade games, but you really have to play it with dual trigger sticks against a human opponent.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 17899
  • Last login:Today at 01:28:39 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #341 on: February 21, 2013, 07:00:37 am »
Badmouth: 

Since you are having so much fun with the crosshairs, here is something else to play with. 

I'm working on a more advanced script that adds more mame-like functionality to the crosshairs.  It's attached below.  It will add a new crosshairs folder as well as a helper script and a script for vcop2.  Just extract it at the root of your m2 folder. 

Holding down the 7 key cycles through available cross hairs for p1, holding down 8 cycles through p2, holding 9 toggles visibility (actually it just loads a blank cursor, but that leads to less "if" statments in the main loop, which should keep things running smoothly).  These keys could be changed of course, even to joystick buttons, but you'd have to google the DIK number. 

The current crosshairs as well as visibility are stored in crosshairs\vcop2.cfg.  When you exit m2, your current settings will be saved for next time. 

You can add/delete your own crosshairs to the mix as well.  They are put in the crosshairs folder.  P1's ch name must end in a "1" and P2's in a "2".  Inside there is also a list file.  Add the name of the cross hair (minus the "1/2.png" to the list) to your list to register it.  Just be sure "NONE" is at the bottom of the list.  No errant returns/spaces in the list either, NONE must be the last line!!!

I need to get back to the main program, but this needs done anyway and it's more fun.  ;)

Anyway, enjoy playing with it. 


Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 17899
  • Last login:Today at 01:28:39 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #342 on: February 21, 2013, 01:07:46 pm »
I found a little bit of time this evening to make skeleton forms/functions for configuring VON and Model 2 in general. 

Slowly but surely. 

I still need to fix the previously discovered bug, but it isn't all that serious a one, so I'll wait until I get more time. 

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 8596
  • Last login:Today at 06:41:21 am
  • ...
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #343 on: February 21, 2013, 10:08:37 pm »
^Is there any harm in making the crosshairs with 2 colors (maybe like a drop shadow).  I do notice occasionally you can lose it if you are aiming at an area that is the same color as your crosshair.

Drop this crosshair folder in your MAME folder and see what you think. 
(Mr Do's instructions say crsshair, but the default is now crosshair.  It can be changed in mame.ini)
Probably need to be a little fatter for MAME, but I was trying to stay away from the thick style already available.
You can also open up the MAME crosshairs in a photo editor and outline them in black.

M2 ones in two sizes also in the zip file.
This style and the laser dots were the two I had in mind.
I probably won't make any more.

DarthMarino

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 499
  • Last login:Yesterday at 07:51:25 pm
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #344 on: February 21, 2013, 10:55:30 pm »
Yeah, I think it's pretty good.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 17899
  • Last login:Today at 01:28:39 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #345 on: February 22, 2013, 07:05:46 am »
I like that one as well. 


Fixed that minor bug I was talking about before.  Thus far no issues, so I'll keep plugging away at getting the cfg menus finished.  Hopefully I can get that done tonight and start adding in the mouse stuff tomorrow. 

yakk11

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 87
  • Last login:Yesterday at 06:14:23 pm
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #346 on: February 22, 2013, 08:47:49 am »
I finally fixed my problem.  I didn't have my Aimtrak configured properly for off screen shooting.  Now it works perfectly.    ;D ;D

I really appreciate the hard work you guys have done!    :applaud:  Thanks again!

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 17899
  • Last login:Today at 01:28:39 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #347 on: February 22, 2013, 09:38:22 am »
Good to hear. 

Thankfully I've got plenty of time to work on things today.  I got the save routines for Virtual On hooked up, and combine this with the launch settings I've already done and that's half of the configuration functions righ tthere.  I'll try to hook up the main save functions (which is a mess) later today. 

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 8596
  • Last login:Today at 06:41:21 am
  • ...
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #348 on: February 22, 2013, 10:10:57 am »
Just an FYI, the lua scripts crash the emulator if the last crosshair that was loaded is deleted.

Not sure if you'd consider it an issue or not, but letting you know in case you want to add some lines to avoid it.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 17899
  • Last login:Today at 01:28:39 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #349 on: February 22, 2013, 10:33:05 am »
Yeah lua doesn't really have a lot of error handling. I can put a check in for "nil" I guess. 

It doesn't actually crash if a crosshair is deleted, but rather if your list is shorter than the crosshair number saved.  Let's say you are using the 6th crosshair and you delete the 4th, making your list only 5 lines long.  It'll still crash. 

Eventually, when I get time, this will all be re-worked anyway.  I'm going to see if I can get it to scan the directory for files instead.  I also want to do that thing mame does, where a crosshair disappears if there's no movement for x-amount of time.  That'll make p2 disappear when you are playing a 1p game. 

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 17899
  • Last login:Today at 01:28:39 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #350 on: February 22, 2013, 04:04:24 pm »
Ok I fixed those issues you mentioned and added a new feature.  I also dropped the NONE crosshairs... at this point the script is too complex to worry about one extra if statement. 

Try this one and let me know how it works.  It has some rudimentary error handling upon startup... if the list number is too high it will revert to the first crosshair... so you'll need at least one.  The new feature is the auto-off.  If a gun stays perfectly still for a second or so (impossible unless it's not in use) the crosshairs will disappear.  They'll come back as soon as they detect movement.  So if you are playing a 1 player game, the second crosshair won't be in your way. 

Rename this to a lua file and try it out. 

DarthMarino

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 499
  • Last login:Yesterday at 07:51:25 pm
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #351 on: February 22, 2013, 08:14:53 pm »
Seems to be working for me.  The original Model 2 crosshair remains.  Should I be seeing that?

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 17899
  • Last login:Today at 01:28:39 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #352 on: February 23, 2013, 08:09:34 am »
Seems to be working for me.  The original Model 2 crosshair remains.  Should I be seeing that?

Emulator.ini >  [Renderer] >  DrawCross = 0    ;)

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 17899
  • Last login:Today at 01:28:39 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #353 on: February 23, 2013, 11:16:15 am »
Ok, I got the save routines installed.  Now I've just got to hook up the mouse stuff and do a bit of testing with it. 

Almost there!

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 17899
  • Last login:Today at 01:28:39 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #354 on: February 23, 2013, 07:38:15 pm »
I had to take a break from the main project today.  The "user friendly" interface coding isn't very fun to do at all. 

I DID play around with lua scripting a little.  I wanted to learn the language because learning a new language (even if it's a dumb scripting language) is always a good thing. 

On that note, you guys do know we can further enhance functionality of Model 2 with scripting right?  I decided to make a "pause" screen because model 2 doesn't have any indicator that the game is paused, which makes it hard on me when I do my memory searches with the cheat engine.  I made a png the resolution of my monitor, made a 25% transparent black png, and scripted it to toggle on and off when the pause key is hit.  Bam!  Now model 2 dims the screen when a game is paused, just like mame. 

Other things that are possible are screen filters, cropped bezels, instruction cards, loading control panel images, ect.  And no, I'm not going to hold up the release for stuff like this, I'm just mentioning it.  I don't know what kind of demand there would be for such functionality though.  I was going to add the instruction cards into some of the scripts, but I couldn't find readable artwork for any of the model 2 games. 

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 17899
  • Last login:Today at 01:28:39 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #355 on: February 24, 2013, 09:09:13 am »
Ok mouse/lightgun code is in place.  I tested it and it works great.

Fixed a few minor bugs with the cfg menu. 


So the app is essentially done at this point.  I can't release it yet because I've got to add a function to generate all the lua scripts for model 2 and some documentation would be nice, but the end is finally in sight. 

retrorepair

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 242
  • Last login:November 04, 2018, 12:58:03 pm
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #356 on: February 24, 2013, 10:40:21 am »
Great news, finally these games are going to be properly playable  :applaud:

Thanks for all your hard work Howard!
My arcade racing setup:
My Youtube Channel: http://www.youtube.com/user/RetroRepair
My Twitter: http://twitter.com/retrorepair

yakk11

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 87
  • Last login:Yesterday at 06:14:23 pm
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #357 on: February 24, 2013, 02:14:09 pm »
Ok mouse/lightgun code is in place.  I tested it and it works great.

Fixed a few minor bugs with the cfg menu. 


So the app is essentially done at this point.  I can't release it yet because I've got to add a function to generate all the lua scripts for model 2 and some documentation would be nice, but the end is finally in sight.

 :applaud:  Looking forward to blasting zombies with my girlfriend! :D

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 17899
  • Last login:Today at 01:28:39 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #358 on: February 24, 2013, 06:32:36 pm »
Ok not a bug guys, but something I discovered that you should be aware of if you intend to make your own crosshairs ect... 

I was working on the scripts and was going to add bezel and pause screen support as a suprise.  I ran into a issue with the way model 2 loads surfaces from a file.  If the png loaded has dimensions that are not a power of 2 the image gets stretched and/or distorted.  So my 48x48 crosshairs are probably getting a little screwed up.  I'll change the default size to 64x64 instead and add more transparent area, because I feel like some people are going to want large crosshairs.

I'll go ahead and convert the crosshairs I've already been sent, but just keep it in mind. 

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 17899
  • Last login:Today at 01:28:39 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Sega Model 2 Emulator Full Screen Shooter fix - RamjetM2Borderless - App
« Reply #359 on: February 26, 2013, 08:32:31 am »
Been learning the scripts a little more to make this thing as easy to mod as possible. 

Did some testing to make sure that you can set a variable and THEN load another lua script via an include statment.  Apparently you can, and you can have all your init postdraw and end functions in the other script.  So what I'll do is make a singular script that does all the real work and then generate a bunch of mini scripts, that just set the rom name. 

This way if the users want to modify anything after install (like launching a glovepie script, ect) they only have to modify one script, as opposed to 56. 

So I'll do that today/tonight.  Then I've got business Wednesday and I'll release hopefully on Thursday.