Previous 199869 Revisions Next

r22729 Friday 10th May, 2013 at 10:37:05 UTC by smf
finished modernizing at28c16 [smf]
[src/emu/machine]at28c16.c at28c16.h
[src/mame/drivers]namcond1.c namcos11.c namcos12.c taitogn.c vegaeo.c zn.c

trunk/src/emu/machine/at28c16.c
r22728r22729
8787
8888void at28c16_device::device_start()
8989{
90   m_write_timer = machine().scheduler().timer_alloc( FUNC(write_finished), this );
90   m_write_timer = timer_alloc(0);
9191
9292   save_item( NAME(m_a9_12v) );
9393   save_item( NAME(m_oe_12v) );
r22728r22729
182182//  READ/WRITE HANDLERS
183183//**************************************************************************
184184
185WRITE8_DEVICE_HANDLER( at28c16_w )
185WRITE8_MEMBER( at28c16_device::write )
186186{
187   downcast<at28c16_device *>( device )->write( offset, data );
188}
189
190void at28c16_device::write( offs_t offset, UINT8 data )
191{
192187   if( m_last_write >= 0 )
193188   {
194189//      logerror( "%s: AT28C16: write( %04x, %02x ) busy\n", machine.describe_context(), offset, data );
r22728r22729
225220}
226221
227222
228READ8_DEVICE_HANDLER( at28c16_r )
223READ8_MEMBER( at28c16_device::read )
229224{
230   return downcast<at28c16_device *>( device )->read( offset );
231}
232
233UINT8 at28c16_device::read( offs_t offset )
234{
235225   if( m_last_write >= 0 )
236226   {
237227      UINT8 data = m_last_write ^ 0x80;
r22728r22729
252242}
253243
254244
255WRITE_LINE_DEVICE_HANDLER( at28c16_a9_12v )
245WRITE_LINE_MEMBER( at28c16_device::set_a9_12v )
256246{
257   downcast<at28c16_device *>( device )->set_a9_12v( state );
258}
259
260void at28c16_device::set_a9_12v( int state )
261{
262247   state &= 1;
263248   if( m_a9_12v != state )
264249   {
r22728r22729
268253}
269254
270255
271WRITE_LINE_DEVICE_HANDLER( at28c16_oe_12v )
256WRITE_LINE_MEMBER( at28c16_device::set_oe_12v )
272257{
273   downcast<at28c16_device *>( device )->set_oe_12v( state );
274}
275
276void at28c16_device::set_oe_12v( int state )
277{
278258   state &= 1;
279259   if( m_oe_12v != state )
280260   {
r22728r22729
284264}
285265
286266
287//**************************************************************************
288//  INTERNAL HELPERS
289//**************************************************************************
290
291TIMER_CALLBACK( at28c16_device::write_finished )
267void at28c16_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
292268{
293   reinterpret_cast<at28c16_device *>(ptr)->m_last_write = -1;
269   switch( id )
270   {
271   case 0:
272      m_last_write = -1;
273      break;
274   }
294275}
trunk/src/emu/machine/at28c16.h
r22728r22729
4444   at28c16_device( const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock );
4545
4646   // I/O operations
47   void write( offs_t offset, UINT8 data );
48   UINT8 read( offs_t offset );
49   void set_a9_12v( int state );
50   void set_oe_12v( int state );
47   DECLARE_WRITE8_MEMBER( write );
48   DECLARE_READ8_MEMBER( read );
49   DECLARE_WRITE_LINE_MEMBER( set_a9_12v );
50   DECLARE_WRITE_LINE_MEMBER( set_oe_12v );
5151
5252protected:
5353   // device-level overrides
r22728r22729
5555   virtual void device_validity_check(validity_checker &valid) const;
5656   virtual void device_start();
5757   virtual void device_reset();
58   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
5859
5960   // device_memory_interface overrides
6061   virtual const address_space_config *memory_space_config( address_spacenum spacenum = AS_0 ) const;
r22728r22729
6465   virtual void nvram_read( emu_file &file );
6566   virtual void nvram_write( emu_file &file );
6667
67   // internal helpers
68   static TIMER_CALLBACK( write_finished );
69
7068   // internal state
7169   address_space_config m_space_config;
7270   emu_timer *m_write_timer;
r22728r22729
7977// device type definition
8078extern const device_type AT28C16;
8179
82
83//**************************************************************************
84//  READ/WRITE HANDLERS
85//**************************************************************************
86
87DECLARE_WRITE8_DEVICE_HANDLER( at28c16_w );
88DECLARE_READ8_DEVICE_HANDLER( at28c16_r );
89WRITE_LINE_DEVICE_HANDLER( at28c16_a9_12v );
90WRITE_LINE_DEVICE_HANDLER( at28c16_oe_12v );
91
9280#endif
trunk/src/mame/drivers/vegaeo.c
r22728r22729
144144static ADDRESS_MAP_START( vega_map, AS_PROGRAM, 32, vegaeo_state )
145145   AM_RANGE(0x00000000, 0x001fffff) AM_RAM
146146   AM_RANGE(0x80000000, 0x80013fff) AM_READWRITE(vega_vram_r, vega_vram_w)
147   AM_RANGE(0xfc000000, 0xfc0000ff) AM_DEVREADWRITE8_LEGACY("at28c16", at28c16_r, at28c16_w, 0x000000ff)
147   AM_RANGE(0xfc000000, 0xfc0000ff) AM_DEVREADWRITE8("at28c16", at28c16_device, read, write, 0x000000ff)
148148   AM_RANGE(0xfc200000, 0xfc2003ff) AM_RAM_WRITE(vega_palette_w) AM_SHARE("paletteram")
149149   AM_RANGE(0xfc400000, 0xfc40005b) AM_WRITENOP // crt registers ?
150150   AM_RANGE(0xfc600000, 0xfc600003) AM_WRITE(soundlatch_w)
trunk/src/mame/drivers/namcos11.c
r22728r22729
730730static ADDRESS_MAP_START( namcos11_map, AS_PROGRAM, 32, namcos11_state )
731731   AM_RANGE(0x1fa04000, 0x1fa0ffff) AM_RAM AM_SHARE("sharedram") /* shared ram with C76 */
732732   AM_RANGE(0x1fa20000, 0x1fa2ffff) AM_WRITE(keycus_w) AM_SHARE("keycus") /* keycus */
733   AM_RANGE(0x1fa30000, 0x1fa30fff) AM_DEVREADWRITE8_LEGACY("at28c16", at28c16_r, at28c16_w, 0x00ff00ff) /* eeprom */
733   AM_RANGE(0x1fa30000, 0x1fa30fff) AM_DEVREADWRITE8("at28c16", at28c16_device, read, write, 0x00ff00ff) /* eeprom */
734734   AM_RANGE(0x1fb00000, 0x1fb00003) AM_WRITENOP /* ?? */
735735   AM_RANGE(0x1fbf6000, 0x1fbf6003) AM_WRITENOP /* ?? */
736736ADDRESS_MAP_END
trunk/src/mame/drivers/zn.c
r22728r22729
420420   AM_RANGE(0x1fa30000, 0x1fa30003) AM_NOP /* ?? */
421421   AM_RANGE(0x1fa40000, 0x1fa40003) AM_READNOP /* ?? */
422422   AM_RANGE(0x1fa60000, 0x1fa60003) AM_READNOP /* ?? */
423   AM_RANGE(0x1faf0000, 0x1faf07ff) AM_DEVREADWRITE8_LEGACY("at28c16", at28c16_r, at28c16_w, 0xffffffff) /* eeprom */
423   AM_RANGE(0x1faf0000, 0x1faf07ff) AM_DEVREADWRITE8("at28c16", at28c16_device, read, write, 0xffffffff) /* eeprom */
424424   AM_RANGE(0x1fb20000, 0x1fb20007) AM_READ(unknown_r)
425425ADDRESS_MAP_END
426426
trunk/src/mame/drivers/taitogn.c
r22728r22729
818818   AM_RANGE(0x1fa30000, 0x1fa30003) AM_READWRITE(control3_r, control3_w)
819819   AM_RANGE(0x1fa51c00, 0x1fa51dff) AM_READNOP // systematic read at spu_address + 250000, result dropped, maybe other accesses
820820   AM_RANGE(0x1fa60000, 0x1fa60003) AM_READ(hack1_r)
821   AM_RANGE(0x1faf0000, 0x1faf07ff) AM_DEVREADWRITE8_LEGACY("at28c16", at28c16_r, at28c16_w, 0xffffffff) /* eeprom */
821   AM_RANGE(0x1faf0000, 0x1faf07ff) AM_DEVREADWRITE8("at28c16", at28c16_device, read, write, 0xffffffff) /* eeprom */
822822   AM_RANGE(0x1fb00000, 0x1fb0ffff) AM_READWRITE(rf5c296_io_r, rf5c296_io_w)
823823   AM_RANGE(0x1fb40000, 0x1fb40003) AM_READWRITE(control_r, control_w)
824824   AM_RANGE(0x1fb60000, 0x1fb60003) AM_WRITE(control2_w)
trunk/src/mame/drivers/namcos12.c
r22728r22729
12571257static ADDRESS_MAP_START( namcos12_map, AS_PROGRAM, 32, namcos12_state )
12581258   AM_RANGE(0x1f000000, 0x1f000003) AM_READNOP AM_WRITE(bankoffset_w)          /* banking */
12591259   AM_RANGE(0x1f080000, 0x1f083fff) AM_READWRITE(sharedram_r, sharedram_w) AM_SHARE("sharedram") /* shared ram?? */
1260   AM_RANGE(0x1f140000, 0x1f140fff) AM_DEVREADWRITE8_LEGACY("at28c16", at28c16_r, at28c16_w, 0x00ff00ff) /* eeprom */
1260   AM_RANGE(0x1f140000, 0x1f140fff) AM_DEVREADWRITE8("at28c16", at28c16_device, read, write, 0x00ff00ff) /* eeprom */
12611261   AM_RANGE(0x1f1bff08, 0x1f1bff0f) AM_WRITENOP    /* ?? */
12621262   AM_RANGE(0x1f700000, 0x1f70ffff) AM_WRITE(dmaoffset_w)  /* dma */
12631263   AM_RANGE(0x1fa00000, 0x1fbfffff) AM_ROMBANK("bank1") /* banked roms */
trunk/src/mame/drivers/namcond1.c
r22728r22729
8080   AM_RANGE(0x000000, 0x0fffff) AM_ROM
8181   AM_RANGE(0x400000, 0x40ffff) AM_READWRITE(namcond1_shared_ram_r,namcond1_shared_ram_w) AM_SHARE("shared_ram")
8282   AM_RANGE(0x800000, 0x80000f) AM_READWRITE_LEGACY(ygv608_r,ygv608_w)
83   AM_RANGE(0xa00000, 0xa00fff) AM_DEVREADWRITE8_LEGACY("at28c16", at28c16_r, at28c16_w, 0xff00)
83   AM_RANGE(0xa00000, 0xa00fff) AM_DEVREADWRITE8("at28c16", at28c16_device, read, write, 0xff00)
8484#ifdef MAME_DEBUG
8585   AM_RANGE(0xb00000, 0xb00001) AM_READ_LEGACY(ygv608_debug_trigger)
8686#endif

Previous 199869 Revisions Next


© 1997-2024 The MAME Team