Exemplo n.º 1
0
UINT32 ui_menu_image_info(UINT32 state)
{
    char buf[2048];
    char *bufptr = buf;
    int selected = 0;

    /* add the game info */
    bufptr += ui_sprintf_image_info(bufptr);

    /* make it look like a menu */
    bufptr += sprintf(bufptr, "\n\t%s %s %s", ui_getstring(UI_lefthilight), ui_getstring(UI_returntomain), ui_getstring(UI_righthilight));

    /* draw the text */
    ui_draw_message_window(buf);

    /* handle the keys */
    ui_menu_generic_keys(&selected, 1);
    return selected;
}
Exemplo n.º 2
0
static const char *default_device_name(const struct IODevice *dev, int id,
	char *buf, size_t bufsize)
{
	const char *name;

	/* use the cool new device string technique */
	name = device_get_info_string(&dev->devclass, DEVINFO_STR_DESCRIPTION+id);
	if (name)
	{
		snprintf(buf, bufsize, "%s", name);
		return buf;
	}

	name = ui_getstring((UI_cartridge - IO_CARTSLOT) + dev->type);
	if (dev->count > 1)
	{
		/* for the average user counting starts at #1 ;-) */
		snprintf(buf, bufsize, "%s #%d", name, id + 1);
		name = buf;
	}
	return name;
}
Exemplo n.º 3
0
void mess_ui_update(void)
{
    static int ui_toggle_key = 0;
    static int ui_display_count = 30;

    char buf[2048];
    int id;
    const struct IODevice *dev;

    /* traditional MESS interface */
    if (Machine->gamedrv->flags & GAME_COMPUTER)
    {
        if( input_ui_pressed(IPT_UI_TOGGLE_UI) )
        {
            if( !ui_toggle_key )
            {
                ui_toggle_key = 1;
                ui_active = !ui_active;
                ui_display_count = 30;
                schedule_full_refresh();
            }
        }
        else
        {
            ui_toggle_key = 0;
        }

        if (ui_active)
        {
            if( ui_display_count > 0 )
            {
                buf[0] = 0;
                strcpy(buf,ui_getstring (UI_keyb1));
                strcat(buf,"\n");
                strcat(buf,ui_getstring (UI_keyb2));
                strcat(buf,"\n");
                strcat(buf,ui_getstring (UI_keyb3));
                strcat(buf,"\n");
                strcat(buf,ui_getstring (UI_keyb5));
                strcat(buf,"\n");
                strcat(buf,ui_getstring (UI_keyb2));
                strcat(buf,"\n");
                strcat(buf,ui_getstring (UI_keyb7));
                strcat(buf,"\n");
                ui_draw_message_window(buf);

                if( --ui_display_count == 0 )
                    schedule_full_refresh();
            }
        }
        else
        {
            if( ui_display_count > 0 )
            {
                buf[0] = 0;
                strcpy(buf,ui_getstring (UI_keyb1));
                strcat(buf,"\n");
                strcat(buf,ui_getstring (UI_keyb2));
                strcat(buf,"\n");
                strcat(buf,ui_getstring (UI_keyb4));
                strcat(buf,"\n");
                strcat(buf,ui_getstring (UI_keyb6));
                strcat(buf,"\n");
                strcat(buf,ui_getstring (UI_keyb2));
                strcat(buf,"\n");
                strcat(buf,ui_getstring (UI_keyb7));
                strcat(buf,"\n");
                ui_draw_message_window(buf);

                if( --ui_display_count == 0 )
                    schedule_full_refresh();
            }
        }
    }

    /* run display routine for device */
    if (devices_inited)
    {
        for (dev = Machine->devices; dev->type < IO_COUNT; dev++)
        {
            if (dev->display)
            {
                for (id = 0; id < device_count(dev->type); id++)
                {
                    mess_image *img = image_from_devtype_and_index(dev->type, id);
                    dev->display(img, NULL);
                }
            }
        }
    }
}