trunk/src/mess/drivers/mstation.c
| r20096 | r20097 | |
| 13 | 13 | - RCV336ACFW 33.6kbps modem |
| 14 | 14 | |
| 15 | 15 | TODO: |
| 16 | | - SST-28SF040 flash |
| 17 | 16 | - RCV336ACFW modem |
| 18 | 17 | - Add similar models (Mivo 100/150/200/250/350) |
| 19 | 18 | - New Mail led |
| r20096 | r20097 | |
| 60 | 59 | DECLARE_WRITE8_MEMBER( flash_0x4000_write_handler ); |
| 61 | 60 | DECLARE_READ8_MEMBER( flash_0x8000_read_handler ); |
| 62 | 61 | DECLARE_WRITE8_MEMBER( flash_0x8000_write_handler ); |
| 62 | DECLARE_READ8_MEMBER( modem_r ); |
| 63 | DECLARE_WRITE8_MEMBER( modem_w ); |
| 63 | 64 | |
| 64 | 65 | void lcd_w(UINT16 offset, int column, UINT8 data); |
| 65 | 66 | UINT8 lcd_r(UINT16 offset, int column); |
| r20096 | r20097 | |
| 104 | 105 | |
| 105 | 106 | READ8_MEMBER( mstation_state::flash_0x4000_read_handler ) |
| 106 | 107 | { |
| 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); |
| 111 | 109 | } |
| 112 | 110 | |
| 113 | 111 | WRITE8_MEMBER( mstation_state::flash_0x4000_write_handler ) |
| r20096 | r20097 | |
| 125 | 123 | m_flashes[m_flash_at_0x8000]->write(((m_bank2[0] & 0x3f)<<14) | offset, data); |
| 126 | 124 | } |
| 127 | 125 | |
| 126 | READ8_MEMBER( mstation_state::modem_r ) |
| 127 | { |
| 128 | return 0xff; |
| 129 | } |
| 128 | 130 | |
| 131 | WRITE8_MEMBER( mstation_state::modem_w ) |
| 132 | { |
| 133 | } |
| 134 | |
| 135 | |
| 129 | 136 | //*************************************************************************** |
| 130 | 137 | // video hardware emulation |
| 131 | 138 | //***************************************************************************/ |
| r20096 | r20097 | |
| 208 | 215 | 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)); |
| 209 | 216 | active_flash = -1; |
| 210 | 217 | 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 | |
| 211 | 223 | default: |
| 212 | 224 | logerror("Unknown chip %02x mapped at %04x - %04x\n", chip_select, bank * 0x4000, bank * 0x4000 + 0x3fff); |
| 213 | 225 | program.unmap_readwrite(bank * 0x4000, bank * 0x4000 + 0x3fff); |
| r20096 | r20097 | |
| 254 | 266 | |
| 255 | 267 | bit 7: power down request |
| 256 | 268 | bit 5: real time clock |
| 257 | | bit 6: unknown |
| 269 | bit 6: modem |
| 258 | 270 | bit 4: 1 sec int |
| 259 | 271 | bit 3: unknown |
| 260 | 272 | bit 0: unknown |
| r20096 | r20097 | |
| 285 | 297 | READ8_MEMBER( mstation_state::battery_status_r ) |
| 286 | 298 | { |
| 287 | 299 | /* |
| 288 | | bit 0-6 - unknown |
| 289 | | bit 7 - battery status |
| 300 | bit 0-3 - unknown |
| 301 | bit 4-7 - battery status |
| 290 | 302 | */ |
| 291 | | return 0x80; |
| 303 | return 0xf0; |
| 292 | 304 | } |
| 293 | 305 | |
| 294 | 306 | WRITE8_MEMBER( mstation_state::kb_w ) |
| r20096 | r20097 | |
| 328 | 340 | AM_RANGE( 0x07, 0x08 ) AM_READWRITE(bank2_r, bank2_w) |
| 329 | 341 | AM_RANGE( 0x09, 0x09 ) AM_READ(battery_status_r) |
| 330 | 342 | AM_RANGE( 0x10, 0x1f ) AM_DEVREADWRITE("rtc", rp5c01_device, read, write) |
| 343 | //AM_RANGE( 0x2c, 0x2c ) printer |
| 331 | 344 | ADDRESS_MAP_END |
| 332 | 345 | |
| 333 | 346 | |
| r20096 | r20097 | |
| 473 | 486 | |
| 474 | 487 | TIMER_DEVICE_CALLBACK_MEMBER(mstation_state::mstation_1hz_timer) |
| 475 | 488 | { |
| 476 | | |
| 477 | 489 | m_irq |= (1<<4); |
| 478 | 490 | |
| 479 | 491 | refresh_ints(); |
| r20096 | r20097 | |
| 481 | 493 | |
| 482 | 494 | TIMER_DEVICE_CALLBACK_MEMBER(mstation_state::mstation_kb_timer) |
| 483 | 495 | { |
| 484 | | |
| 485 | 496 | m_irq |= (1<<1); |
| 486 | 497 | |
| 487 | 498 | refresh_ints(); |
| r20096 | r20097 | |
| 516 | 527 | MCFG_DEFAULT_LAYOUT(layout_lcd) |
| 517 | 528 | |
| 518 | 529 | MCFG_AMD_29F080_ADD("flash0") |
| 519 | | MCFG_AMD_29F080_ADD("flash1") //SST-28SF040 |
| 530 | MCFG_SST_28SF040_ADD("flash1") |
| 520 | 531 | |
| 521 | 532 | // IRQ 4 is generated every second, used for auto power off |
| 522 | 533 | MCFG_TIMER_DRIVER_ADD_PERIODIC("1hz_timer", mstation_state, mstation_1hz_timer, attotime::from_hz(1)) |
trunk/src/emu/machine/intelfsh.c
| r20096 | r20097 | |
| 88 | 88 | const device_type MACRONIX_29L001MC = &device_creator<macronix_29l001mc_device>; |
| 89 | 89 | const device_type PANASONIC_MN63F805MNP = &device_creator<panasonic_mn63f805mnp_device>; |
| 90 | 90 | const device_type SANYO_LE26FV10N1TS = &device_creator<sanyo_le26fv10n1ts_device>; |
| 91 | const device_type SST_28SF040 = &device_creator<sst_28sf040_device>; |
| 91 | 92 | |
| 92 | 93 | const device_type SHARP_LH28F400 = &device_creator<sharp_lh28f400_device>; |
| 93 | 94 | const device_type INTEL_E28F008SA = &device_creator<intel_e28f008sa_device>; |
| r20096 | r20097 | |
| 274 | 275 | m_sector_is_4k = true; |
| 275 | 276 | map = ADDRESS_MAP_NAME( memory_map8_1Mb ); |
| 276 | 277 | 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; |
| 277 | 285 | } |
| 278 | 286 | |
| 279 | 287 | int addrbits; |
| r20096 | r20097 | |
| 327 | 335 | sanyo_le26fv10n1ts_device::sanyo_le26fv10n1ts_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 328 | 336 | : intelfsh8_device(mconfig, SANYO_LE26FV10N1TS, "Sanyo LE26FV10N1TS Flash", tag, owner, clock, FLASH_SANYO_LE26FV10N1TS) { } |
| 329 | 337 | |
| 338 | sst_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 | |
| 330 | 341 | sharp_lh28f400_device::sharp_lh28f400_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 331 | 342 | : intelfsh16_device(mconfig, SHARP_LH28F400, "Sharp LH28F400 Flash", tag, owner, clock, FLASH_SHARP_LH28F400) { } |
| 332 | 343 | |
| r20096 | r20097 | |
| 846 | 857 | break; |
| 847 | 858 | } |
| 848 | 859 | 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; |
| 850 | 864 | break; |
| 851 | 865 | case FM_WRITEPAGEATMEL: |
| 852 | 866 | switch( m_bits ) |
| r20096 | r20097 | |
| 876 | 890 | case FM_CLEARPART1: |
| 877 | 891 | if( ( data & 0xff ) == 0xd0 ) |
| 878 | 892 | { |
| 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); |
| 883 | 899 | |
| 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 | |
| 884 | 912 | m_status = 0x00; |
| 885 | 913 | m_flash_mode = FM_READSTATUS; |
| 886 | | |
| 887 | | m_timer->adjust( attotime::from_seconds( 1 ) ); |
| 888 | 914 | break; |
| 889 | 915 | } |
| 890 | 916 | else |
trunk/src/emu/machine/intelfsh.h
| r20096 | r20097 | |
| 46 | 46 | #define MCFG_SANYO_LE26FV10N1TS_ADD(_tag) \ |
| 47 | 47 | MCFG_DEVICE_ADD(_tag, SANYO_LE26FV10N1TS, 0) |
| 48 | 48 | |
| 49 | #define MCFG_SST_28SF040_ADD(_tag) \ |
| 50 | MCFG_DEVICE_ADD(_tag, SST_28SF040, 0) |
| 51 | |
| 49 | 52 | #define MCFG_SHARP_LH28F400_ADD(_tag) \ |
| 50 | 53 | MCFG_DEVICE_ADD(_tag, SHARP_LH28F400, 0) |
| 51 | 54 | |
| r20096 | r20097 | |
| 90 | 93 | FLASH_MACRONIX_29L001MC, |
| 91 | 94 | FLASH_PANASONIC_MN63F805MNP, |
| 92 | 95 | FLASH_SANYO_LE26FV10N1TS, |
| 96 | FLASH_SST_28SF040, |
| 93 | 97 | |
| 94 | 98 | // 16-bit variants |
| 95 | 99 | FLASH_SHARP_LH28F400 = 0x1000, |
| r20096 | r20097 | |
| 252 | 256 | sanyo_le26fv10n1ts_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 253 | 257 | }; |
| 254 | 258 | |
| 259 | class sst_28sf040_device : public intelfsh8_device |
| 260 | { |
| 261 | public: |
| 262 | sst_28sf040_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 263 | }; |
| 255 | 264 | |
| 256 | 265 | // 16-bit variants |
| 257 | 266 | class sharp_lh28f400_device : public intelfsh16_device |
| r20096 | r20097 | |
| 298 | 307 | extern const device_type MACRONIX_29L001MC; |
| 299 | 308 | extern const device_type PANASONIC_MN63F805MNP; |
| 300 | 309 | extern const device_type SANYO_LE26FV10N1TS; |
| 310 | extern const device_type SST_28SF040; |
| 301 | 311 | |
| 302 | 312 | extern const device_type SHARP_LH28F400; |
| 303 | 313 | extern const device_type INTEL_E28F008SA; |