Previous Thread
Next Thread
Print Thread
Can't seem to get console plugin to work mame182 #111944
12/31/17 12:13 PM
12/31/17 12:13 PM
Joined: Feb 2014
Posts: 150
G
Golden Child Offline OP
Senior Member
Golden Child  Offline OP
Senior Member
G
Joined: Feb 2014
Posts: 150
Yes, it's an old version of mame 0.182 and 0.193 is out now, but I installed the mame from debian's stable package version. (Debian stretch)

I run "sudo apt-get install mame mame-data" to get mame installed.

It runs pretty well, but for some weird reason I can't get the console plugin to work.

mame -rompath "mameroms/;mamesoftware/" -console apple2e -ui_active -window -debug -confirm_quit -plugins -verbose

Everything launches fine and runs, but there's no lua console.

I decided to put some prints into the boot.lua file to see if something was happening. Debian puts the mame directory at /usr/share/games/mame and the boot.lua is at /usr/share/games/mame/plugins/boot.lua.

I also tried a more recent version of packaged mame 0.186 from dmo and was having the same problem.
http://deb-multimedia.org/dists/stable/main/binary-i386/package/mame

Code
cat /usr/share/games/mame/plugins/boot.lua 
-- license:BSD-3-Clause
-- copyright-holders:Miodrag Milanovic
require('lfs')

-- add helper to lfs for plugins to use
function lfs.env_replace(str)
	local pathsep = package.config:sub(1,1)
	local function dorep(val)
		ret = os.getenv(val)
		if ret then
			return ret
		end
		return val
	end

	if pathsep == '\\' then
		str = str:gsub("%%(%w+)%%", dorep)
	else
		str = str:gsub("%$(%w+)", dorep)
	end
	return str
end
local dir = lfs.env_replace(manager:options().entries.pluginspath:value())

package.path = dir .. "/?.lua;" .. dir .. "/?/init.lua"

local json = require('json')
local function readAll(file)
	local f = io.open(file, "rb")
	local content = f:read("*all")
	f:close()
	return content
end

function printt(t) for a,b in pairs(t) do print (a,b) end end

for file in lfs.dir(dir) do
	if (file~="." and file~=".." and lfs.attributes(dir .. "/" .. file,"mode")=="directory") then
		local filename = dir .. "/" .. file .. "/plugin.json"
		local meta = json.parse(readAll(filename))
print([=[meta["plugin"]["type"]]=],meta["plugin"]["type"])
print([=[meta["plugin"]["name"]]=],meta["plugin"]["name"])
print(mame_manager:plugins().entries,#mame_manager:plugins().entries)
printt(mame_manager:plugins().entries)

		if (meta["plugin"]["type"]=="plugin") and (mame_manager:plugins().entries[meta["plugin"]["name"]]~=nil) then
print("plugin entry found")
			local entry = mame_manager:plugins().entries[meta["plugin"]["name"]]
			if (entry:value()==true) then
				emu.print_verbose("Starting plugin " .. meta["plugin"]["name"] .. "...")
				plugin = require(meta["plugin"]["name"])
				if plugin.set_folder~=nil then plugin.set_folder(dir .. "/" .. file) end
				plugin.startplugin();
			end
		end
	end
end



output:

Code
mame -rompath "mameroms/;mamesoftware/" -console apple2e -ui_active -window -debug -confirm_quit -plugins 
meta["plugin"]["type"]	plugin
meta["plugin"]["name"]	data
table: 0x609b46e8	0
meta["plugin"]["type"]	library
meta["plugin"]["name"]	json
table: 0x609a1bf8	0
meta["plugin"]["type"]	plugin
meta["plugin"]["name"]	console
table: 0x609bdf28	0
meta["plugin"]["type"]	plugin
meta["plugin"]["name"]	cheat
table: 0x609be570	0
meta["plugin"]["type"]	plugin
meta["plugin"]["name"]	dummy
table: 0x609becd0	0
meta["plugin"]["type"]	plugin
meta["plugin"]["name"]	timer
table: 0x609bf4b8	0
meta["plugin"]["type"]	plugin
meta["plugin"]["name"]	layout
table: 0x609bfb18	0
meta["plugin"]["type"]	plugin
meta["plugin"]["name"]	cheatfind
table: 0x609c0240	0
meta["plugin"]["type"]	plugin
meta["plugin"]["name"]	hiscore
table: 0x609c0aa8	0
Debug Build: Disabling input grab for -debug
Debug Build: Disabling input grab for -debug
Debug Build: Disabling input grab for -debug
Average speed: 100.00% (13 seconds)


Code
mame -rompath "mameroms/;mamesoftware/" -console apple2e -ui_active -window -debug -confirm_quit -plugins -verbose
meta["plugin"]["type"]	plugin
meta["plugin"]["name"]	data
table: 0x60a82698	0
meta["plugin"]["type"]	library
meta["plugin"]["name"]	json
table: 0x60a6fbb8	0
meta["plugin"]["type"]	plugin
meta["plugin"]["name"]	console
table: 0x60a70258	0
meta["plugin"]["type"]	plugin
meta["plugin"]["name"]	cheat
table: 0x60a8c538	0
meta["plugin"]["type"]	plugin
meta["plugin"]["name"]	dummy
table: 0x60a8cc98	0
meta["plugin"]["type"]	plugin
meta["plugin"]["name"]	timer
table: 0x60a8d480	0
meta["plugin"]["type"]	plugin
meta["plugin"]["name"]	layout
table: 0x60a8dae0	0
meta["plugin"]["type"]	plugin
meta["plugin"]["name"]	cheatfind
table: 0x60a8e208	0
meta["plugin"]["type"]	plugin
meta["plugin"]["name"]	hiscore
table: 0x60a8ea70	0
Available videodrivers: x11 wayland dummy 
Current Videodriver: x11
	Display #0
		Renderdrivers:
			    opengl (0x0)
			 opengles2 (0x0)
			  software (0x0)
	Display #1
		Renderdrivers:
			    opengl (0x0)
			 opengles2 (0x0)
			  software (0x0)
Available audio drivers: 
	pulseaudio          
	alsa                
	sndio               
	dsp                 
	disk                
	dummy               
Build version:      0.182 (unknown)
Build architecure:  
Build defines 1:    SDLMAME_UNIX=1 SDLMAME_X11=1 SDLMAME_LINUX=1 
Build defines 1:    LSB_FIRST=1 
SDL/OpenGL defines: SDL_COMPILEDVERSION=2005 USE_OPENGL=1 
Compiler defines A: __GNUC__=6 __GNUC_MINOR__=3 __GNUC_PATCHLEVEL__=0 __VERSION__="6.3.0 20170124" 
Compiler defines B: __unix__=1 __i386__=1 
Compiler defines C: __USE_FORTIFY_LEVEL=0 
Enter init_monitors
Adding monitor screen0 (1920 x 1080)
Adding monitor screen1 (1280 x 1024)
Leave init_monitors
Enter sdlwindow_init
Using SDL multi-window OpenGL driver (SDL 2.0+)

Re: Can't seem to get console plugin to work mame182 [Re: Golden Child] #111971
01/02/18 02:50 AM
01/02/18 02:50 AM
Joined: Feb 2014
Posts: 150
G
Golden Child Offline OP
Senior Member
Golden Child  Offline OP
Senior Member
G
Joined: Feb 2014
Posts: 150
My idea was to get a mame running with a knoppix 8.1 live usb system, knoppix being based on debian. The knoppix live dvd is based on i386, not amd64.

That was what I was using in the post above.



I thought I'd try the "official debian stretch" live dvd and see how that worked.

http://cdimage.debian.org/debian-cd/current-live/amd64/bt-hybrid/

and I downloaded the debian-live-9.3 system based on lxde.

http://cdimage.debian.org/debian-cd...debian-live-9.3.0-amd64-lxde.iso.torrent


So after getting the iso, and using k3b to burn it to a dvd, I booted the live dvd.

Then I opened a terminal (System Tools/Lxterminal) and executed sudo apt-get update, then sudo apt-get install mame.


Code

user@debian:~$ uname -a
Linux debian 4.9.0-4-amd64 #1 SMP Debian 4.9.65-3 (2017-12-03) x86_64 GNU/Linux

user@debian:~$ lsb_release -a
No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux 9.3 (stretch)
Release:	9.3
Codename:	stretch

user@debian:~$ sudo apt-get update
Ign:1 http://deb.debian.org/debian stretch InRelease
Get:2 http://deb.debian.org/debian stretch Release [118 kB]
Get:3 http://deb.debian.org/debian stretch Release.gpg [2,434 B]
Get:4 http://deb.debian.org/debian stretch/main amd64 Packages [7,123 kB]
Get:5 http://deb.debian.org/debian stretch/main Translation-en [5,393 kB]
Fetched 12.6 MB in 4s (2,757 kB/s)                                 
Reading package lists... Done


user@debian:~$ sudo apt-get install mame
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  liblua5.3-0 libportaudio2 libsdl2-ttf-2.0-0 mame-data
Suggested packages:
  gnome-video-arcade mame-doc mame-extra mame-tools
The following NEW packages will be installed:
  liblua5.3-0 libportaudio2 libsdl2-ttf-2.0-0 mame mame-data
0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
Need to get 49.9 MB of archives.
After this operation, 261 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://deb.debian.org/debian stretch/main amd64 liblua5.3-0 amd64 5.3.3-1 [121 kB]
Get:2 http://deb.debian.org/debian stretch/main amd64 libportaudio2 amd64 19.6.0-1 [66.6 kB]
Get:3 http://deb.debian.org/debian stretch/main amd64 libsdl2-ttf-2.0-0 amd64 2.0.14+dfsg1-1 [15.4 kB]
Get:4 http://deb.debian.org/debian stretch/main amd64 mame-data all 0.182-1 [9,176 kB]                                                 
Err:5 http://deb.debian.org/debian stretch/main amd64 mame amd64 0.182-1                                                               
  503  first byte timeout [IP: 151.101.52.204 80]
Fetched 9,379 kB in 6h 46min 57s (384 B/s)
E: Failed to fetch http://deb.debian.org/debian/pool/main/m/mame/mame_0.182-1_amd64.deb  503  first byte timeout [IP: 151.101.52.204 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

I got a timeout over the network so I tried it again:

user@debian:~$ sudo apt-get install mame
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  liblua5.3-0 libportaudio2 libsdl2-ttf-2.0-0 mame-data
Suggested packages:
  gnome-video-arcade mame-doc mame-extra mame-tools
The following NEW packages will be installed:
  liblua5.3-0 libportaudio2 libsdl2-ttf-2.0-0 mame mame-data
0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
Need to get 40.5 MB/49.9 MB of archives.
After this operation, 261 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://deb.debian.org/debian stretch/main amd64 mame amd64 0.182-1 [40.5 MB]                                                         
Fetched 40.5 MB in 31s (1,286 kB/s)                                                                                                        
Selecting previously unselected package liblua5.3-0:amd64.
(Reading database ... 154686 files and directories currently installed.)
Preparing to unpack .../liblua5.3-0_5.3.3-1_amd64.deb ...
Unpacking liblua5.3-0:amd64 (5.3.3-1) ...
Selecting previously unselected package libportaudio2:amd64.
Preparing to unpack .../libportaudio2_19.6.0-1_amd64.deb ...
Unpacking libportaudio2:amd64 (19.6.0-1) ...
Selecting previously unselected package libsdl2-ttf-2.0-0:amd64.
Preparing to unpack .../libsdl2-ttf-2.0-0_2.0.14+dfsg1-1_amd64.deb ...
Unpacking libsdl2-ttf-2.0-0:amd64 (2.0.14+dfsg1-1) ...
Selecting previously unselected package mame-data.
Preparing to unpack .../mame-data_0.182-1_all.deb ...
Unpacking mame-data (0.182-1) ...
Selecting previously unselected package mame.
Preparing to unpack .../mame_0.182-1_amd64.deb ...
Unpacking mame (0.182-1) ...
Setting up libportaudio2:amd64 (19.6.0-1) ...
Processing triggers for mime-support (3.60) ...
Processing triggers for desktop-file-utils (0.23-1) ...
Processing triggers for libc-bin (2.24-11+deb9u1) ...
Processing triggers for man-db (2.7.6.1-2) ...
Setting up libsdl2-ttf-2.0-0:amd64 (2.0.14+dfsg1-1) ...
Setting up mame-data (0.182-1) ...
Setting up liblua5.3-0:amd64 (5.3.3-1) ...
Processing triggers for hicolor-icon-theme (0.15-1) ...
Setting up mame (0.182-1) ...
Processing triggers for libc-bin (2.24-11+deb9u1) ...


Ok, so it installed 0.182 fine, let's give it a try:

Code
user@debian:~$ mame -console
    _/      _/    _/_/    _/      _/  _/_/_/_/
   _/_/  _/_/  _/    _/  _/_/  _/_/  _/       
  _/  _/  _/  _/_/_/_/  _/  _/  _/  _/_/_/    
 _/      _/  _/    _/  _/      _/  _/         
_/      _/  _/    _/  _/      _/  _/_/_/_/    

mame 0.182	
Copyright (C) Nicola Salmoria and the MAME team

Lua 5.3	
Copyright (C) Lua.org, PUC-Rio

[LUA ERROR] in run: /usr/share/games/mame/plugins/console/init.lua:27: attempt to index a boolean value (local 'ln')




But for some reason there's a LUA ERROR because it can't seem to load the linenoise library. Weird.


Ok, so let's try the deb-multimedia.org mame 0.186 packages.

http://www.deb-multimedia.org/dists/stable/main/binary-amd64/package/mame
http://www.deb-multimedia.org/dists/stable/main/binary-amd64/package/mame-data.php

and I downloaded the amd64 deb packages:

http://www.deb-multimedia.org/pool/main/m/mame-dmo/mame_0.186-dmo1_amd64.deb
http://www.deb-multimedia.org/pool/main/m/mame-dmo/mame-data_0.186-dmo1_all.deb


I tried to install the i386 mame packages but they wouldn't install on the amd64 distribution (package architecture does not match)

Code
user@debian:~$ sudo dpkg -i mame_0.186-dmo1_i386.deb mame-data_0.186-dmo1_all.deb 
dpkg: error processing archive mame_0.186-dmo1_i386.deb (--install):
 package architecture (i386) does not match system (amd64)
(Reading database ... 156950 files and directories currently installed.)
Preparing to unpack .../mame-data_0.186-dmo1_all.deb ...
Unpacking mame-data (1:0.186-dmo1) over (0.182-1) ...
Setting up mame-data (1:0.186-dmo1) ...
Errors were encountered while processing:
mame_0.186-dmo1_i386.deb


So I tried the amd64 packages:


Code

user@debian:~$ sudo dpkg -i mame_0.186-dmo1_amd64.deb mame-data_0.186-dmo1_all.deb 
(Reading database ... 157055 files and directories currently installed.)
Preparing to unpack .../mame_0.186-dmo1_amd64.deb ...
Unpacking mame (1:0.186-dmo1) over (0.182-1) ...
Preparing to unpack .../mame-data_0.186-dmo1_all.deb ...
Unpacking mame-data (1:0.186-dmo1) over (1:0.186-dmo1) ...
Setting up mame-data (1:0.186-dmo1) ...
Setting up mame (1:0.186-dmo1) ...





and I see the mame console working...



Code
user@debian:~$ mame -verbose -console
    _/      _/    _/_/    _/      _/  _/_/_/_/
   _/_/  _/_/  _/    _/  _/_/  _/_/  _/       
  _/  _/  _/  _/_/_/_/  _/  _/  _/  _/_/_/    
 _/      _/  _/    _/  _/      _/  _/         
_/      _/  _/    _/  _/      _/  _/_/_/_/    

mame 0.186	
Copyright (C) Nicola Salmoria and the MAME team

Lua 5.3	
Copyright (C) Lua.org, PUC-Rio

Available videodrivers: x11 wayland dummy 
Current Videodriver: x11
	Display #0
		Renderdrivers:
			    opengl (0x0)
			 opengles2 (0x0)
			  software (0x0)
Available audio drivers: 
	pulseaudio          
	alsa                
	sndio               
	dsp                 
	disk                
	dummy               
Build version:      0.186 (unknown)
Build architecure:  
Build defines 1:    SDLMAME_UNIX=1 SDLMAME_X11=1 SDLMAME_LINUX=1 
Build defines 1:    LSB_FIRST=1 PTR64=1 
SDL/OpenGL defines: SDL_COMPILEDVERSION=2005 USE_OPENGL=1 
Compiler defines A: __GNUC__=4 __GNUC_MINOR__=2 __GNUC_PATCHLEVEL__=1 __VERSION__="4.2.1 Compatible Clang 3.8.1 (tags/RELEASE_381/final)" 
Compiler defines B: __amd64__=1 __x86_64__=1 __unix__=1 
Compiler defines C: __USE_FORTIFY_LEVEL=0 

...

Using SDL multi-window OpenGL driver (SDL 2.0+)

...

[MAME]> 
[MAME]> 
[MAME]> 
[MAME]> 
[MAME]> 
[MAME]> print("it works")
it works
[MAME]> 


So I'm still baffled why I can't get the console (or any plugins) working on knoppix 8.1 live dvd/usb.

Re: Can't seem to get console plugin to work mame182 [Re: Golden Child] #111975
01/02/18 01:14 PM
01/02/18 01:14 PM
Joined: Jan 2012
Posts: 796
C
crazyc Offline
Senior Member
crazyc  Offline
Senior Member
C
Joined: Jan 2012
Posts: 796
Complain to debian. They remove linenoise because we used to use linenoise-ng which includes a file they won't distribute. I switched to a different fork several months ago which should have satisfied them but they didn't add it back even after I mentioned it to one of the packagers.

Re: Can't seem to get console plugin to work mame182 [Re: crazyc] #111990
01/03/18 08:36 AM
01/03/18 08:36 AM
Joined: Feb 2014
Posts: 150
G
Golden Child Offline OP
Senior Member
Golden Child  Offline OP
Senior Member
G
Joined: Feb 2014
Posts: 150
I see how they've taken out the linenoise in the debian version. That explains why the console doesn't work.

from http://metadata.ftp-master.debian.org/changelogs/main/m/mame/mame_0.189+dfsg.1-1_changelog

Code
mame (0.182-1) unstable; urgency=medium

  * New upstream release.
  * Add kfreebsd_dirent.h_path.patch to fix dirent.h include path for
    kFreeBSD builds (thanks Steven Chamberlain; closes: #852507).
  * Drop ConvertUTF.* from the tarball as it is under the Unicode
    non-free license.
  * Add avoid_linenoise.patch: define NO_USE_LINENOISE and guard uses of
    linenoise code with it, to avoid the need to compile 3rdparty/linenoise.

 -- Jordi Mallach   Thu, 26 Jan 2017 01:56:43 +0100



I tried the debian 9.3 i386 and amd64 live dvds and was able to install the deb-multimedia.org 0.186 packages and I could get the lua console to work.



What's really wacky is why I'm having so much problem with a knoppix 8.1 live dvd. Sometimes I can the lua console to work with the 0.186 deb-multimedia.org packages, and other times not... I can't figure it out.



But I did discover in my searching that there's a mame 0.189 debian package that will install without adding anything to knoppix 8.1. (http://knoppix.net/get.php)

In my quest to get a portable flash drive system that will boot knoppix and be able to run mame...

I get the 189 packages from debian:

https://packages.debian.org/sid/mame

Package: mame (0.189+dfsg.1-1 and others)

https://packages.debian.org/sid/i386/mame/download
https://packages.debian.org/sid/i386/mame-data/download

http://ftp.us.debian.org/debian/pool/main/m/mame/mame_0.189+dfsg.1-1_i386.deb
http://ftp.us.debian.org/debian/pool/main/m/mame/mame-data_0.189+dfsg.1-1_all.deb

Then to install the mame 189 packages:

sudo dpkg -i mame_0.189+dfsg.1-1_i386.deb mame-data_0.189+dfsg.1-1_all.deb


and if I've got my roms in a big zip file I'll mount them readonly.

archivemount bigzip.zip myromsdir -o ro


and then

mame -rompath myromsdir

and everything seems to work, except the lua console...

Re: Can't seem to get console plugin to work mame182 [Re: Golden Child] #113588
06/14/18 03:57 PM
06/14/18 03:57 PM
Joined: Feb 2014
Posts: 150
G
Golden Child Offline OP
Senior Member
Golden Child  Offline OP
Senior Member
G
Joined: Feb 2014
Posts: 150
I just installed a fresh Ubuntu 18.04 and installed mame with "sudo apt install mame" and I noticed that the mame lua console works and it's version 195! Yay!

Re: Can't seem to get console plugin to work mame182 [Re: Golden Child] #113597
06/19/18 07:17 PM
06/19/18 07:17 PM
Joined: Apr 2015
Posts: 378
E
EoceneMiacid Online content
Senior Member
EoceneMiacid  Online Content
Senior Member
E
Joined: Apr 2015
Posts: 378
Installing mame from your distro's repo is nice and easy, but you'll always lag behind a bunch of versions.


Moderated by  R. Belmont 

Who's Online Now
0 registered members (), 124 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Shout Box
Forum Statistics
Forums9
Topics8,606
Posts112,517
Members4,828
Most Online296
Dec 5th, 2018
Powered by UBB.threads™ PHP Forum Software 7.6.1.1
(Release build 20180111)
Page Time: 0.038s Queries: 14 (0.019s) Memory: 5.6418 MB (Peak: 5.8279 MB) Zlib enabled. Server Time: 2018-12-16 15:15:31 UTC