Previous 199869 Revisions Next

r24084 Friday 5th July, 2013 at 11:25:00 UTC by smf
Fixes for building MESS with Visual Studio 2013 preview [smf]
[src/mess/drivers]rex6000.c
[src/mess/machine]kc.c thomson.c

trunk/src/mess/machine/thomson.c
r24083r24084
18541854DEVICE_IMAGE_LOAD_MEMBER( thomson_state, mo5_cartridge )
18551855{
18561856   UINT8* pos = memregion("maincpu")->base() + 0x10000;
1857   UINT64 size;
1858   int i,j;
1857   UINT64 size, i;
1858   int j;
18591859   char name[129];
18601860
18611861   if (image.software_entry() == NULL)
r24083r24084
18991899   name[j] = 0;
19001900
19011901   /* sanitize name */
1902   for ( i = 0; name[i]; i++)
1902   for ( j = 0; name[j]; j++)
19031903   {
1904      if ( name[i] < ' ' || name[i] >= 127 ) name[i] = '?';
1904      if ( name[j] < ' ' || name[j] >= 127 ) name[j] = '?';
19051905   }
19061906
19071907   PRINT (( "mo5_cartridge_load: cartridge \"%s\" banks=%i, size=%u\n", name, m_thom_cart_nb_banks, (unsigned) size ));
trunk/src/mess/machine/kc.c
r24083r24084
2828{
2929   UINT8 *data;
3030   struct kcc_header *header;
31   int addr;
32   int datasize;
33   int execution_address;
34   int i;
31   UINT16 addr;
32   UINT16 datasize;
33   UINT16 execution_address;
34   UINT16 i;
3535
3636   /* get file size */
37   datasize = image.length();
37   UINT64 size = image.length();
3838
39   if (datasize != 0)
39   if (size != 0)
4040   {
4141      /* malloc memory for this data */
42      data = (UINT8 *)auto_alloc_array(machine(), UINT8, datasize);
42      data = (UINT8 *)auto_alloc_array(machine(), UINT8, size);
4343
4444      if (data != NULL)
45         image.fread( data, datasize);
45         image.fread( data, size);
4646   }
4747   else
4848   {
r24083r24084
5454   datasize = ((header->end_address_l & 0x0ff) | ((header->end_address_h & 0x0ff)<<8)) - addr;
5555   execution_address = (header->execution_address_l & 0x0ff) | ((header->execution_address_h & 0x0ff)<<8);
5656
57   if (datasize + 128 > image.length())
57   if (datasize > size - 128)
5858   {
59      mame_printf_info("Invalid snapshot size: expected 0x%04x, found 0x%04x\n", datasize, (UINT32)image.length() - 128);
60      datasize = image.length() - 128;
59      mame_printf_info("Invalid snapshot size: expected 0x%04x, found 0x%04x\n", datasize, (UINT32)size - 128);
60      datasize = size - 128;
6161   }
6262
6363   address_space &space = m_maincpu->space( AS_PROGRAM );
trunk/src/mess/drivers/rex6000.c
r24083r24084
578578   img_start = strlen((const char*)data) + 5;
579579   img_start += 0xa0;  //skip the icon (40x32 pixel)
580580
581   for (int i=0; i<image.length() - img_start ;i++)
581   for (UINT32 i=0; i<image.length() - img_start ;i++)
582582      flash.write_byte(i, data[img_start + i]);
583583
584584   auto_free(machine(), data);

Previous 199869 Revisions Next


© 1997-2024 The MAME Team