trunk/src/mame/drivers/metro.c
| r22805 | r22806 | |
| 365 | 365 | { |
| 366 | 366 | if (!BIT(data, 2)) |
| 367 | 367 | { |
| 368 | | ym2413_w(m_ymsnd, space, BIT(data, 1), m_porta); |
| 368 | downcast<ym2413_device *>(m_ymsnd.target())->write(space, BIT(data, 1), m_porta); |
| 369 | 369 | } |
| 370 | 370 | m_portb = data; |
| 371 | 371 | return; |
| r22805 | r22806 | |
| 1252 | 1252 | AM_RANGE(0x279700, 0x279713) AM_WRITEONLY AM_SHARE("videoregs") // Video Registers |
| 1253 | 1253 | AM_RANGE(0x400000, 0x400001) AM_WRITENOP // ? 5 |
| 1254 | 1254 | AM_RANGE(0x500000, 0x500001) AM_WRITE(gakusai_oki_bank_lo_w) // Sound |
| 1255 | | AM_RANGE(0x600000, 0x600003) AM_DEVWRITE8_LEGACY("ymsnd", ym2413_w, 0x00ff) |
| 1255 | AM_RANGE(0x600000, 0x600003) AM_DEVWRITE8("ymsnd", ym2413_device, write, 0x00ff) |
| 1256 | 1256 | AM_RANGE(0x700000, 0x700001) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff) // Sound |
| 1257 | 1257 | AM_RANGE(0xc00000, 0xc00001) AM_READWRITE(gakusai_eeprom_r, gakusai_eeprom_w) // EEPROM |
| 1258 | 1258 | AM_RANGE(0xd00000, 0xd00001) AM_WRITE(gakusai_oki_bank_hi_w) |
| r22805 | r22806 | |
| 1293 | 1293 | AM_RANGE(0x900000, 0x900001) AM_WRITE(gakusai_oki_bank_lo_w) // Sound bank |
| 1294 | 1294 | AM_RANGE(0xa00000, 0xa00001) AM_WRITE(gakusai_oki_bank_hi_w) // |
| 1295 | 1295 | AM_RANGE(0xb00000, 0xb00001) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff) // Sound |
| 1296 | | AM_RANGE(0xc00000, 0xc00003) AM_DEVWRITE8_LEGACY("ymsnd", ym2413_w, 0x00ff) |
| 1296 | AM_RANGE(0xc00000, 0xc00003) AM_DEVWRITE8("ymsnd", ym2413_device, write, 0x00ff) |
| 1297 | 1297 | AM_RANGE(0xe00000, 0xe00001) AM_READWRITE(gakusai_eeprom_r,gakusai_eeprom_w) // EEPROM |
| 1298 | 1298 | AM_RANGE(0xf00000, 0xf0ffff) AM_RAM AM_MIRROR(0x0f0000) // RAM (mirrored) |
| 1299 | 1299 | ADDRESS_MAP_END |
| r22805 | r22806 | |
| 1360 | 1360 | AM_RANGE(0x279700, 0x279713) AM_WRITEONLY AM_SHARE("videoregs") // Video Registers |
| 1361 | 1361 | AM_RANGE(0x400000, 0x400001) AM_WRITENOP // ? 5 |
| 1362 | 1362 | AM_RANGE(0x500000, 0x500001) AM_WRITE(gakusai_oki_bank_lo_w) // Sound |
| 1363 | | AM_RANGE(0x600000, 0x600003) AM_DEVWRITE8_LEGACY("ymsnd", ym2413_w, 0x00ff) |
| 1363 | AM_RANGE(0x600000, 0x600003) AM_DEVWRITE8("ymsnd", ym2413_device, write, 0x00ff) |
| 1364 | 1364 | AM_RANGE(0x700000, 0x700001) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff) // Sound |
| 1365 | 1365 | AM_RANGE(0xc00000, 0xc00001) AM_WRITE(dokyusp_eeprom_reset_w) // EEPROM |
| 1366 | 1366 | AM_RANGE(0xd00000, 0xd00001) AM_READWRITE(dokyusp_eeprom_r, dokyusp_eeprom_bit_w) // EEPROM |
| r22805 | r22806 | |
| 1403 | 1403 | AM_RANGE(0x800000, 0x800001) AM_WRITE(gakusai_oki_bank_hi_w) // Samples Bank? |
| 1404 | 1404 | AM_RANGE(0x900000, 0x900001) AM_WRITENOP // ? 4 |
| 1405 | 1405 | AM_RANGE(0xa00000, 0xa00001) AM_WRITE(gakusai_oki_bank_lo_w) // Samples Bank |
| 1406 | | AM_RANGE(0xc00000, 0xc00003) AM_DEVWRITE8_LEGACY("ymsnd", ym2413_w, 0x00ff) // |
| 1406 | AM_RANGE(0xc00000, 0xc00003) AM_DEVWRITE8("ymsnd", ym2413_device, write, 0x00ff) // |
| 1407 | 1407 | AM_RANGE(0xd00000, 0xd00001) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff) // Sound |
| 1408 | 1408 | AM_RANGE(0xf00000, 0xf0ffff) AM_RAM AM_MIRROR(0x0f0000) // RAM (mirrored) |
| 1409 | 1409 | ADDRESS_MAP_END |
| r22805 | r22806 | |
| 1691 | 1691 | AM_RANGE(0x478888, 0x478889) AM_WRITENOP // ?? |
| 1692 | 1692 | AM_RANGE(0x479700, 0x479713) AM_WRITEONLY AM_SHARE("videoregs") // Video Registers |
| 1693 | 1693 | AM_RANGE(0x800000, 0x800001) AM_WRITE(mouja_sound_rombank_w) |
| 1694 | | AM_RANGE(0xc00000, 0xc00003) AM_DEVWRITE8_LEGACY("ymsnd", ym2413_w, 0x00ff) |
| 1694 | AM_RANGE(0xc00000, 0xc00003) AM_DEVWRITE8("ymsnd", ym2413_device, write, 0x00ff) |
| 1695 | 1695 | AM_RANGE(0xd00000, 0xd00001) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0xffff) |
| 1696 | 1696 | AM_RANGE(0xf00000, 0xf0ffff) AM_RAM AM_MIRROR(0x0f0000) // RAM (mirrored) |
| 1697 | 1697 | #if 0 |
| r22805 | r22806 | |
| 1749 | 1749 | AM_RANGE(0x470000, 0x47dfff) AM_RAM |
| 1750 | 1750 | |
| 1751 | 1751 | AM_RANGE(0x500000, 0x500001) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0xff00) |
| 1752 | | AM_RANGE(0x580000, 0x580003) AM_DEVWRITE8_LEGACY("ymsnd", ym2413_w, 0xff00) |
| 1752 | AM_RANGE(0x580000, 0x580003) AM_DEVWRITE8("ymsnd", ym2413_device, write, 0xff00) |
| 1753 | 1753 | |
| 1754 | 1754 | AM_RANGE(0x700000, 0x71ffff) AM_RAM_WRITE(metro_vram_0_w) AM_SHARE("vram_0") // Layer 0 |
| 1755 | 1755 | AM_RANGE(0x720000, 0x73ffff) AM_RAM_WRITE(metro_vram_1_w) AM_SHARE("vram_1") // Layer 1 |
trunk/src/mame/drivers/ddenlovr.c
| r22805 | r22806 | |
| 1916 | 1916 | AM_RANGE(0x300286, 0x300287) AM_READ(ddenlovr_gfxrom_r) // Video Chip |
| 1917 | 1917 | |
| 1918 | 1918 | AM_RANGE(0x3002c0, 0x3002c1) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff)// Sound |
| 1919 | | AM_RANGE(0x300300, 0x300303) AM_DEVWRITE8_LEGACY("ymsnd", ym2413_w, 0x00ff) |
| 1919 | AM_RANGE(0x300300, 0x300303) AM_DEVWRITE8("ymsnd", ym2413_device, write, 0x00ff) |
| 1920 | 1920 | AM_RANGE(0x300340, 0x30035f) AM_DEVREADWRITE8("rtc", msm6242_device, read, write,0x00ff) |
| 1921 | 1921 | AM_RANGE(0x300380, 0x300383) AM_DEVWRITE8("aysnd", ay8910_device, address_data_w, 0x00ff) |
| 1922 | 1922 | AM_RANGE(0x300384, 0x300385) AM_DEVREAD8("aysnd", ay8910_device, data_r, 0x00ff) |
| r22805 | r22806 | |
| 1968 | 1968 | AM_RANGE(0x300070, 0x300071) AM_READ(unk16_r) // ? must be 78 on startup (not necessary in ddlover) |
| 1969 | 1969 | AM_RANGE(0x300080, 0x300083) AM_WRITE(ddenlovr_blitter_w) |
| 1970 | 1970 | AM_RANGE(0x300086, 0x300087) AM_READ(ddenlovr_gfxrom_r) // Video Chip |
| 1971 | | AM_RANGE(0x3000c0, 0x3000c3) AM_DEVWRITE8_LEGACY("ymsnd", ym2413_w, 0x00ff) |
| 1971 | AM_RANGE(0x3000c0, 0x3000c3) AM_DEVWRITE8("ymsnd", ym2413_device, write, 0x00ff) |
| 1972 | 1972 | AM_RANGE(0x300100, 0x30011f) AM_DEVREADWRITE8("rtc", msm6242_device, read, write,0x00ff) |
| 1973 | 1973 | AM_RANGE(0x300140, 0x300143) AM_DEVWRITE8("aysnd", ay8910_device, address_data_w, 0x00ff) |
| 1974 | 1974 | AM_RANGE(0x300180, 0x300181) AM_READ_PORT("P1") |
| r22805 | r22806 | |
| 2035 | 2035 | AM_RANGE(0xe00308, 0xe00309) AM_WRITE(ddenlovr_coincounter_0_w) // Coin Counters |
| 2036 | 2036 | AM_RANGE(0xe0030c, 0xe0030d) AM_WRITE(ddenlovr_coincounter_1_w) // |
| 2037 | 2037 | |
| 2038 | | AM_RANGE(0xe00400, 0xe00403) AM_DEVWRITE8_LEGACY("ymsnd", ym2413_w, 0x00ff) |
| 2038 | AM_RANGE(0xe00400, 0xe00403) AM_DEVWRITE8("ymsnd", ym2413_device, write, 0x00ff) |
| 2039 | 2039 | AM_RANGE(0xe00500, 0xe0051f) AM_DEVREADWRITE8("rtc", msm6242_device, read, write,0x00ff) |
| 2040 | 2040 | AM_RANGE(0xe00600, 0xe00603) AM_DEVWRITE8("aysnd", ay8910_device, address_data_w, 0x00ff) |
| 2041 | 2041 | AM_RANGE(0xe00604, 0xe00605) AM_DEVREAD8("aysnd", ay8910_device, data_r, 0x00ff) |
| r22805 | r22806 | |
| 2073 | 2073 | AM_RANGE(0xe00308, 0xe00309) AM_WRITE(ddenlovr_coincounter_0_w) // Coin Counters |
| 2074 | 2074 | AM_RANGE(0xe0030c, 0xe0030d) AM_WRITE(ddenlovr_coincounter_1_w) // |
| 2075 | 2075 | |
| 2076 | | AM_RANGE(0xe00400, 0xe00403) AM_DEVWRITE8_LEGACY("ymsnd", ym2413_w, 0x00ff) |
| 2076 | AM_RANGE(0xe00400, 0xe00403) AM_DEVWRITE8("ymsnd", ym2413_device, write, 0x00ff) |
| 2077 | 2077 | AM_RANGE(0xe00500, 0xe0051f) AM_DEVREADWRITE8("rtc", msm6242_device, read, write,0x00ff) |
| 2078 | 2078 | AM_RANGE(0xe00600, 0xe00603) AM_DEVWRITE8("aysnd", ay8910_device, address_data_w, 0x00ff) |
| 2079 | 2079 | AM_RANGE(0xe00604, 0xe00605) AM_DEVREAD8("aysnd", ay8910_device, data_r, 0x00ff) |
| r22805 | r22806 | |
| 2147 | 2147 | AM_RANGE(0x300070, 0x300071) AM_READ(unk16_r) // ? must be 78 on startup (not necessary in ddlover) |
| 2148 | 2148 | AM_RANGE(0x300080, 0x300083) AM_WRITE(ddenlovr_blitter_w) |
| 2149 | 2149 | AM_RANGE(0x300086, 0x300087) AM_READ(ddenlovr_gfxrom_r) // Video Chip |
| 2150 | | AM_RANGE(0x3000c0, 0x3000c3) AM_DEVWRITE8_LEGACY("ymsnd", ym2413_w, 0x00ff) |
| 2150 | AM_RANGE(0x3000c0, 0x3000c3) AM_DEVWRITE8("ymsnd", ym2413_device, write, 0x00ff) |
| 2151 | 2151 | AM_RANGE(0x300100, 0x30011f) AM_DEVREADWRITE8("rtc", msm6242_device, read, write,0x00ff) |
| 2152 | 2152 | AM_RANGE(0x300140, 0x300143) AM_DEVWRITE8("aysnd", ay8910_device, address_data_w, 0x00ff) |
| 2153 | 2153 | AM_RANGE(0x300180, 0x300181) AM_READ_PORT("P1") |
| r22805 | r22806 | |
| 2210 | 2210 | AM_RANGE(0xe00308, 0xe00309) AM_WRITE(ddenlovr_coincounter_0_w) // Coin Counters |
| 2211 | 2211 | AM_RANGE(0xe0030c, 0xe0030d) AM_WRITE(ddenlovr_coincounter_1_w) // |
| 2212 | 2212 | |
| 2213 | | AM_RANGE(0xe00400, 0xe00403) AM_DEVWRITE8_LEGACY("ymsnd", ym2413_w, 0x00ff) |
| 2213 | AM_RANGE(0xe00400, 0xe00403) AM_DEVWRITE8("ymsnd", ym2413_device, write, 0x00ff) |
| 2214 | 2214 | AM_RANGE(0xe00500, 0xe0051f) AM_DEVREADWRITE8("rtc", msm6242_device, read, write,0x00ff) |
| 2215 | 2215 | AM_RANGE(0xe00600, 0xe00603) AM_DEVWRITE8("aysnd", ay8910_device, address_data_w, 0x00ff) |
| 2216 | 2216 | AM_RANGE(0xe00604, 0xe00605) AM_DEVREAD8("aysnd", ay8910_device, data_r, 0x00ff) |
| r22805 | r22806 | |
| 2266 | 2266 | AM_RANGE(0x22, 0x23) AM_READ(rongrong_input2_r) |
| 2267 | 2267 | |
| 2268 | 2268 | AM_RANGE(0x40, 0x40) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 2269 | | AM_RANGE(0x60, 0x61) AM_DEVWRITE_LEGACY("ymsnd", ym2413_w) |
| 2269 | AM_RANGE(0x60, 0x61) AM_DEVWRITE("ymsnd", ym2413_device, write) |
| 2270 | 2270 | |
| 2271 | 2271 | AM_RANGE(0x80, 0x83) AM_WRITE(ddenlovr_palette_base_w) |
| 2272 | 2272 | AM_RANGE(0x84, 0x87) AM_WRITE(ddenlovr_palette_mask_w) |
| r22805 | r22806 | |
| 2303 | 2303 | |
| 2304 | 2304 | AM_RANGE(0x20, 0x2f) AM_DEVREADWRITE("rtc", msm6242_device, read, write) |
| 2305 | 2305 | AM_RANGE(0x40, 0x40) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 2306 | | AM_RANGE(0x60, 0x61) AM_DEVWRITE_LEGACY("ymsnd", ym2413_w) |
| 2306 | AM_RANGE(0x60, 0x61) AM_DEVWRITE("ymsnd", ym2413_device, write) |
| 2307 | 2307 | |
| 2308 | 2308 | AM_RANGE(0x80, 0x83) AM_WRITE(ddenlovr_palette_base_w) |
| 2309 | 2309 | AM_RANGE(0x84, 0x87) AM_WRITE(ddenlovr_palette_mask_w) |
| r22805 | r22806 | |
| 2457 | 2457 | AM_RANGE(0x02, 0x02) AM_READNOP // read just before port 00 |
| 2458 | 2458 | AM_RANGE(0x04, 0x04) AM_NOP // read only once at the start |
| 2459 | 2459 | AM_RANGE(0x06, 0x06) AM_WRITENOP // almost always 1, sometimes 0 |
| 2460 | | AM_RANGE(0x08, 0x09) AM_DEVWRITE_LEGACY("ymsnd", ym2413_w) |
| 2460 | AM_RANGE(0x08, 0x09) AM_DEVWRITE("ymsnd", ym2413_device, write) |
| 2461 | 2461 | AM_RANGE(0x0c, 0x0c) AM_DEVWRITE("aysnd", ay8910_device, data_w) |
| 2462 | 2462 | AM_RANGE(0x0e, 0x0e) AM_DEVWRITE("aysnd", ay8910_device, address_w) |
| 2463 | 2463 | ADDRESS_MAP_END |
| r22805 | r22806 | |
| 2740 | 2740 | AM_RANGE(0x93, 0x93) AM_WRITE(hanakanz_coincounter_w) |
| 2741 | 2741 | AM_RANGE(0x94, 0x94) AM_WRITE(hanakanz_keyb_w) |
| 2742 | 2742 | AM_RANGE(0x96, 0x96) AM_READ(hanakanz_rand_r) |
| 2743 | | AM_RANGE(0xa0, 0xa1) AM_DEVWRITE_LEGACY("ymsnd", ym2413_w) |
| 2743 | AM_RANGE(0xa0, 0xa1) AM_DEVWRITE("ymsnd", ym2413_device, write) |
| 2744 | 2744 | AM_RANGE(0xc0, 0xc0) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 2745 | 2745 | AM_RANGE(0xe0, 0xef) AM_DEVREADWRITE("rtc", msm6242_device, read, write) |
| 2746 | 2746 | ADDRESS_MAP_END |
| r22805 | r22806 | |
| 2756 | 2756 | AM_RANGE(0x80, 0x80) AM_WRITE(hanakanz_blitter_data_w) |
| 2757 | 2757 | AM_RANGE(0x81, 0x81) AM_WRITE(hanakanz_palette_w) |
| 2758 | 2758 | AM_RANGE(0x83, 0x84) AM_READ(hanakanz_gfxrom_r) |
| 2759 | | AM_RANGE(0xa0, 0xa1) AM_DEVWRITE_LEGACY("ymsnd", ym2413_w) |
| 2759 | AM_RANGE(0xa0, 0xa1) AM_DEVWRITE("ymsnd", ym2413_device, write) |
| 2760 | 2760 | AM_RANGE(0xb0, 0xb0) AM_READ_PORT("SYSTEM") |
| 2761 | 2761 | AM_RANGE(0xb1, 0xb2) AM_READ(hanakanz_keyb_r) |
| 2762 | 2762 | AM_RANGE(0xb3, 0xb3) AM_WRITE(hanakanz_coincounter_w) |
| r22805 | r22806 | |
| 2778 | 2778 | AM_RANGE(0x80, 0x80) AM_WRITE(hanakanz_blitter_data_w) |
| 2779 | 2779 | AM_RANGE(0x81, 0x81) AM_WRITE(hanakanz_palette_w) |
| 2780 | 2780 | AM_RANGE(0x83, 0x84) AM_READ(hanakanz_gfxrom_r) |
| 2781 | | AM_RANGE(0xa0, 0xa1) AM_DEVWRITE_LEGACY("ymsnd", ym2413_w) |
| 2781 | AM_RANGE(0xa0, 0xa1) AM_DEVWRITE("ymsnd", ym2413_device, write) |
| 2782 | 2782 | AM_RANGE(0xb0, 0xb0) AM_READ_PORT("SYSTEM") |
| 2783 | 2783 | // AM_RANGE(0xb1, 0xb2) AM_READ(hanakanz_keyb_r) |
| 2784 | 2784 | AM_RANGE(0xb1, 0xb1) AM_READ_PORT("KEYB0") |
| r22805 | r22806 | |
| 2802 | 2802 | AM_RANGE(0x80, 0x80) AM_WRITE(hanakanz_blitter_data_w) |
| 2803 | 2803 | AM_RANGE(0x81, 0x81) AM_WRITE(hanakanz_palette_w) |
| 2804 | 2804 | AM_RANGE(0x83, 0x84) AM_READ(hanakanz_gfxrom_r) |
| 2805 | | AM_RANGE(0xa0, 0xa1) AM_DEVWRITE_LEGACY("ymsnd", ym2413_w) |
| 2805 | AM_RANGE(0xa0, 0xa1) AM_DEVWRITE("ymsnd", ym2413_device, write) |
| 2806 | 2806 | AM_RANGE(0x90, 0x90) AM_READ_PORT("SYSTEM") |
| 2807 | 2807 | // AM_RANGE(0x91, 0x91) AM_READ(hanakanz_keyb_r) |
| 2808 | 2808 | AM_RANGE(0x91, 0x91) AM_READ_PORT("KEYB0") |
| r22805 | r22806 | |
| 2841 | 2841 | AM_RANGE(0x94, 0x94) AM_READ_PORT("SYSTEM") |
| 2842 | 2842 | AM_RANGE(0x95, 0x96) AM_READ(hanakanz_keyb_r) |
| 2843 | 2843 | AM_RANGE(0x97, 0x97) AM_WRITE(hanakanz_coincounter_w) |
| 2844 | | AM_RANGE(0xa0, 0xa1) AM_DEVWRITE_LEGACY("ymsnd", ym2413_w) |
| 2844 | AM_RANGE(0xa0, 0xa1) AM_DEVWRITE("ymsnd", ym2413_device, write) |
| 2845 | 2845 | AM_RANGE(0xc0, 0xc0) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 2846 | 2846 | AM_RANGE(0xe0, 0xef) AM_DEVREADWRITE("rtc", msm6242_device, read, write) |
| 2847 | 2847 | ADDRESS_MAP_END |
| r22805 | r22806 | |
| 2969 | 2969 | AM_RANGE(0x63, 0x63) AM_MIRROR(0xff00) AM_READ_PORT("DSW4") |
| 2970 | 2970 | AM_RANGE(0x64, 0x64) AM_MIRROR(0xff00) AM_READ_PORT("DSW5") // DSW 1-4 high bits |
| 2971 | 2971 | AM_RANGE(0x80, 0x80) AM_MIRROR(0xff00) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 2972 | | AM_RANGE(0xa0, 0xa1) AM_MIRROR(0xff00) AM_DEVWRITE_LEGACY("ymsnd", ym2413_w) |
| 2972 | AM_RANGE(0xa0, 0xa1) AM_MIRROR(0xff00) AM_DEVWRITE("ymsnd", ym2413_device, write) |
| 2973 | 2973 | AM_RANGE(0xc0, 0xcf) AM_MIRROR(0xff00) AM_DEVREADWRITE("rtc", msm6242_device, read, write) |
| 2974 | 2974 | AM_RANGE(0xe0, 0xe1) AM_MIRROR(0xff00) AM_DEVWRITE("aysnd", ay8910_device, address_data_w) |
| 2975 | 2975 | ADDRESS_MAP_END |
| r22805 | r22806 | |
| 3078 | 3078 | AM_RANGE(0x22, 0x22) AM_READ(mjmyster_coins_r) |
| 3079 | 3079 | AM_RANGE(0x23, 0x23) AM_READ(mjmyster_keyb_r) |
| 3080 | 3080 | AM_RANGE(0x40, 0x40) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 3081 | | AM_RANGE(0x42, 0x43) AM_DEVWRITE_LEGACY("ymsnd", ym2413_w) |
| 3081 | AM_RANGE(0x42, 0x43) AM_DEVWRITE("ymsnd", ym2413_device, write) |
| 3082 | 3082 | AM_RANGE(0x44, 0x44) AM_DEVREAD("aysnd", ay8910_device, data_r) |
| 3083 | 3083 | AM_RANGE(0x46, 0x46) AM_DEVWRITE("aysnd", ay8910_device, data_w) |
| 3084 | 3084 | AM_RANGE(0x48, 0x48) AM_DEVWRITE("aysnd", ay8910_device, address_w) |
| r22805 | r22806 | |
| 3243 | 3243 | AM_RANGE(0x03, 0x03) AM_READ(rongrong_gfxrom_r) |
| 3244 | 3244 | AM_RANGE(0x1c, 0x1c) AM_READNOP AM_WRITE(mjmyster_rambank_w) |
| 3245 | 3245 | AM_RANGE(0x1e, 0x1e) AM_WRITE(hginga_rombank_w) |
| 3246 | | AM_RANGE(0x22, 0x23) AM_DEVWRITE_LEGACY("ymsnd", ym2413_w) |
| 3246 | AM_RANGE(0x22, 0x23) AM_DEVWRITE("ymsnd", ym2413_device, write) |
| 3247 | 3247 | AM_RANGE(0x24, 0x24) AM_DEVREAD("aysnd", ay8910_device, data_r) |
| 3248 | 3248 | AM_RANGE(0x26, 0x26) AM_DEVWRITE("aysnd", ay8910_device, data_w) |
| 3249 | 3249 | AM_RANGE(0x28, 0x28) AM_DEVWRITE("aysnd", ay8910_device, address_w) |
| r22805 | r22806 | |
| 3366 | 3366 | AM_RANGE(0x61, 0x61) AM_WRITE(hgokou_input_w) |
| 3367 | 3367 | AM_RANGE(0x62, 0x62) AM_READ(hgokou_input_r) |
| 3368 | 3368 | AM_RANGE(0x80, 0x80) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 3369 | | AM_RANGE(0x82, 0x83) AM_DEVWRITE_LEGACY("ymsnd", ym2413_w) |
| 3369 | AM_RANGE(0x82, 0x83) AM_DEVWRITE("ymsnd", ym2413_device, write) |
| 3370 | 3370 | AM_RANGE(0x84, 0x84) AM_DEVREAD("aysnd", ay8910_device, data_r) |
| 3371 | 3371 | AM_RANGE(0x86, 0x86) AM_DEVWRITE("aysnd", ay8910_device, data_w) |
| 3372 | 3372 | AM_RANGE(0x88, 0x88) AM_DEVWRITE("aysnd", ay8910_device, address_w) |
| r22805 | r22806 | |
| 3409 | 3409 | AM_RANGE(0x1c, 0x1c) AM_READNOP AM_WRITE(mjmyster_rambank_w) // ? ack on RTC int |
| 3410 | 3410 | AM_RANGE(0x1e, 0x1e) AM_WRITE(hginga_rombank_w) |
| 3411 | 3411 | AM_RANGE(0x20, 0x20) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 3412 | | AM_RANGE(0x22, 0x23) AM_DEVWRITE_LEGACY("ymsnd", ym2413_w) |
| 3412 | AM_RANGE(0x22, 0x23) AM_DEVWRITE("ymsnd", ym2413_device, write) |
| 3413 | 3413 | AM_RANGE(0x24, 0x24) AM_DEVREAD("aysnd", ay8910_device, data_r) |
| 3414 | 3414 | AM_RANGE(0x26, 0x26) AM_DEVWRITE("aysnd", ay8910_device, data_w) |
| 3415 | 3415 | AM_RANGE(0x28, 0x28) AM_DEVWRITE("aysnd", ay8910_device, address_w) |
| r22805 | r22806 | |
| 3500 | 3500 | AM_RANGE(0x1c, 0x1c) AM_READ(hparadis_dsw_r) |
| 3501 | 3501 | AM_RANGE(0x1e, 0x1e) AM_WRITE(hparadis_select_w) |
| 3502 | 3502 | AM_RANGE(0x40, 0x40) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 3503 | | AM_RANGE(0x60, 0x61) AM_DEVWRITE_LEGACY("ymsnd", ym2413_w) |
| 3503 | AM_RANGE(0x60, 0x61) AM_DEVWRITE("ymsnd", ym2413_device, write) |
| 3504 | 3504 | AM_RANGE(0x80, 0x83) AM_WRITE(ddenlovr_palette_base_w) |
| 3505 | 3505 | AM_RANGE(0x84, 0x87) AM_WRITE(ddenlovr_palette_mask_w) |
| 3506 | 3506 | AM_RANGE(0x88, 0x8b) AM_WRITE(ddenlovr_transparency_pen_w) |
| r22805 | r22806 | |
| 3546 | 3546 | AM_RANGE(0x22, 0x22) AM_READ(mjmywrld_coins_r) |
| 3547 | 3547 | AM_RANGE(0x23, 0x23) AM_READ(mjmyster_keyb_r) |
| 3548 | 3548 | AM_RANGE(0x40, 0x40) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 3549 | | AM_RANGE(0x42, 0x43) AM_DEVWRITE_LEGACY("ymsnd", ym2413_w) |
| 3549 | AM_RANGE(0x42, 0x43) AM_DEVWRITE("ymsnd", ym2413_device, write) |
| 3550 | 3550 | AM_RANGE(0x44, 0x44) AM_DEVREAD("aysnd", ay8910_device, data_r) |
| 3551 | 3551 | AM_RANGE(0x46, 0x46) AM_DEVWRITE("aysnd", ay8910_device, data_w) |
| 3552 | 3552 | AM_RANGE(0x48, 0x48) AM_DEVWRITE("aysnd", ay8910_device, address_w) |
| r22805 | r22806 | |
| 3646 | 3646 | AM_RANGE(0xe00308, 0xe00309) AM_WRITE(ddenlovr_coincounter_0_w) // Coin Counters |
| 3647 | 3647 | AM_RANGE(0xe0030c, 0xe0030d) AM_WRITE(ddenlovr_coincounter_1_w) // |
| 3648 | 3648 | |
| 3649 | | AM_RANGE(0xe00400, 0xe00403) AM_DEVWRITE8_LEGACY("ymsnd", ym2413_w, 0x00ff) |
| 3649 | AM_RANGE(0xe00400, 0xe00403) AM_DEVWRITE8("ymsnd", ym2413_device, write, 0x00ff) |
| 3650 | 3650 | AM_RANGE(0xe00500, 0xe0051f) AM_DEVREADWRITE8("rtc", msm6242_device, read, write, 0x00ff) |
| 3651 | 3651 | AM_RANGE(0xe00600, 0xe00603) AM_DEVWRITE8("aysnd", ay8910_device, address_data_w, 0x00ff) |
| 3652 | 3652 | AM_RANGE(0xe00604, 0xe00605) AM_DEVREAD8("aysnd", ay8910_device, data_r, 0x00ff) |
| r22805 | r22806 | |
| 3737 | 3737 | AM_RANGE(0x0100, 0x0100) AM_READ_PORT("DSW1") |
| 3738 | 3738 | AM_RANGE(0x0181, 0x0181) AM_WRITENOP // ? int. enable |
| 3739 | 3739 | AM_RANGE(0x0184, 0x0184) AM_WRITE(mjflove_coincounter_w) |
| 3740 | | AM_RANGE(0x0200, 0x0201) AM_DEVWRITE_LEGACY("ymsnd", ym2413_w) |
| 3740 | AM_RANGE(0x0200, 0x0201) AM_DEVWRITE("ymsnd", ym2413_device, write) |
| 3741 | 3741 | AM_RANGE(0x0280, 0x028f) AM_DEVREADWRITE("rtc", msm6242_device, read, write) |
| 3742 | 3742 | AM_RANGE(0x0300, 0x0301) AM_DEVWRITE("aysnd", ay8910_device, address_data_w) |
| 3743 | 3743 | AM_RANGE(0x0380, 0x0380) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| r22805 | r22806 | |
| 3778 | 3778 | AM_RANGE(0x60, 0x60) AM_WRITE(hanakanz_blitter_data_w) |
| 3779 | 3779 | AM_RANGE(0x61, 0x61) AM_WRITE(hanakanz_palette_w) |
| 3780 | 3780 | AM_RANGE(0x63, 0x64) AM_READ(hanakanz_gfxrom_r) |
| 3781 | | AM_RANGE(0x80, 0x81) AM_DEVWRITE_LEGACY("ymsnd", ym2413_w) |
| 3781 | AM_RANGE(0x80, 0x81) AM_DEVWRITE("ymsnd", ym2413_device, write) |
| 3782 | 3782 | AM_RANGE(0xa0, 0xa0) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 3783 | 3783 | AM_RANGE(0xc0, 0xcf) AM_DEVREADWRITE("rtc", msm6242_device, read, write) |
| 3784 | 3784 | ADDRESS_MAP_END |
| r22805 | r22806 | |
| 3841 | 3841 | static ADDRESS_MAP_START( sryudens_portmap, AS_IO, 8, ddenlovr_state ) |
| 3842 | 3842 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 3843 | 3843 | AM_RANGE(0x00, 0x00) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 3844 | | AM_RANGE(0x02, 0x03) AM_DEVWRITE_LEGACY("ymsnd", ym2413_w) |
| 3844 | AM_RANGE(0x02, 0x03) AM_DEVWRITE("ymsnd", ym2413_device, write) |
| 3845 | 3845 | AM_RANGE(0x04, 0x05) AM_DEVWRITE("aysnd", ay8910_device, address_data_w) |
| 3846 | 3846 | AM_RANGE(0x1c, 0x1c) AM_READNOP AM_WRITE(sryudens_rambank_w) // ? ack on RTC int |
| 3847 | 3847 | AM_RANGE(0x1e, 0x1e) AM_WRITE(mjflove_rombank_w) |
| r22805 | r22806 | |
| 3928 | 3928 | AM_RANGE(0x70, 0x70) AM_WRITE(quizchq_oki_bank_w) |
| 3929 | 3929 | AM_RANGE(0x80, 0x80) AM_RAM |
| 3930 | 3930 | AM_RANGE(0x90, 0x90) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 3931 | | AM_RANGE(0x92, 0x93) AM_DEVWRITE_LEGACY("ymsnd", ym2413_w) |
| 3931 | AM_RANGE(0x92, 0x93) AM_DEVWRITE("ymsnd", ym2413_device, write) |
| 3932 | 3932 | AM_RANGE(0x94, 0x95) AM_DEVWRITE("aysnd", ay8910_device, address_data_w) |
| 3933 | 3933 | ADDRESS_MAP_END |
| 3934 | 3934 | |
| r22805 | r22806 | |
| 4000 | 4000 | AM_RANGE(0x38, 0x38) AM_READNOP // ? ack or watchdog |
| 4001 | 4001 | AM_RANGE(0x40, 0x41) AM_WRITE(mjflove_blitter_w) |
| 4002 | 4002 | AM_RANGE(0x43, 0x43) AM_READ(rongrong_gfxrom_r) |
| 4003 | | AM_RANGE(0x50, 0x51) AM_DEVWRITE_LEGACY("ymsnd", ym2413_w) |
| 4003 | AM_RANGE(0x50, 0x51) AM_DEVWRITE("ymsnd", ym2413_device, write) |
| 4004 | 4004 | AM_RANGE(0x54, 0x54) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 4005 | 4005 | AM_RANGE(0x58, 0x58) AM_DEVWRITE("aysnd", ay8910_device, address_w) |
| 4006 | 4006 | AM_RANGE(0x5c, 0x5c) AM_DEVREADWRITE("aysnd", ay8910_device, data_r, data_w) // dsw |
| r22805 | r22806 | |
| 4154 | 4154 | AM_RANGE( 0x40, 0x40 ) AM_DEVWRITE("aysnd", ay8910_device, address_w) // AY8910 |
| 4155 | 4155 | AM_RANGE( 0x42, 0x42 ) AM_DEVREAD("aysnd", ay8910_device, data_r) // |
| 4156 | 4156 | AM_RANGE( 0x44, 0x44 ) AM_DEVWRITE("aysnd", ay8910_device, data_w) // |
| 4157 | | AM_RANGE( 0x46, 0x47 ) AM_DEVWRITE_LEGACY("ymsnd", ym2413_w) // |
| 4157 | AM_RANGE( 0x46, 0x47 ) AM_DEVWRITE("ymsnd", ym2413_device, write) // |
| 4158 | 4158 | AM_RANGE( 0x80, 0x8f ) AM_DEVREADWRITE("rtc", msm6242_device, read, write) |
| 4159 | 4159 | AM_RANGE( 0xa0, 0xa3 ) AM_WRITE(ddenlovr_palette_base_w) // ddenlovr mixer chip |
| 4160 | 4160 | AM_RANGE( 0xa4, 0xa7 ) AM_WRITE(ddenlovr_palette_mask_w) |
| r22805 | r22806 | |
| 4353 | 4353 | AM_RANGE(0x42, 0x44) AM_READ(hanakanz_gfxrom_r) |
| 4354 | 4354 | AM_RANGE(0x8a, 0x8b) AM_READ(daimyojn_year_hack_r) // ? |
| 4355 | 4355 | AM_RANGE(0x80, 0x8f) AM_DEVREADWRITE("rtc", msm6242_device, read, write) |
| 4356 | | AM_RANGE(0xa0, 0xa1) AM_DEVWRITE_LEGACY("ymsnd", ym2413_w) |
| 4356 | AM_RANGE(0xa0, 0xa1) AM_DEVWRITE("ymsnd", ym2413_device, write) |
| 4357 | 4357 | AM_RANGE(0xa2, 0xa2) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 4358 | 4358 | AM_RANGE(0xa8, 0xa8) AM_READ_PORT("SYSTEM") |
| 4359 | 4359 | AM_RANGE(0xaa, 0xaa) AM_READ(daimyojn_keyb1_r) |
trunk/src/mame/drivers/dynax.c
| r22805 | r22806 | |
| 553 | 553 | AM_RANGE( 0x26, 0x26 ) AM_READ_PORT("DSW2") // DSW3 |
| 554 | 554 | AM_RANGE( 0x30, 0x30 ) AM_WRITE(adpcm_reset_w) // MSM5205 reset |
| 555 | 555 | AM_RANGE( 0x32, 0x32 ) AM_WRITE(adpcm_data_w) // MSM5205 data |
| 556 | | AM_RANGE( 0x34, 0x35 ) AM_DEVWRITE_LEGACY("ymsnd", ym2413_w) // |
| 556 | AM_RANGE( 0x34, 0x35 ) AM_DEVWRITE("ymsnd", ym2413_device, write) // |
| 557 | 557 | AM_RANGE( 0x36, 0x36 ) AM_DEVREAD("aysnd", ay8910_device, data_r) // AY8910, DSW1 |
| 558 | 558 | AM_RANGE( 0x38, 0x38 ) AM_DEVWRITE("aysnd", ay8910_device, data_w) // AY8910 |
| 559 | 559 | AM_RANGE( 0x3a, 0x3a ) AM_DEVWRITE("aysnd", ay8910_device, address_w) // |
| r22805 | r22806 | |
| 638 | 638 | |
| 639 | 639 | AM_RANGE( 0x30, 0x30 ) AM_WRITE(adpcm_reset_w) // MSM5205 reset |
| 640 | 640 | AM_RANGE( 0x32, 0x32 ) AM_WRITE(adpcm_data_w) // MSM5205 data |
| 641 | | AM_RANGE( 0x34, 0x35 ) AM_DEVWRITE_LEGACY("ymsnd", ym2413_w) // |
| 641 | AM_RANGE( 0x34, 0x35 ) AM_DEVWRITE("ymsnd", ym2413_device, write) // |
| 642 | 642 | |
| 643 | 643 | AM_RANGE( 0x36, 0x36 ) AM_DEVREAD("aysnd", ay8910_device, data_r) // AY8910, DSW1 |
| 644 | 644 | AM_RANGE( 0x38, 0x38 ) AM_DEVWRITE("aysnd", ay8910_device, data_w) // AY8910 |
| r22805 | r22806 | |
| 778 | 778 | AM_RANGE( 0x11, 0x17 ) AM_WRITE(dynax_blitter_rev2_w) // Blitter |
| 779 | 779 | AM_RANGE( 0x20, 0x20 ) AM_WRITE(adpcm_reset_w) // MSM5205 reset |
| 780 | 780 | AM_RANGE( 0x22, 0x22 ) AM_WRITE(adpcm_data_w) // MSM5205 data |
| 781 | | AM_RANGE( 0x24, 0x25 ) AM_DEVWRITE_LEGACY("ymsnd", ym2413_w) // |
| 781 | AM_RANGE( 0x24, 0x25 ) AM_DEVWRITE("ymsnd", ym2413_device, write) // |
| 782 | 782 | AM_RANGE( 0x28, 0x28 ) AM_DEVWRITE("aysnd", ay8910_device, data_w) // AY8910 |
| 783 | 783 | AM_RANGE( 0x2a, 0x2a ) AM_DEVWRITE("aysnd", ay8910_device, address_w) // |
| 784 | 784 | AM_RANGE( 0x48, 0x48 ) AM_WRITE(dynax_extra_scrollx_w) // screen scroll X |
| r22805 | r22806 | |
| 817 | 817 | AM_RANGE( 0x26, 0x26 ) AM_READ_PORT("DSW1") // DSW3 |
| 818 | 818 | AM_RANGE( 0x30, 0x30 ) AM_WRITE(adpcm_reset_w) // MSM5205 reset |
| 819 | 819 | AM_RANGE( 0x32, 0x32 ) AM_WRITE(adpcm_data_w) // MSM5205 data |
| 820 | | AM_RANGE( 0x34, 0x35 ) AM_DEVWRITE_LEGACY("ymsnd", ym2413_w) // |
| 820 | AM_RANGE( 0x34, 0x35 ) AM_DEVWRITE("ymsnd", ym2413_device, write) // |
| 821 | 821 | AM_RANGE( 0x38, 0x38 ) AM_DEVWRITE("aysnd", ay8910_device, data_w) // AY8910 |
| 822 | 822 | AM_RANGE( 0x3a, 0x3a ) AM_DEVWRITE("aysnd", ay8910_device, address_w) // |
| 823 | 823 | AM_RANGE( 0x40, 0x40 ) AM_WRITE(dynax_blit_pen_w) // Destination Pen |
| r22805 | r22806 | |
| 891 | 891 | AM_RANGE( 0x63, 0x63 ) AM_READ(hanamai_keyboard_0_r) // P1 |
| 892 | 892 | AM_RANGE( 0x64, 0x64 ) AM_READ_PORT("DSW0") // DSW |
| 893 | 893 | AM_RANGE( 0x67, 0x67 ) AM_READ_PORT("DSW1") // DSW |
| 894 | | AM_RANGE( 0x70, 0x71 ) AM_DEVWRITE_LEGACY("ymsnd", ym2413_w) // |
| 894 | AM_RANGE( 0x70, 0x71 ) AM_DEVWRITE("ymsnd", ym2413_device, write) // |
| 895 | 895 | // AM_RANGE( 0x80, 0x80 ) AM_WRITENOP // IRQ ack? |
| 896 | 896 | ADDRESS_MAP_END |
| 897 | 897 | |
| r22805 | r22806 | |
| 900 | 900 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 901 | 901 | AM_RANGE( 0x00, 0x00 ) AM_WRITE(adpcm_reset_w) // MSM5205 reset |
| 902 | 902 | AM_RANGE( 0x02, 0x02 ) AM_WRITE(adpcm_data_w) // MSM5205 data |
| 903 | | AM_RANGE( 0x04, 0x05 ) AM_DEVWRITE_LEGACY("ymsnd", ym2413_w) // |
| 903 | AM_RANGE( 0x04, 0x05 ) AM_DEVWRITE("ymsnd", ym2413_device, write) // |
| 904 | 904 | AM_RANGE( 0x08, 0x08 ) AM_DEVWRITE("aysnd", ay8910_device, data_w) // AY8910 |
| 905 | 905 | AM_RANGE( 0x0a, 0x0a ) AM_DEVWRITE("aysnd", ay8910_device, address_w) // |
| 906 | 906 | AM_RANGE( 0x10, 0x10 ) AM_WRITE(hanamai_keyboard_w) // keyboard row select |
| r22805 | r22806 | |
| 1058 | 1058 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 1059 | 1059 | AM_RANGE( 0x00, 0x00 ) AM_WRITE(adpcm_reset_w) // MSM5205 reset |
| 1060 | 1060 | AM_RANGE( 0x02, 0x02 ) AM_WRITE(adpcm_data_w) // MSM5205 data |
| 1061 | | AM_RANGE( 0x04, 0x05 ) AM_DEVWRITE_LEGACY("ymsnd", ym2413_w) // |
| 1061 | AM_RANGE( 0x04, 0x05 ) AM_DEVWRITE("ymsnd", ym2413_device, write) // |
| 1062 | 1062 | AM_RANGE( 0x08, 0x08 ) AM_DEVWRITE("aysnd", ay8910_device, data_w) // AY8910 |
| 1063 | 1063 | AM_RANGE( 0x0a, 0x0a ) AM_DEVWRITE("aysnd", ay8910_device, address_w) // |
| 1064 | 1064 | AM_RANGE( 0x11, 0x12 ) AM_WRITE(mjelctrn_blitter_ack_w) //? |
| r22805 | r22806 | |
| 1342 | 1342 | AM_RANGE( 0x10000, 0x10000 ) AM_DEVREAD("aysnd", ay8910_device, data_r) // AY8910 |
| 1343 | 1343 | AM_RANGE( 0x10008, 0x10008 ) AM_DEVWRITE("aysnd", ay8910_device, data_w) // |
| 1344 | 1344 | AM_RANGE( 0x10010, 0x10010 ) AM_DEVWRITE("aysnd", ay8910_device, address_w) // |
| 1345 | | AM_RANGE( 0x10020, 0x10021 ) AM_DEVWRITE_LEGACY("ymsnd", ym2413_w) // |
| 1345 | AM_RANGE( 0x10020, 0x10021 ) AM_DEVWRITE("ymsnd", ym2413_device, write) // |
| 1346 | 1346 | AM_RANGE( 0x10040, 0x10040 ) AM_WRITE(dynax_blit_pen_w) // Destination Pen |
| 1347 | 1347 | AM_RANGE( 0x10044, 0x10044 ) AM_WRITE(tenkai_blit_dest_w) // Destination Layer |
| 1348 | 1348 | AM_RANGE( 0x10048, 0x10048 ) AM_WRITE(tenkai_blit_palette23_w) // Layers Palettes |
| r22805 | r22806 | |
| 1485 | 1485 | case 0x8050: // CRT controller |
| 1486 | 1486 | case 0x8051: return; |
| 1487 | 1487 | |
| 1488 | | case 0x8070: ym2413_register_port_w(m_ymsnd, space, 0, data); return; |
| 1489 | | case 0x8071: ym2413_data_port_w(m_ymsnd, space, 0, data); return; |
| 1488 | case 0x8070: downcast<ym2413_device *>(m_ymsnd)->register_port_w(space, 0, data); return; |
| 1489 | case 0x8071: downcast<ym2413_device *>(m_ymsnd)->data_port_w(space, 0, data); return; |
| 1490 | 1490 | |
| 1491 | 1491 | case 0x8060: m_keyb = data; return; |
| 1492 | 1492 | |
trunk/src/emu/sound/2413intf.c
| r22805 | r22806 | |
| 9 | 9 | #include "2413intf.h" |
| 10 | 10 | |
| 11 | 11 | |
| 12 | | /* for stream system */ |
| 13 | | struct ym2413_state |
| 12 | static void ym2413_update_request(void *param, int interval) |
| 14 | 13 | { |
| 15 | | sound_stream * stream; |
| 16 | | void * chip; |
| 17 | | }; |
| 14 | ym2413_device *ym2413 = (ym2413_device *) param; |
| 15 | ym2413->_ym2413_update_request(); |
| 16 | } |
| 18 | 17 | |
| 19 | | |
| 20 | | INLINE ym2413_state *get_safe_token(device_t *device) |
| 18 | void ym2413_device::_ym2413_update_request() |
| 21 | 19 | { |
| 22 | | assert(device != NULL); |
| 23 | | assert(device->type() == YM2413); |
| 24 | | return (ym2413_state *)downcast<ym2413_device *>(device)->token(); |
| 20 | m_stream->update(); |
| 25 | 21 | } |
| 26 | 22 | |
| 23 | //------------------------------------------------- |
| 24 | // sound_stream_update - handle a stream update |
| 25 | //------------------------------------------------- |
| 27 | 26 | |
| 28 | | #ifdef UNUSED_FUNCTION |
| 29 | | void YM2413DAC_update(int chip,stream_sample_t **inputs, stream_sample_t **_buffer,int length) |
| 27 | void ym2413_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) |
| 30 | 28 | { |
| 31 | | INT16 *buffer = _buffer[0]; |
| 32 | | static int out = 0; |
| 33 | | |
| 34 | | if ( ym2413[chip].reg[0x0F] & 0x01 ) |
| 35 | | { |
| 36 | | out = ((ym2413[chip].reg[0x10] & 0xF0) << 7); |
| 37 | | } |
| 38 | | while (length--) *(buffer++) = out; |
| 29 | ym2413_update_one(m_chip, outputs, samples); |
| 39 | 30 | } |
| 40 | | #endif |
| 41 | 31 | |
| 42 | | static STREAM_UPDATE( ym2413_stream_update ) |
| 43 | | { |
| 44 | | ym2413_state *info = (ym2413_state *)param; |
| 45 | | ym2413_update_one(info->chip, outputs, samples); |
| 46 | | } |
| 32 | //------------------------------------------------- |
| 33 | // device_start - device-specific startup |
| 34 | //------------------------------------------------- |
| 47 | 35 | |
| 48 | | static void _stream_update(void *param, int interval) |
| 36 | void ym2413_device::device_start() |
| 49 | 37 | { |
| 50 | | ym2413_state *info = (ym2413_state *)param; |
| 51 | | info->stream->update(); |
| 52 | | } |
| 38 | int rate = clock()/72; |
| 53 | 39 | |
| 54 | | static DEVICE_START( ym2413 ) |
| 55 | | { |
| 56 | | ym2413_state *info = get_safe_token(device); |
| 57 | | int rate = device->clock()/72; |
| 58 | | |
| 59 | 40 | /* emulator create */ |
| 60 | | info->chip = ym2413_init(device, device->clock(), rate); |
| 61 | | assert_always(info->chip != NULL, "Error creating YM2413 chip"); |
| 41 | m_chip = ym2413_init(this, clock(), rate); |
| 42 | assert_always(m_chip != NULL, "Error creating YM2413 chip"); |
| 62 | 43 | |
| 63 | 44 | /* stream system initialize */ |
| 64 | | info->stream = device->machine().sound().stream_alloc(*device,0,2,rate,info,ym2413_stream_update); |
| 45 | m_stream = machine().sound().stream_alloc(*this,0,2,rate); |
| 65 | 46 | |
| 66 | | ym2413_set_update_handler(info->chip, _stream_update, info); |
| 67 | | |
| 68 | | |
| 69 | | |
| 70 | | |
| 71 | | #if 0 |
| 72 | | int i, tst; |
| 73 | | char name[40]; |
| 74 | | |
| 75 | | num = intf->num; |
| 76 | | |
| 77 | | tst = YM3812_sh_start (msound); |
| 78 | | if (tst) |
| 79 | | return 1; |
| 80 | | |
| 81 | | for (i=0;i<num;i++) |
| 82 | | { |
| 83 | | ym2413_reset (i); |
| 84 | | |
| 85 | | ym2413[i].DAC_stream = device->machine().sound().stream_alloc(*device, 0, 1, device->clock()/72, i, YM2413DAC_update); |
| 86 | | |
| 87 | | if (ym2413[i].DAC_stream == -1) |
| 88 | | return 1; |
| 89 | | } |
| 90 | | return 0; |
| 91 | | #endif |
| 92 | | |
| 47 | ym2413_set_update_handler(m_chip, ym2413_update_request, this); |
| 93 | 48 | } |
| 94 | 49 | |
| 95 | | static DEVICE_STOP( ym2413 ) |
| 50 | //------------------------------------------------- |
| 51 | // device_stop - device-specific stop |
| 52 | //------------------------------------------------- |
| 53 | |
| 54 | void ym2413_device::device_stop() |
| 96 | 55 | { |
| 97 | | ym2413_state *info = get_safe_token(device); |
| 98 | | ym2413_shutdown(info->chip); |
| 56 | ym2413_shutdown(m_chip); |
| 99 | 57 | } |
| 100 | 58 | |
| 101 | | static DEVICE_RESET( ym2413 ) |
| 59 | //------------------------------------------------- |
| 60 | // device_reset - device-specific reset |
| 61 | //------------------------------------------------- |
| 62 | |
| 63 | void ym2413_device::device_reset() |
| 102 | 64 | { |
| 103 | | ym2413_state *info = get_safe_token(device); |
| 104 | | ym2413_reset_chip(info->chip); |
| 65 | ym2413_reset_chip(m_chip); |
| 105 | 66 | } |
| 106 | 67 | |
| 107 | 68 | |
| 108 | | WRITE8_DEVICE_HANDLER( ym2413_w ) |
| 69 | WRITE8_MEMBER( ym2413_device::write ) |
| 109 | 70 | { |
| 110 | | ym2413_state *info = get_safe_token(device); |
| 111 | | ym2413_write(info->chip, offset & 1, data); |
| 71 | ym2413_write(m_chip, offset & 1, data); |
| 112 | 72 | } |
| 113 | 73 | |
| 114 | | WRITE8_DEVICE_HANDLER( ym2413_register_port_w ) { ym2413_w(device, space, 0, data); } |
| 115 | | WRITE8_DEVICE_HANDLER( ym2413_data_port_w ) { ym2413_w(device, space, 1, data); } |
| 74 | WRITE8_MEMBER( ym2413_device::register_port_w ) { write(space, 0, data); } |
| 75 | WRITE8_MEMBER( ym2413_device::data_port_w ) { write(space, 1, data); } |
| 116 | 76 | |
| 117 | 77 | const device_type YM2413 = &device_creator<ym2413_device>; |
| 118 | 78 | |
| r22805 | r22806 | |
| 120 | 80 | : device_t(mconfig, YM2413, "YM2413", tag, owner, clock), |
| 121 | 81 | device_sound_interface(mconfig, *this) |
| 122 | 82 | { |
| 123 | | m_token = global_alloc_clear(ym2413_state); |
| 124 | 83 | } |
| 125 | 84 | |
| 126 | 85 | //------------------------------------------------- |
| r22805 | r22806 | |
| 132 | 91 | void ym2413_device::device_config_complete() |
| 133 | 92 | { |
| 134 | 93 | } |
| 135 | | |
| 136 | | //------------------------------------------------- |
| 137 | | // device_start - device-specific startup |
| 138 | | //------------------------------------------------- |
| 139 | | |
| 140 | | void ym2413_device::device_start() |
| 141 | | { |
| 142 | | DEVICE_START_NAME( ym2413 )(this); |
| 143 | | } |
| 144 | | |
| 145 | | //------------------------------------------------- |
| 146 | | // device_reset - device-specific reset |
| 147 | | //------------------------------------------------- |
| 148 | | |
| 149 | | void ym2413_device::device_reset() |
| 150 | | { |
| 151 | | DEVICE_RESET_NAME( ym2413 )(this); |
| 152 | | } |
| 153 | | |
| 154 | | //------------------------------------------------- |
| 155 | | // device_stop - device-specific stop |
| 156 | | //------------------------------------------------- |
| 157 | | |
| 158 | | void ym2413_device::device_stop() |
| 159 | | { |
| 160 | | DEVICE_STOP_NAME( ym2413 )(this); |
| 161 | | } |
| 162 | | |
| 163 | | //------------------------------------------------- |
| 164 | | // sound_stream_update - handle a stream update |
| 165 | | //------------------------------------------------- |
| 166 | | |
| 167 | | void ym2413_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) |
| 168 | | { |
| 169 | | // should never get here |
| 170 | | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); |
| 171 | | } |