Previous 199869 Revisions Next

r20097 Sunday 6th January, 2013 at 10:03:46 UTC by Sandro Ronco
(MESS) mstation: added emulation of SST 28SF040 flash. (nw)
[src/emu/machine]intelfsh.c intelfsh.h
[src/mess/drivers]mstation.c

trunk/src/mess/drivers/mstation.c
r20096r20097
1313        - RCV336ACFW 33.6kbps modem
1414
1515    TODO:
16    - SST-28SF040 flash
1716    - RCV336ACFW modem
1817    - Add similar models (Mivo 100/150/200/250/350)
1918    - New Mail led
r20096r20097
6059   DECLARE_WRITE8_MEMBER( flash_0x4000_write_handler );
6160   DECLARE_READ8_MEMBER( flash_0x8000_read_handler );
6261   DECLARE_WRITE8_MEMBER( flash_0x8000_write_handler );
62   DECLARE_READ8_MEMBER( modem_r );
63   DECLARE_WRITE8_MEMBER( modem_w );
6364
6465   void lcd_w(UINT16 offset, int column, UINT8 data);
6566   UINT8 lcd_r(UINT16 offset, int column);
r20096r20097
104105
105106READ8_MEMBER( mstation_state::flash_0x4000_read_handler )
106107{
107   if (m_flash_at_0x4000 == 1)
108      return 0x00;   //TODO: read from SST-28SF040
109   else
110      return m_flashes[m_flash_at_0x4000]->read(((m_bank1[0] & 0x3f)<<14) | offset);
108   return m_flashes[m_flash_at_0x4000]->read(((m_bank1[0] & 0x3f)<<14) | offset);
111109}
112110
113111WRITE8_MEMBER( mstation_state::flash_0x4000_write_handler )
r20096r20097
125123   m_flashes[m_flash_at_0x8000]->write(((m_bank2[0] & 0x3f)<<14) | offset, data);
126124}
127125
126READ8_MEMBER( mstation_state::modem_r )
127{
128   return 0xff;
129}
128130
131WRITE8_MEMBER( mstation_state::modem_w )
132{
133}
134
135
129136//***************************************************************************
130137//  video hardware emulation
131138//***************************************************************************/
r20096r20097
208215         program.install_readwrite_handler(bank * 0x4000, bank * 0x4000 + 0x3fff, 0, 0, read8_delegate(FUNC(mstation_state::lcd_right_r), this), write8_delegate(FUNC(mstation_state::lcd_right_w), this));
209216         active_flash = -1;
210217         break;
218      case 5:   // modem
219         program.install_readwrite_handler(bank * 0x4000, bank * 0x4000 + 0x3fff, 0x07, 0, read8_delegate(FUNC(mstation_state::modem_r), this), write8_delegate(FUNC(mstation_state::modem_w), this));
220         active_flash = -1;
221         break;
222
211223      default:
212224         logerror("Unknown chip %02x mapped at %04x - %04x\n", chip_select, bank * 0x4000, bank * 0x4000 + 0x3fff);
213225         program.unmap_readwrite(bank * 0x4000, bank * 0x4000 + 0x3fff);
r20096r20097
254266
255267    bit 7: power down request
256268    bit 5: real time clock
257    bit 6: unknown
269    bit 6: modem
258270    bit 4: 1 sec int
259271    bit 3: unknown
260272    bit 0: unknown
r20096r20097
285297READ8_MEMBER( mstation_state::battery_status_r )
286298{
287299   /*
288      bit 0-6 - unknown
289      bit 7   - battery status
300      bit 0-3 - unknown
301      bit 4-7 - battery status
290302    */
291   return 0x80;
303   return 0xf0;
292304}
293305
294306WRITE8_MEMBER( mstation_state::kb_w )
r20096r20097
328340   AM_RANGE( 0x07, 0x08 ) AM_READWRITE(bank2_r, bank2_w)
329341   AM_RANGE( 0x09, 0x09 ) AM_READ(battery_status_r)
330342   AM_RANGE( 0x10, 0x1f ) AM_DEVREADWRITE("rtc", rp5c01_device, read, write)
343   //AM_RANGE( 0x2c, 0x2c ) printer
331344ADDRESS_MAP_END
332345
333346
r20096r20097
473486
474487TIMER_DEVICE_CALLBACK_MEMBER(mstation_state::mstation_1hz_timer)
475488{
476
477489   m_irq |= (1<<4);
478490
479491   refresh_ints();
r20096r20097
481493
482494TIMER_DEVICE_CALLBACK_MEMBER(mstation_state::mstation_kb_timer)
483495{
484
485496   m_irq |= (1<<1);
486497
487498   refresh_ints();
r20096r20097
516527   MCFG_DEFAULT_LAYOUT(layout_lcd)
517528
518529   MCFG_AMD_29F080_ADD("flash0")
519   MCFG_AMD_29F080_ADD("flash1")   //SST-28SF040
530   MCFG_SST_28SF040_ADD("flash1")
520531
521532   // IRQ 4 is generated every second, used for auto power off
522533   MCFG_TIMER_DRIVER_ADD_PERIODIC("1hz_timer", mstation_state, mstation_1hz_timer, attotime::from_hz(1))
trunk/src/emu/machine/intelfsh.c
r20096r20097
8888const device_type MACRONIX_29L001MC = &device_creator<macronix_29l001mc_device>;
8989const device_type PANASONIC_MN63F805MNP = &device_creator<panasonic_mn63f805mnp_device>;
9090const device_type SANYO_LE26FV10N1TS = &device_creator<sanyo_le26fv10n1ts_device>;
91const device_type SST_28SF040 = &device_creator<sst_28sf040_device>;
9192
9293const device_type SHARP_LH28F400 = &device_creator<sharp_lh28f400_device>;
9394const device_type INTEL_E28F008SA = &device_creator<intel_e28f008sa_device>;
r20096r20097
274275      m_sector_is_4k = true;
275276      map = ADDRESS_MAP_NAME( memory_map8_1Mb );
276277      break;
278   case FLASH_SST_28SF040:
279      m_bits = 8;
280      m_size = 0x80000;
281      m_maker_id = MFG_SST;
282      m_device_id = 0x04;
283      map = ADDRESS_MAP_NAME( memory_map8_4Mb );
284      break;
277285   }
278286
279287   int addrbits;
r20096r20097
327335sanyo_le26fv10n1ts_device::sanyo_le26fv10n1ts_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
328336   : intelfsh8_device(mconfig, SANYO_LE26FV10N1TS, "Sanyo LE26FV10N1TS Flash", tag, owner, clock, FLASH_SANYO_LE26FV10N1TS) { }
329337
338sst_28sf040_device::sst_28sf040_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
339   : intelfsh8_device(mconfig, SST_28SF040, "SST 28SF040 Flash", tag, owner, clock, FLASH_SST_28SF040) { }
340
330341sharp_lh28f400_device::sharp_lh28f400_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
331342   : intelfsh16_device(mconfig, SHARP_LH28F400, "Sharp LH28F400 Flash", tag, owner, clock, FLASH_SHARP_LH28F400) { }
332343
r20096r20097
846857         break;
847858      }
848859      m_status = 0x80;
849      m_flash_mode = FM_READSTATUS;
860      if (m_type == FLASH_SST_28SF040)
861         m_flash_mode = FM_NORMAL;
862      else
863         m_flash_mode = FM_READSTATUS;
850864      break;
851865   case FM_WRITEPAGEATMEL:
852866      switch( m_bits )
r20096r20097
876890   case FM_CLEARPART1:
877891      if( ( data & 0xff ) == 0xd0 )
878892      {
879         // clear the 64k block containing the current address to all 0xffs
880         UINT32 base = address * ((m_bits == 16) ? 2 : 1);
881         for (offs_t offs = 0; offs < 64 * 1024; offs++)
882            m_addrspace[0]->write_byte((base & ~0xffff) + offs, 0xff);
893         if (m_type == FLASH_SST_28SF040)
894         {
895            // clear the 256 bytes block containing the current address to all 0xffs
896            UINT32 base = address * ((m_bits == 16) ? 2 : 1);
897            for (offs_t offs = 0; offs < 256; offs++)
898               m_addrspace[0]->write_byte((base & ~0xff) + offs, 0xff);
883899
900            m_timer->adjust( attotime::from_msec( 4 ) );
901         }
902         else
903         {
904            // clear the 64k block containing the current address to all 0xffs
905            UINT32 base = address * ((m_bits == 16) ? 2 : 1);
906            for (offs_t offs = 0; offs < 64 * 1024; offs++)
907               m_addrspace[0]->write_byte((base & ~0xffff) + offs, 0xff);
908
909            m_timer->adjust( attotime::from_seconds( 1 ) );
910         }
911
884912         m_status = 0x00;
885913         m_flash_mode = FM_READSTATUS;
886
887         m_timer->adjust( attotime::from_seconds( 1 ) );
888914         break;
889915      }
890916      else
trunk/src/emu/machine/intelfsh.h
r20096r20097
4646#define MCFG_SANYO_LE26FV10N1TS_ADD(_tag) \
4747   MCFG_DEVICE_ADD(_tag, SANYO_LE26FV10N1TS, 0)
4848
49#define MCFG_SST_28SF040_ADD(_tag) \
50   MCFG_DEVICE_ADD(_tag, SST_28SF040, 0)
51
4952#define MCFG_SHARP_LH28F400_ADD(_tag) \
5053   MCFG_DEVICE_ADD(_tag, SHARP_LH28F400, 0)
5154
r20096r20097
9093      FLASH_MACRONIX_29L001MC,
9194      FLASH_PANASONIC_MN63F805MNP,
9295      FLASH_SANYO_LE26FV10N1TS,
96      FLASH_SST_28SF040,
9397
9498      // 16-bit variants
9599      FLASH_SHARP_LH28F400 = 0x1000,
r20096r20097
252256   sanyo_le26fv10n1ts_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
253257};
254258
259class sst_28sf040_device : public intelfsh8_device
260{
261public:
262   sst_28sf040_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
263};
255264
256265// 16-bit variants
257266class sharp_lh28f400_device : public intelfsh16_device
r20096r20097
298307extern const device_type MACRONIX_29L001MC;
299308extern const device_type PANASONIC_MN63F805MNP;
300309extern const device_type SANYO_LE26FV10N1TS;
310extern const device_type SST_28SF040;
301311
302312extern const device_type SHARP_LH28F400;
303313extern const device_type INTEL_E28F008SA;

Previous 199869 Revisions Next


© 1997-2024 The MAME Team