Previous 15994 Revisions Next

r5955 Sunday 4th October, 2009 at 11:02:43 UTC by Robbbert
[Z80BIN / VTECH1 / EXIDY / MBEE] Display an error if quickload/snapquick image failed to load, instead of saying nothing.
[src/mess/devices]z80bin.c
[src/mess/machine]exidy.c mbee.c vtech1.c

src/mess/machine/mbee.c
r5954r5955
240240      {
241241         j = 0x8c0 + i;
242242
243         if (image_fread(image, &data, 1) != 1) return INIT_FAIL;
243         if (image_fread(image, &data, 1) != 1)
244         {
245            image_message(image, "Unexpected EOF");
246            return INIT_FAIL;
247         }
244248
245249         if ((j < mbee_size) || (j > 0xefff))
246250            memory_write_byte(space, j, data);
247251         else
252         {
253            image_message(image, "Not enough memory in this microbee");
248254            return INIT_FAIL;
255         }
249256      }
250257
251258      if (sw)
r5954r5955
263270      {
264271         j = 0x100 + i;
265272
266         if (image_fread(image, &data, 1) != 1) return INIT_FAIL;
273         if (image_fread(image, &data, 1) != 1)
274         {
275            image_message(image, "Unexpected EOF");
276            return INIT_FAIL;
277         }
267278
268279         if ((j < mbee_size) || (j > 0xefff))
269280            memory_write_byte(space, j, data);
270281         else
282         {
283            image_message(image, "Not enough memory in this microbee");
271284            return INIT_FAIL;
285         }
272286      }
273287
274288      if (sw) cpu_set_reg(cpu, REG_GENPC, 0x100);
src/mess/machine/vtech1.c
r5954r5955
197197      char message[256];
198198      snprintf(message, ARRAY_LENGTH(message), "SNAPLOAD: %s\nInsufficient RAM - need %04X",pgmname,size);
199199      image_seterror(image, IMAGE_ERROR_INVALIDIMAGE, message);
200      image_message(image, "SNAPLOAD: %s\nInsufficient RAM - need %04X",pgmname,size);
200201      return INIT_FAIL;
201202   }
202203
r5954r5955
227228
228229   default:
229230      image_seterror(image, IMAGE_ERROR_UNSUPPORTED, "Snapshot format not supported.");
231      image_message(image, "Snapshot format not supported.");
230232      return INIT_FAIL;
231233   }
232234
src/mess/machine/exidy.c
r5954r5955
405405   if (snapshot_size != 0x1001c)
406406   {
407407      image_seterror(image, IMAGE_ERROR_INVALIDIMAGE, "Snapshot must be 65564 bytes");
408      image_message(image, "Snapshot must be 65564 bytes");
408409      return INIT_FAIL;
409410   }
410411
src/mess/devices/z80bin.c
r5954r5955
4242      if (ch == EOF)
4343      {
4444         image_seterror(image, IMAGE_ERROR_INVALIDIMAGE, "Unexpected EOF while getting file name");
45         image_message(image, " Unexpected EOF while getting file name");
4546         return INIT_FAIL;
4647      }
4748
r5954r5955
5051         if (i >= (ARRAY_LENGTH(pgmname) - 1))
5152         {
5253            image_seterror(image, IMAGE_ERROR_INVALIDIMAGE, "File name too long");
54            image_message(image, " File name too long");
5355            return INIT_FAIL;
5456         }
5557
r5954r5955
6365   if (image_fread(image, args, sizeof(args)) != sizeof(args))
6466   {
6567      image_seterror(image, IMAGE_ERROR_INVALIDIMAGE, "Unexpected EOF while getting file size");
68      image_message(image, " Unexpected EOF while getting file size");
6669      return INIT_FAIL;
6770   }
6871
r5954r5955
8285      {
8386         snprintf(message, ARRAY_LENGTH(message), "%s: Unexpected EOF while writing byte to %04X", pgmname, (unsigned) j);
8487         image_seterror(image, IMAGE_ERROR_INVALIDIMAGE, message);
88         image_message(image, "%s: Unexpected EOF while writing byte to %04X", pgmname, (unsigned) j);
8589         return INIT_FAIL;
8690      }
8791      memory_write_byte(cputag_get_address_space(image->machine,"maincpu",ADDRESS_SPACE_PROGRAM), j, data);

Previous 15994 Revisions Next


© 1998-2018 The MESS Team