iMame Readme ----------------------------------------------- This is a port of MAME (Multi Arcade Machine Emulator) for the Compaq iPAQ 36xx series. It is based on a very old version of MAME for DOS. I found that source code from MAME version .261 provided the best performance. Some games may even run full speed with no frame dropping with 44100k audio. I only included a few drivers to keep the executable size down. The included drivers are ones I picked which seemed to have the best performance. The other drivers have simply been omitted at compile time, but can be reenabled if you with to rebuild the project. Platforms ----------------------------------------------- I only build this project for ARM/PocketPC/iPAQ36xx. The source code is available if you want to use it for some other platform. Setting Up ----------------------------------------------- Run the Setup program from the desktop PC. It connects to ActiveSync and installs iMAME and GameX DLL for you. Once iMame is running, read the online help. On the iPAQ, you have to make a directory to contain the game ROMS, and another directory to contain sound samples if they are needed for some games. You can use zipped or unzipped roms. iMAME installer makes a default Rom and Sample directory locations in the iPAQ Registry, but you can you the iMAME configuration menu to change the ROM and Sample directories to whatever you want. You can put the ROM and Samples on a storage card, for instance. *********************IMPORTANT (I get a lot of email about this)- Make sure you have the right ROM and Sample names for this Mame version (version .261) If you have trouble with the names of your ROM sets (iMAME core error), then you probably need to mess with the names of your ROM images. MAME has a naming convention for ROM images which has changed considerably since .261 was released. If you get a ROM archive off the 'net, it will probably have the names to confirm to the current MAME version. Since we mostly use ROMs in a zip-file format, you have to rename the individual images inside the zip. Mostly this is easy to do. iMAME will tell you the names of the images it expects if you use the "Game Info" menu option within iMAME. (HINT: this information is straight out of the table that is loaded from the driver source code, so it is in the order of the memory regions used). Sorry, it's a pain. Someone can make a conversion table if they are so inclined! Easier for me to keep the original MAME driver code as-is and then to make you conform! One more thing, the ".sam" proprietary Mame sample format is used as well, so you may need to do some digging to find the right samples. Try mameworld.net! Running ----------------------------------------------- Launch the File Explorer as appropriate for your device ("Q" menu in iPaq). Use the drop down tab to navigate to "\" (My Device). Launch iMame by double-clicking the executable file. Select the game and either double-click it or press "Go". Hardware buttons have the following functions: X X X X ALT ESC 1P Start Coin-up Directional control: Up | Left -- Left CTRL -- Right | Down Issues ----------------------------------------------- Sound is a bit funky...older Mame drivers used 8 bit unsigned samples that were written directly into the driver code to support Wavetable devices (notably Namco). New drivers store the wavetables in a Prom image. Dipswitches, other setup not available yet...(TAB key). Sound sub-system sounds like crap when running Pokey. Graphic sub-system trashes on Vector games. Numerous other things. Wishlist ----------------------------------------------- Configurable Keys. More drivers supported. 8-bit color support, configurable option. Better UI, button default-focus, etc. Fix the Ipaq button problem (just kidding). Numerous other things. Acknowledgements ----------------------------------------------- Thanks to all the Mame contributors: developers, testers, web-site maintainers, and certainly all of those who use and enjoy MAME are contributors as well. Thanks to www.mame.net for hosting MAME and keeping the repository of files and MAME versions on-line! Ben Cooley did the first Mame port for Windows CE (it was called MameCE). I modeled the use of the C-runtime support after his design. I also based sound drivers for Wince on his code. '999' designed the iMAME log and made the first iMAME webpage for Mameworld. Mameworld kindly hosts the iMAME website and as well as many other Mame projects. Michael Adcock wrote a document called the Arcade Emulation HowTO. This document is still a good read, I learned a lot about computer emulation and arcade hardware from it. Mike works at BSquare, Mike and the Bsquare folks were very helpful with some troubles I had setting up the remote-debug for Pocket PC. The Mame32 team (Mame32 is MAME for Windoze) did a real fine piece of work on that software and UI...a pinched a bunch of code from Mame32 for handling UI stuff. Rebuilding iMAME from sources code ----------------------------------------------- (nothing to read past here unless you are recompiling iMAME) Why? You want more drivers enabled, or, you kindly submit a problem-report or a bug-fix and then I tell you that wiped Wince off my iPAQ, put Linux on it and can't get to your problem-report@! The iMAME sources are distributed as an add-on to the original MAME .261 code. Make a dirctory to work from, I'll refer to it as $IMAMESRCDIR. Unpack "mame261s.zip" file into $IMAMESRCDIR (original MAME .261 source release) Unpack the "MameXXceXXXsrc.zip" file into $IMAMESRCDIR directory (iMAME add-on). In $IMAMESRCDIR, unpack the sources for zlib compression library. ( zlib113.zip works, zlib114.zip works too. ) If zlib unpacks as something like "zlib-1.1.4", then rename that to "zlib". Therefore, you have "$IMAMESRCDIR/zlib". You must install GAPI (Game API from MS) with your tools....the eVC++ installer does not do this for you! iMAME website has a link to GAPI download. Download it and follow the installation instruction. Load the mame32ce.vcw file into MS eMbedded Visual C++ (I used version 3.0) and build the crt, zlib, and mame32ce projects. The IDE will connect to the target and use the directory "Windows/Start\ Menu" by default. You can set the IDE to use whatever target download directory you want. Regardless, you must make the file "gx.dll" is in this same directory. For development purpose, just manually transfer the gx.dll over to the device. (When installing program from installer, gx.dll installs automatically). Optionally, the .dsw .dsp files build Mame for the desktop if you have Visual C++ 6.0. Please excuse the mess in the sources...it is a work in progress. I suggest you DO NOT alter the resource tab from the IDE, I had a problem with unresolved symbols in the resource script. After removing the unresolveds and recompiling iMAME, there was a Wince system error "SHCreateMenuBar Failed". Changes ----------------------------------------------- V007 - "\Storage Card" works for ROM and Sample file directory. Thanks to "sungmoj@hotmail.com" for this fix. Sorry I took so long to fix it. V006 - Got sick of unzipping roms and samples, so Zip support was added. You can now keep your roms in any directory. Use the options under the "Directories" menu to browse the file system to show iMame where the files are. Data alignment problem in Drawgfx went away...difference betw V261 and V27? Corrected screwed up 16 bit RGB operation in osd_get_pen. Added SuperPac...6809 games seem to do very nicely. Added Mooncrst, Ladybug, Galaxian. Added Pooyan, Timeplt...these work pretty good for PSG games. I think the problem with PSG games is really more pronounced on ones that have a continual music (like frogger...except that frogger has some kind of busy loop optimization in it's sndhrdw file which was mysteriously removed after V261). Overhauled the UI system. The new UI system runs the full screen dialog and sports a a cheesy menu-bar, plus there's a nifty new install program that works through ActiveSync (almost acts like a real Pocket PC app!). Changed the GAPI use slightly. I originally GAPI'd the main UI window, so the GAPI Open and Close calls had been in MameUI.c. Now I GAPI the Game Window (the one created in MameWnd.c) but it turns out that it isn't so good to Open and Close every time you enter and leave a game...that's where the GAPI Suspend and Resume functions come in. Fixed up the display to do centering and clipping as appropriate. The title bar on the Game Window sometimes likes to hang around though, even though I try to clear the screen with black before the game starts. And how do you make the stupid clock go away? It writes over the screen, even with the GAPI on duty?!?? Changed to Mame26.1 core. Makes Frogger much faster!! Various changes in Mame 27 for improved quality of PSG sound system, but require more horsepower. Mame 27 had also taken some optimization's out of Frogger sndhrdw which is why it has been performing dismally for us on V004 and V005 iMame. There didn't appear to be any easy way around these issues. Grabbed the Mappy support files from Mame27...since I like DigDug2 so much. Incredibly, they popped right in to Mame 261. Note: some Rom names have changed...check the game-info dialog if you have trouble running a driver. The Installer comes from two origins. 1) Scott Ludwig (scottlu@eskimo.com) http://www.eskimo.com/~scottlu 2) Infozip...the Info-ZIP home page is currently at http://www.cdrom.com/pub/infozip/. Greg Roelofs was responsible for the basic modifications to UnZip necessary to create UnZipSFX (the self-extracting stub, kind of like Winzip-Self-Extractor, except free!). V005 - More drivers...Mappy, DigDug2, Dkong, Bagman. Added "GameInfo" dialog...shows you what Roms/Samples are needed and available. A '+' indicates that the file was found in the Mamebin directory. Changed sample subsystem back to using the proprietary SAM format. Dig out your old .SAM files! Changed the Keys...thanks to 999 for pointing out that the middle joypad position is not subject to the Stop-n-Shoot crap. Put the framerate display as an option on the UI. A couple of simple changes to common.c, so that you can put your roms in a directory "roms". On the handheld, this must be absolute directory "/mameroms/"...put your samples in "/mamebin/" as well. On the desktop, this can be relative to the current working directory for the iMame executable. V004 - Changed to Mame27 kernel. More Drivers! Many, many will not work yet though, such as: stuff with pokey, stuff with vector, games in the mappy driver, and on and on. Do some cleanup in osd_exit...there's probably more, but we really need to find out what is leaking or whatever and causing the game to crawl after repeated usage of iMame. For the desktop, use SetDIBColorTable to put colors in the DIBsection instead of needing to run osd_obtain_pen before running osd_create_display (the former approach required change to mame.c) Found the problem with using the osd_bitmap structure.... osd_create_bitmap was only allocating "height-1" which caused Windows to trash us when freeing tmpbitmap from vidhrdw/generic.c (need to allocate "height-0"). Add WIN32 to preprocessor defines so that Mame.c will compile correctly. Copied "run_game()" to win32.c so that I wouldnt' have to change "main()" to "run_game()" in Mame.c When clipping, drawgfx() we were sometimes getting the dreaded "Application mame27ce.exe has performed an illegal operation and will be shut down." This was caused by writes to "out of clip rect" that are not multiples of 4, such as -2. drawgfx() then tries to read an int from the source graphic array at offset of 2, which ARM won't permit. In "common.c", the problem line is marked with this comment // GN: TEST (unaligned access, get out!) So far, DigDugAt and Mpatrol have shown up this problem...If I get to looking more at the graphics engine, then we will see what we can do to fix this correctly. Very odd problem observed with frogger...it would only get 30FPS... couldn't figure it out, finally found that it ran at full speed when I left out several drivers and other files from the build: strange! Fixed a bug in the AY8910 and PSG code whereby PSG was mistakenly allocating its own buffers, but then was freeing ours after we already free'd them. See files for more description. This bug was present in the original Mame27 release. Guess that's why they release Mame28! Colors are sometimes funky when running more than one game on one instance of iMame. Also, iMame often acts sluggish after running multiple times without soft-resetting the iPaq. Frogger practically requires a reset after every play. V003 - Correct Mame21 sound interfaces will be used. In previous versions, I had basically hardwired the Namco and Samples sound interfaces to make things work. The mixer code came from Mame36 core code, but has now been pushed back into the "OS dependent" area of the iMame code, per Mame21 architecture. Streaming-PSG sound is enabled now...so Frogger has sound! Sound Enable check box works now (case IDC_SOUNDEN) from main UI message proc, the state of the check is now initialized to "checked" at startup,and retrieved by SendMessage. Sound frequency can be adjusted. For example, running Galaga at 11025 instead of 44100 makes Galaga run about 50fps as opposed to 45. Some UI problems...can't set a default selction in the game selection-list box without causing the cursor-pad not to work on the list-box. Can't get the pad-center to act as a "game-start" key. Trying out btime driver...forgot that you had to turn-to-shoot...crap ...oh well, it is showing up the deficiencies in the current color system, I will fix the color and then take out the driver. V002 - Change osd_play_sample() interface in win_os.c to sample_start() Add invaders support. Change NUMWAVEHDRS from 4 to 16. This was causing the system to trash memory when running a second game within the same Mame instance. Also makes a noticeable sound improvement when running on a desktop machine. Seems to have remedied the intermittent crashes when running a game. Fixed GAMEX stuff. GAMEX cannot be closed and reinitialized in the same program instance. Caused MAME to fail when running second game. Must use GXSuspend and GXResume instead. Protect the entire "case WM_PAINT" in MAME32_MessageProc. This seems to fix the problem where the initial Mame Disclaimer only partially displayed. You can set the frameskip now. Framerate is displayed by pressing the "center" of the joypad. V001 - First release, very buggy.