Previous 15994 Revisions Next

r15841 Friday 10th August, 2012 at 14:46:11 UTC by Curt Coder
[PLUS4] Fixed memory banking, JiffyDOS BIOS mapping, external reset, and modernized the TED. (nw)
[src/mess]mess.mak
[src/mess/audio]mos7360.c* mos7360.h*
[src/mess/drivers]plus4.c
[src/mess/includes]plus4.h
[src/mess/machine]plus4exp.c plus4exp.h plus4user.c plus4user.h

src/mess/audio/mos7360.c
r0r15841
1/**********************************************************************
2
3    MOS 7360/8360 Text Edit Device (TED) emulation
4
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7
8**********************************************************************/
9
10#include "emu.h"
11#include "mos7360.h"
12
13
14
15//**************************************************************************
16//  MACROS / CONSTANTS
17//**************************************************************************
18
19#define LOG 0
20
21
22#define VERBOSE_LEVEL 0
23#define DBG_LOG(N,M,A) \
24   do { \
25      if(VERBOSE_LEVEL >= N) \
26      { \
27         if( M ) \
28            logerror("%11.6f: %-24s", machine().time().as_double(), (char*) M ); \
29         logerror A; \
30      } \
31   } while(0)
32
33
34#define VREFRESHINLINES 28
35
36#define TIMER1HELPER (m_reg[0] | (m_reg[1] << 8))
37#define TIMER2HELPER (m_reg[2] | (m_reg[3] << 8))
38#define TIMER3HELPER (m_reg[4] | (m_reg[5] << 8))
39#define TIMER1 (TIMER1HELPER ? TIMER1HELPER : 0x10000)
40#define TIMER2 (TIMER2HELPER ? TIMER2HELPER : 0x10000)
41#define TIMER3 (TIMER3HELPER ? TIMER3HELPER : 0x10000)
42
43#define TED7360_YPOS            40
44#define RASTERLINE_2_C16(a)    ((a + m_lines - TED7360_YPOS - 5) % m_lines)
45#define C16_2_RASTERLINE(a)    ((a + TED7360_YPOS + 5) % m_lines)
46#define XPOS 8
47#define YPOS 8
48
49#define SCREENON               (m_reg[6] & 0x10)
50#define TEST                   (m_reg[6] & 0x80)
51#define VERTICALPOS            (m_reg[6] & 0x07)
52#define HORICONTALPOS          (m_reg[7] & 0x07)
53#define ECMON                  (m_reg[6] & 0x40)
54#define HIRESON                (m_reg[6] & 0x20)
55#define MULTICOLORON           (m_reg[7] & 0x10)
56#define REVERSEON              (!(m_reg[7] & 0x80))
57
58/* hardware inverts character when bit 7 set (character taken &0x7f) */
59/* instead of fetching character with higher number! */
60#define LINES25     (m_reg[6] & 0x08)     /* else 24 Lines */
61#define LINES       (LINES25 ? 25 : 24)
62#define YSIZE       (LINES * 8)
63#define COLUMNS40   (m_reg[7] & 0x08)     /* else 38 Columns */
64#define COLUMNS     (COLUMNS40 ? 40 : 38)
65#define XSIZE       (COLUMNS * 8)
66
67#define INROM       (m_reg[0x12] & 0x04)
68#define CHARGENADDR (REVERSEON && !HIRESON && !MULTICOLORON ? ((m_reg[0x13] & 0xfc) << 8) : ((m_reg[0x13] & 0xf8) << 8))
69#define BITMAPADDR  ((m_reg[0x12] & 0x38) << 10)
70#define VIDEOADDR   ((m_reg[0x14] & 0xf8) << 8)
71
72#define RASTERLINE  (((m_reg[0xa] & 0x01) << 8) | m_reg[0xb])
73#define CURSOR1POS  (m_reg[0xd] | ((m_reg[0xc] & 0x03) << 8))
74#define CURSOR2POS  (m_reg[0x1b] | ((m_reg[0x1a] & 0x03) << 8))
75#define CURSORRATE  ((m_reg[0x1f] & 0x7c) >> 2)
76
77#define BACKGROUNDCOLOR (m_reg[0x15] & 0x7f)
78#define FOREGROUNDCOLOR (m_reg[0x16] & 0x7f)
79#define MULTICOLOR1     (m_reg[0x17] & 0x7f)
80#define MULTICOLOR2     (m_reg[0x18] & 0x7f)
81#define FRAMECOLOR      (m_reg[0x19] & 0x7f)
82
83#define TED7360_CLOCK        (m_clock / 4)
84#define TED7360_VRETRACERATE ((m_clock == TED7360PAL_CLOCK) ? TED7360PAL_VRETRACERATE : TED7360NTSC_VRETRACERATE)
85#define TED7360_LINES        ((m_clock == TED7360PAL_CLOCK) ? TED7360PAL_LINES : TED7360NTSC_LINES)
86
87static attotime TEDTIME_IN_CYCLES(int cycles)
88{
89   double d = (double)(cycles) / clock();
90   return attotime::from_double(d);
91}
92
93static int TEDTIME_TO_CYCLES(attotime t)
94{
95   double d = t.as_double();
96   return (int)(d * clock());
97}
98
99static const UINT8 PALETTE[] =
100{
101/* black, white, red, cyan */
102/* purple, green, blue, yellow */
103/* orange, light orange, pink, light cyan, */
104/* light violett, light green, light blue, light yellow */
105/* these 16 colors are 8 times here in different luminance (dark..light) */
106/* taken from digitized tv screenshot */
107  0x06, 0x01, 0x03, 0x2b, 0x2b, 0x2b, 0x67, 0x0e, 0x0f, 0x00, 0x3f, 0x42,
108  0x57, 0x00, 0x6d, 0x00, 0x4e, 0x00, 0x19, 0x1c, 0x94, 0x38, 0x38, 0x00,
109  0x56, 0x20, 0x00, 0x4b, 0x28, 0x00, 0x16, 0x48, 0x00, 0x69, 0x07, 0x2f,
110  0x00, 0x46, 0x26, 0x06, 0x2a, 0x80, 0x2a, 0x14, 0x9b, 0x0b, 0x49, 0x00,
111
112  0x00, 0x03, 0x02, 0x3d, 0x3d, 0x3d, 0x75, 0x1e, 0x20, 0x00, 0x50, 0x4f,
113  0x6a, 0x10, 0x78, 0x04, 0x5c, 0x00, 0x2a, 0x2a, 0xa3, 0x4c, 0x47, 0x00,
114  0x69, 0x2f, 0x00, 0x59, 0x38, 0x00, 0x26, 0x56, 0x00, 0x75, 0x15, 0x41,
115  0x00, 0x58, 0x3d, 0x15, 0x3d, 0x8f, 0x39, 0x22, 0xae, 0x19, 0x59, 0x00,
116
117  0x00, 0x03, 0x04, 0x42, 0x42, 0x42, 0x7b, 0x28, 0x20, 0x02, 0x56, 0x59,
118  0x6f, 0x1a, 0x82, 0x0a, 0x65, 0x09, 0x30, 0x34, 0xa7, 0x50, 0x51, 0x00,
119  0x6e, 0x36, 0x00, 0x65, 0x40, 0x00, 0x2c, 0x5c, 0x00, 0x7d, 0x1e, 0x45,
120  0x01, 0x61, 0x45, 0x1c, 0x45, 0x99, 0x42, 0x2d, 0xad, 0x1d, 0x62, 0x00,
121
122  0x05, 0x00, 0x02, 0x56, 0x55, 0x5a, 0x90, 0x3c, 0x3b, 0x17, 0x6d, 0x72,
123  0x87, 0x2d, 0x99, 0x1f, 0x7b, 0x15, 0x46, 0x49, 0xc1, 0x66, 0x63, 0x00,
124  0x84, 0x4c, 0x0d, 0x73, 0x55, 0x00, 0x40, 0x72, 0x00, 0x91, 0x33, 0x5e,
125  0x19, 0x74, 0x5c, 0x32, 0x59, 0xae, 0x59, 0x3f, 0xc3, 0x32, 0x76, 0x00,
126
127  0x02, 0x01, 0x06, 0x84, 0x7e, 0x85, 0xbb, 0x67, 0x68, 0x45, 0x96, 0x96,
128  0xaf, 0x58, 0xc3, 0x4a, 0xa7, 0x3e, 0x73, 0x73, 0xec, 0x92, 0x8d, 0x11,
129  0xaf, 0x78, 0x32, 0xa1, 0x80, 0x20, 0x6c, 0x9e, 0x12, 0xba, 0x5f, 0x89,
130  0x46, 0x9f, 0x83, 0x61, 0x85, 0xdd, 0x84, 0x6c, 0xef, 0x5d, 0xa3, 0x29,
131
132  0x02, 0x00, 0x0a, 0xb2, 0xac, 0xb3, 0xe9, 0x92, 0x92, 0x6c, 0xc3, 0xc1,
133  0xd9, 0x86, 0xf0, 0x79, 0xd1, 0x76, 0x9d, 0xa1, 0xff, 0xbd, 0xbe, 0x40,
134  0xdc, 0xa2, 0x61, 0xd1, 0xa9, 0x4c, 0x93, 0xc8, 0x3d, 0xe9, 0x8a, 0xb1,
135  0x6f, 0xcd, 0xab, 0x8a, 0xb4, 0xff, 0xb2, 0x9a, 0xff, 0x88, 0xcb, 0x59,
136
137  0x02, 0x00, 0x0a, 0xc7, 0xca, 0xc9, 0xff, 0xac, 0xac, 0x85, 0xd8, 0xe0,
138  0xf3, 0x9c, 0xff, 0x92, 0xea, 0x8a, 0xb7, 0xba, 0xff, 0xd6, 0xd3, 0x5b,
139  0xf3, 0xbe, 0x79, 0xe6, 0xc5, 0x65, 0xb0, 0xe0, 0x57, 0xff, 0xa4, 0xcf,
140  0x89, 0xe5, 0xc8, 0xa4, 0xca, 0xff, 0xca, 0xb3, 0xff, 0xa2, 0xe5, 0x7a,
141
142  0x01, 0x01, 0x01, 0xff, 0xff, 0xff, 0xff, 0xf6, 0xf2, 0xd1, 0xff, 0xff,
143  0xff, 0xe9, 0xff, 0xdb, 0xff, 0xd3, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xa3,
144  0xff, 0xff, 0xc1, 0xff, 0xff, 0xb2, 0xfc, 0xff, 0xa2, 0xff, 0xee, 0xff,
145  0xd1, 0xff, 0xff, 0xeb, 0xff, 0xff, 0xff, 0xf8, 0xff, 0xed, 0xff, 0xbc
146};
147
148
149#define NOISE_BUFFER_SIZE_SEC 5
150
151#define TONE_ON         (!(m_reg[0x11] & 0x80))      /* or tone update!? */
152#define TONE1_ON        ((m_reg[0x11] & 0x10))
153#define TONE1_VALUE     (m_reg[0x0e] | ((m_reg[0x12] & 3) << 8))
154#define TONE2_ON        ((m_reg[0x11] & 0x20))
155#define TONE2_VALUE     (m_reg[0x0f] | ((m_reg[0x10] & 3) << 8))
156#define VOLUME          (m_reg[0x11] & 0x0f)
157#define NOISE_ON        (m_reg[0x11] & 0x40)
158
159/*
160 * pal 111860.781
161 * ntsc 111840.45
162 */
163#define TONE_FREQUENCY(reg)         ((TED7360_CLOCK >> 3) / (1024 - reg))
164#define TONE_FREQUENCY_MIN          (TONE_FREQUENCY(0))
165#define NOISE_FREQUENCY             (TED7360_CLOCK / 8 / (1024 - TONE2_VALUE))
166#define NOISE_FREQUENCY_MAX         (TED7360_CLOCK / 8)
167
168
169//**************************************************************************
170//  GLOBAL VARIABLES
171//**************************************************************************
172
173// device type definition
174const device_type MOS7360 = &device_creator<mos7360_device>;
175
176
177
178//**************************************************************************
179//  INLINE HELPERS
180//**************************************************************************
181
182inline void mos7360_device::set_interrupt(int mask)
183{
184   /* kernel itself polls for timer 2 shot (interrupt disabled!) when cassette loading */
185   m_reg[9] |= mask;
186   if ((m_reg[0xa] & m_reg[9] & 0x5e))
187   {
188      if (!(m_reg[9] & 0x80))
189      {
190         //DBG_LOG(1, "ted7360", ("irq start %.2x\n", mask));
191         m_reg[9] |= 0x80;
192         m_out_irq_func(ASSERT_LINE);
193      }
194   }
195   m_reg[9] |= mask;
196}
197
198inline void mos7360_device::clear_interrupt(int mask)
199{
200   m_reg[9] &= ~mask;
201   if ((m_reg[9] & 0x80) && !(m_reg[9] & m_reg[0xa] & 0x5e))
202   {
203      DBG_LOG(1, "ted7360", ("irq end %.2x\n", mask));
204      m_reg[9] &= ~0x80;
205      m_out_irq_func(CLEAR_LINE);
206   }
207}
208
209inline int mos7360_device::rastercolumn()
210{
211   return (int) ((machine().time().as_double() - m_rastertime) * TED7360_VRETRACERATE * m_lines * 57 * 8 + 0.5);
212}
213
214
215
216//**************************************************************************
217//  LIVE DEVICE
218//**************************************************************************
219
220//-------------------------------------------------
221//  mos7360_device - constructor
222//-------------------------------------------------
223
224mos7360_device::mos7360_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
225   : device_t(mconfig, MOS7360, "MOS7360", tag, owner, clock),
226     device_sound_interface(mconfig, *this),
227     m_stream(NULL)
228{
229}
230
231
232//-------------------------------------------------
233//  device_config_complete - perform any
234//  operations now that the configuration is
235//  complete
236//-------------------------------------------------
237
238void mos7360_device::device_config_complete()
239{
240   // inherit a copy of the static data
241   const mos7360_interface *intf = reinterpret_cast<const mos7360_interface *>(static_config());
242   if (intf != NULL)
243      *static_cast<mos7360_interface *>(this) = *intf;
244
245   // or initialize to defaults if none provided
246   else
247   {
248      memset(&m_out_irq_cb, 0, sizeof(m_out_irq_cb));
249      memset(&m_in_ram_cb, 0, sizeof(m_in_ram_cb));
250      memset(&m_in_rom_cb, 0, sizeof(m_in_rom_cb));
251      memset(&m_in_k_cb, 0, sizeof(m_in_k_cb));
252   }
253}
254
255
256//-------------------------------------------------
257//  device_start - device-specific startup
258//-------------------------------------------------
259
260void mos7360_device::device_start()
261{
262   // get the screen device
263   m_screen = machine().device<screen_device>(m_screen_tag);
264   assert(m_screen != NULL);
265
266   // get the CPU device
267   m_cpu = machine().device<cpu_device>(m_cpu_tag);
268   assert(m_cpu != NULL);
269
270   // resolve callbacks
271   m_out_irq_func.resolve(m_out_irq_cb, *this);
272   m_in_ram_func.resolve(m_in_ram_cb, *this);
273   m_in_rom_func.resolve(m_in_rom_cb, *this);
274   m_in_k_func.resolve(m_in_k_cb, *this);
275
276   // allocate timers
277   m_timer1 = timer_alloc(TIMER_ID_1);
278   m_timer2 = timer_alloc(TIMER_ID_2);
279   m_timer3 = timer_alloc(TIMER_ID_3);
280
281   // initialize palette
282   initialize_palette();
283
284   // allocate screen bitmap
285   m_screen->register_screen_bitmap(m_bitmap);
286
287   // create sound stream
288   m_stream = machine().sound().stream_alloc(*this, 0, 1, machine().sample_rate());
289
290   // buffer for fastest played sample for 5 second so we have enough data for min 5 second
291   m_noisesize = NOISE_FREQUENCY_MAX * NOISE_BUFFER_SIZE_SEC;
292   m_noise = auto_alloc_array(machine(), UINT8, m_noisesize);
293
294   {
295      int noiseshift = 0x7ffff8;
296      UINT8 data;
297
298      for (int i = 0; i < m_noisesize; i++)
299      {
300         data = 0;
301         if (noiseshift & 0x400000)
302            data |= 0x80;
303         if (noiseshift & 0x100000)
304            data |= 0x40;
305         if (noiseshift & 0x010000)
306            data |= 0x20;
307         if (noiseshift & 0x002000)
308            data |= 0x10;
309         if (noiseshift & 0x000800)
310            data |= 0x08;
311         if (noiseshift & 0x000080)
312            data |= 0x04;
313         if (noiseshift & 0x000010)
314            data |= 0x02;
315         if (noiseshift & 0x000004)
316            data |= 0x01;
317         m_noise[i] = data;
318         if (((noiseshift & 0x400000) == 0) != ((noiseshift & 0x002000) == 0))
319            noiseshift = (noiseshift << 1) | 1;
320         else
321            noiseshift <<= 1;
322      }
323   }
324
325   // register for state saving
326   //save_item(NAME());
327}
328
329
330//-------------------------------------------------
331//  device_reset - device-specific reset
332//-------------------------------------------------
333
334void mos7360_device::device_reset()
335{
336   memset(m_reg, 0, ARRAY_LENGTH(m_reg));
337
338   m_rom = 1;   // FIXME: at start should be RAM or ROM? old c16 code set it to ROM at init: is it correct?
339
340   m_lines = TED7360_LINES;
341   m_chargenaddr = m_bitmapaddr = m_videoaddr = 0;
342   m_timer1_active = m_timer2_active = m_timer3_active = 0;
343   m_cursor1 = 0;
344
345   m_rasterline = 0;
346   m_lastline = 0;
347
348   m_rastertime = 0.0;
349
350   m_frame_count = 0;
351
352   m_x_begin = 0;
353   m_x_end = 0;
354   m_y_begin = 0;
355   m_y_end = 0;
356
357   memset(m_c16_bitmap, 0, ARRAY_LENGTH(m_c16_bitmap));
358   memset(m_bitmapmulti, 0, ARRAY_LENGTH(m_bitmapmulti));
359   memset(m_mono, 0, ARRAY_LENGTH(m_mono));
360   memset(m_monoinversed, 0, ARRAY_LENGTH(m_monoinversed));
361   memset(m_multi, 0, ARRAY_LENGTH(m_multi));
362   memset(m_ecmcolor, 0, ARRAY_LENGTH(m_ecmcolor));
363   memset(m_colors, 0, ARRAY_LENGTH(m_colors));
364
365   m_tone1pos = 0;
366   m_tone2pos = 0;
367   m_tone1samples = 1;
368   m_tone2samples = 1;
369   m_noisepos = 0;
370   m_noisesamples = 1;
371}
372
373
374//-------------------------------------------------
375//  device_timer - handler timer events
376//-------------------------------------------------
377
378void mos7360_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
379{
380   switch (id)
381   {
382   case TIMER_ID_1:
383      // proved by digisound of several intros like eoroidpro
384      m_timer1->adjust(TEDTIME_IN_CYCLES(TIMER1), 1);
385      m_timer1_active = 1;
386      set_interrupt(0x08);
387      break;
388
389   case TIMER_ID_2:
390      m_timer2->adjust(TEDTIME_IN_CYCLES(0x10000), 2);
391      m_timer2_active = 1;
392      set_interrupt(0x10);
393      break;
394
395   case TIMER_ID_3:
396      m_timer3->adjust(TEDTIME_IN_CYCLES(0x10000), 3);
397      m_timer3_active = 1;
398      set_interrupt(0x40);
399      break;
400   }
401}
402
403
404//-------------------------------------------------
405//  initialize_palette - initialize palette
406//-------------------------------------------------
407
408void mos7360_device::initialize_palette()
409{
410   int i;
411
412   for (i = 0; i < sizeof(PALETTE) / 3; i++)
413      palette_set_color_rgb(machine(), i, PALETTE[i * 3], PALETTE[i * 3 + 1], PALETTE[i * 3 + 2]);
414}
415
416
417//-------------------------------------------------
418//  sound_stream_update - handle update requests for
419//  our sound stream
420//-------------------------------------------------
421
422void mos7360_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
423{
424   int i, v, a;
425   stream_sample_t *buffer = outputs[0];
426
427   for (i = 0; i < samples; i++)
428   {
429      v = 0;
430
431      if (TONE1_ON)
432      {
433         if (m_tone1pos <= m_tone1samples / 2 || !TONE_ON)
434            v += 0x2ff; // depends on the volume between sound and noise
435
436         m_tone1pos++;
437
438         if (m_tone1pos > m_tone1samples)
439            m_tone1pos = 0;
440      }
441
442      if (TONE2_ON || NOISE_ON )
443      {
444         if (TONE2_ON)
445         {                     /*higher priority ?! */
446            if (m_tone2pos <= m_tone2samples / 2 || !TONE_ON)
447               v += 0x2ff;
448
449            m_tone2pos++;
450
451            if (m_tone2pos > m_tone2samples)
452               m_tone2pos = 0;
453         }
454         else
455         {
456            v += m_noise[(int) ((double) m_noisepos * m_noisesize / m_noisesamples)];
457            m_noisepos++;
458
459            if ((double) m_noisepos / m_noisesamples >= 1.0)
460               m_noisepos = 0;
461         }
462      }
463
464      a = VOLUME;
465      if (a > 8)
466         a = 8;
467
468      v = v * a;
469
470      buffer[i] = v;
471   }
472}
473
474
475void mos7360_device::draw_character(int ybegin, int yend, int ch, int yoff, int xoff, UINT16 *color)
476{
477   int y, code;
478
479   for (y = ybegin; y <= yend; y++)
480   {
481      if (INROM)
482         code = m_in_rom_func(m_chargenaddr + ch * 8 + y);
483      else
484         code = m_in_ram_func(m_chargenaddr + ch * 8 + y);
485
486      m_bitmap.pix16(y + yoff, 0 + xoff) = color[code >> 7];
487      m_bitmap.pix16(y + yoff, 1 + xoff) = color[(code >> 6) & 1];
488      m_bitmap.pix16(y + yoff, 2 + xoff) = color[(code >> 5) & 1];
489      m_bitmap.pix16(y + yoff, 3 + xoff) = color[(code >> 4) & 1];
490      m_bitmap.pix16(y + yoff, 4 + xoff) = color[(code >> 3) & 1];
491      m_bitmap.pix16(y + yoff, 5 + xoff) = color[(code >> 2) & 1];
492      m_bitmap.pix16(y + yoff, 6 + xoff) = color[(code >> 1) & 1];
493      m_bitmap.pix16(y + yoff, 7 + xoff) = color[code & 1];
494   }
495}
496
497void mos7360_device::draw_character_multi(int ybegin, int yend, int ch, int yoff, int xoff)
498{
499   int y, code;
500
501   for (y = ybegin; y <= yend; y++)
502   {
503      if (INROM)
504         code = m_in_rom_func(m_chargenaddr + ch * 8 + y);
505      else
506         code = m_in_ram_func(m_chargenaddr + ch * 8 + y);
507
508      m_bitmap.pix16(y + yoff, 0 + xoff) =
509         m_bitmap.pix16(y + yoff, 1 + xoff) = m_multi[code >> 6];
510      m_bitmap.pix16(y + yoff, 2 + xoff) =
511         m_bitmap.pix16(y + yoff, 3 + xoff) = m_multi[(code >> 4) & 3];
512      m_bitmap.pix16(y + yoff, 4 + xoff) =
513         m_bitmap.pix16(y + yoff, 5 + xoff) = m_multi[(code >> 2) & 3];
514      m_bitmap.pix16(y + yoff, 6 + xoff) =
515         m_bitmap.pix16(y + yoff, 7 + xoff) = m_multi[code & 3];
516   }
517}
518
519void mos7360_device::draw_bitmap(int ybegin, int yend, int ch, int yoff, int xoff)
520{
521   int y, code;
522
523   for (y = ybegin; y <= yend; y++)
524   {
525      code = m_in_ram_func(m_bitmapaddr + ch * 8 + y);
526      m_bitmap.pix16(y + yoff, 0 + xoff) = m_c16_bitmap[code >> 7];
527      m_bitmap.pix16(y + yoff, 1 + xoff) = m_c16_bitmap[(code >> 6) & 1];
528      m_bitmap.pix16(y + yoff, 2 + xoff) = m_c16_bitmap[(code >> 5) & 1];
529      m_bitmap.pix16(y + yoff, 3 + xoff) = m_c16_bitmap[(code >> 4) & 1];
530      m_bitmap.pix16(y + yoff, 4 + xoff) = m_c16_bitmap[(code >> 3) & 1];
531      m_bitmap.pix16(y + yoff, 5 + xoff) = m_c16_bitmap[(code >> 2) & 1];
532      m_bitmap.pix16(y + yoff, 6 + xoff) = m_c16_bitmap[(code >> 1) & 1];
533      m_bitmap.pix16(y + yoff, 7 + xoff) = m_c16_bitmap[code & 1];
534   }
535}
536
537void mos7360_device::draw_bitmap_multi(int ybegin, int yend, int ch, int yoff, int xoff)
538{
539   int y, code;
540
541   for (y = ybegin; y <= yend; y++)
542   {
543      code = m_in_ram_func(m_bitmapaddr + ch * 8 + y);
544
545      m_bitmap.pix16(y + yoff, 0 + xoff) =
546         m_bitmap.pix16(y + yoff, 1 + xoff) = m_bitmapmulti[code >> 6];
547      m_bitmap.pix16(y + yoff, 2 + xoff) =
548         m_bitmap.pix16(y + yoff, 3 + xoff) = m_bitmapmulti[(code >> 4) & 3];
549      m_bitmap.pix16(y + yoff, 4 + xoff) =
550         m_bitmap.pix16(y + yoff, 5 + xoff) = m_bitmapmulti[(code >> 2) & 3];
551      m_bitmap.pix16(y + yoff, 6 + xoff) =
552         m_bitmap.pix16(y + yoff, 7 + xoff) = m_bitmapmulti[code & 3];
553   }
554}
555
556#ifndef memset16
557static void *memset16 (void *dest, int value, size_t size)
558{
559   register int i;
560
561   for (i = 0; i < size; i++)
562      ((short *) dest)[i] = value;
563   return dest;
564}
565#endif
566
567void mos7360_device::draw_cursor(int ybegin, int yend, int yoff, int xoff, int color)
568{
569   int y;
570
571   for (y = ybegin; y <= yend; y++)
572   {
573      memset16(&m_bitmap.pix16(yoff + y, xoff), color, 8);
574   }
575}
576
577void mos7360_device::drawlines(int first, int last)
578{
579   int line, vline, end;
580   int attr, ch, c1, c2, ecm;
581   int offs, yoff, xoff, ybegin, yend, xbegin, xend;
582   int i;
583
584   m_lastline = last;
585
586   /* top part of display not rastered */
587   first -= TED7360_YPOS;
588   last -= TED7360_YPOS;
589   if ((first >= last) || (last <= 0))
590      return;
591   if (first < 0)
592      first = 0;
593
594   if (!SCREENON)
595   {
596      for (line = first; (line < last) && (line < m_bitmap.height()); line++)
597         memset16(&m_bitmap.pix16(line), 0, m_bitmap.width());
598      return;
599   }
600
601   if (COLUMNS40)
602      xbegin = XPOS, xend = xbegin + 320;
603   else
604      xbegin = XPOS + 7, xend = xbegin + 304;
605
606   if (last < m_y_begin)
607      end = last;
608   else
609      end = m_y_begin + YPOS;
610   {
611      for (line = first; line < end; line++)
612         memset16(&m_bitmap.pix16(line), FRAMECOLOR, m_bitmap.width());
613   }
614   if (LINES25)
615      vline = line - m_y_begin - YPOS;
616   else
617      vline = line - m_y_begin - YPOS + 8 - VERTICALPOS;
618
619   if (last < m_y_end + YPOS)
620      end = last;
621   else
622      end = m_y_end + YPOS;
623
624   for (; line < end; vline = (vline + 8) & ~7, line = line + 1 + yend - ybegin)
625   {
626      offs = (vline >> 3) * 40;
627      ybegin = vline & 7;
628      yoff = line - ybegin;
629      yend = (yoff + 7 < end) ? 7 : (end - yoff - 1);
630      /* rendering 39 characters */
631      /* left and right borders are overwritten later */
632
633      for (xoff = m_x_begin + XPOS; xoff < m_x_end + XPOS; xoff += 8, offs++)
634      {
635         if (HIRESON)
636         {
637            ch = m_in_ram_func((m_videoaddr | 0x400) + offs);
638            attr = m_in_ram_func(m_videoaddr + offs);
639            c1 = ((ch >> 4) & 0xf) | (attr << 4);
640            c2 = (ch & 0xf) | (attr & 0x70);
641            m_bitmapmulti[1] = m_c16_bitmap[1] = c1 & 0x7f;
642            m_bitmapmulti[2] = m_c16_bitmap[0] = c2 & 0x7f;
643            if (MULTICOLORON)
644            {
645               draw_bitmap_multi(ybegin, yend, offs, yoff, xoff);
646            }
647            else
648            {
649               draw_bitmap(ybegin, yend, offs, yoff, xoff);
650            }
651         }
652         else
653         {
654            ch = m_in_ram_func((m_videoaddr | 0x400) + offs);
655            attr = m_in_ram_func(m_videoaddr + offs);
656            // levente harsfalvi's docu says cursor off in ecm and multicolor
657            if (ECMON)
658            {
659               // hardware reverse off
660               ecm = ch >> 6;
661               m_ecmcolor[0] = m_colors[ecm];
662               m_ecmcolor[1] = attr & 0x7f;
663               draw_character(ybegin, yend, ch & ~0xc0, yoff, xoff, m_ecmcolor);
664            }
665            else if (MULTICOLORON)
666            {
667               // hardware reverse off
668               if (attr & 8)
669               {
670                  m_multi[3] = attr & 0x77;
671                  draw_character_multi(ybegin, yend, ch, yoff, xoff);
672               }
673               else
674               {
675                  m_mono[1] = attr & 0x7f;
676                  draw_character(ybegin, yend, ch, yoff, xoff, m_mono);
677               }
678            }
679            else if (m_cursor1 && (offs == CURSOR1POS))
680            {
681               draw_cursor(ybegin, yend, yoff, xoff, attr & 0x7f);
682            }
683            else if (REVERSEON && (ch & 0x80))
684            {
685               m_monoinversed[0] = attr & 0x7f;
686               if (m_cursor1 && (attr & 0x80))
687                  draw_cursor(ybegin, yend, yoff, xoff, m_monoinversed[0]);
688               else
689                  draw_character(ybegin, yend, ch & ~0x80, yoff, xoff, m_monoinversed);
690            }
691            else
692            {
693               m_mono[1] = attr & 0x7f;
694               if (m_cursor1 && (attr & 0x80))
695                  draw_cursor(ybegin, yend, yoff, xoff, m_mono[0]);
696               else
697                  draw_character(ybegin, yend, ch, yoff, xoff, m_mono);
698            }
699         }
700      }
701
702      for (i = ybegin; i <= yend; i++)
703      {
704         memset16(&m_bitmap.pix16(yoff + i), FRAMECOLOR, xbegin);
705         memset16(&m_bitmap.pix16(yoff + i, xend), FRAMECOLOR, m_bitmap.width() - xend);
706      }
707   }
708
709   if (last < m_bitmap.height())
710      end = last;
711   else
712      end = m_bitmap.height();
713
714   for (; line < end; line++)
715   {
716      memset16(&m_bitmap.pix16(line), FRAMECOLOR, m_bitmap.width());
717   }
718}
719
720void mos7360_device::soundport_w(int offset, int data)
721{
722   // int old = m_reg[offset];
723   m_stream->update();
724
725   switch (offset)
726   {
727   case 0x0e:
728   case 0x12:
729      if (offset == 0x12)
730         m_reg[offset] = (m_reg[offset] & ~3) | (data & 3);
731      else
732         m_reg[offset] = data;
733
734      m_tone1samples = machine().sample_rate() / TONE_FREQUENCY (TONE1_VALUE);
735      DBG_LOG(1, "ted7360", ("tone1 %d %d sample:%d\n", TONE1_VALUE, TONE_FREQUENCY(TONE1_VALUE), m_tone1samples));
736      break;
737
738   case 0xf:
739   case 0x10:
740      m_reg[offset] = data;
741
742      m_tone2samples = machine().sample_rate() / TONE_FREQUENCY (TONE2_VALUE);
743      DBG_LOG (1, "ted7360", ("tone2 %d %d sample:%d\n", TONE2_VALUE, TONE_FREQUENCY(TONE2_VALUE), m_tone2samples));
744
745      m_noisesamples = (int) ((double) NOISE_FREQUENCY_MAX * machine().sample_rate() * NOISE_BUFFER_SIZE_SEC / NOISE_FREQUENCY);
746      DBG_LOG (1, "ted7360", ("noise %d sample:%d\n", NOISE_FREQUENCY, m_noisesamples));
747
748      if (!NOISE_ON || ((double) m_noisepos / m_noisesamples >= 1.0))
749         m_noisepos = 0;
750      break;
751
752   case 0x11:
753      m_reg[offset] = data;
754      DBG_LOG(1, "ted7360", ("%s volume %d, %s %s %s\n", TONE_ON?"on":"off",
755                   VOLUME, TONE1_ON?"tone1":"", TONE2_ON?"tone2":"", NOISE_ON?"noise":""));
756
757      if (!TONE_ON||!TONE1_ON) m_tone1pos = 0;
758      if (!TONE_ON||!TONE2_ON) m_tone2pos = 0;
759      if (!TONE_ON||!NOISE_ON) m_noisepos = 0;
760      break;
761   }
762}
763
764
765//-------------------------------------------------
766//  read - register read
767//-------------------------------------------------
768
769READ8_MEMBER( mos7360_device::read )
770{
771   int val = 0;
772
773   switch (offset)
774   {
775   case 0:
776      if (m_timer1)
777         val = TEDTIME_TO_CYCLES(m_timer1->remaining()) & 0xff;
778      else
779         val = m_reg[offset];
780      break;
781   case 1:
782      if (m_timer1)
783         val = TEDTIME_TO_CYCLES(m_timer1->remaining()) >> 8;
784      else
785         val = m_reg[offset];
786      break;
787   case 2:
788      if (m_timer2)
789         val = TEDTIME_TO_CYCLES(m_timer2->remaining()) & 0xff;
790      else
791         val = m_reg[offset];
792      break;
793   case 3:
794      if (m_timer2)
795         val = TEDTIME_TO_CYCLES(m_timer2->remaining()) >> 8;
796      else
797         val = m_reg[offset];
798      break;
799   case 4:
800      if (m_timer3)
801         val = TEDTIME_TO_CYCLES(m_timer3->remaining()) & 0xff;
802      else
803         val = m_reg[offset];
804      break;
805   case 5:
806      if (m_timer3)
807         val = TEDTIME_TO_CYCLES(m_timer3->remaining()) >> 8;
808      else
809         val = m_reg[offset];
810      break;
811   case 7:
812      val = (m_reg[offset] & ~0x40);
813      if (m_clock == TED7360NTSC_CLOCK)
814         val |= 0x40;
815      break;
816   case 9:
817      val = m_reg[offset] | 1;
818      break;
819   case 0xa:
820      val = m_reg[offset];
821      break;
822   case 0xb:
823      val = m_reg[offset];
824      break;
825   case 0x0c:
826      val = m_reg[offset] |= 0xfc;
827      break;
828   case 0x13:
829      val = m_reg[offset] & ~1;
830      if (m_rom)
831         val |= 1;
832      break;
833   case 0x1c:                     /*rasterline */
834      drawlines(m_lastline, m_rasterline);
835      val = ((RASTERLINE_2_C16(m_rasterline) & 0x100) >> 8) | 0xfe;   /* expected by matrix */
836      break;
837   case 0x1d:                     /*rasterline */
838      drawlines(m_lastline, m_rasterline);
839      val = RASTERLINE_2_C16(m_rasterline) & 0xff;
840      break;
841   case 0x1e:                     /*rastercolumn */
842      val = rastercolumn() / 2;   /* pengo >=0x99 */
843      break;
844   case 0x1f:
845      val = ((m_rasterline & 7) << 4) | (m_reg[offset] & 0x0f);
846      DBG_LOG(1, "port_w", ("read from cursorblink %.2x\n", val));
847      break;
848   default:
849      val = m_reg[offset];
850      break;
851   }
852
853   if ((offset != 8) && (offset >= 6) && (offset != 0x1c) && (offset != 0x1d) && (offset != 9) && ((offset < 0x15) || (offset > 0x19)))
854   {
855      DBG_LOG(1, "port_r", ("%.2x:%.2x\n", offset, val));
856   }
857
858   return val;
859}
860
861
862//-------------------------------------------------
863//  write - register write
864//-------------------------------------------------
865
866WRITE8_MEMBER( mos7360_device::write )
867{
868   int old;
869
870   if ((offset != 8) && ((offset < 0x15) || (offset > 0x19)))
871   {
872      DBG_LOG(1, "port_w", ("%.2x:%.2x\n", offset, data));
873   }
874
875   switch (offset)
876   {
877   case 0xe:
878   case 0xf:
879   case 0x10:
880   case 0x11:
881   case 0x12:
882      soundport_w(offset, data);
883      break;
884   }
885   switch (offset)
886   {
887   case 0:                     /* stop timer 1 */
888      m_reg[offset] = data;
889
890      if (m_timer1_active)
891      {
892         m_reg[1] = TEDTIME_TO_CYCLES(m_timer1->remaining()) >> 8;
893         m_timer1->reset();
894         m_timer1_active = 0;
895      }
896      break;
897   case 1:                     /* start timer 1 */
898      m_reg[offset] = data;
899      m_timer1->adjust(TEDTIME_IN_CYCLES(TIMER1), 1);
900      m_timer1_active = 1;
901      break;
902   case 2:                     /* stop timer 2 */
903      m_reg[offset] = data;
904      if (m_timer2_active)
905      {
906         m_reg[3] = TEDTIME_TO_CYCLES(m_timer2->remaining()) >> 8;
907         m_timer2->reset();
908         m_timer2_active = 0;
909      }
910      break;
911   case 3:                     /* start timer 2 */
912      m_reg[offset] = data;
913      m_timer2->adjust(TEDTIME_IN_CYCLES(TIMER2), 2);
914      m_timer2_active = 1;
915      break;
916   case 4:                     /* stop timer 3 */
917      m_reg[offset] = data;
918      if (m_timer3_active)
919      {
920         m_reg[5] = TEDTIME_TO_CYCLES(m_timer3->remaining()) >> 8;
921         m_timer3->reset();
922         m_timer3_active = 0;
923      }
924      break;
925   case 5:                     /* start timer 3 */
926      m_reg[offset] = data;
927      m_timer3->adjust(TEDTIME_IN_CYCLES(TIMER3), 3);
928      m_timer3_active = 1;
929      break;
930   case 6:
931      if (m_reg[offset] != data)
932      {
933         drawlines(m_lastline, m_rasterline);
934         m_reg[offset] = data;
935         if (LINES25)
936         {
937            m_y_begin = 0;
938            m_y_end = m_y_begin + 200;
939         }
940         else
941         {
942            m_y_begin = 4;
943            m_y_end = m_y_begin + 192;
944         }
945         m_chargenaddr = CHARGENADDR;
946      }
947      break;
948   case 7:
949      if (m_reg[offset] != data)
950      {
951         drawlines(m_lastline, m_rasterline);
952         m_reg[offset] = data;
953         if (COLUMNS40)
954         {
955            m_x_begin = 0;
956            m_x_end = m_x_begin + 320;
957         }
958         else
959         {
960            m_x_begin = HORICONTALPOS;
961            m_x_end = m_x_begin + 320;
962         }
963         DBG_LOG(3, "port_w", ("%s %s\n", data & 0x40 ? "ntsc" : "pal", data & 0x20 ? "hori freeze" : ""));
964         m_chargenaddr = CHARGENADDR;
965      }
966      break;
967   case 8:
968      m_reg[offset] = m_in_k_func(data);
969      break;
970   case 9:
971      if (data & 0x08)
972         clear_interrupt(8);
973      if (data & 0x10)
974         clear_interrupt(0x10);
975      if (data & 0x40)
976         clear_interrupt(0x40);
977      if (data & 0x02)
978         clear_interrupt(2);
979      break;
980   case 0xa:
981      old = data;
982      m_reg[offset] = data | 0xa0;
983#if 0
984      m_reg[9] = (m_reg[9] & 0xa1) | (m_reg[9] & data & 0x5e);
985      if (m_reg[9] & 0x80)
986         clear_interrupt(0);
987#endif
988      if ((data ^ old) & 1)
989      {
990         /* DBG_LOG(1,"set rasterline hi",("soll:%d\n",RASTERLINE)); */
991      }
992      break;
993   case 0xb:
994      if (data != m_reg[offset])
995      {
996         drawlines(m_lastline, m_rasterline);
997         m_reg[offset] = data;
998         /*  DBG_LOG(1,"set rasterline lo",("soll:%d\n",RASTERLINE)); */
999      }
1000      break;
1001   case 0xc:
1002   case 0xd:
1003      if (m_reg[offset] != data)
1004      {
1005         drawlines(m_lastline, m_rasterline);
1006         m_reg[offset] = data;
1007      }
1008      break;
1009   case 0x12:
1010      if (m_reg[offset] != data)
1011      {
1012         drawlines(m_lastline, m_rasterline);
1013         m_reg[offset] = data;
1014         m_bitmapaddr = BITMAPADDR;
1015         m_chargenaddr = CHARGENADDR;
1016         DBG_LOG(3, "port_w", ("bitmap %.4x %s\n",  BITMAPADDR, INROM ? "rom" : "ram"));
1017      }
1018      break;
1019   case 0x13:
1020      if (m_reg[offset] != data)
1021      {
1022         drawlines(m_lastline, m_rasterline);
1023         m_reg[offset] = data;
1024         m_chargenaddr = CHARGENADDR;
1025         DBG_LOG(3, "port_w", ("chargen %.4x %s %d\n", CHARGENADDR, data & 2 ? "" : "doubleclock", data & 1));
1026      }
1027      break;
1028   case 0x14:
1029      if (m_reg[offset] != data)
1030      {
1031         drawlines(m_lastline, m_rasterline);
1032         m_reg[offset] = data;
1033         m_videoaddr = VIDEOADDR;
1034         DBG_LOG(3, "port_w", ("videoram %.4x\n", VIDEOADDR));
1035      }
1036      break;
1037   case 0x15:                     /* backgroundcolor */
1038      if (m_reg[offset] != data)
1039      {
1040         drawlines(m_lastline, m_rasterline);
1041         m_reg[offset] = data;
1042         m_monoinversed[1] = m_mono[0] = m_bitmapmulti[0] = m_multi[0] = m_colors[0] = BACKGROUNDCOLOR;
1043      }
1044      break;
1045   case 0x16:                     /* foregroundcolor */
1046      if (m_reg[offset] != data)
1047      {
1048         drawlines(m_lastline, m_rasterline);
1049         m_reg[offset] = data;
1050         m_bitmapmulti[3] = m_multi[1] = m_colors[1] = FOREGROUNDCOLOR;
1051      }
1052      break;
1053   case 0x17:                     /* multicolor 1 */
1054      if (m_reg[offset] != data)
1055      {
1056         drawlines(m_lastline, m_rasterline);
1057         m_reg[offset] = data;
1058         m_multi[2] = m_colors[2] = MULTICOLOR1;
1059      }
1060      break;
1061   case 0x18:                     /* multicolor 2 */
1062      if (m_reg[offset] != data)
1063      {
1064         drawlines(m_lastline, m_rasterline);
1065         m_reg[offset] = data;
1066         m_colors[3] = MULTICOLOR2;
1067      }
1068      break;
1069   case 0x19:                     /* framecolor */
1070      if (m_reg[offset] != data)
1071      {
1072         drawlines(m_lastline, m_rasterline);
1073         m_reg[offset] = data;
1074         m_colors[4] = FRAMECOLOR;
1075      }
1076      break;
1077   case 0x1c:
1078      m_reg[offset] = data;         /*? */
1079      DBG_LOG(1, "port_w", ("write to rasterline high %.2x\n",
1080                              data));
1081      break;
1082   case 0x1f:
1083      m_reg[offset] = data;
1084      DBG_LOG(1, "port_w", ("write to cursorblink %.2x\n", data));
1085      break;
1086   default:
1087      m_reg[offset] = data;
1088      break;
1089   }
1090}
1091
1092
1093//-------------------------------------------------
1094//  update_screen - update screen
1095//-------------------------------------------------
1096
1097UINT32 mos7360_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
1098{
1099   copybitmap(bitmap, m_bitmap, 0, 0, 0, 0, cliprect);
1100
1101   return 0;
1102}
1103
1104WRITE_LINE_MEMBER( mos7360_device::rom_switch_w )
1105{
1106   m_rom = state;
1107}
1108
1109READ_LINE_MEMBER( mos7360_device::rom_switch_r )
1110{
1111   return m_rom;
1112}
1113
1114void mos7360_device::frame_interrupt_gen()
1115{
1116   if ((m_reg[0x1f] & 0xf) >= 0x0f)
1117   {
1118      /*  if (m_frame_count >= CURSORRATE) */
1119      m_cursor1 ^= 1;
1120      m_reg[0x1f] &= ~0xf;
1121      m_frame_count = 0;
1122   }
1123   else
1124      m_reg[0x1f]++;
1125}
1126
1127void mos7360_device::raster_interrupt_gen()
1128{
1129   m_rasterline++;
1130   m_rastertime = machine().time().as_double();
1131   if (m_rasterline >= m_lines)
1132   {
1133      m_rasterline = 0;
1134      drawlines(m_lastline, TED7360_LINES);
1135      m_lastline = 0;
1136   }
1137
1138   if (m_rasterline == C16_2_RASTERLINE(RASTERLINE))
1139   {
1140      drawlines(m_lastline, m_rasterline);
1141      set_interrupt(2);
1142   }
1143}
src/mess/audio/mos7360.h
r0r15841
1/***************************************************************************
2
3    MOS 7360/8360 Text Edit Device (TED) emulation
4
5    Copyright the MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7
8****************************************************************************
9                            _____   _____
10                   DB6   1 |*    \_/     | 40  Vcc
11                   DB5   2 |             | 39  DB7
12                   DB4   3 |             | 38  DB8
13                   DB3   4 |             | 37  DB9
14                   DB2   5 |             | 36  DB10
15                   DB1   6 |             | 35  DB11
16                   DB0   7 |             | 34  A13
17                  _IRQ   8 |             | 33  A12
18                    LP   9 |             | 32  A11
19                   _CS  10 |   MOS7360   | 31  A10
20                   R/W  11 |             | 30  A9
21                    BA  12 |             | 29  A8
22                   Vdd  13 |             | 28  A7
23                 COLOR  14 |             | 27  A6
24                 S/LUM  15 |             | 26  A5
25                   AEC  16 |             | 25  A4
26                   PH0  17 |             | 24  A3
27                  PHIN  18 |             | 23  A2
28                 PHCOL  19 |             | 22  A1
29                   Vss  20 |_____________| 21  A0
30
31***************************************************************************/
32
33#pragma once
34
35#ifndef __MOS7360__
36#define __MOS7360__
37
38#include "emu.h"
39
40
41
42/***************************************************************************
43    DEVICE CONFIGURATION MACROS
44***************************************************************************/
45
46#define MCFG_MOS7360_ADD(_tag, _screen_tag, _clock, _config) \
47   MCFG_SCREEN_ADD(_screen_tag, RASTER) \
48   MCFG_SCREEN_REFRESH_RATE(TED7360PAL_VRETRACERATE) \
49   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) \
50   MCFG_SCREEN_SIZE(336, 216) \
51   MCFG_SCREEN_VISIBLE_AREA(0, 336 - 1, 0, 216 - 1) \
52   MCFG_SCREEN_UPDATE_DEVICE(_tag, mos7360_device, screen_update) \
53   MCFG_PALETTE_LENGTH(128) \
54   MCFG_DEVICE_ADD(_tag, MOS7360, _clock) \
55   MCFG_DEVICE_CONFIG(_config)
56
57
58#define MOS7360_INTERFACE(_name) \
59   const mos7360_interface (_name) =
60
61
62
63//**************************************************************************
64//  MACROS / CONSTANTS
65//**************************************************************************
66
67#define TED7360NTSC_VRETRACERATE 60
68#define TED7360PAL_VRETRACERATE 50
69#define TED7360_HRETRACERATE 15625
70
71/* the following values depend on the VIC clock,
72 * but to achieve TV-frequency the clock must have a fix frequency */
73#define TED7360_HSIZE   320
74#define TED7360_VSIZE   200
75
76/* of course you clock select an other clock, but for accurate */
77/* video timing (these are used in c16/c116/plus4) */
78#define TED7360NTSC_CLOCK   (14318180/4)
79#define TED7360PAL_CLOCK   (17734470/5)
80
81/* pal 50 Hz vertical screen refresh, screen consists of 312 lines
82 * ntsc 60 Hz vertical screen refresh, screen consists of 262 lines */
83#define TED7360NTSC_LINES 261
84#define TED7360PAL_LINES 312
85
86
87
88/***************************************************************************
89    TYPE DEFINITIONS
90***************************************************************************/
91
92// ======================> mos7360_interface
93
94struct mos7360_interface
95{
96   const char         *m_screen_tag;
97   const char         *m_cpu_tag;
98
99   devcb_write_line   m_out_irq_cb;
100
101   devcb_read8         m_in_ram_cb;
102   devcb_read8         m_in_rom_cb;
103   devcb_read8         m_in_k_cb;
104};
105
106
107// ======================> mos7360_device
108
109class mos7360_device :  public device_t,
110                   public device_sound_interface,
111                   public mos7360_interface
112{
113public:
114   // construction/destruction
115   //mos7360_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
116   mos7360_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
117
118   DECLARE_READ8_MEMBER( read );
119   DECLARE_WRITE8_MEMBER( write );
120
121   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
122
123   // horrible crap code
124   WRITE_LINE_MEMBER( rom_switch_w );
125   READ_LINE_MEMBER( rom_switch_r );
126   void frame_interrupt_gen();
127   void raster_interrupt_gen();
128
129protected:
130   enum
131   {
132      TYPE_7360
133   };
134
135   enum
136   {
137      TIMER_ID_1,
138      TIMER_ID_2,
139      TIMER_ID_3
140   };
141
142   // device-level overrides
143   virtual void device_config_complete();
144   virtual void device_start();
145   virtual void device_reset();
146   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
147
148   // device_sound_interface callbacks
149   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
150
151   inline void set_interrupt(int mask);
152   inline void clear_interrupt(int mask);
153   inline int rastercolumn();
154
155   void initialize_palette();
156   void draw_character(int ybegin, int yend, int ch, int yoff, int xoff, UINT16 *color);
157   void draw_character_multi(int ybegin, int yend, int ch, int yoff, int xoff);
158   void draw_bitmap(int ybegin, int yend, int ch, int yoff, int xoff);
159   void draw_bitmap_multi(int ybegin, int yend, int ch, int yoff, int xoff);
160   void draw_cursor(int ybegin, int yend, int yoff, int xoff, int color);
161   void drawlines(int first, int last);
162   void soundport_w(int offset, int data);
163
164   devcb_resolved_write_line   m_out_irq_func;
165   devcb_resolved_read8      m_in_ram_func;
166   devcb_resolved_read8      m_in_rom_func;
167   devcb_resolved_read8      m_in_k_func;
168
169   screen_device *m_screen;         // screen which sets bitmap properties
170   cpu_device *m_cpu;
171   sound_stream *m_stream;
172
173   UINT8 m_reg[0x20];
174
175   bitmap_ind16 m_bitmap;
176
177   int m_rom;
178
179   int m_frame_count;
180
181   int m_lines;
182   int m_timer1_active, m_timer2_active, m_timer3_active;
183   emu_timer *m_timer1, *m_timer2, *m_timer3;
184   int m_cursor1;
185
186   int m_chargenaddr, m_bitmapaddr, m_videoaddr;
187
188   int m_x_begin, m_x_end;
189   int m_y_begin, m_y_end;
190
191   UINT16 m_c16_bitmap[2], m_bitmapmulti[4], m_mono[2], m_monoinversed[2], m_multi[4], m_ecmcolor[2], m_colors[5];
192
193   int m_rasterline, m_lastline;
194   double m_rastertime;
195
196   /* sound part */
197   UINT8 *m_noise;
198   int m_tone1pos, m_tone2pos,
199   m_tone1samples, m_tone2samples,
200   m_noisesize,        /* number of samples */
201   m_noisepos,         /* pos of tone */
202   m_noisesamples;     /* count of samples to give out per tone */
203   
204   int m_variant;
205};
206
207
208// device type definition
209extern const device_type MOS7360;
210
211
212
213#endif
src/mess/machine/plus4exp.c
r15840r15841
238238 
239239 
240240//-------------------------------------------------
241//  device_reset - device-specific reset
242//-------------------------------------------------
243 
244void plus4_expansion_slot_device::device_reset()
245{
246   breset_w(ASSERT_LINE);
247   breset_w(CLEAR_LINE);
248}
249 
250 
251//-------------------------------------------------
241252//  call_load -
242253//-------------------------------------------------
243254 
r15840r15841
347358 
348359 
349360//-------------------------------------------------
361//  breset_w - buffered reset write
362//-------------------------------------------------
363 
364WRITE_LINE_MEMBER( plus4_expansion_slot_device::breset_w )
365{
366   if (m_cart != NULL)
367   {
368      m_cart->plus4_breset_w(state);
369   }
370}
371 
372 
373//-------------------------------------------------
350374//  dma_cd_r - DMA read
351375//-------------------------------------------------
352376 
src/mess/machine/plus4exp.h
r15840r15841
100100   UINT8 cd_r(address_space &space, offs_t offset, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h);
101101   void cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h);
102102   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
103   DECLARE_WRITE_LINE_MEMBER( breset_w );
103104 
104105   // cartridge interface
105106   UINT8 dma_cd_r(offs_t offset);
r15840r15841
113114   // device-level overrides
114115   virtual void device_config_complete();
115116   virtual void device_start();
117   virtual void device_reset();
116118 
117119   // image-level overrides
118120   virtual bool call_load();
r15840r15841
160162   virtual UINT8* plus4_ram_pointer(running_machine &machine, size_t size);
161163   virtual UINT8* plus4_nvram_pointer(running_machine &machine, size_t size);
162164 
163   // memory access
165   // runtime
164166   virtual UINT8 plus4_cd_r(address_space &space, offs_t offset, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h) { return 0; };
165167   virtual void plus4_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h) { };
166   virtual void plus4_reset_w() { };
167168   virtual UINT32 plus4_screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return 0; }
169   virtual void plus4_breset_w(int state) { };
168170 
169171protected:
170172   plus4_expansion_slot_device *m_slot;
src/mess/machine/plus4user.c
r15840r15841
8484 
8585void plus4_user_port_device::device_reset()
8686{
87   breset_w(ASSERT_LINE);
88   breset_w(CLEAR_LINE);
8789}
8890 
8991 
90UINT8 plus4_user_port_device::p_r() { UINT8 data = 0xff; if (m_cart != NULL) data = m_cart->plus4_p_r(); return data; }
91void plus4_user_port_device::p_w(UINT8 data) { if (m_cart != NULL) m_cart->plus4_p_w(data); }
92READ8_MEMBER( plus4_user_port_device::p_r ) { UINT8 data = 0xff; if (m_cart != NULL) data = m_cart->plus4_p_r(); return data; }
93WRITE8_MEMBER( plus4_user_port_device::p_w ) { if (m_cart != NULL) m_cart->plus4_p_w(data); }
9294 
9395READ_LINE_MEMBER( plus4_user_port_device::rxd_r ) { int state = 1; if (m_cart != NULL) state = m_cart->plus4_rxd_r(); return state; }
9496READ_LINE_MEMBER( plus4_user_port_device::dcd_r ) { int state = 1; if (m_cart != NULL) state = m_cart->plus4_dcd_r(); return state; }
r15840r15841
99101WRITE_LINE_MEMBER( plus4_user_port_device::rts_w ) { if (m_cart != NULL) m_cart->plus4_rts_w(state); }
100102WRITE_LINE_MEMBER( plus4_user_port_device::rxc_w ) { if (m_cart != NULL) m_cart->plus4_rxc_w(state); }
101103WRITE_LINE_MEMBER( plus4_user_port_device::atn_w ) { if (m_cart != NULL) m_cart->plus4_atn_w(state); }
104WRITE_LINE_MEMBER( plus4_user_port_device::breset_w ) { if (m_cart != NULL) m_cart->plus4_breset_w(state); }
src/mess/machine/plus4user.h
r15840r15841
6666   virtual ~plus4_user_port_device();
6767 
6868   // computer interface
69   UINT8 p_r();
70   void p_w(UINT8 data);
69   DECLARE_READ8_MEMBER( p_r );
70   DECLARE_WRITE8_MEMBER( p_w );
7171   DECLARE_READ_LINE_MEMBER( rxd_r );
7272   DECLARE_READ_LINE_MEMBER( dcd_r );
7373   DECLARE_READ_LINE_MEMBER( dsr_r );
r15840r15841
7676   DECLARE_WRITE_LINE_MEMBER( rts_w );
7777   DECLARE_WRITE_LINE_MEMBER( rxc_w );
7878   DECLARE_WRITE_LINE_MEMBER( atn_w );
79   DECLARE_WRITE_LINE_MEMBER( breset_w );
7980 
80   // cartridge interface
81   DECLARE_WRITE_LINE_MEMBER( reset_w );
82 
8381protected:
8482   // device-level overrides
83   virtual void device_config_complete() { };
8584   virtual void device_start();
8685   virtual void device_reset();
87   virtual void device_config_complete() { };
8886 
89    devcb_resolved_write_line   m_out_reset_func;
90 
9187   device_plus4_user_port_interface *m_cart;
9288};
9389 
r15840r15841
115111   virtual void plus4_atn_w(int level) { };
116112 
117113   // reset
118   virtual void plus4_reset_w(int level) { };
114   virtual void plus4_breset_w(int level) { };
119115 
120116protected:
121117   plus4_user_port_device *m_slot;
src/mess/includes/plus4.h
r15840r15841
77#include "formats/cbm_snqk.h"
88#include "includes/cbm.h"
99#include "audio/t6721.h"
10#include "audio/ted7360.h"
10#include "audio/mos7360.h"
1111#include "machine/6551acia.h"
1212#include "machine/plus4exp.h"
1313#include "machine/plus4user.h"
r15840r15841
5454
5555   required_device<cpu_device> m_maincpu;
5656   required_device<pls100_device> m_pla;
57   required_device<device_t> m_ted;
57   required_device<mos7360_device> m_ted;
5858   optional_device<acia6551_device> m_acia;
5959   optional_device<mos6529_device> m_spi_user;
6060   required_device<mos6529_device> m_spi_kb;
r15840r15841
6868   virtual void machine_start();
6969   virtual void machine_reset();
7070
71   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
72
7371   void check_interrupts();
7472   void bankswitch(offs_t offset, int phi0, int mux, int ras, int *scs, int *phi2, int *user, int *_6551, int *addr_clk, int *keyport, int *kernal, int *cs0, int *cs1);
7573   UINT8 read_memory(address_space &space, offs_t offset, int ba, int scs, int phi2, int user, int _6551, int addr_clk, int keyport, int kernal, int cs0, int cs1);
r15840r15841
7977   DECLARE_WRITE8_MEMBER( write );
8078
8179   DECLARE_READ8_MEMBER( cpu_r );
80   DECLARE_READ8_MEMBER( c16_cpu_r );
8281   DECLARE_WRITE8_MEMBER( cpu_w );
82   
83   DECLARE_WRITE_LINE_MEMBER( ted_irq_w );
84   DECLARE_READ8_MEMBER( ted_ram_r );
85   DECLARE_READ8_MEMBER( ted_rom_r );
86   DECLARE_READ8_MEMBER( ted_k_r );
8387
84   DECLARE_READ8_MEMBER( spi_user_r );
85   DECLARE_WRITE8_MEMBER( spi_user_w );
86   
8788   DECLARE_READ8_MEMBER( spi_kb_r );
8889   DECLARE_WRITE8_MEMBER( spi_kb_w );
8990
src/mess/drivers/plus4.c
r15840r15841
22
33   TODO:
44
5   - diag264p: HIGH RAM BAD $FF40-7F DEVICE, bad kernal R5
5   - cassette
66   - c1551 won't load anything
7   - JiffyDOS boots to monitor
87   - clean up keyboard handling
98   - clean up TED
109   - dump PLA
1110   - T6721 speech chip
11   - floating bus read (should return the previous byte read by TED)
1212   - SID card (http://solder.dyndns.info/cgi-bin/showdir.pl?dir=files/commodore/plus4/hardware/SID-Card)
1313
1414*/
r15840r15841
152152         *cs0 = 0;
153153         *cs1 = 1;
154154      }
155      else if ((offset >= 0xc000 && offset < 0xfd00) || (offset >= 0xff40))
155      else if ((offset >= 0xc000 && offset < 0xfd00) || (offset >= 0xff20))
156156      {
157157         *cs0 = 1;
158158         *cs1 = 0;
r15840r15841
176176   {
177177      data = t6721_speech_r(m_t6721, offset & 0x03);
178178   }
179   else if (!user && m_spi_user)
179   else if (!user)
180180   {
181      data = m_spi_user->read(space, 0);
181      if (m_spi_user)
182      {
183         data = m_spi_user->read(space, 0);
184      }
185      else
186      {
187         data |= ((m_cassette->get_state() & CASSETTE_MASK_UISTATE) == CASSETTE_STOPPED) << 2;
188      }
182189   }
183190   else if (!_6551 && m_acia)
184191   {
r15840r15841
245252   }
246253   else if (offset >= 0xff00 && offset < 0xff20)
247254   {
248      data = ted7360_port_r(m_ted, offset & 0x1f);
255      data = m_ted->read(space, offset & 0x1f);
249256   }
250   else if (offset < 0xfd00 || offset > 0xff40)
257   else if (offset < 0xfd00 || offset >= 0xff20)
251258   {
252259      data = m_ram->pointer()[offset & m_ram->mask()];
253260   }
r15840r15841
309316   }
310317   else if (offset >= 0xff00 && offset < 0xff20)
311318   {
312      ted7360_port_w(m_ted, offset & 0x1f, data);
319      m_ted->write(space, offset & 0x1f, data);
313320   }
314321   else if (offset == 0xff3e)
315322   {
316323      m_rom_en = 1;
317324     
318      ted7360_rom_switch_w(m_ted, m_rom_en);
325      m_ted->rom_switch_w(m_rom_en);
319326   }
320327   else if (offset == 0xff3f)
321328   {
322329      m_rom_en = 0;
323330
324      ted7360_rom_switch_w(m_ted, m_rom_en);
331      m_ted->rom_switch_w(m_rom_en);
325332   }
326   else if (offset < 0xfd00 || offset > 0xff40)
333   else if (offset < 0xfd00 || offset >= 0xff20)
327334   {
328335      m_ram->pointer()[offset & m_ram->mask()] = data;
329336   }
r15840r15841
441448       4       CST RD
442449       5       
443450       6       IEC CLK IN
451       7       IEC DATA IN, CST SENSE (Plus/4)
452   
453   */
454
455   UINT8 data = 0x2f;
456
457   data |= (m_cassette->input() > +0.0) << 4;
458
459   data |= m_iec->clk_r() << 6;
460   data |= (m_iec->data_r() || ((m_cassette->get_state() & CASSETTE_MASK_UISTATE) == CASSETTE_STOPPED)) << 7;
461
462   return data;
463}
464
465READ8_MEMBER( plus4_state::c16_cpu_r )
466{
467   /*
468   
469       bit     description
470   
471       0       
472       1       
473       2       
474       3       
475       4       CST RD
476       5       
477       6       IEC CLK IN
444478       7       IEC DATA IN
445479   
446480   */
r15840r15841
462496       bit     description
463497   
464498       0       IEC DATA
465       1       IEC CLK
499       1       IEC CLK, CST WR
466500       2       IEC ATN
467501       3       CST MTR
468502       4       
r15840r15841
472506   
473507   */
474508
509   // serial bus
475510   m_iec->data_w(!BIT(data, 0));
476511   m_iec->clk_w(!BIT(data, 1));
477512   m_iec->atn_w(!BIT(data, 2));
478513
479   m_cassette->change_state(BIT(data, 7) ? CASSETTE_MOTOR_DISABLED : CASSETTE_MOTOR_ENABLED, CASSETTE_MASK_MOTOR);
480
514   // cassette write
481515   m_cassette->output(!BIT(data, 1) ? -(0x5a9e >> 1) : +(0x5a9e >> 1));
516
517   // cassette motor
518   m_cassette->change_state(BIT(data, 3) ? CASSETTE_MOTOR_DISABLED : CASSETTE_MOTOR_ENABLED, CASSETTE_MASK_MOTOR);
482519}
483520
484521static const m6502_interface cpu_intf =
r15840r15841
489526   DEVCB_DRIVER_MEMBER(plus4_state, cpu_w)
490527};
491528
529static const m6502_interface c16_cpu_intf =
530{
531   NULL,
532   NULL,
533   DEVCB_DRIVER_MEMBER(plus4_state, c16_cpu_r),
534   DEVCB_DRIVER_MEMBER(plus4_state, cpu_w)
535};
492536
493537//-------------------------------------------------
494538//  ted7360_interface ted_intf
495539//-------------------------------------------------
496540
497static const unsigned char ted7360_palette[] =
498{
499/* black, white, red, cyan */
500/* purple, green, blue, yellow */
501/* orange, light orange, pink, light cyan, */
502/* light violett, light green, light blue, light yellow */
503/* these 16 colors are 8 times here in different luminance (dark..light) */
504/* taken from digitized tv screenshot */
505   0x06, 0x01, 0x03, 0x2b, 0x2b, 0x2b, 0x67, 0x0e, 0x0f, 0x00, 0x3f, 0x42,
506   0x57, 0x00, 0x6d, 0x00, 0x4e, 0x00, 0x19, 0x1c, 0x94, 0x38, 0x38, 0x00,
507   0x56, 0x20, 0x00, 0x4b, 0x28, 0x00, 0x16, 0x48, 0x00, 0x69, 0x07, 0x2f,
508   0x00, 0x46, 0x26, 0x06, 0x2a, 0x80, 0x2a, 0x14, 0x9b, 0x0b, 0x49, 0x00,
509
510   0x00, 0x03, 0x02, 0x3d, 0x3d, 0x3d, 0x75, 0x1e, 0x20, 0x00, 0x50, 0x4f,
511   0x6a, 0x10, 0x78, 0x04, 0x5c, 0x00, 0x2a, 0x2a, 0xa3, 0x4c, 0x47, 0x00,
512   0x69, 0x2f, 0x00, 0x59, 0x38, 0x00, 0x26, 0x56, 0x00, 0x75, 0x15, 0x41,
513   0x00, 0x58, 0x3d, 0x15, 0x3d, 0x8f, 0x39, 0x22, 0xae, 0x19, 0x59, 0x00,
514
515   0x00, 0x03, 0x04, 0x42, 0x42, 0x42, 0x7b, 0x28, 0x20, 0x02, 0x56, 0x59,
516   0x6f, 0x1a, 0x82, 0x0a, 0x65, 0x09, 0x30, 0x34, 0xa7, 0x50, 0x51, 0x00,
517   0x6e, 0x36, 0x00, 0x65, 0x40, 0x00, 0x2c, 0x5c, 0x00, 0x7d, 0x1e, 0x45,
518   0x01, 0x61, 0x45, 0x1c, 0x45, 0x99, 0x42, 0x2d, 0xad, 0x1d, 0x62, 0x00,
519
520   0x05, 0x00, 0x02, 0x56, 0x55, 0x5a, 0x90, 0x3c, 0x3b, 0x17, 0x6d, 0x72,
521   0x87, 0x2d, 0x99, 0x1f, 0x7b, 0x15, 0x46, 0x49, 0xc1, 0x66, 0x63, 0x00,
522   0x84, 0x4c, 0x0d, 0x73, 0x55, 0x00, 0x40, 0x72, 0x00, 0x91, 0x33, 0x5e,
523   0x19, 0x74, 0x5c, 0x32, 0x59, 0xae, 0x59, 0x3f, 0xc3, 0x32, 0x76, 0x00,
524
525   0x02, 0x01, 0x06, 0x84, 0x7e, 0x85, 0xbb, 0x67, 0x68, 0x45, 0x96, 0x96,
526   0xaf, 0x58, 0xc3, 0x4a, 0xa7, 0x3e, 0x73, 0x73, 0xec, 0x92, 0x8d, 0x11,
527   0xaf, 0x78, 0x32, 0xa1, 0x80, 0x20, 0x6c, 0x9e, 0x12, 0xba, 0x5f, 0x89,
528   0x46, 0x9f, 0x83, 0x61, 0x85, 0xdd, 0x84, 0x6c, 0xef, 0x5d, 0xa3, 0x29,
529
530   0x02, 0x00, 0x0a, 0xb2, 0xac, 0xb3, 0xe9, 0x92, 0x92, 0x6c, 0xc3, 0xc1,
531   0xd9, 0x86, 0xf0, 0x79, 0xd1, 0x76, 0x9d, 0xa1, 0xff, 0xbd, 0xbe, 0x40,
532   0xdc, 0xa2, 0x61, 0xd1, 0xa9, 0x4c, 0x93, 0xc8, 0x3d, 0xe9, 0x8a, 0xb1,
533   0x6f, 0xcd, 0xab, 0x8a, 0xb4, 0xff, 0xb2, 0x9a, 0xff, 0x88, 0xcb, 0x59,
534
535   0x02, 0x00, 0x0a, 0xc7, 0xca, 0xc9, 0xff, 0xac, 0xac, 0x85, 0xd8, 0xe0,
536   0xf3, 0x9c, 0xff, 0x92, 0xea, 0x8a, 0xb7, 0xba, 0xff, 0xd6, 0xd3, 0x5b,
537   0xf3, 0xbe, 0x79, 0xe6, 0xc5, 0x65, 0xb0, 0xe0, 0x57, 0xff, 0xa4, 0xcf,
538   0x89, 0xe5, 0xc8, 0xa4, 0xca, 0xff, 0xca, 0xb3, 0xff, 0xa2, 0xe5, 0x7a,
539
540   0x01, 0x01, 0x01, 0xff, 0xff, 0xff, 0xff, 0xf6, 0xf2, 0xd1, 0xff, 0xff,
541   0xff, 0xe9, 0xff, 0xdb, 0xff, 0xd3, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xa3,
542   0xff, 0xff, 0xc1, 0xff, 0xff, 0xb2, 0xfc, 0xff, 0xa2, 0xff, 0xee, 0xff,
543   0xd1, 0xff, 0xff, 0xeb, 0xff, 0xff, 0xff, 0xf8, 0xff, 0xed, 0xff, 0xbc
544};
545
546static PALETTE_INIT( plus4 )
547{
548   int i;
549
550   for (i = 0; i < sizeof(ted7360_palette) / 3; i++)
551      palette_set_color_rgb(machine, i, ted7360_palette[i * 3], ted7360_palette[i * 3 + 1], ted7360_palette[i * 3 + 2]);
552}
553
554UINT32 plus4_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
555{
556   ted7360_video_update(m_ted, bitmap, cliprect);
557
558   return 0;
559}
560
561541static INTERRUPT_GEN( c16_raster_interrupt )
562542{
563543   plus4_state *state = device->machine().driver_data<plus4_state>();
564544
565   ted7360_raster_interrupt_gen(state->m_ted);
545   state->m_ted->raster_interrupt_gen();
566546}
567547
568548static INTERRUPT_GEN( c16_frame_interrupt )
r15840r15841
623603         state->m_keyline[9] = value;
624604   }
625605
626   ted7360_frame_interrupt_gen(state->m_ted);
606   state->m_ted->frame_interrupt_gen();
627607}
628608
629static int c16_dma_read( running_machine &machine, int offset )
609WRITE_LINE_MEMBER( plus4_state::ted_irq_w )
630610{
631   plus4_state *state = machine.driver_data<plus4_state>();
632   address_space *space = state->m_maincpu->space(AS_PROGRAM);
611   m_ted_irq = state;
633612
634   int phi0 = 1, mux = 0, ras = 1, ba = 0;
635   int speech, phi2, user, _6551, addr_clk, keyport, kernal, cs0, cs1;
636
637   state->bankswitch(offset, phi0, mux, ras, &speech, &phi2, &user, &_6551, &addr_clk, &keyport, &kernal, &cs0, &cs1);
638
639   return state->read_memory(*space, offset, ba, speech, phi2, user, _6551, addr_clk, keyport, kernal, 1, 1);
613   check_interrupts();
640614}
641615
642static int c16_dma_read_rom( running_machine &machine, int offset )
616READ8_MEMBER( plus4_state::ted_ram_r )
643617{
644   plus4_state *state = machine.driver_data<plus4_state>();
645   address_space *space = state->m_maincpu->space(AS_PROGRAM);
646
647618   int phi0 = 1, mux = 0, ras = 1, ba = 0;
648619   int speech, phi2, user, _6551, addr_clk, keyport, kernal, cs0, cs1;
649620
650   state->bankswitch(offset, phi0, mux, ras, &speech, &phi2, &user, &_6551, &addr_clk, &keyport, &kernal, &cs0, &cs1);
621   bankswitch(offset, phi0, mux, ras, &speech, &phi2, &user, &_6551, &addr_clk, &keyport, &kernal, &cs0, &cs1);
651622
652   return state->read_memory(*space, offset, ba, speech, phi2, user, _6551, addr_clk, keyport, kernal, cs0, cs1);
623   return read_memory(space, offset, ba, speech, phi2, user, _6551, addr_clk, keyport, kernal, 1, 1);
653624}
654625
655static void c16_interrupt( running_machine &machine, int level )
626READ8_MEMBER( plus4_state::ted_rom_r )
656627{
657   plus4_state *state = machine.driver_data<plus4_state>();
628   int phi0 = 1, mux = 0, ras = 1, ba = 0;
629   int speech, phi2, user, _6551, addr_clk, keyport, kernal, cs0, cs1;
658630
659   state->m_ted_irq = level;
631   bankswitch(offset, phi0, mux, ras, &speech, &phi2, &user, &_6551, &addr_clk, &keyport, &kernal, &cs0, &cs1);
660632
661   state->check_interrupts();
633   return read_memory(space, offset, ba, speech, phi2, user, _6551, addr_clk, keyport, kernal, cs0, cs1);
662634}
663635
664static UINT8 c16_read_keyboard( running_machine &machine, int databus )
636READ8_MEMBER( plus4_state::ted_k_r )
665637{
666   plus4_state *state = machine.driver_data<plus4_state>();
667
668638   UINT8 value = 0xff;
669639   int i;
670640
671641   for (i = 0; i < 8; i++)
672642   {
673      if (!BIT(state->m_port6529, i))
674         value &= state->m_keyline[i];
643      if (!BIT(m_port6529, i))
644         value &= m_keyline[i];
675645   }
676646
677647   /* looks like joy 0 needs dataline2 low
678648     * and joy 1 needs dataline1 low
679649     * write to 0xff08 (value on databus) reloads latches */
680   if (!BIT(databus, 2))
681      value &= state->m_keyline[8];
650   if (!BIT(offset, 2))
651      value &= m_keyline[8];
682652
683   if (!BIT(databus, 1))
684      value &= state->m_keyline[9];
653   if (!BIT(offset, 1))
654      value &= m_keyline[9];
685655
686656   return value;
687657}
688658
689static const ted7360_interface ntsc_ted_intf =
659static MOS7360_INTERFACE( ted_intf )
690660{
691661   SCREEN_TAG,
692   TED7360_NTSC,
693   c16_dma_read,
694   c16_dma_read_rom,
695   c16_interrupt,
696   c16_read_keyboard
662   MOS7501_TAG,
663   DEVCB_DRIVER_LINE_MEMBER(plus4_state, ted_irq_w),
664   DEVCB_DRIVER_MEMBER(plus4_state, ted_ram_r),
665   DEVCB_DRIVER_MEMBER(plus4_state, ted_rom_r),
666   DEVCB_DRIVER_MEMBER(plus4_state, ted_k_r)
697667};
698668
699static const ted7360_interface pal_ted_intf =
700{
701   SCREEN_TAG,
702   TED7360_PAL,
703   c16_dma_read,
704   c16_dma_read_rom,
705   c16_interrupt,
706   c16_read_keyboard
707};
708669
709
710670//-------------------------------------------------
711671//  MOS6529_INTERFACE( spi_user_intf )
712672//-------------------------------------------------
713673
714READ8_MEMBER( plus4_state::spi_user_r )
715{
716   /*
717   
718       bit     description
719   
720       0       USER PORT B
721       1       
722       2       USER PORT 4, CASS SENSE
723       3       USER PORT 5
724       4       USER PORT 6
725       5       USER PORT 7
726       6       USER PORT J
727       7       USER PORT F
728   
729   */
730
731   UINT8 data = m_user->p_r() & 0xfe;
732
733   // cassette sense
734   data &= ~0x04;
735   data |= ((m_cassette->get_state() & CASSETTE_MASK_UISTATE) == CASSETTE_STOPPED) << 2;
736
737   return data;
738}
739
740WRITE8_MEMBER( plus4_state::spi_user_w )
741{
742   /*
743   
744       bit     description
745   
746       0       USER PORT B
747       1       
748       2       USER PORT 4, CASS SENSE
749       3       USER PORT 5
750       4       USER PORT 6
751       5       USER PORT 7
752       6       USER PORT J
753       7       USER PORT F
754   
755   */
756
757      // cassette sense
758   data &= ~0x04;
759   data |= ((m_cassette->get_state() & CASSETTE_MASK_UISTATE) == CASSETTE_STOPPED) << 2;
760
761   m_user->p_w(data & 0xfe);
762}
763
764674static MOS6529_INTERFACE( spi_user_intf )
765675{
766   DEVCB_DRIVER_MEMBER(plus4_state, spi_user_r),
767   DEVCB_DRIVER_MEMBER(plus4_state, spi_user_w)
676   DEVCB_DEVICE_MEMBER(PLUS4_USER_PORT_TAG, plus4_user_port_device, p_r),
677   DEVCB_DEVICE_MEMBER(PLUS4_USER_PORT_TAG, plus4_user_port_device, p_w)
768678};
769679
770680
r15840r15841
940850
941851   m_iec->reset();
942852
853   if (m_acia)
854   {
855      m_acia->reset();
856   }
857
858   m_exp->reset();
859
860   if (m_user)
861   {
862      m_user->reset();
863   }
864
943865   m_addr = 0;
944866   m_rom_en = 1;
945867
r15840r15841
968890   MCFG_CPU_PERIODIC_INT(c16_raster_interrupt, TED7360_HRETRACERATE)
969891   MCFG_QUANTUM_TIME(attotime::from_hz(60))
970892
971   // video hardware
972   MCFG_SCREEN_ADD(SCREEN_TAG, RASTER)
973   MCFG_SCREEN_REFRESH_RATE(TED7360PAL_VRETRACERATE)
974   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
975   MCFG_SCREEN_SIZE(336, 216)
976   MCFG_SCREEN_VISIBLE_AREA(0, 336 - 1, 0, 216 - 1)
977   MCFG_SCREEN_UPDATE_DRIVER(plus4_state, screen_update)
978
979   MCFG_PALETTE_LENGTH(ARRAY_LENGTH(ted7360_palette) / 3)
980   MCFG_PALETTE_INIT(plus4)
981
982   // sound hardware
893   // video and sound hardware
983894   MCFG_SPEAKER_STANDARD_MONO("mono")
984   MCFG_TED7360_ADD(MOS7360_TAG, ntsc_ted_intf)
895   MCFG_MOS7360_ADD(MOS7360_TAG, SCREEN_TAG, XTAL_14_31818MHz/4, ted_intf)
985896   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
986897
987898   // devices
r15840r15841
1018929   MCFG_CPU_PERIODIC_INT(c16_raster_interrupt, TED7360_HRETRACERATE)
1019930   MCFG_QUANTUM_TIME(attotime::from_hz(60))
1020931
1021   // video hardware
1022   MCFG_SCREEN_ADD(SCREEN_TAG, RASTER)
1023   MCFG_SCREEN_REFRESH_RATE(TED7360PAL_VRETRACERATE)
1024   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
1025   MCFG_SCREEN_SIZE(336, 216)
1026   MCFG_SCREEN_VISIBLE_AREA(0, 336 - 1, 0, 216 - 1)
1027   MCFG_SCREEN_UPDATE_DRIVER(plus4_state, screen_update)
1028
1029   MCFG_PALETTE_LENGTH(ARRAY_LENGTH(ted7360_palette) / 3)
1030   MCFG_PALETTE_INIT(plus4)
1031
1032   // sound hardware
932   // video and sound hardware
1033933   MCFG_SPEAKER_STANDARD_MONO("mono")
1034   MCFG_TED7360_ADD(MOS7360_TAG, pal_ted_intf)
934   MCFG_MOS7360_ADD(MOS7360_TAG, SCREEN_TAG, XTAL_17_73447MHz/5, ted_intf)
1035935   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
1036936
1037937   // devices
r15840r15841
1059959//  MACHINE_CONFIG( c16 )
1060960//-------------------------------------------------
1061961
1062static MACHINE_CONFIG_START( c16, plus4_state )
1063   // basic machine hardware
1064   MCFG_CPU_ADD(MOS7501_TAG, M7501, XTAL_17_73447MHz/20)
1065   MCFG_CPU_PROGRAM_MAP(plus4_mem)
1066   MCFG_CPU_CONFIG(cpu_intf)
1067   MCFG_CPU_VBLANK_INT(SCREEN_TAG, c16_frame_interrupt)
1068   MCFG_CPU_PERIODIC_INT(c16_raster_interrupt, TED7360_HRETRACERATE)
1069   MCFG_QUANTUM_TIME(attotime::from_hz(60))
962static MACHINE_CONFIG_DERIVED( c16, pal )
963   MCFG_DEVICE_REMOVE(MOS6551_TAG)
964   MCFG_DEVICE_REMOVE(MOS6529_USER_TAG)
965   MCFG_DEVICE_REMOVE(PLUS4_USER_PORT_TAG)
1070966
1071   // video hardware
1072   MCFG_SCREEN_ADD(SCREEN_TAG, RASTER)
1073   MCFG_SCREEN_REFRESH_RATE(TED7360PAL_VRETRACERATE)
1074   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
1075   MCFG_SCREEN_SIZE(336, 216)
1076   MCFG_SCREEN_VISIBLE_AREA(0, 336 - 1, 0, 216 - 1)
1077   MCFG_SCREEN_UPDATE_DRIVER(plus4_state, screen_update)
967   MCFG_DEVICE_MODIFY(CBM_IEC_TAG)
968   MCFG_DEVICE_CONFIG(c16_iec_intf)
1078969
1079   MCFG_PALETTE_LENGTH(ARRAY_LENGTH(ted7360_palette) / 3)
1080   MCFG_PALETTE_INIT(plus4)
1081
1082   // sound hardware
1083   MCFG_SPEAKER_STANDARD_MONO("mono")
1084   MCFG_TED7360_ADD(MOS7360_TAG, pal_ted_intf)
1085   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
1086
1087   // devices
1088   MCFG_PLS100_ADD(PLA_TAG)
1089   MCFG_MOS6529_ADD(MOS6529_KB_TAG, spi_kb_intf)
1090   MCFG_QUICKLOAD_ADD("quickload", cbm_c16, "p00,prg", CBM_QUICKLOAD_DELAY_SECONDS)
1091   MCFG_CASSETTE_ADD( CASSETTE_TAG, cbm_cassette_interface )
1092   MCFG_CBM_IEC_ADD(c16_iec_intf, NULL)
1093   MCFG_PLUS4_EXPANSION_SLOT_ADD(PLUS4_EXPANSION_SLOT_TAG, XTAL_17_73447MHz/20, expansion_intf, plus4_expansion_cards, NULL, NULL)
1094
1095   // internal ram
1096   MCFG_RAM_ADD(RAM_TAG)
970   MCFG_DEVICE_MODIFY(RAM_TAG)
1097971   MCFG_RAM_DEFAULT_SIZE("16K")
1098
1099   // software list
1100   MCFG_SOFTWARE_LIST_ADD("cart_list", "plus4_cart")
1101   MCFG_SOFTWARE_LIST_ADD("disk_list", "plus4_flop")
972   MCFG_RAM_EXTRA_OPTIONS("64K")
1102973MACHINE_CONFIG_END
1103974
1104975
r15840r15841
1106977//  MACHINE_CONFIG( c232 )
1107978//-------------------------------------------------
1108979
1109static MACHINE_CONFIG_START( c232, plus4_state )
1110   // basic machine hardware
1111   MCFG_CPU_ADD(MOS7501_TAG, M7501, XTAL_14_31818MHz/16)
1112   MCFG_CPU_PROGRAM_MAP(plus4_mem)
1113   MCFG_CPU_CONFIG(cpu_intf)
1114   MCFG_CPU_VBLANK_INT(SCREEN_TAG, c16_frame_interrupt)
1115   MCFG_CPU_PERIODIC_INT(c16_raster_interrupt, TED7360_HRETRACERATE)
1116   MCFG_QUANTUM_TIME(attotime::from_hz(60))
1117
1118   // video hardware
1119   MCFG_SCREEN_ADD(SCREEN_TAG, RASTER)
1120   MCFG_SCREEN_REFRESH_RATE(TED7360PAL_VRETRACERATE)
1121   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
1122   MCFG_SCREEN_SIZE(336, 216)
1123   MCFG_SCREEN_VISIBLE_AREA(0, 336 - 1, 0, 216 - 1)
1124   MCFG_SCREEN_UPDATE_DRIVER(plus4_state, screen_update)
1125
1126   MCFG_PALETTE_LENGTH(ARRAY_LENGTH(ted7360_palette) / 3)
1127   MCFG_PALETTE_INIT(plus4)
1128
1129   // sound hardware
1130   MCFG_SPEAKER_STANDARD_MONO("mono")
1131   MCFG_TED7360_ADD(MOS7360_TAG, ntsc_ted_intf)
1132   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
1133
1134   // devices
1135   MCFG_PLS100_ADD(PLA_TAG)
1136   MCFG_MOS6529_ADD(MOS6529_KB_TAG, spi_kb_intf)
1137   MCFG_QUICKLOAD_ADD("quickload", cbm_c16, "p00,prg", CBM_QUICKLOAD_DELAY_SECONDS)
1138   MCFG_CASSETTE_ADD( CASSETTE_TAG, cbm_cassette_interface )
1139   MCFG_CBM_IEC_ADD(c16_iec_intf, NULL)
1140   MCFG_PLUS4_EXPANSION_SLOT_ADD(PLUS4_EXPANSION_SLOT_TAG, XTAL_14_31818MHz/16, expansion_intf, plus4_expansion_cards, NULL, NULL)
1141
1142   // internal ram
1143   MCFG_RAM_ADD(RAM_TAG)
980static MACHINE_CONFIG_DERIVED( c232, c16 )
981   MCFG_DEVICE_MODIFY(RAM_TAG)
1144982   MCFG_RAM_DEFAULT_SIZE("32K")
1145
1146   // software list
1147   MCFG_SOFTWARE_LIST_ADD("cart_list", "plus4_cart")
1148   MCFG_SOFTWARE_LIST_ADD("disk_list", "plus4_flop")
1149983MACHINE_CONFIG_END
1150984
1151985
r15840r15841
11861020
11871021ROM_START( plus4n )
11881022   ROM_REGION( 0x8000, "kernal", 0 )
1189   ROM_LOAD( "318006-01.u23", 0x0000, 0x4000, CRC(74eaae87) SHA1(161c96b4ad20f3a4f2321808e37a5ded26a135dd) )
1190
11911023   ROM_DEFAULT_BIOS("r5")
1192   ROM_SYSTEM_BIOS( 0, "r4", "rev. 4" )
1024   ROM_SYSTEM_BIOS( 0, "r4", "Revision 4" )
11931025   ROMX_LOAD( "318005-04.u24", 0x4000, 0x4000, CRC(799a633d) SHA1(5df52c693387c0e2b5d682613a3b5a65477311cf), ROM_BIOS(1) )
1194   ROM_SYSTEM_BIOS( 1, "r5", "rev. 5" )
1026   ROM_SYSTEM_BIOS( 1, "r5", "Revision 5" )
11951027   ROMX_LOAD( "318005-05.u24", 0x4000, 0x4000, CRC(70295038) SHA1(a3d9e5be091b98de39a046ab167fb7632d053682), ROM_BIOS(2) )
11961028   ROM_SYSTEM_BIOS( 2, "jiffydos", "JiffyDOS v6.01" )
1197   ROMX_LOAD( "jiffydos plus4.u24", 0x0000, 0x8000, CRC(818d3f45) SHA1(9bc1b1c3da9ca642deae717905f990d8e36e6c3b), ROM_BIOS(3) )
1029   ROMX_LOAD( "jiffydos plus4.u24", 0x0000, 0x8000, CRC(818d3f45) SHA1(9bc1b1c3da9ca642deae717905f990d8e36e6c3b), ROM_BIOS(3) ) // first half contains R5 kernal
11981030
1031   ROM_LOAD( "318006-01.u23", 0x0000, 0x4000, CRC(74eaae87) SHA1(161c96b4ad20f3a4f2321808e37a5ded26a135dd) )
1032
11991033   ROM_REGION( 0x8000, "function", 0 )
12001034   ROM_LOAD( "317053-01.u25", 0x0000, 0x4000, CRC(4fd1d8cb) SHA1(3b69f6e7cb4c18bb08e203fb18b7dabfa853390f) )
12011035   ROM_LOAD( "317054-01.u26", 0x4000, 0x4000, CRC(109de2fc) SHA1(0ad7ac2db7da692d972e586ca0dfd747d82c7693) )
r15840r15841
12091043//  ROM( plus4p )
12101044//-------------------------------------------------
12111045
1212#define rom_plus4p rom_plus4n
1046ROM_START( plus4p )
1047   ROM_REGION( 0x8000, "kernal", 0 )
1048   ROM_LOAD( "318006-01.u23", 0x0000, 0x4000, CRC(74eaae87) SHA1(161c96b4ad20f3a4f2321808e37a5ded26a135dd) )
12131049
1050   ROM_DEFAULT_BIOS("r5")
1051   ROM_SYSTEM_BIOS( 0, "r3", "Revision 3" )
1052   ROMX_LOAD( "318004-03.u4", 0x4000, 0x4000, CRC(77bab934) SHA1(97814dab9d757fe5a3a61d357a9a81da588a9783), ROM_BIOS(1) )
1053   ROM_SYSTEM_BIOS( 1, "r4", "Revision 4" )
1054   ROMX_LOAD( "318004-04.u4", 0x4000, 0x4000, CRC(be54ed79) SHA1(514ad3c29d01a2c0a3b143d9c1d4143b1912b793), ROM_BIOS(2) )
1055   ROM_SYSTEM_BIOS( 2, "r5", "Revision 5" )
1056   ROMX_LOAD( "318004-05.u4", 0x4000, 0x4000, CRC(71c07bd4) SHA1(7c7e07f016391174a557e790c4ef1cbe33512cdb), ROM_BIOS(3) )
12141057
1058   ROM_REGION( 0x8000, "function", 0 )
1059   ROM_LOAD( "317053-01.u25", 0x0000, 0x4000, CRC(4fd1d8cb) SHA1(3b69f6e7cb4c18bb08e203fb18b7dabfa853390f) )
1060   ROM_LOAD( "317054-01.u26", 0x4000, 0x4000, CRC(109de2fc) SHA1(0ad7ac2db7da692d972e586ca0dfd747d82c7693) )
1061
1062   ROM_REGION( 0xf5, PLA_TAG, 0 )
1063   ROM_LOAD( "251641-02.u19", 0x00, 0xf5, NO_DUMP )
1064ROM_END
1065
1066
12151067//-------------------------------------------------
12161068//  ROM( c16 )
12171069//-------------------------------------------------
r15840r15841
12211073   ROM_LOAD( "318006-01.u3", 0x0000, 0x4000, CRC(74eaae87) SHA1(161c96b4ad20f3a4f2321808e37a5ded26a135dd) )
12221074
12231075   ROM_DEFAULT_BIOS("r5")
1224   ROM_SYSTEM_BIOS( 0, "r3", "rev. 3" )
1076   ROM_SYSTEM_BIOS( 0, "r3", "Revision 3" )
12251077   ROMX_LOAD( "318004-03.u4", 0x4000, 0x4000, CRC(77bab934) SHA1(97814dab9d757fe5a3a61d357a9a81da588a9783), ROM_BIOS(1) )
1226   ROM_SYSTEM_BIOS( 1, "r4", "rev. 4" )
1078   ROM_SYSTEM_BIOS( 1, "r4", "Revision 4" )
12271079   ROMX_LOAD( "318004-04.u4", 0x4000, 0x4000, CRC(be54ed79) SHA1(514ad3c29d01a2c0a3b143d9c1d4143b1912b793), ROM_BIOS(2) )
1228   ROM_SYSTEM_BIOS( 2, "r5", "rev. 5" )
1080   ROM_SYSTEM_BIOS( 2, "r5", "Revision 5" )
12291081   ROMX_LOAD( "318004-05.u4", 0x4000, 0x4000, CRC(71c07bd4) SHA1(7c7e07f016391174a557e790c4ef1cbe33512cdb), ROM_BIOS(3) )
12301082
12311083   ROM_REGION( 0xf5, PLA_TAG, 0 )
r15840r15841
12421094   ROM_LOAD( "318006-01.u3", 0x0000, 0x4000, CRC(74eaae87) SHA1(161c96b4ad20f3a4f2321808e37a5ded26a135dd) )
12431095
12441096   ROM_DEFAULT_BIOS("r5")
1245   ROM_SYSTEM_BIOS( 0, "r3", "rev. 3" )
1097   ROM_SYSTEM_BIOS( 0, "r3", "Revision 3" )
12461098   ROMX_LOAD( "318004-03.u4", 0x4000, 0x4000, CRC(77bab934) SHA1(97814dab9d757fe5a3a61d357a9a81da588a9783), ROM_BIOS(1) )
1247   ROM_SYSTEM_BIOS( 1, "r4", "rev. 4" )
1099   ROM_SYSTEM_BIOS( 1, "r4", "Revision 4" )
12481100   ROMX_LOAD( "318004-04.u4", 0x4000, 0x4000, CRC(be54ed79) SHA1(514ad3c29d01a2c0a3b143d9c1d4143b1912b793), ROM_BIOS(2) )
1249   ROM_SYSTEM_BIOS( 2, "r5", "rev. 5" )
1101   ROM_SYSTEM_BIOS( 2, "r5", "Revision 5" )
12501102   ROMX_LOAD( "318004-05.u4", 0x4000, 0x4000, CRC(71c07bd4) SHA1(7c7e07f016391174a557e790c4ef1cbe33512cdb), ROM_BIOS(3) )
12511103
12521104   ROM_REGION( 0xf5, PLA_TAG, 0 )
r15840r15841
12611113ROM_START( c16h )
12621114   ROM_REGION( 0x8000, "kernal", 0 )
12631115   ROM_LOAD( "318006-01.u3", 0x0000, 0x4000, CRC(74eaae87) SHA1(161c96b4ad20f3a4f2321808e37a5ded26a135dd) )
1264   ROM_LOAD( "hungary.u4",   0x4000, 0x4000, CRC(775f60c5) SHA1(20cf3c4bf6c54ef09799af41887218933f2e27ee) )
1116   
1117   ROM_DEFAULT_BIOS("r2")
1118   ROM_SYSTEM_BIOS( 0, "r1", "Revision 1" )
1119   ROMX_LOAD( "318030-01.u4", 0x4000, 0x4000, NO_DUMP, ROM_BIOS(1) )
1120   ROM_SYSTEM_BIOS( 1, "r2", "Revision 2" )
1121   ROMX_LOAD( "318030-02.u4", 0x4000, 0x4000, CRC(775f60c5) SHA1(20cf3c4bf6c54ef09799af41887218933f2e27ee), ROM_BIOS(2) )
12651122
12661123   ROM_REGION( 0xf5, PLA_TAG, 0 )
12671124   ROM_LOAD( "251641-02.u16", 0x00, 0xf5, NO_DUMP )
src/mess/mess.mak
r15840r15841
863863   $(MESS_MACHINE)/vic1111.o   \
864864   $(MESS_MACHINE)/vic1112.o   \
865865   $(MESS_MACHINE)/vic1210.o   \
866   $(MESS_AUDIO)/ted7360.o      \
867866   $(MESS_AUDIO)/t6721.o      \
867   $(MESS_AUDIO)/mos7360.o      \
868868   $(MESS_DRIVERS)/plus4.o      \
869869   $(MESS_MACHINE)/plus4exp.o   \
870870   $(MESS_MACHINE)/plus4user.o   \

Previous 15994 Revisions Next


© 1998-2018 The MESS Team