Previous 15994 Revisions Next

r15475 Monday 18th June, 2012 at 06:28:05 UTC by Miodrag Milanović
Sync with MAME r16644 (no whatsnew)
[src/emu/machine]s3c24xx.c
[src/lib/util]cdrom.c chd.c huffman.c
[src/mame]mame.lst
[src/mame/drivers]8080bw.c dkong.c ghosteo.c igs011.c igs017.c jaguar.c mw8080bw.c
[src/mame/includes]8080bw.h mw8080bw.h
[src/mame/machine]mw8080bw.c

src/mame/mame.lst
r15474r15475
14361436astropal      // (c) 19?? Sidam
14371437cosmo         // TDS & Mints
14381438darthvdr      // bootleg
1439invmulti      // hack
1440invmultim3a      // hack
1441invmultim2c      // hack
1442invmultim2a      // hack
1443invmultim1a      // hack
1444invmultit3d      // hack
1445invmultis3a      // hack
1446invmultis2a      // hack
1447invmultis1a      // hack
14391448
1440144918w            // 653 (c) 1979 Midway
1441145018w2         // 653 (c) 1979 Midway
src/mame/machine/mw8080bw.c
r15474r15475
100100
101101   mw8080bw_create_interrupt_timer(machine);
102102
103   state->m_maincpu = machine.device("maincpu");
104103   state->m_samples = machine.device<samples_device>("samples");
105104   state->m_samples1 = machine.device<samples_device>("samples1");
106105   state->m_samples2 = machine.device<samples_device>("samples2");
src/mame/includes/mw8080bw.h
r15474r15475
3535{
3636public:
3737   mw8080bw_state(const machine_config &mconfig, device_type type, const char *tag)
38      : driver_device(mconfig, type, tag) ,
38      : driver_device(mconfig, type, tag),
39      m_maincpu(*this,"maincpu"),
3940      m_main_ram(*this, "main_ram"),
40      m_colorram(*this, "colorram"){ }
41      m_colorram(*this, "colorram")
42   { }
4143
42   /* memory pointers */
44   /* device/memory pointers */
45   required_device<cpu_device> m_maincpu;
4346   required_shared_ptr<UINT8> m_main_ram;
4447   optional_shared_ptr<UINT8> m_colorram;
4548
r15474r15475
6669   /* timer */
6770   emu_timer   *m_interrupt_timer;
6871
69   /* devices */
70   device_t *m_maincpu;
72   /* other devices */
7173   device_t *m_mb14241;
7274   samples_device *m_samples;
7375   samples_device *m_samples1;
r15474r15475
7678   device_t *m_sn2;
7779   device_t *m_sn;
7880   device_t *m_discrete;
81
7982   DECLARE_READ8_MEMBER(mw8080bw_shift_result_rev_r);
8083   DECLARE_READ8_MEMBER(mw8080bw_reversable_shift_result_r);
8184   DECLARE_WRITE8_MEMBER(mw8080bw_reversable_shift_count_w);
r15474r15475
140143#define INVADERS_CAB_TYPE_PORT_TAG      ("CAB")
141144#define INVADERS_P1_CONTROL_PORT_TAG   ("CONTP1")
142145#define INVADERS_P2_CONTROL_PORT_TAG   ("CONTP2")
146#define INVADERS_COIN_INPUT_PORT_TAG   ("COIN")
147#define INVADERS_SW6_SW7_PORT_TAG      ("SW6SW7")
148#define INVADERS_SW5_PORT_TAG         ("SW5")
143149
144
145150#define BLUESHRK_SPEAR_PORT_TAG         ("IN0")
146151
147152#define INVADERS_CONTROL_PORT_P1 \
src/mame/includes/8080bw.h
r15474r15475
3232   UINT8       m_screen_red;
3333
3434   device_t *m_speaker;
35
3536   DECLARE_CUSTOM_INPUT_MEMBER(sflush_80_r);
3637   DECLARE_READ8_MEMBER(indianbt_r);
3738   DECLARE_WRITE8_MEMBER(steelwkr_sh_port_3_w);
r15474r15475
5758   DECLARE_WRITE8_MEMBER(yosakdon_sh_port_2_w);
5859   DECLARE_WRITE8_MEMBER(shuttlei_sh_port_1_w);
5960   DECLARE_WRITE8_MEMBER(shuttlei_sh_port_2_w);
61   DECLARE_READ8_MEMBER(invmulti_eeprom_r);
62   DECLARE_WRITE8_MEMBER(invmulti_eeprom_w);
63   DECLARE_WRITE8_MEMBER(invmulti_bank_w);
6064};
6165
6266
r15474r15475
6468
6569MACHINE_START( extra_8080bw_sh );
6670
67
68
6971extern const samples_interface lrescue_samples_interface;
7072
71
72
7373WRITE8_DEVICE_HANDLER( indianbt_sh_port_3_w );
7474DISCRETE_SOUND_EXTERN( indianbt );
7575
r15474r15475
8484DISCRETE_SOUND_EXTERN( schaser );
8585
8686
87
88
89
90
91
92
9387/*----------- defined in video/8080bw.c -----------*/
9488
9589MACHINE_START( extra_8080bw_vh );
src/mame/drivers/mw8080bw.c
r15474r15475
25152515 *
25162516 *************************************/
25172517
2518#define INVADERS_COIN_INPUT_PORT_TAG   ("COIN")
2519#define INVADERS_SW6_SW7_PORT_TAG      ("SW6SW7")
2520#define INVADERS_SW5_PORT_TAG         ("SW5")
2521
2522
25232518static MACHINE_START( invaders )
25242519{
25252520   mw8080bw_state *state = machine.driver_data<mw8080bw_state>();
src/mame/drivers/igs017.c
r15474r15475
13871387   if (ACCESSING_BITS_0_7)
13881388      m_irq1_enable = data & 1;
13891389
1390   if (data != 0 && data != 0xff)
1390   if (data != 0 && data != 1 && data != 0xff)
13911391      logerror("%s: irq1_enable = %04x\n", machine().describe_context(), data);
13921392}
13931393
r15474r15475
13961396   if (ACCESSING_BITS_0_7)
13971397      m_irq2_enable = data & 1;
13981398
1399   if (data != 0 && data != 0xff)
1399   if (data != 0 && data != 1 && data != 0xff)
14001400      logerror("%s: irq2_enable = %04x\n", machine().describe_context(), data);
14011401}
14021402
r15474r15475
41754175GAME( 1997,  tjsb,     0,       tjsb,     tjsb,     tjsb,     ROT0, "IGS",              "Mahjong Tian Jiang Shen Bing (V137C)",        GAME_UNEMULATED_PROTECTION )
41764176GAME( 1998,  mgcs,     0,       mgcs,     mgcs,     mgcs,     ROT0, "IGS",              "Mahjong Man Guan Cai Shen (V103CS)",          GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_SOUND )
41774177GAME( 1998,  lhzb2,    0,       lhzb2,    lhzb2,     lhzb2,   ROT0, "IGS",              "Mahjong Long Hu Zheng Ba 2 (set 1)",          GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION )
4178GAME( 1998,  lhzb2a,   lhzb2,   lhzb2a,   lhzb2a,    lhzb2a,  ROT0, "IGS",              "Mahjong Long Hu Zheng Ba 2 (VS221M)",         GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION )
4178GAME( 1998,  lhzb2a,   lhzb2,   lhzb2a,   lhzb2a,    lhzb2a,  ROT0, "IGS",              "Mahjong Long Hu Zheng Ba 2 (VS221M)",         0 )
41794179GAME( 1998,  slqz2,    0,       slqz2,    slqz2,    slqz2,    ROT0, "IGS",              "Mahjong Shuang Long Qiang Zhu 2 (VS203J)",    GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION )
41804180GAME( 1999?, tarzan,   0,       iqblocka, iqblocka, tarzan,   ROT0, "IGS",              "Tarzan (V109C)",                              GAME_NOT_WORKING )
41814181GAME( 1999?, tarzana,  tarzan,  iqblocka, iqblocka, tarzana,  ROT0, "IGS",              "Tarzan (V107)",                               GAME_NOT_WORKING )
src/mame/drivers/jaguar.c
r15474r15475
18061806   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
18071807
18081808   /* quickload */
1809   MCFG_QUICKLOAD_ADD("quickload", jaguar, "abs,bin,cof,jag,prg", 0)
1809   MCFG_QUICKLOAD_ADD("quickload", jaguar, "abs,bin,cof,jag,prg", 2)
18101810
18111811   /* cartridge */
18121812   MCFG_CARTSLOT_ADD("cart")
src/mame/drivers/dkong.c
r15474r15475
15991599 *
16001600 *************************************/
16011601
1602static const eeprom_interface braze_eeprom_intf =
1603{
1604   7,            /* address bits */
1605   8,            /* data bits */
1606   "*110",         /* read command */
1607   "*101",         /* write command */
1608   0,            /* erase command */
1609   "*10000xxxxx",   /* lock command */
1610   "*10011xxxxx",   /* unlock command */
1611};
1612
16131602READ8_MEMBER(dkong_state::braze_eeprom_r)
16141603{
16151604   eeprom_device *eeprom = machine().device<eeprom_device>("eeprom");
r15474r15475
17241713
17251714static MACHINE_CONFIG_DERIVED( braze, dkong2b )
17261715
1727   MCFG_EEPROM_ADD("eeprom", braze_eeprom_intf)
1716   MCFG_EEPROM_93C46_8BIT_ADD("eeprom")
17281717MACHINE_CONFIG_END
17291718
17301719static MACHINE_CONFIG_START( dkong3, dkong_state )
r15474r15475
32043193GAME( 1981, dkongjo,  dkong,    dkong2b,  dkong,          0,  ROT90, "Nintendo", "Donkey Kong (Japan set 2)", GAME_SUPPORTS_SAVE )
32053194GAME( 1981, dkongjo1, dkong,    dkong2b,  dkong,          0,  ROT90, "Nintendo", "Donkey Kong (Japan set 3)", GAME_SUPPORTS_SAVE )
32063195GAME( 2004, dkongf,   dkong,    dkong2b,  dkongf,         0,  ROT90, "hack", "Donkey Kong Foundry (hack)", GAME_SUPPORTS_SAVE ) /* from Jeff's Romhack */
3207GAME( 2006, dkongx,   dkong,    braze,    dkongx,    dkongx,  ROT90, "hack", "Donkey Kong II - Jumpman Returns (V1.2) (hack)", GAME_SUPPORTS_SAVE )
3208GAME( 2006, dkongx11, dkong,    braze,    dkongx,    dkongx,  ROT90, "hack", "Donkey Kong II - Jumpman Returns (V1.1) (hack)", GAME_SUPPORTS_SAVE )
3196GAME( 2006, dkongx,   dkong,    braze,    dkongx,    dkongx,  ROT90, "hack (Braze Technologies)", "Donkey Kong II - Jumpman Returns (V1.2) (hack)", GAME_SUPPORTS_SAVE )
3197GAME( 2006, dkongx11, dkong,    braze,    dkongx,    dkongx,  ROT90, "hack (Braze Technologies)", "Donkey Kong II - Jumpman Returns (V1.1) (hack)", GAME_SUPPORTS_SAVE )
32093198
32103199GAME( 1982, dkongjr,  0,        dkongjr,  dkongjr,        0,  ROT90, "Nintendo of America", "Donkey Kong Junior (US)", GAME_SUPPORTS_SAVE )
32113200GAME( 1982, dkongjrj, dkongjr,  dkongjr,  dkongjr,        0,  ROT90, "Nintendo", "Donkey Kong Jr. (Japan)", GAME_SUPPORTS_SAVE )
src/mame/drivers/ghosteo.c
r15474r15475
8888   struct nand_t m_nand;
8989   DECLARE_WRITE32_MEMBER(sound_w);
9090   DECLARE_READ32_MEMBER(bballoon_speedup_r);
91   DECLARE_READ32_MEMBER(touryuu_port_10000000_r);
9192
9293   int m_rom_pagesize;
9394};
r15474r15475
118119
119120// GPIO
120121
121static const UINT8 security_data[] = { 0x01, 0xC4, 0xFF, 0x22 };
122static const UINT8 security_data[] = { 0x01, 0xC4, 0xFF, 0x22, 0xFF, 0xFF, 0xFF, 0xFF };
122123
123124static UINT32 s3c2410_gpio_port_r( device_t *device, int port, UINT32 mask)
124125{
r15474r15475
361362   }
362363}
363364
365READ32_MEMBER( ghosteo_state::touryuu_port_10000000_r )
366{
367   ghosteo_state *state = machine().driver_data<ghosteo_state>();
368   UINT32 port_g = state->m_bballoon_port[S3C2410_GPIO_PORT_G];
369   UINT32 data = 0xFFFFFFFF;
370   switch (port_g)
371   {
372      case 0x8 : data = machine().root_device().ioport( "10000000-08")->read(); break;
373      case 0x9 : data = machine().root_device().ioport( "10000000-09")->read(); break;
374      case 0xA : data = machine().root_device().ioport( "10000000-0A")->read(); break;
375      case 0xB : data = machine().root_device().ioport( "10000000-0B")->read(); break;
376      case 0xC : data = machine().root_device().ioport( "10000000-0C")->read(); break;
377   }
378//   logerror( "touryuu_port_10000000_r (%08X) -> %08X\n", port_g, data);
379   return data;
380}
381
382
364383static ADDRESS_MAP_START( bballoon_map, AS_PROGRAM, 32, ghosteo_state )
365384   AM_RANGE(0x10000000, 0x10000003) AM_READ_PORT("10000000")
366385   AM_RANGE(0x10100000, 0x10100003) AM_READ_PORT("10100000")
r15474r15475
369388   AM_RANGE(0x30000000, 0x31ffffff) AM_RAM AM_SHARE("systememory") AM_MIRROR(0x02000000)
370389ADDRESS_MAP_END
371390
391static ADDRESS_MAP_START( touryuu_map, AS_PROGRAM, 32, ghosteo_state )
392   AM_RANGE(0x10000000, 0x10000003) AM_READ(touryuu_port_10000000_r)
393   AM_RANGE(0x10100000, 0x10100003) AM_READ_PORT("10100000")
394   AM_RANGE(0x10200000, 0x10200003) AM_READ_PORT("10200000")
395   AM_RANGE(0x10300000, 0x10300003) AM_WRITE(sound_w)
396   AM_RANGE(0x30000000, 0x31ffffff) AM_RAM AM_SHARE("systememory") AM_MIRROR(0x02000000)
397ADDRESS_MAP_END
398
399
372400/*
373401static INPUT_PORTS_START( bballoon )
374402    PORT_START("10000000")
r15474r15475
427455   PORT_BIT( 0xFFFFFF50, IP_ACTIVE_LOW, IPT_UNUSED )
428456INPUT_PORTS_END
429457
458/*
459
460  Touryuumon
461
462  +----+----+----+----+----+
463  | 1  | 1  | 1  | FF | 1  |
464  +----+----+----+----+----+
465  | C  | G  | K  | Ti | Rn |
466  +----+----+----+----+----+
467  | D  | H  | L  | Po | Be |
468  +----+----+----+----+----+
469  | A  | E  | I  | M  | Kn |
470  +----+----+----+----+----+
471  | B  | F  | J  | N  | Re |
472  +----+----+----+----+----+----+----+
473  | Sv | Ts | Be | 2s | 1s | 2c | 1c |
474  +----+----+----+----+----+----+----+
475
476*/
477
478static INPUT_PORTS_START( touryuu )
479   PORT_START("10000000-08")
480   PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("1 (5)")
481   PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_MAHJONG_FLIP_FLOP )
482   PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("1 (3)")
483   PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("1 (2)")
484   PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("1 (1)")
485   PORT_BIT( 0xFFFFFFE0, IP_ACTIVE_LOW, IPT_UNUSED )
486   PORT_START("10000000-09")
487   PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_MAHJONG_RON )
488   PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_MAHJONG_CHI ) // labeled "Ti" in test mode
489   PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_MAHJONG_K )
490   PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_MAHJONG_G )
491   PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_MAHJONG_C )
492   PORT_BIT( 0xFFFFFFE0, IP_ACTIVE_LOW, IPT_UNUSED )
493   PORT_START("10000000-0A")
494   PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_MAHJONG_BET )
495   PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_MAHJONG_PON )
496   PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_MAHJONG_L )
497   PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_MAHJONG_H )
498   PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_MAHJONG_D )
499   PORT_BIT( 0xFFFFFFE0, IP_ACTIVE_LOW, IPT_UNUSED )
500   PORT_START("10000000-0B")
501   PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_MAHJONG_KAN )
502   PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_MAHJONG_M )
503   PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_MAHJONG_I )
504   PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_MAHJONG_E )
505   PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_MAHJONG_A )
506   PORT_BIT( 0xFFFFFFE0, IP_ACTIVE_LOW, IPT_UNUSED )
507   PORT_START("10000000-0C")
508   PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_MAHJONG_REACH )
509   PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_MAHJONG_N )
510   PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_MAHJONG_J )
511   PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_MAHJONG_F )
512   PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_MAHJONG_B )
513   PORT_BIT( 0xFFFFFFE0, IP_ACTIVE_LOW, IPT_UNUSED )
514   PORT_START("10100000")
515   PORT_BIT( 0xFFFFFFFF, IP_ACTIVE_LOW, IPT_UNUSED )
516   PORT_START("10200000")
517   PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_COIN1 )
518   PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_COIN2 )
519   PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_START1 )
520   PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_START2 )
521   PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_SERVICE1 )
522   PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_SERVICE2 )
523   PORT_BIT( 0xFFFFFF50, IP_ACTIVE_LOW, IPT_UNUSED )
524INPUT_PORTS_END
525
526
430527static const s3c2410_interface bballoon_s3c2410_intf =
431528{
432529   // CORE (pin read / pin write)
r15474r15475
443540   { s3c2410_nand_command_w, s3c2410_nand_address_w, s3c2410_nand_data_r, s3c2410_nand_data_w }
444541};
445542
446static const i2cmem_interface i2cmem_interface =
543static const i2cmem_interface bballoon_i2cmem_interface =
447544{
448545   I2CMEM_SLAVE_ADDRESS, 0, 256
449546};
450547
548static const i2cmem_interface touryuu_i2cmem_interface =
549{
550   I2CMEM_SLAVE_ADDRESS, 0, 1024
551};
451552
452553device_t* s3c2410;
453554
r15474r15475
482583   s3c2410 = machine.device("s3c2410");
483584}
484585
485static MACHINE_CONFIG_START( bballoon, ghosteo_state )
586static MACHINE_CONFIG_START( ghosteo, ghosteo_state )
486587
487588   /* basic machine hardware */
488589   MCFG_CPU_ADD("maincpu", ARM9, 200000000)
489   MCFG_CPU_PROGRAM_MAP(bballoon_map)
490590
491591   MCFG_SCREEN_ADD("screen", RASTER)
492592   MCFG_SCREEN_REFRESH_RATE(60)
r15474r15475
507607//  MCFG_DEVICE_CONFIG(bballoon_nand_intf)
508608
509609//  MCFG_I2CMEM_ADD("i2cmem", 0xA0, 0, 0x100, NULL)
510   MCFG_I2CMEM_ADD("i2cmem", i2cmem_interface)
511610
512611   /* sound hardware */
513612MACHINE_CONFIG_END
514613
614static MACHINE_CONFIG_DERIVED( bballoon, ghosteo )
615   MCFG_CPU_MODIFY("maincpu")
616   MCFG_CPU_PROGRAM_MAP(bballoon_map)
617   MCFG_I2CMEM_ADD("i2cmem", bballoon_i2cmem_interface)
618MACHINE_CONFIG_END
619
620static MACHINE_CONFIG_DERIVED( touryuu, ghosteo )
621   MCFG_CPU_MODIFY("maincpu")
622   MCFG_CPU_PROGRAM_MAP(touryuu_map)
623   MCFG_I2CMEM_ADD("i2cmem", touryuu_i2cmem_interface)
624MACHINE_CONFIG_END
625
626
515627/*
516628Balloon & Balloon
517629Eolith, 2003
r15474r15475
617729
618730GAME( 2003, bballoon, 0, bballoon, bballoon, bballoon, ROT0, "Eolith", "BnB Arcade", GAME_NO_SOUND )
619731GAME( 2005, hapytour, 0, bballoon, bballoon, bballoon, ROT0, "GAV Company", "Happy Tour", GAME_NO_SOUND )
620GAME( 200?, touryuu,  0, bballoon, bballoon, touryuu, ROT0, "Yuki Enterprise", "Touryuumon (V1.1)?", GAME_NOT_WORKING | GAME_NO_SOUND ) // no inputs, boots to test mode first time, endless reboot loop after that
732GAME( 2005, touryuu,  0, touryuu, touryuu, touryuu, ROT0, "Yuki Enterprise", "Touryuumon (V1.1)?", GAME_NO_SOUND ) // On first boot inputs won't work, TODO: hook-up default eeprom
No newline at end of file
src/mame/drivers/8080bw.c
r15474r15475
184184#include "cpu/m6800/m6800.h"
185185#include "cpu/i8085/i8085.h"
186186#include "machine/mb14241.h"
187#include "machine/eeprom.h"
187188#include "sound/speaker.h"
188189#include "includes/8080bw.h"
189190
r15474r15475
20042005
20052006*/
20062007
2007
2008
20092008static MACHINE_START( darthvdr )
20102009{
20112010   /* do nothing for now - different interrupt system */
r15474r15475
20832082
20842083MACHINE_CONFIG_END
20852084
2085
2086
20862087/*************************************
20872088 *
20882089 * Vortex (by Zilec AKA Zenitone-Microsec)
r15474r15475
22132214   auto_free(machine, buf1);
22142215}
22152216
2217
2218
22162219/* unknown gun game by Model Racing, possibly Gun Champ?
22172220
22182221BOARD 1:
r15474r15475
23562359
23572360MACHINE_CONFIG_END
23582361
2362
2363
23592364/* Taito Galactica / Space Missile
23602365This game was officially only distributed in Brazil.
23612366Not much information is avaliable. It is speculated that the original is "Space Missile", whose manufacturer was sued by Taito in Japan.
r15474r15475
24112416INPUT_PORTS_END
24122417
24132418
2419
2420/*****************************************************
2421
2422 Space Invaders Multigame kit, Braze Technologies,
2423 produced from 2002(version 1A) to 2006(version 3D).
2424 This is an 8-in-1 hack on a daughterboard, containing:
2425
2426 - 8080 CPU taken from main PCB
2427 - SST 29EE010 or AM27C010 (or other similar) 128KB EEPROM
2428   (EEPROM functionality not used)
2429 - 93C46P E2PROM for saving highscore/settings
2430 - PALCE22V10H-25PC/4
2431
2432 The kit is compatible with the original Midway boardset
2433
2434******************************************************/
2435
2436static INPUT_PORTS_START( invmulti )
2437   /* same as Midway Space Invaders, except that SW is unused */
2438   PORT_START("IN0")
2439   PORT_DIPUNUSED_DIPLOC( 0x01, 0x00, "SW:8" )
2440   PORT_BIT( 0x06, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mw8080bw_state,invaders_sw6_sw7_r, NULL)
2441   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_UNUSED )
2442   PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mw8080bw_state,invaders_in0_control_r, NULL)
2443   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mw8080bw_state,invaders_sw5_r, NULL)
2444
2445   PORT_START("IN1")
2446   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mw8080bw_state,invaders_coin_input_r, NULL)
2447   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
2448   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
2449   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_UNUSED )
2450   PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mw8080bw_state,invaders_in1_control_r, NULL)
2451   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
2452
2453   PORT_START("IN2")
2454   PORT_DIPUNUSED_DIPLOC( 0x01, 0x00, "SW:3" )
2455   PORT_DIPUNUSED_DIPLOC( 0x02, 0x00, "SW:4" )
2456   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED )
2457   PORT_DIPUNUSED_DIPLOC( 0x08, 0x00, "SW:2" )
2458   PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mw8080bw_state,invaders_in2_control_r, NULL)
2459   PORT_DIPUNUSED_DIPLOC( 0x80, 0x00, "SW:1" )
2460
2461   /* fake port for reading the coin input */
2462   PORT_START(INVADERS_COIN_INPUT_PORT_TAG)
2463   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_COIN1 )
2464   PORT_BIT( 0xfe, IP_ACTIVE_HIGH, IPT_UNUSED )
2465
2466   /* fake port for cabinet type */
2467   PORT_START(INVADERS_CAB_TYPE_PORT_TAG)
2468   PORT_CONFNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
2469   PORT_CONFSETTING(    0x00, DEF_STR( Upright ) )
2470   PORT_CONFSETTING(    0x01, DEF_STR( Cocktail ) )
2471   PORT_BIT( 0xfe, IP_ACTIVE_HIGH, IPT_UNUSED )
2472
2473   /* fake ports for handling the various input ports based on cabinet type */
2474   PORT_START(INVADERS_SW6_SW7_PORT_TAG)
2475   PORT_DIPUNUSED_DIPLOC( 0x01, 0x00, "SW:7" )
2476   PORT_DIPUNUSED_DIPLOC( 0x02, 0x00, "SW:6" )
2477   PORT_BIT( 0xfc, IP_ACTIVE_HIGH, IPT_UNUSED )
2478
2479   PORT_START(INVADERS_SW5_PORT_TAG)
2480   PORT_DIPUNUSED_DIPLOC( 0x01, 0x00, "SW:5" )
2481   PORT_BIT( 0xfe, IP_ACTIVE_HIGH, IPT_UNUSED )
2482
2483   PORT_START(INVADERS_P1_CONTROL_PORT_TAG)
2484   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1)
2485   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(1)
2486   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(1)
2487   PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED )
2488
2489   PORT_START(INVADERS_P2_CONTROL_PORT_TAG)
2490   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
2491   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2)
2492   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(2)
2493   PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED )
2494INPUT_PORTS_END
2495
2496static ADDRESS_MAP_START( invmulti_map, AS_PROGRAM, 8, _8080bw_state )
2497   AM_RANGE(0x0000, 0x1fff) AM_MIRROR(0x8000) AM_ROMBANK("bank1")
2498   AM_RANGE(0x2000, 0x3fff) AM_MIRROR(0x8000) AM_RAM AM_SHARE("main_ram")
2499   AM_RANGE(0x4000, 0x5fff) AM_MIRROR(0x8000) AM_ROMBANK("bank2")
2500   AM_RANGE(0x6000, 0x6000) AM_MIRROR(0x1fff) AM_READWRITE(invmulti_eeprom_r, invmulti_eeprom_w)
2501   AM_RANGE(0xe000, 0xe000) AM_MIRROR(0x1fff) AM_WRITE(invmulti_bank_w)
2502ADDRESS_MAP_END
2503
2504READ8_MEMBER(_8080bw_state::invmulti_eeprom_r)
2505{
2506   eeprom_device *eeprom = machine().device<eeprom_device>("eeprom");
2507   return eeprom->read_bit();
2508}
2509
2510WRITE8_MEMBER(_8080bw_state::invmulti_eeprom_w)
2511{
2512   eeprom_device *eeprom = machine().device<eeprom_device>("eeprom");
2513
2514   // d0: latch bit
2515   eeprom->write_bit(data & 1);
2516
2517   // d6: reset
2518   eeprom->set_cs_line((data & 0x40) ? CLEAR_LINE : ASSERT_LINE);
2519   
2520   // d4: write latch or select next bit to read
2521   eeprom->set_clock_line((data & 0x10) ? ASSERT_LINE : CLEAR_LINE);
2522}
2523
2524WRITE8_MEMBER(_8080bw_state::invmulti_bank_w)
2525{
2526   // d0, d4, d6: bank
2527   int bank = (data & 1) | (data >> 3 & 2) | (data >> 4 & 4);
2528   membank("bank1")->set_base(memregion("maincpu")->base() + bank * 0x4000 + 0x0000);
2529   membank("bank2")->set_base(memregion("maincpu")->base() + bank * 0x4000 + 0x2000);
2530}
2531
2532static MACHINE_RESET( invmulti )
2533{
2534   _8080bw_state *state = machine.driver_data<_8080bw_state>();
2535   
2536   state->invmulti_bank_w(*state->m_maincpu->memory().space(AS_PROGRAM), 0, 0);
2537
2538   MACHINE_RESET_CALL(mw8080bw);
2539}
2540
2541MACHINE_CONFIG_DERIVED_CLASS( invmulti, invaders, _8080bw_state )
2542
2543   /* basic machine hardware */
2544   MCFG_CPU_MODIFY("maincpu")
2545   MCFG_CPU_PROGRAM_MAP(invmulti_map)
2546   
2547   MCFG_EEPROM_93C46_8BIT_ADD("eeprom")
2548   
2549   MCFG_MACHINE_RESET(invmulti)
2550
2551MACHINE_CONFIG_END
2552
2553static DRIVER_INIT( invmulti )
2554{
2555   UINT8 *src = machine.root_device().memregion("user1")->base();
2556   int len = machine.root_device().memregion("user1")->bytes();
2557   UINT8 *dest = machine.root_device().memregion("maincpu")->base();
2558
2559   // decrypt rom
2560   for (int i = 0; i < len; i++)
2561      dest[i] = BITSWAP8(src[(i & 0x100ff) | (BITSWAP8(i >> 8 & 0xff, 7,3,4,5,0,6,1,2) << 8)],0,6,5,7,4,3,1,2);
2562}
2563
2564
2565
2566/**************************************************************************************************************/
2567
24142568ROM_START( searthin )
24152569   ROM_REGION( 0x10000, "maincpu", 0 )
24162570   ROM_LOAD( "earthinv.h",   0x0000, 0x0800, CRC(58a750c8) SHA1(90bfa4ea06f38e67fe4286d37d151632439249d2) )
r15474r15475
31273281ROM_END
31283282
31293283
3284ROM_START( invmulti )
3285   ROM_REGION( 0x20000, "maincpu", ROMREGION_ERASE00 ) // decrypted rom goes here
3286
3287   ROM_REGION( 0x20000, "user1", 0 )
3288   ROM_LOAD("m803d.bin", 0x00000, 0x20000, CRC(6a62cb3c) SHA1(eb7b567098ad596859f417dd5c59c2cf1ebf1154) )
3289ROM_END
3290
3291ROM_START( invmultim3a )
3292   ROM_REGION( 0x20000, "maincpu", ROMREGION_ERASE00 )
3293
3294   ROM_REGION( 0x20000, "user1", 0 )
3295   ROM_LOAD("m803a.bin", 0x00000, 0x20000, CRC(6d538828) SHA1(9a80c67abd32c4c8cd04320501a2aa4e2a308fc9) )
3296ROM_END
3297
3298ROM_START( invmultim2c )
3299   ROM_REGION( 0x20000, "maincpu", ROMREGION_ERASE00 )
3300
3301   ROM_REGION( 0x20000, "user1", 0 )
3302   ROM_LOAD("m802c.bin", 0x00000, 0x20000, CRC(5b537de5) SHA1(4d8a6b622b818e88383d011c25f8f34b7372db6d) )
3303ROM_END
3304
3305ROM_START( invmultim2a )
3306   ROM_REGION( 0x20000, "maincpu", ROMREGION_ERASE00 )
3307
3308   ROM_REGION( 0x20000, "user1", 0 )
3309   ROM_LOAD("m802a.bin", 0x00000, 0x20000, CRC(8079b1d0) SHA1(b13d910f314550eef468ee819b92788d2a002d82) )
3310ROM_END
3311
3312ROM_START( invmultim1a )
3313   ROM_REGION( 0x20000, "maincpu", ROMREGION_ERASE00 )
3314
3315   ROM_REGION( 0x20000, "user1", 0 )
3316   ROM_LOAD("m801a.bin", 0x00000, 0x20000, CRC(f28536d2) SHA1(08ef3ea3fac38c7a478f094bfa7c369ac39515c4) )
3317ROM_END
3318
3319ROM_START( invmultit3d )
3320   ROM_REGION( 0x20000, "maincpu", ROMREGION_ERASE00 )
3321
3322   ROM_REGION( 0x20000, "user1", 0 )
3323   ROM_LOAD("t803d.bin", 0x00000, 0x20000, CRC(4d53173c) SHA1(a9caf7fd8e2fea86ca1cf7edc104bdacf09203f8) )
3324ROM_END
3325
3326ROM_START( invmultis3a )
3327   ROM_REGION( 0x20000, "maincpu", ROMREGION_ERASE00 )
3328
3329   ROM_REGION( 0x20000, "user1", 0 )
3330   ROM_LOAD("s083a.bin", 0x00000, 0x20000, CRC(f426d43b) SHA1(a299472f1d65f356ec01ca7cc8d3039abac20019) )
3331ROM_END
3332
3333ROM_START( invmultis2a )
3334   ROM_REGION( 0x20000, "maincpu", ROMREGION_ERASE00 )
3335
3336   ROM_REGION( 0x20000, "user1", 0 )
3337   ROM_LOAD("s082a.bin", 0x00000, 0x20000, CRC(25f0f17e) SHA1(a3ccf823399e23dd9fdb38fd58c0acfe80b57fe3) )
3338ROM_END
3339
3340ROM_START( invmultis1a )
3341   ROM_REGION( 0x20000, "maincpu", ROMREGION_ERASE00 )
3342
3343   ROM_REGION( 0x20000, "user1", 0 )
3344   ROM_LOAD("s081a.bin", 0x00000, 0x20000, CRC(daa77345) SHA1(0fdc9c2a6d9c0aa3233c5d31433adb1ea4e5b250) )
3345ROM_END
3346
3347
31303348ROM_START( rollingc )
31313349   ROM_REGION( 0x10000, "maincpu", 0 )
31323350   ROM_LOAD( "rc01.bin",     0x0000, 0x0400, CRC(66fa50bf) SHA1(7451d4ff8d3b351a324aaecdbdc5b46672f5fdd0) )
r15474r15475
35083726GAME( 19??, spacmiss, galactic, invaders, galactic, 0, ROT270, "bootleg?", "Space Missile - Space Fighting Game", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND )
35093727
35103728/* Misc. manufacturers */
3511
35123729GAMEL(1980, searthin, invaders, invaders, searthin, 0, ROT270, "bootleg", "Super Earth Invasion (set 1)", GAME_SUPPORTS_SAVE, layout_invaders )
35133730GAMEL(1980, searthina,invaders, invaders, searthin, 0, ROT270, "bootleg", "Super Earth Invasion (set 2)", GAME_SUPPORTS_SAVE, layout_invaders )
35143731GAMEL(1978, invadrmr, invaders, invaders, invadrmr, 0, ROT270, "bootleg? (Model Racing)", "Space Invaders (Model Racing)", GAME_SUPPORTS_SAVE, layout_invaders )
r15474r15475
35543771GAMEL(1979, shuttlei, 0,        shuttlei, shuttlei, 0, ROT270, "Omori Electric Co., Ltd.", "Shuttle Invader", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND | GAME_NO_COCKTAIL, layout_shuttlei )
35553772GAMEL(1979, skylove,  0,        shuttlei, skylove,  0, ROT270, "Omori Electric Co., Ltd.", "Sky Love", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND | GAME_NO_COCKTAIL, layout_shuttlei )
35563773GAME (19??, modelr,   0,        modelr,   invadrmr, 0, ROT0,   "Model Racing", "unknown Model Racing gun game", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) // no titlescreen
3774
3775GAME( 2002, invmulti,    0,        invmulti, invmulti, invmulti, ROT270, "hack (Braze Technologies)", "Space Invaders Multigame (M8.03D)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
3776GAME( 2002, invmultim3a, invmulti, invmulti, invmulti, invmulti, ROT270, "hack (Braze Technologies)", "Space Invaders Multigame (M8.03A)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
3777GAME( 2002, invmultim2c, invmulti, invmulti, invmulti, invmulti, ROT270, "hack (Braze Technologies)", "Space Invaders Multigame (M8.02C)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
3778GAME( 2002, invmultim2a, invmulti, invmulti, invmulti, invmulti, ROT270, "hack (Braze Technologies)", "Space Invaders Multigame (M8.02A)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
3779GAME( 2002, invmultim1a, invmulti, invmulti, invmulti, invmulti, ROT270, "hack (Braze Technologies)", "Space Invaders Multigame (M8.01A)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
3780GAME( 2002, invmultit3d, invmulti, invmulti, invmulti, invmulti, ROT270, "hack (Braze Technologies)", "Space Invaders Multigame (T8.03D)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
3781GAME( 2002, invmultis3a, invmulti, invmulti, invmulti, invmulti, ROT270, "hack (Braze Technologies)", "Space Invaders Multigame (S0.83A)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
3782GAME( 2002, invmultis2a, invmulti, invmulti, invmulti, invmulti, ROT270, "hack (Braze Technologies)", "Space Invaders Multigame (S0.82A)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
3783GAME( 2002, invmultis1a, invmulti, invmulti, invmulti, invmulti, ROT270, "hack (Braze Technologies)", "Space Invaders Multigame (S0.81A)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
src/mame/drivers/igs011.c
r15474r15475
323296 Long Hu Bang II V185H   NO-0115    M6295 YM2413  IGS011 8255
333396 Wan Li Chang Cheng      ?
343496 Xing Yen Man Guan       ?
3598 Mj Nenrikishu SP        NO-0115-5  M6295 YM2413  IGS011 8255
3598 Mj Nenrikishu SP V250J  NO-0115-5  M6295 YM2413  IGS011 8255
3636---------------------------------------------------------------------------
3737
3838To do:
3939
4040- Implement the I/O part of IGS003 as an 8255
41- IGS003 parametric bitswap protection in lhb2, vbowl (instead of patching the roms)
41- IGS003 parametric bitswap protection in lhb2, nkishusp, vbowl (instead of patching the roms)
4242- Interrupt controller at 838000 or a38000 (there's a preliminary implementation for lhb)
4343- A few graphical bugs
4444
r15474r15475
432432               blitter.x,blitter.y,blitter.w,blitter.h,blitter.gfx_hi,blitter.gfx_lo,blitter.depth,blitter.pen,blitter.flags);
433433#endif
434434
435   dest   =   m_layer[      blitter.flags & 0x0007   ];
435   dest   =   m_layer[   blitter.flags & 0x0007   ];
436436   opaque   =          !(blitter.flags & 0x0008);
437437   clear   =            blitter.flags & 0x0010;
438438   flipx   =            blitter.flags & 0x0020;
439439   flipy   =            blitter.flags & 0x0040;
440   if               (!(blitter.flags & 0x0400)) return;
440   if               (!(blitter.flags & 0x0400))
441      return;
441442
442443   pen_hi   =   (m_lhb2_pen_hi & 0x07) << 5;
443444
r15474r15475
544545   for (i = 0; i < NUM; i++)
545546      if ((~m_igs_dips_sel) & (1 << i) )
546547         ret = ioport(dipnames[i])->read();
547   /* 0x0100 is blitter busy */
548
549   // 0x0100 is blitter busy
548550   return   (ret & 0xff) | 0x0000;
549551}
550552
r15474r15475
729731}
730732
731733
732// To be done (similar to lhb2?)
734// xor similar to ryukobou (both sets are Japan), address scrambling from lhb2
733735static void nkishusp_decrypt(running_machine &machine)
734736{
735//  lhb_decrypt(machine);
736//  dbc_decrypt(machine);
737//  lhb2_decrypt(machine);
738//  drgnwrld_type1_decrypt(machine);
739//  drgnwrld_type2_decrypt(machine);
740//  drgnwrld_type3_decrypt(machine);
741//  wlcc_decrypt(machine);
742//  vbowlj_decrypt(machine);
743
744737   int i,j;
745738   int rom_size = 0x80000;
746739   UINT16 *src = (UINT16 *) (machine.root_device().memregion("maincpu")->base());
r15474r15475
750743   {
751744      UINT16 x = src[i];
752745
753      if ((i & 0x0054) != 0x0000 && (i & 0x0056) != 0x0010)
754         x ^= 0x0004;
746      // lhb2 address scrambling
747      j = BITSWAP24(i, 23,22,21,20,19,18,17,16,15,14,13, 8, 11,10, 9, 2, 7,6,5,4,3, 12, 1,0);
755748
756//      if ((i & 0x0204) == 0x0000)
757//          x ^= 0x0008;
749      // ryukobou xor:
758750
759      if ((i & 0x3080) != 0x3080 && (i & 0x3090) != 0x3010)
751//      if ( (j & 0x00100) && (j & 0x00400) )
752//         x ^= 0x0200;
753
754      if ( !(j & 0x00004) || !(j & 0x02000) || (!(j & 0x00080) && !(j & 0x00010) ) )
760755         x ^= 0x0020;
761756
762      j = BITSWAP24(i, 23,22,21,20,19,18,17,16,15,14,13, 8, 11,10, 9, 2, 7,6,5,4,3, 12, 1,0);
757      if ( (j & 0x00100) || (j & 0x00040) || ( (j & 0x00010)&&(j & 0x00002) ) )
758         x ^= 0x00004;
763759
760      // additional xor:
761
762      if ( !(j & 0x4000) && (j & 0x1000) && (j & 0x00200) )
763         x ^= 0x0008;
764
764765      result_data[j] = x;
765766   }
766767
r15474r15475
19611962/*
19621963    // PROTECTION CHECKS
19631964    rom[0x04c42/2]  =   0x602e;     // 004C42: 6604         bne 4c48  (rom test error otherwise)
1965
19641966    rom[0x08694/2]  =   0x6008;     // 008694: 6408         bcc 869e  (fills screen with characters otherwise)
19651967    rom[0x0a05e/2]  =   0x4e71;     // 00A05E: 6408         bcc a068  (fills screen with characters otherwise)
19661968    rom[0x0bec2/2]  =   0x6008;     // 00BEC2: 6408         bcc becc  (fills screen with characters otherwise)
r15474r15475
20622064   // PROTECTION CHECKS
20632065   rom[0x034f4/2]   =   0x4e71;      // 0034F4: 660E    bne 3504   (rom test, fills palette with white otherwise)
20642066   rom[0x03502/2]   =   0x6032;      // 003502: 6732    beq 3536   (rom test, fills palette with white otherwise)
2067
20652068   rom[0x1afea/2]   =   0x6034;      // 01AFEA: 6734    beq 1b020  (fills palette with black otherwise)
20662069//  rom[0x24b8a/2]  =   0x6036;     // 024B8A: 6736    beq 24bc2  (fills palette with green otherwise)
20672070//  rom[0x29ef8/2]  =   0x6036;     // 029EF8: 6736    beq 29f30  (fills palette with red otherwise)
r15474r15475
21232126
21242127static DRIVER_INIT( nkishusp )
21252128{
2129   UINT16 *rom = (UINT16 *) machine.root_device().memregion("maincpu")->base();
2130
21262131   nkishusp_decrypt(machine);
2132   lhb2_decrypt_gfx(machine);
21272133
2128   // PROTECTION CHECKS (similar to lhb2?)
2134   // PROTECTION CHECKS (similar to lhb2)
2135
2136   rom[0x03624/2]   =   0x6042;      // 003624: 660E      bne     $3634 (ROM test)
2137
2138   rom[0x1a9d2/2]   =   0x6034;      // 01A9D2: 6734      beq     $1aa08
2139   rom[0x26306/2]   =   0x6036;      // 026306: 6736      beq     $2633e
2140   rom[0x29190/2]   =   0x6038;      // 029190: 6E38      bgt     $291ca (system error)
2141   rom[0x2b82a/2]   =   0x6036;      // 02B82A: 6736      beq     $2b862
2142   rom[0x2ff20/2]   =   0x6036;      // 02FF20: 6736      beq     $2ff58
2143   rom[0x3151c/2]   =   0x6036;      // 03151C: 6736      beq     $31554
2144   rom[0x33dfc/2]   =   0x6036;      // 033DFC: 6736      beq     $33e34
2145   rom[0x3460e/2]   =   0x6038;      // 03460E: 6E38      bgt     $34648 (system error)
2146   rom[0x3f09e/2]   =   0x6034;      // 03F09E: 6734      beq     $3f0d4
2147   rom[0x406a8/2]   =   0x6036;      // 0406A8: 6736      beq     $406e0
2148   rom[0x4376a/2]   =   0x6034;      // 04376A: 6734      beq     $437a0
2149   rom[0x462d6/2]   =   0x6034;      // 0462D6: 6734      beq     $4630c
2150   rom[0x471ec/2]   =   0x6036;      // 0471EC: 6E36      bgt     $47224 (system error)
2151   rom[0x49c46/2]   =   0x6000;      // 049C46: 6700 0444 beq     $4a08c
2152   rom[0x4a2b6/2]   =   0x6036;      // 04A2B6: 6736      beq     $4a2ee
2153   rom[0x4c67a/2]   =   0x6038;      // 04C67A: 6E38      bgt     $4c6b4 (system error)
21292154}
21302155
21312156
r15474r15475
22622287   AM_RANGE( 0x010000, 0x010001 ) AM_WRITE(lhb_okibank_w )
22632288
22642289   AM_RANGE( 0x010200, 0x0103ff ) AM_WRITE(igs011_prot2_inc_w         )   // inc  (33)
2265   AM_RANGE( 0x010400, 0x0105ff ) AM_WRITE(lhb_igs011_prot2_swap_w   )   // swap (33)
2290   AM_RANGE( 0x010400, 0x0105ff ) AM_WRITE(lhb_igs011_prot2_swap_w      )   // swap (33)
22662291   AM_RANGE( 0x010600, 0x0107ff ) AM_READ(lhb_igs011_prot2_r         )   // read
22672292   // no reset
22682293
r15474r15475
23002325
23012326   AM_RANGE( 0x518000, 0x5181ff ) AM_WRITE(igs011_prot2_inc_w         )   // inc   (33)
23022327   AM_RANGE( 0x518200, 0x5183ff ) AM_WRITE(wlcc_igs011_prot2_swap_w   )   // swap  (33)
2303   AM_RANGE( 0x518800, 0x5189ff ) AM_READ(igs011_prot2_reset_r      )   // reset
2328   AM_RANGE( 0x518800, 0x5189ff ) AM_READ(igs011_prot2_reset_r         )   // reset
23042329   AM_RANGE( 0x519000, 0x5195ff ) AM_READ(lhb_igs011_prot2_r         )   // read
23052330
23062331   AM_RANGE( 0x000000, 0x07ffff ) AM_ROM
r15474r15475
23382363//  AM_RANGE( 0x01ff88, 0x01ff89 ) AM_READ ( igs011_prot1_r )
23392364
23402365   AM_RANGE( 0x020000, 0x0201ff ) AM_WRITE(igs011_prot2_inc_w         )   // inc   (55)
2341   AM_RANGE( 0x020200, 0x0203ff ) AM_WRITE(lhb_igs011_prot2_swap_w   )   // swap  (33)
2342   AM_RANGE( 0x020400, 0x0205ff ) AM_READ(lhb2_igs011_prot2_r      )   // read
2366   AM_RANGE( 0x020200, 0x0203ff ) AM_WRITE(lhb_igs011_prot2_swap_w      )   // swap  (33)
2367   AM_RANGE( 0x020400, 0x0205ff ) AM_READ(lhb2_igs011_prot2_r         )   // read
23432368   AM_RANGE( 0x020600, 0x0207ff ) AM_WRITE(igs011_prot2_reset_w      )   // reset (55)
23442369
23452370   AM_RANGE( 0x000000, 0x07ffff ) AM_ROM
r15474r15475
23702395   AM_RANGE( 0xa88000, 0xa88001 ) AM_READ(igs_3_dips_r )
23712396ADDRESS_MAP_END
23722397
2398
2399
2400static ADDRESS_MAP_START( nkishusp, AS_PROGRAM, 16, igs011_state )
2401//  nkishusp: IGS011 protection dynamically mapped at 1ff8x
2402//  AM_RANGE( 0x01ff80, 0x01ff87 ) AM_WRITE(igs011_prot1_w )
2403//  AM_RANGE( 0x01ff88, 0x01ff89 ) AM_READ ( igs011_prot1_r )
2404
2405   // to be done:
2406   AM_RANGE( 0x023000, 0x0231ff ) AM_WRITE(igs011_prot2_inc_w         )   // inc   (55)
2407   AM_RANGE( 0x023200, 0x0233ff ) AM_WRITE(lhb_igs011_prot2_swap_w      )   // swap  (33)
2408   AM_RANGE( 0x023400, 0x0235ff ) AM_READ(lhb2_igs011_prot2_r         )   // read
2409   AM_RANGE( 0x023600, 0x0237ff ) AM_WRITE(igs011_prot2_reset_w      )   // reset (55)
2410
2411   AM_RANGE( 0x000000, 0x07ffff ) AM_ROM
2412   AM_RANGE( 0x100000, 0x103fff ) AM_RAM AM_SHARE("nvram")
2413   AM_RANGE( 0x200000, 0x200001 ) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff )
2414   AM_RANGE( 0x204000, 0x204003 ) AM_DEVWRITE8_LEGACY("ymsnd", ym2413_w, 0x00ff )
2415   AM_RANGE( 0x208000, 0x208003 ) AM_WRITE(lhb2_igs003_w )
2416   AM_RANGE( 0x208002, 0x208003 ) AM_READ(lhb2_igs003_r )
2417   AM_RANGE( 0x20c000, 0x20cfff ) AM_RAM AM_SHARE("priority_ram")
2418   AM_RANGE( 0x210000, 0x211fff ) AM_RAM_WRITE(igs011_palette ) AM_SHARE("paletteram")
2419   AM_RANGE( 0x214000, 0x214001 ) AM_READ_PORT( "COIN" )
2420   AM_RANGE( 0x300000, 0x3fffff ) AM_READWRITE(igs011_layers_r, igs011_layers_w )
2421   AM_RANGE( 0xa20000, 0xa20001 ) AM_WRITE(igs011_priority_w )
2422   AM_RANGE( 0xa38000, 0xa38001 ) AM_WRITE(lhb_irq_enable_w )
2423   AM_RANGE( 0xa40000, 0xa40001 ) AM_WRITE(igs_dips_w )
2424
2425   AM_RANGE( 0xa50000, 0xa50001 ) AM_WRITE(igs011_prot_addr_w )
2426//  AM_RANGE( 0xa50000, 0xa50005 ) AM_READ(igs011_prot_fake_r )
2427
2428   AM_RANGE( 0xa58000, 0xa58001 ) AM_WRITE(igs011_blit_x_w )
2429   AM_RANGE( 0xa58800, 0xa58801 ) AM_WRITE(igs011_blit_y_w )
2430   AM_RANGE( 0xa59000, 0xa59001 ) AM_WRITE(igs011_blit_w_w )
2431   AM_RANGE( 0xa59800, 0xa59801 ) AM_WRITE(igs011_blit_h_w )
2432   AM_RANGE( 0xa5a000, 0xa5a001 ) AM_WRITE(igs011_blit_gfx_lo_w )
2433   AM_RANGE( 0xa5a800, 0xa5a801 ) AM_WRITE(igs011_blit_gfx_hi_w )
2434   AM_RANGE( 0xa5b000, 0xa5b001 ) AM_WRITE(igs011_blit_flags_w )
2435   AM_RANGE( 0xa5b800, 0xa5b801 ) AM_WRITE(igs011_blit_pen_w )
2436   AM_RANGE( 0xa5c000, 0xa5c001 ) AM_WRITE(igs011_blit_depth_w )
2437   AM_RANGE( 0xa88000, 0xa88001 ) AM_READ(igs_3_dips_r )
2438ADDRESS_MAP_END
2439
2440
2441
23732442/* trap15's note:
23742443 * TODO: change this horrible device-> chain to be proper.
23752444 */
r15474r15475
24502519   AM_RANGE( 0x00d400, 0x00d43f ) AM_WRITE(igs011_prot2_dec_w            )   // dec   (33)
24512520   AM_RANGE( 0x00d440, 0x00d47f ) AM_WRITE(drgnwrld_igs011_prot2_swap_w   )   // swap  (33)
24522521   AM_RANGE( 0x00d480, 0x00d4bf ) AM_WRITE(igs011_prot2_reset_w         )   // reset (33)
2453   AM_RANGE( 0x00d4c0, 0x00d4ff ) AM_READ(drgnwrldv20j_igs011_prot2_r   )   // read
2522   AM_RANGE( 0x00d4c0, 0x00d4ff ) AM_READ(drgnwrldv20j_igs011_prot2_r      )   // read
24542523
24552524   AM_RANGE( 0x50f000, 0x50f1ff ) AM_WRITE(igs011_prot2_dec_w         )   // dec   (33)
24562525   AM_RANGE( 0x50f200, 0x50f3ff ) AM_WRITE(vbowl_igs011_prot2_swap_w   )   // swap  (33)
24572526   AM_RANGE( 0x50f400, 0x50f5ff ) AM_WRITE(igs011_prot2_reset_w      )   // reset (33)
2458   AM_RANGE( 0x50f600, 0x50f7ff ) AM_READ(vbowl_igs011_prot2_r      )   // read
2527   AM_RANGE( 0x50f600, 0x50f7ff ) AM_READ(vbowl_igs011_prot2_r         )   // read
24592528
24602529   AM_RANGE( 0x902000, 0x902fff ) AM_WRITE(igs012_prot_reset_w   )   // reset?
24612530//  AM_RANGE( 0x902000, 0x902005 ) AM_WRITE(igs012_prot_fake_r )
r15474r15475
28002869   PORT_DIPSETTING(    0x02, "70" )
28012870   PORT_DIPSETTING(    0x01, "74" )
28022871   PORT_DIPSETTING(    0x00, "78" )
2803   PORT_DIPNAME( 0x08, 0x08, "Odds Rate" )
2872   PORT_DIPNAME( 0x08, 0x00, "Odds Rate" )
2873   PORT_DIPSETTING(    0x00, "1,2,3,4,5,6,7,8" )
28042874   PORT_DIPSETTING(    0x08, "1,2,3,5,8,15,30,50" )
2805   PORT_DIPSETTING(    0x00, "1,2,3,4,5,6,7,8" )
2806   PORT_DIPNAME( 0x10, 0x10, "Max Bet" )
2875   PORT_DIPNAME( 0x10, 0x00, "Max Bet" )
28072876   PORT_DIPSETTING(    0x00, "5" )
28082877   PORT_DIPSETTING(    0x10, "10" )
2809   PORT_DIPNAME( 0x60, 0x60, "Min Credits To Start" )
2878   PORT_DIPNAME( 0x60, 0x60, "Min Bet" )
28102879   PORT_DIPSETTING(    0x60, "1" )
28112880   PORT_DIPSETTING(    0x40, "2" )
28122881   PORT_DIPSETTING(    0x20, "3" )
r15474r15475
29202989INPUT_PORTS_END
29212990
29222991
2992static INPUT_PORTS_START( nkishusp )
2993   PORT_START("DSW1")
2994   PORT_DIPNAME( 0x07, 0x02, "Pay Out (%)" )
2995   PORT_DIPSETTING(    0x07, "74" )
2996   PORT_DIPSETTING(    0x06, "77" )
2997   PORT_DIPSETTING(    0x05, "80" )
2998   PORT_DIPSETTING(    0x04, "83" )
2999   PORT_DIPSETTING(    0x03, "86" )
3000   PORT_DIPSETTING(    0x02, "89" )
3001   PORT_DIPSETTING(    0x01, "92" )
3002   PORT_DIPSETTING(    0x00, "95" )
3003   PORT_DIPNAME( 0x08, 0x00, "Odds Rate" )
3004   PORT_DIPSETTING(    0x00, "1,2,3,4,5,6,7,8" )
3005   PORT_DIPSETTING(    0x08, "1,2,3,5,8,15,30,50" )
3006   PORT_DIPNAME( 0x10, 0x00, "Max Bet" )
3007   PORT_DIPSETTING(    0x00, "5" )
3008   PORT_DIPSETTING(    0x10, "10" )
3009   PORT_DIPNAME( 0x60, 0x60, "Min Bet" )
3010   PORT_DIPSETTING(    0x60, "1" )
3011   PORT_DIPSETTING(    0x40, "2" )
3012   PORT_DIPSETTING(    0x20, "3" )
3013   PORT_DIPSETTING(    0x00, "5" )
3014   PORT_DIPNAME( 0x80, 0x00, "Credit Timer" )
3015   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
3016   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3017
3018   PORT_START("DSW2")
3019   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) )   // Only when bit 3 = 1
3020   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
3021   PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ) )
3022   PORT_DIPSETTING(    0x02, DEF_STR( 1C_2C ) )
3023   PORT_DIPSETTING(    0x01, DEF_STR( 1C_3C ) )
3024   PORT_DIPNAME( 0x04, 0x04, "Credits Per Note" )   // Only when bit 3 = 0
3025   PORT_DIPSETTING(    0x04, "10" )
3026   PORT_DIPSETTING(    0x00, "100" )
3027   PORT_DIPNAME( 0x08, 0x08, "Money Type" )   // Decides whether to use bits 0&1 or bit 2
3028   PORT_DIPSETTING(    0x08, "Coins" )
3029   PORT_DIPSETTING(    0x00, "Notes" )
3030   PORT_DIPNAME( 0x10, 0x10, "Auto Play" )
3031   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3032   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
3033   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Demo_Sounds ) )
3034   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3035   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
3036   PORT_DIPNAME( 0x40, 0x40, "Undress Girl" )
3037   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
3038   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3039   PORT_DIPUNKNOWN( 0x80, 0x80 )
3040
3041   PORT_START("DSW3")
3042   PORT_DIPNAME( 0x03, 0x03, "Credit Limit" )
3043   PORT_DIPSETTING(    0x03, "500" )
3044   PORT_DIPSETTING(    0x02, "1000" )
3045   PORT_DIPSETTING(    0x01, "2000" )
3046   PORT_DIPSETTING(    0x00, "30000" )
3047   PORT_DIPUNKNOWN( 0x04, 0x04 )
3048   PORT_DIPUNKNOWN( 0x08, 0x08 )
3049   PORT_DIPNAME( 0x70, 0x70, DEF_STR( Unknown ) )
3050   PORT_DIPSETTING(    0x70, "1 : 1" )
3051   PORT_DIPSETTING(    0x60, "1 : 2" )
3052   PORT_DIPSETTING(    0x50, "1 : 5" )
3053   PORT_DIPSETTING(    0x40, "1 : 6" )
3054   PORT_DIPSETTING(    0x30, "1 : 7" )
3055   PORT_DIPSETTING(    0x20, "1 : 8" )
3056   PORT_DIPSETTING(    0x10, "1 : 9" )
3057   PORT_DIPSETTING(    0x00, "1 : 10" )
3058   PORT_DIPUNKNOWN( 0x80, 0x80 )
3059
3060   PORT_START("COIN")
3061   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1    )
3062   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 )   // data clear
3063   PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW )   // keep pressed while booting
3064   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, igs011_state,igs_hopper_r, (void *)0)   // hopper switch
3065   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE2 )   // stats
3066   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER    ) PORT_NAME("Pay Out") PORT_CODE(KEYCODE_O)   // clear coin
3067   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN  )
3068   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN  )
3069
3070   PORT_START("KEY0")
3071   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A )
3072   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_E )
3073   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_I )
3074   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_M )
3075   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_KAN )
3076   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 )
3077   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )   // ? set to 0 both
3078   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )   // ? and you can't start a game
3079
3080   PORT_START("KEY1")
3081   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_B )
3082   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_F )
3083   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_J )
3084   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_N )
3085   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_REACH )
3086   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_BET )
3087   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
3088   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
3089
3090   PORT_START("KEY2")
3091   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_C )
3092   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_G )
3093   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_K )
3094   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_CHI )
3095   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_RON )
3096   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
3097   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
3098   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
3099
3100   PORT_START("KEY3")
3101   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_D )
3102   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_H )
3103   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_L )
3104   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_PON )
3105   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
3106   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
3107   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
3108   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
3109
3110   PORT_START("KEY4")
3111   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
3112   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
3113   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
3114   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
3115   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
3116   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
3117   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
3118   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
3119INPUT_PORTS_END
3120
3121
29233122static INPUT_PORTS_START( wlcc )
29243123   PORT_START("DSW1")
29253124   PORT_DIPUNKNOWN( 0x01, 0x01 )
r15474r15475
29373136   PORT_DIPSETTING(    0x02, "1500" )
29383137   PORT_DIPSETTING(    0x01, "2000" )
29393138   PORT_DIPSETTING(    0x00, "3000" )
2940   PORT_DIPNAME( 0x0c, 0x0c, "Min Credits To Start" )
3139   PORT_DIPNAME( 0x0c, 0x0c, "Min Bet" )
29413140   PORT_DIPSETTING(    0x0c, "1" )
29423141   PORT_DIPSETTING(    0x08, "2" )
29433142   PORT_DIPSETTING(    0x04, "3" )
r15474r15475
30293228   PORT_DIPSETTING(    0x20, "2" )
30303229   PORT_DIPSETTING(    0x10, "3" )
30313230   PORT_DIPSETTING(    0x00, "4" )
3032   PORT_DIPNAME( 0xc0, 0xc0, "Max Bet" )
3231   PORT_DIPNAME( 0xc0, 0x80, "Max Bet" )
30333232   PORT_DIPSETTING(    0xc0, "1" )
30343233   PORT_DIPSETTING(    0x80, "5" )
30353234   PORT_DIPSETTING(    0x40, "10" )
r15474r15475
30413240   PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ) )
30423241   PORT_DIPSETTING(    0x02, DEF_STR( 1C_2C ) )
30433242   PORT_DIPSETTING(    0x01, DEF_STR( 1C_3C ) )
3044   PORT_DIPNAME( 0x0c, 0x0c, "Min Credits To Start" )
3243   PORT_DIPNAME( 0x0c, 0x0c, "Min Bet" )
30453244   PORT_DIPSETTING(    0x0c, "1" )
30463245   PORT_DIPSETTING(    0x08, "2" )
30473246   PORT_DIPSETTING(    0x04, "3" )
r15474r15475
34243623   PORT_DIPSETTING(    0x02, "1500" )
34253624   PORT_DIPSETTING(    0x01, "2000" )
34263625   PORT_DIPSETTING(    0x00, "3000" )
3427   PORT_DIPNAME( 0x0c, 0x0c, "Min Credits To Start" )
3626   PORT_DIPNAME( 0x0c, 0x0c, "Min Bet" )
34283627   PORT_DIPSETTING(    0x0c, "1" )
34293628   PORT_DIPSETTING(    0x08, "2" )
34303629   PORT_DIPSETTING(    0x04, "3" )
r15474r15475
36103809MACHINE_CONFIG_END
36113810
36123811
3613static TIMER_DEVICE_CALLBACK ( drgnworld_timer_irq_cb )
3812static TIMER_DEVICE_CALLBACK ( lev5_timer_irq_cb )
36143813{
36153814   igs011_state *state = timer.machine().driver_data<igs011_state>();
36163815
r15474r15475
36213820   MCFG_CPU_MODIFY("maincpu")
36223821   MCFG_CPU_PROGRAM_MAP(drgnwrld)
36233822   MCFG_CPU_VBLANK_INT("screen",irq6_line_hold)
3624   MCFG_TIMER_ADD_PERIODIC("timer_irq", drgnworld_timer_irq_cb, attotime::from_hz(240)) // lev5 frequency drives the music tempo
3823   MCFG_TIMER_ADD_PERIODIC("timer_irq", lev5_timer_irq_cb, attotime::from_hz(240)) // lev5 frequency drives the music tempo
36253824
3626   MCFG_SOUND_ADD("ymsnd", YM3812, 3579545)
3825   MCFG_SOUND_ADD("ymsnd", YM3812, XTAL_3_579545MHz)
36273826   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 2.0)
36283827MACHINE_CONFIG_END
36293828
r15474r15475
36623861
36633862
36643863
3665static TIMER_DEVICE_CALLBACK ( wlcc_timer_irq_cb )
3864static TIMER_DEVICE_CALLBACK ( lev3_timer_irq_cb )
36663865{
36673866   igs011_state *state = timer.machine().driver_data<igs011_state>();
36683867
r15474r15475
36743873   MCFG_CPU_MODIFY("maincpu")
36753874   MCFG_CPU_PROGRAM_MAP(wlcc)
36763875   MCFG_CPU_VBLANK_INT("screen",irq6_line_hold)
3677   MCFG_TIMER_ADD_PERIODIC("timer_irq", wlcc_timer_irq_cb, attotime::from_hz(240)) // lev3 frequency drives the music tempo
3876   MCFG_TIMER_ADD_PERIODIC("timer_irq", lev3_timer_irq_cb, attotime::from_hz(240)) // lev3 frequency drives the music tempo
36783877MACHINE_CONFIG_END
36793878
36803879
r15474r15475
36833882   MCFG_CPU_MODIFY("maincpu")
36843883   MCFG_CPU_PROGRAM_MAP(xymg)
36853884   MCFG_CPU_VBLANK_INT("screen",irq6_line_hold)
3686   MCFG_TIMER_ADD_PERIODIC("timer_irq", wlcc_timer_irq_cb, attotime::from_hz(240)) // lev3 frequency drives the music tempo
3885   MCFG_TIMER_ADD_PERIODIC("timer_irq", lev3_timer_irq_cb, attotime::from_hz(240)) // lev3 frequency drives the music tempo
36873886MACHINE_CONFIG_END
36883887
36893888
r15474r15475
36923891   MCFG_CPU_MODIFY("maincpu")
36933892   MCFG_CPU_PROGRAM_MAP(lhb2)
36943893   MCFG_CPU_VBLANK_INT("screen",irq6_line_hold)
3695   MCFG_TIMER_ADD_PERIODIC("timer_irq", drgnworld_timer_irq_cb, attotime::from_hz(240)) // lev5 frequency drives the music tempo
3894   MCFG_TIMER_ADD_PERIODIC("timer_irq", lev5_timer_irq_cb, attotime::from_hz(240)) // lev5 frequency drives the music tempo
36963895
36973896//  MCFG_GFXDECODE(igs011_hi)
36983897
3699   MCFG_SOUND_ADD("ymsnd", YM2413, 3579545)
3898   MCFG_SOUND_ADD("ymsnd", YM2413, XTAL_3_579545MHz)
37003899   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 2.0)
37013900MACHINE_CONFIG_END
37023901
37033902
37043903
3904static MACHINE_CONFIG_DERIVED( nkishusp, igs011_base )
3905   MCFG_CPU_MODIFY("maincpu")
3906   MCFG_CPU_PROGRAM_MAP(nkishusp)
3907   MCFG_CPU_VBLANK_INT("screen",irq6_line_hold)
3908   MCFG_TIMER_ADD_PERIODIC("timer_irq", lev3_timer_irq_cb, attotime::from_hz(240)) // lev3 frequency drives the music tempo
3909
3910   // VSync 60.0052Hz, HSync 15.620kHz
3911
3912//  MCFG_GFXDECODE(igs011_hi)
3913
3914   MCFG_SOUND_ADD("ymsnd", YM2413, XTAL_3_579545MHz)
3915   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 2.0)
3916MACHINE_CONFIG_END
3917
3918
3919
37053920static void sound_irq(device_t *device, int state)
37063921{
37073922//   cputag_set_input_line(machine, "maincpu", 3, state);
r15474r15475
37113926   MCFG_CPU_MODIFY("maincpu")
37123927   MCFG_CPU_PROGRAM_MAP(vbowl)
37133928   MCFG_CPU_VBLANK_INT("screen",irq6_line_hold)
3714   MCFG_TIMER_ADD_PERIODIC("timer_irq", wlcc_timer_irq_cb, attotime::from_hz(240)) // lev3 frequency drives the music tempo
3929   MCFG_TIMER_ADD_PERIODIC("timer_irq", lev3_timer_irq_cb, attotime::from_hz(240)) // lev3 frequency drives the music tempo
37153930   // irq 5 points to a debug function (all routines are clearly patched out)
37163931   // irq 4 points to an apparently unneeded routine
37173932
r15474r15475
39854200   ROM_LOAD16_WORD_SWAP( "wlcc4096.rom", 0x00000, 0x80000, CRC(3b16729f) SHA1(4ef4e5cbd6ccc65775e36c2c8b459bc1767d6574) )
39864201   ROM_CONTINUE        (                 0x00000, 0x80000 ) // 1ST+2ND IDENTICAL
39874202
3988   ROM_REGION( 0x280000, "blitter", ROMREGION_ERASE00 )
4203   ROM_REGION( 0x280000, "blitter", 0 )
39894204   ROM_LOAD( "m0201-ig.160", 0x000000, 0x200000, CRC(ec54452c) SHA1(0ee7ffa3d4845af083944e64faf5a1c78247aaa2) )
3990   ROM_LOAD( "wlcc.gfx",  0x200000, 0x080000, CRC(1f7ad299) SHA1(ab0a8fb31906519b9352ba172def48456e8d565c) )
4205   ROM_LOAD( "wlcc.gfx",     0x200000, 0x080000, CRC(1f7ad299) SHA1(ab0a8fb31906519b9352ba172def48456e8d565c) )
39914206
39924207   ROM_REGION( 0x80000, "oki", 0 )
39934208   ROM_LOAD( "040-c3c2.snd", 0x00000, 0x80000, CRC(220949aa) SHA1(1e0dba168a0687d32aaaed42714ae24358f4a3e7) ) // 2 banks
r15474r15475
42454460
42464461/***************************************************************************
42474462
4248Mahjong Nenrikishu SP
4463Mahjong Nenrikishu SP (V250J)
42494464IGS/Alta, 1998
42504465
42514466PCB Layout
r15474r15475
42824497   ROM_REGION( 0x80000, "maincpu", 0 )
42834498   ROM_LOAD16_WORD_SWAP( "v250j.u29", 0x00000, 0x80000, CRC(500cb919) SHA1(76eed80b59c43e8cc1e258056cfe08b33a651852) )
42844499
4285   ROM_REGION( 0x200000, "blitter", 0 )
4286   ROM_LOAD( "m0501.u7", 0x00000, 0x200000, CRC(1c952bd6) SHA1(a6b6f1cdfb29647e81c032ffe59c94f1a10ceaf8) ) // Identical to igsm0501.u7
4500   ROM_REGION( 0x800000, "blitter", ROMREGION_ERASEFF )
4501   ROM_LOAD( "m0501.u7", 0x000000, 0x200000, CRC(1c952bd6) SHA1(a6b6f1cdfb29647e81c032ffe59c94f1a10ceaf8) ) // Identical to igsm0501.u7
4502   // empty
4503   ROM_LOAD( "cg.u4",    0x400000, 0x080000, CRC(fe60f485) SHA1(d75e5f7a187161137a7f7b54d495d1cb3e1802a4) )
4504   // empty
42874505
4288   ROM_REGION( 0x80000, "blitter_hi", 0 ) // high order bit of graphics (5th bit)
4289   ROM_LOAD( "m0502.u6", 0x000000, 0x80000, CRC(5d73ae99) SHA1(7283aa3d6b15ceb95db80756892be46eb997ef15) ) // Identical to igsm0502.u4, igsm0502.u5
4290   ROM_LOAD( "cg.u4",    0x000000, 0x80000, CRC(fe60f485) SHA1(d75e5f7a187161137a7f7b54d495d1cb3e1802a4) )
4506   ROM_REGION( 0x200000, "blitter_hi", ROMREGION_ERASEFF ) // high order bit of graphics (5th bit)
4507   ROM_LOAD( "m0502.u6", 0x00000, 0x80000, CRC(5d73ae99) SHA1(7283aa3d6b15ceb95db80756892be46eb997ef15) ) // Identical to igsm0502.u4, igsm0502.u5
4508   // empty
42914509
42924510   ROM_REGION( 0x80000, "oki", 0 )
42934511   ROM_LOAD( "sp.u38", 0x00000, 0x80000, CRC(d80e28e2) SHA1(c03441686e770227db6a2a41922fbb4284710571) )
r15474r15475
44044622GAME( 1996, wlcc,         xymg,     wlcc,            wlcc,      wlcc,         ROT0, "IGS",        "Wan Li Chang Cheng (China, V638C)",    0 )
44054623GAME( 1996, vbowl,        0,        vbowl,           vbowl,     vbowl,        ROT0, "IGS",        "Virtua Bowling (World, V101XCM)",      GAME_IMPERFECT_SOUND )
44064624GAME( 1996, vbowlj,       vbowl,    vbowl,           vbowlj,    vbowlj,       ROT0, "IGS / Alta", "Virtua Bowling (Japan, V100JCM)",      GAME_IMPERFECT_SOUND )
4407GAME( 1998, nkishusp,     lhb2,     lhb2,            lhb2,      nkishusp,     ROT0, "IGS / Alta", "Mahjong Nenrikishu SP",                GAME_NOT_WORKING )
4625GAME( 1998, nkishusp,     lhb2,     nkishusp,        nkishusp,  nkishusp,     ROT0, "IGS / Alta", "Mahjong Nenrikishu SP (Japan, V250J)", 0 )
src/emu/machine/s3c24xx.c
r15474r15475
11661166   s3c24xx_t *s3c24xx = get_token( device);
11671167   UINT32 temp;
11681168   // normal irq
1169   temp = (s3c24xx->irq.regs.srcpnd & ~s3c24xx->irq.regs.intmsk) & ~s3c24xx->irq.regs.intmod;
1170   if (temp != 0)
1169
1170   if ((s3c24xx->irq.regs.intpnd == 0) && (s3c24xx->irq.regs.intoffset == 0)) // without this "touryuu" crashes
11711171   {
1172      UINT32 int_type = 0;
1173      verboselog( device->machine(), 5, "srcpnd %08X intmsk %08X intmod %08X\n", s3c24xx->irq.regs.srcpnd, s3c24xx->irq.regs.intmsk, s3c24xx->irq.regs.intmod);
1174      while ((temp & 1) == 0)
1172      temp = (s3c24xx->irq.regs.srcpnd & ~s3c24xx->irq.regs.intmsk) & ~s3c24xx->irq.regs.intmod;
1173      if (temp != 0)
11751174      {
1176         int_type++;
1177         temp = temp >> 1;
1175         UINT32 int_type = 0;
1176         verboselog( device->machine(), 5, "srcpnd %08X intmsk %08X intmod %08X\n", s3c24xx->irq.regs.srcpnd, s3c24xx->irq.regs.intmsk, s3c24xx->irq.regs.intmod);
1177         while ((temp & 1) == 0)
1178         {
1179            int_type++;
1180            temp = temp >> 1;
1181         }
1182         verboselog( device->machine(), 5, "intpnd set bit %d\n", int_type);
1183         s3c24xx->irq.regs.intpnd |= (1 << int_type);
1184         s3c24xx->irq.regs.intoffset = int_type;
1185         if (s3c24xx->irq.line_irq != ASSERT_LINE)
1186         {
1187            verboselog( device->machine(), 5, "ARM7_IRQ_LINE -> ASSERT_LINE\n");
1188            cputag_set_input_line( device->machine(), "maincpu", ARM7_IRQ_LINE, ASSERT_LINE);
1189            s3c24xx->irq.line_irq = ASSERT_LINE;
1190         }
11781191      }
1179      verboselog( device->machine(), 5, "intpnd set bit %d\n", int_type);
1180      s3c24xx->irq.regs.intpnd |= (1 << int_type);
1181      s3c24xx->irq.regs.intoffset = int_type;
1182      if (s3c24xx->irq.line_irq != ASSERT_LINE)
1192      else
11831193      {
1184         verboselog( device->machine(), 5, "ARM7_IRQ_LINE -> ASSERT_LINE\n");
1185         cputag_set_input_line( device->machine(), "maincpu", ARM7_IRQ_LINE, ASSERT_LINE);
1186         s3c24xx->irq.line_irq = ASSERT_LINE;
1194         if (s3c24xx->irq.line_irq != CLEAR_LINE)
1195         {
1196            verboselog( device->machine(), 5, "srcpnd %08X intmsk %08X intmod %08X\n", s3c24xx->irq.regs.srcpnd, s3c24xx->irq.regs.intmsk, s3c24xx->irq.regs.intmod);
1197            verboselog( device->machine(), 5, "ARM7_IRQ_LINE -> CLEAR_LINE\n");
1198            cputag_set_input_line( device->machine(), "maincpu", ARM7_IRQ_LINE, CLEAR_LINE);
1199            s3c24xx->irq.line_irq = CLEAR_LINE;
1200         }
11871201      }
11881202   }
1189   else
1190   {
1191      if (s3c24xx->irq.line_irq != CLEAR_LINE)
1192      {
1193         verboselog( device->machine(), 5, "srcpnd %08X intmsk %08X intmod %08X\n", s3c24xx->irq.regs.srcpnd, s3c24xx->irq.regs.intmsk, s3c24xx->irq.regs.intmod);
1194         verboselog( device->machine(), 5, "ARM7_IRQ_LINE -> CLEAR_LINE\n");
1195         cputag_set_input_line( device->machine(), "maincpu", ARM7_IRQ_LINE, CLEAR_LINE);
1196         s3c24xx->irq.line_irq = CLEAR_LINE;
1197      }
1198   }
1203
11991204   // fast irq
12001205   temp = (s3c24xx->irq.regs.srcpnd & ~s3c24xx->irq.regs.intmsk) & s3c24xx->irq.regs.intmod;
12011206   if (temp != 0)
r15474r15475
13301335      {
13311336         s3c24xx->irq.regs.intpnd = (old_value & ~data); // clear only the bit positions of INTPND corresponding to those set to one in the data
13321337         s3c24xx->irq.regs.intoffset = 0; // "This bit can be cleared automatically by clearing SRCPND and INTPND."
1338         s3c24xx_check_pending_irq( device);
13331339      }
13341340      break;
13351341#if defined(DEVICE_S3C2410) || defined(DEVICE_S3C2440)
src/lib/util/chd.c
r15474r15475
17881788      compressed[12] = lengthbits;
17891789      compressed[13] = selfbits;
17901790      compressed[14] = parentbits;
1791        compressed[15] = 0;
17911792
17921793      // write the result
17931794      m_mapoffset = file_append(compressed, complen + 16);
src/lib/util/cdrom.c
r15474r15475
734734      {
735735         /* parse the metadata */
736736         type[0] = subtype[0] = 0;
737            pgtype[0] = pgsub[0] = 0;
737738         if (sscanf(metadata, CDROM_TRACK_METADATA_FORMAT, &tracknum, type, subtype, &frames) != 4)
738739            return CHDERR_INVALID_DATA;
739740         if (tracknum == 0 || tracknum > CD_MAX_TRACKS)
src/lib/util/huffman.c
r15474r15475
535535{
536536   const node_t *node1 = *(const node_t **)item1;
537537   const node_t *node2 = *(const node_t **)item2;
538   return node2->m_weight - node1->m_weight;
538   if (node2->m_weight != node1->m_weight)
539       return node2->m_weight - node1->m_weight;
540   if (node2->m_bits - node1->m_bits == 0)
541       fprintf(stderr, "identical node sort keys, should not happen!\n");
542   return (int)node1->m_bits - (int)node2->m_bits;
539543}
540544
541545
r15474r15475
555559      {
556560         list[listitems++] = &m_huffnode[curcode];
557561         m_huffnode[curcode].m_count = m_datahisto[curcode];
562         m_huffnode[curcode].m_bits = curcode;
558563
559564         // scale the weight by the current effective length, ensuring we don't go to 0
560565         m_huffnode[curcode].m_weight = UINT64(m_datahisto[curcode]) * UINT64(totalweight) / UINT64(totaldata);
561566         if (m_huffnode[curcode].m_weight == 0)
562567            m_huffnode[curcode].m_weight = 1;
563568      }
564
569/*
570        fprintf(stderr, "Pre-sort:\n");
571        for (int i = 0; i < listitems; i++) {
572            fprintf(stderr, "weight: %d code: %d\n", list[i]->m_weight, list[i]->m_bits);
573        }
574*/
565575   // sort the list by weight, largest weight first
566576   qsort(list, listitems, sizeof(list[0]), tree_node_compare);
567
577/*
578        fprintf(stderr, "Post-sort:\n");
579        for (int i = 0; i < listitems; i++) {
580            fprintf(stderr, "weight: %d code: %d\n", list[i]->m_weight, list[i]->m_bits);
581        }
582        fprintf(stderr, "===================\n");
583*/
568584   // now build the tree
569585   int nextalloc = m_numcodes;
570586   while (listitems > 1)
r15474r15475
597613   {
598614      node_t &node = m_huffnode[curcode];
599615      node.m_numbits = 0;
616      node.m_bits = 0;
600617
601618      // if we have a non-zero weight, compute the number of bits
602619      if (node.m_weight > 0)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team