summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/ui/info.c
blob: ba4fa24977a942721ba855babd7b8cd96cbb2861 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
/***************************************************************************

    ui/info.c

    System and image info screens

    Copyright Nicola Salmoria and the MAME Team.
    Visit http://mamedev.org for licensing and usage restrictions.

***************************************************************************/

#include "emu.h"
#include "ui/menu.h"
#include "ui/info.h"
#include "ui/ui.h"

/*-------------------------------------------------
  menu_game_info - handle the game information
  menu
 -------------------------------------------------*/

ui_menu_game_info::ui_menu_game_info(running_machine &machine, render_container *container) : ui_menu(machine, container)
{
}

ui_menu_game_info::~ui_menu_game_info()
{
}

void ui_menu_game_info::populate()
{
	astring tempstring;
	item_append(machine().ui().game_info_astring(tempstring), NULL, MENU_FLAG_MULTILINE, NULL);
}

void ui_menu_game_info::handle()
{
	// process the menu
	process(0);
}


/*-------------------------------------------------
  ui_menu_image_info - handle the image information
  menu
 -------------------------------------------------*/

ui_menu_image_info::ui_menu_image_info(running_machine &machine, render_container *container) : ui_menu(machine, container)
{
}

ui_menu_image_info::~ui_menu_image_info()
{
}

void ui_menu_image_info::populate()
{
	item_append(machine().system().description, NULL, MENU_FLAG_DISABLE, NULL);
	item_append("", NULL, MENU_FLAG_DISABLE, NULL);

	image_interface_iterator iter(machine().root_device());
	for (device_image_interface *image = iter.first(); image != NULL; image = iter.next())
			image_info(image);
}

void ui_menu_image_info::handle()
{
	// process the menu
	process(0);
}


/*-------------------------------------------------
  image_info - display image info for a specific
  image interface device
-------------------------------------------------*/

void ui_menu_image_info::image_info(device_image_interface *image)
{
	if (image->exists())
	{
		// display device type and filename
		item_append(image->brief_instance_name(), image->basename(), 0, NULL);

		// if image has been loaded through softlist, let's add some more info
		if (image->software_entry())
		{
			astring string;

			// display long filename
			item_append(image->longname(), "", MENU_FLAG_DISABLE, NULL);

			// display manufacturer and year
			string.catprintf("%s, %s", image->manufacturer(), image->year());
			item_append(string, "", MENU_FLAG_DISABLE, NULL);

			// display supported information, if available
			switch (image->supported())
			{
				case SOFTWARE_SUPPORTED_NO:
					item_append("Not supported", "", MENU_FLAG_DISABLE, NULL);
					break;
				case SOFTWARE_SUPPORTED_PARTIAL:
					item_append("Partially supported", "", MENU_FLAG_DISABLE, NULL);
					break;
				default:
					break;
			}
		}
	}
	else
		item_append(image->brief_instance_name(), "[empty]", 0, NULL);
	item_append("", NULL, MENU_FLAG_DISABLE, NULL);
}