src/mess/layout/mikrolab.lay
| r0 | r10000 | |
| 1 | <?xml version="1.0"?>
|
| 2 | <mamelayout version="2">
|
| 3 | <element name="digit" defstate="0">
|
| 4 | <led7seg>
|
| 5 | <color red="0.75" green="0.0" blue="0.0" />
|
| 6 | </led7seg>
|
| 7 | </element>
|
| 8 | <element name="background">
|
| 9 | <rect>
|
| 10 | <bounds left="0" top="0" right="1" bottom="1" />
|
| 11 | <color red="0.0" green="0.0" blue="0.0" />
|
| 12 | </rect>
|
| 13 | </element>
|
| 14 | |
| 15 | <view name="Simple Display">
|
| 16 | <!-- Black background -->
|
| 17 | <bezel element="background">
|
| 18 | <bounds left="00" top="00" right="400" bottom="100" />
|
| 19 | </bezel>
|
| 20 | |
| 21 | <bezel name="digit0" element="digit">
|
| 22 | <bounds x="10" y="10" width="50" height="80" />
|
| 23 | </bezel>
|
| 24 | <bezel name="digit1" element="digit">
|
| 25 | <bounds x="70" y="10" width="50" height="80" />
|
| 26 | </bezel>
|
| 27 | <bezel name="digit2" element="digit">
|
| 28 | <bounds x="130" y="10" width="50" height="80" />
|
| 29 | </bezel>
|
| 30 | <bezel name="digit3" element="digit">
|
| 31 | <bounds x="190" y="10" width="50" height="80" />
|
| 32 | </bezel>
|
| 33 | <bezel name="digit4" element="digit">
|
| 34 | <bounds x="270" y="10" width="50" height="80" />
|
| 35 | </bezel>
|
| 36 | <bezel name="digit5" element="digit">
|
| 37 | <bounds x="330" y="10" width="50" height="80" />
|
| 38 | </bezel>
|
| 39 | <bezel name="digit6" element="digit">
|
| 40 | <bounds x="390" y="10" width="50" height="80" />
|
| 41 | </bezel>
|
| 42 | <bezel name="digit7" element="digit">
|
| 43 | <bounds x="450" y="10" width="50" height="80" />
|
| 44 | </bezel>
|
| 45 | </view>
|
| 46 | </mamelayout>
|
src/mess/drivers/mikrolab.c
| r9999 | r10000 | |
| 1 | 1 | /*************************************************************************** |
| 2 | | |
| 2 | |
| 3 | 3 | Mikrolab KR580IK80 |
| 4 | 4 | |
| 5 | 5 | 10/12/2010 Skeleton driver. |
| 6 | 6 | |
| 7 | 7 | ****************************************************************************/ |
| 8 | 8 | |
| 9 | #define ADDRESS_MAP_MODERN |
| 10 | |
| 9 | 11 | #include "emu.h" |
| 10 | 12 | #include "cpu/i8085/i8085.h" |
| 13 | #include "mikrolab.lh" |
| 11 | 14 | |
| 12 | 15 | class mikrolab_state : public driver_device |
| 13 | 16 | { |
| 14 | 17 | public: |
| 15 | 18 | mikrolab_state(running_machine &machine, const driver_device_config_base &config) |
| 16 | 19 | : driver_device(machine, config) { } |
| 20 | |
| 21 | DECLARE_WRITE8_MEMBER(digit_w); |
| 22 | DECLARE_WRITE8_MEMBER(kp_matrix_w); |
| 23 | DECLARE_READ8_MEMBER(keypad_r); |
| 24 | |
| 25 | UINT8 m_kp_matrix; |
| 17 | 26 | }; |
| 18 | 27 | |
| 19 | | static ADDRESS_MAP_START(mikrolab_mem, ADDRESS_SPACE_PROGRAM, 8) |
| 28 | WRITE8_MEMBER(mikrolab_state::digit_w) |
| 29 | { |
| 30 | output_set_digit_value(offset, data); |
| 31 | } |
| 32 | |
| 33 | WRITE8_MEMBER(mikrolab_state::kp_matrix_w) |
| 34 | { |
| 35 | m_kp_matrix = data; |
| 36 | } |
| 37 | |
| 38 | READ8_MEMBER(mikrolab_state::keypad_r) |
| 39 | { |
| 40 | UINT8 data = 0xff; |
| 41 | |
| 42 | if (BIT(m_kp_matrix, 4)) |
| 43 | data &= input_port_read(space.machine, "LINE1"); |
| 44 | if (BIT(m_kp_matrix, 5)) |
| 45 | data &= input_port_read(space.machine, "LINE2"); |
| 46 | if (BIT(m_kp_matrix, 6)) |
| 47 | data &= input_port_read(space.machine, "LINE3"); |
| 48 | |
| 49 | return data; |
| 50 | } |
| 51 | |
| 52 | static ADDRESS_MAP_START(mikrolab_mem, ADDRESS_SPACE_PROGRAM, 8, mikrolab_state) |
| 20 | 53 | ADDRESS_MAP_UNMAP_HIGH |
| 21 | 54 | AM_RANGE( 0x0000, 0x05ff ) AM_ROM // Monitor is up to 0x2ff |
| 22 | | AM_RANGE( 0x8000, 0x83ff ) AM_RAM |
| 55 | AM_RANGE( 0x8000, 0x83f7 ) AM_RAM |
| 56 | AM_RANGE( 0x83f8, 0x83ff ) AM_WRITE(digit_w) |
| 23 | 57 | ADDRESS_MAP_END |
| 24 | 58 | |
| 25 | | static ADDRESS_MAP_START( mikrolab_io , ADDRESS_SPACE_IO, 8) |
| 59 | static ADDRESS_MAP_START( mikrolab_io , ADDRESS_SPACE_IO, 8, mikrolab_state) |
| 26 | 60 | ADDRESS_MAP_UNMAP_HIGH |
| 61 | AM_RANGE( 0xf8, 0xf8 ) AM_READ(keypad_r) |
| 62 | AM_RANGE( 0xfa, 0xfa ) AM_WRITE(kp_matrix_w) |
| 27 | 63 | ADDRESS_MAP_END |
| 28 | 64 | |
| 29 | 65 | /* Input ports */ |
| 30 | 66 | INPUT_PORTS_START( mikrolab ) |
| 67 | PORT_START("LINE1") |
| 68 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("0") PORT_CODE(KEYCODE_0) |
| 69 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("1") PORT_CODE(KEYCODE_1) |
| 70 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("2") PORT_CODE(KEYCODE_2) |
| 71 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("3") PORT_CODE(KEYCODE_3) |
| 72 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("4") PORT_CODE(KEYCODE_4) |
| 73 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("5") PORT_CODE(KEYCODE_5) |
| 74 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("6") PORT_CODE(KEYCODE_6) |
| 75 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("7") PORT_CODE(KEYCODE_7) |
| 76 | PORT_START("LINE2") |
| 77 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("8") PORT_CODE(KEYCODE_8) |
| 78 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("9") PORT_CODE(KEYCODE_9) |
| 79 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("A") PORT_CODE(KEYCODE_A) |
| 80 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("B") PORT_CODE(KEYCODE_B) |
| 81 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("C") PORT_CODE(KEYCODE_C) |
| 82 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("D") PORT_CODE(KEYCODE_D) |
| 83 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("E") PORT_CODE(KEYCODE_E) |
| 84 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("F") PORT_CODE(KEYCODE_F) |
| 85 | PORT_START("LINE3") |
| 86 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("RUN") PORT_CODE(KEYCODE_R) |
| 87 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("RESUME") PORT_CODE(KEYCODE_T) |
| 88 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("ADDRESS") PORT_CODE(KEYCODE_Y) |
| 89 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("-") PORT_CODE(KEYCODE_PGDN) |
| 90 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("+") PORT_CODE(KEYCODE_PGUP) |
| 91 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("SAVE") PORT_CODE(KEYCODE_S) |
| 92 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("END") PORT_CODE(KEYCODE_Z) |
| 93 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("ENTER") PORT_CODE(KEYCODE_ENTER) |
| 31 | 94 | INPUT_PORTS_END |
| 32 | 95 | |
| 33 | | |
| 34 | | static MACHINE_RESET(mikrolab) |
| 35 | | { |
| 36 | | } |
| 37 | | |
| 38 | | static VIDEO_START( mikrolab ) |
| 39 | | { |
| 40 | | } |
| 41 | | |
| 42 | | static VIDEO_UPDATE( mikrolab ) |
| 43 | | { |
| 44 | | return 0; |
| 45 | | } |
| 46 | | |
| 47 | 96 | static MACHINE_CONFIG_START( mikrolab, mikrolab_state ) |
| 48 | 97 | /* basic machine hardware */ |
| 49 | 98 | MCFG_CPU_ADD("maincpu",I8080, XTAL_2MHz) |
| 50 | 99 | MCFG_CPU_PROGRAM_MAP(mikrolab_mem) |
| 51 | | MCFG_CPU_IO_MAP(mikrolab_io) |
| 100 | MCFG_CPU_IO_MAP(mikrolab_io) |
| 52 | 101 | |
| 53 | | MCFG_MACHINE_RESET(mikrolab) |
| 54 | | |
| 55 | 102 | /* video hardware */ |
| 56 | | MCFG_SCREEN_ADD("screen", RASTER) |
| 57 | | MCFG_SCREEN_REFRESH_RATE(50) |
| 58 | | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */ |
| 59 | | MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 60 | | MCFG_SCREEN_SIZE(640, 480) |
| 61 | | MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1) |
| 62 | | MCFG_PALETTE_LENGTH(2) |
| 63 | | MCFG_PALETTE_INIT(black_and_white) |
| 64 | | |
| 65 | | MCFG_VIDEO_START(mikrolab) |
| 66 | | MCFG_VIDEO_UPDATE(mikrolab) |
| 103 | MCFG_DEFAULT_LAYOUT(layout_mikrolab) |
| 67 | 104 | MACHINE_CONFIG_END |
| 68 | 105 | |
| 69 | 106 | /* ROM definition */ |