summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/machine/z80bin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/machine/z80bin.cpp')
-rw-r--r--src/mame/machine/z80bin.cpp38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/mame/machine/z80bin.cpp b/src/mame/machine/z80bin.cpp
index 5da1dafe9f7..9fdf4183e1a 100644
--- a/src/mame/machine/z80bin.cpp
+++ b/src/mame/machine/z80bin.cpp
@@ -8,7 +8,7 @@
memory
-------------------------------------------------*/
-image_init_result z80bin_load_file(device_image_interface *image, address_space &space, const char *file_type, uint16_t *exec_addr, uint16_t *start_addr, uint16_t *end_addr)
+image_init_result z80bin_load_file(device_image_interface &image, address_space &space, uint16_t &exec_addr, uint16_t &start_addr, uint16_t &end_addr)
{
int ch;
uint16_t args[3];
@@ -17,14 +17,14 @@ image_init_result z80bin_load_file(device_image_interface *image, address_space
char pgmname[256];
char message[512];
- image->fseek(7, SEEK_SET);
+ image.fseek(7, SEEK_SET);
- while((ch = image->fgetc()) != 0x1A)
+ while((ch = image.fgetc()) != 0x1A)
{
if (ch == EOF)
{
- image->seterror(IMAGE_ERROR_INVALIDIMAGE, "Unexpected EOF while getting file name");
- image->message(" Unexpected EOF while getting file name");
+ image.seterror(IMAGE_ERROR_INVALIDIMAGE, "Unexpected EOF while getting file name");
+ image.message(" Unexpected EOF while getting file name");
return image_init_result::FAIL;
}
@@ -32,8 +32,8 @@ image_init_result z80bin_load_file(device_image_interface *image, address_space
{
if (i >= (ARRAY_LENGTH(pgmname) - 1))
{
- image->seterror(IMAGE_ERROR_INVALIDIMAGE, "File name too long");
- image->message(" File name too long");
+ image.seterror(IMAGE_ERROR_INVALIDIMAGE, "File name too long");
+ image.message(" File name too long");
return image_init_result::FAIL;
}
@@ -44,30 +44,30 @@ image_init_result z80bin_load_file(device_image_interface *image, address_space
pgmname[i] = '\0'; /* terminate string with a null */
- if (image->fread(args, sizeof(args)) != sizeof(args))
+ if (image.fread(args, sizeof(args)) != sizeof(args))
{
- image->seterror(IMAGE_ERROR_INVALIDIMAGE, "Unexpected EOF while getting file size");
- image->message(" Unexpected EOF while getting file size");
+ image.seterror(IMAGE_ERROR_INVALIDIMAGE, "Unexpected EOF while getting file size");
+ image.message(" Unexpected EOF while getting file size");
return image_init_result::FAIL;
}
- exec_addr[0] = little_endianize_int16(args[0]);
- start_addr[0] = little_endianize_int16(args[1]);
- end_addr[0] = little_endianize_int16(args[2]);
+ exec_addr = little_endianize_int16(args[0]);
+ start_addr = little_endianize_int16(args[1]);
+ end_addr = little_endianize_int16(args[2]);
- size = (end_addr[0] - start_addr[0] + 1) & 0xffff;
+ size = (end_addr - start_addr + 1) & 0xffff;
/* display a message about the loaded quickload */
- image->message(" %s\nsize=%04X : start=%04X : end=%04X : exec=%04X",pgmname,size,start_addr[0],end_addr[0],exec_addr[0]);
+ image.message(" %s\nsize=%04X : start=%04X : end=%04X : exec=%04X",pgmname,size,start_addr,end_addr,exec_addr);
for (i = 0; i < size; i++)
{
- j = (start_addr[0] + i) & 0xffff;
- if (image->fread(&data, 1) != 1)
+ j = (start_addr + i) & 0xffff;
+ if (image.fread(&data, 1) != 1)
{
snprintf(message, ARRAY_LENGTH(message), "%s: Unexpected EOF while writing byte to %04X", pgmname, (unsigned) j);
- image->seterror(IMAGE_ERROR_INVALIDIMAGE, message);
- image->message("%s: Unexpected EOF while writing byte to %04X", pgmname, (unsigned) j);
+ image.seterror(IMAGE_ERROR_INVALIDIMAGE, message);
+ image.message("%s: Unexpected EOF while writing byte to %04X", pgmname, (unsigned) j);
return image_init_result::FAIL;
}
space.write_byte(j, data);