Previous 15994 Revisions Next

r4031 Wednesday 31st December, 2008 at 02:23:39 UTC by Barry Rodewald
[RP5C15] Converted to a device.
[docs]messnew.txt
[src/mess/drivers]atarist.c x68k.c
[src/mess/machine]rp5c15.c rp5c15.h

src/mess/machine/rp5c15.c
r4030r4031
6969
7070#include "rp5c15.h"
7171
72
73static struct rp5c15 rtc;
74
7572static emu_timer* rtc_timer;
7673
7774TIMER_CALLBACK(rtc_alarm_pulse)
7875{
79   if(rtc.pulse16_state == 0)  // low
76   const device_config* device = ptr;
77   rp5c15_t* rtc = device->token;
78   
79   if(rtc->pulse16_state == 0)  // low
8080   {
81      rtc.pulse16_state = 1;  // make high
82      rtc.pulse_count++;
81      rtc->pulse16_state = 1;  // make high
82      rtc->pulse_count++;
8383   }
8484   else
8585   {
86      rtc.pulse16_state = 0;  // make low
86      rtc->pulse16_state = 0;  // make low
8787   }
8888
89   if(rtc.pulse_count == 8)
89   if(rtc->pulse_count == 8)
9090   {
91      rtc.pulse1_state = 0;
91      rtc->pulse1_state = 0;
9292   }
93   if(rtc.pulse_count == 16)
93   if(rtc->pulse_count == 16)
9494   {
95      rtc.pulse_count = 0;
96      rtc.pulse1_state = 1;
97      rtc_add_second();
95      rtc->pulse_count = 0;
96      rtc->pulse1_state = 1;
97      rtc_add_second(device);
9898   }
9999}
100100
101void rp5c15_init(running_machine *machine, const struct rp5c15_interface* intf)
101DEVICE_START( rp5c15 )
102102{
103   rp5c15_t* rtc = device->token;
103104   mame_system_time systm;
104105   mame_system_tm time;
105106
106   rtc.alarm_callback = intf->alarm_irq_callback;
107   assert(device->machine != NULL);
108   rtc->intf = device->static_config;
107109
108   mame_get_base_datetime(machine,&systm);
110   rtc->alarm_callback = rtc->intf->alarm_irq_callback;
111
112   mame_get_base_datetime(device->machine,&systm);
109113   time = systm.local_time;
110114
111115   // date/time is stored as BCD
112   rtc.systime.sec_1 = time.second % 10;
113   rtc.systime.sec_10 = time.second / 10;
114   rtc.systime.min_1 = time.minute % 10;
115   rtc.systime.min_10 = time.minute / 10;
116   rtc.systime.hour_1 = time.hour % 10;
117   rtc.systime.hour_10 = time.hour / 10;
118   rtc.systime.day_1 = time.mday % 10;
119   rtc.systime.day_10 = time.mday / 10;
120   rtc.systime.month_1 = (time.month+1) % 10;
121   rtc.systime.month_10 = (time.month+1) / 10;
122   rtc.systime.year_1 = (time.year - 1980) % 10;
123   rtc.systime.year_10 = (time.year - 1980) / 10;
124   rtc.systime.dayofweek = time.weekday;
125   rtc.alarm.min_1 = time.minute % 10;
126   rtc.alarm.min_10 = time.minute / 10;
127   rtc.alarm.hour_1 = time.hour % 10;
128   rtc.alarm.hour_10 = time.hour / 10;
129   rtc.alarm.day_1 = time.mday % 10;
130   rtc.alarm.day_10 = time.mday / 10;
131   rtc.alarm.dayofweek = time.weekday;
132   rtc.leap = time.year % 4;
116   rtc->systime.sec_1 = time.second % 10;
117   rtc->systime.sec_10 = time.second / 10;
118   rtc->systime.min_1 = time.minute % 10;
119   rtc->systime.min_10 = time.minute / 10;
120   rtc->systime.hour_1 = time.hour % 10;
121   rtc->systime.hour_10 = time.hour / 10;
122   rtc->systime.day_1 = time.mday % 10;
123   rtc->systime.day_10 = time.mday / 10;
124   rtc->systime.month_1 = (time.month+1) % 10;
125   rtc->systime.month_10 = (time.month+1) / 10;
126   rtc->systime.year_1 = (time.year - 1980) % 10;
127   rtc->systime.year_10 = (time.year - 1980) / 10;
128   rtc->systime.dayofweek = time.weekday;
129   rtc->alarm.min_1 = time.minute % 10;
130   rtc->alarm.min_10 = time.minute / 10;
131   rtc->alarm.hour_1 = time.hour % 10;
132   rtc->alarm.hour_10 = time.hour / 10;
133   rtc->alarm.day_1 = time.mday % 10;
134   rtc->alarm.day_10 = time.mday / 10;
135   rtc->alarm.dayofweek = time.weekday;
136   rtc->leap = time.year % 4;
133137
134   rtc.mode = 0x08;  // Timer enabled, Alarm disable, BANK 0 selected (defaults are guessed)
135   rtc.reset = 0x00;  // enable both 1Hz and 16Hz alarm counters by default
136   rtc.test = 0x00;
137   rtc.pulse_count = 0;
138   rtc->mode = 0x08;  // Timer enabled, Alarm disable, BANK 0 selected (defaults are guessed)
139   rtc->reset = 0x00;  // enable both 1Hz and 16Hz alarm counters by default
140   rtc->test = 0x00;
141   rtc->pulse_count = 0;
138142
139   rtc_timer = timer_alloc(machine, rtc_alarm_pulse, NULL);
143   rtc_timer = timer_alloc(device->machine, rtc_alarm_pulse, (void*)device);
140144   timer_adjust_periodic(rtc_timer, attotime_zero, 0, ATTOTIME_IN_HZ(32));
145   
146   return DEVICE_START_OK;
141147}
142148
143static int rp5c15_read(int offset, UINT16 mem_mask)
149static int rp5c15_read(const device_config* device, int offset, UINT16 mem_mask)
144150{
145   if((rtc.mode & 0x01) == 0x00)  // BANK 0 selected
151   rp5c15_t* rtc = device->token;
152   if((rtc->mode & 0x01) == 0x00)  // BANK 0 selected
146153   {
147154      switch(offset)
148155      {
149156         case 0:
150            return rtc.systime.sec_1;
157            return rtc->systime.sec_1;
151158         case 1:
152            return rtc.systime.sec_10;
159            return rtc->systime.sec_10;
153160         case 2:
154            return rtc.systime.min_1;
161            return rtc->systime.min_1;
155162         case 3:
156            return rtc.systime.min_10;
163            return rtc->systime.min_10;
157164         case 4:
158            return rtc.systime.hour_1;
165            return rtc->systime.hour_1;
159166         case 5:
160            return rtc.systime.hour_10;
167            return rtc->systime.hour_10;
161168         case 6:
162            return rtc.systime.dayofweek;
169            return rtc->systime.dayofweek;
163170         case 7:
164            return rtc.systime.day_1;
171            return rtc->systime.day_1;
165172         case 8:
166            return rtc.systime.day_10;
173            return rtc->systime.day_10;
167174         case 9:
168            return rtc.systime.month_1;
175            return rtc->systime.month_1;
169176         case 10:
170            return rtc.systime.month_10;
177            return rtc->systime.month_10;
171178         case 11:
172            return rtc.systime.year_1;
179            return rtc->systime.year_1;
173180         case 12:
174            return rtc.systime.year_10;
181            return rtc->systime.year_10;
175182         case 13:
176            return rtc.mode & 0x0f;
183            return rtc->mode & 0x0f;
177184      }
178185   }
179186   else  // BANK 1 selected
r4030r4031
181188      switch(offset)
182189      {
183190         case 0:  // CLKOUT
184            return rtc.clkout & 0x07;
191            return rtc->clkout & 0x07;
185192         case 1:  // Adjustment (always returns 0)
186193            return 0;
187194         case 2:
188            return rtc.alarm.min_1;
195            return rtc->alarm.min_1;
189196         case 3:
190            return rtc.alarm.min_10;
197            return rtc->alarm.min_10;
191198         case 4:
192            return rtc.alarm.hour_1;
199            return rtc->alarm.hour_1;
193200         case 5:
194            return rtc.alarm.hour_10;
201            return rtc->alarm.hour_10;
195202         case 6:
196            return rtc.alarm.dayofweek;
203            return rtc->alarm.dayofweek;
197204         case 7:
198            return rtc.alarm.day_1;
205            return rtc->alarm.day_1;
199206         case 8:
200            return rtc.alarm.day_10;
207            return rtc->alarm.day_10;
201208         case 10:  // 12/24 hour selection (returns AM/PM?)
202209            return 0;
203210         case 11:  // Leap year
204            return rtc.leap;
211            return rtc->leap;
205212         case 13:
206            return rtc.mode & 0x0f;
213            return rtc->mode & 0x0f;
207214         default:
208215            return 0;
209216      }
r4030r4031
211218   return 0;
212219}
213220
214static void rp5c15_write(int offset, int data, UINT16 mem_mask)
221static void rp5c15_write(const device_config* device, int offset, int data, UINT16 mem_mask)
215222{
223   rp5c15_t* rtc = device->token;
216224   if(offset == 13)
217225   {
218      rtc.mode = data & 0x0f;
226      rtc->mode = data & 0x0f;
219227      return;
220228   }
221   if((rtc.mode & 0x01) == 0x00)  // BANK 0 selected
229   if((rtc->mode & 0x01) == 0x00)  // BANK 0 selected
222230   {
223231      switch(offset)
224232      {
225233         case 0:
226            rtc.systime.sec_1 = data & 0x0f;
234            rtc->systime.sec_1 = data & 0x0f;
227235            break;
228236         case 1:
229            rtc.systime.sec_10 = data & 0x0f;
237            rtc->systime.sec_10 = data & 0x0f;
230238            break;
231239         case 2:
232            rtc.systime.min_1 = data & 0x0f;
240            rtc->systime.min_1 = data & 0x0f;
233241            break;
234242         case 3:
235            rtc.systime.min_10 = data & 0x0f;
243            rtc->systime.min_10 = data & 0x0f;
236244            break;
237245         case 4:
238            rtc.systime.hour_1 = data & 0x0f;
246            rtc->systime.hour_1 = data & 0x0f;
239247            break;
240248         case 5:
241            rtc.systime.hour_10 = data & 0x0f;
249            rtc->systime.hour_10 = data & 0x0f;
242250            break;
243251         case 6:
244            rtc.systime.dayofweek = data & 0x0f;
252            rtc->systime.dayofweek = data & 0x0f;
245253            break;
246254         case 7:
247            rtc.systime.day_1 = data & 0x0f;
255            rtc->systime.day_1 = data & 0x0f;
248256            break;
249257         case 8:
250            rtc.systime.day_10 = data & 0x0f;
258            rtc->systime.day_10 = data & 0x0f;
251259            break;
252260         case 9:
253            rtc.systime.month_1 = data & 0x0f;
261            rtc->systime.month_1 = data & 0x0f;
254262            break;
255263         case 10:
256            rtc.systime.month_10 = data & 0x0f;
264            rtc->systime.month_10 = data & 0x0f;
257265            break;
258266         case 11:
259            rtc.systime.year_1 = data & 0x0f;
267            rtc->systime.year_1 = data & 0x0f;
260268            break;
261269         case 12:
262            rtc.systime.year_10 = data & 0x0f;
270            rtc->systime.year_10 = data & 0x0f;
263271            break;
264272      }
265273   }
r4030r4031
268276      switch(offset)
269277      {
270278         case 0:
271            rtc.clkout = data & 0x07;
279            rtc->clkout = data & 0x07;
272280            break;
273281         case 1:  // Adjustment  (resets seconds to 0, increases minute by 1 if seconds are > 30
274            if(rtc.systime.sec_10 >= 3)
275               rtc_add_minute();
276            rtc.systime.sec_1 = 0;
277            rtc.systime.sec_10 = 0;
282            if(rtc->systime.sec_10 >= 3)
283               rtc_add_minute(device);
284            rtc->systime.sec_1 = 0;
285            rtc->systime.sec_10 = 0;
278286            break;
279287         case 2:
280            rtc.alarm.min_1 = data & 0x0f;
288            rtc->alarm.min_1 = data & 0x0f;
281289            break;
282290         case 3:
283            rtc.alarm.min_10 = data & 0x0f;
291            rtc->alarm.min_10 = data & 0x0f;
284292            break;
285293         case 4:
286            rtc.alarm.hour_1 = data & 0x0f;
294            rtc->alarm.hour_1 = data & 0x0f;
287295            break;
288296         case 5:
289            rtc.alarm.hour_10 = data & 0x0f;
297            rtc->alarm.hour_10 = data & 0x0f;
290298            break;
291299         case 6:
292            rtc.alarm.dayofweek = data & 0x0f;
300            rtc->alarm.dayofweek = data & 0x0f;
293301            break;
294302         case 7:
295            rtc.alarm.day_1 = data & 0x0f;
303            rtc->alarm.day_1 = data & 0x0f;
296304            break;
297305         case 8:
298            rtc.alarm.day_10 = data & 0x0f;
306            rtc->alarm.day_10 = data & 0x0f;
299307            break;
300308         case 10:  // 12/24 hour clock selection
301            rtc.hour24 = data;
309            rtc->hour24 = data;
302310            break;
303311
304312      }
305313   }
306314}
307315
308void rtc_add_second()  // add one second to current time
316void rtc_add_second(const device_config* device)  // add one second to current time
309317{
310   if((rtc.mode & 0x08) == 0x00) // if timer is not enabled
318   rp5c15_t* rtc = device->token;
319   
320   if((rtc->mode & 0x08) == 0x00) // if timer is not enabled
311321      return;
312   rtc.systime.sec_1++;
313   if(rtc.systime.sec_1 < 10)
322   rtc->systime.sec_1++;
323   if(rtc->systime.sec_1 < 10)
314324      return;
315   rtc.systime.sec_1 = 0;
316   rtc.systime.sec_10++;
317   if(rtc.systime.sec_10 < 6)
325   rtc->systime.sec_1 = 0;
326   rtc->systime.sec_10++;
327   if(rtc->systime.sec_10 < 6)
318328      return;
319   rtc.systime.sec_10 = 0;
320   rtc_add_minute();
329   rtc->systime.sec_10 = 0;
330   rtc_add_minute(device);
321331}
322332
323void rtc_add_minute()
333void rtc_add_minute(const device_config* device)
324334{
325   rtc.systime.min_1++;
326   if(rtc.systime.min_1 < 10)
335   rp5c15_t* rtc = device->token;
336   
337   rtc->systime.min_1++;
338   if(rtc->systime.min_1 < 10)
327339      return;
328   rtc.systime.min_1 = 0;
329   rtc.systime.min_10++;
330   if(rtc.systime.min_10 < 6)
340   rtc->systime.min_1 = 0;
341   rtc->systime.min_10++;
342   if(rtc->systime.min_10 < 6)
331343      return;
332   rtc.systime.min_10 = 0;
333   rtc.systime.hour_1++;
334   if(rtc.systime.hour_1 < 10 && rtc.systime.hour_10 < 2)
344   rtc->systime.min_10 = 0;
345   rtc->systime.hour_1++;
346   if(rtc->systime.hour_1 < 10 && rtc->systime.hour_10 < 2)
335347      return;
336   if(rtc.systime.hour_10 < 3 && rtc.systime.hour_1 < 4)
348   if(rtc->systime.hour_10 < 3 && rtc->systime.hour_1 < 4)
337349      return;
338   rtc.systime.hour_1 = 0;
339   rtc.systime.hour_10++;
340   if(rtc.systime.hour_10 < 3)
350   rtc->systime.hour_1 = 0;
351   rtc->systime.hour_10++;
352   if(rtc->systime.hour_10 < 3)
341353      return;
342   rtc.systime.hour_10 = 0;
343   rtc_add_day();
354   rtc->systime.hour_10 = 0;
355   rtc_add_day(device);
344356}
345357
346void rtc_add_day()
358void rtc_add_day(const device_config* device)
347359{
360   rp5c15_t* rtc = device->token;
348361   int d,m;
349362
350   rtc.systime.dayofweek++;
351   if(rtc.systime.dayofweek >= 7)
352      rtc.systime.dayofweek = 0;
353   d = (rtc.systime.day_10 << 4) | rtc.systime.day_1;
354   m = (rtc.systime.month_10 << 4) | rtc.systime.month_1;
363   rtc->systime.dayofweek++;
364   if(rtc->systime.dayofweek >= 7)
365      rtc->systime.dayofweek = 0;
366   d = (rtc->systime.day_10 << 4) | rtc->systime.day_1;
367   m = (rtc->systime.month_10 << 4) | rtc->systime.month_1;
355368   d++;
356369   if((d & 0x0f) >= 10)
357370   {
358371      d &= 0xf0;
359372      d += 0x10;
360373   }
361   rtc.systime.day_1 = (d & 0x0f);
362   rtc.systime.day_10 = (d & 0xf0) >> 4;
374   rtc->systime.day_1 = (d & 0x0f);
375   rtc->systime.day_10 = (d & 0xf0) >> 4;
363376   switch(m)
364377   {
365378      case 1:
r4030r4031
371384      case 0x12:
372385         if(d > 0x31)
373386         {
374            rtc.systime.day_1 = 1;
375            rtc.systime.day_10 = 0;
376            rtc_add_month();
387            rtc->systime.day_1 = 1;
388            rtc->systime.day_10 = 0;
389            rtc_add_month(device);
377390         }
378391         break;
379392      case 4:
r4030r4031
382395      case 11:
383396         if(d > 0x30)
384397         {
385            rtc.systime.day_1 = 1;
386            rtc.systime.day_10 = 0;
387            rtc_add_month();
398            rtc->systime.day_1 = 1;
399            rtc->systime.day_10 = 0;
400            rtc_add_month(device);
388401         }
389402         break;
390403      case 2:
391         if(rtc.leap == 0)  // this is a leap year
404         if(rtc->leap == 0)  // this is a leap year
392405         {
393406            if(d > 0x29)
394407            {
395               rtc.systime.day_1 = 1;
396               rtc.systime.day_10 = 0;
397               rtc_add_month();
408               rtc->systime.day_1 = 1;
409               rtc->systime.day_10 = 0;
410               rtc_add_month(device);
398411            }
399412         }
400413         else  // not a leap year
401414         {
402415            if(d > 0x28)
403416            {
404               rtc.systime.day_1 = 1;
405               rtc.systime.day_10 = 0;
406               rtc_add_month();
417               rtc->systime.day_1 = 1;
418               rtc->systime.day_10 = 0;
419               rtc_add_month(device);
407420            }
408421         }
409422         break;
410423   }
411424}
412425
413void rtc_add_month()
426void rtc_add_month(const device_config* device)
414427{
415   rtc.systime.month_1++;
416   if(rtc.systime.month_1 < 10 && rtc.systime.month_10 < 1)
428   rp5c15_t* rtc = device->token;
429   
430   rtc->systime.month_1++;
431   if(rtc->systime.month_1 < 10 && rtc->systime.month_10 < 1)
417432      return;
418   if(rtc.systime.month_1 < 3 && rtc.systime.month_10 < 2)
433   if(rtc->systime.month_1 < 3 && rtc->systime.month_10 < 2)
419434      return;
420   rtc.systime.month_1 = 0;
421   rtc.systime.month_10++;
422   if(rtc.systime.month_10 < 2)
435   rtc->systime.month_1 = 0;
436   rtc->systime.month_10++;
437   if(rtc->systime.month_10 < 2)
423438      return;
424   rtc.systime.month_1 = 1;
425   rtc.systime.month_10 = 0;
426   rtc.systime.year_1++;
427   if(rtc.systime.year_1 < 10)
439   rtc->systime.month_1 = 1;
440   rtc->systime.month_10 = 0;
441   rtc->systime.year_1++;
442   if(rtc->systime.year_1 < 10)
428443      return;
429   rtc.systime.year_1 = 0;
430   rtc.systime.year_10++;
431   if(rtc.systime.year_10 < 10)
444   rtc->systime.year_1 = 0;
445   rtc->systime.year_10++;
446   if(rtc->systime.year_10 < 10)
432447      return;
433   rtc.systime.year_10 = 0;
448   rtc->systime.year_10 = 0;
434449}
435450
436READ16_HANDLER(rp5c15_r) { return rp5c15_read(offset,mem_mask); }
437WRITE16_HANDLER(rp5c15_w) { rp5c15_write(offset,data,mem_mask); }
451static DEVICE_SET_INFO( rp5c15 )
452{
453   switch (state)
454   {
455      /* no parameters to set */
456   }
457}
458
459DEVICE_GET_INFO( rp5c15 )
460{
461   switch (state)
462   {
463      /* --- the following bits of info are returned as 64-bit signed integers --- */
464      case DEVINFO_INT_CLASS:                     info->i = DEVICE_CLASS_OTHER;            break;
465      case DEVINFO_INT_TOKEN_BYTES:               info->i = sizeof(rp5c15_t);            break;
466
467      /* --- the following bits of info are returned as pointers to data or functions --- */
468      case DEVINFO_FCT_SET_INFO:                  info->set_info = DEVICE_SET_INFO_NAME(rp5c15); break;
469      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME(rp5c15);   break;
470      case DEVINFO_FCT_STOP:                     /* Nothing */                        break;
471      case DEVINFO_FCT_RESET:                     /* Nothing */   break;
472
473      /* --- the following bits of info are returned as NULL-terminated strings --- */
474      case DEVINFO_STR_NAME:                     strcpy(info->s, "Ricoh RP5C15");         break;
475      case DEVINFO_STR_FAMILY:                  strcpy(info->s, "Real Time Clock");         break;
476      case DEVINFO_STR_VERSION:                  strcpy(info->s, "1.0");                  break;
477      case DEVINFO_STR_SOURCE_FILE:               strcpy(info->s, __FILE__);               break;
478      case DEVINFO_STR_CREDITS:                  strcpy(info->s, "Copyright the MESS Team");   break;
479   }
480}
481
482READ16_DEVICE_HANDLER(rp5c15_r) { return rp5c15_read(device,offset,mem_mask); }
483WRITE16_DEVICE_HANDLER(rp5c15_w) { rp5c15_write(device,offset,data,mem_mask); }
src/mess/machine/rp5c15.h
r4030r4031
77
88#include "driver.h"
99
10typedef struct rp5c15_interface rp5c15_intf;
1011struct rp5c15_interface
1112{
1213   void (*alarm_irq_callback)(int state);
1314};
1415
15struct rp5c15
16typedef struct _rp5c15_t rp5c15_t;
17struct _rp5c15_t
1618{
1719   struct
1820   {
r4030r4031
5254   int pulse16_state;
5355   void (*timer_fired_func)(int state);
5456   void (*alarm_callback)(int state);
57   const rp5c15_intf* intf;
5558};  //  Ricoh RP5C15
5659
57void rp5c15_init(running_machine *machine, const struct rp5c15_interface*);
60DEVICE_START(rp5c15);
61DEVICE_GET_INFO(rp5c15);
5862
59void rtc_add_second(void);
60void rtc_add_minute(void);
61void rtc_add_day(void);
62void rtc_add_month(void);
63void rtc_add_second(const device_config*);
64void rtc_add_minute(const device_config*);
65void rtc_add_day(const device_config*);
66void rtc_add_month(const device_config*);
6367
6468TIMER_CALLBACK(rtc_alarm_pulse);
6569
66READ16_HANDLER( rp5c15_r );
67WRITE16_HANDLER( rp5c15_w );
70#define RP5C15 DEVICE_GET_INFO_NAME(rp5c15)
6871
72#define MDRV_RP5C15_ADD(_tag, _config) \
73   MDRV_DEVICE_ADD(_tag, RP5C15, 0) \
74   MDRV_DEVICE_CONFIG(_config)
75
76READ16_DEVICE_HANDLER( rp5c15_r );
77WRITE16_DEVICE_HANDLER( rp5c15_w );
78
6979#endif /*RP5C15_H_*/
src/mess/drivers/x68k.c
r4030r4031
12411241   return ppi8255_r(device,offset & 0x03);
12421242}
12431243
1244static READ16_HANDLER( x68k_rtc_r )
1244static READ16_DEVICE_HANDLER( x68k_rtc_r )
12451245{
1246   return rp5c15_r(space, offset, mem_mask);
1246   return rp5c15_r(device, offset, mem_mask);
12471247}
12481248
1249static WRITE16_HANDLER( x68k_rtc_w )
1249static WRITE16_DEVICE_HANDLER( x68k_rtc_w )
12501250{
1251   rp5c15_w(space, offset, data, mem_mask);
1251   rp5c15_w(device, offset, data, mem_mask);
12521252}
12531253
12541254static void x68k_rtc_alarm_irq(int state)
r4030r4031
16011601   AM_RANGE(0xe84000, 0xe85fff) AM_READWRITE(x68k_dmac_r, x68k_dmac_w)
16021602   AM_RANGE(0xe86000, 0xe87fff) AM_READWRITE(x68k_areaset_r, x68k_areaset_w)
16031603   AM_RANGE(0xe88000, 0xe89fff) AM_READWRITE(x68k_mfp_r, x68k_mfp_w)
1604   AM_RANGE(0xe8a000, 0xe8bfff) AM_READWRITE(x68k_rtc_r, x68k_rtc_w)
1604   AM_RANGE(0xe8a000, 0xe8bfff) AM_DEVREADWRITE(RP5C15, "rp5c15", x68k_rtc_r, x68k_rtc_w)
16051605//  AM_RANGE(0xe8c000, 0xe8dfff) AM_READWRITE(x68k_printer_r, x68k_printer_w)
16061606   AM_RANGE(0xe8e000, 0xe8ffff) AM_READWRITE(x68k_sysport_r, x68k_sysport_w)
16071607   AM_RANGE(0xe90000, 0xe91fff) AM_READWRITE(x68k_fm_r, x68k_fm_w)
r4030r4031
21082108   memset(&sys,0,sizeof(sys));
21092109
21102110   mfp_init();
2111   rp5c15_init(machine, &rtc_intf);
21122111
21132112   cpu_set_irq_callback(machine->cpu[0], x68k_int_ack);
21142113
r4030r4031
21432142   MDRV_X68KHDC_ADD( "x68k_hdc" )
21442143
21452144   MDRV_SCC8530_ADD( "scc" )
2145   
2146   MDRV_RP5C15_ADD( "rp5c15" , rtc_intf)
21462147
21472148    /* video hardware */
21482149   MDRV_SCREEN_ADD("main", RASTER)
src/mess/drivers/atarist.c
r4030r4031
880880   AM_RANGE(0xfffc02, 0xfffc03) AM_DEVREADWRITE8(ACIA6850, "acia_0", acia6850_data_r, acia6850_data_w, 0xff00)
881881   AM_RANGE(0xfffc04, 0xfffc05) AM_DEVREADWRITE8(ACIA6850, "acia_1", acia6850_stat_r, acia6850_ctrl_w, 0xff00)
882882   AM_RANGE(0xfffc06, 0xfffc07) AM_DEVREADWRITE8(ACIA6850, "acia_1", acia6850_data_r, acia6850_data_w, 0xff00)
883   AM_RANGE(0xfffc20, 0xfffc3f) AM_READWRITE(rp5c15_r, rp5c15_w)
883   AM_RANGE(0xfffc20, 0xfffc3f) AM_DEVREADWRITE(RP5C15, "rp5c15", rp5c15_r, rp5c15_w)
884884ADDRESS_MAP_END
885885
886886static ADDRESS_MAP_START( ste_map, ADDRESS_SPACE_PROGRAM, 16 )
r4030r4031
986986   AM_RANGE(0xfffc02, 0xfffc03) AM_DEVREADWRITE8(ACIA6850, "acia_0", acia6850_data_r, acia6850_data_w, 0xff00)
987987   AM_RANGE(0xfffc04, 0xfffc05) AM_DEVREADWRITE8(ACIA6850, "acia_1", acia6850_stat_r, acia6850_ctrl_w, 0xff00)
988988   AM_RANGE(0xfffc06, 0xfffc07) AM_DEVREADWRITE8(ACIA6850, "acia_1", acia6850_data_r, acia6850_data_w, 0xff00)
989   AM_RANGE(0xfffc20, 0xfffc3f) AM_READWRITE(rp5c15_r, rp5c15_w)
989   AM_RANGE(0xfffc20, 0xfffc3f) AM_DEVREADWRITE(RP5C15, "rp5c15", rp5c15_r, rp5c15_w)
990990ADDRESS_MAP_END
991991
992992static ADDRESS_MAP_START( stbook_map, ADDRESS_SPACE_PROGRAM, 16 )
r4030r4031
15191519static MACHINE_START( megast )
15201520{
15211521   MACHINE_START_CALL(atarist);
1522
1523   rp5c15_init(machine, &rtc_intf);
15241522}
15251523
15261524static MC68901_GPIO_READ( atariste_mfp_gpio_r )
r4030r4031
16171615
16181616   MACHINE_START_CALL(atariste);
16191617
1620   rp5c15_init(machine, &rtc_intf);
1621
16221618   state_save_register_global(machine, state->megaste_cache);
16231619}
16241620
r4030r4031
17491745
17501746   /* configure devices */
17511747   centronics_config(machine, 0, atarist_centronics_config);
1752   rp5c15_init(machine, &rtc_intf);
17531748
17541749   /* set CPU interrupt callback */
17551750   cpu_set_irq_callback(machine->cpu[0], atarist_int_ack);
r4030r4031
18381833
18391834   MDRV_CPU_MODIFY("main")
18401835   MDRV_CPU_PROGRAM_MAP(megast_map, 0)
1836   MDRV_RP5C15_ADD("rp5c15",rtc_intf)
18411837
18421838   MDRV_MACHINE_START(megast)
18431839MACHINE_DRIVER_END
r4030r4031
18991895
19001896   MDRV_CPU_MODIFY("main")
19011897   MDRV_CPU_PROGRAM_MAP(megaste_map, 0)
1898   MDRV_RP5C15_ADD("rp5c15",rtc_intf)
19021899
19031900   MDRV_MACHINE_START(megaste)
19041901MACHINE_DRIVER_END
r4030r4031
19091906   // basic machine hardware
19101907   MDRV_CPU_ADD("main", M68000, U517/2)
19111908   MDRV_CPU_PROGRAM_MAP(stbook_map, 0)
1909   MDRV_RP5C15_ADD("rp5c15",rtc_intf)
19121910
19131911   //MDRV_CPU_ADD("cop888", COP888, Y700)
19141912
docs/messnew.txt
r4030r4031
100100
101101- Changed the SAM6883 implementation to be a device.  [Miodrag Milanovic]
102102
103- Changed the RP5C15 RTC implementation to be a device.  [Barry Rodewald]
104
103105- Changed the 6525 TPI implementation to be a device and added save state
104106  support.  [Dirk Best]
105107

Previous 15994 Revisions Next


© 1998-2018 The MESS Team