Previous 15994 Revisions Next

r9148 Friday 17th September, 2010 at 03:25:50 UTC by Miodrag Milanović
mc146818 imported from MAME, added missing makedep.c file
[src/build]makedep.c*
[src/emu/machine]mc146818.c mc146818.h nvram.c nvram.h
[src/mess/drivers]amstrad.c at.c bbc.c bebox.c e01.c micronic.c nc.c orion.c pc.c qx10.c sgi_ip2.c
[src/mess/machine]amstrad.c bbc.c bebox.c orion.c pc.c

src/build/makedep.c
r0r9148
1/***************************************************************************
2
3    MAME source code dependency generator
4
5****************************************************************************
6
7    Copyright Aaron Giles
8    All rights reserved.
9
10    Redistribution and use in source and binary forms, with or without
11    modification, are permitted provided that the following conditions are
12    met:
13
14        * Redistributions of source code must retain the above copyright
15          notice, this list of conditions and the following disclaimer.
16        * Redistributions in binary form must reproduce the above copyright
17          notice, this list of conditions and the following disclaimer in
18          the documentation and/or other materials provided with the
19          distribution.
20        * Neither the name 'MAME' nor the names of its contributors may be
21          used to endorse or promote products derived from this software
22          without specific prior written permission.
23
24    THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
25    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
26    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27    DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
28    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
29    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
30    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
32    STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
33    IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34    POSSIBILITY OF SUCH DAMAGE.
35
36***************************************************************************/
37
38#include <stdio.h>
39#include <stdlib.h>
40#include <string.h>
41#include <ctype.h>
42#include <zlib.h>
43#include "osdcore.h"
44#include "astring.h"
45#include "corefile.h"
46#include "tagmap.h"
47
48
49/***************************************************************************
50    CONSTANTS
51***************************************************************************/
52
53#define HASH_SIZE      193
54
55
56/***************************************************************************
57    TYPE DEFINITIONS
58***************************************************************************/
59
60typedef struct _include_path include_path;
61struct _include_path
62{
63   include_path *   next;
64   const astring *   path;
65};
66
67
68typedef struct _exclude_path exclude_path;
69struct _exclude_path
70{
71   exclude_path *   next;
72   const astring *   path;
73   int            pathlen;
74   UINT8         recursive;
75};
76
77
78typedef struct _list_entry list_entry;
79struct _list_entry
80{
81   list_entry *   next;
82   const astring *   name;
83};
84
85
86typedef struct _file_entry file_entry;
87
88typedef struct _dependency dependency;
89struct _dependency
90{
91   dependency *   next;
92   file_entry *   file;
93};
94
95
96struct _file_entry
97{
98   astring *      name;
99   dependency *   deplist;
100};
101
102
103
104/***************************************************************************
105    GLOBAL VARIABLES
106***************************************************************************/
107
108static include_path *incpaths;
109static exclude_path *excpaths;
110static tagmap *file_map;
111
112
113
114/***************************************************************************
115    PROTOTYPES
116***************************************************************************/
117
118/* core output functions */
119static int recurse_dir(int srcrootlen, const astring *srcdir);
120static file_entry *compute_dependencies(int srcrootlen, const astring *srcfile);
121
122/* path helpers */
123static astring *find_include_file(int srcrootlen, const astring *srcfile, const astring *filename);
124
125
126
127/***************************************************************************
128    INLINE FUNCTIONS
129***************************************************************************/
130
131/* core output functions */
132static int recurse_dir(int srcrootlen, const astring *srcdir);
133static file_entry *compute_dependencies(int srcrootlen, const astring *srcfile);
134
135/* path helpers */
136static astring *find_include_file(int srcrootlen, const astring *srcfile, const astring *filename);
137
138
139
140/***************************************************************************
141    MAIN
142***************************************************************************/
143
144/*-------------------------------------------------
145    main - main entry point
146-------------------------------------------------*/
147
148int main(int argc, char *argv[])
149{
150   include_path **incpathhead = &incpaths;
151   exclude_path **excpathhead = &excpaths;
152   astring *srcdir = NULL;
153   int unadorned = 0;
154   int result;
155   int argnum;
156
157   /* loop over arguments */
158   for (argnum = 1; argnum < argc; argnum++)
159   {
160      char *arg = argv[argnum];
161
162      /* include path? */
163      if (arg[0] == '-' && arg[1] == 'I')
164      {
165         *incpathhead = (include_path *)malloc(sizeof(**incpathhead));
166         if (*incpathhead != NULL)
167         {
168            (*incpathhead)->next = NULL;
169            (*incpathhead)->path = astring_replacechr(astring_dupc(&arg[2]), '/', PATH_SEPARATOR[0]);
170            incpathhead = &(*incpathhead)->next;
171         }
172      }
173
174      /* exclude path? */
175      else if (arg[0] == '-' && arg[1] == 'X')
176      {
177         *excpathhead = (exclude_path *)malloc(sizeof(**excpathhead));
178         if (*excpathhead != NULL)
179         {
180            astring *path;
181            (*excpathhead)->next = NULL;
182            path = astring_replacechr(astring_dupc(&arg[2]), PATH_SEPARATOR[0], '/');
183            (*excpathhead)->recursive = (astring_replacec(path, astring_len(path) - 4, "/...", "") != 0);
184            (*excpathhead)->path = path;
185            (*excpathhead)->pathlen = astring_len(path);
186            excpathhead = &(*excpathhead)->next;
187         }
188      }
189
190      /* other parameter */
191      else if (arg[0] != '-' && unadorned == 0)
192      {
193         srcdir = astring_replacechr(astring_dupc(arg), '/', PATH_SEPARATOR[0]);
194         unadorned++;
195      }
196      else
197         goto usage;
198   }
199
200   /* make sure we got 1 parameter */
201   if (srcdir == NULL)
202      goto usage;
203   
204   /* create a tagmap for tracking files we've visited */
205   file_map = tagmap_alloc();
206
207   /* recurse over subdirectories */
208   result = recurse_dir(astring_len(srcdir), srcdir);
209
210   /* free source and destination directories */
211   tagmap_free(file_map);
212   astring_free(srcdir);
213   return result;
214
215usage:
216   fprintf(stderr, "Usage:\n%s <srcroot> [-Iincpath [-Iincpath [...]]]\n", argv[0]);
217   return 1;
218}
219
220
221
222/***************************************************************************
223    CORE OUTPUT FUNCTIONS
224***************************************************************************/
225
226static int compare_list_entries(const void *p1, const void *p2)
227{
228   const list_entry *entry1 = *(const list_entry **)p1;
229   const list_entry *entry2 = *(const list_entry **)p2;
230   return strcmp(astring_c(entry1->name), astring_c(entry2->name));
231}
232
233
234/*-------------------------------------------------
235    recurse_dependencies - recurse through the
236    dependencies found, adding the mto the tagmap
237    unless we already exist in the map
238-------------------------------------------------*/
239
240static void recurse_dependencies(file_entry *file, tagmap *map)
241{
242   int filelen = astring_len(file->name);
243   exclude_path *exclude;
244   dependency *dep;
245   
246   /* skip if we're in an exclude path */
247   for (exclude = excpaths; exclude != NULL; exclude = exclude->next)
248      if (exclude->pathlen < filelen && strncmp(astring_c(file->name), astring_c(exclude->path), exclude->pathlen) == 0)
249         if (exclude->recursive || astring_chr(file->name, exclude->pathlen + 1, '/') == -1)
250            return;
251   
252   /* attempt to add; if we get an error, we're already present */
253   if (tagmap_add(map, astring_c(file->name), file->name, FALSE) != TMERR_NONE)
254      return;
255   
256   /* recurse the list from there */
257   for (dep = file->deplist; dep != NULL; dep = dep->next)
258      recurse_dependencies(dep->file, map);
259}
260
261
262/*-------------------------------------------------
263    recurse_dir - recurse through a directory
264-------------------------------------------------*/
265
266static int recurse_dir(int srcrootlen, const astring *srcdir)
267{
268   static const osd_dir_entry_type typelist[] = { ENTTYPE_DIR, ENTTYPE_FILE };
269   int result = 0;
270   int entindex;
271
272   /* iterate first over directories, then over files */
273   for (entindex = 0; entindex < ARRAY_LENGTH(typelist) && result == 0; entindex++)
274   {
275      osd_dir_entry_type entry_type = typelist[entindex];
276      const osd_directory_entry *entry;
277      list_entry **listarray = NULL;
278      list_entry *list = NULL;
279      list_entry *curlist;
280      osd_directory *dir;
281      int found = 0;
282
283      /* open the directory and iterate through it */
284      dir = osd_opendir(astring_c(srcdir));
285      if (dir == NULL)
286      {
287         result = 1;
288         goto error;
289      }
290
291      /* build up the list of files */
292      while ((entry = osd_readdir(dir)) != NULL)
293         if (entry->type == entry_type && entry->name[0] != '.')
294         {
295            list_entry *lentry = (list_entry *)malloc(sizeof(*lentry));
296            lentry->name = astring_dupc(entry->name);
297            lentry->next = list;
298            list = lentry;
299            found++;
300         }
301
302      /* close the directory */
303      osd_closedir(dir);
304
305      /* skip if nothing found */
306      if (found == 0)
307         continue;
308
309      /* allocate memory for sorting */
310      listarray = (list_entry **)malloc(sizeof(list_entry *) * found);
311      found = 0;
312      for (curlist = list; curlist != NULL; curlist = curlist->next)
313         listarray[found++] = curlist;
314
315      /* sort the list */
316      qsort(listarray, found, sizeof(listarray[0]), compare_list_entries);
317
318      /* rebuild the list */
319      list = NULL;
320      while (--found >= 0)
321      {
322         listarray[found]->next = list;
323         list = listarray[found];
324      }
325      free(listarray);
326
327      /* iterate through each file */
328      for (curlist = list; curlist != NULL && result == 0; curlist = curlist->next)
329      {
330         astring *srcfile;
331
332         /* build the source filename */
333         srcfile = astring_alloc();
334         astring_printf(srcfile, "%s%c%s", astring_c(srcdir), PATH_SEPARATOR[0], astring_c(curlist->name));
335
336         /* if we have a file, output it */
337         if (entry_type == ENTTYPE_FILE)
338         {
339            /* make sure we care, first */
340            if (core_filename_ends_with(astring_c(curlist->name), ".c"))
341            {
342               tagmap *depend_map = tagmap_alloc();
343               tagmap_entry *entry;
344               file_entry *file;
345               astring *target;
346               int taghash;
347               
348               /* find dependencies */
349               file = compute_dependencies(srcrootlen, srcfile);
350               recurse_dependencies(file, depend_map);
351
352               /* convert the target from source to object (makes assumptions about rules) */
353               target = astring_dup(file->name);
354               astring_replacec(target, 0, "src/", "$(OBJ)/");
355               astring_replacec(target, 0, ".c", ".o");
356               printf("\n%s : \\\n", astring_c(target));
357               
358               /* iterate over the hashed dependencies and output them as well */
359               for (taghash = 0; taghash < TAGMAP_HASH_SIZE; taghash++)
360                  for (entry = depend_map->table[taghash]; entry != NULL; entry = entry->next)
361                     printf("\t%s \\\n", astring_c((astring *)entry->object));
362               
363               astring_free(target);
364               tagmap_free(depend_map);
365            }
366         }
367
368         /* if we have a directory, recurse */
369         else
370            result = recurse_dir(srcrootlen, srcfile);
371
372         /* free memory for the names */
373         astring_free(srcfile);
374      }
375
376      /* free all the allocated entries */
377      while (list != NULL)
378      {
379         list_entry *next = list->next;
380         astring_free((astring *)list->name);
381         free(list);
382         list = next;
383      }
384   }
385
386error:
387   return result;
388}
389
390
391/*-------------------------------------------------
392    output_file - output a file, converting to
393    HTML
394-------------------------------------------------*/
395
396static file_entry *compute_dependencies(int srcrootlen, const astring *srcfile)
397{
398   astring *normalfile;
399   UINT32 filelength;
400   file_entry *file;
401   char *filedata;
402   int index;
403   
404   /* see if we already have an entry */
405   normalfile = astring_dup(srcfile);
406   astring_replacechr(normalfile, PATH_SEPARATOR[0], '/');
407   file = (file_entry *)tagmap_find(file_map, astring_c(normalfile));
408   if (file != NULL)
409      return file;
410
411   /* create a new header entry */
412   file = (file_entry *)malloc(sizeof(*file));
413   file->deplist = NULL;
414   file->name = normalfile;
415   tagmap_add(file_map, astring_c(file->name), file, FALSE);
416
417   /* read the source file */
418   if (core_fload(astring_c(srcfile), (void **)&filedata, &filelength) != FILERR_NONE)
419   {
420      fprintf(stderr, "Unable to read file '%s'\n", astring_c(srcfile));
421      return file;
422   }
423
424   /* find the #include directives in this file */
425   for (index = 0; index < filelength; index++)
426      if (filedata[index] == '#' && strncmp(&filedata[index + 1], "include", 7) == 0)
427      {
428         astring *filename, *target;
429         int scan = index;
430         dependency *dep;
431         int start;
432         
433         /* first make sure we're not commented or quoted */
434         for (scan = index; scan > 2 && filedata[scan] != 13 && filedata[scan] != 10; scan--)
435            if ((filedata[scan] == '/' && filedata[scan - 1] == '/') || filedata[scan] == '"')
436               break;
437         if (filedata[scan] != 13 && filedata[scan] != 10)
438            continue;
439         
440         /* scan forward to find the quotes or bracket */
441         index += 7;
442         for (scan = index; scan < filelength && filedata[scan] != '<' && filedata[scan] != '"' && filedata[scan] != 13 && filedata[scan] != 10; scan++) ;
443           
444         /* ignore if not found or if it's bracketed */
445         if (scan >= filelength || filedata[scan] != '"')
446            continue;
447         start = ++scan;
448         
449         /* find the closing quote */
450         while (scan < filelength && filedata[scan] != '"')
451            scan++;
452         if (scan >= filelength)
453            continue;
454
455         /* find the include file */
456         filename = astring_dupch(&filedata[start], scan - start);
457         target = find_include_file(srcrootlen, srcfile, filename);
458         
459         /* create a new dependency */
460         if (target != NULL)
461         {
462            dep = (dependency *)malloc(sizeof(*dep));
463            dep->next = file->deplist;
464            file->deplist = dep;
465            dep->file = compute_dependencies(srcrootlen, target);
466            astring_free(target);
467         }
468
469         astring_free(filename);
470      }
471
472   free(filedata);
473   return file;
474}
475
476
477
478/***************************************************************************
479    HELPERS
480***************************************************************************/
481
482/*-------------------------------------------------
483    find_include_file - find an include file
484-------------------------------------------------*/
485
486static astring *find_include_file(int srcrootlen, const astring *srcfile, const astring *filename)
487{
488   include_path *curpath;
489
490   /* iterate over include paths and find the file */
491   for (curpath = incpaths; curpath != NULL; curpath = curpath->next)
492   {
493      astring *srcincpath = astring_dup(curpath->path);
494      core_file *testfile;
495      int lastsepindex = 0;
496      int sepindex;
497
498      /* a '.' include path is specially treated */
499      if (astring_cmpc(curpath->path, ".") == 0)
500         astring_cpysubstr(srcincpath, srcfile, 0, astring_rchr(srcfile, 0, PATH_SEPARATOR[0]));
501
502      /* append the filename piecemeal to account for directories */
503      while ((sepindex = astring_chr(filename, lastsepindex, '/')) != -1)
504      {
505         astring *pathpart = astring_dupsubstr(filename, lastsepindex, sepindex - lastsepindex);
506
507         /* handle .. by removing a chunk from the incpath */
508         if (astring_cmpc(pathpart, "..") == 0)
509         {
510            int sepindex = astring_rchr(srcincpath, 0, PATH_SEPARATOR[0]);
511            if (sepindex != -1)
512               astring_substr(srcincpath, 0, sepindex);
513         }
514
515         /* otherwise, append a path separator and the pathpart */
516         else
517            astring_cat(astring_catc(srcincpath, PATH_SEPARATOR), pathpart);
518
519         /* advance past the previous index */
520         lastsepindex = sepindex + 1;
521
522         /* free the path part we extracted */
523         astring_free(pathpart);
524      }
525
526      /* now append the filename */
527      astring_catsubstr(astring_catc(srcincpath, PATH_SEPARATOR), filename, lastsepindex, -1);
528
529      /* see if we can open it */
530      if (core_fopen(astring_c(srcincpath), OPEN_FLAG_READ, &testfile) == FILERR_NONE)
531      {
532         /* close the file */
533         core_fclose(testfile);
534         return srcincpath;
535      }
536
537      /* free our include path */
538      astring_free(srcincpath);
539   }
540   return NULL;
541}
src/emu/machine/mc146818.h
r9147r9148
1111
1212*********************************************************************/
1313
14#ifndef MC146818_H
15#define MC146818_H
14#ifndef __MC146818_H__
15#define __MC146818_H__
1616
17typedef enum
17
18//**************************************************************************
19//  INTERFACE CONFIGURATION MACROS
20//**************************************************************************
21
22#define MDRV_MC146818_ADD(_tag, _type) \
23   MDRV_DEVICE_ADD(_tag, MC146818, 0) \
24   mc146818_device_config::static_set_type(device, mc146818_device_config::_type); \
25
26
27
28//**************************************************************************
29//  TYPE DEFINITIONS
30//**************************************************************************
31
32class mc146818_device;
33
34
35// ======================> mc146818_device_config
36
37class mc146818_device_config :   public device_config,
38                        public device_config_nvram_interface
1839{
19   MC146818_STANDARD,
20   MC146818_IGNORE_CENTURY, // century is NOT set, for systems having other usage of this byte
21   MC146818_ENHANCED
22} MC146818_TYPE;
40   friend class mc146818_device;
2341
42   // construction/destruction
43   mc146818_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
2444
45public:
46   // values
47   enum mc146818_type
48   {
49      MC146818_STANDARD,
50      MC146818_IGNORE_CENTURY, // century is NOT set, for systems having other usage of this byte
51      MC146818_ENHANCED
52   };
2553
26/* initialize mc146818 emulation, call only once at beginning */
27void mc146818_init(running_machine *machine, MC146818_TYPE type);
54   // allocators
55   static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
56   virtual device_t *alloc_device(running_machine &machine) const;
2857
29/* loads data from standard nvram file */
30void mc146818_load(running_machine *machine);
58   // inline configuration helpers
59   static void static_set_type(device_config *device, mc146818_type type);
3160
32/* loads data from file stream */
33void mc146818_load_stream(mame_file *file);
61protected:
62   // internal state
63   mc146818_type       m_type;
64};
3465
35/* saves data into standard nvram file */
36void mc146818_save(running_machine *machine);
3766
38/* saves data into file stream */
39void mc146818_save_stream(mame_file *file);
67// ======================> mc146818_device
4068
41NVRAM_HANDLER( mc146818 );
69class mc146818_device :   public device_t,
70                  public device_nvram_interface
71{
72   friend class mc146818_device_config;
4273
43READ8_HANDLER(mc146818_port_r);
44WRITE8_HANDLER(mc146818_port_w);
74   // construction/destruction
75   mc146818_device(running_machine &_machine, const mc146818_device_config &config);
4576
46READ16_HANDLER(mc146818_port16le_r);
47WRITE16_HANDLER(mc146818_port16le_w);
77public:
78   // read/write access
79   DECLARE_READ8_MEMBER( read );
80   DECLARE_WRITE8_MEMBER( write );
4881
49READ32_HANDLER(mc146818_port32le_r);
50WRITE32_HANDLER(mc146818_port32le_w);
82protected:
83   // device-level overrides
84   virtual void device_start();
85   virtual void device_timer(emu_timer &timer, int param, void *ptr);
5186
52READ64_HANDLER(mc146818_port64be_r);
53WRITE64_HANDLER(mc146818_port64be_w);
87   // device_mc146818_interface overrides
88   virtual void nvram_default();
89   virtual void nvram_read(mame_file &file);
90   virtual void nvram_write(mame_file &file);
5491
55#endif /* MC146818_H */
92   // internal helpers
93   int dec_2_local(int a);
94   void set_base_datetime();
95   
96   // internal state
97   static const int MC146818_DATA_SIZE   = 0x80;
98
99   const mc146818_device_config &   m_config;
100
101   UINT8          m_index;
102   UINT8          m_data[MC146818_DATA_SIZE];
103
104   UINT16          m_eindex;
105   UINT8          m_edata[0x2000];
106
107   bool          m_updated;  /* update ended interrupt flag */
108
109   attotime       m_last_refresh;
110};
111
112
113// device type definition
114extern const device_type MC146818;
115
116
117#endif /* __MC146818_H__ */
src/emu/machine/nvram.c
r9147r9148
4343
4444
4545//**************************************************************************
46//  DEVICE DEFINITIONS
47//**************************************************************************
48
49const device_type NVRAM = nvram_device_config::static_alloc_device_config;
50
51
52
53//**************************************************************************
4654//  DEVICE CONFIGURATION
4755//**************************************************************************
4856
r9147r9148
99107void nvram_device_config::static_set_custom_handler(device_config *device, nvram_init_proto_delegate handler)
100108{
101109   nvram_device_config *nvram = downcast<nvram_device_config *>(device);
110   nvram->m_default_value = DEFAULT_CUSTOM;
102111   nvram->m_custom_handler = handler;
103112}
104113
r9147r9148
131140   // bind our handler
132141   if (!m_config.m_custom_handler.isnull())
133142      m_custom_handler = nvram_init_delegate(m_config.m_custom_handler, *m_owner);
134
135   // find our shared pointer with the target RAM
136   m_base = memory_get_shared(m_machine, tag(), m_length);
137   if (m_base == NULL)
138      throw emu_fatalerror("NVRAM device '%s' has no corresponding AM_SHARE region", tag());
139
140   // if we are region-backed for the default, find it now and make sure it's the right size
141   if (m_region != NULL && m_region->bytes() != m_length)
142      throw emu_fatalerror("NVRAM device '%s' has a default region, but it should be 0x%X bytes", tag(), m_length);
143143}
144144
145145
r9147r9148
150150
151151void nvram_device::nvram_default()
152152{
153   // make sure we have a valid base pointer
154   determine_final_base();
155
153156   // region always wins
154157   if (m_region != NULL)
155158   {
r9147r9148
195198
196199void nvram_device::nvram_read(mame_file &file)
197200{
201   // make sure we have a valid base pointer
202   determine_final_base();
203
198204   mame_fread(&file, m_base, m_length);
199205}
200206
r9147r9148
210216}
211217
212218
213const device_type NVRAM = nvram_device_config::static_alloc_device_config;
219//-------------------------------------------------
220//  determine_final_base - get the final base
221//  pointer by looking up the memory share, unless
222//  a pointer was provided to us
223//-------------------------------------------------
224
225void nvram_device::determine_final_base()
226{
227   // find our shared pointer with the target RAM
228   if (m_base == NULL)
229   {
230      m_base = memory_get_shared(m_machine, tag(), m_length);
231      if (m_base == NULL)
232         throw emu_fatalerror("NVRAM device '%s' has no corresponding AM_SHARE region", tag());
233   }
234
235   // if we are region-backed for the default, find it now and make sure it's the right size
236   if (m_region != NULL && m_region->bytes() != m_length)
237      throw emu_fatalerror("NVRAM device '%s' has a default region, but it should be 0x%X bytes", tag(), m_length);
238}
src/emu/machine/nvram.h
r9147r9148
152152   virtual void nvram_default();
153153   virtual void nvram_read(mame_file &file);
154154   virtual void nvram_write(mame_file &file);
155   
156   // internal helpers
157   void determine_final_base();
155158
156159   // internal state
157160   const nvram_device_config &   m_config;
src/emu/machine/mc146818.c
r9147r9148
7272*********************************************************************/
7373
7474#include "emu.h"
75#include "memconv.h"
7675#include "coreutil.h"
7776#include "machine/mc146818.h"
7877
7978
79//**************************************************************************
80//  DEBUGGING
81//**************************************************************************
82
8083#define LOG_MC146818      0
81#define MC146818_DATA_SIZE   0x80
8284
83struct mc146818_chip
85
86
87//**************************************************************************
88//  MACROS
89//**************************************************************************
90
91#define HOURS_24   (m_data[0xb]&2)
92#define BCD_MODE   !(m_data[0xb]&4) // book has other description!
93#define CENTURY      m_data[50]
94#define YEAR      m_data[9]
95#define MONTH      m_data[8]
96#define DAY         m_data[7]
97#define WEEK_DAY   m_data[6]
98
99
100
101//**************************************************************************
102//  DEVICE DEFINITIONS
103//**************************************************************************
104
105const device_type MC146818 = mc146818_device_config::static_alloc_device_config;
106
107
108
109//**************************************************************************
110//  DEVICE CONFIGURATION
111//**************************************************************************
112
113//-------------------------------------------------
114//  mc146818_device_config - constructor
115//-------------------------------------------------
116
117mc146818_device_config::mc146818_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
118   : device_config(mconfig, static_alloc_device_config, "NVRAM", tag, owner, clock),
119     device_config_nvram_interface(mconfig, *this),
120     m_type(MC146818_STANDARD)
84121{
85   MC146818_TYPE type;
122}
86123
87   UINT8 index;
88   UINT8 data[MC146818_DATA_SIZE];
89124
90   UINT16 eindex;
91   UINT8 edata[0x2000];
125//-------------------------------------------------
126//  static_alloc_device_config - allocate a new
127//  configuration object
128//-------------------------------------------------
92129
93   int updated;  /* update ended interrupt flag */
130device_config *mc146818_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
131{
132   return global_alloc(mc146818_device_config(mconfig, tag, owner, clock));
133}
94134
95   attotime last_refresh;
96};
97135
98static struct mc146818_chip *mc146818;
136//-------------------------------------------------
137//  alloc_device - allocate a new device object
138//-------------------------------------------------
99139
140device_t *mc146818_device_config::alloc_device(running_machine &machine) const
141{
142   return auto_alloc(&machine, mc146818_device(machine, *this));
143}
100144
101145
102#define HOURS_24   (mc146818->data[0xb]&2)
103#define BCD_MODE   !(mc146818->data[0xb]&4) // book has other description!
104#define CENTURY      mc146818->data[50]
105#define YEAR      mc146818->data[9]
106#define MONTH      mc146818->data[8]
107#define DAY         mc146818->data[7]
108#define WEEK_DAY   mc146818->data[6]
146//-------------------------------------------------
147//  static_set_interface - configuration helper
148//  to set the interface
149//-------------------------------------------------
109150
151void mc146818_device_config::static_set_type(device_config *device, mc146818_type type)
152{
153   downcast<mc146818_device_config *>(device)->m_type = type;
154}
110155
111156
112static void mc146818_set_base_datetime(running_machine *machine);
113157
114static TIMER_CALLBACK( mc146818_timer )
158//**************************************************************************
159//  LIVE DEVICE
160//**************************************************************************
161
162//-------------------------------------------------
163//  mc146818_device - constructor
164//-------------------------------------------------
165
166mc146818_device::mc146818_device(running_machine &_machine, const mc146818_device_config &config)
167   : device_t(_machine, config),
168     device_nvram_interface(_machine, config, *this),
169     m_config(config),
170     m_index(0),
171     m_eindex(0),
172     m_updated(false),
173     m_last_refresh(attotime_zero)
115174{
175}
176
177
178//-------------------------------------------------
179//  device_start - device-specific startup
180//-------------------------------------------------
181
182void mc146818_device::device_start()
183{
184   m_last_refresh = timer_get_time(&m_machine);
185   emu_timer *timer = device_timer_alloc(*this);
186   timer_adjust_periodic(timer, ATTOTIME_IN_HZ(1), 0, ATTOTIME_IN_HZ(1));
187   set_base_datetime();
188}
189
190
191//-------------------------------------------------
192//  device_timer - handler timer events
193//-------------------------------------------------
194
195void mc146818_device::device_timer(emu_timer &timer, int param, void *ptr)
196{
116197   int year/*, month*/;
117198
118199   if (BCD_MODE)
119200   {
120      mc146818->data[0]=bcd_adjust(mc146818->data[0]+1);
121      if (mc146818->data[0]>=0x60)
201      m_data[0]=bcd_adjust(m_data[0]+1);
202      if (m_data[0]>=0x60)
122203      {
123         mc146818->data[0]=0;
124         mc146818->data[2]=bcd_adjust(mc146818->data[2]+1);
125         if (mc146818->data[2]>=0x60)
204         m_data[0]=0;
205         m_data[2]=bcd_adjust(m_data[2]+1);
206         if (m_data[2]>=0x60)
126207         {
127            mc146818->data[2]=0;
128            mc146818->data[4]=bcd_adjust(mc146818->data[4]+1);
208            m_data[2]=0;
209            m_data[4]=bcd_adjust(m_data[4]+1);
129210            // different handling of hours
130            if (mc146818->data[4]>=0x24)
211            if (m_data[4]>=0x24)
131212            {
132               mc146818->data[4]=0;
213               m_data[4]=0;
133214               WEEK_DAY=bcd_adjust(WEEK_DAY+1)%7;
134215               DAY=bcd_adjust(DAY+1);
135216               //month=bcd_2_dec(MONTH);
136217               year=bcd_2_dec(YEAR);
137               if (mc146818->type!=MC146818_IGNORE_CENTURY) year+=bcd_2_dec(CENTURY)*100;
218               if (m_config.m_type!=mc146818_device_config::MC146818_IGNORE_CENTURY) year+=bcd_2_dec(CENTURY)*100;
138219               else year+=2000; // save for julian_days_in_month calculation
139220               DAY=bcd_adjust(DAY+1);
140221               if (DAY>gregorian_days_in_month(MONTH, year))
r9147r9148
145226                  {
146227                     MONTH=1;
147228                     YEAR=year=bcd_adjust(YEAR+1);
148                     if (mc146818->type!=MC146818_IGNORE_CENTURY)
229                     if (m_config.m_type!=mc146818_device_config::MC146818_IGNORE_CENTURY)
149230                     {
150231                        if (year>=0x100)
151232                        {
r9147r9148
160241   }
161242   else
162243   {
163      mc146818->data[0]=mc146818->data[0]+1;
164      if (mc146818->data[0]>=60)
244      m_data[0]=m_data[0]+1;
245      if (m_data[0]>=60)
165246      {
166         mc146818->data[0]=0;
167         mc146818->data[2]=mc146818->data[2]+1;
168         if (mc146818->data[2]>=60) {
169            mc146818->data[2]=0;
170            mc146818->data[4]=mc146818->data[4]+1;
247         m_data[0]=0;
248         m_data[2]=m_data[2]+1;
249         if (m_data[2]>=60) {
250            m_data[2]=0;
251            m_data[4]=m_data[4]+1;
171252            // different handling of hours //?
172            if (mc146818->data[4]>=24) {
173               mc146818->data[4]=0;
253            if (m_data[4]>=24) {
254               m_data[4]=0;
174255               WEEK_DAY=(WEEK_DAY+1)%7;
175256               year=YEAR;
176               if (mc146818->type!=MC146818_IGNORE_CENTURY) year+=CENTURY*100;
257               if (m_config.m_type!=mc146818_device_config::MC146818_IGNORE_CENTURY) year+=CENTURY*100;
177258               else year+=2000; // save for julian_days_in_month calculation
178259               if (++DAY>gregorian_days_in_month(MONTH, year)) {
179260                  DAY=1;
180261                  if (++MONTH>12) {
181262                     MONTH=1;
182263                     YEAR++;
183                     if (mc146818->type!=MC146818_IGNORE_CENTURY) {
264                     if (m_config.m_type!=mc146818_device_config::MC146818_IGNORE_CENTURY) {
184265                        if (YEAR>=100) { CENTURY++;YEAR=0; }
185266                     } else {
186267                        YEAR%=100;
r9147r9148
191272         }
192273      }
193274   }
194   mc146818->updated = 1;  /* clock has been updated */
195   mc146818->last_refresh = timer_get_time(machine);
275   m_updated = true;  /* clock has been updated */
276   m_last_refresh = timer_get_time(&m_machine);
196277}
197278
198279
199280
200void mc146818_init(running_machine *machine, MC146818_TYPE type)
281//-------------------------------------------------
282//  nvram_default - called to initialize NVRAM to
283//  its default state
284//-------------------------------------------------
285
286void mc146818_device::nvram_default()
201287{
202   mc146818 = auto_alloc_clear(machine, struct mc146818_chip);
203   mc146818->type = type;
204   mc146818->last_refresh = timer_get_time(machine);
205    timer_pulse(machine, ATTOTIME_IN_HZ(1), NULL, 0, mc146818_timer);
206   mc146818_set_base_datetime(machine);
288   set_base_datetime();
207289}
208290
209291
292//-------------------------------------------------
293//  nvram_read - called to read NVRAM from the
294//  .nv file
295//-------------------------------------------------
210296
211void mc146818_load(running_machine *machine)
297void mc146818_device::nvram_read(mame_file &file)
212298{
213   mame_file *file;
214
215   file = nvram_fopen(machine, OPEN_FLAG_READ);
216   if (file)
217   {
218      mc146818_load_stream(file);
219      mame_fclose(file);
220   }
299   mame_fread(&file, m_data, sizeof(m_data));
221300}
222301
223302
303//-------------------------------------------------
304//  nvram_write - called to write NVRAM to the
305//  .nv file
306//-------------------------------------------------
224307
225void mc146818_load_stream(mame_file *file)
308void mc146818_device::nvram_write(mame_file &file)
226309{
227   mame_fread(file, mc146818->data, sizeof(mc146818->data));
310   mame_fwrite(&file, m_data, sizeof(m_data));
228311}
229312
230313
314//-------------------------------------------------
315//  dec_2_local - convert from decimal to BCD if
316//  necessary
317//-------------------------------------------------
231318
232static int dec_2_local(int a)
319inline int mc146818_device::dec_2_local(int a)
233320{
234321   return BCD_MODE ? dec_2_bcd(a) : a;
235322}
236323
237324
325//-------------------------------------------------
326//  dec_2_local - convert from decimal to BCD if
327//  necessary
328//-------------------------------------------------
238329
239static void mc146818_set_base_datetime(running_machine *machine)
330void mc146818_device::set_base_datetime()
240331{
241332   system_time systime;
242333
243   machine->base_datetime(systime);
334   m_machine.base_datetime(systime);
244335
245336   if (HOURS_24 || (systime.local_time.hour < 12))
246      mc146818->data[4] = dec_2_local(systime.local_time.hour);
337      m_data[4] = dec_2_local(systime.local_time.hour);
247338   else
248      mc146818->data[4] = dec_2_local(systime.local_time.hour - 12) | 0x80;
339      m_data[4] = dec_2_local(systime.local_time.hour - 12) | 0x80;
249340
250   if (mc146818->type != MC146818_IGNORE_CENTURY)
341   if (m_config.m_type != mc146818_device_config::MC146818_IGNORE_CENTURY)
251342      CENTURY = dec_2_local(systime.local_time.year /100);
252343
253   mc146818->data[0]   = dec_2_local(systime.local_time.second);
254   mc146818->data[2]   = dec_2_local(systime.local_time.minute);
344   m_data[0]   = dec_2_local(systime.local_time.second);
345   m_data[2]   = dec_2_local(systime.local_time.minute);
255346   DAY               = dec_2_local(systime.local_time.day);
256347   MONTH            = dec_2_local(systime.local_time.month + 1);
257348   YEAR            = dec_2_local(systime.local_time.year % 100);
258349
259350   WEEK_DAY = systime.local_time.weekday;
260351   if (systime.local_time.is_dst)
261      mc146818->data[0xb] |= 1;
352      m_data[0xb] |= 1;
262353   else
263      mc146818->data[0xb] &= ~1;
354      m_data[0xb] &= ~1;
264355}
265356
266357
358//-------------------------------------------------
359//  read - I/O handler for reading
360//-------------------------------------------------
267361
268void mc146818_save(running_machine *machine)
362READ8_MEMBER( mc146818_device::read )
269363{
270   mame_file *file;
271
272   file = nvram_fopen(machine, OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
273   if (file)
274   {
275      mame_fwrite(file, mc146818->data, sizeof(mc146818->data));
276      mame_fclose(file);
277   }
278}
279
280
281
282void mc146818_save_stream(mame_file *file)
283{
284   mame_fwrite(file, mc146818->data, sizeof(mc146818->data));
285}
286
287
288
289NVRAM_HANDLER( mc146818 )
290{
291   if (file == NULL)
292   {
293      mc146818_set_base_datetime(machine);
294      // init only
295   }
296   else if (read_or_write)
297   {
298      mc146818_save_stream(file);
299   }
300   else
301   {
302      mc146818_load_stream(file);
303   }
304}
305
306
307
308READ8_HANDLER(mc146818_port_r)
309{
310364   UINT8 data = 0;
311365   switch (offset) {
312366   case 0:
313      data = mc146818->index;
367      data = m_index;
314368      break;
315369
316370   case 1:
317      switch (mc146818->index % MC146818_DATA_SIZE) {
371      switch (m_index % MC146818_DATA_SIZE) {
318372      case 0xa:
319         data = mc146818->data[mc146818->index  % MC146818_DATA_SIZE];
320         if (attotime_compare(attotime_sub(timer_get_time(space->machine), mc146818->last_refresh), ATTOTIME_IN_HZ(32768)) < 0)
373         data = m_data[m_index  % MC146818_DATA_SIZE];
374         if (attotime_compare(attotime_sub(timer_get_time(space.machine), m_last_refresh), ATTOTIME_IN_HZ(32768)) < 0)
321375            data |= 0x80;
322376#if 0
323377         /* for pc1512 bios realtime clock test */
324         mc146818->data[mc146818->index % MC146818_DATA_SIZE] ^= 0x80; /* 0x80 update in progress */
378         m_data[m_index % MC146818_DATA_SIZE] ^= 0x80; /* 0x80 update in progress */
325379#endif
326380         break;
327381
328382      case 0xc:
329         if(mc146818->updated != 0) /* the clock has been updated */
383         if (m_updated) /* the clock has been updated */
330384            data = 0x10;
331385         else
332386            data = 0x00;
333387         break;
334388      case 0xd:
335389         /* battery ok */
336         data = mc146818->data[mc146818->index % MC146818_DATA_SIZE] | 0x80;
390         data = m_data[m_index % MC146818_DATA_SIZE] | 0x80;
337391         break;
338392
339393      default:
340         data = mc146818->data[mc146818->index % MC146818_DATA_SIZE];
394         data = m_data[m_index % MC146818_DATA_SIZE];
341395         break;
342396      }
343397      break;
344398   }
345399
346400   if (LOG_MC146818)
347      logerror("mc146818_port_r(): index=0x%02x data=0x%02x\n", mc146818->index, data);
401      logerror("mc146818_port_r(): index=0x%02x data=0x%02x\n", m_index, data);
348402   return data;
349403}
350404
351405
406//-------------------------------------------------
407//  write - I/O handler for writing
408//-------------------------------------------------
352409
353WRITE8_HANDLER(mc146818_port_w)
410WRITE8_MEMBER( mc146818_device::write )
354411{
355412   if (LOG_MC146818)
356      logerror("mc146818_port_w(): index=0x%02x data=0x%02x\n", mc146818->index, data);
413      logerror("mc146818_port_w(): index=0x%02x data=0x%02x\n", m_index, data);
357414
358415   switch (offset) {
359416   case 0:
360      mc146818->index = data;
417      m_index = data;
361418      break;
362419
363420   case 1:
364      switch(mc146818->index % MC146818_DATA_SIZE)
421      switch(m_index % MC146818_DATA_SIZE)
365422      {
366423      case 0x0b:
367424         if(data & 0x80)
368            mc146818->updated = 0;
369         mc146818->data[mc146818->index % MC146818_DATA_SIZE] = data;
425            m_updated = false;
426         m_data[m_index % MC146818_DATA_SIZE] = data;
370427         break;
371428      default:
372         mc146818->data[mc146818->index % MC146818_DATA_SIZE] = data;
429         m_data[m_index % MC146818_DATA_SIZE] = data;
373430      }
374431      break;
375432   }
376433}
377
378
379
380READ16_HANDLER(mc146818_port16le_r)
381{
382   return read16le_with_read8_handler(mc146818_port_r, space, offset, mem_mask);
383}
384
385WRITE16_HANDLER(mc146818_port16le_w)
386{
387   write16le_with_write8_handler(mc146818_port_w, space, offset, data, mem_mask);
388}
389
390READ32_HANDLER(mc146818_port32le_r)
391{
392   return read32le_with_read8_handler(mc146818_port_r, space, offset, mem_mask);
393}
394
395WRITE32_HANDLER(mc146818_port32le_w)
396{
397   write32le_with_write8_handler(mc146818_port_w, space, offset, data, mem_mask);
398}
399
400READ64_HANDLER(mc146818_port64be_r)
401{
402   return read64be_with_read8_handler(mc146818_port_r, space, offset, mem_mask);
403}
404
405WRITE64_HANDLER(mc146818_port64be_w)
406{
407   write64be_with_write8_handler(mc146818_port_w, space, offset, data, mem_mask);
408}
src/mess/machine/orion.c
r9147r9148
225225{
226226   if ((offset >= 0x60) && (offset <= 0x6f))
227227   {
228      return mc146818_port_r(space,offset-0x60);
228      return space->machine->device<mc146818_device>("rtc")->read(*space,offset-0x60);
229229   }
230230   else
231231   {
r9147r9148
237237{
238238   if ((offset >= 0x60) && (offset <= 0x6f))
239239   {
240      mc146818_port_w(space,offset-0x60,data);
240      space->machine->device<mc146818_device>("rtc")->write(*space,offset-0x60,data);
241241   }
242242   else
243243   {
r9147r9148
248248
249249MACHINE_START( orionz80 )
250250{
251   mc146818_init(machine, MC146818_IGNORE_CENTURY);
252251   orion_video_mode_mask = 7;
253252}
254253
src/mess/machine/amstrad.c
r9147r9148
26932693{
26942694   address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
26952695   running_device *ay8910 = machine->device("ay");
2696   mc146818_device *rtc = space->machine->device<mc146818_device>("rtc");
26962697
26972698   if(aleste_mode & 0x20)  // RTC selected
26982699   {
26992700      switch(aleste_rtc_function)
27002701      {
27012702      case 0x02:  // AS
2702         mc146818_port_w(space, 0,ppi_port_outputs[amstrad_ppi_PortA]);
2703         rtc->write(*space, 0,ppi_port_outputs[amstrad_ppi_PortA]);
27032704         break;
27042705      case 0x04:  // DS write
2705         mc146818_port_w(space, 1,ppi_port_outputs[amstrad_ppi_PortA]);
2706         rtc->write(*space, 1,ppi_port_outputs[amstrad_ppi_PortA]);
27062707         break;
27072708      case 0x05:  // DS read
2708         ppi_port_inputs[amstrad_ppi_PortA] = mc146818_port_r(space, 1);
2709         ppi_port_inputs[amstrad_ppi_PortA] = rtc->read(*space, 1);
27092710         break;
27102711      }
27112712      return;
src/mess/machine/bebox.c
r9147r9148
11041104   memory_install_readwrite_bank(space_0, 0, messram_get_size(machine->device("messram")) - 1, 0, 0x02000000, "bank3");
11051105   memory_install_readwrite_bank(space_1, 0, messram_get_size(machine->device("messram")) - 1, 0, 0x02000000, "bank3");
11061106   memory_set_bankptr(machine, "bank3", messram_get_ptr(machine->device("messram")));
1107
1108   mc146818_init(machine, MC146818_STANDARD);
1107   
11091108   pc_vga_init(machine, &bebox_vga_interface, &cirrus_svga_interface);
11101109   kbdc8042_init(machine, &bebox_8042_interface);
11111110
src/mess/machine/pc.c
r9147r9148
12531253   pc_videoram_size = 0x10000;
12541254   pc_videoram = memory_region(machine, "maincpu")+0xb0000;
12551255   mess_init_pc_common(machine, PCCOMMON_KEYBOARD_PC, pc_set_keyb_int, pc_set_irq_line);
1256   mc146818_init(machine, MC146818_IGNORE_CENTURY);
12571256}
12581257DRIVER_INIT( pc1512 )
12591258{
r9147r9148
12731272   memory_install_write16_handler( io_space, 0x3d0, 0x3df, 0, 0, pc1512_16le_w );
12741273
12751274   mess_init_pc_common(machine, PCCOMMON_KEYBOARD_PC, pc_set_keyb_int, pc_set_irq_line);
1276   mc146818_init(machine, MC146818_IGNORE_CENTURY);
12771275}
12781276
12791277
r9147r9148
13051303   memory_install_read16_handler(io_space, 0x4278, 0x427b, 0, 0, pc1640_16le_port4278_r );
13061304
13071305   mess_init_pc_common(machine, PCCOMMON_KEYBOARD_PC, pc_set_keyb_int, pc_set_irq_line);
1308
1309   mc146818_init(machine, MC146818_IGNORE_CENTURY);
13101306}
13111307
13121308DRIVER_INIT( pc_vga )
src/mess/machine/bbc.c
r9147r9148
948948static void MC146818_set(address_space *space)
949949{
950950   logerror ("146181 WR=%d DS=%d AS=%d CE=%d \n",MC146818_WR,MC146818_DS,MC146818_AS,MC146818_CE);
951
951   mc146818_device *rtc = space->machine->device<mc146818_device>("rtc");
952   
952953   // if chip enabled
953954   if (MC146818_CE)
954955   {
r9147r9148
957958      {
958959         if (MC146818_WR)
959960         {
960            via_system_porta=mc146818_port_r(space, 1);
961            via_system_porta=rtc->read(*space, 1);
961962            //logerror("read 146818 data %d \n",via_system_porta);
962963         }
963964         else
964965         {
965            mc146818_port_w(space, 1, via_system_porta);
966            rtc->write(*space, 1, via_system_porta);
966967            //logerror("write 146818 data %d \n",via_system_porta);
967968         }
968969      }
r9147r9148
970971      // if address select is set then set the address in the 146818
971972      if (MC146818_AS)
972973      {
973         mc146818_port_w(space, 0, via_system_porta);
974         rtc->write(*space, 0, via_system_porta);
974975         //logerror("write 146818 address %d \n",via_system_porta);
975976      }
976977   }
src/mess/drivers/at.c
r9147r9148
171171   AM_RANGE(0x0020, 0x003f) AM_DEVREADWRITE8("pic8259_master", pic8259_r, pic8259_w, 0xffff)
172172   AM_RANGE(0x0040, 0x005f) AM_DEVREADWRITE8("pit8254", pit8253_r, pit8253_w, 0xffff)
173173   AM_RANGE(0x0060, 0x006f) AM_READWRITE8(at_kbdc8042_r,            at_kbdc8042_w, 0xffff)
174   AM_RANGE(0x0070, 0x007f) AM_READWRITE8(mc146818_port_r,          mc146818_port_w, 0xffff)
174   AM_RANGE(0x0070, 0x007f) AM_DEVREADWRITE8_MODERN("rtc", mc146818_device, read, write , 0xffff)
175175   AM_RANGE(0x0080, 0x009f) AM_READWRITE8(at_page8_r,               at_page8_w, 0xffff)
176176   AM_RANGE(0x00a0, 0x00bf) AM_DEVREADWRITE8("pic8259_slave", pic8259_r, pic8259_w, 0xffff)
177177   AM_RANGE(0x00c0, 0x00df) AM_DEVREADWRITE8("dma8237_2", at_dma8237_1_r, at_dma8237_1_w, 0xffff)
r9147r9148
199199   AM_RANGE(0x0020, 0x003f) AM_DEVREADWRITE8("pic8259_master", pic8259_r, pic8259_w, 0xffffffff)
200200   AM_RANGE(0x0040, 0x005f) AM_DEVREADWRITE8("pit8254", pit8253_r, pit8253_w, 0xffffffff)
201201   AM_RANGE(0x0060, 0x006f) AM_READWRITE(at_kbdc8042_32le_r,      at_kbdc8042_32le_w)
202   AM_RANGE(0x0070, 0x007f) AM_READWRITE(mc146818_port32le_r,      mc146818_port32le_w)
202   AM_RANGE(0x0070, 0x007f) AM_DEVREADWRITE8_MODERN("rtc", mc146818_device, read, write , 0xffffffff)
203203   AM_RANGE(0x0080, 0x009f) AM_READWRITE8(at_page8_r,            at_page8_w, 0xffffffff)
204204   AM_RANGE(0x00a0, 0x00bf) AM_DEVREADWRITE8("pic8259_slave", pic8259_r, pic8259_w, 0xffffffff)
205205   AM_RANGE(0x00c0, 0x00df) AM_DEVREADWRITE8("dma8237_2", at_dma8237_1_r, at_dma8237_1_w, 0xffffffff)
r9147r9148
221221   AM_RANGE(0x0020, 0x003f) AM_DEVREADWRITE8("pic8259_master", pic8259_r, pic8259_w, 0xffffffff)
222222   AM_RANGE(0x0040, 0x005f) AM_DEVREADWRITE8("pit8254", pit8253_r, pit8253_w, 0xffffffff)
223223   AM_RANGE(0x0060, 0x006f) AM_READWRITE(at_kbdc8042_32le_r,      at_kbdc8042_32le_w)
224   AM_RANGE(0x0070, 0x007f) AM_READWRITE(mc146818_port32le_r,      mc146818_port32le_w)
224   AM_RANGE(0x0070, 0x007f) AM_DEVREADWRITE8_MODERN("rtc", mc146818_device, read, write , 0xffffffff)
225225   AM_RANGE(0x0080, 0x009f) AM_READWRITE8(at_page8_r,            at_page8_w, 0xffffffff)
226226   AM_RANGE(0x00a0, 0x00bf) AM_DEVREADWRITE8("pic8259_slave", pic8259_r, pic8259_w, 0xffffffff)
227227   AM_RANGE(0x00c0, 0x00df) AM_DEVREADWRITE8("dma8237_2", at_dma8237_1_r, at_dma8237_1_w, 0xffffffff)
r9147r9148
274274   AM_RANGE(0x0020, 0x003f) AM_DEVREADWRITE8("pic8259_master", pic8259_r, pic8259_w, 0xffffffff)
275275   AM_RANGE(0x0040, 0x005f) AM_DEVREADWRITE8("pit8254", pit8253_r, pit8253_w, 0xffffffff)
276276   //AM_RANGE(0x0060, 0x006f) AM_READWRITE(at_kbdc8042_32le_r,      at_kbdc8042_32le_w)
277   AM_RANGE(0x0070, 0x007f) AM_READWRITE(mc146818_port32le_r,      mc146818_port32le_w)
277   AM_RANGE(0x0070, 0x007f) AM_DEVREADWRITE8_MODERN("rtc", mc146818_device, read, write , 0xffffffff)
278278   AM_RANGE(0x0080, 0x009f) AM_READWRITE8(at_page8_r,            at_page8_w, 0xffffffff)
279279   AM_RANGE(0x00a0, 0x00bf) AM_DEVREADWRITE8("pic8259_slave", pic8259_r, pic8259_w, 0xffffffff)
280280   AM_RANGE(0x00c0, 0x00df) AM_DEVREADWRITE8("dma8237_2", at_dma8237_1_r, at_dma8237_1_w, 0xffffffff)
r9147r9148
534534
535535   MDRV_KB_KEYTRONIC_ADD("keyboard", at_keytronic_intf)
536536
537   MDRV_NVRAM_HANDLER( mc146818 )
537   MDRV_MC146818_ADD( "rtc", MC146818_STANDARD )
538538
539539   /* printers */
540540   MDRV_PC_LPT_ADD("lpt_0", at_lpt_config)
r9147r9148
607607
608608   MDRV_KB_KEYTRONIC_ADD("keyboard", at_keytronic_intf)
609609
610   MDRV_NVRAM_HANDLER( mc146818 )
610   MDRV_MC146818_ADD( "rtc", MC146818_STANDARD )
611611
612612   /* printers */
613613   MDRV_PC_LPT_ADD("lpt_0", at_lpt_config)
r9147r9148
678678
679679   MDRV_KB_KEYTRONIC_ADD("keyboard", at_keytronic_intf)
680680
681   MDRV_NVRAM_HANDLER( mc146818 )
681   MDRV_MC146818_ADD( "rtc", MC146818_STANDARD )
682682
683683   /* printers */
684684   MDRV_PC_LPT_ADD("lpt_0", at_lpt_config)
r9147r9148
751751
752752   MDRV_KB_KEYTRONIC_ADD("keyboard", at_keytronic_intf)
753753
754   MDRV_NVRAM_HANDLER( mc146818 )
754   MDRV_MC146818_ADD( "rtc", MC146818_STANDARD )
755755
756756   /* printers */
757757   MDRV_PC_LPT_ADD("lpt_0", at_lpt_config)
r9147r9148
825825
826826   MDRV_KB_KEYTRONIC_ADD("keyboard", at_keytronic_intf)
827827
828   MDRV_NVRAM_HANDLER( mc146818 )
828   MDRV_MC146818_ADD( "rtc", MC146818_STANDARD )
829829//  MDRV_NVRAM_ADD_0FILL("nvram")
830830
831831   /* printers */
src/mess/drivers/orion.c
r9147r9148
207207   MDRV_VIDEO_START(orion128)
208208   MDRV_VIDEO_UPDATE(orion128)
209209
210   MDRV_NVRAM_HANDLER( mc146818 )
210   MDRV_MC146818_ADD( "rtc", MC146818_IGNORE_CENTURY )
211211
212212   MDRV_SPEAKER_STANDARD_MONO("mono")
213213   MDRV_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
src/mess/drivers/qx10.c
r9147r9148
268268static READ8_HANDLER(mc146818_data_r)
269269{
270270   qx10_state *state = space->machine->driver_data<qx10_state>();
271   return mc146818_port_r(space, state->mc146818_offset);
271   return space->machine->device<mc146818_device>("rtc")->read(*space, state->mc146818_offset);
272272};
273273
274274static WRITE8_HANDLER(mc146818_data_w)
275275{
276276   qx10_state *state = space->machine->driver_data<qx10_state>();
277   mc146818_port_w(space, state->mc146818_offset, data);
277   space->machine->device<mc146818_device>("rtc")->write(*space, state->mc146818_offset, data);
278278};
279279
280280static WRITE8_HANDLER(mc146818_offset_w)
r9147r9148
459459
460460   cpu_set_irq_callback(machine->device("maincpu"), irq_callback);
461461
462   mc146818_init(machine, MC146818_STANDARD);
463462   compis_init( &i82720_interface );
464463
465464   // find devices
r9147r9148
535534   MDRV_VIDEO_START(compis_gdc)
536535   MDRV_VIDEO_UPDATE(compis_gdc)
537536
537   MDRV_MC146818_ADD( "rtc", MC146818_STANDARD )
538   
538539   /* internal ram */
539540   MDRV_RAM_ADD("messram")
540541   MDRV_RAM_DEFAULT_SIZE("256K")
src/mess/drivers/amstrad.c
r9147r9148
155155
156156static DRIVER_INIT( aleste )
157157{
158   mc146818_init(machine, MC146818_IGNORE_CENTURY);
159158}
160159
161160
r9147r9148
10401039   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
10411040   MDRV_PALETTE_LENGTH(32+64)
10421041   MDRV_PALETTE_INIT(aleste)
1043   MDRV_NVRAM_HANDLER(mc146818)
1042   MDRV_MC146818_ADD( "rtc", MC146818_IGNORE_CENTURY )
10441043   MDRV_UPD765A_MODIFY("upd765", aleste_8272_interface)
10451044
10461045   MDRV_FLOPPY_2_DRIVES_MODIFY(aleste_floppy_config)
src/mess/drivers/nc.c
r9147r9148
13411341   nc200_uart_interrupt_irq = 0;
13421342
13431343   nc_common_open_stream_for_reading(machine);
1344   if (file)
1345   {
1346      mc146818_load_stream(file);
1347   }
13481344   nc_common_restore_memory_from_stream(machine);
13491345   nc_common_close_stream();
13501346
r9147r9148
13571353static void nc200_machine_stop(running_machine &machine)
13581354{
13591355   nc_common_open_stream_for_writing(&machine);
1360   if (file)
1361   {
1362      mc146818_save_stream(file);
1363   }
13641356   nc_common_store_memory_to_stream(&machine);
13651357   nc_common_close_stream();
13661358}
r9147r9148
13801372
13811373   /* serial timer */
13821374   nc_serial_timer = timer_alloc(machine, nc_serial_timer_callback, NULL);
1383
1384   mc146818_init(machine, MC146818_STANDARD);
13851375}
13861376
13871377/*
r9147r9148
15101500   AM_RANGE(0xb0, 0xb9) AM_READ(nc_key_data_in_r)
15111501   AM_RANGE(0xc0, 0xc0) AM_DEVREADWRITE("uart", msm8251_data_r, msm8251_data_w)
15121502   AM_RANGE(0xc1, 0xc1) AM_DEVREADWRITE("uart", msm8251_status_r, msm8251_control_w)
1513   AM_RANGE(0xd0, 0xd1) AM_READWRITE(mc146818_port_r, mc146818_port_w)
1503   AM_RANGE(0xd0, 0xd1) AM_DEVREADWRITE_MODERN("rtc", mc146818_device, read, write)
15141504   AM_RANGE(0xe0, 0xe0) AM_DEVREAD("upd765", upd765_status_r)
15151505   AM_RANGE(0xe1, 0xe1) AM_DEVREADWRITE("upd765",upd765_data_r, upd765_data_w)
15161506ADDRESS_MAP_END
r9147r9148
17191709   MDRV_CARTSLOT_START(nc_pcmcia_card)
17201710   MDRV_CARTSLOT_LOAD(nc_pcmcia_card)
17211711   MDRV_CARTSLOT_UNLOAD(nc_pcmcia_card)
1712   
1713   MDRV_MC146818_ADD( "rtc", MC146818_STANDARD )
17221714
17231715   /* internal ram */
17241716   MDRV_RAM_ADD("messram")
src/mess/drivers/sgi_ip2.c
r9147r9148
120120
121121static READ8_HANDLER(sgi_ip2_clock_ctl_r)
122122{
123   UINT8 ret = mc146818_port_r(space, 1);
123   mc146818_device *rtc = space->machine->device<mc146818_device>("rtc");
124   UINT8 ret = rtc->read(*space, 1);
124125   verboselog(space->machine, 1, "sgi_ip2_clock_ctl_r: %02x\n", ret);
125126   return ret;
126127}
r9147r9148
128129static WRITE8_HANDLER(sgi_ip2_clock_ctl_w)
129130{
130131   verboselog(space->machine, 1, "sgi_ip2_clock_ctl_w: %02x\n", data);
131   mc146818_port_w(space, 1, data);
132   mc146818_device *rtc = space->machine->device<mc146818_device>("rtc");
133   rtc->write(*space, 1, data);
132134}
133135
134136static READ8_HANDLER(sgi_ip2_clock_data_r)
135137{
136   UINT8 ret = mc146818_port_r(space, 0);
138   mc146818_device *rtc = space->machine->device<mc146818_device>("rtc");
139   UINT8 ret = rtc->read(*space, 0);
140
137141   verboselog(space->machine, 1, "sgi_ip2_clock_data_r: %02x\n", ret);
138142   return ret;
139143}
r9147r9148
141145static WRITE8_HANDLER(sgi_ip2_clock_data_w)
142146{
143147   verboselog(space->machine, 1, "sgi_ip2_clock_data_w: %02x\n", data);
144   mc146818_port_w(space, 0, data);
148   mc146818_device *rtc = space->machine->device<mc146818_device>("rtc");
149   rtc->write(*space, 0, data);
145150}
146151
147152
r9147r9148
437442
438443    MDRV_DUART68681_ADD( "duart68681a", XTAL_3_6864MHz, sgi_ip2_duart68681a_config ) /* Y3 3.6864MHz Xtal ??? copy-over from dectalk */
439444    MDRV_DUART68681_ADD( "duart68681b", XTAL_3_6864MHz, sgi_ip2_duart68681b_config ) /* Y3 3.6864MHz Xtal ??? copy-over from dectalk */
440   MDRV_NVRAM_HANDLER(mc146818)
445   MDRV_MC146818_ADD( "rtc", MC146818_IGNORE_CENTURY )
441446
442447   /* sound hardware */
443448   MDRV_SPEAKER_STANDARD_MONO("mono")
r9147r9148
501506   memcpy(dst, src, 8);
502507
503508   machine->device("maincpu")->reset();
504
505   mc146818_init(machine, MC146818_IGNORE_CENTURY);
506509}
507510
508511/***************************************************************************
src/mess/drivers/bebox.c
r9147r9148
6060   AM_RANGE(0x80000000, 0x8000001F) AM_DEVREADWRITE8( "dma8237_1", i8237_r, i8237_w, U64(0xffffffffffffffff) )
6161   AM_RANGE(0x80000020, 0x8000003F) AM_DEVREADWRITE8( "pic8259_master", pic8259_r, pic8259_w, U64(0xffffffffffffffff) )
6262   AM_RANGE(0x80000040, 0x8000005f) AM_DEVREADWRITE8( "pit8254", pit8253_r, pit8253_w, U64(0xffffffffffffffff) )
63   AM_RANGE(0x80000060, 0x8000006F) AM_READWRITE( kbdc8042_64be_r, kbdc8042_64be_w )
64   AM_RANGE(0x80000070, 0x8000007F) AM_READWRITE( mc146818_port64be_r, mc146818_port64be_w )
63   AM_RANGE(0x80000060, 0x8000006F) AM_READWRITE( kbdc8042_64be_r, kbdc8042_64be_w )   
64   AM_RANGE(0x80000070, 0x8000007F) AM_DEVREADWRITE8_MODERN("rtc", mc146818_device, read, write , U64(0xffffffffffffffff) )
6565   AM_RANGE(0x80000080, 0x8000009F) AM_READWRITE( bebox_page_r, bebox_page_w)
6666   AM_RANGE(0x800000A0, 0x800000BF) AM_DEVREADWRITE8( "pic8259_slave", pic8259_r, pic8259_w, U64(0xffffffffffffffff) )
6767   AM_RANGE(0x800000C0, 0x800000DF) AM_READWRITE( bebox_dma8237_1_r, bebox_dma8237_1_w)
r9147r9148
170170
171171   MDRV_FLOPPY_DRIVE_ADD(FLOPPY_0, bebox_floppy_config)
172172
173   MDRV_MC146818_ADD( "rtc", MC146818_STANDARD )
174   
173175   /* internal ram */
174176   MDRV_RAM_ADD("messram")
175177   MDRV_RAM_DEFAULT_SIZE("32M")
src/mess/drivers/e01.c
r9147r9148
199199
200200static READ8_HANDLER( rtc_address_r )
201201{
202   return mc146818_port_r(space, 0);
202   mc146818_device *rtc = space->machine->device<mc146818_device>("rtc");
203   return rtc->read(*space, 0);
203204}
204205
205206static WRITE8_HANDLER( rtc_address_w )
206207{
207   mc146818_port_w(space, 0, data);
208   mc146818_device *rtc = space->machine->device<mc146818_device>("rtc");
209   rtc->write(*space, 0, data);
208210}
209211
210212static READ8_HANDLER( rtc_data_r )
211213{
212   return mc146818_port_r(space, 1);
214   mc146818_device *rtc = space->machine->device<mc146818_device>("rtc");
215   return rtc->read(*space, 1);
213216}
214217
215218static WRITE8_HANDLER( rtc_data_w )
216219{
217   mc146818_port_w(space, 1, data);
220   mc146818_device *rtc = space->machine->device<mc146818_device>("rtc");
221   rtc->write(*space, 1, data);
218222}
219223
220224/***************************************************************************
r9147r9148
406410   memory_configure_bank(machine, "bank4", 0, 1, ram + 0xfd00, 0);
407411   memory_set_bank(machine, "bank4", 0);
408412
409   /* initialize RTC */
410   mc146818_init(machine, MC146818_STANDARD);
411
412413   /* register for state saving */
413414   state_save_register_global(machine, state->adlc_ie);
414415   state_save_register_global(machine, state->hdc_ie);
r9147r9148
446447    MDRV_MACHINE_START(e01)
447448    MDRV_MACHINE_RESET(e01)
448449
449   MDRV_NVRAM_HANDLER(mc146818)
450   MDRV_MC146818_ADD( "rtc", MC146818_STANDARD )
450451
451452   MDRV_TIMER_ADD_PERIODIC("rtc", rtc_irq_hack, HZ(2)) // HACK!
452453
src/mess/drivers/pc.c
r9147r9148
497497   AM_RANGE(0x0020, 0x0021) AM_DEVREADWRITE8("pic8259", pic8259_r, pic8259_w, 0xffff)
498498   AM_RANGE(0x0040, 0x0043) AM_DEVREADWRITE8("pit8253", pit8253_r, pit8253_w, 0xffff)
499499   AM_RANGE(0x0060, 0x0065) AM_READWRITE(pc1640_16le_port60_r,         pc1640_16le_port60_w)
500   AM_RANGE(0x0070, 0x0071) AM_READWRITE(mc146818_port16le_r,      mc146818_port16le_w)
500   AM_RANGE(0x0070, 0x0071) AM_DEVREADWRITE8_MODERN("rtc", mc146818_device, read, write, 0xffff)
501501   AM_RANGE(0x0078, 0x0079) AM_READWRITE(pc1640_16le_mouse_x_r,         pc1640_16le_mouse_x_w)
502502   AM_RANGE(0x007a, 0x007b) AM_READWRITE(pc1640_16le_mouse_y_r,         pc1640_16le_mouse_y_w)
503503   AM_RANGE(0x0080, 0x0087) AM_READWRITE8(pc_page_r,               pc_page_w, 0xffff)
r9147r9148
561561   AM_RANGE(0x0020, 0x0021) AM_DEVREADWRITE8("pic8259", pic8259_r, pic8259_w, 0xffff)
562562   AM_RANGE(0x0040, 0x0043) AM_DEVREADWRITE8("pit8253", pit8253_r, pit8253_w, 0xffff)
563563   AM_RANGE(0x0060, 0x0065) AM_READWRITE(pc1640_16le_port60_r,         pc1640_16le_port60_w)
564   AM_RANGE(0x0070, 0x0071) AM_READWRITE(mc146818_port16le_r,      mc146818_port16le_w)
564   AM_RANGE(0x0070, 0x0071) AM_DEVREADWRITE8_MODERN("rtc", mc146818_device, read, write, 0xffff)
565565   AM_RANGE(0x0078, 0x0079) AM_READWRITE(pc1640_16le_mouse_x_r,   pc1640_16le_mouse_x_w)
566566   AM_RANGE(0x007a, 0x007b) AM_READWRITE(pc1640_16le_mouse_y_r,   pc1640_16le_mouse_y_w)
567567   AM_RANGE(0x0080, 0x0087) AM_READWRITE8(pc_page_r,            pc_page_w, 0xffff)
r9147r9148
592592   AM_RANGE(0x0020, 0x0021) AM_DEVREADWRITE8("pic8259", pic8259_r, pic8259_w, 0xffff)
593593   AM_RANGE(0x0040, 0x0043) AM_DEVREADWRITE8("pit8253", pit8253_r, pit8253_w, 0xffff)
594594   AM_RANGE(0x0060, 0x0065) AM_READWRITE(pc1640_16le_port60_r,         pc1640_16le_port60_w)
595   AM_RANGE(0x0070, 0x0071) AM_READWRITE(mc146818_port16le_r,      mc146818_port16le_w)
595   AM_RANGE(0x0070, 0x0071) AM_DEVREADWRITE8_MODERN("rtc", mc146818_device, read, write, 0xffff)
596596   AM_RANGE(0x0078, 0x0079) AM_READWRITE(pc1640_16le_mouse_x_r,   pc1640_16le_mouse_x_w)
597597   AM_RANGE(0x007a, 0x007b) AM_READWRITE(pc1640_16le_mouse_y_r,   pc1640_16le_mouse_y_w)
598598   AM_RANGE(0x0080, 0x0087) AM_READWRITE8(pc_page_r,            pc_page_w, 0xffff)
r9147r9148
21372137   MDRV_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
21382138   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
21392139
2140   MDRV_NVRAM_HANDLER( mc146818 )
2140   MDRV_MC146818_ADD( "rtc", MC146818_IGNORE_CENTURY )
21412141
21422142   /* printer */
21432143   MDRV_PC_LPT_ADD("lpt_0", pc_lpt_config)
r9147r9148
21862186   MDRV_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
21872187   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
21882188
2189   MDRV_NVRAM_HANDLER( mc146818 )
2189   MDRV_MC146818_ADD( "rtc", MC146818_IGNORE_CENTURY )
21902190
21912191   /* printer */
21922192   MDRV_PC_LPT_ADD("lpt_0", pc_lpt_config)
src/mess/drivers/micronic.c
r9147r9148
252252{
253253   micronic_state *state = space->machine->driver_data<micronic_state>();
254254   state->rtc_address = data;
255
256   mc146818_port_w(space, 0, data);
255   mc146818_device *rtc = space->machine->device<mc146818_device>("rtc");
256   rtc->write(*space, 0, data);
257257}
258258
259259READ8_HANDLER( rtc_data_r )
260260{
261261   micronic_state *state = space->machine->driver_data<micronic_state>();
262262   UINT8 data = 0;
263
263   mc146818_device *rtc = space->machine->device<mc146818_device>("rtc");
264264   switch(state->rtc_address & 0x3f)
265265   {
266266      case 0x0c:
267         data = state->irq_flags | mc146818_port_r(space, 1);
267         data = state->irq_flags | rtc->read(*space, 1);
268268         state->irq_flags = 0;
269269         break;
270270      default:
271         data = mc146818_port_r(space, 1);
271         data = rtc->read(*space, 1);
272272   }
273273
274274   return data;
r9147r9148
277277WRITE8_HANDLER( rtc_data_w )
278278{
279279   micronic_state *state = space->machine->driver_data<micronic_state>();
280   mc146818_device *rtc = space->machine->device<mc146818_device>("rtc");
281   rtc->write(*space, 1, data);
280282
281   mc146818_port_w(space, 1, data);
282
283283   switch(state->rtc_address & 0x3f)
284284   {
285285      case 0x0a:
r9147r9148
404404   {
405405      mame_fwrite(file, state->ram, 0x8000);
406406      mame_fwrite(file, messram_get_ptr(machine->device("messram")), 224*1024);
407      mc146818_save_stream(file);
408407   }
409408   else
410409   {
411410      if (file)
412411      {
413412         mame_fread(file, state->ram, 0x8000);
414         mame_fread(file, messram_get_ptr(machine->device("messram")), 224*1024);
415         mc146818_load_stream(file);
413         mame_fread(file, messram_get_ptr(machine->device("messram")), 224*1024);         
416414
417415         /* reload register A and B for restore the periodic irq state */
418416         mame_fseek(file, 0x4000a, SEEK_SET);
r9147r9148
462460   memory_configure_bank(machine, "bank1", 0x02, 0x07, messram_get_ptr(machine->device("messram")), 0x8000);
463461
464462   state->rtc_periodic_irq = timer_alloc(machine, rtc_periodic_irq, 0);
465
466   mc146818_init(machine, MC146818_IGNORE_CENTURY);
467
468463   /* register for state saving */
469464//  state_save_register_global(machine, state->);
470465}
r9147r9148
513508   MDRV_RAM_DEFAULT_SIZE("224K")
514509
515510   MDRV_NVRAM_HANDLER(micronic)
516
511   
512   MDRV_MC146818_ADD( "rtc", MC146818_IGNORE_CENTURY )
517513MACHINE_CONFIG_END
518514
519515/* ROM definition */
src/mess/drivers/bbc.c
r9147r9148
923923   MDRV_SOUND_ADD("sn76489", SN76489, 4000000)   /* 4 MHz */
924924   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
925925
926   MDRV_NVRAM_HANDLER( mc146818 )
926   MDRV_MC146818_ADD( "rtc", MC146818_STANDARD )
927927
928928   /* printer */
929929   MDRV_CENTRONICS_ADD("centronics", bbcb_centronics_config)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team