Dedicated machines under Linux/MacOS

Discussion of anything and everything relating to chess playing software and machines.

Moderator: Ras

cpeters
Posts: 190
Joined: Wed Feb 17, 2021 7:44 pm
Full name: Christian Petersen

Dedicated machines under Linux/MacOS

Post by cpeters »

Hello Alex!


The mame-team and other workers brought emulation of not only dedicated chess-computers - but here nothing else (making these work under Linux) is covered; for windows there are packed archives (from Franz Huber), for the Pi-enthusiasts picochess is available.

If one likes to play only against a certain machine, nothing but mame (and roms) is required; as soon as one does like to let play tournaments between them or does like have the games saved (through a chess GUI/programm like cutechess-cli) , we need more: the chessplugin for mame.

Mame is not static software, but ruthlessly enhanced (precise emulation trumps everything) and released often, so brakages can occur/some APIs are not stable.

This can pose some problems if you're dependent of the use (compuchess) of the chessplugin for mame/using a rolling distribution or either a too old one as mame+plugins have to be in sync to work properly.

For the actual plugin (synced with latest release, but version 230 should work, too) one can compile:
https://github.com/mamedev/mame/archive ... 231.tar.gz
Unpack..and continue as described here:
https://docs.mamedev.org/initialsetup/c ... gmame.html

For Debian/testing to fulfill the dependencies I think I had to install something like this:

Code: Select all

libsdl2-dev libsdl2-ttf-dev libfontconfig-dev qtbase5-dev-tools qtbase5-dev
besides build-essential git etc

Compilation starts with

Code: Select all

make
or

Code: Select all

make SUBTARGET=mess
I did:

Code: Select all

make SUBTARGET=tasc PRECOMPILE=0 REGENIE=1 SOURCES=src/mame/drivers/mephisto_academy.cpp,src/mame/drivers/mephisto_amsterdam.cpp,src/mame/drivers/mephisto_berlin.cpp,src/mame/drivers/mephisto_brikett.cpp,src/mame/drivers/mephisto_glasgow.cpp,src/mame/drivers/mephisto_milano.cpp,src/mame/drivers/mephisto_mm1.cpp,src/mame/drivers/mephisto_mm2.cpp,src/mame/drivers/mephisto_modena.cpp,src/mame/drivers/mephisto_modular.cpp,src/mame/drivers/mephisto_modular_tm.cpp,src/mame/drivers/mephisto_mondial.cpp,src/mame/drivers/mephisto_mondial2.cpp,src/mame/drivers/mephisto_mondial68k.cpp,src/mame/drivers/mephisto_montec.cpp,src/mame/drivers/mephisto_polgar.cpp,src/mame/drivers/mephisto_risc.cpp,src/mame/drivers/mephisto_smondial.cpp,src/mame/drivers/saitek_ccompan.cpp,src/mame/drivers/saitek_chesstrv.cpp,src/mame/drivers/saitek_cp2000.cpp,src/mame/drivers/saitek_delta1.cpp,src/mame/drivers/saitek_exchess.cpp,src/mame/drivers/saitek_intchess.cpp,src/mame/drivers/saitek_leonardo.cpp,src/mame/drivers/saitek_mark5.cpp,src/mame/drivers/saitek_minichess.cpp,src/mame/drivers/saitek_prschess.cpp,src/mame/drivers/saitek_renaissance.cpp,src/mame/drivers/saitek_risc2500.cpp,src/mame/drivers/saitek_schess.cpp,src/mame/drivers/saitek_simultano.cpp,src/mame/drivers/saitek_ssystem3.cpp,src/mame/drivers/saitek_stratos.cpp,src/mame/drivers/saitek_corona.cpp,src/mame/drivers/saitek_superstar.cpp,src/mame/machine/fidel_clockdiv.cpp,src/mame/drivers/fidel_as12.cpp,src/mame/drivers/fidel_card.cpp,src/mame/drivers/fidel_cc1.cpp,src/mame/drivers/fidel_cc10.cpp,src/mame/drivers/fidel_cc7.cpp,src/mame/drivers/fidel_chesster.cpp,src/mame/drivers/fidel_csc.cpp,src/mame/drivers/fidel_dames.cpp,src/mame/drivers/fidel_desdis.cpp,src/mame/drivers/fidel_eag68k.cpp,src/mame/drivers/fidel_elite.cpp,src/mame/drivers/fidel_excel.cpp,src/mame/drivers/fidel_msc.cpp,src/mame/drivers/fidel_phantom.cpp,src/mame/drivers/fidel_sc12.cpp,src/mame/drivers/fidel_sc6.cpp,src/mame/drivers/fidel_sc8.cpp,src/mame/drivers/fidel_sc9.cpp,src/mame/drivers/fidel_vcc.cpp,src/mame/drivers/fidel_vsc.cpp,src/mame/drivers/tasc.cpp,src/mame/drivers/chessmst.cpp,src/mame/drivers/kc.cpp,src/mame/machine/kc.cpp,src/mame/machine/kc_keyb.cpp,src/mame/video/kc.cpp,src/mame/drivers/lc80.cpp,src/mame/drivers/mc8020.cpp,src/mame/drivers/mc8030.cpp,src/mame/drivers/poly880.cpp,src/mame/drivers/sc2.cpp,src/mame/drivers/novag_cexpert.cpp,src/mame/drivers/novag_cforte.cpp,src/mame/drivers/novag_const.cpp,src/mame/drivers/novag_diablo.cpp,src/mame/drivers/novag_micro.cpp,src/mame/drivers/novag_micro2.cpp,src/mame/drivers/novag_savant.cpp,src/mame/drivers/novag_sexpert.cpp,src/mame/drivers/novag_snova.cpp
-this will compile only aforementioned chess-drivers (some might be missing) and (more than) basic stuff to work
-binary is called 'tasc'
-no precompiled headers (had problems with it)
-regenerates settings, as I played with stuff
-use just one thread (one can do

Code: Select all

-j2/3/4567
of course, but RAM is of the essence here (if you do have got only 8 gig, "-j3" is likely to force swapping

Caveat compiling: paths. Later we have to be concerned (use absolute ones in ini-files/everywhere) about them, otherwise configuring chessprograms to make use of our compis will likely fail.

But there are also packages, even for LTS-Ubuntu-releases:

https://sdlmame.wallyweek.org/download/
(for ARM)
https://launchpad.net/~c.falco/+archive ... _arm64.deb

Installable (as root) then with

Code: Select all

apt install mame_0.231+dfsg.1-0ubuntu1~ppa1~focal1_arm64.deb
This package wasn't built by some rando, but the actual Ubuntu-maintainer for mame.

So now we should have mame and with

Code: Select all

git clone https://github.com/sronco/mame-chessengine/
we fetch the plugin. If locally compiled, the subdirectory 'chessengine' has to be moved into the mame/plugins folder, when installed with apt we can do

Code: Select all

sudo cp -r /path/to/mame-chessengine/chessengine /usr/share/games/mame/plugins/ 
or whereever the plugin folder is in our system.

For MacOS, if brew is installed, this should fetch it:

Code: Select all

brew install mame
Look for the plugins-folder then and move Sandro's magnificent thingy in it.
cpeters
Posts: 190
Joined: Wed Feb 17, 2021 7:44 pm
Full name: Christian Petersen

Re: Dedicated machines under Linux/MacOS

Post by cpeters »

When mame (or the fine 'tasc') is started from commandline, it will likely fill the whole screencreate and create a

Code: Select all

.mame
directory.

In this directory we can fiddle with options.
With GUI it is also possible (Menu point "Configure Options'):
Image

and then:

Image

and:

Image

Return to Previous menu and save.
cpeters
Posts: 190
Joined: Wed Feb 17, 2021 7:44 pm
Full name: Christian Petersen

Re: Dedicated machines under Linux/MacOS

Post by cpeters »

Now we need roms.

They are all over in the net. However, the use may be questionable (if one does not own the actual physical device) or licensed like this:

https://gitlab.com/lucaapp/android/-/ra ... fc/LICENSE

(just look, don't touch).

https://archive.org/download/mame.0229

They act as a library and therefore are excempted by DMCA-takedown notices - at least in the USA.
https://www.copyright.gov/1201/docs/120 ... dation.pdf
https://archive.org/post/82097/internet ... yright-act

So looking, yes. Using, no. Don't touch.
cpeters
Posts: 190
Joined: Wed Feb 17, 2021 7:44 pm
Full name: Christian Petersen

Re: Dedicated machines under Linux/MacOS

Post by cpeters »

Now then.

The mame-chessengine-plugin translates 'UCI' and makes moves for us in theory and praxis. In the interfaces subdirecty we find the machines the plugin can talk with.

It might look like this

Code: Select all

plugins/chessengine/interfaces/tascr30.lua
:
-- license:BSD-3-Clause

interface = {}

interface.level = "010 sec/move"
interface.cur_level = nil
interface.levelnum = 1
interface.style = "normal"
interface.cur_style = nil
interface.stylenum = 3

local function setdigits(n)
local dram = machine.devices[':lcd:lcdc'].spaces['display']
send_input(":IN.3", 0x20, 0.25) -- Enter
for i=1,n do
if (n == 7 and (i == 3 or i == 5)) then
-- skip char
else
local k = tonumber(interface.level:sub(i,i)) - (dram:read_u8(0x119+i)-0x10)
ETC...
These are the only options we can change/use while playing with a chessprogramm.
interface.level = "010 sec/move"
interface.cur_level = nil
interface.levelnum = 1
interface.style = "normal"
interface.cur_style = nil
interface.stylenum = 3

The documentations/manuals from here:
http://www.zanchetta.net/
give detailed information.
cutechess-cli -wait 300 -engine name="Mephisto Genius 68030 NORML 4" \
cmd="mame -inipath /path/to/ini/folder/ -plugin \ chessengine gen32" \
timemargin=22000 st=600 option.Level="NORML 4" \
-engine name="Tasc R30 The King 2.5" \
cmd="mame -inipath /path/to/ini/folder/ -plugin chessengine tascr30" \
tc=40/4500 timemargin=15000 option.Level="40/0:40 moves/hrs" \
-each whitepov proto=uci -games 40 -rounds 6 -site Gambit -pgnout test-1.pgn -debug
Everything (time-controls, style if any, levels etc.) can only be set for the comps through the

Code: Select all

option.Level="option from lua for the comp" 
for cutechess-cli for example.


Hope this helps.


Greetings.
cpeters
Posts: 190
Joined: Wed Feb 17, 2021 7:44 pm
Full name: Christian Petersen

Re: Dedicated machines under Linux/MacOS

Post by cpeters »

Options for chessprograms.

The plugin cannot parse (from the machine itself) the available options for the dedicated machine (think of command 'uci' that you send to an engine and you see them all). If the option is not implemented in the corresponding lua-file, it does'nt exist for the chess-programm.

As we see:
Image

for the Genius, everything is fixed. Average (30 seconds average may also mean 2 minutes/move) movetime, he understands but 40 moves in 40 minutes he does not. One could program/script that of course (all in the manual), but now, default, it's not possible.
If one thinks that he must move strict, one must set "TURN *" controls.
As consecutive/repeating time-controls are not implemented in UCI (yet), this makes it difficult sometimes.

If emulation is slow (when started from commandline, you'll be told the speed in %)/sub realtime it is also problematic, because you've to compensate in GUI/cutechess-cli.

Tasc is more flexible in entering time-controls though.


Have fun!