Previous 15994 Revisions Next

r2544 Monday 5th May, 2008 at 01:51:53 UTC by Nathan Woods
1. Changed Apple FDC/IWM implementation to be a MAME device. This affects the
Apple II, Apple III, Apple IIgs, Lisa and Mac drivers.

2. [APPLE2] Changed slot system to be implemented as MAME devices.
[docs]messnew.txt
[src/emu]devintrf.c
[src/mess]mess.mak
[src/mess/drivers]apple2.c apple2gs.c apple3.c lisa.c mac.c
[src/mess/includes]apple2.h apple3.h
[src/mess/machine]ap2_lang.c* ap2_lang.h* ap2_slot.c* ap2_slot.h* apple2.c apple2gs.c apple3.c applefdc.c applefdc.h lisa.c mac.c mockngbd.c* mockngbd.h* oric.c

src/emu/devintrf.c
r2543r2544
243243{
244244   const device_config *curdev;
245245
246   assert(type != NULL);
247246   assert(tag != NULL);
248247
249248   /* find the device in the list */
src/mess/includes/apple3.h
r2543r2544
99#ifndef APPLE3_H_
1010#define APPLE3_H_
1111
12#include "machine/applefdc.h"
1213
1314#define VAR_VM0         0x0001
1415#define VAR_VM1         0x0002
r2543r2544
2324/*----------- defined in machine/apple3.c -----------*/
2425
2526extern UINT32 a3;
27extern const applefdc_interface apple3_fdc_interface;
2628
2729MACHINE_RESET( apple3 );
2830DRIVER_INIT( apple3 );
src/mess/includes/apple2.h
r2543r2544
99#ifndef APPLE2_H_
1010#define APPLE2_H_
1111
12#include "machine/applefdc.h"
1213
14
1315/* -----------------------------------------------------------------------
1416 * Softswitch values
1517 * ----------------------------------------------------------------------- */
r2543r2544
3739
3840#define VAR_DHIRES      VAR_AN3
3941
40/* ----------------------------------------------------------------------- */
41
42#define APPLE2_SLOT_COUNT   8
43
44typedef struct _apple2_slotdevice apple2_slotdevice;
45struct _apple2_slotdevice
46{
47   const char *name;
48   const char *description;
49   void *(*init)(running_machine *machine, int slot);
50   void (*reset)(running_machine *machine, void *token);
51   UINT8 (*read)(running_machine *machine, void *token, offs_t offset);
52   void (*write)(running_machine *machine, void *token, offs_t offset, UINT8 data);
53};
54
55typedef struct _apple2_config apple2_config;
56struct _apple2_config
57{
58   const apple2_slotdevice *slots[APPLE2_SLOT_COUNT];
59};
60
61
6242/*----------- defined in machine/apple2.c -----------*/
6343
6444extern UINT32 a2;
6545
66extern const apple2_slotdevice apple2_slot_langcard;
67extern const apple2_slotdevice apple2_slot_mockingboard;
68extern const apple2_slotdevice apple2_slot_floppy525;
69extern const apple2_slotdevice apple2_slot_iwm;
46extern const applefdc_interface apple2_fdc_interface;
7047
7148void apple2_iwm_setdiskreg(UINT8 data);
7249UINT8 apple2_iwm_getdiskreg(void);
7350
74void apple2_init_common(running_machine *machine, const apple2_config *config);
51void apple2_init_common(running_machine *machine);
7552MACHINE_START( apple2 );
7653UINT8 apple2_getfloatingbusvalue(void);
7754READ8_HANDLER( apple2_c0xx_r );
src/mess/machine/applefdc.c
r2543r2544
5858#define IWM_Q6      0x40
5959#define IWM_Q7      0x80
6060
61typedef enum
62{
63   APPLEFDC_APPLE2,   /* classic Apple II disk controller (pre-IWM) */
64   APPLEFDC_IWM,      /* Integrated Woz Machine */
65   APPLEFDC_SWIM      /* Steve Woz Integrated Machine (NYI) */
66} applefdc_t;
6167
6268
69
6370/***************************************************************************
64    LOCAL VARIABLES
65***************************************************************************/
71    IWM MODE
6672
67static UINT8 applefdc_writebyte=0;
68static UINT8 applefdc_lines;      /* flags from IWM_MOTOR - IWM_Q7 */
73   The IWM mode has the following values:
6974
70/*
71 * IWM mode (iwm_mode):   The IWM mode has the following values:
72 *
73 * Bit 7     Reserved
74 * Bit 6     Reserved
75 * Bit 5     Reserved
76 * Bit 4   ! Clock speed
77 *            0=7MHz;   used by Apple IIgs
78 *            1=8MHz;   used by Mac (I believe)
79 * Bit 3   ! Bit cell time
80 *            0=4usec/bit   (used for 5.25" drives)
81 *            1=2usec/bit (used for 3.5" drives)
82 * Bit 2     Motor-off delay
83 *            0=leave on for 1 sec after system turns it off
84 *            1=turn off immediately
85 * Bit 1   ! Handshake protocol
86 *            0=synchronous (software supplies timing for writing data; used for 5.25" drives)
87 *            1=asynchronous (IWM supplies timing; used for 3.5" drives)
88 * Bit 0   ! Latch mode
89 *            0=read data stays valid for 7usec (used for 5.25" drives)
90 *            1=read data stays valid for full byte time (used for 3.5" drives)
91 */
75   Bit 7     Reserved
76   Bit 6     Reserved
77   Bit 5     Reserved
78   Bit 4   ! Clock speed
79             0=7MHz;   used by Apple IIgs
80             1=8MHz;   used by Mac (I believe)
81   Bit 3   ! Bit cell time
82             0=4usec/bit   (used for 5.25" drives)
83             1=2usec/bit (used for 3.5" drives)
84   Bit 2     Motor-off delay
85             0=leave on for 1 sec after system turns it off
86             1=turn off immediately
87   Bit 1   ! Handshake protocol
88             0=synchronous (software supplies timing for writing data; used for 5.25" drives)
89             1=asynchronous (IWM supplies timing; used for 3.5" drives)
90   Bit 0   ! Latch mode
91             0=read data stays valid for 7usec (used for 5.25" drives)
92             1=read data stays valid for full byte time (used for 3.5" drives)
93
94 ***************************************************************************/
95
9296enum
9397{
9498   IWM_MODE_CLOCKSPEED         = 0x10,
r2543r2544
98102   IWM_MODE_LATCHMODE         = 0x01
99103};
100104
101static int iwm_mode;      /* 0-31 */
102static emu_timer *motor_timer;
103static applefdc_interface iwm_intf;
104105
105106
107/***************************************************************************
108    TYPE DEFINITIONS
109***************************************************************************/
106110
111typedef struct _applefdc_token applefdc_token;
112struct _applefdc_token
113{
114   /* data that is constant for the lifetime of the emulation */
115   emu_timer *motor_timer;
116   applefdc_t type;
117
118   /* data that changes at emulation time */
119   UINT8 write_byte;
120   UINT8 lines;               /* flags from IWM_MOTOR - IWM_Q7 */
121   UINT8 mode;                  /* 0-31; see above */
122   UINT8 handshake_hack;         /* not sure what this is for */
123};
124
125
126
107127/***************************************************************************
108128    PROTOTYPES
109129***************************************************************************/
r2543r2544
113133
114134
115135/***************************************************************************
136    INLINE FUNCTIONS
137***************************************************************************/
138
139INLINE void assert_is_applefdc(const device_config *device)
140{
141   assert(device != NULL);
142   assert((device->type == APPLEFDC) || (device->type == IWM) || (device->type == SWIM));
143}
144
145
146
147INLINE applefdc_token *get_token(const device_config *device)
148{
149   assert_is_applefdc(device);
150   return (applefdc_token *) device->token;
151}
152
153
154
155INLINE const applefdc_interface *get_interface(const device_config *device)
156{
157   static const applefdc_interface dummy_interface = {0, };
158
159   assert_is_applefdc(device);
160   return (device->static_config != NULL)
161      ? (const applefdc_interface *) device->static_config
162      : &dummy_interface;
163}
164
165
166
167/***************************************************************************
116168    CORE IMPLEMENTATION
117169***************************************************************************/
118170
119void applefdc_init(const applefdc_interface *intf)
171/*-------------------------------------------------
172    applefdc_start - starts up an FDC
173-------------------------------------------------*/
174
175static void applefdc_start(const device_config *device, applefdc_t type)
120176{
121   applefdc_lines = 0;
122   iwm_mode = 0x1f;   /* default value needed by Lisa 2 - no, I don't know if it is true */
123   motor_timer = timer_alloc(iwm_turnmotor_onoff, NULL);
124   if (intf)
125      iwm_intf = *intf;
126   else
127      memset(&iwm_intf, 0, sizeof(iwm_intf));
177   applefdc_token *fdc = get_token(device);
178
179   memset(fdc, 0, sizeof(*fdc));
180   fdc->type = type;
181   fdc->motor_timer = timer_alloc(iwm_turnmotor_onoff, (void *) device);
182   fdc->lines = 0x00;
183   fdc->mode = 0x1F;   /* default value needed by Lisa 2 - no, I don't know if it is true */
184
185   /* register save states */
186   state_save_register_item("applefdc", 0, fdc->write_byte);
187   state_save_register_item("applefdc", 0, fdc->lines);
188   state_save_register_item("applefdc", 0, fdc->mode);
189   state_save_register_item("applefdc", 0, fdc->handshake_hack);
128190}
129191
130192
131193
132194/*-------------------------------------------------
195    DEVICE_RESET(applefdc) - resets an FDC
196-------------------------------------------------*/
197
198static DEVICE_RESET(applefdc)
199{
200   applefdc_token *fdc = get_token(device);
201
202   fdc->handshake_hack = 0x00;
203   fdc->write_byte = 0x00;
204   fdc->lines = 0x00;
205   fdc->mode = 0x1F;   /* default value needed by Lisa 2 - no, I don't know if it is true */
206
207   timer_reset(fdc->motor_timer, attotime_never);
208}
209
210
211
212/*-------------------------------------------------
133213    iwm_enable2 - hackish function
134214-------------------------------------------------*/
135215
136static int iwm_enable2(void)
216static int iwm_enable2(const device_config *device)
137217{
218   applefdc_token *fdc = get_token(device);
219
138220   /* R. Nabet : This function looks more like a hack than a real feature of the IWM; */
139221   /* it is not called from the Mac Plus driver */
140   return (applefdc_lines & APPLEFDC_PH1) && (applefdc_lines & APPLEFDC_PH3);
222   return (fdc->lines & APPLEFDC_PH1) && (fdc->lines & APPLEFDC_PH3);
141223}
142224
143225
r2543r2544
146228    iwm_readenable2handshake - hackish function
147229-------------------------------------------------*/
148230
149static int iwm_readenable2handshake(void)
231static UINT8 iwm_readenable2handshake(const device_config *device)
150232{
233   applefdc_token *fdc = get_token(device);
234
151235   /* R. Nabet : This function looks more like a hack than a real feature of the IWM; */
152236   /* it is not called from the Mac Plus driver */
153
154   static int val = 0;
155
156   if (val++ > 3)
157      val = 0;
158
159   return val ? 0xc0 : 0x80;
237   fdc->handshake_hack++;
238   fdc->handshake_hack %= 4;
239   return (fdc->handshake_hack != 0) ? 0xc0 : 0x80;
160240}
161241
162242
r2543r2544
165245    applefdc_statusreg_r - reads the status register
166246-------------------------------------------------*/
167247
168static int applefdc_statusreg_r(void)
248static UINT8 applefdc_statusreg_r(const device_config *device)
169249{
250   UINT8 result;
251   int status;
252   applefdc_token *fdc = get_token(device);
253   const applefdc_interface *intf = get_interface(device);
254
170255   /* IWM status:
171256    *
172257    * Bit 7   Sense input (write protect for 5.25" drive and general status line for 3.5")
r2543r2544
175260    * Bits 4-0   Same as IWM mode bits 4-0
176261    */
177262
178   int result;
179   int status;
263   status = iwm_enable2(device) ? 1 : (intf->read_status ? intf->read_status() : 0);
180264
181   status = iwm_enable2() ? 1 : (iwm_intf.read_status ? iwm_intf.read_status() : 0);
182
183265   result = (status ? 0x80 : 0x00);
184266
185   if (iwm_intf.type != APPLEFDC_APPLE2)
186       result |= (((applefdc_lines & IWM_MOTOR) ? 1 : 0) << 5) | iwm_mode;
267   if (fdc->type != APPLEFDC_APPLE2)
268       result |= (((fdc->lines & IWM_MOTOR) ? 1 : 0) << 5) | fdc->mode;
187269   return result;
188270}
189271
r2543r2544
193275    iwm_modereg_w - changes the mode register
194276-------------------------------------------------*/
195277
196static void iwm_modereg_w(int data)
278static void iwm_modereg_w(const device_config *device, UINT8 data)
197279{
198   iwm_mode = data & 0x1f;   /* Write mode register */
280   applefdc_token *fdc = get_token(device);
199281
282   fdc->mode = data & 0x1f;   /* write mode register */
283
200284   if (LOG_APPLEFDC_EXTRA)
201      logerror("iwm_modereg_w: iwm_mode=0x%02x\n", (int) iwm_mode);
285      logerror("iwm_modereg_w: iwm_mode=0x%02x\n", (unsigned) fdc->mode);
202286}
203287
204288
r2543r2544
207291    applefdc_read_reg - reads a register
208292-------------------------------------------------*/
209293
210static UINT8 applefdc_read_reg(int lines)
294static UINT8 applefdc_read_reg(const device_config *device, int lines)
211295{
296   applefdc_token *fdc = get_token(device);
297   const applefdc_interface *intf = get_interface(device);
212298   UINT8 result = 0;
213299
214300   switch(lines)
215301   {
216302      case 0:
217303         /* Read data register */
218         if ((iwm_intf.type != APPLEFDC_APPLE2) && (iwm_enable2() || !(applefdc_lines & IWM_MOTOR)))
304         if ((fdc->type != APPLEFDC_APPLE2) && (iwm_enable2(device) || !(fdc->lines & IWM_MOTOR)))
219305         {
220306            result = 0xFF;
221307         }
r2543r2544
228314             */
229315            if (LOG_APPLEFDC)
230316            {
231               if ((iwm_mode & IWM_MODE_LATCHMODE) == 0)
317               if ((fdc->mode & IWM_MODE_LATCHMODE) == 0x00)
232318                  logerror("applefdc_read_reg(): latch mode off not implemented\n");
233319            }
234320
235            result = (iwm_intf.read_data ? iwm_intf.read_data() : 0);
321            result = (intf->read_data ? intf->read_data() : 0x00);
236322         }
237323         break;
238324
239325      case IWM_Q6:
240326         /* Read status register */
241         result = applefdc_statusreg_r();
327         result = applefdc_statusreg_r(device);
242328         break;
243329
244330      case IWM_Q7:
245331         /* Classic Apple II: Read status register
246332          * IWM: Read handshake register
247333          */
248         if (iwm_intf.type == APPLEFDC_APPLE2)
249            result = applefdc_statusreg_r();
334         if (fdc->type == APPLEFDC_APPLE2)
335            result = applefdc_statusreg_r(device);
250336         else
251            result = iwm_enable2() ? iwm_readenable2handshake() : 0x80;
337            result = iwm_enable2(device) ? iwm_readenable2handshake(device) : 0x80;
252338         break;
253339   }
254340   return result;
r2543r2544
260346    applefdc_write_reg - writes a register
261347-------------------------------------------------*/
262348
263static void applefdc_write_reg(UINT8 data)
349static void applefdc_write_reg(const device_config *device, UINT8 data)
264350{
265   switch(applefdc_lines & (IWM_Q6 | IWM_Q7))
351   applefdc_token *fdc = get_token(device);
352   const applefdc_interface *intf = get_interface(device);
353
354   switch(fdc->lines & (IWM_Q6 | IWM_Q7))
266355   {
267356      case IWM_Q6 | IWM_Q7:
268         if (!(applefdc_lines & IWM_MOTOR))
357         if (!(fdc->lines & IWM_MOTOR))
269358         {
270            iwm_modereg_w(data);
359            iwm_modereg_w(device, data);
271360         }
272         else if (!iwm_enable2())
361         else if (!iwm_enable2(device))
273362         {
274363            /*
275364             * Right now, this function assumes latch mode; which is always used for
r2543r2544
278367             */
279368            if (LOG_APPLEFDC)
280369            {
281               if ((iwm_mode & IWM_MODE_LATCHMODE) == 0)
370               if ((fdc->mode & IWM_MODE_LATCHMODE) == 0)
282371                  logerror("applefdc_write_reg(): latch mode off not implemented\n");
283372            }
284373
285            if (iwm_intf.write_data)
286               iwm_intf.write_data(data);
374            if (intf->write_data != NULL)
375               intf->write_data(data);
287376         }
288377         break;
289378   }
r2543r2544
298387
299388static TIMER_CALLBACK(iwm_turnmotor_onoff)
300389{
390   const device_config *device = (const device_config *) ptr;
391   applefdc_token *fdc = get_token(device);
392   const applefdc_interface *intf = get_interface(device);
301393   int status = param;
302394   int enable_lines;
303395
304   if (status)
396   if (status != 0)
305397   {
306      applefdc_lines |= IWM_MOTOR;
307      enable_lines = (applefdc_lines & IWM_DRIVE) ? 2 : 1;
398      fdc->lines |= IWM_MOTOR;
399      enable_lines = (fdc->lines & IWM_DRIVE) ? 2 : 1;
308400   }
309401   else
310402   {
311      applefdc_lines &= ~IWM_MOTOR;
403      fdc->lines &= ~IWM_MOTOR;
312404
313      if (iwm_intf.type == APPLEFDC_APPLE2)
314         enable_lines = (applefdc_lines & IWM_DRIVE) ? 2 : 1;
405      if (fdc->type == APPLEFDC_APPLE2)
406         enable_lines = (fdc->lines & IWM_DRIVE) ? 2 : 1;
315407      else
316408         enable_lines = 0;
317409   }
318410
319411   /* invoke callback, if present */
320   if (iwm_intf.set_enable_lines)
321      iwm_intf.set_enable_lines(enable_lines);
412   if (intf->set_enable_lines != NULL)
413      intf->set_enable_lines(enable_lines);
322414
323415   if (LOG_APPLEFDC_EXTRA)
324416      logerror("iwm_turnmotor_onoff(): Turning motor %s\n", status ? "on" : "off");
r2543r2544
330422    iwm_access
331423-------------------------------------------------*/
332424
333static void iwm_access(int offset)
425static void iwm_access(const device_config *device, int offset)
334426{
335427   static const char *const lines[] =
336428   {
r2543r2544
344436      "Q7"
345437   };
346438
439   applefdc_token *fdc = get_token(device);
440   const applefdc_interface *intf = get_interface(device);
441
347442   if (LOG_APPLEFDC_EXTRA)
348443   {
349444      logerror("iwm_access(): %s line %s\n",
r2543r2544
351446   }
352447
353448   if (offset & 1)
354      applefdc_lines |= (1 << (offset >> 1));
449      fdc->lines |= (1 << (offset >> 1));
355450   else
356      applefdc_lines &= ~(1 << (offset >> 1));
451      fdc->lines &= ~(1 << (offset >> 1));
357452
358   if ((offset < 0x08) && iwm_intf.set_lines)
359      iwm_intf.set_lines(applefdc_lines & 0x0f);
453   if ((offset < 0x08) && (intf->set_lines != NULL))
454      intf->set_lines(fdc->lines & 0x0f);
360455
361456   switch(offset)
362457   {
363458      case 0x08:
364         /* Turn off motor */
365         timer_adjust_oneshot(motor_timer,
366            (iwm_mode & IWM_MODE_MOTOROFFDELAY) ? attotime_zero : ATTOTIME_IN_SEC(1), 0);
459         /* turn off motor */
460         timer_adjust_oneshot(fdc->motor_timer,
461            (fdc->mode & IWM_MODE_MOTOROFFDELAY) ? attotime_zero : ATTOTIME_IN_SEC(1), 0);
367462         break;
368463
369464      case 0x09:
370         /* Turn on motor */
371         timer_adjust_oneshot(motor_timer, attotime_zero, 1);
465         /* turn on motor */
466         timer_adjust_oneshot(fdc->motor_timer, attotime_zero, 1);
372467         break;
373468
374469      case 0x0A:
375470         /* turn off IWM_DRIVE */
376         if ((applefdc_lines & IWM_MOTOR) && iwm_intf.set_enable_lines)
377            iwm_intf.set_enable_lines(1);
471         if ((fdc->lines & IWM_MOTOR) && (intf->set_enable_lines != NULL))
472            intf->set_enable_lines(1);
378473         break;
379474
380475      case 0x0B:
381476         /* turn on IWM_DRIVE */
382         if ((applefdc_lines & IWM_MOTOR) && iwm_intf.set_enable_lines)
383            iwm_intf.set_enable_lines(2);
477         if ((fdc->lines & IWM_MOTOR) && (intf->set_enable_lines != NULL))
478            intf->set_enable_lines(2);
384479         break;
385480   }
386481}
r2543r2544
391486    applefdc_r - reads a byte from the FDC
392487-------------------------------------------------*/
393488
394READ8_HANDLER( applefdc_r )
489READ8_DEVICE_HANDLER( applefdc_r )
395490{
491   applefdc_token *fdc = get_token(device);
492   const applefdc_interface *intf = get_interface(device);
396493   UINT8 result = 0;
397494
398495   /* normalize offset */
r2543r2544
401498   if (LOG_APPLEFDC_EXTRA)
402499      logerror("applefdc_r: offset=%i\n", offset);
403500
404   iwm_access(offset);
501   iwm_access(device, offset);
405502
406   switch(iwm_intf.type)
503   switch(fdc->type)
407504   {
408505      case APPLEFDC_APPLE2:
409506         switch(offset)
410507         {
411508            case 0x0C:
412               if (applefdc_lines & IWM_Q7)
509               if (fdc->lines & IWM_Q7)
413510               {
414                  if (iwm_intf.write_data)
415                     iwm_intf.write_data(applefdc_writebyte);
511                  if (intf->write_data != NULL)
512                     intf->write_data(fdc->write_byte);
416513                  result = 0;
417514               }
418515               else
419                  result = applefdc_read_reg(0);
516                  result = applefdc_read_reg(device, 0);
420517
421518               break;
422519            case 0x0D:
423               result = applefdc_read_reg(IWM_Q6);
520               result = applefdc_read_reg(device, IWM_Q6);
424521               break;
425522            case 0x0E:
426               result = applefdc_read_reg(IWM_Q7);
523               result = applefdc_read_reg(device, IWM_Q7);
427524               break;
428525            case 0x0F:
429               result = applefdc_read_reg(IWM_Q7 | IWM_Q6);
526               result = applefdc_read_reg(device, IWM_Q7 | IWM_Q6);
430527               break;
431528         }
432529         break;
433530
434531      case APPLEFDC_IWM:
435532         if ((offset & 1) == 0)
436            result = applefdc_read_reg(applefdc_lines & (IWM_Q6 | IWM_Q7));
533            result = applefdc_read_reg(device, fdc->lines & (IWM_Q6 | IWM_Q7));
437534         break;
438535
439536      case APPLEFDC_SWIM:
r2543r2544
449546    applefdc_w - writes a byte to the FDC
450547-------------------------------------------------*/
451548
452WRITE8_HANDLER( applefdc_w )
549WRITE8_DEVICE_HANDLER( applefdc_w )
453550{
551   applefdc_token *fdc = get_token(device);
552   const applefdc_interface *intf = get_interface(device);
553
454554   /* normalize offset */
455555   offset &= 15;
456556
457557   if (LOG_APPLEFDC_EXTRA)
458558      logerror("applefdc_w: offset=%i data=0x%02x\n", offset, data);
459559
460   iwm_access(offset);
560   iwm_access(device, offset);
461561
462   switch(iwm_intf.type)
562   switch(fdc->type)
463563   {
464564      case APPLEFDC_APPLE2:
465565         switch(offset)
466566         {
467567            case 0x0C:
468               if (applefdc_lines & IWM_Q7)
568               if (fdc->lines & IWM_Q7)
469569               {
470                  if (iwm_intf.write_data)
471                     iwm_intf.write_data(applefdc_writebyte);
570                  if (intf->write_data != NULL)
571                     intf->write_data(fdc->write_byte);
472572               }
473573               break;
474574
475575            case 0x0D:
476               applefdc_writebyte = data;
576               fdc->write_byte = data;
477577               break;
478578         }
479579         break;
480580
481581      case APPLEFDC_IWM:
482582         if (offset & 1)
483            applefdc_write_reg(data);
583            applefdc_write_reg(device, data);
484584         break;
485585
486586      case APPLEFDC_SWIM:
r2543r2544
495595    applefdc_w - writes a byte to the FDC
496596-------------------------------------------------*/
497597
498UINT8 applefdc_get_lines(void)
598UINT8 applefdc_get_lines(const device_config *device)
499599{
500   return applefdc_lines & 0x0f;
600   applefdc_token *fdc = get_token(device);
601   return fdc->lines & 0x0f;
501602}
603
604
605
606/***************************************************************************
607    INTERFACE
608***************************************************************************/
609
610/*-------------------------------------------------
611    DEVICE_GET_INFO(applefdc_base) - device get info
612    callback
613-------------------------------------------------*/
614
615static DEVICE_GET_INFO(applefdc_base)
616{
617   switch (state)
618   {
619      /* --- the following bits of info are returned as 64-bit signed integers --- */
620      case DEVINFO_INT_TOKEN_BYTES:               info->i = sizeof(applefdc_token);         break;
621      case DEVINFO_INT_INLINE_CONFIG_BYTES:         info->i = 0;                        break;
622      case DEVINFO_INT_CLASS:                     info->i = DEVICE_CLASS_PERIPHERAL;         break;
623
624      /* --- the following bits of info are returned as pointers to data or functions --- */
625      case DEVINFO_FCT_START:                     /* Nothing */                        break;
626      case DEVINFO_FCT_STOP:                     /* Nothing */                        break;
627      case DEVINFO_FCT_RESET:                     info->reset = DEVICE_RESET_NAME(applefdc);   break;
628
629      /* --- the following bits of info are returned as NULL-terminated strings --- */
630      case DEVINFO_STR_FAMILY:                  info->s = "Apple FDC";                  break;
631      case DEVINFO_STR_VERSION:                  info->s = "1.0";                     break;
632      case DEVINFO_STR_SOURCE_FILE:               info->s = __FILE__;                     break;
633   }
634}
635
636
637
638/*-------------------------------------------------
639    DEVICE_START(oldfdc) - device start
640    callback
641-------------------------------------------------*/
642
643static DEVICE_START(oldfdc)
644{
645   applefdc_start(device, APPLEFDC_APPLE2);
646}
647
648
649
650/*-------------------------------------------------
651    DEVICE_GET_INFO(applefdc) - device get info
652    callback
653-------------------------------------------------*/
654
655DEVICE_GET_INFO(applefdc)
656{
657   switch (state)
658   {
659      /* --- the following bits of info are returned as NULL-terminated strings --- */
660      case DEVINFO_STR_NAME:                     info->s = "Apple FDC";            break;
661
662      /* --- the following bits of info are returned as pointers to data or functions --- */
663      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME(oldfdc);   break;
664
665      default:                               DEVICE_GET_INFO_CALL(applefdc_base);   break;
666   }
667}
668
669
670
671/*-------------------------------------------------
672    DEVICE_START(iwm) - device start
673    callback
674-------------------------------------------------*/
675
676static DEVICE_START(iwm)
677{
678   applefdc_start(device, APPLEFDC_IWM);
679}
680
681
682
683/*-------------------------------------------------
684    DEVICE_GET_INFO(iwm) - device get info
685    callback
686-------------------------------------------------*/
687
688DEVICE_GET_INFO(iwm)
689{
690   switch (state)
691   {
692      /* --- the following bits of info are returned as NULL-terminated strings --- */
693      case DEVINFO_STR_NAME:                     info->s = "Apple IWM (Integrated Woz Machine)";            break;
694
695      /* --- the following bits of info are returned as pointers to data or functions --- */
696      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME(iwm);   break;
697
698      default:                               DEVICE_GET_INFO_CALL(applefdc_base);   break;
699   }
700}
701
702
703
704/*-------------------------------------------------
705    DEVICE_START(iwm) - device start
706    callback
707-------------------------------------------------*/
708
709static DEVICE_START(swim)
710{
711   applefdc_start(device, APPLEFDC_SWIM);
712}
713
714
715
716/*-------------------------------------------------
717    DEVICE_GET_INFO(swim) - device get info
718    callback
719-------------------------------------------------*/
720
721DEVICE_GET_INFO(swim)
722{
723   switch (state)
724   {
725      /* --- the following bits of info are returned as NULL-terminated strings --- */
726      case DEVINFO_STR_NAME:                     info->s = "Apple SWIM (Steve Woz Integrated Machine)";            break;
727
728      /* --- the following bits of info are returned as pointers to data or functions --- */
729      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME(swim);   break;
730
731      default:                               DEVICE_GET_INFO_CALL(applefdc_base);   break;
732   }
733}
src/mess/machine/applefdc.h
r2543r2544
2727#define APPLEFDC_PH2   0x04
2828#define APPLEFDC_PH3   0x08
2929
30#define APPLEFDC   DEVICE_GET_INFO_NAME( applefdc )
31#define IWM         DEVICE_GET_INFO_NAME( iwm )
32#define SWIM      DEVICE_GET_INFO_NAME( swim )
3033
3134
35
3236/***************************************************************************
3337    TYPE DEFINITIONS
3438***************************************************************************/
3539
36typedef enum
37{
38   APPLEFDC_APPLE2,   /* classic Apple II disk controller (pre-IWM) */
39   APPLEFDC_IWM,      /* Integrated Woz Machine */
40   APPLEFDC_SWIM      /* Steve Woz Integrated Machine (NYI) */
41} applefdc_t;
42
43
4440typedef struct _applefdc_interface applefdc_interface;
4541struct _applefdc_interface
4642{
47   applefdc_t type;
4843   void (*set_lines)(UINT8 lines);
4944   void (*set_enable_lines)(int enable_mask);
5045
r2543r2544
5954    PROTOTYPES
6055***************************************************************************/
6156
62void applefdc_init(const applefdc_interface *intf);
63READ8_HANDLER( applefdc_r );
64WRITE8_HANDLER( applefdc_w );
65UINT8 applefdc_get_lines(void);
57/* classic Apple II disk controller (pre-IWM) */
58DEVICE_GET_INFO(applefdc);   
6659
60/* Integrated Woz Machine */
61DEVICE_GET_INFO(iwm);
6762
63/* Steve Woz Integrated Machine (NYI) */
64DEVICE_GET_INFO(swim);   
65
66/* read/write handlers */
67READ8_DEVICE_HANDLER(applefdc_r);
68WRITE8_DEVICE_HANDLER(applefdc_w);
69
70/* accessor */
71UINT8 applefdc_get_lines(const device_config *device);
72
73
6874#endif /* __APPLEFDC_H__ */
src/mess/machine/ap2_slot.c
r0r2544
1/*********************************************************************
2
3   ap2_slot.c
4
5   Implementation of Apple II device slots
6
7*********************************************************************/
8
9#include "ap2_slot.h"
10
11
12/***************************************************************************
13    TYPE DEFINITIONS
14***************************************************************************/
15
16typedef struct _apple2_slot_token apple2_slot_token;
17struct _apple2_slot_token
18{
19   const device_config *slot_device;
20};
21
22
23
24/***************************************************************************
25    INLINE FUNCTIONS
26***************************************************************************/
27
28INLINE void assert_valid(const device_config *device)
29{
30   assert(device != NULL);
31   assert(device->type == APPLE2_SLOT);
32}
33
34
35
36INLINE const apple2_slot_config *get_config(const device_config *device)
37{
38   assert_valid(device);
39   return (const apple2_slot_config *) device->inline_config;
40}
41
42
43
44INLINE apple2_slot_token *get_token(const device_config *device)
45{
46   assert_valid(device);
47   return (apple2_slot_token *) device->token;
48}
49
50
51
52/***************************************************************************
53    CORE IMPLEMENTATION
54***************************************************************************/
55
56/*-------------------------------------------------
57    apple2_slot - looks up a slot
58-------------------------------------------------*/
59
60const device_config *apple2_slot(running_machine *machine, int slotnum)
61{
62   char buffer[7];
63
64   assert((slotnum >= 0) && (slotnum <= 7));
65   snprintf(buffer, ARRAY_LENGTH(buffer), "slot_%d", slotnum);
66   
67   return device_list_find_by_tag(
68      machine->config->devicelist,
69      APPLE2_SLOT,
70      buffer);
71}
72
73
74
75/*-------------------------------------------------
76    DEVICE_START(apple2_slot) - device start
77   function
78-------------------------------------------------*/
79
80static DEVICE_START(apple2_slot)
81{
82   const apple2_slot_config *config = get_config(device);
83   apple2_slot_token *token = get_token(device);
84
85   if (config->tag != NULL)
86   {
87      /* locate the device */
88      token->slot_device = device_list_find_by_tag(
89         device->machine->config->devicelist,
90         DEVICE_TYPE_WILDCARD,
91         config->tag);
92
93      assert(token->slot_device != NULL);
94   }
95   else
96   {
97      token->slot_device = NULL;
98   }
99}
100
101
102
103/*-------------------------------------------------
104    apple2_slot_r - slot read function
105-------------------------------------------------*/
106
107READ8_DEVICE_HANDLER(apple2_slot_r)
108{
109   UINT8 result = 0x00;
110   const apple2_slot_config *config = get_config(device);
111   apple2_slot_token *token = get_token(device);
112
113   /* do we actually have a device, and can we read? */
114   if ((token->slot_device != NULL) && (config->rh != NULL))
115   {
116      result = (*config->rh)(token->slot_device, offset);
117   }
118
119   return result;
120}
121
122
123
124/*-------------------------------------------------
125    apple2_slot_w - slot write function
126-------------------------------------------------*/
127
128WRITE8_DEVICE_HANDLER(apple2_slot_w)
129{
130   const apple2_slot_config *config = get_config(device);
131   apple2_slot_token *token = get_token(device);
132
133   /* do we actually have a device, and can we read? */
134   if ((token->slot_device != NULL) && (config->wh != NULL))
135   {
136      (*config->wh)(token->slot_device, offset, data);
137   }
138}
139
140
141
142/*-------------------------------------------------
143    DEVICE_GET_INFO(apple2_slot) - device get info
144   function
145-------------------------------------------------*/
146
147DEVICE_GET_INFO(apple2_slot)
148{
149   switch (state)
150   {
151      /* --- the following bits of info are returned as 64-bit signed integers --- */
152      case DEVINFO_INT_TOKEN_BYTES:               info->i = sizeof(apple2_slot_token);      break;
153      case DEVINFO_INT_INLINE_CONFIG_BYTES:         info->i = sizeof(apple2_slot_config);      break;
154      case DEVINFO_INT_CLASS:                     info->i = DEVICE_CLASS_PERIPHERAL;         break;
155
156      /* --- the following bits of info are returned as pointers to data or functions --- */
157      case DEVINFO_FCT_SET_INFO:                  /* Nothing */                        break;
158      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME(apple2_slot);   break;
159      case DEVINFO_FCT_STOP:                     /* Nothing */                        break;
160      case DEVINFO_FCT_RESET:                     /* Nothing */                        break;
161
162      /* --- the following bits of info are returned as NULL-terminated strings --- */
163      case DEVINFO_STR_NAME:                     info->s = "Apple II Slot";               break;
164      case DEVINFO_STR_FAMILY:                  info->s = "Apple II Slot";               break;
165      case DEVINFO_STR_VERSION:                  info->s = "1.0";                     break;
166      case DEVINFO_STR_SOURCE_FILE:               info->s = __FILE__;                     break;
167   }
168}
src/mess/machine/mockngbd.c
r0r2544
1/*********************************************************************
2
3   mockngbd.c
4
5   Implementation of the Apple II Mockingboard
6
7   TODO - When sound cores and the 6522 VIA become devices, and devices
8   can contain other devices, start containing AY8910 and 6522VIA
9   implementations
10
11*********************************************************************/
12
13#include "mockngbd.h"
14#include "sound/ay8910.h"
15
16
17/***************************************************************************
18    PARAMETERS
19***************************************************************************/
20
21#define LOG_MOCKINGBOARD   0
22
23
24/***************************************************************************
25    TYPE DEFINITIONS
26***************************************************************************/
27
28typedef struct _mockingboard_token mockingboard_token;
29struct _mockingboard_token
30{
31   UINT8 flip1;
32   UINT8 flip2;
33   UINT8 latch0;
34   UINT8 latch1;
35};
36
37
38/***************************************************************************
39    INLINE FUNCTIONS
40***************************************************************************/
41
42INLINE mockingboard_token *get_token(const device_config *device)
43{
44   assert(device != NULL);
45   assert(device->type == MOCKINGBOARD);
46   return (mockingboard_token *) device->token;
47}
48
49
50
51/***************************************************************************
52    FUNCTION PROTOTYPES
53***************************************************************************/
54
55/*-------------------------------------------------
56    DEVICE_START(mockingboard) - device start
57   function
58-------------------------------------------------*/
59
60static DEVICE_START(mockingboard)
61{
62}
63
64
65
66/*-------------------------------------------------
67    DEVICE_RESET(mockingboard) - device reset
68   function
69-------------------------------------------------*/
70
71static DEVICE_RESET(mockingboard)
72{
73   mockingboard_token *token = get_token(device);
74   token->flip1 = 0x00;
75   token->flip2 = 0x00;
76   token->latch0 = 0x00;
77   token->latch1 = 0x00;
78
79   /* TODO: fix this */
80   /* What follows is pure filth. It abuses the core like an angry pimp on a bad hair day. */
81
82   /* Since we know that the Mockingboard has no code ROM, we'll copy into the slot ROM space
83      an image of the onboard ROM so that when an IRQ bankswitches to the onboard ROM, we read
84      the proper stuff. Without this, it will choke and try to use the memory handler above, and
85      fail miserably. That should really be fixed. I beg you -- if you are reading this comment,
86      fix this :) */
87//   memcpy (apple2_slotrom(slot), &apple_rom[0x0000 + (slot * 0x100)], 0x100);
88}
89
90
91
92/*-------------------------------------------------
93    mockingboard_r - device read function
94-------------------------------------------------*/
95
96READ8_DEVICE_HANDLER(mockingboard_r)
97{
98   UINT8 result = 0x00;
99   mockingboard_token *token = get_token(device);
100
101   switch (offset)
102   {
103      /* This is used to ID the board */
104      case 0x04:
105         token->flip1 ^= 0x08;
106         result = token->flip1;
107         break;
108
109      case 0x84:
110         token->flip2 ^= 0x08;
111         result = token->flip2;
112         break;
113
114      default:
115         if (LOG_MOCKINGBOARD)
116            logerror("mockingboard_r unmapped, offset: %02x, pc: %04x\n", offset, (unsigned) cpunum_get_reg(0, REG_PC));
117         break;
118   }
119   return 0x00;
120}
121
122
123
124/*-------------------------------------------------
125    mockingboard_w - device write function
126-------------------------------------------------*/
127
128WRITE8_DEVICE_HANDLER(mockingboard_w)
129{
130   mockingboard_token *token = get_token(device);
131
132   if (LOG_MOCKINGBOARD)
133      logerror("mockingboard_w, $%02x:%02x\n", offset, data);
134
135   /* There is a 6522 in here which interfaces to the 8910s */
136   switch (offset)
137   {
138      case 0x00: /* ORB1 */
139         switch (data)
140         {
141            case 0x00: /* reset */
142               sndti_reset(SOUND_AY8910, 0);
143               break;
144            case 0x04: /* make inactive */
145               break;
146            case 0x06: /* write data */
147               AY8910_write_port_0_w(device->machine, 0, token->latch0);
148               break;
149            case 0x07: /* set register */
150               AY8910_control_port_0_w(device->machine, 0, token->latch0);
151               break;
152         }
153         break;
154
155      case 0x01: /* ORA1 */
156         token->latch0 = data;
157         break;
158
159      case 0x02: /* DDRB1 */
160      case 0x03: /* DDRA1 */
161         break;
162
163      case 0x80: /* ORB2 */
164         switch (data)
165         {
166            case 0x00: /* reset */
167               sndti_reset(SOUND_AY8910, 1);
168               break;
169            case 0x04: /* make inactive */
170               break;
171            case 0x06: /* write data */
172               AY8910_write_port_1_w(device->machine, 0, token->latch1);
173               break;
174            case 0x07: /* set register */
175               AY8910_control_port_1_w(device->machine, 0, token->latch1);
176               break;
177         }
178         break;
179
180      case 0x81: /* ORA2 */
181         token->latch1 = data;
182         break;
183
184      case 0x82: /* DDRB2 */
185      case 0x83: /* DDRA2 */
186         break;
187   }
188}
189
190
191
192/*-------------------------------------------------
193    DEVICE_GET_INFO(mockingboard) - device get info
194   function
195-------------------------------------------------*/
196
197DEVICE_GET_INFO(mockingboard)
198{
199   switch (state)
200   {
201      /* --- the following bits of info are returned as 64-bit signed integers --- */
202      case DEVINFO_INT_TOKEN_BYTES:               info->i = sizeof(mockingboard_token);      break;
203      case DEVINFO_INT_INLINE_CONFIG_BYTES:         info->i = 0;                        break;
204      case DEVINFO_INT_CLASS:                     info->i = DEVICE_CLASS_PERIPHERAL;         break;
205
206      /* --- the following bits of info are returned as pointers to data or functions --- */
207      case DEVINFO_FCT_SET_INFO:                  /* Nothing */                        break;
208      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME(mockingboard);   break;
209      case DEVINFO_FCT_STOP:                     /* Nothing */                        break;
210      case DEVINFO_FCT_RESET:                     info->reset = DEVICE_RESET_NAME(mockingboard);   break;
211
212      /* --- the following bits of info are returned as NULL-terminated strings --- */
213      case DEVINFO_STR_NAME:                     info->s = "Apple II Mockingboard";         break;
214      case DEVINFO_STR_FAMILY:                  info->s = "Apple II Mockingboard";         break;
215      case DEVINFO_STR_VERSION:                  info->s = "1.0";                     break;
216      case DEVINFO_STR_SOURCE_FILE:               info->s = __FILE__;                     break;
217   }
218}
src/mess/machine/apple3.c
r2543r2544
119119
120120static READ8_HANDLER( apple3_c0xx_r )
121121{
122   const device_config *fdc = device_list_find_by_tag(machine->config->devicelist,
123      APPLEFDC,
124      "fdc");
122125   UINT8 result = 0xFF;
126
123127   switch(offset)
124128   {
125129      case 0x00: case 0x01: case 0x02: case 0x03:
r2543r2544
184188      case 0xE4: case 0xE5: case 0xE6: case 0xE7:
185189      case 0xE8: case 0xE9: case 0xEA: case 0xEB:
186190      case 0xEC: case 0xED: case 0xEE: case 0xEF:
187         result = applefdc_r(machine, offset);
191         result = applefdc_r(fdc, offset);
188192         break;
189193
190194      case 0xF0:
r2543r2544
201205
202206static WRITE8_HANDLER( apple3_c0xx_w )
203207{
208   const device_config *fdc = device_list_find_by_tag(machine->config->devicelist,
209      IWM,
210      "fdc");
204211   switch(offset)
205212   {
206213      case 0x10: case 0x11: case 0x12: case 0x13:
r2543r2544
245252      case 0xE4: case 0xE5: case 0xE6: case 0xE7:
246253      case 0xE8: case 0xE9: case 0xEA: case 0xEB:
247254      case 0xEC: case 0xED: case 0xEE: case 0xEF:
248         applefdc_w(machine, offset, data);
255         applefdc_w(fdc, offset, data);
249256         break;
250257
251258      case 0xF0:
r2543r2544
688695
689696
690697
691static const applefdc_interface apple3_fdc_interface =
698const applefdc_interface apple3_fdc_interface =
692699{
693   APPLEFDC_APPLE2,
694700   apple525_set_lines,
695701   apple3_set_enable_lines,
696702   apple525_read_data,
r2543r2544
705711   memory_region(REGION_CPU1)[0x0685] = 0x00;
706712
707713   apple3_enable_mask = 0;
708   applefdc_init(&apple3_fdc_interface);
709714   apple3_update_drives();
710715
711716   acia_6551_init();
src/mess/machine/ap2_slot.h
r0r2544
1/*********************************************************************
2
3   ap2_slot.h
4
5   Implementation of Apple II device slots
6
7*********************************************************************/
8
9#ifndef __AP2_SLOT__
10#define __AP2_SLOT__
11
12#include "driver.h"
13
14
15/***************************************************************************
16    CONSTANTS
17***************************************************************************/
18
19#define APPLE2_SLOT      DEVICE_GET_INFO_NAME(apple2_slot)
20
21
22
23/***************************************************************************
24    TYPE DEFINITIONS
25***************************************************************************/
26
27typedef struct _apple2_slot_config apple2_slot_config;
28struct _apple2_slot_config
29{
30   const char *tag;
31   read8_device_func rh;
32   write8_device_func wh;
33};
34
35
36
37/***************************************************************************
38    DEVICE CONFIGURATION MACROS
39***************************************************************************/
40
41#define MDRV_APPLE2_SLOT_ADD(_slot_number, _slot_device_tag, _rh, _wh)      \
42   MDRV_DEVICE_ADD("slot_" #_slot_number, APPLE2_SLOT)         \
43   MDRV_DEVICE_CONFIG_DATAPTR(apple2_slot_config, tag, _slot_device_tag)   \
44   MDRV_DEVICE_CONFIG_DATAPTR(apple2_slot_config, rh, _rh)      \
45   MDRV_DEVICE_CONFIG_DATAPTR(apple2_slot_config, wh, _wh)      \
46
47
48
49/***************************************************************************
50    FUNCTION PROTOTYPES
51***************************************************************************/
52
53/* device get info function */
54DEVICE_GET_INFO(apple2_slot);   
55
56/* slot read function */
57READ8_DEVICE_HANDLER(apple2_slot_r);
58
59/* slot write function */
60WRITE8_DEVICE_HANDLER(apple2_slot_w);
61
62/* slot device lookup */
63const device_config *apple2_slot(running_machine *machine, int slotnum);
64
65#endif /* __AP2_SLOT__ */
src/mess/machine/mockngbd.h
r0r2544
1/*********************************************************************
2
3   mockngbd.h
4
5   Implementation of the Apple II Mockingboard
6
7*********************************************************************/
8
9#ifndef __MOCKNGBD__
10#define __MOCKNGBD__
11
12#include "driver.h"
13
14
15/***************************************************************************
16    CONSTANTS
17***************************************************************************/
18
19#define MOCKINGBOARD      DEVICE_GET_INFO_NAME(mockingboard)
20
21
22/***************************************************************************
23    FUNCTION PROTOTYPES
24***************************************************************************/
25
26/* device get info function */
27DEVICE_GET_INFO(mockingboard);   
28
29/* slot read function */
30READ8_DEVICE_HANDLER(mockingboard_r);
31
32/* slot write function */
33WRITE8_DEVICE_HANDLER(mockingboard_w);
34
35
36#endif /* __MOCKNGBD__ */
src/mess/machine/ap2_lang.c
r0r2544
1/*********************************************************************
2
3   ap2_lang.c
4
5   Implementation of the Apple II Language Card
6
7*********************************************************************/
8
9#include "driver.h"
10#include "includes/apple2.h"
11#include "ap2_lang.h"
12
13
14/***************************************************************************
15    PARAMETERS
16***************************************************************************/
17
18#define LOG_LANGCARD   0
19
20
21
22/***************************************************************************
23    CORE IMPLEMENTATION
24***************************************************************************/
25
26/*-------------------------------------------------
27    apple2_langcard_touch - device read callback
28-------------------------------------------------*/
29
30static void apple2_langcard_touch(const device_config *device, offs_t offset)
31{
32   UINT32 val, mask;
33
34   if (LOG_LANGCARD)
35      logerror("language card bankswitch read, offset: $c08%0x\n", offset);
36
37   /* determine which flags to change */
38   mask = VAR_LCWRITE | VAR_LCRAM | VAR_LCRAM2;
39   val = 0;
40
41   if (offset & 0x01)
42      val |= VAR_LCWRITE;
43
44   switch(offset & 0x03)
45   {
46      case 0x03:
47      case 0x00:
48         val |= VAR_LCRAM;
49         break;
50   }
51
52   if ((offset & 0x08) == 0)
53      val |= VAR_LCRAM2;
54
55   /* change the flags */
56   apple2_setvar(val, mask);
57}
58
59
60
61/*-------------------------------------------------
62    apple2_langcard_r - device read callback
63-------------------------------------------------*/
64
65READ8_DEVICE_HANDLER(apple2_langcard_r)
66{
67   apple2_langcard_touch(device, offset);
68   return 0x00;
69}
70
71
72
73/*-------------------------------------------------
74    apple2_langcard_w - device read callback
75-------------------------------------------------*/
76
77WRITE8_DEVICE_HANDLER(apple2_langcard_w)
78{
79   apple2_langcard_touch(device, offset);
80}
81
82
83
84/*-------------------------------------------------
85    DEVICE_START(apple2_langcard) - device start
86   function
87-------------------------------------------------*/
88
89static DEVICE_START(apple2_langcard)
90{
91   /* nothing to do */
92}
93
94
95
96/*-------------------------------------------------
97    DEVICE_GET_INFO(apple2_langcard) - device get info
98   function
99-------------------------------------------------*/
100
101DEVICE_GET_INFO(apple2_langcard)
102{
103   switch (state)
104   {
105      /* --- the following bits of info are returned as 64-bit signed integers --- */
106      case DEVINFO_INT_TOKEN_BYTES:               info->i = 1;                        break;
107      case DEVINFO_INT_INLINE_CONFIG_BYTES:         info->i = 0;                        break;
108      case DEVINFO_INT_CLASS:                     info->i = DEVICE_CLASS_PERIPHERAL;         break;
109
110      /* --- the following bits of info are returned as pointers to data or functions --- */
111      case DEVINFO_FCT_SET_INFO:                  /* Nothing */                        break;
112      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME(apple2_langcard);   break;
113      case DEVINFO_FCT_STOP:                     /* Nothing */                        break;
114      case DEVINFO_FCT_RESET:                     /* Nothing */                        break;
115
116      /* --- the following bits of info are returned as NULL-terminated strings --- */
117      case DEVINFO_STR_NAME:                     info->s = "Apple II Language Card";         break;
118      case DEVINFO_STR_FAMILY:                  info->s = "Apple II Language Card";         break;
119      case DEVINFO_STR_VERSION:                  info->s = "1.0";                     break;
120      case DEVINFO_STR_SOURCE_FILE:               info->s = __FILE__;                     break;
121   }
122}
src/mess/machine/ap2_lang.h
r0r2544
1/*********************************************************************
2
3   ap2_lang.h
4
5   Implementation of the Apple II Language Card
6
7*********************************************************************/
8
9#ifndef __AP2_LANG__
10#define __AP2_LANG__
11
12#include "driver.h"
13
14
15/***************************************************************************
16    CONSTANTS
17***************************************************************************/
18
19#define APPLE2_LANGCARD      DEVICE_GET_INFO_NAME(apple2_langcard)
20
21
22
23/***************************************************************************
24    FUNCTION PROTOTYPES
25***************************************************************************/
26
27/* device get info function */
28DEVICE_GET_INFO(apple2_langcard);   
29
30/* slot read function */
31READ8_DEVICE_HANDLER(apple2_langcard_r);
32
33/* slot write function */
34WRITE8_DEVICE_HANDLER(apple2_langcard_w);
35
36#endif /* __AP2_LANG__ */
src/mess/machine/oric.c
r2543r2544
495495
496496static void oric_install_apple2_interface(running_machine *machine)
497497{
498   const device_config *fdc = device_list_find_by_tag(machine->config->devicelist,
499      APPLEFDC,
500      "fdc");
501
498502   memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0300, 0x030f, 0, 0, oric_IO_r);
499   memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0310, 0x031f, 0, 0, applefdc_r);
503   memory_install_read8_device_handler(fdc, 0, ADDRESS_SPACE_PROGRAM, 0x0310, 0x031f, 0, 0, applefdc_r);
500504   memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0320, 0x03ff, 0, 0, SMH_BANK4);
501505
502506   memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0300, 0x030f, 0, 0, oric_IO_w);
503   memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0310, 0x031f, 0, 0, applefdc_w);
507   memory_install_write8_device_handler(fdc, 0, ADDRESS_SPACE_PROGRAM, 0x0310, 0x031f, 0, 0, applefdc_w);
504508   memory_set_bankptr(4,    memory_region(REGION_CPU1) + 0x014000 + 0x020);
505509}
506510
r2543r2544
585589/* APPLE 2 INTERFACE V2 */
586590static void oric_install_apple2_v2_interface(running_machine *machine)
587591{
592   const device_config *fdc = device_list_find_by_tag(machine->config->devicelist,
593      APPLEFDC,
594      "fdc");
595
588596   memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0300, 0x030f, 0, 0, oric_IO_r);
589   memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0310, 0x031f, 0, 0, applefdc_r);
597   memory_install_read8_device_handler(fdc, 0, ADDRESS_SPACE_PROGRAM, 0x0310, 0x031f, 0, 0, applefdc_r);
590598   memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0320, 0x03ff, 0, 0, SMH_BANK4);
591599
592600   memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0300, 0x030f, 0, 0, oric_IO_w);
593   memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0310, 0x031f, 0, 0, applefdc_w);
601   memory_install_write8_device_handler(fdc, 0, ADDRESS_SPACE_PROGRAM, 0x0310, 0x031f, 0, 0, applefdc_w);
594602   memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0380, 0x0383, 0, 0, apple2_v2_interface_w);
595603
596604   apple2_v2_interface_w(machine, 0, 0);
src/mess/machine/apple2gs.c
r2543r2544
17341734
17351735MACHINE_START( apple2gs )
17361736{
1737   apple2_config cfg;
1737   apple2_init_common(machine);
17381738
1739   memset(&cfg, 0, sizeof(cfg));
1740   cfg.slots[0] = &apple2_slot_langcard;
1741   cfg.slots[4] = &apple2_slot_mockingboard;
1742   cfg.slots[6] = &apple2_slot_iwm;
1743
1744   apple2_init_common(machine, &cfg);
1745
17461739   /* set up Apple IIgs vectoring */
17471740   cpunum_set_info_fct(0, CPUINFO_PTR_G65816_READVECTOR_CALLBACK, (genf *) apple2gs_read_vector);
17481741
src/mess/machine/mac.c
r2543r2544
11/****************************************************************************
2   Mac hardware
32
4   The hardware for Mac 128k, 512k, 512ke, Plus (SCSI, SCC, etc).
3   machine/mac.c
54
5   Mac hardware - Mac 128k, 512k, 512ke, Plus (SCSI, SCC, etc)
6
67   Nate Woods
78   Ernesto Corvi
89   Raphael Nabet
r2543r2544
11131114    * this driver along
11141115    */
11151116
1116   int result = 0;
1117   UINT16 result = 0;
1118   const device_config *fdc = device_list_find_by_tag(machine->config->devicelist,
1119      IWM,
1120      "fdc");
11171121
11181122   if (LOG_MAC_IWM)
11191123      logerror("mac_iwm_r: offset=0x%08x\n", offset);
11201124
1121   result = applefdc_r(machine, offset >> 8);
1125   result = applefdc_r(fdc, offset >> 8);
11221126   return (result << 8) | result;
11231127}
11241128
11251129WRITE16_HANDLER ( mac_iwm_w )
11261130{
1131   const device_config *fdc = device_list_find_by_tag(machine->config->devicelist,
1132      IWM,
1133      "fdc");
1134
11271135   if (LOG_MAC_IWM)
11281136      logerror("mac_iwm_w: offset=0x%08x data=0x%04x\n", offset, data);
11291137
11301138   if (ACCESSING_BITS_0_7)
1131      applefdc_w(machine, offset >> 8, data & 0xff);
1139      applefdc_w(fdc, offset >> 8, data & 0xff);
11321140}
11331141
11341142/* *************************************************************************
r2543r2544
12971305   /* initialize serial */
12981306   scc_init(&mac_scc8530_interface);
12991307
1300   /* initialize floppy */
1301   {
1302      static const applefdc_interface intf =
1303      {
1304         APPLEFDC_IWM,
1305         sony_set_lines,
1306         sony_set_enable_lines,
1307
1308         sony_read_data,
1309         sony_write_data,
1310         sony_read_status
1311      };
1312
1313      applefdc_init(&intf);
1314   }
1315
13161308   /* setup the memory overlay */
13171309   set_memory_overlay(1);
13181310
src/mess/machine/lisa.c
r2543r2544
11181118   bad_parity_table = auto_malloc(0x40000);  /* 1 bit per byte of CPU RAM */
11191119}
11201120
1121static void lisa2_set_iwm_enable_lines(int enable_mask)
1122{
1123   /* E1 & E2 is connected to the Sony SEL line (?) */
1124   /*logerror("new sel line state %d\n", (enable_mask) ? 0 : 1);*/
1125   sony_set_sel_line((enable_mask) ? 0 : 1);
1126}
1127
1128static void lisa210_set_iwm_enable_lines(int enable_mask)
1129{
1130   /* E2 is connected to the Sony enable line (?) */
1131   sony_set_enable_lines(enable_mask >> 1);
1132}
1133
11341121MACHINE_RESET( lisa )
11351122{
11361123   mouse_timer = timer_alloc(handle_mouse, NULL);
r2543r2544
11821169
11831170   /* initialize floppy */
11841171   {
1185      static applefdc_interface intf =
1186      {
1187         APPLEFDC_IWM,
1188         sony_set_lines,
1189         sony_set_enable_lines,
1190
1191         sony_read_data,
1192         sony_write_data,
1193         sony_read_status
1194      };
1195
11961172      if (lisa_features.floppy_hardware == sony_lisa2)
1197      {
1198         intf.set_enable_lines = lisa2_set_iwm_enable_lines;
1199      }
1200      if (lisa_features.floppy_hardware == sony_lisa210)
1201      {
1202         intf.set_enable_lines = lisa210_set_iwm_enable_lines;
1203      }
1204
1205      applefdc_init(& intf);
1206
1207      if (lisa_features.floppy_hardware == sony_lisa2)
12081173         sony_set_enable_lines(1);   /* on lisa2, drive unit 1 is always selected (?) */
12091174   }
12101175}
r2543r2544
13351300         MT1 = offset & 1;
13361301         if (MT1 && ! oldMT1)
13371302         {
1303            const device_config *fdc = device_list_find_by_tag(machine->config->devicelist,
1304               IWM,
1305               "fdc");
1306
13381307            PWM_floppy_motor_speed = (PWM_floppy_motor_speed << 1) & 0xff;
1339            if (applefdc_get_lines() & APPLEFDC_PH0)
1308            if (applefdc_get_lines(fdc) & APPLEFDC_PH0)
13401309               PWM_floppy_motor_speed |= 1;
13411310            sony_set_speed(((256-PWM_floppy_motor_speed) * 1.3) + 237);
13421311         }
r2543r2544
13671336READ8_HANDLER ( lisa_fdc_io_r )
13681337{
13691338   int answer=0;
1339   const device_config *fdc = device_list_find_by_tag(machine->config->devicelist,
1340      IWM,
1341      "fdc");
13701342
13711343   switch ((offset & 0x0030) >> 4)
13721344   {
13731345   case 0:   /* IWM */
1374      answer = /*iwm_lisa_r*/applefdc_r(machine, offset);
1346      answer = applefdc_r(fdc, offset);
13751347      break;
13761348
13771349   case 1:   /* TTL glue */
r2543r2544
13931365
13941366WRITE8_HANDLER ( lisa_fdc_io_w )
13951367{
1368   const device_config *fdc = device_list_find_by_tag(machine->config->devicelist,
1369      IWM,
1370      "fdc");
1371
13961372   switch ((offset & 0x0030) >> 4)
13971373   {
13981374   case 0:   /* IWM */
1399      /*iwm_lisa_w*/applefdc_w(machine, offset, data);
1375      applefdc_w(fdc, offset, data);
14001376      break;
14011377
14021378   case 1:   /* TTL glue */
src/mess/machine/apple2.c
r2543r2544
1515#include "deprecat.h"
1616#include "cpu/m6502/m6502.h"
1717#include "includes/apple2.h"
18#include "machine/ap2_slot.h"
1819#include "machine/ay3600.h"
1920#include "machine/applefdc.h"
2021#include "devices/sonydriv.h"
2122#include "devices/appldriv.h"
2223#include "devices/flopdrv.h"
2324#include "sound/dac.h"
24#include "sound/ay8910.h"
2525#include "profiler.h"
2626
2727#ifdef MAME_DEBUG
r2543r2544
4646
4747
4848/* local */
49static apple2_config *a2_config;
50static void **a2_slot_tokens;
5149static int a2_speaker_state;
5250
5351static double joystick_x1_time;
r2543r2544
318316      apple2_c07x_r
319317   };
320318   UINT8 result = 0x00;
321   int slot;
319   int slotnum;
320   const device_config *slotdevice;
322321
323322   offset &= 0xFF;
324323
325324   if (offset < 0x80)
326325   {
326      /* normal handler */
327327      if (handlers[offset / 0x10])
328328         result = handlers[offset / 0x10](machine, offset % 0x10);
329329   }
330330   else
331331   {
332      slot = (offset - 0x80) / 0x10;
333      if (a2_config->slots[slot] && a2_config->slots[slot]->read)
334         result = a2_config->slots[slot]->read(machine, a2_slot_tokens[slot], offset % 0x10);
332      /* slot handler; identify the slot number */
333      slotnum = (offset - 0x80) / 0x10;
334
335      /* now identify the device */
336      slotdevice = apple2_slot(machine, slotnum);
337
338      /* and if we can, read from the slot */
339      if (slotdevice != NULL)
340         result = apple2_slot_r(slotdevice, offset % 0x10);
335341   }
336342   return result;
337343}
r2543r2544
351357      NULL,
352358      apple2_c07x_w
353359   };
354   int slot;
360   int slotnum;
361   const device_config *slotdevice;
355362
356363   offset &= 0xFF;
357364
358365   if (offset < 0x80)
359366   {
367      /* normal handler */
360368      if (handlers[offset / 0x10])
361369         handlers[offset / 0x10](machine, offset % 0x10, data);
362370   }
363371   else
364372   {
365      slot = (offset - 0x80) / 0x10;
366      if (a2_config->slots[slot] && a2_config->slots[slot]->write)
367         a2_config->slots[slot]->write(machine, a2_slot_tokens[slot], offset % 0x10, data);
373      /* slot handler; identify the slot number */
374      slotnum = (offset - 0x80) / 0x10;
375
376      /* now identify the device */
377      slotdevice = apple2_slot(machine, slotnum);
378
379      /* and if we can, write to the slot */
380      if (slotdevice != NULL)
381         apple2_slot_w(slotdevice, offset % 0x10, data);
368382   }
369383}
370384
r2543r2544
727741
728742static void apple2_reset(running_machine *machine)
729743{
730   int need_intcxrom, i;
744   int need_intcxrom;
731745
732746   need_intcxrom = !strcmp(machine->gamedrv->name, "apple2c")
733747      || !strcmp(machine->gamedrv->name, "apple2c0")
r2543r2544
744758
745759   a2_speaker_state = 0;
746760
747   /* reset slots */
748   for (i = 0; i < APPLE2_SLOT_COUNT; i++)
749   {
750      if (a2_config->slots[i])
751      {
752         if (a2_config->slots[i]->reset)
753            a2_config->slots[i]->reset(machine, a2_slot_tokens[i]);
754      }
755   }
756
757761   joystick_x1_time = joystick_y1_time = 0;
758762   joystick_x2_time = joystick_y2_time = 0;
759763}
r2543r2544
10911095
10921096
10931097
1094/***************************************************************************
1095  apple2_c08x_r
1096***************************************************************************/
1097
1098static READ8_HANDLER ( apple2_c08x_r )
1099{
1100   UINT32 val, mask;
1101
1102   profiler_mark(PROFILER_C08X);
1103   LOG(("language card bankswitch read, offset: $c08%0x\n", offset));
1104
1105   mask = VAR_LCWRITE | VAR_LCRAM | VAR_LCRAM2;
1106   val = 0;
1107
1108   if (offset & 0x01)
1109      val |= VAR_LCWRITE;
1110
1111   switch(offset & 0x03)
1112   {
1113      case 0x03:
1114      case 0x00:
1115         val |= VAR_LCRAM;
1116         break;
1117   }
1118
1119   if ((offset & 0x08) == 0)
1120      val |= VAR_LCRAM2;
1121
1122   apple2_setvar(val, mask);
1123
1124   profiler_mark(PROFILER_END);
1125   return 0;
1126}
1127
1128
1129
1130/***************************************************************************
1131  apple2_c08x_w
1132***************************************************************************/
1133
1134static WRITE8_HANDLER ( apple2_c08x_w )
1135{
1136   apple2_c08x_r(machine, offset);
1137}
1138
1139
1140
11411098/* -----------------------------------------------------------------------
1142 * Language Card
1099 * Floppy disk controller
11431100 * ----------------------------------------------------------------------- */
11441101
1145static UINT8 apple2_langcard_read(running_machine *machine, void *token, offs_t offset)
1146{
1147   return apple2_c08x_r(machine, offset);
1102static int apple2_fdc_diskreg;
11481103
1149}
1150
1151
1152
1153static void apple2_langcard_write(running_machine *machine, void *token, offs_t offset, UINT8 data)
1104static int apple2_fdc_has_35(void)
11541105{
1155   apple2_c08x_w(machine, offset, data);
1106   return device_count_tag_from_machine(Machine, "sonydriv") > 0;
11561107}
11571108
1158
1159
1160const apple2_slotdevice apple2_slot_langcard =
1109static int apple2_fdc_has_525(void)
11611110{
1162   "langcard",
1163   "Language Card",
1164   NULL,
1165   NULL,
1166   apple2_langcard_read,
1167   apple2_langcard_write
1168};
1169
1170
1171
1172/* -----------------------------------------------------------------------
1173 * Mockingboard
1174 * ----------------------------------------------------------------------- */
1175
1176static void apple2_mockingboard_reset(running_machine *machine, void *token)
1177{
1178   /* TODO: fix this */
1179   /* What follows is pure filth. It abuses the core like an angry pimp on a bad hair day. */
1180
1181   /* Since we know that the Mockingboard has no code ROM, we'll copy into the slot ROM space
1182      an image of the onboard ROM so that when an IRQ bankswitches to the onboard ROM, we read
1183      the proper stuff. Without this, it will choke and try to use the memory handler above, and
1184      fail miserably. That should really be fixed. I beg you -- if you are reading this comment,
1185      fix this :) */
1186//   memcpy (apple2_slotrom(slot), &apple_rom[0x0000 + (slot * 0x100)], 0x100);
1111   return device_count_tag_from_machine(Machine, "apple525driv") > 0;
11871112}
11881113
1189
1190
1191static UINT8 apple2_mockingboard_read(running_machine *machine, void *token, offs_t offset)
1192{
1193   static int flip1 = 0, flip2 = 0;
1194
1195   switch (offset)
1196   {
1197      /* This is used to ID the board */
1198      case 0x04:
1199         flip1 ^= 0x08;
1200         return flip1;
1201         break;
1202      case 0x84:
1203         flip2 ^= 0x08;
1204         return flip2;
1205         break;
1206      default:
1207         LOG(("mockingboard_r unmapped, offset: %02x, pc: %04x\n", offset, (unsigned) cpunum_get_reg(0, REG_PC)));
1208         break;
1209   }
1210   return 0x00;
1211}
1212
1213
1214
1215static void apple2_mockingboard_write(running_machine *machine, void *token, offs_t offset, UINT8 data)
1216{
1217   static int latch0, latch1;
1218
1219   LOG(("mockingboard_w, $%02x:%02x\n", offset, data));
1220
1221   /* There is a 6522 in here which interfaces to the 8910s */
1222   switch (offset)
1223   {
1224      case 0x00: /* ORB1 */
1225         switch (data)
1226         {
1227            case 0x00: /* reset */
1228               sndti_reset(SOUND_AY8910, 0);
1229               break;
1230            case 0x04: /* make inactive */
1231               break;
1232            case 0x06: /* write data */
1233               AY8910_write_port_0_w (machine, 0, latch0);
1234               break;
1235            case 0x07: /* set register */
1236               AY8910_control_port_0_w (machine, 0, latch0);
1237               break;
1238         }
1239         break;
1240
1241      case 0x01: /* ORA1 */
1242         latch0 = data;
1243         break;
1244
1245      case 0x02: /* DDRB1 */
1246      case 0x03: /* DDRA1 */
1247         break;
1248
1249      case 0x80: /* ORB2 */
1250         switch (data)
1251         {
1252            case 0x00: /* reset */
1253               sndti_reset(SOUND_AY8910, 1);
1254               break;
1255            case 0x04: /* make inactive */
1256               break;
1257            case 0x06: /* write data */
1258               AY8910_write_port_1_w (machine, 0, latch1);
1259               break;
1260            case 0x07: /* set register */
1261               AY8910_control_port_1_w (machine, 0, latch1);
1262               break;
1263         }
1264         break;
1265
1266      case 0x81: /* ORA2 */
1267         latch1 = data;
1268         break;
1269
1270      case 0x82: /* DDRB2 */
1271      case 0x83: /* DDRA2 */
1272         break;
1273   }
1274}
1275
1276
1277
1278const apple2_slotdevice apple2_slot_mockingboard =
1279{
1280   "mockingboard",
1281   "Mockingboard",
1282   NULL,
1283   apple2_mockingboard_reset,
1284   apple2_mockingboard_read,
1285   apple2_mockingboard_write
1286};
1287
1288
1289
1290/* -----------------------------------------------------------------------
1291 * Floppy disk controller
1292 * ----------------------------------------------------------------------- */
1293
1294static int apple2_fdc_has_35;
1295static int apple2_fdc_has_525;
1296static int apple2_fdc_diskreg;
1297
12981114static void apple2_fdc_set_lines(UINT8 lines)
12991115{
13001116   if (apple2_fdc_diskreg & 0x40)
13011117   {
1302      if (apple2_fdc_has_35)
1118      if (apple2_fdc_has_35())
13031119      {
13041120         /* slot 5: 3.5" disks */
13051121         sony_set_lines(lines);
r2543r2544
13071123   }
13081124   else
13091125   {
1310      if (apple2_fdc_has_525)
1126      if (apple2_fdc_has_525())
13111127      {
13121128         /* slot 6: 5.25" disks */
13131129         apple525_set_lines(lines);
r2543r2544
13271143   else
13281144      slot6_enable_mask = enable_mask;
13291145
1330   if (apple2_fdc_has_35)
1146   if (apple2_fdc_has_35())
13311147   {
13321148      /* set the 3.5" enable lines */
13331149      sony_set_enable_lines(slot5_enable_mask);
13341150   }
13351151
1336   if (apple2_fdc_has_525)
1152   if (apple2_fdc_has_525())
13371153   {
13381154      /* set the 5.25" enable lines */
13391155      apple525_set_enable_lines(slot6_enable_mask);
r2543r2544
13481164
13491165   if (apple2_fdc_diskreg & 0x40)
13501166   {
1351      if (apple2_fdc_has_35)
1167      if (apple2_fdc_has_35())
13521168      {
13531169         /* slot 5: 3.5" disks */
13541170         result = sony_read_data();
r2543r2544
13561172   }
13571173   else
13581174   {
1359      if (apple2_fdc_has_525)
1175      if (apple2_fdc_has_525())
13601176      {
13611177         /* slot 6: 5.25" disks */
13621178         result = apple525_read_data();
r2543r2544
13711187{
13721188   if (apple2_fdc_diskreg & 0x40)
13731189   {
1374      if (apple2_fdc_has_35)
1190      if (apple2_fdc_has_35())
13751191      {
13761192         /* slot 5: 3.5" disks */
13771193         sony_write_data(data);
r2543r2544
13791195   }
13801196   else
13811197   {
1382      if (apple2_fdc_has_525)
1198      if (apple2_fdc_has_525())
13831199      {
13841200         /* slot 6: 5.25" disks */
13851201         apple525_write_data(data);
r2543r2544
13951211
13961212   if (apple2_fdc_diskreg & 0x40)
13971213   {
1398      if (apple2_fdc_has_35)
1214      if (apple2_fdc_has_35())
13991215      {
14001216         /* slot 5: 3.5" disks */
14011217         result = sony_read_status();
r2543r2544
14031219   }
14041220   else
14051221   {
1406      if (apple2_fdc_has_525)
1222      if (apple2_fdc_has_525())
14071223      {
14081224         /* slot 6: 5.25" disks */
14091225         result = apple525_read_status();
r2543r2544
14171233void apple2_iwm_setdiskreg(UINT8 data)
14181234{
14191235   apple2_fdc_diskreg = data & 0xC0;
1420   if (apple2_fdc_has_35)
1236   if (apple2_fdc_has_35())
14211237      sony_set_sel_line(apple2_fdc_diskreg & 0x80);
14221238}
14231239
r2543r2544
14301246
14311247
14321248
1433static void *apple2_fdc_init(running_machine *machine, int slot, applefdc_t fdc_type)
1434{
1435   const device_config *dev;
1436   const struct IODevice *iodev;
1437   applefdc_interface intf;
14381249
1439   apple2_fdc_has_35 = FALSE;
1440   apple2_fdc_has_525 = FALSE;
1441   apple2_fdc_diskreg = 0x00;
1442
1443   /* setup interface */
1444   memset(&intf, 0, sizeof(intf));
1445   intf.type = fdc_type;
1446   intf.set_lines = apple2_fdc_set_lines;
1447   intf.set_enable_lines = apple2_fdc_set_enable_lines;
1448   intf.read_status = apple2_fdc_read_status;
1449   intf.read_data = apple2_fdc_read_data;
1450   intf.write_data = apple2_fdc_write_data;
1451
1452   for (dev = image_device_first(machine->config); dev != NULL; dev = image_device_next(dev))
1453   {
1454      iodev = mess_device_from_core_device(dev);
1455      if (iodev != NULL)
1456      {
1457         if (!strcmp(iodev->tag, "sonydriv"))
1458            apple2_fdc_has_35 = 1;
1459         else if (!strcmp(iodev->tag, "apple525driv"))
1460            apple2_fdc_has_525 = 1;
1461      }
1462   }
1463
1464   applefdc_init(&intf);
1465   return (void *) ~0;
1466}
1467
1468
1469
1470static void *apple2_fdc_apple2_init(running_machine *machine, int slot)
1250const applefdc_interface apple2_fdc_interface =
14711251{
1472   return apple2_fdc_init(machine, slot, APPLEFDC_APPLE2);
1473}
1252   apple2_fdc_set_lines,         /* set_lines */
1253   apple2_fdc_set_enable_lines,   /* set_enable_lines */
14741254
1475
1476
1477static void *apple2_fdc_iwm_init(running_machine *machine, int slot)
1478{
1479   return apple2_fdc_init(machine, slot, APPLEFDC_IWM);
1480}
1481
1482
1483
1484static UINT8 apple2_fdc_read(running_machine *machine, void *token, offs_t offset)
1485{
1486   return applefdc_r(machine, offset);
1487}
1488
1489
1490
1491static void apple2_fdc_write(running_machine *machine, void *token, offs_t offset, UINT8 data)
1492{
1493   applefdc_w(machine, offset, data);
1494}
1495
1496
1497
1498const apple2_slotdevice apple2_slot_floppy525 =
1499{
1500   "floppy525",
1501   "5.25\" Floppy Drive",
1502   apple2_fdc_apple2_init,
1503   NULL,
1504   apple2_fdc_read,
1505   apple2_fdc_write
1255   apple2_fdc_read_data,         /* read_data */
1256   apple2_fdc_write_data,         /* write_data */
1257   apple2_fdc_read_status         /* read_status */
15061258};
15071259
15081260
15091261
1510const apple2_slotdevice apple2_slot_iwm =
1511{
1512   "iwm",
1513   "IWM",
1514   apple2_fdc_iwm_init,
1515   NULL,
1516   apple2_fdc_read,
1517   apple2_fdc_write
1518};
1519
1520
1521
15221262/* -----------------------------------------------------------------------
15231263 * Driver init
15241264 * ----------------------------------------------------------------------- */
15251265
1526void apple2_init_common(running_machine *machine, const apple2_config *config)
1266void apple2_init_common(running_machine *machine)
15271267{
1528   int i;
1529   void *token;
1530
15311268   a2 = 0;
1269   apple2_fdc_diskreg = 0;
15321270
15331271   AY3600_init();
15341272   add_reset_callback(machine, apple2_reset);
15351273
1536   /* copy configuration */
1537   a2_config = auto_malloc(sizeof(*config));
1538   memcpy(a2_config, config, sizeof(*config));
1539
15401274   /* state save registers */
15411275   state_save_register_global(a2);
15421276   state_save_register_postload(machine, apple2_update_memory_postload, NULL);
r2543r2544
15441278   /* apple2 behaves much better when the default memory is zero */
15451279   memset(mess_ram, 0, mess_ram_size);
15461280
1547   /* initialize slots */
1548   a2_slot_tokens = auto_malloc(sizeof(*a2_slot_tokens) * APPLE2_SLOT_COUNT);
1549   memset(a2_slot_tokens, 0, sizeof(*a2_slot_tokens) * APPLE2_SLOT_COUNT);
1550   for (i = 0; i < APPLE2_SLOT_COUNT; i++)
1551   {
1552      if (a2_config->slots[i])
1553      {
1554         if (a2_config->slots[i]->init)
1555            token = a2_config->slots[i]->init(machine, i);
1556         else
1557            token = (void *) ~0;
1558
1559         a2_slot_tokens[i] = token;
1560      }
1561   }
1562
15631281   /* --------------------------------------------- *
15641282    * set up the softswitch mask/set                *
15651283    * --------------------------------------------- */
r2543r2544
15791297MACHINE_START( apple2 )
15801298{
15811299   apple2_memmap_config mem_cfg;
1582   apple2_config a2_cfg;
15831300   void *apple2cp_ce00_ram = NULL;
15841301
1585   memset(&a2_cfg, 0, sizeof(a2_cfg));
1586
1587   /* specify slots */
1588   if (!strcmp(machine->gamedrv->name, "apple2c0") ||
1589      !strcmp(machine->gamedrv->name, "apple2c3") ||
1590      !strcmp(machine->gamedrv->name, "apple2cp"))
1591   {
1592      a2_cfg.slots[0] = &apple2_slot_langcard;
1593      a2_cfg.slots[4] = &apple2_slot_mockingboard;
1594      a2_cfg.slots[6] = &apple2_slot_iwm;
1595   }
1596   else
1597   {
1598      a2_cfg.slots[0] = &apple2_slot_langcard;
1599      a2_cfg.slots[4] = &apple2_slot_mockingboard;
1600      a2_cfg.slots[6] = &apple2_slot_floppy525;
1601   }
1602
16031302   /* there appears to be some hidden RAM that is swapped in on the Apple
16041303    * IIc plus; I have not found any official documentation but the BIOS
16051304    * clearly uses this area as writeable memory */
16061305   if (!strcmp(machine->gamedrv->name, "apple2cp"))
16071306      apple2cp_ce00_ram = auto_malloc(0x200);
16081307
1609   apple2_init_common(machine, &a2_cfg);
1308   apple2_init_common(machine);
16101309
16111310   /* setup memory */
16121311   memset(&mem_cfg, 0, sizeof(mem_cfg));
r2543r2544
16181317   /* perform initial reset */
16191318   apple2_reset(machine);
16201319}
1621
src/mess/mess.mak
r2543r2544
703703   $(MESS_FORMATS)/ap2_dsk.o      \
704704   $(MESS_FORMATS)/ap_dsk35.o      \
705705   $(MESS_MACHINE)/ay3600.o      \
706   $(MESS_MACHINE)/ap2_slot.o      \
707   $(MESS_MACHINE)/ap2_lang.o      \
708   $(MESS_MACHINE)/mockngbd.o      \
706709   $(MESS_MACHINE)/lisa.o         \
707710   $(MESS_DRIVERS)/lisa.o         \
708711   $(MESS_MACHINE)/applefdc.o      \
src/mess/drivers/apple2gs.c
r2543r2544
4949#include "devices/sonydriv.h"
5050#include "devices/appldriv.h"
5151#include "sound/es5503.h"
52#include "machine/ap2_slot.h"
53#include "machine/ap2_lang.h"
54#include "machine/applefdc.h"
55#include "machine/mockngbd.h"
56#include "sound/ay8910.h"
5257
5358static const gfx_layout apple2gs_text_layout =
5459{
r2543r2544
170175   MDRV_SOUND_CONFIG(es5503_interface)
171176   MDRV_SOUND_ROUTE(0, "left", 1.0)
172177   MDRV_SOUND_ROUTE(1, "right", 1.0)
178
179   /* replace the old-style FDC with an IWM */
180   MDRV_DEVICE_REMOVE("fdc", APPLEFDC)
181   MDRV_DEVICE_ADD("fdc", IWM)
182   MDRV_DEVICE_CONFIG(apple2_fdc_interface)
173183MACHINE_DRIVER_END
174184
175185
src/mess/drivers/apple3.c
r2543r2544
5252
5353   MDRV_VIDEO_START( apple3 )
5454   MDRV_VIDEO_UPDATE( apple3 )
55
56   MDRV_DEVICE_ADD("fdc", APPLEFDC)
57   MDRV_DEVICE_CONFIG(apple3_fdc_interface)
5558MACHINE_DRIVER_END
5659
5760
src/mess/drivers/mac.c
r2543r2544
1/*
2 *  Mac Plus & 512ke emulation
3 *
4 *  Nate Woods, Raphael Nabet
5 *
6 *
7 *      0x000000 - 0x3fffff     RAM/ROM (switches based on overlay)
8 *      0x400000 - 0x4fffff     ROM
9 *      0x580000 - 0x5fffff     5380 NCR/Symbios SCSI peripherals chip (Mac Plus only)
10 *      0x600000 - 0x6fffff     RAM
11 *      0x800000 - 0x9fffff     Zilog 8530 SCC (Serial Control Chip) Read
12 *      0xa00000 - 0xbfffff     Zilog 8530 SCC (Serial Control Chip) Write
13 *      0xc00000 - 0xdfffff     IWM (Integrated Woz Machine; floppy)
14 *      0xe80000 - 0xefffff     Rockwell 6522 VIA
15 *      0xf00000 - 0xffffef     ??? (the ROM appears to be accessing here)
16 *      0xfffff0 - 0xffffff     Auto Vector
17 *
18 *
19 *  Interrupts:
20 *      M68K:
21 *          Level 1 from VIA
22 *          Level 2 from SCC
23 *          Level 4 : Interrupt switch (not implemented)
24 *
25 *      VIA:
26 *          CA1 from VBLANK
27 *          CA2 from 1 Hz clock (RTC)
28 *          CB1 from Keyboard Clock
29 *          CB2 from Keyboard Data
30 *          SR  from Keyboard Data Ready
31 *
32 *      SCC:
33 *          PB_EXT  from mouse Y circuitry
34 *          PA_EXT  from mouse X circuitry
35 *
36 */
1/****************************************************************************
372
3   drivers/mac.c
4   Mac Plus & 512ke emulation
5 
6   Nate Woods, Raphael Nabet
7 
8 
9       0x000000 - 0x3fffff     RAM/ROM (switches based on overlay)
10       0x400000 - 0x4fffff     ROM
11        0x580000 - 0x5fffff     5380 NCR/Symbios SCSI peripherals chip (Mac Plus only)
12        0x600000 - 0x6fffff     RAM
13       0x800000 - 0x9fffff     Zilog 8530 SCC (Serial Control Chip) Read
14       0xa00000 - 0xbfffff     Zilog 8530 SCC (Serial Control Chip) Write
15       0xc00000 - 0xdfffff     IWM (Integrated Woz Machine; floppy)
16       0xe80000 - 0xefffff     Rockwell 6522 VIA
17       0xf00000 - 0xffffef     ??? (the ROM appears to be accessing here)
18       0xfffff0 - 0xffffff     Auto Vector
19   
20   
21   Interrupts:
22       M68K:
23           Level 1 from VIA
24           Level 2 from SCC
25           Level 4 : Interrupt switch (not implemented)
26 
27       VIA:
28           CA1 from VBLANK
29           CA2 from 1 Hz clock (RTC)
30           CB1 from Keyboard Clock
31           CB2 from Keyboard Data
32           SR  from Keyboard Data Ready
33   
34       SCC:
35           PB_EXT  from mouse Y circuitry
36           PA_EXT  from mouse X circuitry
37 
38****************************************************************************/
39
3840#include "driver.h"
3941#include "includes/mac.h"
4042#include "machine/6522via.h"
4143#include "machine/ncr5380.h"
44#include "machine/applefdc.h"
4245#include "devices/sonydriv.h"
4346#include "devices/harddriv.h"
4447
4548
49/***************************************************************************
50    ADDRESS MAPS
51***************************************************************************/
52
4653static ADDRESS_MAP_START(mac512ke_map, ADDRESS_SPACE_PROGRAM, 16)
4754   AM_RANGE(0x800000, 0x9fffff) AM_READ(mac_scc_r)
4855   AM_RANGE(0xa00000, 0xbfffff) AM_WRITE(mac_scc_w)
r2543r2544
6269
6370
6471
72/***************************************************************************
73    DEVICE CONFIG
74***************************************************************************/
75
6576static const struct CustomSound_interface custom_interface =
6677{
6778   mac_sh_start
6879};
6980
81
82
83static const applefdc_interface mac_iwm_interface =
84{
85   sony_set_lines,
86   sony_set_enable_lines,
87
88   sony_read_data,
89   sony_write_data,
90   sony_read_status
91};
92
93
94
95/***************************************************************************
96    MACHINE DRIVERS
97***************************************************************************/
98
7099static MACHINE_DRIVER_START( mac512ke )
71100   /* basic machine hardware */
72101   MDRV_CPU_ADD_TAG("main", M68000, 7833600)        /* 7.8336 Mhz */
r2543r2544
95124   MDRV_SOUND_CONFIG(custom_interface)
96125   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
97126
127   /* nvram */
98128   MDRV_NVRAM_HANDLER(mac)
129
130   /* devices */
131   MDRV_DEVICE_ADD("fdc", IWM)
132   MDRV_DEVICE_CONFIG(mac_iwm_interface)
99133MACHINE_DRIVER_END
100134
101135static MACHINE_DRIVER_START( macplus )
src/mess/drivers/lisa.c
r2543r2544
1/*
2    experimental LISA driver
1/*********************************************************************
32
3   drivers/lisa.c
4
5   Experimental LISA driver
6
47    Raphael Nabet, 2000
5*/
68
9*********************************************************************/
10
711#include "driver.h"
812#include "includes/lisa.h"
913#include "devices/sonydriv.h"
10/*#include "machine/6522via.h"*/
14#include "machine/applefdc.h"
1115
1216
17/***************************************************************************
18    ADDRESS MAP
19***************************************************************************/
20
1321static ADDRESS_MAP_START(lisa_map, ADDRESS_SPACE_PROGRAM, 16)
1422   AM_RANGE(0x000000, 0xffffff) AM_READWRITE(lisa_r, lisa_w)         /* no fixed map, we use an MMU */
1523ADDRESS_MAP_END
r2543r2544
3240ADDRESS_MAP_END
3341
3442
43
44/***************************************************************************
45    DEVICE CONFIG
46***************************************************************************/
47
48static void lisa2_set_iwm_enable_lines(int enable_mask)
49{
50   /* E1 & E2 is connected to the Sony SEL line (?) */
51   /*logerror("new sel line state %d\n", (enable_mask) ? 0 : 1);*/
52   sony_set_sel_line((enable_mask) ? 0 : 1);
53}
54
55static void lisa210_set_iwm_enable_lines(int enable_mask)
56{
57   /* E2 is connected to the Sony enable line (?) */
58   sony_set_enable_lines(enable_mask >> 1);
59}
60
61static const applefdc_interface lisa2_fdc_interface =
62{
63   sony_set_lines,
64   lisa2_set_iwm_enable_lines,
65
66   sony_read_data,
67   sony_write_data,
68   sony_read_status
69};
70
71static const applefdc_interface lisa210_fdc_interface =
72{
73   sony_set_lines,
74   lisa210_set_iwm_enable_lines,
75
76   sony_read_data,
77   sony_write_data,
78   sony_read_status
79};
80
81
82
83/***************************************************************************
84    MACHINE DRIVER
85***************************************************************************/
86
3587/* Lisa1 and Lisa 2 machine */
3688static MACHINE_DRIVER_START( lisa )
3789   /* basic machine hardware */
r2543r2544
63115   MDRV_SOUND_ADD(SPEAKER, 0)
64116   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
65117
118   /* nvram */
66119   MDRV_NVRAM_HANDLER(lisa)
120
121   /* devices */
122   MDRV_DEVICE_ADD("fdc", IWM)
123   MDRV_DEVICE_CONFIG(lisa2_fdc_interface)
67124MACHINE_DRIVER_END
68125
69126
r2543r2544
71128   MDRV_IMPORT_FROM( lisa )
72129   MDRV_CPU_MODIFY( "fdc" )
73130   MDRV_CPU_PROGRAM_MAP(lisa210_fdc_map, 0)
131
132   /* Lisa 2/10 and MacXL had a slightly different FDC interface */   
133   MDRV_DEVICE_MODIFY("fdc", IWM)
134   MDRV_DEVICE_CONFIG(lisa210_fdc_interface)
74135MACHINE_DRIVER_END
75136
76137
src/mess/drivers/apple2.c
r2543r2544
184184
185185#include "driver.h"
186186#include "deprecat.h"
187#include "includes/apple2.h"
188#include "machine/ay3600.h"
189187#include "devices/appldriv.h"
190188#include "devices/mflopimg.h"
191189#include "formats/ap2_dsk.h"
190#include "includes/apple2.h"
191#include "machine/ay3600.h"
192#include "machine/ap2_slot.h"
193#include "machine/ap2_lang.h"
194#include "machine/applefdc.h"
195#include "machine/mockngbd.h"
192196#include "sound/ay8910.h"
193197
194198
195static ADDRESS_MAP_START( apple2_map, ADDRESS_SPACE_PROGRAM, 8 )
196ADDRESS_MAP_END
197199
198
199/**************************************************************************
200/***************************************************************************
201    PARAMETERS
200202***************************************************************************/
201203
202204#define JOYSTICK_DELTA         80
r2543r2544
206208#define PADDLE_SENSITIVITY      10
207209#define PADDLE_AUTOCENTER       0
208210
211
212
213/***************************************************************************
214    ADDRESS MAP
215***************************************************************************/
216
217static ADDRESS_MAP_START( apple2_map, ADDRESS_SPACE_PROGRAM, 8 )
218   /* nothing in the address map - everything is added dynamically */
219ADDRESS_MAP_END
220
221
222
223/***************************************************************************
224    INPUT PORTS
225***************************************************************************/
226
209227static INPUT_PORTS_START( apple2_joystick )
210228   PORT_START_TAG("joystick_1_x")      /* Joystick 1 X Axis */
211229   PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X) PORT_NAME("P1 Joystick X")
r2543r2544
571589   MDRV_SOUND_ADD(AY8913, 1022727)
572590   MDRV_SOUND_CONFIG(ay8910_interface)
573591   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
592
593   /* slot devices */
594   MDRV_DEVICE_ADD("langcard", APPLE2_LANGCARD)
595   MDRV_DEVICE_ADD("mockingboard", MOCKINGBOARD)
596   MDRV_DEVICE_ADD("fdc", APPLEFDC)
597   MDRV_DEVICE_CONFIG(apple2_fdc_interface)
598
599   /* slots */
600   MDRV_APPLE2_SLOT_ADD(0, "langcard", apple2_langcard_r, apple2_langcard_w)
601   MDRV_APPLE2_SLOT_ADD(4, "mockingboard", mockingboard_r, mockingboard_w)
602   MDRV_APPLE2_SLOT_ADD(6, "fdc", applefdc_r, applefdc_w)
574603MACHINE_DRIVER_END
575604
576605static MACHINE_DRIVER_START( apple2 )
r2543r2544
582611   MDRV_VIDEO_START(apple2p)
583612MACHINE_DRIVER_END
584613
585#ifdef UNUSED_FUNCTION
586static MACHINE_DRIVER_START( ace100 )
587   MDRV_IMPORT_FROM( apple2_common )
588   MDRV_VIDEO_START(apple2p)
589MACHINE_DRIVER_END
590#endif
591
592614ROM_START(las3000)
593615   ROM_REGION(0x0800,REGION_GFX1,0)
594616   ROM_LOAD ( "a2.chr", 0x0000, 0x0800, CRC(64f415c6) SHA1(f9d312f128c9557d9d6ac03bfad6c3ddf83e5659))
r2543r2544
612634   MDRV_IMPORT_FROM( apple2ee )
613635MACHINE_DRIVER_END
614636
637static MACHINE_DRIVER_START( apple2c_iwm )
638   MDRV_IMPORT_FROM( apple2c )
615639
640   /* replace the old-style FDC with an IWM */
641   MDRV_DEVICE_REMOVE("fdc", APPLEFDC)
642   MDRV_DEVICE_ADD("fdc", IWM)
643   MDRV_DEVICE_CONFIG(apple2_fdc_interface)
644MACHINE_DRIVER_END
645
646
616647/***************************************************************************
617648
618649  Game driver(s)
r2543r2544
829860
830861
831862
832/*    YEAR  NAME      PARENT    COMPAT      MACHINE   INPUT     INIT CONFIG     COMPANY            FULLNAME */
833COMP( 1977, apple2,   0,        0,         apple2,   apple2,   0,   apple2,   "Apple Computer", "Apple ][" , 0)
834COMP( 1979, apple2p,  apple2,   0,         apple2p,  apple2p,  0,   apple2p,   "Apple Computer", "Apple ][+" , 0)
835COMP( 1980, apple2jp, apple2,   0,         apple2p,  apple2p,  0,   apple2p,   "Apple Computer", "Apple ][j+" , 0)
836COMP( 1982, ace100,   apple2,   0,         apple2,     apple2e,  0,   apple2,   "Franklin Computer", "Franklin Ace 100" , 0)
837COMP( 1983, apple2e,  0,        apple2,      apple2e,  apple2e,  0,   apple2e,   "Apple Computer", "Apple //e" , 0)
838COMP( 1985, apple2ee, apple2e,  0,         apple2ee, apple2e,  0,   apple2e,   "Apple Computer", "Apple //e (enhanced)" , 0)
839COMP( 1987, apple2ep, apple2e,  0,         apple2ee, apple2ep, 0,   apple2e,   "Apple Computer", "Apple //e (Platinum)" , 0)
840COMP( 1984, apple2c,  0,        apple2,      apple2c,  apple2e,  0,   apple2e,   "Apple Computer", "Apple //c" , 0)
841COMP( 1983, las3000,  apple2,   0,         apple2p,  apple2p,  0,   apple2p,   "Video Technology", "Laser 3000",      GAME_NOT_WORKING )
842COMP( 1987, laser128, 0,        apple2c0,   apple2c,  apple2e,  0,   apple2e,   "Video Technology", "Laser 128 (rev 4)",      GAME_NOT_WORKING )
843COMP( 1987, las128ex, apple2c,  0,         apple2c,  apple2e,  0,   apple2e,   "Video Technology", "Laser 128ex (rev 4a)",      GAME_NOT_WORKING )
844COMP( 1985, apple2c0, apple2c,  0,         apple2c,  apple2e,  0,   apple2e,   "Apple Computer", "Apple //c (UniDisk 3.5)" , 0)
845COMP( 1986, apple2c3, apple2c,  0,         apple2c,  apple2e,  0,    apple2e,   "Apple Computer", "Apple //c (Original Memory Expansion)" , 0)
846COMP( 1986, apple2c4, apple2c,  0,         apple2c,  apple2e,  0,    apple2e,   "Apple Computer", "Apple //c (rev 4)" , GAME_NOT_WORKING )
847COMP( 1988, apple2cp, apple2c,  0,         apple2c,  apple2e,  0,    apple2e,   "Apple Computer", "Apple //c Plus" , 0)
863/*    YEAR  NAME      PARENT    COMPAT      MACHINE       INPUT     INIT CONFIG     COMPANY            FULLNAME */
864COMP( 1977, apple2,   0,        0,         apple2,       apple2,   0,   apple2,   "Apple Computer", "Apple ][" , 0)
865COMP( 1979, apple2p,  apple2,   0,         apple2p,      apple2p,  0,   apple2p,   "Apple Computer", "Apple ][+" , 0)
866COMP( 1980, apple2jp, apple2,   0,         apple2p,      apple2p,  0,   apple2p,   "Apple Computer", "Apple ][j+" , 0)
867COMP( 1982, ace100,   apple2,   0,         apple2,         apple2e,  0,   apple2,   "Franklin Computer", "Franklin Ace 100" , 0)
868COMP( 1983, apple2e,  0,        apple2,      apple2e,      apple2e,  0,   apple2e,   "Apple Computer", "Apple //e" , 0)
869COMP( 1985, apple2ee, apple2e,  0,         apple2ee,     apple2e,  0,   apple2e,   "Apple Computer", "Apple //e (enhanced)" , 0)
870COMP( 1987, apple2ep, apple2e,  0,         apple2ee,     apple2ep, 0,   apple2e,   "Apple Computer", "Apple //e (Platinum)" , 0)
871COMP( 1984, apple2c,  0,        apple2,      apple2c,      apple2e,  0,   apple2e,   "Apple Computer", "Apple //c" , 0)
872COMP( 1983, las3000,  apple2,   0,         apple2p,      apple2p,  0,   apple2p,   "Video Technology", "Laser 3000",      GAME_NOT_WORKING )
873COMP( 1987, laser128, 0,        apple2c0,   apple2c,      apple2e,  0,   apple2e,   "Video Technology", "Laser 128 (rev 4)",      GAME_NOT_WORKING )
874COMP( 1987, las128ex, apple2c,  0,         apple2c,      apple2e,  0,   apple2e,   "Video Technology", "Laser 128ex (rev 4a)",      GAME_NOT_WORKING )
875COMP( 1985, apple2c0, apple2c,  0,         apple2c_iwm,  apple2e,  0,   apple2e,   "Apple Computer", "Apple //c (UniDisk 3.5)" , 0)
876COMP( 1986, apple2c3, apple2c,  0,         apple2c_iwm,  apple2e,  0,    apple2e,   "Apple Computer", "Apple //c (Original Memory Expansion)" , 0)
877COMP( 1986, apple2c4, apple2c,  0,         apple2c_iwm,  apple2e,  0,    apple2e,   "Apple Computer", "Apple //c (rev 4)" , GAME_NOT_WORKING )
878COMP( 1988, apple2cp, apple2c,  0,         apple2c_iwm,  apple2e,  0,    apple2e,   "Apple Computer", "Apple //c Plus" , 0)
docs/messnew.txt
r2543r2544
1212----------------------
1313- [ABC80] Fixed so that it boots and keyboard works. [Robbbert]
1414
15- [APPLE2] Changed slot system to be implemented as MAME devices.  [Nate
16  Woods]
17
1518- [BK] Added cassete loading [Miodrag Milanovic]
1619
1720- [BW2] Added MSM6255 LCD controller emulation. [Curt Coder]
r2543r2544
133136
134137- New MESS specific OSD call:  osd_get_clipboard_text().  [Nate Woods]
135138
139- Changed Apple FDC/IWM implementation to be a MAME device.  This affects the
140  Apple II, Apple III, Apple IIgs, Lisa and Mac drivers.  [Nate Woods]
136141
137142
143
1381440.124a
139145
140146New System Drivers Supported (in no particular order):

Previous 15994 Revisions Next


© 1998-2018 The MESS Team