Previous 15994 Revisions Next

r9241 Monday 27th September, 2010 at 20:59:32 UTC by Miodrag Milanović
Sync with MAME.
[src/emu]addrmap.h debugger.c emu.mak memory.c
[src/emu/cpu/sh2]sh2comn.c
[src/emu/machine]er2055.c* er2055.h* x2212.c x2212.h
[src/osd]osdepend.h
[src/osd/osdmini]minimain.c
[src/osd/sdl]debug-intf.c debugosx.m debugwin.c
[src/osd/windows]debugwin.c

src/osd/osdmini/minimain.c
r9240r9241
136136
137137
138138//============================================================
139//  osd_init_debugger
140//============================================================
141
142void osd_init_debugger(running_machine *machine)
143{
144}
145
146
147//============================================================
139148//  osd_wait_for_debugger
140149//============================================================
141150
src/osd/sdl/debug-intf.c
r9240r9241
688688  gtk_widget_add_accelerator (physical_addresses, "activate", accel_group,
689689                              GDK_y, (GdkModifierType) GDK_CONTROL_MASK,
690690                              GTK_ACCEL_VISIBLE);
691  gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (physical_addresses), TRUE);
692691
693692  separatormenuitem1 = gtk_separator_menu_item_new ();
694693  gtk_widget_set_name (separatormenuitem1, "separatormenuitem1");
r9240r9241
800799  g_signal_connect_swapped ((gpointer) chunks_4, "activate",
801800                            G_CALLBACK (on_chunks_4_activate),
802801                            GTK_OBJECT (memorywin));
803  g_signal_connect_swapped ((gpointer) logical_addresses, "group_changed",
802  g_signal_connect_swapped ((gpointer) logical_addresses, "activate",
804803                            G_CALLBACK (on_logical_addresses_group_changed),
805804                            GTK_OBJECT (memorywin));
806  g_signal_connect_swapped ((gpointer) physical_addresses, "group_changed",
805  g_signal_connect_swapped ((gpointer) physical_addresses, "activate",
807806                            G_CALLBACK (on_physical_addresses_group_changed),
808807                            GTK_OBJECT (memorywin));
809808  g_signal_connect_swapped ((gpointer) reverse, "activate",
src/osd/sdl/debugosx.m
r9240r9241
6363
6464
6565//============================================================
66//  osd_init_debugger
67//============================================================
68
69void osd_init_debugger(running_machine *machine)
70{
71}
72
73//============================================================
6674//  osd_wait_for_debugger
6775//============================================================
6876
src/osd/sdl/debugwin.c
r9240r9241
2222#include "debug-sup.h"
2323#include "debug-cb.h"
2424
25#include "config.h"
26
2527//============================================================
2628//  PARAMETERS
2729//============================================================
r9240r9241
7476   running_device *      cpu;   // current CPU
7577};
7678
79struct windowState
80{
81    windowState() : type(0),
82                    sizeX(-1), sizeY(-1),
83                    positionX(-1), positionY(-1) { }
84    ~windowState() { }
85   
86    void loadFromXmlDataNode(xml_data_node* wnode)
87    {
88        if (!wnode) return;
89       
90        type = xml_get_attribute_int(wnode, "type", type);
7791
92        sizeX = xml_get_attribute_int(wnode, "size_x", sizeX);
93        sizeY = xml_get_attribute_int(wnode, "size_y", sizeY);
94        positionX = xml_get_attribute_int(wnode, "position_x", positionX);
95        positionY = xml_get_attribute_int(wnode, "position_y", positionY);
96    }
97
98    int type;
99    int sizeX;
100    int sizeY;
101    int positionX;
102    int positionY;
103};
104windowState windowStateArray[64];
105int windowStateCount = 0;
106
78107//============================================================
79108//  LOCAL VARIABLES
80109//============================================================
r9240r9241
86115//============================================================
87116
88117static void debugmain_init(running_machine *machine);
118static void memorywin_new(running_machine *machine);
119static void disasmwin_new(running_machine *machine);
120static void logwin_new(running_machine *machine);
89121
90122
91123//============================================================
r9240r9241
444476}
445477
446478
479//============================================================
480//  configuration_load
481//============================================================
447482
483static void configuration_load(running_machine *machine, int config_type, xml_data_node *parentnode)
484{
485   xml_data_node *wnode;
486
487   /* we only care about game files */
488   if (config_type != CONFIG_TYPE_GAME)
489      return;
490
491   /* might not have any data */
492   if (parentnode == NULL)
493      return;
494
495    /* configuration load */
496   int i = 0;
497   for (wnode = xml_get_sibling(parentnode->child, "window"); wnode != NULL; wnode = xml_get_sibling(wnode->next, "window"))
498    {
499        windowStateArray[i].loadFromXmlDataNode(wnode);
500        i++;
501    }
502    windowStateCount = i;
503}
504
448505//============================================================
506//  configuration_save
507//============================================================
508
509static void configuration_save(running_machine *machine, int config_type, xml_data_node *parentnode)
510{
511   /* we only care about game files */
512   if (config_type != CONFIG_TYPE_GAME)
513      return;
514
515   // Loop over all the nodes
516   for(win_i *p = win_list; p != NULL; p = p->next)
517   {
518       /* create a node */
519       xml_data_node *debugger_node;
520       debugger_node = xml_add_child(parentnode, "window", NULL);
521
522       xml_set_attribute_int(debugger_node, "type", p->type);
523
524       if (debugger_node != NULL)
525       {
526           int x, y;
527           gtk_window_get_position(GTK_WINDOW(p->win), &x, &y);
528            xml_set_attribute_int(debugger_node, "position_x", x);
529            xml_set_attribute_int(debugger_node, "position_y", y);
530
531           gtk_window_get_size(GTK_WINDOW(p->win), &x, &y);
532            xml_set_attribute_int(debugger_node, "size_x", x);
533            xml_set_attribute_int(debugger_node, "size_y", y);
534        }
535    }
536}
537
538
539//============================================================
540//  osd_init_debugger
541//============================================================
542
543void osd_init_debugger(running_machine *machine)
544{
545   /* register callbacks */
546   config_register(machine, "debugger", configuration_load, configuration_save);
547}
548
549
550//============================================================
449551//  osd_wait_for_debugger
450552//============================================================
451553
452554void osd_wait_for_debugger(running_device *device, int firststop)
453555{
454556   win_i *dmain = get_first_win_i(WIN_TYPE_MAIN);
455   // create a console window
557
558   // Create a console window if one doesn't already exist
456559   if(!dmain)
457560   {
458561      // GTK init should probably be done earlier
459562      gtk_init(0, 0);
460563      debugmain_init(device->machine);
564
565        // Resize the main window
566        for (int i = 0; i < windowStateCount; i++)
567        {
568            if (windowStateArray[i].type == WIN_TYPE_MAIN)
569            {
570                gtk_window_move(GTK_WINDOW(win_list->win), windowStateArray[i].positionX, windowStateArray[i].positionY);
571                gtk_window_resize(GTK_WINDOW(win_list->win), windowStateArray[i].sizeX, windowStateArray[i].sizeY);
572            }
573        }
574       
575        // Respawn and reposition every other window
576        for (int i = 0; i < windowStateCount; i++)
577        {
578            if (!windowStateArray[i].type || windowStateArray[i].type == WIN_TYPE_MAIN)
579                continue;
580           
581            switch (windowStateArray[i].type)
582            {
583                case WIN_TYPE_MEMORY: memorywin_new(device->machine); break;
584                case WIN_TYPE_DISASM: disasmwin_new(device->machine); break;
585                case WIN_TYPE_LOG:    logwin_new(device->machine); break;
586                default: break;
587            }
588           
589            gtk_window_move(GTK_WINDOW(win_list->win), windowStateArray[i].positionX, windowStateArray[i].positionY);
590            gtk_window_resize(GTK_WINDOW(win_list->win), windowStateArray[i].sizeX, windowStateArray[i].sizeY);
591        }
461592   }
462593
463594   // update the views in the console to reflect the current CPU
r9240r9241
468599}
469600
470601
471
472602//============================================================
473603//  debugwin_update_during_game
474604//============================================================
r9240r9241
483613}
484614
485615
486
487616//============================================================
488617//  debugmain_process_string
489618//============================================================
r9240r9241
11431272#include "emu.h"
11441273
11451274// win32 stubs for linking
1275void osd_init_debugger(running_machine *machine)
1276{
1277}
1278
11461279void osd_wait_for_debugger(running_device *device, int firststop)
11471280{
11481281}
src/osd/osdepend.h
r9240r9241
126126-----------------------------------------------------------------------------*/
127127void osd_init(running_machine *machine);
128128
129void osd_init_debugger(running_machine *machine);
129130void osd_wait_for_debugger(device_t *device, int firststop);
130131
131132
src/osd/windows/debugwin.c
r9240r9241
9595#define EDIT_BOX_STYLE_EX      0
9696
9797// combo box styles
98#define COMBO_BOX_STYLE         WS_CHILD | WS_VISIBLE | CBS_DROPDOWNLIST
98#define COMBO_BOX_STYLE         WS_CHILD | WS_VISIBLE | CBS_DROPDOWNLIST | WS_VSCROLL
9999#define COMBO_BOX_STYLE_EX      0
100100
101101// horizontal scroll bar styles
r9240r9241
262262
263263
264264//============================================================
265//  osd_init_debugger
266//============================================================
267
268void osd_init_debugger(running_machine *machine)
269{
270}
271
272
273//============================================================
265274//  osd_wait_for_debugger
266275//============================================================
267276
r9240r9241
17751784   SendMessage(info->otherwnd[0], WM_SETFONT, (WPARAM)debug_font, (LPARAM)FALSE);
17761785
17771786   // populate the combobox
1787   int maxlength = 0;
17781788   for (const debug_view_source *source = info->view[0].view->source_list().head(); source != NULL; source = source->next())
17791789   {
1790      int length = strlen(source->name());
1791      if (length > maxlength)
1792         maxlength = length;
17801793      TCHAR *t_name = tstring_from_utf8(source->name());
17811794      SendMessage(info->otherwnd[0], CB_ADDSTRING, 0, (LPARAM)t_name);
17821795      osd_free(t_name);
17831796   }
17841797   const debug_view_source *source = info->view[0].view->source_list().match_device(curcpu);
17851798   SendMessage(info->otherwnd[0], CB_SETCURSEL, info->view[0].view->source_list().index(*source), 0);
1799   SendMessage(info->otherwnd[0], CB_SETDROPPEDWIDTH, (maxlength + 2) * debug_font_width + vscroll_width, 0);
17861800   info->view[0].view->set_source(*source);
17871801
17881802   // set the child functions
r9240r9241
20812095   SendMessage(info->otherwnd[0], WM_SETFONT, (WPARAM)debug_font, (LPARAM)FALSE);
20822096
20832097   // populate the combobox
2098   int maxlength = 0;
20842099   for (const debug_view_source *source = info->view[0].view->source_list().head(); source != NULL; source = source->next())
20852100   {
2101      int length = strlen(source->name());
2102      if (length > maxlength)
2103         maxlength = length;
20862104      TCHAR *t_name = tstring_from_utf8(source->name());
20872105      SendMessage(info->otherwnd[0], CB_ADDSTRING, 0, (LPARAM)t_name);
20882106      osd_free(t_name);
20892107   }
20902108   const debug_view_source *source = info->view[0].view->source_list().match_device(curcpu);
20912109   SendMessage(info->otherwnd[0], CB_SETCURSEL, info->view[0].view->source_list().index(*source), 0);
2110   SendMessage(info->otherwnd[0], CB_SETDROPPEDWIDTH, (maxlength + 2) * debug_font_width + vscroll_width, 0);
20922111   info->view[0].view->set_source(*source);
20932112
20942113   // set the child functions
src/emu/cpu/sh2/sh2comn.c
r9240r9241
150150  b) in the CPU_EXECUTE loop
151151
152152
153  we're currently doing b)
153  we're currently doing a)
154  b) seems to cause issues with ST-V games
154155
155156*/
156157
158// Fever Soccer requires stupidly fast DMA or the palette gets corrupt due
159// to DMA being cancelled mid-flight.  Are we incorrectly emulating some other register?
160#define DMA_TIMER_STEP (ATTOTIME_IN_NSEC(1))
161// have a bigger delay if no data is available, as it will take some time before there is
162// any, and having such a high frequency timer with no data is not a good idea
163#define DMA_TIMER_STEP_IF_UNAVAILABLE (ATTOTIME_IN_NSEC(1000))
157164
158165void sh2_do_dma(sh2_state *sh2, int dma)
159166{
r9240r9241
163170
164171   if (sh2->active_dma_count[dma] > 0)
165172   {
166#ifdef USE_TIMER_FOR_DMA
167       //schedule next DMA callback
168      timer_adjust_oneshot(sh2->dma_current_active_timer[dma], sh2->device->cycles_to_attotime(2), dma);
169#endif
170173
174
171175      // process current DMA
172176      switch(sh2->active_dma_size[dma])
173177      {
r9240r9241
192196               int available = sh2->dma_callback_fifo_data_available(tempsrc, tempdst, 0, sh2->active_dma_size[dma]);
193197   
194198               if (!available)
199               {
200                  #ifdef USE_TIMER_FOR_DMA
201                  //schedule next DMA callback
202                  timer_adjust_oneshot(sh2->dma_current_active_timer[dma], DMA_TIMER_STEP_IF_UNAVAILABLE , dma);
203                  #endif
195204                  return;
205               }
206                 
196207            }
197208               
209            #ifdef USE_TIMER_FOR_DMA
210             //schedule next DMA callback
211            timer_adjust_oneshot(sh2->dma_current_active_timer[dma], DMA_TIMER_STEP , dma);
212            #endif
198213
199214            dmadata = sh2->program->read_byte(tempsrc);
200215            if (sh2->dma_callback_kludge) dmadata = sh2->dma_callback_kludge(tempsrc, tempdst, dmadata, sh2->active_dma_size[dma]);
r9240r9241
231246               int available = sh2->dma_callback_fifo_data_available(tempsrc, tempdst, 0, sh2->active_dma_size[dma]);
232247   
233248               if (!available)
249               {
250                  #ifdef USE_TIMER_FOR_DMA
251                  //schedule next DMA callback
252                  timer_adjust_oneshot(sh2->dma_current_active_timer[dma], DMA_TIMER_STEP_IF_UNAVAILABLE , dma);
253                  #endif
234254                  return;
255               }
235256            }
236257
258            #ifdef USE_TIMER_FOR_DMA
259             //schedule next DMA callback
260            timer_adjust_oneshot(sh2->dma_current_active_timer[dma], DMA_TIMER_STEP , dma);
261            #endif
262
237263            // check: should this really be using read_word_32 / write_word_32?
238264            dmadata   = sh2->program->read_word(tempsrc);
239265            if (sh2->dma_callback_kludge) dmadata = sh2->dma_callback_kludge(tempsrc, tempdst, dmadata, sh2->active_dma_size[dma]);
r9240r9241
269295               int available = sh2->dma_callback_fifo_data_available(tempsrc, tempdst, 0, sh2->active_dma_size[dma]);
270296   
271297               if (!available)
298               {
299                  #ifdef USE_TIMER_FOR_DMA
300                  //schedule next DMA callback
301                  timer_adjust_oneshot(sh2->dma_current_active_timer[dma], DMA_TIMER_STEP_IF_UNAVAILABLE , dma);
302                  #endif
272303                  return;
304               }
273305            }
274306
307            #ifdef USE_TIMER_FOR_DMA
308             //schedule next DMA callback
309            timer_adjust_oneshot(sh2->dma_current_active_timer[dma], DMA_TIMER_STEP , dma);
310            #endif
311
275312            dmadata   = sh2->program->read_dword(tempsrc);
276313            if (sh2->dma_callback_kludge) dmadata = sh2->dma_callback_kludge(tempsrc, tempdst, dmadata, sh2->active_dma_size[dma]);
277314            sh2->program->write_dword(tempdst, dmadata);
r9240r9241
308345                  fatalerror("SH2 dma_callback_fifo_data_available == 0 in unsupported mode");
309346            }
310347
348
349            #ifdef USE_TIMER_FOR_DMA
350             //schedule next DMA callback
351            timer_adjust_oneshot(sh2->dma_current_active_timer[dma], DMA_TIMER_STEP , dma);
352            #endif
353
311354            dmadata = sh2->program->read_dword(tempsrc);
312355            if (sh2->dma_callback_kludge) dmadata = sh2->dma_callback_kludge(tempsrc, tempdst, dmadata, sh2->active_dma_size[dma]);
313356            sh2->program->write_dword(tempdst, dmadata);
r9240r9241
406449         }
407450#ifdef USE_TIMER_FOR_DMA
408451         // start DMA timer
409         timer_adjust_oneshot(sh2->dma_current_active_timer[dma], sh2->device->cycles_to_attotime(2), dma);
452         timer_adjust_oneshot(sh2->dma_current_active_timer[dma], attotime_zero, dma);
410453#endif
411454
412455      }
src/emu/memory.c
r9240r9241
480480   UINT8 **            m_rambaseptr;         // pointer to the bank base
481481   UINT8               m_subunits;            // for width stubs, the number of subunits
482482   UINT8               m_subshift[8];         // for width stubs, the shift of each subunit
483   UINT64               m_invsubmask;         // inverted mask of the populated subunits
483484};
484485
485486
r9240r9241
43704371{
43714372   UINT64 unitmask = ((UINT64)1 << handlerbits) - 1;
43724373   assert(handlermask != 0);
4374   
4375   // set the inverse mask
4376   m_invsubmask = ~handlermask;
43734377
43744378   // compute the maximum possible subunits
43754379   int maxunits = m_datawidth / handlerbits;
r9240r9241
46184622
46194623UINT16 handler_entry_read::read_stub_16_from_8(address_space &space, offs_t offset, UINT16 mask)
46204624{
4621   UINT16 result = 0;
4625   UINT16 result = space.unmap() & m_invsubmask;
46224626   for (int index = 0; index < m_subunits; index++)
46234627   {
46244628      int shift = m_subshift[index];
r9240r9241
46374641
46384642UINT32 handler_entry_read::read_stub_32_from_8(address_space &space, offs_t offset, UINT32 mask)
46394643{
4640   UINT32 result = 0;
4644   UINT32 result = space.unmap() & m_invsubmask;
46414645   for (int index = 0; index < m_subunits; index++)
46424646   {
46434647      int shift = m_subshift[index];
r9240r9241
46564660
46574661UINT64 handler_entry_read::read_stub_64_from_8(address_space &space, offs_t offset, UINT64 mask)
46584662{
4659   UINT64 result = 0;
4663   UINT64 result = space.unmap() & m_invsubmask;
46604664   for (int index = 0; index < m_subunits; index++)
46614665   {
46624666      int shift = m_subshift[index];
r9240r9241
46754679
46764680UINT32 handler_entry_read::read_stub_32_from_16(address_space &space, offs_t offset, UINT32 mask)
46774681{
4678   UINT32 result = 0;
4682   UINT32 result = space.unmap() & m_invsubmask;
46794683   for (int index = 0; index < m_subunits; index++)
46804684   {
46814685      int shift = m_subshift[index];
r9240r9241
46944698
46954699UINT64 handler_entry_read::read_stub_64_from_16(address_space &space, offs_t offset, UINT64 mask)
46964700{
4697   UINT64 result = 0;
4701   UINT64 result = space.unmap() & m_invsubmask;
46984702   for (int index = 0; index < m_subunits; index++)
46994703   {
47004704      int shift = m_subshift[index];
r9240r9241
47134717
47144718UINT64 handler_entry_read::read_stub_64_from_32(address_space &space, offs_t offset, UINT64 mask)
47154719{
4716   UINT64 result = 0;
4720   UINT64 result = space.unmap() & m_invsubmask;
47174721   for (int index = 0; index < m_subunits; index++)
47184722   {
47194723      int shift = m_subshift[index];
src/emu/emu.mak
r9240r9241
152152   $(EMUMACHINE)/ds2401.o \
153153   $(EMUMACHINE)/ds2404.o \
154154   $(EMUMACHINE)/eeprom.o \
155   $(EMUMACHINE)/er2055.o \
155156   $(EMUMACHINE)/f3853.o \
156157   $(EMUMACHINE)/generic.o \
157158   $(EMUMACHINE)/i8243.o \
src/emu/machine/er2055.c
r0r9241
1/***************************************************************************
2
3    er2055.c
4
5    GI 512 bit electrically alterable read-only memory.
6
7****************************************************************************
8
9    Copyright Aaron Giles
10    All rights reserved.
11
12    Redistribution and use in source and binary forms, with or without
13    modification, are permitted provided that the following conditions are
14    met:
15
16        * Redistributions of source code must retain the above copyright
17          notice, this list of conditions and the following disclaimer.
18        * Redistributions in binary form must reproduce the above copyright
19          notice, this list of conditions and the following disclaimer in
20          the documentation and/or other materials provided with the
21          distribution.
22        * Neither the name 'MAME' nor the names of its contributors may be
23          used to endorse or promote products derived from this software
24          without specific prior written permission.
25
26    THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
27    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
28    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
29    DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
30    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
31    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
34    STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
35    IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36    POSSIBILITY OF SUCH DAMAGE.
37
38***************************************************************************/
39
40#include "emu.h"
41#include "machine/er2055.h"
42
43
44//**************************************************************************
45//  GLOBAL VARIABLES
46//**************************************************************************
47
48const device_type ER2055 = er2055_device_config::static_alloc_device_config;
49
50static ADDRESS_MAP_START( er2055_map, ADDRESS_SPACE_PROGRAM, 8 )
51   AM_RANGE(0x0000, 0x003f) AM_RAM
52ADDRESS_MAP_END
53
54
55
56//**************************************************************************
57//  DEVICE CONFIGURATION
58//**************************************************************************
59
60//-------------------------------------------------
61//  er2055_device_config - constructor
62//-------------------------------------------------
63
64er2055_device_config::er2055_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
65   : device_config(mconfig, static_alloc_device_config, "ER2055", tag, owner, clock),
66     device_config_memory_interface(mconfig, *this),
67     device_config_nvram_interface(mconfig, *this),
68     m_space_config("EAROM", ENDIANNESS_BIG, 8, 6, 0, *ADDRESS_MAP_NAME(er2055_map))
69{
70}
71
72
73//-------------------------------------------------
74//  static_alloc_device_config - allocate a new
75//  configuration object
76//-------------------------------------------------
77
78device_config *er2055_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
79{
80   return global_alloc(er2055_device_config(mconfig, tag, owner, clock));
81}
82
83
84//-------------------------------------------------
85//  alloc_device - allocate a new device object
86//-------------------------------------------------
87
88device_t *er2055_device_config::alloc_device(running_machine &machine) const
89{
90   return auto_alloc(&machine, er2055_device(machine, *this));
91}
92
93
94//-------------------------------------------------
95//  memory_space_config - return a description of
96//  any address spaces owned by this device
97//-------------------------------------------------
98
99const address_space_config *er2055_device_config::memory_space_config(int spacenum) const
100{
101   return (spacenum == 0) ? &m_space_config : NULL;
102}
103
104
105
106//**************************************************************************
107//  LIVE DEVICE
108//**************************************************************************
109
110//-------------------------------------------------
111//  er2055_device - constructor
112//-------------------------------------------------
113
114er2055_device::er2055_device(running_machine &_machine, const er2055_device_config &config)
115   : device_t(_machine, config),
116     device_memory_interface(_machine, config, *this),
117     device_nvram_interface(_machine, config, *this),
118     m_config(config),
119     m_control_state(0),
120     m_address(0),
121     m_data(0)
122{
123}
124
125
126//-------------------------------------------------
127//  device_start - device-specific startup
128//-------------------------------------------------
129
130void er2055_device::device_start()
131{
132   state_save_register_device_item(this, 0, m_control_state);
133   state_save_register_device_item(this, 0, m_address);
134   state_save_register_device_item(this, 0, m_data);
135   
136   m_control_state = 0;
137}
138
139
140//-------------------------------------------------
141//  nvram_default - called to initialize NVRAM to
142//  its default state
143//-------------------------------------------------
144
145void er2055_device::nvram_default()
146{
147   // default to all-0xff
148   for (int byte = 0; byte < SIZE_DATA; byte++)
149      m_addrspace[0]->write_byte(byte, 0xff);
150
151   // populate from a memory region if present
152   if (m_region != NULL)
153   {
154      if (m_region->bytes() != SIZE_DATA)
155         fatalerror("er2055 region '%s' wrong size (expected size = 0x100)", tag());
156      if (m_region->width() != 1)
157         fatalerror("er2055 region '%s' needs to be an 8-bit region", tag());
158
159      for (int byte = 0; byte < SIZE_DATA; byte++)
160         m_addrspace[0]->write_byte(byte, m_region->u8(byte));
161   }
162}
163
164
165//-------------------------------------------------
166//  nvram_read - called to read NVRAM from the
167//  .nv file
168//-------------------------------------------------
169
170void er2055_device::nvram_read(mame_file &file)
171{
172   UINT8 buffer[SIZE_DATA];
173   mame_fread(&file, buffer, sizeof(buffer));
174   for (int byte = 0; byte < SIZE_DATA; byte++)
175      m_addrspace[0]->write_byte(byte, buffer[byte]);
176}
177
178
179//-------------------------------------------------
180//  nvram_write - called to write NVRAM to the
181//  .nv file
182//-------------------------------------------------
183
184void er2055_device::nvram_write(mame_file &file)
185{
186   UINT8 buffer[SIZE_DATA];
187   for (int byte = 0; byte < SIZE_DATA; byte++)
188      buffer[byte] = m_addrspace[0]->read_byte(byte);
189   mame_fwrite(&file, buffer, sizeof(buffer));
190}
191
192
193
194//**************************************************************************
195//  I/O OPERATIONS
196//**************************************************************************
197
198//-------------------------------------------------
199//  set_control - set the control lines; these
200//  must be done simultaneously because the chip
201//  reacts to various combinations
202//-------------------------------------------------
203
204void er2055_device::set_control(UINT8 cs1, UINT8 cs2, UINT8 c1, UINT8 c2, UINT8 ck)
205{
206   // create a new composite control state
207   UINT8 oldstate = m_control_state;
208   m_control_state = (ck != 0) ? CK : 0;
209   m_control_state |= (c1 != 0) ? C1 : 0;
210   m_control_state |= (c2 != 0) ? C2 : 0;
211   m_control_state |= (cs1 != 0) ? CS1 : 0;
212   m_control_state |= (cs2 != 0) ? CS2 : 0;
213
214   // if not selected, or if change from previous, we're done
215   if ((m_control_state & (CS1 | CS2)) != (CS1 | CS2) || m_control_state == oldstate)
216      return;
217   
218   // something changed, see what it is based on what mode we're in
219   switch (m_control_state & (C1 | C2))
220   {
221      // write mode; erasing is required, so we perform an AND against previous
222      // data to simulate incorrect behavior if erasing was not done
223      case 0:
224         m_addrspace[0]->write_byte(m_address, m_addrspace[0]->read_byte(m_address) & m_data);
225//printf("Write %02X = %02X\n", m_address, m_data);
226         break;
227
228      // erase mode
229      case C2:
230         m_addrspace[0]->write_byte(m_address, 0xff);
231//printf("Erase %02X\n", m_address);
232         break;
233     
234      // read mode
235      case C1:
236         if ((oldstate & CK) != 0 && (m_control_state & CK) == 0)
237         {
238            m_data = m_addrspace[0]->read_byte(m_address);
239//printf("Read %02X = %02X\n", m_address, m_data);
240         }
241         break;
242   }
243}
src/emu/machine/er2055.h
r0r9241
1/***************************************************************************
2
3    er2055.h
4
5    GI 512 bit electrically alterable read-only memory.
6
7****************************************************************************
8
9    Copyright Aaron Giles
10    All rights reserved.
11
12    Redistribution and use in source and binary forms, with or without
13    modification, are permitted provided that the following conditions are
14    met:
15
16        * Redistributions of source code must retain the above copyright
17          notice, this list of conditions and the following disclaimer.
18        * Redistributions in binary form must reproduce the above copyright
19          notice, this list of conditions and the following disclaimer in
20          the documentation and/or other materials provided with the
21          distribution.
22        * Neither the name 'MAME' nor the names of its contributors may be
23          used to endorse or promote products derived from this software
24          without specific prior written permission.
25
26    THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
27    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
28    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
29    DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
30    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
31    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
34    STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
35    IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36    POSSIBILITY OF SUCH DAMAGE.
37
38***************************************************************************/
39
40#pragma once
41
42#ifndef __ER2055_H__
43#define __ER2055_H__
44
45
46
47//**************************************************************************
48//  INTERFACE CONFIGURATION MACROS
49//**************************************************************************
50
51#define MDRV_ER2055_ADD(_tag) \
52   MDRV_DEVICE_ADD(_tag, ER2055, 0) \
53
54
55
56//**************************************************************************
57//  TYPE DEFINITIONS
58//**************************************************************************
59
60
61// ======================> er2055_device_config
62
63class er2055_device_config :   public device_config,
64                        public device_config_memory_interface,
65                        public device_config_nvram_interface
66{
67   friend class er2055_device;
68
69   // construction/destruction
70   er2055_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
71
72public:
73   // allocators
74   static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
75   virtual device_t *alloc_device(running_machine &machine) const;
76
77protected:
78   // device_config_memory_interface overrides
79   virtual const address_space_config *memory_space_config(int spacenum = 0) const;
80
81   // device-specific configuration
82   address_space_config      m_space_config;
83};
84
85
86// ======================> er2055_device
87
88class er2055_device :   public device_t,
89                  public device_memory_interface,
90                  public device_nvram_interface
91{
92   friend class er2055_device_config;
93
94   // construction/destruction
95   er2055_device(running_machine &_machine, const er2055_device_config &config);
96
97public:
98   // I/O operations
99   UINT8 data() const { return m_data; }
100   void set_address(UINT8 address) { m_address = address & 0x3f; }
101   void set_data(UINT8 data) { m_data = data; }
102   
103   // control lines -- all lines are specified as active-high (even CS2)
104   void set_control(UINT8 cs1, UINT8 cs2, UINT8 c1, UINT8 c2, UINT8 ck);
105
106protected:
107   // device-level overrides
108   virtual void device_start();
109
110   // device_nvram_interface overrides
111   virtual void nvram_default();
112   virtual void nvram_read(mame_file &file);
113   virtual void nvram_write(mame_file &file);
114
115   static const int SIZE_DATA = 0x40;
116
117   static const UINT8 CK  = 0x01;
118   static const UINT8 C1  = 0x02;
119   static const UINT8 C2  = 0x04;
120   static const UINT8 CS1 = 0x08;
121   static const UINT8 CS2 = 0x10;
122
123   // internal state
124   const er2055_device_config &m_config;
125   
126   UINT8      m_control_state;
127   UINT8      m_address;
128   UINT8      m_data;
129};
130
131
132// device type definition
133extern const device_type ER2055;
134
135
136#endif
src/emu/machine/x2212.c
r9240r9241
1/*
2 * Xicor X2212
3 *
4 * 256 x 4 bit Nonvolatile Static RAM
5 *
6 */
1/***************************************************************************
72
3    x2212.c
4
5    Xicor X2212 256 x 4 bit Nonvolatile Static RAM.
6
7***************************************************************************/
8
89#include "emu.h"
910#include "machine/x2212.h"
1011
11#define SIZE_DATA ( 0x100 )
1212
13typedef struct
13//**************************************************************************
14//  GLOBAL VARIABLES
15//**************************************************************************
16
17const device_type X2212 = x2212_device_config::static_alloc_device_config;
18
19static ADDRESS_MAP_START( x2212_map, ADDRESS_SPACE_PROGRAM, 8 )
20   AM_RANGE(0x0000, 0x00ff) AM_RAM
21ADDRESS_MAP_END
22
23
24
25//**************************************************************************
26//  DEVICE CONFIGURATION
27//**************************************************************************
28
29//-------------------------------------------------
30//  x2212_device_config - constructor
31//-------------------------------------------------
32
33x2212_device_config::x2212_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
34   : device_config(mconfig, static_alloc_device_config, "X2212", tag, owner, clock),
35     device_config_memory_interface(mconfig, *this),
36     device_config_nvram_interface(mconfig, *this),
37     m_sram_space_config("SRAM", ENDIANNESS_BIG, 8, 8, 0, *ADDRESS_MAP_NAME(x2212_map)),
38     m_e2prom_space_config("E2PROM", ENDIANNESS_BIG, 8, 8, 0, *ADDRESS_MAP_NAME(x2212_map)),
39     m_auto_save(false)
1440{
15   UINT8 *sram;
16   UINT8 *e2prom;
17   UINT8 *default_data;
18   int store;
19   int array_recall;
20} x2212_state;
41}
2142
22/*-------------------------------------------------
23    get_safe_token - makes sure that the passed
24    in device is, in fact, an X2212
25-------------------------------------------------*/
2643
27INLINE x2212_state *get_safe_token(running_device *device)
44//-------------------------------------------------
45//  static_alloc_device_config - allocate a new
46//  configuration object
47//-------------------------------------------------
48
49device_config *x2212_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
2850{
29   assert(device != NULL);
30   assert(device->type() == X2212);
51   return global_alloc(x2212_device_config(mconfig, tag, owner, clock));
52}
3153
32   return (x2212_state *)downcast<legacy_device_base *>(device)->token();
54
55//-------------------------------------------------
56//  alloc_device - allocate a new device object
57//-------------------------------------------------
58
59device_t *x2212_device_config::alloc_device(running_machine &machine) const
60{
61   return auto_alloc(&machine, x2212_device(machine, *this));
3362}
3463
35WRITE8_DEVICE_HANDLER( x2212_write )
64
65//-------------------------------------------------
66//  memory_space_config - return a description of
67//  any address spaces owned by this device
68//-------------------------------------------------
69
70const address_space_config *x2212_device_config::memory_space_config(int spacenum) const
3671{
37   x2212_state *c = get_safe_token(device);
72   return (spacenum == 0) ? &m_sram_space_config : (spacenum == 1) ? &m_e2prom_space_config : NULL;
73}
3874
39   c->sram[ offset ] = data;
75
76//-------------------------------------------------
77//  static_set_auto_save - configuration helper
78//  to set the auto-save flag
79//-------------------------------------------------
80
81void x2212_device_config::static_set_auto_save(device_config *device)
82{
83   downcast<x2212_device_config *>(device)->m_auto_save = true;
4084}
4185
4286
43READ8_DEVICE_HANDLER( x2212_read )
87
88//**************************************************************************
89//  LIVE DEVICE
90//**************************************************************************
91
92//-------------------------------------------------
93//  x2212_device - constructor
94//-------------------------------------------------
95
96x2212_device::x2212_device(running_machine &_machine, const x2212_device_config &config)
97   : device_t(_machine, config),
98     device_memory_interface(_machine, config, *this),
99     device_nvram_interface(_machine, config, *this),
100     m_config(config),
101     m_store(false),
102     m_array_recall(false)
44103{
45   x2212_state *c = get_safe_token(device);
104}
46105
47   return c->sram[ offset ];
106
107//-------------------------------------------------
108//  device_start - device-specific startup
109//-------------------------------------------------
110
111void x2212_device::device_start()
112{
113   state_save_register_device_item(this, 0, m_store);
114   state_save_register_device_item(this, 0, m_array_recall);
115   
116   m_sram = m_addrspace[0];
117   m_e2prom = m_addrspace[1];
48118}
49119
50WRITE_LINE_DEVICE_HANDLER( x2212_store )
120
121//-------------------------------------------------
122//  nvram_default - called to initialize NVRAM to
123//  its default state
124//-------------------------------------------------
125
126void x2212_device::nvram_default()
51127{
52   x2212_state *c = get_safe_token(device);
128   // default to all-0xff
129   for (int byte = 0; byte < SIZE_DATA; byte++)
130   {
131      m_sram->write_byte(byte, 0xff);
132      m_e2prom->write_byte(byte, 0xff);
133   }
53134
54   state &= 1;
55   if( !state && c->store )
135   // populate from a memory region if present
136   if (m_region != NULL)
56137   {
57      memcpy( c->e2prom, c->sram, SIZE_DATA );
138      if (m_region->bytes() != SIZE_DATA)
139         fatalerror("x2212 region '%s' wrong size (expected size = 0x100)", tag());
140      if (m_region->width() != 1)
141         fatalerror("x2212 region '%s' needs to be an 8-bit region", tag());
142
143      for (int byte = 0; byte < SIZE_DATA; byte++)
144         m_e2prom->write_byte(byte, m_region->u8(byte));
58145   }
59
60   c->store = state;
61146}
62147
63WRITE_LINE_DEVICE_HANDLER( x2212_array_recall )
148
149//-------------------------------------------------
150//  nvram_read - called to read NVRAM from the
151//  .nv file
152//-------------------------------------------------
153
154void x2212_device::nvram_read(mame_file &file)
64155{
65   x2212_state *c = get_safe_token(device);
66
67   state &= 1;
68   if( !state && c->array_recall )
156   UINT8 buffer[SIZE_DATA];
157   mame_fread(&file, buffer, sizeof(buffer));
158   for (int byte = 0; byte < SIZE_DATA; byte++)
69159   {
70      memcpy( c->sram, c->e2prom, SIZE_DATA );
160      m_sram->write_byte(byte, 0xff);
161      m_e2prom->write_byte(byte, buffer[byte]);
71162   }
72
73   c->array_recall = state;
74163}
75164
76/*-------------------------------------------------
77    device start callback
78-------------------------------------------------*/
79165
80static DEVICE_START(x2212)
166//-------------------------------------------------
167//  nvram_write - called to write NVRAM to the
168//  .nv file
169//-------------------------------------------------
170
171void x2212_device::nvram_write(mame_file &file)
81172{
82   x2212_state *c = get_safe_token(device);
173   // auto-save causes an implicit store prior to exiting (writing)
174   if (m_config.m_auto_save)
175      store();
176   
177   UINT8 buffer[SIZE_DATA];
178   for (int byte = 0; byte < SIZE_DATA; byte++)
179      buffer[byte] = m_e2prom->read_byte(byte);
180   mame_fwrite(&file, buffer, sizeof(buffer));
181}
83182
84   /* validate some basic stuff */
85   assert(device != NULL);
86   assert(device->baseconfig().static_config() == NULL);
87   assert(downcast<const legacy_device_config_base &>(device->baseconfig()).inline_config() == NULL);
88   assert(device->machine != NULL);
89   assert(device->machine->config != NULL);
90183
91   c->sram = auto_alloc_array( device->machine, UINT8, SIZE_DATA );
92   c->e2prom = auto_alloc_array( device->machine, UINT8, SIZE_DATA );
93   c->store = 1;
94   c->array_recall = 1;
95184
96   c->default_data = *device->region();
185//**************************************************************************
186//  INTERNAL HELPERS
187//**************************************************************************
97188
98   state_save_register_device_item_pointer( device, 0, c->sram, SIZE_DATA );
99   state_save_register_device_item_pointer( device, 0, c->e2prom, SIZE_DATA );
100   state_save_register_device_item( device, 0, c->store );
101   state_save_register_device_item( device, 0, c->array_recall );
189//-------------------------------------------------
190//  store - store data from live RAM into the
191//  EEPROM
192//-------------------------------------------------
193
194void x2212_device::store()
195{
196   for (int byte = 0; byte < SIZE_DATA; byte++)
197      m_e2prom->write_byte(byte, m_sram->read_byte(byte));
102198}
103199
104/*-------------------------------------------------
105    device reset callback
106-------------------------------------------------*/
107200
108static DEVICE_RESET(x2212)
201//-------------------------------------------------
202//  recall - fetch data from the EEPROM into live
203//  RAM
204//-------------------------------------------------
205
206void x2212_device::recall()
109207{
208   for (int byte = 0; byte < SIZE_DATA; byte++)
209      m_sram->write_byte(byte, m_e2prom->read_byte(byte));
110210}
111211
112static DEVICE_NVRAM(x2212)
212
213
214//**************************************************************************
215//  READ/WRITE HANDLERS
216//**************************************************************************
217
218//-------------------------------------------------
219//  write - store to the live RAM
220//-------------------------------------------------
221
222WRITE8_MEMBER( x2212_device::write )
113223{
114   x2212_state *c = get_safe_token(device);
224   m_sram->write_byte(offset, data & 0x0f);
225}
115226
116   if( read_or_write )
117   {
118      mame_fwrite( file, c->sram, SIZE_DATA );
119   }
120   else
121   {
122      if( file )
123      {
124         mame_fread( file, c->e2prom, SIZE_DATA );
125      }
126      else
127      {
128         if( c->default_data != NULL )
129         {
130            memcpy( c->e2prom, c->default_data, SIZE_DATA );
131         }
132         else
133         {
134            memset( c->e2prom, 0xff, SIZE_DATA );
135         }
136      }
137227
138      memcpy( c->sram, c->e2prom, SIZE_DATA );
139   }
228//-------------------------------------------------
229//  read - read from the live RAM
230//-------------------------------------------------
231
232READ8_MEMBER( x2212_device::read )
233{
234   return (m_sram->read_byte(offset) & 0x0f) | (space.unmap() & 0xf0);
140235}
141236
142/*-------------------------------------------------
143    device definition
144-------------------------------------------------*/
145237
146static const char DEVTEMPLATE_SOURCE[] = __FILE__;
238//-------------------------------------------------
239//  store - set the state of the store line
240//  (active high)
241//-------------------------------------------------
147242
148#define DEVTEMPLATE_ID( p, s )   p##x2212##s
149#define DEVTEMPLATE_FEATURES   DT_HAS_START | DT_HAS_RESET | DT_HAS_NVRAM
150#define DEVTEMPLATE_NAME      "X2212"
151#define DEVTEMPLATE_FAMILY      "EEPROM"
152#define DEVTEMPLATE_CLASS      DEVICE_CLASS_PERIPHERAL
153#include "devtempl.h"
243WRITE_LINE_MEMBER( x2212_device::store )
244{
245   if (state != 0 && !m_store)
246      store();
247   m_store = (state != 0);
248}
154249
155250
156DEFINE_LEGACY_NVRAM_DEVICE(X2212, x2212);
251//-------------------------------------------------
252//  recall - set the state of the recall line
253//  (active high)
254//-------------------------------------------------
255
256WRITE_LINE_MEMBER( x2212_device::recall )
257{
258   if (state != 0 && !m_array_recall)
259      recall();
260   m_array_recall = (state != 0);
261}
src/emu/machine/x2212.h
r9240r9241
1/*
2 * Xicor X2212
3 *
4 * 256 x 4 bit Nonvolatile Static RAM
5 *
6 */
1/***************************************************************************
72
8#if !defined( X2212_H )
9#define X2212_H ( 1 )
3    x2212.h
104
11#include "devlegcy.h"
5    Xicor X2212 256 x 4 bit Nonvolatile Static RAM.
126
13/* default nvram contents should be in memory region
14 * with the same tag as device.
15 */
7***************************************************************************/
168
17DECLARE_LEGACY_NVRAM_DEVICE(X2212, x2212);
9#pragma once
1810
11#ifndef __X2212_H__
12#define __X2212_H__
13
14
15
16//**************************************************************************
17//  INTERFACE CONFIGURATION MACROS
18//**************************************************************************
19
1920#define MDRV_X2212_ADD(_tag) \
20   MDRV_DEVICE_ADD(_tag, X2212, 0)
21   MDRV_DEVICE_ADD(_tag, X2212, 0) \
2122
22WRITE8_DEVICE_HANDLER( x2212_write );
23READ8_DEVICE_HANDLER( x2212_read );
24WRITE_LINE_DEVICE_HANDLER( x2212_store );
25WRITE_LINE_DEVICE_HANDLER( x2212_array_recall );
23// some systems (like many early Atari games) wire up the /STORE signal
24// to fire on power-down, effectively creating an "auto-save" functionality
25#define MDRV_X2212_ADD_AUTOSAVE(_tag) \
26   MDRV_DEVICE_ADD(_tag, X2212, 0) \
27   x2212_device_config::static_set_auto_save(device); \
2628
29
30
31//**************************************************************************
32//  TYPE DEFINITIONS
33//**************************************************************************
34
35
36// ======================> x2212_device_config
37
38class x2212_device_config :   public device_config,
39                     public device_config_memory_interface,
40                     public device_config_nvram_interface
41{
42   friend class x2212_device;
43
44   // construction/destruction
45   x2212_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
46
47public:
48   // allocators
49   static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
50   virtual device_t *alloc_device(running_machine &machine) const;
51
52   // inline configuration helpers
53   static void static_set_auto_save(device_config *device);
54
55protected:
56   // device_config_memory_interface overrides
57   virtual const address_space_config *memory_space_config(int spacenum = 0) const;
58
59   // device-specific configuration
60   address_space_config      m_sram_space_config;
61   address_space_config      m_e2prom_space_config;
62
63   // internal state
64   bool                  m_auto_save;
65};
66
67
68// ======================> x2212_device
69
70class x2212_device :   public device_t,
71                  public device_memory_interface,
72                  public device_nvram_interface
73{
74   friend class x2212_device_config;
75
76   // construction/destruction
77   x2212_device(running_machine &_machine, const x2212_device_config &config);
78
79public:
80   // I/O operations
81   DECLARE_READ8_MEMBER( read );
82   DECLARE_WRITE8_MEMBER( write );
83
84   DECLARE_WRITE_LINE_MEMBER( store );
85   DECLARE_WRITE_LINE_MEMBER( recall );
86
87protected:
88   // internal helpers
89   void store();
90   void recall();
91
92   // device-level overrides
93   virtual void device_start();
94
95   // device_nvram_interface overrides
96   virtual void nvram_default();
97   virtual void nvram_read(mame_file &file);
98   virtual void nvram_write(mame_file &file);
99
100   static const int SIZE_DATA = 0x100;
101
102   // internal state
103   const x2212_device_config &m_config;
104   
105   address_space *   m_sram;
106   address_space *   m_e2prom;
107
108   bool       m_store;
109   bool       m_array_recall;
110};
111
112
113// device type definition
114extern const device_type X2212;
115
116
27117#endif
src/emu/addrmap.h
r9240r9241
856856   curentry->set_handler(devconfig, _tag, _rhandler, #_rhandler, _whandler, #_whandler, _unitmask); \
857857
858858
859// driver data base reads
860#define AM_READ_BASE(_class, _handler) \
861   curentry->set_handler(devconfig, NULL, read_proto_delegate::_create_member<_class, &_class::_handler>("driver_data::" #_handler)); \
862
863#define AM_READ8_BASE(_class, _handler, _unitmask) \
864   curentry->set_handler(devconfig, NULL, read8_proto_delegate::_create_member<_class, &_class::_handler>("driver_data::" #_handler), _unitmask); \
865
866#define AM_READ16_BASE(_class, _handler, _unitmask) \
867   curentry->set_handler(devconfig, NULL, read16_proto_delegate::_create_member<_class, &_class::_handler>("driver_data::" #_handler), _unitmask); \
868
869#define AM_READ32_BASE(_class, _handler, _unitmask) \
870   curentry->set_handler(devconfig, NULL, read32_proto_delegate::_create_member<_class, &_class::_handler>("driver_data::" #_handler), _unitmask); \
871
872
873// driver data base writes
874#define AM_WRITE_BASE(_class, _handler) \
875   curentry->set_handler(devconfig, NULL, write_proto_delegate::_create_member<_class, &_class::_handler>("driver_data::" #_handler)); \
876
877#define AM_WRITE8_BASE(_class, _handler, _unitmask) \
878   curentry->set_handler(devconfig, NULL, write8_proto_delegate::_create_member<_class, &_class::_handler>("driver_data::" #_handler), _unitmask); \
879
880#define AM_WRITE16_BASE(_class, _handler, _unitmask) \
881   curentry->set_handler(devconfig, NULL, write16_proto_delegate::_create_member<_class, &_class::_handler>("driver_data::" #_handler), _unitmask); \
882
883#define AM_WRITE32_BASE(_class, _handler, _unitmask) \
884   curentry->set_handler(devconfig, NULL, write32_proto_delegate::_create_member<_class, &_class::_handler>("driver_data::" #_handler), _unitmask); \
885
886
887// driver data base reads/writes
888#define AM_READWRITE_BASE(_class, _rhandler, _whandler) \
889   curentry->set_handler(devconfig, NULL, read_proto_delegate::_create_member<_class, &_class::_rhandler>("driver_data::" #_rhandler), write_proto_delegate::_create_member<_class, &_class::_whandler>("driver_data::" #_whandler)); \
890
891#define AM_READWRITE8_BASE(_class, _rhandler, _whandler, _unitmask) \
892   curentry->set_handler(devconfig, NULL, read8_proto_delegate::_create_member<_class, &_class::_rhandler>("driver_data::" #_rhandler), write8_proto_delegate::_create_member<_class, &_class::_whandler>("driver_data::" #_whandler), _unitmask); \
893
894#define AM_READWRITE16_BASE(_class, _rhandler, _whandler, _unitmask) \
895   curentry->set_handler(devconfig, NULL, read16_proto_delegate::_create_member<_class, &_class::_rhandler>("driver_data::" #_rhandler), write16_proto_delegate::_create_member<_class, &_class::_whandler>("driver_data::" #_whandler), _unitmask); \
896
897#define AM_READWRITE32_BASE(_class, _rhandler, _whandler, _unitmask) \
898   curentry->set_handler(devconfig, NULL, read32_proto_delegate::_create_member<_class, &_class::_rhandler>("driver_data::" #_rhandler), write32_proto_delegate::_create_member<_class, &_class::_whandler>("driver_data::" #_whandler), _unitmask); \
899
900
859901// driver data reads
860902#define AM_READ(_handler) \
861903   curentry->set_handler(devconfig, NULL, read_proto_delegate::_create_member<drivdata_class, &drivdata_class::_handler>("driver_data::" #_handler)); \
src/emu/debugger.c
r9240r9241
1111
1212#include "emu.h"
1313#include "debugger.h"
14#include "osdepend.h"
1415#include "debug/debugcpu.h"
1516#include "debug/debugcmd.h"
1617#include "debug/debugcon.h"
r9240r9241
8990
9091      /* listen in on the errorlog */
9192      machine->add_logerror_callback(debug_errorlog_write_line);
93       
94      /* initialize osd debugger features */
95      osd_init_debugger(machine);
9296   }
9397}
9498

Previous 15994 Revisions Next


© 1998-2018 The MESS Team