CAESAR Logo

Catalogue of Arcade Emulation Software - the Absolute Reference

Valid XHTML 1.0! Valid CSS!

X-Arcade

X-Arcade

Large CAESAR Logo

arcadia.c

0.89u5 [Ernesto Corvi, Mariusz Wojcieszek, Aaron Giles]


TODO:

- To get into service mode, hold down F2 before pressing a button after the 'INITIALIZATION OK' message. Pressing F2 during game brings service mode also.


NOTES:

- Hardware: In the late 80s, Arcadia collaborated with Mastertronic to create their own ten-interchangeable-game arcade platform called the Arcadia Multi Select system, using the same hardware as the beloved Commodore Amiga computer. In fact, the Multi Select's main PCB is an A500 motherboard, to which the ROM cage is attached through the external expansion port. Reportedly the system was also (or was originally) supposed to have been released in two five-game Super Select versions--"Arcade Action" and "Sports Simulation", but no specimens of these have ever been seen.

- More about the Arcadia System at http://amiga.emugaming.com/arcadia.html


WIP:

- 0.113u2: Changed VSync to 59.997000 Hz.

- 0.111u6: Ernesto Corvi fixed the data fetch and scrolling calculation for almost all video modes in the Amiga driver.

- 0.111u5: Nathan Woods updated the Amiga video driver to use the new BITMAP_ADDR* macros instead of using the line[] array.

- 0.111u4: Ernesto Corvi fixed system time counters in the Amiga code. Fixed gfx messed up.

- 0.111u3: Another Amiga update [Ernesto Corvi]: Fixed blitter in line mode. Modified Copper to run on odd memory bus cycles. Fixed screen delay offset when display data fetch is not word aligned.

- 0.111u2: Amiga core system updates [Ernesto Corvi]: Updated 6526/8520 CIA to be able to set the value of the SP pin. This is needed to emulate the Amiga keyboard. Updated the custom chips emulation to delay for about 24 cycles the issuing of interrupts after a write to INTENA or INTREQ. Fixed a bug where if INTREQ got cleared programatically, it would 'forget' about pending CIA interrupts, causing the CIA to stop sending further interrupts. Fixed the interrupt delay logic. Now it properly delays firing the irqs, not the masking/disabling. Fixed return value for unused/invalid custom registers reads. Added Denise ID custom register to properly identify OCS, ECS and AGA. Added reset to custom, autoconfig and cia when a RESET opcode is found. Resetting the custom chips will now clear INTENA, preventing further interrupts. Fixed a bug in the RBF interrupt request code check. Fixed a bug on the 6526/8520 CIA that prevented chained counters from working. Added support for the 'blitter-nasty' bit on the blitter. Fixes many games that displayed wrong graphics.

- 0.110u5: Aaron Giles added serial in/out support to the Amiga hardware. Added hooks for output pins and light pen positioning. Also fixed the horrible static at startup in the debug build.

- 0.105u5: Dirk Best added some Amiga enhancements needed for MESS Amiga and CDTV drivers.

- 0.105u3: More Amiga cleanups [Aaron Giles]: Fixed dual playfield mode. Rewrote blitter code (fixes glitches in ar_bowl and others). Changed Arcadia boot loading to use ROMtags instead of autoconfig. Swapped Kickstart 1.2 in for Arcadia BIOS (fixes ar_sdwr). Nathan Woods refactored the 8530 CIA code from the Amiga into a separate module and made it support both the 6526 and 8530 variants.

- 25th April 2006: Aaron Giles - Turns out, the Amiga has a pretty basic 4-channel DMA driven 8-bit sample playing set of DACs, and it only took a couple of days to get the sound going. But by this time, I was intrigued. I had managed to track down a used copy of the Amiga Hardware Reference Manual and as I read more about the Copper and the Blitter and the custom registers, it sounded like more and more of an interesting emulation challenge. Most of the Arcadia games already worked pretty well, but there were still glitches in a few of them, and Up Scope and Moonquake were two other Amiga-based games that weren't yet in MAME. With that incentive, I started delving into the existing implementation of the system. Although the Amiga implementation in MAME hasn't been around that long officially, I knew that Ernesto Corvi had worked on it on and off for a few years even before it made its debut. At the time, the original driver was written to be fairly low-impact, meaning it was reasonably optimized and made fairly poor documentation of how the system worked in exchange for speed (though by comparison to the UAE code, it was clear as a bell). I set out to change that. The first thing that needed an overhaul was the video renderer. I noticed that Moonquake ran in extra half-bright mode, which wasn't supported, so I first tried to fix that. Along the way, I discovered that a lot of assumptions were being made in the code which would ensure that features such as dual playfield scolling and collision detection would not work without a substantial rewrite. A substantal rewrite ensued. Of course, rendering on the Amiga is driven to a large extent by the Copper chip, and as I started to look into that, I realized that Magic Johnson's Fast Break (a)bused the Copper to jam multiple sprites and scrolling displays along the top and bottom of the screen. Which meant I needed to overhaul how sprite drawing worked in order to support these 'manually drawn' sprites, and I also needed to tweak with the timing in the Copper code so that it changed the sprites at just the right instant within a given scanline. I'm still not convinced I have the sprite rendering and Copper timing just right, but it's good enough for the games we've got. Then I wanted to understand this Autoconfig thing. There were some references to Autoconfig in the Arcadia driver, which is how expansion cards were plug & played on the Amiga. Taking the existing implementation at face value, I abstracted out the Autoconfig system so that MESS could eventually use it to plug in peripheral cards, and then I reconnected the expansion card in the Arcadia so that it worked via the Autoconfig mechanism. Of course, after doing that work, I am now convinced that it is wrong. First off, it doesn't make sense that a custom piece of hardware like the Arcadia would bother to implement anything as elaborate as the Autoconfig protocol. Second, the first word of the Arcadia BIOS ROM is a standard Amiga 'ROMtag', and if you map the BIOS up into the Fxxxxx space it boots fine without any Autoconfig mumbo-jumbo. And third, the docs say that the Arcadia systems ran off the Kickstart 1.2 boot ROM. But when you boot an Autoconfig device with the Kickstart 1.2 boot ROM, you run into a bug in the 1.2 code that causes a crash on startup if the device has a boot ROM (you can tell it's a bug because it is very clearly fixed in the 1.3 version of the ROM). I suppose the documentation about the 1.2 boot ROM could be wrong. After all, up until now the Arcadia systems all ran fine with the Kickstart 1.3 boot ROM, right? Well, actually, no.
I now have proof that the original system couldn't have run off the 1.3 boot ROM. Sidewinder, a vertical shooter, always had particularly odd problems. The background bitmap would wrap strangely, and when you shot, you would hit random targets in the middle of nowhere. I tracked this down yesterday to code that would attempt to blit data from one bitmap to another, but which would somtimes specify the destination to be a location outside of RAM somewhere. Until recently, there had been a hack in the blitter that would throw away accesses outside of chip RAM, but I knew that was wrong because the documentation is very clear that outside accesses would wrap around and clobber important bits of program code. Looking into this problem more closely, it turns out that the blitting code was doing a bunch of careful 16-bit calculations in the low half of the 68000's D1 register, and then at the end, adding the full 32-bit D1 value to the address. Which means it was assuming that the upper half of the register was 0. Tracing backwards, it was clear that this code was called as part of the VBLANK interrupt routine, and the code which put the non-zero data in the upper half of D1 was the part of the Amiga Kickstart ROM which actually handled the first part of the interrupt. Comparing that same section of code between the 1.2 and 1.3 Kickstart ROMs revealed very different register usage patterns, and sure enough, booting the system under the 1.2 Kickstart ROM produces no invalid blitter accesses and yes, all the graphics problems are fixed. Of course, prior to discovering the Kickstart problem, I thought for sure it was a bug in the blitter. So yes, I ended up rewriting the blitter routines as well, attempting to document them moreso than optimize them. Which in the end was a good thing as I managed to somehow fix the blitting problems in SportTime Bowling. By this time, I'd rewritten 80% of the emulation, so finishing it off by rewriting the 8520 CIA I/O routines and cleaning up the rest of the driver goes without saying. If I had the time, I'd probably play around with the Amiga emulation in MESS, now that I've made a number of fixes and improvements to the system, but there are more pressing matters, as always. Oh, and what about Up Scope and Moonquake? More later.

- 0.105u2: More Amiga/Arcadia system updates [Aaron Giles]: Rewrote autoconfig system to be more generically useful, cleaned up/rewrote the CIA emulation to be more complete, added dual playfield and sprite priority support, added collision detection support, tweaked COPPER timing to fix scores on Fast Break and shuffled the BIOSes so that the newer version is the default.

- 0.105u1: Aaron Giles rewroted a large chunk of the Amiga emulation to support sound and additional video modes/effects including extra half-bright mode, manual sprites and mid-scanline changes. This is still a work in progress. Aaron also modified Arcadia driver which using empty RAM regions for RAM or had extraneous memory regions. Added Custom (3579545 Hz) stereo sound and changed visible area to 671x216 and VSync to 59.997002 Hz.

- 0.96u1: Brad Oliver fixed big endian issues in the Arcadia driver.

- 0.90u4: Mariusz Wojcieszek changed driver to use multi bios setup. Added support for TenPlay bios (from 10 games board), added proper Kickstart 1.3 image (256k instead of 512k), reverted ar_sdwr to use 0.5MB chip ram and made the blitter to discard writes above chip ram.

- 0.90u3: Mariusz Wojcieszek changed video update to be scanline based, improved sprites rendering and fixed sprite clipping, added hold-and-modify display mode and changed ar_sdwr to use 1MB chip ram, this needs more investigation.

- 0.90u2: Nathan Woods moved refactors code specific out of src/machine/amiga.c into callbacks.

- 0.90u1: Arcadia Update [Mariusz Wojcieszek]. Fixed DMACON register writing, added horizontal scrolling for playfield, improved coin handling, fixed area filling mode in blitter, kludged World Darts to work (adding sound emulation should make kludge obsolete), fixed attached sprites rendering, fixed CIA registers reading and improved vblank/video update timing.

- 13th December 2004: Mariusz Wojcieszek - Wrote a driver for the Arcadia Multi Select System (Amiga 500). The titles are Leader Board, Magic Johnson Fast Break, Ninja Mission, Road Wars, Sidewinder, Space Ranger, SportTime Bowling, SportTime Table Hockey, World Darts and Xenon. Four titles are working.

- 29th June 1999: Ernesto Corvi sent a preliminary Arcadia system driver, which is basically just an Amiga 500 modified for arcade usage.