Author Topic: project64 - load controller config with rom  (Read 7180 times)

Spyke

  • Newbie
  • *
  • Posts: 26
Re: project64 - load controller config with rom
« Reply #8 on: July 16, 2015, 04:10:43 PM »
It works!!!! :D
Was a plugin problem, with NRage it didnĀ“t work, with Jabo-DInput it works.
Thank you very much for helping me out.

Spyke

  • Newbie
  • *
  • Posts: 26
Re: project64 - load controller config with rom
« Reply #7 on: July 16, 2015, 01:25:28 PM »
Will try with this one.
The name of the script was clear, what I meant was the name of the game inside config.ini
I think I must use name of the rom, I will test and give a reply.

Aeliss

  • Hero Member
  • *****
  • Posts: 900
Re: project64 - load controller config with rom
« Reply #6 on: July 16, 2015, 11:32:31 AM »
New working script, this one works tested

Code: (autoit) [Select]
#include <File.au3>

;Parsing
Local $count = StringInStr($CmdLineRaw, ".exe", 0 , 1, 1)
local $app = StringLeft ( $CmdLineRaw, $count + 4 )
local $command = StringTrimLeft( $CmdLineRaw, $count + 4 )
if not $command then exit 0

HotKeySet("{ESC}", "Terminate")

;Special part for pads
local $folder = @ScriptDir & '\Pad_config\'
local $fichier = $command
$file = StringTrimRight( $fichier, 1 )
$file = StringTrimleft( $fichier, 1 )
Local $szDrive, $szDir, $szFName, $szExt
_PathSplit($file, $szDrive, $szDir, $szFName, $szExt)
Local $patch = IniRead($folder & "config.ini", "PATCH", $szFName, "")
if $patch <> "" Then
   if $patch = 'FPS' then
       RunWait(@ComSpec & " /c " & 'Regedit /s "' & $folder & 'fps.reg"', "", @SW_HIDE)
   Elseif $patch = 'PLATEFORM' then
       RunWait(@ComSpec & " /c " & 'Regedit /s "' & $folder & 'plateform.reg"', "", @SW_HIDE)
   Else
       RunWait(@ComSpec & " /c " & 'Regedit /s "' & $folder & 'defaut.reg"', "", @SW_HIDE)
   Endif
Else
   RunWait(@ComSpec & " /c " & 'Regedit /s "' & $folder & 'defaut.reg"', "", @SW_HIDE)
Endif


$PID = Run ('"' & $app & '" ' & $command)

While ProcessExists ( $PID )
   sleep(500)
WEnd

WinActivate("mGalaxy")

Exit 0

;functions
Func Terminate()
    While ProcessExists ( $PID )
  ProcessClose ( $PID )
    WEnd

WinActivate("mGalaxy")

    Exit 0
EndFunc

Do I have to extract the Nrage key or the plugin key ?

Depend of the plugin you use, for me
I extract [HKEY_CURRENT_USER\Software\JaboSoft\Project64 DLL\DirectInput7 1.5\Keys 0] Not Nragekey

my reg file is like this one
Code: [Select]
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\JaboSoft\Project64 DLL\DirectInput7 1.5\Keys 0]
"DigitalUp Key"=dword:00000048
"DigitalUp Device"=dword:00000000
"DigitalDown Key"=dword:00000050
"DigitalDown Device"=dword:00000000
"DigitalLeft Key"=dword:0000004b
"DigitalLeft Device"=dword:00000000
"DigitalRight Key"=dword:0000004d
"DigitalRight Device"=dword:00000000
"AnalogUp Key"=dword:000000c8
"AnalogUp Device"=dword:00000000
"AnalogDown Key"=dword:000000d0
"AnalogDown Device"=dword:00000000
"AnalogLeft Key"=dword:000000cb
"AnalogLeft Device"=dword:00000000
"AnalogRight Key"=dword:000000cd
"AnalogRight Device"=dword:00000000
"A Key"=dword:0000002d
"A Device"=dword:00000000
"B Key"=dword:0000002e
"B Device"=dword:00000000
"Start Key"=dword:0000001c
"Start Device"=dword:00000000
"Z Key"=dword:0000002c
"Z Device"=dword:00000000
"L Key"=dword:0000001e
"L Device"=dword:00000000
"R Key"=dword:0000001f
"R Device"=dword:00000000
"C_Up Key"=dword:000000c7
"C_Up Device"=dword:00000000
"C_Down Key"=dword:000000cf
"C_Down Device"=dword:00000000
"C_Left Key"=dword:000000d3
"C_Left Device"=dword:00000000
"C_Right Key"=dword:000000d1
"C_Right Device"=dword:00000000

and I call this file fps.reg for exemple.

Quote
Do I have to use the rom name in.ini file or the DB name shown in mgalaxy?
This script is only for P64 so you need to use this file instead of this one in your p64 folder and call it "mGalaxy_Script.au3"


Perhaps a admin right problem ?

« Last Edit: July 16, 2015, 11:34:45 AM by Aeliss »

Spyke

  • Newbie
  • *
  • Posts: 26
Re: project64 - load controller config with rom
« Reply #5 on: July 15, 2015, 03:23:38 PM »
Good luck with your RetroBox to bring it back to live.
I have tested, the script and files, but without success... P64 use with all games the settings made least in P64
Some questions:
Do I have to extract the Nrage key or the plugin key ?
Do I have to use the rom name in.ini file or the DB name shown in mgalaxy?
I use joy2key, is it a problem? I think not, because it didn't take effect to to the plugin.

Aeliss

  • Hero Member
  • *****
  • Posts: 900
Re: project64 - load controller config with rom
« Reply #4 on: July 13, 2015, 11:24:29 AM »
Yep, exactly ^^, it 's for that I asking if you know autoit. The code isn't complete, and I haven't test all the script. My RetroBox is under repair, I have installed a 1T DDR with bad partition alignement, and after a bad test, I need to reinstall all the system, fortunately data are ok)

You need to configure your pad for plate form game, and save the registry key you need in a file called "plateform.reg"
ect ...

But the script isn't complicated, I think you can finsh it easily.
Code: [Select]
IF .... Then
.....
Elseif ....
.....
Elseif ....
......
Elseif ....
......

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


Else
.....
Endif

All the game that are not in the ini file will use the defaut config. With that you don't need to enter all your game in the ini file, only theses one where you need special config.
« Last Edit: July 13, 2015, 11:29:18 AM by Aeliss »

Spyke

  • Newbie
  • *
  • Posts: 26
Re: project64 - load controller config with rom
« Reply #3 on: July 12, 2015, 11:55:23 AM »
Ok, thank's I will give a try. What do you mean with "I hope you understand autoit script?
I know how to make .exe with autoit, but that's it....
If I understand right it is possible to use config defaut, plateform and fps. If I need more, I can add them in autoit script with elseif....... and can create the for example racer config?

Marc
« Last Edit: July 12, 2015, 05:01:17 PM by Spyke »

Aeliss

  • Hero Member
  • *****
  • Posts: 900
Re: project64 - load controller config with rom
« Reply #2 on: July 12, 2015, 04:40:01 AM »
Yep. But I hope you can understand autoit script because I will not make support for it.

Use this autoit script instead of normal one.

Code: (autoit) [Select]
#include <File.au3>

;Parsing
Local $count = StringInStr($CmdLineRaw, ".exe", 0 , 1, 1)
local $app = StringLeft ( $CmdLineRaw, $count + 4 )
local $command = StringTrimLeft( $CmdLineRaw, $count + 4 )
if not $command then exit 0

HotKeySet("{ESC}", "Terminate")

;Special part for pad config
local $folder = @ScriptDir & '\Pad_config\'
local $fichier = $command
$file = StringTrimRight( $fichier, 1 )
$file = StringTrimleft( $fichier, 1 )
Local $szDrive, $szDir, $szFName, $szExt
_PathSplit($file, $szDrive, $szDir, $szFName, $szExt)
Local $patch = IniRead($folder & "config.ini", "PATCH", $szFName, "")
if $patch <> "" Then
   if $patch = 'FPS' then
       RunWait(@ComSpec & " /c " & 'Regedit /s ' & $folder & 'fps.reg', "", @SW_HIDE)
   Elseif $patch = 'PLATEFORM' then
       RunWait(@ComSpec & " /c " & 'Regedit /s ' & $folder & 'plateform.reg', "", @SW_HIDE)
   Else
       RunWait(@ComSpec & " /c " & 'Regedit /s ' & $folder & 'defaut.reg', "", @SW_HIDE)
   Endif

Else
   RunWait(@ComSpec & " /c " & 'Regedit /s ' & $folder & 'defaut.reg', "", @SW_HIDE)
Endif


$PID = Run ('"' & $app & '" ' & $command)

While ProcessExists ( $PID )
   sleep(500)
WEnd

WinActivate("mGalaxy")

Exit 0

;functions
Func Terminate()
    While ProcessExists ( $PID )
  ProcessClose ( $PID )
    WEnd

WinActivate("mGalaxy")

    Exit 0
EndFunc

Make a folder called "Pad_config"
inside put a ini file called "config.ini"

Code: [Select]
[PATCH]
Paper Mario (E) [!]=fps

and all your reg file
« Last Edit: July 12, 2015, 04:42:39 AM by Aeliss »

Spyke

  • Newbie
  • *
  • Posts: 26
project64 - load controller config with rom
« Reply #1 on: July 11, 2015, 07:40:11 PM »
Hello,

maybe a stupid question, but is it possible to do something like discribed in post 7 with mGALAXY?
http://www.gameex.info/forums/topic/11318-launching-project64-with-different-joypad-configs/

Marc