Previous 15994 Revisions Next

r11270 Friday 22nd April, 2011 at 00:38:20 UTC by Robbbert
[LCMATE2] Made some adjustments found by team investigation. (Robbbert, Cowering, Lord Nightmare, DMEnduro)
[src/mess/drivers]lcmate2.c

src/mess/drivers/lcmate2.c
r11269r11270
66        DMEnduro. He owns one of these machines.
77        21/04/2011 Hooked up the lcd controller and added keyboard
88        input. [Sandro Ronco]
9        22/04/2011 Small adjustments resulting from team investigations.
910
10        If you have further info, this driver is yours!
11
1211        Chips: Z80 CPU, 8K of RAM, 32K ROM, 'VTCL', '8826KX',
1312               RP5C15 RTC.
1413
r11269r11270
1716        There are no devices for file saving or loading, is more of
1817        a PDA format with all programs (address book, etc) in the ROM.
1918
20        Sound: a piezo device which is assumed to be a beeper at this time.
19        Sound: a piezo speaker.
2120
2221        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
2428
2529
2630****************************************************************************/
r11269r11270
3034#include "cpu/z80/z80.h"
3135#include "machine/rp5c01.h"
3236#include "video/hd44780.h"
33#include "sound/beep.h"
37#include "sound/speaker.h"
3438#include "rendlay.h"
3539
3640
r11269r11270
4246   m_maincpu(*this, "maincpu"),
4347   m_lcdc(*this, "hd44780"),
4448   m_rtc(*this, "rtc"),
45   m_beep(*this, "beep")
49   m_speaker(*this, "speaker")
4650   { }
4751
4852   required_device<cpu_device> m_maincpu;
4953   required_device<hd44780_device> m_lcdc;
5054   required_device<rp5c01_device> m_rtc;
51   required_device<device_t> m_beep;
55   required_device<device_t> m_speaker;
5256
5357   virtual bool screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect);
5458
55   DECLARE_WRITE8_MEMBER( beep_w );
56   DECLARE_READ8_MEMBER( kb_r );
59   DECLARE_WRITE8_MEMBER( speaker_w );
5760};
5861
59READ8_MEMBER( lcmate2_state::kb_r )
62WRITE8_MEMBER( lcmate2_state::speaker_w )
6063{
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));
6965}
7066
71WRITE8_MEMBER( lcmate2_state::beep_w )
72{
73   beep_set_state(m_beep, data&0x40);
74}
75
7667static ADDRESS_MAP_START(lcmate2_mem, AS_PROGRAM, 8, lcmate2_state)
7768   ADDRESS_MAP_UNMAP_HIGH
7869   AM_RANGE( 0x0000, 0x7fff ) AM_ROM
r11269r11270
8273static ADDRESS_MAP_START(lcmate2_io, AS_IO, 8, lcmate2_state)
8374   ADDRESS_MAP_UNMAP_HIGH
8475   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)
8677
8778   AM_RANGE(0x3000, 0x3000) AM_DEVWRITE("hd44780", hd44780_device, control_write)
8879   AM_RANGE(0x3001, 0x3001) AM_DEVWRITE("hd44780", hd44780_device, data_write)
8980   AM_RANGE(0x3002, 0x3002) AM_DEVREAD("hd44780", hd44780_device, control_read)
9081   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")
9490ADDRESS_MAP_END
9591
9692/* Input ports */
r11269r11270
220216
221217   /* sound hardware */
222218   MCFG_SPEAKER_STANDARD_MONO("mono")
223   MCFG_SOUND_ADD("beep", BEEP, 0)
219   MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
224220   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
225221
226222   /* Devices */
r11269r11270
239235/* Driver */
240236
241237/*    YEAR  NAME    PARENT  COMPAT   MACHINE    INPUT    INIT     COMPANY   FULLNAME       FLAGS */
242COMP( 1984, lcmate2,  0,       0,   lcmate2,   lcmate2,    0,   "Vtech",   "Laser Compumate 2", GAME_NOT_WORKING | GAME_NO_SOUND_HW)
238COMP( 1984, lcmate2,  0,       0,   lcmate2,   lcmate2,    0,   "Vtech",   "Laser Compumate 2", GAME_NOT_WORKING )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team