Previous 15994 Revisions Next

r2999 Saturday 2nd August, 2008 at 16:18:49 UTC by R. Belmont
[SDLMESS] Sync with SDLMAME 0.126u3.
[src/osd/sdl]debugosx.c debugwin.c

src/osd/sdl/debugwin.c
r2998r2999
119119{
120120   memorycombo_item **tail = &memorycombo;
121121   UINT32 cpunum, spacenum;
122   int rgnnum, itemnum;
122   int itemnum;
123   const char *rgnname;
123124
124125   // first add all the CPUs' address spaces
125126   for (cpunum = 0; cpunum < MAX_CPU; cpunum++)
r2998r2999
141142   }
142143
143144   // then add all the memory regions
144   for (rgnnum = 0; rgnnum < MAX_MEMORY_REGIONS; rgnnum++)
145   rgnname = memory_region_next(machine, NULL);
146   while (rgnname != NULL)
145147   {
146      UINT8 *base = memory_region(machine, rgnnum);
147      UINT32 type = memory_region_type(machine, rgnnum);
148      if (base != NULL && type > REGION_INVALID && (type - REGION_INVALID) < ARRAY_LENGTH(memory_region_names))
148      UINT8 *base = memory_region(machine, rgnname);
149      memorycombo_item *ci = malloc_or_die(sizeof(*ci));
150      UINT32 flags = memory_region_flags(machine, rgnname);
151      UINT8 width = 0, little_endian;
152
153      memset(ci, 0, sizeof(*ci));
154      ci->base = base;
155      ci->length = memory_region_length(machine, rgnname);
156      little_endian = ((flags & ROMREGION_ENDIANMASK) == ROMREGION_LE);
157      switch (flags & ROMREGION_WIDTHMASK)
149158      {
150         memorycombo_item *ci = malloc_or_die(sizeof(*ci));
151         UINT32 flags = memory_region_flags(machine, rgnnum);
152         UINT8 width, little_endian;
153         memset(ci, 0, sizeof(*ci));
154         ci->base = base;
155         ci->length = memory_region_length(machine, rgnnum);
156         width = 1 << (flags & ROMREGION_WIDTHMASK);
157         little_endian = ((flags & ROMREGION_ENDIANMASK) == ROMREGION_LE);
158         if (type >= REGION_CPU1 && type <= REGION_CPU8)
159         {
160            const debug_cpu_info *cpuinfo = debug_get_cpu_info(type - REGION_CPU1);
161            if (cpuinfo)
162            {
163               width = cpuinfo->space[ADDRESS_SPACE_PROGRAM].databytes;
164               little_endian = (cpuinfo->endianness == CPU_IS_LE);
165            }
166         }
167         ci->prefsize = MIN(width, 4);
168         ci->offset_xor = width - 1;
169         ci->little_endian = little_endian;
170         strcpy(ci->name, memory_region_names[type - REGION_INVALID]);
171         *tail = ci;
172         tail = &ci->next;
159         case ROMREGION_8BIT:
160            width = 8;
161            break;
162         case ROMREGION_16BIT:
163            width = 16;
164            break;
165         case ROMREGION_32BIT:
166            width = 32;
167            break;
168         case ROMREGION_64BIT:
169            width = 64;
170            break;
173171      }
172      ci->prefsize = MIN(width, 4);
173      ci->offset_xor = width - 1;
174      ci->little_endian = little_endian;
175      strcpy(ci->name, rgnname);
176      *tail = ci;
177      tail = &ci->next;
178
179      // and get the next region
180      rgnname = memory_region_next(machine, rgnname);
174181   }
175182
176183   // finally add all global array symbols
src/osd/sdl/debugosx.c
r2998r2999
266266#endif
267267static void generic_recompute_children(debugwin_info *info);
268268
269static void memory_create_window(void);
269static void memory_create_window(running_machine *machine);
270270static void memory_recompute_children(debugwin_info *info);
271271static void memory_process_string(debugwin_info *info, const char *string);
272272static void memory_update_checkmarks(debugwin_info *info);
r2998r2999
19861986//  memory_determine_combo_items
19871987//============================================================
19881988
1989static void memory_determine_combo_items(void)
1989static void memory_determine_combo_items(running_machine *machine)
19901990{
19911991   memorycombo_item **tail = &memorycombo;
19921992   UINT32 cpunum, spacenum;
1993   int rgnnum, itemnum;
1993   int itemnum;
1994   const char *rgnname;
19941995
19951996   // first add all the CPUs' address spaces
19961997   for (cpunum = 0; cpunum < MAX_CPU; cpunum++)
r2998r2999
20122013   }
20132014
20142015   // then add all the memory regions
2015   for (rgnnum = 0; rgnnum < MAX_MEMORY_REGIONS; rgnnum++)
2016   rgnname = memory_region_next(machine, NULL);
2017   while (rgnname != NULL)
20162018   {
2017      UINT8 *base = memory_region(Machine, rgnnum);
2018      UINT32 type = memory_region_type(Machine, rgnnum);
2019      if (base != NULL && type > REGION_INVALID && (type - REGION_INVALID) < ARRAY_LENGTH(memory_region_names))
2019      UINT8 *base = memory_region(machine, rgnname);
2020      memorycombo_item *ci = malloc_or_die(sizeof(*ci));
2021      UINT32 flags = memory_region_flags(machine, rgnname);
2022      UINT8 width = 0, little_endian;
2023
2024      memset(ci, 0, sizeof(*ci));
2025      ci->base = base;
2026      ci->length = memory_region_length(machine, rgnname);
2027      little_endian = ((flags & ROMREGION_ENDIANMASK) == ROMREGION_LE);
2028      switch (flags & ROMREGION_WIDTHMASK)
20202029      {
2021         memorycombo_item *ci = malloc_or_die(sizeof(*ci));
2022         UINT32 flags = memory_region_flags(Machine, rgnnum);
2023         UINT8 width, little_endian;
2024         memset(ci, 0, sizeof(*ci));
2025         ci->base = base;
2026         ci->length = memory_region_length(Machine, rgnnum);
2027         width = 1 << (flags & ROMREGION_WIDTHMASK);
2028         little_endian = ((flags & ROMREGION_ENDIANMASK) == ROMREGION_LE);
2029         if (type >= REGION_CPU1 && type <= REGION_CPU8)
2030         {
2031            const debug_cpu_info *cpuinfo = debug_get_cpu_info(type - REGION_CPU1);
2032            if (cpuinfo)
2033            {
2034               width = cpuinfo->space[ADDRESS_SPACE_PROGRAM].databytes;
2035               little_endian = (cpuinfo->endianness == CPU_IS_LE);
2036            }
2037         }
2038         ci->prefsize = MIN(width, 4);
2039         ci->offset_xor = width - 1;
2040         ci->little_endian = little_endian;
2041         strcpy(ci->name, memory_region_names[type - REGION_INVALID]);
2042         *tail = ci;
2043         tail = &ci->next;
2030         case ROMREGION_8BIT:
2031            width = 8;
2032            break;
2033         case ROMREGION_16BIT:
2034            width = 16;
2035            break;
2036         case ROMREGION_32BIT:
2037            width = 32;
2038            break;
2039         case ROMREGION_64BIT:
2040            width = 64;
2041            break;
20442042      }
2043      ci->prefsize = MIN(width, 4);
2044      ci->offset_xor = width - 1;
2045      ci->little_endian = little_endian;
2046      strcpy(ci->name, rgnname);
2047      *tail = ci;
2048      tail = &ci->next;
2049
2050      // and get the next region
2051      rgnname = memory_region_next(machine, rgnname);
20452052   }
20462053
20472054   // finally add all global array symbols
r2998r2999
21032110//  memory_create_window
21042111//============================================================
21052112
2106static void memory_create_window(void)
2113static void memory_create_window(running_machine *machine)
21072114{
21082115   int curcpu = cpu_getactivecpu(), cursel = 0;
21092116   memorycombo_item *ci, *selci = NULL;
r2998r2999
22082215
22092216   // populate the combobox
22102217   if (!memorycombo)
2211      memory_determine_combo_items();
2218      memory_determine_combo_items(machine);
22122219   for (ci = memorycombo; ci; ci = ci->next)
22132220   {
22142221      CFStringRef      cfName = CFStringCreateWithCString( NULL, ci->name, CFStringGetSystemEncoding() );
r2998r2999
35153522   switch( cmd.commandID )
35163523   {
35173524      case ID_NEW_MEMORY_WND:
3518         memory_create_window();
3525         memory_create_window(Machine);
35193526         return 1;
35203527
35213528      case ID_NEW_DISASM_WND:
r2998r2999
36473654         {
36483655            case 'm':
36493656            case 'M':
3650               memory_create_window();
3657               memory_create_window(Machine);
36513658               return 1;
36523659           
36533660            case 'd':

Previous 15994 Revisions Next


© 1998-2018 The MESS Team