src/mess/drivers/z1013.c
| r12599 | r12600 | |
| 4 | 4 | |
| 5 | 5 | 22/04/2009 Preliminary driver. |
| 6 | 6 | |
| 7 | Monitor commands |
| 8 | B - Registers |
| 9 | D - Dump memory |
| 10 | E - Registers |
| 11 | L - Load Cassette |
| 12 | M - Modify Memory |
| 13 | S - Save Cassette |
| 14 | |
| 15 | There are others which just hang or reboot the system, due to no input checking. |
| 16 | |
| 17 | Unable to test the cassette due to a core bug. |
| 18 | |
| 7 | 19 | ****************************************************************************/ |
| 20 | #define ADDRESS_MAP_MODERN |
| 8 | 21 | |
| 9 | | |
| 10 | 22 | #include "emu.h" |
| 11 | 23 | #include "cpu/z80/z80.h" |
| 12 | 24 | #include "machine/z80pio.h" |
| 13 | | #include "includes/z1013.h" |
| 25 | #include "imagedev/snapquik.h" |
| 26 | #include "imagedev/cassette.h" |
| 27 | #include "sound/wave.h" |
| 14 | 28 | |
| 29 | |
| 30 | class z1013_state : public driver_device |
| 31 | { |
| 32 | public: |
| 33 | z1013_state(const machine_config &mconfig, device_type type, const char *tag) |
| 34 | : driver_device(mconfig, type, tag), |
| 35 | m_maincpu(*this, "maincpu"), |
| 36 | m_cass(*this, CASSETTE_TAG) |
| 37 | { } |
| 38 | |
| 39 | required_device<cpu_device> m_maincpu; |
| 40 | required_device<cassette_image_device> m_cass; |
| 41 | DECLARE_WRITE8_MEMBER(z1013_keyboard_w); |
| 42 | DECLARE_READ8_MEMBER(z1013_port_b_r); |
| 43 | DECLARE_WRITE8_MEMBER(z1013_port_b_w); |
| 44 | DECLARE_READ8_MEMBER(z1013k7659_port_b_r); |
| 45 | UINT8 *m_p_videoram; |
| 46 | const UINT8 *m_p_chargen; |
| 47 | UINT8 m_keyboard_line; |
| 48 | bool m_keyboard_part; |
| 49 | }; |
| 50 | |
| 51 | |
| 15 | 52 | /* Address maps */ |
| 16 | | static ADDRESS_MAP_START(z1013_mem, AS_PROGRAM, 8) |
| 17 | | AM_RANGE( 0x0000, 0xefff ) AM_RAM |
| 18 | | AM_RANGE( 0xec00, 0xefff ) AM_RAM AM_BASE_MEMBER(z1013_state, m_video_ram) |
| 19 | | AM_RANGE( 0xf000, 0xffff ) AM_ROM // ROM |
| 53 | static ADDRESS_MAP_START(z1013_mem, AS_PROGRAM, 8, z1013_state) |
| 54 | AM_RANGE( 0x0000, 0xebff ) AM_RAM |
| 55 | AM_RANGE( 0xec00, 0xefff ) AM_RAM AM_BASE(m_p_videoram) |
| 56 | AM_RANGE( 0xf000, 0xffff ) AM_ROM // ROM |
| 20 | 57 | ADDRESS_MAP_END |
| 21 | 58 | |
| 22 | | static ADDRESS_MAP_START( z1013_io, AS_IO, 8 ) |
| 59 | static ADDRESS_MAP_START(z1013_io, AS_IO, 8, z1013_state) |
| 23 | 60 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 24 | | AM_RANGE( 0x00, 0x03 ) AM_DEVREADWRITE("z80pio", z80pio_ba_cd_r, z80pio_ba_cd_w) |
| 61 | AM_RANGE( 0x00, 0x03 ) AM_DEVREADWRITE_LEGACY("z80pio", z80pio_ba_cd_r, z80pio_ba_cd_w) |
| 25 | 62 | AM_RANGE( 0x08, 0x08 ) AM_WRITE(z1013_keyboard_w) |
| 26 | 63 | ADDRESS_MAP_END |
| 27 | 64 | |
| 28 | 65 | /* Input ports */ |
| 29 | 66 | static INPUT_PORTS_START( z1013_8x4 ) |
| 30 | | PORT_START("LINE0") |
| 67 | PORT_START("X0") |
| 31 | 68 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("@") PORT_CODE(KEYCODE_TAB) |
| 32 | 69 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("H") PORT_CODE(KEYCODE_H) |
| 33 | 70 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("P") PORT_CODE(KEYCODE_P) |
| 34 | 71 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("S1") PORT_CODE(KEYCODE_LSHIFT) |
| 35 | | PORT_START("LINE1") |
| 72 | PORT_START("X1") |
| 36 | 73 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("A") PORT_CODE(KEYCODE_A) |
| 37 | 74 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("I") PORT_CODE(KEYCODE_I) |
| 38 | 75 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Q") PORT_CODE(KEYCODE_Q) |
| 39 | 76 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("S2") PORT_CODE(KEYCODE_LCONTROL) |
| 40 | | PORT_START("LINE2") |
| 77 | PORT_START("X2") |
| 41 | 78 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("B") PORT_CODE(KEYCODE_B) |
| 42 | 79 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("J") PORT_CODE(KEYCODE_J) |
| 43 | 80 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("R") PORT_CODE(KEYCODE_R) |
| 44 | 81 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("S3") PORT_CODE(KEYCODE_RSHIFT) |
| 45 | | PORT_START("LINE3") |
| 82 | PORT_START("X3") |
| 46 | 83 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("C") PORT_CODE(KEYCODE_C) |
| 47 | 84 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("K") PORT_CODE(KEYCODE_K) |
| 48 | 85 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("S") PORT_CODE(KEYCODE_S) |
| 49 | 86 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("S4") PORT_CODE(KEYCODE_RCONTROL) |
| 50 | | PORT_START("LINE4") |
| 87 | PORT_START("X4") |
| 51 | 88 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("D") PORT_CODE(KEYCODE_D) |
| 52 | 89 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("L") PORT_CODE(KEYCODE_L) |
| 53 | 90 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("T") PORT_CODE(KEYCODE_T) |
| 54 | 91 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Left") PORT_CODE(KEYCODE_LEFT) |
| 55 | | PORT_START("LINE5") |
| 92 | PORT_START("X5") |
| 56 | 93 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("E") PORT_CODE(KEYCODE_E) |
| 57 | 94 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("M") PORT_CODE(KEYCODE_M) |
| 58 | 95 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("U") PORT_CODE(KEYCODE_U) |
| 59 | 96 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Space") PORT_CODE(KEYCODE_SPACE) |
| 60 | | PORT_START("LINE6") |
| 97 | PORT_START("X6") |
| 61 | 98 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F") PORT_CODE(KEYCODE_F) |
| 62 | 99 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("N") PORT_CODE(KEYCODE_N) |
| 63 | 100 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("V") PORT_CODE(KEYCODE_V) |
| 64 | 101 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Right") PORT_CODE(KEYCODE_RIGHT) |
| 65 | | PORT_START("LINE7") |
| 102 | PORT_START("X7") |
| 66 | 103 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G") PORT_CODE(KEYCODE_G) |
| 67 | 104 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("O") PORT_CODE(KEYCODE_O) |
| 68 | 105 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("W") PORT_CODE(KEYCODE_W) |
| r12599 | r12600 | |
| 70 | 107 | INPUT_PORTS_END |
| 71 | 108 | |
| 72 | 109 | static INPUT_PORTS_START( z1013_8x8 ) |
| 73 | | PORT_START("LINE0") |
| 110 | PORT_START("X0") |
| 74 | 111 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("1") PORT_CODE(KEYCODE_1) |
| 75 | 112 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Q") PORT_CODE(KEYCODE_Q) |
| 76 | 113 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("A") PORT_CODE(KEYCODE_A) |
| r12599 | r12600 | |
| 79 | 116 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("W") PORT_CODE(KEYCODE_W) |
| 80 | 117 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("S") PORT_CODE(KEYCODE_S) |
| 81 | 118 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("X") PORT_CODE(KEYCODE_X) |
| 82 | | PORT_START("LINE1") |
| 119 | PORT_START("X1") |
| 83 | 120 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("3") PORT_CODE(KEYCODE_3) |
| 84 | 121 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("E") PORT_CODE(KEYCODE_E) |
| 85 | 122 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("D") PORT_CODE(KEYCODE_D) |
| r12599 | r12600 | |
| 88 | 125 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("R") PORT_CODE(KEYCODE_R) |
| 89 | 126 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F") PORT_CODE(KEYCODE_F) |
| 90 | 127 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("V") PORT_CODE(KEYCODE_V) |
| 91 | | PORT_START("LINE2") |
| 128 | PORT_START("X2") |
| 92 | 129 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("5") PORT_CODE(KEYCODE_5) |
| 93 | 130 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("T") PORT_CODE(KEYCODE_T) |
| 94 | 131 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G") PORT_CODE(KEYCODE_G) |
| r12599 | r12600 | |
| 96 | 133 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("6") PORT_CODE(KEYCODE_6) |
| 97 | 134 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Z") PORT_CODE(KEYCODE_Z) |
| 98 | 135 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("H") PORT_CODE(KEYCODE_H) |
| 99 | | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("N") PORT_CODE(KEYCODE_V) |
| 100 | | PORT_START("LINE3") |
| 136 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("N") PORT_CODE(KEYCODE_N) |
| 137 | PORT_START("X3") |
| 101 | 138 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("7") PORT_CODE(KEYCODE_7) |
| 102 | 139 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("U") PORT_CODE(KEYCODE_U) |
| 103 | 140 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("J") PORT_CODE(KEYCODE_J) |
| r12599 | r12600 | |
| 106 | 143 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("I") PORT_CODE(KEYCODE_I) |
| 107 | 144 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("K") PORT_CODE(KEYCODE_K) |
| 108 | 145 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(",") PORT_CODE(KEYCODE_COMMA) |
| 109 | | PORT_START("LINE4") |
| 146 | PORT_START("X4") |
| 110 | 147 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("9") PORT_CODE(KEYCODE_9) |
| 111 | 148 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("O") PORT_CODE(KEYCODE_O) |
| 112 | 149 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("L") PORT_CODE(KEYCODE_L) |
| r12599 | r12600 | |
| 115 | 152 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("P") PORT_CODE(KEYCODE_P) |
| 116 | 153 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("+") PORT_CODE(KEYCODE_COLON) |
| 117 | 154 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("/") PORT_CODE(KEYCODE_SLASH) |
| 118 | | PORT_START("LINE5") |
| 155 | PORT_START("X5") |
| 119 | 156 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("-") PORT_CODE(KEYCODE_EQUALS) |
| 120 | 157 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("@") PORT_CODE(KEYCODE_TILDE) |
| 121 | 158 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("*") PORT_CODE(KEYCODE_OPENBRACE) |
| r12599 | r12600 | |
| 124 | 161 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("]") PORT_CODE(KEYCODE_CLOSEBRACE) |
| 125 | 162 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("\\") PORT_CODE(KEYCODE_BACKSLASH) |
| 126 | 163 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("_") PORT_CODE(KEYCODE_MINUS) |
| 127 | | PORT_START("LINE6") |
| 164 | PORT_START("X6") |
| 128 | 165 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Graph") PORT_CODE(KEYCODE_LALT) PORT_CODE(KEYCODE_RALT) |
| 129 | 166 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Ent") PORT_CODE(KEYCODE_ENTER) |
| 130 | 167 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Left") PORT_CODE(KEYCODE_LEFT) |
| r12599 | r12600 | |
| 133 | 170 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Ctrl") PORT_CODE(KEYCODE_LCONTROL) PORT_CODE(KEYCODE_RCONTROL) |
| 134 | 171 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Up") PORT_CODE(KEYCODE_UP) |
| 135 | 172 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Down") PORT_CODE(KEYCODE_DOWN) |
| 136 | | PORT_START("LINE7") |
| 173 | PORT_START("X7") |
| 137 | 174 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNUSED) |
| 138 | 175 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNUSED) |
| 139 | 176 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNUSED) |
| r12599 | r12600 | |
| 146 | 183 | |
| 147 | 184 | INPUT_PORTS_EXTERN( k7659 ); |
| 148 | 185 | |
| 186 | |
| 187 | VIDEO_START( z1013 ) |
| 188 | { |
| 189 | z1013_state *state = machine.driver_data<z1013_state>(); |
| 190 | state->m_p_chargen = machine.region("chargen")->base(); |
| 191 | } |
| 192 | |
| 193 | SCREEN_UPDATE( z1013 ) |
| 194 | { |
| 195 | z1013_state *state = screen->machine().driver_data<z1013_state>(); |
| 196 | UINT8 y,ra,chr,gfx; |
| 197 | UINT16 sy=0,ma=0,x; |
| 198 | |
| 199 | for (y = 0; y < 32; y++) |
| 200 | { |
| 201 | for (ra = 0; ra < 8; ra++) |
| 202 | { |
| 203 | UINT16 *p = BITMAP_ADDR16(bitmap, sy++, 0); |
| 204 | |
| 205 | for (x = ma; x < ma+32; x++) |
| 206 | { |
| 207 | chr = state->m_p_videoram[x]; |
| 208 | |
| 209 | /* get pattern of pixels for that character scanline */ |
| 210 | gfx = state->m_p_chargen[(chr<<3) | ra]; |
| 211 | |
| 212 | /* Display a scanline of a character */ |
| 213 | *p++ = BIT(gfx, 7); |
| 214 | *p++ = BIT(gfx, 6); |
| 215 | *p++ = BIT(gfx, 5); |
| 216 | *p++ = BIT(gfx, 4); |
| 217 | *p++ = BIT(gfx, 3); |
| 218 | *p++ = BIT(gfx, 2); |
| 219 | *p++ = BIT(gfx, 1); |
| 220 | *p++ = BIT(gfx, 0); |
| 221 | } |
| 222 | } |
| 223 | ma+=32; |
| 224 | } |
| 225 | return 0; |
| 226 | } |
| 227 | |
| 228 | MACHINE_RESET( z1013 ) |
| 229 | { |
| 230 | z1013_state *state = machine.driver_data<z1013_state>(); |
| 231 | cpu_set_reg(machine.device("maincpu"), Z80_PC, 0xF000); |
| 232 | state->m_keyboard_part = 0; |
| 233 | state->m_keyboard_line = 0; |
| 234 | } |
| 235 | |
| 236 | WRITE8_MEMBER( z1013_state::z1013_keyboard_w ) |
| 237 | { |
| 238 | m_keyboard_line = data; |
| 239 | } |
| 240 | |
| 241 | READ8_MEMBER( z1013_state::z1013_port_b_r ) |
| 242 | { |
| 243 | char kbdrow[6]; |
| 244 | sprintf(kbdrow,"X%d", m_keyboard_line & 7); |
| 245 | UINT8 data = input_port_read(machine(), kbdrow); |
| 246 | |
| 247 | if (m_keyboard_part) |
| 248 | data >>= 4; |
| 249 | |
| 250 | data &= 0x0f; |
| 251 | |
| 252 | if (m_cass->input() > 0.03) |
| 253 | data |= 0x40; |
| 254 | |
| 255 | return data; |
| 256 | } |
| 257 | |
| 258 | WRITE8_MEMBER( z1013_state::z1013_port_b_w ) |
| 259 | { |
| 260 | m_keyboard_part = BIT(data, 4); // for z1013a2 only |
| 261 | m_cass->output(BIT(data, 7) ? -1.0 : +1.0); |
| 262 | } |
| 263 | |
| 264 | const z80pio_interface z1013_z80pio_intf = |
| 265 | { |
| 266 | DEVCB_NULL, /* callback when change interrupt status */ |
| 267 | DEVCB_NULL, |
| 268 | DEVCB_NULL, |
| 269 | DEVCB_NULL, |
| 270 | DEVCB_DRIVER_MEMBER(z1013_state, z1013_port_b_r), |
| 271 | DEVCB_DRIVER_MEMBER(z1013_state, z1013_port_b_w), |
| 272 | DEVCB_NULL |
| 273 | }; |
| 274 | |
| 275 | READ8_MEMBER( z1013_state::z1013k7659_port_b_r ) |
| 276 | { |
| 277 | return 0xff; |
| 278 | } |
| 279 | |
| 280 | const z80pio_interface z1013k7659_z80pio_intf = |
| 281 | { |
| 282 | DEVCB_NULL, /* callback when change interrupt status */ |
| 283 | DEVCB_NULL, |
| 284 | DEVCB_NULL, |
| 285 | DEVCB_NULL, |
| 286 | DEVCB_DRIVER_MEMBER(z1013_state, z1013k7659_port_b_r), |
| 287 | DEVCB_NULL, |
| 288 | DEVCB_NULL |
| 289 | }; |
| 290 | |
| 291 | SNAPSHOT_LOAD( z1013 ) |
| 292 | { |
| 293 | UINT8* data= auto_alloc_array(image.device().machine(), UINT8, snapshot_size); |
| 294 | UINT16 startaddr,endaddr,runaddr; |
| 295 | |
| 296 | image.fread( data, snapshot_size); |
| 297 | |
| 298 | startaddr = data[0] + data[1]*256; |
| 299 | endaddr = data[2] + data[3]*256; |
| 300 | runaddr = data[4] + data[5]*256; |
| 301 | |
| 302 | if ((data[12]=='C') && (data[13]==0xD3) && (data[14]==0xD3)) |
| 303 | { } |
| 304 | else |
| 305 | return IMAGE_INIT_FAIL; |
| 306 | |
| 307 | memcpy (image.device().machine().device("maincpu")->memory().space(AS_PROGRAM)->get_read_ptr(startaddr), |
| 308 | data+0x20, endaddr - startaddr + 1); |
| 309 | |
| 310 | cpu_set_reg(image.device().machine().device("maincpu"), Z80_PC, runaddr); |
| 311 | |
| 312 | return IMAGE_INIT_PASS; |
| 313 | } |
| 314 | |
| 149 | 315 | /* F4 Character Displayer */ |
| 150 | 316 | static const gfx_layout z1013_charlayout = |
| 151 | 317 | { |
| r12599 | r12600 | |
| 156 | 322 | /* x offsets */ |
| 157 | 323 | { 0, 1, 2, 3, 4, 5, 6, 7 }, |
| 158 | 324 | /* y offsets */ |
| 159 | | { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, 8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 }, |
| 325 | { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 }, |
| 160 | 326 | 8*8 /* every char takes 8 bytes */ |
| 161 | 327 | }; |
| 162 | 328 | |
| 163 | 329 | static GFXDECODE_START( z1013 ) |
| 164 | | GFXDECODE_ENTRY( "gfx1", 0x0000, z1013_charlayout, 0, 1 ) |
| 330 | GFXDECODE_ENTRY( "chargen", 0x0000, z1013_charlayout, 0, 1 ) |
| 165 | 331 | GFXDECODE_END |
| 166 | 332 | |
| 333 | static const cassette_interface z1013_cassette_interface = |
| 334 | { |
| 335 | cassette_default_formats, |
| 336 | NULL, |
| 337 | (cassette_state)(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED), |
| 338 | NULL, |
| 339 | NULL |
| 340 | }; |
| 167 | 341 | |
| 342 | |
| 168 | 343 | /* Machine driver */ |
| 169 | 344 | static MACHINE_CONFIG_START( z1013, z1013_state ) |
| 170 | 345 | /* basic machine hardware */ |
| r12599 | r12600 | |
| 181 | 356 | MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 182 | 357 | MCFG_SCREEN_SIZE(32*8, 32*8) |
| 183 | 358 | MCFG_SCREEN_VISIBLE_AREA(0, 32*8-1, 0, 32*8-1) |
| 359 | MCFG_VIDEO_START(z1013) |
| 184 | 360 | MCFG_SCREEN_UPDATE(z1013) |
| 185 | | |
| 186 | 361 | MCFG_GFXDECODE(z1013) |
| 187 | 362 | MCFG_PALETTE_LENGTH(2) |
| 188 | 363 | MCFG_PALETTE_INIT(black_and_white) |
| 189 | 364 | |
| 190 | | MCFG_VIDEO_START(z1013) |
| 365 | /* sound hardware */ |
| 366 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 367 | MCFG_SOUND_WAVE_ADD(WAVE_TAG, CASSETTE_TAG) |
| 368 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 191 | 369 | |
| 370 | /* Devices */ |
| 192 | 371 | MCFG_Z80PIO_ADD( "z80pio", XTAL_1MHz, z1013_z80pio_intf ) |
| 193 | | |
| 194 | | /* snapshot */ |
| 372 | MCFG_CASSETTE_ADD( CASSETTE_TAG, z1013_cassette_interface ) |
| 195 | 373 | MCFG_SNAPSHOT_ADD("snapshot", z1013, "z80", 0) |
| 196 | 374 | MACHINE_CONFIG_END |
| 197 | 375 | |
| r12599 | r12600 | |
| 205 | 383 | ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF ) |
| 206 | 384 | ROM_SYSTEM_BIOS( 0, "202", "Original" ) |
| 207 | 385 | ROMX_LOAD( "mon_202.bin", 0xf000, 0x0800, CRC(5884edab) SHA1(c3a45ea5cc4da2b7c270068ba1e2d75916960709), ROM_BIOS(1)) |
| 386 | |
| 208 | 387 | ROM_SYSTEM_BIOS( 1, "jm", "Jens Muller version" ) |
| 209 | 388 | ROMX_LOAD( "mon_jm_1992.bin", 0xf000, 0x0800, CRC(186d2888) SHA1(b52ccb557c41c96bace7db4c4f5031a0cd736168), ROM_BIOS(2)) |
| 210 | | ROM_REGION(0x1000, "gfx1",0) |
| 389 | |
| 390 | ROM_REGION(0x1000, "chargen",0) |
| 211 | 391 | ROM_LOAD ("z1013font.bin", 0x0000, 0x0800, CRC(7023088f) SHA1(8b197a51c070efeba173d10be197bd41e764358c)) |
| 212 | 392 | ROM_LOAD ("altfont.bin", 0x0800, 0x0800, CRC(2dc96f9c) SHA1(d0b9b0751cc1e91be731547f6442c649b6dd6979)) |
| 213 | 393 | ROM_END |
| r12599 | r12600 | |
| 215 | 395 | ROM_START( z1013a2 ) |
| 216 | 396 | ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF ) |
| 217 | 397 | ROM_LOAD( "mon_a2.bin", 0xf000, 0x0800, CRC(98b19b10) SHA1(97e158f589198cb96aae1567ee0aa6e47824027e)) |
| 218 | | ROM_REGION(0x1000, "gfx1",0) |
| 398 | |
| 399 | ROM_REGION(0x1000, "chargen",0) |
| 219 | 400 | ROM_LOAD ("z1013font.bin", 0x0000, 0x0800, CRC(7023088f) SHA1(8b197a51c070efeba173d10be197bd41e764358c)) |
| 220 | 401 | ROM_LOAD ("altfont.bin", 0x0800, 0x0800, CRC(2dc96f9c) SHA1(d0b9b0751cc1e91be731547f6442c649b6dd6979)) |
| 221 | 402 | ROM_END |
| r12599 | r12600 | |
| 223 | 404 | ROM_START( z1013k76 ) |
| 224 | 405 | ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF ) |
| 225 | 406 | ROM_LOAD( "mon_rb_k7659.bin", 0xf000, 0x1000, CRC(b3d88c45) SHA1(0bcd20338cf0706b384f40901b7f8498c6f6c320)) |
| 226 | | ROM_REGION(0x1000, "gfx1",0) |
| 407 | |
| 408 | ROM_REGION(0x1000, "chargen",0) |
| 227 | 409 | ROM_LOAD ("z1013font.bin", 0x0000, 0x0800, CRC(7023088f) SHA1(8b197a51c070efeba173d10be197bd41e764358c)) |
| 228 | 410 | ROM_LOAD ("altfont.bin", 0x0800, 0x0800, CRC(2dc96f9c) SHA1(d0b9b0751cc1e91be731547f6442c649b6dd6979)) |
| 411 | |
| 229 | 412 | ROM_REGION(0x1000, "k7659",0) |
| 230 | 413 | ROM_LOAD ("k7659n.bin", 0x0000, 0x0800, CRC(7454bf0a) SHA1(b97e7df93778fa371b96b6f4fb1a5b1c8b89d7ba) ) |
| 231 | 414 | ROM_END |
| r12599 | r12600 | |
| 234 | 417 | ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF ) |
| 235 | 418 | ROM_SYSTEM_BIOS( 0, "v1", "Version 1" ) |
| 236 | 419 | ROMX_LOAD( "mon_rb_s6009.bin", 0xf000, 0x1000, CRC(b37faeed) SHA1(ce2e69af5378d39284e8b3be23da50416a0b0fbe), ROM_BIOS(1)) |
| 420 | |
| 237 | 421 | ROM_SYSTEM_BIOS( 1, "v2", "Version 2" ) |
| 238 | 422 | ROMX_LOAD( "4k-moni-k7652.bin", 0xf000, 0x1000, CRC(a1625fce) SHA1(f0847399502b38a73ad26b38ee2d85ba04ab85ec), ROM_BIOS(2)) |
| 239 | | ROM_REGION(0x1000, "gfx1",0) |
| 423 | |
| 424 | ROM_REGION(0x1000, "chargen",0) |
| 240 | 425 | ROM_LOAD ("z1013font.bin", 0x0000, 0x0800, CRC(7023088f) SHA1(8b197a51c070efeba173d10be197bd41e764358c)) |
| 241 | 426 | ROM_LOAD ("altfont.bin", 0x0800, 0x0800, CRC(2dc96f9c) SHA1(d0b9b0751cc1e91be731547f6442c649b6dd6979)) |
| 242 | 427 | ROM_END |
| r12599 | r12600 | |
| 244 | 429 | ROM_START( z1013k69 ) |
| 245 | 430 | ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF ) |
| 246 | 431 | ROM_LOAD( "4k-moni-k7669.bin", 0xf000, 0x1000, CRC(09cd2a7a) SHA1(0b8500320d464469868a6b48db31105f34710c41)) |
| 247 | | ROM_REGION(0x1000, "gfx1",0) |
| 432 | |
| 433 | ROM_REGION(0x1000, "chargen",0) |
| 248 | 434 | ROM_LOAD ("z1013font.bin", 0x0000, 0x0800, CRC(7023088f) SHA1(8b197a51c070efeba173d10be197bd41e764358c)) |
| 249 | 435 | ROM_LOAD ("altfont.bin", 0x0800, 0x0800, CRC(2dc96f9c) SHA1(d0b9b0751cc1e91be731547f6442c649b6dd6979)) |
| 250 | 436 | ROM_END |
| 251 | 437 | /* Driver */ |
| 252 | 438 | |
| 253 | | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS */ |
| 254 | | COMP( 1985, z1013, 0, 0, z1013, z1013_8x4, z1013, "VEB Robotron Electronics Riesa", "Z1013 (matrix 8x4)", GAME_NO_SOUND) |
| 255 | | COMP( 1985, z1013a2, z1013, 0, z1013, z1013_8x8, z1013, "VEB Robotron Electronics Riesa", "Z1013 (matrix 8x8)", GAME_NO_SOUND) |
| 256 | | COMP( 1985, z1013k76, z1013, 0, z1013k76, k7659, z1013, "VEB Robotron Electronics Riesa", "Z1013 (K7659)", GAME_NOT_WORKING | GAME_NO_SOUND) |
| 257 | | COMP( 1985, z1013s60, z1013, 0, z1013k76, z1013_8x8, z1013, "VEB Robotron Electronics Riesa", "Z1013 (K7652/S6009)", GAME_NOT_WORKING | GAME_NO_SOUND) |
| 258 | | COMP( 1985, z1013k69, z1013, 0, z1013k76, k7659, z1013, "VEB Robotron Electronics Riesa", "Z1013 (K7669)", GAME_NOT_WORKING | GAME_NO_SOUND) |
| 439 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS */ |
| 440 | COMP( 1985, z1013, 0, 0, z1013, z1013_8x4, 0, "VEB Robotron Electronics Riesa", "Z1013 (matrix 8x4)", 0 ) |
| 441 | COMP( 1985, z1013a2, z1013, 0, z1013, z1013_8x8, 0, "VEB Robotron Electronics Riesa", "Z1013 (matrix 8x8)", 0 ) |
| 442 | COMP( 1985, z1013k76, z1013, 0, z1013k76, k7659, 0, "VEB Robotron Electronics Riesa", "Z1013 (K7659)", GAME_NOT_WORKING | GAME_NO_SOUND_HW) |
| 443 | COMP( 1985, z1013s60, z1013, 0, z1013k76, z1013_8x8, 0, "VEB Robotron Electronics Riesa", "Z1013 (K7652/S6009)", GAME_NOT_WORKING | GAME_NO_SOUND_HW) |
| 444 | COMP( 1985, z1013k69, z1013, 0, z1013k76, k7659, 0, "VEB Robotron Electronics Riesa", "Z1013 (K7669)", GAME_NOT_WORKING | GAME_NO_SOUND_HW) |