May 19, 2022, 04:17:25 am
0 Members and 1 Guest are viewing this topic.
Hey, this will be a useful reference. I did the DK plugins but am soon to be looking at other scripting projects for MAME.
There are some bad links above with hxxps instead of https. Please update.
Defender directional movement plugin:https://github.com/BPaden/defenderlrhttps://reddit.com/r/MAME/comments/njc019/defender_directional_movement_plugin/https://drive.google.com/file/d/1kRYwEwyKy_wDicLL9JTlnwOuOlicM5tB/view?usp=sharing
Quote from: Stiletto on October 24, 2021, 04:28:25 pmDefender directional movement plugin:https://github.com/BPaden/defenderlrhttps://reddit.com/r/MAME/comments/njc019/defender_directional_movement_plugin/https://drive.google.com/file/d/1kRYwEwyKy_wDicLL9JTlnwOuOlicM5tB/view?usp=sharingDoes anybody have this plugin installed and MAME configured in a way that doesn't cause MAME problems/errors/crashes outside of Defender? It does work for Defender in MAME 0.231 and 0.238 if I use the steps below, but "plugins 1" in mame.ini + this plugin enabled can cause problems with games other than Defender (unless the workaround mentioned below works) and AFAIK it will cause problems with MAME's built-in UI. 1. Download MAME and do a fresh install. I put it in "C:\MAME_defender\".2. Copy/paste the defender ROM into the roms folder.3. Download the .zip file for the plugin and copy/paste the defenderlr folder with init.lua and plugin.json files into the plugins folder.4. Generate a fresh mame.ini ("mame -cc" command) then verify that it contains "plugins 1" and the paths are good for inis and plugins.5. Make a defender.ini containing "plugin defenderlr" in either the ini folder or the same folder as the MAME executable.6. Launch MAME.7. Enable the defenderlr plugin in the MAME user interface "plugins" menu.8. Exit MAME.9. Create a .bat file or shortcut link for "mame defender". Use that file/link to launch Defender.If you run the MAME 0.231 executable without the ROMname, MAME's built-in FE throws an annoying error that you can work around it by closing the error window and choosing "Select New Machine".If you run the MAME 0.238 executable without the ROMname, MAME doesn't get past a black screen and hourglass icon before . . . eventually . . . timing out and crashing. Possible labor-intensive workaround:- For other games, it looks like you can use a .ini file containing "plugins 0" (plugins disabled) and launch the game from a .bat file or a shortcut link without a problem. (tested using Asteroids)Scott
mame defender -plugin defenderlr
I get problems when using the files downloaded from the Google Drive. These files appear to be out of date. The author has since made some enhancements on github to verify that you are running the defender rom during initialisation.Scott - Can you replace with github files and repeat your tests.
Mixed news:Tried the files saved from those links with the command line you posted for Defender.- As expected, the command line you posted launches the game and plugin. No custom .ini file needed for this approach.- If you launch from the MAME built-in FE you'll need the defender.ini file with "plugin defenderlr".There are definite improvements in v2 like being able to run the MAME built-in FE by just launching the executable.There are also definite stability issues, usually when switching between games.- If you don't change games, it appears to be very stable. - When you try to switch to a different game, sometimes it works but sometimes it locks up -- around 50-50 odds. - The instability could also be caused by my e-mail client or browser pages auto-refreshing and bogging things down.-- I've never seen that cause problems in MAME before, but this old system is getting a bit squirrely. - Tomorrow I'll try adding a few more games to see if there's any instability when switching between them or if it's only triggered when Defender and this plugin are involved.Scott
I fixed the issue by clearing out input variables and unregistering the frame callback on exit and when starting up a game that is not defender.Updated plugin files are in the zip.If you are able to test again Scott and confirm all good. I will submit my changes to the author so hopefully he can update his git repo.
The defenderlr pluginThis plugin is adapted from the original by oomek here and works with MAME [v0.231?] or newer.It should work with whatever you have configured to act as a joystick with no configuration.I know someone asks about defender every few months, and I've been meaning to get this working for me for a long time, but I've just now gotten around to it. This makes the game way more playable, though I still prefer Defender II for the 2600. The enemies in the arcade original are pretty devious and dodge your laser gun like alien ninja.A note about the implementation. I tried to avoid writing to memory by detecting the facing of the player and triggering the reverse button, but it didn't work. While I was able to successfully detect the facing, triggering the reverse button didn't reliably work and I couldn't figure out why. So I fell back to the behavior in the original plugin of writing to memory. There doesn't seem to be any side-effects from casual observation.Anyway the fact that you can do this with no modifications to mame is pretty cool.Configuring MAMECan you launch Defender in MAME? "mame.exe defender"- If not, you need to find the correct version of the "defender.zip" ROM file for your version of MAME and put it the "\mame\roms" folder. (ROM not provided here.)If you don't already have one, create a mame.ini file using the "mame -cc" (create config) command.- Open it in Notepad and verify that it contains "plugins 1". (enabled)Code: [Select]## SCRIPTING OPTIONS#autoboot_command autoboot_delay 0autoboot_script console 0plugins 1- Next, check the paths for inis and plugins so you know where to put those files so MAME can find them.For example, "inipath .;ini;ini/presets" indicates that MAME will look for ini files in three folders "\mame\", "\mame\ini\", and "\mame\ini\presets\".Code: [Select]## CORE SEARCH PATH OPTIONS#homepath .rompath romshashpath hashsamplepath samplesartpath artworkctrlrpath ctrlrinipath .;ini;ini/presetsfontpath .cheatpath cheatcrosshairpath crosshairpluginspath pluginsMake a "\mame\plugins\defenderlr\" folder.- Put the init.lua and plugin.json plugin files in that folder.Make a text file named "defender.ini" in either the ini folder or the same folder as the MAME executable.- It should contain the text "plugin defenderlr".Enable the defenderlr plugin via the MAME user interface "plugins" menu. orEdit the "plugin.ini" file and change "defenderlr 0" (disabled) to "defenderlr 1". (enabled)Code: [Select]## PLUGINS OPTIONS#autofire 0cheat 0cheatfind 0commonui 0console 0data 1defenderlr 1Now you're ready to play Defender and blast those pesky aliens.
## SCRIPTING OPTIONS#autoboot_command autoboot_delay 0autoboot_script console 0plugins 1
## CORE SEARCH PATH OPTIONS#homepath .rompath romshashpath hashsamplepath samplesartpath artworkctrlrpath ctrlrinipath .;ini;ini/presetsfontpath .cheatpath cheatcrosshairpath crosshairpluginspath plugins
## PLUGINS OPTIONS#autofire 0cheat 0cheatfind 0commonui 0console 0data 1defenderlr 1
Confirmed. Your updated files look rock solid.
I know the "defender.ini" file is really simple, but it wouldn't hurt to include it on the Github.The other thing that he should have is a Readme.md file to explain the plugin and how to use it for those who are . . . less technically inclined . . . and don't know how the MAME plugin system works. Maybe something like this?The opening is mostly borrowed from his Reddit post here.
One unknown item is whether or not the plugin works with versions of MAME before v0.231. - One Redditor tried it with v0.167, but that version was way too old for some of the features in the script.
input = manager.machine.inputioport = manager.machine.ioportmemory = manager.machine.devices[':maincpu'].spaces['program']
if tonumber(emu.app_version()) >= 0.196 then if type(manager.machine) == "userdata" then mac = manager.machine else mac = manager:machine() end input = mac.input ioport = mac.ioport memory = mac.devices[':maincpu'].spaces['program'] else print("ERROR: This plugin requires MAME version 0.196 or greater.")end
Good news. Aaron has accepted our changes to the defenderlr plug-in and his repository is updated. Version is now 3.https://github.com/AaronBPaden/defenderlr
Finally got a chance to update and test. Everything works great!
I tried to adapt it for Stargate by copying the plugin files to a "stargatelr" folder and changing "defender" to "stargate" in the .json and .lua files -- and it half-way worked! - Left and right on the joystick trigger thrust, but they do not reverse direction.I figure that this is either due to a change in the default button/keystroke for reverse (Z for Defender vs. Shift for Stargate) or a change in the memory location "FACING_ADDRESS = 0xA0BB". (line 28 of the .lua)What do you think, Jon?
It's the facing address. If you set that to "FACING_ADDRESS = 0x9C92" then it should work for you. If that's all good then I could merge the stargate into defenderlr so we are only maintaining one plugin.
With that address change, everything appears to work fine in my copied/edited version of the plugin.
Can you launch Defender in MAME? "mame.exe defender" - If not, you need to find the correct version of the "defender.zip" ROM file for your version of MAME and put it the "\mame\roms" folder. (ROM not provided here.)
Can you launch Defender and Stargate in MAME? "mame.exe defender" and "mame.exe stargate" - If not, you need to find the correct version of the "defender.zip" and "stargate.zip" ROM files for your version of MAME and put them the "\mame\roms" folder. (ROMs not provided here.)
Make a text file named "defender.ini" in either the ini folder or the same folder as the MAME executable. - It should contain the text "plugin defenderlr".
Make text files named "defender.ini" and "stargate.ini" in either the ini folder or the same folder as the MAME executable. - They should contain the text "plugin defenderlr".
Now you're ready to play Defender and blast those pesky aliens.
Now you're ready to play Defender or Stargate and blast those pesky aliens.
I have merged the stargate change into defenderlr and tested ok. Plugin version is now 4.0. I have sent a request to Aaron to update his original git repo.I made a fork so you can easily grab the files for the v4 release in a zip at: https://github.com/10yard/defenderlr/releases
Outside of github I tend to use https://stackedit.io/ for editing/reviewing markdown.
I made a tweak to your latest readme to emphasise code blocks using ``` tags.
If that's all good with you then I will send Aaron another pull request.
2. If you don't already have one, create a mame.ini file using the ```mame -cc``` (create config) command.
2. If you don't already have one, create a "mame.ini" file using the ```mame -cc``` (create config) command.
1. Can you launch Defender and Stargate in MAME? 'mame.exe defender' and 'mame.exe stargate'?
1. Can you launch Defender and Stargate in MAME? `mame.exe defender` and `mame.exe stargate`
1. Can you launch Defender and Stargate in MAME? (`mame.exe defender` and `mame.exe stargate`)
1. Can you launch Defender (`mame.exe defender`) and Stargate (`mame.exe stargate`) in MAME?
Just figured out what I was doing wrong. I used the single-quote ' (un-shifted " key) next to the ENTER key instead of the backtick ` (un-shifted ~ key) next to the ESC key. I understand why you would use a ``` (fenced code block) tag for multi-line .ini file content, but why use it instead of a ` (code) tag for the inline commands and settings?- You used single backtick code tags lots of times for inline code in your DKAFE Readme.md file.
Line 18: Add double quotes around mame.ini. (all other filenames have them) ChangeQuote2. If you don't already have one, create a mame.ini file using the ```mame -cc``` (create config) command. toQuote2. If you don't already have one, create a "mame.ini" file using the ```mame -cc``` (create config) command.----------------------Add a blank line between lines 15 and 16 so current line 16 renders as a paragraph like current line 20 does.----------------------Line 15:- Change the single-quotes to backticks -- your choice single (code tag, shown) or triple. (fenced code block tag)- Delete the second question mark (you're stating the correct commands to launch the games) or put the second half of the line in one set of parentheses or put the command after the game name. ChangeQuote1. Can you launch Defender and Stargate in MAME? 'mame.exe defender' and 'mame.exe stargate'? toQuote1. Can you launch Defender and Stargate in MAME? `mame.exe defender` and `mame.exe stargate` orQuote1. Can you launch Defender and Stargate in MAME? (`mame.exe defender` and `mame.exe stargate`) orQuote1. Can you launch Defender (`mame.exe defender`) and Stargate (`mame.exe stargate`) in MAME?The only remaining odd rendering is on lines 20, 35, 60, and 66 where the multiple spaces like "defenderlr 0" are auto-formatted to a single space like "defenderlr 0" -- not sure if it's possible to change this.
Thanks for being so thorough!
Defender and Stargate directional movement plugin:https://github.com/BPaden/defenderlr