Jump to content

All my products and services are free. All my costs are met by donations I receive from my users. If you enjoy using any of my products, please donate to support me. Thank you for your support. Tom Speirs

Patreon

[TOOL] Autoload/save individual game control configs with Demul


stigzler

Recommended Posts

Scenario - You're booting Atomiswave/Naomi/Dreamcast games from GameEx via Demul. However, you have to set up the controls each time.

Solution: This approach saves the key configs for each game when you exit Demul.

Use: Run game. Set up controls via Demul menu. Exit Game. Next time you load that game, the controls will be recalled.

How to:

Make a folder somewhere for your individual game controls

Copy this text and make a bat file:

:: Load Controls ini for demul
:: By Stigzler 2013

@echo off
set romname=%1
set romname=%romname:~1,-1%
set emu=%2
set emu=%emu:~1,-1%

echo Recieved Rom Filename = %romname%
echo Recieved Emulator = %emu%

:: --------------------------------------------------------------------
:: User Variables - SET HERE!
:: --------------------------------------------------------------------
:: Location of Controls Folder:
set controlsfolder=C:\Emulators\Dreamcast\demul_controls

:: Location of Emul Folder:
set emulfolder=C:\Emulators\Dreamcast\demul0582

:: Name of EmuExe:
set emuexe=demul.exe

:: Name of Emu Controller ini
set emucontini=padDemul.ini


:: -------------------------------------------------------------------
:: Code
:: -------------------------------------------------------------------

:: Load Controls

set padfull=%emulfolder%\%emucontini%
set controlsfull=%controlsfolder%\%romname%.ini

if exist %controlsfull% (
Echo Controls for this game already exist.
Goto CopyControls
) else (
if exist %controlsfolder%\default.ini (
set controlsfull=%controlsfolder%\default.ini
Echo Controls don't exist... loading defaults
) else (
Copy /Y "%padfull%" "%controlsfolder%\default.ini"
set controlsfull=%controlsfolder%\default.ini
Echo Default.ini didn't exist - using default in Emu
)
)

:CopyControls
Copy /Y "%controlsfull%" "%padfull%"
Echo Loading Controls...
::Pause

:LaunchEmu
:: Launch Emu
Echo Launching Emulator
cd %emulfolder%
start/wait %emuexe% -run=%emu% -rom=%romname%
ping -n 3 localhost > nul



Echo Backing up controls for this game...
set padfull=%emulfolder%\%emucontini%
set controlsfull=%controlsfolder%\%romname%.ini
Copy /Y "%padfull%" "%controlsfull%"

::Pause

Exit

Change the User Variables Section to match your system. Save it as a batch file (use notepad - put .bat at end of filename)

In your command line for GameEx, enter the following:

{Path and bat} "[ROM]" "{system name}"

For e.g.:

C:\GameEx\AHKS_BATS\Demul_load_save_controls.bat "[ROM]" "naomi"

Copy text below into notepad and save as "[Mapping Off] Exit (Process Close) - Demul.ini" in C:\GameEx\CONFIG\EMULATORS


# This is an advanced emulator configuration file. It does things such as allow keyboard only emulators to be operated by a gamepad, wait for additional processes to exit and map keys. If this file is used it overrides the MAPKeys setting for the emulator.

[GENERAL]

# Enabled. Use this.

Enabled=True

#Make MCE Back button and X-ARCADE Escape and SlikStik Escape to close emulator process

MapBack=True

#Make Escape key close emulator process

MapEscape=True

#When exiting an emulator via the above mappings, you can specify keys in the send keys format to send instead of having GameEx close the process to cleanly exit the emulator. Such as the Q Key or ALT F4 which is %{F4}

KeysToSendOnExit=

#Wait for keys to be processed by the emulator

EmuWaitForKeys=True

#Additional processes to wait to exit or close on exit. Dont include the .exe. Leave blank not to use.

Process1=demul
Process2=
Process3=
Process4=

[JOYMAPPING]

# For mapping a GamePad to keys
# Specify a virtual key code to send when the specific joystick control is pressed. Look at vkcodes.htm for codes.

JoymappingEnabled=False

Left=
up=
Right=
Down=
Button1=
Button2=
Button3=
Button4=
Button5=
Button6=
Button7=
Button8=
Button9=
Button10=
Button11=
Button12=
Button13=
Button14=
Button15=
Button16=

[GAMEPADEXIT]

#MAP Gamepad controls to exit and make controls exit process

MapGamePadExit=True

#Flag the controls that exit a game by placing True next to each control. To not use the control as part of the combination use a 0

Left=True
Down=
Right=
Up=True
Button1=
Button2=
Button3=
Button4=True
Button5=True
Button6=True
Button7=
Button8=
Button9=
Button10=
Button11=
Button12=
Button13=
Button14=
Button15=
Button16=

[MOUSEMAPPING]

# For registered users, the ability to control the mouse with a gamepad and/or directional keys.
# For example for PC strategy games.
# Apparantly this functionality is similar to the software Pinnacle profiler. Remember you can setup an emulator
# as one PC game. Specify enabled, and mousespeed 0-20. 20 Being fastest. This setting overrides the directional
# mapping for the above and buttons 1 and 2 Button 1/CTRL becomes left mouse. Button 2/ALT Right mouse

MouseMappingEnabled=False
MouseSpeed=0

[bLOCKKEYS]

# Use this section to disable and block key presses and mouse clicks.
# To disable the mouse clicks use code 1 for left mouse button,
# 2 for right button and 4 for middle button

Enabled=False

BlockKey_1=1
BlockKey_2=2
BlockKey_3=4
BlockKey_4=
BlockKey_5=

[KEYBOARDREMAP]

# Remap Keys for the emulator. Specify from the from key, which is the key you wish to replace the to key
# This should be good enough for real time gaming. Registered version feature. Look at VKCodes.htm for codes.

Enabled=True

Remap_1_From_VK=
Remap_1_To_VK=

Remap_2_From_VK=
Remap_2_To_VK=

Remap_3_From_VK=
Remap_3_To_VK=

Remap_4_From_VK=
Remap_4_To_VK=

Remap_5_From_VK=
Remap_5_To_VK=
Remap_6_From_VK=
Remap_6_To_VK=
Remap_7_From_VK=
Remap_7_To_VK=
Remap_8_From_VK=
Remap_8_To_VK=
Remap_9_From_VK=
Remap_9_To_VK=
Remap_10_From_VK=
Remap_10_To_VK=
Remap_11_From_VK=
Remap_11_To_VK=
Remap_12_From_VK=
Remap_12_To_VK=
Remap_13_From_VK=
Remap_13_To_VK=
Remap_14_From_VK=
Remap_14_To_VK=
Remap_15_From_VK=
Remap_15_To_VK=
Remap_16_From_VK=
Remap_16_To_VK=
Remap_17_From_VK=
Remap_17_To_VK=
Remap_18_From_VK=
Remap_18_To_VK=
Remap_19_From_VK=
Remap_19_To_VK=
Remap_20_From_VK=
Remap_20_To_VK=
Remap_21_From_VK=
Remap_21_To_VK=
Remap_22_From_VK=
Remap_22_To_VK=
Remap_23_From_VK=
Remap_23_To_VK=
Remap_24_From_VK=
Remap_24_To_VK=
Remap_25_From_VK=
Remap_25_To_VK=
Remap_26_From_VK=
Remap_26_To_VK=
Remap_27_From_VK=
Remap_27_To_VK=
Remap_28_From_VK=
Remap_28_To_VK=
Remap_29_From_VK=
Remap_29_To_VK=
Remap_30_From_VK=
Remap_30_To_VK=
Remap_31_From_VK=
Remap_31_To_VK=
Remap_32_From_VK=
Remap_32_To_VK=

Finally, under Advanced config, select this file:

Screenshot%20-%2015_01_2014%20%2C%2018_4

Hope this helps and let me know if buggy!

  • Like 1
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...