CAESAR Logo

Catalogue of Arcade Emulation Software - the Absolute Reference

Valid XHTML 1.0! Valid CSS!

X-Arcade

X-Arcade

Large CAESAR Logo

segas32.c

0.97u5 [Aaron Giles]

0.89u5 [David Haywood]

0.67 [Jason Lo, R. Belmont]

0.56 [David Haywood, Olivier Galibert, R. Belmont, Farfetch'd]


TODO:

- Fix protection

- Fix jpark correctly


NOTES:

- Hardware: Sega System32: 5-layer tilemap hardware consisting of 4 independant rom-based layers with linescroll, lineselection, linezoom and window clipping capability and one simpler ram-based text plane. Mixed ram/rom sprite engine with palette indirection, per-color priority (thankfully not actually used). The sprite list includes jumping and clipping capabilities, and advanced hot-spot positioning. The mixer chip adds totally dynamic priorities, alpha-blending of the tilemaps, per-component color control, and some other funnies we have not been able to decypher.


VIDEO HARDWARE NOTES:

- In f1en, the scrolling text in attract mode is very jumpy. Whatever double buffering they are using seems to be out of sync with the sprite rendering.

- In radr, NBG1 should be opaque on select screen, and NBG3 should be opaque while driving. How is this controlled?

- In radr, they use $1A0 as the X center for zooming; however, this contradicts the theory that bit 9 is a sign bit. For now, the code assumes that the X center has 10 bits of resolution.

- In svf (the field) and radr (on the field), they use tilemap-specific flip in conjunction with rowscroll AND rowselect. According to Charles, in this case, the rowselect lookups should be done in reverse order, but this results in an incorrect display. For now, we assume there is a bug in the procedure and implement it so that it looks correct.


WIP:

- 0.111u1: Robiza fixed EEPROM saving in OutRunners (same problem for all multi32 games).

- 0.106u6: Updated Sega multi-32 driver to support multiple screens (2x 416x224) [Aaron Giles].

- 0.104u7: Anonymous fixed indirect palettes in the System 32 driver. This fixes SegaSonic The Hedgehog graphics finally.

- 0.102u2: Some minor cleanups to the System 32 driver. Air Rescue and F1 Exhaust Note now share common multi-PCB faking logic [Anonymous].

- 0.98u3: Some more minor fixes to System 32 sprites [Aaron Giles].

- 0.97u5: Merged multi32.c with segas32.c driver. Aaron Giles connected Sega Multi 32 games up using the new System 32 code. Replaced V60 with V70 CPU, fixed cpu2 rom address and visible area to 832x224 and removed 'Monitors' dipswitch in all Multi32 games.

- 0.97u4: Aaron Giles rewrote the System 32 mixer layer to support accurate implementation of the alpha blending modes. Sprite shadows and several other effects are still not yet implemented. And it's much slower than before.

- 0.97u3: Fixed cpu2/gfx2 roms addresses in all games.

- 24th June 2005: Charles MacDonald - I've been making a lot of progress with the System 32 hardware. Most everything has been documented at this point, currently I'm working on the mixer chip. It's responsible for combining all the display layers (five tilemaps, a bitmap, and sprites) based on priority and applying special effects such as blurring and alpha blending. I've also looked at the random number generator, which I'll discuss here. The random number generator is a 16-bit register mapped throughout the $D80000-$DFFFFF range. Writing to it sets the seed value. It is clocked asynchronously rather than by access from the V60, so continually reading it does not produce an exact dump of the values it generates. Furthermore things like the V60's prefetch queue make it difficult to synchronize the CPU with running instruction sequences, so even the same code that reads the random number generator several times will have slightly different values depending on how quickly the V60 processes it. For example, you could assume the mov.d (64-bit) and mov.w (32-bit) transfer instructions issue four or two back-to-back memory read bus cycles, respectively. If the random number generator was clocked at a slower rate, mov.d would capture more data than mov.w does when they are used repeatedly to dump the output. However the data read does not resemble any part of the data captured using mov.w, meaning that the random number generator is updated faster than the V60 can access in a best case situation. One possible solution would be to cut the trace to the clock input (there are two of them, 16 and 8 MHz) on the custom chip that contains the random number generator hardware and connect it to a spare I/O port pin, allowing it to be manually clocked through software. I had done a similar thing on System 24 to determine how the timers were implemented, so it can work in the right circumstances. But the same chip also controls many other aspects of the hardware and this might prevent the system from running. It would only work if one of the clock inputs was used for non-critical functions as well as the random number generator. I've got two spare boards and may try this eventually. Perhaps it is possible to determine how the random numbers are generated without having a sample of every possible state. I wouldn't mind hearing from people with some experience on this subject.

- 0.97u2: System 32 and Multi System 32 games are seriously under construction now. Do not report any bugs against them [Aaron Giles].

- 15th June 2005: Charles MacDonald - I've been using Aaron's V60 assembler to develop test programs for the Sega System 32 platform. The video hardware seems to be a precursor of what's in the Sega Saturn's VDP1/2 chips, which makes it interesting to study but also quite complex. Thankfully I've done a lot of work with the Saturn in the past. I picked up some related PCBs as well; two DBZ V.R.V.S boards (I can confirm that it is a terrible game, ironically these were conversions from Arabian Fight and Dark Edge) and I'm expecting a System Multi 32 "Title Fight" board to arrive soon.

- 0.97u1: Aaron Giles began to cleanup the Sega System 32 driver. Things may not work as well as before; this will be fixed over time. Do not report bugs on it. Also changed V60 CPU to clock multiple cycles per instruction instead of requiring every driver to divide the clock; updated all drivers to use the correct clock speed. Changed V60 CPU1 clock speed to 16107950 Hz and Z80 CPU2 and the 2x YM3438 to 8053975 Hz. Changed visible area to 416x224 and user1 roms to cpu1 (100000/100001). Aaron Giles changed V60 CPU to clock multiple cycles per instruction instead of requiring every driver to divide the clock; updated all drivers to use the correct clock speed. Changed V60 CPU1 clock speed to 20MHz.

- 0.96u4: Aaron Giles rewrote the RF5C68 sound emulator from the specs, improving sound in the System 18/32 games. Changed RF5C68 clock speed to 12.5MHz.

- 0.96: Brad Oliver fixed endianness problems in the Sega System 32 games rom loading.

- 0.93: Added clock parameter to RF5C68 sound (9MHz). Added clock parameter to MultiPCM sound (8053975 Hz).

- 0.89u5: Changed system32.c to segas32.c driver. David Haywood started minor cleanup of System 32 driver (some things are probably broken for now). Changed V60 CPU1 clock speed to 1.6MHz and Z80 CPU2 to 8MHz and cpu1 roms ($100000/100001) to user1 ($0/1) in all games.

- 0.68: Acho A. Tang, Jason Lo, David Haywood made various System 32 Updates (Priority, SVF Pitch etc.).

- 7th May 2003: Acho A. Tang submitted a small sprite drawing speedup to the Sega System 32 driver.

- 22nd April 2003: Jason Lo added dual screen support, added sprite shadows and improved the graphics priorities in the Sega System Multi 32 driver.

- 9th April 2003: David Haywood fixed the rowscroll / rowselect in Sega System 32 graphics emulation, fixing the title screen in Outrunners, playfield in Super Visual Football, floors in Arabian Fight and Burning Rival and mirror view in Rad Rally.

- 0.67: Added multi32.c driver.

- 4th April 2003: Jason Lo submitted major improvements to the Sega System Multi 32 driver, Hard Dunk and Outrunners are playable though they have a few graphics glitches. David Haywood fixed the row scroll / row select in Outrunners.

- 2nd February 2003: David Haywood converted the Sega System 32 driver for the tilemap system and added preliminary alpha blending emulation.

- 31st January 2003: R. Belmont sent in a very preliminary System 32 Multi driver in which basically only the MultiPCM sound works, nothing else.



- 19th January 2003: David Haywood further improved the Sega System 32 driver background graphics emulation, adding support for changing resolution on demand.

- 18th January 2003: David Haywood improved the Sega System 32 driver background graphics emulation, though it's still far from perfect.

- 1st December 2002: Stephane Humbert fixed various parts of the inputs in the Sega System 32 driver.

- 29th November 2002: David Haywood fixed the controls in Alien3 in the Sega System 32 driver, and it's completely playable now although missing some background graphics.

- 28th November 2002: David Haywood sent in another update to the Sega System 32 driver with protection fixes for Burning Rivals, Arabian Fight and Golden Axe 2 from R. Belmont, improved inputs from Stephane Humbert and various improvements to the graphics emulation, making Super Visual Football, Burning Rivals, Rad Mobile, Rad Rally and F1 Exhaust Note playable.

- 27th November 2002: David Haywood sent in an updated Sega System 32 driver with improved palette handling thanks to R. Belmont.

- 24th November 2002: David Haywood fixed a small sprite placement bug in the Sega System 32 driver.

- 23rd November 2002: David Haywood added preliminary sprite support to the Sega System 32 driver, making Holosseum fully playable.

- 14th November 2002: R. Belmont added inputs and sound emulation to the Sega System 32 driver, but it's still missing graphics emulation.