Previous 15994 Revisions Next

r2154 Saturday 29th March, 2008 at 23:48:13 UTC by Firewave
And more Machine -> machine cleanups
[src/mess]image.c
[src/mess/devices]cartslot.c cassette.c
[src/mess/drivers]pasogo.c snes.c x68k.c
[src/mess/machine]cbm.c nes.c ti85.c

src/mess/devices/cassette.c
r2153r2154
1010#include "cassette.h"
1111#include "formats/cassimg.h"
1212#include "ui.h"
13#include "deprecat.h"
1413
1514
1615#define CASSETTE_TAG      "cassette"
r2153r2154
238237      return INIT_FAIL;
239238
240239   /* set to default state */
241   dev = device_find_from_machine(Machine, IO_CASSETTE);
240   dev = device_find_from_machine(image->machine, IO_CASSETTE);
242241   get_cassimg(image)->state = get_default_state(dev);
243242
244243   return INIT_PASS;
r2153r2154
260259   tag = get_cassimg(image);
261260
262261   /* figure out the cassette format */
263   dev = device_find_from_machine(Machine, IO_CASSETTE);
262   dev = device_find_from_machine(image->machine, IO_CASSETTE);
264263   formats = mess_device_get_info_ptr(&dev->devclass, MESS_DEVINFO_PTR_CASSETTE_FORMATS);
265264
266265   if (image_has_been_created(image))
src/mess/devices/cartslot.c
r2153r2154
11#include <ctype.h>
22#include "driver.h"
33#include "cartslot.h"
4#include "deprecat.h"
54
65
76static int is_cart_roment(const rom_entry *roment)
r2153r2154
7675      /* if the region is inverted, do that now */
7776      if (type >= REGION_CPU1 && type < REGION_CPU1 + MAX_CPU)
7877      {
79         int cputype = Machine->config->cpu[type - REGION_CPU1].type;
78         int cputype = image->machine->config->cpu[type - REGION_CPU1].type;
8079         if (cputype != 0)
8180         {
8281            datawidth = cputype_databus_width(cputype, ADDRESS_SPACE_PROGRAM) / 8;
r2153r2154
117116   const rom_entry *romrgn, *roment;
118117   int position = 0, result;
119118
120   romrgn = rom_first_region(Machine->gamedrv);
119   romrgn = rom_first_region(image->machine->gamedrv);
121120   while(romrgn)
122121   {
123122      roment = romrgn + 1;
src/mess/image.c
r2153r2154
14201420   if (try_change_working_directory(image, "software"))
14211421   {
14221422      /* now down to a directory for this computer */
1423      gamedrv = Machine->gamedrv;
1423      gamedrv = image->dev->machine->gamedrv;
14241424      while(gamedrv && !try_change_working_directory(image, gamedrv->name))
14251425      {
14261426         gamedrv = mess_next_compatible_driver(gamedrv);
r2153r2154
15861586   basename_noext = strip_extension(image_basename(image));
15871587   if (!basename_noext)
15881588      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");
15901590   filerr = mame_fopen(SEARCHPATH_NVRAM, astring_c(fname), openflags, file);
15911591   astring_free(fname);
15921592   free(basename_noext);
r2153r2154
16541654int image_absolute_index(mess_image *image)
16551655{
16561656   image_slot_data *slot = find_image_slot(image);
1657   return slot - Machine->images_data->slots;
1657   return slot - image->machine->images_data->slots;
16581658}
16591659
16601660
src/mess/machine/cbm.c
r2153r2154
22#include <stdarg.h>
33
44#include "driver.h"
5#include "deprecat.h"
65#include "includes/cbm.h"
76#include "devices/cartslot.h"
87
r2153r2154
199198   if (i >= sizeof(cbm_rom) / sizeof(cbm_rom[0]))
200199      return INIT_FAIL;
201200
202   dev = cbm_rom_find_device(Machine);
201   dev = cbm_rom_find_device(image->machine);
203202
204203   size = image_length(image);
205204
src/mess/machine/nes.c
r2153r2154
44#include "includes/nes.h"
55#include "machine/nes_mmc.h"
66#include "sound/nes_apu.h"
7#include "zlib.h"
87#include "image.h"
98#include "hash.h"
10#include "deprecat.h"
119
1210
1311
r2153r2154
465463   if (nes.four_screen_vram) logerror("-- 4-screen VRAM\n");
466464
467465   /* 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);
470468
471469   /* 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);
473471   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);
475473
476474   nes.rom = memory_region(REGION_CPU1);
477475   nes.vrom = memory_region(REGION_GFX1);
src/mess/machine/ti85.c
r2153r2154
88
99#include <stdarg.h>
1010#include "driver.h"
11#include "deprecat.h"
1211#include "cpu/z80/z80.h"
1312#include "includes/ti85.h"
1413#include "formats/ti85_ser.h"
r2153r2154
651650
652651DEVICE_INIT( ti85_serial )
653652{
654   ti85_free_serial_data_memory(Machine);
653   ti85_free_serial_data_memory(image->machine);
655654   ti85_receive_serial (NULL,0);
656655   return INIT_PASS;
657656}
r2153r2154
670669      file_data = (UINT8*) auto_malloc(file_size);
671670      image_fread(image, file_data, file_size);
672671
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))
674673      {
675674         ti85_free_serial_stream (&ti85_serial_stream);
676675         return INIT_FAIL;
r2153r2154
687686
688687DEVICE_UNLOAD( ti85_serial )
689688{
690   ti85_free_serial_data_memory(Machine);
689   ti85_free_serial_data_memory(image->machine);
691690   ti85_serial_status = TI85_SEND_STOP;
692691   ti85_free_serial_stream (&ti85_serial_stream);
693692}
src/mess/drivers/pasogo.c
r2153r2154
6464  }
6565}
6666
67void vg230_reset(void)
67void vg230_reset(running_machine *machine)
6868{
6969  mame_system_time systime;
7070
r2153r2154
7373  timer_pulse(ATTOTIME_IN_HZ(1), NULL, 0, vg230_timer);
7474
7575
76  mame_get_base_datetime(Machine, &systime);
76  mame_get_base_datetime(machine, &systime);
7777 
7878  vg230.rtc.seconds= systime.local_time.second;
7979  vg230.rtc.minutes= systime.local_time.minute;
r2153r2154
8383  vg230.bios_timer.data=0x7200; // HACK
8484}
8585
86void vg230_init(void)
86void vg230_init(running_machine *machine)
8787{
88  vg230_reset();
88  vg230_reset(machine);
8989}
9090
9191
r2153r2154
470470
471471static DRIVER_INIT( pasogo )
472472{
473  vg230_init();
473  vg230_init(machine);
474474  memset(&ems, 0, sizeof(ems));
475475  memory_set_bankptr( 27, memory_region(REGION_USER1) + 0x00000 );
476476  memory_set_bankptr( 28, memory_region(REGION_CPU1) + 0xb8000/*?*/ );
src/mess/drivers/x68k.c
r2153r2154
18271827         current_vector[1] = 0x61;
18281828         sys.ioc.irqstatus |= 0x40;
18291829         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
18311831         logerror("IOC: Disk image inserted\n");
18321832      }
18331833      sys.fdc.disk_inserted[image_index_in_device(image)] = 1;
r2153r2154
18441844      current_vector[1] = 0x61;
18451845      sys.ioc.irqstatus |= 0x40;
18461846      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
18481848   }
18491849   sys.fdc.disk_inserted[image_index_in_device(image)] = 0;
18501850}
src/mess/drivers/snes.c
r2153r2154
237237static int device_load_snes_cart(mess_image *image)
238238{
239239   int i;
240   running_machine *machine = Machine;
240   running_machine *machine = image->machine;
241241   UINT16 totalblocks, readblocks;
242242   UINT32 offset;
243243   UINT8 header[512], sample[0xffff];

Previous 15994 Revisions Next


© 1998-2018 The MESS Team