DOF2DMD is a small utility for arcade cabinets to display game marquees, score and animations on a real or emulated DMD device.
It covers the following use cases:
DOF2DMD offers a simple HTTP API (see API) to display pictures, animations and scores.
One big use case is to interface DOFLinx and its modified version of MAME from DDH69 to get the DMD to show animations while playing MAME.
Here is how it looks like with an emulated DMD (using Freezy DMD extensions):
DOF2DMD relies on FlexDMD, which itself uses Freezy DMD extensions
Tweak settings.ini
if needed:
; Settings for DOF2DMD
; The base URL that DOF2DMD will listen to. Defaults to http://127.0.0.1:8080
; DO NOT COMMENT OUT, as DOFLinx reads settings.ini to determine where to send requests to
url_prefix=http://127.0.0.1:8080
; Display the score for x seconds, then back to marquee. Defaults to 5 seconds.
;display_score_duration_s=5
; Verbose output in debug.log file if debug=true. Defaults to false.
;debug=false
; Path of the artwork (relative to DOF2DMD or absolute). Defaults to "artwork"
;artwork_path=artwork
; Width in pixels for DMD. Defaults to 128
;dmd_width=128
; Height in pixels for DMD. Defaults to 32
;dmd_height=32
; Picture to display when DOF2DMD starts. Defaults to DOF2DMD (that is artwork/DOF2DMD.png or DOF2DMD.gif)
;start_picture=DOF2DMD
;Activate the autoshow of the Scoreboard or Marquee after using a call
;score_dmd=1
;marquee_dmd=1
; Not implemented ---
;scene_default=marquee
;number_of_dmd=1
;animation_dmd=1
DmdDevice.ini
The images and animations must be in the artwork
folder (by default in the DOF2DMD path under the artwork
folder).
[!NOTE] I provide a basic set of artwork, so that you can test and start editing DOFLINX's
.MAME
files. You probably need more artwork. I created a tool which may help - see artwork4DMD. In addition, there is a pack you can download, and more you can buy from Neo-Arcadia. If you own a PixelCade, then you are entitled to a massive pixel perfect DMD artwork library. To create your own artwork, you can use a Pixel Art tool or Gif editor, like aseprite. There are example aseprite files in theingame.src
folder.
DOF2DMD is a server listening to simple http request. Once it has started, you can use the following :
[url_prefix]/v1/display/picture?path=<image or video path>&animation=<fade|ScrollRight|ScrollLeft|ScrollUp|ScrollDown|None>&duration=<seconds>
[url_prefix]/v1/display/score?players=<number of players>&player=<active player>&score=<score>&cleanbg=<true|false>
[url_prefix]/v1/display/scorebackground?path=<image or video path>
[url_prefix]/v1/blank
This endpoint clears or blanks the display[url_prefix]/v1/exit
This endpoint exits or closes the application[url_prefix]/v1/version
This endpoint returns the version information of the application[url_prefix]/v1/loopstop
This endpoint stops an active infinite scroll text[url_prefix]/v1/display/text?text=<text>?size=XS|S|M|L|XL&color=<hex color>&font=<font>&bordercolor=<hex color>&bordersize=<0|1>&cleanbg=<true|false>&animation=<ScrollRight|ScrollLeft|ScrollUp|ScrollDown|None>&duration=<seconds>&loop=<true|false>
[url_prefix]/v1/display/advanced?path=<image or video path>&text=<text>?size=XS|S|M|L|XL&color=<hex color>&font=<font>&bordercolor=<hex color>&bordersize=<0|1>&cleanbg=<true|false>&animationin=<FadeIn|FadeOut|ScrollOffRight|ScrollOffLeft|ScrollOnLeft|ScrollOnRight|ScrollOffUp|ScrollOffDown|ScrollOnUp|ScrollOnDown|FillFadeIn|FillFadeOut|None>&animationout=<FadeIn|FadeOut|ScrollOffRight|ScrollOffLeft|ScrollOnLeft|ScrollOnRight|ScrollOffUp|ScrollOffDown|ScrollOnUp|ScrollOnDown|FillFadeIn|FillFadeOut|None>&duration=<seconds>
FadeIn|FadeOut|ScrollOffRight|ScrollOffLeft|ScrollOnLeft|ScrollOnRight|ScrollOffUp|ScrollOffDown|ScrollOnUp|ScrollOnDown|FillFadeIn|FillFadeOut|None
FadeIn|FadeOut|ScrollOffRight|ScrollOffLeft|ScrollOnLeft|ScrollOnRight|ScrollOffUp|ScrollOffDown|ScrollOnUp|ScrollOnDown|FillFadeIn|FillFadeOut|None
To generate effects, DOFLinx uses .MAME
files located in DOFLinx's MAME
folder. DOFLinx can communicate with DOF2DMD, using DOFLinx FF_DMD
command.
The FF_DMD
command can call any of the DOF2DMD APIs.
DOFLinx.ini
fileHere is a minimal DOFLinx.ini file which will work with DOF2DMD
:
# location of your files and systems
COLOUR_FILE=<DOFLinx path>\config\colours.ini
DIRECTOUTPUTGLOBAL=<DOFLinx path>\config\GlobalConfig_b2sserver.xml
PATH_MAME=<DOFLinx path>\MAME\
MAME_FOLDER=<MAME executable path (note: it must be DOFLinx modified MAME version)>
# When to activate, and more specifically what is the MAME process to kick things off
PROCESSES=Mame64
MAME_PROCESS=Mame64
# DOF2DMD
PATH_DOF2DMD=<location of DOF2DMD executable and settings.ini>
Note:
PATH_DOF2DMD
: the location of DOF2DMD executable and settings.iniMAME_FOLDER
: MAME executable path which must be DOFLinx's modified version of MAMEDOFLinx will generate the following commands automatically:
http://<host:port>/v1/version
- to check that DOF2DMD is up. DOFLinx will attempt to start it otherwise.http://<host:port>/v1/display/picture?path=mame/DOFLinx
- to display the DOFLinx welcome picturehttp://<host:port>/v1/display/picture?path=mame/<rom-name>&duration=<duration>&animation=<animation>
- to display a PNG for the marqueehttp://<host:port>/v1/display/score?player=<active player>&score=<score>&cleanbg=<true|false>
- to display score of the given playerhttp://<host:port>/v1/display/score?players=<number of players>&player=<active player>&score=<score>&cleanbg=<true|false>&credits=<credits>
- to display score of the given player inidicating the score board layout based on the number of playershttp://<host:port>/v1/display/score?player=1&score=0
- reset score to 0http://<host:port>/v1/blank
- to clear the DMD (goes to black)http://<host:port>/v1/exit
- to instruct DOF2DMD to exit cleanlyFF_DMD
DOFLinx commandTo add effects like showing animations or text during the game, you must insert
the FF_DMD
command in the <rom>.MAME
file which corresponds to the game.
FF_DMD,U,<DOF2DMD API CALL without host nor /v1/ prefix>
FF_DMD
is the commandU
is for a user command (DOFLinx specific)Examples :
artwork/ingame/bonus.gif
: FF_DMD,U,display/picture?path=ingame/bonus&duration=0&animation=none
artwork/mame/pacman.png
: FF_DMD,U,display/picture?path=mame/pacman&duration=-1
artwork/mame/pacman.gif
: FF_DMD,U,display/picture?path=mame/pacman&duration=-1
Check the .MAME
files included in DOFLinx, which already contain FF_DMD
commands.
Once DOF2DMD is started, you can use your browser to test it:
mame
, picture galaga
: http://127.0.0.1:8080/v1/display/picture?path=mame/galaga&duration=-1&animation=fade or use the demo.ps1
and demo2.ps1
PowerShell script.
Here is what I plan to implement :
settings.ini
I count on the Pinball and Arcade community to help each other through the GitHub discussions. I will be there too.
Thanks to