src/mess/drivers/super80.c
| r3623 | r3624 | |
| 10 | 10 | #include "sound/speaker.h" |
| 11 | 11 | #include "machine/centroni.h" |
| 12 | 12 | #include "devices/printer.h" |
| 13 | #include "deprecat.h" |
| 13 | 14 | |
| 14 | 15 | static UINT8 super80_mhz=2; /* state of bit 2 of port F0 */ |
| 15 | 16 | static UINT16 vidpg=0xfe00; /* Home position of video page being displayed */ |
| r3623 | r3624 | |
| 152 | 153 | pcgram[0x800+offset] = data; |
| 153 | 154 | |
| 154 | 155 | /* decode character graphics again */ |
| 155 | | decodechar(machine->gfx[0], chr, pcgram); |
| 156 | decodechar(space->machine->gfx[0], chr, pcgram); |
| 156 | 157 | } |
| 157 | 158 | } |
| 158 | 159 | } |
| r3623 | r3624 | |
| 239 | 240 | for (x=0; x<32; x++) |
| 240 | 241 | { |
| 241 | 242 | if (screen_on) |
| 242 | | code = memory_read_byte(space, vidpg + x + (y<<5)); |
| 243 | code = memory_read_byte(cputag_get_address_space(Machine,"main",ADDRESS_SPACE_PROGRAM), vidpg + x + (y<<5)); |
| 243 | 244 | |
| 244 | 245 | drawgfx(bitmap, screen->machine->gfx[0], code & mask, 0, 0, 0, x*8, y*10, |
| 245 | 246 | cliprect, TRANSPARENCY_NONE, 0); |
| r3623 | r3624 | |
| 274 | 275 | { |
| 275 | 276 | if (screen_on) |
| 276 | 277 | { |
| 277 | | code = memory_read_byte(space, vidpg + x + (y<<5)); /* get character to display */ |
| 278 | code = memory_read_byte(cputag_get_address_space(Machine,"main",ADDRESS_SPACE_PROGRAM), vidpg + x + (y<<5)); /* get character to display */ |
| 278 | 279 | |
| 279 | | if (!(options & 0x40)) col = memory_read_byte(space, 0xfe00 + x + (y<<5)); /* byte of colour to display */ |
| 280 | if (!(options & 0x40)) col = memory_read_byte(cputag_get_address_space(Machine,"main",ADDRESS_SPACE_PROGRAM), 0xfe00 + x + (y<<5)); /* byte of colour to display */ |
| 280 | 281 | } |
| 281 | 282 | |
| 282 | 283 | drawgfx(bitmap, screen->machine->gfx[cgen], code, col, 0, 0, x*8, y*10, |
| r3623 | r3624 | |
| 348 | 349 | |
| 349 | 350 | static Z80PIO_ON_INT_CHANGED( pio_interrupt ) |
| 350 | 351 | { |
| 351 | | cpunum_set_input_line( device->machine, 0, 0, state ? ASSERT_LINE : CLEAR_LINE ); |
| 352 | cpu_set_input_line( device->machine->cpu[0], 0, state ? ASSERT_LINE : CLEAR_LINE ); |
| 352 | 353 | } |
| 353 | 354 | |
| 354 | 355 | static WRITE8_DEVICE_HANDLER( pio_port_a_w ) |
| r3623 | r3624 | |
| 494 | 495 | /* bit 7 = printer busy |
| 495 | 496 | 0 = printer is not busy */ |
| 496 | 497 | |
| 497 | | if (printer_is_ready(printer_device(machine))==0 ) |
| 498 | if (printer_is_ready(printer_device(space->machine))==0 ) |
| 498 | 499 | data |= 0x80; |
| 499 | 500 | |
| 500 | 501 | return data; |
| r3623 | r3624 | |
| 502 | 503 | |
| 503 | 504 | static READ8_HANDLER( super80_f2_r ) |
| 504 | 505 | { |
| 505 | | UINT8 data = input_port_read(machine, "DSW") & 0xf0; // dip switches on pcb |
| 506 | UINT8 data = input_port_read(space->machine, "DSW") & 0xf0; // dip switches on pcb |
| 506 | 507 | data |= cass_data[2]; // bit 0 = output of U1, bit 1 = MDS cass state, bit 2 = current wave_state |
| 507 | 508 | data |= 0x08; // bit 3 - not used |
| 508 | 509 | return data; |
| r3623 | r3624 | |
| 516 | 517 | static WRITE8_HANDLER( super80v_11_w ) |
| 517 | 518 | { |
| 518 | 519 | if (mc6845_ind < 16) mc6845_reg[mc6845_ind] = data & mc6845_mask[mc6845_ind]; /* save data in register */ |
| 519 | | if ((mc6845_ind == 1) || (mc6845_ind == 6) || (mc6845_ind == 9)) mc6845_screen_configure(machine); /* adjust screen size */ |
| 520 | if ((mc6845_ind == 1) || (mc6845_ind == 6) || (mc6845_ind == 9)) mc6845_screen_configure(space->machine); /* adjust screen size */ |
| 520 | 521 | if ((mc6845_ind > 8) && (mc6845_ind < 12)) mc6845_cursor_configure(); /* adjust cursor shape */ |
| 521 | 522 | } |
| 522 | 523 | |
| r3623 | r3624 | |
| 538 | 539 | if (bits & 0x20) set_led_status(2,(data & 32) ? 0 : 1); /* bit 5 - LED - scroll lock led is used */ |
| 539 | 540 | speaker_level_w(0, (data & 8) ? 0 : 1); /* bit 3 - speaker */ |
| 540 | 541 | super80_mhz = (data & 4) ? 1 : 2; /* bit 2 - video on/off */ |
| 541 | | if (bits & 2) cassette_motor( machine, data & 2 ? 1 : 0); /* bit 1 - cassette motor */ |
| 542 | | if (bits & 1) cassette_output(cassette_device_image(machine), (data & 1) ? -1.0 : +1.0); /* bit 0 - cass out */ |
| 542 | if (bits & 2) cassette_motor( space->machine, data & 2 ? 1 : 0); /* bit 1 - cassette motor */ |
| 543 | if (bits & 1) cassette_output(cassette_device_image(space->machine), (data & 1) ? -1.0 : +1.0); /* bit 0 - cass out */ |
| 543 | 544 | |
| 544 | 545 | last_data = data; |
| 545 | 546 | } |
| r3623 | r3624 | |
| 550 | 551 | |
| 551 | 552 | if (bits & 0x20) set_led_status(2,(data & 32) ? 0 : 1); /* bit 5 - LED - scroll lock led is used */ |
| 552 | 553 | speaker_level_w(0, (data & 8) ? 0 : 1); /* bit 3 - speaker */ |
| 553 | | if (bits & 2) cassette_motor( machine, data & 2 ? 1 : 0); /* bit 1 - cassette motor */ |
| 554 | | if (bits & 1) cassette_output(cassette_device_image(machine), (data & 1) ? -1.0 : +1.0); /* bit 0 - cass out */ |
| 554 | if (bits & 2) cassette_motor( space->machine, data & 2 ? 1 : 0); /* bit 1 - cassette motor */ |
| 555 | if (bits & 1) cassette_output(cassette_device_image(space->machine), (data & 1) ? -1.0 : +1.0); /* bit 0 - cass out */ |
| 555 | 556 | |
| 556 | 557 | last_data = data; |
| 557 | 558 | } |
| r3623 | r3624 | |
| 564 | 565 | super80v_rom_pcg = data & 0x10; /* bit 4 - bankswitch gfx rom or pcg */ |
| 565 | 566 | speaker_level_w(0, (data & 8) ? 0 : 1); /* bit 3 - speaker */ |
| 566 | 567 | super80v_vid_col = data & 4; /* bit 2 - bankswitch video or colour ram */ |
| 567 | | if (bits & 2) cassette_motor( machine, data & 2 ? 1 : 0); /* bit 1 - cassette motor */ |
| 568 | | if (bits & 1) cassette_output(cassette_device_image(machine), (data & 1) ? -1.0 : +1.0); /* bit 0 - cass out */ |
| 568 | if (bits & 2) cassette_motor( space->machine, data & 2 ? 1 : 0); /* bit 1 - cassette motor */ |
| 569 | if (bits & 1) cassette_output(cassette_device_image(space->machine), (data & 1) ? -1.0 : +1.0); /* bit 0 - cass out */ |
| 569 | 570 | |
| 570 | 571 | last_data = data; |
| 571 | 572 | } |