src/mess/machine/mz80.c
| r0 | r3557 | |
| 1 | /***************************************************************************
|
| 2 | |
| 3 | MZ80 driver by Miodrag Milanovic
|
| 4 | |
| 5 | 22/11/2008 Preliminary driver.
|
| 6 | |
| 7 | ****************************************************************************/
|
| 8 | |
| 9 | #include "driver.h"
|
| 10 | #include "machine/8255ppi.h"
|
| 11 | #include "machine/pit8253.h"
|
| 12 | #include "devices/cassette.h"
|
| 13 | #include "sound/speaker.h"
|
| 14 | #include "includes/mz80.h"
|
| 15 |
|
| 16 | UINT8 mz80k_tempo_strobe = 0;
|
| 17 | UINT8 mz80k_8255_portc = 0;
|
| 18 | UINT8 mz80k_vertical = 0;
|
| 19 | UINT8 mz80k_cursor_cnt = 0;
|
| 20 | UINT8 mz80k_keyboard_line = 0;
|
| 21 | |
| 22 | |
| 23 | /* Driver initialization */
|
| 24 | DRIVER_INIT(mz80k)
|
| 25 | {
|
| 26 | }
|
| 27 | |
| 28 | |
| 29 | MACHINE_RESET( mz80k )
|
| 30 | {
|
| 31 | mz80k_tempo_strobe = 0;
|
| 32 | mz80k_8255_portc = 0;
|
| 33 | mz80k_vertical = 0;
|
| 34 | mz80k_cursor_cnt = 0;
|
| 35 | mz80k_keyboard_line = 0;
|
| 36 | }
|
| 37 | |
| 38 | |
| 39 | READ8_DEVICE_HANDLER(mz80k_8255_portb_r)
|
| 40 | {
|
| 41 | static const char *keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6", "LINE7", "LINE8", "LINE9" };
|
| 42 | if (mz80k_keyboard_line > 9) {
|
| 43 | return 0xff;
|
| 44 | } else {
|
| 45 | return input_port_read(device->machine, keynames[mz80k_keyboard_line]);
|
| 46 | }
|
| 47 | }
|
| 48 | |
| 49 | READ8_DEVICE_HANDLER(mz80k_8255_portc_r)
|
| 50 | {
|
| 51 | UINT8 val = 0;
|
| 52 | val |= mz80k_vertical ? 0x80 : 0x00;
|
| 53 | val |= (mz80k_cursor_cnt > 31) ? 0x40 : 0x00;
|
| 54 | val |= (cassette_get_state(device_list_find_by_tag( device->machine->config->devicelist, CASSETTE, "cassette" )) & CASSETTE_MASK_UISTATE)== CASSETTE_PLAY ? 0x10 : 0x00;
|
| 55 | |
| 56 | if (cassette_input(device_list_find_by_tag( device->machine->config->devicelist, CASSETTE, "cassette" )) > 0.00)
|
| 57 | val |= 0x20;
|
| 58 | |
| 59 | return val;
|
| 60 | }
|
| 61 | |
| 62 | WRITE8_DEVICE_HANDLER(mz80k_8255_porta_w) |
| 63 | {
|
| 64 | mz80k_keyboard_line = data & 0x0f;
|
| 65 | }
|
| 66 | |
| 67 | WRITE8_DEVICE_HANDLER(mz80k_8255_portc_w) |
| 68 | {
|
| 69 | // logerror("mz80k_8255_portc_w %02x\n",data);
|
| 70 | }
|
| 71 | |
| 72 | static PIT8253_OUTPUT_CHANGED( pit_out0_changed )
|
| 73 | {
|
| 74 | speaker_level_w( 0, state ? 1 : 0 );
|
| 75 | }
|
| 76 | |
| 77 | |
| 78 | static PIT8253_OUTPUT_CHANGED( pit_out1_changed )
|
| 79 | {
|
| 80 | pit8253_set_clock_signal( device, 2, state );
|
| 81 | }
|
| 82 | |
| 83 | |
| 84 | static PIT8253_OUTPUT_CHANGED( pit_out2_changed )
|
| 85 | {
|
| 86 | cpunum_set_input_line(device->machine, 0, 0, HOLD_LINE);
|
| 87 | }
|
| 88 | |
| 89 | ppi8255_interface mz80k_8255_int =
|
| 90 | {
|
| 91 | NULL,
|
| 92 | mz80k_8255_portb_r,
|
| 93 | mz80k_8255_portc_r,
|
| 94 | mz80k_8255_porta_w,
|
| 95 | NULL,
|
| 96 | mz80k_8255_portc_w,
|
| 97 | };
|
| 98 | |
| 99 | struct pit8253_config mz80k_pit8253_config =
|
| 100 | {
|
| 101 | {
|
| 102 | /* clockin irq callback */
|
| 103 | { 1108800.0, pit_out0_changed }, |
| 104 | { 15611.0, pit_out1_changed },
|
| 105 | { 0, pit_out2_changed },
|
| 106 | }
|
| 107 | };
|
| 108 | |
| 109 | READ8_HANDLER(mz80k_strobe_r)
|
| 110 | {
|
| 111 | mz80k_tempo_strobe^=1;
|
| 112 | return(0x7e | mz80k_tempo_strobe);
|
| 113 | }
|
| 114 | WRITE8_HANDLER(mz80k_strobe_w)
|
| 115 | {
|
| 116 | }
|
| 117 | |
src/mess/drivers/mz80.c
| r0 | r3557 | |
| 1 | /***************************************************************************
|
| 2 | |
| 3 | MZ80 driver by Miodrag Milanovic
|
| 4 | |
| 5 | 22/11/2008 Preliminary driver.
|
| 6 | |
| 7 | ****************************************************************************/
|
| 8 | |
| 9 | #include "driver.h"
|
| 10 | #include "cpu/z80/z80.h"
|
| 11 | #include "machine/8255ppi.h"
|
| 12 | #include "machine/pit8253.h"
|
| 13 | #include "devices/cassette.h"
|
| 14 | #include "sound/speaker.h"
|
| 15 | #include "includes/mz80.h"
|
| 16 |
|
| 17 | static INPUT_PORTS_START( mz80k )
|
| 18 | PORT_START("LINE0")
|
| 19 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("1") PORT_CODE(KEYCODE_1)
|
| 20 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("3") PORT_CODE(KEYCODE_3)
|
| 21 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("5") PORT_CODE(KEYCODE_5)
|
| 22 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("7") PORT_CODE(KEYCODE_7)
|
| 23 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("9") PORT_CODE(KEYCODE_9)
|
| 24 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("+ -") PORT_CODE(KEYCODE_MINUS)
|
| 25 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G2") PORT_CODE(KEYCODE_TILDE)
|
| 26 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G4") PORT_CODE(KEYCODE_TILDE)
|
| 27 | PORT_START("LINE1")
|
| 28 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("2") PORT_CODE(KEYCODE_2)
|
| 29 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("4") PORT_CODE(KEYCODE_4)
|
| 30 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("6") PORT_CODE(KEYCODE_6)
|
| 31 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("8") PORT_CODE(KEYCODE_8)
|
| 32 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("0") PORT_CODE(KEYCODE_0)
|
| 33 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G1") PORT_CODE(KEYCODE_1_PAD)
|
| 34 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G3") PORT_CODE(KEYCODE_3_PAD)
|
| 35 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G5") PORT_CODE(KEYCODE_5_PAD)
|
| 36 | PORT_START("LINE2")
|
| 37 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Q") PORT_CODE(KEYCODE_Q)
|
| 38 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("E") PORT_CODE(KEYCODE_E)
|
| 39 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("T") PORT_CODE(KEYCODE_T)
|
| 40 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("U") PORT_CODE(KEYCODE_U)
|
| 41 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("O") PORT_CODE(KEYCODE_O)
|
| 42 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("* =") PORT_CODE(KEYCODE_EQUALS)
|
| 43 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G7") PORT_CODE(KEYCODE_7_PAD)
|
| 44 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G9") PORT_CODE(KEYCODE_9_PAD)
|
| 45 | PORT_START("LINE3")
|
| 46 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("W") PORT_CODE(KEYCODE_W)
|
| 47 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("R") PORT_CODE(KEYCODE_R)
|
| 48 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Y") PORT_CODE(KEYCODE_Y)
|
| 49 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("I") PORT_CODE(KEYCODE_I)
|
| 50 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("P") PORT_CODE(KEYCODE_P)
|
| 51 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G6") PORT_CODE(KEYCODE_6_PAD)
|
| 52 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G8") PORT_CODE(KEYCODE_8_PAD)
|
| 53 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G10") PORT_CODE(KEYCODE_0_PAD)
|
| 54 | PORT_START("LINE4")
|
| 55 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("A") PORT_CODE(KEYCODE_A)
|
| 56 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("D") PORT_CODE(KEYCODE_D)
|
| 57 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G") PORT_CODE(KEYCODE_G)
|
| 58 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("J") PORT_CODE(KEYCODE_J)
|
| 59 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("L") PORT_CODE(KEYCODE_L)
|
| 60 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("pund") PORT_CODE(KEYCODE_QUOTE)
|
| 61 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G12") PORT_CODE(KEYCODE_F2)
|
| 62 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G14") PORT_CODE(KEYCODE_F4)
|
| 63 | PORT_START("LINE5")
|
| 64 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("S") PORT_CODE(KEYCODE_S)
|
| 65 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F") PORT_CODE(KEYCODE_F)
|
| 66 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("H") PORT_CODE(KEYCODE_H)
|
| 67 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("K") PORT_CODE(KEYCODE_K)
|
| 68 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(":") PORT_CODE(KEYCODE_COLON)
|
| 69 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G11") PORT_CODE(KEYCODE_F1)
|
| 70 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G13") PORT_CODE(KEYCODE_F3)
|
| 71 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G15") PORT_CODE(KEYCODE_F5)
|
| 72 | PORT_START("LINE6")
|
| 73 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Z") PORT_CODE(KEYCODE_Z)
|
| 74 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("C") PORT_CODE(KEYCODE_C)
|
| 75 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("B") PORT_CODE(KEYCODE_B)
|
| 76 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("M") PORT_CODE(KEYCODE_M)
|
| 77 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(".") PORT_CODE(KEYCODE_STOP)
|
| 78 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("SML CAP") PORT_CODE(KEYCODE_LCONTROL) PORT_CODE(KEYCODE_RCONTROL)
|
| 79 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G17") PORT_CODE(KEYCODE_F7)
|
| 80 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G19") PORT_CODE(KEYCODE_F9)
|
| 81 | PORT_START("LINE7")
|
| 82 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("X") PORT_CODE(KEYCODE_X)
|
| 83 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("V") PORT_CODE(KEYCODE_V)
|
| 84 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("N") PORT_CODE(KEYCODE_N)
|
| 85 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(",") PORT_CODE(KEYCODE_COMMA)
|
| 86 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("/") PORT_CODE(KEYCODE_SLASH)
|
| 87 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G16") PORT_CODE(KEYCODE_F6)
|
| 88 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G18") PORT_CODE(KEYCODE_F8)
|
| 89 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G20") PORT_CODE(KEYCODE_F10)
|
| 90 | PORT_START("LINE8")
|
| 91 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("L Shift") PORT_CODE(KEYCODE_LSHIFT)
|
| 92 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Ins Del") PORT_CODE(KEYCODE_BACKSPACE)
|
| 93 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNUSED)
|
| 94 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Right/Left") PORT_CODE(KEYCODE_RIGHT)
|
| 95 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("CR") PORT_CODE(KEYCODE_ENTER)
|
| 96 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("R Shift") PORT_CODE(KEYCODE_RSHIFT)
|
| 97 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G22") PORT_CODE(KEYCODE_PGUP)
|
| 98 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G24") PORT_CODE(KEYCODE_PGDN)
|
| 99 | PORT_START("LINE9")
|
| 100 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Clr Home") PORT_CODE(KEYCODE_HOME)
|
| 101 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Space") PORT_CODE(KEYCODE_SPACE)
|
| 102 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Up/Down") PORT_CODE(KEYCODE_UP)
|
| 103 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Break") PORT_CODE(KEYCODE_ESC)
|
| 104 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED)
|
| 105 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G21") PORT_CODE(KEYCODE_ENTER_PAD)
|
| 106 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G23") PORT_CODE(KEYCODE_DEL_PAD)
|
| 107 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G25") PORT_CODE(KEYCODE_TILDE) |
| 108 | INPUT_PORTS_END
|
| 109 | |
| 110 | static ADDRESS_MAP_START( mz80k_mem , ADDRESS_SPACE_PROGRAM, 8)
|
| 111 | ADDRESS_MAP_UNMAP_HIGH
|
| 112 | AM_RANGE(0x0000, 0x0fff) AM_ROM
|
| 113 | AM_RANGE(0x1000, 0xcfff) AM_RAM // 48 KB of RAM
|
| 114 | AM_RANGE(0xd000, 0xd3ff) AM_RAM // Video RAM
|
| 115 | AM_RANGE(0xe000, 0xe003) AM_DEVREADWRITE( PPI8255, "ppi8255", ppi8255_r, ppi8255_w) /* PPIA 8255 */
|
| 116 | AM_RANGE(0xe004, 0xe007) AM_DEVREADWRITE( PIT8253, "pit8253", pit8253_r,pit8253_w) /* PIT 8253 */
|
| 117 | AM_RANGE(0xe008, 0xe008) AM_READWRITE( mz80k_strobe_r, mz80k_strobe_w)
|
| 118 | AM_RANGE(0xf000, 0xf3ff) AM_ROM
|
| 119 | ADDRESS_MAP_END
|
| 120 | |
| 121 | static ADDRESS_MAP_START( mz80k_io, ADDRESS_SPACE_IO, 8)
|
| 122 | ADDRESS_MAP_GLOBAL_MASK(0xff)
|
| 123 | ADDRESS_MAP_UNMAP_HIGH
|
| 124 | ADDRESS_MAP_END
|
| 125 | |
| 126 | ROM_START (mz80k)
|
| 127 | ROM_REGION(0x10000,"main",0)
|
| 128 | ROM_LOAD ("sp1002.rom", 0x0000, 0x1000, CRC(2223e677) SHA1(518ffbe2333582ab36e6d76d1e03879a246ffa1c))
|
| 129 | ROM_LOAD ("mz80kfdif.rom", 0xf000, 0x0400, CRC(d36505e0) SHA1(1f60027e8739313962a37edbf98172df7062df49))
|
| 130 | ROM_REGION(0x0800, "gfx1",0)
|
| 131 | ROM_LOAD ("mz80k.int", 0x0000, 0x0800, CRC(a87c2e2b) SHA1(e8aefbdb48a63e5f96692af868c353ca7e1bfcd2))
|
| 132 | ROM_END
|
| 133 | |
| 134 | ROM_START (mz80kj)
|
| 135 | ROM_REGION(0x10000,"main",0)
|
| 136 | ROM_LOAD ("sp1002.rom", 0x0000, 0x1000, CRC(2223e677) SHA1(518ffbe2333582ab36e6d76d1e03879a246ffa1c))
|
| 137 | ROM_LOAD ("mz80kfdif.rom", 0xf000, 0x0400, CRC(d36505e0) SHA1(1f60027e8739313962a37edbf98172df7062df49))
|
| 138 | ROM_REGION(0x0800, "gfx1",0)
|
| 139 | ROM_LOAD ("mz80k.jap", 0x0000, 0x0800, CRC(bffe3312) SHA1(7058e565f338f5ec2bba85c19c9671e5c4fe258e))
|
| 140 | ROM_END
|
| 141 | |
| 142 | static GFXDECODE_START( mz80k )
|
| 143 | GFXDECODE_ENTRY( "gfx1", 0x0000, mz80k_charlayout, 0, 1 )
|
| 144 | GFXDECODE_END
|
| 145 | |
| 146 | static GFXDECODE_START( mz80kj )
|
| 147 | GFXDECODE_ENTRY( "gfx1", 0x0000, mz80kj_charlayout, 0, 1 )
|
| 148 | GFXDECODE_END
|
| 149 | |
| 150 | static const cassette_config mz80k_cassette_config =
|
| 151 | {
|
| 152 | cassette_default_formats,
|
| 153 | NULL,
|
| 154 | CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED
|
| 155 | };
|
| 156 | |
| 157 | static MACHINE_DRIVER_START( mz80k )
|
| 158 | /* basic machine hardware */
|
| 159 | |
| 160 | /* main CPU */
|
| 161 | MDRV_CPU_ADD("main", Z80, 2000000) /* 2 Mhz */
|
| 162 | MDRV_CPU_PROGRAM_MAP(mz80k_mem, 0)
|
| 163 | MDRV_CPU_IO_MAP(mz80k_io, 0)
|
| 164 | |
| 165 | MDRV_MACHINE_RESET( mz80k )
|
| 166 | |
| 167 | MDRV_DEVICE_ADD( "ppi8255", PPI8255 )
|
| 168 | MDRV_DEVICE_CONFIG( mz80k_8255_int )
|
| 169 | |
| 170 | MDRV_DEVICE_ADD( "pit8253", PIT8253 )
|
| 171 | MDRV_DEVICE_CONFIG( mz80k_pit8253_config )
|
| 172 | |
| 173 | /* video hardware */
|
| 174 | MDRV_SCREEN_ADD("main", RASTER)
|
| 175 | MDRV_SCREEN_REFRESH_RATE(60)
|
| 176 | |
| 177 | MDRV_VIDEO_START(mz80k)
|
| 178 | MDRV_VIDEO_UPDATE(mz80k)
|
| 179 |
|
| 180 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
|
| 181 | MDRV_GFXDECODE( mz80k ) |
| 182 | MDRV_PALETTE_LENGTH(2)
|
| 183 | MDRV_PALETTE_INIT(black_and_white)
|
| 184 | MDRV_SCREEN_SIZE(320, 200)
|
| 185 | MDRV_SCREEN_VISIBLE_AREA(0, 319, 0, 199)
|
| 186 |
|
| 187 | MDRV_SPEAKER_STANDARD_MONO("mono")
|
| 188 | MDRV_SOUND_ADD("cassette", WAVE, 0)
|
| 189 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
|
| 190 | MDRV_SOUND_ADD("speaker", SPEAKER, 0)
|
| 191 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
|
| 192 |
|
| 193 | MDRV_CASSETTE_ADD( "cassette", mz80k_cassette_config ) |
| 194 | MACHINE_DRIVER_END
|
| 195 | |
| 196 | static MACHINE_DRIVER_START( mz80kj )
|
| 197 | MDRV_IMPORT_FROM( mz80k )
|
| 198 | MDRV_GFXDECODE( mz80kj ) |
| 199 | MACHINE_DRIVER_END
|
| 200 | |
| 201 | |
| 202 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT CONFIG COMPANY FULLNAME */
|
| 203 | COMP( 1979, mz80kj, 0, 0, mz80kj, mz80k, mz80k, 0, "Sharp", "MZ-80K (Japanese)", 0 )
|
| 204 | COMP( 1979, mz80k, mz80kj, 0, mz80k, mz80k, mz80k, 0, "Sharp", "MZ-80K", 0 )
|