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

    1  /* Triforce Skeleton
    2   -- split from Naomi.c
    3  
    4   Triforce uses
    5  
    6  a stock Gamecube motherboard with custom Bios
    7  a 'media board' which acts as a CD/DVD emulator
    8  the Naomi 'DIMM' board, which connects to the GD-ROM drive
    9  
   10  Sega Triforce Hardware Overview
   11  Sega/Namco/Nintendo 2002-2006
   12  -----------------------------
   13  
   14  This is a GameCube-based system containing several PCBs mounted inside a metal box.
   15  There are two versions. One is for GDROM-based games and the other is customised for
   16  use with Namco ROM carts.
   17  
   18  
   19  Games on this system include....
   20  
   21     Game                                                      Manufacturer              Media             Key Chip
   22  +-+---------------------------------------------------------+-------------------------+-----------------+--------------|
   23  | |Donkey Kong Jungle Fever                                 | Namco / Nintendo, 2005  | ROM Cart        | ?            |
   24  |*|Mario Kart Arcade GP                                     | Namco / Nintendo, 2005  | ROM Cart        | 317-5109-COM |
   25  | |Mario Kart Arcade GP 2                                   | Namco / Nintendo, 2007  | ROM Cart        | ?            |
   26  |*|Virtua Striker 2002 (Japan)                              | Sega, 2002              | GDROM GDT-0001  | 317-0337-JPN |
   27  |*|Virtua Striker 2002 (Export)                             | Sega, 2002              | GDROM GDT-0002  | 317-0337-EXP |
   28  | |F-Zero AX                                                | Sega / Nintendo, 2003   | GDROM GDT-0004  | ?            |
   29  |*|The Key Of Avalon: The Wizard Master (server) (Rev C)    | Sega, 2003              | GDROM GDT-0005C | ?            |
   30  | |The Key Of Avalon: The Wizard Master (client) (Rev C)    | Sega, 2003              | GDROM GDT-0006C | ?            |
   31  |*|Gekitou Pro Yakyuu (Rev C)                               | Sega, 2003              | GDROM GDT-0008C | 317-0371-JPN |
   32  |*|The Key Of Avalon 1.30: Chaotic Sabbat (server) (Rev C)  | Sega, 2004              | GDROM GDT-0009C | ?            |
   33  |*|The Key Of Avalon 1.30: Chaotic Sabbat (client) (Rev C)  | Sega, 2004              | GDROM GDT-0010C | ?            |
   34  |*|Firmware Update                                          | Sega, 2004              | GDROM GDT-0011  | ?            |
   35  |*|Virtua Striker 4 (Japan) (Rev E)                         | Sega, 2004              | GDROM GDT-0013E | 317-0391-JPN |
   36  |*|Virtua Striker 4 (Export)                                | Sega, 2004              | GDROM GDT-0015  | 317-0393-EXP |
   37  | |The Key Of Avalon 2: Eutaxy Commandment (server)         | Sega, 2004              | GDROM GDT-0016  | ?            |
   38  |*|The Key Of Avalon 2: Eutaxy Commandment (client) (Rev B) | Sega, 2004              | GDROM GDT-0017B | ?            |
   39  |*|Virtua Striker 4 Ver.2006 (Japan) (Rev D)                | Sega, 2006              | GDROM GDT-0020D | ?            |
   40  | |Virtua Striker 4 Ver.2006 (Export)                       | Sega, 2006              | GDROM GDT-0021  | ?            |
   41  | |F-Zero AX - Monster Ride Cycraft Edition                 | Sega / Nintendo, 2004   | GDROM ?         | ?            |
   42  | |The Key Of Avalon 1.10                                   | Sega, 2003              | GDROM ?         | ?            |
   43  | |The Key Of Avalon 1.20: Summon The New Monster           | Sega, 2003              | GDROM ?         | ?            |
   44  | |The Key Of Avalon 2.5: War of the Key                    | Sega, 2005              | GDROM ?         | ?            |
   45  | |Donkey Kong:Banana Kingdom                               | Namco / Nintendo, 2006  | ROM Cart ?      | ?            |
   46  | |Starfox Armada (planned, but not released)               | Namco / Nintendo, 2002? | ?               | ?            |
   47  +-+---------------------------------------------------------+-------------------------+-----------------+--------------+
   48  * denotes these games are archived.
   49  If you can help with the undumped games or know of missing Triforce games, please contact...
   50  http://guru.mameworld.info/
   51  
   52  
   53  PCB Layouts
   54  ===========
   55  
   56  
   57  Network Board (top)
   58  -------------
   59  
   60  This board is not used on the older Triforce version
   61  
   62  837-14341
   63  171-8226C SEGA 2002
   64  |----------------------------|
   65  |           LLLL     070XZ1H |
   66  |           JP1    K4S643232 |
   67  |           JP2    24LC04    |
   68  |      25MHz        32.768kHz|
   69  |CN7   L80227/B        12MHz |
   70  |      LL          |------|  |
   71  |                  |AMD   |  |
   72  |      CN1         |AU1500|  |
   73  |      CN2         |------|  |
   74  |                   FLASH.IC2|
   75  |CN4      ADM3222            |
   76  |     JP4 ADM3222            |
   77  |LL   JP3 ADM3222            |
   78  |----------------------------|
   79  Notes:
   80        AMD AU1500 - AMD AU1500-333MBD MIPS32-compatible CPU (BGA424)
   81        K4S643232  - Samsung K4S643232H-UC60 512k x 32bit x 4 banks (64 MBit) Synchronous DRAM LVTTL,
   82                     3.3V, 222MHz (TSOPII-86)
   83        ADM3222    - Analog Devices ADM3222 High-Speed, +3.3V, 2-Channel RS232/V.28 Interface Device
   84                     with 460kBPS Data Rate and Shutdown and Enable Pins (SOIC20)
   85        24LC04     - Microchip 24LC04B 2x256x8 (4kbit) Serial EEPROM (SOIC8)
   86        FLASH.IC2  - ST Microelectronics M29W160ET 2M x8 (16 MBit) Flash ROM (TSOP48)
   87                      - Namco ROM cart version stamped 'FPR24274'
   88                      - Sega GDROM version stamped 'FPR24036'
   89        L80277/B   - LSI Logic L80227/B 10BASE-T/100BASE-TX Ethernet Network IC (QFP48)
   90        070XZ1H    - Sharp 070XZ1H Voltage Regulator
   91        CN1/CN2    - Connectors joining to Media Board (2nd Board)
   92        CN7        - RJ45 LAN Port A
   93        CN4        - DB9 Serial Port
   94        JP1        - 1-2
   95        JP2        - 1-2
   96        JP3        - 2-3
   97        JP4        - 2-3
   98        L          - LEDs
   99  
  100  
  101  Media Boards
  102  ------------
  103  
  104  Sega GDROM-specific older version without DIMM Board (Top Board)
  105  This version requires a separate standard Sega DIMM Board (same as used on NAOMI)
  106  This was probably used only for the very early titles like Virtua Striker 2002
  107  
  108  837-14291 SEGA 2002
  109  171-8209B
  110              |--------------------------------------|
  111              |                             LLLLLLLL |
  112              |    DIP42                             |----------|
  113              |                      EPC1PC8       JP4  JP2  LL |
  114              |                                       JP3  JP1  |
  115  |-----------|                                                 |
  116  |                        54MHz                  CN2           |
  117  |                      |-----------|                          |
  118  |    FLASH.IC4         |ALTERA     |                          |
  119  |                      |ACEX       |    CN5S                  |
  120  |                      |EP1K50QC208|                          |
  121  |                      |           |                          |
  122  |      070XZ1H         |-----------|                          |
  123  |                                                             |
  124  |                             32.9MHz                         |
  125  |                                                             |
  126  |CN6S                                                         |
  127  |             CN3                               CN1           |
  128  |-------------------------------------------------------------|
  129  Notes:
  130        ACEX      - Altera ACEX EP1K50QC208 FPGA (QFP208)
  131        EPC1PC8   - Altera EPC1PC8 One Time Programmable FPGA Configuration Device (DIP8)
  132                     - Sticker '315-6343P'
  133        FLASH.IC4 - ST Microelectronics M29W160ET 2M x8 (16 MBit) Flash ROM (TSOP48)
  134                     - Stamped 'FPR23910'
  135        DIP42     - DIP42 location for M27C160 2M x8 (16 MBit) EPROM (not populated)
  136        CN1/2/3   - Connectors for GDROM DIMM Board
  137        070XZ1H   - Sharp 070XZ1H Voltage Regulator
  138        CN5S      - Connector joining to GameCube PCB (located under the PCB)
  139        CN6S      - Connector joining to JVS Filter Board (located under the PCB)
  140        JPx       - Jumpers. All positioned to 2-3
  141        L         - LEDs
  142  
  143  
  144  Newer Square Metal Box Version (2nd Board down)
  145  
  146  837-14355 SEGA 2002 (Sega GDROM version)
  147  837-14356 SEGA 2002 (Namco ROM cart version)
  148  171-8232A (Namco ROM cart version)
  149  171-8231C (Sega GDROM version)
  150  837-14356R91 (sticker for Namco ROM cart version)
  151  837-14355-92 (sticker for Sega GDROM version)
  152              |----|----------|-----------------------------|
  153              |    |PIC16C621 |            50HONDA  SD_CARD |
  154              |    |   4MHz   |    CN6     LED              |---|
  155              |    |----------|                                 |
  156              |  DSW  3771                 50MHz                |
  157  |-----------|                                                 |
  158  |LED                                                          |
  159  |LED                       |-----------|                      |
  160  |    FLASH.IC2             |   SEGA    |                      |
  161  |                 DIP42    | 315-6347A |    CN1S         CN3  |
  162  |LED  71V016               |           |                      |
  163  |LED                       |           |                      |
  164  |                          |-----------|                      |
  165  |                                                             |
  166  |                                                             |
  167  |       CN8                                                   |
  168  |       CN9                               070XZ1H             |
  169  |CN2S                                                     CN12|
  170  |-------------------------------------------------------------|
  171  Notes:
  172        315-6347A - Sega custom IC (BGA). Sega GDROM version uses 315-6347
  173        71V016    - IDT 71V016SA 64k x 16-bit (1 MBit) 3.3V CMOS Static RAM (TSOP44)
  174                    This chip is located under the PCB
  175        FLASH.IC2 - ST Microelectronics M29W160ET 2M x8 (16 MBit) Flash ROM (TSOP48)
  176                     - Namco ROM cart version stamped 'FPR24331'
  177                     - Sega GDROM version stamped 'FPR24035'
  178        DIP42     - DIP42 location for M27C160 2M x8 (16 MBit) EPROM (not populated)
  179        CN8/CN9   - Connectors joining to network PCB
  180        070XZ1H   - Sharp 070XZ1H Voltage Regulator
  181        SD_CARD   - Standard SD Card slot (present only on Namco ROM cart version PCB, unused on Mario Kart)
  182        50HONDA   - 50-pin mini Honda connector for connection of standard Sega GDROM unit for GDROM-based games only.
  183                     - This connector is not present on the Namco ROM cart version of this PCB
  184        CN1S      - Connector joining to GameCube PCB (located under the PCB)
  185        CN2S      - Connector joining to JVS Filter Board (located under the PCB)
  186        CN3       - Connector for ROM cartridge.
  187                     - Replaced by 2x 168-pin DIMM Memory Slots on GDROM-based version
  188        CN6       - 40 pin IDC flat cable connector (unused)
  189        CN12      - 3-pin battery connector, present only on Sega GDROM version PCB
  190        DSW       - 2-position DIP Switch, present only on Sega GDROM version PCB
  191        PIC16C621 - DIP18 socket and 4MHz OSC on a 90-degrees-mounted small PCB for
  192                    Microchip PIC16C621A protection key chip
  193  
  194   ? ? ? ? ? ? ? ? ?Usage:
  195   ? ? ? ? ? ? ? ? ?+-----------------------+-----------------+----------------+
  196   ? ? ? ? ? ? ? ? ?| ? ? ? ? ? ? ? ? ? ? ? | ? ? ? ? ? ? ? ? | Sega Security ?|
  197   ? ? ? ? ? ? ? ? ?| Game ? ? ? ? ? ? ? ? ?| Sticker ? ? ? ? | Part Number ? ?|
  198   ? ? ? ? ? ? ? ? ?+-----------------------+-----------------+----------------+
  199   ? ? ? ? ? ? ? ? ?| Mario Kart Arcade GP ?| 253-5509-5109 ? | 317-5109-COM ? |
  200   ? ? ? ? ? ? ? ? ?| Nintendo/Namco, 2005 ?| ? ? ? ? ? ? ? ? | ? ? ? ? ? ? ? ?|
  201   ? ? ? ? ? ? ? ? ?| ? ? ? ? ? ? ? ? ? ? ? | ? ? ? ? ? ? ? ? | ? ? ? ? ? ? ? ?|
  202   ? ? ? ? ? ? ? ? ?| Namco Code: MKA2Ver.B | ? ? ? ? ? ? ? ? | ? ? ? ? ? ? ? ?|
  203   ? ? ? ? ? ? ? ? ?+-----------------------+-----------------+----------------+
  204  
  205  ROM Board (attached to CN3 of Media Board, ONLY for use with Namco ROM cart version of the Media Board)
  206  ---------
  207  
  208  837-14343 SEGA 2002
  209  171-8228D
  210  837-14343R4S0 (sticker)
  211  |---------------|
  212  | FLASH.IC6     |
  213  | *FLASH.8S     |
  214  | FLASH.IC2     |
  215  | *FLASH.4S     |
  216  | PFLASH.IC9    |
  217  | |-------|     |
  218  | |*Actel |     |
  219  | |ProASIC|     |
  220  | |-------|*CN1S|
  221  |LCX138         |
  222  |     50MHz     |
  223  |               |
  224  |               |
  225  | FLASH.IC1     |
  226  | *FLASH.IC3S   |
  227  | FLASH.IC5     |
  228  | *FLASH.IC7S   |
  229  |CN2            |
  230  |---------------|
  231  Notes:
  232           * - These parts on other side of PCB
  233   FLASH.ICx - (except IC9) Samsung K9F1208U0B 512MBit (64Mx8) 3.0V NAND Flash ROM (TSOP48)
  234   FLASH.IC9 - Macronix 29LV400CTTC-70G 4MBit (512k x8 / 256k x16) 3V FLASH ROM (TSOP48)
  235        CN1S - Connector joining to Media Board (located under the PCB)
  236         CN2 - 10-pin JTAG Connector for reprogramming the FPGA (all JTAG connectors and required support parts are not populated)
  237     ProASIC - Actel ProASIC Plus APA075 TQG100 75000 Gate FPGA stamped '315-6419B' (TQFP100)
  238  
  239  
  240  Main Board (GameCube)
  241  ----------
  242  
  243  This is a standard Nintendo GameCube mainboard.
  244  Any GameCube mainboard or any version from any of the Triforce units will work.
  245  Note! The hardware specifications are IDENTICAL to any common GameCube. See
  246  http://hitmen.c02.at/files/yagcd/yagcd/frames.html for further detailed documentation.
  247  
  248  DOL-CPU-10 (Sega Triforce)
  249  DOL-CPU-20 (Namco Triforce)
  250  838-14297  (Sticker)
  251  |----------------------------------------|
  252  |070XZ1H   MS3M32B    MS3M32B            |
  253  |D4891281                                |
  254  |P10                                     |
  255  |           |-----------|       P9     P5|
  256  |           | FLIPPER A |                |
  257  |           |2001 NINTENDO               |
  258  |P7         |ATI  NEC   |                |
  259  | AVE_N-DOL |D8926F2011 |RTC_AM-DOL    P3|
  260  |           |-----------|   32.768kHz    |
  261  |                                        |
  262  |   AMP-DOL                              |
  263  |P2           |-------|          P6    P4|
  264  |  CLK_B-DOL  |IBM    |                  |
  265  |  D135       |GEKKO  |                  |
  266  |  P1         |-------|         P8       |
  267  |----------------------------------------|
  268  Notes:
  269        070XZ1H    - Sharp 070XZ1H Voltage Regulator
  270        D4891281   - NEC D4891281G5 0125XU621 16MB ARAM Auxiliary/DSP DRAM, clocked at 81MHz (SSOP54)
  271        FLIPPER A  - Custom NEC/ATI Flipper Chip, clocked at 162MHz (large BGA)
  272                     Contains (something like)....
  273                               MX92L832 32 Poly Phony Sound Generator
  274                               MX96037 16bit DSP Controller
  275                               Custom ATI GFX controller
  276                               2MB of fast 1T-SRAM memory
  277        IBM GEKKO  - Custom IBM PowerPC 750-derivative 'Gekko' CPU with FPU extensions clocked at 486MHz (large BGA)
  278                     Full markings..... IBM
  279                                        45L8926ESD
  280                                        IBM9314PQ
  281                                        (C)IBM 2000
  282                                        PPCDBK-EFB486X3
  283                                        J1900LPB  GE
  284        MS3M32B    - MoSys MS3M32B-5 B 12MB 1-T SRAM, clocked at 162MHz (x2, BGA)
  285        AVE_N-DOL  - Rohm BU9949FS AV Encoder stamped 'AVE N-DOL' (SSOP32)
  286        AMP-DOL    - Amplifier chip stamped 'AMP-DOL' (SOIC14)
  287        RTC_AM-DOL - Macronix 1R7459A1 Real Time Clock, also contains the GameCube BIOS in some kind of on-chip serial EEPROM (SOIC14)
  288        CLK_B-DOL  - Macronix B021954 CLK B-DOL Clock Generator (SOIC14)
  289        D135       - Crystal at 13.5MHz. Most likely clocks generated are....
  290                     Gekko:    13.5 x36 = 486MHz
  291                     Flipper:  13.5 x12 = 162MHz
  292                     1-T SRAM: 13.5 x12 = 162MHz
  293                     16M ARAM: 13.5 x6  = 81MHz
  294        P1         - Motherboard Power Connector (located under the PCB)
  295        P2         - Digital Video Output Connector (not used)
  296        P3         - Controller Pad Board Connector (tied to lower PCB to J8 with a small flat cable)
  297        P4         - Memory Card Slot Connector A  \ (not used)
  298        P5         - Memory Card Slot Connector B  /
  299        P6         - Serial Port Connector 1 (located under the PCB, tied to a plug/cable that leads to J10 on lower PCB)
  300        P7         - Analog Video Output Connector (tied to a plug/cable that leads to J9 on lower PCB)
  301        P8         - Serial Port Connector 2 (located under the PCB, not used)
  302        P9         - Media Port Connector (joins to CN1S on the Media Board)
  303        P10        - Hi-Speed Parallel Port Connector (located under the PCB, not used)
  304  
  305  
  306  Base Board
  307  ----------
  308  1st Version (older rectangular metal box without built-in DIMM board and newer square metal box version with built in GDROM controller)
  309  8909960107 (8909970107) NAMCO LIMITED 2002 GC-AM BASE PCB
  310  
  311  2nd Version (newer square metal box, found in a Mario Kart Triforce unit using ROM carts)
  312  8909961100 (8909971100) NAMCO LIMITED 2002-2003 GC-AM BASE(B) PCB
  313  
  314  The differences between the versions seems minor... some component shuffling
  315  and a switch to a pb-Free manufacturing process. The PCB sizes are the same.
  316  However the two boards are not compatible when using the other media board. That is, a Base Board for
  317  GDROM will not work with the top section using ROM carts even though the boards appear identical.
  318  That is because when a key chip is inserted into a new board, it will marry itself with that board
  319  (this is stated in the F-Zero AX manual). From then onwards, the Base Board can only be used for _that_ game.
  320  
  321                             |----------------------------------|
  322                             |     CR2032            070XZ01    |
  323                             |      5.5V        J12             |
  324                             |                          TPS54610|
  325                             |                                  |
  326                             |                               J13|
  327                             |                  ADM3222  ADM3222|
  328  |-----------------|        |                             PC410|
  329  |CY7C1399         |        |J10                               |
  330  |LED     J8       |--------|                                  |
  331  |LED                           |---------------------|        |
  332  |LED |------|  |----|          |                     |    J9  |
  333  |LED |ALTERA|  |CY37128        |                     |        |
  334  |    |EPF10K|  |----|          |                     |        |
  335  |    |------|        33MHz     |                     |CMPV-DOL|
  336  |   BU9480F      IS63LV1024    |---------------------|        |
  337  |                |------|   ADM485        070XZ01    CXA2067AS|
  338  |                | H8S/ |                        |------------|
  339  |    3414        |2676  |   ST16C550             |
  340  |J5              |------|                        |
  341  |---|  J1       J2          J3         J4        |
  342      |--------------------------------------------|
  343  Notes:
  344        070XZ01    - Sharp 070XZ01 Voltage Regulator
  345        EPF10K     - Altera FLEX EPF10K30AQC208 FPGA (QFP208)
  346        CY37128    - Cypress CY37128VP100 CPLD stamped 'GCABJV1A' (QFP100)
  347        CY7C1399   - Cypress CY7C1399 32k x8 3.3V Static RAM (SOJ28)
  348        IS63LV1024 - ISSI IS63LV1024-12KL 128k x8 (1M) High-speed CMOS Static RAM 3.3V (SOJ32)
  349        H8S/2676   - Hitachi H8S/2676 Microcontroller (QFP144)
  350        BU9480F    - ROHM BU9480F 16-bit stereo D/A converter (SOIC8)
  351        3414       - JRC NJM3414A Dual High Current Operational Amplifier (SOIC8)
  352        ST16C550   - Exar ST16C550 Universal Asynchronous Receiver & Transmitter with 16 byte Transmit & Receive FIFO (TQFP48)
  353        ADM485     - Analog Devices ADM485 +5 V Low Power Half Duplex EIA RS-485 Transceiver (SOIC8)
  354        CXA2067AS  - Sony CXA2067AS Video Preamplifier (SDIP30)
  355        CMPV-DOL   - Macronix B055055G stamped 'CMPV-DOL' (SOP24)
  356        ADM3222    - Analog Devices ADM3222 High-Speed, +3.3V, 2-Channel RS232/V.28 Interface Device
  357                     with 460kBPS Data Rate and Shutdown and Enable Pins (SOIC20)
  358        PC410      - Sharp PC410 Photocoupler (SOIC4)
  359        CR20332    - 3.0 Volt Coin Battery
  360        5.5V       - 5.5 Volt 1uF Super Cap
  361        TPS54610   - Texas Instruments TPS54610 3V-6V Input, 6A Output Synchronous Buck PWM Switcher with Integrated FETs (SSOP28)
  362        J1         - USB Connector for attachment of a Sega JVS I/O PCB
  363        J2         - RCA Audio Output
  364        J3         - 15-pin DSUB Video Output 1
  365        J4         - 15-pin DSUB Video Output 2
  366        J5         - 6-pin connector (unused)
  367        J8         - Flat Cable Connector with Small Flat Cable tied to P3 on Main Board
  368        J9         - Flat Cable Connector and Plug tied to P7 Analog Video Output Connector on Main Board
  369        J10        - Flat Cable Connector and Plug tied to P6 Serial Port Connector 1 on Main Board
  370        J12        - Power Connector tied to P1 Motherboard Power Connector on Main Board
  371  
  372  
  373  Filter Board
  374  ------------
  375  1st Version
  376  8909960503 (8909970503) GC-AM CNT-JV PCB
  377  
  378  2nd Version
  379  8909961400 (8909971400) GC-AM CNT-JV(B) PCB
  380  
  381  The two versions are identical, the later one is pb-Free
  382  |------------------------------------------------------|
  383  |SW2  SW1     DIPSW              J2              J8    |
  384  |                                                  J9  |
  385  |J3                       J6          J7               |
  386  |                                                      |
  387  |J4    J5                        J1                    |
  388  |------------------------------------------------------|
  389  Notes:
  390        J1 - 60-pin Connector joins to J13 on Base Board
  391        J2 - 30-pin Connector joins to CN2S on Media Board
  392        J3 - 8-pin Connector labelled 'RS232'
  393        J4 - 7-pin Connector labelled 'MIDI'
  394        J5 - 10-pin Connector labelled 'SI'
  395        J6 - 6-pin JVS Power Connector
  396        J7 - 8-pin JVS Power Connector
  397        J8 - 3-pin Fan Connector
  398        J9 - 4-pin Namco Audio Connector (unused)
  399  
  400  ------------------------------------------------------------------------------------------------------------------
  401  
  402   Note: "Type 3" Triforce uploads GD-ROM firmware to a MIPS processor which is DES encrypted (same as the GD images).
  403   The key is 0x00 0x22 0x44 0x66 0x88 0xaa 0xcc 0xee (http://debugmo.de/2010/12/the-last-piece/).
  404  
  405  */
  406  
  407  #include "emu.h"
  408  #include "cpu/powerpc/ppc.h"
  409  #include "machine/naomigd.h"
  410  
  411  class triforce_state : public driver_device
  412  {
  413  public:
  414      triforce_state(const machine_config &mconfig, device_type type, const char *tag)
  415          : driver_device(mconfig, type, tag)
  416      { }
  417  
  418      DECLARE_READ64_MEMBER(gc_pi_r);
  419      DECLARE_WRITE64_MEMBER(gc_pi_w);
  420      DECLARE_READ64_MEMBER(gc_exi_r);
  421      DECLARE_WRITE64_MEMBER(gc_exi_w);
  422      virtual void machine_start();
  423      virtual void video_start();
  424      UINT32 screen_update_triforce(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
  425  };
  426  
  427  READ64_MEMBER(triforce_state::gc_pi_r)
  428  {
  429      return 0;
  430  }
  431  
  432  WRITE64_MEMBER(triforce_state::gc_pi_w)
  433  {
  434  }
  435  
  436  READ64_MEMBER(triforce_state::gc_exi_r)
  437  {
  438      return 0;
  439  }
  440  
  441  WRITE64_MEMBER(triforce_state::gc_exi_w)
  442  {
  443  }
  444  
  445  static ADDRESS_MAP_START( gc_map, AS_PROGRAM, 64, triforce_state )
  446      AM_RANGE(0x00000000, 0x017fffff) AM_RAM
  447      AM_RANGE(0x0c003000, 0x0c003fff) AM_READWRITE(gc_pi_r, gc_pi_w)
  448      AM_RANGE(0x0c006800, 0x0c0068ff) AM_READWRITE(gc_exi_r, gc_exi_w)
  449      AM_RANGE(0xfff00000, 0xffffffff) AM_ROM AM_REGION("maincpu", 0) AM_SHARE("share2")  /* Program ROM */
  450  ADDRESS_MAP_END
  451  
  452  
  453  void triforce_state::video_start()
  454  {
  455  }
  456  
  457  UINT32 triforce_state::screen_update_triforce(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
  458  {
  459      return 0;
  460  }
  461  
  462  static INPUT_PORTS_START( triforce )
  463  INPUT_PORTS_END
  464  
  465  // bootrom descrambler reversed by segher
  466  // Copyright 2008 Segher Boessenkool <segher@kernel.crashing.org>
  467  static void descrambler(UINT8* data, UINT32 size)
  468  {
  469      UINT8 acc = 0;
  470      UINT8 nacc = 0;
  471  
  472      UINT16 t = 0x2953;
  473      UINT16 u = 0xd9c2;
  474      UINT16 v = 0x3ff1;
  475  
  476      UINT8 x = 1;
  477  
  478      for (UINT32 it = 0; it < size;)
  479      {
  480          int t0 = t & 1;
  481          int t1 = (t >> 1) & 1;
  482          int u0 = u & 1;
  483          int u1 = (u >> 1) & 1;
  484          int v0 = v & 1;
  485  
  486          x ^= t1 ^ v0;
  487          x ^= (u0 | u1);
  488          x ^= (t0 ^ u1 ^ v0) & (t0 ^ u0);
  489  
  490          if (t0 == u0)
  491          {
  492              v >>= 1;
  493              if (v0)
  494                  v ^= 0xb3d0;
  495          }
  496  
  497          if (t0 == 0)
  498          {
  499              u >>= 1;
  500              if (u0)
  501                  u ^= 0xfb10;
  502          }
  503  
  504          t >>= 1;
  505          if (t0)
  506              t ^= 0xa740;
  507  
  508          nacc++;
  509          acc = 2*acc + x;
  510          if (nacc == 8)
  511          {
  512              data[BYTE8_XOR_BE(it)] ^= acc;
  513              it++;
  514              nacc = 0;
  515          }
  516      }
  517  }
  518  
  519  void triforce_state::machine_start()
  520  {
  521      /* set conservative DRC options */
  522      ppcdrc_set_options(machine().device("maincpu"), PPCDRC_COMPATIBLE_OPTIONS);
  523  
  524      UINT8 *rom = (UINT8*)machine().root_device().memregion("maincpu")->base();
  525      descrambler(&rom[0x100], 0x1afe00);
  526  }
  527  
  528  static MACHINE_CONFIG_START( triforce_base, triforce_state )
  529  
  530      /* basic machine hardware */
  531      MCFG_CPU_ADD("maincpu", PPC603, 64000000) /* Correct CPU is a PowerPC 750 (what Apple called "G3") with paired-single vector instructions added */
  532      MCFG_CPU_PROGRAM_MAP(gc_map)
  533  
  534      MCFG_QUANTUM_TIME(attotime::from_hz(6000))
  535  
  536  
  537      /* video hardware */
  538      MCFG_SCREEN_ADD("screen", RASTER)
  539      MCFG_SCREEN_REFRESH_RATE(60)
  540      MCFG_SCREEN_SIZE(640, 480)
  541      MCFG_SCREEN_VISIBLE_AREA(0, 639, 0, 479)
  542      MCFG_SCREEN_UPDATE_DRIVER(triforce_state, screen_update_triforce)
  543  
  544      MCFG_PALETTE_LENGTH(65536)
  545  
  546  MACHINE_CONFIG_END
  547  
  548  static MACHINE_CONFIG_DERIVED( triforcegd, triforce_base )
  549      MCFG_NAOMI_GDROM_BOARD_ADD("rom_board", ":gdrom", "picreturn", NULL, "maincpu", NULL)
  550  MACHINE_CONFIG_END
  551  
  552  
  553  #define ROM_LOAD16_WORD_SWAP_BIOS(bios,name,offset,length,hash) \
  554          ROMX_LOAD(name, offset, length, hash, ROM_GROUPWORD | ROM_BIOS(bios+1)) /* Note '+1' */
  555  
  556  #define TRIFORCE_BIOS \
  557      ROM_REGION( 0x200000, "maincpu", 0) \
  558      ROM_SYSTEM_BIOS( 0, "bios0", "Triforce Bios" ) \
  559      ROM_LOAD16_WORD_SWAP_BIOS( 0,  "triforce_bootrom.bin", 0x000000, 0x200000, CRC(d1883221) SHA1(c3cb7227e4dbc2af861e76d00cb59726105a2e4c) )
  560  ROM_START( triforce )
  561      TRIFORCE_BIOS
  562  ROM_END
  563  
  564  ROM_START( vs2002j )
  565      TRIFORCE_BIOS
  566  
  567      DISK_REGION( "gdrom" )
  568      DISK_IMAGE_READONLY( "gdt-0001", 0, BAD_DUMP SHA1(1b4b16b0715fa5717904f0b3141cc48cca99b7a4) )
  569  
  570      ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
  571      ROM_LOAD("gdt-0001.data", 0x00, 0x50, CRC(4a1fca38) SHA1(3bc6dca4f8faba44bf5c5a8012cffc69dbb6aea2) )
  572  ROM_END
  573  
  574  /*
  575  Title   VIRTUA_STRIKER_2002
  576  Media ID    0DD8
  577  Media Config    GD-ROM1/1
  578  Regions J
  579  Peripheral String   0000000
  580  Product Number  GDT-0002
  581  Version V1.005
  582  Release Date    20020730
  583  
  584  
  585  PIC
  586  
  587  253-5508-337E
  588  317-0337-EXP
  589  */
  590  
  591  ROM_START( vs2002ex )
  592      TRIFORCE_BIOS
  593  
  594      DISK_REGION( "gdrom" )
  595      DISK_IMAGE_READONLY( "gdt-0002", 0, BAD_DUMP SHA1(471e896d43167c93cc229cfc94ff7ac6de7cf9a4) )
  596  
  597      ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
  598      ROM_LOAD("317-0337-exp.data", 0x00, 0x50, CRC(aa6be604) SHA1(fabc43ecfb7ddf1d5a87f10884852027d6f4773b) )
  599  ROM_END
  600  
  601  
  602  ROM_START( avalons )
  603      TRIFORCE_BIOS
  604  
  605      DISK_REGION( "gdrom" )
  606      DISK_IMAGE_READONLY( "gdt-0005c", 0, BAD_DUMP SHA1(9edb3d9ff492d2207d57bfdb6859e796f76c5e0c) )
  607  
  608      ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
  609      ROM_LOAD("gdt-0005.data", 0x00, 0x50, CRC(6c51e5d6) SHA1(84afef983f1f855fe8722f55baa8ea5121da9369) )
  610  ROM_END
  611  
  612  
  613  ROM_START( gekpurya )
  614      TRIFORCE_BIOS
  615  
  616      DISK_REGION( "gdrom" )
  617      DISK_IMAGE_READONLY( "gdt-0008c", 0, BAD_DUMP SHA1(2c1bdb8324efc216edd771fe45c680ac726111a0) )
  618  
  619      ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
  620      ROM_LOAD("317-0371-jpn.data", 0x00, 0x50, CRC(08434e5e) SHA1(2121999e851f6f62ab845e6de40849d850ac9d1c) )
  621  ROM_END
  622  
  623  
  624  ROM_START( tfupdate )
  625      TRIFORCE_BIOS
  626  
  627      DISK_REGION( "gdrom" )
  628      DISK_IMAGE_READONLY( "gdt-0011", 0, BAD_DUMP SHA1(71bfa8f53d211085c020d54f55eeeabf85212a0b) )
  629  
  630      ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
  631      ROM_LOAD("gdt-0011.data", 0x00, 0x50, CRC(08434e5e) SHA1(2121999e851f6f62ab845e6de40849d850ac9d1c) )
  632  ROM_END
  633  
  634  
  635  /*
  636  
  637  Title   VIRTUA STRIKER 4
  638  Media ID    93B2
  639  Media Config    GD-ROM1/1
  640  Regions J
  641  Peripheral String   0000000
  642  Product Number  GDT-0015
  643  Version V1.001
  644  Release Date    20041202
  645  Manufacturer ID
  646  TOC DISC
  647  Track   Start Sector    End Sector  Track Size
  648  track01.bin 150 449 705600
  649  track02.raw 600 1951    3179904
  650  track03.bin 45150   549299  1185760800
  651  
  652  
  653  PIC
  654  255-5508-393E
  655  317-0393-EXP
  656  
  657  */
  658  
  659  ROM_START( vs4 )
  660      TRIFORCE_BIOS
  661  
  662      DISK_REGION( "gdrom" )
  663      DISK_IMAGE_READONLY( "gdt-0015", 0, BAD_DUMP SHA1(1f83712b2b170d6edf4a27c15b6f763cc3cc4b71) )
  664  
  665      ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
  666      ROM_LOAD("317-0393-exp.data", 0x00, 0x50, CRC(2dcfecd7) SHA1(d805168e1564051ae5c47876ade2c9843253c6b4) )
  667  ROM_END
  668  
  669  
  670  /*
  671  
  672  Title   VIRTUA STRIKER 4
  673  Media ID    7BC9
  674  Media Config    GD-ROM1/1
  675  Regions J
  676  Peripheral String   0000000
  677  Product Number  GDT-0013E
  678  Version V6.000
  679  Release Date    20050217
  680  
  681  
  682  PIC
  683  255-5508-391J
  684  317-0391-JPN
  685  
  686  */
  687  
  688  ROM_START( vs4j )
  689      TRIFORCE_BIOS
  690  
  691      DISK_REGION( "gdrom" )
  692      DISK_IMAGE_READONLY( "gdt-0013e", 0, BAD_DUMP SHA1(b69cc5cab889114eda5c6e9ddcca42de9bc235b3) )
  693  
  694      ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
  695      ROM_LOAD("317-0391-jpn.data", 0x00, 0x50, CRC(0f2dbb73) SHA1(7b9d66abe85303b3e26b442a3a63feca1a0edbdb) )
  696  ROM_END
  697  
  698  
  699  /*
  700  
  701  Title   TRF GDROM TBA EX SATL
  702  Media ID    92C5
  703  Media Config    GD-ROM1/1
  704  Regions J
  705  Peripheral String   0000000
  706  Product Number  GDT-0010C
  707  Version V4.000
  708  Release Date    20040608
  709  Manufacturer ID
  710  
  711  TOC DISC
  712  Track   Start Sector    End Sector  Track Size
  713  track01.bin 150 599 1058400
  714  track02.raw 750 2101    3179904
  715  track03.bin 45150   549299  1185760800
  716  */
  717  
  718  ROM_START( avalon13 )
  719      TRIFORCE_BIOS
  720  
  721      DISK_REGION( "gdrom" )
  722      DISK_IMAGE_READONLY( "gdt-0010c", 0, BAD_DUMP SHA1(716c441d8dc9036a13c66ef0048cd6d32ac63c4e) )
  723  
  724      ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
  725      ROM_LOAD("gdt-0010c.data", 0x00, 0x50, CRC(6c51e5d6) SHA1(84afef983f1f855fe8722f55baa8ea5121da9369) )
  726  ROM_END
  727  
  728  
  729  /*
  730  
  731  Title   TRF GDROM TBT SATL
  732  Media ID    1348
  733  Media Config    GD-ROM1/1
  734  Regions J
  735  Peripheral String   0000000
  736  Product Number  GDT-0017B
  737  Version V3.001
  738  Release Date    20041102
  739  Manufacturer ID
  740  
  741  TOC DISC
  742  Track   Start Sector    End Sector  Track Size
  743  track01.bin 150 599 1058400
  744  track02.raw 750 2101    3179904
  745  track03.bin 45150   549299  1185760800
  746  
  747  */
  748  
  749  ROM_START( avalon20 )
  750      TRIFORCE_BIOS
  751  
  752      DISK_REGION( "gdrom" )
  753      DISK_IMAGE_READONLY( "gdt-0017b", 0, BAD_DUMP SHA1(e2dd32c322ffcaf38b82275d2721b71bb3dfc1f2) )
  754  
  755      ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
  756      ROM_LOAD("gdt-0017b.data", 0x00, 0x50, CRC(32cb46d4) SHA1(a58b9e03d57b317133d9b6c29e42852af8e77559) )
  757  ROM_END
  758  
  759  
  760  ROM_START( vs42006 )
  761      TRIFORCE_BIOS
  762  
  763      DISK_REGION( "gdrom" )
  764      DISK_IMAGE_READONLY( "gdt-0020d", 0, BAD_DUMP SHA1(db256d094b9754d452d7a2b8a370699d21141c1f) )
  765  
  766      ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
  767      ROM_LOAD("gdt-0020.data", 0x00, 0x50, CRC(e3d13191) SHA1(4255c09aad06eb38c16bdec881897404a3a68b37) )
  768  ROM_END
  769  
  770  
  771  // This dump is tested good on h/w: was flashed to a dead cart and it then ran fine
  772  ROM_START( mkartagp )
  773      TRIFORCE_BIOS
  774  
  775      ROM_REGION(0x19000000, "rom_board", 0)
  776      ROM_LOAD( "ic9_29lv400t",    0x00000000, 0x0080000, CRC(f1ba67b2) SHA1(212fe4b28b6f9590bff200a6680bf7ee381780c7) )
  777      ROM_LOAD( "ic1_k9f1208u0b",  0x01000000, 0x4200000, CRC(7edb6ff2) SHA1(c544c09fc0441f940623c7368919e46153d49c20) )
  778      ROM_LOAD( "ic2_k9f1208u0b",  0x04200000, 0x4200000, CRC(beb58594) SHA1(826ddc3db46f7644b08488618453917430bb16a1) )
  779      ROM_LOAD( "ic5_k9f1208u0b",  0x08400000, 0x4200000, CRC(fd7b9a28) SHA1(bc56c0a786e70de7365bd1b46fe82b3c43388f0c) )
  780      ROM_LOAD( "ic6_k9f1208u0b",  0x0c600000, 0x4200000, CRC(26bcfe14) SHA1(893e6b38cccca62037fc01012410d535634f8bc1) )
  781      ROM_LOAD( "ic35_k9f1208u0b", 0x10800000, 0x4200000, CRC(9a67892f) SHA1(f2beb56d07a42a01a8cfffbf683d8ec58c8407cc) )
  782      ROM_LOAD( "ic45_k9f1208u0b", 0x14c00000, 0x4200000, CRC(274e7b81) SHA1(d97951c19d4ea430e09bc56777d99651a1f888d1) )
  783  ROM_END
  784  
  785  
  786  GAME( 2002, triforce, 0,        triforcegd,    triforce, driver_device,    0, ROT0, "Sega",           "Triforce Bios", GAME_IS_SKELETON|GAME_IS_BIOS_ROOT )
  787  
  788  // GD-ROM games
  789  GAME( 2002, vs2002j,  triforce, triforcegd,    triforce, driver_device,    0, ROT0, "Sega",           "Virtua Striker 2002 (GDT-0001)", GAME_IS_SKELETON )
  790  GAME( 2002, vs2002ex, triforce, triforcegd,    triforce, driver_device,    0, ROT0, "Sega",           "Virtua Striker 2002 (GDT-0002)", GAME_IS_SKELETON )
  791  GAME( 2003, avalons,  triforce, triforcegd,    triforce, driver_device,    0, ROT0, "Sega",           "The Key Of Avalon - The Wizard Master - Server (GDT-0005C) (V4.001)", GAME_IS_SKELETON )
  792  GAME( 2003, gekpurya, triforce, triforcegd,    triforce, driver_device,    0, ROT0, "Sega",           "Gekitou Pro Yakyuu Mizushima Shinji All Stars vs. Pro Yakyuu (Rev C) (GDT-0008C)", GAME_IS_SKELETON )
  793  GAME( 2004, avalon13, triforce, triforcegd,    triforce, driver_device,    0, ROT0, "Sega",           "The Key Of Avalon 1.3 - Chaotic Sabbat - Client (GDT-0010C) (V4.000)", GAME_IS_SKELETON )
  794  GAME( 2004, tfupdate, triforce, triforcegd,    triforce, driver_device,    0, ROT0, "Sega",           "Triforce DIMM Updater (GDT-0011)", GAME_IS_SKELETON )
  795  GAME( 2004, vs4j,     triforce, triforcegd,    triforce, driver_device,    0, ROT0, "Sega",           "Virtua Striker 4 (Japan) (GDT-0013E)", GAME_IS_SKELETON )
  796  GAME( 2004, vs4,      triforce, triforcegd,    triforce, driver_device,    0, ROT0, "Sega",           "Virtua Striker 4 (Export) (GDT-0015)", GAME_IS_SKELETON )
  797  GAME( 2004, avalon20, triforce, triforcegd,    triforce, driver_device,    0, ROT0, "Sega",           "The Key Of Avalon 2.0 - Eutaxy and Commandment - Client (GDT-0017B) (V3.001)", GAME_IS_SKELETON )
  798  GAME( 2006, vs42006,  triforce, triforcegd,    triforce, driver_device,    0, ROT0, "Sega",           "Virtua Striker 4 Ver.2006 (Japan) (Rev D) (GDT-0020D)", GAME_IS_SKELETON )
  799  
  800  // ROM games
  801  GAME( 2005, mkartagp, triforce, triforce_base, triforce, driver_device,    0, ROT0, "Namco",          "Mario Kart Arcade GP", GAME_IS_SKELETON )