CAESAR Logo

Catalogue of Arcade Emulation Software - the Absolute Reference

Valid XHTML 1.0! Valid CSS!

X-Arcade

X-Arcade

Large CAESAR Logo

mpu4.c

0.103u2 [Re-Animator, El Condor, AGEMame]


TODO:

- Confirm map, based on 6809 code.

- Get MPU4 board working properly, so that video layer will operate.

- Confirm that MC6850 emulation is sufficient.

- MPU4 Master clock balue taken from schematic, but 68k value is not.


NOTES:

- The MPU4 BOARD is the driver board, originally designed to run Fruit Machines made by the Barcrest Group, but later licensed to other firms as a general purpose unit (even some old Photo-Me booths used the unit). This original board uses a ~1.72 Mhz 6809B CPU, and a number of PIA6821 chips for multiplexing inputs and the like. A 6840PTM is used for internal timing, one of it's functions is to act with an AY8913 chip as a crude analogue sound device. (Data is transmitted through a PIA, with a square wave from the PTM being used as part of the filtering process). A MPU4 GAME CARD (cartridge) plugs into the MPU4 board containing the game, and a protection PAL (the 'characteriser'). This PAL, as well as protecting the games, also controlled some of the lamp address matrix for many games, and acted as an anti-tampering device which helped to prevent the hacking of certain titles in a manner which broke UK gaming laws. One of the advantages of the hardware setup was that the developer could change the nature of the game card up to a point, adding extra lamp support, different amounts of RAM, and (in many cases) an OKI MSM6376 and related PIA and PTM for improved ADPCM sample support (This was eventually endorsed in the most recent official 'MOD' of the board). For the Barcrest MPU4 Video system, the cartridge contains the MPU4 video bios in the usual ROM space (occupying 16k), interface chips to connect an additional Video board, and a 6850 serial IO to communicate with said board. This version of the game card does not have the OKI chip, or the characteriser. The VIDEO BOARD is driven by a 10mhz 68000 processor, and contains a 6840PTM, 6850 serial IO (the other end of the communications), an SAA1099 for stereo sound and SCN2674 gfx chip. The VIDEO CARTRIDGE plugs into the video board, and contains the program roms for the video based game. Like the MPU4 game card, in some cases an extra OKI sound chip is added to the video board's game card,as well as extra RAM. There is a protection chip similar to and replacing the MPU4 Characteriser, which is often fed question data to descramble (unknown how it works). In non-question cases, however, the protection chip works near identically to the original. A decent schematic for the MPU4 board, amongst other info is available, see http://www.mameworld.net/agemame/techinfo/mpu4.php (This appears to have an error in it regarding the IRQ generation of the PIAs, as IC3 causes an infinite loop if IRQA is connected). No video card schematics ever left the PCB factory, but some decent scans of the board have been made, now also available for review. Additional: 68k HALT line is tied to the reset circuit of the MPU4. Emulating the standalone MPU4 is a priority, unless this works, the video won't run. The copy of this driver held by AGEMAME is currently set up to run two UK standalone games (Celebration Club and Connect 4), as well as a title using one of the later 'mods' (Old Timer, a Dutch machine). Interestingly, on the Video card version of the MPU4, the 6840 IRQ is in fact the FIRQ, in order to help with communications. Everything here is preliminary... The boards are quite fussy with regards their self tests and the timing may have to be perfect for them to function correctly (as the comms are timer driven, the video is capable of various raster effects etc.). Datasheets are available for the main components, The AGEMAME site mirrors a few of the harder-to-find ones.


WIP:

- 0.112u1: James Wallace verified and improved stepper behavior based on comparison with a real machine.

- 10th February 2007: James Wallace - Improved input timing. It appears Connect 4 uses a different sound mapping to regular Barcrest games.

- 30th January 2007: James Wallace - Characteriser rewritten to run the 'extra' data needed by some games.

- 0.111u6: James Wallace fixed assertion in MPU4 driver. Fixed the mechanical meter operation, enabling coin entry in Connect 4.

- 0.111u5: James Wallace cleaned up memory maps in the MPU4 driver. Redesigned the MPU4 code so that the DRIVER_INIT only needs to take an address in the ROM for the lookup table for CHR generation to be done. Changed AY8910 clock speeds to 1720000 Hz.

- 24th January 2007: James Wallace - With thanks to Canonman and HIGHWAYMAN, I was able to confirm a seemingly ghastly misuse of a PIA is actually on the real hardware. This fixes the meters.

- 0.111u3: James Wallace added save state support to the steppermotor emulation module (machinesteppers.c).

- 0.109u1: El Condor fixed crash in the MPU4 driver.

- 0.109: El Condor made MSC1937 operation more accurately match datasheet and wiring diagram. Added indexed getters to the output system to match the newly introduced setters.

- 0.108u4: El Condor updated the MPU4 layout and added more documentation.

- 23rd September 2006: Converted 7Segment code to cleaner version, but have yet to add new 16k EPROM, as the original image was purported to come from a Barcrest BBS service, and is probably more 'official'.

- 0.108u3: Big update to the MPU4 driver [El Condor]: Added support for reverse clocking in the VFD code. Changed the 6840 to not run the counter clock if no frequency is specified. Reworked the MPU4 drastically to be more in sync with AGEMAME. MPU4 video should now be working a little better. Deprecated 6850acia.c, replacing it with a specialized driver.

- 7th September 2006: It appears that the video firmware is intended to be a 16k EPROM, not 64k as dumped. In fact, the current dump is just the code repeated 4 times, when nothing earlier than 0xC000 is ever called. Presumably, the ROM is loaded into C000, and the remainder of the 'ROM' space is in fact the extra 32k of RAM apparently needed to hold the video board data. For now, we'll continue to use the old dump, as I am unsure as to how to map this in MAME. Changed Turn Over's name in AGEMAME, it's either 12 Pound or 20 Pound Turn Over, depending on settings. Not that I know how to hook this up, but the O3 pin from IC2 seems to be able to influence the audio filter in some way - see the circuit diagram on my site for the layout. At this stage, I cannot see how to progress any further with the emulation, so I have transferred a non-AWP version of this driver to MAME for further study.

- 6th September 2006: Connect 4 added - VFD is currently reversed, although it looks to me like that's the correct behaviour, and that my 'correction' for Old Timer was wrong. Yamaha sound does work, but is horrendous - presumably there's a filter on the sound that I haven't spotted. Trackball is apparently connected to AUX1, via Schmitt triggers - I wish I had a clue what this meant (El Condor).

- 5th September 2006: And the award for most bone-headed bug goes to.. me! the 6840 handler wasn't resetting the clocks after timeout, so the wave frequencies were way off. Machines now hang on reset due to a lack of reel support. CHR decoding now included, but still requires knowledge of the data table location - this should be present in the ROMs somewhere. 6850 ACIA code now taken from the SAC-1, with a few alterations for the clocking in and out - doesn't seem to be copying the right data, though.

- 0.108u2: El Condor cleaned up the vacfdisp module to display 14 and 16 segment displays. Added a separate character set for the OKI MSC1937. Tidied up the 6840 emulator a bit.

- 11th August 2006: It appears that the PIA IRQ's are not connected after all - but even disabling these won't get around the PTM issues. It also looks like the video card CHR is just a word-based version of the original, byte-based chip, meaning that should be fairly simple to emulate too, when the time comes.

- 0.107u3: El Condor updated the MPU4 driver to the most recent 6840 PTM implementation. Changed M6809 CPU1 clock speed to 1720000 Hz and added dipswitches '10p Enable?', '20p Enable?', '50p Enable?' and '100p Enable?'.

- 0.106u11: El Condor improved memory map and clock speeds for the MPU4 driver.

- 8th July 2006: Revised mapping of peripherals, and found method of calculating CHR values - although their use is still unknown.

- 7th May 2006: AGEMAME - After having another look at the schematic, I've tried to hook up a few more things in the emulation (LEDs and inputs mainly). However, I'm having trouble finding an MPU4 Gamecard to look at (I only have the main board). If anyone can help, please let me know on the forums.

- 11th May 2006: El Condor - Working from schematics and photos at present.

- 0.105u4: El Condor cleaned up 6840 implementation and updated the MPU4 memory map.

- 0.104u4: El Condor tidying up the MPU4 emulation with some new information.

- 0.104: El Condor added 16-segment drawing code to the machinevacfdisp module (Vacuum Fluorescence Display).

- 20th May 2004: Re-Animator. See http://www.mameworld.net/agemame/techinfo/mpu4main.php for map. See http://www.mameworld.net/agemame/techinfo/mpu4.php for Video Card information.