trunk/src/mame/drivers/gaelco2.c
| r19905 | r19906 | |
| 55 | 55 | ============================================================================*/ |
| 56 | 56 | |
| 57 | 57 | static ADDRESS_MAP_START( maniacsq_map, AS_PROGRAM, 16, gaelco2_state ) |
| 58 | | AM_RANGE(0x000000, 0x03ffff) AM_ROM /* ROM */ |
| 59 | | AM_RANGE(0x202890, 0x2028ff) AM_DEVREADWRITE_LEGACY("gaelco", gaelcosnd_r, gaelcosnd_w) /* Sound Registers */ |
| 60 | | AM_RANGE(0x200000, 0x20ffff) AM_RAM_WRITE(gaelco2_vram_w) AM_SHARE("spriteram") /* Video RAM */ |
| 61 | | AM_RANGE(0x210000, 0x211fff) AM_RAM_WRITE(gaelco2_palette_w) AM_SHARE("paletteram") /* Palette */ |
| 62 | | AM_RANGE(0x218004, 0x218009) AM_RAM AM_SHARE("vregs") /* Video Registers */ |
| 63 | | AM_RANGE(0x300000, 0x300001) AM_READ_PORT("IN0") /* DSW #1 + Input 1P */ |
| 64 | | AM_RANGE(0x300002, 0x300003) AM_READ_PORT("IN1") /* DSW #2 + Input 2P */ |
| 65 | | AM_RANGE(0x30004a, 0x30004b) AM_WRITENOP /* Sound muting? */ |
| 66 | | AM_RANGE(0x320000, 0x320001) AM_READ_PORT("COIN") /* COINSW + SERVICESW */ |
| 67 | | AM_RANGE(0x500000, 0x500001) AM_WRITE(gaelco2_coin_w) /* Coin lockout + counters */ |
| 68 | | AM_RANGE(0xfe0000, 0xfeffff) AM_RAM /* Work RAM */ |
| 58 | AM_RANGE(0x000000, 0x03ffff) AM_ROM /* ROM */ |
| 59 | AM_RANGE(0x202890, 0x2028ff) AM_DEVREADWRITE("gaelco", gaelco_gae1_device, gaelcosnd_r, gaelcosnd_w) /* Sound Registers */ |
| 60 | AM_RANGE(0x200000, 0x20ffff) AM_RAM_WRITE(gaelco2_vram_w) AM_SHARE("spriteram") /* Video RAM */ |
| 61 | AM_RANGE(0x210000, 0x211fff) AM_RAM_WRITE(gaelco2_palette_w) AM_SHARE("paletteram") /* Palette */ |
| 62 | AM_RANGE(0x218004, 0x218009) AM_RAM AM_SHARE("vregs") /* Video Registers */ |
| 63 | AM_RANGE(0x300000, 0x300001) AM_READ_PORT("IN0") /* DSW #1 + Input 1P */ |
| 64 | AM_RANGE(0x300002, 0x300003) AM_READ_PORT("IN1") /* DSW #2 + Input 2P */ |
| 65 | AM_RANGE(0x30004a, 0x30004b) AM_WRITENOP /* Sound muting? */ |
| 66 | AM_RANGE(0x320000, 0x320001) AM_READ_PORT("COIN") /* COINSW + SERVICESW */ |
| 67 | AM_RANGE(0x500000, 0x500001) AM_WRITE(gaelco2_coin_w) /* Coin lockout + counters */ |
| 68 | AM_RANGE(0xfe0000, 0xfeffff) AM_RAM /* Work RAM */ |
| 69 | 69 | ADDRESS_MAP_END |
| 70 | 70 | |
| 71 | 71 | |
| r19905 | r19906 | |
| 178 | 178 | /* sound hardware */ |
| 179 | 179 | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 180 | 180 | |
| 181 | | MCFG_SOUND_ADD("gaelco", GAELCO_GAE1, 0) |
| 181 | MCFG_GAELCO_GAE1_ADD("gaelco", 0) |
| 182 | 182 | MCFG_SOUND_CONFIG(maniacsq_snd_interface) |
| 183 | 183 | MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) |
| 184 | 184 | MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) |
| r19905 | r19906 | |
| 212 | 212 | READ16_MEMBER(gaelco2_state::p2_gun_y){return (ioport("LIGHT1_Y")->read() * 240 / 0x100) - 4;} |
| 213 | 213 | |
| 214 | 214 | static ADDRESS_MAP_START( bang_map, AS_PROGRAM, 16, gaelco2_state ) |
| 215 | | AM_RANGE(0x000000, 0x0fffff) AM_ROM /* ROM */ |
| 216 | | AM_RANGE(0x202890, 0x2028ff) AM_DEVREADWRITE_LEGACY("gaelco", gaelcosnd_r, gaelcosnd_w) /* Sound Registers */ |
| 217 | | AM_RANGE(0x200000, 0x20ffff) AM_RAM_WRITE(gaelco2_vram_w) AM_SHARE("spriteram") /* Video RAM */ |
| 218 | | AM_RANGE(0x210000, 0x211fff) AM_RAM_WRITE(gaelco2_palette_w) AM_SHARE("paletteram") /* Palette */ |
| 215 | AM_RANGE(0x000000, 0x0fffff) AM_ROM /* ROM */ |
| 216 | AM_RANGE(0x202890, 0x2028ff) AM_DEVREADWRITE("gaelco", gaelco_cg1v_device, gaelcosnd_r, gaelcosnd_w) /* Sound Registers */ |
| 217 | AM_RANGE(0x200000, 0x20ffff) AM_RAM_WRITE(gaelco2_vram_w) AM_SHARE("spriteram") /* Video RAM */ |
| 218 | AM_RANGE(0x210000, 0x211fff) AM_RAM_WRITE(gaelco2_palette_w) AM_SHARE("paletteram") /* Palette */ |
| 219 | 219 | AM_RANGE(0x218004, 0x218009) AM_READONLY /* Video Registers */ |
| 220 | | AM_RANGE(0x218004, 0x218007) AM_WRITEONLY AM_SHARE("vregs") /* Video Registers */ |
| 221 | | AM_RANGE(0x218008, 0x218009) AM_WRITENOP /* CLR INT Video */ |
| 220 | AM_RANGE(0x218004, 0x218007) AM_WRITEONLY AM_SHARE("vregs") /* Video Registers */ |
| 221 | AM_RANGE(0x218008, 0x218009) AM_WRITENOP /* CLR INT Video */ |
| 222 | 222 | AM_RANGE(0x300000, 0x300001) AM_READ_PORT("P1") |
| 223 | | AM_RANGE(0x300002, 0x300003) AM_READNOP /* Random number generator? */ |
| 224 | | AM_RANGE(0x300000, 0x300003) AM_WRITE(gaelco2_coin2_w) /* Coin Counters */ |
| 225 | | AM_RANGE(0x300008, 0x300009) AM_WRITE(gaelco2_eeprom_data_w) /* EEPROM data */ |
| 226 | | AM_RANGE(0x30000a, 0x30000b) AM_WRITE(gaelco2_eeprom_sk_w) /* EEPROM serial clock */ |
| 227 | | AM_RANGE(0x30000c, 0x30000d) AM_WRITE(gaelco2_eeprom_cs_w) /* EEPROM chip select */ |
| 223 | AM_RANGE(0x300002, 0x300003) AM_READNOP /* Random number generator? */ |
| 224 | AM_RANGE(0x300000, 0x300003) AM_WRITE(gaelco2_coin2_w) /* Coin Counters */ |
| 225 | AM_RANGE(0x300008, 0x300009) AM_WRITE(gaelco2_eeprom_data_w) /* EEPROM data */ |
| 226 | AM_RANGE(0x30000a, 0x30000b) AM_WRITE(gaelco2_eeprom_sk_w) /* EEPROM serial clock */ |
| 227 | AM_RANGE(0x30000c, 0x30000d) AM_WRITE(gaelco2_eeprom_cs_w) /* EEPROM chip select */ |
| 228 | 228 | AM_RANGE(0x300010, 0x300011) AM_READ_PORT("P2") |
| 229 | 229 | AM_RANGE(0x300020, 0x300021) AM_READ_PORT("COIN") |
| 230 | | AM_RANGE(0x310000, 0x310001) AM_READ(p1_gun_x) AM_WRITE(bang_clr_gun_int_w) /* Gun 1P X */ /* CLR INT Gun */ |
| 231 | | AM_RANGE(0x310002, 0x310003) AM_READ(p2_gun_x) /* Gun 2P X */ |
| 232 | | AM_RANGE(0x310004, 0x310005) AM_READ(p1_gun_y) /* Gun 1P Y */ |
| 233 | | AM_RANGE(0x310006, 0x310007) AM_READ(p2_gun_y) /* Gun 2P Y */ |
| 234 | | AM_RANGE(0xfe0000, 0xfeffff) AM_RAM /* Work RAM */ |
| 230 | AM_RANGE(0x310000, 0x310001) AM_READ(p1_gun_x) AM_WRITE(bang_clr_gun_int_w) /* Gun 1P X */ /* CLR INT Gun */ |
| 231 | AM_RANGE(0x310002, 0x310003) AM_READ(p2_gun_x) /* Gun 2P X */ |
| 232 | AM_RANGE(0x310004, 0x310005) AM_READ(p1_gun_y) /* Gun 1P Y */ |
| 233 | AM_RANGE(0x310006, 0x310007) AM_READ(p2_gun_y) /* Gun 2P Y */ |
| 234 | AM_RANGE(0xfe0000, 0xfeffff) AM_RAM /* Work RAM */ |
| 235 | 235 | ADDRESS_MAP_END |
| 236 | 236 | |
| 237 | 237 | |
| r19905 | r19906 | |
| 311 | 311 | /* sound hardware */ |
| 312 | 312 | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 313 | 313 | |
| 314 | | MCFG_SOUND_ADD("gaelco", GAELCO_CG1V, 0) |
| 314 | MCFG_GAELCO_CG1V_ADD("gaelco", 0) |
| 315 | 315 | MCFG_SOUND_CONFIG(bang_snd_interface) |
| 316 | 316 | MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) |
| 317 | 317 | MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) |
| r19905 | r19906 | |
| 430 | 430 | |
| 431 | 431 | |
| 432 | 432 | static ADDRESS_MAP_START( alighunt_map, AS_PROGRAM, 16, gaelco2_state ) |
| 433 | | AM_RANGE(0x000000, 0x0fffff) AM_ROM /* ROM */ |
| 434 | | AM_RANGE(0x202890, 0x2028ff) AM_DEVREADWRITE_LEGACY("gaelco", gaelcosnd_r, gaelcosnd_w) /* Sound Registers */ |
| 435 | | AM_RANGE(0x200000, 0x20ffff) AM_RAM_WRITE(gaelco2_vram_w) AM_SHARE("spriteram") /* Video RAM */ |
| 436 | | AM_RANGE(0x210000, 0x211fff) AM_RAM_WRITE(gaelco2_palette_w) AM_SHARE("paletteram") /* Palette */ |
| 433 | AM_RANGE(0x000000, 0x0fffff) AM_ROM /* ROM */ |
| 434 | AM_RANGE(0x202890, 0x2028ff) AM_DEVREADWRITE("gaelco", gaelco_gae1_device, gaelcosnd_r, gaelcosnd_w) /* Sound Registers */ |
| 435 | AM_RANGE(0x200000, 0x20ffff) AM_RAM_WRITE(gaelco2_vram_w) AM_SHARE("spriteram") /* Video RAM */ |
| 436 | AM_RANGE(0x210000, 0x211fff) AM_RAM_WRITE(gaelco2_palette_w) AM_SHARE("paletteram") /* Palette */ |
| 437 | 437 | AM_RANGE(0x218004, 0x218009) AM_RAM AM_SHARE("vregs") /* Video Registers */ |
| 438 | | AM_RANGE(0x300000, 0x300001) AM_READ_PORT("IN0") /* DSW #1 + Input 1P */ |
| 439 | | AM_RANGE(0x300002, 0x300003) AM_READ_PORT("IN1") /* DSW #2 + Input 2P */ |
| 440 | | AM_RANGE(0x320000, 0x320001) AM_READ_PORT("COIN") /* COINSW + SERVICESW */ |
| 441 | | AM_RANGE(0x500000, 0x500001) AM_WRITE(gaelco2_coin_w) /* Coin lockout + counters */ |
| 442 | | AM_RANGE(0x500006, 0x500007) AM_WRITENOP /* ??? */ |
| 443 | | AM_RANGE(0xfe0000, 0xfeffff) AM_RAM /* Work RAM */ |
| 438 | AM_RANGE(0x300000, 0x300001) AM_READ_PORT("IN0") /* DSW #1 + Input 1P */ |
| 439 | AM_RANGE(0x300002, 0x300003) AM_READ_PORT("IN1") /* DSW #2 + Input 2P */ |
| 440 | AM_RANGE(0x320000, 0x320001) AM_READ_PORT("COIN") /* COINSW + SERVICESW */ |
| 441 | AM_RANGE(0x500000, 0x500001) AM_WRITE(gaelco2_coin_w) /* Coin lockout + counters */ |
| 442 | AM_RANGE(0x500006, 0x500007) AM_WRITENOP /* ??? */ |
| 443 | AM_RANGE(0xfe0000, 0xfeffff) AM_RAM /* Work RAM */ |
| 444 | 444 | ADDRESS_MAP_END |
| 445 | 445 | |
| 446 | 446 | |
| r19905 | r19906 | |
| 552 | 552 | /* sound hardware */ |
| 553 | 553 | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 554 | 554 | |
| 555 | | MCFG_SOUND_ADD("gaelco", GAELCO_GAE1, 0) |
| 555 | MCFG_GAELCO_GAE1_ADD("gaelco", 0) |
| 556 | 556 | MCFG_SOUND_CONFIG(alighunt_snd_interface) |
| 557 | 557 | MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) |
| 558 | 558 | MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) |
| r19905 | r19906 | |
| 641 | 641 | } |
| 642 | 642 | |
| 643 | 643 | static ADDRESS_MAP_START( touchgo_map, AS_PROGRAM, 16, gaelco2_state ) |
| 644 | | AM_RANGE(0x000000, 0x0fffff) AM_ROM /* ROM */ |
| 645 | | AM_RANGE(0x202890, 0x2028ff) AM_DEVREADWRITE_LEGACY("gaelco", gaelcosnd_r, gaelcosnd_w) /* Sound Registers */ |
| 646 | | AM_RANGE(0x200000, 0x20ffff) AM_RAM_WRITE(gaelco2_vram_w) AM_SHARE("spriteram") /* Video RAM */ |
| 647 | | AM_RANGE(0x210000, 0x211fff) AM_RAM_WRITE(gaelco2_palette_w) AM_SHARE("paletteram") /* Palette */ |
| 648 | | AM_RANGE(0x218004, 0x218009) AM_RAM AM_SHARE("vregs") /* Video Registers */ |
| 649 | | AM_RANGE(0x300000, 0x300001) AM_READ_PORT("IN0") /* DSW #1 + Input 1P */ |
| 650 | | AM_RANGE(0x300002, 0x300003) AM_READ_PORT("IN1") /* DSW #2 + Input 2P */ |
| 651 | | AM_RANGE(0x300004, 0x300005) AM_READ_PORT("IN2") /* COINSW + Input 3P */ |
| 652 | | AM_RANGE(0x300006, 0x300007) AM_READ_PORT("IN3") /* SERVICESW + Input 4P */ |
| 653 | | AM_RANGE(0x500000, 0x50001f) AM_WRITE(touchgo_coin_w) /* Coin counters */ |
| 654 | | AM_RANGE(0xfefffa, 0xfefffb) AM_RAM_READ(dallas_kludge_r) /* DS5002FP related patch */ |
| 655 | | AM_RANGE(0xfe0000, 0xfeffff) AM_RAM /* Work RAM */ |
| 644 | AM_RANGE(0x000000, 0x0fffff) AM_ROM /* ROM */ |
| 645 | AM_RANGE(0x202890, 0x2028ff) AM_DEVREADWRITE("gaelco", gaelco_gae1_device, gaelcosnd_r, gaelcosnd_w) /* Sound Registers */ |
| 646 | AM_RANGE(0x200000, 0x20ffff) AM_RAM_WRITE(gaelco2_vram_w) AM_SHARE("spriteram") /* Video RAM */ |
| 647 | AM_RANGE(0x210000, 0x211fff) AM_RAM_WRITE(gaelco2_palette_w) AM_SHARE("paletteram") /* Palette */ |
| 648 | AM_RANGE(0x218004, 0x218009) AM_RAM AM_SHARE("vregs") /* Video Registers */ |
| 649 | AM_RANGE(0x300000, 0x300001) AM_READ_PORT("IN0") /* DSW #1 + Input 1P */ |
| 650 | AM_RANGE(0x300002, 0x300003) AM_READ_PORT("IN1") /* DSW #2 + Input 2P */ |
| 651 | AM_RANGE(0x300004, 0x300005) AM_READ_PORT("IN2") /* COINSW + Input 3P */ |
| 652 | AM_RANGE(0x300006, 0x300007) AM_READ_PORT("IN3") /* SERVICESW + Input 4P */ |
| 653 | AM_RANGE(0x500000, 0x50001f) AM_WRITE(touchgo_coin_w) /* Coin counters */ |
| 654 | AM_RANGE(0xfefffa, 0xfefffb) AM_RAM_READ(dallas_kludge_r) /* DS5002FP related patch */ |
| 655 | AM_RANGE(0xfe0000, 0xfeffff) AM_RAM /* Work RAM */ |
| 656 | 656 | ADDRESS_MAP_END |
| 657 | 657 | |
| 658 | 658 | |
| r19905 | r19906 | |
| 802 | 802 | /* the chip is stereo, but the game sound is mono because the right channel |
| 803 | 803 | output is for cabinet 1 and the left channel output is for cabinet 2 */ |
| 804 | 804 | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 805 | | MCFG_SOUND_ADD("gaelco", GAELCO_GAE1, 0) |
| 805 | MCFG_GAELCO_GAE1_ADD("gaelco", 0) |
| 806 | 806 | MCFG_SOUND_CONFIG(touchgo_snd_interface) |
| 807 | 807 | MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) |
| 808 | 808 | MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) |
| r19905 | r19906 | |
| 905 | 905 | ============================================================================*/ |
| 906 | 906 | |
| 907 | 907 | static ADDRESS_MAP_START( snowboar_map, AS_PROGRAM, 16, gaelco2_state ) |
| 908 | | AM_RANGE(0x000000, 0x0fffff) AM_ROM /* ROM */ |
| 909 | | AM_RANGE(0x202890, 0x2028ff) AM_DEVREADWRITE_LEGACY("gaelco", gaelcosnd_r, gaelcosnd_w) /* Sound Registers */ |
| 910 | | AM_RANGE(0x200000, 0x20ffff) AM_RAM_WRITE(gaelco2_vram_w) AM_SHARE("spriteram") /* Video RAM */ |
| 911 | | AM_RANGE(0x210000, 0x211fff) AM_RAM_WRITE(gaelco2_palette_w) AM_SHARE("paletteram") /* Palette */ |
| 912 | | AM_RANGE(0x212000, 0x213fff) AM_RAM /* Extra RAM */ |
| 913 | | AM_RANGE(0x218004, 0x218009) AM_RAM AM_SHARE("vregs") /* Video Registers */ |
| 908 | AM_RANGE(0x000000, 0x0fffff) AM_ROM /* ROM */ |
| 909 | AM_RANGE(0x202890, 0x2028ff) AM_DEVREADWRITE("gaelco", gaelco_cg1v_device, gaelcosnd_r, gaelcosnd_w) /* Sound Registers */ |
| 910 | AM_RANGE(0x200000, 0x20ffff) AM_RAM_WRITE(gaelco2_vram_w) AM_SHARE("spriteram") /* Video RAM */ |
| 911 | AM_RANGE(0x210000, 0x211fff) AM_RAM_WRITE(gaelco2_palette_w) AM_SHARE("paletteram") /* Palette */ |
| 912 | AM_RANGE(0x212000, 0x213fff) AM_RAM /* Extra RAM */ |
| 913 | AM_RANGE(0x218004, 0x218009) AM_RAM AM_SHARE("vregs") /* Video Registers */ |
| 914 | 914 | AM_RANGE(0x300000, 0x300001) AM_READ_PORT("P1") |
| 915 | | AM_RANGE(0x300000, 0x300003) AM_WRITE(gaelco2_coin2_w) /* Coin Counters */ |
| 916 | | AM_RANGE(0x300008, 0x300009) AM_WRITE(gaelco2_eeprom_data_w) /* EEPROM data */ |
| 917 | | AM_RANGE(0x30000a, 0x30000b) AM_WRITE(gaelco2_eeprom_sk_w) /* EEPROM serial clock */ |
| 918 | | AM_RANGE(0x30000c, 0x30000d) AM_WRITE(gaelco2_eeprom_cs_w) /* EEPROM chip select */ |
| 915 | AM_RANGE(0x300000, 0x300003) AM_WRITE(gaelco2_coin2_w) /* Coin Counters */ |
| 916 | AM_RANGE(0x300008, 0x300009) AM_WRITE(gaelco2_eeprom_data_w) /* EEPROM data */ |
| 917 | AM_RANGE(0x30000a, 0x30000b) AM_WRITE(gaelco2_eeprom_sk_w) /* EEPROM serial clock */ |
| 918 | AM_RANGE(0x30000c, 0x30000d) AM_WRITE(gaelco2_eeprom_cs_w) /* EEPROM chip select */ |
| 919 | 919 | AM_RANGE(0x300010, 0x300011) AM_READ_PORT("P2") |
| 920 | 920 | AM_RANGE(0x300020, 0x300021) AM_READ_PORT("COIN") |
| 921 | 921 | AM_RANGE(0x310000, 0x31ffff) AM_READWRITE(snowboar_protection_r,snowboar_protection_w) AM_SHARE("snowboar_prot") /* Protection */ |
| 922 | | AM_RANGE(0xfe0000, 0xfeffff) AM_RAM /* Work RAM */ |
| 922 | AM_RANGE(0xfe0000, 0xfeffff) AM_RAM /* Work RAM */ |
| 923 | 923 | ADDRESS_MAP_END |
| 924 | 924 | |
| 925 | 925 | |
| r19905 | r19906 | |
| 988 | 988 | /* sound hardware */ |
| 989 | 989 | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 990 | 990 | |
| 991 | | MCFG_SOUND_ADD("gaelco", GAELCO_CG1V, 0) |
| 991 | MCFG_GAELCO_CG1V_ADD("gaelco", 0) |
| 992 | 992 | MCFG_SOUND_CONFIG(snowboar_snd_interface) |
| 993 | 993 | MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) |
| 994 | 994 | MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) |
| r19905 | r19906 | |
| 1090 | 1090 | ============================================================================*/ |
| 1091 | 1091 | |
| 1092 | 1092 | static ADDRESS_MAP_START( wrally2_map, AS_PROGRAM, 16, gaelco2_state ) |
| 1093 | | AM_RANGE(0x000000, 0x0fffff) AM_ROM /* ROM */ |
| 1094 | | AM_RANGE(0x202890, 0x2028ff) AM_DEVREADWRITE_LEGACY("gaelco", gaelcosnd_r, gaelcosnd_w) /* Sound Registers */ |
| 1095 | | AM_RANGE(0x200000, 0x20ffff) AM_RAM_WRITE(gaelco2_vram_w) AM_SHARE("spriteram") /* Video RAM */ |
| 1096 | | AM_RANGE(0x210000, 0x211fff) AM_RAM_WRITE(gaelco2_palette_w) AM_SHARE("paletteram") /* Palette */ |
| 1097 | | AM_RANGE(0x212000, 0x213fff) AM_RAM /* Extra RAM */ |
| 1093 | AM_RANGE(0x000000, 0x0fffff) AM_ROM /* ROM */ |
| 1094 | AM_RANGE(0x202890, 0x2028ff) AM_DEVREADWRITE("gaelco", gaelco_gae1_device, gaelcosnd_r, gaelcosnd_w) /* Sound Registers */ |
| 1095 | AM_RANGE(0x200000, 0x20ffff) AM_RAM_WRITE(gaelco2_vram_w) AM_SHARE("spriteram") /* Video RAM */ |
| 1096 | AM_RANGE(0x210000, 0x211fff) AM_RAM_WRITE(gaelco2_palette_w) AM_SHARE("paletteram") /* Palette */ |
| 1097 | AM_RANGE(0x212000, 0x213fff) AM_RAM /* Extra RAM */ |
| 1098 | 1098 | AM_RANGE(0x218004, 0x218009) AM_RAM AM_SHARE("vregs") /* Video Registers */ |
| 1099 | | AM_RANGE(0x300000, 0x300001) AM_READ_PORT("IN0") /* DIPSW #2 + Inputs 1P */ |
| 1100 | | AM_RANGE(0x300002, 0x300003) AM_READ_PORT("IN1") /* DIPSW #1 */ |
| 1101 | | AM_RANGE(0x300004, 0x300005) AM_READ_PORT("IN2") /* Inputs 2P + COINSW */ |
| 1102 | | AM_RANGE(0x300006, 0x300007) AM_READ_PORT("IN3") /* SERVICESW */ |
| 1103 | | AM_RANGE(0x400000, 0x400011) AM_WRITE(wrally2_coin_w) /* Coin Counters */ |
| 1104 | | AM_RANGE(0x400028, 0x400029) AM_WRITE(wrally2_adc_clk) /* ADCs clock-in line */ |
| 1105 | | AM_RANGE(0x400030, 0x400031) AM_WRITE(wrally2_adc_cs) /* ADCs chip select line */ |
| 1106 | | AM_RANGE(0xfe0000, 0xfeffff) AM_RAM /* Work RAM */ |
| 1099 | AM_RANGE(0x300000, 0x300001) AM_READ_PORT("IN0") /* DIPSW #2 + Inputs 1P */ |
| 1100 | AM_RANGE(0x300002, 0x300003) AM_READ_PORT("IN1") /* DIPSW #1 */ |
| 1101 | AM_RANGE(0x300004, 0x300005) AM_READ_PORT("IN2") /* Inputs 2P + COINSW */ |
| 1102 | AM_RANGE(0x300006, 0x300007) AM_READ_PORT("IN3") /* SERVICESW */ |
| 1103 | AM_RANGE(0x400000, 0x400011) AM_WRITE(wrally2_coin_w) /* Coin Counters */ |
| 1104 | AM_RANGE(0x400028, 0x400029) AM_WRITE(wrally2_adc_clk) /* ADCs clock-in line */ |
| 1105 | AM_RANGE(0x400030, 0x400031) AM_WRITE(wrally2_adc_cs) /* ADCs chip select line */ |
| 1106 | AM_RANGE(0xfe0000, 0xfeffff) AM_RAM /* Work RAM */ |
| 1107 | 1107 | ADDRESS_MAP_END |
| 1108 | 1108 | |
| 1109 | 1109 | |
| r19905 | r19906 | |
| 1238 | 1238 | /* the chip is stereo, but the game sound is mono because the right channel |
| 1239 | 1239 | output is for cabinet 1 and the left channel output is for cabinet 2 */ |
| 1240 | 1240 | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 1241 | | MCFG_SOUND_ADD("gaelco", GAELCO_GAE1, 0) |
| 1241 | MCFG_GAELCO_GAE1_ADD("gaelco", 0) |
| 1242 | 1242 | MCFG_SOUND_CONFIG(wrally2_snd_interface) |
| 1243 | 1243 | MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) |
| 1244 | 1244 | MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) |
| r19905 | r19906 | |
| 1439 | 1439 | |
| 1440 | 1440 | GAME( 1994, aligator, 0, alighunt, alighunt, gaelco2_state, alighunt, ROT0, "Gaelco", "Alligator Hunt", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING ) |
| 1441 | 1441 | GAME( 1994, aligatorun,aligator,alighunt, alighunt, gaelco2_state, alighunt, ROT0, "Gaelco", "Alligator Hunt (unprotected)", 0 ) |
| 1442 | | GAME( 1995, touchgo, 0, touchgo, touchgo, gaelco2_state, touchgo, ROT0, "Gaelco", "Touch & Go (World)", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING ) |
| 1443 | | GAME( 1995, touchgon, touchgo, touchgo, touchgo, gaelco2_state, touchgo, ROT0, "Gaelco", "Touch & Go (Non North America)", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING ) |
| 1444 | | GAME( 1995, touchgoe, touchgo, touchgo, touchgo, gaelco2_state, touchgo, ROT0, "Gaelco", "Touch & Go (earlier revision)", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING ) |
| 1445 | | GAME( 1995, wrally2, 0, wrally2, wrally2, driver_device, 0, ROT0, "Gaelco", "World Rally 2: Twin Racing", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING ) |
| 1442 | GAME( 1995, touchgo, 0, touchgo, touchgo, gaelco2_state, touchgo, ROT0, "Gaelco", "Touch & Go (World)", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING ) |
| 1443 | GAME( 1995, touchgon, touchgo, touchgo, touchgo, gaelco2_state, touchgo, ROT0, "Gaelco", "Touch & Go (Non North America)", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING ) |
| 1444 | GAME( 1995, touchgoe, touchgo, touchgo, touchgo, gaelco2_state, touchgo, ROT0, "Gaelco", "Touch & Go (earlier revision)", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING ) |
| 1445 | GAME( 1995, wrally2, 0, wrally2, wrally2, driver_device, 0, ROT0, "Gaelco", "World Rally 2: Twin Racing", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING ) |
| 1446 | 1446 | GAME( 1996, maniacsq, 0, maniacsq, maniacsq, driver_device, 0, ROT0, "Gaelco", "Maniac Square (unprotected)", 0 ) |
| 1447 | 1447 | GAME( 1996, snowboar, 0, snowboar, snowboar, driver_device, 0, ROT0, "Gaelco", "Snow Board Championship (Version 2.1)", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING ) |
| 1448 | 1448 | GAME( 1996, snowboara,snowboar, snowboar, snowboar, gaelco2_state, snowboar, ROT0, "Gaelco", "Snow Board Championship (Version 2.0)", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING ) |
| 1449 | | GAME( 1998, bang, 0, bang, bang, gaelco2_state, bang, ROT0, "Gaelco", "Bang!", 0 ) |
| 1450 | | GAME( 1998, bangj, bang, bang, bang, gaelco2_state, bang, ROT0, "Gaelco", "Gun Gabacho (Japan)", 0 ) |
| 1449 | GAME( 1998, bang, 0, bang, bang, gaelco2_state, bang, ROT0, "Gaelco", "Bang!", 0 ) |
| 1450 | GAME( 1998, bangj, bang, bang, bang, gaelco2_state, bang, ROT0, "Gaelco", "Gun Gabacho (Japan)", 0 ) |
| 1451 | 1451 | GAME( 1999, grtesoro, 0, maniacsq, maniacsq, driver_device, 0, ROT0, "Nova Desitec", "Gran Tesoro? / Play 2000 (v5.01) (Italy)", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING ) |
| 1452 | 1452 | GAME( 1999, grtesoro4, grtesoro,maniacsq, maniacsq, driver_device, 0, ROT0, "Nova Desitec", "Gran Tesoro? / Play 2000 (v4.0) (Italy)", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING ) |
trunk/src/emu/sound/gaelco.c
| r19905 | r19906 | |
| 42 | 42 | #define LOG_SOUND(x) do { if (VERBOSE_SOUND) logerror x; } while (0) |
| 43 | 43 | #define LOG_READ_WRITES(x) do { if (VERBOSE_READ_WRITES) logerror x; } while (0) |
| 44 | 44 | |
| 45 | | #define LOG_WAVE 0 |
| 46 | 45 | //#define ALT_MIX |
| 47 | 46 | |
| 48 | | #define GAELCO_NUM_CHANNELS 0x07 |
| 49 | | #define VOLUME_LEVELS 0x10 |
| 47 | #define LOG_WAVE 0 |
| 48 | static wav_file* wavraw; // Raw waveform |
| 50 | 49 | |
| 51 | | /* this structure defines a channel */ |
| 52 | | struct gaelco_sound_channel |
| 53 | | { |
| 54 | | int active; /* is it playing? */ |
| 55 | | int loop; /* = 0 no looping, = 1 looping */ |
| 56 | | int chunkNum; /* current chunk if looping */ |
| 57 | | }; |
| 58 | 50 | |
| 59 | | /* this structure defines the Gaelco custom sound chip */ |
| 60 | | struct gaelco_sound_state |
| 61 | | { |
| 62 | | sound_stream *stream; /* our stream */ |
| 63 | | UINT8 *snd_data; /* PCM data */ |
| 64 | | int banks[4]; /* start of each ROM bank */ |
| 65 | | gaelco_sound_channel channel[GAELCO_NUM_CHANNELS]; /* 7 stereo channels */ |
| 51 | /*============================================================================ |
| 52 | Gaelco GAE1 sound device |
| 53 | ============================================================================*/ |
| 66 | 54 | |
| 67 | | UINT16 sndregs[0x38]; |
| 55 | const device_type GAELCO_GAE1 = &device_creator<gaelco_gae1_device>; |
| 68 | 56 | |
| 69 | | /* table for converting from 8 to 16 bits with volume control */ |
| 70 | | INT16 volume_table[VOLUME_LEVELS][256]; |
| 71 | | }; |
| 57 | gaelco_gae1_device::gaelco_gae1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 58 | : device_t(mconfig, GAELCO_GAE1, "Gaelco GAE1", tag, owner, clock), |
| 59 | device_sound_interface(mconfig, *this), |
| 60 | m_stream(NULL), |
| 61 | m_snd_data(NULL) |
| 62 | { |
| 63 | } |
| 72 | 64 | |
| 73 | | static wav_file * wavraw; /* raw waveform */ |
| 74 | | |
| 75 | | INLINE gaelco_sound_state *get_safe_token(device_t *device) |
| 65 | gaelco_gae1_device::gaelco_gae1_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) |
| 66 | : device_t(mconfig, type, name, tag, owner, clock), |
| 67 | device_sound_interface(mconfig, *this), |
| 68 | m_stream(NULL), |
| 69 | m_snd_data(NULL) |
| 76 | 70 | { |
| 77 | | assert(device != NULL); |
| 78 | | assert(device->type() == GAELCO_GAE1 || device->type() == GAELCO_CG1V); |
| 79 | | return (gaelco_sound_state *)downcast<gaelco_gae1_device *>(device)->token(); |
| 80 | 71 | } |
| 81 | 72 | |
| 73 | |
| 82 | 74 | /*============================================================================ |
| 83 | 75 | CG-1V/GAE1 Sound Update |
| 84 | 76 | |
| 85 | 77 | Writes length bytes to the sound buffer |
| 86 | 78 | ============================================================================*/ |
| 87 | 79 | |
| 88 | | static STREAM_UPDATE( gaelco_update ) |
| 80 | void gaelco_gae1_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) |
| 89 | 81 | { |
| 90 | | gaelco_sound_state *info = (gaelco_sound_state *)param; |
| 91 | 82 | int j, ch; |
| 92 | 83 | |
| 93 | 84 | /* fill all data needed */ |
| r19905 | r19906 | |
| 97 | 88 | /* for each channel */ |
| 98 | 89 | for (ch = 0; ch < GAELCO_NUM_CHANNELS; ch ++){ |
| 99 | 90 | int ch_data_l = 0, ch_data_r = 0; |
| 100 | | gaelco_sound_channel *channel = &info->channel[ch]; |
| 91 | gaelco_sound_channel *channel = &m_channel[ch]; |
| 101 | 92 | |
| 102 | 93 | /* if the channel is playing */ |
| 103 | 94 | if (channel->active == 1){ |
| r19905 | r19906 | |
| 112 | 103 | base_offset = ch*8 + chunkNum*4; |
| 113 | 104 | |
| 114 | 105 | /* get channel parameters */ |
| 115 | | type = ((info->sndregs[base_offset + 1] >> 4) & 0x0f); |
| 116 | | bank = info->banks[((info->sndregs[base_offset + 1] >> 0) & 0x03)]; |
| 117 | | vol_l = ((info->sndregs[base_offset + 1] >> 12) & 0x0f); |
| 118 | | vol_r = ((info->sndregs[base_offset + 1] >> 8) & 0x0f); |
| 119 | | end_pos = info->sndregs[base_offset + 2] << 8; |
| 106 | type = ((m_sndregs[base_offset + 1] >> 4) & 0x0f); |
| 107 | bank = m_banks[((m_sndregs[base_offset + 1] >> 0) & 0x03)]; |
| 108 | vol_l = ((m_sndregs[base_offset + 1] >> 12) & 0x0f); |
| 109 | vol_r = ((m_sndregs[base_offset + 1] >> 8) & 0x0f); |
| 110 | end_pos = m_sndregs[base_offset + 2] << 8; |
| 120 | 111 | |
| 121 | 112 | /* generates output data (range 0x00000..0xffff) */ |
| 122 | 113 | if (type == 0x08){ |
| 123 | 114 | /* PCM, 8 bits mono */ |
| 124 | | data = info->snd_data[bank + end_pos + info->sndregs[base_offset + 3]]; |
| 125 | | ch_data_l = info->volume_table[vol_l][data]; |
| 126 | | ch_data_r = info->volume_table[vol_r][data]; |
| 115 | data = m_snd_data[bank + end_pos + m_sndregs[base_offset + 3]]; |
| 116 | ch_data_l = m_volume_table[vol_l][data]; |
| 117 | ch_data_r = m_volume_table[vol_r][data]; |
| 127 | 118 | |
| 128 | | info->sndregs[base_offset + 3]--; |
| 119 | m_sndregs[base_offset + 3]--; |
| 129 | 120 | } else if (type == 0x0c){ |
| 130 | 121 | /* PCM, 8 bits stereo */ |
| 131 | | data = info->snd_data[bank + end_pos + info->sndregs[base_offset + 3]]; |
| 132 | | ch_data_l = info->volume_table[vol_l][data]; |
| 122 | data = m_snd_data[bank + end_pos + m_sndregs[base_offset + 3]]; |
| 123 | ch_data_l = m_volume_table[vol_l][data]; |
| 133 | 124 | |
| 134 | | info->sndregs[base_offset + 3]--; |
| 125 | m_sndregs[base_offset + 3]--; |
| 135 | 126 | |
| 136 | | if (info->sndregs[base_offset + 3] > 0){ |
| 137 | | data = info->snd_data[bank + end_pos + info->sndregs[base_offset + 3]]; |
| 138 | | ch_data_r = info->volume_table[vol_r][data]; |
| 127 | if (m_sndregs[base_offset + 3] > 0){ |
| 128 | data = m_snd_data[bank + end_pos + m_sndregs[base_offset + 3]]; |
| 129 | ch_data_r = m_volume_table[vol_r][data]; |
| 139 | 130 | |
| 140 | | info->sndregs[base_offset + 3]--; |
| 131 | m_sndregs[base_offset + 3]--; |
| 141 | 132 | } |
| 142 | 133 | } else { |
| 143 | | LOG_SOUND(("(GAE1) Playing unknown sample format in channel: %02d, type: %02x, bank: %02x, end: %08x, Length: %04x\n", ch, type, bank, end_pos, info->sndregs[base_offset + 3])); |
| 134 | LOG_SOUND(("(GAE1) Playing unknown sample format in channel: %02d, type: %02x, bank: %02x, end: %08x, Length: %04x\n", ch, type, bank, end_pos, m_sndregs[base_offset + 3])); |
| 144 | 135 | channel->active = 0; |
| 145 | 136 | } |
| 146 | 137 | |
| 147 | 138 | /* check if the current sample has finished playing */ |
| 148 | | if (info->sndregs[base_offset + 3] == 0){ |
| 139 | if (m_sndregs[base_offset + 3] == 0){ |
| 149 | 140 | if (channel->loop == 0){ /* if no looping, we're done */ |
| 150 | 141 | channel->active = 0; |
| 151 | 142 | } else { /* if we're looping, swap chunks */ |
| 152 | 143 | channel->chunkNum = (channel->chunkNum + 1) & 0x01; |
| 153 | 144 | |
| 154 | 145 | /* if the length of the next chunk is 0, we're done */ |
| 155 | | if (info->sndregs[ch*8 + channel->chunkNum*4 + 3] == 0){ |
| 146 | if (m_sndregs[ch*8 + channel->chunkNum*4 + 3] == 0){ |
| 156 | 147 | channel->active = 0; |
| 157 | 148 | } |
| 158 | 149 | } |
| r19905 | r19906 | |
| 189 | 180 | CG-1V/GAE1 Read Handler |
| 190 | 181 | ============================================================================*/ |
| 191 | 182 | |
| 192 | | READ16_DEVICE_HANDLER( gaelcosnd_r ) |
| 183 | READ16_MEMBER( gaelco_gae1_device::gaelcosnd_r ) |
| 193 | 184 | { |
| 194 | | gaelco_sound_state *info = get_safe_token(device); |
| 185 | LOG_READ_WRITES(("%s: (GAE1): read from %04x\n", machine().describe_context(), offset)); |
| 195 | 186 | |
| 196 | | LOG_READ_WRITES(("%s: (GAE1): read from %04x\n", device->machine().describe_context(), offset)); |
| 197 | | |
| 198 | | return info->sndregs[offset]; |
| 187 | return m_sndregs[offset]; |
| 199 | 188 | } |
| 200 | 189 | |
| 201 | 190 | /*============================================================================ |
| 202 | 191 | CG-1V/GAE1 Write Handler |
| 203 | 192 | ============================================================================*/ |
| 204 | 193 | |
| 205 | | WRITE16_DEVICE_HANDLER( gaelcosnd_w ) |
| 194 | WRITE16_MEMBER( gaelco_gae1_device::gaelcosnd_w ) |
| 206 | 195 | { |
| 207 | | gaelco_sound_state *info = get_safe_token(device); |
| 208 | | gaelco_sound_channel *channel = &info->channel[offset >> 3]; |
| 196 | gaelco_sound_channel *channel = &m_channel[offset >> 3]; |
| 209 | 197 | |
| 210 | | LOG_READ_WRITES(("%s: (GAE1): write %04x to %04x\n", device->machine().describe_context(), data, offset)); |
| 198 | LOG_READ_WRITES(("%s: (GAE1): write %04x to %04x\n", machine().describe_context(), data, offset)); |
| 211 | 199 | |
| 212 | 200 | /* first update the stream to this point in time */ |
| 213 | | info->stream->update(); |
| 201 | m_stream->update(); |
| 214 | 202 | |
| 215 | | COMBINE_DATA(&info->sndregs[offset]); |
| 203 | COMBINE_DATA(&m_sndregs[offset]); |
| 216 | 204 | |
| 217 | 205 | switch(offset & 0x07){ |
| 218 | 206 | case 0x03: |
| 219 | 207 | /* trigger sound */ |
| 220 | | if ((info->sndregs[offset - 1] != 0) && (data != 0)){ |
| 208 | if ((m_sndregs[offset - 1] != 0) && (data != 0)){ |
| 221 | 209 | if (!channel->active){ |
| 222 | 210 | channel->active = 1; |
| 223 | 211 | channel->chunkNum = 0; |
| 224 | 212 | channel->loop = 0; |
| 225 | | LOG_SOUND(("(GAE1) Playing sample channel: %02d, type: %02x, bank: %02x, end: %08x, Length: %04x\n", offset >> 3, (info->sndregs[offset - 2] >> 4) & 0x0f, info->sndregs[offset - 2] & 0x03, info->sndregs[offset - 1] << 8, data)); |
| 213 | LOG_SOUND(("(GAE1) Playing sample channel: %02d, type: %02x, bank: %02x, end: %08x, Length: %04x\n", offset >> 3, (m_sndregs[offset - 2] >> 4) & 0x0f, m_sndregs[offset - 2] & 0x03, m_sndregs[offset - 1] << 8, data)); |
| 226 | 214 | } |
| 227 | 215 | } else { |
| 228 | 216 | channel->active = 0; |
| r19905 | r19906 | |
| 231 | 219 | break; |
| 232 | 220 | |
| 233 | 221 | case 0x07: /* enable/disable looping */ |
| 234 | | if ((info->sndregs[offset - 1] != 0) && (data != 0)){ |
| 235 | | LOG_SOUND(("(GAE1) Looping in channel: %02d, type: %02x, bank: %02x, end: %08x, Length: %04x\n", offset >> 3, (info->sndregs[offset - 2] >> 4) & 0x0f, info->sndregs[offset - 2] & 0x03, info->sndregs[offset - 1] << 8, data)); |
| 222 | if ((m_sndregs[offset - 1] != 0) && (data != 0)){ |
| 223 | LOG_SOUND(("(GAE1) Looping in channel: %02d, type: %02x, bank: %02x, end: %08x, Length: %04x\n", offset >> 3, (m_sndregs[offset - 2] >> 4) & 0x0f, m_sndregs[offset - 2] & 0x03, m_sndregs[offset - 1] << 8, data)); |
| 236 | 224 | channel->loop = 1; |
| 237 | 225 | } else { |
| 238 | 226 | channel->loop = 0; |
| r19905 | r19906 | |
| 243 | 231 | } |
| 244 | 232 | |
| 245 | 233 | /*============================================================================ |
| 246 | | CG-1V/GAE1 Init |
| 234 | CG-1V/GAE1 Init / Close |
| 247 | 235 | ============================================================================*/ |
| 248 | 236 | |
| 249 | | static DEVICE_START( gaelco ) |
| 237 | void gaelco_gae1_device::device_start() |
| 250 | 238 | { |
| 251 | 239 | int j, vol; |
| 252 | | const gaelcosnd_interface *intf = (const gaelcosnd_interface *)device->static_config(); |
| 240 | const gaelcosnd_interface *intf = (const gaelcosnd_interface *)static_config(); |
| 253 | 241 | |
| 254 | | gaelco_sound_state *info = get_safe_token(device); |
| 255 | | |
| 256 | 242 | /* copy rom banks */ |
| 257 | 243 | for (j = 0; j < 4; j++){ |
| 258 | | info->banks[j] = intf->banks[j]; |
| 244 | m_banks[j] = intf->banks[j]; |
| 259 | 245 | } |
| 260 | | info->stream = device->machine().sound().stream_alloc(*device, 0, 2, 8000, info, gaelco_update); |
| 261 | | info->snd_data = (UINT8 *)device->machine().root_device().memregion(intf->gfxregion)->base(); |
| 262 | | if (info->snd_data == NULL) |
| 263 | | info->snd_data = *device->region(); |
| 246 | m_stream = stream_alloc(0, 2, 8000); |
| 247 | m_snd_data = (UINT8 *)machine().root_device().memregion(intf->gfxregion)->base(); |
| 248 | if (m_snd_data == NULL) |
| 249 | m_snd_data = *region(); |
| 264 | 250 | |
| 265 | 251 | /* init volume table */ |
| 266 | 252 | for (vol = 0; vol < VOLUME_LEVELS; vol++){ |
| 267 | 253 | for (j = -128; j <= 127; j++){ |
| 268 | | info->volume_table[vol][(j ^ 0x80) & 0xff] = (vol*j*256)/(VOLUME_LEVELS - 1); |
| 254 | m_volume_table[vol][(j ^ 0x80) & 0xff] = (vol*j*256)/(VOLUME_LEVELS - 1); |
| 269 | 255 | } |
| 270 | 256 | } |
| 271 | 257 | |
| r19905 | r19906 | |
| 274 | 260 | } |
| 275 | 261 | |
| 276 | 262 | |
| 277 | | static DEVICE_STOP( gaelco ) |
| 263 | void gaelco_gae1_device::device_stop() |
| 278 | 264 | { |
| 279 | 265 | if (wavraw) |
| 280 | 266 | wav_close(wavraw); |
| r19905 | r19906 | |
| 282 | 268 | } |
| 283 | 269 | |
| 284 | 270 | |
| 285 | | const device_type GAELCO_GAE1 = &device_creator<gaelco_gae1_device>; |
| 286 | 271 | |
| 287 | | gaelco_gae1_device::gaelco_gae1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 288 | | : device_t(mconfig, GAELCO_GAE1, "Gaelco GAE1", tag, owner, clock), |
| 289 | | device_sound_interface(mconfig, *this) |
| 290 | | { |
| 291 | | m_token = global_alloc_clear(gaelco_sound_state); |
| 292 | | } |
| 293 | 272 | |
| 294 | | gaelco_gae1_device::gaelco_gae1_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) |
| 295 | | : device_t(mconfig, type, name, tag, owner, clock), |
| 296 | | device_sound_interface(mconfig, *this) |
| 297 | | { |
| 298 | | m_token = global_alloc_clear(gaelco_sound_state); |
| 299 | | } |
| 273 | /*============================================================================ |
| 274 | Gaelco CG-1V sound device |
| 275 | ============================================================================*/ |
| 300 | 276 | |
| 301 | | //------------------------------------------------- |
| 302 | | // device_config_complete - perform any |
| 303 | | // operations now that the configuration is |
| 304 | | // complete |
| 305 | | //------------------------------------------------- |
| 306 | | |
| 307 | | void gaelco_gae1_device::device_config_complete() |
| 308 | | { |
| 309 | | } |
| 310 | | |
| 311 | | //------------------------------------------------- |
| 312 | | // device_start - device-specific startup |
| 313 | | //------------------------------------------------- |
| 314 | | |
| 315 | | void gaelco_gae1_device::device_start() |
| 316 | | { |
| 317 | | DEVICE_START_NAME( gaelco )(this); |
| 318 | | } |
| 319 | | |
| 320 | | //------------------------------------------------- |
| 321 | | // device_stop - device-specific stop |
| 322 | | //------------------------------------------------- |
| 323 | | |
| 324 | | void gaelco_gae1_device::device_stop() |
| 325 | | { |
| 326 | | DEVICE_STOP_NAME( gaelco )(this); |
| 327 | | } |
| 328 | | |
| 329 | | //------------------------------------------------- |
| 330 | | // sound_stream_update - handle a stream update |
| 331 | | //------------------------------------------------- |
| 332 | | |
| 333 | | void gaelco_gae1_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) |
| 334 | | { |
| 335 | | // should never get here |
| 336 | | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); |
| 337 | | } |
| 338 | | |
| 339 | | |
| 340 | 277 | const device_type GAELCO_CG1V = &device_creator<gaelco_cg1v_device>; |
| 341 | 278 | |
| 342 | 279 | gaelco_cg1v_device::gaelco_cg1v_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |