src/mess/drivers/px8.c
| r11078 | r11079 | |
| 27 | 27 | |
| 28 | 28 | */ |
| 29 | 29 | |
| 30 | | #include "emu.h" |
| 31 | 30 | #include "includes/px8.h" |
| 32 | | #include "cpu/z80/z80.h" |
| 33 | | #include "cpu/m6800/m6800.h" |
| 34 | | #include "imagedev/cartslot.h" |
| 35 | | #include "imagedev/cassette.h" |
| 36 | | #include "machine/ram.h" |
| 37 | | #include "machine/msm8251.h" |
| 38 | | #include "machine/pf10.h" |
| 39 | | #include "sound/wave.h" |
| 40 | | #include "video/sed1330.h" |
| 41 | 31 | #include "px8.lh" |
| 42 | 32 | |
| 43 | 33 | /*************************************************************************** |
| r11078 | r11079 | |
| 83 | 73 | bankswitch - memory bankswitching |
| 84 | 74 | -------------------------------------------------*/ |
| 85 | 75 | |
| 86 | | static void bankswitch(running_machine &machine) |
| 76 | void px8_state::bankswitch() |
| 87 | 77 | { |
| 88 | | px8_state *state = machine.driver_data<px8_state>(); |
| 89 | | address_space *program = machine.device(UPD70008_TAG)->memory().space(AS_PROGRAM); |
| 90 | | UINT8 *ram = ram_get_ptr(machine.device(RAM_TAG)); |
| 91 | | UINT8 *ipl_rom = machine.region(UPD70008_TAG)->base(); |
| 78 | address_space *program = m_maincpu->memory().space(AS_PROGRAM); |
| 79 | UINT8 *ram = ram_get_ptr(m_ram); |
| 80 | UINT8 *ipl_rom = m_machine.region(UPD70008_TAG)->base(); |
| 92 | 81 | |
| 93 | | if (!state->m_bank0) |
| 82 | if (!m_bank0) |
| 94 | 83 | { |
| 95 | 84 | /* IPL ROM */ |
| 96 | 85 | program->install_rom(0x0000, 0x7fff, ipl_rom); |
| 97 | 86 | } |
| 98 | 87 | else |
| 99 | 88 | { |
| 100 | | if (state->m_bk2) |
| 89 | if (m_bk2) |
| 101 | 90 | { |
| 102 | 91 | /* D-RAM (L) */ |
| 103 | 92 | program->install_ram(0x0000, 0x7fff, ram); |
| r11078 | r11079 | |
| 109 | 98 | } |
| 110 | 99 | } |
| 111 | 100 | |
| 112 | | if (state->m_bk2) |
| 101 | if (m_bk2) |
| 113 | 102 | { |
| 114 | 103 | /* D-RAM (H) */ |
| 115 | 104 | program->install_ram(0x8000, 0xffff, ram + 0x8000); |
| r11078 | r11079 | |
| 125 | 114 | gah40m_r - GAH40M read |
| 126 | 115 | -------------------------------------------------*/ |
| 127 | 116 | |
| 128 | | static READ8_HANDLER( gah40m_r ) |
| 117 | READ8_MEMBER( px8_state::gah40m_r ) |
| 129 | 118 | { |
| 130 | 119 | switch (offset) |
| 131 | 120 | { |
| r11078 | r11079 | |
| 273 | 262 | gah40m_w - GAH40M write |
| 274 | 263 | -------------------------------------------------*/ |
| 275 | 264 | |
| 276 | | static WRITE8_HANDLER( gah40m_w ) |
| 265 | WRITE8_MEMBER( px8_state::gah40m_w ) |
| 277 | 266 | { |
| 278 | | px8_state *state = space->machine().driver_data<px8_state>(); |
| 279 | | |
| 280 | 267 | switch (offset) |
| 281 | 268 | { |
| 282 | 269 | case GAH40M_CTLR1: |
| r11078 | r11079 | |
| 295 | 282 | |
| 296 | 283 | */ |
| 297 | 284 | |
| 298 | | state->m_bank0 = BIT(data, 0); |
| 299 | | bankswitch(space->machine()); |
| 285 | m_bank0 = BIT(data, 0); |
| 286 | bankswitch(); |
| 300 | 287 | break; |
| 301 | 288 | |
| 302 | 289 | case GAH40M_CMDR: |
| r11078 | r11079 | |
| 353 | 340 | |
| 354 | 341 | */ |
| 355 | 342 | |
| 356 | | state->m_ier = data; |
| 343 | m_ier = data; |
| 357 | 344 | break; |
| 358 | 345 | |
| 359 | 346 | case GAH40M_SIOR: |
| r11078 | r11079 | |
| 372 | 359 | |
| 373 | 360 | */ |
| 374 | 361 | |
| 375 | | state->m_sio = data; |
| 362 | m_sio = data; |
| 376 | 363 | break; |
| 377 | 364 | } |
| 378 | 365 | } |
| r11078 | r11079 | |
| 381 | 368 | gah40s_r - GAH40S read |
| 382 | 369 | -------------------------------------------------*/ |
| 383 | 370 | |
| 384 | | static READ8_HANDLER( gah40s_r ) |
| 371 | READ8_MEMBER( px8_state::gah40s_r ) |
| 385 | 372 | { |
| 386 | | px8_state *state = space->machine().driver_data<px8_state>(); |
| 387 | 373 | UINT8 data = 0xff; |
| 388 | 374 | |
| 389 | 375 | switch (offset) |
| 390 | 376 | { |
| 391 | 377 | case 0: /* counter (upper byte) input */ |
| 392 | | data = (state->m_cnt >> 8) & 0x1f; |
| 378 | data = (m_cnt >> 8) & 0x1f; |
| 393 | 379 | break; |
| 394 | 380 | |
| 395 | 381 | case 1: /* counter (lower byte) */ |
| 396 | | data = state->m_cnt & 0xff; |
| 382 | data = m_cnt & 0xff; |
| 397 | 383 | break; |
| 398 | 384 | |
| 399 | 385 | case 3: /* P-ROM read data */ |
| 400 | | data = state->m_prd; |
| 386 | data = m_prd; |
| 401 | 387 | break; |
| 402 | 388 | } |
| 403 | 389 | |
| r11078 | r11079 | |
| 408 | 394 | gah40s_w - GAH40S write |
| 409 | 395 | -------------------------------------------------*/ |
| 410 | 396 | |
| 411 | | static WRITE8_HANDLER( gah40s_w ) |
| 397 | WRITE8_MEMBER( px8_state::gah40s_w ) |
| 412 | 398 | { |
| 413 | | px8_state *state = space->machine().driver_data<px8_state>(); |
| 414 | | |
| 415 | 399 | switch (offset) |
| 416 | 400 | { |
| 417 | 401 | case 0: /* counter reset */ |
| 418 | | state->m_cnt = 0; |
| 402 | m_cnt = 0; |
| 419 | 403 | break; |
| 420 | 404 | |
| 421 | 405 | case 1: /* command register */ |
| r11078 | r11079 | |
| 434 | 418 | |
| 435 | 419 | */ |
| 436 | 420 | |
| 437 | | state->m_swpr = BIT(data, 0); |
| 421 | m_swpr = BIT(data, 0); |
| 438 | 422 | break; |
| 439 | 423 | |
| 440 | 424 | case 2: /* P-ROM address (upper 8 byte) */ |
| 441 | | state->m_pra = (data << 8) | (state->m_pra & 0xff); |
| 442 | | state->m_prd = 0; // TODO read prom! |
| 425 | m_pra = (data << 8) | (m_pra & 0xff); |
| 426 | m_prd = 0; // TODO read prom! |
| 443 | 427 | break; |
| 444 | 428 | |
| 445 | 429 | case 3: /* P-ROM address (lower 8 byte) */ |
| 446 | | state->m_pra = (state->m_pra & 0xff00) | data; |
| 447 | | state->m_prd = 0; // TODO read prom! |
| 430 | m_pra = (m_pra & 0xff00) | data; |
| 431 | m_prd = 0; // TODO read prom! |
| 448 | 432 | break; |
| 449 | 433 | } |
| 450 | 434 | } |
| r11078 | r11079 | |
| 453 | 437 | gah40s_ier_w - interrupt enable register write |
| 454 | 438 | -------------------------------------------------*/ |
| 455 | 439 | |
| 456 | | static WRITE8_HANDLER( gah40s_ier_w ) |
| 440 | WRITE8_MEMBER( px8_state::gah40s_ier_w ) |
| 457 | 441 | { |
| 458 | | px8_state *state = space->machine().driver_data<px8_state>(); |
| 442 | m_ier = data; |
| 443 | } |
| 459 | 444 | |
| 460 | | state->m_ier = data; |
| 445 | /*------------------------------------------------- |
| 446 | krtn_read - read keyboard return |
| 447 | -------------------------------------------------*/ |
| 448 | |
| 449 | UINT8 px8_state::krtn_read() |
| 450 | { |
| 451 | UINT8 data = 0xff; |
| 452 | |
| 453 | switch (m_ksc) |
| 454 | { |
| 455 | case 0: data = input_port_read(m_machine, "KSC0"); break; |
| 456 | case 1: data = input_port_read(m_machine, "KSC1"); break; |
| 457 | case 2: data = input_port_read(m_machine, "KSC2"); break; |
| 458 | case 3: data = input_port_read(m_machine, "KSC3"); break; |
| 459 | case 4: data = input_port_read(m_machine, "KSC4"); break; |
| 460 | case 5: data = input_port_read(m_machine, "KSC5"); break; |
| 461 | case 6: data = input_port_read(m_machine, "KSC6"); break; |
| 462 | case 7: data = input_port_read(m_machine, "KSC7"); break; |
| 463 | case 8: data = input_port_read(m_machine, "KSC8"); break; |
| 464 | case 9: data = input_port_read(m_machine, "SW4"); break; |
| 465 | } |
| 466 | |
| 467 | return data; |
| 461 | 468 | } |
| 462 | 469 | |
| 463 | | ///*------------------------------------------------- |
| 464 | | // krtn_read - read keyboard return |
| 465 | | //-------------------------------------------------*/ |
| 466 | | // |
| 467 | | //static UINT8 krtn_read(running_machine &machine) |
| 468 | | //{ |
| 469 | | // px8_state *state = machine.driver_data<px8_state>(); |
| 470 | | // UINT8 data = 0xff; |
| 471 | | // |
| 472 | | // switch (state->m_ksc) |
| 473 | | // { |
| 474 | | // case 0: data = input_port_read(machine, "KSC0"); break; |
| 475 | | // case 1: data = input_port_read(machine, "KSC1"); break; |
| 476 | | // case 2: data = input_port_read(machine, "KSC2"); break; |
| 477 | | // case 3: data = input_port_read(machine, "KSC3"); break; |
| 478 | | // case 4: data = input_port_read(machine, "KSC4"); break; |
| 479 | | // case 5: data = input_port_read(machine, "KSC5"); break; |
| 480 | | // case 6: data = input_port_read(machine, "KSC6"); break; |
| 481 | | // case 7: data = input_port_read(machine, "KSC7"); break; |
| 482 | | // case 8: data = input_port_read(machine, "KSC8"); break; |
| 483 | | // case 9: data = input_port_read(machine, "SW4"); break; |
| 484 | | // } |
| 485 | | // |
| 486 | | // return data; |
| 487 | | //} |
| 488 | | // |
| 489 | | ///*------------------------------------------------- |
| 490 | | // krtn_0_3_r - keyboard return 0..3 read |
| 491 | | //-------------------------------------------------*/ |
| 492 | | // |
| 493 | | //static READ8_HANDLER( krtn_0_3_r ) |
| 494 | | //{ |
| 495 | | // return krtn_read(space->machine()) & 0x0f; |
| 496 | | //} |
| 497 | | // |
| 498 | | ///*------------------------------------------------- |
| 499 | | // krtn_4_7_r - keyboard return 4..7 read |
| 500 | | //-------------------------------------------------*/ |
| 501 | | // |
| 502 | | //static READ8_HANDLER( krtn_4_7_r ) |
| 503 | | //{ |
| 504 | | // return krtn_read(space->machine()) >> 4; |
| 505 | | //} |
| 506 | | // |
| 507 | | ///*------------------------------------------------- |
| 508 | | // ksc_w - keyboard scan write |
| 509 | | //-------------------------------------------------*/ |
| 510 | | // |
| 511 | | //static WRITE8_HANDLER( ksc_w ) |
| 512 | | //{ |
| 513 | | // px8_state *state = space->machine().driver_data<px8_state>(); |
| 514 | | // |
| 515 | | // state->m_ksc = data; |
| 516 | | //} |
| 470 | /*------------------------------------------------- |
| 471 | krtn_0_3_r - keyboard return 0..3 read |
| 472 | -------------------------------------------------*/ |
| 517 | 473 | |
| 474 | READ8_MEMBER( px8_state::krtn_0_3_r ) |
| 475 | { |
| 476 | return krtn_read() & 0x0f; |
| 477 | } |
| 478 | |
| 479 | /*------------------------------------------------- |
| 480 | krtn_4_7_r - keyboard return 4..7 read |
| 481 | -------------------------------------------------*/ |
| 482 | |
| 483 | READ8_MEMBER( px8_state::krtn_4_7_r ) |
| 484 | { |
| 485 | return krtn_read() >> 4; |
| 486 | } |
| 487 | |
| 488 | /*------------------------------------------------- |
| 489 | ksc_w - keyboard scan write |
| 490 | -------------------------------------------------*/ |
| 491 | |
| 492 | WRITE8_MEMBER( px8_state::ksc_w ) |
| 493 | { |
| 494 | m_ksc = data; |
| 495 | } |
| 496 | |
| 518 | 497 | /*************************************************************************** |
| 519 | 498 | MEMORY MAPS |
| 520 | 499 | ***************************************************************************/ |
| r11078 | r11079 | |
| 523 | 502 | ADDRESS_MAP( px8_mem ) |
| 524 | 503 | -------------------------------------------------*/ |
| 525 | 504 | |
| 526 | | static ADDRESS_MAP_START( px8_mem, AS_PROGRAM, 8 ) |
| 505 | static ADDRESS_MAP_START( px8_mem, AS_PROGRAM, 8, px8_state ) |
| 527 | 506 | ADDRESS_MAP_UNMAP_HIGH |
| 528 | 507 | AM_RANGE(0x0000, 0x7fff) AM_RAMBANK("bank0") |
| 529 | 508 | AM_RANGE(0x8000, 0xffff) AM_RAMBANK("bank1") |
| r11078 | r11079 | |
| 533 | 512 | ADDRESS_MAP( px8_io ) |
| 534 | 513 | -------------------------------------------------*/ |
| 535 | 514 | |
| 536 | | static ADDRESS_MAP_START( px8_io, AS_IO, 8 ) |
| 515 | static ADDRESS_MAP_START( px8_io, AS_IO, 8, px8_state ) |
| 537 | 516 | ADDRESS_MAP_UNMAP_HIGH |
| 538 | 517 | ADDRESS_MAP_GLOBAL_MASK(0x0f) |
| 539 | 518 | AM_RANGE(0x00, 0x07) AM_READWRITE(gah40m_r, gah40m_w) |
| 540 | | AM_RANGE(0x0c, 0x0c) AM_DEVREADWRITE(I8251_TAG, msm8251_data_r, msm8251_data_w) |
| 541 | | AM_RANGE(0x0d, 0x0d) AM_DEVREADWRITE(I8251_TAG, msm8251_status_r, msm8251_control_w) |
| 542 | | AM_RANGE(0x0e, 0x0e) AM_DEVREADWRITE(SED1320_TAG, sed1330_status_r, sed1330_data_w) |
| 543 | | AM_RANGE(0x0f, 0x0f) AM_DEVREADWRITE(SED1320_TAG, sed1330_data_r, sed1330_command_w) |
| 519 | AM_RANGE(0x0c, 0x0c) AM_DEVREADWRITE_LEGACY(I8251_TAG, msm8251_data_r, msm8251_data_w) |
| 520 | AM_RANGE(0x0d, 0x0d) AM_DEVREADWRITE_LEGACY(I8251_TAG, msm8251_status_r, msm8251_control_w) |
| 521 | // AM_RANGE(0x0e, 0x0e) AM_DEVREADWRITE_LEGACY(SED1320_TAG, sed1330_status_r, sed1330_data_w) |
| 522 | // AM_RANGE(0x0f, 0x0f) AM_DEVREADWRITE_LEGACY(SED1320_TAG, sed1330_data_r, sed1330_command_w) |
| 544 | 523 | ADDRESS_MAP_END |
| 545 | 524 | |
| 546 | 525 | /*------------------------------------------------- |
| 547 | 526 | ADDRESS_MAP( px8_slave_mem ) |
| 548 | 527 | -------------------------------------------------*/ |
| 549 | 528 | |
| 550 | | static ADDRESS_MAP_START( px8_slave_mem, AS_PROGRAM, 8 ) |
| 529 | static ADDRESS_MAP_START( px8_slave_mem, AS_PROGRAM, 8, px8_state ) |
| 551 | 530 | ADDRESS_MAP_UNMAP_HIGH |
| 552 | 531 | AM_RANGE(0x0020, 0x0023) AM_READWRITE(gah40s_r, gah40s_w) |
| 553 | | // AM_RANGE(0x0024, 0x0027) AM_DEVREADWRITE(SED1320_TAG, ) |
| 532 | // AM_RANGE(0x0024, 0x0027) AM_DEVREADWRITE_LEGACY(SED1320_TAG, ) |
| 554 | 533 | AM_RANGE(0x0028, 0x0028) AM_WRITE(gah40s_ier_w) |
| 555 | | AM_RANGE(0x8000, 0x97ff) AM_RAM AM_BASE_MEMBER(px8_state, m_video_ram) |
| 534 | AM_RANGE(0x8000, 0x97ff) AM_RAM AM_BASE(m_video_ram) |
| 556 | 535 | AM_RANGE(0x9800, 0xefff) AM_NOP |
| 557 | 536 | AM_RANGE(0xf000, 0xffff) AM_ROM AM_REGION(HD6303_TAG, 0) /* internal mask rom */ |
| 558 | 537 | ADDRESS_MAP_END |
| r11078 | r11079 | |
| 561 | 540 | ADDRESS_MAP( px8_slave_io ) |
| 562 | 541 | -------------------------------------------------*/ |
| 563 | 542 | |
| 564 | | static ADDRESS_MAP_START( px8_slave_io, AS_IO, 8 ) |
| 543 | static ADDRESS_MAP_START( px8_slave_io, AS_IO, 8, px8_state ) |
| 565 | 544 | ADDRESS_MAP_UNMAP_HIGH |
| 566 | | // AM_RANGE(M6801_PORT1, M6801_PORT1) |
| 567 | | // AM_RANGE(M6801_PORT2, M6801_PORT2) |
| 568 | | // AM_RANGE(M6801_PORT3, M6801_PORT3) |
| 569 | | // AM_RANGE(M6801_PORT4, M6801_PORT4) |
| 545 | AM_RANGE(M6801_PORT1, M6801_PORT1) |
| 546 | AM_RANGE(M6801_PORT2, M6801_PORT2) |
| 547 | AM_RANGE(M6801_PORT3, M6801_PORT3) |
| 548 | AM_RANGE(M6801_PORT4, M6801_PORT4) |
| 570 | 549 | ADDRESS_MAP_END |
| 571 | 550 | |
| 572 | 551 | /*------------------------------------------------- |
| 573 | 552 | ADDRESS_MAP( px8_sub_io ) |
| 574 | 553 | -------------------------------------------------*/ |
| 575 | | |
| 576 | | //static ADDRESS_MAP_START( px8_sub_io, AS_IO, 8 ) |
| 577 | | //// AM_RANGE(0x00, 0x00) AM_READWRITE() |
| 578 | | // AM_RANGE(0x01, 0x01) AM_READ(krtn_0_3_r) |
| 579 | | //// AM_RANGE(0x02, 0x02) AM_WRITE() |
| 580 | | // AM_RANGE(0x03, 0x03) AM_WRITE(ksc_w) |
| 581 | | //// AM_RANGE(0x04, 0x04) AM_WRITE() |
| 582 | | // AM_RANGE(0x05, 0x05) AM_READ(krtn_4_7_r) |
| 583 | | //// AM_RANGE(0x06, 0x06) AM_READ() |
| 584 | | //// AM_RANGE(0x07, 0x07) AM_WRITE() |
| 585 | | //ADDRESS_MAP_END |
| 586 | | |
| 554 | #ifdef UNUSED_CODE |
| 555 | static ADDRESS_MAP_START( px8_sub_io, AS_IO, 8, px8_state ) |
| 556 | // AM_RANGE(0x00, 0x00) AM_READWRITE() |
| 557 | AM_RANGE(0x01, 0x01) AM_READ(krtn_0_3_r) |
| 558 | // AM_RANGE(0x02, 0x02) AM_WRITE() |
| 559 | AM_RANGE(0x03, 0x03) AM_WRITE(ksc_w) |
| 560 | // AM_RANGE(0x04, 0x04) AM_WRITE() |
| 561 | AM_RANGE(0x05, 0x05) AM_READ(krtn_4_7_r) |
| 562 | // AM_RANGE(0x06, 0x06) AM_READ() |
| 563 | // AM_RANGE(0x07, 0x07) AM_WRITE() |
| 564 | ADDRESS_MAP_END |
| 565 | #endif |
| 587 | 566 | /*************************************************************************** |
| 588 | 567 | INPUT PORTS |
| 589 | 568 | ***************************************************************************/ |
| r11078 | r11079 | |
| 704 | 683 | ***************************************************************************/ |
| 705 | 684 | |
| 706 | 685 | /*------------------------------------------------- |
| 707 | | SED1330_INTERFACE( sed1320_intf ) |
| 708 | | -------------------------------------------------*/ |
| 709 | | |
| 710 | | static READ8_DEVICE_HANDLER( vd_r ) |
| 711 | | { |
| 712 | | px8_state *state = device->machine().driver_data<px8_state>(); |
| 713 | | |
| 714 | | return state->m_video_ram[offset & PX8_VIDEORAM_MASK]; |
| 715 | | } |
| 716 | | |
| 717 | | static WRITE8_DEVICE_HANDLER( vd_w ) |
| 718 | | { |
| 719 | | px8_state *state = device->machine().driver_data<px8_state>(); |
| 720 | | |
| 721 | | state->m_video_ram[offset & PX8_VIDEORAM_MASK] = data; |
| 722 | | } |
| 723 | | |
| 724 | | static SED1330_INTERFACE( sed1320_intf ) |
| 725 | | { |
| 726 | | SCREEN_TAG, |
| 727 | | DEVCB_HANDLER(vd_r), |
| 728 | | DEVCB_HANDLER(vd_w) |
| 729 | | }; |
| 730 | | |
| 731 | | /*------------------------------------------------- |
| 732 | 686 | PALETTE_INIT( px8 ) |
| 733 | 687 | -------------------------------------------------*/ |
| 734 | 688 | |
| r11078 | r11079 | |
| 739 | 693 | } |
| 740 | 694 | |
| 741 | 695 | /*------------------------------------------------- |
| 742 | | VIDEO_START( px8 ) |
| 743 | | -------------------------------------------------*/ |
| 744 | | |
| 745 | | static VIDEO_START( px8 ) |
| 746 | | { |
| 747 | | } |
| 748 | | |
| 749 | | /*------------------------------------------------- |
| 750 | 696 | SCREEN_UPDATE( px8 ) |
| 751 | 697 | -------------------------------------------------*/ |
| 752 | 698 | |
| 753 | | static SCREEN_UPDATE( px8 ) |
| 699 | bool px8_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect) |
| 754 | 700 | { |
| 755 | | px8_state *state = screen->machine().driver_data<px8_state>(); |
| 756 | | |
| 757 | | sed1330_update(state->m_sed1320, bitmap, cliprect); |
| 758 | | |
| 759 | 701 | return 0; |
| 760 | 702 | } |
| 761 | 703 | |
| r11078 | r11079 | |
| 825 | 767 | MACHINE_START( px8 ) |
| 826 | 768 | -------------------------------------------------*/ |
| 827 | 769 | |
| 828 | | static MACHINE_START( px8 ) |
| 770 | void px8_state::machine_start() |
| 829 | 771 | { |
| 830 | | px8_state *state = machine.driver_data<px8_state>(); |
| 831 | | |
| 832 | | /* find devices */ |
| 833 | | state->m_sed1320 = machine.device(SED1320_TAG); |
| 834 | | state->m_cassette = machine.device(CASSETTE_TAG); |
| 835 | | |
| 836 | 772 | /* register for state saving */ |
| 837 | | state->save_item(NAME(state->m_ier)); |
| 838 | | state->save_item(NAME(state->m_isr)); |
| 839 | | state->save_item(NAME(state->m_bank0)); |
| 840 | | state->save_item(NAME(state->m_bk2)); |
| 841 | | state->save_item(NAME(state->m_sio)); |
| 842 | | state->save_item(NAME(state->m_ksc)); |
| 773 | save_item(NAME(m_ier)); |
| 774 | save_item(NAME(m_isr)); |
| 775 | save_item(NAME(m_bank0)); |
| 776 | save_item(NAME(m_bk2)); |
| 777 | save_item(NAME(m_sio)); |
| 778 | save_item(NAME(m_ksc)); |
| 843 | 779 | } |
| 844 | 780 | |
| 845 | | static MACHINE_RESET( px8 ) |
| 781 | void px8_state::machine_reset() |
| 846 | 782 | { |
| 847 | | px8_state *state = machine.driver_data<px8_state>(); |
| 783 | m_bank0 = 0; |
| 784 | m_bk2 = 1; |
| 848 | 785 | |
| 849 | | state->m_bank0 = 0; |
| 850 | | state->m_bk2 = 1; |
| 851 | | |
| 852 | | bankswitch(machine); |
| 786 | bankswitch(); |
| 853 | 787 | } |
| 854 | 788 | |
| 855 | 789 | /*************************************************************************** |
| r11078 | r11079 | |
| 857 | 791 | ***************************************************************************/ |
| 858 | 792 | |
| 859 | 793 | static MACHINE_CONFIG_START( px8, px8_state ) |
| 860 | | |
| 861 | 794 | /* main cpu (uPD70008) */ |
| 862 | 795 | MCFG_CPU_ADD(UPD70008_TAG, Z80, XTAL_CR1 / 4) /* 2.45 MHz */ |
| 863 | 796 | MCFG_CPU_PROGRAM_MAP(px8_mem) |
| r11078 | r11079 | |
| 874 | 807 | // MCFG_CPU_IO_MAP(px8_sub_io) |
| 875 | 808 | // MCFG_DEVICE_DISABLE() |
| 876 | 809 | |
| 877 | | MCFG_MACHINE_START(px8) |
| 878 | | MCFG_MACHINE_RESET(px8) |
| 879 | | |
| 880 | 810 | /* video hardware */ |
| 881 | 811 | MCFG_DEFAULT_LAYOUT(layout_px8) |
| 882 | 812 | |
| r11078 | r11079 | |
| 885 | 815 | MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 886 | 816 | MCFG_SCREEN_SIZE(480, 64) |
| 887 | 817 | MCFG_SCREEN_VISIBLE_AREA(0, 479, 0, 63) |
| 888 | | MCFG_SCREEN_UPDATE(px8) |
| 889 | 818 | |
| 890 | 819 | MCFG_GFXDECODE(px8) |
| 891 | 820 | MCFG_PALETTE_LENGTH(2) |
| 892 | 821 | MCFG_PALETTE_INIT(px8) |
| 893 | | MCFG_VIDEO_START(px8) |
| 894 | | MCFG_SED1330_ADD(SED1320_TAG, 0, sed1320_intf) |
| 895 | 822 | |
| 896 | 823 | /* sound hardware */ |
| 897 | 824 | MCFG_SPEAKER_STANDARD_MONO("mono") |