summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/ui
diff options
context:
space:
mode:
Diffstat (limited to 'src/emu/ui')
-rw-r--r--src/emu/ui/barcode.c28
-rw-r--r--src/emu/ui/barcode.h2
-rw-r--r--src/emu/ui/devctrl.h6
-rw-r--r--src/emu/ui/filemngr.c2
-rw-r--r--src/emu/ui/filesel.c24
-rw-r--r--src/emu/ui/filesel.h40
-rw-r--r--src/emu/ui/imgcntrl.c2
-rw-r--r--src/emu/ui/imginfo.c2
-rw-r--r--src/emu/ui/mainmenu.c4
-rw-r--r--src/emu/ui/menu.c204
-rw-r--r--src/emu/ui/menu.h96
-rw-r--r--src/emu/ui/selgame.c6
-rw-r--r--src/emu/ui/selgame.h8
-rw-r--r--src/emu/ui/swlist.c2
-rw-r--r--src/emu/ui/swlist.h26
-rw-r--r--src/emu/ui/ui.c186
-rw-r--r--src/emu/ui/ui.h32
-rw-r--r--src/emu/ui/viewgfx.c54
18 files changed, 360 insertions, 364 deletions
diff --git a/src/emu/ui/barcode.c b/src/emu/ui/barcode.c
index a5c7db0c9dd..fcf1b06444a 100644
--- a/src/emu/ui/barcode.c
+++ b/src/emu/ui/barcode.c
@@ -1,9 +1,9 @@
/***************************************************************************
- ui/barcode.c
-
- MESS's "barcode reader" control
-
+ ui/barcode.c
+
+ MESS's "barcode reader" control
+
Copyright Nicola Salmoria and the MAME Team.
Visit http://mamedev.org for licensing and usage restrictions.
@@ -21,9 +21,9 @@
/**************************************************
-
+
BARCODE INPUT MENU
-
+
**************************************************/
@@ -67,7 +67,7 @@ void ui_menu_barcode_code::populate()
}
item_append("New Barcode:", new_barcode, 0, ITEMREF_NEW_BARCODE);
-
+
// finish up the menu
item_append(MENU_SEPARATOR_ITEM, NULL, 0, NULL);
item_append("Enter Code", NULL, 0, ITEMREF_ENTER);
@@ -108,12 +108,12 @@ void ui_menu_barcode_code::handle()
}
}
break;
-
+
case IPT_SPECIAL:
if (get_selection() == ITEMREF_NEW_BARCODE)
{
int buflen = strlen(m_barcode_buffer);
-
+
// if it's a backspace and we can handle it, do so
if ((event->unichar == 8 || event->unichar == 0x7f) && buflen > 0)
*(char *)utf8_previous_char(&m_barcode_buffer[buflen]) = 0;
@@ -140,7 +140,7 @@ void ui_menu_barcode_code::handle()
/**************************************************
READER MENU
-
+
**************************************************/
//-------------------------------------------------
@@ -168,14 +168,14 @@ ui_menu_barcode_reader::~ui_menu_barcode_reader()
void ui_menu_barcode_reader::populate()
{
astring buffer;
-
+
barcode_reader_device_iterator iter(machine().config().root_device());
for (const barcode_reader_device *bcreader = iter.first(); bcreader != NULL; bcreader = iter.next())
{
char label[0x400];
sprintf(label,"[%s (%s)]",bcreader->name(),bcreader->basetag());
item_append(label, NULL, 0, (void *)bcreader);
- }
+ }
}
@@ -187,7 +187,7 @@ void ui_menu_barcode_reader::handle()
{
// process the menu
const ui_menu_event *event = process(0);
-
+
// process the event
if (event != NULL && event->iptkey == IPT_UI_SELECT)
{
@@ -195,6 +195,6 @@ void ui_menu_barcode_reader::handle()
{
ui_menu::stack_push(auto_alloc_clear(machine(), ui_menu_barcode_code(machine(), container, (barcode_reader_device *)event->itemref)));
}
-
+
}
}
diff --git a/src/emu/ui/barcode.h b/src/emu/ui/barcode.h
index c467fff8f38..46dbe981ad0 100644
--- a/src/emu/ui/barcode.h
+++ b/src/emu/ui/barcode.h
@@ -22,7 +22,7 @@ public:
virtual ~ui_menu_barcode_code();
virtual void populate();
virtual void handle();
-
+
private:
barcode_reader_device *m_reader;
char m_barcode_buffer[20];
diff --git a/src/emu/ui/devctrl.h b/src/emu/ui/devctrl.h
index 5cc246cb567..24a7b743d8b 100644
--- a/src/emu/ui/devctrl.h
+++ b/src/emu/ui/devctrl.h
@@ -23,7 +23,7 @@ public:
protected:
_DeviceType *current_device() { return m_device; }
int count() { return m_count; }
-
+
int current_index();
void previous();
void next();
@@ -32,8 +32,8 @@ private:
// device iterator
typedef device_type_iterator<&device_creator<_DeviceType>, _DeviceType> iterator;
- _DeviceType * m_device;
- int m_count;
+ _DeviceType * m_device;
+ int m_count;
};
diff --git a/src/emu/ui/filemngr.c b/src/emu/ui/filemngr.c
index 1650145277d..ef7bb0838e1 100644
--- a/src/emu/ui/filemngr.c
+++ b/src/emu/ui/filemngr.c
@@ -134,5 +134,3 @@ void ui_menu_file_manager::handle()
}
}
}
-
-
diff --git a/src/emu/ui/filesel.c b/src/emu/ui/filesel.c
index ed275f255a5..403ccb4268e 100644
--- a/src/emu/ui/filesel.c
+++ b/src/emu/ui/filesel.c
@@ -203,14 +203,14 @@ static int is_valid_filename_char(unicode_char unichar)
// this should really be in the OSD layer
static const char valid_filename_char[] =
{
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 00-0f
- 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 10-1f
- 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, // !"#$%&'()*+,-./
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, // 0123456789:;<=>?
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // @ABCDEFGHIJKLMNO
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, // PQRSTUVWXYZ[\]^_
- 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // `abcdefghijklmno
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, // pqrstuvwxyz{|}~
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 00-0f
+ 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 10-1f
+ 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, // !"#$%&'()*+,-./
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, // 0123456789:;<=>?
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // @ABCDEFGHIJKLMNO
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, // PQRSTUVWXYZ[\]^_
+ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // `abcdefghijklmno
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, // pqrstuvwxyz{|}~
};
return (unichar < ARRAY_LENGTH(valid_filename_char)) && valid_filename_char[unichar];
}
@@ -222,8 +222,8 @@ static int is_valid_filename_char(unicode_char unichar)
ui_menu_file_create::ui_menu_file_create(running_machine &machine, render_container *container, device_image_interface *image, astring &current_directory, astring &current_file)
: ui_menu(machine, container),
- m_current_directory(current_directory),
- m_current_file(current_file)
+ m_current_directory(current_directory),
+ m_current_file(current_file)
{
m_image = image;
}
@@ -344,8 +344,8 @@ void ui_menu_file_create::handle()
ui_menu_file_selector::ui_menu_file_selector(running_machine &machine, render_container *container, device_image_interface *image, astring &current_directory, astring &current_file, bool has_empty, bool has_softlist, bool has_create, int *result)
: ui_menu(machine, container),
- m_current_directory(current_directory),
- m_current_file(current_file)
+ m_current_directory(current_directory),
+ m_current_file(current_file)
{
m_image = image;
m_has_empty = has_empty;
diff --git a/src/emu/ui/filesel.h b/src/emu/ui/filesel.h
index 4e741a8e4a3..f32e87cf7b7 100644
--- a/src/emu/ui/filesel.h
+++ b/src/emu/ui/filesel.h
@@ -41,11 +41,11 @@ public:
virtual void custom_render(void *selectedref, float top, float bottom, float x, float y, float x2, float y2);
private:
- device_image_interface * m_image;
- astring & m_current_directory;
- astring & m_current_file;
- const image_device_format * m_current_format;
- char m_filename_buffer[1024];
+ device_image_interface * m_image;
+ astring & m_current_directory;
+ astring & m_current_file;
+ const image_device_format * m_current_format;
+ char m_filename_buffer[1024];
};
@@ -82,15 +82,15 @@ private:
};
// internal state
- device_image_interface * m_image;
- astring & m_current_directory;
- astring & m_current_file;
- bool m_has_empty;
- bool m_has_softlist;
- bool m_has_create;
- int * m_result;
- file_selector_entry * m_entrylist;
- char m_filename_buffer[1024];
+ device_image_interface * m_image;
+ astring & m_current_directory;
+ astring & m_current_file;
+ bool m_has_empty;
+ bool m_has_softlist;
+ bool m_has_create;
+ int * m_result;
+ file_selector_entry * m_entrylist;
+ char m_filename_buffer[1024];
// methods
int compare_entries(const file_selector_entry *e1, const file_selector_entry *e2);
@@ -113,10 +113,10 @@ public:
private:
// internal state
- floppy_image_format_t ** m_formats;
- int m_ext_match;
- int m_total_usable;
- int * m_result;
+ floppy_image_format_t ** m_formats;
+ int m_ext_match;
+ int m_total_usable;
+ int * m_result;
};
@@ -134,8 +134,8 @@ public:
private:
// internal state
- bool m_can_in_place;
- int * m_result;
+ bool m_can_in_place;
+ int * m_result;
};
// helper
diff --git a/src/emu/ui/imgcntrl.c b/src/emu/ui/imgcntrl.c
index 82b37b376fb..7d451863d5f 100644
--- a/src/emu/ui/imgcntrl.c
+++ b/src/emu/ui/imgcntrl.c
@@ -119,7 +119,7 @@ void ui_menu_control_device_image::test_create(bool &can_create, bool &need_conf
need_confirm = false;
break;
}
-
+
if (entry != NULL)
osd_free(entry);
}
diff --git a/src/emu/ui/imginfo.c b/src/emu/ui/imginfo.c
index 2eaccfdaee6..9fc80b82a07 100644
--- a/src/emu/ui/imginfo.c
+++ b/src/emu/ui/imginfo.c
@@ -186,5 +186,3 @@ void ui_menu_image_info::image_info_astring(running_machine &machine, astring &s
}
}
}
-
-
diff --git a/src/emu/ui/mainmenu.c b/src/emu/ui/mainmenu.c
index 5b48a80c153..341a3c1dc01 100644
--- a/src/emu/ui/mainmenu.c
+++ b/src/emu/ui/mainmenu.c
@@ -246,11 +246,11 @@ void ui_menu_main::handle()
case BIOS_SELECTION:
ui_menu::stack_push(auto_alloc_clear(machine(), ui_menu_bios_selection(machine(), container)));
break;
-
+
case BARCODE_READ:
ui_menu::stack_push(auto_alloc_clear(machine(), ui_menu_barcode_reader(machine(), container)));
break;
-
+
default:
fatalerror("ui_menu_main::handle - unknown reference\n");
}
diff --git a/src/emu/ui/menu.c b/src/emu/ui/menu.c
index 3e35ee3a6c5..6e5c8f09297 100644
--- a/src/emu/ui/menu.c
+++ b/src/emu/ui/menu.c
@@ -83,10 +83,10 @@ void ui_menu::init(running_machine &machine)
{
int x;
- // initialize the menu stack
+ // initialize the menu stack
ui_menu::stack_reset(machine);
- // create a texture for hilighting items
+ // create a texture for hilighting items
hilight_bitmap = auto_bitmap_rgb32_alloc(machine, 256, 1);
for (x = 0; x < 256; x++)
{
@@ -98,10 +98,10 @@ void ui_menu::init(running_machine &machine)
hilight_texture = machine.render().texture_alloc();
hilight_texture->set_bitmap(*hilight_bitmap, hilight_bitmap->cliprect(), TEXFORMAT_ARGB32);
- // create a texture for arrow icons
+ // create a texture for arrow icons
arrow_texture = machine.render().texture_alloc(render_triangle);
- // add an exit callback to free memory
+ // add an exit callback to free memory
machine.add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(ui_menu::exit), &machine));
}
@@ -112,11 +112,11 @@ void ui_menu::init(running_machine &machine)
void ui_menu::exit(running_machine &machine)
{
- // free menus
+ // free menus
ui_menu::stack_reset(machine);
ui_menu::clear_free_list(machine);
- // free textures
+ // free textures
machine.render().texture_free(hilight_texture);
machine.render().texture_free(arrow_texture);
}
@@ -146,7 +146,7 @@ ui_menu::ui_menu(running_machine &machine, render_container *_container) : m_mac
ui_menu::~ui_menu()
{
- // free the pools
+ // free the pools
while (pool)
{
ui_menu_pool *ppool = pool;
@@ -154,7 +154,7 @@ ui_menu::~ui_menu()
auto_free(machine(), ppool);
}
- // free the item array
+ // free the item array
if (item)
auto_free(machine(), item);
}
@@ -167,7 +167,7 @@ ui_menu::~ui_menu()
void ui_menu::reset(ui_menu_reset_options options)
{
- // based on the reset option, set the reset info
+ // based on the reset option, set the reset info
resetpos = 0;
resetref = NULL;
if (options == UI_MENU_RESET_REMEMBER_POSITION)
@@ -175,7 +175,7 @@ void ui_menu::reset(ui_menu_reset_options options)
else if (options == UI_MENU_RESET_REMEMBER_REF)
resetref = item[selected].ref;
- // reset all the pools and the numitems back to 0
+ // reset all the pools and the numitems back to 0
for (ui_menu_pool *ppool = pool; ppool != NULL; ppool = ppool->next)
ppool->top = (UINT8 *)(ppool + 1);
numitems = 0;
@@ -184,7 +184,7 @@ void ui_menu::reset(ui_menu_reset_options options)
astring backtext;
backtext.printf("Return to %s",emulator_info::get_capstartgamenoun());
- // add an item to return
+ // add an item to return
if (parent == NULL)
item_append(backtext.cstr(), NULL, 0, NULL);
else if (parent->is_special_main_menu())
@@ -237,15 +237,15 @@ void ui_menu::item_append(const char *text, const char *subtext, UINT32 flags, v
ui_menu_item *pitem;
int index;
- // only allow multiline as the first item
+ // only allow multiline as the first item
if ((flags & MENU_FLAG_MULTILINE) != 0)
assert(numitems == 1);
- // only allow a single multi-line item
+ // only allow a single multi-line item
else if (numitems >= 2)
assert((item[0].flags & MENU_FLAG_MULTILINE) == 0);
- // realloc the item array if necessary
+ // realloc the item array if necessary
if (numitems >= allocitems)
{
int olditems = allocitems;
@@ -258,21 +258,21 @@ void ui_menu::item_append(const char *text, const char *subtext, UINT32 flags, v
}
index = numitems++;
- // copy the previous last item to the next one
+ // copy the previous last item to the next one
if (index != 0)
{
index--;
item[index + 1] = item[index];
}
- // allocate a new item and populate it
+ // allocate a new item and populate it
pitem = &item[index];
pitem->text = (text != NULL) ? pool_strdup(text) : NULL;
pitem->subtext = (subtext != NULL) ? pool_strdup(subtext) : NULL;
pitem->flags = flags;
pitem->ref = ref;
- // update the selection if we need to
+ // update the selection if we need to
if (resetpos == index || (resetref != NULL && resetref == ref))
selected = index;
if (resetpos == numitems - 1)
@@ -287,30 +287,30 @@ void ui_menu::item_append(const char *text, const char *subtext, UINT32 flags, v
const ui_menu_event *ui_menu::process(UINT32 flags)
{
- // reset the menu_event
+ // reset the menu_event
menu_event.iptkey = IPT_INVALID;
- // first make sure our selection is valid
+ // first make sure our selection is valid
validate_selection(1);
- // draw the menu
+ // draw the menu
if (numitems > 1 && (item[0].flags & MENU_FLAG_MULTILINE) != 0)
draw_text_box();
else
draw(flags & UI_MENU_PROCESS_CUSTOM_ONLY);
- // process input
+ // process input
if (!(flags & UI_MENU_PROCESS_NOKEYS))
{
- // read events
+ // read events
handle_events();
- // handle the keys if we don't already have an menu_event
+ // handle the keys if we don't already have an menu_event
if (menu_event.iptkey == IPT_INVALID)
handle_keys(flags);
}
- // update the selected item in the menu_event
+ // update the selected item in the menu_event
if (menu_event.iptkey != IPT_INVALID && selected >= 0 && selected < numitems)
{
menu_event.itemref = item[selected].ref;
@@ -331,7 +331,7 @@ void *ui_menu::m_pool_alloc(size_t size)
assert(size < UI_MENU_POOL_SIZE);
- // find a pool with enough room
+ // find a pool with enough room
for (ppool = pool; ppool != NULL; ppool = ppool->next)
if (ppool->end - ppool->top >= size)
{
@@ -340,10 +340,10 @@ void *ui_menu::m_pool_alloc(size_t size)
return result;
}
- // allocate a new pool
+ // allocate a new pool
ppool = (ui_menu_pool *)auto_alloc_array_clear(machine(), UINT8, sizeof(*ppool) + UI_MENU_POOL_SIZE);
- // wire it up
+ // wire it up
ppool->next = pool;
pool = ppool;
ppool->top = (UINT8 *)(ppool + 1);
@@ -423,7 +423,7 @@ void ui_menu::draw(bool customonly)
INT32 mouse_target_x, mouse_target_y;
float mouse_x = -1, mouse_y = -1;
- // compute the width and height of the full menu
+ // compute the width and height of the full menu
visible_width = 0;
visible_main_menu_height = 0;
for (itemnum = 0; itemnum < numitems; itemnum++)
@@ -431,47 +431,47 @@ void ui_menu::draw(bool customonly)
const ui_menu_item &pitem = item[itemnum];
float total_width;
- // compute width of left hand side
+ // compute width of left hand side
total_width = gutter_width + machine().ui().get_string_width(pitem.text) + gutter_width;
- // add in width of right hand side
+ // add in width of right hand side
if (pitem.subtext)
total_width += 2.0f * gutter_width + machine().ui().get_string_width(pitem.subtext);
- // track the maximum
+ // track the maximum
if (total_width > visible_width)
visible_width = total_width;
- // track the height as well
+ // track the height as well
visible_main_menu_height += line_height;
}
- // account for extra space at the top and bottom
+ // account for extra space at the top and bottom
visible_extra_menu_height = customtop + custombottom;
- // add a little bit of slop for rounding
+ // add a little bit of slop for rounding
visible_width += 0.01f;
visible_main_menu_height += 0.01f;
- // if we are too wide or too tall, clamp it down
+ // if we are too wide or too tall, clamp it down
if (visible_width + 2.0f * UI_BOX_LR_BORDER > 1.0f)
visible_width = 1.0f - 2.0f * UI_BOX_LR_BORDER;
- // if the menu and extra menu won't fit, take away part of the regular menu, it will scroll
+ // if the menu and extra menu won't fit, take away part of the regular menu, it will scroll
if (visible_main_menu_height + visible_extra_menu_height + 2.0f * UI_BOX_TB_BORDER > 1.0f)
visible_main_menu_height = 1.0f - 2.0f * UI_BOX_TB_BORDER - visible_extra_menu_height;
visible_lines = floor(visible_main_menu_height / line_height);
visible_main_menu_height = (float)visible_lines * line_height;
- // compute top/left of inner menu area by centering
+ // compute top/left of inner menu area by centering
visible_left = (1.0f - visible_width) * 0.5f;
visible_top = (1.0f - (visible_main_menu_height + visible_extra_menu_height)) * 0.5f;
- // if the menu is at the bottom of the extra, adjust
+ // if the menu is at the bottom of the extra, adjust
visible_top += customtop;
- // first add us a box
+ // first add us a box
x1 = visible_left - UI_BOX_LR_BORDER;
y1 = visible_top - UI_BOX_TB_BORDER;
x2 = visible_left + visible_width + UI_BOX_LR_BORDER;
@@ -479,18 +479,18 @@ void ui_menu::draw(bool customonly)
if (!customonly)
machine().ui().draw_outlined_box(container, x1, y1, x2, y2, UI_BACKGROUND_COLOR);
- // determine the first visible line based on the current selection
+ // determine the first visible line based on the current selection
top_line = selected - visible_lines / 2;
if (top_line < 0)
top_line = 0;
if (top_line + visible_lines >= numitems)
top_line = numitems - visible_lines;
- // determine effective positions taking into account the hilighting arrows
+ // determine effective positions taking into account the hilighting arrows
effective_width = visible_width - 2.0f * gutter_width;
effective_left = visible_left + gutter_width;
- // locate mouse
+ // locate mouse
mouse_hit = false;
mouse_button = false;
if (!customonly)
@@ -501,7 +501,7 @@ void ui_menu::draw(bool customonly)
mouse_hit = true;
}
- // loop over visible lines
+ // loop over visible lines
hover = numitems + 1;
if (!customonly)
for (linenum = 0; linenum < visible_lines; linenum++)
@@ -519,11 +519,11 @@ void ui_menu::draw(bool customonly)
float line_x1 = x2 - 0.5f * UI_LINE_WIDTH;
float line_y1 = line_y + line_height;
- // set the hover if this is our item
+ // set the hover if this is our item
if (mouse_hit && line_x0 <= mouse_x && line_x1 > mouse_x && line_y0 <= mouse_y && line_y1 > mouse_y && pitem.is_selectable())
hover = itemnum;
- // if we're selected, draw with a different background
+ // if we're selected, draw with a different background
if (itemnum == selected)
{
fgcolor = UI_SELECTED_COLOR;
@@ -532,7 +532,7 @@ void ui_menu::draw(bool customonly)
fgcolor3 = UI_SELECTED_COLOR;
}
- // else if the mouse is over this item, draw with a different background
+ // else if the mouse is over this item, draw with a different background
else if (itemnum == hover)
{
fgcolor = UI_MOUSEOVER_COLOR;
@@ -541,11 +541,11 @@ void ui_menu::draw(bool customonly)
fgcolor3 = UI_MOUSEOVER_COLOR;
}
- // if we have some background hilighting to do, add a quad behind everything else
+ // if we have some background hilighting to do, add a quad behind everything else
if (bgcolor != UI_TEXT_BG_COLOR)
highlight(container, line_x0, line_y0, line_x1, line_y1, bgcolor);
- // if we're on the top line, display the up arrow
+ // if we're on the top line, display the up arrow
if (linenum == 0 && top_line != 0)
{
draw_arrow(
@@ -560,7 +560,7 @@ void ui_menu::draw(bool customonly)
hover = -2;
}
- // if we're on the bottom line, display the down arrow
+ // if we're on the bottom line, display the down arrow
else if (linenum == visible_lines - 1 && itemnum != numitems - 1)
{
draw_arrow(
@@ -575,30 +575,30 @@ void ui_menu::draw(bool customonly)
hover = -1;
}
- // if we're just a divider, draw a line
+ // if we're just a divider, draw a line
else if (strcmp(itemtext, MENU_SEPARATOR_ITEM) == 0)
container->add_line(visible_left, line_y + 0.5f * line_height, visible_left + visible_width, line_y + 0.5f * line_height, UI_LINE_WIDTH, UI_BORDER_COLOR, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
- // if we don't have a subitem, just draw the string centered
+ // if we don't have a subitem, just draw the string centered
else if (pitem.subtext == NULL)
machine().ui().draw_text_full(container, itemtext, effective_left, line_y, effective_width,
JUSTIFY_CENTER, WRAP_TRUNCATE, DRAW_NORMAL, fgcolor, bgcolor, NULL, NULL);
- // otherwise, draw the item on the left and the subitem text on the right
+ // otherwise, draw the item on the left and the subitem text on the right
else
{
int subitem_invert = pitem.flags & MENU_FLAG_INVERT;
const char *subitem_text = pitem.subtext;
float item_width, subitem_width;
- // draw the left-side text
+ // draw the left-side text
machine().ui().draw_text_full(container, itemtext, effective_left, line_y, effective_width,
JUSTIFY_LEFT, WRAP_TRUNCATE, DRAW_NORMAL, fgcolor, bgcolor, &item_width, NULL);
- // give 2 spaces worth of padding
+ // give 2 spaces worth of padding
item_width += 2.0f * gutter_width;
- // if the subitem doesn't fit here, display dots
+ // if the subitem doesn't fit here, display dots
if (machine().ui().get_string_width(subitem_text) > effective_width - item_width)
{
subitem_text = "...";
@@ -606,11 +606,11 @@ void ui_menu::draw(bool customonly)
selected_subitem_too_big = TRUE;
}
- // draw the subitem right-justified
+ // draw the subitem right-justified
machine().ui().draw_text_full(container, subitem_text, effective_left + item_width, line_y, effective_width - item_width,
JUSTIFY_RIGHT, WRAP_TRUNCATE, DRAW_NORMAL, subitem_invert ? fgcolor3 : fgcolor2, bgcolor, &subitem_width, NULL);
- // apply arrows
+ // apply arrows
if (itemnum == selected && (pitem.flags & MENU_FLAG_LEFT_ARROW))
{
draw_arrow(
@@ -636,7 +636,7 @@ void ui_menu::draw(bool customonly)
}
}
- // if the selected subitem is too big, display it in a separate offset box
+ // if the selected subitem is too big, display it in a separate offset box
if (selected_subitem_too_big)
{
const ui_menu_item &pitem = item[selected];
@@ -646,17 +646,17 @@ void ui_menu::draw(bool customonly)
float target_width, target_height;
float target_x, target_y;
- // compute the multi-line target width/height
+ // compute the multi-line target width/height
machine().ui().draw_text_full(container, pitem.subtext, 0, 0, visible_width * 0.75f,
JUSTIFY_RIGHT, WRAP_WORD, DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &target_width, &target_height);
- // determine the target location
+ // determine the target location
target_x = visible_left + visible_width - target_width - UI_BOX_LR_BORDER;
target_y = line_y + line_height + UI_BOX_TB_BORDER;
if (target_y + target_height + UI_BOX_TB_BORDER > visible_main_menu_height)
target_y = line_y - target_height - UI_BOX_TB_BORDER;
- // add a box around that
+ // add a box around that
machine().ui().draw_outlined_box(container, target_x - UI_BOX_LR_BORDER,
target_y - UI_BOX_TB_BORDER,
target_x + target_width + UI_BOX_LR_BORDER,
@@ -665,10 +665,10 @@ void ui_menu::draw(bool customonly)
JUSTIFY_RIGHT, WRAP_WORD, DRAW_NORMAL, UI_SELECTED_COLOR, UI_SELECTED_BG_COLOR, NULL, NULL);
}
- // if there is something special to add, do it by calling the virtual method
+ // if there is something special to add, do it by calling the virtual method
custom_render((selected >= 0 && selected < numitems) ? item[selected].ref : NULL, customtop, custombottom, x1, y1, x2, y2);
- // return the number of visible lines, minus 1 for top arrow and 1 for bottom arrow
+ // return the number of visible lines, minus 1 for top arrow and 1 for bottom arrow
visitems = visible_lines - (top_line != 0) - (top_line + visible_lines != numitems);
}
@@ -692,22 +692,22 @@ void ui_menu::draw_text_box()
float target_width, target_height, prior_width;
float target_x, target_y;
- // compute the multi-line target width/height
+ // compute the multi-line target width/height
machine().ui().draw_text_full(container, text, 0, 0, 1.0f - 2.0f * UI_BOX_LR_BORDER - 2.0f * gutter_width,
JUSTIFY_LEFT, WRAP_WORD, DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &target_width, &target_height);
target_height += 2.0f * line_height;
if (target_height > 1.0f - 2.0f * UI_BOX_TB_BORDER)
target_height = floor((1.0f - 2.0f * UI_BOX_TB_BORDER) / line_height) * line_height;
- // maximum against "return to prior menu" text
+ // maximum against "return to prior menu" text
prior_width = machine().ui().get_string_width(backtext) + 2.0f * gutter_width;
target_width = MAX(target_width, prior_width);
- // determine the target location
+ // determine the target location
target_x = 0.5f - 0.5f * target_width;
target_y = 0.5f - 0.5f * target_height;
- // make sure we stay on-screen
+ // make sure we stay on-screen
if (target_x < UI_BOX_LR_BORDER + gutter_width)
target_x = UI_BOX_LR_BORDER + gutter_width;
if (target_x + target_width + gutter_width + UI_BOX_LR_BORDER > 1.0f)
@@ -717,7 +717,7 @@ void ui_menu::draw_text_box()
if (target_y + target_height + UI_BOX_TB_BORDER > 1.0f)
target_y = 1.0f - UI_BOX_TB_BORDER - target_height;
- // add a box around that
+ // add a box around that
machine().ui().draw_outlined_box(container, target_x - UI_BOX_LR_BORDER - gutter_width,
target_y - UI_BOX_TB_BORDER,
target_x + target_width + gutter_width + UI_BOX_LR_BORDER,
@@ -725,7 +725,7 @@ void ui_menu::draw_text_box()
machine().ui().draw_text_full(container, text, target_x, target_y, target_width,
JUSTIFY_LEFT, WRAP_WORD, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, NULL, NULL);
- // draw the "return to prior menu" text with a hilight behind it
+ // draw the "return to prior menu" text with a hilight behind it
highlight(
container,
target_x + 0.5f * UI_LINE_WIDTH,
@@ -736,7 +736,7 @@ void ui_menu::draw_text_box()
machine().ui().draw_text_full(container, backtext, target_x, target_y + target_height - line_height, target_width,
JUSTIFY_CENTER, WRAP_TRUNCATE, DRAW_NORMAL, UI_SELECTED_COLOR, UI_SELECTED_BG_COLOR, NULL, NULL);
- // artificially set the hover to the last item so a double-click exits
+ // artificially set the hover to the last item so a double-click exits
hover = numitems - 1;
}
@@ -751,12 +751,12 @@ void ui_menu::handle_events()
int stop = FALSE;
ui_event local_menu_event;
- // loop while we have interesting events
+ // loop while we have interesting events
while (!stop && ui_input_pop_event(machine(), &local_menu_event))
{
switch (local_menu_event.event_type)
{
- // if we are hovering over a valid item, select it with a single click
+ // if we are hovering over a valid item, select it with a single click
case UI_EVENT_MOUSE_DOWN:
if (hover >= 0 && hover < numitems)
selected = hover;
@@ -772,7 +772,7 @@ void ui_menu::handle_events()
}
break;
- // if we are hovering over a valid item, fake a UI_SELECT with a double-click
+ // if we are hovering over a valid item, fake a UI_SELECT with a double-click
case UI_EVENT_MOUSE_DOUBLE_CLICK:
if (hover >= 0 && hover < numitems)
{
@@ -790,14 +790,14 @@ void ui_menu::handle_events()
}
break;
- // translate CHAR events into specials
+ // translate CHAR events into specials
case UI_EVENT_CHAR:
menu_event.iptkey = IPT_SPECIAL;
menu_event.unichar = local_menu_event.ch;
stop = TRUE;
break;
- // ignore everything else
+ // ignore everything else
default:
break;
}
@@ -817,11 +817,11 @@ void ui_menu::handle_keys(UINT32 flags)
int ignoreleft = FALSE;
int code;
- // bail if no items
+ // bail if no items
if (numitems == 0)
return;
- // if we hit select, return TRUE or pop the stack, depending on the item
+ // if we hit select, return TRUE or pop the stack, depending on the item
if (exclusive_input_pressed(IPT_UI_SELECT, 0))
{
if (selected == numitems - 1)
@@ -832,69 +832,69 @@ void ui_menu::handle_keys(UINT32 flags)
return;
}
- // hitting cancel also pops the stack
+ // hitting cancel also pops the stack
if (exclusive_input_pressed(IPT_UI_CANCEL, 0))
{
ui_menu::stack_pop(machine());
return;
}
- // validate the current selection
+ // validate the current selection
validate_selection(1);
- // swallow left/right keys if they are not appropriate
+ // swallow left/right keys if they are not appropriate
ignoreleft = ((item[selected].flags & MENU_FLAG_LEFT_ARROW) == 0);
ignoreright = ((item[selected].flags & MENU_FLAG_RIGHT_ARROW) == 0);
- // accept left/right keys as-is with repeat
+ // accept left/right keys as-is with repeat
if (!ignoreleft && exclusive_input_pressed(IPT_UI_LEFT, (flags & UI_MENU_PROCESS_LR_REPEAT) ? 6 : 0))
return;
if (!ignoreright && exclusive_input_pressed(IPT_UI_RIGHT, (flags & UI_MENU_PROCESS_LR_REPEAT) ? 6 : 0))
return;
- // up backs up by one item
+ // up backs up by one item
if (exclusive_input_pressed(IPT_UI_UP, 6))
{
selected = (selected + numitems - 1) % numitems;
validate_selection(-1);
}
- // down advances by one item
+ // down advances by one item
if (exclusive_input_pressed(IPT_UI_DOWN, 6))
{
selected = (selected + 1) % numitems;
validate_selection(1);
}
- // page up backs up by visitems
+ // page up backs up by visitems
if (exclusive_input_pressed(IPT_UI_PAGE_UP, 6))
{
selected -= visitems - 1;
validate_selection(1);
}
- // page down advances by visitems
+ // page down advances by visitems
if (exclusive_input_pressed(IPT_UI_PAGE_DOWN, 6))
{
selected += visitems - 1;
validate_selection(-1);
}
- // home goes to the start
+ // home goes to the start
if (exclusive_input_pressed(IPT_UI_HOME, 0))
{
selected = 0;
validate_selection(1);
}
- // end goes to the last
+ // end goes to the last
if (exclusive_input_pressed(IPT_UI_END, 0))
{
selected = numitems - 1;
validate_selection(-1);
}
- // pause enables/disables pause
+ // pause enables/disables pause
if (!ignorepause && exclusive_input_pressed(IPT_UI_PAUSE, 0))
{
if (machine().paused())
@@ -903,11 +903,11 @@ void ui_menu::handle_keys(UINT32 flags)
machine().pause();
}
- // handle a toggle cheats request
+ // handle a toggle cheats request
if (ui_input_pressed_repeat(machine(), IPT_UI_TOGGLE_CHEAT, 0))
machine().cheat().set_enable(!machine().cheat().enabled());
- // see if any other UI keys are pressed
+ // see if any other UI keys are pressed
if (menu_event.iptkey == IPT_INVALID)
for (code = IPT_UI_FIRST + 1; code < IPT_UI_LAST; code++)
{
@@ -927,13 +927,13 @@ void ui_menu::handle_keys(UINT32 flags)
void ui_menu::validate_selection(int scandir)
{
- // clamp to be in range
+ // clamp to be in range
if (selected < 0)
selected = 0;
else if (selected >= numitems)
selected = numitems - 1;
- // skip past unselectable items
+ // skip past unselectable items
while (!item[selected].is_selectable())
selected = (selected + numitems + scandir) % numitems;
}
@@ -1038,18 +1038,18 @@ void ui_menu::do_handle()
UINT32 ui_menu::ui_handler(running_machine &machine, render_container *container, UINT32 state)
{
- // if we have no menus stacked up, start with the main menu
+ // if we have no menus stacked up, start with the main menu
if (menu_stack == NULL)
stack_push(auto_alloc_clear(machine, ui_menu_main(machine, container)));
- // update the menu state
+ // update the menu state
if (menu_stack != NULL)
menu_stack->do_handle();
- // clear up anything pending to be released
+ // clear up anything pending to be released
clear_free_list(machine);
- // if the menus are to be hidden, return a cancel here
+ // if the menus are to be hidden, return a cancel here
if (machine.ui().is_menu_active() && ((ui_input_pressed(machine, IPT_UI_CONFIGURE) && !stack_has_special_main_menu()) || menu_stack == NULL))
return UI_HANDLER_CANCEL;
@@ -1072,16 +1072,16 @@ void ui_menu::render_triangle(bitmap_argb32 &dest, bitmap_argb32 &source, const
int height = dest.height();
int x, y;
- // start with all-transparent
+ // start with all-transparent
dest.fill(rgb_t(0x00,0x00,0x00,0x00));
- // render from the tip to the bottom
+ // render from the tip to the bottom
for (y = 0; y < height; y++)
{
int linewidth = (y * (halfwidth - 1) + (height / 2)) * 255 * 2 / height;
UINT32 *target = &dest.pix32(y, halfwidth);
- // don't antialias if height < 12
+ // don't antialias if height < 12
if (dest.height() < 12)
{
int pixels = (linewidth + 254) / 255;
@@ -1089,19 +1089,19 @@ void ui_menu::render_triangle(bitmap_argb32 &dest, bitmap_argb32 &source, const
linewidth = pixels * 255;
}
- // loop while we still have data to generate
+ // loop while we still have data to generate
for (x = 0; linewidth > 0; x++)
{
int dalpha;
- // first column we only consume one pixel
+ // first column we only consume one pixel
if (x == 0)
{
dalpha = MIN(0xff, linewidth);
target[x] = rgb_t(dalpha,0xff,0xff,0xff);
}
- // remaining columns consume two pixels, one on each side
+ // remaining columns consume two pixels, one on each side
else
{
dalpha = MIN(0x1fe, linewidth);
diff --git a/src/emu/ui/menu.h b/src/emu/ui/menu.h
index 6091bc3e3a7..253e3634ad7 100644
--- a/src/emu/ui/menu.h
+++ b/src/emu/ui/menu.h
@@ -21,7 +21,7 @@
CONSTANTS
***************************************************************************/
-// flags for menu items
+// flags for menu items
#define MENU_FLAG_LEFT_ARROW (1 << 0)
#define MENU_FLAG_RIGHT_ARROW (1 << 1)
#define MENU_FLAG_INVERT (1 << 2)
@@ -29,15 +29,15 @@
#define MENU_FLAG_REDTEXT (1 << 4)
#define MENU_FLAG_DISABLE (1 << 5)
-// special menu item for separators
+// special menu item for separators
#define MENU_SEPARATOR_ITEM "---"
-// flags to pass to ui_menu_process
+// flags to pass to ui_menu_process
#define UI_MENU_PROCESS_NOKEYS 1
#define UI_MENU_PROCESS_LR_REPEAT 2
#define UI_MENU_PROCESS_CUSTOM_ONLY 4
-// options for ui_menu_reset
+// options for ui_menu_reset
enum ui_menu_reset_options
{
UI_MENU_RESET_SELECT_FIRST,
@@ -51,19 +51,19 @@ enum ui_menu_reset_options
TYPE DEFINITIONS
***************************************************************************/
-// menu-related events
+// menu-related events
struct ui_menu_event
{
- void * itemref; // reference for the selected item
- int iptkey; // one of the IPT_* values from inptport.h
- unicode_char unichar; // unicode character if iptkey == IPT_SPECIAL
+ void * itemref; // reference for the selected item
+ int iptkey; // one of the IPT_* values from inptport.h
+ unicode_char unichar; // unicode character if iptkey == IPT_SPECIAL
};
struct ui_menu_pool
{
- ui_menu_pool * next; // chain to next one
- UINT8 * top; // top of the pool
- UINT8 * end; // end of the pool
+ ui_menu_pool * next; // chain to next one
+ UINT8 * top; // top of the pool
+ UINT8 * end; // end of the pool
};
@@ -86,87 +86,87 @@ public:
running_machine &machine() const { return m_machine; }
- render_container * container; // render_container we render to
- ui_menu_event menu_event; // the UI menu_event that occurred
- ui_menu * parent; // pointer to parent menu
- int resetpos; // reset position
- void * resetref; // reset reference
- int selected; // which item is selected
- int hover; // which item is being hovered over
- int visitems; // number of visible items
- int numitems; // number of items in the menu
- int allocitems; // allocated size of array
- ui_menu_item * item; // pointer to array of items
- float customtop; // amount of extra height to add at the top
- float custombottom; // amount of extra height to add at the bottom
- ui_menu_pool * pool; // list of memory pools
-
- // free all items in the menu, and all memory allocated from the memory pool
+ render_container * container; // render_container we render to
+ ui_menu_event menu_event; // the UI menu_event that occurred
+ ui_menu * parent; // pointer to parent menu
+ int resetpos; // reset position
+ void * resetref; // reset reference
+ int selected; // which item is selected
+ int hover; // which item is being hovered over
+ int visitems; // number of visible items
+ int numitems; // number of items in the menu
+ int allocitems; // allocated size of array
+ ui_menu_item * item; // pointer to array of items
+ float customtop; // amount of extra height to add at the top
+ float custombottom; // amount of extra height to add at the bottom
+ ui_menu_pool * pool; // list of memory pools
+
+ // free all items in the menu, and all memory allocated from the memory pool
void reset(ui_menu_reset_options options);
- // returns true if the menu has any non-default items in it
+ // returns true if the menu has any non-default items in it
bool populated();
- // append a new item to the end of the menu
+ // append a new item to the end of the menu
void item_append(const char *text, const char *subtext, UINT32 flags, void *ref);
- // process a menu, drawing it and returning any interesting events
+ // process a menu, drawing it and returning any interesting events
const ui_menu_event *process(UINT32 flags);
- // configure the menu for custom rendering
+ // configure the menu for custom rendering
virtual void custom_render(void *selectedref, float top, float bottom, float x, float y, float x2, float y2);
- // allocate temporary memory from the menu's memory pool
+ // allocate temporary memory from the menu's memory pool
void *m_pool_alloc(size_t size);
- // make a temporary string copy in the menu's memory pool
+ // make a temporary string copy in the menu's memory pool
const char *pool_strdup(const char *string);
- // retrieves the index of the currently selected menu item
+ // retrieves the index of the currently selected menu item
void *get_selection();
- // changes the index of the currently selected menu item
+ // changes the index of the currently selected menu item
void set_selection(void *selected_itemref);
- // request the specific handling of the game selection main menu
+ // request the specific handling of the game selection main menu
bool is_special_main_menu() const;
void set_special_main_menu(bool disable);
- // Global initialization
+ // Global initialization
static void init(running_machine &machine);
static void exit(running_machine &machine);
- // reset the menus, clearing everything
+ // reset the menus, clearing everything
static void stack_reset(running_machine &machine);
- // push a new menu onto the stack
+ // push a new menu onto the stack
static void stack_push(ui_menu *menu);
- // pop a menu from the stack
+ // pop a menu from the stack
static void stack_pop(running_machine &machine);
- // test if one of the menus in the stack requires hide disable
+ // test if one of the menus in the stack requires hide disable
static bool stack_has_special_main_menu();
- // highlight
+ // highlight
static void highlight(render_container *container, float x0, float y0, float x1, float y1, rgb_t bgcolor);
- // draw arrow
+ // draw arrow
static void draw_arrow(render_container *container, float x0, float y0, float x1, float y1, rgb_t fgcolor, UINT32 orientation);
- // master handler
+ // master handler
static UINT32 ui_handler(running_machine &machine, render_container *container, UINT32 state);
- // Used by sliders
+ // Used by sliders
void validate_selection(int scandir);
static ui_menu *menu_stack;
void do_handle();
- // To be reimplemented in the menu subclass
+ // To be reimplemented in the menu subclass
virtual void populate() = 0;
- // To be reimplemented in the menu subclass
+ // To be reimplemented in the menu subclass
virtual void handle() = 0;
private:
@@ -188,4 +188,4 @@ private:
static void render_triangle(bitmap_argb32 &dest, bitmap_argb32 &source, const rectangle &sbounds, void *param);
};
-#endif // __UI_MENU_H__
+#endif // __UI_MENU_H__
diff --git a/src/emu/ui/selgame.c b/src/emu/ui/selgame.c
index 87deeaabf0e..97dc05663ee 100644
--- a/src/emu/ui/selgame.c
+++ b/src/emu/ui/selgame.c
@@ -47,8 +47,8 @@ ui_menu_select_game::~ui_menu_select_game()
//-------------------------------------------------
-// build_driver_list - build a list of available
-// drivers
+// build_driver_list - build a list of available
+// drivers
//-------------------------------------------------
void ui_menu_select_game::build_driver_list()
@@ -108,7 +108,7 @@ void ui_menu_select_game::handle()
m_error = false;
// handle selections
- else
+ else
{
switch(menu_event->iptkey)
{
diff --git a/src/emu/ui/selgame.h b/src/emu/ui/selgame.h
index 94e6f37d43b..940a195721b 100644
--- a/src/emu/ui/selgame.h
+++ b/src/emu/ui/selgame.h
@@ -31,10 +31,10 @@ public:
private:
// internal state
enum { VISIBLE_GAMES_IN_LIST = 15 };
- UINT8 m_error;
- UINT8 m_rerandomize;
- char m_search[40];
- int m_matchlist[VISIBLE_GAMES_IN_LIST];
+ UINT8 m_error;
+ UINT8 m_rerandomize;
+ char m_search[40];
+ int m_matchlist[VISIBLE_GAMES_IN_LIST];
dynamic_array<const game_driver *> m_driverlist;
auto_pointer<driver_enumerator> m_drivlist;
diff --git a/src/emu/ui/swlist.c b/src/emu/ui/swlist.c
index f18693d7049..c864ff560e5 100644
--- a/src/emu/ui/swlist.c
+++ b/src/emu/ui/swlist.c
@@ -360,7 +360,7 @@ void ui_menu_software_list::handle()
/***************************************************************************
SOFTWARE MENU - list of available software lists - i.e. cartridges,
- floppies
+ floppies
***************************************************************************/
//-------------------------------------------------
diff --git a/src/emu/ui/swlist.h b/src/emu/ui/swlist.h
index 98c5de0d860..1d0edc80d1e 100644
--- a/src/emu/ui/swlist.h
+++ b/src/emu/ui/swlist.h
@@ -29,11 +29,11 @@ private:
};
// variables
- const software_info * m_info;
- const char * m_interface;
- const software_part ** m_selected_part;
- bool m_opt_fmgr;
- int * m_result;
+ const software_info * m_info;
+ const char * m_interface;
+ const software_part ** m_selected_part;
+ bool m_opt_fmgr;
+ int * m_result;
};
@@ -55,12 +55,12 @@ private:
};
// variables
- software_list_device * m_swlist; // currently selected list
- const char * m_interface;
- astring & m_result;
- entry_info * m_entrylist;
- char m_filename_buffer[1024];
- bool m_ordered_by_shortname;
+ software_list_device * m_swlist; // currently selected list
+ const char * m_interface;
+ astring & m_result;
+ entry_info * m_entrylist;
+ char m_filename_buffer[1024];
+ bool m_ordered_by_shortname;
// functions
int compare_entries(const entry_info *e1, const entry_info *e2, bool shortname);
@@ -78,8 +78,8 @@ public:
virtual void handle();
private:
- const char * m_interface;
- software_list_device ** m_result;
+ const char * m_interface;
+ software_list_device ** m_result;
};
#endif /* __UI_SWLIST_H__ */
diff --git a/src/emu/ui/ui.c b/src/emu/ui/ui.c
index d957d8086af..45277e14b9a 100644
--- a/src/emu/ui/ui.c
+++ b/src/emu/ui/ui.c
@@ -40,7 +40,7 @@ enum
LOCAL VARIABLES
***************************************************************************/
-// list of natural keyboard keys that are not associated with UI_EVENT_CHARs
+// list of natural keyboard keys that are not associated with UI_EVENT_CHARs
static const input_item_id non_char_keys[] =
{
ITEM_ID_ESC,
@@ -88,11 +88,11 @@ static const input_item_id non_char_keys[] =
GLOBAL VARIABLES
***************************************************************************/
-// messagebox buffer
+// messagebox buffer
static astring messagebox_text;
static rgb_t messagebox_backcolor;
-// slider info
+// slider info
static slider_state *slider_list;
static slider_state *slider_current;
@@ -101,7 +101,7 @@ static slider_state *slider_current;
FUNCTION PROTOTYPES
***************************************************************************/
-// slider controls
+// slider controls
static slider_state *slider_alloc(running_machine &machine, const char *title, INT32 minval, INT32 defval, INT32 maxval, INT32 incval, slider_update update, void *arg);
static slider_state *slider_init(running_machine &machine);
static INT32 slider_volume(running_machine &machine, void *arg, astring *string, INT32 newval);
@@ -221,11 +221,11 @@ static const UINT32 mouse_bitmap[] = {
ui_manager::ui_manager(running_machine &machine)
: m_machine(machine)
{
- // initialize the other UI bits
+ // initialize the other UI bits
ui_menu::init(machine);
ui_gfx_init(machine);
- // reset instance variables
+ // reset instance variables
m_font = NULL;
m_handler_callback = NULL;
m_handler_param = 0;
@@ -245,7 +245,7 @@ ui_manager::ui_manager(running_machine &machine)
// request a callback upon exiting
machine.add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(ui_manager::exit), this));
- // retrieve options
+ // retrieve options
m_use_natural_keyboard = machine.options().natural_keyboard();
bitmap_argb32 *ui_mouse_bitmap = auto_alloc(machine, bitmap_argb32(32, 32));
UINT32 *dst = &ui_mouse_bitmap->pix32(0);
@@ -265,7 +265,7 @@ void ui_manager::exit()
machine().render().texture_free(m_mouse_arrow_texture);
m_mouse_arrow_texture = NULL;
- // free the font
+ // free the font
if (m_font != NULL)
{
machine().render().font_free(m_font);
@@ -280,7 +280,7 @@ void ui_manager::exit()
void ui_manager::initialize(running_machine &machine)
{
- // initialize the on-screen display system
+ // initialize the on-screen display system
slider_list = slider_current = slider_init(machine);
}
@@ -712,7 +712,7 @@ void ui_manager::draw_text_full(render_container *container, const char *origs,
if (curwidth > maxwidth)
maxwidth = curwidth;
- // if opaque, add a black box
+ // if opaque, add a black box
if (draw == DRAW_OPAQUE)
container->add_rect(curx, cury, curx + curwidth, cury + lineheight, bgcolor, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
@@ -1131,7 +1131,7 @@ astring &ui_manager::game_info_astring(astring &string)
// get cpu specific clock that takes internal multiplier/dividers into account
int clock = exec->device().clock();
- // count how many identical CPUs we have
+ // count how many identical CPUs we have
int count = 1;
const char *name = exec->device().name();
execute_interface_iterator execinneriter(machine().root_device());
@@ -1142,19 +1142,19 @@ astring &ui_manager::game_info_astring(astring &string)
count++;
}
- // if more than one, prepend a #x in front of the CPU name
+ // if more than one, prepend a #x in front of the CPU name
if (count > 1)
string.catprintf("%d" UTF8_MULTIPLY, count);
string.cat(name);
- // display clock in kHz or MHz
+ // display clock in kHz or MHz
if (clock >= 1000000)
string.catprintf(" %d.%06d" UTF8_NBSP "MHz\n", clock / 1000000, clock % 1000000);
else
string.catprintf(" %d.%03d" UTF8_NBSP "kHz\n", clock / 1000, clock % 1000);
}
- // loop over all sound chips
+ // loop over all sound chips
sound_interface_iterator snditer(machine().root_device());
tagmap_t<UINT8> soundtags;
bool found_sound = false;
@@ -1163,12 +1163,12 @@ astring &ui_manager::game_info_astring(astring &string)
if (soundtags.add(sound->device().tag(), 1, FALSE) == TMERR_DUPLICATE)
continue;
- // append the Sound: string
+ // append the Sound: string
if (!found_sound)
string.cat("\nSound:\n");
found_sound = true;
- // count how many identical sound chips we have
+ // count how many identical sound chips we have
int count = 1;
sound_interface_iterator sndinneriter(machine().root_device());
for (device_sound_interface *scan = sndinneriter.first(); scan != NULL; scan = sndinneriter.next())
@@ -1177,12 +1177,12 @@ astring &ui_manager::game_info_astring(astring &string)
if (soundtags.add(scan->device().tag(), 1, FALSE) != TMERR_DUPLICATE)
count++;
}
- // if more than one, prepend a #x in front of the CPU name
+ // if more than one, prepend a #x in front of the CPU name
if (count > 1)
string.catprintf("%d" UTF8_MULTIPLY, count);
string.cat(sound->device().name());
- // display clock in kHz or MHz
+ // display clock in kHz or MHz
int clock = sound->device().clock();
if (clock >= 1000000)
string.catprintf(" %d.%06d" UTF8_NBSP "MHz\n", clock / 1000000, clock % 1000000);
@@ -1192,7 +1192,7 @@ astring &ui_manager::game_info_astring(astring &string)
string.cat("\n");
}
- // display screen information
+ // display screen information
string.cat("\nVideo:\n");
screen_device_iterator scriter(machine().root_device());
int scrcount = scriter.count();
@@ -1250,18 +1250,18 @@ UINT32 ui_manager::handler_messagebox(running_machine &machine, render_container
UINT32 ui_manager::handler_messagebox_ok(running_machine &machine, render_container *container, UINT32 state)
{
- // draw a standard message window
+ // draw a standard message window
machine.ui().draw_text_box(container, messagebox_text, JUSTIFY_LEFT, 0.5f, 0.5f, messagebox_backcolor);
- // an 'O' or left joystick kicks us to the next state
+ // an 'O' or left joystick kicks us to the next state
if (state == 0 && (machine.input().code_pressed_once(KEYCODE_O) || ui_input_pressed(machine, IPT_UI_LEFT)))
state++;
- // a 'K' or right joystick exits the state
+ // a 'K' or right joystick exits the state
else if (state == 1 && (machine.input().code_pressed_once(KEYCODE_K) || ui_input_pressed(machine, IPT_UI_RIGHT)))
state = UI_HANDLER_CANCEL;
- // if the user cancels, exit out completely
+ // if the user cancels, exit out completely
else if (ui_input_pressed(machine, IPT_UI_CANCEL))
{
machine.schedule_exit();
@@ -1280,17 +1280,17 @@ UINT32 ui_manager::handler_messagebox_ok(running_machine &machine, render_contai
UINT32 ui_manager::handler_messagebox_anykey(running_machine &machine, render_container *container, UINT32 state)
{
- // draw a standard message window
+ // draw a standard message window
machine.ui().draw_text_box(container, messagebox_text, JUSTIFY_LEFT, 0.5f, 0.5f, messagebox_backcolor);
- // if the user cancels, exit out completely
+ // if the user cancels, exit out completely
if (ui_input_pressed(machine, IPT_UI_CANCEL))
{
machine.schedule_exit();
state = UI_HANDLER_CANCEL;
}
- // if any key is pressed, just exit
+ // if any key is pressed, just exit
else if (machine.input().poll_switches() != INPUT_CODE_INVALID)
state = UI_HANDLER_CANCEL;
@@ -1312,39 +1312,39 @@ void ui_manager::process_natural_keyboard()
UINT8 *key_down_ptr;
UINT8 key_down_mask;
- // loop while we have interesting events
+ // loop while we have interesting events
while (ui_input_pop_event(machine(), &event))
{
- // if this was a UI_EVENT_CHAR event, post it
+ // if this was a UI_EVENT_CHAR event, post it
if (event.event_type == UI_EVENT_CHAR)
machine().ioport().natkeyboard().post(event.ch);
}
- // process natural keyboard keys that don't get UI_EVENT_CHARs
+ // process natural keyboard keys that don't get UI_EVENT_CHARs
for (i = 0; i < ARRAY_LENGTH(non_char_keys); i++)
{
- // identify this keycode
+ // identify this keycode
itemid = non_char_keys[i];
code = machine().input().code_from_itemid(itemid);
- // ...and determine if it is pressed
+ // ...and determine if it is pressed
pressed = machine().input().code_pressed(code);
- // figure out whey we are in the key_down map
+ // figure out whey we are in the key_down map
key_down_ptr = &m_non_char_keys_down[i / 8];
key_down_mask = 1 << (i % 8);
if (pressed && !(*key_down_ptr & key_down_mask))
{
- // this key is now down
+ // this key is now down
*key_down_ptr |= key_down_mask;
- // post the key
+ // post the key
machine().ioport().natkeyboard().post(UCHAR_MAMEKEY_BEGIN + code.item_id());
}
else if (!pressed && (*key_down_ptr & key_down_mask))
{
- // this key is now up
+ // this key is now up
*key_down_ptr &= ~key_down_mask;
}
}
@@ -1357,13 +1357,13 @@ void ui_manager::process_natural_keyboard()
void ui_manager::increase_frameskip()
{
- // get the current value and increment it
+ // get the current value and increment it
int newframeskip = machine().video().frameskip() + 1;
if (newframeskip > MAX_FRAMESKIP)
newframeskip = -1;
machine().video().set_frameskip(newframeskip);
- // display the FPS counter for 2 seconds
+ // display the FPS counter for 2 seconds
machine().ui().show_fps_temp(2.0);
}
@@ -1374,13 +1374,13 @@ void ui_manager::increase_frameskip()
void ui_manager::decrease_frameskip()
{
- // get the current value and decrement it
+ // get the current value and decrement it
int newframeskip = machine().video().frameskip() - 1;
if (newframeskip < -1)
newframeskip = MAX_FRAMESKIP;
machine().video().set_frameskip(newframeskip);
- // display the FPS counter for 2 seconds
+ // display the FPS counter for 2 seconds
machine().ui().show_fps_temp(2.0);
}
@@ -1391,7 +1391,7 @@ void ui_manager::decrease_frameskip()
bool ui_manager::can_paste()
{
- // retrieve the clipboard text
+ // retrieve the clipboard text
char *text = osd_get_clipboard_text();
// free the string if allocated
@@ -1409,16 +1409,16 @@ bool ui_manager::can_paste()
void ui_manager::paste()
{
- // retrieve the clipboard text
+ // retrieve the clipboard text
char *text = osd_get_clipboard_text();
- // was a result returned?
+ // was a result returned?
if (text != NULL)
{
- // post the text
+ // post the text
machine().ioport().natkeyboard().post_utf8(text);
- // free the string
+ // free the string
osd_free(text);
}
}
@@ -1431,7 +1431,7 @@ void ui_manager::paste()
void ui_manager::image_handler_ingame()
{
- // run display routine for devices
+ // run display routine for devices
if (machine().phase() == MACHINE_PHASE_RUNNING)
{
image_interface_iterator iter(machine().root_device());
@@ -1450,7 +1450,7 @@ UINT32 ui_manager::handler_ingame(running_machine &machine, render_container *co
{
bool is_paused = machine.paused();
- // first draw the FPS counter
+ // first draw the FPS counter
if (machine.ui().show_fps_counter())
{
astring tempstring;
@@ -1458,33 +1458,33 @@ UINT32 ui_manager::handler_ingame(running_machine &machine, render_container *co
JUSTIFY_RIGHT, WRAP_WORD, DRAW_OPAQUE, ARGB_WHITE, ARGB_BLACK, NULL, NULL);
}
- // draw the profiler if visible
+ // draw the profiler if visible
if (machine.ui().show_profiler())
{
const char *text = g_profiler.text(machine);
machine.ui().draw_text_full(container, text, 0.0f, 0.0f, 1.0f, JUSTIFY_LEFT, WRAP_WORD, DRAW_OPAQUE, ARGB_WHITE, ARGB_BLACK, NULL, NULL);
}
- // if we're single-stepping, pause now
+ // if we're single-stepping, pause now
if (machine.ui().single_step())
{
machine.pause();
machine.ui().set_single_step(false);
}
- // determine if we should disable the rest of the UI
+ // determine if we should disable the rest of the UI
bool ui_disabled = (machine.ioport().has_keyboard() && !machine.ui_active());
- // is ScrLk UI toggling applicable here?
+ // is ScrLk UI toggling applicable here?
if (machine.ioport().has_keyboard())
{
- // are we toggling the UI with ScrLk?
+ // are we toggling the UI with ScrLk?
if (ui_input_pressed(machine, IPT_UI_TOGGLE_UI))
{
- // toggle the UI
+ // toggle the UI
machine.set_ui_active(!machine.ui_active());
- // display a popup indicating the new status
+ // display a popup indicating the new status
if (machine.ui_active())
{
machine.ui().popup_time(2, "%s\n%s\n%s\n%s\n%s\n%s\n",
@@ -1508,13 +1508,13 @@ UINT32 ui_manager::handler_ingame(running_machine &machine, render_container *co
}
}
- // is the natural keyboard enabled?
+ // is the natural keyboard enabled?
if (machine.ui().use_natural_keyboard() && (machine.phase() == MACHINE_PHASE_RUNNING))
machine.ui().process_natural_keyboard();
if (!ui_disabled)
{
- // paste command
+ // paste command
if (ui_input_pressed(machine, IPT_UI_PASTE))
machine.ui().paste();
}
@@ -1529,21 +1529,21 @@ UINT32 ui_manager::handler_ingame(running_machine &machine, render_container *co
return 0;
}
- // turn on menus if requested
+ // turn on menus if requested
if (ui_input_pressed(machine, IPT_UI_CONFIGURE))
return machine.ui().set_handler(ui_menu::ui_handler, 0);
- // if the on-screen display isn't up and the user has toggled it, turn it on
+ // if the on-screen display isn't up and the user has toggled it, turn it on
if ((machine.debug_flags & DEBUG_FLAG_ENABLED) == 0 && ui_input_pressed(machine, IPT_UI_ON_SCREEN_DISPLAY))
return machine.ui().set_handler(ui_menu_sliders::ui_handler, 1);
- // handle a reset request
+ // handle a reset request
if (ui_input_pressed(machine, IPT_UI_RESET_MACHINE))
machine.schedule_hard_reset();
if (ui_input_pressed(machine, IPT_UI_SOFT_RESET))
machine.schedule_soft_reset();
- // handle a request to display graphics/palette
+ // handle a request to display graphics/palette
if (ui_input_pressed(machine, IPT_UI_SHOW_GFX))
{
if (!is_paused)
@@ -1551,28 +1551,28 @@ UINT32 ui_manager::handler_ingame(running_machine &machine, render_container *co
return machine.ui().set_handler(ui_gfx_ui_handler, is_paused);
}
- // handle a save state request
+ // handle a save state request
if (ui_input_pressed(machine, IPT_UI_SAVE_STATE))
{
machine.pause();
return machine.ui().set_handler(handler_load_save, LOADSAVE_SAVE);
}
- // handle a load state request
+ // handle a load state request
if (ui_input_pressed(machine, IPT_UI_LOAD_STATE))
{
machine.pause();
return machine.ui().set_handler(handler_load_save, LOADSAVE_LOAD);
}
- // handle a save snapshot request
+ // handle a save snapshot request
if (ui_input_pressed(machine, IPT_UI_SNAPSHOT))
machine.video().save_active_screen_snapshots();
- // toggle pause
+ // toggle pause
if (ui_input_pressed(machine, IPT_UI_PAUSE))
{
- // with a shift key, it is single step
+ // with a shift key, it is single step
if (is_paused && (machine.input().code_pressed(KEYCODE_LSHIFT) || machine.input().code_pressed(KEYCODE_RSHIFT)))
{
machine.ui().set_single_step(true);
@@ -1582,35 +1582,35 @@ UINT32 ui_manager::handler_ingame(running_machine &machine, render_container *co
machine.toggle_pause();
}
- // handle a toggle cheats request
+ // handle a toggle cheats request
if (ui_input_pressed(machine, IPT_UI_TOGGLE_CHEAT))
machine.cheat().set_enable(!machine.cheat().enabled());
- // toggle movie recording
+ // toggle movie recording
if (ui_input_pressed(machine, IPT_UI_RECORD_MOVIE))
machine.video().toggle_record_movie();
- // toggle profiler display
+ // toggle profiler display
if (ui_input_pressed(machine, IPT_UI_SHOW_PROFILER))
machine.ui().set_show_profiler(!machine.ui().show_profiler());
- // toggle FPS display
+ // toggle FPS display
if (ui_input_pressed(machine, IPT_UI_SHOW_FPS))
machine.ui().set_show_fps(!machine.ui().show_fps());
- // increment frameskip?
+ // increment frameskip?
if (ui_input_pressed(machine, IPT_UI_FRAMESKIP_INC))
machine.ui().increase_frameskip();
- // decrement frameskip?
+ // decrement frameskip?
if (ui_input_pressed(machine, IPT_UI_FRAMESKIP_DEC))
machine.ui().decrease_frameskip();
- // toggle throttle?
+ // toggle throttle?
if (ui_input_pressed(machine, IPT_UI_THROTTLE))
machine.video().toggle_throttle();
- // check for fast forward
+ // check for fast forward
if (machine.ioport().type_pressed(IPT_UI_FAST_FORWARD))
{
machine.video().set_fastforward(true);
@@ -1634,31 +1634,31 @@ UINT32 ui_manager::handler_load_save(running_machine &machine, render_container
input_code code;
char file = 0;
- // if we're not in the middle of anything, skip
+ // if we're not in the middle of anything, skip
if (state == LOADSAVE_NONE)
return 0;
- // okay, we're waiting for a key to select a slot; display a message
+ // okay, we're waiting for a key to select a slot; display a message
if (state == LOADSAVE_SAVE)
machine.ui().draw_message_window(container, "Select position to save to");
else
machine.ui().draw_message_window(container, "Select position to load from");
- // check for cancel key
+ // check for cancel key
if (ui_input_pressed(machine, IPT_UI_CANCEL))
{
- // display a popup indicating things were cancelled
+ // display a popup indicating things were cancelled
if (state == LOADSAVE_SAVE)
popmessage("Save cancelled");
else
popmessage("Load cancelled");
- // reset the state
+ // reset the state
machine.resume();
return UI_HANDLER_CANCEL;
}
- // check for A-Z or 0-9
+ // check for A-Z or 0-9
for (input_item_id id = ITEM_ID_A; id <= ITEM_ID_Z; id++)
if (machine.input().code_pressed_once(input_code(DEVICE_CLASS_KEYBOARD, 0, ITEM_CLASS_SWITCH, ITEM_MODIFIER_NONE, id)))
file = id - ITEM_ID_A + 'a';
@@ -1673,7 +1673,7 @@ UINT32 ui_manager::handler_load_save(running_machine &machine, render_container
if (file == 0)
return state;
- // display a popup indicating that the save will proceed
+ // display a popup indicating that the save will proceed
sprintf(filename, "%c", file);
if (state == LOADSAVE_SAVE)
{
@@ -1686,7 +1686,7 @@ UINT32 ui_manager::handler_load_save(running_machine &machine, render_container
machine.schedule_load(filename);
}
- // remove the pause and reset the state
+ // remove the pause and reset the state
machine.resume();
return UI_HANDLER_CANCEL;
}
@@ -1719,11 +1719,11 @@ UINT32 ui_manager::handler_confirm_quit(running_machine &machine, render_contain
machine.ui().draw_text_box(container, quit_message, JUSTIFY_CENTER, 0.5f, 0.5f, UI_RED_COLOR);
machine.pause();
- // if the user press ENTER, quit the game
+ // if the user press ENTER, quit the game
if (ui_input_pressed(machine, IPT_UI_SELECT))
machine.schedule_exit();
- // if the user press ESC, just continue
+ // if the user press ESC, just continue
else if (ui_input_pressed(machine, IPT_UI_CANCEL))
{
machine.resume();
@@ -1783,11 +1783,11 @@ static slider_state *slider_init(running_machine &machine)
astring string;
int item;
- // add overall volume
+ // add overall volume
*tailptr = slider_alloc(machine, "Master Volume", -32, 0, 0, 1, slider_volume, NULL);
tailptr = &(*tailptr)->next;
- // add per-channel volume
+ // add per-channel volume
mixer_input info;
for (item = 0; machine.sound().indexed_mixer_input(item, info); item++)
{
@@ -1800,7 +1800,7 @@ static slider_state *slider_init(running_machine &machine)
tailptr = &(*tailptr)->next;
}
- // add analog adjusters
+ // add analog adjusters
for (port = machine.ioport().first_port(); port != NULL; port = port->next())
for (field = port->first_field(); field != NULL; field = field->next())
if (field->type() == IPT_ADJUSTER)
@@ -1810,7 +1810,7 @@ static slider_state *slider_init(running_machine &machine)
tailptr = &(*tailptr)->next;
}
- // add CPU overclocking (cheat only)
+ // add CPU overclocking (cheat only)
if (machine.options().cheat())
{
execute_interface_iterator iter(machine.root_device());
@@ -1823,7 +1823,7 @@ static slider_state *slider_init(running_machine &machine)
}
}
- // add screen parameters
+ // add screen parameters
screen_device_iterator scriter(machine.root_device());
for (screen_device *screen = scriter.first(); screen != NULL; screen = scriter.next())
{
@@ -1833,7 +1833,7 @@ static slider_state *slider_init(running_machine &machine)
int defyoffset = floor(screen->yoffset() * 1000.0f + 0.5f);
void *param = (void *)screen;
- // add refresh rate tweaker
+ // add refresh rate tweaker
if (machine.options().cheat())
{
string.printf("%s Refresh Rate", slider_get_screen_desc(*screen));
@@ -1841,7 +1841,7 @@ static slider_state *slider_init(running_machine &machine)
tailptr = &(*tailptr)->next;
}
- // add standard brightness/contrast/gamma controls per-screen
+ // add standard brightness/contrast/gamma controls per-screen
string.printf("%s Brightness", slider_get_screen_desc(*screen));
*tailptr = slider_alloc(machine, string, 100, 1000, 2000, 10, slider_brightness, param);
tailptr = &(*tailptr)->next;
@@ -1852,7 +1852,7 @@ static slider_state *slider_init(running_machine &machine)
*tailptr = slider_alloc(machine, string, 100, 1000, 3000, 50, slider_gamma, param);
tailptr = &(*tailptr)->next;
- // add scale and offset controls per-screen
+ // add scale and offset controls per-screen
string.printf("%s Horiz Stretch", slider_get_screen_desc(*screen));
*tailptr = slider_alloc(machine, string, 500, defxscale, 1500, 2, slider_xscale, param);
tailptr = &(*tailptr)->next;
@@ -1879,7 +1879,7 @@ static slider_state *slider_init(running_machine &machine)
int defyoffset = floor(config.m_overposy * 1000.0f + 0.5f);
void *param = (void *)laserdisc;
- // add scale and offset controls per-overlay
+ // add scale and offset controls per-overlay
string.printf("Laserdisc '%s' Horiz Stretch", laserdisc->tag());
*tailptr = slider_alloc(machine, string, 500, (defxscale == 0) ? 1000 : defxscale, 1500, 2, slider_overxscale, param);
tailptr = &(*tailptr)->next;
@@ -1897,7 +1897,7 @@ static slider_state *slider_init(running_machine &machine)
for (screen_device *screen = scriter.first(); screen != NULL; screen = scriter.next())
if (screen->screen_type() == SCREEN_TYPE_VECTOR)
{
- // add flicker control
+ // add flicker control
*tailptr = slider_alloc(machine, "Vector Flicker", 0, 0, 1000, 10, slider_flicker, NULL);
tailptr = &(*tailptr)->next;
*tailptr = slider_alloc(machine, "Beam Width", 10, 100, 1000, 10, slider_beam, NULL);
@@ -1906,7 +1906,7 @@ static slider_state *slider_init(running_machine &machine)
}
#ifdef MAME_DEBUG
- // add crosshair adjusters
+ // add crosshair adjusters
for (port = machine.ioport().first_port(); port != NULL; port = port->next())
for (field = port->first_field(); field != NULL; field = field->next())
if (field->crosshair_axis() != CROSSHAIR_AXIS_NONE && field->player() == 0)
diff --git a/src/emu/ui/ui.h b/src/emu/ui/ui.h
index 4506555156f..fa6c4824d1a 100644
--- a/src/emu/ui/ui.h
+++ b/src/emu/ui/ui.h
@@ -170,25 +170,25 @@ public:
private:
// instance variables
- running_machine & m_machine;
- render_font * m_font;
- ui_callback m_handler_callback;
- UINT32 m_handler_param;
- bool m_single_step;
- bool m_showfps;
- osd_ticks_t m_showfps_end;
- bool m_show_profiler;
- osd_ticks_t m_popup_text_end;
- bool m_use_natural_keyboard;
- UINT8 * m_non_char_keys_down;
- render_texture * m_mouse_arrow_texture;
- bool m_mouse_show;
-
- // text generators
+ running_machine & m_machine;
+ render_font * m_font;
+ ui_callback m_handler_callback;
+ UINT32 m_handler_param;
+ bool m_single_step;
+ bool m_showfps;
+ osd_ticks_t m_showfps_end;
+ bool m_show_profiler;
+ osd_ticks_t m_popup_text_end;
+ bool m_use_natural_keyboard;
+ UINT8 * m_non_char_keys_down;
+ render_texture * m_mouse_arrow_texture;
+ bool m_mouse_show;
+
+ // text generators
astring &disclaimer_string(astring &buffer);
astring &warnings_string(astring &buffer);
- // UI handlers
+ // UI handlers
static UINT32 handler_messagebox(running_machine &machine, render_container *container, UINT32 state);
static UINT32 handler_messagebox_ok(running_machine &machine, render_container *container, UINT32 state);
static UINT32 handler_messagebox_anykey(running_machine &machine, render_container *container, UINT32 state);
diff --git a/src/emu/ui/viewgfx.c b/src/emu/ui/viewgfx.c
index c6410229121..feb084ca597 100644
--- a/src/emu/ui/viewgfx.c
+++ b/src/emu/ui/viewgfx.c
@@ -41,54 +41,54 @@ const int MAX_GFX_DECODERS = 8;
// information about a single gfx device
struct ui_gfx_info
{
- device_gfx_interface *interface; // pointer to device's gfx interface
- UINT8 setcount; // how many gfx sets device has
- UINT8 rotate[MAX_GFX_ELEMENTS]; // current rotation (orientation) value
- UINT8 columns[MAX_GFX_ELEMENTS]; // number of items per row
- int offset[MAX_GFX_ELEMENTS]; // current offset of top,left item
- int color[MAX_GFX_ELEMENTS]; // current color selected
+ device_gfx_interface *interface; // pointer to device's gfx interface
+ UINT8 setcount; // how many gfx sets device has
+ UINT8 rotate[MAX_GFX_ELEMENTS]; // current rotation (orientation) value
+ UINT8 columns[MAX_GFX_ELEMENTS]; // number of items per row
+ int offset[MAX_GFX_ELEMENTS]; // current offset of top,left item
+ int color[MAX_GFX_ELEMENTS]; // current color selected
};
struct ui_gfx_state
{
- bool started; // have we called ui_gfx_count_devices() yet?
- UINT8 mode; // which mode are we in?
+ bool started; // have we called ui_gfx_count_devices() yet?
+ UINT8 mode; // which mode are we in?
// intermediate bitmaps
- bool bitmap_dirty; // is the bitmap dirty?
- bitmap_rgb32 * bitmap; // bitmap for drawing gfx and tilemaps
- render_texture *texture; // texture for rendering the above bitmap
+ bool bitmap_dirty; // is the bitmap dirty?
+ bitmap_rgb32 * bitmap; // bitmap for drawing gfx and tilemaps
+ render_texture *texture; // texture for rendering the above bitmap
// palette-specific data
struct
{
- palette_device *device; // pointer to current device
- int devcount; // how many palette devices exist
- int devindex; // which palette device is visible
- UINT8 which; // which subset (pens or indirect colors)?
- UINT8 columns; // number of items per row
- int offset; // current offset of top left item
+ palette_device *device; // pointer to current device
+ int devcount; // how many palette devices exist
+ int devindex; // which palette device is visible
+ UINT8 which; // which subset (pens or indirect colors)?
+ UINT8 columns; // number of items per row
+ int offset; // current offset of top left item
} palette;
// graphics-specific data
struct
{
- UINT8 devcount; // how many gfx devices exist
- UINT8 devindex; // which device is visible
- UINT8 set; // which set is visible
+ UINT8 devcount; // how many gfx devices exist
+ UINT8 devindex; // which device is visible
+ UINT8 set; // which set is visible
} gfxset;
-
+
// information about each gfx device
ui_gfx_info gfxdev[MAX_GFX_DECODERS];
// tilemap-specific data
struct
{
- int which; // which tilemap are we viewing?
- int xoffs; // current X offset
- int yoffs; // current Y offset
- int zoom; // zoom factor
- UINT8 rotate; // current rotation (orientation) value
+ int which; // which tilemap are we viewing?
+ int xoffs; // current X offset
+ int yoffs; // current Y offset
+ int zoom; // zoom factor
+ UINT8 rotate; // current rotation (orientation) value
} tilemap;
};
@@ -254,7 +254,7 @@ bool ui_gfx_is_relevant(running_machine &machine)
UINT32 ui_gfx_ui_handler(running_machine &machine, render_container *container, UINT32 uistate)
{
ui_gfx_state &state = ui_gfx;
-
+
// if we have nothing, implicitly cancel
if (!ui_gfx_is_relevant(machine))
goto cancel;