Previous 15994 Revisions Next

r2430 Tuesday 22nd April, 2008 at 12:56:54 UTC by Nathan Woods
Created a image_message() API to provide a standard way to display messages;
updated the z80bin device
[src/mess]image.c image.h
[src/mess/devices]z80bin.c

src/mess/devices/z80bin.c
r2429r2430
7070
7171   size = (end_addr[0] - start_addr[0] + 1) & 0xffff;
7272
73   logerror("%s\nsize=%04X : start=%04X : end=%04X : exec=%04X",pgmname,size,start_addr[0],end_addr[0],exec_addr[0]);
73   /* display a message about the loaded quickload */
74   image_message(image, "size=%04X : start=%04X : end=%04X : exec=%04X", size,start_addr[0],end_addr[0],exec_addr[0]);
7475
7576   for (i = 0; i < size; i++)
7677   {
src/mess/image.c
r2429r2430
2121#include "hashfile.h"
2222#include "mamecore.h"
2323#include "messopts.h"
24#include "ui.h"
2425
2526
2627
r2429r2430
11531154
11541155
11551156
1157/*-------------------------------------------------
1158    image_message - used to display a message while
1159   loading
1160-------------------------------------------------*/
1161
1162void image_message(const device_config *device, const char *format, ...)
1163{
1164   image_slot_data *slot;
1165   va_list args;
1166   char buffer[256];
1167
1168   /* sanity checks */
1169   slot = find_image_slot(device);
1170   assert(is_loaded(slot) || slot->is_loading);
1171
1172   /* format the message */
1173   va_start(args, format);
1174   vsnprintf(buffer, ARRAY_LENGTH(buffer), format, args);
1175   va_end(args);
1176
1177   /* display the popup for a standard amount of time */
1178   ui_popup_time(10, "%s: %s",
1179      image_basename(device),
1180      buffer);
1181}
1182
1183
1184
11561185/****************************************************************************
11571186  Hash info loading
11581187
src/mess/image.h
r2429r2430
174174/* used to set the error that occured during image loading */
175175void image_seterror(const device_config *img, image_error_t err, const char *message);
176176
177/* used to display a message while loading */
178void image_message(const device_config *device, const char *format, ...);
177179
178180
181
179182/****************************************************************************
180183  Accessor functions
181184

Previous 15994 Revisions Next


© 1998-2018 The MESS Team