trunk/src/emu/ui/imginfo.c
| r242968 | r242969 | |
| 1 | | /*************************************************************************** |
| 2 | | |
| 3 | | ui/imginfo.c |
| 4 | | |
| 5 | | Image info screen |
| 6 | | |
| 7 | | Copyright Nicola Salmoria and the MAME Team. |
| 8 | | Visit http://mamedev.org for licensing and usage restrictions. |
| 9 | | |
| 10 | | ***************************************************************************/ |
| 11 | | |
| 12 | | #include "emu.h" |
| 13 | | #include "ui/menu.h" |
| 14 | | #include "ui/imginfo.h" |
| 15 | | |
| 16 | | |
| 17 | | /*************************************************************************** |
| 18 | | IMPLEMENTATION |
| 19 | | ***************************************************************************/ |
| 20 | | |
| 21 | | //------------------------------------------------- |
| 22 | | // ctor |
| 23 | | //------------------------------------------------- |
| 24 | | |
| 25 | | ui_menu_image_info::ui_menu_image_info(running_machine &machine, render_container *container) : ui_menu(machine, container) |
| 26 | | { |
| 27 | | } |
| 28 | | |
| 29 | | |
| 30 | | //------------------------------------------------- |
| 31 | | // dtor |
| 32 | | //------------------------------------------------- |
| 33 | | |
| 34 | | ui_menu_image_info::~ui_menu_image_info() |
| 35 | | { |
| 36 | | } |
| 37 | | |
| 38 | | |
| 39 | | //------------------------------------------------- |
| 40 | | // populate |
| 41 | | //------------------------------------------------- |
| 42 | | |
| 43 | | void ui_menu_image_info::populate() |
| 44 | | { |
| 45 | | item_append(machine().system().description, NULL, MENU_FLAG_DISABLE, NULL); |
| 46 | | item_append("", NULL, MENU_FLAG_DISABLE, NULL); |
| 47 | | |
| 48 | | image_interface_iterator iter(machine().root_device()); |
| 49 | | for (device_image_interface *image = iter.first(); image != NULL; image = iter.next()) |
| 50 | | image_info(image); |
| 51 | | } |
| 52 | | |
| 53 | | |
| 54 | | //------------------------------------------------- |
| 55 | | // handle |
| 56 | | //------------------------------------------------- |
| 57 | | |
| 58 | | void ui_menu_image_info::handle() |
| 59 | | { |
| 60 | | // process the menu |
| 61 | | process(0); |
| 62 | | } |
| 63 | | |
| 64 | | |
| 65 | | //------------------------------------------------- |
| 66 | | // image_info - display image info for a specific |
| 67 | | // image interface device |
| 68 | | //------------------------------------------------- |
| 69 | | |
| 70 | | void ui_menu_image_info::image_info(device_image_interface *image) |
| 71 | | { |
| 72 | | if (image->exists()) |
| 73 | | { |
| 74 | | // display device type and filename |
| 75 | | item_append(image->brief_instance_name(), image->basename(), 0, NULL); |
| 76 | | |
| 77 | | // if image has been loaded through softlist, let's add some more info |
| 78 | | if (image->software_entry()) |
| 79 | | { |
| 80 | | astring string; |
| 81 | | |
| 82 | | // display long filename |
| 83 | | item_append(image->longname(), "", MENU_FLAG_DISABLE, NULL); |
| 84 | | |
| 85 | | // display manufacturer and year |
| 86 | | string.catprintf("%s, %s", image->manufacturer(), image->year()); |
| 87 | | item_append(string, "", MENU_FLAG_DISABLE, NULL); |
| 88 | | |
| 89 | | // display supported information, if available |
| 90 | | switch (image->supported()) |
| 91 | | { |
| 92 | | case SOFTWARE_SUPPORTED_NO: |
| 93 | | item_append("Not supported", "", MENU_FLAG_DISABLE, NULL); |
| 94 | | break; |
| 95 | | case SOFTWARE_SUPPORTED_PARTIAL: |
| 96 | | item_append("Partially supported", "", MENU_FLAG_DISABLE, NULL); |
| 97 | | break; |
| 98 | | default: |
| 99 | | break; |
| 100 | | } |
| 101 | | } |
| 102 | | } |
| 103 | | else |
| 104 | | item_append(image->brief_instance_name(), "[empty]", 0, NULL); |
| 105 | | item_append("", NULL, MENU_FLAG_DISABLE, NULL); |
| 106 | | } |
trunk/src/emu/ui/info.c
| r0 | r242969 | |
| 1 | /*************************************************************************** |
| 2 | |
| 3 | ui/info.c |
| 4 | |
| 5 | System and image info screens |
| 6 | |
| 7 | Copyright Nicola Salmoria and the MAME Team. |
| 8 | Visit http://mamedev.org for licensing and usage restrictions. |
| 9 | |
| 10 | ***************************************************************************/ |
| 11 | |
| 12 | #include "emu.h" |
| 13 | #include "ui/menu.h" |
| 14 | #include "ui/info.h" |
| 15 | #include "ui/ui.h" |
| 16 | |
| 17 | /*------------------------------------------------- |
| 18 | menu_game_info - handle the game information |
| 19 | menu |
| 20 | -------------------------------------------------*/ |
| 21 | |
| 22 | ui_menu_game_info::ui_menu_game_info(running_machine &machine, render_container *container) : ui_menu(machine, container) |
| 23 | { |
| 24 | } |
| 25 | |
| 26 | ui_menu_game_info::~ui_menu_game_info() |
| 27 | { |
| 28 | } |
| 29 | |
| 30 | void ui_menu_game_info::populate() |
| 31 | { |
| 32 | astring tempstring; |
| 33 | item_append(machine().ui().game_info_astring(tempstring), NULL, MENU_FLAG_MULTILINE, NULL); |
| 34 | } |
| 35 | |
| 36 | void ui_menu_game_info::handle() |
| 37 | { |
| 38 | // process the menu |
| 39 | process(0); |
| 40 | } |
| 41 | |
| 42 | |
| 43 | /*------------------------------------------------- |
| 44 | ui_menu_image_info - handle the image information |
| 45 | menu |
| 46 | -------------------------------------------------*/ |
| 47 | |
| 48 | ui_menu_image_info::ui_menu_image_info(running_machine &machine, render_container *container) : ui_menu(machine, container) |
| 49 | { |
| 50 | } |
| 51 | |
| 52 | ui_menu_image_info::~ui_menu_image_info() |
| 53 | { |
| 54 | } |
| 55 | |
| 56 | void ui_menu_image_info::populate() |
| 57 | { |
| 58 | item_append(machine().system().description, NULL, MENU_FLAG_DISABLE, NULL); |
| 59 | item_append("", NULL, MENU_FLAG_DISABLE, NULL); |
| 60 | |
| 61 | image_interface_iterator iter(machine().root_device()); |
| 62 | for (device_image_interface *image = iter.first(); image != NULL; image = iter.next()) |
| 63 | image_info(image); |
| 64 | } |
| 65 | |
| 66 | void ui_menu_image_info::handle() |
| 67 | { |
| 68 | // process the menu |
| 69 | process(0); |
| 70 | } |
| 71 | |
| 72 | |
| 73 | /*------------------------------------------------- |
| 74 | image_info - display image info for a specific |
| 75 | image interface device |
| 76 | -------------------------------------------------*/ |
| 77 | |
| 78 | void ui_menu_image_info::image_info(device_image_interface *image) |
| 79 | { |
| 80 | if (image->exists()) |
| 81 | { |
| 82 | // display device type and filename |
| 83 | item_append(image->brief_instance_name(), image->basename(), 0, NULL); |
| 84 | |
| 85 | // if image has been loaded through softlist, let's add some more info |
| 86 | if (image->software_entry()) |
| 87 | { |
| 88 | astring string; |
| 89 | |
| 90 | // display long filename |
| 91 | item_append(image->longname(), "", MENU_FLAG_DISABLE, NULL); |
| 92 | |
| 93 | // display manufacturer and year |
| 94 | string.catprintf("%s, %s", image->manufacturer(), image->year()); |
| 95 | item_append(string, "", MENU_FLAG_DISABLE, NULL); |
| 96 | |
| 97 | // display supported information, if available |
| 98 | switch (image->supported()) |
| 99 | { |
| 100 | case SOFTWARE_SUPPORTED_NO: |
| 101 | item_append("Not supported", "", MENU_FLAG_DISABLE, NULL); |
| 102 | break; |
| 103 | case SOFTWARE_SUPPORTED_PARTIAL: |
| 104 | item_append("Partially supported", "", MENU_FLAG_DISABLE, NULL); |
| 105 | break; |
| 106 | default: |
| 107 | break; |
| 108 | } |
| 109 | } |
| 110 | } |
| 111 | else |
| 112 | item_append(image->brief_instance_name(), "[empty]", 0, NULL); |
| 113 | item_append("", NULL, MENU_FLAG_DISABLE, NULL); |
| 114 | } |
trunk/src/emu/ui/info.h
| r0 | r242969 | |
| 1 | /*************************************************************************** |
| 2 | |
| 3 | ui/info.h |
| 4 | |
| 5 | System and image info screens |
| 6 | |
| 7 | Copyright Nicola Salmoria and the MAME Team. |
| 8 | Visit http://mamedev.org for licensing and usage restrictions. |
| 9 | |
| 10 | ***************************************************************************/ |
| 11 | |
| 12 | #pragma once |
| 13 | |
| 14 | #ifndef __UI_INFO_H__ |
| 15 | #define __UI_INFO_H__ |
| 16 | |
| 17 | class ui_menu_game_info : public ui_menu { |
| 18 | public: |
| 19 | ui_menu_game_info(running_machine &machine, render_container *container); |
| 20 | virtual ~ui_menu_game_info(); |
| 21 | virtual void populate(); |
| 22 | virtual void handle(); |
| 23 | }; |
| 24 | |
| 25 | |
| 26 | class ui_menu_image_info : public ui_menu |
| 27 | { |
| 28 | public: |
| 29 | ui_menu_image_info(running_machine &machine, render_container *container); |
| 30 | virtual ~ui_menu_image_info(); |
| 31 | virtual void populate(); |
| 32 | virtual void handle(); |
| 33 | |
| 34 | private: |
| 35 | void image_info(device_image_interface *image); |
| 36 | }; |
| 37 | |
| 38 | #endif // __UI_INFO_H__ |
trunk/src/emu/ui/miscmenu.c
| r242968 | r242969 | |
| 19 | 19 | #include "rendutil.h" |
| 20 | 20 | |
| 21 | 21 | #include "uiinput.h" |
| 22 | | #include "ui/ui.h" |
| 23 | 22 | #include "ui/miscmenu.h" |
| 24 | 23 | #include "ui/filemngr.h" |
| 25 | 24 | |
| r242968 | r242969 | |
| 305 | 304 | |
| 306 | 305 | |
| 307 | 306 | /*------------------------------------------------- |
| 308 | | menu_game_info - handle the game information |
| 309 | | menu |
| 310 | | -------------------------------------------------*/ |
| 311 | | |
| 312 | | ui_menu_game_info::ui_menu_game_info(running_machine &machine, render_container *container) : ui_menu(machine, container) |
| 313 | | { |
| 314 | | } |
| 315 | | |
| 316 | | void ui_menu_game_info::populate() |
| 317 | | { |
| 318 | | astring tempstring; |
| 319 | | item_append(machine().ui().game_info_astring(tempstring), NULL, MENU_FLAG_MULTILINE, NULL); |
| 320 | | } |
| 321 | | |
| 322 | | void ui_menu_game_info::handle() |
| 323 | | { |
| 324 | | /* process the menu */ |
| 325 | | process(0); |
| 326 | | } |
| 327 | | |
| 328 | | ui_menu_game_info::~ui_menu_game_info() |
| 329 | | { |
| 330 | | } |
| 331 | | |
| 332 | | /*------------------------------------------------- |
| 333 | 307 | menu_cheat - handle the cheat menu |
| 334 | 308 | -------------------------------------------------*/ |
| 335 | 309 | |