Previous 15994 Revisions Next

r7196 Saturday 30th January, 2010 at 14:02:18 UTC by Miodrag Milanović
Fix compile of U2 release
[src/emu]ui.c
[src/emu/cpu/v30mz]v30mz.c
[src/emu/machine]6526cia.h
[src/emu/sound]s14001a.c wave.c
[src/lib/util]pool.c

src/emu/cpu/v30mz/v30mz.c
r7195r7196
9090   UINT8   no_interrupt;
9191
9292   cpu_irq_callback irq_callback;
93   const device_config *device;
93   running_device *device;
9494   const address_space *program;
9595   const address_space *io;
9696   int icount;
r7195r7196
107107
108108extern int necv_dasm_one(char *buffer, UINT32 eip, const UINT8 *oprom, const nec_config *config);
109109
110INLINE v30mz_state *get_safe_token(const device_config *device)
110INLINE v30mz_state *get_safe_token(running_device *device)
111111{
112112   assert(device != NULL);
113113   assert(device->token != NULL);
r7195r7196
939939   return necv_dasm_one(buffer, pc, oprom, cpustate->config);
940940}
941941
942static void nec_init(const device_config *device, cpu_irq_callback irqcallback, int type)
942static void nec_init(running_device *device, cpu_irq_callback irqcallback, int type)
943943{
944944   v30mz_state *cpustate = get_safe_token(device);
945945
r7195r7196
10791079      case CPUINFO_INT_MIN_CYCLES:               info->i = 1;                     break;
10801080      case CPUINFO_INT_MAX_CYCLES:               info->i = 80;                     break;
10811081
1082      case CPUINFO_INT_DATABUS_WIDTH_PROGRAM:   info->i = 8;               break;
1083      case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 20;               break;
1084      case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0;               break;
1085      case CPUINFO_INT_DATABUS_WIDTH_DATA:   info->i = 0;               break;
1086      case CPUINFO_INT_ADDRBUS_WIDTH_DATA:   info->i = 0;               break;
1087      case CPUINFO_INT_ADDRBUS_SHIFT_DATA:   info->i = 0;               break;
1088      case CPUINFO_INT_DATABUS_WIDTH_IO:      info->i = 8;               break;
1089      case CPUINFO_INT_ADDRBUS_WIDTH_IO:      info->i = 16;               break;
1090      case CPUINFO_INT_ADDRBUS_SHIFT_IO:      info->i = 0;               break;
1082      case DEVINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM:   info->i = 8;               break;
1083      case DEVINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 20;               break;
1084      case DEVINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0;               break;
1085      case DEVINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA:   info->i = 0;               break;
1086      case DEVINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA:   info->i = 0;               break;
1087      case DEVINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA:   info->i = 0;               break;
1088      case DEVINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO:      info->i = 8;               break;
1089      case DEVINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO:      info->i = 16;               break;
1090      case DEVINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO:      info->i = 0;               break;
10911091
10921092      case CPUINFO_INT_INPUT_STATE + 0:            info->i = (cpustate->pending_irq & INT_IRQ) ? ASSERT_LINE : CLEAR_LINE; break;
10931093      case CPUINFO_INT_INPUT_STATE + INPUT_LINE_NMI:   info->i = cpustate->nmi_state;               break;
src/emu/machine/6526cia.h
r7195r7196
116116WRITE_LINE_DEVICE_HANDLER( mos6526_flag_w );
117117
118118/* port mask */
119void cia_set_port_mask_value(const device_config *device, int port, int data);
119void cia_set_port_mask_value(running_device *device, int port, int data);
120120
121121#endif /* __6526CIA_H__ */
src/emu/sound/wave.c
r7195r7196
2222static STREAM_UPDATE( wave_sound_update )
2323{
2424#ifdef MESS
25   const device_config *image = (const device_config *)param;
25   running_device *image = (running_device *)param;
2626   cassette_image *cassette;
2727   cassette_state state;
2828   double time_index;
r7195r7196
6262
6363static DEVICE_START( wave )
6464{
65   const device_config *image = NULL;
65   running_device *image = NULL;
6666
6767   assert( device != NULL );
68   assert( device->static_config != NULL );
68   assert( device->baseconfig().static_config != NULL );
6969
7070#ifdef MESS
71   image = device->machine->device( (const char *)device->static_config );
71   image = device->machine->device( (const char *)device->baseconfig().static_config );
7272#endif
7373   stream_create(device, 0, 2, device->machine->sample_rate, (void *)image, wave_sound_update);
7474}
src/emu/sound/s14001a.c
r7195r7196
231231 *   if mirrored mode is OFF, increment oddphone. if not, don't touch it here. if oddphone was 1 before the increment, increment phoneaddress and set oddphone to 0
232232 *
233233 */
234 
235#undef ACCURATE_SQUEAL
236234
237235#undef ACCURATE_SQUEAL
238236
src/emu/ui.c
r7195r7196
1414#include "video/vector.h"
1515#include "machine/laserdsc.h"
1616#include "profiler.h"
17#include "cheat.h"
1817#include "render.h"
18#include "cheat.h"
1919#include "rendfont.h"
2020#include "ui.h"
2121#include "uiinput.h"
r7195r7196
5454static render_font *ui_font;
5555
5656/* current UI handler */
57static UINT32 (*ui_handler_callback)(running_machine *, UINT32);
57static UINT32 (*ui_handler_callback)(running_machine *, render_container *, UINT32);
5858static UINT32 ui_handler_param;
5959
6060/* flag to track single stepping */
r7195r7196
9191static astring &warnings_string(running_machine *machine, astring &buffer);
9292
9393/* UI handlers */
94static UINT32 handler_messagebox(running_machine *machine, UINT32 state);
95static UINT32 handler_messagebox_ok(running_machine *machine, UINT32 state);
96static UINT32 handler_messagebox_anykey(running_machine *machine, UINT32 state);
97static UINT32 handler_ingame(running_machine *machine, UINT32 state);
98static UINT32 handler_load_save(running_machine *machine, UINT32 state);
94static UINT32 handler_messagebox(running_machine *machine, render_container *container, UINT32 state);
95static UINT32 handler_messagebox_ok(running_machine *machine, render_container *container, UINT32 state);
96static UINT32 handler_messagebox_anykey(running_machine *machine, render_container *container, UINT32 state);
97static UINT32 handler_ingame(running_machine *machine, render_container *container, UINT32 state);
98static UINT32 handler_load_save(running_machine *machine, render_container *container, UINT32 state);
9999
100100/* slider controls */
101101static slider_state *slider_alloc(running_machine *machine, const char *title, INT32 minval, INT32 defval, INT32 maxval, INT32 incval, slider_update update, void *arg);
r7195r7196
118118static INT32 slider_overyoffset(running_machine *machine, void *arg, astring *string, INT32 newval);
119119static INT32 slider_flicker(running_machine *machine, void *arg, astring *string, INT32 newval);
120120static INT32 slider_beam(running_machine *machine, void *arg, astring *string, INT32 newval);
121static char *slider_get_screen_desc(const device_config *screen);
122static char *slider_get_laserdisc_desc(const device_config *screen);
121static char *slider_get_screen_desc(running_device *screen);
122static char *slider_get_laserdisc_desc(running_device *screen);
123123#ifdef MAME_DEBUG
124124static INT32 slider_crossscale(running_machine *machine, void *arg, astring *string, INT32 newval);
125125static INT32 slider_crossoffset(running_machine *machine, void *arg, astring *string, INT32 newval);
r7195r7196
135135    pair for the current UI handler
136136-------------------------------------------------*/
137137
138INLINE UINT32 ui_set_handler(UINT32 (*callback)(running_machine *, UINT32), UINT32 param)
138INLINE UINT32 ui_set_handler(UINT32 (*callback)(running_machine *, render_container *, UINT32), UINT32 param)
139139{
140140   ui_handler_callback = callback;
141141   ui_handler_param = param;
r7195r7196
340340    render it; called by video.c
341341-------------------------------------------------*/
342342
343void ui_update_and_render(running_machine *machine)
343void ui_update_and_render(running_machine *machine, render_container *container)
344344{
345345   /* always start clean */
346   render_container_empty(render_container_get_ui());
346   render_container_empty(container);
347347
348348   /* if we're paused, dim the whole screen */
349349   if (mame_get_phase(machine) >= MAME_PHASE_RESET && (single_step || mame_is_paused(machine)))
r7195r7196
354354      if (alpha > 255)
355355         alpha = 255;
356356      if (alpha >= 0)
357         render_ui_add_rect(0.0f, 0.0f, 1.0f, 1.0f, MAKE_ARGB(alpha,0x00,0x00,0x00), PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
357         render_container_add_rect(container, 0.0f, 0.0f, 1.0f, 1.0f, MAKE_ARGB(alpha,0x00,0x00,0x00), PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
358358   }
359359
360360   /* render any cheat stuff at the bottom */
361   cheat_render_text(machine);
361   cheat_render_text(machine, container);
362362
363363   /* call the current UI handler */
364364   assert(ui_handler_callback != NULL);
365   ui_handler_param = (*ui_handler_callback)(machine, ui_handler_param);
365   ui_handler_param = (*ui_handler_callback)(machine, container, ui_handler_param);
366366
367367   /* display any popup messages */
368368   if (osd_ticks() < popup_text_end)
369      ui_draw_text_box(messagebox_text, JUSTIFY_CENTER, 0.5f, 0.9f, messagebox_backcolor);
369      ui_draw_text_box(container, messagebox_text, JUSTIFY_CENTER, 0.5f, 0.9f, messagebox_backcolor);
370370   else
371371      popup_text_end = 0;
372372
r7195r7196
462462    color
463463-------------------------------------------------*/
464464
465void ui_draw_outlined_box(float x0, float y0, float x1, float y1, rgb_t backcolor)
465void ui_draw_outlined_box(render_container *container, float x0, float y0, float x1, float y1, rgb_t backcolor)
466466{
467   render_ui_add_rect(x0, y0, x1, y1, backcolor, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
468   render_ui_add_line(x0, y0, x1, y0, UI_LINE_WIDTH, UI_BORDER_COLOR, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
469   render_ui_add_line(x1, y0, x1, y1, UI_LINE_WIDTH, UI_BORDER_COLOR, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
470   render_ui_add_line(x1, y1, x0, y1, UI_LINE_WIDTH, UI_BORDER_COLOR, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
471   render_ui_add_line(x0, y1, x0, y0, UI_LINE_WIDTH, UI_BORDER_COLOR, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
467   render_container_add_rect(container, x0, y0, x1, y1, backcolor, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
468   render_container_add_line(container, x0, y0, x1, y0, UI_LINE_WIDTH, UI_BORDER_COLOR, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
469   render_container_add_line(container, x1, y0, x1, y1, UI_LINE_WIDTH, UI_BORDER_COLOR, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
470   render_container_add_line(container, x1, y1, x0, y1, UI_LINE_WIDTH, UI_BORDER_COLOR, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
471   render_container_add_line(container, x0, y1, x0, y0, UI_LINE_WIDTH, UI_BORDER_COLOR, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
472472}
473473
474474
r7195r7196
476476    ui_draw_text - simple text renderer
477477-------------------------------------------------*/
478478
479void ui_draw_text(const char *buf, float x, float y)
479void ui_draw_text(render_container *container, const char *buf, float x, float y)
480480{
481   ui_draw_text_full(buf, x, y, 1.0f - x, JUSTIFY_LEFT, WRAP_WORD, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, NULL, NULL);
481   ui_draw_text_full(container, buf, x, y, 1.0f - x, JUSTIFY_LEFT, WRAP_WORD, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, NULL, NULL);
482482}
483483
484484
r7195r7196
488488    and full size computation
489489-------------------------------------------------*/
490490
491void ui_draw_text_full(const char *origs, float x, float y, float origwrapwidth, int justify, int wrap, int draw, rgb_t fgcolor, rgb_t bgcolor, float *totalwidth, float *totalheight)
491void ui_draw_text_full(render_container *container, const char *origs, float x, float y, float origwrapwidth, int justify, int wrap, int draw, rgb_t fgcolor, rgb_t bgcolor, float *totalwidth, float *totalheight)
492492{
493493   float lineheight = ui_get_line_height();
494494   const char *ends = origs + strlen(origs);
r7195r7196
625625
626626      /* if opaque, add a black box */
627627      if (draw == DRAW_OPAQUE)
628         render_ui_add_rect(curx, cury, curx + curwidth, cury + lineheight, bgcolor, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
628         render_container_add_rect(container, curx, cury, curx + curwidth, cury + lineheight, bgcolor, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
629629
630630      /* loop from the line start and add the characters */
631631      while (linestart < s)
r7195r7196
638638
639639         if (draw != DRAW_NONE)
640640         {
641            render_ui_add_char(curx, cury, lineheight, render_get_ui_aspect(), fgcolor, ui_font, linechar);
641            render_container_add_char(container, curx, cury, lineheight, render_get_ui_aspect(), fgcolor, ui_font, linechar);
642642            curx += ui_get_char_width(linechar);
643643         }
644644         linestart += linecharcount;
r7195r7196
647647      /* append ellipses if needed */
648648      if (wrap == WRAP_TRUNCATE && *s != 0 && draw != DRAW_NONE)
649649      {
650         render_ui_add_char(curx, cury, lineheight, render_get_ui_aspect(), fgcolor, ui_font, '.');
650         render_container_add_char(container, curx, cury, lineheight, render_get_ui_aspect(), fgcolor, ui_font, '.');
651651         curx += ui_get_char_width('.');
652         render_ui_add_char(curx, cury, lineheight, render_get_ui_aspect(), fgcolor, ui_font, '.');
652         render_container_add_char(container, curx, cury, lineheight, render_get_ui_aspect(), fgcolor, ui_font, '.');
653653         curx += ui_get_char_width('.');
654         render_ui_add_char(curx, cury, lineheight, render_get_ui_aspect(), fgcolor, ui_font, '.');
654         render_container_add_char(container, curx, cury, lineheight, render_get_ui_aspect(), fgcolor, ui_font, '.');
655655         curx += ui_get_char_width('.');
656656      }
657657
r7195r7196
692692    message with a box around it
693693-------------------------------------------------*/
694694
695void ui_draw_text_box(const char *text, int justify, float xpos, float ypos, rgb_t backcolor)
695void ui_draw_text_box(render_container *container, const char *text, int justify, float xpos, float ypos, rgb_t backcolor)
696696{
697697   float target_width, target_height;
698698   float target_x, target_y;
699699
700700   /* compute the multi-line target width/height */
701   ui_draw_text_full(text, 0, 0, 1.0f - 2.0f * UI_BOX_LR_BORDER,
701   ui_draw_text_full(container, text, 0, 0, 1.0f - 2.0f * UI_BOX_LR_BORDER,
702702            justify, WRAP_WORD, DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &target_width, &target_height);
703703   if (target_height > 1.0f - 2.0f * UI_BOX_TB_BORDER)
704704      target_height = floor((1.0f - 2.0f * UI_BOX_TB_BORDER) / ui_get_line_height()) * ui_get_line_height();
r7195r7196
718718      target_y = 1.0f - UI_BOX_TB_BORDER - target_height;
719719
720720   /* add a box around that */
721   ui_draw_outlined_box(target_x - UI_BOX_LR_BORDER,
721   ui_draw_outlined_box(container, target_x - UI_BOX_LR_BORDER,
722722                target_y - UI_BOX_TB_BORDER,
723723                target_x + target_width + UI_BOX_LR_BORDER,
724724                target_y + target_height + UI_BOX_TB_BORDER, backcolor);
725   ui_draw_text_full(text, target_x, target_y, target_width,
725   ui_draw_text_full(container, text, target_x, target_y, target_width,
726726            justify, WRAP_WORD, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, NULL, NULL);
727727}
728728
r7195r7196
969969astring &game_info_astring(running_machine *machine, astring &string)
970970{
971971   int scrcount = video_screen_count(machine->config);
972   const device_config *scandevice;
973   const device_config *device;
972   running_device *scandevice;
973   running_device *device;
974974   int found_sound = FALSE;
975975   int count;
976976
r7195r7196
985985
986986      /* count how many identical CPUs we have */
987987      count = 1;
988      for (scandevice = device->typenext; scandevice != NULL; scandevice = scandevice->typenext)
988      for (scandevice = device->typenext(); scandevice != NULL; scandevice = scandevice->typenext())
989989      {
990990         if (cpu_get_type(device) != cpu_get_type(scandevice) || device->clock != scandevice->clock)
991991            break;
r7195r7196
995995      /* if more than one, prepend a #x in front of the CPU name */
996996      if (count > 1)
997997         string.catprintf("%d" UTF8_MULTIPLY, count);
998      string.cat(cpu_get_name(device));
998      string.cat(device->name());
999999
10001000      /* display clock in kHz or MHz */
10011001      if (clock >= 1000000)
r7195r7196
10051005   }
10061006
10071007   /* loop over all sound chips */
1008   for (device = sound_first(machine->config); device != NULL; device = scandevice)
1008   for (device = sound_first(machine); device != NULL; device = scandevice)
10091009   {
10101010      /* append the Sound: string */
10111011      if (!found_sound)
r7195r7196
10141014
10151015      /* count how many identical sound chips we have */
10161016      count = 1;
1017      for (scandevice = device->typenext; scandevice != NULL; scandevice = scandevice->typenext)
1017      for (scandevice = device->typenext(); scandevice != NULL; scandevice = scandevice->typenext())
10181018      {
10191019         if (sound_get_type(device) != sound_get_type(scandevice) || device->clock != scandevice->clock)
10201020            break;
r7195r7196
10241024      /* if more than one, prepend a #x in front of the CPU name */
10251025      if (count > 1)
10261026         string.catprintf("%d" UTF8_MULTIPLY, count);
1027      string.cat(device_get_name(device));
1027      string.cat(device->name());
10281028
10291029      /* display clock in kHz or MHz */
10301030      if (device->clock >= 1000000)
r7195r7196
10411041      string.cat("None\n");
10421042   else
10431043   {
1044      const device_config *screen;
1045
1046      for (screen = video_screen_first(machine->config); screen != NULL; screen = video_screen_next(screen))
1044      for (running_device *screen = video_screen_first(machine); screen != NULL; screen = video_screen_next(screen))
10471045      {
1048         const screen_config *scrconfig = (const screen_config *)screen->inline_config;
1046         const screen_config *scrconfig = (const screen_config *)screen->baseconfig().inline_config;
10491047
10501048         if (scrcount > 1)
10511049         {
r7195r7196
10821080    messagebox_text string but handles no input
10831081-------------------------------------------------*/
10841082
1085static UINT32 handler_messagebox(running_machine *machine, UINT32 state)
1083static UINT32 handler_messagebox(running_machine *machine, render_container *container, UINT32 state)
10861084{
1087   ui_draw_text_box(messagebox_text, JUSTIFY_LEFT, 0.5f, 0.5f, messagebox_backcolor);
1085   ui_draw_text_box(container, messagebox_text, JUSTIFY_LEFT, 0.5f, 0.5f, messagebox_backcolor);
10881086   return 0;
10891087}
10901088
r7195r7196
10941092    messagebox_text string and waits for an OK
10951093-------------------------------------------------*/
10961094
1097static UINT32 handler_messagebox_ok(running_machine *machine, UINT32 state)
1095static UINT32 handler_messagebox_ok(running_machine *machine, render_container *container, UINT32 state)
10981096{
10991097   /* draw a standard message window */
1100   ui_draw_text_box(messagebox_text, JUSTIFY_LEFT, 0.5f, 0.5f, messagebox_backcolor);
1098   ui_draw_text_box(container, messagebox_text, JUSTIFY_LEFT, 0.5f, 0.5f, messagebox_backcolor);
11011099
11021100   /* an 'O' or left joystick kicks us to the next state */
11031101   if (state == 0 && (input_code_pressed_once(machine, KEYCODE_O) || ui_input_pressed(machine, IPT_UI_LEFT)))
r7195r7196
11241122    any keypress
11251123-------------------------------------------------*/
11261124
1127static UINT32 handler_messagebox_anykey(running_machine *machine, UINT32 state)
1125static UINT32 handler_messagebox_anykey(running_machine *machine, render_container *container, UINT32 state)
11281126{
11291127   /* draw a standard message window */
1130   ui_draw_text_box(messagebox_text, JUSTIFY_LEFT, 0.5f, 0.5f, messagebox_backcolor);
1128   ui_draw_text_box(container, messagebox_text, JUSTIFY_LEFT, 0.5f, 0.5f, messagebox_backcolor);
11311129
11321130   /* if the user cancels, exit out completely */
11331131   if (ui_input_pressed(machine, IPT_UI_CANCEL))
r7195r7196
11491147    of the standard keypresses
11501148-------------------------------------------------*/
11511149
1152static UINT32 handler_ingame(running_machine *machine, UINT32 state)
1150static UINT32 handler_ingame(running_machine *machine, render_container *container, UINT32 state)
11531151{
11541152   int is_paused = mame_is_paused(machine);
11551153
11561154   /* first draw the FPS counter */
11571155   if (showfps || osd_ticks() < showfps_end)
11581156   {
1159      ui_draw_text_full(video_get_speed_text(machine), 0.0f, 0.0f, 1.0f,
1157      ui_draw_text_full(container, video_get_speed_text(machine), 0.0f, 0.0f, 1.0f,
11601158               JUSTIFY_RIGHT, WRAP_WORD, DRAW_OPAQUE, ARGB_WHITE, ARGB_BLACK, NULL, NULL);
11611159   }
11621160   else
r7195r7196
11671165   {
11681166      astring profilertext;
11691167      profiler_get_text(machine, profilertext);
1170      ui_draw_text_full(profilertext, 0.0f, 0.0f, 1.0f, JUSTIFY_LEFT, WRAP_WORD, DRAW_OPAQUE, ARGB_WHITE, ARGB_BLACK, NULL, NULL);
1168      ui_draw_text_full(container, profilertext, 0.0f, 0.0f, 1.0f, JUSTIFY_LEFT, WRAP_WORD, DRAW_OPAQUE, ARGB_WHITE, ARGB_BLACK, NULL, NULL);
11711169   }
11721170
11731171   /* if we're single-stepping, pause now */
r7195r7196
13141312    specifying a game to save or load
13151313-------------------------------------------------*/
13161314
1317static UINT32 handler_load_save(running_machine *machine, UINT32 state)
1315static UINT32 handler_load_save(running_machine *machine, render_container *container, UINT32 state)
13181316{
13191317   char filename[20];
13201318   input_code code;
r7195r7196
13261324
13271325   /* okay, we're waiting for a key to select a slot; display a message */
13281326   if (state == LOADSAVE_SAVE)
1329      ui_draw_message_window("Select position to save to");
1327      ui_draw_message_window(container, "Select position to save to");
13301328   else
1331      ui_draw_message_window("Select position to load from");
1329      ui_draw_message_window(container, "Select position to load from");
13321330
13331331   /* check for cancel key */
13341332   if (ui_input_pressed(machine, IPT_UI_CANCEL))
r7195r7196
14231421{
14241422   const input_field_config *field;
14251423   const input_port_config *port;
1426   const device_config *device;
1424   running_device *device;
14271425   slider_state *listhead = NULL;
14281426   slider_state **tailptr = &listhead;
14291427   astring string;
r7195r7196
14491447   }
14501448
14511449   /* add analog adjusters */
1452   for (port = machine->portlist.head; port != NULL; port = port->next)
1450   for (port = machine->portlist.first(); port != NULL; port = port->next)
14531451      for (field = port->fieldlist; field != NULL; field = field->next)
14541452         if (field->type == IPT_ADJUSTER)
14551453         {
r7195r7196
14711469   }
14721470
14731471   /* add screen parameters */
1474   for (device = video_screen_first(machine->config); device != NULL; device = video_screen_next(device))
1472   for (device = video_screen_first(machine); device != NULL; device = video_screen_next(device))
14751473   {
1476      const screen_config *scrconfig = (const screen_config *)device->inline_config;
1474      const screen_config *scrconfig = (const screen_config *)device->baseconfig().inline_config;
14771475      int defxscale = floor(scrconfig->xscale * 1000.0f + 0.5f);
14781476      int defyscale = floor(scrconfig->yscale * 1000.0f + 0.5f);
14791477      int defxoffset = floor(scrconfig->xoffset * 1000.0f + 0.5f);
r7195r7196
15141512      tailptr = &(*tailptr)->next;
15151513   }
15161514
1517   for (device = device_list_first(&machine->config->devicelist, LASERDISC); device != NULL; device = device_list_next(device, LASERDISC))
1515   for (device = machine->devicelist.first(LASERDISC); device != NULL; device = device->typenext())
15181516   {
1519      const laserdisc_config *config = (const laserdisc_config *)device->inline_config;
1517      const laserdisc_config *config = (const laserdisc_config *)device->baseconfig().inline_config;
15201518      if (config->overupdate != NULL)
15211519      {
15221520         int defxscale = floor(config->overscalex * 1000.0f + 0.5f);
r7195r7196
15411539      }
15421540   }
15431541
1544   for (device = video_screen_first(machine->config); device != NULL; device = video_screen_next(device))
1542   for (device = video_screen_first(machine); device != NULL; device = video_screen_next(device))
15451543   {
1546      const screen_config *scrconfig = (const screen_config *)device->inline_config;
1544      const screen_config *scrconfig = (const screen_config *)device->baseconfig().inline_config;
15471545      if (scrconfig->type == SCREEN_TYPE_VECTOR)
15481546      {
15491547         /* add flicker control */
r7195r7196
15571555
15581556#ifdef MAME_DEBUG
15591557   /* add crosshair adjusters */
1560   for (port = machine->portlist.head; port != NULL; port = port->next)
1558   for (port = machine->portlist.first(); port != NULL; port = port->next)
15611559      for (field = port->fieldlist; field != NULL; field = field->next)
15621560         if (field->crossaxis != CROSSHAIR_AXIS_NONE && field->player == 0)
15631561         {
r7195r7196
16341632
16351633static INT32 slider_overclock(running_machine *machine, void *arg, astring *string, INT32 newval)
16361634{
1637   const device_config *cpu = (const device_config *)arg;
1635   running_device *cpu = (running_device *)arg;
16381636   if (newval != SLIDER_NOCHANGE)
16391637      cpu_set_clockscale(cpu, (float)newval * 0.001f);
16401638   if (string != NULL)
r7195r7196
16491647
16501648static INT32 slider_refresh(running_machine *machine, void *arg, astring *string, INT32 newval)
16511649{
1652   const device_config *screen = (const device_config *)arg;
1653   const screen_config *scrconfig = (const screen_config *)screen->inline_config;
1650   running_device *screen = (running_device *)arg;
1651   const screen_config *scrconfig = (const screen_config *)screen->baseconfig().inline_config;
16541652   double defrefresh = ATTOSECONDS_TO_HZ(scrconfig->refresh);
16551653   double refresh;
16561654
r7195r7196
16761674
16771675static INT32 slider_brightness(running_machine *machine, void *arg, astring *string, INT32 newval)
16781676{
1679   const device_config *screen = (const device_config *)arg;
1677   running_device *screen = (running_device *)arg;
16801678   render_container *container = render_container_get_screen(screen);
16811679   render_container_user_settings settings;
16821680
r7195r7196
16991697
17001698static INT32 slider_contrast(running_machine *machine, void *arg, astring *string, INT32 newval)
17011699{
1702   const device_config *screen = (const device_config *)arg;
1700   running_device *screen = (running_device *)arg;
17031701   render_container *container = render_container_get_screen(screen);
17041702   render_container_user_settings settings;
17051703
r7195r7196
17211719
17221720static INT32 slider_gamma(running_machine *machine, void *arg, astring *string, INT32 newval)
17231721{
1724   const device_config *screen = (const device_config *)arg;
1722   running_device *screen = (running_device *)arg;
17251723   render_container *container = render_container_get_screen(screen);
17261724   render_container_user_settings settings;
17271725
r7195r7196
17441742
17451743static INT32 slider_xscale(running_machine *machine, void *arg, astring *string, INT32 newval)
17461744{
1747   const device_config *screen = (const device_config *)arg;
1745   running_device *screen = (running_device *)arg;
17481746   render_container *container = render_container_get_screen(screen);
17491747   render_container_user_settings settings;
17501748
r7195r7196
17671765
17681766static INT32 slider_yscale(running_machine *machine, void *arg, astring *string, INT32 newval)
17691767{
1770   const device_config *screen = (const device_config *)arg;
1768   running_device *screen = (running_device *)arg;
17711769   render_container *container = render_container_get_screen(screen);
17721770   render_container_user_settings settings;
17731771
r7195r7196
17901788
17911789static INT32 slider_xoffset(running_machine *machine, void *arg, astring *string, INT32 newval)
17921790{
1793   const device_config *screen = (const device_config *)arg;
1791   running_device *screen = (running_device *)arg;
17941792   render_container *container = render_container_get_screen(screen);
17951793   render_container_user_settings settings;
17961794
r7195r7196
18131811
18141812static INT32 slider_yoffset(running_machine *machine, void *arg, astring *string, INT32 newval)
18151813{
1816   const device_config *screen = (const device_config *)arg;
1814   running_device *screen = (running_device *)arg;
18171815   render_container *container = render_container_get_screen(screen);
18181816   render_container_user_settings settings;
18191817
r7195r7196
18361834
18371835static INT32 slider_overxscale(running_machine *machine, void *arg, astring *string, INT32 newval)
18381836{
1839   const device_config *laserdisc = (const device_config *)arg;
1837   running_device *laserdisc = (running_device *)arg;
18401838   laserdisc_config settings;
18411839
18421840   laserdisc_get_config(laserdisc, &settings);
r7195r7196
18581856
18591857static INT32 slider_overyscale(running_machine *machine, void *arg, astring *string, INT32 newval)
18601858{
1861   const device_config *laserdisc = (const device_config *)arg;
1859   running_device *laserdisc = (running_device *)arg;
18621860   laserdisc_config settings;
18631861
18641862   laserdisc_get_config(laserdisc, &settings);
r7195r7196
18801878
18811879static INT32 slider_overxoffset(running_machine *machine, void *arg, astring *string, INT32 newval)
18821880{
1883   const device_config *laserdisc = (const device_config *)arg;
1881   running_device *laserdisc = (running_device *)arg;
18841882   laserdisc_config settings;
18851883
18861884   laserdisc_get_config(laserdisc, &settings);
r7195r7196
19021900
19031901static INT32 slider_overyoffset(running_machine *machine, void *arg, astring *string, INT32 newval)
19041902{
1905   const device_config *laserdisc = (const device_config *)arg;
1903   running_device *laserdisc = (running_device *)arg;
19061904   laserdisc_config settings;
19071905
19081906   laserdisc_get_config(laserdisc, &settings);
r7195r7196
19521950    description for a given screen
19531951-------------------------------------------------*/
19541952
1955static char *slider_get_screen_desc(const device_config *screen)
1953static char *slider_get_screen_desc(running_device *screen)
19561954{
19571955   int screen_count = video_screen_count(screen->machine->config);
19581956   static char descbuf[256];
r7195r7196
19711969    description for a given laseridsc
19721970-------------------------------------------------*/
19731971
1974static char *slider_get_laserdisc_desc(const device_config *laserdisc)
1972static char *slider_get_laserdisc_desc(running_device *laserdisc)
19751973{
1976   int ldcount = device_list_items(&laserdisc->machine->config->devicelist, LASERDISC);
1974   int ldcount = laserdisc->machine->devicelist.count(LASERDISC);
19771975   static char descbuf[256];
19781976
19791977   if (ldcount > 1)
src/lib/util/pool.c
r7195r7196
3939
4040#include <stdarg.h>
4141#include <stddef.h>
42#include <stdlib.h>
4243#include "pool.h"
4344#include "coreutil.h"
4445

Previous 15994 Revisions Next


© 1998-2018 The MESS Team