June 03, 2024, 05:25:10 pm
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
Attempting load of mame.iniParsing mame.iniAttempting load of mame.iniParsing mame.iniAttempting load of horizont.iniAttempting load of raster.iniParsing raster.iniAttempting load of source\williams.iniAttempting load of defender.iniParsing defender.iniLoading translation file language\English\strings.moReading translation file: 1 strings, original table at word offset 7, translated table at word offset 9Loaded 0 translated string from fileStarting plugin data...Starting plugin defenderlr...Attempting load of mame.iniParsing mame.iniAttempting load of mame.iniParsing mame.iniAttempting load of horizont.iniAttempting load of raster.iniParsing raster.iniAttempting load of source\williams.iniAttempting load of defender.iniParsing defender.iniVideo: Monitor 65537 = "\\.\DISPLAY1" (primary)Direct3D: Using Direct3D 9Physical width 1360, height 768Direct3D: InitializeDirect3D: Configuring adapter #0 = NVIDIA GeForce GT 630Direct3D: YUV format = RGBDirect3D: Max texture size = 16384x16384Direct3D: Device created at 1360x768Direct3D: Initialize HLSLDirect3D: First store optionsDirect3D: HLSL initializedDirectSound: Primary buffer: 48000 Hz, 16 bits, 2 channelsInput: Adding keyboard #1: HID Keyboard Device (device id: \\?\HID#VID_21F8&PID_208A&MI_00&Col02#8&2b022778&0&0001#{884b96c3-56ef-11d1-bc8c-00a0c91405dd})Input: Adding keyboard #2: HID Keyboard Device (device id: \\?\HID#VID_21F8&PID_208A&MI_02#8&1eee75fb&0&0000#{884b96c3-56ef-11d1-bc8c-00a0c91405dd})Input: Adding mouse #1: HID-compliant mouse (device id: \\?\HID#VID_21F8&PID_208A&MI_01&Col01#8&72ae9b6&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd})Input: Adding lightgun #1: HID-compliant mouse (device id: \\?\HID#VID_21F8&PID_208A&MI_01&Col01#8&72ae9b6&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd})unzip: opened archive file roms\defender.zipunzip: found roms\defender.zip ECD at 980unzip: roms\defender.zip has no ZIP64 ECD locatorunzip: read roms\defender.zip central directoryunzip: closing archive file roms\defender.zip and sending to cacheunzip: found roms\defender.zip in cacheunzip: opened archive file roms\defender.zipunzip: closing archive file roms\defender.zip and sending to cacheunzip: found roms\defender.zip in cacheunzip: opened archive file roms\defender.zipunzip: closing archive file roms\defender.zip and sending to cacheunzip: found roms\defender.zip in cacheunzip: opened archive file roms\defender.zipunzip: closing archive file roms\defender.zip and sending to cacheunzip: found roms\defender.zip in cacheunzip: opened archive file roms\defender.zipunzip: closing archive file roms\defender.zip and sending to cacheunzip: found roms\defender.zip in cacheunzip: opened archive file roms\defender.zipunzip: closing archive file roms\defender.zip and sending to cacheunzip: found roms\defender.zip in cacheunzip: opened archive file roms\defender.zipunzip: closing archive file roms\defender.zip and sending to cacheunzip: found roms\defender.zip in cacheunzip: opened archive file roms\defender.zipunzip: closing archive file roms\defender.zip and sending to cacheunzip: found roms\defender.zip in cacheunzip: opened archive file roms\defender.zipunzip: closing archive file roms\defender.zip and sending to cacheunzip: found roms\defender.zip in cacheunzip: opened archive file roms\defender.zipunzip: closing archive file roms\defender.zip and sending to cacheunzip: found roms\defender.zip in cacheunzip: opened archive file roms\defender.zipunzip: closing archive file roms\defender.zip and sending to cacheunzip: found roms\defender.zip in cacheunzip: opened archive file roms\defender.zipunzip: closing archive file roms\defender.zip and sending to cacheunzip: found roms\defender.zip in cacheunzip: opened archive file roms\defender.zipunzip: closing archive file roms\defender.zip and sending to cacheunzip: found roms\defender.zip in cacheunzip: opened archive file roms\defender.zipunzip: closing archive file roms\defender.zip and sending to cacheOptional device ':pia_3' not foundOptional memory bank ':mainbank' not foundOptional memory region ':nvram' not foundOptional memory region ':screen' not foundStarting Defender (Red label) ':' (missing dependencies; rescheduling)Starting Motorola MC6809E ':maincpu'Starting Motorola MC6808 ':soundcpu'Starting NVRAM ':nvram'Starting Timer ':scan_timer'Starting Timer ':240_timer'Starting Watchdog Timer ':watchdog'Starting Video Screen ':screen'Starting palette ':palette'Starting Speaker ':speaker' (missing dependencies; rescheduling)Starting MC1408 DAC ':dac'Starting Input Merger (any high) ':mainirq'Starting Input Merger (any high) ':soundirq'Starting 6821 PIA ':pia_0'Starting 6821 PIA ':pia_1'Starting 6821 PIA ':pia_2'Starting Address Map Bank ':bankc000'Starting Defender (Red label) ':' (missing dependencies; rescheduling)Starting Speaker ':speaker'Starting Defender (Red label) ':'Attempting to parse: default.cfgAttempting to parse: defender.cfgAverage speed: 100.00% (11 seconds)Sound: buffer overflows=2 underflows=0
I also had no more luck with an install of mame 263 other than the workaround suggested (running from the command line). Hope there is a work around or update as this makes one of the most brutally difficult arcade games a little more accessible
Quote from: Begbie80 on March 25, 2024, 11:10:09 pmI also had no more luck with an install of mame 263 other than the workaround suggested (running from the command line). Hope there is a work around or update as this makes one of the most brutally difficult arcade games a little more accessibleI've tested my fork version of the defenderlr plugin (from 2021) and all seems to be working with MAME 0.263 including when switching between roms. There are deprecation warnings (for start/end callbacks) but this should not effect use and retains compatibility back to MAME 0.227Download link:https://github.com/10yard/defenderlr/releases/download/v4/defenderlr_v4.zip