src/mess/devices/cassette.c
| r2153 | r2154 | |
| 10 | 10 | #include "cassette.h" |
| 11 | 11 | #include "formats/cassimg.h" |
| 12 | 12 | #include "ui.h" |
| 13 | | #include "deprecat.h" |
| 14 | 13 | |
| 15 | 14 | |
| 16 | 15 | #define CASSETTE_TAG "cassette" |
| r2153 | r2154 | |
| 238 | 237 | return INIT_FAIL; |
| 239 | 238 | |
| 240 | 239 | /* set to default state */ |
| 241 | | dev = device_find_from_machine(Machine, IO_CASSETTE); |
| 240 | dev = device_find_from_machine(image->machine, IO_CASSETTE); |
| 242 | 241 | get_cassimg(image)->state = get_default_state(dev); |
| 243 | 242 | |
| 244 | 243 | return INIT_PASS; |
| r2153 | r2154 | |
| 260 | 259 | tag = get_cassimg(image); |
| 261 | 260 | |
| 262 | 261 | /* figure out the cassette format */ |
| 263 | | dev = device_find_from_machine(Machine, IO_CASSETTE); |
| 262 | dev = device_find_from_machine(image->machine, IO_CASSETTE); |
| 264 | 263 | formats = mess_device_get_info_ptr(&dev->devclass, MESS_DEVINFO_PTR_CASSETTE_FORMATS); |
| 265 | 264 | |
| 266 | 265 | if (image_has_been_created(image)) |
src/mess/devices/cartslot.c
| r2153 | r2154 | |
| 1 | 1 | #include <ctype.h> |
| 2 | 2 | #include "driver.h" |
| 3 | 3 | #include "cartslot.h" |
| 4 | | #include "deprecat.h" |
| 5 | 4 | |
| 6 | 5 | |
| 7 | 6 | static int is_cart_roment(const rom_entry *roment) |
| r2153 | r2154 | |
| 76 | 75 | /* if the region is inverted, do that now */ |
| 77 | 76 | if (type >= REGION_CPU1 && type < REGION_CPU1 + MAX_CPU) |
| 78 | 77 | { |
| 79 | | int cputype = Machine->config->cpu[type - REGION_CPU1].type; |
| 78 | int cputype = image->machine->config->cpu[type - REGION_CPU1].type; |
| 80 | 79 | if (cputype != 0) |
| 81 | 80 | { |
| 82 | 81 | datawidth = cputype_databus_width(cputype, ADDRESS_SPACE_PROGRAM) / 8; |
| r2153 | r2154 | |
| 117 | 116 | const rom_entry *romrgn, *roment; |
| 118 | 117 | int position = 0, result; |
| 119 | 118 | |
| 120 | | romrgn = rom_first_region(Machine->gamedrv); |
| 119 | romrgn = rom_first_region(image->machine->gamedrv); |
| 121 | 120 | while(romrgn) |
| 122 | 121 | { |
| 123 | 122 | roment = romrgn + 1; |
src/mess/image.c
| r2153 | r2154 | |
| 1420 | 1420 | if (try_change_working_directory(image, "software")) |
| 1421 | 1421 | { |
| 1422 | 1422 | /* now down to a directory for this computer */ |
| 1423 | | gamedrv = Machine->gamedrv; |
| 1423 | gamedrv = image->dev->machine->gamedrv; |
| 1424 | 1424 | while(gamedrv && !try_change_working_directory(image, gamedrv->name)) |
| 1425 | 1425 | { |
| 1426 | 1426 | gamedrv = mess_next_compatible_driver(gamedrv); |
| r2153 | r2154 | |
| 1586 | 1586 | basename_noext = strip_extension(image_basename(image)); |
| 1587 | 1587 | if (!basename_noext) |
| 1588 | 1588 | return FILERR_OUT_OF_MEMORY; |
| 1589 | | fname = astring_assemble_4(astring_alloc(), Machine->gamedrv->name, PATH_SEPARATOR, basename_noext, ".nv"); |
| 1589 | fname = astring_assemble_4(astring_alloc(), image->machine->gamedrv->name, PATH_SEPARATOR, basename_noext, ".nv"); |
| 1590 | 1590 | filerr = mame_fopen(SEARCHPATH_NVRAM, astring_c(fname), openflags, file); |
| 1591 | 1591 | astring_free(fname); |
| 1592 | 1592 | free(basename_noext); |
| r2153 | r2154 | |
| 1654 | 1654 | int image_absolute_index(mess_image *image) |
| 1655 | 1655 | { |
| 1656 | 1656 | image_slot_data *slot = find_image_slot(image); |
| 1657 | | return slot - Machine->images_data->slots; |
| 1657 | return slot - image->machine->images_data->slots; |
| 1658 | 1658 | } |
| 1659 | 1659 | |
| 1660 | 1660 | |
src/mess/machine/nes.c
| r2153 | r2154 | |
| 4 | 4 | #include "includes/nes.h" |
| 5 | 5 | #include "machine/nes_mmc.h" |
| 6 | 6 | #include "sound/nes_apu.h" |
| 7 | | #include "zlib.h" |
| 8 | 7 | #include "image.h" |
| 9 | 8 | #include "hash.h" |
| 10 | | #include "deprecat.h" |
| 11 | 9 | |
| 12 | 10 | |
| 13 | 11 | |
| r2153 | r2154 | |
| 465 | 463 | if (nes.four_screen_vram) logerror("-- 4-screen VRAM\n"); |
| 466 | 464 | |
| 467 | 465 | /* Free the regions that were allocated by the ROM loader */ |
| 468 | | free_memory_region (Machine, REGION_CPU1); |
| 469 | | free_memory_region (Machine, REGION_GFX1); |
| 466 | free_memory_region (image->machine, REGION_CPU1); |
| 467 | free_memory_region (image->machine, REGION_GFX1); |
| 470 | 468 | |
| 471 | 469 | /* Allocate them again with the proper size */ |
| 472 | | new_memory_region(Machine, REGION_CPU1, 0x10000 + (nes.prg_chunks+1) * 0x4000,0); |
| 470 | new_memory_region(image->machine, REGION_CPU1, 0x10000 + (nes.prg_chunks+1) * 0x4000,0); |
| 473 | 471 | if (nes.chr_chunks) |
| 474 | | new_memory_region(Machine, REGION_GFX1, nes.chr_chunks * 0x2000,0); |
| 472 | new_memory_region(image->machine, REGION_GFX1, nes.chr_chunks * 0x2000,0); |
| 475 | 473 | |
| 476 | 474 | nes.rom = memory_region(REGION_CPU1); |
| 477 | 475 | nes.vrom = memory_region(REGION_GFX1); |
src/mess/machine/ti85.c
| r2153 | r2154 | |
| 8 | 8 | |
| 9 | 9 | #include <stdarg.h> |
| 10 | 10 | #include "driver.h" |
| 11 | | #include "deprecat.h" |
| 12 | 11 | #include "cpu/z80/z80.h" |
| 13 | 12 | #include "includes/ti85.h" |
| 14 | 13 | #include "formats/ti85_ser.h" |
| r2153 | r2154 | |
| 651 | 650 | |
| 652 | 651 | DEVICE_INIT( ti85_serial ) |
| 653 | 652 | { |
| 654 | | ti85_free_serial_data_memory(Machine); |
| 653 | ti85_free_serial_data_memory(image->machine); |
| 655 | 654 | ti85_receive_serial (NULL,0); |
| 656 | 655 | return INIT_PASS; |
| 657 | 656 | } |
| r2153 | r2154 | |
| 670 | 669 | file_data = (UINT8*) auto_malloc(file_size); |
| 671 | 670 | image_fread(image, file_data, file_size); |
| 672 | 671 | |
| 673 | | if(!ti85_convert_file_data_to_serial_stream(file_data, file_size, &ti85_serial_stream, (char*)Machine->gamedrv->name)) |
| 672 | if(!ti85_convert_file_data_to_serial_stream(file_data, file_size, &ti85_serial_stream, (char*)image->machine->gamedrv->name)) |
| 674 | 673 | { |
| 675 | 674 | ti85_free_serial_stream (&ti85_serial_stream); |
| 676 | 675 | return INIT_FAIL; |
| r2153 | r2154 | |
| 687 | 686 | |
| 688 | 687 | DEVICE_UNLOAD( ti85_serial ) |
| 689 | 688 | { |
| 690 | | ti85_free_serial_data_memory(Machine); |
| 689 | ti85_free_serial_data_memory(image->machine); |
| 691 | 690 | ti85_serial_status = TI85_SEND_STOP; |
| 692 | 691 | ti85_free_serial_stream (&ti85_serial_stream); |
| 693 | 692 | } |
src/mess/drivers/pasogo.c
| r2153 | r2154 | |
| 64 | 64 | } |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | | void vg230_reset(void) |
| 67 | void vg230_reset(running_machine *machine) |
| 68 | 68 | { |
| 69 | 69 | mame_system_time systime; |
| 70 | 70 | |
| r2153 | r2154 | |
| 73 | 73 | timer_pulse(ATTOTIME_IN_HZ(1), NULL, 0, vg230_timer); |
| 74 | 74 | |
| 75 | 75 | |
| 76 | | mame_get_base_datetime(Machine, &systime); |
| 76 | mame_get_base_datetime(machine, &systime); |
| 77 | 77 | |
| 78 | 78 | vg230.rtc.seconds= systime.local_time.second; |
| 79 | 79 | vg230.rtc.minutes= systime.local_time.minute; |
| r2153 | r2154 | |
| 83 | 83 | vg230.bios_timer.data=0x7200; // HACK |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | | void vg230_init(void) |
| 86 | void vg230_init(running_machine *machine) |
| 87 | 87 | { |
| 88 | | vg230_reset(); |
| 88 | vg230_reset(machine); |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | |
| r2153 | r2154 | |
| 470 | 470 | |
| 471 | 471 | static DRIVER_INIT( pasogo ) |
| 472 | 472 | { |
| 473 | | vg230_init(); |
| 473 | vg230_init(machine); |
| 474 | 474 | memset(&ems, 0, sizeof(ems)); |
| 475 | 475 | memory_set_bankptr( 27, memory_region(REGION_USER1) + 0x00000 ); |
| 476 | 476 | memory_set_bankptr( 28, memory_region(REGION_CPU1) + 0xb8000/*?*/ ); |
src/mess/drivers/x68k.c
| r2153 | r2154 | |
| 1827 | 1827 | current_vector[1] = 0x61; |
| 1828 | 1828 | sys.ioc.irqstatus |= 0x40; |
| 1829 | 1829 | current_irq_line = 1; |
| 1830 | | cpunum_set_input_line_and_vector(Machine, 0,1,ASSERT_LINE,current_vector[1]); // Disk insert/eject interrupt |
| 1830 | cpunum_set_input_line_and_vector(image->machine, 0,1,ASSERT_LINE,current_vector[1]); // Disk insert/eject interrupt |
| 1831 | 1831 | logerror("IOC: Disk image inserted\n"); |
| 1832 | 1832 | } |
| 1833 | 1833 | sys.fdc.disk_inserted[image_index_in_device(image)] = 1; |
| r2153 | r2154 | |
| 1844 | 1844 | current_vector[1] = 0x61; |
| 1845 | 1845 | sys.ioc.irqstatus |= 0x40; |
| 1846 | 1846 | current_irq_line = 1; |
| 1847 | | cpunum_set_input_line_and_vector(Machine, 0,1,ASSERT_LINE,current_vector[1]); // Disk insert/eject interrupt |
| 1847 | cpunum_set_input_line_and_vector(image->machine, 0,1,ASSERT_LINE,current_vector[1]); // Disk insert/eject interrupt |
| 1848 | 1848 | } |
| 1849 | 1849 | sys.fdc.disk_inserted[image_index_in_device(image)] = 0; |
| 1850 | 1850 | } |