src/mess/drivers/lcmate2.c
| r11269 | r11270 | |
| 6 | 6 | DMEnduro. He owns one of these machines. |
| 7 | 7 | 21/04/2011 Hooked up the lcd controller and added keyboard |
| 8 | 8 | input. [Sandro Ronco] |
| 9 | 22/04/2011 Small adjustments resulting from team investigations. |
| 9 | 10 | |
| 10 | | If you have further info, this driver is yours! |
| 11 | | |
| 12 | 11 | Chips: Z80 CPU, 8K of RAM, 32K ROM, 'VTCL', '8826KX', |
| 13 | 12 | RP5C15 RTC. |
| 14 | 13 | |
| r11269 | r11270 | |
| 17 | 16 | There are no devices for file saving or loading, is more of |
| 18 | 17 | a PDA format with all programs (address book, etc) in the ROM. |
| 19 | 18 | |
| 20 | | Sound: a piezo device which is assumed to be a beeper at this time. |
| 19 | Sound: a piezo speaker. |
| 21 | 20 | |
| 22 | 21 | ToDo: |
| 23 | | - Absolutely everything! |
| 22 | - RTC doesn't remember the time |
| 23 | - Alarm doesn't work |
| 24 | - All RAM needs to be battery-backed up. |
| 25 | - Reset/On button to be added |
| 26 | - The ROM has INT and NMI code; investigate if something uses it. |
| 27 | - Possible rom banking |
| 24 | 28 | |
| 25 | 29 | |
| 26 | 30 | ****************************************************************************/ |
| r11269 | r11270 | |
| 30 | 34 | #include "cpu/z80/z80.h" |
| 31 | 35 | #include "machine/rp5c01.h" |
| 32 | 36 | #include "video/hd44780.h" |
| 33 | | #include "sound/beep.h" |
| 37 | #include "sound/speaker.h" |
| 34 | 38 | #include "rendlay.h" |
| 35 | 39 | |
| 36 | 40 | |
| r11269 | r11270 | |
| 42 | 46 | m_maincpu(*this, "maincpu"), |
| 43 | 47 | m_lcdc(*this, "hd44780"), |
| 44 | 48 | m_rtc(*this, "rtc"), |
| 45 | | m_beep(*this, "beep") |
| 49 | m_speaker(*this, "speaker") |
| 46 | 50 | { } |
| 47 | 51 | |
| 48 | 52 | required_device<cpu_device> m_maincpu; |
| 49 | 53 | required_device<hd44780_device> m_lcdc; |
| 50 | 54 | required_device<rp5c01_device> m_rtc; |
| 51 | | required_device<device_t> m_beep; |
| 55 | required_device<device_t> m_speaker; |
| 52 | 56 | |
| 53 | 57 | virtual bool screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect); |
| 54 | 58 | |
| 55 | | DECLARE_WRITE8_MEMBER( beep_w ); |
| 56 | | DECLARE_READ8_MEMBER( kb_r ); |
| 59 | DECLARE_WRITE8_MEMBER( speaker_w ); |
| 57 | 60 | }; |
| 58 | 61 | |
| 59 | | READ8_MEMBER( lcmate2_state::kb_r ) |
| 62 | WRITE8_MEMBER( lcmate2_state::speaker_w ) |
| 60 | 63 | { |
| 61 | | static const char *const bitnames[] = {"LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6", "LINE7"}; |
| 62 | | UINT8 data = 0xff; |
| 63 | | |
| 64 | | for (int line=0; line<8; line++) |
| 65 | | if (!(offset & (1<<line))) |
| 66 | | data &= input_port_read(machine(), bitnames[line]); |
| 67 | | |
| 68 | | return data; |
| 64 | speaker_level_w(m_speaker, BIT(data, 6)); |
| 69 | 65 | } |
| 70 | 66 | |
| 71 | | WRITE8_MEMBER( lcmate2_state::beep_w ) |
| 72 | | { |
| 73 | | beep_set_state(m_beep, data&0x40); |
| 74 | | } |
| 75 | | |
| 76 | 67 | static ADDRESS_MAP_START(lcmate2_mem, AS_PROGRAM, 8, lcmate2_state) |
| 77 | 68 | ADDRESS_MAP_UNMAP_HIGH |
| 78 | 69 | AM_RANGE( 0x0000, 0x7fff ) AM_ROM |
| r11269 | r11270 | |
| 82 | 73 | static ADDRESS_MAP_START(lcmate2_io, AS_IO, 8, lcmate2_state) |
| 83 | 74 | ADDRESS_MAP_UNMAP_HIGH |
| 84 | 75 | AM_RANGE(0x0000, 0x000f) AM_DEVREADWRITE("rtc", rp5c01_device, read, write) |
| 85 | | AM_RANGE(0x1000, 0x1000) AM_WRITE(beep_w) |
| 76 | AM_RANGE(0x1000, 0x1000) AM_WRITE(speaker_w) |
| 86 | 77 | |
| 87 | 78 | AM_RANGE(0x3000, 0x3000) AM_DEVWRITE("hd44780", hd44780_device, control_write) |
| 88 | 79 | AM_RANGE(0x3001, 0x3001) AM_DEVWRITE("hd44780", hd44780_device, data_write) |
| 89 | 80 | AM_RANGE(0x3002, 0x3002) AM_DEVREAD("hd44780", hd44780_device, control_read) |
| 90 | 81 | AM_RANGE(0x3003, 0x3003) AM_DEVREAD("hd44780", hd44780_device, data_read) |
| 91 | | |
| 92 | | //keyboard read, offset used as matrix |
| 93 | | AM_RANGE(0x5000, 0x50ff) AM_READ(kb_r) |
| 82 | AM_RANGE(0x50fe, 0x50fe) AM_READ_PORT("LINE0") |
| 83 | AM_RANGE(0x50fd, 0x50fd) AM_READ_PORT("LINE1") |
| 84 | AM_RANGE(0x50fb, 0x50fb) AM_READ_PORT("LINE2") |
| 85 | AM_RANGE(0x50f7, 0x50f7) AM_READ_PORT("LINE3") |
| 86 | AM_RANGE(0x50ef, 0x50ef) AM_READ_PORT("LINE4") |
| 87 | AM_RANGE(0x50df, 0x50df) AM_READ_PORT("LINE5") |
| 88 | AM_RANGE(0x50bf, 0x50bf) AM_READ_PORT("LINE6") |
| 89 | AM_RANGE(0x507f, 0x507f) AM_READ_PORT("LINE7") |
| 94 | 90 | ADDRESS_MAP_END |
| 95 | 91 | |
| 96 | 92 | /* Input ports */ |
| r11269 | r11270 | |
| 220 | 216 | |
| 221 | 217 | /* sound hardware */ |
| 222 | 218 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 223 | | MCFG_SOUND_ADD("beep", BEEP, 0) |
| 219 | MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0) |
| 224 | 220 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 225 | 221 | |
| 226 | 222 | /* Devices */ |
| r11269 | r11270 | |
| 239 | 235 | /* Driver */ |
| 240 | 236 | |
| 241 | 237 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS */ |
| 242 | | COMP( 1984, lcmate2, 0, 0, lcmate2, lcmate2, 0, "Vtech", "Laser Compumate 2", GAME_NOT_WORKING | GAME_NO_SOUND_HW) |
| 238 | COMP( 1984, lcmate2, 0, 0, lcmate2, lcmate2, 0, "Vtech", "Laser Compumate 2", GAME_NOT_WORKING ) |