Previous 199869 Revisions Next

r22806 Monday 13th May, 2013 at 14:08:19 UTC by smf
modernised YM2413 [smf]
[src/emu/sound]2413intf.c 2413intf.h
[src/mame/drivers]alpha68k.c bfm_sc2.c cabaret.c cbasebal.c d9final.c ddenlovr.c dunhuang.c dynax.c fromance.c gluck2.c hyprduel.c igs009.c igs011.c igs017.c igspoker.c iqblock.c jackie.c jpmsys5.c magicard.c maygay1b.c maygayv1.c metro.c mitchell.c mpu4hw.c popobear.c ppmast93.c rampart.c realbrk.c relief.c sangho.c segas16b.c spoker.c subsino.c
[src/mess/includes]sms.h
[src/mess/machine]msx.c msx_slot.c nes_konami.c nes_konami.h sms.c

trunk/src/mame/drivers/alpha68k.c
r22805r22806
791791   ADDRESS_MAP_GLOBAL_MASK(0xff)
792792   AM_RANGE(0x00, 0x00) AM_READWRITE(soundlatch_byte_r, soundlatch_clear_byte_w)
793793   AM_RANGE(0x08, 0x08) AM_DEVWRITE("dac", dac_device, write_signed8)
794   AM_RANGE(0x0a, 0x0b) AM_DEVWRITE_LEGACY("ym2", ym2413_w)
794   AM_RANGE(0x0a, 0x0b) AM_DEVWRITE("ym2", ym2413_device, write)
795795   AM_RANGE(0x0c, 0x0d) AM_DEVWRITE("ym1", ym2203_device, write)
796796   AM_RANGE(0x0e, 0x0e) AM_WRITE(sound_bank_w)
797797ADDRESS_MAP_END
trunk/src/mame/drivers/realbrk.c
r22805r22806
169169/*realbrk specific memory map*/
170170static ADDRESS_MAP_START( realbrk_mem, AS_PROGRAM, 16, realbrk_state )
171171   AM_IMPORT_FROM(base_mem)
172   AM_RANGE(0x800008, 0x80000b) AM_DEVWRITE8_LEGACY("ymsnd", ym2413_w, 0x00ff) //
172   AM_RANGE(0x800008, 0x80000b) AM_DEVWRITE8("ymsnd", ym2413_device, write, 0x00ff) //
173173   AM_RANGE(0xc00000, 0xc00001) AM_READ_PORT("IN0")                            // P1 & P2 (Inputs)
174174   AM_RANGE(0xc00002, 0xc00003) AM_READ_PORT("IN1")                            // Coins
175175   AM_RANGE(0xc00004, 0xc00005) AM_RAM_READ(realbrk_dsw_r) AM_SHARE("dsw_select")  // DSW select
r22805r22806
179179
180180/*pkgnsh specific memory map*/
181181static ADDRESS_MAP_START( pkgnsh_mem, AS_PROGRAM, 16, realbrk_state )
182   AM_RANGE(0x800008, 0x80000b) AM_DEVWRITE8_LEGACY("ymsnd", ym2413_w, 0xff00  )   // YM2413
182   AM_RANGE(0x800008, 0x80000b) AM_DEVWRITE8("ymsnd", ym2413_device, write, 0xff00)   // YM2413
183183   AM_RANGE(0xc00000, 0xc00013) AM_READ(pkgnsh_input_r             )   // P1 & P2 (Inputs)
184184   AM_RANGE(0xff0000, 0xfffbff) AM_READWRITE(backup_ram_r,backup_ram_w) AM_SHARE("backup_ram") // RAM
185185   AM_IMPORT_FROM(base_mem)
r22805r22806
187187
188188/*pkgnshdx specific memory map*/
189189static ADDRESS_MAP_START( pkgnshdx_mem, AS_PROGRAM, 16, realbrk_state )
190   AM_RANGE(0x800008, 0x80000b) AM_DEVWRITE8_LEGACY("ymsnd", ym2413_w, 0x00ff) //
190   AM_RANGE(0x800008, 0x80000b) AM_DEVWRITE8("ymsnd", ym2413_device, write, 0x00ff) //
191191   AM_RANGE(0xc00000, 0xc00013) AM_READ(pkgnshdx_input_r               )   // P1 & P2 (Inputs)
192192   AM_RANGE(0xc00004, 0xc00005) AM_WRITEONLY AM_SHARE("dsw_select") // DSW select
193193   AM_RANGE(0xff0000, 0xfffbff) AM_READWRITE(backup_ram_dx_r,backup_ram_w) AM_SHARE("backup_ram")  // RAM
r22805r22806
198198static ADDRESS_MAP_START( dai2kaku_mem, AS_PROGRAM, 16, realbrk_state )
199199   AM_RANGE(0x605000, 0x6053ff) AM_RAM AM_SHARE("vram_0ras")   // rasterinfo   (0)
200200   AM_RANGE(0x605400, 0x6057ff) AM_RAM AM_SHARE("vram_1ras")   // rasterinfo   (1)
201   AM_RANGE(0x800008, 0x80000b) AM_DEVWRITE8_LEGACY("ymsnd", ym2413_w, 0x00ff) //
201   AM_RANGE(0x800008, 0x80000b) AM_DEVWRITE8("ymsnd", ym2413_device, write, 0x00ff) //
202202   AM_RANGE(0xc00000, 0xc00001) AM_READ_PORT("IN0")                            // P1 & P2 (Inputs)
203203   AM_RANGE(0xc00002, 0xc00003) AM_READ_PORT("IN1")                            // Coins
204204   AM_RANGE(0xc00004, 0xc00005) AM_RAM_READ(realbrk_dsw_r) AM_SHARE("dsw_select")  // DSW select
trunk/src/mame/drivers/dunhuang.c
r22805r22806
508508
509509   AM_RANGE( 0x001b, 0x001b ) AM_WRITE(dunhuang_block_dest_w )
510510
511   AM_RANGE( 0x0081, 0x0081 ) AM_DEVWRITE_LEGACY("ymsnd", ym2413_register_port_w   )
512   AM_RANGE( 0x0089, 0x0089 ) AM_DEVWRITE_LEGACY("ymsnd", ym2413_data_port_w       )
511   AM_RANGE( 0x0081, 0x0081 ) AM_DEVWRITE("ymsnd", ym2413_device, register_port_w)
512   AM_RANGE( 0x0089, 0x0089 ) AM_DEVWRITE("ymsnd", ym2413_device, data_port_w)
513513
514514//  AM_RANGE( 0x0082, 0x0082 ) AM_WRITE(dunhuang_82_w )
515515
trunk/src/mame/drivers/gluck2.c
r22805r22806
341341   AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(gluck2_videoram_w) AM_SHARE("videoram") /* 6116 #1 (2K x 8) RAM (only 1st half used) */
342342   AM_RANGE(0x1800, 0x1bff) AM_RAM_WRITE(gluck2_colorram_w) AM_SHARE("colorram") /* 6116 #2 (2K x 8) RAM (only 1st half used) */
343343   AM_RANGE(0x2000, 0x2000) AM_READ_PORT("SW1")
344   AM_RANGE(0x2d00, 0x2d01) AM_DEVWRITE_LEGACY("ymsnd", ym2413_w )
344   AM_RANGE(0x2d00, 0x2d01) AM_DEVWRITE("ymsnd", ym2413_device, write)
345345   AM_RANGE(0x3400, 0x3400) AM_READ_PORT("IN0")
346346   AM_RANGE(0x3500, 0x3500) AM_READ_PORT("IN1")
347347   AM_RANGE(0x3600, 0x3600) AM_READ_PORT("IN2")
trunk/src/mame/drivers/cabaret.c
r22805r22806
181181   AM_RANGE( 0x00a2, 0x00a2 ) AM_READ_PORT("DSW2")         /* DSW2 */
182182   AM_RANGE( 0x00b0, 0x00b0 ) AM_READ_PORT("DSW3")         /* DSW3 */
183183
184   AM_RANGE( 0x00e0, 0x00e1 ) AM_DEVWRITE_LEGACY("ymsnd", ym2413_w )
184   AM_RANGE( 0x00e0, 0x00e1 ) AM_DEVWRITE("ymsnd", ym2413_device, write)
185185
186186   AM_RANGE( 0x2000, 0x27ff ) AM_RAM_WRITE(fg_tile_w )  AM_SHARE("fg_tile_ram")
187187   AM_RANGE( 0x2800, 0x2fff ) AM_RAM_WRITE(fg_color_w ) AM_SHARE("fg_color_ram")
trunk/src/mame/drivers/d9final.c
r22805r22806
129129   AM_RANGE(0x00, 0x00) AM_READ_PORT("DSWA")
130130   AM_RANGE(0x20, 0x20) AM_READ_PORT("DSWB")
131131   AM_RANGE(0x40, 0x40) AM_READ_PORT("DSWC")
132   AM_RANGE(0x40, 0x41) AM_DEVWRITE_LEGACY("ymsnd",ym2413_w)
132   AM_RANGE(0x40, 0x41) AM_DEVWRITE("ymsnd", ym2413_device, write)
133133   AM_RANGE(0x60, 0x60) AM_READ_PORT("DSWD")
134134   AM_RANGE(0x80, 0x80) AM_READ_PORT("IN0")
135135   AM_RANGE(0xa0, 0xa0) AM_READ_PORT("IN1") AM_WRITE(d9final_bank_w)
trunk/src/mame/drivers/mpu4hw.c
r22805r22806
22822282
22832283WRITE8_MEMBER(mpu4_state::mpu4_ym2413_w)
22842284{
2285   device_t *ym = machine().device("ym2413");
2286   if (ym) ym2413_w(ym,space,offset,data);
2285   ym2413_device *ym2413 = machine().device<ym2413_device>("ym2413");
2286   if (ym2413) ym2413->write(space,offset,data);
22872287}
22882288
22892289READ8_MEMBER(mpu4_state::mpu4_ym2413_r)
22902290{
2291//  device_t *ym = machine().device("ym2413");
2292//  return ym2413_read(ym,offset);
2291//  ym2413_device *ym2413 = machine().device<ym2413_device>("ym2413");
2292//  if (ym2413) return ym2413->read(space,offset);
22932293   return 0xff;
22942294}
22952295
trunk/src/mame/drivers/segas16b.c
r22805r22806
11701170
11711171WRITE16_MEMBER( segas16b_state::atomicp_sound_w )
11721172{
1173   ym2413_w(m_ym2413, space, offset, data >> 8);
1173   m_ym2413->write(space, offset, data >> 8);
11741174}
11751175
11761176
trunk/src/mame/drivers/mitchell.c
r22805r22806
296296   AM_RANGE(0x00, 0x02) AM_READ(input_r)           /* The Mahjong games and Block Block need special input treatment */
297297   AM_RANGE(0x01, 0x01) AM_WRITE(input_w)
298298   AM_RANGE(0x02, 0x02) AM_WRITE(pang_bankswitch_w)    /* Code bank register */
299   AM_RANGE(0x03, 0x03) AM_DEVWRITE_LEGACY("ymsnd", ym2413_data_port_w)
300   AM_RANGE(0x04, 0x04) AM_DEVWRITE_LEGACY("ymsnd", ym2413_register_port_w)
299   AM_RANGE(0x03, 0x03) AM_DEVWRITE("ymsnd", ym2413_device, data_port_w)
300   AM_RANGE(0x04, 0x04) AM_DEVWRITE("ymsnd", ym2413_device, register_port_w)
301301   AM_RANGE(0x05, 0x05) AM_READ(pang_port5_r) AM_DEVWRITE("oki", okim6295_device, write)
302302   AM_RANGE(0x06, 0x06) AM_WRITENOP                /* watchdog? irq ack? */
303303   AM_RANGE(0x07, 0x07) AM_WRITE(pang_video_bank_w)    /* Video RAM bank register */
r22805r22806
321321   AM_RANGE(0x00, 0x02) AM_READ(input_r)
322322   AM_RANGE(0x00, 0x00) AM_WRITE(pangbl_gfxctrl_w)    /* Palette bank, layer enable, coin counters, more */
323323   AM_RANGE(0x02, 0x02) AM_WRITE(pang_bankswitch_w)      /* Code bank register */
324   AM_RANGE(0x03, 0x03) AM_DEVWRITE_LEGACY("ymsnd", ym2413_data_port_w)
325   AM_RANGE(0x04, 0x04) AM_DEVWRITE_LEGACY("ymsnd", ym2413_register_port_w)
324   AM_RANGE(0x03, 0x03) AM_DEVWRITE("ymsnd", ym2413_device, data_port_w)
325   AM_RANGE(0x04, 0x04) AM_DEVWRITE("ymsnd", ym2413_device, register_port_w)
326326   AM_RANGE(0x05, 0x05) AM_READ_PORT("SYS0")
327327   AM_RANGE(0x06, 0x06) AM_WRITENOP    /* watchdog? irq ack? */
328328   AM_RANGE(0x07, 0x07) AM_WRITE(pang_video_bank_w)      /* Video RAM bank register */
trunk/src/mame/drivers/bfm_sc2.c
r22805r22806
14631463   AM_RANGE(0x2A00, 0x2AFF) AM_WRITE(nec_latch_w)
14641464   AM_RANGE(0x2B00, 0x2BFF) AM_WRITE(nec_reset_w)
14651465   AM_RANGE(0x2C00, 0x2C00) AM_WRITE(unlock_w)                     /* custom chip unlock */
1466   AM_RANGE(0x2D00, 0x2D01) AM_DEVWRITE_LEGACY("ymsnd", ym2413_w)
1466   AM_RANGE(0x2D00, 0x2D01) AM_DEVWRITE("ymsnd", ym2413_device, write)
14671467   AM_RANGE(0x2E00, 0x2E00) AM_WRITE(bankswitch_w)                 /* write bank (rom page select for 0x6000 - 0x7fff ) */
14681468   //AM_RANGE(0x2F00, 0x2F00) AM_WRITE(vfd2_data_w)                /* vfd2 data (not usually connected!)*/
14691469
trunk/src/mame/drivers/magicard.c
r22805r22806
673673   AM_RANGE(0x001ffc40, 0x001ffc41) AM_MIRROR(0x7fe00000) AM_READ(test_r)
674674   AM_RANGE(0x001ffd00, 0x001ffd05) AM_MIRROR(0x7fe00000) AM_WRITE(paletteram_io_w) //RAMDAC
675675   /*not the right sound chip,unknown type,it should be an ADPCM with 8 channels.*/
676   AM_RANGE(0x001ffd40, 0x001ffd43) AM_MIRROR(0x7fe00000) AM_DEVWRITE8_LEGACY("ymsnd", ym2413_w, 0x00ff)
676   AM_RANGE(0x001ffd40, 0x001ffd43) AM_MIRROR(0x7fe00000) AM_DEVWRITE8("ymsnd", ym2413_device, write, 0x00ff)
677677   AM_RANGE(0x001ffd80, 0x001ffd81) AM_MIRROR(0x7fe00000) AM_READ(test_r)
678678   AM_RANGE(0x001ffd80, 0x001ffd81) AM_MIRROR(0x7fe00000) AM_WRITENOP //?
679679   AM_RANGE(0x001fff80, 0x001fffbf) AM_MIRROR(0x7fe00000) AM_RAM //DRAM I/O, not accessed by this game, CD buffer?
trunk/src/mame/drivers/sangho.c
r22805r22806
248248
249249static ADDRESS_MAP_START( pzlestar_io_map, AS_IO, 8, sangho_state )
250250   ADDRESS_MAP_GLOBAL_MASK(0xff)
251   AM_RANGE( 0x7c, 0x7d) AM_DEVWRITE_LEGACY("ymsnd", ym2413_w )
251   AM_RANGE( 0x7c, 0x7d) AM_DEVWRITE("ymsnd", ym2413_device, write)
252252   AM_RANGE( 0x91, 0x91) AM_WRITE(pzlestar_bank_w )
253253   AM_RANGE( 0x98, 0x9b) AM_DEVREADWRITE("v9958", v9958_device, read, write )
254254   AM_RANGE( 0xa0, 0xa0) AM_READ_PORT("P1")
r22805r22806
261261
262262static ADDRESS_MAP_START( sexyboom_io_map, AS_IO, 8, sangho_state )
263263   ADDRESS_MAP_GLOBAL_MASK(0xff)
264   AM_RANGE( 0x7c, 0x7d) AM_DEVWRITE_LEGACY("ymsnd", ym2413_w )
264   AM_RANGE( 0x7c, 0x7d) AM_DEVWRITE("ymsnd", ym2413_device, write)
265265   AM_RANGE( 0xa0, 0xa0) AM_READ_PORT("P1")
266266   AM_RANGE( 0xa1, 0xa1) AM_READ_PORT("P2")
267267   AM_RANGE( 0xf0, 0xf3) AM_DEVREADWRITE("v9958", v9958_device, read, write )
trunk/src/mame/drivers/igs009.c
r22805r22806
494494   AM_RANGE( 0x6492, 0x6492 ) AM_WRITE(jingbell_leds_w )
495495   AM_RANGE( 0x64a0, 0x64a0 ) AM_READ_PORT( "BUTTONS2" )
496496
497   AM_RANGE( 0x64b0, 0x64b1 ) AM_DEVWRITE_LEGACY("ymsnd", ym2413_w )
497   AM_RANGE( 0x64b0, 0x64b1 ) AM_DEVWRITE("ymsnd", ym2413_device, write)
498498
499499   AM_RANGE( 0x64c0, 0x64c0 ) AM_DEVREADWRITE("oki", okim6295_device, read, write)
500500
trunk/src/mame/drivers/metro.c
r22805r22806
365365   {
366366      if (!BIT(data, 2))
367367      {
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);
369369      }
370370      m_portb = data;
371371      return;
r22805r22806
12521252   AM_RANGE(0x279700, 0x279713) AM_WRITEONLY AM_SHARE("videoregs")                 // Video Registers
12531253   AM_RANGE(0x400000, 0x400001) AM_WRITENOP                                        // ? 5
12541254   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)
12561256   AM_RANGE(0x700000, 0x700001) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff)  // Sound
12571257   AM_RANGE(0xc00000, 0xc00001) AM_READWRITE(gakusai_eeprom_r, gakusai_eeprom_w)   // EEPROM
12581258   AM_RANGE(0xd00000, 0xd00001) AM_WRITE(gakusai_oki_bank_hi_w)
r22805r22806
12931293   AM_RANGE(0x900000, 0x900001) AM_WRITE(gakusai_oki_bank_lo_w)                    // Sound bank
12941294   AM_RANGE(0xa00000, 0xa00001) AM_WRITE(gakusai_oki_bank_hi_w)                    //
12951295   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)
12971297   AM_RANGE(0xe00000, 0xe00001) AM_READWRITE(gakusai_eeprom_r,gakusai_eeprom_w)    // EEPROM
12981298   AM_RANGE(0xf00000, 0xf0ffff) AM_RAM AM_MIRROR(0x0f0000)                         // RAM (mirrored)
12991299ADDRESS_MAP_END
r22805r22806
13601360   AM_RANGE(0x279700, 0x279713) AM_WRITEONLY AM_SHARE("videoregs")                 // Video Registers
13611361   AM_RANGE(0x400000, 0x400001) AM_WRITENOP                                        // ? 5
13621362   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)
13641364   AM_RANGE(0x700000, 0x700001) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff)  // Sound
13651365   AM_RANGE(0xc00000, 0xc00001) AM_WRITE(dokyusp_eeprom_reset_w)                       // EEPROM
13661366   AM_RANGE(0xd00000, 0xd00001) AM_READWRITE(dokyusp_eeprom_r, dokyusp_eeprom_bit_w)   // EEPROM
r22805r22806
14031403   AM_RANGE(0x800000, 0x800001) AM_WRITE(gakusai_oki_bank_hi_w)                    // Samples Bank?
14041404   AM_RANGE(0x900000, 0x900001) AM_WRITENOP                                        // ? 4
14051405   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)     //
14071407   AM_RANGE(0xd00000, 0xd00001) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff)  // Sound
14081408   AM_RANGE(0xf00000, 0xf0ffff) AM_RAM AM_MIRROR(0x0f0000)                         // RAM (mirrored)
14091409ADDRESS_MAP_END
r22805r22806
16911691   AM_RANGE(0x478888, 0x478889) AM_WRITENOP                                        // ??
16921692   AM_RANGE(0x479700, 0x479713) AM_WRITEONLY AM_SHARE("videoregs")                 // Video Registers
16931693   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)
16951695   AM_RANGE(0xd00000, 0xd00001) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0xffff)
16961696   AM_RANGE(0xf00000, 0xf0ffff) AM_RAM AM_MIRROR(0x0f0000)                         // RAM (mirrored)
16971697#if 0
r22805r22806
17491749   AM_RANGE(0x470000, 0x47dfff) AM_RAM
17501750
17511751   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)
17531753
17541754   AM_RANGE(0x700000, 0x71ffff) AM_RAM_WRITE(metro_vram_0_w) AM_SHARE("vram_0")    // Layer 0
17551755   AM_RANGE(0x720000, 0x73ffff) AM_RAM_WRITE(metro_vram_1_w) AM_SHARE("vram_1")    // Layer 1
trunk/src/mame/drivers/ddenlovr.c
r22805r22806
19161916   AM_RANGE(0x300286, 0x300287) AM_READ(ddenlovr_gfxrom_r)                             // Video Chip
19171917
19181918   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)
19201920   AM_RANGE(0x300340, 0x30035f) AM_DEVREADWRITE8("rtc", msm6242_device, read, write,0x00ff)
19211921   AM_RANGE(0x300380, 0x300383) AM_DEVWRITE8("aysnd", ay8910_device, address_data_w, 0x00ff)
19221922   AM_RANGE(0x300384, 0x300385) AM_DEVREAD8("aysnd", ay8910_device, data_r, 0x00ff)
r22805r22806
19681968   AM_RANGE(0x300070, 0x300071) AM_READ(unk16_r)                                       // ? must be 78 on startup (not necessary in ddlover)
19691969   AM_RANGE(0x300080, 0x300083) AM_WRITE(ddenlovr_blitter_w)
19701970   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)
19721972   AM_RANGE(0x300100, 0x30011f) AM_DEVREADWRITE8("rtc", msm6242_device, read, write,0x00ff)
19731973   AM_RANGE(0x300140, 0x300143) AM_DEVWRITE8("aysnd", ay8910_device, address_data_w, 0x00ff)
19741974   AM_RANGE(0x300180, 0x300181) AM_READ_PORT("P1")
r22805r22806
20352035   AM_RANGE(0xe00308, 0xe00309) AM_WRITE(ddenlovr_coincounter_0_w)                         // Coin Counters
20362036   AM_RANGE(0xe0030c, 0xe0030d) AM_WRITE(ddenlovr_coincounter_1_w)                         //
20372037
2038   AM_RANGE(0xe00400, 0xe00403) AM_DEVWRITE8_LEGACY("ymsnd", ym2413_w, 0x00ff)
2038   AM_RANGE(0xe00400, 0xe00403) AM_DEVWRITE8("ymsnd", ym2413_device, write, 0x00ff)
20392039   AM_RANGE(0xe00500, 0xe0051f) AM_DEVREADWRITE8("rtc", msm6242_device, read, write,0x00ff)
20402040   AM_RANGE(0xe00600, 0xe00603) AM_DEVWRITE8("aysnd", ay8910_device, address_data_w, 0x00ff)
20412041   AM_RANGE(0xe00604, 0xe00605) AM_DEVREAD8("aysnd", ay8910_device, data_r, 0x00ff)
r22805r22806
20732073   AM_RANGE(0xe00308, 0xe00309) AM_WRITE(ddenlovr_coincounter_0_w)                         // Coin Counters
20742074   AM_RANGE(0xe0030c, 0xe0030d) AM_WRITE(ddenlovr_coincounter_1_w)                         //
20752075
2076   AM_RANGE(0xe00400, 0xe00403) AM_DEVWRITE8_LEGACY("ymsnd", ym2413_w, 0x00ff)
2076   AM_RANGE(0xe00400, 0xe00403) AM_DEVWRITE8("ymsnd", ym2413_device, write, 0x00ff)
20772077   AM_RANGE(0xe00500, 0xe0051f) AM_DEVREADWRITE8("rtc", msm6242_device, read, write,0x00ff)
20782078   AM_RANGE(0xe00600, 0xe00603) AM_DEVWRITE8("aysnd", ay8910_device, address_data_w, 0x00ff)
20792079   AM_RANGE(0xe00604, 0xe00605) AM_DEVREAD8("aysnd", ay8910_device, data_r, 0x00ff)
r22805r22806
21472147   AM_RANGE(0x300070, 0x300071) AM_READ(unk16_r)                                           // ? must be 78 on startup (not necessary in ddlover)
21482148   AM_RANGE(0x300080, 0x300083) AM_WRITE(ddenlovr_blitter_w)
21492149   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)
21512151   AM_RANGE(0x300100, 0x30011f) AM_DEVREADWRITE8("rtc", msm6242_device, read, write,0x00ff)
21522152   AM_RANGE(0x300140, 0x300143) AM_DEVWRITE8("aysnd", ay8910_device, address_data_w, 0x00ff)
21532153   AM_RANGE(0x300180, 0x300181) AM_READ_PORT("P1")
r22805r22806
22102210   AM_RANGE(0xe00308, 0xe00309) AM_WRITE(ddenlovr_coincounter_0_w)                         // Coin Counters
22112211   AM_RANGE(0xe0030c, 0xe0030d) AM_WRITE(ddenlovr_coincounter_1_w)                         //
22122212
2213   AM_RANGE(0xe00400, 0xe00403) AM_DEVWRITE8_LEGACY("ymsnd", ym2413_w, 0x00ff)
2213   AM_RANGE(0xe00400, 0xe00403) AM_DEVWRITE8("ymsnd", ym2413_device, write, 0x00ff)
22142214   AM_RANGE(0xe00500, 0xe0051f) AM_DEVREADWRITE8("rtc", msm6242_device, read, write,0x00ff)
22152215   AM_RANGE(0xe00600, 0xe00603) AM_DEVWRITE8("aysnd", ay8910_device, address_data_w, 0x00ff)
22162216   AM_RANGE(0xe00604, 0xe00605) AM_DEVREAD8("aysnd", ay8910_device, data_r, 0x00ff)
r22805r22806
22662266   AM_RANGE(0x22, 0x23) AM_READ(rongrong_input2_r)
22672267
22682268   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)
22702270
22712271   AM_RANGE(0x80, 0x83) AM_WRITE(ddenlovr_palette_base_w)
22722272   AM_RANGE(0x84, 0x87) AM_WRITE(ddenlovr_palette_mask_w)
r22805r22806
23032303
23042304   AM_RANGE(0x20, 0x2f) AM_DEVREADWRITE("rtc", msm6242_device, read, write)
23052305   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)
23072307
23082308   AM_RANGE(0x80, 0x83) AM_WRITE(ddenlovr_palette_base_w)
23092309   AM_RANGE(0x84, 0x87) AM_WRITE(ddenlovr_palette_mask_w)
r22805r22806
24572457   AM_RANGE(0x02, 0x02) AM_READNOP     // read just before port 00
24582458   AM_RANGE(0x04, 0x04) AM_NOP                 // read only once at the start
24592459   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)
24612461   AM_RANGE(0x0c, 0x0c) AM_DEVWRITE("aysnd", ay8910_device, data_w)
24622462   AM_RANGE(0x0e, 0x0e) AM_DEVWRITE("aysnd", ay8910_device, address_w)
24632463ADDRESS_MAP_END
r22805r22806
27402740   AM_RANGE(0x93, 0x93) AM_WRITE(hanakanz_coincounter_w)
27412741   AM_RANGE(0x94, 0x94) AM_WRITE(hanakanz_keyb_w)
27422742   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)
27442744   AM_RANGE(0xc0, 0xc0) AM_DEVREADWRITE("oki", okim6295_device, read, write)
27452745   AM_RANGE(0xe0, 0xef) AM_DEVREADWRITE("rtc", msm6242_device, read, write)
27462746ADDRESS_MAP_END
r22805r22806
27562756   AM_RANGE(0x80, 0x80) AM_WRITE(hanakanz_blitter_data_w)
27572757   AM_RANGE(0x81, 0x81) AM_WRITE(hanakanz_palette_w)
27582758   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)
27602760   AM_RANGE(0xb0, 0xb0) AM_READ_PORT("SYSTEM")
27612761   AM_RANGE(0xb1, 0xb2) AM_READ(hanakanz_keyb_r)
27622762   AM_RANGE(0xb3, 0xb3) AM_WRITE(hanakanz_coincounter_w)
r22805r22806
27782778   AM_RANGE(0x80, 0x80) AM_WRITE(hanakanz_blitter_data_w)
27792779   AM_RANGE(0x81, 0x81) AM_WRITE(hanakanz_palette_w)
27802780   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)
27822782   AM_RANGE(0xb0, 0xb0) AM_READ_PORT("SYSTEM")
27832783//  AM_RANGE(0xb1, 0xb2) AM_READ(hanakanz_keyb_r)
27842784   AM_RANGE(0xb1, 0xb1) AM_READ_PORT("KEYB0")
r22805r22806
28022802   AM_RANGE(0x80, 0x80) AM_WRITE(hanakanz_blitter_data_w)
28032803   AM_RANGE(0x81, 0x81) AM_WRITE(hanakanz_palette_w)
28042804   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)
28062806   AM_RANGE(0x90, 0x90) AM_READ_PORT("SYSTEM")
28072807//  AM_RANGE(0x91, 0x91) AM_READ(hanakanz_keyb_r)
28082808   AM_RANGE(0x91, 0x91) AM_READ_PORT("KEYB0")
r22805r22806
28412841   AM_RANGE(0x94, 0x94) AM_READ_PORT("SYSTEM")
28422842   AM_RANGE(0x95, 0x96) AM_READ(hanakanz_keyb_r)
28432843   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)
28452845   AM_RANGE(0xc0, 0xc0) AM_DEVREADWRITE("oki", okim6295_device, read, write)
28462846   AM_RANGE(0xe0, 0xef) AM_DEVREADWRITE("rtc", msm6242_device, read, write)
28472847ADDRESS_MAP_END
r22805r22806
29692969   AM_RANGE(0x63, 0x63) AM_MIRROR(0xff00) AM_READ_PORT("DSW4")
29702970   AM_RANGE(0x64, 0x64) AM_MIRROR(0xff00) AM_READ_PORT("DSW5")     // DSW 1-4 high bits
29712971   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)
29732973   AM_RANGE(0xc0, 0xcf) AM_MIRROR(0xff00) AM_DEVREADWRITE("rtc", msm6242_device, read, write)
29742974   AM_RANGE(0xe0, 0xe1) AM_MIRROR(0xff00) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
29752975ADDRESS_MAP_END
r22805r22806
30783078   AM_RANGE(0x22, 0x22) AM_READ(mjmyster_coins_r)
30793079   AM_RANGE(0x23, 0x23) AM_READ(mjmyster_keyb_r)
30803080   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)
30823082   AM_RANGE(0x44, 0x44) AM_DEVREAD("aysnd", ay8910_device, data_r)
30833083   AM_RANGE(0x46, 0x46) AM_DEVWRITE("aysnd", ay8910_device, data_w)
30843084   AM_RANGE(0x48, 0x48) AM_DEVWRITE("aysnd", ay8910_device, address_w)
r22805r22806
32433243   AM_RANGE(0x03, 0x03) AM_READ(rongrong_gfxrom_r)
32443244   AM_RANGE(0x1c, 0x1c) AM_READNOP AM_WRITE(mjmyster_rambank_w)
32453245   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)
32473247   AM_RANGE(0x24, 0x24) AM_DEVREAD("aysnd", ay8910_device, data_r)
32483248   AM_RANGE(0x26, 0x26) AM_DEVWRITE("aysnd", ay8910_device, data_w)
32493249   AM_RANGE(0x28, 0x28) AM_DEVWRITE("aysnd", ay8910_device, address_w)
r22805r22806
33663366   AM_RANGE(0x61, 0x61) AM_WRITE(hgokou_input_w)
33673367   AM_RANGE(0x62, 0x62) AM_READ(hgokou_input_r)
33683368   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)
33703370   AM_RANGE(0x84, 0x84) AM_DEVREAD("aysnd", ay8910_device, data_r)
33713371   AM_RANGE(0x86, 0x86) AM_DEVWRITE("aysnd", ay8910_device, data_w)
33723372   AM_RANGE(0x88, 0x88) AM_DEVWRITE("aysnd", ay8910_device, address_w)
r22805r22806
34093409   AM_RANGE(0x1c, 0x1c) AM_READNOP AM_WRITE(mjmyster_rambank_w)        // ? ack on RTC int
34103410   AM_RANGE(0x1e, 0x1e) AM_WRITE(hginga_rombank_w)
34113411   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)
34133413   AM_RANGE(0x24, 0x24) AM_DEVREAD("aysnd", ay8910_device, data_r)
34143414   AM_RANGE(0x26, 0x26) AM_DEVWRITE("aysnd", ay8910_device, data_w)
34153415   AM_RANGE(0x28, 0x28) AM_DEVWRITE("aysnd", ay8910_device, address_w)
r22805r22806
35003500   AM_RANGE(0x1c, 0x1c) AM_READ(hparadis_dsw_r)
35013501   AM_RANGE(0x1e, 0x1e) AM_WRITE(hparadis_select_w)
35023502   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)
35043504   AM_RANGE(0x80, 0x83) AM_WRITE(ddenlovr_palette_base_w)
35053505   AM_RANGE(0x84, 0x87) AM_WRITE(ddenlovr_palette_mask_w)
35063506   AM_RANGE(0x88, 0x8b) AM_WRITE(ddenlovr_transparency_pen_w)
r22805r22806
35463546   AM_RANGE(0x22, 0x22) AM_READ(mjmywrld_coins_r)
35473547   AM_RANGE(0x23, 0x23) AM_READ(mjmyster_keyb_r)
35483548   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)
35503550   AM_RANGE(0x44, 0x44) AM_DEVREAD("aysnd", ay8910_device, data_r)
35513551   AM_RANGE(0x46, 0x46) AM_DEVWRITE("aysnd", ay8910_device, data_w)
35523552   AM_RANGE(0x48, 0x48) AM_DEVWRITE("aysnd", ay8910_device, address_w)
r22805r22806
36463646   AM_RANGE(0xe00308, 0xe00309) AM_WRITE(ddenlovr_coincounter_0_w)                         // Coin Counters
36473647   AM_RANGE(0xe0030c, 0xe0030d) AM_WRITE(ddenlovr_coincounter_1_w)                         //
36483648
3649   AM_RANGE(0xe00400, 0xe00403) AM_DEVWRITE8_LEGACY("ymsnd", ym2413_w, 0x00ff)
3649   AM_RANGE(0xe00400, 0xe00403) AM_DEVWRITE8("ymsnd", ym2413_device, write, 0x00ff)
36503650   AM_RANGE(0xe00500, 0xe0051f) AM_DEVREADWRITE8("rtc", msm6242_device, read, write, 0x00ff)
36513651   AM_RANGE(0xe00600, 0xe00603) AM_DEVWRITE8("aysnd", ay8910_device, address_data_w, 0x00ff)
36523652   AM_RANGE(0xe00604, 0xe00605) AM_DEVREAD8("aysnd", ay8910_device, data_r, 0x00ff)
r22805r22806
37373737   AM_RANGE(0x0100, 0x0100) AM_READ_PORT("DSW1")
37383738   AM_RANGE(0x0181, 0x0181) AM_WRITENOP                        // ? int. enable
37393739   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)
37413741   AM_RANGE(0x0280, 0x028f) AM_DEVREADWRITE("rtc", msm6242_device, read, write)
37423742   AM_RANGE(0x0300, 0x0301) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
37433743   AM_RANGE(0x0380, 0x0380) AM_DEVREADWRITE("oki", okim6295_device, read, write)
r22805r22806
37783778   AM_RANGE(0x60, 0x60) AM_WRITE(hanakanz_blitter_data_w)
37793779   AM_RANGE(0x61, 0x61) AM_WRITE(hanakanz_palette_w)
37803780   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)
37823782   AM_RANGE(0xa0, 0xa0) AM_DEVREADWRITE("oki", okim6295_device, read, write)
37833783   AM_RANGE(0xc0, 0xcf) AM_DEVREADWRITE("rtc", msm6242_device, read, write)
37843784ADDRESS_MAP_END
r22805r22806
38413841static ADDRESS_MAP_START( sryudens_portmap, AS_IO, 8, ddenlovr_state )
38423842   ADDRESS_MAP_GLOBAL_MASK(0xff)
38433843   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)
38453845   AM_RANGE(0x04, 0x05) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
38463846   AM_RANGE(0x1c, 0x1c) AM_READNOP AM_WRITE(sryudens_rambank_w)    // ? ack on RTC int
38473847   AM_RANGE(0x1e, 0x1e) AM_WRITE(mjflove_rombank_w)
r22805r22806
39283928   AM_RANGE(0x70, 0x70) AM_WRITE(quizchq_oki_bank_w)
39293929   AM_RANGE(0x80, 0x80) AM_RAM
39303930   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)
39323932   AM_RANGE(0x94, 0x95) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
39333933ADDRESS_MAP_END
39343934
r22805r22806
40004000   AM_RANGE(0x38, 0x38) AM_READNOP         // ? ack or watchdog
40014001   AM_RANGE(0x40, 0x41) AM_WRITE(mjflove_blitter_w)
40024002   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)
40044004   AM_RANGE(0x54, 0x54) AM_DEVREADWRITE("oki", okim6295_device, read, write)
40054005   AM_RANGE(0x58, 0x58) AM_DEVWRITE("aysnd", ay8910_device, address_w)
40064006   AM_RANGE(0x5c, 0x5c) AM_DEVREADWRITE("aysnd", ay8910_device, data_r, data_w)   // dsw
r22805r22806
41544154   AM_RANGE( 0x40, 0x40 ) AM_DEVWRITE("aysnd", ay8910_device, address_w)    // AY8910
41554155   AM_RANGE( 0x42, 0x42 ) AM_DEVREAD("aysnd", ay8910_device, data_r)     //
41564156   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)        //
41584158   AM_RANGE( 0x80, 0x8f ) AM_DEVREADWRITE("rtc", msm6242_device, read, write)
41594159   AM_RANGE( 0xa0, 0xa3 ) AM_WRITE(ddenlovr_palette_base_w)    // ddenlovr mixer chip
41604160   AM_RANGE( 0xa4, 0xa7 ) AM_WRITE(ddenlovr_palette_mask_w)
r22805r22806
43534353   AM_RANGE(0x42, 0x44) AM_READ(hanakanz_gfxrom_r)
43544354   AM_RANGE(0x8a, 0x8b) AM_READ(daimyojn_year_hack_r)  // ?
43554355   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)
43574357   AM_RANGE(0xa2, 0xa2) AM_DEVREADWRITE("oki", okim6295_device, read, write)
43584358   AM_RANGE(0xa8, 0xa8) AM_READ_PORT("SYSTEM")
43594359   AM_RANGE(0xaa, 0xaa) AM_READ(daimyojn_keyb1_r)
trunk/src/mame/drivers/iqblock.c
r22805r22806
137137   AM_RANGE(0x5080, 0x5083) AM_DEVREADWRITE("ppi8255", i8255_device, read, write)
138138   AM_RANGE(0x5090, 0x5090) AM_READ_PORT("SW0")
139139   AM_RANGE(0x50a0, 0x50a0) AM_READ_PORT("SW1")
140   AM_RANGE(0x50b0, 0x50b1) AM_DEVWRITE_LEGACY("ymsnd", ym2413_w) // UM3567_data_port_0_w
140   AM_RANGE(0x50b0, 0x50b1) AM_DEVWRITE("ymsnd", ym2413_device, write) // UM3567_data_port_0_w
141141   AM_RANGE(0x50c0, 0x50c0) AM_WRITE(iqblock_irqack_w)
142142   AM_RANGE(0x7000, 0x7fff) AM_READ(iqblock_bgvideoram_r)
143143   AM_RANGE(0x8000, 0xffff) AM_READ(extrarom_r)
trunk/src/mame/drivers/subsino.c
r22805r22806
904904
905905//  AM_RANGE( 0x0900c, 0x0900c ) AM_DEVWRITE("oki", okim6295_device, write)
906906
907   AM_RANGE( 0x0900e, 0x0900f ) AM_DEVWRITE_LEGACY("ymsnd", ym2413_w )
907   AM_RANGE( 0x0900e, 0x0900f ) AM_DEVWRITE("ymsnd", ym2413_device, write)
908908
909909   AM_RANGE( 0x0900d, 0x0900d ) AM_WRITE(subsino_tiles_offset_w )
910910
r22805r22806
998998   AM_RANGE( 0x09010, 0x09010 ) AM_READWRITE(flash_r, flash_w )
999999//  AM_RANGE( 0x09011, 0x09011 ) //"flash" status, bit 0
10001000//  AM_RANGE( 0x0900c, 0x0900c ) AM_READ_PORT( "INC" )
1001   AM_RANGE( 0x0900c, 0x0900d ) AM_DEVWRITE_LEGACY("ymsnd", ym2413_w )
1001   AM_RANGE( 0x0900c, 0x0900d ) AM_DEVWRITE("ymsnd", ym2413_device, write)
10021002
10031003//  AM_RANGE( 0x09018, 0x09018 ) AM_DEVWRITE("oki", okim6295_device, write)
10041004
trunk/src/mame/drivers/jackie.c
r22805r22806
382382   AM_RANGE(0x5090, 0x5090) AM_READ_PORT("BUTTONS1")
383383   AM_RANGE(0x5091, 0x5091) AM_WRITE(jackie_lamps_w )
384384   AM_RANGE(0x50a0, 0x50a0) AM_READ_PORT("BUTTONS2")
385   AM_RANGE(0x50b0, 0x50b1) AM_DEVWRITE_LEGACY("ymsnd", ym2413_w)
385   AM_RANGE(0x50b0, 0x50b1) AM_DEVWRITE("ymsnd", ym2413_device, write)
386386   AM_RANGE(0x50c0, 0x50c0) AM_READ(igs_irqack_r) AM_WRITE(igs_irqack_w)
387387   AM_RANGE(0x6000, 0x60ff) AM_RAM_WRITE(bg_scroll_w ) AM_SHARE("bg_scroll")
388388   AM_RANGE(0x6800, 0x69ff) AM_RAM_WRITE(jackie_reel1_ram_w )  AM_SHARE("reel1_ram")
trunk/src/mame/drivers/cbasebal.c
r22805r22806
120120   AM_RANGE(0x02, 0x02) AM_WRITE_PORT("IO_02")
121121   AM_RANGE(0x03, 0x03) AM_WRITE_PORT("IO_03")
122122   AM_RANGE(0x05, 0x05) AM_DEVWRITE("oki", okim6295_device, write)
123   AM_RANGE(0x06, 0x07) AM_DEVWRITE_LEGACY("ymsnd", ym2413_w)
123   AM_RANGE(0x06, 0x07) AM_DEVWRITE("ymsnd", ym2413_device, write)
124124   AM_RANGE(0x08, 0x09) AM_WRITE(cbasebal_scrollx_w)
125125   AM_RANGE(0x0a, 0x0b) AM_WRITE(cbasebal_scrolly_w)
126126   AM_RANGE(0x10, 0x10) AM_READ_PORT("P1")
trunk/src/mame/drivers/maygayv1.c
r22805r22806
691691   AM_RANGE(0x080000, 0x083fff) AM_RAM AM_SHARE("nvram")
692692   AM_RANGE(0x100000, 0x17ffff) AM_ROM AM_REGION("maincpu", 0x80000)
693693   AM_RANGE(0x820000, 0x820003) AM_READWRITE(maygay_8279_r, maygay_8279_w)
694   AM_RANGE(0x800000, 0x800003) AM_DEVWRITE8_LEGACY("ymsnd", ym2413_w, 0xff00 )
694   AM_RANGE(0x800000, 0x800003) AM_DEVWRITE8("ymsnd", ym2413_device, write, 0xff00)
695695   AM_RANGE(0x860000, 0x86000d) AM_READWRITE(read_odd, write_odd)
696696   AM_RANGE(0x86000e, 0x86000f) AM_WRITE(vsync_int_ctrl)
697697   AM_RANGE(0x880000, 0x89ffff) AM_READWRITE(i82716_r, i82716_w)
trunk/src/mame/drivers/spoker.c
r22805r22806
242242
243243   AM_RANGE( 0x64a0, 0x64a0 ) AM_READ_PORT( "BUTTONS2" )
244244
245   AM_RANGE( 0x64b0, 0x64b1 ) AM_DEVWRITE_LEGACY("ymsnd", ym2413_w )
245   AM_RANGE( 0x64b0, 0x64b1 ) AM_DEVWRITE("ymsnd", ym2413_device, write)
246246
247247   AM_RANGE( 0x64c0, 0x64c0 ) AM_DEVREADWRITE("oki", okim6295_device, read, write)
248248
trunk/src/mame/drivers/relief.c
r22805r22806
136136   ADDRESS_MAP_UNMAP_HIGH
137137   ADDRESS_MAP_GLOBAL_MASK(0x3fffff)
138138   AM_RANGE(0x000000, 0x07ffff) AM_ROM
139   AM_RANGE(0x140000, 0x140003) AM_DEVWRITE8_LEGACY("ymsnd", ym2413_w, 0x00ff)
139   AM_RANGE(0x140000, 0x140003) AM_DEVWRITE8("ymsnd", ym2413_device, write, 0x00ff)
140140   AM_RANGE(0x140010, 0x140011) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff)
141141   AM_RANGE(0x140020, 0x140021) AM_WRITE(audio_volume_w)
142142   AM_RANGE(0x140030, 0x140031) AM_WRITE(audio_control_w)
trunk/src/mame/drivers/igs011.c
r22805r22806
25152515   AM_RANGE( 0x000000, 0x07ffff ) AM_ROM
25162516   AM_RANGE( 0x100000, 0x103fff ) AM_RAM AM_SHARE("nvram")
25172517   AM_RANGE( 0x200000, 0x200001 ) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff )
2518   AM_RANGE( 0x204000, 0x204003 ) AM_DEVWRITE8_LEGACY("ymsnd", ym2413_w, 0x00ff )
2518   AM_RANGE( 0x204000, 0x204003 ) AM_DEVWRITE8("ymsnd", ym2413_device, write, 0x00ff)
25192519   AM_RANGE( 0x208000, 0x208003 ) AM_WRITE(lhb2_igs003_w )
25202520   AM_RANGE( 0x208002, 0x208003 ) AM_READ(lhb2_igs003_r )
25212521   AM_RANGE( 0x20c000, 0x20cfff ) AM_RAM AM_SHARE("priority_ram")
r22805r22806
25562556   AM_RANGE( 0x000000, 0x07ffff ) AM_ROM
25572557   AM_RANGE( 0x100000, 0x103fff ) AM_RAM AM_SHARE("nvram")
25582558   AM_RANGE( 0x200000, 0x200001 ) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff )
2559   AM_RANGE( 0x204000, 0x204003 ) AM_DEVWRITE8_LEGACY("ymsnd", ym2413_w, 0x00ff )
2559   AM_RANGE( 0x204000, 0x204003 ) AM_DEVWRITE8("ymsnd", ym2413_device, write, 0x00ff)
25602560   AM_RANGE( 0x208000, 0x208003 ) AM_WRITE(lhb2_igs003_w )
25612561   AM_RANGE( 0x208002, 0x208003 ) AM_READ(lhb2_igs003_r )
25622562   AM_RANGE( 0x20c000, 0x20cfff ) AM_RAM AM_SHARE("priority_ram")
trunk/src/mame/drivers/fromance.c
r22805r22806
302302   AM_RANGE(0x26, 0x26) AM_READWRITE(fromance_commanddata_r, fromance_busycheck_sub_w)
303303   AM_RANGE(0x27, 0x27) AM_WRITE(fromance_adpcm_reset_w)
304304   AM_RANGE(0x28, 0x28) AM_WRITE(fromance_adpcm_w)
305   AM_RANGE(0x2a, 0x2b) AM_DEVWRITE_LEGACY("ymsnd", ym2413_w)
305   AM_RANGE(0x2a, 0x2b) AM_DEVWRITE("ymsnd", ym2413_device, write)
306306ADDRESS_MAP_END
307307
308308
trunk/src/mame/drivers/jpmsys5.c
r22805r22806
321321
322322static ADDRESS_MAP_START( 68000_awp_map, AS_PROGRAM, 16, jpmsys5_state )
323323   JPM_SYS5_COMMON_MAP
324   AM_RANGE(0x0460a0, 0x0460a3) AM_DEVWRITE8_LEGACY("ym2413", ym2413_w, 0x00ff)
324   AM_RANGE(0x0460a0, 0x0460a3) AM_DEVWRITE8("ym2413", ym2413_device, write, 0x00ff)
325325   AM_RANGE(0x04c100, 0x04c105) AM_READWRITE(jpm_upd7759_r, jpm_upd7759_w)
326326ADDRESS_MAP_END
327327
r22805r22806
336336   JPM_SYS5_COMMON_MAP
337337   AM_RANGE(0x01fffe, 0x01ffff) AM_WRITE(rombank_w) // extra on video system (rom board?) (although regular games do write here?)
338338   AM_RANGE(0x020000, 0x03ffff) AM_ROMBANK("bank1") // extra on video system (rom board?)
339   AM_RANGE(0x0460a0, 0x0460a3) AM_DEVWRITE8_LEGACY("ym2413", ym2413_w, 0x00ff)
339   AM_RANGE(0x0460a0, 0x0460a3) AM_DEVWRITE8("ym2413", ym2413_device, write, 0x00ff)
340340   AM_RANGE(0x0460e0, 0x0460e5) AM_WRITE(ramdac_w)  // extra on video system (rom board?)
341341   AM_RANGE(0x04c100, 0x04c105) AM_READWRITE(jpm_upd7759_r, jpm_upd7759_w)
342342   AM_RANGE(0x800000, 0xcfffff) AM_READWRITE(sys5_tms34061_r, sys5_tms34061_w) // extra on video system (rom board?)
trunk/src/mame/drivers/dynax.c
r22805r22806
553553   AM_RANGE( 0x26, 0x26 ) AM_READ_PORT("DSW2")         // DSW3
554554   AM_RANGE( 0x30, 0x30 ) AM_WRITE(adpcm_reset_w)  // MSM5205 reset
555555   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)        //
557557   AM_RANGE( 0x36, 0x36 ) AM_DEVREAD("aysnd", ay8910_device, data_r)     // AY8910, DSW1
558558   AM_RANGE( 0x38, 0x38 ) AM_DEVWRITE("aysnd", ay8910_device, data_w)   // AY8910
559559   AM_RANGE( 0x3a, 0x3a ) AM_DEVWRITE("aysnd", ay8910_device, address_w)    //
r22805r22806
638638
639639   AM_RANGE( 0x30, 0x30 ) AM_WRITE(adpcm_reset_w)  // MSM5205 reset
640640   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)        //
642642
643643   AM_RANGE( 0x36, 0x36 ) AM_DEVREAD("aysnd", ay8910_device, data_r)     // AY8910, DSW1
644644   AM_RANGE( 0x38, 0x38 ) AM_DEVWRITE("aysnd", ay8910_device, data_w)   // AY8910
r22805r22806
778778   AM_RANGE( 0x11, 0x17 ) AM_WRITE(dynax_blitter_rev2_w)       // Blitter
779779   AM_RANGE( 0x20, 0x20 ) AM_WRITE(adpcm_reset_w)  // MSM5205 reset
780780   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)        //
782782   AM_RANGE( 0x28, 0x28 ) AM_DEVWRITE("aysnd", ay8910_device, data_w)   // AY8910
783783   AM_RANGE( 0x2a, 0x2a ) AM_DEVWRITE("aysnd", ay8910_device, address_w)    //
784784   AM_RANGE( 0x48, 0x48 ) AM_WRITE(dynax_extra_scrollx_w)  // screen scroll X
r22805r22806
817817   AM_RANGE( 0x26, 0x26 ) AM_READ_PORT("DSW1")         // DSW3
818818   AM_RANGE( 0x30, 0x30 ) AM_WRITE(adpcm_reset_w)  // MSM5205 reset
819819   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)        //
821821   AM_RANGE( 0x38, 0x38 ) AM_DEVWRITE("aysnd", ay8910_device, data_w)   // AY8910
822822   AM_RANGE( 0x3a, 0x3a ) AM_DEVWRITE("aysnd", ay8910_device, address_w)    //
823823   AM_RANGE( 0x40, 0x40 ) AM_WRITE(dynax_blit_pen_w)       // Destination Pen
r22805r22806
891891   AM_RANGE( 0x63, 0x63 ) AM_READ(hanamai_keyboard_0_r)        // P1
892892   AM_RANGE( 0x64, 0x64 ) AM_READ_PORT("DSW0")         // DSW
893893   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)        //
895895//  AM_RANGE( 0x80, 0x80 ) AM_WRITENOP   // IRQ ack?
896896ADDRESS_MAP_END
897897
r22805r22806
900900   ADDRESS_MAP_GLOBAL_MASK(0xff)
901901   AM_RANGE( 0x00, 0x00 ) AM_WRITE(adpcm_reset_w)  // MSM5205 reset
902902   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)        //
904904   AM_RANGE( 0x08, 0x08 ) AM_DEVWRITE("aysnd", ay8910_device, data_w)   // AY8910
905905   AM_RANGE( 0x0a, 0x0a ) AM_DEVWRITE("aysnd", ay8910_device, address_w)    //
906906   AM_RANGE( 0x10, 0x10 ) AM_WRITE(hanamai_keyboard_w)     // keyboard row select
r22805r22806
10581058   ADDRESS_MAP_GLOBAL_MASK(0xff)
10591059   AM_RANGE( 0x00, 0x00 ) AM_WRITE(adpcm_reset_w)  // MSM5205 reset
10601060   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)        //
10621062   AM_RANGE( 0x08, 0x08 ) AM_DEVWRITE("aysnd", ay8910_device, data_w)   // AY8910
10631063   AM_RANGE( 0x0a, 0x0a ) AM_DEVWRITE("aysnd", ay8910_device, address_w)    //
10641064   AM_RANGE( 0x11, 0x12 ) AM_WRITE(mjelctrn_blitter_ack_w) //?
r22805r22806
13421342   AM_RANGE( 0x10000, 0x10000 ) AM_DEVREAD("aysnd", ay8910_device, data_r)       // AY8910
13431343   AM_RANGE( 0x10008, 0x10008 ) AM_DEVWRITE("aysnd", ay8910_device, data_w) //
13441344   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)      //
13461346   AM_RANGE( 0x10040, 0x10040 ) AM_WRITE(dynax_blit_pen_w)     // Destination Pen
13471347   AM_RANGE( 0x10044, 0x10044 ) AM_WRITE(tenkai_blit_dest_w)       // Destination Layer
13481348   AM_RANGE( 0x10048, 0x10048 ) AM_WRITE(tenkai_blit_palette23_w)  // Layers Palettes
r22805r22806
14851485         case 0x8050:    // CRT controller
14861486         case 0x8051:    return;
14871487
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;
14901490
14911491         case 0x8060:    m_keyb = data;  return;
14921492
trunk/src/mame/drivers/ppmast93.c
r22805r22806
222222   switch(offset&0xff)
223223   {
224224      case 0:
225      case 1: ym2413_w(machine().device("ymsnd"),space,offset,data); break;
225      case 1: machine().device<ym2413_device>("ymsnd")->write(space,offset,data); break;
226226      case 2: m_dac->write_unsigned8(data);break;
227227      default: logerror("%x %x - %x\n",offset,data,space.device().safe_pcbase());
228228   }
trunk/src/mame/drivers/rampart.c
r22805r22806
134134   AM_RANGE(0x3e3f40, 0x3e3f7f) AM_MIRROR(0x010000) AM_READWRITE_LEGACY(atarimo_0_slipram_r, atarimo_0_slipram_w)
135135   AM_RANGE(0x3e3f80, 0x3effff) AM_MIRROR(0x010000) AM_RAM
136136   AM_RANGE(0x460000, 0x460001) AM_MIRROR(0x019ffe) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0xff00)
137   AM_RANGE(0x480000, 0x480003) AM_MIRROR(0x019ffc) AM_DEVWRITE8_LEGACY("ymsnd", ym2413_w, 0xff00)
137   AM_RANGE(0x480000, 0x480003) AM_MIRROR(0x019ffc) AM_DEVWRITE8("ymsnd", ym2413_device, write, 0xff00)
138138   AM_RANGE(0x500000, 0x500fff) AM_MIRROR(0x019000) AM_READWRITE(eeprom_r, eeprom_w) AM_SHARE("eeprom")
139139   AM_RANGE(0x5a6000, 0x5a6001) AM_MIRROR(0x019ffe) AM_WRITE(eeprom_enable_w)
140140   AM_RANGE(0x640000, 0x640001) AM_MIRROR(0x019ffe) AM_WRITE(latch_w)
trunk/src/mame/drivers/maygay1b.c
r22805r22806
821821
822822   AM_RANGE(0x20C0, 0x20C7) AM_WRITE(m1_latch_w)
823823
824   AM_RANGE(0x2400, 0x2401) AM_DEVWRITE_LEGACY("ymsnd", ym2413_w ) // 2149F??
824   AM_RANGE(0x2400, 0x2401) AM_DEVWRITE("ymsnd", ym2413_device, write) // 2149F??
825825   AM_RANGE(0x2404, 0x2405) AM_READ(latch_st_lo)
826826   AM_RANGE(0x2406, 0x2407) AM_READ(latch_st_hi)
827827
trunk/src/mame/drivers/popobear.c
r22805r22806
492492   AM_RANGE(0x500000, 0x500001) AM_READ_PORT("IN0")
493493   AM_RANGE(0x520000, 0x520001) AM_READ_PORT("IN1")
494494   AM_RANGE(0x540000, 0x540001) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff)
495   AM_RANGE(0x550000, 0x550003) AM_DEVWRITE8_LEGACY("ymsnd", ym2413_w, 0x00ff )
495   AM_RANGE(0x550000, 0x550003) AM_DEVWRITE8("ymsnd", ym2413_device, write, 0x00ff)
496496
497497   AM_RANGE(0x600000, 0x600001) AM_WRITENOP
498498   AM_RANGE(0x620000, 0x620001) AM_READ8(popo_620000_r,0xff00) AM_WRITENOP
trunk/src/mame/drivers/igs017.c
r22805r22806
13471347
13481348   AM_RANGE( 0xa000, 0xa000 ) AM_READ_PORT( "BUTTONS" )
13491349
1350   AM_RANGE( 0xb000, 0xb001 ) AM_DEVWRITE_LEGACY("ymsnd", ym2413_w )
1350   AM_RANGE( 0xb000, 0xb001 ) AM_DEVWRITE("ymsnd", ym2413_device, write)
13511351ADDRESS_MAP_END
13521352
13531353
r22805r22806
17721772
17731773   AM_RANGE( 0x9000, 0x9000 ) AM_DEVREADWRITE("oki", okim6295_device, read, write)
17741774
1775   AM_RANGE( 0xb000, 0xb001 ) AM_DEVWRITE_LEGACY("ymsnd", ym2413_w )
1775   AM_RANGE( 0xb000, 0xb001 ) AM_DEVWRITE("ymsnd", ym2413_device, write)
17761776ADDRESS_MAP_END
17771777
17781778
trunk/src/mame/drivers/igspoker.c
r22805r22806
375375   AM_RANGE(0x5090, 0x5090) AM_WRITE(custom_io_w)
376376   AM_RANGE(0x5091, 0x5091) AM_READ(custom_io_r) AM_WRITE(igs_lamps_w )            /* Keyboard */
377377   AM_RANGE(0x50a0, 0x50a0) AM_READ_PORT("BUTTONS2")           /* Not connected */
378   AM_RANGE(0x50b0, 0x50b1) AM_DEVWRITE_LEGACY("ymsnd", ym2413_w)
378   AM_RANGE(0x50b0, 0x50b1) AM_DEVWRITE("ymsnd", ym2413_device, write)
379379   AM_RANGE(0x50c0, 0x50c0) AM_READ(igs_irqack_r) AM_WRITE(igs_irqack_w)
380380   AM_RANGE(0x6800, 0x6fff) AM_RAM_WRITE(bg_tile_w )  AM_SHARE("bg_tile_ram")
381381   AM_RANGE(0x7000, 0x77ff) AM_RAM_WRITE(fg_tile_w )  AM_SHARE("fg_tile_ram")
trunk/src/mame/drivers/hyprduel.c
r22805r22806
489489   AM_RANGE(0x000000, 0x003fff) AM_RAM AM_SHARE("sharedram1")                      /* shadow ($c00000 - $c03fff : vector) */
490490   AM_RANGE(0x004000, 0x007fff) AM_READONLY AM_WRITENOP AM_SHARE("sharedram3")     /* shadow ($fe4000 - $fe7fff : read only) */
491491   AM_RANGE(0x400000, 0x400003) AM_NOP
492   AM_RANGE(0x800000, 0x800003) AM_READNOP AM_DEVWRITE8_LEGACY("ymsnd", ym2413_w, 0x00ff)
492   AM_RANGE(0x800000, 0x800003) AM_READNOP AM_DEVWRITE8("ymsnd", ym2413_device, write, 0x00ff)
493493   AM_RANGE(0x800004, 0x800005) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff)
494494   AM_RANGE(0xc00000, 0xc1ffff) AM_RAM AM_SHARE("sharedram1")
495495   AM_RANGE(0xfe0000, 0xfe3fff) AM_RAM AM_SHARE("sharedram2")
trunk/src/emu/sound/2413intf.c
r22805r22806
99#include "2413intf.h"
1010
1111
12/* for stream system */
13struct ym2413_state
12static void ym2413_update_request(void *param, int interval)
1413{
15   sound_stream *  stream;
16   void *          chip;
17};
14   ym2413_device *ym2413 = (ym2413_device *) param;
15   ym2413->_ym2413_update_request();
16}
1817
19
20INLINE ym2413_state *get_safe_token(device_t *device)
18void ym2413_device::_ym2413_update_request()
2119{
22   assert(device != NULL);
23   assert(device->type() == YM2413);
24   return (ym2413_state *)downcast<ym2413_device *>(device)->token();
20   m_stream->update();
2521}
2622
23//-------------------------------------------------
24//  sound_stream_update - handle a stream update
25//-------------------------------------------------
2726
28#ifdef UNUSED_FUNCTION
29void YM2413DAC_update(int chip,stream_sample_t **inputs, stream_sample_t **_buffer,int length)
27void ym2413_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
3028{
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);
3930}
40#endif
4131
42static 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//-------------------------------------------------
4735
48static void _stream_update(void *param, int interval)
36void ym2413_device::device_start()
4937{
50   ym2413_state *info = (ym2413_state *)param;
51   info->stream->update();
52}
38   int rate = clock()/72;
5339
54static DEVICE_START( ym2413 )
55{
56   ym2413_state *info = get_safe_token(device);
57   int rate = device->clock()/72;
58
5940   /* 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");
6243
6344   /* 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);
6546
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);
9348}
9449
95static DEVICE_STOP( ym2413 )
50//-------------------------------------------------
51//  device_stop - device-specific stop
52//-------------------------------------------------
53
54void ym2413_device::device_stop()
9655{
97   ym2413_state *info = get_safe_token(device);
98   ym2413_shutdown(info->chip);
56   ym2413_shutdown(m_chip);
9957}
10058
101static DEVICE_RESET( ym2413 )
59//-------------------------------------------------
60//  device_reset - device-specific reset
61//-------------------------------------------------
62
63void ym2413_device::device_reset()
10264{
103   ym2413_state *info = get_safe_token(device);
104   ym2413_reset_chip(info->chip);
65   ym2413_reset_chip(m_chip);
10566}
10667
10768
108WRITE8_DEVICE_HANDLER( ym2413_w )
69WRITE8_MEMBER( ym2413_device::write )
10970{
110   ym2413_state *info = get_safe_token(device);
111   ym2413_write(info->chip, offset & 1, data);
71   ym2413_write(m_chip, offset & 1, data);
11272}
11373
114WRITE8_DEVICE_HANDLER( ym2413_register_port_w ) { ym2413_w(device, space, 0, data); }
115WRITE8_DEVICE_HANDLER( ym2413_data_port_w ) { ym2413_w(device, space, 1, data); }
74WRITE8_MEMBER( ym2413_device::register_port_w ) { write(space, 0, data); }
75WRITE8_MEMBER( ym2413_device::data_port_w ) { write(space, 1, data); }
11676
11777const device_type YM2413 = &device_creator<ym2413_device>;
11878
r22805r22806
12080   : device_t(mconfig, YM2413, "YM2413", tag, owner, clock),
12181      device_sound_interface(mconfig, *this)
12282{
123   m_token = global_alloc_clear(ym2413_state);
12483}
12584
12685//-------------------------------------------------
r22805r22806
13291void ym2413_device::device_config_complete()
13392{
13493}
135
136//-------------------------------------------------
137//  device_start - device-specific startup
138//-------------------------------------------------
139
140void ym2413_device::device_start()
141{
142   DEVICE_START_NAME( ym2413 )(this);
143}
144
145//-------------------------------------------------
146//  device_reset - device-specific reset
147//-------------------------------------------------
148
149void ym2413_device::device_reset()
150{
151   DEVICE_RESET_NAME( ym2413 )(this);
152}
153
154//-------------------------------------------------
155//  device_stop - device-specific stop
156//-------------------------------------------------
157
158void ym2413_device::device_stop()
159{
160   DEVICE_STOP_NAME( ym2413 )(this);
161}
162
163//-------------------------------------------------
164//  sound_stream_update - handle a stream update
165//-------------------------------------------------
166
167void 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}
trunk/src/emu/sound/2413intf.h
r22805r22806
33#ifndef __2413INTF_H__
44#define __2413INTF_H__
55
6#include "devlegcy.h"
6#include "emu.h"
77
8DECLARE_WRITE8_DEVICE_HANDLER( ym2413_w );
9
10DECLARE_WRITE8_DEVICE_HANDLER( ym2413_register_port_w );
11DECLARE_WRITE8_DEVICE_HANDLER( ym2413_data_port_w );
12
138class ym2413_device : public device_t,
149                           public device_sound_interface
1510{
1611public:
1712   ym2413_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
18   ~ym2413_device() { global_free(m_token); }
1913
20   // access to legacy token
21   void *token() const { assert(m_token != NULL); return m_token; }
14   DECLARE_WRITE8_MEMBER( write );
15
16   DECLARE_WRITE8_MEMBER( register_port_w );
17   DECLARE_WRITE8_MEMBER( data_port_w );
18
19   void _ym2413_update_request();
20
2221protected:
2322   // device-level overrides
2423   virtual void device_config_complete();
r22805r22806
2827
2928   // sound stream update overrides
3029   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
30
3131private:
3232   // internal state
33   void *m_token;
33   sound_stream *  m_stream;
34   void *          m_chip;
3435};
3536
3637extern const device_type YM2413;
trunk/src/mess/includes/sms.h
r22805r22806
3131      m_control_cpu(*this, "control"),
3232      m_vdp(*this, "sms_vdp"),
3333      m_eeprom(*this, "eeprom"),
34      m_ym(*this, "ym2413"),
3435      m_main_scr(*this, "screen"),
3536      m_is_gamegear(0),
3637      m_is_region_japan(0),
r22805r22806
4748   optional_device<cpu_device> m_control_cpu;
4849   required_device<sega315_5124_device> m_vdp;
4950   optional_device<eeprom_device> m_eeprom;
50   device_t *m_ym;
51   optional_device<ym2413_device> m_ym;
5152   required_device<screen_device> m_main_scr;
5253   device_t *m_left_lcd;
5354   device_t *m_right_lcd;
trunk/src/mess/machine/msx_slot.c
r22805r22806
17041704   case 0x7ff4:
17051705      if (state->m_cart.fmpac.opll_active)
17061706      {
1707         ym2413_w (drvstate->m_ym, space, 0, val);
1707         drvstate->m_ym->write(space, 0, val);
17081708      }
17091709      break;
17101710   case 0x7ff5:
17111711      if (state->m_cart.fmpac.opll_active)
17121712      {
1713         ym2413_w (drvstate->m_ym, space, 1, val);
1713         drvstate->m_ym->write(space, 1, val);
17141714      }
17151715      break;
17161716   case 0x7ff6:
trunk/src/mess/machine/msx.c
r22805r22806
648648   if (m_opll_active)
649649   {
650650      if (offset == 1)
651         ym2413_w (m_ym, space, 1, data);
651         m_ym->write(space, 1, data);
652652      else
653         ym2413_w (m_ym, space, 0, data);
653         m_ym->write(space, 0, data);
654654   }
655655}
656656
trunk/src/mess/machine/nes_konami.c
r22805r22806
2929#include "machine/nes_konami.h"
3030
3131#include "cpu/m6502/m6502.h"
32#include "sound/2413intf.h"
3332
3433#ifdef NES_PCB_DEBUG
3534#define VERBOSE 1
r22805r22806
8584}
8685
8786nes_konami_vrc7_device::nes_konami_vrc7_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
88               : nes_konami_vrc4_device(mconfig, NES_VRC7, "NES Cart Konami VRC-7 PCB", tag, owner, clock, "nes_vrc7", __FILE__)
87               : nes_konami_vrc4_device(mconfig, NES_VRC7, "NES Cart Konami VRC-7 PCB", tag, owner, clock, "nes_vrc7", __FILE__),
88               m_ym2413(*this, "ym")
8989{
9090}
9191
r22805r22806
196196
197197void nes_konami_vrc7_device::device_start()
198198{
199   m_ym2413 = device().subdevice("ym");
200
201199   common_start();
202200   irq_timer = timer_alloc(TIMER_IRQ);
203201   irq_timer->adjust(attotime::zero, 0, machine().device<cpu_device>("maincpu")->cycles_to_attotime(1));
r22805r22806
691689
692690      case 0x1010:
693691      case 0x1018:
694         ym2413_register_port_w(m_ym2413, space, 0, data);
692         m_ym2413->register_port_w(space, 0, data);
695693         break;
696694      case 0x1030:
697695      case 0x1038:
698         ym2413_data_port_w(m_ym2413, space, 0, data);
696         m_ym2413->data_port_w(space, 0, data);
699697         break;
700698
701699      case 0x2000:
trunk/src/mess/machine/nes_konami.h
r22805r22806
33
44#include "machine/nes_nxrom.h"
55#include "audio/vrc6.h"
6#include "sound/2413intf.h"
67
78
89// ======================> nes_konami_vrc1_device
r22805r22806
136137   virtual void pcb_reset();
137138
138139private:
139   device_t *m_ym2413;
140   required_device<ym2413_device> m_ym2413;
140141};
141142
142143
trunk/src/mess/machine/sms.c
r22805r22806
831831WRITE8_MEMBER(sms_state::sms_ym2413_register_port_0_w)
832832{
833833   if (m_has_fm)
834      ym2413_w(m_ym, space, 0, (data & 0x3f));
834      m_ym->write(space, 0, (data & 0x3f));
835835}
836836
837837
r22805r22806
840840   if (m_has_fm)
841841   {
842842      logerror("data_port_0_w %x %x\n", offset, data);
843      ym2413_w(m_ym, space, 1, data);
843      m_ym->write(space, 1, data);
844844   }
845845}
846846
r22805r22806
19061906   m_lphaser_1_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sms_state::lphaser_1_callback),this));
19071907   m_lphaser_2_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sms_state::lphaser_2_callback),this));
19081908
1909   m_ym = machine().device("ym2413");
19101909   m_left_lcd = machine().device("left_lcd");
19111910   m_right_lcd = machine().device("right_lcd");
19121911   m_space = &m_main_cpu->space(AS_PROGRAM);

Previous 199869 Revisions Next


© 1997-2024 The MAME Team