Previous 15994 Revisions Next

r3204 Monday 8th September, 2008 at 03:15:00 UTC by Nathan Woods
Moved MESS-specific main menu item setup into a MESS-specific function
[src/emu]uimenu.c
[src/mess]uimess.c uimess.h

src/emu/uimenu.c
r3203r3204
14311431   int has_configs = FALSE;
14321432   int has_analog = FALSE;
14331433   int has_dips = FALSE;
1434#ifdef MESS
1435   int has_keyboard = FALSE;
1436#endif
14371434
14381435   /* scan the input port array to see what options we need to enable */
14391436   for (port = machine->portconfig; port != NULL; port = port->next)
r3203r3204
14471444            has_categories = TRUE;
14481445         if (input_type_is_analog(field->type))
14491446            has_analog = TRUE;
1450#ifdef MESS
1451         if (field->type == IPT_KEYBOARD)
1452            has_keyboard = TRUE;         
1453#endif
14541447      }
14551448
14561449   /* add input menu items */
r3203r3204
14761469   ui_menu_item_append(menu, CAPSTARTGAMENOUN " Information", NULL, 0, menu_game_info);
14771470
14781471#ifdef MESS
1479     /* add image info menu */
1480   ui_menu_item_append(menu, "Image Information", NULL, 0, ui_menu_image_info);
1481
1482     /* add image info menu */
1483   ui_menu_item_append(menu, "File Manager", NULL, 0, menu_file_manager);
1484
1485#if HAS_WAVE
1486     /* add tape control menu */
1487   if (device_find_from_machine(machine, IO_CASSETTE))
1488      ui_menu_item_append(menu, "Tape Control", NULL, 0, menu_tape_control);
1489#endif /* HAS_WAVE */
1490
1491     /* add keyboard mode menu */
1492     if( has_keyboard && inputx_can_post(machine) )
1493      ui_menu_item_append(menu, "Keyboard Mode", NULL, 0, ui_menu_keyboard_mode);
1472   /* add MESS-specific menus */
1473   ui_mess_main_menu_populate(machine, menu);
14941474#endif /* MESS */
14951475
14961476   /* add sliders menu */
src/mess/uimess.c
r3203r3204
389389   machine->ui_mess_data->use_natural_keyboard = use_natural_keyboard;
390390}
391391
392
393
392394/*-------------------------------------------------
393    ui_menu_keyboard_mode - menu that   
395    ui_mess_menu_keyboard_mode - menu that   
394396-------------------------------------------------*/
395397
396void ui_menu_keyboard_mode(running_machine *machine, ui_menu *menu, void *parameter, void *state)
398void ui_mess_menu_keyboard_mode(running_machine *machine, ui_menu *menu, void *parameter, void *state)
397399{
398400   const ui_menu_event *event;
399401   int natural = ui_mess_get_use_natural_keyboard(machine);
r3203r3204
415417      }
416418   }     
417419}
420
421
422
423/*-------------------------------------------------
424    ui_mess_menu_keyboard_mode - populate MESS-specific menus   
425-------------------------------------------------*/
426
427void ui_mess_main_menu_populate(running_machine *machine, ui_menu *menu)
428{
429   const input_field_config *field;
430   const input_port_config *port;
431   int has_keyboard = FALSE;
432
433   /* scan the input port array to see what options we need to enable */
434   for (port = machine->portconfig; port != NULL; port = port->next)
435   {
436      for (field = port->fieldlist; field != NULL; field = field->next)
437      {
438         if (field->type == IPT_KEYBOARD)
439            has_keyboard = TRUE;         
440      }
441   }
442
443     /* add image info menu */
444   ui_menu_item_append(menu, "Image Information", NULL, 0, ui_menu_image_info);
445
446     /* add image info menu */
447   ui_menu_item_append(menu, "File Manager", NULL, 0, menu_file_manager);
448
449#if HAS_WAVE
450     /* add tape control menu */
451   if (device_find_from_machine(machine, IO_CASSETTE))
452      ui_menu_item_append(menu, "Tape Control", NULL, 0, menu_tape_control);
453#endif /* HAS_WAVE */
454
455     /* add keyboard mode menu */
456     if (has_keyboard && inputx_can_post(machine))
457      ui_menu_item_append(menu, "Keyboard Mode", NULL, 0, ui_mess_menu_keyboard_mode);
458}
src/mess/uimess.h
r3203r3204
5858void ui_mess_set_use_natural_keyboard(running_machine *machine, int use_natural_keyboard);
5959
6060/* keyboard mode menu */
61void ui_menu_keyboard_mode(running_machine *machine, ui_menu *menu, void *parameter, void *state);
61void ui_mess_menu_keyboard_mode(running_machine *machine, ui_menu *menu, void *parameter, void *state);
6262
63/* populate MESS-specific menus */
64void ui_mess_main_menu_populate(running_machine *machine, ui_menu *menu);
65
6366#endif /* __UIMESS_H__ */

Previous 15994 Revisions Next


© 1998-2018 The MESS Team