Previous 15994 Revisions Next

r2654 Sunday 18th May, 2008 at 13:58:06 UTC by Nathan Woods
File Manager and Tape Control cleanups
[docs]messnew.txt
[src/mess]filemngr.c tapectrl.c

src/mess/tapectrl.c
r2653r2654
1414#include "devices/cassette.h"
1515#include "deprecat.h"
1616
17
18
19/***************************************************************************
20    IMPLEMENTATION
21***************************************************************************/
22
1723void tapecontrol_gettime(char *timepos, size_t timepos_size, const device_config *img, int *curpos, int *endpos)
1824{
1925   double t0, t1;
r2653r2654
3440
3541int tapecontrol(int selected)
3642{
43   running_machine *machine = Machine;
3744   static int id = 0;
3845   char timepos[32];
3946   ui_menu_item menu_item[40];
r2653r2654
151158      {
152159      case 0:
153160         id--;
154         if (id < 0) id = device_count(Machine, IO_CASSETTE)-1;
161         if (id < 0) id = device_count(machine, IO_CASSETTE)-1;
155162         break;
156163      }
157164   }
r2653r2654
162169      {
163170      case 0:
164171         id++;
165         if (id > device_count(Machine, IO_CASSETTE)-1) id = 0;
172         if (id > device_count(machine, IO_CASSETTE)-1) id = 0;
166173         break;
167174      }
168175   }
r2653r2654
177184         switch (sel)
178185         {
179186         case 0:
180            id = (id + 1) % device_count(Machine, IO_CASSETTE);
187            id = (id + 1) % device_count(machine, IO_CASSETTE);
181188            break;
182189         case 2:
183190            /* Pause/stop */
src/mess/filemngr.c
r2653r2654
1414#include "uimenu.h"
1515#include "mslegacy.h"
1616
17
18
19/***************************************************************************
20    PARAMETERS
21***************************************************************************/
22
1723#define SEL_BITS   12
1824#define SEL_MASK   ((1<<SEL_BITS)-1)
1925
26
27
28/***************************************************************************
29    LOCAL VARIABLES
30***************************************************************************/
31
2032static int count_chars_entered;
2133static char *enter_string;
2234static int enter_string_size;
r2653r2654
2537
2638static char entered_filename[512];
2739
40
41
42/***************************************************************************
43    IMPLEMENTATION
44***************************************************************************/
45
2846static void start_enter_string(char *string_buffer, int max_string_size, int filename_mode)
2947{
3048   enter_string = string_buffer;
r2653r2654
435453{
436454   int sel, total, arrowize;
437455   int visible;
456   running_machine *machine = Machine;
438457
439458   sel = selected - 1;
440459
r2653r2654
551570
552571      /* pause enables/disables pause */
553572      if (input_ui_pressed(IPT_UI_PAUSE))
554         mame_pause(Machine, !mame_is_paused(Machine));
573         mame_pause(machine, !mame_is_paused(machine));
555574
556575      if (input_ui_pressed(IPT_UI_SELECT))
557576      {
r2653r2654
648667
649668int filemanager(int selected)
650669{
670   running_machine *machine = Machine;
651671   static int previous_sel;
652672   const char *name;
653673   ui_menu_item menu_items[40];
654674   const device_config *devices[40];
655675   char names[40][64];
656   int sel, total, visible, arrowize;
676   UINT32 sel, total, visible, arrowize;
657677   const device_config *image;
658678
659679   sel = selected - 1;
660680   total = 0;
661681
662682   /* Cycle through all devices for this system */
663   for (image = image_device_first(Machine->config); image != NULL; image = image_device_next(image))
683   for (image = image_device_first(machine->config); image != NULL; image = image_device_next(image))
664684   {
665685      strcpy( names[total], image_typename_id(image) );
666686      name = image_filename(image);
r2653r2654
737757
738758   visible = ui_menu_draw(menu_items, total, sel, NULL);
739759
740   /* Maybe the following code up to IPT_UI_PAUSE can be replaced with a call to ui_menu_generic_keys() */
741
742   /* up backs up by one item */
743   if (input_ui_pressed_repeat(IPT_UI_UP, 6))
744      sel = (sel + total - 1) % total;
745
746   /* down advances by one item */
747   if (input_ui_pressed_repeat(IPT_UI_DOWN, 6))
748      sel = (sel +  1) % total;
749
750   /* page up backs up by visible_items */
751   if (input_ui_pressed_repeat(IPT_UI_PAGE_UP, 6))
752   {
753      if (sel >= visible - 1)
754         sel -= visible - 1;
755      else
756         sel = 0;
757   }
758
759   /* page down advances by visible_items */
760   if (input_ui_pressed_repeat(IPT_UI_PAGE_DOWN, 6))
761   {
762      sel += visible - 1;
763      if (sel >= total)
764         sel = total - 1;
765   }
766
767   /* home goes to the start */
768   if (input_ui_pressed(IPT_UI_HOME))
769      sel = 0;
770
771   /* end goes to the last */
772   if (input_ui_pressed(IPT_UI_END))
773      sel = total - 1;
774
775   /* pause enables/disables pause */
776   if (input_ui_pressed(IPT_UI_PAUSE))
777      mame_pause(Machine, !mame_is_paused(Machine));
778
779760   if (input_ui_pressed(IPT_UI_SELECT))
780761   {
781762      int os_sel;
r2653r2654
826807         sel |= 1 << SEL_BITS;   /* we'll ask for a key */
827808      }
828809   }
829
830   if (input_ui_pressed(IPT_UI_CANCEL))
810   else if (input_ui_pressed(IPT_UI_CANCEL))
811   {
831812      sel = -1;
813   }
814   else
815   {
816      ui_menu_generic_keys(&sel, total, visible);
817   }
832818
833819   if (input_ui_pressed(IPT_UI_CONFIGURE))
834820      sel = -2;
docs/messnew.txt
r2653r2654
5959
6060User Interface Changes:
6161-----------------------
62(none)
62- File Manager and Tape Control cleanups.  [Nate Woods]
6363
6464
6565

Previous 15994 Revisions Next


© 1998-2018 The MESS Team