Post subject: DOS/WindowsXP-/Linux/Flash in MAME and PCem? Testers needed!
Site Admin, Skilled player (1234)
Joined: 4/17/2010
Posts: 11251
Location: RU
UPDATE - 2018-06-05 So tons of testing was done. MAME runs DOS and somewhat runs Windows. Somewhat runs Linux, and does not run standalone FlashPlayer. It also has bugs in savestates, and doesn't really have solid emulation of anything after 486. Even after all the years of developement, their thread at Bannister forum ends with this:
PC/XT/AT (inside) WIP topic wrote:
Give PCem a shot until MAME matures some - it's quite good. I've even managed to install Windows XP with some recent cdrom fixes committed to the tree, and it works surprisingly well. On an emulated Pentium 233, Voodoo 2 and a functional network card, no less.
Amusingly, it's like a testament to us. Because what we need is solid emulation of as modern hardware as possible. Also, by the time MAME matures more, PCem will emulate x64 and nvidia cards I guess? So the setup is similar to what we were trying:
  • Install DOS. Either FreeDOS or MS-DOS. The former lets us ship DOS environment bundles ready for TASing.
  • Install x86 Windows, up to XP, inclusively. Even if we come up with ways to disable some features that may slow the system down or increase its memory usage, there's still no way to distribute it, so we have to install it from scratch.
  • Install x86 Linux. Some games work on Linux natively.
    • Use Wine on Linux. Library is a bit bigger than the the above.
  • Use standalone FlashPlayer
    • On Windows XP latest FP should work
    • Linux only has x86 FP versions up to 11.2. Recently Adobe started providing x64 standalone FP versions for Linux, but x64 is useless for us, because those emulators only emulate x86 machines.
There are billions of video and text tutorials how to set up PCem. And people say that it's way simpler than setting up PC emulation in MAME. Finally, PCem has solid chance of being ported to bizhawk, if we test it well and know exactly what we need from it. And it has dynamic recompiler! Impressive list if what PCem emulates: https://pcem-emulator.co.uk/status.html More details on those: https://bitbucket.org/pcem_emulator/pcem Downloads: https://pcem-emulator.co.uk/downloads.html Link to video Link to video Link to video Let's go!
OLD POST - 2018-05-26 Apparently, MAME can emulate machines that can run DOS, and therefore DOS games as well. Originally, it was done in MESS, MAME's clone designed to emulate everything but arcades. Then the 2 projects were merged, so now MAME emulates it all. But I have no idea how to set it up! I only can give you some links. Here's where you download latest MAME: http://mamedev.org/release.php Here's a thread talking about running DOS on it: http://forums.bannister.org//ubbthreads.php?ubb=showflat&Number=95414 Here's a DOS tutorial IN SPANISH: https://www.youtube.com/watch?v=uBZ65CyfrKI A few examples: https://www.youtube.com/watch?v=hAGUXZZNEgY https://www.youtube.com/watch?v=PVu1m09v5UI https://www.youtube.com/watch?v=ZsB9CMoFLDs Win 3.1 tutorial: Main hint: disable mouse in MAME during installation https://www.youtube.com/watch?v=FCAElO5qmR4
So what is this thread for? I would very much want people who know how to install games on actual DOS to try this environment out. Because integration of MAME into Bizhawk is one of my main coding goals. For arcades originally, but if it behaves nicely for DOS games, it'd be a killer!
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
DrD2k9
He/Him
Editor, Expert player, Judge (2036)
Joined: 8/21/2016
Posts: 1009
Location: US
I'll happily look into this and let you know what (if anything) I can figure out. EDIT: This is going to take some time....I'm not familiar with MAME, so i have to figure it out first. Then try and get DOS/FreeDOS running.
Expert player, Reviewer (2388)
Joined: 5/21/2013
Posts: 414
I'm in the same boat as DrD2k9. I've never used MAME in my life, but if this is a way to get DOS into Bizhawk, then I'll do whatever it takes. Good thing I have a long weekend coming up. I noticed all the posted videos use PC speaker, so we'll have to see if we can get proper sound working in this as well.
Site Admin, Skilled player (1234)
Joined: 4/17/2010
Posts: 11251
Location: RU
Prince of Persia uses MT32, Doom uses both. It seems to be optional, I just don't know how to enable proper sound card there.
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
Site Admin, Skilled player (1234)
Joined: 4/17/2010
Posts: 11251
Location: RU
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
Editor, Player (67)
Joined: 6/22/2005
Posts: 1041
I got SkyRoads running by following those instructions but setting up two 3.5" floppy drives, with the boot image from the JPC-rr distribution on A: and another one on B: containing the SkyRoads files. Note that the 2-GiB hard disk causes some error message about LBA when booting FreeDOS.
Current Projects: TAS: Wizards & Warriors III.
Site Admin, Skilled player (1234)
Joined: 4/17/2010
Posts: 11251
Location: RU
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
Joined: 9/12/2014
Posts: 535
Location: Waterford, MI
I’m excited about this too! I didn’t know anything about this!
Expert player, Reviewer (2388)
Joined: 5/21/2013
Posts: 414
I got Monster Bash to run on this. No sound yet, but I'll get to that next. Most importantly I figured out how to import your own hard drives into MAME. There's a "chdman" utility that comes with MAME that you can use to create hard drive images. Now it doesn't allow you to import folders directly, but if you create a virtual hard drive and put your files in there, it will happily convert that volume to a chd file. It MUST be FAT formatted and you have to specifically tell chdman not to compress it, or else it won't work. When you're in the CMOS setup you can ask it to auto-detect hard drives, so you don't have to manually enter the cylinders and all that stuff. This page helped me figure it out: http://www.thekillerinstinctproject.com/kiproject/chdman.html
Editor, Player (67)
Joined: 6/22/2005
Posts: 1041
I was able to get FreeDOS 1.2 installed in MAME with some hacking. You'll need the boot floppy and CDROM "standard" installer from the FreeDOS site to do this yourself.
  • Create a hard disk image using chdman. I used chdman createhd -o FDOS_hd.chd -c none -chs 1000,16,63 -ss 512 to get one that's around 492 MiB.
  • Run mame using something similar to mame64.exe -w -nomax ct486 -ramsize 64M -hard1 FDOS_hd.chd -flop1 FDOS.img, where FODS.img is the boot floppy. The FreeDOS installation should start, and you can use it to partition and then format the hard disk image. Restart in between, like it prompts you to do.
  • Ideally, you would now proceed with the installation using the boot floppy and the CD image. Unfortunately, it seems like MAME doesn't recognize the CD image when the boot floppy sets up CD support. I got around this by making another hard disk image using chdman createhd -o transfer.chd -c none -chs 1000,16,63 -ss 512, then partitioning and formatting that in MAME, then converting that to a raw image using chdman extractraw -o transfer.img -i transfer.chd, then using a FreeDOS installation in BOCHS to xcopy the files from the CD image to transfer.img, then converting back to a CHD via chdman createhd -o transferred.chd -i transfer.img -c none -chs 1000,16,63 -ss 512, and finally using transferred.chd as a D: drive in MAME. The FreeDOS setup seems to run OK even if the D: drive isn't actually a CD.
If anyone wants more details, please feel free to ask. I could also upload my final FDOS_hd.chd somewhere, if desired. That shouldn't run into any legal problems, should it? EDIT: You'll need to use the command-line option -board3:ide:ide:1 hdd -hard2 transferred.chd to let you use a second hard disk file in MAME. To add a CD drive, use -board3:ide:ide:1 cdrom -cdrom whatever.iso.
Current Projects: TAS: Wizards & Warriors III.
Expert player, Reviewer (2388)
Joined: 5/21/2013
Posts: 414
Hee hee. Quake runs in it. Not very quickly, but it runs. I wonder if there's a way to up the clock speed. I got sound working too. It turns out MAME already has Sound Blaster support built in there somewhere. To activate Sound Blaster 16 just throw this parameter into your launch batch file:
-isa5 sblaster_16
And put this in your autoexec.bat or just manually put it into the command prompt:
set BLASTER=A220 I5 D1 H5 T6
(is it bad that I can type that from memory now?)
DrD2k9
He/Him
Editor, Expert player, Judge (2036)
Joined: 8/21/2016
Posts: 1009
Location: US
And from all the above...we can see how slow I am at getting things accomplished. Congrats to everyone who's figured things out. Sorry I didn't contribute anything.
Site Admin, Skilled player (1234)
Joined: 4/17/2010
Posts: 11251
Location: RU
Oh boy, you guys are fantastic!!! Slamo, can you make a MAME recording of you playing Quake with SB16? -aviwrite video.avi This will make uncompressed AVI, so before sharing you might want to reencode it using something like virtualdub, with some lossless codec like lagarith. Dacicus, mame devs have an IRC chat where any setup question can be asked: #mame. I would talk to them myself, but I don't know what is not working exactly and how to express myself about something I don't know how to ask. Can you ask them if the problem you are having is a bug or by design, or maybe they know a workaround? They seem to be using such emulated machines with installed OSs quite a lot. This stuff even supports networking from those OSs! I don't think sharing HDD images with FreeDOS installed is illegal, but we'll need to research on this. Also, if we distribute such an image, I think it'd be handier if the HDD had smaller size? I think for any potential TAS one would need a dedicated HDD image to prevent messing things up. So I think it'd just need to be the size where the biggest DOS game would fit?
I found a thread that contains TONS of other installation instructions, like windows 2000, linux or amiga os. The wiki link above copies the first instruction from that thread. http://forums.bannister.org/ubbthreads.php?ubb=showflat&Number=86865
Important notes from IRC: Lord_Nightmare one important thing to note if you have a killer instinct or similar arcade hdd and want to 'update' it to a later version: please image the original drive first, MAME is missing MANY drive software versions Lord_Nightmare dumping the ata-identify page from drives is strongly recommended as well, theres a special utility to do that, ask on the dumping union forums Lord_Nightmare the ata identify page contains the drive serial number, drive type name, and some other important information that many games actually check!
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
Editor, Player (67)
Joined: 6/22/2005
Posts: 1041
I found the reason for and a solution to the CD problem. The FreeDOS 1.2 boot floppy uses udvd2.sys as the CD driver, but it doesn't work for the hardware that is being emulated. Another CD driver called oakcdrom.sys does work. I placed it into the fdsetup\bin directory of the boot floppy and edited autoexec.bat to use oakcdrom.sys instead of udvd2.sys (there's only one line that needs to be changed). FreeDOS then installed using the boot floppy and CD. EDIT: You'll have to add the same CD driver to the installation on the C: drive and to the autoexec.bat there in order to use it after installing FreeDOS.
Current Projects: TAS: Wizards & Warriors III.
Site Admin, Skilled player (1234)
Joined: 4/17/2010
Posts: 11251
Location: RU
Congratulations!!! So if we decide to distribute HDD images with FreeDOS on them, will it be needed to add anything else to such images, or you just put them in the right place and install the game? I mean, to figure out the legal nature of this, we need to know exactly what we distribute. And for that, we need to include as much as possible into those "distributives", so the only thing left to do is installing the game.
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
Editor, Player (67)
Joined: 6/22/2005
Posts: 1041
The largest potential problem I foresee is device drivers, such as sound cards and CD drives. IDK the status of this oakcdrom one, for example. It came from Oak Technology originally, which has been bought out by some other company. You can find it all over the Internet, but that doesn't mean it's legal to distribute.
Current Projects: TAS: Wizards & Warriors III.
Joined: 9/12/2014
Posts: 535
Location: Waterford, MI
Seeing how MAME games have different controller layouts for each machine, how would we implement those?
Site Admin, Skilled player (1234)
Joined: 4/17/2010
Posts: 11251
Location: RU
InfamousKnight wrote:
how would we implement those?
Depends on what you plan to implement.
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
Joined: 9/12/2014
Posts: 535
Location: Waterford, MI
feos wrote:
InfamousKnight wrote:
how would we implement those?
Depends on what you plan to implement.
Cool, a nice big team project. Making controller layouts shouldn’t be that hard at all. Where would I start?
Site Admin, Skilled player (1234)
Joined: 4/17/2010
Posts: 11251
Location: RU
Let's start with what you want to achieve. I don't think this whole setup will fit into bizhawk just yet. I'd rather add basic rerecording to MAME itself as a start. It already has movies and savestates, just not tied together. Porting this to bizhawk would have to resolve a huge pile of things, and we're not ready for solving them before we ensure the setup itself works.
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
Expert player, Reviewer (2388)
Joined: 5/21/2013
Posts: 414
feos wrote:
Slamo, can you make a MAME recording of you playing Quake with SB16?
Link to video You'll notice it takes a while to load up. It's all functional, though.
DrD2k9
He/Him
Editor, Expert player, Judge (2036)
Joined: 8/21/2016
Posts: 1009
Location: US
I noticed during boot-up a note of CPU clock speed at 25mhz in that Quake video...is there a way to adjust the CPU clock speed settings in MAME? EDIT: CPUs from the era when Quake was released were easily 100mhz+ and up to 300-400mhz by the next year.
Expert player, Reviewer (2388)
Joined: 5/21/2013
Posts: 414
This was requested, so here's a step-by-step tutorial. Creating and using a hard drive image for MAME in Windows This will tell you how to create a virtual hard drive and convert its contents into a .chd file to use in MAME. 1. Open up Disk Management. How to do this will vary depending on your version of Windows, but generally opening a "Run" prompt and typing "diskmgmt.msc" will work. 2. In the menu, click on Action -> Create VHD. It will open up a window called "Create and Attach Virtual Hard Disk". Put in whatever name and location you want for the .vhd file. Also enter the size you want the drive to be, but keep in mind FreeDOS will have issues with larger drives. Leave everything else as it is and press OK. 3. You should now see a new disk in the Disk Management window with the size that you specified. It will say "Disk x", with "x" being a number that depends on how many hard drives you already have loaded. Make note of this number, as it will be important later! Right click this new disk and click Initialize Disk. In the next window, select MBR (Master Boot Record) and click OK. 4. Now right click where the new disk says "Unallocated" and click on New Simple Volume. This will open the New Simple Volume Wizard. Click next until you have to assign a drive letter, and give it whatever drive letter you want. In the Format Partition section of the wizard, make sure you format it under the FAT file system. You can also name the volume whatever you want. Click Next and then Finish. 5. You're done with Disk Management now, and you should have a new drive available with the drive letter, size, and volume name that you specified. Open it in file explorer and copy over whatever files you want into it. 6. You'll now want to go into a command prompt and get to your MAME folder. Make sure you have chdman.exe in this folder, as it's the utility you need to make .chd files. In the command prompt, put in:
chdman createhd -o name.chd -i \\.\PHYSICALDRIVEx -c none
A couple things you'll have to change here: for name.chd, that will be your file name, and you can change that to whatever you want. Also, remember the disk number from step 3? Put that in after PHYSICALDRIVE (eg if it said Disk 1, put in \\.\PHYSICALDRIVE1). The "-c none" parameter means that the drive will not be compressed, which you need to specify, otherwise ct486 won't like it. Run the batch file and it will make your .chd file. You don't need to specify cylinders or anything like that, chdman will figure that stuff out for you. 7. You now need to get ct486 to recognize your new drive. In the batch file you use to launch MAME with ct486, load in the new .chd with either -hard1 or -hard2. If you have not already created a batch file, find yourself a boot floppy image and just use the following:
mame64 ct486 -ramsize 64M -hard1 name.chd -flop1 floppy.img
Run the batch file and launch MAME. 8. While the memory is initializing, hit the DEL key to open setup. If this is your first time booting, you will be forced to open it anyway. Choose "Auto Detect Hard Disk" and let it look for your new drive. It will find it in the C drive if you chose hard1 or D if you chose hard2. After it's detected all the hard drives you loaded, escape from this screen. If this is your first time booting ct486, you'll definitely want to go to Standard CMOS Setup and assign drive A to match the floppy size you used for the boot disk. You also want to go to Advanced CMOS Setup and change the System Boot Up Sequence to "A:, C:" so that it boots from the floppy first. 9. Select Write to CMOS and Exit and the system will reboot. Once the system is booted go to C: or D: to make sure your files are there. If so, congrats!
Emulator Coder
Joined: 3/9/2004
Posts: 4588
Location: In his lab studying psychology to find new ways to torture TASers and forumers
slamo wrote:
is it bad that I can type that from memory now?
Back in the 90s, I could tell you the entire contents of all my various config.sys and autoexec.bat, and write them from scratch. (I had several to optimize various usage scenerios.)
DrD2k9 wrote:
I noticed during boot-up a note of CPU clock speed at 25mhz in that Quake video...is there a way to adjust the CPU clock speed settings in MAME? EDIT: CPUs from the era when Quake was released were easily 100mhz+ and up to 300-400mhz by the next year.
It's not all about MHz. Different CPUs have different features and different operations per clock performance. From the little I saw, this is emulating a 4x86 system. That's marvelous if it does that well with an AMI BIOS and everything, but you'll need something more recent for the newer games. Quake is specifically designed to take advantage of a CPU pipeline which can perform integer and floating point operations simultaneously. It was also built with the Pentium Pro / Pentium II operations and mechanics in mind. If MAME is really supplying a faithful 4x86 lacking all the newer features, you might need to ramp that up to 600MHz or more just to match a Pentium II 266 MHz when the software in question is capable of using the newer stuff.
Warning: Opinions expressed by Nach or others in this post do not necessarily reflect the views, opinions, or position of Nach himself on the matter(s) being discussed therein.
Expert player, Reviewer (2388)
Joined: 5/21/2013
Posts: 414
I found this page, which is somewhat helpful in figuring out slot options. http://www.progettoemma.net/index.php?gioco=ct486&lang=en There aren't too many details on what each of these modules are, but searching for each name in the MAME source code should illuminate all of them. It supports numerous graphics cards and sound cards, so getting every DOS game to run shouldn't be a problem. It also shows you can convert the floppy drives to 5.25", and there's even an ISA to IDE adapter so you can possibly add more drives.