src/mess/video/hp48.c
| r3768 | r3769 | |
| 13 | 13 | |
| 14 | 14 | #include "includes/hp48.h" |
| 15 | 15 | |
| 16 | | #include "deprecat.h" |
| 17 | | |
| 18 | 16 | /*************************************************************************** |
| 19 | 17 | DEBUGGING |
| 20 | 18 | ***************************************************************************/ |
| r3768 | r3769 | |
| 133 | 131 | data >>= 1 |
| 134 | 132 | |
| 135 | 133 | #define draw_quart \ |
| 136 | | UINT8 data = memory_read_byte(cputag_get_address_space(Machine,"main",ADDRESS_SPACE_PROGRAM), addr ); \ |
| 134 | UINT8 data = memory_read_byte(cputag_get_address_space(screen->machine,"main",ADDRESS_SPACE_PROGRAM), addr ); \ |
| 137 | 135 | draw_pixel; draw_pixel; draw_pixel; draw_pixel; |
| 138 | 136 | |
| 139 | 137 | |
src/mess/video/m6847.c
| r3768 | r3769 | |
| 1619 | 1619 | static TIMER_CALLBACK(hs_fall) |
| 1620 | 1620 | { |
| 1621 | 1621 | if (LOG_HS) |
| 1622 | | logerror("hs_fall(): time=%s\n", attotime_string(timer_get_time(Machine), ATTOTIME_STRING_PRECISION)); |
| 1622 | logerror("hs_fall(): time=%s\n", attotime_string(timer_get_time(machine), ATTOTIME_STRING_PRECISION)); |
| 1623 | 1623 | |
| 1624 | 1624 | set_horizontal_sync(); |
| 1625 | 1625 | } |
| r3768 | r3769 | |
| 1627 | 1627 | static TIMER_CALLBACK(hs_rise) |
| 1628 | 1628 | { |
| 1629 | 1629 | if (LOG_HS) |
| 1630 | | logerror("hs_rise(): time=%s\n", attotime_string(timer_get_time(Machine), ATTOTIME_STRING_PRECISION)); |
| 1630 | logerror("hs_rise(): time=%s\n", attotime_string(timer_get_time(machine), ATTOTIME_STRING_PRECISION)); |
| 1631 | 1631 | |
| 1632 | 1632 | timer_adjust_oneshot(m6847->hs_rise_timer, |
| 1633 | 1633 | attotime_make(0, m6847->scanline_period), 0); |
| r3768 | r3769 | |
| 1641 | 1641 | static TIMER_CALLBACK(fs_fall) |
| 1642 | 1642 | { |
| 1643 | 1643 | if (LOG_FS) |
| 1644 | | logerror("fs_fall(): time=%s scanline=%d\n", attotime_string(timer_get_time(Machine), ATTOTIME_STRING_PRECISION), get_scanline()); |
| 1644 | logerror("fs_fall(): time=%s scanline=%d\n", attotime_string(timer_get_time(machine), ATTOTIME_STRING_PRECISION), get_scanline()); |
| 1645 | 1645 | |
| 1646 | 1646 | set_field_sync(); |
| 1647 | 1647 | } |
| r3768 | r3769 | |
| 1649 | 1649 | static TIMER_CALLBACK(fs_rise) |
| 1650 | 1650 | { |
| 1651 | 1651 | if (LOG_FS) |
| 1652 | | logerror("fs_rise(): time=%s scanline=%d\n", attotime_string(timer_get_time(Machine), ATTOTIME_STRING_PRECISION), get_scanline()); |
| 1652 | logerror("fs_rise(): time=%s scanline=%d\n", attotime_string(timer_get_time(machine), ATTOTIME_STRING_PRECISION), get_scanline()); |
| 1653 | 1653 | |
| 1654 | 1654 | /* adjust field sync falling edge timer */ |
| 1655 | 1655 | timer_adjust_oneshot(m6847->fs_fall_timer, |
src/mess/video/exidy.c
| r3768 | r3769 | |
| 8 | 8 | |
| 9 | 9 | #include "driver.h" |
| 10 | 10 | #include "includes/exidy.h" |
| 11 | | #include "deprecat.h" |
| 12 | 11 | |
| 13 | 12 | |
| 14 | 13 | VIDEO_UPDATE( exidy ) |
| r3768 | r3769 | |
| 28 | 27 | int ch; |
| 29 | 28 | |
| 30 | 29 | /* get char from z80 address space */ |
| 31 | | ch = memory_read_byte(cputag_get_address_space(Machine,"main",ADDRESS_SPACE_PROGRAM), 0x0f080 + (y<<6) + x) & 0x0ff; |
| 30 | ch = memory_read_byte(cputag_get_address_space(screen->machine,"main",ADDRESS_SPACE_PROGRAM), 0x0f080 + (y<<6) + x) & 0x0ff; |
| 32 | 31 | |
| 33 | 32 | /* prom at 0x0f800, user chars from 0x0fc00 */ |
| 34 | 33 | char_addr = 0x0f800 | (ch<<3); |
| r3768 | r3769 | |
| 40 | 39 | |
| 41 | 40 | /* read byte of graphics data from z80 memory */ |
| 42 | 41 | /* either prom or ram */ |
| 43 | | byte = memory_read_byte(cputag_get_address_space(Machine,"main",ADDRESS_SPACE_PROGRAM), char_addr|cheight); |
| 42 | byte = memory_read_byte(cputag_get_address_space(screen->machine,"main",ADDRESS_SPACE_PROGRAM), char_addr|cheight); |
| 44 | 43 | |
| 45 | 44 | px = (x<<3); |
| 46 | 45 | py = (y<<3)|cheight; |
src/mess/machine/tx0.c
| r3768 | r3769 | |
| 336 | 336 | if (data & 0100) |
| 337 | 337 | { |
| 338 | 338 | /* read current AC */ |
| 339 | | ac = cpu_get_reg(Machine->cpu[0], TX0_AC); |
| 339 | ac = cpu_get_reg(machine->cpu[0], TX0_AC); |
| 340 | 340 | /* cycle right */ |
| 341 | 341 | ac = (ac >> 1) | ((ac & 1) << 17); |
| 342 | 342 | /* shuffle and insert data into AC */ |
| 343 | 343 | ac = (ac /*& 0333333*/) | ((data & 001) << 17) | ((data & 002) << 13) | ((data & 004) << 9) | ((data & 010) << 5) | ((data & 020) << 1) | ((data & 040) >> 3); |
| 344 | 344 | /* write modified AC */ |
| 345 | | cpu_set_reg(Machine->cpu[0], TX0_AC, ac); |
| 345 | cpu_set_reg(machine->cpu[0], TX0_AC, ac); |
| 346 | 346 | |
| 347 | 347 | tape_reader.rc = (tape_reader.rc+1) & 3; |
| 348 | 348 | |
| 349 | 349 | if (tape_reader.rc == 0) |
| 350 | 350 | { /* IO complete */ |
| 351 | 351 | tape_reader.rcl = 0; |
| 352 | | cpu_set_reg(Machine->cpu[0], TX0_IO_COMPLETE, 0); |
| 352 | cpu_set_reg(machine->cpu[0], TX0_IO_COMPLETE, 0); |
| 353 | 353 | } |
| 354 | 354 | } |
| 355 | 355 | } |
| r3768 | r3769 | |
| 367 | 367 | */ |
| 368 | 368 | static TIMER_CALLBACK(puncher_callback) |
| 369 | 369 | { |
| 370 | | cpu_set_reg(Machine->cpu[0], TX0_IO_COMPLETE, 0); |
| 370 | cpu_set_reg(machine->cpu[0], TX0_IO_COMPLETE, 0); |
| 371 | 371 | } |
| 372 | 372 | |
| 373 | 373 | /* |
| r3768 | r3769 | |
| 455 | 455 | */ |
| 456 | 456 | static TIMER_CALLBACK(prt_callback) |
| 457 | 457 | { |
| 458 | | cpu_set_reg(Machine->cpu[0], TX0_IO_COMPLETE, 0); |
| 458 | cpu_set_reg(machine->cpu[0], TX0_IO_COMPLETE, 0); |
| 459 | 459 | } |
| 460 | 460 | |
| 461 | 461 | /* |
| r3768 | r3769 | |
| 481 | 481 | */ |
| 482 | 482 | static TIMER_CALLBACK(dis_callback) |
| 483 | 483 | { |
| 484 | | cpu_set_reg(Machine->cpu[0], TX0_IO_COMPLETE, 0); |
| 484 | cpu_set_reg(machine->cpu[0], TX0_IO_COMPLETE, 0); |
| 485 | 485 | } |
| 486 | 486 | |
| 487 | 487 | /* |
| r3768 | r3769 | |
| 596 | 596 | if ((magtape.state == MTS_SELECTED) || ((magtape.state == MTS_SELECTING) && (magtape.command == 2))) |
| 597 | 597 | { /* unit has become unavailable */ |
| 598 | 598 | magtape.state = MTS_UNSELECTING; |
| 599 | | cpu_set_reg(Machine->cpu[0], TX0_PF, cpu_get_reg(Machine->cpu[0], TX0_PF) | PF_RWC); |
| 599 | cpu_set_reg(image->machine->cpu[0], TX0_PF, cpu_get_reg(image->machine->cpu[0], TX0_PF) | PF_RWC); |
| 600 | 600 | schedule_unselect(); |
| 601 | 601 | } |
| 602 | 602 | } |
src/mess/machine/pet.c
| r3768 | r3769 | |
| 20 | 20 | #include "devices/cartslot.h" |
| 21 | 21 | #include "devices/cassette.h" |
| 22 | 22 | |
| 23 | | #include "deprecat.h" |
| 24 | | |
| 25 | 23 | #define VERBOSE_LEVEL 0 |
| 26 | 24 | #define DBG_LOG(N,M,A) \ |
| 27 | 25 | do { \ |
| r3768 | r3769 | |
| 555 | 553 | { |
| 556 | 554 | static int level = 0; |
| 557 | 555 | |
| 558 | | pia_0_cb1_w(cputag_get_address_space(Machine,"main",ADDRESS_SPACE_PROGRAM), 0, level); |
| 556 | pia_0_cb1_w(cputag_get_address_space(machine,"main",ADDRESS_SPACE_PROGRAM), 0, level); |
| 559 | 557 | level = !level; |
| 560 | 558 | } |
| 561 | 559 | |
| r3768 | r3769 | |
| 565 | 563 | { |
| 566 | 564 | // cassette 1 |
| 567 | 565 | UINT8 data = (cassette_input(device_list_find_by_tag( machine->config->devicelist, CASSETTE, "cassette1" )) > +0.0) ? 1 : 0; |
| 568 | | pia_0_ca1_w(cputag_get_address_space(Machine,"main",ADDRESS_SPACE_PROGRAM), 0, data); |
| 566 | pia_0_ca1_w(cputag_get_address_space(machine,"main",ADDRESS_SPACE_PROGRAM), 0, data); |
| 569 | 567 | } |
| 570 | 568 | |
| 571 | 569 | /* NOT WORKING - Just placeholder */ |
| r3768 | r3769 | |
| 573 | 571 | { |
| 574 | 572 | // cassette 2 |
| 575 | 573 | UINT8 data = (cassette_input(device_list_find_by_tag( machine->config->devicelist, CASSETTE, "cassette2" )) > +0.0) ? 1 : 0; |
| 576 | | via_0_cb1_w(cputag_get_address_space(Machine,"main",ADDRESS_SPACE_PROGRAM), 0, data); |
| 574 | via_0_cb1_w(cputag_get_address_space(machine,"main",ADDRESS_SPACE_PROGRAM), 0, data); |
| 577 | 575 | } |
| 578 | 576 | |
| 579 | 577 | |
src/mess/machine/c16.c
| r3768 | r3769 | |
| 438 | 438 | cpu_set_info_fct(machine->cpu[0], CPUINFO_PTR_M6510_PORTREAD, (genf *) c16_m7501_port_read); |
| 439 | 439 | cpu_set_info_fct(machine->cpu[0], CPUINFO_PTR_M6510_PORTWRITE, (genf *) c16_m7501_port_write); |
| 440 | 440 | |
| 441 | | c16_select_roms (cputag_get_address_space(Machine,"main",ADDRESS_SPACE_PROGRAM), 0, 0); |
| 442 | | c16_switch_to_rom (cputag_get_address_space(Machine,"main",ADDRESS_SPACE_PROGRAM), 0, 0); |
| 441 | c16_select_roms (cputag_get_address_space(machine,"main",ADDRESS_SPACE_PROGRAM), 0, 0); |
| 442 | c16_switch_to_rom (cputag_get_address_space(machine,"main",ADDRESS_SPACE_PROGRAM), 0, 0); |
| 443 | 443 | |
| 444 | 444 | if (has_c1551) /* C1551 */ |
| 445 | 445 | { |
src/mess/machine/lynx.c
| r3768 | r3769 | |
| 9 | 9 | #include "devices/cartslot.h" |
| 10 | 10 | #include "hash.h" |
| 11 | 11 | |
| 12 | | #include "deprecat.h" |
| 13 | | |
| 14 | 12 | static UINT16 lynx_granularity = 1; |
| 15 | 13 | static int lynx_line; |
| 16 | 14 | static int lynx_line_y; |
| r3768 | r3769 | |
| 787 | 785 | int i; int o;int colors; |
| 788 | 786 | |
| 789 | 787 | blitter.memory_accesses = 0; |
| 790 | | blitter.mem = memory_get_read_ptr(cpu_get_address_space(Machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0000); |
| 788 | blitter.mem = memory_get_read_ptr(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0000); |
| 791 | 789 | |
| 792 | 790 | blitter.xoff = GET_WORD(suzy.data, 0x04); |
| 793 | 791 | blitter.yoff = GET_WORD(suzy.data, 0x06); |
src/mess/machine/atom.c
| r3768 | r3769 | |
| 316 | 316 | /* copy data into memory */ |
| 317 | 317 | for (i=size-1; i>=0; i--) |
| 318 | 318 | { |
| 319 | | memory_write_byte( cpu_get_address_space( Machine->cpu[0], ADDRESS_SPACE_PROGRAM ), addr, data[0]); |
| 319 | memory_write_byte( cpu_get_address_space( image->machine->cpu[0], ADDRESS_SPACE_PROGRAM ), addr, data[0]); |
| 320 | 320 | addr++; |
| 321 | 321 | data++; |
| 322 | 322 | } |
| 323 | 323 | |
| 324 | 324 | |
| 325 | 325 | /* set new pc address */ |
| 326 | | cpu_set_reg( Machine->cpu[0], REG_PC, exec); |
| 326 | cpu_set_reg( image->machine->cpu[0], REG_PC, exec); |
| 327 | 327 | |
| 328 | 328 | /* free the data */ |
| 329 | 329 | free(quickload_data); |
src/mess/machine/c64.c
| r3768 | r3769 | |
| 271 | 271 | value &= t; |
| 272 | 272 | } |
| 273 | 273 | |
| 274 | | if ( input_port_read(Machine, "CTRLSEL") & 0x80 ) |
| 274 | if ( input_port_read(device->machine, "CTRLSEL") & 0x80 ) |
| 275 | 275 | value &= c64_keyline[8]; |
| 276 | 276 | else |
| 277 | 277 | value &= c64_keyline[9]; |
| r3768 | r3769 | |
| 293 | 293 | if (!(cia0porta & 0x02)) value &= c64_keyline[1]; |
| 294 | 294 | if (!(cia0porta & 0x01)) value &= c64_keyline[0]; |
| 295 | 295 | |
| 296 | | if ( input_port_read(Machine, "CTRLSEL") & 0x80 ) |
| 296 | if ( input_port_read(device->machine, "CTRLSEL") & 0x80 ) |
| 297 | 297 | value &= c64_keyline[9]; |
| 298 | 298 | else |
| 299 | 299 | value &= c64_keyline[8]; |
| 300 | 300 | |
| 301 | | if (is_c128(Machine)) |
| 301 | if (is_c128(device->machine)) |
| 302 | 302 | { |
| 303 | 303 | if (!vic2e_k0_r ()) |
| 304 | 304 | value &= c128_keyline[0]; |
| r3768 | r3769 | |
| 307 | 307 | if (!vic2e_k2_r ()) |
| 308 | 308 | value &= c128_keyline[2]; |
| 309 | 309 | } |
| 310 | | if (is_c65(Machine)) |
| 310 | if (is_c65(device->machine)) |
| 311 | 311 | { |
| 312 | 312 | if (!(c65_6511_port & 0x02)) |
| 313 | 313 | value &= c65_keyline; |
| r3768 | r3769 | |
| 407 | 407 | cbm_serial_data_write (serial_data = !(data & 0x20)); |
| 408 | 408 | cbm_serial_atn_write (serial_atn = !(data & 0x08)); |
| 409 | 409 | c64_vicaddr = c64_memory + helper[data & 0x03]; |
| 410 | | if (is_c128(Machine)) |
| 410 | if (is_c128(device->machine)) |
| 411 | 411 | { |
| 412 | 412 | c128_vicaddr = c64_memory + helper[data & 0x03] + c128_va1617; |
| 413 | 413 | } |
src/mess/drivers/lynx.c
| r3768 | r3769 | |
| 12 | 12 | |
| 13 | 13 | #include "devices/snapquik.h" |
| 14 | 14 | |
| 15 | | #include "deprecat.h" |
| 16 | | |
| 17 | 15 | static QUICKLOAD_LOAD( lynx ); |
| 18 | 16 | |
| 19 | 17 | static ADDRESS_MAP_START( lynx_mem , ADDRESS_SPACE_PROGRAM, 8) |
| r3768 | r3769 | |
| 174 | 172 | return INIT_FAIL; |
| 175 | 173 | |
| 176 | 174 | for (i = 0; i < length; i++) |
| 177 | | memory_write_byte(cputag_get_address_space(Machine,"main",ADDRESS_SPACE_PROGRAM), start + i, data[i]); |
| 175 | memory_write_byte(cputag_get_address_space(image->machine,"main",ADDRESS_SPACE_PROGRAM), start + i, data[i]); |
| 178 | 176 | |
| 179 | 177 | rom[0x1fc] = start & 0xff; |
| 180 | 178 | rom[0x1fd] = start >> 8; |
src/mess/drivers/super80.c
| r3768 | r3769 | |
| 10 | 10 | #include "sound/speaker.h" |
| 11 | 11 | #include "machine/centroni.h" |
| 12 | 12 | #include "devices/printer.h" |
| 13 | | #include "deprecat.h" |
| 14 | 13 | |
| 15 | 14 | static UINT8 super80_mhz=2; /* state of bit 2 of port F0 */ |
| 16 | 15 | static UINT16 vidpg=0xfe00; /* Home position of video page being displayed */ |
| r3768 | r3769 | |
| 240 | 239 | for (x=0; x<32; x++) |
| 241 | 240 | { |
| 242 | 241 | if (screen_on) |
| 243 | | code = memory_read_byte(cputag_get_address_space(Machine,"main",ADDRESS_SPACE_PROGRAM), vidpg + x + (y<<5)); |
| 242 | code = memory_read_byte(cputag_get_address_space(screen->machine,"main",ADDRESS_SPACE_PROGRAM), vidpg + x + (y<<5)); |
| 244 | 243 | |
| 245 | 244 | drawgfx(bitmap, screen->machine->gfx[0], code & mask, 0, 0, 0, x*8, y*10, |
| 246 | 245 | cliprect, TRANSPARENCY_NONE, 0); |
| r3768 | r3769 | |
| 275 | 274 | { |
| 276 | 275 | if (screen_on) |
| 277 | 276 | { |
| 278 | | code = memory_read_byte(cputag_get_address_space(Machine,"main",ADDRESS_SPACE_PROGRAM), vidpg + x + (y<<5)); /* get character to display */ |
| 277 | code = memory_read_byte(cputag_get_address_space(screen->machine,"main",ADDRESS_SPACE_PROGRAM), vidpg + x + (y<<5)); /* get character to display */ |
| 279 | 278 | |
| 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 */ |
| 279 | if (!(options & 0x40)) col = memory_read_byte(cputag_get_address_space(screen->machine,"main",ADDRESS_SPACE_PROGRAM), 0xfe00 + x + (y<<5)); /* byte of colour to display */ |
| 281 | 280 | } |
| 282 | 281 | |
| 283 | 282 | drawgfx(bitmap, screen->machine->gfx[cgen], code, col, 0, 0, x*8, y*10, |
src/mess/drivers/saturn.c
| r3768 | r3769 | |
| 532 | 532 | { |
| 533 | 533 | case 0: |
| 534 | 534 | return_data = 0x90; |
| 535 | | // return_data = 0xf0 | ((input_port_read(Machine, "JOY1")>>4) & 0xf); |
| 535 | // return_data = 0xf0 | ((input_port_read(space->machine, "JOY1")>>4) & 0xf); |
| 536 | 536 | break; |
| 537 | 537 | |
| 538 | 538 | case 1: |
| 539 | | // return_data = 0xf0 | ((input_port_read(Machine, "JOY1")>>12) & 0xf); |
| 539 | // return_data = 0xf0 | ((input_port_read(space->machine, "JOY1")>>12) & 0xf); |
| 540 | 540 | break; |
| 541 | 541 | |
| 542 | 542 | case 2: |
| 543 | | // return_data = 0xf0 | ((input_port_read(Machine, "JOY1")>>8) & 0xf); |
| 543 | // return_data = 0xf0 | ((input_port_read(space->machine, "JOY1")>>8) & 0xf); |
| 544 | 544 | break; |
| 545 | 545 | |
| 546 | 546 | case 3: |
| 547 | 547 | return_data = 0x94; |
| 548 | | // return_data = 0xf0 | (input_port_read(Machine, "JOY1")&0x8) | 0x4; |
| 548 | // return_data = 0xf0 | (input_port_read(space->machine, "JOY1")&0x8) | 0x4; |
| 549 | 549 | break; |
| 550 | 550 | } |
| 551 | 551 | } |
src/mess/drivers/amiga.c
| r3768 | r3769 | |
| 399 | 399 | /* overlay disabled, map RAM on 0x000000 */ |
| 400 | 400 | memory_install_write16_handler(cpu_get_address_space(device->machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x000000, amiga_chip_ram_size - 1, 0, mirror_mask, SMH_BANK1); |
| 401 | 401 | |
| 402 | | amiga_cart_check_overlay(Machine); |
| 402 | amiga_cart_check_overlay(device->machine); |
| 403 | 403 | } |
| 404 | 404 | else |
| 405 | 405 | /* overlay enabled, map Amiga system ROM on 0x000000 */ |