MAME: How to ... ?

want to talk about MESS/model b/beebem/b-em/electrem/elkulator? do it here!
Post Reply
User avatar
Pernod
Posts: 1545
Joined: Fri Jun 08, 2012 10:01 pm
Location: Croydon, UK
Contact:

MAME: How to ... ?

Post by Pernod » Wed Feb 20, 2019 11:09 pm

I'm frequently asked how to do particular things in MAME, specifically how to setup a machine with various devices attached.

I'd appreciate it if questions about MAME usage could be kept to this thread, and avoid taking other threads off-topic with MAME questions.

At the time of writing the latest MAME release is 0.206 and I'll assume the latest is being used with all applicable ROMs for the machine being emulated.

General MAME documentation can be found at https://docs.mamedev.org/index.html.

I prefer to start MAME from commandline, as it enables me to select any expansion devices at startup. To list applicable devices for a machine you can do:

Code: Select all

mame64 electron -listslots

SYSTEM           SLOT NAME        SLOT OPTIONS     SLOT DEVICE NAME
---------------- ---------------- ---------------- ----------------------------
electron         exp              fbjoy            First Byte Joystick Interface
                                  m2105            Acorn M2105 Expansion
                                  plus1            Acorn Plus 1 Expansion
                                  plus2            Slogger Plus 2 Expansion
                                  plus3            Acorn Plus 3 Disc Expansion
                                  pwrjoy           Power Software Joystick Interface
                                  rombox           Slogger Rombox
                                  romboxp          Slogger Rombox+
                                  voxbox           Millsgrade Voxbox Speech Synthesiser
So the electron has an expansion slot (exp) which can be configured with any of the above devices. By default the electron has the plus3 attached, but this can be replaced with any device.
To start the Electron with Plus1 interface, AP5, and SEDFS you'd use:

Code: Select all

mame64 electron -exp plus1 -cart1 seds -cart2 ap5
Note: -cart options only available with plus1 and romboxp as you'd expect with real hardware.

In addition to using the commandline there is an internal MAMEUI, which is usually accessed by pressing ScrollLock (to enable UI mode) then Tab to enter the UI.
mameui.png
And selecting Slot Devices:
slots.png
Here we can see which devices are currently in each available slot, and see that the AP5 exposes more slots, including 1mhzbus where you can select beebsid (or any other available 1mhzbus device). After changing any devices you should always Reset the machine.
Note: beebsid has a passthrough port so exposes another 1mhzbus slot.

To mount a floppy image you use the File Manager:
fileman.png
This will allow you to navigate your file system and select a floppy image (ssd, dsd, adf, etc.).

Similarly for the BBC there are various slots:

Code: Select all

mame64 bbcb -listslots

SYSTEM           SLOT NAME        SLOT OPTIONS     SLOT DEVICE NAME
---------------- ---------------- ---------------- ----------------------------
bbcb             rs232            dec_loopback     RS232 Loopback (DEC 12-15336-00)
                                  ie15             IE15 Terminal
                                  keyboard         Serial Keyboard
                                  loopback         RS232 Loopback
                                  null_modem       RS232 Null Modem
                                  printer          Serial Printer
                                  pty              Pseudo terminal
                                  sunkbd           Sun Keyboard Adaptor
                                  terminal         Serial Terminal

                 centronics       ap2000           Epson ActionPrinter 2000
                                  covox            Covox Speech Thing
                                  covox_stereo     Covox (Stereo-in-1)
                                  ex800            Epson EX-800
                                  lx800            Epson LX-800
                                  lx810l           Espon LX-810L
                                  p72              NEC PinWriter P72
                                  pl80             COMX PL-80
                                  printer          Centronics Printer

                 fdc              acorn1770        Acorn 1770 FDC
                                  acorn8271        Acorn 8721 FDC
                                  ams3             AMS 3" Microdrive Disc System
                                  cumana1          Cumana QFS 8877A FDC
                                  cumana2          Cumana QFS Issue 2 8877A FDC
                                  cv1797           Computer Village 1797 FDC
                                  microware        Microware DDFS FDC
                                  opus1770         Opus D-DOS(B) 1770 FDC
                                  opus2791         Opus 2791 FDC
                                  opus2793         Opus 2793 FDC
                                  opus8272         Opus 8272 FDC
                                  stl1770_1        Solidisk 1770 DDFS Issue 1 FDC
                                  stl1770_2        Solidisk 1770 DDFS Issue 2 FDC
                                  stl8271          Solidisk Dual FDC (8271)
                                  weddb2           Watford Electronics DDB2 1772 FDC
                                  weddb3           Watford Electronics DDB3 1770 FDC

                 analogue         acornjoy         Acorn Analogue Joysticks
                                  bitstik1         Acorn Bitstik
                                  bitstik2         Robo Bitstik 2
                                  cfa3000a         Henson CFA 3000 Analogue
                                  voltmace3b       Voltmace Delta 3b Twin Joysticks

                 1mhzbus          b488             Aries-B488
                                  beebsid          BeebSID
                                  emrmidi          EMR BBC Midi Interface
                                  ieee488          Acorn IEEE-488 Interface
                                  opus3            Opus Challenger 3-in-1
                                  prisma3          Millipede PRISMA-3
                                  sprite           Logotron Sprite Board

                 tube             32016            Acorn 32016 2nd processor
                                  6502             Acorn 6502 2nd Processor
                                  65c102           Acorn 65C102 Co-Processor
                                  80186            Acorn 80186 Co-Processor
                                  80286            Acorn 80286 2nd Processor
                                  arm              ARM Evaluation System
                                  casper           Casper 68000 2nd Processor
                                  pmsb2p           PMS B2P-6502 Second Processor
                                  rc6502           ReCo6502 (65C02)
                                  rc65816          ReCo6502 (65C816)
                                  z80              Acorn Z80 2nd Processor
                                  zep100           Torch Z80 Communicator (Torch)

                 userport         amxmouse         AMX Mouse (BBC Micro)
                                  beebspch         Beeb Speech Synthesiser
                                  cfa3000kbd       Henson CFA 3000 Keyboard
                                  m512mouse        Acorn Master 512 Mouse
                                  tracker          Marconi RB2 Tracker Ball
So to start a BBC Model B with Acorn 1770 FDC, ADFS 1.30, AMX Mouse, 80186 2nd Processor, and the M512SystemDisc in the floppy drive you can:

Code: Select all

mame64 bbcb -fdc acorn1770 -rom2 adfs130 -tube 80186 -userport amxmouse -flop1 m512sys
Note: -rom2 adfs130 and -flop1 m512sys assume you have the software lists (ROMs, floppy images, cassette images, etc.) installed. Alternatively a filename to a local file can be used instead, ie. -rom2 adfs130.rom

All commandline options can also be selected individually from the internal MAMEUI.

Hope someone finds this useful, and feel free to post any other usage questions here :D
- Nigel

BBC Model B: ATPL Sidewise, Acorn Speech, 2xWatford Floppy Drives, AMX Mouse, Viglen case, BeebZIF, etc.

User avatar
tricky
Posts: 3465
Joined: Tue Jun 21, 2011 8:25 am
Contact:

Re: MAME: How to ... ?

Post by tricky » Thu Feb 21, 2019 8:04 am

Last time a tried it I got stuck in full screen mode and had to use the windows keys to get out. Is the idea that you should map an extra quit button?

I got excited when I saw beeb speech, what is the issue with adding the tms5220, is it just priorities and time?

Lastly, could you add a parallel d2a (resistor ladder) to 1mhz audio in as per b-em please? Default same volume as a sound channel maybe, but with its own volume level to represent different resistors.

User avatar
Pernod
Posts: 1545
Joined: Fri Jun 08, 2012 10:01 pm
Location: Croydon, UK
Contact:

Re: MAME: How to ... ?

Post by Pernod » Thu Feb 21, 2019 11:20 am

tricky wrote:
Thu Feb 21, 2019 8:04 am
Last time a tried it I got stuck in full screen mode and had to use the windows keys to get out. Is the idea that you should map an extra quit button?
I prefer to run in window mode. On commandline add -window, or edit your mame.ini and set window to 1:

Code: Select all

#
# OSD VIDEO OPTIONS
#
video                     bgfx
numscreens                1
window                    1
maximize                  1
waitvsync                 0
syncrefresh               0
monitorprovider           auto
To quit from full screen mode you would usually enter UI mode (ScrollLock) then press Escape to quit. This can be annoying if you forget you're in UI mode and Escape quits emulation instead of emulating the Escape key. So also set confirm_quit in mame.ini:

Code: Select all

#
# CORE MISC OPTIONS
#                 
confirm_quit              1
All commandline and ini options are documented at https://docs.mamedev.org/commandline/co ... index.html
tricky wrote:
Thu Feb 21, 2019 8:04 am
I got excited when I saw beeb speech, what is the issue with adding the tms5220, is it just priorities and time?
Last time I looked at it I suspected 6522 issues, though this may have changed recently so may be worth another visit.
tricky wrote:
Thu Feb 21, 2019 8:04 am
Lastly, could you add a parallel d2a (resistor ladder) to 1mhz audio in as per b-em please? Default same volume as a sound channel maybe, but with its own volume level to represent different resistors.
You can already adjust volumes of any sound device, enter UI mode (ScrollLock) then Tab to open UI and select Slider Controls.
- Nigel

BBC Model B: ATPL Sidewise, Acorn Speech, 2xWatford Floppy Drives, AMX Mouse, Viglen case, BeebZIF, etc.

User avatar
tricky
Posts: 3465
Joined: Tue Jun 21, 2011 8:25 am
Contact:

Re: MAME: How to ... ?

Post by tricky » Thu Feb 21, 2019 12:33 pm

Thanks, scroll-lock is a good tip ;)
And adding a d2a on the parallel port connected to audio in on the 1MHz bus?
I think that my AstroBlaster (not all versions) will use it in attract mode before the main game has started.

User avatar
Pernod
Posts: 1545
Joined: Fri Jun 08, 2012 10:01 pm
Location: Croydon, UK
Contact:

Re: MAME: How to ... ?

Post by Pernod » Thu Feb 21, 2019 12:38 pm

tricky wrote:
Thu Feb 21, 2019 12:33 pm
And adding a d2a on the parallel port connected to audio in on the 1MHz bus?
I think that my AstroBlaster (not all versions) will use it in attract mode before the main game has started.
You've lost me on this, why and what does it do, what would I expect to behave differently?
- Nigel

BBC Model B: ATPL Sidewise, Acorn Speech, 2xWatford Floppy Drives, AMX Mouse, Viglen case, BeebZIF, etc.

User avatar
tricky
Posts: 3465
Joined: Tue Jun 21, 2011 8:25 am
Contact:

Re: MAME: How to ... ?

Post by tricky » Thu Feb 21, 2019 10:53 pm

It converts the 8 bit digital value on the printer port ignoring the other printer signals to an analogue voltage going into the internal amplifier.
You can then use it as a more efficient, more accurate way of playing samples or notes too low for the sound chip.

User avatar
davidb
Posts: 2402
Joined: Sun Nov 11, 2007 10:11 pm
Contact:

Re: MAME: How to ... ?

Post by davidb » Sat Feb 23, 2019 5:37 pm

Is there a way to compile MAME for only one system, or do I have to do a full build first?
I tried this:

Code: Select all

make SOURCES=src/mame/drivers/electron.cpp TOOLS=1
It seems to want to process a lot of things that aren't at all related to the Electron.

User avatar
Pernod
Posts: 1545
Joined: Fri Jun 08, 2012 10:01 pm
Location: Croydon, UK
Contact:

Re: MAME: How to ... ?

Post by Pernod » Sat Feb 23, 2019 5:44 pm

davidb wrote:
Sat Feb 23, 2019 5:37 pm
Is there a way to compile MAME for only one system, or do I have to do a full build first?
I tried this:

Code: Select all

make SOURCES=src/mame/drivers/electron.cpp TOOLS=1
It seems to want to process a lot of things that aren't at all related to the Electron.
That is correct, though I tend to add SUBTARGET=elk, and you don't need TOOLS.
- Nigel

BBC Model B: ATPL Sidewise, Acorn Speech, 2xWatford Floppy Drives, AMX Mouse, Viglen case, BeebZIF, etc.

User avatar
KenLowe
Posts: 588
Joined: Mon Oct 18, 2004 4:35 pm
Location: Scotland
Contact:

Re: MAME: How to ... ?

Post by KenLowe » Fri May 03, 2019 1:04 pm

Hi Nigel,

Would you consider adding the IntegraB ROM / RAM / shadow RAM / RTC expansion board to MAME? It's something I added to BeebEm many years ago, if you wanted to look at the code.

TIA for considering.
Ken.

User avatar
Pernod
Posts: 1545
Joined: Fri Jun 08, 2012 10:01 pm
Location: Croydon, UK
Contact:

Re: MAME: How to ... ?

Post by Pernod » Fri May 03, 2019 1:36 pm

KenLowe wrote:
Fri May 03, 2019 1:04 pm
Would you consider adding the IntegraB ROM / RAM / shadow RAM / RTC expansion board to MAME? It's something I added to BeebEm many years ago, if you wanted to look at the code.
It's something that I want to add, along with various other ROM/RAM boards, especially those that include their own ROM manager like Aries, Integra, Raven, Solidisk, Watford. Ideally they should be defined as slot devices, but this requires them to have a common interface. Other add-ons have well defined interfaces like Tube, User Port, 1MHz Bus, but ROM/RAM boards are all different with flying leads into various points and some also clip directly to the 6502.

I could easily add them as derivative machines such as 'BBC Model B with IntegraB', 'BBC Model B with Aries B32' but that would make the code rather messy having conditions for each board type, and adding derivatives for this purpose is not the MAME way of doing things. I need to define a common slot interface that will cater for all boards so that they can be chosen and selected from the Slot Options menu. The Aries boards cause more problems as you can have both B12 and B20 fitted.

So yes I am considering it but don't yet have a workable plan for implementation. When I get one board in the rest will quickly follow.
- Nigel

BBC Model B: ATPL Sidewise, Acorn Speech, 2xWatford Floppy Drives, AMX Mouse, Viglen case, BeebZIF, etc.

User avatar
KenLowe
Posts: 588
Joined: Mon Oct 18, 2004 4:35 pm
Location: Scotland
Contact:

Re: MAME: How to ... ?

Post by KenLowe » Sun May 05, 2019 9:20 pm

Thanks for the reply. I did notice that your code is quite modular and wondered how these types of boards would fit that structure.

I can't talk for all the RAM / ROM boards, but most flying leads are probably just picking up R/W and ROM select signals.

However, as you've highlighed, the IntegraB is one of those boards that uses the 6502 socket to pick up various signals. It uses the 6502 primarily to pick up data and address lines for address decoding (&FE30 for ROM decoding, &FE34 for Shadow / private RAM selection & &FE38 / &FE3C for RTC address / data decoding), but also intercepts and manipulates the Clk & R/W signals before sending them back to the main board - these signals are disabled when Shadow RAM is being accessed.

Here's hoping you find a reasonable way to integrate these cards into your code!

bob147
Posts: 10
Joined: Thu May 02, 2019 9:02 pm
Contact:

Re: MAME: How to ... ?

Post by bob147 » Thu Jun 13, 2019 7:54 pm

A subtlety of MAME that I don't think is particularly well advertised (and took me a while to get my head around) is that the command line is alot more forgiving than the internal UI when it comes to having exactly the right set of files to run a machine.

For example, if you have the bios files but don't have all of the extra alternative file system stuff, the UI will throw an error saying 'missing files', but running from command line will still work fine. Similarly, you can also load some software using a normal file path rather than via the software list this way if you want. Makes life slightly easier.

Figured this might be of help to people that are struggling with getting things going or just want to mess around with it a bit. For doing anything interesting though, it's worth the effort to get the software lists set up properly. As you can probably tell I'm a big fan of MAME and Pernod's work over the last few years to enhance the BBC Micro emulation in that program.

User avatar
Pernod
Posts: 1545
Joined: Fri Jun 08, 2012 10:01 pm
Location: Croydon, UK
Contact:

Re: MAME: How to ... ?

Post by Pernod » Thu Jun 13, 2019 8:44 pm

bob147 wrote:
Thu Jun 13, 2019 7:54 pm
As you can probably tell I'm a big fan of MAME and Pernod's work over the last few years to enhance the BBC Micro emulation in that program.
Thanks :D
- Nigel

BBC Model B: ATPL Sidewise, Acorn Speech, 2xWatford Floppy Drives, AMX Mouse, Viglen case, BeebZIF, etc.

bob147
Posts: 10
Joined: Thu May 02, 2019 9:02 pm
Contact:

Re: MAME: How to ... ?

Post by bob147 » Fri Jun 14, 2019 11:15 am

MAME's a fun project to just keep an eye on in github. There's always someone working on something obscure and interesting. Didn't you add an opticians eye testing machine a while back? You never know what's gonna show up. If you ever need a tester for this stuff, I'd be happy to chip in when possible. Although with the rare expansions I'd have no idea what 'working' even looks like!

Post Reply