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: Johnny5 Run-time Error  (Read 2068 times)

0 Members and 1 Guest are viewing this topic.

Dustin Mustangs

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 188
  • Last login:September 14, 2017, 11:43:18 am
  • Cut the sheet!
    • My Site
Johnny5 Run-time Error
« on: May 24, 2006, 01:10:24 pm »
Well, I used this page ( http://www.mameworld.net/tigerheli/johnny/ ) to attempt and get J5 working under 'Method 5'.  I believe I followed everything to the T, with the exception of adjusting it for my directory structure. 

I can get it to properly launch from a command prompt but when I try and get it to come up while paused in mame I get a runtime error.  I have attached a screen capture of the error to this post.  After I launch mame I do have the AHK icon in the notification area of my desktop if that makes any difference.  There is also quite a bit more of a delay between the time I toggle on J5 and when the error pops up (the screen is blank in between) then when I run it from the command line and it works properly. 

FYI I'm using the default J5 layout, xp, the standard command line mame, mamewah 1.61, and all my mame directories are on E:/, not C:/ .  In accordance with this page ( http://www.mameworld.net/tigerheli/johnny/ahk_th.htm ) I changed the mamewah mame.ini file to show the emulator executable as default.bat which I made following the instructions on the same page.

I can't seem to figure this one out, any ideas??

 ???
« Last Edit: May 24, 2006, 02:27:15 pm by Dustin Mustangs »

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19428
  • Last login:August 02, 2025, 06:13:49 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Johnny5 Run-time Error
« Reply #1 on: May 24, 2006, 05:34:21 pm »
Well if it works from that command line and not from within mame doesn't that tell you that it is the script that is at fault?  The script doesn't do anything to j5, it just launches it. 

So if it's working at the command line but not in mame then the fault is at either the script, which tiger wrote, or the front-end, which minwah wrote.

I can't help you from either, except to say that tiger's script is a little goofy.  Those 1, 2, ctrl, ect. lines he's got in there.  All they are doing is messing up the function structure by leaving an open-ended query.  Not sure what the point is there as he says they aren't being blocked out in mame and they certainly don't need to be blocked out to get the script to run correctly.

I would ask him. 

In the meantime use my script.  This new version doesn't have syncing problems as tiger describes and I know that it works. 

Dustin Mustangs

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 188
  • Last login:September 14, 2017, 11:43:18 am
  • Cut the sheet!
    • My Site
Re: Johnny5 Run-time Error
« Reply #2 on: May 25, 2006, 11:51:48 pm »
It does function with your script, but I don't think it's right yet. 

It takes 14 seconds from the time I press pause in Mame till when it actually displays its image (2.53ghz p4, 512megs ram).  For comparison, it takes less then 2 seconds to come up for the same game (1942) from the command prompt.  The screen is blank during most of the 14s wait.  When I unpause, mamewah flashes on the screen quick and then the game comes back up with the graphics a little bugged right along the left and right edge of Mame's image.  If I exit J5 the screen flashes again and the graphics straighten out.  If I go back to my FE and then back into the game the graphics straighten out also. 

I have the ctrlr cfg field in the parsing options left blank.  Could that have something to do with it?  I wasn't sure what to put there and saw that it was capable of finding it itself.  Maybe it is taking time searching for something else I could specify instead??

I'd really love to get this last kink ironed out.  Anyone have any ideas??

Here's how I currently have it coded:

Code: [Select]
### 0000.ini (mamewah v1.61) ###

emulator_title                            M.A.M.E.

### List Generation Settings ###
rom_path                                  E:\Mame\roms
rom_extension                             zip
dat_file                                  E:\Mame\mameinfo.dat
nms_file                                 
catver_ini_file                           E:\Mame\catver.ini
list_generation_method                    rom_folder_vs_listxml

### Execution Settings ###
emulator_executable                       E:\Mame\mame.exe
commandline_format                        "[rompath]\[name].[romext]"{nodosbox}{safelaunch}
alt_commandline_format_1                  [name]{autodosbox}{nosafelaunch}
alt_commandline_format_2                  [name]{autodosbox}{nosafelaunch}
game_specific_config_path                 

### Artwork Locations ###
artwork_1_image_path                      E:\Mame\snap
artwork_2_image_path                      E:\Mame\marquees
artwork_3_image_path                      E:\Mame\cabinets
artwork_4_image_path                      E:\Mame\titles
artwork_5_image_path                      E:\Mame\cpanel
artwork_6_image_path                      E:\Mame\flyers
artwork_7_image_path                      E:\Mame\artwork
artwork_8_image_path                      E:\Mame\artwork
artwork_9_image_path                      E:\Mame\artwork
artwork_10_image_path                     E:\Mame\artwork
movie_preview_path                        E:\Mame\artwork\movies
movie_artwork_no                          1

### Screen-Saver Settings ###
enable_music_in_screensaver               0
saver_type                                movie
movie_path                               
movie_fullscreen                          1
quit_delay                                30
wrapper_executable                       
wrapper_commandline_format                [name]{nodosbox}{nosafelaunch}
scr_file                                 

### External Application Settings ###
ipc_file_or_path                         
app_1_executable                          E:\J5\j5.bat
app_1_commandline_format                  [name]{nodosbox}{safelaunch}
app_2_executable                         
app_2_commandline_format                 
app_3_executable                         
app_3_commandline_format                 
auto_launch_apps                          1

### Additional Settings ###
music_path                                c:\mamewah\music
lcd_display_file_path                     
lcd_fe_text                               

### Settings used by MAMEWAH ###
current_list                              1


Code: [Select]
#SingleInstance force
#Persistent
; The asterisk prefix makes the remapping more complete on XP/2k/NT. For 9x systems you can remove it.
DetectHiddenWindows, On
ScreenState=0
~p::
{
   if p_pressed = 1
     p_pressed = 0
   else
     p_pressed = 1
}
return
~1::
{
   if p_pressed = 1
   {
If ScreenState = 1
{
send, {Escape down}
send, {Escape up}
WinActivate,%Title%
WinRestore,%Title%
WinActivate,%Title%
WinWaitActive,%Title%
ScreenState=0
}
else
{
WinGetActiveTitle, Title
J5=Johnny5.exe %1% -ahk 1000
        if 0 >1
            J5=%J5%  -clone %2%
        if 0 >2
            J5=%J5%  -driver %3%
if 0 >3
    J5=%J5%  -emu %4%     
        Run,%J5%, e:\j5, max
ScreenState=1
}
   }
}
return
~Escape::
{
if ScreenState=1
{
WinActivate,%Title%
WinRestore,%Title%
WinActivate,%Title%
WinWaitActive,%Title%
ScreenState=0
}
else
{
ExitApp ; Assign a hotkey to terminate this script.
}
}
return


Code: [Select]
0
 0
E:\Mame\
mame.exe

 0
 1
 1
 0
 0
 0
 0
27
17
 1
 1
g:\mame\cpos\
g:\mame\cards\

Code: [Select]
e:
cd e:\J5
start johnny5.ahk %1 %2 %3 %4


Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19428
  • Last login:August 02, 2025, 06:13:49 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Johnny5 Run-time Error
« Reply #3 on: May 26, 2006, 04:15:16 am »
It does function with your script, but I don't think it's right yet. 

It takes 14 seconds from the time I press pause in Mame till when it actually displays its image (2.53ghz p4, 512megs ram).  For comparison, it takes less then 2 seconds to come up for the same game (1942) from the command prompt.  The screen is blank during most of the 14s wait.  When I unpause, mamewah flashes on the screen quick and then the game comes back up with the graphics a little bugged right along the left and right edge of Mame's image.  If I exit J5 the screen flashes again and the graphics straighten out.  If I go back to my FE and then back into the game the graphics straighten out also. 


It should take longer for j5 to come up, that is what fixed teh syncing issues.  14 seconds no but a few seconds yes. 

What do you mean if you unpause?  You can't unpause as when you pause j5 comes up.  Pressing "p" again simply exits j5 and it unpauses mame for you.  And what do you mean by exit j5?
Also what do you mean by "go back to my fe"?  Unless minwah has done some crazy bad coding, you shouldn't be able to access mamewah while a game is running.  It's back there, but you shouldn't be able to use it. 

Be sure you are running j5 at the same res as mamewah and mame the same res as mamewah.  If you don't you will notice issues when the apps switch.

When the mame screen gets corrupted, particularly in games that don't fill the entire screen, that is a mame issue.  You'll also see the same corruption when any onscreen display comes up while in mame (a im-pop-up, on screen volume adjustment, ect).  These issues will be fixed when aaron finishes the video core re-write for mame. 

Dustin Mustangs

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 188
  • Last login:September 14, 2017, 11:43:18 am
  • Cut the sheet!
    • My Site
Re: Johnny5 Run-time Error
« Reply #4 on: May 26, 2006, 08:43:57 am »
Thanks for your help again on this Howard.

Let me describe a little better what is going on.  I begin with a game running in Mame that was started via mamewah.  I Hit "p" to pause it and bring up J5, exactly 14 seconds later (screen is blank for most of this time) the J5 display pops up and looks correct (I'm still using your default layout and background for now).  I have the command.dat add on and at this point this also works correctly with "ctrl" working as the toggle.  Hitting "p" again makes mamewah's display flash briefly and then the game I was playing in mame comes back up with some minor glitches in how it looks as mentioned above.  And yes, this is on a game that doesn't fill the entire screen. 

My other scenario,  I referred to above as 'exit J5', was to hit "esc" instead of hitting "p" for the second time to return to mame.  If I do this mame comes back up and the display doesn't have any of the glitches it would of had if I had hit "p" instead of "esc" to get back to mame.  I can't remember if mamewah's display flashes across the screen in this scenario as it does with a second press of "p" and I am not in front of the computer to check right now.  At this point I believe the script is unloaded because if I press "p" to pause again, mame pauses as normal and J5 never comes up. 

By going back to my front end I meant exiting mame with "esc".  This brings me back to mamewah.  If I do this and then enter back into mame by loading a game, everything starts over just as before, including a glitch free display and with the J5 script loaded.

I'll look into the resolution settings and make sure they all match.  Hopefully that will solve the graphics issue although my instinct tells me whatever is causing that extra delay is also what is goofing up the graphics.  Really, I can deal with slightly bugged graphics.  It's the delay that I'd love to have solved. 

.........................................

I also thought of one other thing that seemed weird.  The line in your script that has the path you need to adjust was giving me some errors.  As posted on your site and modified for my directory structure it reads:

Code: [Select]
Run,%J5%, e:\j5 DON'T ERASE\sources\Controls Viewer3\, max
This gave me an error on this line that popped up when "p" was pressed in mame with the script loaded  until I changed it to:

Code: [Select]
Run,%J5%, e:\j5, max
I know, I know; I erased the part that says don't erase but that got rid of the error on that line.  Maybe this is part of the problem?  How should this line look??

Thanks again for any help you can offer!

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19428
  • Last login:August 02, 2025, 06:13:49 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Johnny5 Run-time Error
« Reply #5 on: May 26, 2006, 03:39:01 pm »
Heh, don't erase is the name of the directory I keep all my source code in, I didn't mean for you not to erase it, it's a reminder to me.  ;)

This should be obvious, but that path does match where you actually have j5 installed doesn't it?

The script is designed to self-exit when you press esc, so that is normal operation. 

As I said, the garbled graphics thing is soley because of mame.  There is absolutely nothing you can do about it.  The only reason it doesn't corrupt when you exit out of j5 via esc is because then the screens aren't swapped, rather mame moves itself (which I can't do unfortunately)  so it doesn't have those issues.  As I said, aaron's upcoming changes will fix that. 

The delay isn't related at all.  It usually depends upon how well your system can handle haveing two instances of mame running at once.  Mame is called by j5 to get vital info. I have no clue why, but some systems seem to have a problem with that.  Mame is very tiny when you don't launch a game, so I have no clue why. 

Also the ahk tag in the script controls a delay on an old-school vb timer, which are notoriously resource dependant.  Having hi-priority in mame set might cause the timer to run slowly. In any extent.....
You can try adjusting the "-ahk " delay to a smaller number to increase speed, but it may cause dislay errors in j5.  You have to kind of tweak it for each system.  I made it high purposefully so it would always display right. 


On a different note, how did the pause syncing work for you?  I've had much more luck with this script but I always like to get fedback from others. 

Dustin Mustangs

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 188
  • Last login:September 14, 2017, 11:43:18 am
  • Cut the sheet!
    • My Site
Re: Johnny5 Run-time Error
« Reply #6 on: May 26, 2006, 04:20:17 pm »
Lol, that is pretty funny.  I can't imagine I am the only one who will make that mistake.

The path does match where I have Johnny5.exe. 

I'll try messing with that delay.  It would be weird if it's my machine that is so slow with this.  I just reinstalled windows and only put mame related apps on it other then NAV and the whole slew of windows updates.  Needless to say it doesn't have much bogging it down.

It got out of sync on me once, although I really haven't had a chance to use it much other then just testing while trying to get it set up correctly.  I'm pretty sure it was my fault anyways due to me getting ancy during that 14 second wait and hitting p again before it had a chance to display but I am not sure.  If I can't get this delay down I think I am going to have to go with one of the other options for displaying controls.  If I have a hard time waiting for it to come up then I can only imagine all the problems it will cause when someone else is behind the controls and starts randomly pushing buttons while they wait.  I am still optimistic but I feel the options are running short.  *knocks on wood*

Dustin Mustangs

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 188
  • Last login:September 14, 2017, 11:43:18 am
  • Cut the sheet!
    • My Site
Re: Johnny5 Run-time Error
« Reply #7 on: May 27, 2006, 09:43:47 am »
The delay settings had no effect except would make the script not work at all if I went too low.

The resolution in mame ini was switched from auto to 800x600, my desktop res.  I imagine Johnny's resolution and Mamewah's resolution are set dependant on their layout files which are both at 800x600 also.  This had little to no effect.

I did notice something weird and possibly realted though.  With mame running 1942 it takes up 14% of my cpu resources.  If I pause it that shoots up to and stays at 99% until I unpause at which time it returns to normal.  This is regardless of how I launch mame and if the script is running or not.  That doesn't seem right, does it?

 :dizzy:

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19428
  • Last login:August 02, 2025, 06:13:49 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Johnny5 Run-time Error
« Reply #8 on: May 27, 2006, 11:24:41 am »
No... they aren't...

mamewah has resolution settings (not familair with it so i don't know where specifically)

to set the "resolution" in j5 you launch it with the -position tag  (read your readme.txt)



It sounds to me like you has rdtsc(spelling?) timing turned on or high priority turned on in mame.  If not your issue is operating system related.  I know it's not a fault of mame and as you said, this is occuring if you have j5 running or not. 

Dustin Mustangs

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 188
  • Last login:September 14, 2017, 11:43:18 am
  • Cut the sheet!
    • My Site
Re: Johnny5 Run-time Error
« Reply #9 on: May 30, 2006, 03:11:26 pm »
I checked both the rdtsc and the high priority settings in my mame.ini and they were both disabled.  I tried changing them anyways and it didn't help any regardless of how I had them set.

I didn't get a chance to verify all the resolution settings but I will give it a go tonight although I doubt it will solve my problem.

Could you possibly elaborate on your 'operating system related' thought??

I am starting to loose hope which sucks because I REALLY wanted to make use of this app.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19428
  • Last login:August 02, 2025, 06:13:49 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Johnny5 Run-time Error
« Reply #10 on: May 30, 2006, 03:59:12 pm »
By operating system related I mean something is wrong with your windows install. 


When you pause mame it should have a high processing percentage used BUT as you do other things on your machine while it's paused the number should drop just enough for you to do what you are doing.  For example, I am typing this message while 1942 is pause as we speak.  When I stop typing the percentage goes up to around 98%, but while I'm typing th enumber drops to 80-90 percent. 

It sounds to me like your machine isn't dropping priorities like it should.  I have no clue what could cause this. 

Your system specs might give some sort of indication. 

Tiger-Heli

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5447
  • Last login:January 03, 2018, 02:19:23 pm
  • Ron Howard? . . . er, I mean . . . Run, Coward!!!
    • Tiger-Heli
Re: Johnny5 Run-time Error
« Reply #11 on: June 03, 2006, 06:47:16 am »
Dustin,

Sorry I am late to the party, but anyway -

First, your initial error looks to me like the script is not passing the gamename to Johnny5, although I am not sure why.  I wrote my script for the previous version of J5 and have not tested with the latest one, but I would expect it to work.
Well if it works from that command line and not from within mame doesn't that tell you that it is the script that is at fault?  The script doesn't do anything to j5, it just launches it.
Agreed 
Quote
I can't help you from either, except to say that tiger's script is a little goofy.  Those 1, 2, ctrl, ect. lines he's got in there.  All they are doing is messing up the function structure by leaving an open-ended query.  Not sure what the point is there as he says they aren't being blocked out in mame and they certainly don't need to be blocked out to get the script to run correctly.
Not sure why you think the script is goofy.  All the 1,2,ctrl, etc. lines do is mean that you can press either Button 1 or Start to display J5 when MAME is paused.

(But most of my script was simple modifications (often suggested by you, Howard, IIRC) of the main script that you wrote - (which I couldn't come up with independently anyways)) -  :cheers:
[/quote]
It's not what you take when you leave this world behind you, it's what you leave behind you when you go. - R. Travis.
When all is said and done, generally much more is SAID than DONE.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19428
  • Last login:August 02, 2025, 06:13:49 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Johnny5 Run-time Error
« Reply #12 on: June 03, 2006, 05:17:03 pm »
Well the thing about those buttons you added in is... even if they are working, they shouldn't work.  What you have is three open-ended functions, by all accounts the script shouldn't even be working.

To do multiple keys you should either setup a fucntion for teh keypress code and pass that funciton for each key, or setup a check of all keys pressed, rather than a translation.



I'll be honest, I had three people with similar j5 problems posting at the same time and this one got lost.  I don't know much about mamewah so I might not be able to tell, but we don't even know if mamewah is setup occrectly.  It could very well be that mw isn't setup to pass the command line.

Dustin Mustangs

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 188
  • Last login:September 14, 2017, 11:43:18 am
  • Cut the sheet!
    • My Site
Re: Johnny5 Run-time Error
« Reply #13 on: June 04, 2006, 11:56:37 am »
Ok, I have still been working with this and really haven't gotten anywhere but I did find some interesting things out.

First off, I couldn't get your -position tag to work for setting J5's resolution so that may still be what is hanging me up.  Please excuse me, because when it comes to command prompts my knowledge is pretty limited.  Is the -position tag a one time only thing, or do I need to specify it each time I run a game?  Regardless, I couldn't seem to get it to work.  I assume you run it each time you start a game and if that is the case then I can add this to the commandline format of my external application settings in mamewah.  Here is how it currently looks, could you suggest how to properly add the -position tag to this:

Code: [Select]
### External Application Settings ###
ipc_file_or_path                         
app_1_executable                          E:\J5\j5.bat
app_1_commandline_format                  [name]{nodosbox}{safelaunch}
app_2_executable                         
app_2_commandline_format                 
app_3_executable                         
app_3_commandline_format                 
auto_launch_apps                          1

FYI, my J5.bat can be found a few posts up if that's where it would need to be added.


I seem to have found what was causing my high cpu usage while mame is paused.  For whatever reason I decided to generate a new mame.ini and see if that had any effect.  Well, it did.  CPU usage dropped from 100% while paused in (for example) gridlee, to 7%.  Average FPS went from 27 to 58.  After I found this I decided to go back through my origianl ini one setting at a time and change the new one to match, testing it's effect between each change.  My cpu usage didn't spike until I changed  'skip_gameinfo' to 1, which actaully didn't make mame skip the game info (those are the left, right screens when it first starts up, right?).  Here is the weird part, changing it back to 0 had no effect on cpu usage while paused until I also changed 'cheat' back to 0, even though when I first changed cheat to 1 with skip_gameinfo at 0 it worked fine.  Regardelss of what and why this is going on, I now have it set so it behaves properly when paused during gameplay. 

This cut my wait for J5 to display from 14 seconds to 7 seconds (with the 1000 msec delay specified), still really long.  Changing the 1000 to something different just mad ethe wait longer.  Here are some examples:

500 msecond delay = 24 second wait
1000=7
1500=20
2000=26
2500=28
3000=8

Not exactly how I would have expected it to behave.  By the way this is all using the same script, the same game and pausing at the same exact time in gridlee, all launched through mamewah using the settings posted a few posts up.  I tried other delays also and the default 1000 produced my shortest wait.

I really am no where near knowledgable enough to get in the 'should tigers script work' debate, but I can tell you this.  Both scripts work the same on my machine.  The wait is SLIGHTLY altered, but really not enough to make any difference.  My end goal is to get tiger's working, but ever since howard expressed some concern I have been doing all my troubleshooting with his default script just to reduce the number of variables.

Speaking of which, can some one suggest how to use J5 with mame from the command line?  I guess I would also need the position tag added because I'll need to use that aand would likely screw it up, lol.  You should be able to get enough of my directory structure from the code I have post in various places above.  This would take mamewah out of the equation which would agian simplify things just for the sake of getting this working.  I have tried with no luck.  What I was doing was double clicking the J5.ahk and then running a command prompt on my mame directory using 'mame gridlee'.  This produced the same problem and screen as in my very first post.  Not changing anything, if I run a command prompt on the J5 folder like 'johnny5 gridlee' it displays fine and with pretty much no delay.

Thanks again for all your help on this guys...

     


Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19428
  • Last login:August 02, 2025, 06:13:49 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Johnny5 Run-time Error
« Reply #14 on: June 04, 2006, 03:03:06 pm »
Ok you don't seem to know how the script works then. 

If you don't pass at least a romname to the script it WILL NOT WORK!!!!!

The script, nor j5 have any way of know what the running game is. 

This is why prior to launch you tell it the rom name when you run the bat. 


How to run j5 from the command prompt is explained in the readme as is the position tag.  It has to be set every single time and to set it to work with a script you'll have to alter the script (throw it in, in the section where the command line is being "built" by the options sent).


And let me make this one clear... you CANNOT use j5 with mame without a script.  You can launch it before mame or launch it from your fe, but you can't launch it from within mame without a script. That is the whole purpose of the scripts. 

Maybe your conception of 7 seconds is longer than mine, but that doesn't sound long at all to me.  J5 doesn't just immediately show a picture when you launch it, it takes a few to parse the data.  Run it from the command prompt and time it and then run it from mame. You shouldn't see a difference of more than 2-3 seconds. 

Tiger-Heli

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5447
  • Last login:January 03, 2018, 02:19:23 pm
  • Ron Howard? . . . er, I mean . . . Run, Coward!!!
    • Tiger-Heli
Re: Johnny5 Run-time Error
« Reply #15 on: June 05, 2006, 07:08:12 am »
First off, I couldn't get your -position tag to work for setting J5's resolution so that may still be what is hanging me up.  Is the -position tag a one time only thing, or do I need to specify it each time I run a game?
Everytime
Quote
Here is how it currently looks, could you suggest how to properly add the -position tag to this:
From J5's readme, the tag looks like this. -position x,y,width,height.  You want to add it to the AHK script.  For example, find the line that reads
J5=Johnny5.exe %1% -ahk 1000
and change it to
J5=Johnny5.exe %1% -position 0,0,800,600 -ahk 1000
Quote
My cpu usage didn't spike until I changed  'skip_gameinfo' to 1, which actaully didn't make mame skip the game info (those are the left, right screens when it first starts up, right?).
I think you are thinking about -skip disclaimer.  That would be the screen that comes up when you first start MAME about usage with ROMS you don't own is illegal, press OK to continue.  Gameinfo is the square box with the game CPU's and resolution, etc.  Interesting that cheat and this setting caused the CPU usage.
Quote
Speaking of which, can some one suggest how to use J5 with mame from the command line?
I go through exactly this process in my Troubleshooting (or similar name - MW is down) section of the page.  Quoting:
Quote
If the batch file does not work properly, I recommend a systematic approach to troubleshooting:

Navigate to your MAME directory, open a command prompt, and type mame and a romname followed by enter.  Ensure MAME starts properly and pauses properly.  This verifies MAME is setup correctly.  (Once I had BuddaMAME still configured to use the external viewer and didn't realize that was what was happening rather than the script.)

Navigate to your c:\johnny directory, open a command prompt, and type Johnny5 and a romname followed by enter.  Ensure Johnny5 launches and displays the correct information for the romname.  This verifies that Johnny5 is working.  If this fails, try running Johnny5 with the -debug flag, and, if necessary contact Howard Casto for assistance.

While in the c:\johnny directory, open a command prompt, and type start johnny5.ahk and a romname followed by enter.  Ensure the AHK icon appears in the statusbar.  Press one of the launch keys and verify that Johnny5 is displayed with the correct information for the romname.  Press any of the launch keys again and verify that Johnny5 closes, but the AHK icon stays loaded.  Press any of the launch keys again and verify that Johnny5 again launches with the correct information.  Press Escape and verify that Johnny5 closes, but the AHK icon stays loaded.  Press Escape again and verify that the AHK icon disappears from the status bar.  This verifies that the AHK script is being loaded and mostly working.  Perform the following steps to troubleshoot:
 
If the AHK icon fails to appear, verify that AHK is properly installed and .ahk files are associated with AutoHotKey. 

Try reinstalling the application if necessary.
 
If Johnny5 fails to launch, verify the path to Johnny5 in the script and the line that contains J5=Johnny5.exe do not have any typos in them.  Possibly try substituting Johnny5 for another program like Notepad or Wordpad and verifying that this is launched.  Try commenting out or removing commands from the script and see if this helps.

Finally, if Johnny5 launches but does not display the correct game info, try either adding the -debug flag to the J5=Johnny5.exe line in the script, substituting Notepad or Wordpad for Johnny5, or looking at the .bat files created by Johnny5 to verify the correct romname info is being passed to Johnny5.  Minwah had an error with this, and I am awaiting resolution on it.

Next, while in the c:\johnny directory, open a command prompt, and and type start johnny5.ahk and a romname followed by enter.  Ensure the AHK icon appears in the statusbar.  Now, navigate to the MAME directory (cd\ - enter, cd mame - enter) and type mame and the same romname followed by enter.  Perform the same tests as initially run and verify that the script behaves properly.  This verifies that the script is compatible with MAME.  If Johnny5 does not display at all, you may have some type of compatibility issue with your system, but I don't know how to troubleshoot this.
 
Finally, if all the above works fine but default.bat fails the initial check, look for typos in the default.bat file.


Quote
I guess I would also need the position tag added because I'll need to use that aand would likely screw it up, lol.  What I was doing was double clicking the J5.ahk and then running a command prompt on my mame directory using 'mame gridlee'.  This produced the same problem and screen as in my very first post.  Not changing anything, if I run a command prompt on the J5 folder like 'johnny5 gridlee' it displays fine and with pretty much no delay.
like Howard said, what you posted won't work.  In order (from simplest to most automated):

1) Navigate to E:\J5 (from a command prompt), then type johnny5 gridlee -position 0,0,800,600 - Verify J5 displays.

2) Navigate to E:\J5 (from a command prompt), then type Start johnny5.ahk gridlee (with the position command added to the AHK script.  Then navigate to the MAME directory and run MAME gridlee. Verify J5 displays when MAME is paused.

3) Navigate to E:\J5 (from a command prompt), then type j5.bat gridlee.  AHK and MAME should both launch. Verify J5 displays when MAME is paused.
It's not what you take when you leave this world behind you, it's what you leave behind you when you go. - R. Travis.
When all is said and done, generally much more is SAID than DONE.

Dustin Mustangs

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 188
  • Last login:September 14, 2017, 11:43:18 am
  • Cut the sheet!
    • My Site
Re: Johnny5 Run-time Error
« Reply #16 on: June 08, 2006, 11:51:34 pm »
Thanks for taking the time to spell it out for me Tiger, I needed it.  Running the position tag from the command prompt worked just fine.  It came up real quick, less then 2 seconds.  When I added it to the script and tried to run that from the command prompt I got another run-time error (see attached) when pressing pause once gridlee was running.  If it matters, the AHK icon did appear on my task bar before I started up Mame.

I double checked this with your instructions, but just in case I screwed this up along the line, here are my exact steps and my .ahk:

Open command prompt on E:\J5

type 'Start johnny5.ahk gridlee' and hit enter

Open command prompt on E:\mame

type 'mame gridlee' and hit enter



Code: [Select]
#SingleInstance force
#Persistent
; The asterisk prefix makes the remapping more complete on XP/2k/NT. For 9x systems you can

remove it.
DetectHiddenWindows, On
ScreenState =0

SetKeyDelay, 250,250

~p::

{
if ScreenState > -1
{
If ScreenState =1

{
ScreenState=-1

send, {Escape down}
send, {escape up}

WinActivate,%Title%
WinRestore,%Title%
WinActivate,%Title%
WinWaitActive,%Title%
sleep 250
Send,{p down}{p up}


ScreenState=0


}
else
{



ScreenState=-1
WinGetActiveTitle, Title
sleep 100
J5=Johnny5.exe %1% -position 0,0,800,600 -ahk 1000
if 0 >1
J5=%J5%  -clone %2%
if 0 >2
J5=%J5%  -driver %3%
if 0 >3
J5=%J5%  -emu %4%


Run,%J5%, e:\j5, max


ScreenState=1

}
}

}

return
~Escape::
if ScreenState=1
{



ScreenState=-1
WinActivate,%Title%
WinRestore,%Title%
WinActivate,%Title%
WinWaitActive,%Title%
sleep 250
Send,{p down}{p up}

ScreenState=0


}
else
{
ExitApp
}

return





Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19428
  • Last login:August 02, 2025, 06:13:49 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Johnny5 Run-time Error
« Reply #17 on: June 09, 2006, 12:51:44 am »
" e:\j5"  should be " e:\j5\"  That's the only thing I see and that shouldn't even make a difference.


The error you are getting is different this time (you should have mentioned that). 

It is caused when j5 tries to resize the screen too soon.  Remove the ", Max" from the script and that should remove the error.  Since you are now setting the size of the form yourself so you no longer need to have the script force maximization for you.  The two functions are fighting each other. 
« Last Edit: June 09, 2006, 12:56:53 am by Howard_Casto »

Tiger-Heli

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5447
  • Last login:January 03, 2018, 02:19:23 pm
  • Ron Howard? . . . er, I mean . . . Run, Coward!!!
    • Tiger-Heli
Re: Johnny5 Run-time Error
« Reply #18 on: June 09, 2006, 06:50:12 am »
" e:\j5"  should be " e:\j5\"  That's the only thing I see and that shouldn't even make a difference.


The error you are getting is different this time (you should have mentioned that). 

It is caused when j5 tries to resize the screen too soon.  Remove the ", Max" from the script and that should remove the error.  Since you are now setting the size of the form yourself so you no longer need to have the script force maximization for you.  The two functions are fighting each other. 
Agreed - Good catch, Howard.
It's not what you take when you leave this world behind you, it's what you leave behind you when you go. - R. Travis.
When all is said and done, generally much more is SAID than DONE.