Viewing File: <root>/src/mame/drivers/cps3.c

    1  /*
    2  
    3  CPS3 Driver (preliminary)
    4  
    5  Decryption by Andreas Naive
    6  
    7  Driver by David Haywood
    8   with help from Tomasz Slanina and ElSemi
    9  
   10  Sound emulation by Philip Bennett
   11  
   12  SCSI code by ElSemi
   13  
   14  ToDo: (in order or priority?)
   15  
   16  Street Fighter 3 2nd Impact uses flipped tilemaps during flashing, emulate this.
   17  
   18  Figure out proper IRQ10 generation:
   19   If we generate on DMA operations only then Warzard is OK, otherwise it hangs during attract
   20   HOWEVER, SFIII2 sometimes has messed up character profiles unless we also generate it periodicly.
   21   I think the corrupt background on some of the lighning effects may be realted to this + the DMA
   22   status flags.
   23  
   24  Alpha Blending Effects
   25      These are actually palette manipulation effects, not true blending.  How the values are used is
   26      not currently 100% understood.  They are incorrect if you use player 2 in Warzard
   27  
   28  Linezoom
   29      Is it used anywhere??
   30  
   31  Palette DMA effects
   32      Verify them, they might not be 100% accurate at the moment
   33  
   34  Verify Full Screen Zoom on real hardware
   35   Which is which, x & y registers, how far can it zoom etc.
   36  
   37  Verify CRT registers
   38   Only SFIII2 changes them, for widescreen mode.  What other modes are possible?
   39  
   40  Sprite positioning glitches
   41   Some sprites are still in the wrong places, seems the placement of zooming sprites is imperfect
   42   eg. warzard intro + cutscenes leave the left most 16 pixels uncovered because the sprite is positioned incorrectly,
   43       the same occurs in the sf games.  doesn't look like the origin is correct when zooming in all cases.
   44  
   45  Gaps in Sprite Zooming
   46   probably cause by use of drawgfx instead of processing as a single large sprite, but could also be due to the
   47   positioning of each part of the sprite.  Warzard is confirmed to have gaps during some cutscenes on real hardware.
   48  
   49  ---
   50  
   51  Capcom CP SYSTEM III Hardware Overview
   52  Capcom, 1996-1999
   53  
   54  From late 1996 to 1999 Capcom developed another hardware platform to rival the CPS2 System and called
   55  it CP SYSTEM III. Only 6 games were produced. Here's a detailed table of all known releases until now:
   56  
   57                                                             |--------------- Cart ----------------|  |-------------- CD ---------------|
   58  Game                                                 Year  Part #     Label      Region  CD  NO CD  Part #      Catalog #   Label        Revision
   59  ---------------------------------------------------  ----  ---------  ---------  ------  --  -----  ----------  ----------  -----------  --------
   60  Warzard                                              1996  WZD96a00F  CP300000G  JAPAN   X          CAP-WZD000  CAP-WZD-3   CAP-WZD-3    961023
   61  Warzard                                                    WZD96a00F  CP300000G  JAPAN   X          CAP-WZD000  CAP-WZD-5   CAP-WZD-5    961121
   62  Red Earth                                                  WZD96aA0F  CP3000B0G  EUROPE  X          CAP-WZD0A0  CAP-WZD-3   CAP-WZD-3    961023
   63  Red Earth                                                  WZD96aA0F  CP3000B0G  EUROPE  X          CAP-WZD0A0  CAP-WZD-5   CAP-WZD-5    961121
   64  Red Earth                                                  WZD96aA0F  CP3000H0G  MEXICO* X          CAP-WZD0A0  CAP-WZD-3   CAP-WZD-3    961023
   65  Red Earth                                                  WZD96aA0F  CP3000H0G  MEXICO* X          CAP-WZD0A0  CAP-WZD-5   CAP-WZD-5    961121
   66  Red Earth                                                  WZD96aA0F  CP3000U0G  USA*    X          CAP-WZD0A0  CAP-WZD-3   CAP-WZD-3    961023
   67  Red Earth                                                  WZD96aA0F  CP3000U0G  USA*    X          CAP-WZD0A0  CAP-WZD-5   CAP-WZD-5    961121
   68  
   69  Street Fighter III: New Generation                   1997  SF397200F  CP300000G  JAPAN   X          CAP-SF3000  CAP-SF3-3   CAP-SF3-3    970204
   70  Street Fighter III: New Generation                         SF397200F  CP300000G  JAPAN   X          CAP-SF3000  ?           ?            970312*
   71  Street Fighter III: New Generation                         SF397200F  CP300000G  JAPAN   X          CAP-SF3000  ?           ?            970403*
   72  Street Fighter III: New Generation                         SF3972A0F  CP3000C0G  ASIA        X                                           970204
   73  Street Fighter III: New Generation                         SF3972A0F  CP3000C0G  ASIA        X                                           970312*
   74  Street Fighter III: New Generation                         SF3972A0F  CP3000C0G  ASIA        X                                           970403*
   75  Street Fighter III: New Generation                         SF3972A0F  CP3000H0G  MEXICO  X          CAP-SF30A0  CAP-SF3-3   CAP-SF3-3    970204
   76  Street Fighter III: New Generation                         SF3972A0F  CP3000H0G  MEXICO  X          CAP-SF30A0  ?           ?            970312*
   77  Street Fighter III: New Generation                         SF3972A0F  CP3000H0G  MEXICO  X          CAP-SF30A0  ?           ?            970403*
   78  Street Fighter III: New Generation                         SF3972A0F  CP3000U0G  USA     X          CAP-SF30A0  CAP-SF3-3   CAP-SF3-3    970204
   79  Street Fighter III: New Generation                         SF3972A0F  CP3000U0G  USA     X          CAP-SF30A0  ?           ?            970312*
   80  Street Fighter III: New Generation                         SF3972A0F  CP3000U0G  USA     X          CAP-SF30A0  ?           ?            970403*
   81  
   82  Street Fighter III 2nd Impact: Giant Attack          1997  3GA97a00F  CP300000G  JAPAN   X          CAP-3GA000  CAP-3GA000  CAP-3GA-1    970930
   83  Street Fighter III 2nd Impact: Giant Attack                3GA97a00F  CP300000G  JAPAN   X          CAP-3GA000  ?           ?            971016*
   84  Street Fighter III 2nd Impact: Giant Attack                3GA97aA0F  CP3000C0G  ASIA        X                                           970930
   85  Street Fighter III 2nd Impact: Giant Attack                3GA97aA0F  CP3000C0G  ASIA        X                                           971016*
   86  Street Fighter III 2nd Impact: Giant Attack                3GA97aA0F  CP3000U0G  USA     X          CAP-3GA0A0  CAP-3GA000  CAP-3GA-1    970930
   87  Street Fighter III 2nd Impact: Giant Attack                3GA97aA0F  CP3000U0G  USA     X          CAP-3GA0A0  ?           ?            971016*
   88  
   89  JoJo no Kimyou na Bouken                             1998  JJK98c00F  CP300000G  JAPAN   X          CAP-JJK000  CAP-JJK000  CAP-JJK-140  981202
   90  JoJo no Kimyou na Bouken                                   JJK98c00F  CP300000G  JAPAN   X          CAP-JJK000  CAP-JJK-2   CAP-JJK-160  990108
   91  JoJo no Kimyou na Bouken                                   JJK98c00F  CP300000G  JAPAN   X          CAP-JJK000  CAP-JJK-3   CAP-JJK-161  990128
   92  JoJo's Venture                                             JJK98cA0F  CP3000C0G  ASIA        X                                           981202
   93  JoJo's Venture                                             JJK98cA0F  CP3000C0G  ASIA        X                                           990108
   94  JoJo's Venture                                             JJK98cA0F  CP3000C0G  ASIA        X                                           990128
   95  JoJo's Venture                                             JJK98cA0F  CP3000U0G  USA     X          CAP-JJK0A0  CAP-JJK000  CAP-JJK-140  981202
   96  JoJo's Venture                                             JJK98cA0F  CP3000U0G  USA     X          CAP-JJK0A0  CAP-JJK-2   CAP-JJK-160  990108
   97  JoJo's Venture                                             JJK98cA0F  CP3000U0G  USA     X          CAP-JJK0A0  CAP-JJK-3   CAP-JJK-161  990128
   98  
   99  Street Fighter III 3rd Strike: Fight for the Future  1999  33S99400F  CP300000G  JAPAN*  X          CAP-33S000  CAP-33S-1   CAP-33S-1    990512
  100  Street Fighter III 3rd Strike: Fight for the Future        33S99400F  CP300000G  JAPAN*  X          CAP-33S000  CAP-33S-2   CAP-33S-2    990608
  101  Street Fighter III 3rd Strike: Fight for the Future        33S99400F  CP300000G  JAPAN       X                                           990512
  102  Street Fighter III 3rd Strike: Fight for the Future        33S99400F  CP300000G  JAPAN       X                                           990608
  103  Street Fighter III 3rd Strike: Fight for the Future        33S994A0F  CP3000B0G  EUROPE  X          CAP-33S0A0  CAP-33S-1   CAP-33S-1    990512
  104  Street Fighter III 3rd Strike: Fight for the Future        33S994A0F  CP3000B0G  EUROPE  X          CAP-33S0A0  CAP-33S-2   CAP-33S-2    990608
  105  Street Fighter III 3rd Strike: Fight for the Future        33S994A0F  CP3000C0G  ASIA*   X          CAP-33S0A0  CAP-33S-1   CAP-33S-1    990512
  106  Street Fighter III 3rd Strike: Fight for the Future        33S994A0F  CP3000C0G  ASIA*   X          CAP-33S0A0  CAP-33S-2   CAP-33S-2    990608
  107  Street Fighter III 3rd Strike: Fight for the Future        33S994A0F  CP3000C0G  ASIA*       X                                           990512
  108  Street Fighter III 3rd Strike: Fight for the Future        33S994A0F  CP3000C0G  ASIA*       X                                           990608
  109  Street Fighter III 3rd Strike: Fight for the Future        33S994A0F  CP3000H0G  MEXICO* ?          CAP-33S0A0  CAP-33S-1   CAP-33S-1    990512
  110  Street Fighter III 3rd Strike: Fight for the Future        33S994A0F  CP3000H0G  MEXICO* ?          CAP-33S0A0  CAP-33S-2   CAP-33S-2    990608
  111  Street Fighter III 3rd Strike: Fight for the Future        33S994A0F  CP3000U0G  USA     X          CAP-33S0A0  CAP-33S-1   CAP-33S-1    990512
  112  Street Fighter III 3rd Strike: Fight for the Future        33S994A0F  CP3000U0G  USA     X          CAP-33S0A0  CAP-33S-2   CAP-33S-2    990608
  113  
  114  JoJo no Kimyou na Bouken: Mirai e no Isan            1999  JJM99900F  CP300000G  JAPAN   X          CAP-JJM000  CAP-JJM-0   CAP-JJM-110  990913
  115  JoJo no Kimyou na Bouken: Mirai e no Isan                  JJM99900F  CP300000G  JAPAN   X          CAP-JJM000  CAP-JJM-1   CAP-JJM-120  990927
  116  JoJo no Kimyou na Bouken: Mirai e no Isan                  JJM99900F  CP300000G  JAPAN       X                                           990913
  117  JoJo no Kimyou na Bouken: Mirai e no Isan                  JJM99900F  CP300000G  JAPAN       X                                           990927
  118  JoJo's Bizarre Adventure                                   JJM999A0F  CP3000B0G  EUROPE      X                                           990913
  119  JoJo's Bizarre Adventure                                   JJM999A0F  CP3000B0G  EUROPE      X                                           990927
  120  
  121  * NOT DUMPED but known to exist
  122  
  123  Each game consists of a Cart and a CD having various codes needed to identify them. Carts and CDs have
  124  both a different Part # printed on their front/top side that includes the game Cart/CD code and ends
  125  respectively with 00F/000 for all Japan releases and with A0F/0A0 for all the other ones. Therefore,
  126  the Part # can be used only to identify Japan releases and further parameters need to be introduced.
  127  The Cart is responsible for the game Region that can be identified by a Label with coloured characters
  128  and a code printed on back side. The antepenultimate character of the Label code and the colour of the
  129  sticker vary by Region, exactly as happens on the boot screen when the board is powered on. There are two
  130  types of Carts. Some require the CD to boot, some don't since the game is already loaded into the SIMMs.
  131  Both types are externally identical and use the same codes, so the only way to distinguish them is dump
  132  the BIOSes. The game Region and CD/NO CD flags are controlled by two different bytes in the BIOS rom.
  133  The CD (and SIMMs too if the Cart is of type NO CD) contains the game Revision that can be identified
  134  by two codes, the Catalog # and the Label. The Catalog # is the identifying code printed in the mirror
  135  ring on top side close to the CD's center while the Label is the code appearing on the CD icon when
  136  it's inserted into a PC CD reader. It has been verified that the Catalog # and Label are the same for
  137  some games but quite different for some others, so it's better to check both to avoid confusion. It
  138  has also been verified that the Catalog # and Label (and the data on CDs) don't change between Regions,
  139  only between Revisions. However, knowing one of them and comparing it with the table above will help
  140  to understand if a new game Revision has been discovered. Current CD dumps have been documented using
  141  the Catalog # as name, since the Label is already included into the images used to generate CHDs.
  142  
  143  The CP SYSTEM III comprises a main board with several custom ASICs, custom 72-pin SIMMs for program
  144  and graphics storage (the same SIMMs are also used in some CPS2 titles), SCSI CDROM and CDROM disc,
  145  and a plug-in security cart containing a boot ROM, an NVRAM and another custom ASIC containing vital
  146  decryption information held by a [suicide] battery.
  147  
  148  Not much is known about the actual CPU used in this system due to the extensive use of encryption,
  149  and the volatile nature of the security information. There appears to be a custom Hitachi SH-2 CPU on
  150  the mainboard and there has been confirmed to be one in the cart. Tests were done by decrypting the
  151  BIOS and code and running it on the PCB. It is known that neither of these CPU's will run standard
  152  (i.e. unencrypted) SH2 code.
  153  
  154  The security cart is thought to work like this: the flashROM in the cart contains a program BIOS which is
  155  decrypted by the CPU in the cart (the CPU has built-in decryption) then executed by that CPU to boot the
  156  BIOS code. Even though the code in the flashROM is encrypted, the cart can run it even if it is dead/suicided
  157  because it has been discovered that the BIOS contains a hidden security menu allowing the cart to be loaded
  158  with the security data. This proves the cart runs the BIOS even if it is dead. The special security menu is
  159  not normally available but is likely accessed with a special key/button combination which is unknown ATM.
  160  The cart contains a FM1208S NVRAM which appears to either be unused or holds game settings. Because the CPU
  161  in the cart is always powered by a battery, it has stealth capability that allows it to continually monitor
  162  the situation. If the custom CPU detects any tampering (generally things such as voltage fluctuation or
  163  voltage dropping or even removal of the cart with the power on), it immediately erases the SRAM inside the
  164  CPU (and thus the key) which effectively kills the security cart dead. This also suggests that the custom
  165  Capcom CPU contains some additional internal code to initiate the boot process which is battery-backed as
  166  well. It is known (from decapping it) that the CPU in the security cart does contain an amount of static
  167  RAM for data storage and a SH2 core.
  168  
  169  The main board uses the familiar Capcom SIMM modules to hold the data from the CDROM so that the life of
  170  the CD drive is maximized. The SIMMs don't contain RAM, but instead TSOP48 surface mounted flashROMs that
  171  can be updated with different games on bootup using a built-in software updating system.
  172  The SIMMs that hold the program code are located in positions 1 & 2 and are 64MBit.
  173  The SIMMs that hold the graphics are located in positions 3, 4, 5, 6 & 7 and are 128MBit.
  174  The data in the SIMMs is not decrypted, it is merely taken directly from the CDROM and shuffled slightly
  175  then programmed to the flashROMs. The SIMMs hold the entire contents of the CDROM.
  176  
  177  To swap games requires the security cart for the game, it's CDROM disc and the correctly populated type
  178  and number of SIMMs on the main board.
  179  On first power-up after switching the cart and CD, you're presented with a screen asking if you want to
  180  re-program the SIMMs with the new game. Pressing player 1 button 2 cancels it. Pressing player 1 button 1
  181  allows it to proceed whereby you wait about 25 minutes then the game boots up almost immediately. On
  182  subsequent power-ups, the game boots immediately.
  183  If the CDROM is not present in the drive on a normal bootup, a message tells you to insert the CDROM.
  184  Then you press button 1 to continue and the game boots immediately.
  185  Note that not all of the SIMMs are populated on the PCB for each game. Some games have more, some less,
  186  depending on game requirements, so flash times can vary per game. See the table below for details.
  187  
  188                                                       |----------- Required SIMM Locations & Types -----------|
  189  Game                                                 1       2       3        4        5         6         7
  190  --------------------------------------------------------------------------------------------------------------
  191  Red Earth / Warzard                                  64MBit  -       128MBit  128MBit  32MBit*   -         -
  192  Street Fighter III: New Generation                   64MBit  -       128MBit  128MBit  32MBit*   -         -
  193  Street Fighter III 2nd Impact: Giant Attack          64MBit  64MBit  128MBit  128MBit  128MBit   -         -
  194  JoJo's Venture                                       64MBit  64MBit  128MBit  128MBit  32MBit*   -         -
  195  Street Fighter III 3rd Strike: Fight for the Future  64MBit  64MBit  128MBit  128MBit  128MBit   128MBit   -
  196  JoJo's Bizarre Adventure                             64MBit  64MBit  128MBit  128MBit  128MBit   -         -
  197  
  198                                                       Notes:
  199                                                             - denotes not populated
  200                                                             * 32MBit SIMMs have only 2 FlashROMs populated on them.
  201                                                               128MBit SIMMs can also be used.
  202                                                             No game uses a SIMM at 7
  203                                                             See main board diagram below for SIMM locations.
  204  
  205  Due to the built-in upgradability of the hardware, and the higher frame-rates the hardware seems to have,
  206  it appears Capcom had big plans for this system and possibly intended to create many games on it, as they
  207  did with CPS2. Unfortunately for Capcom, CP SYSTEM III was an absolute flop in the arcades so those plans
  208  were cancelled. Possible reasons include:
  209  - the games were essentially just 2D, and already there were many 3D games coming out onto the market that
  210    interested operators more than this,
  211  - the cost of the system was quite expensive when compared to other games on the market,
  212  - it is rumoured that the system was difficult to program for developers,
  213  - these PCBs were not popular with operators because the security carts are extremely static-sensitive and most
  214    of them failed due to the decryption information being zapped by simple handling of the PCBs or by touching
  215    the security cart edge connector underneath the PCB while the security cart was plugged in, or by power
  216    fluctuations while flashing the SIMMs. You will know if your cart has been zapped because on bootup, you get
  217    a screen full of garbage coloured pixels instead of the game booting up, or just a black or single-coloured
  218    screen. You should also not touch the inside of the security cart because it will be immediately zapped
  219    when you touch it! The PCB can detect the presence of the security cart and if it is removed on a working game,
  220    the game will freeze immediately and it will also erase the security cart battery-backed data.
  221  
  222  
  223  PCB Layouts
  224  -----------
  225  
  226  CAPCOM
  227  CP SYSTEM III
  228  95682A-4 (older rev 95682A-3)
  229     |----------------------------------------------------------------------|
  230    |= J1             HM514260     |------------|      |  |  |  |  |        |
  231     |                             |CAPCOM      |      |  |  |  |  |        |
  232    |= J2     TA8201  TC5118160    |DL-2729 PPU |      |  |  |  |  |        |
  233     |                             |(QFP304)    |      |  |  |  |  |        |
  234  |--|          VOL   TC5118160    |            |      |  |  |  |  |        |
  235  |    LM833N                      |            |      S  S  S  S  S        |
  236  |    LM833N         TC5118160    |------------|      I  I  I  I  I        |
  237  |           TDA1306T                      |--------| M  M  M  M  M        |
  238  |                   TC5118160  60MHz      |CAPCOM  | M  M  M  M  M       |-|
  239  |                              42.9545MHz |DL-3329 | 7  6  5  4  3       | |
  240  |           LM385                         |SSU     | |  |  |  |  |       | |
  241  |J                         KM681002       |--------| |  |  |  |  |       | |
  242  |A                         KM681002  62256 |-------| |  |  |  |  |       | |
  243  |M                                         |DL3529 | |  |  |  |  |       | |
  244  |M          MC44200FU                      |GLL2   | |  |  |  |  |       | |
  245  |A                              3.6864MHz  |-------|                  CN6| |
  246  |                                                             |  |       | |
  247  |                               |--------|   |-|              |  |       | |
  248  |                               |CAPCOM  |   | |   |-------|  |  |       | |
  249  |        TD62064                |DL-2929 |   | |   |CAPCOM |  |  |       | |
  250  |                               |IOU     |   | |   |DL-3429|  |  |       | |
  251  |        TD62064                |--------|   | |   |GLL1   |  S  S       | |
  252  |--|                            *HA16103FPJ  | |   |-------|  I  I       |-|
  253     |                                         | |CN5           M  M        |
  254     |                                         | |   |-------|  M  M        |
  255    |-|                        93C46           | |   |CAPCOM |  2  1        |
  256    | |      PS2501                            | |   |DL-2829|  |  | |-----||
  257    | |CN1                                     | |   |CCU    |  |  | |AMD  ||
  258    | |      PS2501                            | |   |-------|  |  | |33C93||
  259    |-|                                        |-|              |  | |-----||
  260     |   SW1                                         HM514260   |  |        |
  261     |----------------------------------------------------------------------|
  262  Notes:
  263        TA8201     - Toshiba TA8201 18W BTL x 2-Channel Audio Power Amplifier
  264        PS2501     - NEC PS2501 High Isolation Voltage Single Transistor Type Multi Photocoupler (DIP16)
  265        TDA1306T   - Philips TDA1306T Noise Shaping Filter DAC (SOIC24). The clock (on pin 12) measures
  266                     14.3181667MHz (42.9545/3)
  267        MC44200FU  - Motorola MC44200FU Triple 8-bit Video DAC (QFP44)
  268        LM833N     - ST Microelectronics LM833N Low Noise Audio Dual Op-Amp (DIP8)
  269        TD62064    - Toshiba TD62064AP NPN 50V 1.5A Quad Darlington Driver (DIP16)
  270        HA16103FPJ - Hitachi HA16103FPJ Watchdog Timer (SOIC20)
  271                     *Note this IC is not populated on the rev -4 board
  272        93C46      - National Semiconductor NM93C46A 128bytes x8 Serial EEPROM (SOIC8)
  273                     Note this IC is covered by a plastic housing on the PCB. The chip is just a normal
  274                     (unsecured) EEPROM so why it was covered is not known.
  275        LM385      - National Semiconductor LM385 Adjustable Micropower Voltage Reference Diode (SOIC8)
  276        33C93      - AMD 33C93A-16 SCSI Controller (PLCC44)
  277        KM681002   - Samsung Electronics KM681002 128k x8 SRAM (SOJ32)
  278        62256      - 8k x8 SRAM (SOJ28)
  279        HM514260   - Hitachi HM514260CJ7 1M x16 DRAM (SOJ42)
  280        TC5118160  - Toshiba TC5118160BJ-60 256k x16 DRAM (SOJ42)
  281        SW1        - Push-button Test Switch
  282        VOL        - Master Volume Potentiometer
  283        J1/J2      - Optional RCA Left/Right Audio Out Connectors
  284        CN1        - 34-Pin Capcom Kick Button Harness Connector
  285        CN5        - Security Cartridge Slot
  286        CN6        - 4-Pin Power Connector and 50-pin SCSI Data Cable Connector
  287                     CDROM Drive is a CR504-KCM 4X SCSI drive manufactured By Panasonic / Matsushita
  288        SIMM 1-2   - 72-Pin SIMM Connector, holds single sided SIMMs containing 4x Fujitsu 29F016A
  289                     surface mounted TSOP48 FlashROMs
  290        SIMM 3-7   - 72-Pin SIMM Connector, holds double sided SIMMs containing 8x Fujitsu 29F016A
  291                     surface mounted TSOP48 FlashROMs
  292  
  293                     SIMM Layout -
  294                            |----------------------------------------------------|
  295                            |                                                    |
  296                            |   |-------|   |-------|   |-------|   |-------|    |
  297                            |   |Flash_A|   |Flash_B|   |Flash_C|   |Flash_D|    |
  298                            |   |-------|   |-------|   |-------|   |-------|    |
  299                            |-                                                   |
  300                             |-------------------------/\------------------------|
  301                             Notes:
  302                                    For SIMMs 1-2, Flash_A & Flash_C and regular pinout (Fujitsu 29F016A-90PFTN)
  303                                    Flash_B & Flash_D are reverse pinout (Fujitsu 29F016A-90PFTR)
  304                                    and are mounted upside down also so that pin1 lines up with
  305                                    the normal pinout of FlashROMs A & C.
  306                                    For SIMMs 3-7, the 8 FlashROMs are populated on both sides using a similar layout.
  307  
  308        Capcom Custom ASICs -
  309                             DL-2729 PPU SD10-505   (QFP304). Decapping reveals this is the main graphics chip.
  310                             DL-2829 CCU SD07-1514  (QFP208). Decapping reveals this to be a custom Toshiba ASIC.
  311                             DL-2929 IOU SD08-1513  (QFP208). This is the I/O controller.
  312                             DL-3329 SSU SD04-1536  (QFP144). This is might be the main CPU. It appears to be a SH2
  313                                                              variant with built-in encryption. It is clocked at
  314                                                              21.47725MHz (42.9545/2)
  315                             DL-3429 GLL1 SD06-1537 (QFP144). Unknown, possibly a DMA or bus controller.
  316                             DL-3529 GLL2 SD11-1755 (QFP80).  This might be the sound chip (it has 32k SRAM connected to it).
  317  
  318  
  319  Connector Pinouts
  320  -----------------
  321  
  322                         JAMMA Connector                                       Extra Button Connector
  323                         ---------------                                       ----------------------
  324                      PART SIDE    SOLDER SIDE                                       TOP    BOTTOM
  325                  ----------------------------                               --------------------------
  326                        GND  01    A  GND                                        GND  01    02  GND
  327                        GND  02    B  GND                                        +5V  03    04  +5V
  328                        +5V  03    C  +5V                                       +12V  05    06  +12V
  329                        +5V  04    D  +5V                                             07    08
  330                         NC  05    E  NC                           Player 2 Button 4  09    10
  331                       +12V  06    F  +12V                                            11    12
  332                             07    H                                                  13    14
  333             Coin Counter 1  08    J  NC                           Player 1 Button 4  15    16
  334               Coin Lockout  09    K  Coin Lockout                 Player 1 Button 5  17    18
  335                 Speaker (+) 10    L  Speaker (-)                  Player 1 Button 6  19    20
  336                         NC  11    M  NC                           Player 2 Button 5  21    22
  337                  Video Red  12    N  Video Green                  Player 2 Button 6  23    24
  338                 Video Blue  13    P  Video Composite Sync                            25    26
  339               Video Ground  14    R  Service Switch                                  27    28
  340                       Test  15    S  NC                                 Volume Down  29    30  Volume UP
  341                     Coin A  16    T  Coin B                                     GND  31    32  GND
  342             Player 1 Start  17    U  Player 2 Start                             GND  33    34  GND
  343                Player 1 Up  18    V  Player 2 Up
  344              Player 1 Down  19    W  Player 2 Down
  345              Player 1 Left  20    X  Player 2 Left
  346             Player 1 Right  21    Y  Player 2 Right
  347          Player 1 Button 1  22    Z  Player 2 Button 1
  348          Player 1 Button 2  23    a  Player 2 Button 2
  349          Player 1 Button 3  24    b  Player 2 Button 3
  350                         NC  25    c  NC
  351                         NC  26    d  NC
  352                        GND  27    e  GND
  353                        GND  28    f  GND
  354  
  355  
  356  Security Cartridge PCB Layout
  357  -----------------------------
  358  
  359  CAPCOM 95682B-3 TORNADE
  360  |------------------------------------------------|
  361  |      BATTERY                                   |
  362  |                          |-------|             |
  363  |                          |CAPCOM |   29F400    |
  364  |                          |DL-3229|   *28F400   |
  365  |                          |SCU    |     *FM1208S|
  366  | 74HC00                   |-------|             |
  367  |               6.25MHz                    74F00 |
  368  |---|     |-|                             |------|
  369      |     | |                             |
  370      |-----| |-----------------------------|
  371  Notes:
  372        74F00        - 74F00 Quad 2-Input NAND Gate (SOIC14)
  373        74HC00       - Philips 74HC00N Quad 2-Input NAND Gate (DIP14)
  374        29F400       - Fujitsu 29F400TA-90PFTN 512k x8 FlashROM (TSOP48)
  375        Custom ASIC  - CAPCOM DL-3229 SCU (QFP144). Decapping reveals this is a Hitachi HD6417099 SH2 variant
  376                       with built-in encryption, clocked at 6.250MHz
  377        FM1208S      - RAMTRON FM1208S 4k (512bytes x8) Nonvolatile Ferroelectric RAM (SOIC24)
  378        28F400       - 28F400 SOP44 FlashROM (not populated)
  379        *            - These components located on the other side of the PCB
  380        The battery powers the CPU only. A small board containing some transistors is wired to the 74HC00
  381        to switch the CPU from battery power to main power to increase the life of the battery.
  382  
  383  */
  384  
  385  #include "emu.h"
  386  #include "cdrom.h"
  387  #include "cpu/sh2/sh2.h"
  388  #include "machine/intelfsh.h"
  389  #include "machine/nvram.h"
  390  #include "includes/cps3.h"
  391  #include "machine/scsibus.h"
  392  #include "machine/scsicd.h"
  393  #include "machine/wd33c93.h"
  394  
  395  #define MASTER_CLOCK    42954500
  396  
  397  #define DEBUG_PRINTF 0
  398  
  399  
  400  
  401  #define DMA_XOR(a)      ((a) ^ NATIVE_ENDIAN_VALUE_LE_BE(1,2))
  402  
  403  #define USER4REGION_LENGTH 0x800000*2
  404  #define USER5REGION_LENGTH 0x800000*10
  405  
  406  #define CPS3_TRANSPARENCY_NONE 0
  407  #define CPS3_TRANSPARENCY_PEN 1
  408  #define CPS3_TRANSPARENCY_PEN_INDEX 2
  409  #define CPS3_TRANSPARENCY_PEN_INDEX_BLEND 3
  410  
  411  inline void cps3_state::cps3_drawgfxzoom(bitmap_rgb32 &dest_bmp,const rectangle &clip,gfx_element *gfx,
  412          unsigned int code,unsigned int color,int flipx,int flipy,int sx,int sy,
  413          int transparency,int transparent_color,
  414          int scalex, int scaley,bitmap_ind8 *pri_buffer,UINT32 pri_mask)
  415  {
  416      rectangle myclip;
  417  
  418  //  UINT8 al;
  419  
  420  //  al = (pdrawgfx_shadow_lowpri) ? 0 : 0x80;
  421  
  422      if (!scalex || !scaley) return;
  423  
  424  // todo: reimplement this optimization!!
  425  //  if (scalex == 0x10000 && scaley == 0x10000)
  426  //  {
  427  //      common_drawgfx(dest_bmp,gfx,code,color,flipx,flipy,sx,sy,clip,transparency,transparent_color,pri_buffer,pri_mask);
  428  //      return;
  429  //  }
  430  
  431      /*
  432      scalex and scaley are 16.16 fixed point numbers
  433      1<<15 : shrink to 50%
  434      1<<16 : uniform scale
  435      1<<17 : double to 200%
  436      */
  437  
  438  
  439      /* force clip to bitmap boundary */
  440      myclip = clip;
  441      myclip &= dest_bmp.cliprect();
  442  
  443      /* 32-bit ONLY */
  444      {
  445          if( gfx )
  446          {
  447  //          const pen_t *pal = &gfx->colortable[gfx->granularity() * (color % gfx->colors())];
  448              UINT32 palbase = (gfx->granularity() * color) & 0x1ffff;
  449              const pen_t *pal = &m_mame_colours[palbase];
  450              const UINT8 *source_base = gfx->get_data(code % gfx->elements());
  451  
  452              int sprite_screen_height = (scaley*gfx->height()+0x8000)>>16;
  453              int sprite_screen_width = (scalex*gfx->width()+0x8000)>>16;
  454  
  455              if (sprite_screen_width && sprite_screen_height)
  456              {
  457                  /* compute sprite increment per screen pixel */
  458                  int dx = (gfx->width()<<16)/sprite_screen_width;
  459                  int dy = (gfx->height()<<16)/sprite_screen_height;
  460  
  461                  int ex = sx+sprite_screen_width;
  462                  int ey = sy+sprite_screen_height;
  463  
  464                  int x_index_base;
  465                  int y_index;
  466  
  467                  if( flipx )
  468                  {
  469                      x_index_base = (sprite_screen_width-1)*dx;
  470                      dx = -dx;
  471                  }
  472                  else
  473                  {
  474                      x_index_base = 0;
  475                  }
  476  
  477                  if( flipy )
  478                  {
  479                      y_index = (sprite_screen_height-1)*dy;
  480                      dy = -dy;
  481                  }
  482                  else
  483                  {
  484                      y_index = 0;
  485                  }
  486  
  487                  if( sx < myclip.min_x)
  488                  { /* clip left */
  489                      int pixels = myclip.min_x-sx;
  490                      sx += pixels;
  491                      x_index_base += pixels*dx;
  492                  }
  493                  if( sy < myclip.min_y )
  494                  { /* clip top */
  495                      int pixels = myclip.min_y-sy;
  496                      sy += pixels;
  497                      y_index += pixels*dy;
  498                  }
  499                  if( ex > myclip.max_x+1 )
  500                  { /* clip right */
  501                      int pixels = ex-myclip.max_x-1;
  502                      ex -= pixels;
  503                  }
  504                  if( ey > myclip.max_y+1 )
  505                  { /* clip bottom */
  506                      int pixels = ey-myclip.max_y-1;
  507                      ey -= pixels;
  508                  }
  509  
  510                  if( ex>sx )
  511                  { /* skip if inner loop doesn't draw anything */
  512                      int y;
  513  
  514                      /* case 0: no transparency */
  515                      if (transparency == CPS3_TRANSPARENCY_NONE)
  516                      {
  517                          {
  518                              for( y=sy; y<ey; y++ )
  519                              {
  520                                  const UINT8 *source = source_base + (y_index>>16) * gfx->rowbytes();
  521                                  UINT32 *dest = &dest_bmp.pix32(y);
  522  
  523                                  int x, x_index = x_index_base;
  524                                  for( x=sx; x<ex; x++ )
  525                                  {
  526                                      dest[x] = pal[source[x_index>>16]];
  527                                      x_index += dx;
  528                                  }
  529  
  530                                  y_index += dy;
  531                              }
  532                          }
  533                      }
  534                      else if (transparency == CPS3_TRANSPARENCY_PEN)
  535                      {
  536                          {
  537                              for( y=sy; y<ey; y++ )
  538                              {
  539                                  const UINT8 *source = source_base + (y_index>>16) * gfx->rowbytes();
  540                                  UINT32 *dest = &dest_bmp.pix32(y);
  541  
  542                                  int x, x_index = x_index_base;
  543                                  for( x=sx; x<ex; x++ )
  544                                  {
  545                                      int c = source[x_index>>16];
  546                                      if( c != transparent_color ) dest[x] = pal[c];
  547                                      x_index += dx;
  548                                  }
  549  
  550                                  y_index += dy;
  551                              }
  552                          }
  553                      }
  554                      else if (transparency == CPS3_TRANSPARENCY_PEN_INDEX)
  555                      {
  556                          {
  557                              for( y=sy; y<ey; y++ )
  558                              {
  559                                  const UINT8 *source = source_base + (y_index>>16) * gfx->rowbytes();
  560                                  UINT32 *dest = &dest_bmp.pix32(y);
  561  
  562                                  int x, x_index = x_index_base;
  563                                  for( x=sx; x<ex; x++ )
  564                                  {
  565                                      int c = source[x_index>>16];
  566                                      if( c != transparent_color ) dest[x] = c | palbase;
  567                                      x_index += dx;
  568                                  }
  569  
  570                                  y_index += dy;
  571                              }
  572                          }
  573                      }
  574                      else if (transparency == CPS3_TRANSPARENCY_PEN_INDEX_BLEND)
  575                      {
  576                          {
  577                              for( y=sy; y<ey; y++ )
  578                              {
  579                                  const UINT8 *source = source_base + (y_index>>16) * gfx->rowbytes();
  580                                  UINT32 *dest = &dest_bmp.pix32(y);
  581  
  582                                  int x, x_index = x_index_base;
  583                                  for( x=sx; x<ex; x++ )
  584                                  {
  585                                      int c = source[x_index>>16];
  586                                      if( c != transparent_color )
  587                                      {
  588                                          /* blending isn't 100% understood */
  589                                          if (gfx->granularity() == 64)
  590                                          {
  591                                              // OK for sfiii2 spotlight
  592                                              if (c&0x01) dest[x] |= 0x2000;
  593                                              if (c&0x02) dest[x] |= 0x4000;
  594                                              if (c&0x04) dest[x] |= 0x8000;
  595                                              if (c&0x08) dest[x] |= 0x10000;
  596                                              if (c&0xf0) dest[x] |= gfx->machine().rand(); // ?? not used?
  597                                          }
  598                                          else
  599                                          {
  600                                              // OK for jojo intro, and warzard swords, and various shadows in sf games
  601                                              if (c&0x01) dest[x] |= 0x8000;
  602                                              if (color&0x100) dest[x]|=0x10000;
  603                                          }
  604                                      }
  605  
  606  
  607                                      x_index += dx;
  608                                  }
  609  
  610                                  y_index += dy;
  611                              }
  612                          }
  613                      }
  614                  }
  615              }
  616          }
  617      }
  618  }
  619  
  620  
  621  
  622  /* Encryption */
  623  
  624  
  625  UINT16 cps3_state::rotate_left(UINT16 value, int n)
  626  {
  627      int aux = value>>(16-n);
  628      return ((value<<n)|aux)%0x10000;
  629  }
  630  
  631  UINT16 cps3_state::rotxor(UINT16 val, UINT16 xorval)
  632  {
  633      UINT16 res;
  634  
  635      res = val + rotate_left(val,2);
  636  
  637      res = rotate_left(res,4) ^ (res & (val ^ xorval));
  638  
  639      return res;
  640  }
  641  
  642  UINT32 cps3_state::cps3_mask(UINT32 address, UINT32 key1, UINT32 key2)
  643  {
  644      UINT16 val;
  645  
  646      address ^= key1;
  647  
  648      val = (address & 0xffff) ^ 0xffff;
  649  
  650      val = rotxor(val, key2 & 0xffff);
  651  
  652      val ^= (address >> 16) ^ 0xffff;
  653  
  654      val = rotxor(val, key2 >> 16);
  655  
  656      val ^= (address & 0xffff) ^ (key2 & 0xffff);
  657  
  658      return val | (val << 16);
  659  }
  660  
  661  void cps3_state::cps3_decrypt_bios()
  662  {
  663      int i;
  664      UINT32 *coderegion = (UINT32*)memregion("user1")->base();
  665  
  666      m_decrypted_bios = (UINT32*)memregion("user1")->base();
  667  
  668      for (i=0;i<0x80000;i+=4)
  669      {
  670          UINT32 dword = coderegion[i/4];
  671          UINT32 xormask = cps3_mask(i, m_key1, m_key2);
  672          m_decrypted_bios[i/4] = dword ^ xormask;
  673      }
  674  #if 0
  675      /* Dump to file */
  676      {
  677          FILE *fp;
  678          const char *gamename = machine().system().name;
  679          char filename[256];
  680          sprintf(filename, "%s_bios.dump", gamename);
  681  
  682          fp=fopen(filename, "w+b");
  683          if (fp)
  684          {
  685              fwrite(m_decrypted_bios, 0x080000, 1, fp);
  686              fclose(fp);
  687          }
  688      }
  689  #endif
  690  }
  691  
  692  
  693  void cps3_state::init_common(UINT32 key1, UINT32 key2, int altEncryption)
  694  {
  695      m_key1 = key1;
  696      m_key2 = key2;
  697      m_altEncryption = altEncryption;
  698  
  699      // cache pointers to regions
  700      m_user4region = memregion("user4")->base();
  701      m_user5region = memregion("user5")->base();
  702  
  703      if (!m_user4region) m_user4region = auto_alloc_array(machine(), UINT8, USER4REGION_LENGTH);
  704      if (!m_user5region) m_user5region = auto_alloc_array(machine(), UINT8, USER5REGION_LENGTH);
  705  
  706      // set strict verify
  707      sh2drc_set_options(machine().device("maincpu"), SH2DRC_STRICT_VERIFY);
  708  
  709      cps3_decrypt_bios();
  710      m_decrypted_gamerom = auto_alloc_array(machine(), UINT32, 0x1000000/4);
  711  
  712      /* just some NOPs for the game to execute if it crashes and starts executing unmapped addresses
  713       - this prevents MAME from crashing */
  714      m_nops = auto_alloc(machine(), UINT32);
  715      m_nops[0] = 0x00090009;
  716  
  717  
  718      m_0xc0000000_ram_decrypted = auto_alloc_array(machine(), UINT32, 0x400/4);
  719  
  720      address_space &main = machine().device<sh2_device>("maincpu")->space(AS_PROGRAM);
  721      main.set_direct_update_handler(direct_update_delegate(FUNC(cps3_state::cps3_direct_handler), this));
  722  
  723      // flash roms
  724      astring tempstr;
  725      for (int simmnum = 0; simmnum < 7; simmnum++)
  726          for (int chipnum = 0; chipnum < 8; chipnum++)
  727              m_simm[simmnum][chipnum] = machine().device<fujitsu_29f016a_device>(tempstr.format("simm%d.%d", simmnum + 1, chipnum));
  728  
  729      m_eeprom = auto_alloc_array(machine(), UINT32, 0x400/4);
  730      machine().device<nvram_device>("eeprom")->set_base(m_eeprom, 0x400);
  731  }
  732  
  733  DRIVER_INIT_MEMBER(cps3_state,redearth)  { init_common(0x9e300ab1, 0xa175b82c, 0); }
  734  DRIVER_INIT_MEMBER(cps3_state,sfiii)     { init_common(0xb5fe053e, 0xfc03925a, 0); }
  735  DRIVER_INIT_MEMBER(cps3_state,sfiii2)    { init_common(0x00000000, 0x00000000, 1); }
  736  DRIVER_INIT_MEMBER(cps3_state,jojo)      { init_common(0x02203ee3, 0x01301972, 0); }
  737  DRIVER_INIT_MEMBER(cps3_state,sfiii3)    { init_common(0xa55432b4, 0x0c129981, 0); }
  738  DRIVER_INIT_MEMBER(cps3_state,jojoba)    { init_common(0x23323ee3, 0x03021972, 0); }
  739  
  740  
  741  
  742  /* GFX decodes */
  743  
  744  
  745  static const gfx_layout cps3_tiles16x16_layout =
  746  {
  747      16,16,
  748      0x8000,
  749      8,
  750      { 0,1,2,3,4,5,6,7 },
  751      { 3*8,2*8,1*8,0*8,7*8,6*8,5*8,4*8,
  752          11*8,10*8,9*8,8*8,15*8,14*8,13*8,12*8 },
  753      { 0*128,1*128,2*128,3*128,4*128,5*128,6*128,7*128,8*128,9*128,10*128,11*128,12*128,13*128,14*128,15*128},
  754      8*256
  755  };
  756  
  757  
  758  
  759  static const gfx_layout cps3_tiles8x8_layout =
  760  {
  761      8,8,
  762      0x400,
  763      4,
  764      { /*8,9,10,11,*/ 0,1,2,3 },
  765      { 20,16,4,0,52,48,36,32 },
  766  
  767      { 0*64, 1*64, 2*64, 3*64, 4*64, 5*64, 6*64, 7*64 },
  768      64*8
  769  };
  770  
  771  
  772  void cps3_state::cps3_set_mame_colours(int colournum, UINT16 data, UINT32 fadeval)
  773  {
  774      int r,g,b;
  775      UINT16* dst = (UINT16*)m_colourram.target();
  776  
  777  
  778      r = (data >> 0) & 0x1f;
  779      g = (data >> 5) & 0x1f;
  780      b = (data >> 10) & 0x1f;
  781  
  782      /* is this 100% correct? */
  783      if (fadeval!=0)
  784      {
  785          int fade;
  786          //printf("fadeval %08x\n",fadeval);
  787  
  788          fade = (fadeval & 0x3f000000)>>24;
  789          r = (r*fade)>>5;
  790          if (r>0x1f) r = 0x1f;
  791  
  792          fade = (fadeval & 0x003f0000)>>16;
  793          g = (g*fade)>>5;
  794          if (g>0x1f) g = 0x1f;
  795  
  796          fade = (fadeval & 0x0000003f)>>0;
  797          b = (b*fade)>>5;
  798          if (b>0x1f) b = 0x1f;
  799  
  800          data = (r <<0) | (g << 5) | (b << 10);
  801      }
  802  
  803      dst[colournum] = data;
  804  
  805      m_mame_colours[colournum] = (r << (16+3)) | (g << (8+3)) | (b << (0+3));
  806  
  807      if (colournum<0x10000) palette_set_color(machine(),colournum,m_mame_colours[colournum]/* MAKE_RGB(r<<3,g<<3,b<<3)*/);//m_mame_colours[colournum]);
  808  }
  809  
  810  
  811  void cps3_state::video_start()
  812  {
  813      m_ss_ram       = auto_alloc_array(machine(), UINT32, 0x10000/4);
  814      memset(m_ss_ram, 0x00, 0x10000);
  815      state_save_register_global_pointer(machine(), m_ss_ram, 0x10000/4);
  816  
  817      m_char_ram = auto_alloc_array(machine(), UINT32, 0x800000/4);
  818      memset(m_char_ram, 0x00, 0x800000);
  819      state_save_register_global_pointer(machine(), m_char_ram, 0x800000 /4);
  820  
  821      /* create the char set (gfx will then be updated dynamically from RAM) */
  822      machine().gfx[0] = auto_alloc(machine(), gfx_element(machine(), cps3_tiles8x8_layout, (UINT8 *)m_ss_ram, machine().total_colors() / 16, 0));
  823  
  824      //decode_ssram();
  825  
  826      /* create the char set (gfx will then be updated dynamically from RAM) */
  827      machine().gfx[1] = auto_alloc(machine(), gfx_element(machine(), cps3_tiles16x16_layout, (UINT8 *)m_char_ram, machine().total_colors() / 64, 0));
  828      machine().gfx[1]->set_granularity(64);
  829  
  830      //decode_charram();
  831  
  832      m_mame_colours = auto_alloc_array(machine(), UINT32, 0x80000/4);
  833      memset(m_mame_colours, 0x00, 0x80000);
  834  
  835      m_screenwidth = 384;
  836  
  837      // the renderbuffer can be twice the size of the screen, this allows us to handle framebuffer zoom values
  838      // between 0x00 and 0x80 (0x40 is normal, 0x80 would be 'view twice as much', 0x20 is 'view half as much')
  839      m_renderbuffer_bitmap.allocate(512*2,224*2);
  840  
  841      m_renderbuffer_clip.set(0, m_screenwidth-1, 0, 224-1);
  842  
  843      m_renderbuffer_bitmap.fill(0x3f, m_renderbuffer_clip);
  844  
  845  }
  846  
  847  // the 0x400 bit in the tilemap regs is "draw it upside-down"  (bios tilemap during flashing, otherwise capcom logo is flipped)
  848  
  849  void cps3_state::cps3_draw_tilemapsprite_line(int tmnum, int drawline, bitmap_rgb32 &bitmap, const rectangle &cliprect )
  850  {
  851      UINT32* tmapregs[4] = { m_tilemap20_regs_base, m_tilemap30_regs_base, m_tilemap40_regs_base, m_tilemap50_regs_base };
  852      UINT32* regs;
  853      int line;
  854      int scrolly;
  855      if (tmnum>3)
  856      {
  857          printf("cps3_draw_tilemapsprite_line Illegal tilemap number %d\n",tmnum);
  858          return;
  859      }
  860      regs = tmapregs[tmnum];
  861  
  862      scrolly =  ((regs[0]&0x0000ffff)>>0)+4;
  863      line = drawline+scrolly;
  864      line&=0x3ff;
  865  
  866  
  867      if (!(regs[1]&0x00008000)) return;
  868  
  869      {
  870          UINT32 mapbase =  (regs[2]&0x007f0000)>>16;
  871          UINT32 linebase=  (regs[2]&0x7f000000)>>24;
  872          int linescroll_enable = (regs[1]&0x00004000);
  873  
  874          int scrollx;
  875          int x;
  876          int tileline = (line/16)+1;
  877          int tilesubline = line % 16;
  878          rectangle clip;
  879  
  880          mapbase = mapbase << 10;
  881          linebase = linebase << 10;
  882  
  883          if (!linescroll_enable)
  884          {
  885              scrollx =  (regs[0]&0xffff0000)>>16;
  886          }
  887          else
  888          {
  889          //  printf("linebase %08x\n", linebase);
  890  
  891              scrollx =  (regs[0]&0xffff0000)>>16;
  892              scrollx+= (m_spriteram[linebase+((line+16-4)&0x3ff)]>>16)&0x3ff;
  893  
  894          }
  895  
  896  //  zoombase    =  (layerregs[1]&0xffff0000)>>16;
  897  
  898          drawline&=0x3ff;
  899  
  900          if (drawline>cliprect.max_y+4) return;
  901  
  902          clip.set(cliprect.min_x, cliprect.max_x, drawline, drawline);
  903  
  904          for (x=0;x<(cliprect.max_x/16)+2;x++)
  905          {
  906              UINT32 dat;
  907              int tileno;
  908              int colour;
  909              int bpp;
  910              int xflip,yflip;
  911  
  912              dat = m_spriteram[mapbase+((tileline&63)*64)+((x+scrollx/16)&63)];
  913              tileno = (dat & 0xffff0000)>>17;
  914              colour = (dat & 0x000001ff)>>0;
  915              bpp = (dat & 0x0000200)>>9;
  916              yflip  = (dat & 0x00000800)>>11;
  917              xflip  = (dat & 0x00001000)>>12;
  918  
  919              if (!bpp) machine().gfx[1]->set_granularity(256);
  920              else machine().gfx[1]->set_granularity(64);
  921  
  922              cps3_drawgfxzoom(bitmap,clip,machine().gfx[1],tileno,colour,xflip,yflip,(x*16)-scrollx%16,drawline-tilesubline,CPS3_TRANSPARENCY_PEN_INDEX,0, 0x10000, 0x10000, NULL, 0);
  923          }
  924      }
  925  }
  926  
  927  UINT32 cps3_state::screen_update_cps3(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
  928  {
  929      int y,x, count;
  930      attoseconds_t period = screen.frame_period().attoseconds;
  931      rectangle visarea = screen.visible_area();
  932  
  933      int bg_drawn[4] = { 0, 0, 0, 0 };
  934  
  935      UINT32 fullscreenzoomx, fullscreenzoomy;
  936      UINT32 fszx, fszy;
  937  
  938  //  decode_ssram();
  939  //  decode_charram();
  940  
  941      /* registers are normally 002a006f 01ef01c6
  942              widescreen mode = 00230076 026501c6
  943        only SFIII2 uses widescreen, I don't know exactly which register controls it */
  944      if (((m_fullscreenzoom[1]&0xffff0000)>>16)==0x0265)
  945      {
  946          if (m_screenwidth!=496)
  947          {
  948              m_screenwidth = 496;
  949              visarea.set(0, 496-1, 0, 224-1);
  950              screen.configure(496, 224, visarea, period);
  951          }
  952      }
  953      else
  954      {
  955          if (m_screenwidth!=384)
  956          {
  957              m_screenwidth = 384;
  958              visarea.set(0, 384-1, 0, 224-1);
  959              screen.configure(384, 224, visarea, period);
  960          }
  961      }
  962  
  963      fullscreenzoomx = m_fullscreenzoom[3] & 0x000000ff;
  964      fullscreenzoomy = m_fullscreenzoom[3] & 0x000000ff;
  965      /* clamp at 0x80, I don't know if this is accurate */
  966      if (fullscreenzoomx>0x80) fullscreenzoomx = 0x80;
  967      if (fullscreenzoomy>0x80) fullscreenzoomy = 0x80;
  968  
  969      fszx = (fullscreenzoomx<<16)/0x40;
  970      fszy = (fullscreenzoomy<<16)/0x40;
  971  
  972      m_renderbuffer_clip.min_x = 0;
  973      m_renderbuffer_clip.max_x = ((m_screenwidth*fszx)>>16)-1;
  974      m_renderbuffer_clip.min_y = 0;
  975      m_renderbuffer_clip.max_y = ((224*fszx)>>16)-1;
  976  
  977      m_renderbuffer_bitmap.fill(0, m_renderbuffer_clip);
  978  
  979      /* Sprites */
  980      {
  981          int i;
  982  
  983          //printf("Spritelist start:\n");
  984          for (i=0x00000/4;i<0x2000/4;i+=4)
  985          {
  986              int xpos =      (m_spriteram[i+1]&0x03ff0000)>>16;
  987              int ypos =      m_spriteram[i+1]&0x000003ff;
  988              int j;
  989              int gscroll =      (m_spriteram[i+0]&0x70000000)>>28;
  990              int length =    (m_spriteram[i+0]&0x01ff0000)>>16; // how many entries in the sprite table
  991              UINT32 start  =    (m_spriteram[i+0]&0x00007ff0)>>4;
  992  
  993              int whichbpp =     (m_spriteram[i+2]&0x40000000)>>30; // not 100% sure if this is right, jojo title / characters
  994              int whichpal =     (m_spriteram[i+2]&0x20000000)>>29;
  995              int global_xflip = (m_spriteram[i+2]&0x10000000)>>28;
  996              int global_yflip = (m_spriteram[i+2]&0x08000000)>>27;
  997              int global_alpha = (m_spriteram[i+2]&0x04000000)>>26; // alpha / shadow? set on sfiii2 shadows, and big black image in jojo intro
  998              int global_bpp =   (m_spriteram[i+2]&0x02000000)>>25;
  999              int global_pal =   (m_spriteram[i+2]&0x01ff0000)>>16;
 1000  
 1001              int gscrollx = (m_unk_vidregs[gscroll]&0x03ff0000)>>16;
 1002              int gscrolly = (m_unk_vidregs[gscroll]&0x000003ff)>>0;
 1003              start = (start * 0x100) >> 2;
 1004  
 1005              if ((m_spriteram[i+0]&0xf0000000) == 0x80000000)
 1006                  break;
 1007  
 1008              for (j=0;j<(length)*4;j+=4)
 1009              {
 1010                  UINT32 value1 =     (m_spriteram[start+j+0]);
 1011                  UINT32 value2 =     (m_spriteram[start+j+1]);
 1012                  UINT32 value3 =     (m_spriteram[start+j+2]);
 1013  
 1014  
 1015                  //UINT8* srcdata = (UINT8*)m_char_ram;
 1016                  //UINT32 sourceoffset = (value1 >>14)&0x7fffff;
 1017                  int count;
 1018  
 1019                  UINT32 tileno = (value1&0xfffe0000)>>17;
 1020  
 1021                  int xpos2 = (value2 & 0x03ff0000)>>16;
 1022                  int ypos2 = (value2 & 0x000003ff)>>0;
 1023                  int flipx = (value1 & 0x00001000)>>12;
 1024                  int flipy = (value1 & 0x00000800)>>11;
 1025                  int alpha = (value1 & 0x00000400)>>10; //? this one is used for alpha effects on warzard
 1026                  int bpp =   (value1 & 0x00000200)>>9;
 1027                  int pal =   (value1 & 0x000001ff);
 1028  
 1029  
 1030                  /* these are the sizes to actually draw */
 1031                  int ysizedraw2 = ((value3 & 0x7f000000)>>24);
 1032                  int xsizedraw2 = ((value3 & 0x007f0000)>>16);
 1033                  int xx,yy;
 1034  
 1035                  static const int tilestable[4] = { 8,1,2,4 };
 1036                  int ysize2 = ((value3 & 0x0000000c)>>2);
 1037                  int xsize2 = ((value3 & 0x00000003)>>0);
 1038                  UINT32 xinc,yinc;
 1039  
 1040                  if (ysize2==0)
 1041                  {
 1042                  //  printf("invalid sprite ysize of 0 tiles\n");
 1043                      continue;
 1044                  }
 1045  
 1046                  if (xsize2==0) // xsize of 0 tiles seems to be a special command to draw tilemaps
 1047                  {
 1048                      int tilemapnum = ((value3 & 0x00000030)>>4);
 1049                      //int startline;// = value2 & 0x3ff;
 1050                      //int endline;
 1051                      //int height = (value3 & 0x7f000000)>>24;
 1052                      int uu;
 1053  //                  UINT32* tmapregs[4] = { m_tilemap20_regs_base, m_tilemap30_regs_base, m_tilemap40_regs_base, m_tilemap50_regs_base };
 1054  //                  UINT32* regs;
 1055  //                  regs = tmapregs[tilemapnum];
 1056                      //endline = value2;
 1057                      //startline = endline - height;
 1058  
 1059                      //startline &=0x3ff;
 1060                      //endline &=0x3ff;
 1061  
 1062                      //printf("tilemap draw %01x %02x %02x %02x\n",tilemapnum, value2, height, regs[0]&0x000003ff );
 1063  
 1064                      //printf("tilemap draw %01x %d %d\n",tilemapnum, startline, endline );
 1065  
 1066  
 1067                      /* Urgh, the startline / endline seem to be direct screen co-ordinates regardless of fullscreen zoom
 1068                         which probably means the fullscreen zoom is applied when rendering everything, not aftewards */
 1069                      //for (uu=startline;uu<endline+1;uu++)
 1070  
 1071                      if (bg_drawn[tilemapnum]==0)
 1072                      {
 1073                          for (uu=0;uu<1023;uu++)
 1074                          {
 1075                              cps3_draw_tilemapsprite_line(tilemapnum, uu, m_renderbuffer_bitmap, m_renderbuffer_clip );
 1076                          }
 1077                      }
 1078                      bg_drawn[tilemapnum] = 1;
 1079                  }
 1080                  else
 1081                  {
 1082                      ysize2 = tilestable[ysize2];
 1083                      xsize2 = tilestable[xsize2];
 1084  
 1085                      xinc = ((xsizedraw2+1)<<16) / ((xsize2*0x10));
 1086                      yinc = ((ysizedraw2+1)<<16) / ((ysize2*0x10));
 1087  
 1088                      xsize2-=1;
 1089                      ysize2-=1;
 1090  
 1091                      flipx ^= global_xflip;
 1092                      flipy ^= global_yflip;
 1093  
 1094                      if (!flipx) xpos2+=((xsizedraw2+1)/2);
 1095                      else xpos2-=((xsizedraw2+1)/2);
 1096  
 1097                      ypos2+=((ysizedraw2+1)/2);
 1098  
 1099                      if (!flipx) xpos2-= ((xsize2+1)*16*xinc)>>16;
 1100                      else  xpos2+= (xsize2*16*xinc)>>16;
 1101  
 1102                      if (flipy) ypos2-= (ysize2*16*yinc)>>16;
 1103  
 1104                      {
 1105                          count = 0;
 1106                          for (xx=0;xx<xsize2+1;xx++)
 1107                          {
 1108                              int current_xpos;
 1109  
 1110                              if (!flipx) current_xpos = (xpos+xpos2+((xx*16*xinc)>>16));
 1111                              else current_xpos = (xpos+xpos2-((xx*16*xinc)>>16));
 1112                              //current_xpos +=  rand()&0x3ff;
 1113                              current_xpos += gscrollx;
 1114                              current_xpos += 1;
 1115                              current_xpos &=0x3ff;
 1116                              if (current_xpos&0x200) current_xpos-=0x400;
 1117  
 1118                              for (yy=0;yy<ysize2+1;yy++)
 1119                              {
 1120                                  int current_ypos;
 1121                                  int actualpal;
 1122  
 1123                                  if (flipy) current_ypos = (ypos+ypos2+((yy*16*yinc)>>16));
 1124                                  else current_ypos = (ypos+ypos2-((yy*16*yinc)>>16));
 1125  
 1126                                  current_ypos += gscrolly;
 1127                                  current_ypos = 0x3ff-current_ypos;
 1128                                  current_ypos -= 17;
 1129                                  current_ypos &=0x3ff;
 1130  
 1131                                  if (current_ypos&0x200) current_ypos-=0x400;
 1132  
 1133                                  //if ( (whichbpp) && (machine().primary_screen->frame_number() & 1)) continue;
 1134  
 1135                                  /* use the palette value from the main list or the sublists? */
 1136                                  if (whichpal)
 1137                                  {
 1138                                      actualpal = global_pal;
 1139                                  }
 1140                                  else
 1141                                  {
 1142                                      actualpal = pal;
 1143                                  }
 1144  
 1145                                  /* use the bpp value from the main list or the sublists? */
 1146                                  if (whichbpp)
 1147                                  {
 1148                                      if (!global_bpp) machine().gfx[1]->set_granularity(256);
 1149                                      else machine().gfx[1]->set_granularity(64);
 1150                                  }
 1151                                  else
 1152                                  {
 1153                                      if (!bpp) machine().gfx[1]->set_granularity(256);
 1154                                      else machine().gfx[1]->set_granularity(64);
 1155                                  }
 1156  
 1157                                  {
 1158                                      int realtileno = tileno+count;
 1159  
 1160                                      if (global_alpha || alpha)
 1161                                      {
 1162                                          cps3_drawgfxzoom(m_renderbuffer_bitmap,m_renderbuffer_clip,machine().gfx[1],realtileno,actualpal,0^flipx,0^flipy,current_xpos,current_ypos,CPS3_TRANSPARENCY_PEN_INDEX_BLEND,0,xinc,yinc, NULL, 0);
 1163                                      }
 1164                                      else
 1165                                      {
 1166                                          cps3_drawgfxzoom(m_renderbuffer_bitmap,m_renderbuffer_clip,machine().gfx[1],realtileno,actualpal,0^flipx,0^flipy,current_xpos,current_ypos,CPS3_TRANSPARENCY_PEN_INDEX,0,xinc,yinc, NULL, 0);
 1167                                      }
 1168                                      count++;
 1169                                  }
 1170                              }
 1171                          }
 1172                      }
 1173      //              */
 1174  
 1175                  //  printf("cell %08x %08x %08x\n",value1, value2, value3);
 1176                  }
 1177              }
 1178          }
 1179      }
 1180  
 1181      /* copy render bitmap with zoom */
 1182      {
 1183          UINT32 renderx,rendery;
 1184          UINT32 srcx, srcy;
 1185          UINT32* srcbitmap;
 1186          UINT32* dstbitmap;
 1187  
 1188  
 1189          srcy=0;
 1190          for (rendery=0;rendery<224;rendery++)
 1191          {
 1192              dstbitmap = &bitmap.pix32(rendery);
 1193              srcbitmap = &m_renderbuffer_bitmap.pix32(srcy>>16);
 1194              srcx=0;
 1195  
 1196              for (renderx=0;renderx<m_screenwidth;renderx++)
 1197              {
 1198                  dstbitmap[renderx] = m_mame_colours[srcbitmap[srcx>>16]&0x1ffff];
 1199                  srcx += fszx;
 1200              }
 1201  
 1202              srcy += fszy;
 1203          }
 1204      }
 1205  
 1206      /* Draw the text layer */
 1207      /* Copy the first 0x800 colours to be used for fg layer rendering */
 1208  //  for (offset=0;offset<0x200;offset++)
 1209  //  {
 1210  //      int palreadbase = (m_ss_pal_base << 9);
 1211  //      palette_set_color(machine(),offset,m_mame_colours[palreadbase+offset]);
 1212  //  }
 1213  
 1214      // fg layer
 1215      {
 1216          // bank select? (sfiii2 intro)
 1217          if (m_ss_bank_base & 0x01000000) count = 0x000;
 1218          else count = 0x800;
 1219  
 1220          for (y=0;y<32;y++)
 1221          {
 1222              for (x=0;x<64;x++)
 1223              {
 1224                  UINT32 data = m_ss_ram[count]; // +0x800 = 2nd bank, used on sfiii2 intro..
 1225                  UINT32 tile = (data >> 16) & 0x1ff;
 1226                  int pal = (data&0x003f) >> 1;
 1227                  int flipx = (data & 0x0080) >> 7;
 1228                  int flipy = (data & 0x0040) >> 6;
 1229                  pal += m_ss_pal_base << 5;
 1230                  tile+=0x200;
 1231  
 1232                  cps3_drawgfxzoom(bitmap, cliprect, machine().gfx[0],tile,pal,flipx,flipy,x*8,y*8,CPS3_TRANSPARENCY_PEN,0,0x10000,0x10000,NULL,0);
 1233                  count++;
 1234              }
 1235          }
 1236      }
 1237      return 0;
 1238  }
 1239  
 1240  READ32_MEMBER(cps3_state::cps3_ssram_r)
 1241  {
 1242      if (offset>0x8000/4)
 1243          return LITTLE_ENDIANIZE_INT32(m_ss_ram[offset]);
 1244      else
 1245          return m_ss_ram[offset];
 1246  }
 1247  
 1248  WRITE32_MEMBER(cps3_state::cps3_ssram_w)
 1249  {
 1250      if (offset>0x8000/4)
 1251      {
 1252          // we only want to endian-flip the character data, the tilemap info is fine
 1253          data = LITTLE_ENDIANIZE_INT32(data);
 1254          mem_mask = LITTLE_ENDIANIZE_INT32(mem_mask);
 1255          machine().gfx[0]->mark_dirty(offset/16);
 1256      }
 1257  
 1258      COMBINE_DATA(&m_ss_ram[offset]);
 1259  }
 1260  
 1261  WRITE32_MEMBER(cps3_state::cps3_0xc0000000_ram_w)
 1262  {
 1263      COMBINE_DATA( &m_0xc0000000_ram[offset] );
 1264      // store a decrypted copy
 1265      m_0xc0000000_ram_decrypted[offset] = m_0xc0000000_ram[offset]^cps3_mask(offset*4+0xc0000000, m_key1, m_key2);
 1266  }
 1267  
 1268  
 1269  
 1270  DIRECT_UPDATE_MEMBER(cps3_state::cps3_direct_handler)
 1271  {
 1272  //  if(DEBUG_PRINTF) printf("address %04x\n",address);
 1273  
 1274      /* BIOS ROM */
 1275      if (address < 0x80000)
 1276      {
 1277          direct.explicit_configure(0x00000, 0x7ffff, 0x7ffff, *direct.space().machine().root_device().memregion("user1"));
 1278          return ~0;
 1279      }
 1280      /* RAM */
 1281      else if (address >= 0x06000000 && address <= 0x06ffffff)
 1282      {
 1283          UINT8 *decrypted = (UINT8*)m_decrypted_gamerom;
 1284          UINT8 *raw = decrypted;
 1285  
 1286          if (m_altEncryption) raw = (UINT8*) m_user4region;
 1287  
 1288          direct.explicit_configure(0x06000000, 0x06ffffff, 0x00ffffff, raw, decrypted);
 1289  
 1290          return ~0;
 1291      }
 1292      else if (address >= 0xc0000000 && address <= 0xc00003ff)
 1293      {
 1294          //direct->decrypted = (void*)m_0xc0000000_ram_decrypted;
 1295          direct.explicit_configure(0xc0000000, 0xc00003ff, 0x3ff, (UINT8*)m_0xc0000000_ram.target(), (UINT8*)m_0xc0000000_ram_decrypted);
 1296          return ~0;
 1297      }
 1298  
 1299      /* anything else falls through to NOPs */
 1300      direct.explicit_configure(address, address, 0, (UINT8*)m_nops, (UINT8*)m_nops);
 1301      return ~0;
 1302  }
 1303  
 1304  
 1305  WRITE32_MEMBER(cps3_state::cram_bank_w)
 1306  {
 1307      if (ACCESSING_BITS_0_7)
 1308      {
 1309          // this seems to be related to accesses to the 0x04100000 region
 1310          if (m_cram_bank != data)
 1311          {
 1312              m_cram_bank = data;
 1313          //if(data&0xfffffff0)
 1314          //bank_w 00000000, ffff0000
 1315          //bank_w 00000001, ffff0000
 1316          //bank_w 00000002, ffff0000
 1317          //bank_w 00000003, ffff0000
 1318          //bank_w 00000004, ffff0000
 1319          //bank_w 00000005, ffff0000
 1320          //bank_w 00000006, ffff0000
 1321          //bank_w 00000007, ffff0000
 1322          // during CHARACTER RAM test..
 1323              if(DEBUG_PRINTF) printf("bank_w %08x, %08x\n",data,mem_mask);
 1324  
 1325          }
 1326      }
 1327      else
 1328      {
 1329          if(DEBUG_PRINTF) printf("bank_w LSB32 %08x, %08x\n",data,mem_mask);
 1330  
 1331      }
 1332  }
 1333  
 1334  READ32_MEMBER(cps3_state::cram_data_r)
 1335  {
 1336      UINT32 fulloffset = (((m_cram_bank&0x7)*0x100000)/4) + offset;
 1337  
 1338      return LITTLE_ENDIANIZE_INT32(m_char_ram[fulloffset]);
 1339  }
 1340  
 1341  WRITE32_MEMBER(cps3_state::cram_data_w)
 1342  {
 1343      UINT32 fulloffset = (((m_cram_bank&0x7)*0x100000)/4) + offset;
 1344      mem_mask = LITTLE_ENDIANIZE_INT32(mem_mask);
 1345      data = LITTLE_ENDIANIZE_INT32(data);
 1346      COMBINE_DATA(&m_char_ram[fulloffset]);
 1347      machine().gfx[1]->mark_dirty(fulloffset/0x40);
 1348  }
 1349  
 1350  /* FLASH ROM ACCESS */
 1351  
 1352  READ32_MEMBER(cps3_state::cps3_gfxflash_r)
 1353  {
 1354      UINT32 result = 0;
 1355      if (m_cram_gfxflash_bank&1) offset += 0x200000/4;
 1356  
 1357      fujitsu_29f016a_device *chip0 = m_simm[2 + m_cram_gfxflash_bank/8][(m_cram_gfxflash_bank % 8) & ~1];
 1358      fujitsu_29f016a_device *chip1 = m_simm[2 + m_cram_gfxflash_bank/8][(m_cram_gfxflash_bank % 8) |  1];
 1359      if (chip0 == NULL || chip1 == NULL)
 1360          return 0xffffffff;
 1361  
 1362      if(DEBUG_PRINTF) printf("gfxflash_r\n");
 1363  
 1364      if (ACCESSING_BITS_24_31)   // GFX Flash 1
 1365      {
 1366          logerror("read GFX flash chip %s addr %02x\n", chip0->tag(), (offset<<1));
 1367          result |= chip0->read( (offset<<1) ) << 24;
 1368      }
 1369      if (ACCESSING_BITS_16_23)   // GFX Flash 2
 1370      {
 1371          logerror("read GFX flash chip %s addr %02x\n", chip1->tag(), (offset<<1));
 1372          result |= chip1->read( (offset<<1) ) << 16;
 1373      }
 1374      if (ACCESSING_BITS_8_15)    // GFX Flash 1
 1375      {
 1376          logerror("read GFX flash chip %s addr %02x\n", chip0->tag(), (offset<<1)+1);
 1377          result |= chip0->read( (offset<<1)+0x1 ) << 8;
 1378      }
 1379      if (ACCESSING_BITS_0_7) // GFX Flash 2
 1380      {
 1381          logerror("read GFX flash chip %s addr %02x\n", chip1->tag(), (offset<<1)+1);
 1382          result |= chip1->read( (offset<<1)+0x1 ) << 0;
 1383      }
 1384  
 1385      //printf("read GFX flash chips addr %02x returning %08x mem_mask %08x crambank %08x gfxbank %08x\n", offset*2, result,mem_mask,  m_cram_bank, m_cram_gfxflash_bank  );
 1386  
 1387      return result;
 1388  }
 1389  
 1390  WRITE32_MEMBER(cps3_state::cps3_gfxflash_w)
 1391  {
 1392      int command;
 1393      if (m_cram_gfxflash_bank&1) offset += 0x200000/4;
 1394  
 1395      fujitsu_29f016a_device *chip0 = m_simm[2 + m_cram_gfxflash_bank/8][(m_cram_gfxflash_bank % 8) & ~1];
 1396      fujitsu_29f016a_device *chip1 = m_simm[2 + m_cram_gfxflash_bank/8][(m_cram_gfxflash_bank % 8) |  1];
 1397      if (chip0 == NULL || chip1 == NULL)
 1398          return;
 1399  
 1400  //  if(DEBUG_PRINTF) printf("cps3_gfxflash_w %08x %08x %08x\n", offset *2, data, mem_mask);
 1401  
 1402  
 1403      if (ACCESSING_BITS_24_31)   // GFX Flash 1
 1404      {
 1405          command = (data >> 24) & 0xff;
 1406          logerror("write to GFX flash chip %s addr %02x cmd %02x\n", chip0->tag(), (offset<<1), command);
 1407          chip0->write( (offset<<1), command);
 1408      }
 1409      if (ACCESSING_BITS_16_23)   // GFX Flash 2
 1410      {
 1411          command = (data >> 16) & 0xff;
 1412          logerror("write to GFX flash chip %s addr %02x cmd %02x\n", chip1->tag(), (offset<<1), command);
 1413          chip1->write( (offset<<1), command);
 1414      }
 1415      if (ACCESSING_BITS_8_15)    // GFX Flash 1
 1416      {
 1417          command = (data >> 8) & 0xff;
 1418          logerror("write to GFX flash chip %s addr %02x cmd %02x\n", chip0->tag(), (offset<<1)+1, command);
 1419          chip0->write( (offset<<1)+0x1, command);
 1420      }
 1421      if (ACCESSING_BITS_0_7) // GFX Flash 2
 1422      {
 1423          command = (data >> 0) & 0xff;
 1424          //if ( ((offset<<1)+1) != 0x555) printf("write to GFX flash chip %s addr %02x cmd %02x\n", chip1->tag(), (offset<<1)+1, command);
 1425          chip1->write( (offset<<1)+0x1, command);
 1426      }
 1427  
 1428      /* make a copy in the linear memory region we actually use for drawing etc.  having it stored in interleaved flash roms isnt' very useful */
 1429      {
 1430          UINT32* romdata = (UINT32*)m_user5region;
 1431          int real_offset = 0;
 1432          UINT32 newdata;
 1433  
 1434          real_offset = ((m_cram_gfxflash_bank&0x3e) * 0x200000) + offset*4;
 1435  
 1436          newdata =((chip0->read_raw(((offset*2)&0xfffffffe)+0)<<8) |
 1437                      (chip0->read_raw(((offset*2)&0xfffffffe)+1)<<24) |
 1438                      (chip1->read_raw(((offset*2)&0xfffffffe)+0)<<0)  |
 1439                      (chip1->read_raw(((offset*2)&0xfffffffe)+1)<<16));
 1440  
 1441  //      printf("flashcrap %08x %08x %08x\n", offset *2, romdata[real_offset/4], newdata);
 1442          romdata[real_offset/4] = newdata;
 1443      }
 1444  }
 1445  
 1446  
 1447  
 1448  UINT32 cps3_state::cps3_flashmain_r(address_space &space, int which, UINT32 offset, UINT32 mem_mask)
 1449  {
 1450      UINT32 result = 0;
 1451  
 1452      if (m_simm[which][0] == NULL || m_simm[which][1] == NULL || m_simm[which][2] == NULL || m_simm[which][3] == NULL)
 1453          return 0xffffffff;
 1454  
 1455      if (ACCESSING_BITS_24_31)   // Flash 1
 1456      {
 1457  //      logerror("read flash chip %d addr %02x\n", base+0, offset*4 );
 1458          result |= (m_simm[which][0]->read(offset)<<24);
 1459      }
 1460      if (ACCESSING_BITS_16_23)   // Flash 1
 1461      {
 1462  //      logerror("read flash chip %d addr %02x\n", base+1, offset*4 );
 1463          result |= (m_simm[which][1]->read(offset)<<16);
 1464      }
 1465      if (ACCESSING_BITS_8_15)    // Flash 1
 1466      {
 1467  //      logerror("read flash chip %d addr %02x\n", base+2, offset*4 );
 1468          result |= (m_simm[which][2]->read(offset)<<8);
 1469      }
 1470      if (ACCESSING_BITS_0_7) // Flash 1
 1471      {
 1472  //      logerror("read flash chip %d addr %02x\n", base+3, offset*4 );
 1473          result |= (m_simm[which][3]->read(offset)<<0);
 1474      }
 1475  
 1476  //  if (base==4) logerror("read flash chips addr %02x returning %08x\n", offset*4, result );
 1477  
 1478      return result;
 1479  }
 1480  
 1481  
 1482  
 1483  READ32_MEMBER(cps3_state::cps3_flash1_r)
 1484  {
 1485      UINT32 retvalue = cps3_flashmain_r(space, 0, offset,mem_mask);
 1486  
 1487      if (m_altEncryption) return retvalue;
 1488  
 1489      retvalue = retvalue ^ cps3_mask(0x6000000+offset*4, m_key1, m_key2);
 1490      return retvalue;
 1491  }
 1492  
 1493  READ32_MEMBER(cps3_state::cps3_flash2_r)
 1494  {
 1495      UINT32 retvalue = cps3_flashmain_r(space, 1, offset,mem_mask);
 1496  
 1497      if (m_altEncryption) return retvalue;
 1498  
 1499      retvalue = retvalue ^ cps3_mask(0x6800000+offset*4, m_key1, m_key2);
 1500      return retvalue;
 1501  }
 1502  
 1503  void cps3_state::cps3_flashmain_w(int which, UINT32 offset, UINT32 data, UINT32 mem_mask)
 1504  {
 1505      int command;
 1506  
 1507      if (m_simm[which][0] == NULL || m_simm[which][1] == NULL || m_simm[which][2] == NULL || m_simm[which][3] == NULL)
 1508          return;
 1509  
 1510      if (ACCESSING_BITS_24_31)   // Flash 1
 1511      {
 1512          command = (data >> 24) & 0xff;
 1513          logerror("write to flash chip %s addr %02x cmd %02x\n", m_simm[which][0]->tag(), offset, command);
 1514          m_simm[which][0]->write(offset, command);
 1515      }
 1516      if (ACCESSING_BITS_16_23)   // Flash 2
 1517      {
 1518          command = (data >> 16) & 0xff;
 1519          logerror("write to flash chip %s addr %02x cmd %02x\n", m_simm[which][1]->tag(), offset, command);
 1520          m_simm[which][1]->write(offset, command);
 1521      }
 1522      if (ACCESSING_BITS_8_15)    // Flash 2
 1523      {
 1524          command = (data >> 8) & 0xff;
 1525          logerror("write to flash chip %s addr %02x cmd %02x\n", m_simm[which][2]->tag(), offset, command);
 1526          m_simm[which][2]->write(offset, command);
 1527      }
 1528      if (ACCESSING_BITS_0_7) // Flash 2
 1529      {
 1530          command = (data >> 0) & 0xff;
 1531          logerror("write to flash chip %s addr %02x cmd %02x\n", m_simm[which][3]->tag(), offset, command);
 1532          m_simm[which][3]->write(offset, command);
 1533      }
 1534  
 1535      /* copy data into regions to execute from */
 1536      {
 1537          UINT32* romdata =  (UINT32*)m_user4region;
 1538          UINT32* romdata2 = (UINT32*)m_decrypted_gamerom;
 1539          int real_offset = 0;
 1540          UINT32 newdata;
 1541  
 1542          real_offset = offset * 4;
 1543  
 1544          if (which==1)
 1545          {
 1546              romdata+=0x800000/4;
 1547              romdata2+=0x800000/4;
 1548              real_offset += 0x800000;
 1549          }
 1550  
 1551          newdata = (m_simm[which][0]->read_raw(offset)<<24) |
 1552                      (m_simm[which][1]->read_raw(offset)<<16) |
 1553                      (m_simm[which][2]->read_raw(offset)<<8) |
 1554                      (m_simm[which][3]->read_raw(offset)<<0);
 1555  
 1556          //printf("%08x %08x %08x %08x %08x\n",offset, romdata2[offset], romdata[offset], newdata,  newdata^cps3_mask(0x6000000+real_offset, m_key1, m_key2)  );
 1557  
 1558          romdata[offset] = newdata;
 1559          romdata2[offset] = newdata^cps3_mask(0x6000000+real_offset, m_key1, m_key2);
 1560      }
 1561  }
 1562  
 1563  WRITE32_MEMBER(cps3_state::cps3_flash1_w)
 1564  {
 1565      cps3_flashmain_w(0,offset,data,mem_mask);
 1566  }
 1567  
 1568  WRITE32_MEMBER(cps3_state::cps3_flash2_w)
 1569  {
 1570      cps3_flashmain_w(1,offset,data,mem_mask);
 1571  }
 1572  
 1573  WRITE32_MEMBER(cps3_state::cram_gfxflash_bank_w)
 1574  {
 1575      if (ACCESSING_BITS_24_31)
 1576      {
 1577          //printf("cram_gfxflash_bank_w MSB32 %08x\n",data);
 1578  /*
 1579      SIMM 3 (Rom 30/31)
 1580      cram_gfxflash_bank_w MSB32 00020000  // first half of gfx 0 + 1
 1581      cram_gfxflash_bank_w MSB32 00030000  // 2nd half of gfx 0 + 1
 1582      cram_gfxflash_bank_w MSB32 00040000  // first half of gfx 2 + 3
 1583      cram_gfxflash_bank_w MSB32 00050000
 1584      cram_gfxflash_bank_w MSB32 00060000  // first half of gfx 4 + 5
 1585      cram_gfxflash_bank_w MSB32 00070000
 1586      cram_gfxflash_bank_w MSB32 00080000  // first half of gfx 6 + 7
 1587      cram_gfxflash_bank_w MSB32 00090000
 1588      SIMM 4 (Rom 40/41)
 1589      cram_gfxflash_bank_w MSB32 000a0000  // first half of gfx 8 + 9
 1590      cram_gfxflash_bank_w MSB32 000b0000
 1591      cram_gfxflash_bank_w MSB32 000c0000  // first half of gfx 10 + 11
 1592      cram_gfxflash_bank_w MSB32 000d0000
 1593      cram_gfxflash_bank_w MSB32 000e0000  // first half of gfx 12 + 13
 1594      cram_gfxflash_bank_w MSB32 000f0000
 1595      cram_gfxflash_bank_w MSB32 00100000  // first half of gfx 14 + 15
 1596      cram_gfxflash_bank_w MSB32 00110000
 1597      SIMM 5 (Rom 50/51)
 1598      cram_gfxflash_bank_w MSB32 00120000  // first half of gfx 16 + 17
 1599      cram_gfxflash_bank_w MSB32 00130000
 1600      cram_gfxflash_bank_w MSB32 00140000  // first half of gfx 18 + 19
 1601      cram_gfxflash_bank_w MSB32 00150000
 1602      cram_gfxflash_bank_w MSB32 00160000  // first half of gfx 20 + 21
 1603      cram_gfxflash_bank_w MSB32 00170000
 1604      cram_gfxflash_bank_w MSB32 00180000  // first half of gfx 22 + 23
 1605      cram_gfxflash_bank_w MSB32 00190000
 1606      SIMM 6 (Rom 60/61)
 1607      cram_gfxflash_bank_w MSB32 001a0000  // first half of gfx 24 + 25
 1608      cram_gfxflash_bank_w MSB32 001b0000
 1609      cram_gfxflash_bank_w MSB32 001c0000  // first half of gfx 26 + 27
 1610      cram_gfxflash_bank_w MSB32 001d0000
 1611      cram_gfxflash_bank_w MSB32 001e0000  // first half of gfx 28 + 29
 1612      cram_gfxflash_bank_w MSB32 001f0000
 1613      cram_gfxflash_bank_w MSB32 00200000  // first half of gfx 30 + 31
 1614      cram_gfxflash_bank_w MSB32 00210000
 1615      SIMM 7 (Rom 70/71) ** NOT USED (would follow on in sequence tho)
 1616  
 1617      */
 1618          m_cram_gfxflash_bank = (data & 0xffff0000) >> 16;
 1619          m_cram_gfxflash_bank-= 0x0002;// as with sound access etc. first 4 meg is 'special' and skipped
 1620      }
 1621  
 1622      if (ACCESSING_BITS_0_7)
 1623      {
 1624          // writes 0 during boot
 1625          //printf("cram_gfxflash_bank_LSB_w LSB32 %08x\n",data);
 1626      }
 1627  }
 1628  
 1629  // this seems to be dma active flags, and maybe vblank... not if it is anything else
 1630  READ32_MEMBER(cps3_state::cps3_vbl_r)
 1631  {
 1632      return 0x00000000;
 1633  }
 1634  
 1635  READ32_MEMBER(cps3_state::cps3_unk_io_r)
 1636  {
 1637      //  warzard will crash before booting if you return anything here
 1638      return 0xffffffff;
 1639  }
 1640  
 1641  READ32_MEMBER(cps3_state::cps3_40C0000_r)
 1642  {
 1643      return 0x00000000;
 1644  }
 1645  
 1646  READ32_MEMBER(cps3_state::cps3_40C0004_r)
 1647  {
 1648      return 0x00000000;
 1649  }
 1650  
 1651  /* EEPROM access is a little odd, I think it accesses eeprom through some kind of
 1652     additional interface, as these writes aren't normal for the type of eeprom we have */
 1653  
 1654  READ32_MEMBER(cps3_state::cps3_eeprom_r)
 1655  {
 1656      int addr = offset*4;
 1657  
 1658      if (addr>=0x100 && addr<=0x17f)
 1659      {
 1660          if (ACCESSING_BITS_24_31) m_current_eeprom_read = (m_eeprom[offset-0x100/4] & 0xffff0000)>>16;
 1661          else m_current_eeprom_read = (m_eeprom[offset-0x100/4] & 0x0000ffff)>>0;
 1662          // read word to latch...
 1663          return 0x00000000;
 1664      }
 1665      else if (addr == 0x200)
 1666      {
 1667          // busy flag / read data..
 1668          if (ACCESSING_BITS_24_31) return 0;
 1669          else
 1670          {
 1671              //if(DEBUG_PRINTF) printf("reading %04x from eeprom\n", m_current_eeprom_read);
 1672              return m_current_eeprom_read;
 1673          }
 1674      }
 1675      else
 1676      {
 1677      //  if(DEBUG_PRINTF) printf("unk read eeprom addr %04x, mask %08x\n", addr, mem_mask);
 1678          return 0x00000000;
 1679      }
 1680      return 0x00000000;
 1681  }
 1682  
 1683  WRITE32_MEMBER(cps3_state::cps3_eeprom_w)
 1684  {
 1685      int addr = offset*4;
 1686  
 1687      if (addr>=0x080 && addr<=0x0ff)
 1688      {
 1689          offset -= 0x80/4;
 1690          COMBINE_DATA(&m_eeprom[offset]);
 1691          // write word to storage
 1692  
 1693      }
 1694      else if (addr>=0x180 && addr<=0x1ff)
 1695      {
 1696          // always 00000000 ? incrememnt access?
 1697      }
 1698      else
 1699      {
 1700      //  if(DEBUG_PRINTF) printf("unk write eeprom addr %04x, data %08x, mask %08x\n", addr, data, mem_mask);
 1701      }
 1702  
 1703  }
 1704  
 1705  WRITE32_MEMBER(cps3_state::cps3_ss_bank_base_w)
 1706  {
 1707      // might be scroll registers or something else..
 1708      // used to display bank with 'insert coin' on during sfiii2 attract intro
 1709      COMBINE_DATA(&m_ss_bank_base);
 1710  
 1711  //  printf("cps3_ss_bank_base_w %08x %08x\n", data, mem_mask);
 1712  }
 1713  
 1714  WRITE32_MEMBER(cps3_state::cps3_ss_pal_base_w)
 1715  {
 1716          if(DEBUG_PRINTF) printf ("cps3_ss_pal_base_w %08x %08x\n", data, mem_mask);
 1717  
 1718      if(ACCESSING_BITS_24_31)
 1719      {
 1720          m_ss_pal_base = (data & 0x00ff0000)>>16;
 1721  
 1722          if (data & 0xff000000) printf("ss_pal_base MSB32 upper bits used %04x \n", data);
 1723      }
 1724      else
 1725      {
 1726      //  printf("ss_pal_base LSB32 used %04x \n", data);
 1727      }
 1728  }
 1729  
 1730  //<ElSemi> +0 X  +2 Y +4 unknown +6 enable (&0x8000) +8 low part tilemap base, high part linescroll base
 1731  //<ElSemi> (a word each)
 1732  
 1733  
 1734  WRITE32_MEMBER(cps3_state::cps3_palettedma_w)
 1735  {
 1736      if (offset==0)
 1737      {
 1738          COMBINE_DATA(&m_paldma_source);
 1739          m_paldma_realsource = (m_paldma_source<<1)-0x400000;
 1740      }
 1741      else if (offset==1)
 1742      {
 1743          COMBINE_DATA(&m_paldma_dest);
 1744      }
 1745      else if (offset==2)
 1746      {
 1747          COMBINE_DATA(&m_paldma_fade);
 1748      }
 1749      else if (offset==3)
 1750      {
 1751          COMBINE_DATA(&m_paldma_other2);
 1752  
 1753          if (ACCESSING_BITS_24_31)
 1754          {
 1755              m_paldma_length = (data & 0xffff0000)>>16;
 1756          }
 1757          if (ACCESSING_BITS_0_7)
 1758          {
 1759              if (data & 0x0002)
 1760              {
 1761                  int i;
 1762                  UINT16* src = (UINT16*)m_user5region;
 1763              //  if(DEBUG_PRINTF) printf("CPS3 pal dma start %08x (real: %08x) dest %08x fade %08x other2 %08x (length %04x)\n", m_paldma_source, m_paldma_realsource, m_paldma_dest, m_paldma_fade, m_paldma_other2, m_paldma_length);
 1764  
 1765                  for (i=0;i<m_paldma_length;i++)
 1766                  {
 1767                      UINT16 coldata = src[BYTE_XOR_BE(((m_paldma_realsource>>1)+i))];
 1768  
 1769                      //if (m_paldma_fade!=0) printf("%08x\n",m_paldma_fade);
 1770  
 1771                      cps3_set_mame_colours((m_paldma_dest+i)^1, coldata, m_paldma_fade);
 1772                  }
 1773  
 1774  
 1775                  machine().device("maincpu")->execute().set_input_line(10, ASSERT_LINE);
 1776  
 1777  
 1778              }
 1779          }
 1780      }
 1781  
 1782  }
 1783  
 1784  
 1785  //static UINT8* current_table;
 1786  
 1787  
 1788  
 1789  
 1790  UINT32 cps3_state::process_byte( UINT8 real_byte, UINT32 destination, int max_length )
 1791  {
 1792      UINT8* dest       = (UINT8*)m_char_ram;
 1793  
 1794      //printf("process byte for destination %08x\n", destination);
 1795  
 1796      destination&=0x7fffff;
 1797  
 1798      if (real_byte&0x40)
 1799      {
 1800          int tranfercount = 0;
 1801  
 1802          //printf("Set RLE Mode\n");
 1803          m_rle_length = (real_byte&0x3f)+1;
 1804  
 1805          //printf("RLE Operation (length %08x\n", m_rle_length );
 1806  
 1807          while (m_rle_length)
 1808          {
 1809              dest[((destination+tranfercount)&0x7fffff)^3] = (m_last_normal_byte&0x3f);
 1810              machine().gfx[1]->mark_dirty(((destination+tranfercount)&0x7fffff)/0x100);
 1811              //printf("RLE WRite Byte %08x, %02x\n", destination+tranfercount, real_byte);
 1812  
 1813              tranfercount++;
 1814              m_rle_length--;
 1815              max_length--;
 1816  
 1817              if ((destination+tranfercount) > 0x7fffff)  return max_length;
 1818  
 1819  
 1820      //      if (max_length==0) return max_length; // this is meant to abort the transfer if we exceed dest length,, not working
 1821          }
 1822          return tranfercount;
 1823      }
 1824      else
 1825      {
 1826          //printf("Write Normal Data\n");
 1827          dest[(destination&0x7fffff)^3] = real_byte;
 1828          m_last_normal_byte = real_byte;
 1829          machine().gfx[1]->mark_dirty((destination&0x7fffff)/0x100);
 1830          return 1;
 1831      }
 1832  }
 1833  
 1834  void cps3_state::cps3_do_char_dma( UINT32 real_source, UINT32 real_destination, UINT32 real_length )
 1835  {
 1836      UINT8* sourcedata = (UINT8*)m_user5region;
 1837      int length_remaining;
 1838  
 1839      m_last_normal_byte = 0;
 1840      m_rle_length = 0;
 1841      length_remaining = real_length;
 1842      while (length_remaining)
 1843      {
 1844          UINT8 current_byte;
 1845  
 1846          current_byte = sourcedata[DMA_XOR(real_source)];
 1847          real_source++;
 1848  
 1849          if (current_byte & 0x80)
 1850          {
 1851              UINT8 real_byte;
 1852              UINT32 length_processed;
 1853              current_byte &= 0x7f;
 1854  
 1855              real_byte = sourcedata[DMA_XOR((m_current_table_address+current_byte*2+0))];
 1856              //if (real_byte&0x80) return;
 1857              length_processed = process_byte(real_byte, real_destination, length_remaining );
 1858              length_remaining-=length_processed; // subtract the number of bytes the operation has taken
 1859              real_destination+=length_processed; // add it onto the destination
 1860              if (real_destination>0x7fffff) return;
 1861              if (length_remaining<=0) return; // if we've expired, exit
 1862  
 1863              real_byte = sourcedata[DMA_XOR((m_current_table_address+current_byte*2+1))];
 1864              //if (real_byte&0x80) return;
 1865              length_processed = process_byte(real_byte, real_destination, length_remaining );
 1866              length_remaining-=length_processed; // subtract the number of bytes the operation has taken
 1867              real_destination+=length_processed; // add it onto the destination
 1868              if (real_destination>0x7fffff) return;
 1869              if (length_remaining<=0) return;  // if we've expired, exit
 1870          }
 1871          else
 1872          {
 1873              UINT32 length_processed;
 1874              length_processed = process_byte(current_byte, real_destination, length_remaining );
 1875              length_remaining-=length_processed; // subtract the number of bytes the operation has taken
 1876              real_destination+=length_processed; // add it onto the destination
 1877              if (real_destination>0x7fffff) return;
 1878              if (length_remaining<=0) return;  // if we've expired, exit
 1879          }
 1880  
 1881  //      length_remaining--;
 1882      }
 1883  }
 1884  
 1885  UINT32 cps3_state::ProcessByte8(UINT8 b,UINT32 dst_offset)
 1886  {
 1887      UINT8* destRAM = (UINT8*)m_char_ram;
 1888      int l=0;
 1889  
 1890      if(m_lastb==m_lastb2) //rle
 1891      {
 1892          int i;
 1893          int rle=(b+1)&0xff;
 1894  
 1895          for(i=0;i<rle;++i)
 1896          {
 1897              destRAM[(dst_offset&0x7fffff)^3] = m_lastb;
 1898              machine().gfx[1]->mark_dirty((dst_offset&0x7fffff)/0x100);
 1899  
 1900              dst_offset++;
 1901              ++l;
 1902          }
 1903          m_lastb2=0xffff;
 1904  
 1905          return l;
 1906      }
 1907      else
 1908      {
 1909          m_lastb2=m_lastb;
 1910          m_lastb=b;
 1911          destRAM[(dst_offset&0x7fffff)^3] = b;
 1912          machine().gfx[1]->mark_dirty((dst_offset&0x7fffff)/0x100);
 1913          return 1;
 1914      }
 1915  }
 1916  
 1917  void cps3_state::cps3_do_alt_char_dma( UINT32 src, UINT32 real_dest, UINT32 real_length )
 1918  {
 1919      UINT8* px = (UINT8*)m_user5region;
 1920      UINT32 start = real_dest;
 1921      UINT32 ds = real_dest;
 1922  
 1923      m_lastb=0xfffe;
 1924      m_lastb2=0xffff;
 1925  
 1926      while(1)
 1927      {
 1928          int i;
 1929          UINT8 ctrl=px[DMA_XOR(src)];
 1930          ++src;
 1931  
 1932          for(i=0;i<8;++i)
 1933          {
 1934              UINT8 p=px[DMA_XOR(src)];
 1935  
 1936              if(ctrl&0x80)
 1937              {
 1938                  UINT8 real_byte;
 1939                  p&=0x7f;
 1940                  real_byte = px[DMA_XOR((m_current_table_address+p*2+0))];
 1941                  ds+=ProcessByte8(real_byte,ds);
 1942                  real_byte = px[DMA_XOR((m_current_table_address+p*2+1))];
 1943                  ds+=ProcessByte8(real_byte,ds);
 1944              }
 1945              else
 1946              {
 1947                  ds+=ProcessByte8(p,ds);
 1948              }
 1949              ++src;
 1950              ctrl<<=1;
 1951  
 1952              if((ds-start)>=real_length)
 1953                  return;
 1954          }
 1955      }
 1956  }
 1957  
 1958  void cps3_state::cps3_process_character_dma(UINT32 address)
 1959  {
 1960      int i;
 1961  
 1962      //printf("charDMA start:\n");
 1963  
 1964      for (i = 0; i < 0x1000; i += 3)
 1965      {
 1966          UINT32 dat1 = LITTLE_ENDIANIZE_INT32(m_char_ram[i + 0 + (address)]);
 1967          UINT32 dat2 = LITTLE_ENDIANIZE_INT32(m_char_ram[i + 1 + (address)]);
 1968          UINT32 dat3 = LITTLE_ENDIANIZE_INT32(m_char_ram[i + 2 + (address)]);
 1969          UINT32 real_source      = (dat3 << 1) - 0x400000;
 1970          UINT32 real_destination =  dat2 << 3;
 1971          UINT32 real_length      = (((dat1 & 0x001fffff) + 1) << 3);
 1972  
 1973          /* 0x01000000 is the end of list marker, 0x13131313 is our default fill */
 1974          if ((dat1 == 0x01000000) || (dat1 == 0x13131313)) break;
 1975  
 1976          //printf("%08x %08x %08x real_source %08x (rom %d offset %08x) real_destination %08x, real_length %08x\n", dat1, dat2, dat3, real_source, real_source/0x800000, real_source%0x800000, real_destination, real_length);
 1977  
 1978          if  ((dat1 & 0x00e00000) == 0x00800000)
 1979          {
 1980              /* Sets a table used by the decompression routines */
 1981              {
 1982                  /* We should probably copy this, but a pointer to it is fine for our purposes as the data doesn't change */
 1983                  m_current_table_address = real_source;
 1984              }
 1985              machine().device("maincpu")->execute().set_input_line(10, ASSERT_LINE);
 1986          }
 1987          else if  ((dat1 & 0x00e00000) == 0x00400000)
 1988          {
 1989              /* 6bpp DMA decompression
 1990                - this is used for the majority of sprites and backgrounds */
 1991              cps3_do_char_dma(real_source, real_destination, real_length );
 1992              machine().device("maincpu")->execute().set_input_line(10, ASSERT_LINE);
 1993  
 1994          }
 1995          else if  ((dat1 & 0x00e00000) == 0x00600000)
 1996          {
 1997              /* 8bpp DMA decompression
 1998                - this is used on SFIII NG Sean's Stage ONLY */
 1999              cps3_do_alt_char_dma(real_source, real_destination, real_length);
 2000              machine().device("maincpu")->execute().set_input_line(10, ASSERT_LINE);
 2001          }
 2002          else
 2003          {
 2004              // warzard uses command 0, uncompressed? but for what?
 2005              //printf("Unknown DMA List Command Type\n");
 2006          }
 2007  
 2008      }
 2009  }
 2010  
 2011  WRITE32_MEMBER(cps3_state::cps3_characterdma_w)
 2012  {
 2013      if(DEBUG_PRINTF) printf("chardma_w %08x %08x %08x\n", offset, data, mem_mask);
 2014  
 2015      if (offset==0)
 2016      {
 2017          //COMBINE_DATA(&m_chardma_source);
 2018          if (ACCESSING_BITS_0_7)
 2019          {
 2020              m_chardma_source = data & 0x0000ffff;
 2021          }
 2022          if (ACCESSING_BITS_24_31)
 2023          {
 2024              if(DEBUG_PRINTF) printf("chardma_w accessing MSB32 of offset 0");
 2025          }
 2026      }
 2027      else if (offset==1)
 2028      {
 2029          COMBINE_DATA(&m_chardma_other);
 2030  
 2031          if (ACCESSING_BITS_24_31)
 2032          {
 2033              if ((data>>16) & 0x0040)
 2034              {
 2035                  UINT32 list_address;
 2036                  list_address = (m_chardma_source | ((m_chardma_other&0x003f0000)));
 2037  
 2038                  //printf("chardma_w activated %08x %08x (address = cram %08x)\n", m_chardma_source, m_chardma_other, list_address*4 );
 2039                  cps3_process_character_dma(list_address);
 2040              }
 2041              else
 2042              {
 2043                  if(DEBUG_PRINTF) printf("chardma_w NOT activated %08x %08x\n", m_chardma_source, m_chardma_other );
 2044              }
 2045  
 2046              if ((data>>16) & 0xff80)
 2047                  if(DEBUG_PRINTF) printf("chardma_w unknown bits in activate command %08x %08x\n", m_chardma_source, m_chardma_other );
 2048          }
 2049          else
 2050          {
 2051              if(DEBUG_PRINTF) printf("chardma_w LSB32 write to activate command %08x %08x\n", m_chardma_source, m_chardma_other );
 2052          }
 2053      }
 2054  }
 2055  
 2056  WRITE32_MEMBER(cps3_state::cps3_irq10_ack_w)
 2057  {
 2058      machine().device("maincpu")->execute().set_input_line(10, CLEAR_LINE); return;
 2059  }
 2060  
 2061  WRITE32_MEMBER(cps3_state::cps3_irq12_ack_w)
 2062  {
 2063      machine().device("maincpu")->execute().set_input_line(12, CLEAR_LINE); return;
 2064  }
 2065  
 2066  WRITE32_MEMBER(cps3_state::cps3_unk_vidregs_w)
 2067  {
 2068      COMBINE_DATA(&m_unk_vidregs[offset]);
 2069  }
 2070  
 2071  READ32_MEMBER(cps3_state::cps3_colourram_r)
 2072  {
 2073      UINT16* src = (UINT16*)m_colourram.target();
 2074  
 2075      return src[offset*2+1] | (src[offset*2+0]<<16);
 2076  }
 2077  
 2078  WRITE32_MEMBER(cps3_state::cps3_colourram_w)
 2079  {
 2080  //  COMBINE_DATA(&m_colourram[offset]);
 2081  
 2082      if (ACCESSING_BITS_24_31)
 2083      {
 2084          cps3_set_mame_colours(offset*2, (data & 0xffff0000) >> 16, 0);
 2085      }
 2086  
 2087      if (ACCESSING_BITS_0_7)
 2088      {
 2089          cps3_set_mame_colours(offset*2+1, (data & 0x0000ffff) >> 0, 0);
 2090      }
 2091  }
 2092  
 2093  
 2094  /* there are more unknown writes, but you get the idea */
 2095  static ADDRESS_MAP_START( cps3_map, AS_PROGRAM, 32, cps3_state )
 2096      AM_RANGE(0x00000000, 0x0007ffff) AM_ROM AM_REGION("user1", 0) // Bios ROM
 2097      AM_RANGE(0x02000000, 0x0207ffff) AM_RAM AM_SHARE("mainram") // Main RAM
 2098  
 2099      AM_RANGE(0x03000000, 0x030003ff) AM_RAM // 'FRAM' (SFIII memory test mode ONLY)
 2100  
 2101  //  AM_RANGE(0x04000000, 0x0407dfff) AM_RAM AM_SHARE("spriteram")//AM_WRITEONLY // Sprite RAM (jojoba tests this size)
 2102      AM_RANGE(0x04000000, 0x0407ffff) AM_RAM AM_SHARE("spriteram")//AM_WRITEONLY // Sprite RAM
 2103  
 2104      AM_RANGE(0x04080000, 0x040bffff) AM_READWRITE(cps3_colourram_r, cps3_colourram_w) AM_SHARE("colourram")  // Colour RAM (jojoba tests this size) 0x20000 colours?!
 2105  
 2106      // video registers of some kind probably
 2107      AM_RANGE(0x040C0000, 0x040C0003) AM_READ(cps3_40C0000_r)//?? every frame
 2108      AM_RANGE(0x040C0004, 0x040C0007) AM_READ(cps3_40C0004_r)//AM_READ(cps3_40C0004_r) // warzard reads this!
 2109  //  AM_RANGE(0x040C0008, 0x040C000b) AM_WRITENOP//??
 2110      AM_RANGE(0x040C000c, 0x040C000f) AM_READ(cps3_vbl_r)// AM_WRITENOP/
 2111  
 2112      AM_RANGE(0x040C0000, 0x040C001f) AM_WRITE(cps3_unk_vidregs_w)
 2113      AM_RANGE(0x040C0020, 0x040C002b) AM_WRITEONLY AM_SHARE("tmap20_regs")
 2114      AM_RANGE(0x040C0030, 0x040C003b) AM_WRITEONLY AM_SHARE("tmap30_regs")
 2115      AM_RANGE(0x040C0040, 0x040C004b) AM_WRITEONLY AM_SHARE("tmap40_regs")
 2116      AM_RANGE(0x040C0050, 0x040C005b) AM_WRITEONLY AM_SHARE("tmap50_regs")
 2117  
 2118      AM_RANGE(0x040C0060, 0x040C007f) AM_RAM AM_SHARE("fullscreenzoom")
 2119  
 2120  
 2121      AM_RANGE(0x040C0094, 0x040C009b) AM_WRITE(cps3_characterdma_w)
 2122  
 2123  
 2124      AM_RANGE(0x040C00a0, 0x040C00af) AM_WRITE(cps3_palettedma_w)
 2125  
 2126  
 2127      AM_RANGE(0x040C0084, 0x040C0087) AM_WRITE(cram_bank_w)
 2128      AM_RANGE(0x040C0088, 0x040C008b) AM_WRITE(cram_gfxflash_bank_w)
 2129  
 2130      AM_RANGE(0x040e0000, 0x040e02ff) AM_DEVREADWRITE_LEGACY("cps3", cps3_sound_r, cps3_sound_w)
 2131  
 2132      AM_RANGE(0x04100000, 0x041fffff) AM_READWRITE(cram_data_r, cram_data_w)
 2133      AM_RANGE(0x04200000, 0x043fffff) AM_READWRITE(cps3_gfxflash_r, cps3_gfxflash_w) // GFX Flash ROMS
 2134  
 2135      AM_RANGE(0x05000000, 0x05000003) AM_READ_PORT("INPUTS")
 2136      AM_RANGE(0x05000004, 0x05000007) AM_READ_PORT("EXTRA")
 2137  
 2138      AM_RANGE(0x05000008, 0x0500000b) AM_WRITENOP // ?? every frame
 2139  
 2140      AM_RANGE(0x05000a00, 0x05000a1f) AM_READ(cps3_unk_io_r ) // ?? every frame
 2141  
 2142      AM_RANGE(0x05001000, 0x05001203) AM_READWRITE(cps3_eeprom_r, cps3_eeprom_w )
 2143  
 2144      AM_RANGE(0x05040000, 0x0504ffff) AM_READWRITE(cps3_ssram_r,cps3_ssram_w) // 'SS' RAM (Score Screen) (text tilemap + toles)
 2145      //0x25050020
 2146      AM_RANGE(0x05050020, 0x05050023) AM_WRITE(cps3_ss_bank_base_w )
 2147      AM_RANGE(0x05050024, 0x05050027) AM_WRITE(cps3_ss_pal_base_w )
 2148  
 2149      AM_RANGE(0x05100000, 0x05100003) AM_WRITE(cps3_irq12_ack_w )
 2150      AM_RANGE(0x05110000, 0x05110003) AM_WRITE(cps3_irq10_ack_w )
 2151  
 2152      AM_RANGE(0x05140000, 0x05140003) AM_DEVREADWRITE8("scsi:wd33c93", wd33c93_device, read, write, 0x00ff00ff )
 2153  
 2154      AM_RANGE(0x06000000, 0x067fffff) AM_READWRITE(cps3_flash1_r, cps3_flash1_w ) /* Flash ROMs simm 1 */
 2155      AM_RANGE(0x06800000, 0x06ffffff) AM_READWRITE(cps3_flash2_r, cps3_flash2_w ) /* Flash ROMs simm 2 */
 2156  
 2157      AM_RANGE(0xc0000000, 0xc00003ff) AM_RAM_WRITE(cps3_0xc0000000_ram_w ) AM_SHARE("0xc0000000_ram") /* Executes code from here */
 2158  ADDRESS_MAP_END
 2159  
 2160  static INPUT_PORTS_START( cps3 )
 2161      PORT_START("INPUTS")
 2162      PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
 2163      PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
 2164      PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
 2165      PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
 2166      PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P1 Jab Punch") PORT_PLAYER(1)
 2167      PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P1 Strong Punch") PORT_PLAYER(1)
 2168      PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P1 Fierce Punch") PORT_PLAYER(1)
 2169      PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_UNUSED ) // nothing here?
 2170      PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
 2171      PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
 2172      PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
 2173      PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
 2174      PORT_BIT( 0x00001000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P2 Jab Punch") PORT_PLAYER(2)
 2175      PORT_BIT( 0x00002000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P2 Strong Punch") PORT_PLAYER(2)
 2176      PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P2 Fierce Punch") PORT_PLAYER(2)
 2177      PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_UNUSED ) // nothing here?
 2178      PORT_BIT( 0x00010000, IP_ACTIVE_LOW, IPT_SERVICE1 )
 2179      PORT_SERVICE_NO_TOGGLE( 0x00020000, IP_ACTIVE_LOW )
 2180      PORT_BIT( 0x00fc0000, IP_ACTIVE_LOW, IPT_UNUSED ) // nothing here?
 2181      PORT_BIT( 0x01000000, IP_ACTIVE_LOW, IPT_COIN1 )
 2182      PORT_BIT( 0x02000000, IP_ACTIVE_LOW, IPT_COIN2 )
 2183      PORT_BIT( 0x04000000, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("P2 Roundhouse Kick") PORT_PLAYER(2)
 2184      PORT_BIT( 0x08000000, IP_ACTIVE_LOW, IPT_UNUSED ) // nothing here?
 2185      PORT_BIT( 0x10000000, IP_ACTIVE_LOW, IPT_START1 )
 2186      PORT_BIT( 0x20000000, IP_ACTIVE_LOW, IPT_START2 )
 2187      PORT_BIT( 0xc0000000, IP_ACTIVE_LOW, IPT_UNUSED ) // nothing here?
 2188  
 2189      PORT_START("EXTRA")
 2190      PORT_BIT( 0x0001ffff, IP_ACTIVE_LOW, IPT_UNUSED ) // nothing here?
 2191      PORT_BIT( 0x00020000, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("P1 Roundhouse Kick") PORT_PLAYER(1)
 2192      PORT_BIT( 0x00040000, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("P1 Forward Kick") PORT_PLAYER(1)
 2193      PORT_BIT( 0x00080000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("P1 Short Kick") PORT_PLAYER(1)
 2194      PORT_BIT( 0x00100000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("P2 Short Kick") PORT_PLAYER(2)
 2195      PORT_BIT( 0x00200000, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("P2 Forward Kick") PORT_PLAYER(2)
 2196      PORT_BIT( 0xffc00000, IP_ACTIVE_LOW, IPT_UNUSED ) // nothing here?
 2197  INPUT_PORTS_END
 2198  
 2199  /* Red Earth game inputs */
 2200  static INPUT_PORTS_START ( cps3_re )
 2201      PORT_INCLUDE ( cps3 )
 2202  
 2203      PORT_MODIFY("INPUTS")
 2204      PORT_BIT( 0x10000000, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("P1 Start / Change Orb")
 2205      PORT_BIT( 0x20000000, IP_ACTIVE_LOW, IPT_START2 ) PORT_NAME("P2 Start / Change Orb")
 2206  INPUT_PORTS_END
 2207  
 2208  /* Jojo game inputs */
 2209  static INPUT_PORTS_START( cps3_jojo)
 2210      PORT_INCLUDE( cps3 )
 2211  
 2212      PORT_MODIFY("INPUTS")
 2213      PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P1 Light") PORT_PLAYER(1)
 2214      PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P1 Medium") PORT_PLAYER(1)
 2215      PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P1 Strong") PORT_PLAYER(1)
 2216      PORT_BIT( 0x00001000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P2 Light") PORT_PLAYER(2)
 2217      PORT_BIT( 0x00002000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P2 Medium") PORT_PLAYER(2)
 2218      PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P2 Strong") PORT_PLAYER(2)
 2219      PORT_BIT( 0x04000000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_PLAYER(2)
 2220  
 2221      PORT_MODIFY("EXTRA")
 2222      PORT_BIT( 0x00020000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_PLAYER(1)
 2223      PORT_BIT( 0x00040000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_PLAYER(1)
 2224      PORT_BIT( 0x00080000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("P1 Stand") PORT_PLAYER(1)
 2225      PORT_BIT( 0x00100000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("P2 Stand") PORT_PLAYER(2)
 2226      PORT_BIT( 0x00200000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_PLAYER(2)
 2227  INPUT_PORTS_END
 2228  
 2229  INTERRUPT_GEN_MEMBER(cps3_state::cps3_vbl_interrupt)
 2230  {
 2231      device.execute().set_input_line(12, ASSERT_LINE);
 2232  }
 2233  
 2234  INTERRUPT_GEN_MEMBER(cps3_state::cps3_other_interrupt)
 2235  {
 2236      // this seems to need to be periodic (see the life bar portraits in sfiii2
 2237      // but also triggered on certain dma events (or warzard locks up in attract)
 2238      // what is the REAL source of IRQ10??
 2239      device.execute().set_input_line(10, ASSERT_LINE);
 2240  }
 2241  
 2242  
 2243  //static sh2_cpu_core sh2cp_conf_slave  = { 1, NULL };
 2244  
 2245  
 2246  static const struct WD33C93interface wd33c93_intf =
 2247  {
 2248      NULL            /* command completion IRQ */
 2249  };
 2250  
 2251  void cps3_state::machine_reset()
 2252  {
 2253      m_current_table_address = -1;
 2254  
 2255      // copy data from flashroms back into user regions + decrypt into regions we execute/draw from.
 2256      copy_from_nvram();
 2257  }
 2258  
 2259  
 2260  
 2261  // make a copy in the regions we execute code / draw gfx from
 2262  void cps3_state::copy_from_nvram()
 2263  {
 2264      UINT32* romdata = (UINT32*)m_user4region;
 2265      UINT32* romdata2 = (UINT32*)m_decrypted_gamerom;
 2266      int i;
 2267      /* copy + decrypt program roms which have been loaded from flashroms/nvram */
 2268      for (i=0;i<0x800000;i+=4)
 2269      {
 2270          UINT32 data;
 2271  
 2272          data = ((m_simm[0][0]->read_raw(i/4)<<24) | (m_simm[0][1]->read_raw(i/4)<<16) | (m_simm[0][2]->read_raw(i/4)<<8) | (m_simm[0][3]->read_raw(i/4)<<0));
 2273  
 2274      //  printf("%08x %08x %08x %08x\n",romdata[i/4],data, romdata2[i/4], data ^ cps3_mask(i+0x6000000, m_key1, m_key2));
 2275          romdata[i/4] = data;
 2276          romdata2[i/4] = data ^ cps3_mask(i+0x6000000, m_key1, m_key2);
 2277  
 2278      }
 2279  
 2280      romdata  += 0x800000/4;
 2281      romdata2 += 0x800000/4;
 2282  
 2283      if (m_simm[1][0] != NULL)
 2284          for (i=0;i<0x800000;i+=4)
 2285          {
 2286              UINT32 data;
 2287  
 2288              data = ((m_simm[1][0]->read_raw(i/4)<<24) | (m_simm[1][1]->read_raw(i/4)<<16) | (m_simm[1][2]->read_raw(i/4)<<8) | (m_simm[1][3]->read_raw(i/4)<<0));
 2289  
 2290          //  printf("%08x %08x %08x %08x\n",romdata[i/4],data, romdata2[i/4],  data ^ cps3_mask(i+0x6800000, m_key1, m_key2) );
 2291              romdata[i/4] = data;
 2292              romdata2[i/4] = data ^ cps3_mask(i+0x6800000, m_key1, m_key2);
 2293          }
 2294  
 2295      /* copy gfx from loaded flashroms to user reigon 5, where it's used */
 2296      {
 2297          UINT32 thebase, len = USER5REGION_LENGTH;
 2298          int flashnum = 0;
 2299          int countoffset = 0;
 2300  
 2301          romdata = (UINT32*)m_user5region;
 2302          for (thebase = 0;thebase < len/2; thebase+=0x200000)
 2303          {
 2304          //  printf("flashnums %d. %d\n",flashnum, flashnum+1);
 2305  
 2306              fujitsu_29f016a_device *flash0 = m_simm[2 + flashnum/8][flashnum % 8 + 0];
 2307              fujitsu_29f016a_device *flash1 = m_simm[2 + flashnum/8][flashnum % 8 + 1];
 2308              if (flash0 == NULL || flash1 == NULL)
 2309                  continue;
 2310              if (flash0 != NULL && flash1 != NULL)
 2311              {
 2312                  for (i=0;i<0x200000;i+=2)
 2313                  {
 2314                      UINT32 dat = (flash0->read_raw(i+0)<<8) |
 2315                                      (flash0->read_raw(i+1)<<24) |
 2316                                      (flash1->read_raw(i+0)<<0) |
 2317                                      (flash1->read_raw(i+1)<<16);
 2318  
 2319                      //printf("%08x %08x\n",romdata[countoffset],dat);
 2320                      romdata[countoffset] = dat;
 2321  
 2322                      countoffset++;
 2323                  }
 2324              }
 2325              flashnum+=2;
 2326          }
 2327      }
 2328  
 2329  
 2330      /*
 2331      {
 2332          FILE *fp;
 2333          const char *gamename = machine().system().name;
 2334          char filename[256];
 2335          sprintf(filename, "%s_bios.dump", gamename);
 2336  
 2337          fp=fopen(filename, "w+b");
 2338          if (fp)
 2339          {
 2340              fwrite(rom, 0x080000, 1, fp);
 2341              fclose(fp);
 2342          }
 2343      }
 2344      */
 2345  
 2346  }
 2347  
 2348  
 2349  static int cps3_dma_callback(device_t *device, UINT32 src, UINT32 dst, UINT32 data, int size)
 2350  {
 2351      cps3_state *state = device->machine().driver_data<cps3_state>();
 2352      /*
 2353        on the actual CPS3 hardware the SH2 DMA bypasses the encryption.
 2354  
 2355        to handle this in MAME we use this callback, and reverse the effect of the
 2356        encryption that would otherwise be applied.  this allows us to avoid per-game,
 2357        per-PC hacks.  this approach is however still a little messy.
 2358  
 2359      */
 2360  
 2361      /* I doubt this is endian safe.. needs checking / fixing */
 2362      if (size==0)
 2363      {
 2364          if ((src&3)==0) data <<=24;
 2365          if ((src&3)==1) data <<=16;
 2366          if ((src&3)==2) data <<=8;
 2367          if ((src&3)==3) data <<=0;
 2368      }
 2369  
 2370  
 2371      if (src<0x80000)
 2372      {
 2373          int offs = (src&0x07ffff)>>2;
 2374          data = data ^ state->cps3_mask(offs*4, state->m_key1, state->m_key2);
 2375      }
 2376      else if (src>=0x6000000 && src<0x6800000)
 2377      {
 2378          int offs = (src&0x07fffff)>>2;
 2379          if (!state->m_altEncryption) data = data ^ state->cps3_mask(0x6000000+offs*4, state->m_key1, state->m_key2);
 2380      }
 2381      else if (src>=0x6800000 && src<0x7000000)
 2382      {
 2383          int offs = (src&0x07fffff)>>2;
 2384          if (!state->m_altEncryption) data = data ^ state->cps3_mask(0x6800000+offs*4, state->m_key1, state->m_key2);
 2385      }
 2386      else
 2387      {
 2388          //printf("%s :src %08x, dst %08x, returning %08x\n", machine.describe_context(), src, dst, data);
 2389      }
 2390  
 2391      /* I doubt this is endian safe.. needs checking / fixing */
 2392      if (size==0)
 2393      {
 2394          if ((src&3)==0) data >>=24;
 2395          if ((src&3)==1) data >>=16;
 2396          if ((src&3)==2) data >>=8;
 2397          if ((src&3)==3) data >>=0;
 2398  
 2399          data &=0x000000ff;
 2400      }
 2401  
 2402      return data;
 2403  }
 2404  
 2405  
 2406  
 2407  static const sh2_cpu_core sh2_conf_cps3 = {
 2408      0, // master
 2409      cps3_dma_callback
 2410  };
 2411  
 2412  static MACHINE_CONFIG_FRAGMENT( simm1_64mbit )
 2413      MCFG_FUJITSU_29F016A_ADD("simm1.0")
 2414      MCFG_FUJITSU_29F016A_ADD("simm1.1")
 2415      MCFG_FUJITSU_29F016A_ADD("simm1.2")
 2416      MCFG_FUJITSU_29F016A_ADD("simm1.3")
 2417  MACHINE_CONFIG_END
 2418  
 2419  static MACHINE_CONFIG_FRAGMENT( simm2_64mbit )
 2420      MCFG_FUJITSU_29F016A_ADD("simm2.0")
 2421      MCFG_FUJITSU_29F016A_ADD("simm2.1")
 2422      MCFG_FUJITSU_29F016A_ADD("simm2.2")
 2423      MCFG_FUJITSU_29F016A_ADD("simm2.3")
 2424  MACHINE_CONFIG_END
 2425  
 2426  static MACHINE_CONFIG_FRAGMENT( simm3_128mbit )
 2427      MCFG_FUJITSU_29F016A_ADD("simm3.0")
 2428      MCFG_FUJITSU_29F016A_ADD("simm3.1")
 2429      MCFG_FUJITSU_29F016A_ADD("simm3.2")
 2430      MCFG_FUJITSU_29F016A_ADD("simm3.3")
 2431      MCFG_FUJITSU_29F016A_ADD("simm3.4")
 2432      MCFG_FUJITSU_29F016A_ADD("simm3.5")
 2433      MCFG_FUJITSU_29F016A_ADD("simm3.6")
 2434      MCFG_FUJITSU_29F016A_ADD("simm3.7")
 2435  MACHINE_CONFIG_END
 2436  
 2437  static MACHINE_CONFIG_FRAGMENT( simm4_128mbit )
 2438      MCFG_FUJITSU_29F016A_ADD("simm4.0")
 2439      MCFG_FUJITSU_29F016A_ADD("simm4.1")
 2440      MCFG_FUJITSU_29F016A_ADD("simm4.2")
 2441      MCFG_FUJITSU_29F016A_ADD("simm4.3")
 2442      MCFG_FUJITSU_29F016A_ADD("simm4.4")
 2443      MCFG_FUJITSU_29F016A_ADD("simm4.5")
 2444      MCFG_FUJITSU_29F016A_ADD("simm4.6")
 2445      MCFG_FUJITSU_29F016A_ADD("simm4.7")
 2446  MACHINE_CONFIG_END
 2447  
 2448  static MACHINE_CONFIG_FRAGMENT( simm5_128mbit )
 2449      MCFG_FUJITSU_29F016A_ADD("simm5.0")
 2450      MCFG_FUJITSU_29F016A_ADD("simm5.1")
 2451      MCFG_FUJITSU_29F016A_ADD("simm5.2")
 2452      MCFG_FUJITSU_29F016A_ADD("simm5.3")
 2453      MCFG_FUJITSU_29F016A_ADD("simm5.4")
 2454      MCFG_FUJITSU_29F016A_ADD("simm5.5")
 2455      MCFG_FUJITSU_29F016A_ADD("simm5.6")
 2456      MCFG_FUJITSU_29F016A_ADD("simm5.7")
 2457  MACHINE_CONFIG_END
 2458  
 2459  static MACHINE_CONFIG_FRAGMENT( simm5_32mbit )
 2460      MCFG_FUJITSU_29F016A_ADD("simm5.0")
 2461      MCFG_FUJITSU_29F016A_ADD("simm5.1")
 2462  MACHINE_CONFIG_END
 2463  
 2464  static MACHINE_CONFIG_FRAGMENT( simm6_128mbit )
 2465      MCFG_FUJITSU_29F016A_ADD("simm6.0")
 2466      MCFG_FUJITSU_29F016A_ADD("simm6.1")
 2467      MCFG_FUJITSU_29F016A_ADD("simm6.2")
 2468      MCFG_FUJITSU_29F016A_ADD("simm6.3")
 2469      MCFG_FUJITSU_29F016A_ADD("simm6.4")
 2470      MCFG_FUJITSU_29F016A_ADD("simm6.5")
 2471      MCFG_FUJITSU_29F016A_ADD("simm6.6")
 2472      MCFG_FUJITSU_29F016A_ADD("simm6.7")
 2473  MACHINE_CONFIG_END
 2474  
 2475  static MACHINE_CONFIG_START( cps3, cps3_state )
 2476      /* basic machine hardware */
 2477      MCFG_CPU_ADD("maincpu", SH2, 6250000*4) // external clock is 6.25 Mhz, it sets the intenral multiplier to 4x (this should probably be handled in the core..)
 2478      MCFG_CPU_PROGRAM_MAP(cps3_map)
 2479      MCFG_CPU_VBLANK_INT_DRIVER("screen", cps3_state,  cps3_vbl_interrupt)
 2480      MCFG_CPU_PERIODIC_INT_DRIVER(cps3_state, cps3_other_interrupt, 80) /* ?source? */
 2481      MCFG_CPU_CONFIG(sh2_conf_cps3)
 2482  
 2483      MCFG_SCSIBUS_ADD("scsi")
 2484      MCFG_SCSIDEV_ADD("scsi:cdrom", SCSICD, SCSI_ID_1)
 2485      MCFG_WD33C93_ADD("scsi:wd33c93", wd33c93_intf)
 2486  
 2487      /* video hardware */
 2488      MCFG_SCREEN_ADD("screen", RASTER)
 2489      MCFG_SCREEN_RAW_PARAMS(XTAL_60MHz/8, 486, 0, 384, 259, 0, 224)
 2490      MCFG_SCREEN_UPDATE_DRIVER(cps3_state, screen_update_cps3)
 2491  /*
 2492      Measured clocks:
 2493          V = 59.5992Hz
 2494          H = 15.4335kHz
 2495          H/V = 258.955 ~ 259 lines
 2496  
 2497      Possible video clocks:
 2498          60MHz       / 15.4335kHz = 3887.647 / 8 = 485.956 ~ 486 -> likely
 2499           42.9545MHz / 15.4445kHz = 2781.217 / 6 = 463.536 -> unlikely
 2500  */
 2501  
 2502      MCFG_NVRAM_ADD_0FILL("eeprom")
 2503      MCFG_PALETTE_LENGTH(0x10000) // actually 0x20000 ...
 2504  
 2505  
 2506      /* sound hardware */
 2507      MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
 2508  
 2509      MCFG_SOUND_ADD("cps3", CPS3, MASTER_CLOCK / 3)
 2510      MCFG_SOUND_ROUTE(1, "lspeaker", 1.0)
 2511      MCFG_SOUND_ROUTE(0, "rspeaker", 1.0)
 2512  MACHINE_CONFIG_END
 2513  
 2514  
 2515  /* individual configs for each machine, depending on the SIMMs installed */
 2516  MACHINE_CONFIG_DERIVED( redearth, cps3 )
 2517      MCFG_FRAGMENT_ADD(simm1_64mbit)
 2518      MCFG_FRAGMENT_ADD(simm3_128mbit)
 2519      MCFG_FRAGMENT_ADD(simm4_128mbit)
 2520      MCFG_FRAGMENT_ADD(simm5_32mbit)
 2521  MACHINE_CONFIG_END
 2522  
 2523  MACHINE_CONFIG_DERIVED( sfiii, cps3 )
 2524      MCFG_FRAGMENT_ADD(simm1_64mbit)
 2525      MCFG_FRAGMENT_ADD(simm3_128mbit)
 2526      MCFG_FRAGMENT_ADD(simm4_128mbit)
 2527      MCFG_FRAGMENT_ADD(simm5_32mbit)
 2528  MACHINE_CONFIG_END
 2529  
 2530  MACHINE_CONFIG_DERIVED( sfiii2, cps3 )
 2531      MCFG_FRAGMENT_ADD(simm1_64mbit)
 2532      MCFG_FRAGMENT_ADD(simm2_64mbit)
 2533      MCFG_FRAGMENT_ADD(simm3_128mbit)
 2534      MCFG_FRAGMENT_ADD(simm4_128mbit)
 2535      MCFG_FRAGMENT_ADD(simm5_128mbit)
 2536  MACHINE_CONFIG_END
 2537  
 2538  MACHINE_CONFIG_DERIVED( jojo, cps3 )
 2539      MCFG_FRAGMENT_ADD(simm1_64mbit)
 2540      MCFG_FRAGMENT_ADD(simm2_64mbit)
 2541      MCFG_FRAGMENT_ADD(simm3_128mbit)
 2542      MCFG_FRAGMENT_ADD(simm4_128mbit)
 2543      MCFG_FRAGMENT_ADD(simm5_32mbit)
 2544  MACHINE_CONFIG_END
 2545  
 2546  MACHINE_CONFIG_DERIVED( sfiii3, cps3 )
 2547      MCFG_FRAGMENT_ADD(simm1_64mbit)
 2548      MCFG_FRAGMENT_ADD(simm2_64mbit)
 2549      MCFG_FRAGMENT_ADD(simm3_128mbit)
 2550      MCFG_FRAGMENT_ADD(simm4_128mbit)
 2551      MCFG_FRAGMENT_ADD(simm5_128mbit)
 2552      MCFG_FRAGMENT_ADD(simm6_128mbit)
 2553  MACHINE_CONFIG_END
 2554  
 2555  MACHINE_CONFIG_DERIVED( jojoba, cps3 )
 2556      MCFG_FRAGMENT_ADD(simm1_64mbit)
 2557      MCFG_FRAGMENT_ADD(simm2_64mbit)
 2558      MCFG_FRAGMENT_ADD(simm3_128mbit)
 2559      MCFG_FRAGMENT_ADD(simm4_128mbit)
 2560      MCFG_FRAGMENT_ADD(simm5_128mbit)
 2561  MACHINE_CONFIG_END
 2562  
 2563  
 2564  /* CD sets - use CD BIOS roms */
 2565  
 2566  ROM_START( redearth )
 2567      ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
 2568      ROM_LOAD( "redearth_euro.29f400.u2", 0x000000, 0x080000, CRC(02e0f336) SHA1(acc37e830dfeb9674f5a0fb24f4cc23217ae4ff5) )
 2569  
 2570      DISK_REGION( "scsi:cdrom" )
 2571      DISK_IMAGE_READONLY( "cap-wzd-5", 0, BAD_DUMP SHA1(e5676752b08283dc4a98c3d7b759e8aa6dcd0679) )
 2572  ROM_END
 2573  
 2574  ROM_START( redearthr1 )
 2575      ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
 2576      ROM_LOAD( "redearth_euro.29f400.u2", 0x000000, 0x080000, CRC(02e0f336) SHA1(acc37e830dfeb9674f5a0fb24f4cc23217ae4ff5) )
 2577  
 2578      DISK_REGION( "scsi:cdrom" )
 2579      DISK_IMAGE_READONLY( "cap-wzd-3", 0, SHA1(a6ff67093db6bc80ee5fc46e4300e0177b213a52) )
 2580  ROM_END
 2581  
 2582  ROM_START( warzard )
 2583      ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
 2584      ROM_LOAD( "warzard_japan.29f400.u2", 0x000000, 0x080000, CRC(f8e2f0c6) SHA1(93d6a986f44c211fff014e55681eca4d2a2774d6) )
 2585  
 2586      DISK_REGION( "scsi:cdrom" )
 2587      DISK_IMAGE_READONLY( "cap-wzd-5", 0, BAD_DUMP SHA1(e5676752b08283dc4a98c3d7b759e8aa6dcd0679) )
 2588  ROM_END
 2589  
 2590  ROM_START( warzardr1 )
 2591      ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
 2592      ROM_LOAD( "warzard_japan.29f400.u2", 0x000000, 0x080000, CRC(f8e2f0c6) SHA1(93d6a986f44c211fff014e55681eca4d2a2774d6) )
 2593  
 2594      DISK_REGION( "scsi:cdrom" )
 2595      DISK_IMAGE_READONLY( "cap-wzd-3", 0, SHA1(a6ff67093db6bc80ee5fc46e4300e0177b213a52) )
 2596  ROM_END
 2597  
 2598  
 2599  ROM_START( sfiii )
 2600      ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
 2601      ROM_LOAD( "sfiii_usa.29f400.u2", 0x000000, 0x080000, CRC(fb172a8e) SHA1(48ebf59910f246835f7dc0c588da30f7a908072f) )
 2602  
 2603      DISK_REGION( "scsi:cdrom" )
 2604      DISK_IMAGE_READONLY( "cap-sf3-3", 0, BAD_DUMP SHA1(606e62cc5f46275e366e7dbb412dbaeb7e54cd0c) )
 2605  ROM_END
 2606  
 2607  ROM_START( sfiiij )
 2608      ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
 2609      ROM_LOAD( "sfiii_japan.29f400.u2", 0x000000, 0x080000, CRC(74205250) SHA1(c3e83ace7121d32da729162662ec6b5285a31211) )
 2610  
 2611      DISK_REGION( "scsi:cdrom" )
 2612      DISK_IMAGE_READONLY( "cap-sf3-3", 0, BAD_DUMP SHA1(606e62cc5f46275e366e7dbb412dbaeb7e54cd0c) )
 2613  ROM_END
 2614  
 2615  ROM_START( sfiiih )
 2616      ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
 2617      ROM_LOAD( "sfiii_hispanic.29f400.u2", 0x000000, 0x080000, CRC(d2b3cd48) SHA1(00ebb270c24a66515c97e35331de54ff5358000e) )
 2618  
 2619      DISK_REGION( "scsi:cdrom" )
 2620      DISK_IMAGE_READONLY( "cap-sf3-3", 0, BAD_DUMP SHA1(606e62cc5f46275e366e7dbb412dbaeb7e54cd0c) )
 2621  ROM_END
 2622  
 2623  
 2624  ROM_START( sfiii2 )
 2625      ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
 2626      ROM_LOAD( "sfiii2_usa.29f400.u2", 0x000000, 0x080000, CRC(75dd72e0) SHA1(5a12d6ea6734df5de00ecee6f9ef470749d2f242) )
 2627  
 2628      DISK_REGION( "scsi:cdrom" )
 2629      DISK_IMAGE_READONLY( "cap-3ga000", 0, BAD_DUMP SHA1(4e162885b0b3265a56e0265037bcf247e820f027) )
 2630  ROM_END
 2631  
 2632  ROM_START( sfiii2j )
 2633      ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
 2634      ROM_LOAD( "sfiii2_japan.29f400.u2", 0x000000, 0x080000, CRC(faea0a3e) SHA1(a03cd63bcf52e4d57f7a598c8bc8e243694624ec) )
 2635  
 2636      DISK_REGION( "scsi:cdrom" )
 2637      DISK_IMAGE_READONLY( "cap-3ga000", 0, BAD_DUMP SHA1(4e162885b0b3265a56e0265037bcf247e820f027) )
 2638  ROM_END
 2639  
 2640  
 2641  ROM_START( jojo )
 2642      ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
 2643      ROM_LOAD( "jojo_usa.29f400.u2", 0x000000, 0x080000, CRC(8d40f7be) SHA1(2a4bd83db2f959c33b071e517941aa55a0f919c0) )
 2644  
 2645      DISK_REGION( "scsi:cdrom" )
 2646      DISK_IMAGE_READONLY( "cap-jjk-3", 0, SHA1(dc6e74b5e02e13f62cb8c4e234dd6061501e49c1) )
 2647  ROM_END
 2648  
 2649  ROM_START( jojor1 )
 2650      ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
 2651      ROM_LOAD( "jojo_usa.29f400.u2", 0x000000, 0x080000, CRC(8d40f7be) SHA1(2a4bd83db2f959c33b071e517941aa55a0f919c0) )
 2652  
 2653      DISK_REGION( "scsi:cdrom" )
 2654      DISK_IMAGE_READONLY( "cap-jjk-2", 0, BAD_DUMP SHA1(0f5c09171409213e191a607ee89ca3a91fe9c96a) )
 2655  ROM_END
 2656  
 2657  ROM_START( jojor2 )
 2658      ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
 2659      ROM_LOAD( "jojo_usa.29f400.u2", 0x000000, 0x080000, CRC(8d40f7be) SHA1(2a4bd83db2f959c33b071e517941aa55a0f919c0) )
 2660  
 2661      DISK_REGION( "scsi:cdrom" )
 2662      DISK_IMAGE_READONLY( "cap-jjk000", 0, BAD_DUMP SHA1(09869f6d8c032b527e02d815749dc8fab1289e86) )
 2663  ROM_END
 2664  
 2665  ROM_START( jojoj )
 2666      ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
 2667      ROM_LOAD( "jojo_japan.29f400.u2", 0x000000, 0x080000, CRC(02778f60) SHA1(a167f9ebe030592a0cdb0c6a3c75835c6a43be4c) )
 2668  
 2669      DISK_REGION( "scsi:cdrom" )
 2670      DISK_IMAGE_READONLY( "cap-jjk-3", 0, SHA1(dc6e74b5e02e13f62cb8c4e234dd6061501e49c1) )
 2671  ROM_END
 2672  
 2673  ROM_START( jojojr1 )
 2674      ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
 2675      ROM_LOAD( "jojo_japan.29f400.u2", 0x000000, 0x080000, CRC(02778f60) SHA1(a167f9ebe030592a0cdb0c6a3c75835c6a43be4c) )
 2676  
 2677      DISK_REGION( "scsi:cdrom" )
 2678      DISK_IMAGE_READONLY( "cap-jjk-2", 0, BAD_DUMP SHA1(0f5c09171409213e191a607ee89ca3a91fe9c96a) )
 2679  ROM_END
 2680  
 2681  ROM_START( jojojr2 )
 2682      ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
 2683      ROM_LOAD( "jojo_japan.29f400.u2", 0x000000, 0x080000, CRC(02778f60) SHA1(a167f9ebe030592a0cdb0c6a3c75835c6a43be4c) )
 2684  
 2685      DISK_REGION( "scsi:cdrom" )
 2686      DISK_IMAGE_READONLY( "cap-jjk000", 0, BAD_DUMP SHA1(09869f6d8c032b527e02d815749dc8fab1289e86) )
 2687  ROM_END
 2688  
 2689  
 2690  ROM_START( sfiii3 )
 2691      ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
 2692      ROM_LOAD( "sfiii3_euro.29f400.u2", 0x000000, 0x080000, CRC(30bbf293) SHA1(f094c2eeaf4f6709060197aca371a4532346bf78) )
 2693  
 2694      DISK_REGION( "scsi:cdrom" )
 2695      DISK_IMAGE_READONLY( "cap-33s-2", 0, BAD_DUMP SHA1(41b0e246db91cbfc3f8f0f62d981734feb4b4ab5) )
 2696  ROM_END
 2697  
 2698  ROM_START( sfiii3r1 )
 2699      ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
 2700      ROM_LOAD( "sfiii3_euro.29f400.u2", 0x000000, 0x080000, CRC(30bbf293) SHA1(f094c2eeaf4f6709060197aca371a4532346bf78) )
 2701  
 2702      DISK_REGION( "scsi:cdrom" )
 2703      DISK_IMAGE_READONLY( "cap-33s-1", 0, BAD_DUMP SHA1(2f4a9006a31903114f9f9dc09465ae253e565c51) )
 2704  ROM_END
 2705  
 2706  ROM_START( sfiii3u )
 2707      ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
 2708      ROM_LOAD( "sfiii3_usa.29f400.u2", 0x000000, 0x080000, CRC(ecc545c1) SHA1(e39083820aae914fd8b80c9765129bedb745ceba) )
 2709  
 2710      DISK_REGION( "scsi:cdrom" )
 2711      DISK_IMAGE_READONLY( "cap-33s-2", 0, BAD_DUMP SHA1(41b0e246db91cbfc3f8f0f62d981734feb4b4ab5) )
 2712  ROM_END
 2713  
 2714  ROM_START( sfiii3ur1 )
 2715      ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
 2716      ROM_LOAD( "sfiii3_usa.29f400.u2", 0x000000, 0x080000, CRC(ecc545c1) SHA1(e39083820aae914fd8b80c9765129bedb745ceba) )
 2717  
 2718      DISK_REGION( "scsi:cdrom" )
 2719      DISK_IMAGE_READONLY( "cap-33s-1", 0, BAD_DUMP SHA1(2f4a9006a31903114f9f9dc09465ae253e565c51) )
 2720  ROM_END
 2721  
 2722  
 2723  ROM_START( jojoba )
 2724      ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
 2725      ROM_LOAD( "jojoba_japan.29f400.u2", 0x000000, 0x080000, CRC(3085478c) SHA1(055eab1fc42816f370a44b17fd7e87ffcb10e8b7) )
 2726  
 2727      DISK_REGION( "scsi:cdrom" )
 2728      DISK_IMAGE_READONLY( "cap-jjm-1", 0, SHA1(8628d3fa555fbd5f4121082e925c1834b76c5e65) )
 2729  ROM_END
 2730  
 2731  ROM_START( jojobar1 )
 2732      ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
 2733      ROM_LOAD( "jojoba_japan.29f400.u2", 0x000000, 0x080000, CRC(3085478c) SHA1(055eab1fc42816f370a44b17fd7e87ffcb10e8b7) )
 2734  
 2735      DISK_REGION( "scsi:cdrom" )
 2736      DISK_IMAGE_READONLY( "cap-jjm-0", 0, BAD_DUMP SHA1(0678a0baeb853dcff1d230c14f0873cc9f143d7b) )
 2737  ROM_END
 2738  
 2739  
 2740  /* NO CD sets - use NO CD BIOS roms - don't require the CD image to boot */
 2741  
 2742  ROM_START( sfiiin )
 2743      ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
 2744      ROM_LOAD( "sfiii_asia_nocd.29f400.u2", 0x000000, 0x080000, CRC(73e32463) SHA1(45d144e533e4b20cc5a744ca4f618e288430c601) )
 2745  
 2746      ROM_REGION( 0x200000, "simm1.0", 0 )
 2747      ROM_LOAD( "sfiii-simm1.0", 0x00000, 0x200000, CRC(cfc9e45a) SHA1(5d9061f76680642e730373e3ac29b24926dc5c0c) )
 2748      ROM_REGION( 0x200000, "simm1.1", 0 )
 2749      ROM_LOAD( "sfiii-simm1.1", 0x00000, 0x200000, CRC(57920546) SHA1(c8452e7e101b8888fb806d1c9874c6be49fc7dbd) )
 2750      ROM_REGION( 0x200000, "simm1.2", 0 )
 2751      ROM_LOAD( "sfiii-simm1.2", 0x00000, 0x200000, CRC(0d8f2680) SHA1(ade7b28acd11023696c4b20136f3d2f34da6b1be) )
 2752      ROM_REGION( 0x200000, "simm1.3", 0 )
 2753      ROM_LOAD( "sfiii-simm1.3", 0x00000, 0x200000, CRC(ea4ca054) SHA1(f91c55c4e4fc428ce15d27be38aeed3a483d028c) )
 2754  
 2755      ROM_REGION( 0x200000, "simm3.0", 0 )
 2756      ROM_LOAD( "sfiii-simm3.0", 0x00000, 0x200000, CRC(080b3bd3) SHA1(f51bc5de95ab22b87ba09ea721285b308afd0bda) )
 2757      ROM_REGION( 0x200000, "simm3.1", 0 )
 2758      ROM_LOAD( "sfiii-simm3.1", 0x00000, 0x200000, CRC(5c356f2f) SHA1(e969ce388f6e565d9612e65b0895560c7bb472e6) )
 2759      ROM_REGION( 0x200000, "simm3.2", 0 )
 2760      ROM_LOAD( "sfiii-simm3.2", 0x00000, 0x200000, CRC(f9c97a45) SHA1(58a9691696c3f26a1150a451567c501f55cf1874) )
 2761      ROM_REGION( 0x200000, "simm3.3", 0 )
 2762      ROM_LOAD( "sfiii-simm3.3", 0x00000, 0x200000, CRC(09de3ead) SHA1(2f41d84a96cb5e0d169200a4e9358ad5f407a2b7) )
 2763      ROM_REGION( 0x200000, "simm3.4", 0 )
 2764      ROM_LOAD( "sfiii-simm3.4", 0x00000, 0x200000, CRC(7dd7e1f3) SHA1(bcf1023287457d97f09d9f6e9c93fdf24cc24a07) )
 2765      ROM_REGION( 0x200000, "simm3.5", 0 )
 2766      ROM_LOAD( "sfiii-simm3.5", 0x00000, 0x200000, CRC(47a03a3a) SHA1(2509e5737059251888e4e1efbcdfac86a89ff1a1) )
 2767      ROM_REGION( 0x200000, "simm3.6", 0 )
 2768      ROM_LOAD( "sfiii-simm3.6", 0x00000, 0x200000, CRC(e9eb7a26) SHA1(b8547edb7085e9149aa59d5226ad2d1976cab2bd) )
 2769      ROM_REGION( 0x200000, "simm3.7", 0 )
 2770      ROM_LOAD( "sfiii-simm3.7", 0x00000, 0x200000, CRC(7f44395c) SHA1(f4d2e283cb3a4aad4eae4e13963a74e20be7c181) )
 2771  
 2772      ROM_REGION( 0x200000, "simm4.0", 0 )
 2773      ROM_LOAD( "sfiii-simm4.0", 0x00000, 0x200000, CRC(9ac080fc) SHA1(2e5024b35b147513ee42eda8748df9d669410377) )
 2774      ROM_REGION( 0x200000, "simm4.1", 0 )
 2775      ROM_LOAD( "sfiii-simm4.1", 0x00000, 0x200000, CRC(6e2c4c94) SHA1(5a185cb76b5999bd826bc9b5ea584a5c3498f69d) )
 2776      ROM_REGION( 0x200000, "simm4.2", 0 )
 2777      ROM_LOAD( "sfiii-simm4.2", 0x00000, 0x200000, CRC(8afc22d4) SHA1(04a419a3092c98fc4a7693e6acf30ae5a849e5c1) )
 2778      ROM_REGION( 0x200000, "simm4.3", 0 )
 2779      ROM_LOAD( "sfiii-simm4.3", 0x00000, 0x200000, CRC(9f3873b8) SHA1(33499d6f02bc84c80acb56be078aaed7f8d1300d) )
 2780      ROM_REGION( 0x200000, "simm4.4", 0 )
 2781      ROM_LOAD( "sfiii-simm4.4", 0x00000, 0x200000, CRC(166b3c97) SHA1(40e6e9d43cbbd8496b430931b8ab7db01dc1c6d5) )
 2782      ROM_REGION( 0x200000, "simm4.5", 0 )
 2783      ROM_LOAD( "sfiii-simm4.5", 0x00000, 0x200000, CRC(e5ea2547) SHA1(a823c689098f37a3054d728bddb0033a4b8396f1) )
 2784      ROM_REGION( 0x200000, "simm4.6", 0 )
 2785      ROM_LOAD( "sfiii-simm4.6", 0x00000, 0x200000, CRC(e85b9fdd) SHA1(264cb10fe9b3ede384c7db42bfc58ed5c21ea8f8) )
 2786      ROM_REGION( 0x200000, "simm4.7", 0 )
 2787      ROM_LOAD( "sfiii-simm4.7", 0x00000, 0x200000, CRC(362c01b7) SHA1(9c404312a6aabe8e91e68dde193e3972bc1636cd) )
 2788  
 2789      ROM_REGION( 0x200000, "simm5.0", 0 )
 2790      ROM_LOAD( "sfiii-simm5.0", 0x00000, 0x200000, CRC(9bc108b2) SHA1(894dadab7957044bf877029c7f8e556d5d6e85d3) )
 2791      ROM_REGION( 0x200000, "simm5.1", 0 )
 2792      ROM_LOAD( "sfiii-simm5.1", 0x00000, 0x200000, CRC(c6f1c066) SHA1(00de492dd1ef7aef05027a8c501c296b6602e917) )
 2793  ROM_END
 2794  
 2795  ROM_START( sfiii2n )
 2796      ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
 2797      ROM_LOAD( "sfiii2_asia_nocd.29f400.u2", 0x000000, 0x080000, CRC(fd297c0d) SHA1(4323deda2789f104b53f32a663196ec16de73215) )
 2798  
 2799      ROM_REGION( 0x200000, "simm1.0", 0 )
 2800      ROM_LOAD( "sfiii2-simm1.0", 0x00000, 0x200000, CRC(2d666f0b) SHA1(68de034b3a3aeaf4b26122a84ad48b0b763e4122) )
 2801      ROM_REGION( 0x200000, "simm1.1", 0 )
 2802      ROM_LOAD( "sfiii2-simm1.1", 0x00000, 0x200000, CRC(2a3a8ef6) SHA1(31fb58fd1360ed8c951e2c4ac898a5a7104528d6) )
 2803      ROM_REGION( 0x200000, "simm1.2", 0 )
 2804      ROM_LOAD( "sfiii2-simm1.2", 0x00000, 0x200000, CRC(161d2206) SHA1(58999f876e64c1a088e8765962a9cd504f22a706) )
 2805      ROM_REGION( 0x200000, "simm1.3", 0 )
 2806      ROM_LOAD( "sfiii2-simm1.3", 0x00000, 0x200000, CRC(87ded8a3) SHA1(4ccef64f80d2ee63940b0958b500364ee515db51) )
 2807  
 2808      ROM_REGION( 0x200000, "simm2.0", 0 )
 2809      ROM_LOAD( "sfiii2-simm2.0", 0x00000, 0x200000, CRC(94a4ce0f) SHA1(2c8e26a66d1dcd17c22c70baa2a3ff5a54511514) )
 2810      ROM_REGION( 0x200000, "simm2.1", 0 )
 2811      ROM_LOAD( "sfiii2-simm2.1", 0x00000, 0x200000, CRC(67585033) SHA1(24df9968a54c330fbe95f8e4dfe6e7dfd144ed0c) )
 2812      ROM_REGION( 0x200000, "simm2.2", 0 )
 2813      ROM_LOAD( "sfiii2-simm2.2", 0x00000, 0x200000, CRC(fabffcd5) SHA1(9399f64c42f63a64e44a21a2690e44779943a2b2) )
 2814      ROM_REGION( 0x200000, "simm2.3", 0 )
 2815      ROM_LOAD( "sfiii2-simm2.3", 0x00000, 0x200000, CRC(623c09ca) SHA1(dc9618a08bb7f44e569ac17605d268511155a14e) )
 2816  
 2817      ROM_REGION( 0x200000, "simm3.0", 0 )
 2818      ROM_LOAD( "sfiii2-simm3.0", 0x00000, 0x200000, CRC(dab2d766) SHA1(d265cc8b1b497eb4bedd63b3f1de60eb1c1db0df) )
 2819      ROM_REGION( 0x200000, "simm3.1", 0 )
 2820      ROM_LOAD( "sfiii2-simm3.1", 0x00000, 0x200000, CRC(1f2aa34b) SHA1(38b224d34c4550f1f33c2c368e2a252d0d176cc0) )
 2821      ROM_REGION( 0x200000, "simm3.2", 0 )
 2822      ROM_LOAD( "sfiii2-simm3.2", 0x00000, 0x200000, CRC(6f1a04eb) SHA1(980ca929114075d1920e2da44f9a22087cc92e55) )
 2823      ROM_REGION( 0x200000, "simm3.3", 0 )
 2824      ROM_LOAD( "sfiii2-simm3.3", 0x00000, 0x200000, CRC(e05ef205) SHA1(e604e3832549740f953581fc91e850beda6a73c8) )
 2825      ROM_REGION( 0x200000, "simm3.4", 0 )
 2826      ROM_LOAD( "sfiii2-simm3.4", 0x00000, 0x200000, CRC(affb074f) SHA1(0e76973807039bc66fd0f3233401cea8d2c45f84) )
 2827      ROM_REGION( 0x200000, "simm3.5", 0 )
 2828      ROM_LOAD( "sfiii2-simm3.5", 0x00000, 0x200000, CRC(6962872e) SHA1(f16b2d0792697345145d0e9d950e912a2ffabe0d) )
 2829      ROM_REGION( 0x200000, "simm3.6", 0 )
 2830      ROM_LOAD( "sfiii2-simm3.6", 0x00000, 0x200000, CRC(6eed87de) SHA1(5d5067ad36234c5efd57a2baebeffa2f44f2caec) )
 2831      ROM_REGION( 0x200000, "simm3.7", 0 )
 2832      ROM_LOAD( "sfiii2-simm3.7", 0x00000, 0x200000, CRC(e18f479e) SHA1(cd4c1812ab422336bfa414e0b2098b472d2f9251) )
 2833  
 2834      ROM_REGION( 0x200000, "simm4.0", 0 )
 2835      ROM_LOAD( "sfiii2-simm4.0", 0x00000, 0x200000, CRC(764c2503) SHA1(cad3f20ade2e1d3ac52f8c318443da20062ae943) )
 2836      ROM_REGION( 0x200000, "simm4.1", 0 )
 2837      ROM_LOAD( "sfiii2-simm4.1", 0x00000, 0x200000, CRC(3e16af6e) SHA1(afde2ed4bf3a3e95035fc02c572c5b83178a9467) )
 2838      ROM_REGION( 0x200000, "simm4.2", 0 )
 2839      ROM_LOAD( "sfiii2-simm4.2", 0x00000, 0x200000, CRC(215705e6) SHA1(42d3849f8a9242a89ba465dbc205f310186c67cd) )
 2840      ROM_REGION( 0x200000, "simm4.3", 0 )
 2841      ROM_LOAD( "sfiii2-simm4.3", 0x00000, 0x200000, CRC(e30cbd9c) SHA1(c205101ada86154921e09fed4f6908d15ec60761) )
 2842      ROM_REGION( 0x200000, "simm4.4", 0 )
 2843      ROM_LOAD( "sfiii2-simm4.4", 0x00000, 0x200000, CRC(4185ded9) SHA1(24bf9b5f25d7753f1feb09b82611f7482f30d304) )
 2844      ROM_REGION( 0x200000, "simm4.5", 0 )
 2845      ROM_LOAD( "sfiii2-simm4.5", 0x00000, 0x200000, CRC(4e8db013) SHA1(6816df2b6c60005fb375530ea93bb30a960c9b01) )
 2846      ROM_REGION( 0x200000, "simm4.6", 0 )
 2847      ROM_LOAD( "sfiii2-simm4.6", 0x00000, 0x200000, CRC(08df48ce) SHA1(e8a3b68ebeab193539446c3f6e0a19b37f1f3495) )
 2848      ROM_REGION( 0x200000, "simm4.7", 0 )
 2849      ROM_LOAD( "sfiii2-simm4.7", 0x00000, 0x200000, CRC(bb8f80a5) SHA1(35d9e86637d54405c97fdb7da9c42cc53907cae3) )
 2850  
 2851      ROM_REGION( 0x200000, "simm5.0", 0 )
 2852      ROM_LOAD( "sfiii2-simm5.0", 0x00000, 0x200000, CRC(ebdc4787) SHA1(f86e8ebf4b2214be166dbe4ea921058a552364ea) )
 2853      ROM_REGION( 0x200000, "simm5.1", 0 )
 2854      ROM_LOAD( "sfiii2-simm5.1", 0x00000, 0x200000, CRC(6b7c550e) SHA1(77cdabccf3ecebf142ac86dffe6e24052941e3a1) )
 2855      ROM_REGION( 0x200000, "simm5.2", 0 )
 2856      ROM_LOAD( "sfiii2-simm5.2", 0x00000, 0x200000, CRC(56ff8c50) SHA1(16f7602a4549a5b724e3fcdb75b0f3c397077b81) )
 2857      ROM_REGION( 0x200000, "simm5.3", 0 )
 2858      ROM_LOAD( "sfiii2-simm5.3", 0x00000, 0x200000, CRC(3f2ac3e9) SHA1(a7b631f18ce572a42f46314f37a01d9840abc765) )
 2859      ROM_REGION( 0x200000, "simm5.4", 0 )
 2860      ROM_LOAD( "sfiii2-simm5.4", 0x00000, 0x200000, CRC(48cda50e) SHA1(35e9f27fb8b69e3b3a313ea33dc53b1102e5f66e) )
 2861      ROM_REGION( 0x200000, "simm5.5", 0 )
 2862      ROM_LOAD( "sfiii2-simm5.5", 0x00000, 0x200000, CRC(520c0af6) SHA1(7bed1b6707974eafbfb62ccb84a51df8a100e070) )
 2863      ROM_REGION( 0x200000, "simm5.6", 0 )
 2864      ROM_LOAD( "sfiii2-simm5.6", 0x00000, 0x200000, CRC(2edc5986) SHA1(761ab2c67d0d873ffd74158eb77f7722c076f3e3) )
 2865      ROM_REGION( 0x200000, "simm5.7", 0 )
 2866      ROM_LOAD( "sfiii2-simm5.7", 0x00000, 0x200000, CRC(93ffa199) SHA1(33ec2379f30c6fdf47ba72c1d0cad8bdd02f17df) )
 2867  ROM_END
 2868  
 2869  ROM_START( jojon )
 2870      ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
 2871      ROM_LOAD( "jojo_asia_nocd.29f400.u2", 0x000000, 0x080000, CRC(05b4f953) SHA1(c746c7bb5359acc9adced817cb4870b1912eaefd) )
 2872  
 2873      ROM_REGION( 0x200000, "simm1.0", 0 )
 2874      ROM_LOAD( "jojo(__990128)-simm1.0", 0x00000, 0x200000, CRC(9516948b) SHA1(4d7e6c1eb7d1bebff2a5069bcd186070a9105474) )
 2875      ROM_REGION( 0x200000, "simm1.1", 0 )
 2876      ROM_LOAD( "jojo(__990128)-simm1.1", 0x00000, 0x200000, CRC(a847848d) SHA1(4df70309395f1d2a2e8f85bc34e17453d4a76f81) )
 2877      ROM_REGION( 0x200000, "simm1.2", 0 )
 2878      ROM_LOAD( "jojo(__990128)-simm1.2", 0x00000, 0x200000, CRC(853e8846) SHA1(d120b7e2de9502e3261e8dd101f97589b2ed1c38) )
 2879      ROM_REGION( 0x200000, "simm1.3", 0 )
 2880      ROM_LOAD( "jojo(__990128)-simm1.3", 0x00000, 0x200000, CRC(c04fe00e) SHA1(d09409b77460d19b56aaaf4a64356f3d37a1ee41) )
 2881  
 2882      ROM_REGION( 0x200000, "simm2.0", 0 )
 2883      ROM_LOAD( "jojo(__990128)-simm2.0", 0x00000, 0x200000, CRC(e1a4b3c8) SHA1(5dc298431644e1ca470aaab752a7d74f2f9dc7a1) )
 2884      ROM_REGION( 0x200000, "simm2.1", 0 )
 2885      ROM_LOAD( "jojo(__990128)-simm2.1", 0x00000, 0x200000, CRC(189cef95) SHA1(ebe42a019358461557f69fb17d65d84d0f733415) )
 2886      ROM_REGION( 0x200000, "simm2.2", 0 )
 2887      ROM_LOAD( "jojo(__990128)-simm2.2", 0x00000, 0x200000, CRC(47db5ec6) SHA1(e80271e4013e4391c2cc4229ff1fbd4a2b7c6f04) )
 2888      ROM_REGION( 0x200000, "simm2.3", 0 )
 2889      ROM_LOAD( "jojo(__990128)-simm2.3", 0x00000, 0x200000, CRC(e3d3a155) SHA1(75e9b5da93dd8894cf70fa4dac56f3958be4c766) )
 2890  
 2891      ROM_REGION( 0x200000, "simm3.0", 0 )
 2892      ROM_LOAD( "jojo-simm3.0", 0x00000, 0x200000, CRC(de7fc9c1) SHA1(662b85a990b04c855773506c936317e62fab4a05) )
 2893      ROM_REGION( 0x200000, "simm3.1", 0 )
 2894      ROM_LOAD( "jojo-simm3.1", 0x00000, 0x200000, CRC(43d053d3) SHA1(54ff0e9c164e0d1649522c330ccc7e5d79e0bc85) )
 2895      ROM_REGION( 0x200000, "simm3.2", 0 )
 2896      ROM_LOAD( "jojo-simm3.2", 0x00000, 0x200000, CRC(2ffd7fa5) SHA1(9018c8e2b286a333ba606208e90caa764951ea3f) )
 2897      ROM_REGION( 0x200000, "simm3.3", 0 )
 2898      ROM_LOAD( "jojo-simm3.3", 0x00000, 0x200000, CRC(4da4985b) SHA1(2552b1730a21ce17d58b69a79ad212a6a5829439) )
 2899      ROM_REGION( 0x200000, "simm3.4", 0 )
 2900      ROM_LOAD( "jojo-simm3.4", 0x00000, 0x200000, CRC(fde98d72) SHA1(654563e12d033e8656dc74a268a08b15b171470d) )
 2901      ROM_REGION( 0x200000, "simm3.5", 0 )
 2902      ROM_LOAD( "jojo-simm3.5", 0x00000, 0x200000, CRC(edb2a266) SHA1(19ebada8422c7f4bf70d0c9ad42b84268967b316) )
 2903      ROM_REGION( 0x200000, "simm3.6", 0 )
 2904      ROM_LOAD( "jojo-simm3.6", 0x00000, 0x200000, CRC(be7cf319) SHA1(7893f5907992e6b903b2683980bba6d3d003bb06) )
 2905      ROM_REGION( 0x200000, "simm3.7", 0 )
 2906      ROM_LOAD( "jojo-simm3.7", 0x00000, 0x200000, CRC(56fe1a9f) SHA1(01741fe1256f4e682f687e94040f4e8bbb8bedb2) )
 2907  
 2908      ROM_REGION( 0x200000, "simm4.0", 0 )
 2909      ROM_LOAD( "jojo-simm4.0", 0x00000, 0x200000, CRC(c4e7bf68) SHA1(a4d1ddea58a3d42db82a63a5e974cbf38d9b792a) )
 2910      ROM_REGION( 0x200000, "simm4.1", 0 )
 2911      ROM_LOAD( "jojo-simm4.1", 0x00000, 0x200000, CRC(b62b2719) SHA1(cb577b89e9e14fda67715716fefd47a782d518ab) )
 2912      ROM_REGION( 0x200000, "simm4.2", 0 )
 2913      ROM_LOAD( "jojo-simm4.2", 0x00000, 0x200000, CRC(18d15809) SHA1(2b406cd1aaa4799a436213dcaa65473eacb4c6d7) )
 2914      ROM_REGION( 0x200000, "simm4.3", 0 )
 2915      ROM_LOAD( "jojo-simm4.3", 0x00000, 0x200000, CRC(9af0ad79) SHA1(075ee048e17b50188876f25d7a6571d6ace84d7d) )
 2916      ROM_REGION( 0x200000, "simm4.4", 0 )
 2917      ROM_LOAD( "jojo-simm4.4", 0x00000, 0x200000, CRC(4124c1f0) SHA1(e4946a8029adc5d0bacead8d766521b4ccd1722b) )
 2918      ROM_REGION( 0x200000, "simm4.5", 0 )
 2919      ROM_LOAD( "jojo-simm4.5", 0x00000, 0x200000, CRC(5e001fd1) SHA1(6457a39f336381b46e587aa2f5f719810ee5bcf9) )
 2920      ROM_REGION( 0x200000, "simm4.6", 0 )
 2921      ROM_LOAD( "jojo-simm4.6", 0x00000, 0x200000, CRC(9affa23b) SHA1(e3d77e777c47277d841a9dadc1dd6e3157706a2e) )
 2922      ROM_REGION( 0x200000, "simm4.7", 0 )
 2923      ROM_LOAD( "jojo-simm4.7", 0x00000, 0x200000, CRC(2511572a) SHA1(725adcf71bcee5c8bb839d2d1c5e3456b8c6886b) )
 2924  
 2925      ROM_REGION( 0x200000, "simm5.0", 0 )
 2926      ROM_LOAD( "jojo-simm5.0", 0x00000, 0x200000, CRC(797615fc) SHA1(29874be9f1da5515c90f5d601aa5924c263f8feb) )
 2927      ROM_REGION( 0x200000, "simm5.1", 0 )
 2928      ROM_LOAD( "jojo-simm5.1", 0x00000, 0x200000, CRC(734fd162) SHA1(16cdfac74d18a6c2216afb1ce6afbd7f15297c32) )
 2929  ROM_END
 2930  
 2931  ROM_START( jojonr1 )
 2932      ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
 2933      ROM_LOAD( "jojo_asia_nocd.29f400.u2", 0x000000, 0x080000, CRC(05b4f953) SHA1(c746c7bb5359acc9adced817cb4870b1912eaefd) )
 2934  
 2935      ROM_REGION( 0x200000, "simm1.0", 0 )
 2936      ROM_LOAD( "jojo(__990108)-simm1.0", 0x00000, 0x200000, CRC(cfbc38d6) SHA1(c33e3a51fe8ab54e0912a1d6e662fe1ade73cee7) )
 2937      ROM_REGION( 0x200000, "simm1.1", 0 )
 2938      ROM_LOAD( "jojo(__990108)-simm1.1", 0x00000, 0x200000, CRC(42578d94) SHA1(fa46f92ac1a6716430adec9ab27214a11fa61749) )
 2939      ROM_REGION( 0x200000, "simm1.2", 0 )
 2940      ROM_LOAD( "jojo(__990108)-simm1.2", 0x00000, 0x200000, CRC(1b40c566) SHA1(9833799e9b4fecf7f9ce14bca64936646b3fdbde) )
 2941      ROM_REGION( 0x200000, "simm1.3", 0 )
 2942      ROM_LOAD( "jojo(__990108)-simm1.3", 0x00000, 0x200000, CRC(bba709b4) SHA1(0dd71e575f2193505f2ab960568ac1eccf40d53f) )
 2943  
 2944      ROM_REGION( 0x200000, "simm2.0", 0 )
 2945      ROM_LOAD( "jojo(__990108)-simm2.0", 0x00000, 0x200000, CRC(417e5dc1) SHA1(54ee9596c1c51811f3bdef7dbe77b44b34f230ca) )
 2946      ROM_REGION( 0x200000, "simm2.1", 0 )
 2947      ROM_LOAD( "jojo(__990108)-simm2.1", 0x00000, 0x200000, CRC(d3b3267d) SHA1(eb2cff347880f1489fb5b1b8bd16df8f50c7f494) )
 2948      ROM_REGION( 0x200000, "simm2.2", 0 )
 2949      ROM_LOAD( "jojo(__990108)-simm2.2", 0x00000, 0x200000, CRC(c66d96b1) SHA1(909d5aac165748b549b6056a6091c41df012f5df) )
 2950      ROM_REGION( 0x200000, "simm2.3", 0 )
 2951      ROM_LOAD( "jojo(__990108)-simm2.3", 0x00000, 0x200000, CRC(aa34cc85) SHA1(7677cc6fa913755fc699691b350698bbe8904118) )
 2952  
 2953      ROM_REGION( 0x200000, "simm3.0", 0 )
 2954      ROM_LOAD( "jojo-simm3.0", 0x00000, 0x200000, CRC(de7fc9c1) SHA1(662b85a990b04c855773506c936317e62fab4a05) )
 2955      ROM_REGION( 0x200000, "simm3.1", 0 )
 2956      ROM_LOAD( "jojo-simm3.1", 0x00000, 0x200000, CRC(43d053d3) SHA1(54ff0e9c164e0d1649522c330ccc7e5d79e0bc85) )
 2957      ROM_REGION( 0x200000, "simm3.2", 0 )
 2958      ROM_LOAD( "jojo-simm3.2", 0x00000, 0x200000, CRC(2ffd7fa5) SHA1(9018c8e2b286a333ba606208e90caa764951ea3f) )
 2959      ROM_REGION( 0x200000, "simm3.3", 0 )
 2960      ROM_LOAD( "jojo-simm3.3", 0x00000, 0x200000, CRC(4da4985b) SHA1(2552b1730a21ce17d58b69a79ad212a6a5829439) )
 2961      ROM_REGION( 0x200000, "simm3.4", 0 )
 2962      ROM_LOAD( "jojo-simm3.4", 0x00000, 0x200000, CRC(fde98d72) SHA1(654563e12d033e8656dc74a268a08b15b171470d) )
 2963      ROM_REGION( 0x200000, "simm3.5", 0 )
 2964      ROM_LOAD( "jojo-simm3.5", 0x00000, 0x200000, CRC(edb2a266) SHA1(19ebada8422c7f4bf70d0c9ad42b84268967b316) )
 2965      ROM_REGION( 0x200000, "simm3.6", 0 )
 2966      ROM_LOAD( "jojo-simm3.6", 0x00000, 0x200000, CRC(be7cf319) SHA1(7893f5907992e6b903b2683980bba6d3d003bb06) )
 2967      ROM_REGION( 0x200000, "simm3.7", 0 )
 2968      ROM_LOAD( "jojo-simm3.7", 0x00000, 0x200000, CRC(56fe1a9f) SHA1(01741fe1256f4e682f687e94040f4e8bbb8bedb2) )
 2969  
 2970      ROM_REGION( 0x200000, "simm4.0", 0 )
 2971      ROM_LOAD( "jojo-simm4.0", 0x00000, 0x200000, CRC(c4e7bf68) SHA1(a4d1ddea58a3d42db82a63a5e974cbf38d9b792a) )
 2972      ROM_REGION( 0x200000, "simm4.1", 0 )
 2973      ROM_LOAD( "jojo-simm4.1", 0x00000, 0x200000, CRC(b62b2719) SHA1(cb577b89e9e14fda67715716fefd47a782d518ab) )
 2974      ROM_REGION( 0x200000, "simm4.2", 0 )
 2975      ROM_LOAD( "jojo-simm4.2", 0x00000, 0x200000, CRC(18d15809) SHA1(2b406cd1aaa4799a436213dcaa65473eacb4c6d7) )
 2976      ROM_REGION( 0x200000, "simm4.3", 0 )
 2977      ROM_LOAD( "jojo-simm4.3", 0x00000, 0x200000, CRC(9af0ad79) SHA1(075ee048e17b50188876f25d7a6571d6ace84d7d) )
 2978      ROM_REGION( 0x200000, "simm4.4", 0 )
 2979      ROM_LOAD( "jojo-simm4.4", 0x00000, 0x200000, CRC(4124c1f0) SHA1(e4946a8029adc5d0bacead8d766521b4ccd1722b) )
 2980      ROM_REGION( 0x200000, "simm4.5", 0 )
 2981      ROM_LOAD( "jojo-simm4.5", 0x00000, 0x200000, CRC(5e001fd1) SHA1(6457a39f336381b46e587aa2f5f719810ee5bcf9) )
 2982      ROM_REGION( 0x200000, "simm4.6", 0 )
 2983      ROM_LOAD( "jojo-simm4.6", 0x00000, 0x200000, CRC(9affa23b) SHA1(e3d77e777c47277d841a9dadc1dd6e3157706a2e) )
 2984      ROM_REGION( 0x200000, "simm4.7", 0 )
 2985      ROM_LOAD( "jojo-simm4.7", 0x00000, 0x200000, CRC(2511572a) SHA1(725adcf71bcee5c8bb839d2d1c5e3456b8c6886b) )
 2986  
 2987      ROM_REGION( 0x200000, "simm5.0", 0 )
 2988      ROM_LOAD( "jojo-simm5.0", 0x00000, 0x200000, CRC(797615fc) SHA1(29874be9f1da5515c90f5d601aa5924c263f8feb) )
 2989      ROM_REGION( 0x200000, "simm5.1", 0 )
 2990      ROM_LOAD( "jojo-simm5.1", 0x00000, 0x200000, CRC(734fd162) SHA1(16cdfac74d18a6c2216afb1ce6afbd7f15297c32) )
 2991  ROM_END
 2992  
 2993  ROM_START( jojonr2 )
 2994      ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
 2995      ROM_LOAD( "jojo_asia_nocd.29f400.u2", 0x000000, 0x080000, CRC(05b4f953) SHA1(c746c7bb5359acc9adced817cb4870b1912eaefd) )
 2996  
 2997      ROM_REGION( 0x200000, "simm1.0", 0 )
 2998      ROM_LOAD( "jojo(__981202)-simm1.0", 0x00000, 0x200000, CRC(e06ba886) SHA1(4defd5e8e1e6d0c439fed8a6454e89a59e24ea4c) )
 2999      ROM_REGION( 0x200000, "simm1.1", 0 )
 3000      ROM_LOAD( "jojo(__981202)-simm1.1", 0x00000, 0x200000, CRC(6dd177c8) SHA1(c39db980f6fcca9c221e9be6f777eaf38f1b136b) )
 3001      ROM_REGION( 0x200000, "simm1.2", 0 )
 3002      ROM_LOAD( "jojo(__981202)-simm1.2", 0x00000, 0x200000, CRC(d35a15e0) SHA1(576b92a94505764a10b9bcf82c02335e7ef62014) )
 3003      ROM_REGION( 0x200000, "simm1.3", 0 )
 3004      ROM_LOAD( "jojo(__981202)-simm1.3", 0x00000, 0x200000, CRC(66d865ac) SHA1(5248c3f124af62b4a672d954ef15f86629feeacb) )
 3005  
 3006      ROM_REGION( 0x200000, "simm2.0", 0 )
 3007      ROM_LOAD( "jojo(__981202)-simm2.0", 0x00000, 0x200000, CRC(417e5dc1) SHA1(54ee9596c1c51811f3bdef7dbe77b44b34f230ca) )
 3008      ROM_REGION( 0x200000, "simm2.1", 0 )
 3009      ROM_LOAD( "jojo(__981202)-simm2.1", 0x00000, 0x200000, CRC(c891c887) SHA1(42e84f774ee655e9a39b016a3cfe94262ed2e9f1) )
 3010      ROM_REGION( 0x200000, "simm2.2", 0 )
 3011      ROM_LOAD( "jojo(__981202)-simm2.2", 0x00000, 0x200000, CRC(1e101f30) SHA1(56518c1646bb9452334856bb8bcc58892f9f93b9) )
 3012      ROM_REGION( 0x200000, "simm2.3", 0 )
 3013      ROM_LOAD( "jojo(__981202)-simm2.3", 0x00000, 0x200000, CRC(1fd1d3e4) SHA1(bed2b77d58f1fdf7ba5ca7126d3db1dd0f8c80b4) )
 3014  
 3015      ROM_REGION( 0x200000, "simm3.0", 0 )
 3016      ROM_LOAD( "jojo-simm3.0",  0x00000, 0x200000, CRC(de7fc9c1) SHA1(662b85a990b04c855773506c936317e62fab4a05) )
 3017      ROM_REGION( 0x200000, "simm3.1", 0 )
 3018      ROM_LOAD( "jojo-simm3.1",  0x00000, 0x200000, CRC(43d053d3) SHA1(54ff0e9c164e0d1649522c330ccc7e5d79e0bc85) )
 3019      ROM_REGION( 0x200000, "simm3.2", 0 )
 3020      ROM_LOAD( "jojo-simm3.2",  0x00000, 0x200000, CRC(2ffd7fa5) SHA1(9018c8e2b286a333ba606208e90caa764951ea3f) )
 3021      ROM_REGION( 0x200000, "simm3.3", 0 )
 3022      ROM_LOAD( "jojo-simm3.3",  0x00000, 0x200000, CRC(4da4985b) SHA1(2552b1730a21ce17d58b69a79ad212a6a5829439) )
 3023      ROM_REGION( 0x200000, "simm3.4", 0 )
 3024      ROM_LOAD( "jojo-simm3.4",  0x00000, 0x200000, CRC(fde98d72) SHA1(654563e12d033e8656dc74a268a08b15b171470d) )
 3025      ROM_REGION( 0x200000, "simm3.5", 0 )
 3026      ROM_LOAD( "jojo-simm3.5",  0x00000, 0x200000, CRC(edb2a266) SHA1(19ebada8422c7f4bf70d0c9ad42b84268967b316) )
 3027      ROM_REGION( 0x200000, "simm3.6", 0 )
 3028      ROM_LOAD( "jojo-simm3.6",  0x00000, 0x200000, CRC(be7cf319) SHA1(7893f5907992e6b903b2683980bba6d3d003bb06) )
 3029      ROM_REGION( 0x200000, "simm3.7", 0 )
 3030      ROM_LOAD( "jojo-simm3.7",  0x00000, 0x200000, CRC(56fe1a9f) SHA1(01741fe1256f4e682f687e94040f4e8bbb8bedb2) )
 3031  
 3032      ROM_REGION( 0x200000, "simm4.0", 0 )
 3033      ROM_LOAD( "jojo-simm4.0",  0x00000, 0x200000, CRC(c4e7bf68) SHA1(a4d1ddea58a3d42db82a63a5e974cbf38d9b792a) )
 3034      ROM_REGION( 0x200000, "simm4.1", 0 )
 3035      ROM_LOAD( "jojo-simm4.1",  0x00000, 0x200000, CRC(b62b2719) SHA1(cb577b89e9e14fda67715716fefd47a782d518ab) )
 3036      ROM_REGION( 0x200000, "simm4.2", 0 )
 3037      ROM_LOAD( "jojo-simm4.2",  0x00000, 0x200000, CRC(18d15809) SHA1(2b406cd1aaa4799a436213dcaa65473eacb4c6d7) )
 3038      ROM_REGION( 0x200000, "simm4.3", 0 )
 3039      ROM_LOAD( "jojo-simm4.3",  0x00000, 0x200000, CRC(9af0ad79) SHA1(075ee048e17b50188876f25d7a6571d6ace84d7d) )
 3040      ROM_REGION( 0x200000, "simm4.4", 0 )
 3041      ROM_LOAD( "jojo-simm4.4",  0x00000, 0x200000, CRC(4124c1f0) SHA1(e4946a8029adc5d0bacead8d766521b4ccd1722b) )
 3042      ROM_REGION( 0x200000, "simm4.5", 0 )
 3043      ROM_LOAD( "jojo-simm4.5",  0x00000, 0x200000, CRC(5e001fd1) SHA1(6457a39f336381b46e587aa2f5f719810ee5bcf9) )
 3044      ROM_REGION( 0x200000, "simm4.6", 0 )
 3045      ROM_LOAD( "jojo-simm4.6",  0x00000, 0x200000, CRC(9affa23b) SHA1(e3d77e777c47277d841a9dadc1dd6e3157706a2e) )
 3046      ROM_REGION( 0x200000, "simm4.7", 0 )
 3047      ROM_LOAD( "jojo-simm4.7",  0x00000, 0x200000, CRC(2511572a) SHA1(725adcf71bcee5c8bb839d2d1c5e3456b8c6886b) )
 3048  
 3049      ROM_REGION( 0x200000, "simm5.0", 0 )
 3050      ROM_LOAD( "jojo-simm5.0",  0x00000, 0x200000, CRC(797615fc) SHA1(29874be9f1da5515c90f5d601aa5924c263f8feb) )
 3051      ROM_REGION( 0x200000, "simm5.1", 0 )
 3052      ROM_LOAD( "jojo-simm5.1",  0x00000, 0x200000, CRC(734fd162) SHA1(16cdfac74d18a6c2216afb1ce6afbd7f15297c32) )
 3053  ROM_END
 3054  
 3055  ROM_START( sfiii3n )
 3056      ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
 3057      ROM_LOAD( "sfiii3_japan_nocd.29f400.u2", 0x000000, 0x080000, CRC(1edc6366) SHA1(60b4b9adeb030a33059d74fdf03873029e465b52) )
 3058  
 3059      ROM_REGION( 0x200000, "simm1.0", 0 )
 3060      ROM_LOAD( "sfiii3(__990608)-simm1.0", 0x00000, 0x200000, CRC(11dfd3cd) SHA1(dba1f77c46e80317e3279298411154dfb6db2309) )
 3061      ROM_REGION( 0x200000, "simm1.1", 0 )
 3062      ROM_LOAD( "sfiii3(__990608)-simm1.1", 0x00000, 0x200000, CRC(c50585e6) SHA1(a289237957ea1c7f58b1c65e24c54ceb34cb1712) )
 3063      ROM_REGION( 0x200000, "simm1.2", 0 )
 3064      ROM_LOAD( "sfiii3(__990608)-simm1.2", 0x00000, 0x200000, CRC(8e011d9b) SHA1(e0861bcd3c4f865474d7ce47aa9eeec7b3d28da6) )
 3065      ROM_REGION( 0x200000, "simm1.3", 0 )
 3066      ROM_LOAD( "sfiii3(__990608)-simm1.3", 0x00000, 0x200000, CRC(dca8d92f) SHA1(7cd241641c943df446e2c75b88b5cf2d2ebf7b2e) )
 3067  
 3068      ROM_REGION( 0x200000, "simm2.0", 0 )
 3069      ROM_LOAD( "sfiii3-simm2.0", 0x00000, 0x200000, CRC(06eb969e) SHA1(d89f6a6585b76692d57d337f0f8186398fb056da) )
 3070      ROM_REGION( 0x200000, "simm2.1", 0 )
 3071      ROM_LOAD( "sfiii3-simm2.1", 0x00000, 0x200000, CRC(e7039f82) SHA1(8e81e66b5a4f45ae14b070a491bde47a6a74499f) )
 3072      ROM_REGION( 0x200000, "simm2.2", 0 )
 3073      ROM_LOAD( "sfiii3-simm2.2", 0x00000, 0x200000, CRC(645c96f7) SHA1(06d5a54874d4bf100b776131ec9060da209ad037) )
 3074      ROM_REGION( 0x200000, "simm2.3", 0 )
 3075      ROM_LOAD( "sfiii3-simm2.3", 0x00000, 0x200000, CRC(610efab1) SHA1(bbc21ed6ff6220ff6017a3f02ebd9a341fbc9040) )
 3076  
 3077      ROM_REGION( 0x200000, "simm3.0", 0 )
 3078      ROM_LOAD( "sfiii3-simm3.0", 0x00000, 0x200000, CRC(7baa1f79) SHA1(3f409df28c24dd7221966b5340d59898ea756b6f) )
 3079      ROM_REGION( 0x200000, "simm3.1", 0 )
 3080      ROM_LOAD( "sfiii3-simm3.1", 0x00000, 0x200000, CRC(234bf8fe) SHA1(2191781ae4d726cab28de97f27efa4a13f3bdd69) )
 3081      ROM_REGION( 0x200000, "simm3.2", 0 )
 3082      ROM_LOAD( "sfiii3-simm3.2", 0x00000, 0x200000, CRC(d9ebc308) SHA1(af6a0dca77e5181c9f20533a06760a782c5fd51d) )
 3083      ROM_REGION( 0x200000, "simm3.3", 0 )
 3084      ROM_LOAD( "sfiii3-simm3.3", 0x00000, 0x200000, CRC(293cba77) SHA1(294604cacdc24261aec4d39e489de91c41fa1758) )
 3085      ROM_REGION( 0x200000, "simm3.4", 0 )
 3086      ROM_LOAD( "sfiii3-simm3.4", 0x00000, 0x200000, CRC(6055e747) SHA1(3813852c5a4a5355ef739ca8f0913bbd390b984b) )
 3087      ROM_REGION( 0x200000, "simm3.5", 0 )
 3088      ROM_LOAD( "sfiii3-simm3.5", 0x00000, 0x200000, CRC(499aa6fc) SHA1(5b9b6eab3e99ff3e1d7c1f50b9d8bc6a81f3f8a9) )
 3089      ROM_REGION( 0x200000, "simm3.6", 0 )
 3090      ROM_LOAD( "sfiii3-simm3.6", 0x00000, 0x200000, CRC(6c13879e) SHA1(de189b0b8f42bc7dd89983e62bc2ecb4237b3277) )
 3091      ROM_REGION( 0x200000, "simm3.7", 0 )
 3092      ROM_LOAD( "sfiii3-simm3.7", 0x00000, 0x200000, CRC(cf4f8ede) SHA1(e0fb68fcb0e445f824c62fa828d6e1dcd7e3683a) )
 3093  
 3094      ROM_REGION( 0x200000, "simm4.0", 0 )
 3095      ROM_LOAD( "sfiii3-simm4.0", 0x00000, 0x200000, CRC(091fd5ba) SHA1(3327ad7c2623c119bf728af717ea2ce3b74673a9) )
 3096      ROM_REGION( 0x200000, "simm4.1", 0 )
 3097      ROM_LOAD( "sfiii3-simm4.1", 0x00000, 0x200000, CRC(0bca8917) SHA1(b7b284e2f16f46d46bcfaae779b232c5b980924f) )
 3098      ROM_REGION( 0x200000, "simm4.2", 0 )
 3099      ROM_LOAD( "sfiii3-simm4.2", 0x00000, 0x200000, CRC(a0fd578b) SHA1(100c9db9f00ecd88d518076f5a0822e6ac3695b3) )
 3100      ROM_REGION( 0x200000, "simm4.3", 0 )
 3101      ROM_LOAD( "sfiii3-simm4.3", 0x00000, 0x200000, CRC(4bf8c699) SHA1(2c0b4288b5ebc5e54d9e782dfc39eb8c78fd4c21) )
 3102      ROM_REGION( 0x200000, "simm4.4", 0 )
 3103      ROM_LOAD( "sfiii3-simm4.4", 0x00000, 0x200000, CRC(137b8785) SHA1(56a579520a8ce2abbf36be57777f024e80474eee) )
 3104      ROM_REGION( 0x200000, "simm4.5", 0 )
 3105      ROM_LOAD( "sfiii3-simm4.5", 0x00000, 0x200000, CRC(4fb70671) SHA1(9aba83c18cfc099a5ce18793119bff0c2b9c777f) )
 3106      ROM_REGION( 0x200000, "simm4.6", 0 )
 3107      ROM_LOAD( "sfiii3-simm4.6", 0x00000, 0x200000, CRC(832374a4) SHA1(c84629e32fbf47cb7b5b4ee7555bfc2ac9b3857f) )
 3108      ROM_REGION( 0x200000, "simm4.7", 0 )
 3109      ROM_LOAD( "sfiii3-simm4.7", 0x00000, 0x200000, CRC(1c88576d) SHA1(0f039944d0c2305999ed5dbd351c3eb87812dc3b) )
 3110  
 3111      ROM_REGION( 0x200000, "simm5.0", 0 )
 3112      ROM_LOAD( "sfiii3-simm5.0", 0x00000, 0x200000, CRC(c67d9190) SHA1(d265475244099d0ec153059986f3445c7bd910a3) )
 3113      ROM_REGION( 0x200000, "simm5.1", 0 )
 3114      ROM_LOAD( "sfiii3-simm5.1", 0x00000, 0x200000, CRC(6cb79868) SHA1(c94237f30e05bfcb2e23945530c812d9e4c73416) )
 3115      ROM_REGION( 0x200000, "simm5.2", 0 )
 3116      ROM_LOAD( "sfiii3-simm5.2", 0x00000, 0x200000, CRC(df69930e) SHA1(c76b7c559a1d5558138afbc796249efa2f49f6a8) )
 3117      ROM_REGION( 0x200000, "simm5.3", 0 )
 3118      ROM_LOAD( "sfiii3-simm5.3", 0x00000, 0x200000, CRC(333754e0) SHA1(4c18a569c26524a492ecd6f4c8b3c8e803a077d3) )
 3119      ROM_REGION( 0x200000, "simm5.4", 0 )
 3120      ROM_LOAD( "sfiii3-simm5.4", 0x00000, 0x200000, CRC(78f6d417) SHA1(a69577cc5399fcf0a24548661168f27f3e7e8e40) )
 3121      ROM_REGION( 0x200000, "simm5.5", 0 )
 3122      ROM_LOAD( "sfiii3-simm5.5", 0x00000, 0x200000, CRC(8ccad9b1) SHA1(f8bda399f87be2497b7ac39e9661f9863bf4f873) )
 3123      ROM_REGION( 0x200000, "simm5.6", 0 )
 3124      ROM_LOAD( "sfiii3-simm5.6", 0x00000, 0x200000, CRC(85de59e5) SHA1(748b5c91f15777b85d8c1d35b685cd90d3185ec6) )
 3125      ROM_REGION( 0x200000, "simm5.7", 0 )
 3126      ROM_LOAD( "sfiii3-simm5.7", 0x00000, 0x200000, CRC(ee7e29b3) SHA1(63dc30c6904ca2f58d229249bee5eef51fafa158) )
 3127  
 3128      ROM_REGION( 0x200000, "simm6.0", 0 )
 3129      ROM_LOAD( "sfiii3-simm6.0", 0x00000, 0x200000, CRC(8da69042) SHA1(fd3d08295342635b2136e48d543c9350d287bb22) )
 3130      ROM_REGION( 0x200000, "simm6.1", 0 )
 3131      ROM_LOAD( "sfiii3-simm6.1", 0x00000, 0x200000, CRC(1c8c7ac4) SHA1(ac9f8353a4c356ef98aa7c226baba00b01f5a80f) )
 3132      ROM_REGION( 0x200000, "simm6.2", 0 )
 3133      ROM_LOAD( "sfiii3-simm6.2", 0x00000, 0x200000, CRC(a671341d) SHA1(636f4c04962bc1e1ddb29d2e01244b00389b234f) )
 3134      ROM_REGION( 0x200000, "simm6.3", 0 )
 3135      ROM_LOAD( "sfiii3-simm6.3", 0x00000, 0x200000, CRC(1a990249) SHA1(2acc639e2c0c53bf24096b8620eab090bc25d03b) )
 3136      ROM_REGION( 0x200000, "simm6.4", 0 )
 3137      ROM_LOAD( "sfiii3-simm6.4", 0x00000, 0x200000, CRC(20cb39ac) SHA1(7d13a0fea1ef719dd2ff77dfb547d53c6023cc9e) )
 3138      ROM_REGION( 0x200000, "simm6.5", 0 )
 3139      ROM_LOAD( "sfiii3-simm6.5", 0x00000, 0x200000, CRC(5f844b2f) SHA1(564e4934f89ed3b92a4c4874519f8f00f3b48696) )
 3140      ROM_REGION( 0x200000, "simm6.6", 0 )
 3141      ROM_LOAD( "sfiii3-simm6.6", 0x00000, 0x200000, CRC(450e8d28) SHA1(885db658132aa27926df617ec2d2a1f38abdbb60) )
 3142      ROM_REGION( 0x200000, "simm6.7", 0 )
 3143      ROM_LOAD( "sfiii3-simm6.7", 0x00000, 0x200000, CRC(cc5f4187) SHA1(248ddace21ed4736a56e92f77cc6ad219d7fef0b) )
 3144  ROM_END
 3145  
 3146  ROM_START( sfiii3nr1 )
 3147      ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
 3148      ROM_LOAD( "sfiii3_japan_nocd.29f400.u2", 0x000000, 0x080000, CRC(1edc6366) SHA1(60b4b9adeb030a33059d74fdf03873029e465b52) )
 3149  
 3150      ROM_REGION( 0x200000, "simm1.0", 0 )
 3151      ROM_LOAD( "sfiii3(__990512)-simm1.0", 0x00000, 0x200000, CRC(66e66235) SHA1(0a98038721d176458d4f85dbd76c5edb93a65322) )
 3152      ROM_REGION( 0x200000, "simm1.1", 0 )
 3153      ROM_LOAD( "sfiii3(__990512)-simm1.1", 0x00000, 0x200000, CRC(186e8c5f) SHA1(a63040201a660b56217a8cbab32f5c2c466ee5dd) )
 3154      ROM_REGION( 0x200000, "simm1.2", 0 )
 3155      ROM_LOAD( "sfiii3(__990512)-simm1.2", 0x00000, 0x200000, CRC(bce18cab) SHA1(a5c28063d98c22403756fc926a20631456fb7dcc) )
 3156      ROM_REGION( 0x200000, "simm1.3", 0 )
 3157      ROM_LOAD( "sfiii3(__990512)-simm1.3", 0x00000, 0x200000, CRC(129dc2c9) SHA1(c1e634d94b1c8f7f02a47703622de5cab3d0da3f) )
 3158  
 3159      ROM_REGION( 0x200000, "simm2.0", 0 )
 3160      ROM_LOAD( "sfiii3-simm2.0",  0x00000, 0x200000, CRC(06eb969e) SHA1(d89f6a6585b76692d57d337f0f8186398fb056da) )
 3161      ROM_REGION( 0x200000, "simm2.1", 0 )
 3162      ROM_LOAD( "sfiii3-simm2.1",  0x00000, 0x200000, CRC(e7039f82) SHA1(8e81e66b5a4f45ae14b070a491bde47a6a74499f) )
 3163      ROM_REGION( 0x200000, "simm2.2", 0 )
 3164      ROM_LOAD( "sfiii3-simm2.2",  0x00000, 0x200000, CRC(645c96f7) SHA1(06d5a54874d4bf100b776131ec9060da209ad037) )
 3165      ROM_REGION( 0x200000, "simm2.3", 0 )
 3166      ROM_LOAD( "sfiii3-simm2.3",  0x00000, 0x200000, CRC(610efab1) SHA1(bbc21ed6ff6220ff6017a3f02ebd9a341fbc9040) )
 3167  
 3168      ROM_REGION( 0x200000, "simm3.0", 0 )
 3169      ROM_LOAD( "sfiii3-simm3.0",  0x00000, 0x200000, CRC(7baa1f79) SHA1(3f409df28c24dd7221966b5340d59898ea756b6f) )
 3170      ROM_REGION( 0x200000, "simm3.1", 0 )
 3171      ROM_LOAD( "sfiii3-simm3.1",  0x00000, 0x200000, CRC(234bf8fe) SHA1(2191781ae4d726cab28de97f27efa4a13f3bdd69) )
 3172      ROM_REGION( 0x200000, "simm3.2", 0 )
 3173      ROM_LOAD( "sfiii3-simm3.2",  0x00000, 0x200000, CRC(d9ebc308) SHA1(af6a0dca77e5181c9f20533a06760a782c5fd51d) )
 3174      ROM_REGION( 0x200000, "simm3.3", 0 )
 3175      ROM_LOAD( "sfiii3-simm3.3",  0x00000, 0x200000, CRC(293cba77) SHA1(294604cacdc24261aec4d39e489de91c41fa1758) )
 3176      ROM_REGION( 0x200000, "simm3.4", 0 )
 3177      ROM_LOAD( "sfiii3-simm3.4",  0x00000, 0x200000, CRC(6055e747) SHA1(3813852c5a4a5355ef739ca8f0913bbd390b984b) )
 3178      ROM_REGION( 0x200000, "simm3.5", 0 )
 3179      ROM_LOAD( "sfiii3-simm3.5",  0x00000, 0x200000, CRC(499aa6fc) SHA1(5b9b6eab3e99ff3e1d7c1f50b9d8bc6a81f3f8a9) )
 3180      ROM_REGION( 0x200000, "simm3.6", 0 )
 3181      ROM_LOAD( "sfiii3-simm3.6",  0x00000, 0x200000, CRC(6c13879e) SHA1(de189b0b8f42bc7dd89983e62bc2ecb4237b3277) )
 3182      ROM_REGION( 0x200000, "simm3.7", 0 )
 3183      ROM_LOAD( "sfiii3-simm3.7",  0x00000, 0x200000, CRC(cf4f8ede) SHA1(e0fb68fcb0e445f824c62fa828d6e1dcd7e3683a) )
 3184  
 3185      ROM_REGION( 0x200000, "simm4.0", 0 )
 3186      ROM_LOAD( "sfiii3-simm4.0",  0x00000, 0x200000, CRC(091fd5ba) SHA1(3327ad7c2623c119bf728af717ea2ce3b74673a9) )
 3187      ROM_REGION( 0x200000, "simm4.1", 0 )
 3188      ROM_LOAD( "sfiii3-simm4.1",  0x00000, 0x200000, CRC(0bca8917) SHA1(b7b284e2f16f46d46bcfaae779b232c5b980924f) )
 3189      ROM_REGION( 0x200000, "simm4.2", 0 )
 3190      ROM_LOAD( "sfiii3-simm4.2",  0x00000, 0x200000, CRC(a0fd578b) SHA1(100c9db9f00ecd88d518076f5a0822e6ac3695b3) )
 3191      ROM_REGION( 0x200000, "simm4.3", 0 )
 3192      ROM_LOAD( "sfiii3-simm4.3",  0x00000, 0x200000, CRC(4bf8c699) SHA1(2c0b4288b5ebc5e54d9e782dfc39eb8c78fd4c21) )
 3193      ROM_REGION( 0x200000, "simm4.4", 0 )
 3194      ROM_LOAD( "sfiii3-simm4.4",  0x00000, 0x200000, CRC(137b8785) SHA1(56a579520a8ce2abbf36be57777f024e80474eee) )
 3195      ROM_REGION( 0x200000, "simm4.5", 0 )
 3196      ROM_LOAD( "sfiii3-simm4.5",  0x00000, 0x200000, CRC(4fb70671) SHA1(9aba83c18cfc099a5ce18793119bff0c2b9c777f) )
 3197      ROM_REGION( 0x200000, "simm4.6", 0 )
 3198      ROM_LOAD( "sfiii3-simm4.6",  0x00000, 0x200000, CRC(832374a4) SHA1(c84629e32fbf47cb7b5b4ee7555bfc2ac9b3857f) )
 3199      ROM_REGION( 0x200000, "simm4.7", 0 )
 3200      ROM_LOAD( "sfiii3-simm4.7",  0x00000, 0x200000, CRC(1c88576d) SHA1(0f039944d0c2305999ed5dbd351c3eb87812dc3b) )
 3201  
 3202      ROM_REGION( 0x200000, "simm5.0", 0 )
 3203      ROM_LOAD( "sfiii3-simm5.0",  0x00000, 0x200000, CRC(c67d9190) SHA1(d265475244099d0ec153059986f3445c7bd910a3) )
 3204      ROM_REGION( 0x200000, "simm5.1", 0 )
 3205      ROM_LOAD( "sfiii3-simm5.1",  0x00000, 0x200000, CRC(6cb79868) SHA1(c94237f30e05bfcb2e23945530c812d9e4c73416) )
 3206      ROM_REGION( 0x200000, "simm5.2", 0 )
 3207      ROM_LOAD( "sfiii3-simm5.2",  0x00000, 0x200000, CRC(df69930e) SHA1(c76b7c559a1d5558138afbc796249efa2f49f6a8) )
 3208      ROM_REGION( 0x200000, "simm5.3", 0 )
 3209      ROM_LOAD( "sfiii3-simm5.3",  0x00000, 0x200000, CRC(333754e0) SHA1(4c18a569c26524a492ecd6f4c8b3c8e803a077d3) )
 3210      ROM_REGION( 0x200000, "simm5.4", 0 )
 3211      ROM_LOAD( "sfiii3-simm5.4",  0x00000, 0x200000, CRC(78f6d417) SHA1(a69577cc5399fcf0a24548661168f27f3e7e8e40) )
 3212      ROM_REGION( 0x200000, "simm5.5", 0 )
 3213      ROM_LOAD( "sfiii3-simm5.5",  0x00000, 0x200000, CRC(8ccad9b1) SHA1(f8bda399f87be2497b7ac39e9661f9863bf4f873) )
 3214      ROM_REGION( 0x200000, "simm5.6", 0 )
 3215      ROM_LOAD( "sfiii3-simm5.6",  0x00000, 0x200000, CRC(85de59e5) SHA1(748b5c91f15777b85d8c1d35b685cd90d3185ec6) )
 3216      ROM_REGION( 0x200000, "simm5.7", 0 )
 3217      ROM_LOAD( "sfiii3-simm5.7",  0x00000, 0x200000, CRC(ee7e29b3) SHA1(63dc30c6904ca2f58d229249bee5eef51fafa158) )
 3218  
 3219      ROM_REGION( 0x200000, "simm6.0", 0 )
 3220      ROM_LOAD( "sfiii3-simm6.0",  0x00000, 0x200000, CRC(8da69042) SHA1(fd3d08295342635b2136e48d543c9350d287bb22) )
 3221      ROM_REGION( 0x200000, "simm6.1", 0 )
 3222      ROM_LOAD( "sfiii3-simm6.1",  0x00000, 0x200000, CRC(1c8c7ac4) SHA1(ac9f8353a4c356ef98aa7c226baba00b01f5a80f) )
 3223      ROM_REGION( 0x200000, "simm6.2", 0 )
 3224      ROM_LOAD( "sfiii3-simm6.2",  0x00000, 0x200000, CRC(a671341d) SHA1(636f4c04962bc1e1ddb29d2e01244b00389b234f) )
 3225      ROM_REGION( 0x200000, "simm6.3", 0 )
 3226      ROM_LOAD( "sfiii3-simm6.3",  0x00000, 0x200000, CRC(1a990249) SHA1(2acc639e2c0c53bf24096b8620eab090bc25d03b) )
 3227      ROM_REGION( 0x200000, "simm6.4", 0 )
 3228      ROM_LOAD( "sfiii3-simm6.4",  0x00000, 0x200000, CRC(20cb39ac) SHA1(7d13a0fea1ef719dd2ff77dfb547d53c6023cc9e) )
 3229      ROM_REGION( 0x200000, "simm6.5", 0 )
 3230      ROM_LOAD( "sfiii3-simm6.5",  0x00000, 0x200000, CRC(5f844b2f) SHA1(564e4934f89ed3b92a4c4874519f8f00f3b48696) )
 3231      ROM_REGION( 0x200000, "simm6.6", 0 )
 3232      ROM_LOAD( "sfiii3-simm6.6",  0x00000, 0x200000, CRC(450e8d28) SHA1(885db658132aa27926df617ec2d2a1f38abdbb60) )
 3233      ROM_REGION( 0x200000, "simm6.7", 0 )
 3234      ROM_LOAD( "sfiii3-simm6.7",  0x00000, 0x200000, CRC(cc5f4187) SHA1(248ddace21ed4736a56e92f77cc6ad219d7fef0b) )
 3235  ROM_END
 3236  
 3237  ROM_START( jojoban )
 3238      ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
 3239      ROM_LOAD( "jojoba_japan_nocd.29f400.u2", 0x000000, 0x080000, CRC(4dab19f5) SHA1(ba07190e7662937fc267f07285c51e99a45c061e) )
 3240  
 3241      ROM_REGION( 0x200000, "simm1.0", 0 )
 3242      ROM_LOAD( "jojoba(__990927)-simm1.0", 0x00000, 0x200000, CRC(adcd8377) SHA1(f1aacbe061e3bcade5cca34435c3f86aec5f1499) )
 3243      ROM_REGION( 0x200000, "simm1.1", 0 )
 3244      ROM_LOAD( "jojoba(__990927)-simm1.1", 0x00000, 0x200000, CRC(d7590b59) SHA1(bfee627ebb7cb7b28216527b17e1b06a4e6f19f4) )
 3245      ROM_REGION( 0x200000, "simm1.2", 0 )
 3246      ROM_LOAD( "jojoba(__990927)-simm1.2", 0x00000, 0x200000, CRC(e62e240b) SHA1(70468cae67c009a80b45954c2a30794577343c77) )
 3247      ROM_REGION( 0x200000, "simm1.3", 0 )
 3248      ROM_LOAD( "jojoba(__990927)-simm1.3", 0x00000, 0x200000, CRC(c95450c3) SHA1(55616e009b007180d1ac6290c8da44b0d864a494) )
 3249  
 3250      ROM_REGION( 0x200000, "simm2.0", 0 )
 3251      ROM_LOAD( "jojoba(__990927)-simm2.0", 0x00000, 0x200000, CRC(535f2eba) SHA1(167bec0dccfc2f91cb10cb1e2631ee619b3eb9fe) )
 3252      ROM_REGION( 0x200000, "simm2.1", 0 )
 3253      ROM_LOAD( "jojoba(__990927)-simm2.1", 0x00000, 0x200000, CRC(01dd3a01) SHA1(08c462219796baa3ec28d78d038a18187cd838bb) )
 3254      ROM_REGION( 0x200000, "simm2.2", 0 )
 3255      ROM_LOAD( "jojoba(__990927)-simm2.2", 0x00000, 0x200000, CRC(61432672) SHA1(d0416a75d395926041f90a3d34edb96a080acfd6) )
 3256      ROM_REGION( 0x200000, "simm2.3", 0 )
 3257      ROM_LOAD( "jojoba(__990927)-simm2.3", 0x00000, 0x200000, CRC(acdc9aca) SHA1(89f77ddd6286709182a676fd9bd6c333a3b16271) )
 3258  
 3259      ROM_REGION( 0x200000, "simm3.0", 0 )
 3260      ROM_LOAD( "jojoba-simm3.0", 0x00000, 0x200000, CRC(4d16e111) SHA1(f198007375be65e89856d64ee2b3857a18b4eab8) )
 3261      ROM_REGION( 0x200000, "simm3.1", 0 )
 3262      ROM_LOAD( "jojoba-simm3.1", 0x00000, 0x200000, CRC(9b3406d3) SHA1(54e90cd334d13e2c74305c6b87ebce1365ef3d59) )
 3263      ROM_REGION( 0x200000, "simm3.2", 0 )
 3264      ROM_LOAD( "jojoba-simm3.2", 0x00000, 0x200000, CRC(f2414997) SHA1(fb89d5784250538ad17fd527267b513afb6eca20) )
 3265      ROM_REGION( 0x200000, "simm3.3", 0 )
 3266      ROM_LOAD( "jojoba-simm3.3", 0x00000, 0x200000, CRC(954b9c7d) SHA1(0d64d97167d4e669d7e4f3a388f9d5ec1e18ed42) )
 3267      ROM_REGION( 0x200000, "simm3.4", 0 )
 3268      ROM_LOAD( "jojoba-simm3.4", 0x00000, 0x200000, CRC(625adc1d) SHA1(533d62759ecece10c711d99bfca403e5cba279b5) )
 3269      ROM_REGION( 0x200000, "simm3.5", 0 )
 3270      ROM_LOAD( "jojoba-simm3.5", 0x00000, 0x200000, CRC(20a70bb4) SHA1(3bd8376304ffc974fb8031eac8bebff27969538c) )
 3271      ROM_REGION( 0x200000, "simm3.6", 0 )
 3272      ROM_LOAD( "jojoba-simm3.6", 0x00000, 0x200000, CRC(a10ec5af) SHA1(9b403260e8fbdacaa5369ab79fc05855cc6a6bdb) )
 3273      ROM_REGION( 0x200000, "simm3.7", 0 )
 3274      ROM_LOAD( "jojoba-simm3.7", 0x00000, 0x200000, CRC(0bd0de7a) SHA1(1debecda5f282f2a1dd17e887e522a4d00c5dc9d) )
 3275  
 3276      ROM_REGION( 0x200000, "simm4.0", 0 )
 3277      ROM_LOAD( "jojoba-simm4.0", 0x00000, 0x200000, CRC(6ea14adc) SHA1(696b2ec66f3c197817a60f507a1b4c78db37f488) )
 3278      ROM_REGION( 0x200000, "simm4.1", 0 )
 3279      ROM_LOAD( "jojoba-simm4.1", 0x00000, 0x200000, CRC(8f4c42fb) SHA1(363d769b0b066ce139125426d2da6dfa15d1eb28) )
 3280      ROM_REGION( 0x200000, "simm4.2", 0 )
 3281      ROM_LOAD( "jojoba-simm4.2", 0x00000, 0x200000, CRC(ef0586d1) SHA1(8fcc350da20e3e59fa76fa14e10f2c47233ba9dc) )
 3282      ROM_REGION( 0x200000, "simm4.3", 0 )
 3283      ROM_LOAD( "jojoba-simm4.3", 0x00000, 0x200000, CRC(93ccc470) SHA1(5d267679e61c0fb592ad5f696d3c06ec1746d0b3) )
 3284      ROM_REGION( 0x200000, "simm4.4", 0 )
 3285      ROM_LOAD( "jojoba-simm4.4", 0x00000, 0x200000, CRC(3d9ec7d2) SHA1(665b867bab928be183c2006527e55f9b8ec4a271) )
 3286      ROM_REGION( 0x200000, "simm4.5", 0 )
 3287      ROM_LOAD( "jojoba-simm4.5", 0x00000, 0x200000, CRC(03e66850) SHA1(8478662dc9db20d9a186d315a883bd1cbb5e5000) )
 3288      ROM_REGION( 0x200000, "simm4.6", 0 )
 3289      ROM_LOAD( "jojoba-simm4.6", 0x00000, 0x200000, CRC(01606ac3) SHA1(ccc74edeca6abdd86fc1cf42ececa1ea393b3261) )
 3290      ROM_REGION( 0x200000, "simm4.7", 0 )
 3291      ROM_LOAD( "jojoba-simm4.7", 0x00000, 0x200000, CRC(36392b87) SHA1(e62080c8461775c1e180400dfb44414679fd0fc1) )
 3292  
 3293      ROM_REGION( 0x200000, "simm5.0", 0 )
 3294      ROM_LOAD( "jojoba-simm5.0", 0x00000, 0x200000, CRC(2ef8c60c) SHA1(dea87a73a11b8edd27c3c9c5ab2af295cb5508f9) )
 3295      ROM_REGION( 0x200000, "simm5.1", 0 )
 3296      ROM_LOAD( "jojoba-simm5.1", 0x00000, 0x200000, CRC(cf7d7ca6) SHA1(b347707b1e5bc71d28b282273f893592e5f9e333) )
 3297      ROM_REGION( 0x200000, "simm5.2", 0 )
 3298      ROM_LOAD( "jojoba-simm5.2", 0x00000, 0x200000, CRC(b7815bfa) SHA1(0b5a3a2ffe1b3c0ca765dcedc297e78e5928302b) )
 3299      ROM_REGION( 0x200000, "simm5.3", 0 )
 3300      ROM_LOAD( "jojoba-simm5.3", 0x00000, 0x200000, CRC(9bfec049) SHA1(62cc9a1920047863205544b77344ee18f310f084) )
 3301      ROM_REGION( 0x200000, "simm5.4", 0 )
 3302      ROM_LOAD( "jojoba-simm5.4", 0x00000, 0x200000, CRC(d167536b) SHA1(e2637d3486f168ce44e0a00413d38960cb86db4c) )
 3303      ROM_REGION( 0x200000, "simm5.5", 0 )
 3304      ROM_LOAD( "jojoba-simm5.5", 0x00000, 0x200000, CRC(55e7a042) SHA1(c18bda61fa005d9174a27b7b7d324004262a4525) )
 3305      ROM_REGION( 0x200000, "simm5.6", 0 )
 3306      ROM_LOAD( "jojoba-simm5.6", 0x00000, 0x200000, CRC(4fb32906) SHA1(3a5965b3197517932c8aa4c07a6ea6a190a338d7) )
 3307      ROM_REGION( 0x200000, "simm5.7", 0 )
 3308      ROM_LOAD( "jojoba-simm5.7", 0x00000, 0x200000, CRC(8c8be520) SHA1(c461f3f76a83592b36b29afb316679a7c8972404) )
 3309  ROM_END
 3310  
 3311  ROM_START( jojobanr1 )
 3312      ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
 3313      ROM_LOAD( "jojoba_japan_nocd.29f400.u2", 0x000000, 0x080000, CRC(4dab19f5) SHA1(ba07190e7662937fc267f07285c51e99a45c061e) )
 3314  
 3315      ROM_REGION( 0x200000, "simm1.0", 0 )
 3316      ROM_LOAD( "jojoba(__990913)-simm1.0", 0x00000, 0x200000, CRC(76976231) SHA1(90adde7e5983ec6a4e02789d5cefe9e85c9c52d5) )
 3317      ROM_REGION( 0x200000, "simm1.1", 0 )
 3318      ROM_LOAD( "jojoba(__990913)-simm1.1", 0x00000, 0x200000, CRC(cedd78e7) SHA1(964988b90a2f14c1da2cfc48d943e16e54da3fd3) )
 3319      ROM_REGION( 0x200000, "simm1.2", 0 )
 3320      ROM_LOAD( "jojoba(__990913)-simm1.2", 0x00000, 0x200000, CRC(2955b77f) SHA1(2a907a5cd91448bfc420c318584e5ef4bbe55a91) )
 3321      ROM_REGION( 0x200000, "simm1.3", 0 )
 3322      ROM_LOAD( "jojoba(__990913)-simm1.3", 0x00000, 0x200000, CRC(280139d7) SHA1(b7c28f6f0218688fb873a3106d2f95ea2e1e927c) )
 3323  
 3324      ROM_REGION( 0x200000, "simm2.0", 0 )
 3325      ROM_LOAD( "jojoba(__990913)-simm2.0", 0x00000, 0x200000, CRC(305c4914) SHA1(c3a73ffe58f61ab8f1cd9e3f0891037638dc5a9b) )
 3326      ROM_REGION( 0x200000, "simm2.1", 0 )
 3327      ROM_LOAD( "jojoba(__990913)-simm2.1", 0x00000, 0x200000, CRC(18af4f3b) SHA1(04b8fdf23a782b10c203b111cc634a6d3474044a) )
 3328      ROM_REGION( 0x200000, "simm2.2", 0 )
 3329      ROM_LOAD( "jojoba(__990913)-simm2.2", 0x00000, 0x200000, CRC(397e5c9e) SHA1(021d86ee66bf951fb6a1dd90fb7007c6865cbb8b) )
 3330      ROM_REGION( 0x200000, "simm2.3", 0 )
 3331      ROM_LOAD( "jojoba(__990913)-simm2.3", 0x00000, 0x200000, CRC(a9d0a7d7) SHA1(b2cfc0661f8903ddbeea8a604ee8b42097e10ab8) )
 3332  
 3333      ROM_REGION( 0x200000, "simm3.0", 0 )
 3334      ROM_LOAD( "jojoba-simm3.0",  0x00000, 0x200000, CRC(4d16e111) SHA1(f198007375be65e89856d64ee2b3857a18b4eab8) )
 3335      ROM_REGION( 0x200000, "simm3.1", 0 )
 3336      ROM_LOAD( "jojoba-simm3.1",  0x00000, 0x200000, CRC(9b3406d3) SHA1(54e90cd334d13e2c74305c6b87ebce1365ef3d59) )
 3337      ROM_REGION( 0x200000, "simm3.2", 0 )
 3338      ROM_LOAD( "jojoba-simm3.2",  0x00000, 0x200000, CRC(f2414997) SHA1(fb89d5784250538ad17fd527267b513afb6eca20) )
 3339      ROM_REGION( 0x200000, "simm3.3", 0 )
 3340      ROM_LOAD( "jojoba-simm3.3",  0x00000, 0x200000, CRC(954b9c7d) SHA1(0d64d97167d4e669d7e4f3a388f9d5ec1e18ed42) )
 3341      ROM_REGION( 0x200000, "simm3.4", 0 )
 3342      ROM_LOAD( "jojoba-simm3.4",  0x00000, 0x200000, CRC(625adc1d) SHA1(533d62759ecece10c711d99bfca403e5cba279b5) )
 3343      ROM_REGION( 0x200000, "simm3.5", 0 )
 3344      ROM_LOAD( "jojoba-simm3.5",  0x00000, 0x200000, CRC(20a70bb4) SHA1(3bd8376304ffc974fb8031eac8bebff27969538c) )
 3345      ROM_REGION( 0x200000, "simm3.6", 0 )
 3346      ROM_LOAD( "jojoba-simm3.6",  0x00000, 0x200000, CRC(a10ec5af) SHA1(9b403260e8fbdacaa5369ab79fc05855cc6a6bdb) )
 3347      ROM_REGION( 0x200000, "simm3.7", 0 )
 3348      ROM_LOAD( "jojoba-simm3.7",  0x00000, 0x200000, CRC(0bd0de7a) SHA1(1debecda5f282f2a1dd17e887e522a4d00c5dc9d) )
 3349  
 3350      ROM_REGION( 0x200000, "simm4.0", 0 )
 3351      ROM_LOAD( "jojoba-simm4.0",  0x00000, 0x200000, CRC(6ea14adc) SHA1(696b2ec66f3c197817a60f507a1b4c78db37f488) )
 3352      ROM_REGION( 0x200000, "simm4.1", 0 )
 3353      ROM_LOAD( "jojoba-simm4.1",  0x00000, 0x200000, CRC(8f4c42fb) SHA1(363d769b0b066ce139125426d2da6dfa15d1eb28) )
 3354      ROM_REGION( 0x200000, "simm4.2", 0 )
 3355      ROM_LOAD( "jojoba-simm4.2",  0x00000, 0x200000, CRC(ef0586d1) SHA1(8fcc350da20e3e59fa76fa14e10f2c47233ba9dc) )
 3356      ROM_REGION( 0x200000, "simm4.3", 0 )
 3357      ROM_LOAD( "jojoba-simm4.3",  0x00000, 0x200000, CRC(93ccc470) SHA1(5d267679e61c0fb592ad5f696d3c06ec1746d0b3) )
 3358      ROM_REGION( 0x200000, "simm4.4", 0 )
 3359      ROM_LOAD( "jojoba-simm4.4",  0x00000, 0x200000, CRC(3d9ec7d2) SHA1(665b867bab928be183c2006527e55f9b8ec4a271) )
 3360      ROM_REGION( 0x200000, "simm4.5", 0 )
 3361      ROM_LOAD( "jojoba-simm4.5",  0x00000, 0x200000, CRC(03e66850) SHA1(8478662dc9db20d9a186d315a883bd1cbb5e5000) )
 3362      ROM_REGION( 0x200000, "simm4.6", 0 )
 3363      ROM_LOAD( "jojoba-simm4.6",  0x00000, 0x200000, CRC(01606ac3) SHA1(ccc74edeca6abdd86fc1cf42ececa1ea393b3261) )
 3364      ROM_REGION( 0x200000, "simm4.7", 0 )
 3365      ROM_LOAD( "jojoba-simm4.7",  0x00000, 0x200000, CRC(36392b87) SHA1(e62080c8461775c1e180400dfb44414679fd0fc1) )
 3366  
 3367      ROM_REGION( 0x200000, "simm5.0", 0 )
 3368      ROM_LOAD( "jojoba-simm5.0",  0x00000, 0x200000, CRC(2ef8c60c) SHA1(dea87a73a11b8edd27c3c9c5ab2af295cb5508f9) )
 3369      ROM_REGION( 0x200000, "simm5.1", 0 )
 3370      ROM_LOAD( "jojoba-simm5.1",  0x00000, 0x200000, CRC(cf7d7ca6) SHA1(b347707b1e5bc71d28b282273f893592e5f9e333) )
 3371      ROM_REGION( 0x200000, "simm5.2", 0 )
 3372      ROM_LOAD( "jojoba-simm5.2",  0x00000, 0x200000, CRC(b7815bfa) SHA1(0b5a3a2ffe1b3c0ca765dcedc297e78e5928302b) )
 3373      ROM_REGION( 0x200000, "simm5.3", 0 )
 3374      ROM_LOAD( "jojoba-simm5.3",  0x00000, 0x200000, CRC(9bfec049) SHA1(62cc9a1920047863205544b77344ee18f310f084) )
 3375      ROM_REGION( 0x200000, "simm5.4", 0 )
 3376      ROM_LOAD( "jojoba-simm5.4",  0x00000, 0x200000, CRC(d167536b) SHA1(e2637d3486f168ce44e0a00413d38960cb86db4c) )
 3377      ROM_REGION( 0x200000, "simm5.5", 0 )
 3378      ROM_LOAD( "jojoba-simm5.5",  0x00000, 0x200000, CRC(55e7a042) SHA1(c18bda61fa005d9174a27b7b7d324004262a4525) )
 3379      ROM_REGION( 0x200000, "simm5.6", 0 )
 3380      ROM_LOAD( "jojoba-simm5.6",  0x00000, 0x200000, CRC(4fb32906) SHA1(3a5965b3197517932c8aa4c07a6ea6a190a338d7) )
 3381      ROM_REGION( 0x200000, "simm5.7", 0 )
 3382      ROM_LOAD( "jojoba-simm5.7",  0x00000, 0x200000, CRC(8c8be520) SHA1(c461f3f76a83592b36b29afb316679a7c8972404) )
 3383  ROM_END
 3384  
 3385  ROM_START( jojobane )
 3386      ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
 3387      ROM_LOAD( "jojoba_euro_nocd.29f400.u2", 0x000000, 0x080000, CRC(1ee2d679) SHA1(9e129b454a376606b3f7e8aec64de425cf9c635c) )
 3388  
 3389      ROM_REGION( 0x200000, "simm1.0", 0 )
 3390      ROM_LOAD( "jojoba(__990927)-simm1.0", 0x00000, 0x200000, CRC(adcd8377) SHA1(f1aacbe061e3bcade5cca34435c3f86aec5f1499) )
 3391      ROM_REGION( 0x200000, "simm1.1", 0 )
 3392      ROM_LOAD( "jojoba(__990927)-simm1.1", 0x00000, 0x200000, CRC(d7590b59) SHA1(bfee627ebb7cb7b28216527b17e1b06a4e6f19f4) )
 3393      ROM_REGION( 0x200000, "simm1.2", 0 )
 3394      ROM_LOAD( "jojoba(__990927)-simm1.2", 0x00000, 0x200000, CRC(e62e240b) SHA1(70468cae67c009a80b45954c2a30794577343c77) )
 3395      ROM_REGION( 0x200000, "simm1.3", 0 )
 3396      ROM_LOAD( "jojoba(__990927)-simm1.3", 0x00000, 0x200000, CRC(c95450c3) SHA1(55616e009b007180d1ac6290c8da44b0d864a494) )
 3397  
 3398      ROM_REGION( 0x200000, "simm2.0", 0 )
 3399      ROM_LOAD( "jojoba(__990927)-simm2.0", 0x00000, 0x200000, CRC(535f2eba) SHA1(167bec0dccfc2f91cb10cb1e2631ee619b3eb9fe) )
 3400      ROM_REGION( 0x200000, "simm2.1", 0 )
 3401      ROM_LOAD( "jojoba(__990927)-simm2.1", 0x00000, 0x200000, CRC(01dd3a01) SHA1(08c462219796baa3ec28d78d038a18187cd838bb) )
 3402      ROM_REGION( 0x200000, "simm2.2", 0 )
 3403      ROM_LOAD( "jojoba(__990927)-simm2.2", 0x00000, 0x200000, CRC(61432672) SHA1(d0416a75d395926041f90a3d34edb96a080acfd6) )
 3404      ROM_REGION( 0x200000, "simm2.3", 0 )
 3405      ROM_LOAD( "jojoba(__990927)-simm2.3", 0x00000, 0x200000, CRC(acdc9aca) SHA1(89f77ddd6286709182a676fd9bd6c333a3b16271) )
 3406  
 3407      ROM_REGION( 0x200000, "simm3.0", 0 )
 3408      ROM_LOAD( "jojoba-simm3.0", 0x00000, 0x200000, CRC(4d16e111) SHA1(f198007375be65e89856d64ee2b3857a18b4eab8) )
 3409      ROM_REGION( 0x200000, "simm3.1", 0 )
 3410      ROM_LOAD( "jojoba-simm3.1", 0x00000, 0x200000, CRC(9b3406d3) SHA1(54e90cd334d13e2c74305c6b87ebce1365ef3d59) )
 3411      ROM_REGION( 0x200000, "simm3.2", 0 )
 3412      ROM_LOAD( "jojoba-simm3.2", 0x00000, 0x200000, CRC(f2414997) SHA1(fb89d5784250538ad17fd527267b513afb6eca20) )
 3413      ROM_REGION( 0x200000, "simm3.3", 0 )
 3414      ROM_LOAD( "jojoba-simm3.3", 0x00000, 0x200000, CRC(954b9c7d) SHA1(0d64d97167d4e669d7e4f3a388f9d5ec1e18ed42) )
 3415      ROM_REGION( 0x200000, "simm3.4", 0 )
 3416      ROM_LOAD( "jojoba-simm3.4", 0x00000, 0x200000, CRC(625adc1d) SHA1(533d62759ecece10c711d99bfca403e5cba279b5) )
 3417      ROM_REGION( 0x200000, "simm3.5", 0 )
 3418      ROM_LOAD( "jojoba-simm3.5", 0x00000, 0x200000, CRC(20a70bb4) SHA1(3bd8376304ffc974fb8031eac8bebff27969538c) )
 3419      ROM_REGION( 0x200000, "simm3.6", 0 )
 3420      ROM_LOAD( "jojoba-simm3.6", 0x00000, 0x200000, CRC(a10ec5af) SHA1(9b403260e8fbdacaa5369ab79fc05855cc6a6bdb) )
 3421      ROM_REGION( 0x200000, "simm3.7", 0 )
 3422      ROM_LOAD( "jojoba-simm3.7", 0x00000, 0x200000, CRC(0bd0de7a) SHA1(1debecda5f282f2a1dd17e887e522a4d00c5dc9d) )
 3423  
 3424      ROM_REGION( 0x200000, "simm4.0", 0 )
 3425      ROM_LOAD( "jojoba-simm4.0", 0x00000, 0x200000, CRC(6ea14adc) SHA1(696b2ec66f3c197817a60f507a1b4c78db37f488) )
 3426      ROM_REGION( 0x200000, "simm4.1", 0 )
 3427      ROM_LOAD( "jojoba-simm4.1", 0x00000, 0x200000, CRC(8f4c42fb) SHA1(363d769b0b066ce139125426d2da6dfa15d1eb28) )
 3428      ROM_REGION( 0x200000, "simm4.2", 0 )
 3429      ROM_LOAD( "jojoba-simm4.2", 0x00000, 0x200000, CRC(ef0586d1) SHA1(8fcc350da20e3e59fa76fa14e10f2c47233ba9dc) )
 3430      ROM_REGION( 0x200000, "simm4.3", 0 )
 3431      ROM_LOAD( "jojoba-simm4.3", 0x00000, 0x200000, CRC(93ccc470) SHA1(5d267679e61c0fb592ad5f696d3c06ec1746d0b3) )
 3432      ROM_REGION( 0x200000, "simm4.4", 0 )
 3433      ROM_LOAD( "jojoba-simm4.4", 0x00000, 0x200000, CRC(3d9ec7d2) SHA1(665b867bab928be183c2006527e55f9b8ec4a271) )
 3434      ROM_REGION( 0x200000, "simm4.5", 0 )
 3435      ROM_LOAD( "jojoba-simm4.5", 0x00000, 0x200000, CRC(03e66850) SHA1(8478662dc9db20d9a186d315a883bd1cbb5e5000) )
 3436      ROM_REGION( 0x200000, "simm4.6", 0 )
 3437      ROM_LOAD( "jojoba-simm4.6", 0x00000, 0x200000, CRC(01606ac3) SHA1(ccc74edeca6abdd86fc1cf42ececa1ea393b3261) )
 3438      ROM_REGION( 0x200000, "simm4.7", 0 )
 3439      ROM_LOAD( "jojoba-simm4.7", 0x00000, 0x200000, CRC(36392b87) SHA1(e62080c8461775c1e180400dfb44414679fd0fc1) )
 3440  
 3441      ROM_REGION( 0x200000, "simm5.0", 0 )
 3442      ROM_LOAD( "jojoba-simm5.0", 0x00000, 0x200000, CRC(2ef8c60c) SHA1(dea87a73a11b8edd27c3c9c5ab2af295cb5508f9) )
 3443      ROM_REGION( 0x200000, "simm5.1", 0 )
 3444      ROM_LOAD( "jojoba-simm5.1", 0x00000, 0x200000, CRC(cf7d7ca6) SHA1(b347707b1e5bc71d28b282273f893592e5f9e333) )
 3445      ROM_REGION( 0x200000, "simm5.2", 0 )
 3446      ROM_LOAD( "jojoba-simm5.2", 0x00000, 0x200000, CRC(b7815bfa) SHA1(0b5a3a2ffe1b3c0ca765dcedc297e78e5928302b) )
 3447      ROM_REGION( 0x200000, "simm5.3", 0 )
 3448      ROM_LOAD( "jojoba-simm5.3", 0x00000, 0x200000, CRC(9bfec049) SHA1(62cc9a1920047863205544b77344ee18f310f084) )
 3449      ROM_REGION( 0x200000, "simm5.4", 0 )
 3450      ROM_LOAD( "jojoba-simm5.4", 0x00000, 0x200000, CRC(d167536b) SHA1(e2637d3486f168ce44e0a00413d38960cb86db4c) )
 3451      ROM_REGION( 0x200000, "simm5.5", 0 )
 3452      ROM_LOAD( "jojoba-simm5.5", 0x00000, 0x200000, CRC(55e7a042) SHA1(c18bda61fa005d9174a27b7b7d324004262a4525) )
 3453      ROM_REGION( 0x200000, "simm5.6", 0 )
 3454      ROM_LOAD( "jojoba-simm5.6", 0x00000, 0x200000, CRC(4fb32906) SHA1(3a5965b3197517932c8aa4c07a6ea6a190a338d7) )
 3455      ROM_REGION( 0x200000, "simm5.7", 0 )
 3456      ROM_LOAD( "jojoba-simm5.7", 0x00000, 0x200000, CRC(8c8be520) SHA1(c461f3f76a83592b36b29afb316679a7c8972404) )
 3457  ROM_END
 3458  
 3459  ROM_START( jojobaner1 )
 3460      ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
 3461      ROM_LOAD( "jojoba_euro_nocd.29f400.u2", 0x000000, 0x080000, CRC(1ee2d679) SHA1(9e129b454a376606b3f7e8aec64de425cf9c635c) )
 3462  
 3463      ROM_REGION( 0x200000, "simm1.0", 0 )
 3464      ROM_LOAD( "jojoba(__990913)-simm1.0", 0x00000, 0x200000, CRC(76976231) SHA1(90adde7e5983ec6a4e02789d5cefe9e85c9c52d5) )
 3465      ROM_REGION( 0x200000, "simm1.1", 0 )
 3466      ROM_LOAD( "jojoba(__990913)-simm1.1", 0x00000, 0x200000, CRC(cedd78e7) SHA1(964988b90a2f14c1da2cfc48d943e16e54da3fd3) )
 3467      ROM_REGION( 0x200000, "simm1.2", 0 )
 3468      ROM_LOAD( "jojoba(__990913)-simm1.2", 0x00000, 0x200000, CRC(2955b77f) SHA1(2a907a5cd91448bfc420c318584e5ef4bbe55a91) )
 3469      ROM_REGION( 0x200000, "simm1.3", 0 )
 3470      ROM_LOAD( "jojoba(__990913)-simm1.3", 0x00000, 0x200000, CRC(280139d7) SHA1(b7c28f6f0218688fb873a3106d2f95ea2e1e927c) )
 3471  
 3472      ROM_REGION( 0x200000, "simm2.0", 0 )
 3473      ROM_LOAD( "jojoba(__990913)-simm2.0", 0x00000, 0x200000, CRC(305c4914) SHA1(c3a73ffe58f61ab8f1cd9e3f0891037638dc5a9b) )
 3474      ROM_REGION( 0x200000, "simm2.1", 0 )
 3475      ROM_LOAD( "jojoba(__990913)-simm2.1", 0x00000, 0x200000, CRC(18af4f3b) SHA1(04b8fdf23a782b10c203b111cc634a6d3474044a) )
 3476      ROM_REGION( 0x200000, "simm2.2", 0 )
 3477      ROM_LOAD( "jojoba(__990913)-simm2.2", 0x00000, 0x200000, CRC(397e5c9e) SHA1(021d86ee66bf951fb6a1dd90fb7007c6865cbb8b) )
 3478      ROM_REGION( 0x200000, "simm2.3", 0 )
 3479      ROM_LOAD( "jojoba(__990913)-simm2.3", 0x00000, 0x200000, CRC(a9d0a7d7) SHA1(b2cfc0661f8903ddbeea8a604ee8b42097e10ab8) )
 3480  
 3481      ROM_REGION( 0x200000, "simm3.0", 0 )
 3482      ROM_LOAD( "jojoba-simm3.0",  0x00000, 0x200000, CRC(4d16e111) SHA1(f198007375be65e89856d64ee2b3857a18b4eab8) )
 3483      ROM_REGION( 0x200000, "simm3.1", 0 )
 3484      ROM_LOAD( "jojoba-simm3.1",  0x00000, 0x200000, CRC(9b3406d3) SHA1(54e90cd334d13e2c74305c6b87ebce1365ef3d59) )
 3485      ROM_REGION( 0x200000, "simm3.2", 0 )
 3486      ROM_LOAD( "jojoba-simm3.2",  0x00000, 0x200000, CRC(f2414997) SHA1(fb89d5784250538ad17fd527267b513afb6eca20) )
 3487      ROM_REGION( 0x200000, "simm3.3", 0 )
 3488      ROM_LOAD( "jojoba-simm3.3",  0x00000, 0x200000, CRC(954b9c7d) SHA1(0d64d97167d4e669d7e4f3a388f9d5ec1e18ed42) )
 3489      ROM_REGION( 0x200000, "simm3.4", 0 )
 3490      ROM_LOAD( "jojoba-simm3.4",  0x00000, 0x200000, CRC(625adc1d) SHA1(533d62759ecece10c711d99bfca403e5cba279b5) )
 3491      ROM_REGION( 0x200000, "simm3.5", 0 )
 3492      ROM_LOAD( "jojoba-simm3.5",  0x00000, 0x200000, CRC(20a70bb4) SHA1(3bd8376304ffc974fb8031eac8bebff27969538c) )
 3493      ROM_REGION( 0x200000, "simm3.6", 0 )
 3494      ROM_LOAD( "jojoba-simm3.6",  0x00000, 0x200000, CRC(a10ec5af) SHA1(9b403260e8fbdacaa5369ab79fc05855cc6a6bdb) )
 3495      ROM_REGION( 0x200000, "simm3.7", 0 )
 3496      ROM_LOAD( "jojoba-simm3.7",  0x00000, 0x200000, CRC(0bd0de7a) SHA1(1debecda5f282f2a1dd17e887e522a4d00c5dc9d) )
 3497  
 3498      ROM_REGION( 0x200000, "simm4.0", 0 )
 3499      ROM_LOAD( "jojoba-simm4.0",  0x00000, 0x200000, CRC(6ea14adc) SHA1(696b2ec66f3c197817a60f507a1b4c78db37f488) )
 3500      ROM_REGION( 0x200000, "simm4.1", 0 )
 3501      ROM_LOAD( "jojoba-simm4.1",  0x00000, 0x200000, CRC(8f4c42fb) SHA1(363d769b0b066ce139125426d2da6dfa15d1eb28) )
 3502      ROM_REGION( 0x200000, "simm4.2", 0 )
 3503      ROM_LOAD( "jojoba-simm4.2",  0x00000, 0x200000, CRC(ef0586d1) SHA1(8fcc350da20e3e59fa76fa14e10f2c47233ba9dc) )
 3504      ROM_REGION( 0x200000, "simm4.3", 0 )
 3505      ROM_LOAD( "jojoba-simm4.3",  0x00000, 0x200000, CRC(93ccc470) SHA1(5d267679e61c0fb592ad5f696d3c06ec1746d0b3) )
 3506      ROM_REGION( 0x200000, "simm4.4", 0 )
 3507      ROM_LOAD( "jojoba-simm4.4",  0x00000, 0x200000, CRC(3d9ec7d2) SHA1(665b867bab928be183c2006527e55f9b8ec4a271) )
 3508      ROM_REGION( 0x200000, "simm4.5", 0 )
 3509      ROM_LOAD( "jojoba-simm4.5",  0x00000, 0x200000, CRC(03e66850) SHA1(8478662dc9db20d9a186d315a883bd1cbb5e5000) )
 3510      ROM_REGION( 0x200000, "simm4.6", 0 )
 3511      ROM_LOAD( "jojoba-simm4.6",  0x00000, 0x200000, CRC(01606ac3) SHA1(ccc74edeca6abdd86fc1cf42ececa1ea393b3261) )
 3512      ROM_REGION( 0x200000, "simm4.7", 0 )
 3513      ROM_LOAD( "jojoba-simm4.7",  0x00000, 0x200000, CRC(36392b87) SHA1(e62080c8461775c1e180400dfb44414679fd0fc1) )
 3514  
 3515      ROM_REGION( 0x200000, "simm5.0", 0 )
 3516      ROM_LOAD( "jojoba-simm5.0",  0x00000, 0x200000, CRC(2ef8c60c) SHA1(dea87a73a11b8edd27c3c9c5ab2af295cb5508f9) )
 3517      ROM_REGION( 0x200000, "simm5.1", 0 )
 3518      ROM_LOAD( "jojoba-simm5.1",  0x00000, 0x200000, CRC(cf7d7ca6) SHA1(b347707b1e5bc71d28b282273f893592e5f9e333) )
 3519      ROM_REGION( 0x200000, "simm5.2", 0 )
 3520      ROM_LOAD( "jojoba-simm5.2",  0x00000, 0x200000, CRC(b7815bfa) SHA1(0b5a3a2ffe1b3c0ca765dcedc297e78e5928302b) )
 3521      ROM_REGION( 0x200000, "simm5.3", 0 )
 3522      ROM_LOAD( "jojoba-simm5.3",  0x00000, 0x200000, CRC(9bfec049) SHA1(62cc9a1920047863205544b77344ee18f310f084) )
 3523      ROM_REGION( 0x200000, "simm5.4", 0 )
 3524      ROM_LOAD( "jojoba-simm5.4",  0x00000, 0x200000, CRC(d167536b) SHA1(e2637d3486f168ce44e0a00413d38960cb86db4c) )
 3525      ROM_REGION( 0x200000, "simm5.5", 0 )
 3526      ROM_LOAD( "jojoba-simm5.5",  0x00000, 0x200000, CRC(55e7a042) SHA1(c18bda61fa005d9174a27b7b7d324004262a4525) )
 3527      ROM_REGION( 0x200000, "simm5.6", 0 )
 3528      ROM_LOAD( "jojoba-simm5.6",  0x00000, 0x200000, CRC(4fb32906) SHA1(3a5965b3197517932c8aa4c07a6ea6a190a338d7) )
 3529      ROM_REGION( 0x200000, "simm5.7", 0 )
 3530      ROM_LOAD( "jojoba-simm5.7",  0x00000, 0x200000, CRC(8c8be520) SHA1(c461f3f76a83592b36b29afb316679a7c8972404) )
 3531  ROM_END
 3532  
 3533  
 3534  /*****************************************************************************************
 3535    CPS3 game region / special flag information
 3536  *****************************************************************************************/
 3537  
 3538  /*****************************************************************************************
 3539  
 3540      Red Earth / Warzard
 3541  
 3542      JAPAN 1
 3543      ASIA 2
 3544      EURO 3
 3545      USA 4
 3546      HISPANIC 5
 3547      BRAZIL 6
 3548      OCEANIA 7
 3549      ASIA NCD 8
 3550  
 3551      UINT32 *rom =  (UINT32*)machine.root_device().memregion ( "user1" )->base();
 3552      rom[0x1fed8/4]^=0x00000001; // clear region to 0 (invalid)
 3553      rom[0x1fed8/4]^=0x00000008; // region 8 - ASIA NO CD - doesn't actually skip the CD
 3554                                  // test on startup, only during game, must be another flag
 3555                                  // somewhere too, and we don't have any actual NCD dumps
 3556                                  // to compare (or it expects SCSI to report there being
 3557                                  // no cd drive?)
 3558  
 3559  *****************************************************************************************/
 3560  
 3561  /*****************************************************************************************
 3562  
 3563      Street Fighter III: New Generation
 3564  
 3565      JAPAN 1
 3566      ASIA NCD 2
 3567      EURO 3
 3568      USA 4
 3569      HISPANIC 5
 3570      BRAZIL 6
 3571      OCEANIA 7
 3572      ASIA 8
 3573  
 3574      // bios rom also lists korea, but game rom does not.
 3575  
 3576      UINT32 *rom =  (UINT32*)machine.root_device().memregion ( "user1" )->base();
 3577      rom[0x1fec8/4]^=0x00000001; // region (clear region)
 3578      rom[0x1fec8/4]^=0x00000008; // region
 3579      rom[0x1fecc/4]^=0x01000000; // nocd - this ONLY skips the cd check in the bios test
 3580                                  // menu is region is ASIA NCD, otherwise it will report
 3581                                  // NG, Asia was probably the only NCD region for this
 3582  
 3583  *****************************************************************************************/
 3584  
 3585  /*****************************************************************************************
 3586  
 3587      Street Fighter III 2nd Impact: Giant Attack
 3588  
 3589      JAPAN 1
 3590      ASIA NCD 2
 3591      EURO 3
 3592      USA 4
 3593      HISPANIC 5
 3594      BRAZIL 6
 3595      OCEANIA 7
 3596      ASIA 8
 3597  
 3598      UINT32 *rom =  (UINT32*)machine.root_device().memregion ( "user1" )->base();
 3599      rom[0x1fec8/4]^=0x00000001; // region (clear region)
 3600      rom[0x1fec8/4]^=0x00000008; // region
 3601      rom[0x1fecc/4]^=0x01000000; // nocd - this ONLY skips the cd check in the bios test
 3602                                  // menu is region is ASIA NCD, otherwise it will report
 3603                                  // NG, Asia was probably the only NCD region for this
 3604  
 3605  *****************************************************************************************/
 3606  
 3607  /*****************************************************************************************
 3608  
 3609      JoJo's Venture / JoJo no Kimyou na Bouken
 3610  
 3611      XXXXXX 0
 3612      JAPAN 1
 3613      ASIA 2
 3614      EURO 3
 3615      USA 4
 3616      HISPANIC 5
 3617      BRAZIL 6
 3618      OCEANIA 7
 3619  
 3620      DEVELOPMENT VERSION add 0x70 mask!
 3621  
 3622      UINT32 *rom =  (UINT32*)machine.root_device().memregion ( "user1" )->base();
 3623      rom[0x1fec8/4]^=0x00000001; // region hack (clear jpn)
 3624  
 3625      rom[0x1fec8/4]^=0x00000004; // region
 3626      rom[0x1fec8/4]^=0x00000070; // DEV mode
 3627      rom[0x1fecc/4]^=0x01000000; // nocd
 3628  
 3629  *****************************************************************************************/
 3630  
 3631  /*****************************************************************************************
 3632  
 3633      Street Fighter III 3rd Strike: Fight for the Future
 3634  
 3635      JAPAN 1
 3636      ASIA 2
 3637      EURO 3
 3638      USA 4
 3639      HISPANIC 5
 3640      BRAZIL 6
 3641      OCEANIA 7
 3642  
 3643      UINT32 *rom =  (UINT32*)machine.root_device().memregion ( "user1" )->base();
 3644      rom[0x1fec8/4]^=0x00000004; // region (clear region)
 3645      rom[0x1fec8/4]^=0x00000001; // region
 3646      rom[0x1fecc/4]^=0x01000000; // nocd
 3647  
 3648  *****************************************************************************************/
 3649  
 3650  /*****************************************************************************************
 3651  
 3652      JoJo's Bizarre Adventure / JoJo no Kimyou na Bouken: Mirai e no Isan
 3653  
 3654      XXXXXX 0
 3655      JAPAN 1
 3656      ASIA 2
 3657      EURO 3
 3658      USA 4
 3659      HISPANIC 5
 3660      BRAZIL 6
 3661      OCEANIA 7
 3662  
 3663      DEVELOPMENT VERSION add 0x70 mask!
 3664  
 3665      UINT32 *rom =  (UINT32*)machine.root_device().memregion ( "user1" )->base();
 3666      rom[0x1fec8/4]^=0x00000001; // region (clear jpn)
 3667      rom[0x1fec8/4]^=0x00000002; // region
 3668      rom[0x1fec8/4]^=0x00000070; // DEV mode
 3669      rom[0x1fecc/4]^=0x01000000; // nocd
 3670  
 3671  *****************************************************************************************/
 3672  
 3673  /* Red Earth / Warzard */
 3674  
 3675  // 961121
 3676  GAME( 1996, redearth,  0,        redearth, cps3_re, cps3_state,   redearth, ROT0, "Capcom", "Red Earth (Euro 961121)", GAME_IMPERFECT_GRAPHICS )
 3677  GAME( 1996, warzard,   redearth, redearth, cps3_re, cps3_state,   redearth, ROT0, "Capcom", "Warzard (Japan 961121)", GAME_IMPERFECT_GRAPHICS )
 3678  
 3679  // 961023
 3680  GAME( 1996, redearthr1,redearth, redearth, cps3_re, cps3_state,   redearth, ROT0, "Capcom", "Red Earth (Euro 961023)", GAME_IMPERFECT_GRAPHICS )
 3681  GAME( 1996, warzardr1, redearth, redearth, cps3_re, cps3_state,   redearth, ROT0, "Capcom", "Warzard (Japan 961023)", GAME_IMPERFECT_GRAPHICS )
 3682  
 3683  /* Street Fighter III: New Generation */
 3684  
 3685  // 970403
 3686  // not dumped
 3687  
 3688  // 970312
 3689  // not dumped
 3690  
 3691  // 970204
 3692  GAME( 1997, sfiii,     0,        sfiii,    cps3, cps3_state,      sfiii,    ROT0, "Capcom", "Street Fighter III: New Generation (USA 970204)", GAME_IMPERFECT_GRAPHICS )
 3693  GAME( 1997, sfiiij,    sfiii,    sfiii,    cps3, cps3_state,      sfiii,    ROT0, "Capcom", "Street Fighter III: New Generation (Japan 970204)", GAME_IMPERFECT_GRAPHICS )
 3694  GAME( 1997, sfiiih,    sfiii,    sfiii,    cps3, cps3_state,      sfiii,    ROT0, "Capcom", "Street Fighter III: New Generation (Hispanic 970204)", GAME_IMPERFECT_GRAPHICS )
 3695  GAME( 1997, sfiiin,    sfiii,    sfiii,    cps3, cps3_state,      sfiii,    ROT0, "Capcom", "Street Fighter III: New Generation (Asia 970204, NO CD)", GAME_IMPERFECT_GRAPHICS )
 3696  
 3697  /* Street Fighter III 2nd Impact: Giant Attack */
 3698  
 3699  // 971016
 3700  // not dumped
 3701  
 3702  // 970930
 3703  GAME( 1997, sfiii2,    0,        sfiii2,   cps3, cps3_state,      sfiii2,   ROT0, "Capcom", "Street Fighter III 2nd Impact: Giant Attack (USA 970930)", GAME_IMPERFECT_GRAPHICS )
 3704  GAME( 1997, sfiii2j,   sfiii2,   sfiii2,   cps3, cps3_state,      sfiii2,   ROT0, "Capcom", "Street Fighter III 2nd Impact: Giant Attack (Japan 970930)", GAME_IMPERFECT_GRAPHICS )
 3705  GAME( 1997, sfiii2n,   sfiii2,   sfiii2,   cps3, cps3_state,      sfiii2,   ROT0, "Capcom", "Street Fighter III 2nd Impact: Giant Attack (Asia 970930, NO CD)", GAME_IMPERFECT_GRAPHICS )
 3706  
 3707  /* JoJo's Venture / JoJo no Kimyou na Bouken */
 3708  
 3709  // 990128
 3710  GAME( 1998, jojo,      0,        jojo,     cps3_jojo, cps3_state, jojo,     ROT0, "Capcom", "JoJo's Venture (USA 990128)", GAME_IMPERFECT_GRAPHICS )
 3711  GAME( 1998, jojoj,     jojo,     jojo,     cps3_jojo, cps3_state, jojo,     ROT0, "Capcom", "JoJo no Kimyou na Bouken (Japan 990128)", GAME_IMPERFECT_GRAPHICS )
 3712  GAME( 1998, jojon,     jojo,     jojo,     cps3_jojo, cps3_state, jojo,     ROT0, "Capcom", "JoJo's Venture (Asia 990128, NO CD)", GAME_IMPERFECT_GRAPHICS )
 3713  
 3714  // 990108
 3715  GAME( 1998, jojor1,    jojo,     jojo,     cps3_jojo, cps3_state, jojo,     ROT0, "Capcom", "JoJo's Venture (USA 990108)", GAME_IMPERFECT_GRAPHICS )
 3716  GAME( 1998, jojojr1,   jojo,     jojo,     cps3_jojo, cps3_state, jojo,     ROT0, "Capcom", "JoJo no Kimyou na Bouken (Japan 990108)", GAME_IMPERFECT_GRAPHICS )
 3717  GAME( 1998, jojonr1,   jojo,     jojo,     cps3_jojo, cps3_state, jojo,     ROT0, "Capcom", "JoJo's Venture (Asia 990108, NO CD)", GAME_IMPERFECT_GRAPHICS )
 3718  
 3719  // 981202
 3720  GAME( 1998, jojor2,    jojo,     jojo,     cps3_jojo, cps3_state, jojo,     ROT0, "Capcom", "JoJo's Venture (USA 981202)", GAME_IMPERFECT_GRAPHICS )
 3721  GAME( 1998, jojojr2,   jojo,     jojo,     cps3_jojo, cps3_state, jojo,     ROT0, "Capcom", "JoJo no Kimyou na Bouken (Japan 981202)", GAME_IMPERFECT_GRAPHICS )
 3722  GAME( 1998, jojonr2,   jojo,     jojo,     cps3_jojo, cps3_state, jojo,     ROT0, "Capcom", "JoJo's Venture (Asia 981202, NO CD)", GAME_IMPERFECT_GRAPHICS )
 3723  
 3724  /* Street Fighter III 3rd Strike: Fight for the Future */
 3725  
 3726  // 990608
 3727  GAME( 1999, sfiii3,    0,        sfiii3,   cps3, cps3_state,      sfiii3,   ROT0, "Capcom", "Street Fighter III 3rd Strike: Fight for the Future (Euro 990608)", GAME_IMPERFECT_GRAPHICS )
 3728  GAME( 1999, sfiii3u,   sfiii3,   sfiii3,   cps3, cps3_state,      sfiii3,   ROT0, "Capcom", "Street Fighter III 3rd Strike: Fight for the Future (USA 990608)", GAME_IMPERFECT_GRAPHICS )
 3729  GAME( 1999, sfiii3n,   sfiii3,   sfiii3,   cps3, cps3_state,      sfiii3,   ROT0, "Capcom", "Street Fighter III 3rd Strike: Fight for the Future (Japan 990608, NO CD)", GAME_IMPERFECT_GRAPHICS )
 3730  
 3731  // 990512
 3732  GAME( 1999, sfiii3r1,  sfiii3,   sfiii3,   cps3, cps3_state,      sfiii3,   ROT0, "Capcom", "Street Fighter III 3rd Strike: Fight for the Future (Euro 990512)", GAME_IMPERFECT_GRAPHICS )
 3733  GAME( 1999, sfiii3ur1, sfiii3,   sfiii3,   cps3, cps3_state,      sfiii3,   ROT0, "Capcom", "Street Fighter III 3rd Strike: Fight for the Future (USA 990512)", GAME_IMPERFECT_GRAPHICS )
 3734  GAME( 1999, sfiii3nr1, sfiii3,   sfiii3,   cps3, cps3_state,      sfiii3,   ROT0, "Capcom", "Street Fighter III 3rd Strike: Fight for the Future (Japan 990512, NO CD)", GAME_IMPERFECT_GRAPHICS )
 3735  
 3736  /* JoJo's Bizarre Adventure / JoJo no Kimyou na Bouken: Mirai e no Isan */
 3737  
 3738  // 990927
 3739  GAME( 1999, jojoba,    0,        jojoba,   cps3_jojo, cps3_state, jojoba,   ROT0, "Capcom", "JoJo no Kimyou na Bouken: Mirai e no Isan (Japan 990927)", GAME_IMPERFECT_GRAPHICS )
 3740  GAME( 1999, jojoban,   jojoba,   jojoba,   cps3_jojo, cps3_state, jojoba,   ROT0, "Capcom", "JoJo no Kimyou na Bouken: Mirai e no Isan (Japan 990927, NO CD)", GAME_IMPERFECT_GRAPHICS )
 3741  GAME( 1999, jojobane,  jojoba,   jojoba,   cps3_jojo, cps3_state, jojoba,   ROT0, "Capcom", "JoJo's Bizarre Adventure (Euro 990927, NO CD)", GAME_IMPERFECT_GRAPHICS )
 3742  
 3743  // 990913
 3744  GAME( 1999, jojobar1,  jojoba,   jojoba,   cps3_jojo, cps3_state, jojoba,   ROT0, "Capcom", "JoJo no Kimyou na Bouken: Mirai e no Isan (Japan 990913)", GAME_IMPERFECT_GRAPHICS )
 3745  GAME( 1999, jojobanr1, jojoba,   jojoba,   cps3_jojo, cps3_state, jojoba,   ROT0, "Capcom", "JoJo no Kimyou na Bouken: Mirai e no Isan (Japan 990913, NO CD)", GAME_IMPERFECT_GRAPHICS )
 3746  GAME( 1999, jojobaner1,jojoba,   jojoba,   cps3_jojo, cps3_state, jojoba,   ROT0, "Capcom", "JoJo's Bizarre Adventure (Euro 990913, NO CD)", GAME_IMPERFECT_GRAPHICS )