trunk/src/mess/drivers/tutor.c
| r242555 | r242556 | |
| 187 | 187 | m_cass(*this, "cassette"), |
| 188 | 188 | m_centronics(*this, "centronics"), |
| 189 | 189 | m_cent_data_out(*this, "cent_data_out"), |
| 190 | | m_bank1(*this, "bank1") |
| 190 | m_bank1(*this, "bank1"), |
| 191 | m_bank2(*this, "bank2"), |
| 192 | m_bank1_switching(0) |
| 191 | 193 | { |
| 192 | 194 | } |
| 193 | 195 | |
| r242555 | r242556 | |
| 197 | 199 | optional_device<centronics_device> m_centronics; |
| 198 | 200 | optional_device<output_latch_device> m_cent_data_out; |
| 199 | 201 | required_memory_bank m_bank1; |
| 202 | required_memory_bank m_bank2; |
| 200 | 203 | memory_region *m_cart_rom; |
| 201 | 204 | |
| 205 | int m_bank1_switching; |
| 202 | 206 | DECLARE_READ8_MEMBER(key_r); |
| 203 | 207 | DECLARE_READ8_MEMBER(tutor_mapper_r); |
| 204 | 208 | DECLARE_WRITE8_MEMBER(tutor_mapper_w); |
| r242555 | r242556 | |
| 226 | 230 | |
| 227 | 231 | m_tape_interrupt_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(tutor_state::tape_interrupt_handler),this)); |
| 228 | 232 | |
| 229 | | m_bank1->configure_entry(0, memregion("maincpu")->base() + 0x8000); |
| 233 | m_bank1->configure_entry(0, memregion("maincpu")->base() + 0x4000); |
| 230 | 234 | m_bank1->set_entry(0); |
| 235 | m_bank2->configure_entry(0, memregion("maincpu")->base() + 0x8000); |
| 236 | m_bank2->set_entry(0); |
| 231 | 237 | |
| 232 | 238 | if (m_cart_rom) |
| 233 | 239 | { |
| 234 | | m_bank1->configure_entry(1, m_cart_rom->base()); |
| 235 | | m_bank1->set_entry(1); |
| 240 | if (m_cart_rom->bytes() > 0x4000) |
| 241 | { |
| 242 | m_bank1_switching = 1; |
| 243 | m_bank1->configure_entry(1, m_cart_rom->base()); |
| 244 | m_bank1->set_entry(1); |
| 245 | m_bank2->configure_entry(1, m_cart_rom->base() + 0x4000); |
| 246 | m_bank2->set_entry(1); |
| 247 | } |
| 248 | else |
| 249 | { |
| 250 | m_bank2->configure_entry(1, m_cart_rom->base()); |
| 251 | m_bank2->set_entry(1); |
| 252 | } |
| 236 | 253 | } |
| 237 | 254 | } |
| 238 | 255 | |
| r242555 | r242556 | |
| 323 | 340 | case 0x08: |
| 324 | 341 | /* disable cartridge ROM, enable BASIC ROM at base >8000 */ |
| 325 | 342 | m_bank1->set_entry(0); |
| 343 | m_bank2->set_entry(0); |
| 326 | 344 | break; |
| 327 | 345 | |
| 328 | 346 | case 0x0c: |
| 329 | 347 | /* enable cartridge ROM, disable BASIC ROM at base >8000 */ |
| 330 | 348 | if (m_cart_rom) |
| 331 | | m_bank1->set_entry(1); |
| 349 | { |
| 350 | if (m_bank1_switching) |
| 351 | m_bank1->set_entry(1); |
| 352 | m_bank2->set_entry(1); |
| 353 | } |
| 332 | 354 | break; |
| 333 | 355 | |
| 334 | 356 | default: |
| r242555 | r242556 | |
| 516 | 538 | #endif |
| 517 | 539 | |
| 518 | 540 | static ADDRESS_MAP_START(tutor_memmap, AS_PROGRAM, 8, tutor_state) |
| 519 | | AM_RANGE(0x0000, 0x7fff) AM_ROM /*system ROM*/ |
| 520 | | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1") AM_WRITENOP /*BASIC ROM & cartridge ROM*/ |
| 541 | AM_RANGE(0x0000, 0x3fff) AM_ROM |
| 542 | AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank1") AM_WRITENOP |
| 543 | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank2") AM_WRITENOP |
| 521 | 544 | AM_RANGE(0xc000, 0xdfff) AM_NOP /*free for expansion, or cartridge ROM?*/ |
| 522 | 545 | |
| 523 | 546 | AM_RANGE(0xe000, 0xe000) AM_DEVREADWRITE("tms9928a", tms9928a_device, vram_read, vram_write) /*VDP data*/ |
| r242555 | r242556 | |
| 531 | 554 | ADDRESS_MAP_END |
| 532 | 555 | |
| 533 | 556 | static ADDRESS_MAP_START(pyuutajr_mem, AS_PROGRAM, 8, tutor_state) |
| 534 | | AM_RANGE(0x0000, 0x7fff) AM_ROM /*system ROM*/ |
| 535 | | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1") AM_WRITENOP /*BASIC ROM & cartridge ROM*/ |
| 557 | AM_RANGE(0x0000, 0x3fff) AM_ROM |
| 558 | AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank1") AM_WRITENOP |
| 559 | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank2") AM_WRITENOP |
| 536 | 560 | AM_RANGE(0xc000, 0xdfff) AM_NOP /*free for expansion, or cartridge ROM?*/ |
| 561 | |
| 537 | 562 | AM_RANGE(0xe000, 0xe000) AM_DEVREADWRITE("tms9928a", tms9928a_device, vram_read, vram_write) /*VDP data*/ |
| 538 | 563 | AM_RANGE(0xe002, 0xe002) AM_DEVREADWRITE("tms9928a", tms9928a_device, register_read, register_write)/*VDP status*/ |
| 539 | 564 | AM_RANGE(0xe100, 0xe1ff) AM_READWRITE(tutor_mapper_r, tutor_mapper_w) /*cartridge mapper*/ |
| r242555 | r242556 | |
| 542 | 567 | AM_RANGE(0xea00, 0xea00) AM_READ_PORT("LINE1") |
| 543 | 568 | AM_RANGE(0xec00, 0xec00) AM_READ_PORT("LINE2") |
| 544 | 569 | AM_RANGE(0xee00, 0xee00) AM_READ_PORT("LINE3") |
| 570 | |
| 545 | 571 | AM_RANGE(0xf000, 0xffff) AM_READ(tutor_highmem_r) AM_WRITENOP /*free for expansion (and internal processor RAM)*/ |
| 546 | 572 | ADDRESS_MAP_END |
| 547 | 573 | |