Previous 15994 Revisions Next

r9700 Wednesday 1st December, 2010 at 11:38:54 UTC by Nathan Woods
More fixes. [Atari Ace]
[src/mess/drivers]apogee.c lisa.c mikrosha.c orion.c radio86.c ti99_4p.c z88.c
[src/mess/includes]lisa.h orion.h partner.h radio86.h z88.h
[src/mess/machine]lisa.c orion.c partner.c radio86.c
[src/mess/video]radio86.c z88.c

src/mess/machine/radio86.c
r9699r9700
1515#include "video/i8275.h"
1616#include "includes/radio86.h"
1717
18static int radio86_keyboard_mask;
19UINT8 radio86_tape_value;
2018
21static UINT8* radio_ram_disk;
2219
23void radio86_init_keyboard()
20void radio86_init_keyboard(running_machine *machine)
2421{
25   radio86_keyboard_mask = 0;
26   radio86_tape_value = 0x10;
22   radio86_state *state = machine->driver_data<radio86_state>();
23   state->keyboard_mask = 0;
24   state->tape_value = 0x10;
2725}
2826
2927/* Driver initialization */
r9699r9700
3432   memset(RAM,0x0000,0x1000); // make frist page empty by default
3533   memory_configure_bank(machine, "bank1", 1, 2, RAM, 0x0000);
3634   memory_configure_bank(machine, "bank1", 0, 2, RAM, 0xf800);
37   radio86_init_keyboard();
35   radio86_init_keyboard(machine);
3836}
3937
4038DRIVER_INIT(radioram)
4139{
40   radio86_state *state = machine->driver_data<radio86_state>();
4241   DRIVER_INIT_CALL(radio86);
43   radio_ram_disk = auto_alloc_array(machine, UINT8, 0x20000);
44   memset(radio_ram_disk,0,0x20000);
42   state->radio_ram_disk = auto_alloc_array(machine, UINT8, 0x20000);
43   memset(state->radio_ram_disk,0,0x20000);
4544}
4645static READ8_DEVICE_HANDLER (radio86_8255_portb_r2 )
4746{
47   radio86_state *state = device->machine->driver_data<radio86_state>();
4848   UINT8 key = 0xff;
49   if ((radio86_keyboard_mask & 0x01)!=0) { key &= input_port_read(device->machine,"LINE0"); }
50   if ((radio86_keyboard_mask & 0x02)!=0) { key &= input_port_read(device->machine,"LINE1"); }
51   if ((radio86_keyboard_mask & 0x04)!=0) { key &= input_port_read(device->machine,"LINE2"); }
52   if ((radio86_keyboard_mask & 0x08)!=0) { key &= input_port_read(device->machine,"LINE3"); }
53   if ((radio86_keyboard_mask & 0x10)!=0) { key &= input_port_read(device->machine,"LINE4"); }
54   if ((radio86_keyboard_mask & 0x20)!=0) { key &= input_port_read(device->machine,"LINE5"); }
55   if ((radio86_keyboard_mask & 0x40)!=0) { key &= input_port_read(device->machine,"LINE6"); }
56   if ((radio86_keyboard_mask & 0x80)!=0) { key &= input_port_read(device->machine,"LINE7"); }
49   if ((state->keyboard_mask & 0x01)!=0) { key &= input_port_read(device->machine,"LINE0"); }
50   if ((state->keyboard_mask & 0x02)!=0) { key &= input_port_read(device->machine,"LINE1"); }
51   if ((state->keyboard_mask & 0x04)!=0) { key &= input_port_read(device->machine,"LINE2"); }
52   if ((state->keyboard_mask & 0x08)!=0) { key &= input_port_read(device->machine,"LINE3"); }
53   if ((state->keyboard_mask & 0x10)!=0) { key &= input_port_read(device->machine,"LINE4"); }
54   if ((state->keyboard_mask & 0x20)!=0) { key &= input_port_read(device->machine,"LINE5"); }
55   if ((state->keyboard_mask & 0x40)!=0) { key &= input_port_read(device->machine,"LINE6"); }
56   if ((state->keyboard_mask & 0x80)!=0) { key &= input_port_read(device->machine,"LINE7"); }
5757   return key;
5858}
5959
6060static READ8_DEVICE_HANDLER (radio86_8255_portc_r2 )
6161{
62   radio86_state *state = device->machine->driver_data<radio86_state>();
6263   double level = cassette_input(device->machine->device("cassette"));
6364   UINT8 dat = input_port_read(device->machine, "LINE8");
6465   if (level <  0) {
65      dat ^= radio86_tape_value;
66      dat ^= state->tape_value;
6667   }
6768   return dat;
6869}
6970
7071static WRITE8_DEVICE_HANDLER (radio86_8255_porta_w2 )
7172{
72   radio86_keyboard_mask = data ^ 0xff;
73   radio86_state *state = device->machine->driver_data<radio86_state>();
74   state->keyboard_mask = data ^ 0xff;
7375}
7476
7577static WRITE8_DEVICE_HANDLER (radio86_8255_portc_w2 )
r9699r9700
102104
103105static READ8_DEVICE_HANDLER (rk7007_8255_portc_r )
104106{
107   radio86_state *state = device->machine->driver_data<radio86_state>();
105108   double level = cassette_input(device->machine->device("cassette"));
106109   UINT8 key = 0xff;
107   if ((radio86_keyboard_mask & 0x01)!=0) { key &= input_port_read(device->machine,"CLINE0"); }
108   if ((radio86_keyboard_mask & 0x02)!=0) { key &= input_port_read(device->machine,"CLINE1"); }
109   if ((radio86_keyboard_mask & 0x04)!=0) { key &= input_port_read(device->machine,"CLINE2"); }
110   if ((radio86_keyboard_mask & 0x08)!=0) { key &= input_port_read(device->machine,"CLINE3"); }
111   if ((radio86_keyboard_mask & 0x10)!=0) { key &= input_port_read(device->machine,"CLINE4"); }
112   if ((radio86_keyboard_mask & 0x20)!=0) { key &= input_port_read(device->machine,"CLINE5"); }
113   if ((radio86_keyboard_mask & 0x40)!=0) { key &= input_port_read(device->machine,"CLINE6"); }
114   if ((radio86_keyboard_mask & 0x80)!=0) { key &= input_port_read(device->machine,"CLINE7"); }
110   if ((state->keyboard_mask & 0x01)!=0) { key &= input_port_read(device->machine,"CLINE0"); }
111   if ((state->keyboard_mask & 0x02)!=0) { key &= input_port_read(device->machine,"CLINE1"); }
112   if ((state->keyboard_mask & 0x04)!=0) { key &= input_port_read(device->machine,"CLINE2"); }
113   if ((state->keyboard_mask & 0x08)!=0) { key &= input_port_read(device->machine,"CLINE3"); }
114   if ((state->keyboard_mask & 0x10)!=0) { key &= input_port_read(device->machine,"CLINE4"); }
115   if ((state->keyboard_mask & 0x20)!=0) { key &= input_port_read(device->machine,"CLINE5"); }
116   if ((state->keyboard_mask & 0x40)!=0) { key &= input_port_read(device->machine,"CLINE6"); }
117   if ((state->keyboard_mask & 0x80)!=0) { key &= input_port_read(device->machine,"CLINE7"); }
115118   key &= 0xe0;
116119   if (level <  0) {
117      key ^= radio86_tape_value;
120      key ^= state->tape_value;
118121   }
119122   return key;
120123}
r9699r9700
158161   memory_set_bank(machine, "bank1", 0);
159162}
160163
161static UINT8 romdisk_lsb,romdisk_msb, disk_sel;
162164
163165READ8_HANDLER (radio_cpu_state_r )
164166{
r9699r9700
177179
178180MACHINE_RESET( radio86 )
179181{
182   radio86_state *state = machine->driver_data<radio86_state>();
180183   timer_set(machine, ATTOTIME_IN_USEC(10), NULL, 0, radio86_reset);
181184   memory_set_bank(machine, "bank1", 1);
182185
183   radio86_keyboard_mask = 0;
184   disk_sel = 0;
186   state->keyboard_mask = 0;
187   state->disk_sel = 0;
185188}
186189
187190
188191WRITE8_HANDLER ( radio86_pagesel )
189192{
190   disk_sel = data;
193   radio86_state *state = space->machine->driver_data<radio86_state>();
194   state->disk_sel = data;
191195}
192196
193197static READ8_DEVICE_HANDLER (radio86_romdisk_porta_r )
194198{
199   radio86_state *state = device->machine->driver_data<radio86_state>();
195200   UINT8 *romdisk = memory_region(device->machine, "maincpu") + 0x10000;
196   if ((disk_sel & 0x0f) ==0) {
197      return romdisk[romdisk_msb*256+romdisk_lsb];
201   if ((state->disk_sel & 0x0f) ==0) {
202      return romdisk[state->romdisk_msb*256+state->romdisk_lsb];
198203   } else {
199      if (disk_sel==0xdf) {
200         return radio_ram_disk[romdisk_msb*256+romdisk_lsb + 0x10000];
204      if (state->disk_sel==0xdf) {
205         return state->radio_ram_disk[state->romdisk_msb*256+state->romdisk_lsb + 0x10000];
201206      } else {
202         return radio_ram_disk[romdisk_msb*256+romdisk_lsb];
207         return state->radio_ram_disk[state->romdisk_msb*256+state->romdisk_lsb];
203208      }
204209   }
205210}
206211
207212static WRITE8_DEVICE_HANDLER (radio86_romdisk_portb_w )
208213{
209   romdisk_lsb = data;
214   radio86_state *state = device->machine->driver_data<radio86_state>();
215   state->romdisk_lsb = data;
210216}
211217
212218static WRITE8_DEVICE_HANDLER (radio86_romdisk_portc_w )
213219{
214   romdisk_msb = data;
220   radio86_state *state = device->machine->driver_data<radio86_state>();
221   state->romdisk_msb = data;
215222}
216223
217224I8255A_INTERFACE( radio86_ppi8255_interface_2 )
r9699r9700
226233
227234static WRITE8_DEVICE_HANDLER (mikrosha_8255_font_page_w )
228235{
229   mikrosha_font_page = (data  > 7) & 1;
236   radio86_state *state = device->machine->driver_data<radio86_state>();
237   state->mikrosha_font_page = (data  > 7) & 1;
230238}
231239
232240I8255A_INTERFACE( mikrosha_ppi8255_interface_2 )
src/mess/machine/orion.c
r9699r9700
173173   memory_set_bankptr(machine, "bank2", messram_get_ptr(machine->device("messram")) + 0xf000);
174174   state->orion128_video_width = SCREEN_WIDTH_384;
175175   orion_set_video_mode(machine,384);
176   radio86_init_keyboard();
176   radio86_init_keyboard(machine);
177177}
178178
179179static WRITE8_HANDLER ( orion_disk_control_w )
r9699r9700
377377   state->speaker = 0;
378378   state->orion128_video_width = SCREEN_WIDTH_384;
379379   orion_set_video_mode(machine,384);
380   radio86_init_keyboard();
380   radio86_init_keyboard(machine);
381381}
382382
383383INTERRUPT_GEN( orionz80_interrupt )
r9699r9700
535535MACHINE_RESET ( orionpro )
536536{
537537   orion_state *state = machine->driver_data<orion_state>();
538   radio86_init_keyboard();
538   radio86_init_keyboard(machine);
539539
540540   state->orion128_video_page = 0;
541541   state->orion128_video_mode = 0;
src/mess/machine/lisa.c
r9699r9700
5050*/
5151
5252/* up to 2MB of 68k RAM (normally 1MB or 512kb), generally 16kb of ROM */
53static UINT8 *lisa_ram_ptr;
54static UINT8 *lisa_rom_ptr;
5553
5654/* offsets in "maincpu" */
5755#define RAM_OFFSET 0x004000
r9699r9700
6058/* 1kb of RAM for 6504 floppy disk controller (shared with 68000), and 4kb of
6159ROM (8kb on some boards, but then only one 4kb bank is selected, according to
6260the drive type (TWIGGY or 3.5'')) */
63UINT8 *lisa_fdc_ram;
64UINT8 *lisa_fdc_rom;
6561
6662/* special ROM (includes S/N) */
67static UINT8 *videoROM_ptr;
6863
6964
7065/*
7166    MMU regs
7267*/
7368
74static int setup;   /* MMU setup mode : allows to edit the MMU regs */
7569
76static int seg;      /* current SEG0-1 state (-> MMU register bank) */
7770
78/* lisa MMU segment regs */
79typedef struct real_mmu_entry
80{
81   UINT16 sorg;
82   UINT16 slim;
83} real_mmu_entry;
8471
85/* MMU regs translated into a more efficient format */
86enum mmu_entry_t { RAM_stack_r, RAM_r, RAM_stack_rw, RAM_rw, IO, invalid, special_IO };
8772
88typedef struct mmu_entry
89{
90   offs_t sorg;   /* (real_sorg & 0x0fff) << 9 */
91   mmu_entry_t type;   /* <-> (real_slim & 0x0f00) */
92   int slim;   /* (~ ((real_slim & 0x00ff) << 9)) & 0x01ffff */
93} mmu_entry;
94
95static real_mmu_entry real_mmu_regs[4][128];   /* 4 banks of 128 regs */
96static mmu_entry mmu_regs[4][128];
97
98
9973/*
10074    parity logic - only hard errors are emulated for now, since
10175    a) the ROMs power-up test only tests hard errors
r9699r9700
10478      fix errors)
10579*/
10680
107static int diag2;         /* -> writes wrong parity data into RAM */
108static int test_parity;      /* detect parity hard errors */
109static UINT16 mem_err_addr_latch;   /* address when parity error occured */
110static int parity_error_pending;   /* parity error interrupt pending */
11181
112static int bad_parity_count;   /* total number of bytes in RAM which have wrong parity */
113static UINT8 *bad_parity_table;   /* array : 1 bit set for each byte in RAM with wrong parity */
11482
11583
11684/*
11785    video
11886*/
119static int VTMSK;            /* VBI enable */
120static int VTIR;            /* VBI pending */
121static UINT16 video_address_latch;   /* register : MSBs of screen bitmap address (LSBs are 0s) */
122static UINT16 *videoram_ptr;      /* screen bitmap base address (derived from video_address_latch) */
12387
12488
12589/*
r9699r9700
13599static void COPS_via_irq_func(running_device *device, int val);
136100static READ8_DEVICE_HANDLER(parallel_via_in_b);
137101
138static int KBIR;   /* COPS VIA interrupt pending */
139102
140103const via6522_interface lisa_via6522_0_intf =
141104{
r9699r9700
164127    floppy disk interface
165128*/
166129
167static int FDIR;
168static int DISK_DIAG;
169130
170static int MT1;
171131
172static int PWM_floppy_motor_speed;
173132
174133/*
175134    lisa model identification
176135*/
177static enum
136enum lisa_model_t
178137{
179138   /*lisa1,*/      /* twiggy floppy drive */
180139   lisa2,      /* 3.5'' Sony floppy drive */
181140   lisa210,   /* modified I/O board, and internal 10Meg drive */
182141   mac_xl      /* same as above with modified video */
183} lisa_model;
142};
184143
185enum floppy_hardware_t
186{
187   twiggy,         /* twiggy drives (Lisa 1) */
188   sony_lisa2,      /* 3.5'' drive with LisaLite adapter (Lisa 2) */
189   sony_lisa210   /* 3.5'' drive with modified fdc hardware (Lisa 2/10, Mac XL) */
190} ;
191144
192static struct
193{
194   unsigned int has_fast_timers : 1;   /* I/O board VIAs are clocked at 1.25 MHz (?) instead of .5 MHz (?) (Lisa 2/10, Mac XL) */
195                              /* Note that the beep routine in boot ROMs implies that
196                                        VIA clock is 1.25 times faster with fast timers than with
197                                        slow timers.  I read the schematics again and again, and
198                                        I simply don't understand : in one case the VIA is
199                                        connected to the 68k E clock, which is CPUCK/10, and in
200                                        another case, to a generated PH2 clock which is CPUCK/4,
201                                        with additionnal logic to keep it in phase with the 68k
202                                        memory cycle.  After hearing the beep when MacWorks XL
203                                        boots, I bet the correct values are .625 MHz and .5 MHz.
204                                        Maybe the schematics are wrong, and PH2 is CPUCK/8.
205                                        Maybe the board uses a 6522 variant with different
206                                        timings. */
207   floppy_hardware_t floppy_hardware;
208   unsigned int has_double_sided_floppy : 1;   /* true on lisa 1 and *hacked* lisa 2/10 / Mac XL */
209   unsigned int has_mac_xl_video : 1;   /* modified video for MacXL */
210} lisa_features;
211145
212146/*
213147    protos
r9699r9700
223157
224158static void lisa_field_interrupts(running_machine *machine)
225159{
226   if (parity_error_pending)
160   lisa_state *state = machine->driver_data<lisa_state>();
161   if (state->parity_error_pending)
227162      return;   /* don't touch anything... */
228163
229164#if 0
r9699r9700
241176      cputag_set_input_line_and_vector(machine, "maincpu", M68K_IRQ_3, ASSERT_LINE, M68K_INT_ACK_AUTOVECTOR);
242177   else
243178#endif
244   if (KBIR)
179   if (state->KBIR)
245180      /* COPS VIA interrupt */
246181      cputag_set_input_line_and_vector(machine, "maincpu", M68K_IRQ_2, ASSERT_LINE, M68K_INT_ACK_AUTOVECTOR);
247   else if (FDIR || VTIR)
182   else if (state->FDIR || state->VTIR)
248183      /* floppy disk or VBl */
249184      cputag_set_input_line_and_vector(machine, "maincpu", M68K_IRQ_1, ASSERT_LINE, M68K_INT_ACK_AUTOVECTOR);
250185   else
r9699r9700
254189
255190static void set_parity_error_pending(running_machine *machine, int value)
256191{
192   lisa_state *state = machine->driver_data<lisa_state>();
257193#if 1
258194   /* does not work well due to bugs in 68k cores */
259   parity_error_pending = value;
260   if (parity_error_pending)
195   state->parity_error_pending = value;
196   if (state->parity_error_pending)
261197   {
262198      cputag_set_input_line_and_vector(machine, "maincpu", M68K_IRQ_7, ASSERT_LINE, M68K_INT_ACK_AUTOVECTOR);
263199   }
r9699r9700
267203   }
268204#else
269205   /* work-around... */
270   if ((! parity_error_pending) && value)
206   if ((! state->parity_error_pending) && value)
271207   {
272      parity_error_pending = 1;
208      state->parity_error_pending = 1;
273209      cputag_set_input_line_and_vector(machine, "maincpu", M68K_IRQ_7, PULSE_LINE, M68K_INT_ACK_AUTOVECTOR);
274210   }
275   else if (parity_error_pending && (! value))
211   else if (state->parity_error_pending && (! value))
276212   {
277      parity_error_pending = 0;
213      state->parity_error_pending = 0;
278214      lisa_field_interrupts(machine);
279215   }
280216#endif
r9699r9700
282218
283219INLINE void set_VTIR(running_machine *machine, int value)
284220{
285   if (VTIR != value)
221   lisa_state *state = machine->driver_data<lisa_state>();
222   if (state->VTIR != value)
286223   {
287      VTIR = value;
288      if (VTIR==1)
224      state->VTIR = value;
225      if (state->VTIR==1)
289226         lisa_field_interrupts(machine);
290227   }
291228}
r9699r9700
296233    keyboard interface
297234*/
298235
299static int COPS_Ready;      /* COPS is about to read a command from VIA port A */
300236
301static int COPS_command;   /* keeps the data sent by the VIA to the COPS */
302237
303static int fifo_data[8];   /* 8-byte FIFO used by COPS to buffer data sent to VIA */
304static int fifo_size;         /* current data in FIFO */
305static int fifo_head;
306static int fifo_tail;
307static int mouse_data_offset;   /* current offset for mouse data in FIFO (!) */
308238
309static int COPS_force_unplug;      /* force unplug keyboard/mouse line for COPS (comes from VIA) */
310239
311static emu_timer *mouse_timer = NULL;   /* timer called for mouse setup */
312240
313static int hold_COPS_data;   /* mirrors the state of CA2 - COPS does not send data until it is low */
314241
315static int NMIcode;
316242
317enum clock_mode_t
318{
319   clock_timer_disable = 0,
320   timer_disable = 1,
321   timer_interrupt = 2,   /* timer underflow generates interrupt */
322   timer_power_on = 3      /* timer underflow turns system on if it is off and gens interrupt */
323};         /* clock mode */
324243
325/* clock registers */
326static struct
327{
328   long alarm;      /* alarm (20-bit binary) */
329   int years;      /* years (4-bit binary ) */
330   int days1;      /* days (BCD : 1-366) */
331   int days2;
332   int days3;
333   int hours1;      /* hours (BCD : 0-23) */
334   int hours2;
335   int minutes1;   /* minutes (BCD : 0-59) */
336   int minutes2;
337   int seconds1;   /* seconds (BCD : 0-59) */
338   int seconds2;
339   int tenths;      /* tenths of second (BCD : 0-9) */
340244
341   int clock_write_ptr;   /* clock byte to be written next (-1 if clock write disabled) */
342245
343   enum clock_mode_t clock_mode;
344} clock_regs;
345
346
347
348246INLINE void COPS_send_data_if_possible(running_machine *machine)
349247{
248   lisa_state *state = machine->driver_data<lisa_state>();
350249   via6522_device *via_0 = machine->device<via6522_device>("via6522_0");
351250   address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
352251
353   if ((! hold_COPS_data) && fifo_size && (! COPS_Ready))
252   if ((! state->hold_COPS_data) && state->fifo_size && (! state->COPS_Ready))
354253   {
355254      logerror("Pushing one byte of data to VIA\n");
356255
357      via_0->write_porta(*space, 0, fifo_data[fifo_head]);   /* output data */
358      if (fifo_head == mouse_data_offset)
359         mouse_data_offset = -1;   /* we just phased out the mouse data in buffer */
360      fifo_head = (fifo_head+1) & 0x7;
361      fifo_size--;
256      via_0->write_porta(*space, 0, state->fifo_data[state->fifo_head]);   /* output data */
257      if (state->fifo_head == state->mouse_data_offset)
258         state->mouse_data_offset = -1;   /* we just phased out the mouse data in buffer */
259      state->fifo_head = (state->fifo_head+1) & 0x7;
260      state->fifo_size--;
362261      via_0->write_ca1(1);      /* pulse ca1 so that VIA reads it */
363262      via_0->write_ca1(0);      /* BTW, I have no idea how a real COPS does it ! */
364263   }
r9699r9700
367266/* send data (queue it into the FIFO if needed) */
368267static void COPS_queue_data(running_machine *machine, const UINT8 *data, int len)
369268{
269   lisa_state *state = machine->driver_data<lisa_state>();
370270#if 0
371   if (fifo_size + len <= 8)
271   if (state->fifo_size + len <= 8)
372272#else
373273   /* trash old data */
374   while (fifo_size > 8 - len)
274   while (state->fifo_size > 8 - len)
375275   {
376      if (fifo_head == mouse_data_offset)
377         mouse_data_offset = -1;   /* we just phased out the mouse data in buffer */
378      fifo_head = (fifo_head+1) & 0x7;
379      fifo_size--;
276      if (state->fifo_head == state->mouse_data_offset)
277         state->mouse_data_offset = -1;   /* we just phased out the mouse data in buffer */
278      state->fifo_head = (state->fifo_head+1) & 0x7;
279      state->fifo_size--;
380280   }
381281#endif
382282
r9699r9700
385285
386286      while (len--)
387287      {
388         fifo_data[fifo_tail] = * (data++);
389         fifo_tail = (fifo_tail+1) & 0x7;
390         fifo_size++;
288         state->fifo_data[state->fifo_tail] = * (data++);
289         state->fifo_tail = (state->fifo_tail+1) & 0x7;
290         state->fifo_size++;
391291      }
392292
393293      /*logerror("COPS_queue_data : trying to send data to VIA\n");*/
r9699r9700
403303/* shamelessly stolen from machine/mac.c :-) */
404304
405305/* keyboard matrix to detect transition */
406static int key_matrix[8];
407306
408307static void scan_keyboard(running_machine *machine)
409308{
309   lisa_state *state = machine->driver_data<lisa_state>();
410310   int i, j;
411311   int keybuf;
412312   UINT8 keycode;
413313   static const char *const keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6", "LINE7" };
414314
415   if (! COPS_force_unplug)
315   if (! state->COPS_force_unplug)
416316      for (i=0; i<8; i++)
417317      {
418318         keybuf = input_port_read(machine, keynames[i]);
419319
420         if (keybuf != key_matrix[i])
320         if (keybuf != state->key_matrix[i])
421321         {   /* if state has changed, find first bit which has changed */
422322            /*logerror("keyboard state changed, %d %X\n", i, keybuf);*/
423323
424324            for (j=0; j<16; j++)
425325            {
426               if (((keybuf ^ key_matrix[i]) >> j) & 1)
326               if (((keybuf ^ state->key_matrix[i]) >> j) & 1)
427327               {
428328                  /* update key_matrix */
429                  key_matrix[i] = (key_matrix[i] & ~ (1 << j)) | (keybuf & (1 << j));
329                  state->key_matrix[i] = (state->key_matrix[i] & ~ (1 << j)) | (keybuf & (1 << j));
430330
431331                  /* create key code */
432332                  keycode = (i << 4) | j;
r9699r9700
435335                     keycode |= 0x80;
436336                  }
437337#if 0
438                  if (keycode == NMIcode)
338                  if (keycode == state->NMIcode)
439339                  {   /* generate NMI interrupt */
440340                     cputag_set_input_line(machine, "maincpu", M68K_IRQ_7, PULSE_LINE);
441341                     cpu_set_input_line_vector(machine->device("maincpu"), M68K_IRQ_7, M68K_INT_ACK_AUTOVECTOR);
r9699r9700
452352/* shamelessly stolen from machine/mac.c :-) */
453353static TIMER_CALLBACK(handle_mouse)
454354{
455   static int last_mx = 0, last_my = 0;
456
355   lisa_state *state = machine->driver_data<lisa_state>();
457356   int diff_x = 0, diff_y = 0;
458357   int new_mx, new_my;
459358
460359#if 0
461   if (COPS_force_unplug)
360   if (state->COPS_force_unplug)
462361      return;   /* ???? */
463362#endif
464363
r9699r9700
466365   new_my = input_port_read(machine, "MOUSE_Y");
467366
468367   /* see if it moved in the x coord */
469   if (new_mx != last_mx)
368   if (new_mx != state->last_mx)
470369   {
471      diff_x = new_mx - last_mx;
370      diff_x = new_mx - state->last_mx;
472371
473372      /* check for wrap */
474373      if (diff_x > 0x80)
r9699r9700
476375      if  (diff_x < -0x80)
477376         diff_x = -0x100-diff_x;
478377
479      last_mx = new_mx;
378      state->last_mx = new_mx;
480379   }
481380   /* see if it moved in the y coord */
482   if (new_my != last_my)
381   if (new_my != state->last_my)
483382   {
484      diff_y = new_my - last_my;
383      diff_y = new_my - state->last_my;
485384
486385      /* check for wrap */
487386      if (diff_y > 0x80)
r9699r9700
489388      if  (diff_y < -0x80)
490389         diff_y = -0x100-diff_y;
491390
492      last_my = new_my;
391      state->last_my = new_my;
493392   }
494393
495394   /* update any remaining count and then return */
496395   if (diff_x || diff_y)
497396   {
498      if (mouse_data_offset != -1)
397      if (state->mouse_data_offset != -1)
499398      {
500         fifo_data[mouse_data_offset] += diff_x;
501         fifo_data[(mouse_data_offset+1) & 0x7] += diff_y;
399         state->fifo_data[state->mouse_data_offset] += diff_x;
400         state->fifo_data[(state->mouse_data_offset+1) & 0x7] += diff_y;
502401      }
503402      else
504403      {
505404#if 0
506         if (fifo_size <= 5)
405         if (state->fifo_size <= 5)
507406#else
508407         /* trash old data */
509         while (fifo_size > 5)
408         while (state->fifo_size > 5)
510409         {
511            fifo_head = (fifo_head+1) & 0x7;
512            fifo_size--;
410            state->fifo_head = (state->fifo_head+1) & 0x7;
411            state->fifo_size--;
513412         }
514413#endif
515414
516415         {
517416            /*logerror("Adding 3 bytes of mouse data to FIFO\n");*/
518417
519            fifo_data[fifo_tail] = 0;
520            mouse_data_offset = fifo_tail = (fifo_tail+1) & 0x7;
521            fifo_data[fifo_tail] = diff_x;
522            fifo_tail = (fifo_tail+1) & 0x7;
523            fifo_data[fifo_tail] = diff_y;
524            fifo_tail = (fifo_tail+1) & 0x7;
525            fifo_size += 3;
418            state->fifo_data[state->fifo_tail] = 0;
419            state->mouse_data_offset = state->fifo_tail = (state->fifo_tail+1) & 0x7;
420            state->fifo_data[state->fifo_tail] = diff_x;
421            state->fifo_tail = (state->fifo_tail+1) & 0x7;
422            state->fifo_data[state->fifo_tail] = diff_y;
423            state->fifo_tail = (state->fifo_tail+1) & 0x7;
424            state->fifo_size += 3;
526425
527426            /*logerror("handle_mouse : trying to send data to VIA\n");*/
528427            COPS_send_data_if_possible(machine);
r9699r9700
535434/* read command from the VIA port A */
536435static TIMER_CALLBACK(read_COPS_command)
537436{
437   lisa_state *state = machine->driver_data<lisa_state>();
538438   int command;
539439   via6522_device *via_0 = machine->device<via6522_device>("via6522_0");
540440   address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
541441   
542   COPS_Ready = 0;
442   state->COPS_Ready = 0;
543443
544444   /*logerror("read_COPS_command : trying to send data to VIA\n");*/
545445   COPS_send_data_if_possible(machine);
546446
547447   /* some pull-ups allow the COPS to read 1s when the VIA port is not set as output */
548   command = (COPS_command | (~ via_0->read(*space, VIA_DDRA))) & 0xff;
448   command = (state->COPS_command | (~ via_0->read(*space, VIA_DDRA))) & 0xff;
549449
550450   if (command & 0x80)
551451      return;   /* NOP */
r9699r9700
557457      switch ((command & 0xF0) >> 4)
558458      {
559459      case 0x1:   /* write clock data */
560         if (clock_regs.clock_write_ptr != -1)
460         if (state->clock_regs.clock_write_ptr != -1)
561461         {
562            switch (clock_regs.clock_write_ptr)
462            switch (state->clock_regs.clock_write_ptr)
563463            {
564464            case 0:
565465            case 1:
r9699r9700
567467            case 3:
568468            case 4:
569469               /* alarm */
570               clock_regs.alarm &= ~ (0xf << (4 * (4 - clock_regs.clock_write_ptr)));
571               clock_regs.alarm |= immediate << (4 * (4 - clock_regs.clock_write_ptr));
470               state->clock_regs.alarm &= ~ (0xf << (4 * (4 - state->clock_regs.clock_write_ptr)));
471               state->clock_regs.alarm |= immediate << (4 * (4 - state->clock_regs.clock_write_ptr));
572472               break;
573473            case 5:
574474               /* year */
575               clock_regs.years = immediate;
475               state->clock_regs.years = immediate;
576476               break;
577477            case 6:
578478               /* day */
579               clock_regs.days1 = immediate;
479               state->clock_regs.days1 = immediate;
580480               break;
581481            case 7:
582482               /* day */
583               clock_regs.days2 = immediate;
483               state->clock_regs.days2 = immediate;
584484               break;
585485            case 8:
586486               /* day */
587               clock_regs.days3 = immediate;
487               state->clock_regs.days3 = immediate;
588488               break;
589489            case 9:
590490               /* hours */
591               clock_regs.hours1 = immediate;
491               state->clock_regs.hours1 = immediate;
592492               break;
593493            case 10:
594494               /* hours */
595               clock_regs.hours2 = immediate;
495               state->clock_regs.hours2 = immediate;
596496               break;
597497            case 11:
598498               /* minutes */
599               clock_regs.minutes1 = immediate;
499               state->clock_regs.minutes1 = immediate;
600500               break;
601501            case 12:
602502               /* minutes */
603               clock_regs.minutes1 = immediate;
503               state->clock_regs.minutes1 = immediate;
604504               break;
605505            case 13:
606506               /* seconds */
607               clock_regs.seconds1 = immediate;
507               state->clock_regs.seconds1 = immediate;
608508               break;
609509            case 14:
610510               /* seconds */
611               clock_regs.seconds2 = immediate;
511               state->clock_regs.seconds2 = immediate;
612512               break;
613513            case 15:
614514               /* tenth */
615               clock_regs.tenths = immediate;
515               state->clock_regs.tenths = immediate;
616516               break;
617517            }
618            clock_regs.clock_write_ptr++;
619            if (clock_regs.clock_write_ptr == 16)
620               clock_regs.clock_write_ptr = -1;
518            state->clock_regs.clock_write_ptr++;
519            if (state->clock_regs.clock_write_ptr == 16)
520               state->clock_regs.clock_write_ptr = -1;
621521         }
622522
623523         break;
r9699r9700
625525      case 0x2:   /* set clock mode */
626526         if (immediate & 0x8)
627527         {   /* start setting the clock */
628            clock_regs.clock_write_ptr = 0;
528            state->clock_regs.clock_write_ptr = 0;
629529         }
630530         else
631531         {   /* clock write disabled */
632            clock_regs.clock_write_ptr = -1;
532            state->clock_regs.clock_write_ptr = -1;
633533         }
634534
635535         if (! (immediate & 0x4))
r9699r9700
641541            /* should never happen */
642542         }
643543
644         clock_regs.clock_mode = (clock_mode_t)(immediate & 0x3);
544         state->clock_regs.clock_mode = (clock_mode_t)(immediate & 0x3);
645545         break;
646546
647547#if 0
r9699r9700
656556#endif
657557
658558      case 0x5:   /* set high nibble of NMI character to nnnn */
659         NMIcode = (NMIcode & 0x0f) | (immediate << 4);
559         state->NMIcode = (state->NMIcode & 0x0f) | (immediate << 4);
660560         break;
661561
662562      case 0x6:   /* set low nibble of NMI character to nnnn */
663         NMIcode = (NMIcode & 0xf0) | immediate;
563         state->NMIcode = (state->NMIcode & 0xf0) | immediate;
664564         break;
665565
666566      case 0x7:   /* send mouse command */
667567         if (immediate & 0x8)
668            timer_adjust_periodic(mouse_timer, attotime_zero, 0, ATTOTIME_IN_MSEC((immediate & 0x7)*4)); /* enable mouse */
568            timer_adjust_periodic(state->mouse_timer, attotime_zero, 0, ATTOTIME_IN_MSEC((immediate & 0x7)*4)); /* enable mouse */
669569         else
670            timer_reset(mouse_timer, attotime_never);
570            timer_reset(state->mouse_timer, attotime_never);
671571         break;
672572      }
673573   }
r9699r9700
690590            UINT8 reply[7];
691591
692592            reply[0] = 0x80;
693            reply[1] = 0xE0 | clock_regs.years;
694            reply[2] = (clock_regs.days1 << 4) | clock_regs.days2;
695            reply[3] = (clock_regs.days3 << 4) | clock_regs.hours1;
696            reply[4] = (clock_regs.hours2 << 4) | clock_regs.minutes1;
697            reply[5] = (clock_regs.minutes2 << 4) | clock_regs.seconds1;
698            reply[6] = (clock_regs.seconds2 << 4) | clock_regs.tenths;
593            reply[1] = 0xE0 | state->clock_regs.years;
594            reply[2] = (state->clock_regs.days1 << 4) | state->clock_regs.days2;
595            reply[3] = (state->clock_regs.days3 << 4) | state->clock_regs.hours1;
596            reply[4] = (state->clock_regs.hours2 << 4) | state->clock_regs.minutes1;
597            reply[5] = (state->clock_regs.minutes2 << 4) | state->clock_regs.seconds1;
598            reply[6] = (state->clock_regs.seconds2 << 4) | state->clock_regs.tenths;
699599
700600            COPS_queue_data(machine, reply, 7);
701601         }
r9699r9700
707607/* this timer callback raises the COPS Ready line, which tells the COPS is about to read a command */
708608static TIMER_CALLBACK(set_COPS_ready)
709609{
710   COPS_Ready = 1;
610   lisa_state *state = machine->driver_data<lisa_state>();
611   state->COPS_Ready = 1;
711612
712613   /* impulsion width : +/- 20us */
713614   timer_set(machine, ATTOTIME_IN_USEC(20), NULL, 0, read_COPS_command);
714615}
715616
716static void reset_COPS(void)
617static void reset_COPS(lisa_state *state)
717618{
718619   int i;
719620
720   fifo_size = 0;
721   fifo_head = 0;
722   fifo_tail = 0;
723   mouse_data_offset = -1;
621   state->fifo_size = 0;
622   state->fifo_head = 0;
623   state->fifo_tail = 0;
624   state->mouse_data_offset = -1;
724625
725626   for (i=0; i<8; i++)
726      key_matrix[i] = 0;
627      state->key_matrix[i] = 0;
727628
728   timer_reset(mouse_timer, attotime_never);
629   timer_reset(state->mouse_timer, attotime_never);
729630}
730631
731632static void unplug_keyboard(running_machine *machine)
r9699r9700
771672/* called at power-up */
772673static void init_COPS(running_machine *machine)
773674{
774   COPS_Ready = 0;
675   lisa_state *state = machine->driver_data<lisa_state>();
676   state->COPS_Ready = 0;
775677
776   reset_COPS();
678   reset_COPS(state);
777679}
778680
779681
r9699r9700
787689*/
788690static WRITE8_DEVICE_HANDLER(COPS_via_out_a)
789691{
790   COPS_command = data;
692   lisa_state *state = device->machine->driver_data<lisa_state>();
693   state->COPS_command = data;
791694}
792695
793696static WRITE8_DEVICE_HANDLER(COPS_via_out_ca2)
794697{
795   hold_COPS_data = data;
698   lisa_state *state = device->machine->driver_data<lisa_state>();
699   state->hold_COPS_data = data;
796700
797701   /*logerror("COPS CA2 line state : %d\n", val);*/
798702
r9699r9700
816720*/
817721static READ8_DEVICE_HANDLER(COPS_via_in_b)
818722{
723   lisa_state *state = device->machine->driver_data<lisa_state>();
819724   int val = 0;
820725
821   if (! COPS_Ready)
726   if (! state->COPS_Ready)
822727      val |= 0x40;
823728
824   if (FDIR)
729   if (state->FDIR)
825730      val |= 0x10;
826731
827732   return val;
r9699r9700
829734
830735static WRITE8_DEVICE_HANDLER(COPS_via_out_b)
831736{
737   lisa_state *state = device->machine->driver_data<lisa_state>();
832738   via6522_device *via_0 = device->machine->device<via6522_device>("via6522_0");
833739   address_space *space = cputag_get_address_space(device->machine, "maincpu", ADDRESS_SPACE_PROGRAM);
834740
r9699r9700
837743
838744   if (data & 0x01)
839745   {
840      if (COPS_force_unplug)
746      if (state->COPS_force_unplug)
841747      {
842         COPS_force_unplug = 0;
748         state->COPS_force_unplug = 0;
843749         plug_keyboard(device->machine);
844750      }
845751   }
846752   else
847753   {
848      if (! COPS_force_unplug)
754      if (! state->COPS_force_unplug)
849755      {
850         COPS_force_unplug = 1;
756         state->COPS_force_unplug = 1;
851757         unplug_keyboard(device->machine);
852         //reset_COPS();
758         //reset_COPS(state);
853759      }
854760   }
855761}
r9699r9700
862768
863769static void COPS_via_irq_func(running_device *device, int val)
864770{
865   if (KBIR != val)
771   lisa_state *state = device->machine->driver_data<lisa_state>();
772   if (state->KBIR != val)
866773   {
867      KBIR = val;
774      state->KBIR = val;
868775      lisa_field_interrupts(device->machine);
869776   }
870777}
r9699r9700
891798*/
892799static READ8_DEVICE_HANDLER(parallel_via_in_b)
893800{
801   lisa_state *state = device->machine->driver_data<lisa_state>();
894802   int val = 0;
895803
896   if (DISK_DIAG)
804   if (state->DISK_DIAG)
897805      val |= 0x40;
898806
899807   /* tell there is no hard disk : */
r9699r9700
923831*/
924832VIDEO_UPDATE( lisa )
925833{
834   lisa_state *state = screen->machine->driver_data<lisa_state>();
926835   UINT16 *v;
927836   int x, y;
928837   /* resolution is 720*364 on lisa, vs 608*431 on mac XL */
929   int resx = (lisa_features.has_mac_xl_video) ? 608 : 720;   /* width */
930   int resy = (lisa_features.has_mac_xl_video) ? 431 : 364;   /* height */
838   int resx = (state->features.has_mac_xl_video) ? 608 : 720;   /* width */
839   int resy = (state->features.has_mac_xl_video) ? 431 : 364;   /* height */
931840
932841   UINT8 line_buffer[720];
933842
934   v = videoram_ptr;
843   v = state->videoram_ptr;
935844
936845   for (y = 0; y < resy; y++)
937846   {
r9699r9700
946855#if 0   // we can execute directly out of read handlers now, so this shouldn't be necessary any more.  #if 0'd for documentation until we get everything working.
947856DIRECT_UPDATE_HANDLER (lisa_OPbaseoverride)
948857{
858   lisa_state *state = machine->driver_data<lisa_state>();
949859   /* upper 7 bits -> segment # */
950860   int segment = (address >> 17) & 0x7f;
951   int the_seg = seg;
861   int the_seg = state->seg;
952862
953863   address &= 0xffffff;
954864
955865   printf("lisa: logical address %x\n", address);
956866
957   if (setup)
867   if (state->setup)
958868   {
959869      if (address & 0x004000)
960870      {
r9699r9700
968878         }
969879         else
970880         {   /* system ROMs */
971            direct.explicit_configure((address & 0xffc000), (address & 0xffc000) + 0x003fff, 0xffffff, lisa_rom_ptr - (address & 0x3fff));
881            direct.explicit_configure((address & 0xffc000), (address & 0xffc000) + 0x003fff, 0xffffff, state->rom_ptr - (address & 0x3fff));
972882         }
973883
974884         return -1;
r9699r9700
986896      int seg_offset = address & 0x01ffff;
987897
988898      /* add revelant origin -> address */
989      offs_t mapped_address = (mmu_regs[the_seg][segment].sorg + seg_offset) & 0x1fffff;
899      offs_t mapped_address = (state->mmu_regs[the_seg][segment].sorg + seg_offset) & 0x1fffff;
990900
991      switch ((mmu_entry_t)mmu_regs[the_seg][segment].type)
901      switch ((mmu_entry_t)state->mmu_regs[the_seg][segment].type)
992902      {
993903
994904      case RAM_r:
995905      case RAM_rw:
996         if (seg_offset > mmu_regs[the_seg][segment].slim)
906         if (seg_offset > state->mmu_regs[the_seg][segment].slim)
997907         {
998908            /* out of segment limits : bus error */
999909            printf("illegal opbase address%lX\n", (long) address);
1000910         }
1001         direct.explicit_configure((address & 0xffc000), (address & 0xffc000) + 0x003fff, 0xffffff, lisa_ram_ptr + mapped_address - address);
911         direct.explicit_configure((address & 0xffc000), (address & 0xffc000) + 0x003fff, 0xffffff, state->ram_ptr + mapped_address - address);
1002912         printf("RAM\n");
1003913         break;
1004914
r9699r9700
1011921         break;
1012922
1013923      case special_IO:
1014         direct.explicit_configure((address & 0xffc000), (address & 0xffc000) + 0x003fff, 0xffffff, lisa_rom_ptr + (mapped_address & 0x003fff) - address);
924         direct.explicit_configure((address & 0xffc000), (address & 0xffc000) + 0x003fff, 0xffffff, state->rom_ptr + (mapped_address & 0x003fff) - address);
1015925         printf("ROM\n");
1016926         break;
1017927      }
r9699r9700
1025935/* TODO : save time difference with host clock, set default date, etc */
1026936NVRAM_HANDLER(lisa)
1027937{
938   lisa_state *state = machine->driver_data<lisa_state>();
1028939   if (read_or_write)
1029940   {
1030      mame_fwrite(file, lisa_fdc_ram, 1024);
941      mame_fwrite(file, state->fdc_ram, 1024);
1031942   }
1032943   else
1033944   {
1034945      if (file)
1035         mame_fread(file, lisa_fdc_ram, 1024);
946         mame_fread(file, state->fdc_ram, 1024);
1036947      else
1037         memset(lisa_fdc_ram, 0, 1024);
948         memset(state->fdc_ram, 0, 1024);
1038949
1039950      {
1040951         /* Now we copy the host clock into the Lisa clock */
1041952         system_time systime;
1042953         machine->base_datetime(systime);
1043954
1044         clock_regs.alarm = 0xfffffL;
955         state->clock_regs.alarm = 0xfffffL;
1045956         /* The clock count starts on 1st January 1980 */
1046         clock_regs.years = (systime.local_time.year - 1980) & 0xf;
1047         clock_regs.days1 = (systime.local_time.day + 1) / 100;
1048         clock_regs.days2 = ((systime.local_time.day + 1) / 10) % 10;
1049         clock_regs.days3 = (systime.local_time.day + 1) % 10;
1050         clock_regs.hours1 = systime.local_time.hour / 10;
1051         clock_regs.hours2 = systime.local_time.hour % 10;
1052         clock_regs.minutes1 = systime.local_time.minute / 10;
1053         clock_regs.minutes2 = systime.local_time.minute % 10;
1054         clock_regs.seconds1 = systime.local_time.second / 10;
1055         clock_regs.seconds2 = systime.local_time.second % 10;
1056         clock_regs.tenths = 0;
957         state->clock_regs.years = (systime.local_time.year - 1980) & 0xf;
958         state->clock_regs.days1 = (systime.local_time.day + 1) / 100;
959         state->clock_regs.days2 = ((systime.local_time.day + 1) / 10) % 10;
960         state->clock_regs.days3 = (systime.local_time.day + 1) % 10;
961         state->clock_regs.hours1 = systime.local_time.hour / 10;
962         state->clock_regs.hours2 = systime.local_time.hour % 10;
963         state->clock_regs.minutes1 = systime.local_time.minute / 10;
964         state->clock_regs.minutes2 = systime.local_time.minute % 10;
965         state->clock_regs.seconds1 = systime.local_time.second / 10;
966         state->clock_regs.seconds2 = systime.local_time.second % 10;
967         state->clock_regs.tenths = 0;
1057968      }
1058      clock_regs.clock_mode = timer_disable;
1059      clock_regs.clock_write_ptr = -1;
969      state->clock_regs.clock_mode = timer_disable;
970      state->clock_regs.clock_write_ptr = -1;
1060971   }
1061972
1062973
1063974#if 0
1064975   UINT32 temp32;
1065976   SINT8 temp8;
1066   temp32 = (clock_regs.alarm << 12) | (clock_regs.years << 8) | (clock_regs.days1 << 4)
1067           | clock_regs.days2;
977   temp32 = (state->clock_regs.alarm << 12) | (state->clock_regs.years << 8) | (state->clock_regs.days1 << 4)
978           | state->clock_regs.days2;
1068979
1069   temp32 = (clock_regs.days3 << 28) | (clock_regs.hours1 << 24) | (clock_regs.hours2 << 20)
1070           | (clock_regs.minutes1 << 16) | (clock_regs.minutes2 << 12)
1071           | (clock_regs.seconds1 << 8) | (clock_regs.seconds2 << 4) | clock_regs.tenths;
980   temp32 = (state->clock_regs.days3 << 28) | (state->clock_regs.hours1 << 24) | (state->clock_regs.hours2 << 20)
981           | (state->clock_regs.minutes1 << 16) | (state->clock_regs.minutes2 << 12)
982           | (state->clock_regs.seconds1 << 8) | (state->clock_regs.seconds2 << 4) | state->clock_regs.tenths;
1072983
1073984   temp8 = clock_mode;         /* clock mode */
1074985
1075   temp8 = clock_regs.clock_write_ptr;   /* clock byte to be written next (-1 if clock write disabled) */
986   temp8 = state->clock_regs.clock_write_ptr;   /* clock byte to be written next (-1 if clock write disabled) */
1076987#endif
1077988}
1078989
1079990#ifdef UNUSED_FUNCTION
1080991void init_lisa1(void)
1081992{
1082   lisa_model = lisa1;
1083   lisa_features.has_fast_timers = 0;
1084   lisa_features.floppy_hardware = twiggy;
1085   lisa_features.has_double_sided_floppy = 1;
1086   lisa_features.has_mac_xl_video = 0;
993   lisa_state *state = machine->driver_data<lisa_state>();
994   state->model = lisa1;
995   state->features.has_fast_timers = 0;
996   state->features.floppy_hardware = twiggy;
997   state->features.has_double_sided_floppy = 1;
998   state->features.has_mac_xl_video = 0;
1087999}
10881000#endif
10891001
10901002DRIVER_INIT( lisa2 )
10911003{
1092   lisa_ram_ptr = memory_region(machine, "maincpu") + RAM_OFFSET;
1093   lisa_rom_ptr = memory_region(machine, "maincpu") + ROM_OFFSET;
1094   lisa_model = lisa2;
1095   lisa_features.has_fast_timers = 0;
1096   lisa_features.floppy_hardware = sony_lisa2;
1097   lisa_features.has_double_sided_floppy = 0;
1098   lisa_features.has_mac_xl_video = 0;
1004   lisa_state *state = machine->driver_data<lisa_state>();
1005   state->ram_ptr = memory_region(machine, "maincpu") + RAM_OFFSET;
1006   state->rom_ptr = memory_region(machine, "maincpu") + ROM_OFFSET;
1007   state->model = lisa2;
1008   state->features.has_fast_timers = 0;
1009   state->features.floppy_hardware = sony_lisa2;
1010   state->features.has_double_sided_floppy = 0;
1011   state->features.has_mac_xl_video = 0;
10991012
1100   bad_parity_table = auto_alloc_array(machine, UINT8, 0x40000);  /* 1 bit per byte of CPU RAM */
1013   state->bad_parity_table = auto_alloc_array(machine, UINT8, 0x40000);  /* 1 bit per byte of CPU RAM */
11011014}
11021015
11031016DRIVER_INIT( lisa210 )
11041017{
1105   lisa_ram_ptr = memory_region(machine, "maincpu") + RAM_OFFSET;
1106   lisa_rom_ptr = memory_region(machine, "maincpu") + ROM_OFFSET;
1107   lisa_model = lisa210;
1108   lisa_features.has_fast_timers = 1;
1109   lisa_features.floppy_hardware = sony_lisa210;
1110   lisa_features.has_double_sided_floppy = 0;
1111   lisa_features.has_mac_xl_video = 0;
1018   lisa_state *state = machine->driver_data<lisa_state>();
1019   state->ram_ptr = memory_region(machine, "maincpu") + RAM_OFFSET;
1020   state->rom_ptr = memory_region(machine, "maincpu") + ROM_OFFSET;
1021   state->model = lisa210;
1022   state->features.has_fast_timers = 1;
1023   state->features.floppy_hardware = sony_lisa210;
1024   state->features.has_double_sided_floppy = 0;
1025   state->features.has_mac_xl_video = 0;
11121026
1113   bad_parity_table = auto_alloc_array(machine, UINT8, 0x40000);  /* 1 bit per byte of CPU RAM */
1027   state->bad_parity_table = auto_alloc_array(machine, UINT8, 0x40000);  /* 1 bit per byte of CPU RAM */
11141028}
11151029
11161030DRIVER_INIT( mac_xl )
11171031{
1118   lisa_ram_ptr = memory_region(machine, "maincpu") + RAM_OFFSET;
1119   lisa_rom_ptr = memory_region(machine, "maincpu") + ROM_OFFSET;
1120   lisa_model = mac_xl;
1121   lisa_features.has_fast_timers = 1;
1122   lisa_features.floppy_hardware = sony_lisa210;
1123   lisa_features.has_double_sided_floppy = 0;
1124   lisa_features.has_mac_xl_video = 1;
1032   lisa_state *state = machine->driver_data<lisa_state>();
1033   state->ram_ptr = memory_region(machine, "maincpu") + RAM_OFFSET;
1034   state->rom_ptr = memory_region(machine, "maincpu") + ROM_OFFSET;
1035   state->model = mac_xl;
1036   state->features.has_fast_timers = 1;
1037   state->features.floppy_hardware = sony_lisa210;
1038   state->features.has_double_sided_floppy = 0;
1039   state->features.has_mac_xl_video = 1;
11251040
1126   bad_parity_table = auto_alloc_array(machine, UINT8, 0x40000);  /* 1 bit per byte of CPU RAM */
1041   state->bad_parity_table = auto_alloc_array(machine, UINT8, 0x40000);  /* 1 bit per byte of CPU RAM */
11271042}
11281043
11291044MACHINE_START( lisa )
11301045{
1131   mouse_timer = timer_alloc(machine, handle_mouse, NULL);
1046   lisa_state *state = machine->driver_data<lisa_state>();
1047   state->mouse_timer = timer_alloc(machine, handle_mouse, NULL);
11321048
11331049   /* read command every ms (don't know the real value) */
11341050   timer_pulse(machine, ATTOTIME_IN_MSEC(1), NULL, 0, set_COPS_ready);
r9699r9700
11361052
11371053MACHINE_RESET( lisa )
11381054{
1139   lisa_ram_ptr = memory_region(machine, "maincpu") + RAM_OFFSET;
1140   lisa_rom_ptr = memory_region(machine, "maincpu") + ROM_OFFSET;
1141   videoROM_ptr = memory_region(machine, "gfx1");
1055   lisa_state *state = machine->driver_data<lisa_state>();
1056   state->ram_ptr = memory_region(machine, "maincpu") + RAM_OFFSET;
1057   state->rom_ptr = memory_region(machine, "maincpu") + ROM_OFFSET;
1058   state->videoROM_ptr = memory_region(machine, "gfx1");
11421059
11431060//   cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM)->set_direct_update_handler(direct_update_delegate_create_static(lisa_OPbaseoverride, *machine));
11441061//   m68k_set_reset_callback(machine->device("maincpu"), /*lisa_reset_instr_callback*/NULL);
11451062
11461063   /* init MMU */
1147   setup = 1;
1148   seg = 0;
1064   state->setup = 1;
1065   state->seg = 0;
11491066
11501067   /* init parity */
1151   diag2 = 0;
1152   test_parity = 0;
1153   parity_error_pending = 0;
1068   state->diag2 = 0;
1069   state->test_parity = 0;
1070   state->parity_error_pending = 0;
11541071
1155   bad_parity_count = 0;
1156   memset(bad_parity_table, 0, 0x40000);   /* Clear */
1072   state->bad_parity_count = 0;
1073   memset(state->bad_parity_table, 0, 0x40000);   /* Clear */
11571074
11581075   /* init video */
11591076
1160   VTMSK = 0;
1077   state->VTMSK = 0;
11611078   set_VTIR(machine, 0);
11621079
1163   video_address_latch = 0;
1164   videoram_ptr = (UINT16 *) lisa_ram_ptr;
1080   state->video_address_latch = 0;
1081   state->videoram_ptr = (UINT16 *) state->ram_ptr;
11651082
11661083   /* reset COPS keyboard/mouse controller */
11671084   init_COPS(machine);
r9699r9700
11731090
11741091   /* initialize floppy */
11751092   {
1176      if (lisa_features.floppy_hardware == sony_lisa2)
1093      if (state->features.floppy_hardware == sony_lisa2)
11771094      {
11781095         sony_set_enable_lines(machine->device("fdc"),1);   /* on lisa2, drive unit 1 is always selected (?) */
11791096      }
r9699r9700
11851102
11861103INTERRUPT_GEN( lisa_interrupt )
11871104{
1188   static int frame_count = 0;
1189
1190   if ((++frame_count) == 6)
1105   lisa_state *state = device->machine->driver_data<lisa_state>();
1106   if ((++state->frame_count) == 6)
11911107   {   /* increment clock every 1/10s */
1192      frame_count = 0;
1108      state->frame_count = 0;
11931109
1194      if (clock_regs.clock_mode != clock_timer_disable)
1110      if (state->clock_regs.clock_mode != clock_timer_disable)
11951111      {
1196         if ((++clock_regs.tenths) == 10)
1112         if ((++state->clock_regs.tenths) == 10)
11971113         {
1198            clock_regs.tenths = 0;
1114            state->clock_regs.tenths = 0;
11991115
1200            if (clock_regs.clock_mode != timer_disable)
1116            if (state->clock_regs.clock_mode != timer_disable)
12011117            {
1202               if (clock_regs.alarm == 0)
1118               if (state->clock_regs.alarm == 0)
12031119               {
12041120                  /* generate reset (should cause a VIA interrupt...) */
12051121                  static const UINT8 cmd[2] =
r9699r9700
12091125                  };
12101126                  COPS_queue_data(device->machine, cmd, 2);
12111127
1212                  clock_regs.alarm = 0xfffffL;
1128                  state->clock_regs.alarm = 0xfffffL;
12131129               }
12141130               else
12151131               {
1216                  clock_regs.alarm--;
1132                  state->clock_regs.alarm--;
12171133               }
12181134            }
12191135
1220            if ((++clock_regs.seconds2) == 10)
1136            if ((++state->clock_regs.seconds2) == 10)
12211137            {
1222               clock_regs.seconds2 = 0;
1138               state->clock_regs.seconds2 = 0;
12231139
1224               if ((++clock_regs.seconds1) == 6)
1140               if ((++state->clock_regs.seconds1) == 6)
12251141               {
1226                  clock_regs.seconds1 = 0;
1142                  state->clock_regs.seconds1 = 0;
12271143
1228                  if ((++clock_regs.minutes2) == 10)
1144                  if ((++state->clock_regs.minutes2) == 10)
12291145                  {
1230                     clock_regs.minutes2 = 0;
1146                     state->clock_regs.minutes2 = 0;
12311147
1232                     if ((++clock_regs.minutes1) == 6)
1148                     if ((++state->clock_regs.minutes1) == 6)
12331149                     {
1234                        clock_regs.minutes1 = 0;
1150                        state->clock_regs.minutes1 = 0;
12351151
1236                        if ((++clock_regs.hours2) == 10)
1152                        if ((++state->clock_regs.hours2) == 10)
12371153                        {
1238                           clock_regs.hours2 = 0;
1154                           state->clock_regs.hours2 = 0;
12391155
1240                           clock_regs.hours1++;
1156                           state->clock_regs.hours1++;
12411157                        }
12421158
1243                        if ((clock_regs.hours1*10 + clock_regs.hours2) == 24)
1159                        if ((state->clock_regs.hours1*10 + state->clock_regs.hours2) == 24)
12441160                        {
1245                           clock_regs.hours1 = clock_regs.hours2 = 0;
1161                           state->clock_regs.hours1 = state->clock_regs.hours2 = 0;
12461162
1247                           if ((++clock_regs.days3) == 10)
1163                           if ((++state->clock_regs.days3) == 10)
12481164                           {
1249                              clock_regs.days3 = 0;
1165                              state->clock_regs.days3 = 0;
12501166
1251                              if ((++clock_regs.days2) == 10)
1167                              if ((++state->clock_regs.days2) == 10)
12521168                              {
1253                                 clock_regs.days2 = 0;
1169                                 state->clock_regs.days2 = 0;
12541170
1255                                 clock_regs.days1++;
1171                                 state->clock_regs.days1++;
12561172                              }
12571173                           }
12581174
1259                           if ((clock_regs.days1*100 + clock_regs.days2*10 + clock_regs.days3) ==
1260                              ((clock_regs.years % 4) ? 366 : 367))
1175                           if ((state->clock_regs.days1*100 + state->clock_regs.days2*10 + state->clock_regs.days3) ==
1176                              ((state->clock_regs.years % 4) ? 366 : 367))
12611177                           {
1262                              clock_regs.days1 = clock_regs.days2 = clock_regs.days3 = 0;
1178                              state->clock_regs.days1 = state->clock_regs.days2 = state->clock_regs.days3 = 0;
12631179
1264                              clock_regs.years = (clock_regs.years + 1) & 0xf;
1180                              state->clock_regs.years = (state->clock_regs.years + 1) & 0xf;
12651181                           }
12661182                        }
12671183                     }
r9699r9700
12731189   }
12741190
12751191   /* set VBI */
1276   if (VTMSK)
1192   if (state->VTMSK)
12771193      set_VTIR(device->machine, 1);
12781194   else
12791195      set_VTIR(device->machine, 0);
r9699r9700
12911207
12921208INLINE void lisa_fdc_ttl_glue_access(running_machine *machine, offs_t offset)
12931209{
1210   lisa_state *state = machine->driver_data<lisa_state>();
12941211   switch ((offset & 0x000E) >> 1)
12951212   {
12961213   case 0:
r9699r9700
13031220      /* enable/disable the motor on Lisa 1 */
13041221      /* can disable the motor on Lisa 2/10, too (although it is not useful) */
13051222      /* On lisa 2, commands the loading of the speed register on lisalite board */
1306      if (lisa_features.floppy_hardware == sony_lisa2)
1223      if (state->features.floppy_hardware == sony_lisa2)
13071224      {
1308         int oldMT1 = MT1;
1309         MT1 = offset & 1;
1310         if (MT1 && ! oldMT1)
1225         int oldMT1 = state->MT1;
1226         state->MT1 = offset & 1;
1227         if (state->MT1 && ! oldMT1)
13111228         {
13121229            running_device *fdc = machine->device("fdc");
13131230
1314            PWM_floppy_motor_speed = (PWM_floppy_motor_speed << 1) & 0xff;
1231            state->PWM_floppy_motor_speed = (state->PWM_floppy_motor_speed << 1) & 0xff;
13151232            if (applefdc_get_lines(fdc) & APPLEFDC_PH0)
1316               PWM_floppy_motor_speed |= 1;
1317            sony_set_speed(((256-PWM_floppy_motor_speed) * 1.3) + 237);
1233               state->PWM_floppy_motor_speed |= 1;
1234            sony_set_speed(((256-state->PWM_floppy_motor_speed) * 1.3) + 237);
13181235         }
13191236      }
13201237      /*else
1321            MT1 = offset & 1;*/
1238            state->MT1 = offset & 1;*/
13221239      break;
13231240   case 4:
13241241      /*DIS = offset & 1;*/   /* forbids access from the 68000 to our RAM */
r9699r9700
13261243   case 5:
13271244      /*HDS = offset & 1;*/      /* head select (-> disk side) on twiggy */
13281245#if 0
1329      if (lisa_features.floppy_hardware == twiggy)
1246      if (state->features.floppy_hardware == twiggy)
13301247         twiggy_set_head_line(offset & 1);
13311248      else
13321249#endif
1333      if (lisa_features.floppy_hardware == sony_lisa210)
1250      if (state->features.floppy_hardware == sony_lisa210)
13341251         sony_set_sel_line(machine->device("fdc"), offset & 1);
13351252      break;
13361253   case 6:
1337      DISK_DIAG = offset & 1;
1254      state->DISK_DIAG = offset & 1;
13381255      break;
13391256   case 7:
1340      FDIR = offset & 1;   /* Interrupt request to 68k */
1257      state->FDIR = offset & 1;   /* Interrupt request to 68k */
13411258      lisa_field_interrupts(machine);
13421259      break;
13431260   }
r9699r9700
13731290
13741291WRITE8_HANDLER ( lisa_fdc_io_w )
13751292{
1293   lisa_state *state = space->machine->driver_data<lisa_state>();
13761294   running_device *fdc = space->machine->device("fdc");
13771295
13781296   switch ((offset & 0x0030) >> 4)
r9699r9700
13881306   case 2:   /* writes the PWM register */
13891307      /* the written value is used to generate the motor speed control signal */
13901308#if 0
1391      if (lisa_features.floppy_hardware == twiggy)
1309      if (state->features.floppy_hardware == twiggy)
13921310         twiggy_set_speed((256-data) * 1.3 /* ??? */ + 237 /* ??? */);
13931311      else
13941312#endif
1395      if (lisa_features.floppy_hardware == sony_lisa210)
1313      if (state->features.floppy_hardware == sony_lisa210)
13961314         sony_set_speed(((256-data) * 1.3) + 237);
13971315      break;
13981316
r9699r9700
14031321
14041322READ8_HANDLER ( lisa_fdc_r )
14051323{
1324   lisa_state *state = space->machine->driver_data<lisa_state>();
14061325   if (! (offset & 0x1000))
14071326   {
14081327      if (! (offset & 0x0800))
14091328         if (! (offset & 0x0400))
1410            return lisa_fdc_ram[offset & 0x03ff];
1329            return state->fdc_ram[offset & 0x03ff];
14111330         else
14121331            return lisa_fdc_io_r(space, offset & 0x03ff);
14131332      else
14141333         return 0;   /* ??? */
14151334   }
14161335   else
1417      return lisa_fdc_rom[offset & 0x0fff];
1336      return state->fdc_rom[offset & 0x0fff];
14181337}
14191338
14201339READ8_HANDLER ( lisa210_fdc_r )
14211340{
1341   lisa_state *state = space->machine->driver_data<lisa_state>();
14221342   if (! (offset & 0x1000))
14231343   {
14241344      if (! (offset & 0x0400))
14251345         if (! (offset & 0x0800))
1426            return lisa_fdc_ram[offset & 0x03ff];
1346            return state->fdc_ram[offset & 0x03ff];
14271347         else
14281348            return lisa_fdc_io_r(space, offset & 0x03ff);
14291349      else
14301350         return 0;   /* ??? */
14311351   }
14321352   else
1433      return lisa_fdc_rom[offset & 0x0fff];
1353      return state->fdc_rom[offset & 0x0fff];
14341354}
14351355
14361356WRITE8_HANDLER ( lisa_fdc_w )
14371357{
1358   lisa_state *state = space->machine->driver_data<lisa_state>();
14381359   if (! (offset & 0x1000))
14391360   {
14401361      if (! (offset & 0x0800))
14411362      {
14421363         if (! (offset & 0x0400))
1443            lisa_fdc_ram[offset & 0x03ff] = data;
1364            state->fdc_ram[offset & 0x03ff] = data;
14441365         else
14451366            lisa_fdc_io_w(space, offset & 0x03ff, data);
14461367      }
r9699r9700
14491370
14501371WRITE8_HANDLER ( lisa210_fdc_w )
14511372{
1373   lisa_state *state = space->machine->driver_data<lisa_state>();
14521374   if (! (offset & 0x1000))
14531375   {
14541376      if (! (offset & 0x0400))
14551377      {
14561378         if (! (offset & 0x0800))
1457            lisa_fdc_ram[offset & 0x03ff] = data;
1379            state->fdc_ram[offset & 0x03ff] = data;
14581380         else
14591381            lisa_fdc_io_w(space, offset & 0x03ff, data);
14601382      }
r9699r9700
14631385
14641386READ16_HANDLER ( lisa_r )
14651387{
1388   lisa_state *state = space->machine->driver_data<lisa_state>();
14661389   int answer=0;
14671390
14681391   /* segment register set */
1469   int the_seg = seg;
1392   int the_seg = state->seg;
14701393
14711394   /* upper 7 bits -> segment # */
14721395   int segment = (offset >> 16) & 0x7f;
14731396
14741397   /*logerror("read, logical address%lX\n", offset);*/
14751398
1476   if (setup)
1399   if (state->setup)
14771400   {   /* special setup mode */
14781401      if (offset & 0x002000)
14791402      {
r9699r9700
14861409            /*logerror("read from segment registers (%X:%X) ", the_seg, segment);*/
14871410            if (offset & 0x000004)
14881411            {   /* sorg register */
1489               answer = real_mmu_regs[the_seg][segment].sorg;
1412               answer = state->real_mmu_regs[the_seg][segment].sorg;
14901413               /*logerror("sorg, data = %X\n", answer);*/
14911414            }
14921415            else
14931416            {   /* slim register */
1494               answer = real_mmu_regs[the_seg][segment].slim;
1417               answer = state->real_mmu_regs[the_seg][segment].slim;
14951418               /*logerror("slim, data = %X\n", answer);*/
14961419            }
14971420         }
14981421         else
14991422         {   /* system ROMs */
1500            answer = ((UINT16*)lisa_rom_ptr)[(offset & 0x001fff)];
1423            answer = ((UINT16*)state->rom_ptr)[(offset & 0x001fff)];
15011424            /*logerror("dst address in ROM (setup mode)\n");*/
15021425         }
15031426
r9699r9700
15141437      int seg_offset = (offset & 0x00ffff) << 1;
15151438
15161439      /* add revelant origin -> address */
1517      offs_t address = (mmu_regs[the_seg][segment].sorg + seg_offset) & 0x1fffff;
1440      offs_t address = (state->mmu_regs[the_seg][segment].sorg + seg_offset) & 0x1fffff;
15181441
15191442      /*logerror("read, logical address%lX\n", offset);
15201443        logerror("physical address%lX\n", address);*/
15211444
1522      switch (mmu_regs[the_seg][segment].type)
1445      switch (state->mmu_regs[the_seg][segment].type)
15231446      {
15241447
15251448      case RAM_stack_r:
15261449      case RAM_stack_rw:
1527         if (address <= mmu_regs[the_seg][segment].slim)
1450         if (address <= state->mmu_regs[the_seg][segment].slim)
15281451         {
15291452            /* out of segment limits : bus error */
15301453
15311454         }
1532         answer = *(UINT16 *)(lisa_ram_ptr + address);
1455         answer = *(UINT16 *)(state->ram_ptr + address);
15331456
1534         if (bad_parity_count && test_parity
1535               && (bad_parity_table[address >> 3] & (0x3 << (address & 0x7))))
1457         if (state->bad_parity_count && state->test_parity
1458               && (state->bad_parity_table[address >> 3] & (0x3 << (address & 0x7))))
15361459         {
1537            mem_err_addr_latch = address >> 5;
1460            state->mem_err_addr_latch = address >> 5;
15381461            set_parity_error_pending(space->machine, 1);
15391462         }
15401463
r9699r9700
15421465
15431466      case RAM_r:
15441467      case RAM_rw:
1545         if (address > mmu_regs[the_seg][segment].slim)
1468         if (address > state->mmu_regs[the_seg][segment].slim)
15461469         {
15471470            /* out of segment limits : bus error */
15481471
15491472         }
1550         answer = *(UINT16 *)(lisa_ram_ptr + address);
1473         answer = *(UINT16 *)(state->ram_ptr + address);
15511474
1552         if (bad_parity_count && test_parity
1553               && (bad_parity_table[address >> 3] & (0x3 << (address & 0x7))))
1475         if (state->bad_parity_count && state->test_parity
1476               && (state->bad_parity_table[address >> 3] & (0x3 << (address & 0x7))))
15541477         {
1555            mem_err_addr_latch = address >> 5;
1478            state->mem_err_addr_latch = address >> 5;
15561479            set_parity_error_pending(space->machine, 1);
15571480         }
15581481
r9699r9700
15721495
15731496      case special_IO:
15741497         if (! (address & 0x008000))
1575            answer = *(UINT16 *)(lisa_rom_ptr + (address & 0x003fff));
1498            answer = *(UINT16 *)(state->rom_ptr + (address & 0x003fff));
15761499         else
15771500         {   /* read serial number from ROM */
15781501            /* this has to be be the least efficient way to read a ROM :-) */
r9699r9700
15821505                are slightly different from timings of a bare 68k */
15831506            /* so we use a kludge... */
15841507            int time_in_frame = space->machine->primary_screen->vpos();
1585            static int videoROM_address = 0;
15861508
15871509            /* the BOOT ROM only reads 56 bits, so there must be some wrap-around for
15881510                videoROM_address <= 56 */
r9699r9700
15971519                there are no additionnal margins).
15981520                This is caused by the fact that 68k timings are wrong (memory accesses are
15991521                interlaced with the video hardware, which is not emulated). */
1600            if (lisa_features.has_mac_xl_video)
1522            if (state->features.has_mac_xl_video)
16011523            {
16021524               if ((time_in_frame >= 374) && (time_in_frame <= 392))   /* these values have not been tested */
1603                  answer = videoROM_ptr[videoROM_address|0x80] << 8;
1525                  answer = state->videoROM_ptr[state->videoROM_address|0x80] << 8;
16041526               else
1605                  answer = videoROM_ptr[videoROM_address] << 8;
1527                  answer = state->videoROM_ptr[state->videoROM_address] << 8;
16061528            }
16071529            else
16081530            {
16091531               if ((time_in_frame >= 364) && (time_in_frame <= 375))
16101532               {
1611                  answer = videoROM_ptr[videoROM_address|0x80] << 8;
1533                  answer = state->videoROM_ptr[state->videoROM_address|0x80] << 8;
16121534            logerror("reading1 %06X=%04x PC=%06x time=%d\n", address, answer, cpu_get_pc(space->machine->device("maincpu")), time_in_frame);
16131535               }
16141536               else
16151537               {
1616                  answer = videoROM_ptr[videoROM_address] << 8;
1538                  answer = state->videoROM_ptr[state->videoROM_address] << 8;
16171539            logerror("reading2 %06X=%04x PC=%06x time=%d\n", address, answer, cpu_get_pc(space->machine->device("maincpu")), time_in_frame);
16181540               }
16191541            }
16201542
16211543
1622            videoROM_address = (videoROM_address + 1) & 0x7f;
1623            if (videoROM_address == ((lisa_features.has_mac_xl_video) ? 48 : 56)) {
1624                logerror("loop %d\n", videoROM_address);
1625               videoROM_address = 0;
1544            state->videoROM_address = (state->videoROM_address + 1) & 0x7f;
1545            if (state->videoROM_address == ((state->features.has_mac_xl_video) ? 48 : 56)) {
1546               logerror("loop %d\n", state->videoROM_address);
1547               state->videoROM_address = 0;
16261548            }
16271549
16281550         }
r9699r9700
16381560
16391561WRITE16_HANDLER ( lisa_w )
16401562{
1563   lisa_state *state = space->machine->driver_data<lisa_state>();
16411564   /* segment register set */
1642   int the_seg = seg;
1565   int the_seg = state->seg;
16431566
16441567   /* upper 7 bits -> segment # */
16451568   int segment = (offset >> 16) & 0x7f;
16461569
16471570
1648   if (setup)
1571   if (state->setup)
16491572   {
16501573      if (offset & 0x002000)
16511574      {
r9699r9700
16591582            if (offset & 0x000004)
16601583            {   /* sorg register */
16611584               logerror("sorg, data = %X\n", data);
1662               real_mmu_regs[the_seg][segment].sorg = data & 0xFFF;
1663               mmu_regs[the_seg][segment].sorg = (data & 0x0fff) << 9;
1585               state->real_mmu_regs[the_seg][segment].sorg = data & 0xFFF;
1586               state->mmu_regs[the_seg][segment].sorg = (data & 0x0fff) << 9;
16641587            }
16651588            else
16661589            {   /* slim register */
16671590               logerror("slim, data = %X\n", data);
1668               real_mmu_regs[the_seg][segment].slim = data & 0xFFF;
1669               mmu_regs[the_seg][segment].slim = (~ (data << 9)) & 0x01ffff;
1591               state->real_mmu_regs[the_seg][segment].slim = data & 0xFFF;
1592               state->mmu_regs[the_seg][segment].slim = (~ (data << 9)) & 0x01ffff;
16701593               switch ((data & 0x0f00) >> 8)
16711594               {
16721595               case 0x4:
16731596                  /*logerror("type : RAM stack r\n");*/
1674                  mmu_regs[the_seg][segment].type = RAM_stack_r;
1597                  state->mmu_regs[the_seg][segment].type = RAM_stack_r;
16751598                  break;
16761599               case 0x5:
16771600                  /*logerror("type : RAM r\n");*/
1678                  mmu_regs[the_seg][segment].type = RAM_r;
1601                  state->mmu_regs[the_seg][segment].type = RAM_r;
16791602                  break;
16801603               case 0x6:
16811604                  /*logerror("type : RAM stack rw\n");*/
1682                  mmu_regs[the_seg][segment].type = RAM_stack_rw;
1605                  state->mmu_regs[the_seg][segment].type = RAM_stack_rw;
16831606                  break;
16841607               case 0x7:
16851608                  /*logerror("type : RAM rw\n");*/
1686                  mmu_regs[the_seg][segment].type = RAM_rw;
1609                  state->mmu_regs[the_seg][segment].type = RAM_rw;
16871610                  break;
16881611               case 0x8:
16891612               case 0x9:   /* not documented, but used by ROMs (?) */
16901613                  /*logerror("type : I/O\n");*/
1691                  mmu_regs[the_seg][segment].type = IO;
1614                  state->mmu_regs[the_seg][segment].type = IO;
16921615                  break;
16931616               case 0xC:
16941617                  /*logerror("type : invalid\n");*/
1695                  mmu_regs[the_seg][segment].type = invalid;
1618                  state->mmu_regs[the_seg][segment].type = invalid;
16961619                  break;
16971620               case 0xF:
16981621                  logerror("type : special I/O\n");
1699                  mmu_regs[the_seg][segment].type = special_IO;
1622                  state->mmu_regs[the_seg][segment].type = special_IO;
17001623                  break;
17011624               default:   /* "unpredictable results" */
17021625                  logerror("type : unknown\n");
1703                  mmu_regs[the_seg][segment].type = invalid;
1626                  state->mmu_regs[the_seg][segment].type = invalid;
17041627                  break;
17051628               }
17061629            }
r9699r9700
17221645      int seg_offset = (offset & 0x00ffff) << 1;
17231646
17241647      /* add revelant origin -> address */
1725      offs_t address = (mmu_regs[the_seg][segment].sorg + seg_offset) & 0x1fffff;
1648      offs_t address = (state->mmu_regs[the_seg][segment].sorg + seg_offset) & 0x1fffff;
17261649
1727      switch (mmu_regs[the_seg][segment].type)
1650      switch (state->mmu_regs[the_seg][segment].type)
17281651      {
17291652
17301653      case RAM_stack_rw:
1731         if (address <= mmu_regs[the_seg][segment].slim)
1654         if (address <= state->mmu_regs[the_seg][segment].slim)
17321655         {
17331656            /* out of segment limits : bus error */
17341657
17351658         }
1736         COMBINE_DATA((UINT16 *) (lisa_ram_ptr + address));
1737         if (diag2)
1659         COMBINE_DATA((UINT16 *) (state->ram_ptr + address));
1660         if (state->diag2)
17381661         {
17391662            if ((ACCESSING_BITS_0_7)
1740               && ! (bad_parity_table[address >> 3] & (0x1 << (address & 0x7))))
1663               && ! (state->bad_parity_table[address >> 3] & (0x1 << (address & 0x7))))
17411664            {
1742               bad_parity_table[address >> 3] |= 0x1 << (address & 0x7);
1743               bad_parity_count++;
1665               state->bad_parity_table[address >> 3] |= 0x1 << (address & 0x7);
1666               state->bad_parity_count++;
17441667            }
17451668            if ((ACCESSING_BITS_8_15)
1746               && ! (bad_parity_table[address >> 3] & (0x2 << (address & 0x7))))
1669               && ! (state->bad_parity_table[address >> 3] & (0x2 << (address & 0x7))))
17471670            {
1748               bad_parity_table[address >> 3] |= 0x2 << (address & 0x7);
1749               bad_parity_count++;
1671               state->bad_parity_table[address >> 3] |= 0x2 << (address & 0x7);
1672               state->bad_parity_count++;
17501673            }
17511674         }
1752         else if (bad_parity_table[address >> 3] & (0x3 << (address & 0x7)))
1675         else if (state->bad_parity_table[address >> 3] & (0x3 << (address & 0x7)))
17531676         {
17541677            if ((ACCESSING_BITS_0_7)
1755               && (bad_parity_table[address >> 3] & (0x1 << (address & 0x7))))
1678               && (state->bad_parity_table[address >> 3] & (0x1 << (address & 0x7))))
17561679            {
1757               bad_parity_table[address >> 3] &= ~ (0x1 << (address & 0x7));
1758               bad_parity_count--;
1680               state->bad_parity_table[address >> 3] &= ~ (0x1 << (address & 0x7));
1681               state->bad_parity_count--;
17591682            }
17601683            if ((ACCESSING_BITS_8_15)
1761               && (bad_parity_table[address >> 3] & (0x2 << (address & 0x7))))
1684               && (state->bad_parity_table[address >> 3] & (0x2 << (address & 0x7))))
17621685            {
1763               bad_parity_table[address >> 3] &= ~ (0x2 << (address & 0x7));
1764               bad_parity_count--;
1686               state->bad_parity_table[address >> 3] &= ~ (0x2 << (address & 0x7));
1687               state->bad_parity_count--;
17651688            }
17661689         }
17671690         break;
17681691
17691692      case RAM_rw:
1770         if (address > mmu_regs[the_seg][segment].slim)
1693         if (address > state->mmu_regs[the_seg][segment].slim)
17711694         {
17721695            /* out of segment limits : bus error */
17731696
17741697         }
1775         COMBINE_DATA((UINT16 *) (lisa_ram_ptr + address));
1776         if (diag2)
1698         COMBINE_DATA((UINT16 *) (state->ram_ptr + address));
1699         if (state->diag2)
17771700         {
17781701            if ((ACCESSING_BITS_0_7)
1779               && ! (bad_parity_table[address >> 3] & (0x1 << (address & 0x7))))
1702               && ! (state->bad_parity_table[address >> 3] & (0x1 << (address & 0x7))))
17801703            {
1781               bad_parity_table[address >> 3] |= 0x1 << (address & 0x7);
1782               bad_parity_count++;
1704               state->bad_parity_table[address >> 3] |= 0x1 << (address & 0x7);
1705               state->bad_parity_count++;
17831706            }
17841707            if ((ACCESSING_BITS_8_15)
1785               && ! (bad_parity_table[address >> 3] & (0x2 << (address & 0x7))))
1708               && ! (state->bad_parity_table[address >> 3] & (0x2 << (address & 0x7))))
17861709            {
1787               bad_parity_table[address >> 3] |= 0x2 << (address & 0x7);
1788               bad_parity_count++;
1710               state->bad_parity_table[address >> 3] |= 0x2 << (address & 0x7);
1711               state->bad_parity_count++;
17891712            }
17901713         }
1791         else if (bad_parity_table[address >> 3] & (0x3 << (address & 0x7)))
1714         else if (state->bad_parity_table[address >> 3] & (0x3 << (address & 0x7)))
17921715         {
17931716            if ((ACCESSING_BITS_0_7)
1794               && (bad_parity_table[address >> 3] & (0x1 << (address & 0x7))))
1717               && (state->bad_parity_table[address >> 3] & (0x1 << (address & 0x7))))
17951718            {
1796               bad_parity_table[address >> 3] &= ~ (0x1 << (address & 0x7));
1797               bad_parity_count--;
1719               state->bad_parity_table[address >> 3] &= ~ (0x1 << (address & 0x7));
1720               state->bad_parity_count--;
17981721            }
17991722            if ((ACCESSING_BITS_8_15)
1800               && (bad_parity_table[address >> 3] & (0x2 << (address & 0x7))))
1723               && (state->bad_parity_table[address >> 3] & (0x2 << (address & 0x7))))
18011724            {
1802               bad_parity_table[address >> 3] &= ~ (0x2 << (address & 0x7));
1803               bad_parity_count--;
1725               state->bad_parity_table[address >> 3] &= ~ (0x2 << (address & 0x7));
1726               state->bad_parity_count--;
18041727            }
18051728         }
18061729         break;
r9699r9700
18471770
18481771INLINE void cpu_board_control_access(running_machine *machine, offs_t offset)
18491772{
1773   lisa_state *state = machine->driver_data<lisa_state>();
18501774   switch ((offset & 0x03ff) << 1)
18511775   {
18521776   case 0x0002:   /* Set DIAG1 Latch */
18531777   case 0x0000:   /* Reset DIAG1 Latch */
18541778      break;
18551779   case 0x0006:   /* Set Diag2 Latch */
1856      diag2 = 1;
1780      state->diag2 = 1;
18571781      break;
18581782   case 0x0004:   /* ReSet Diag2 Latch */
1859      diag2 = 0;
1783      state->diag2 = 0;
18601784      break;
18611785   case 0x000A:   /* SEG1 Context Selection bit SET */
18621786      /*logerror("seg bit 0 set\n");*/
1863      seg |= 1;
1787      state->seg |= 1;
18641788      break;
18651789   case 0x0008:   /* SEG1 Context Selection bit RESET */
18661790      /*logerror("seg bit 0 clear\n");*/
1867      seg &= ~1;
1791      state->seg &= ~1;
18681792      break;
18691793   case 0x000E:   /* SEG2 Context Selection bit SET */
18701794      /*logerror("seg bit 1 set\n");*/
1871      seg |= 2;
1795      state->seg |= 2;
18721796      break;
18731797   case 0x000C:   /* SEG2 Context Selection bit RESET */
18741798      /*logerror("seg bit 1 clear\n");*/
1875      seg &= ~2;
1799      state->seg &= ~2;
18761800      break;
18771801   case 0x0010:   /* SETUP register SET */
18781802       logerror("setup SET PC=%x\n", cpu_get_pc(machine->device("maincpu")));
1879      setup = 1;
1803      state->setup = 1;
18801804      break;
18811805   case 0x0012:   /* SETUP register RESET */
18821806       logerror("setup UNSET PC=%x\n", cpu_get_pc(machine->device("maincpu")));
1883      setup = 0;
1807      state->setup = 0;
18841808      break;
18851809   case 0x001A:   /* Enable Vertical Retrace Interrupt */
18861810       logerror("enable retrace PC=%x\n", cpu_get_pc(machine->device("maincpu")));
1887      VTMSK = 1;
1811      state->VTMSK = 1;
18881812      break;
18891813   case 0x0018:   /* Disable Vertical Retrace Interrupt */
18901814       logerror("disable retrace PC=%x\n", cpu_get_pc(machine->device("maincpu")));
1891      VTMSK = 0;
1815      state->VTMSK = 0;
18921816      set_VTIR(machine, 2);
18931817      break;
18941818   case 0x0016:   /* Enable Soft Error Detect. */
18951819   case 0x0014:   /* Disable Soft Error Detect. */
18961820      break;
18971821   case 0x001E:   /* Enable Hard Error Detect */
1898      test_parity = 1;
1822      state->test_parity = 1;
18991823      break;
19001824   case 0x001C:   /* Disable Hard Error Detect */
1901      test_parity = 0;
1825      state->test_parity = 0;
19021826      set_parity_error_pending(machine, 0);
19031827      break;
19041828   }
r9699r9700
19061830
19071831static READ16_HANDLER ( lisa_IO_r )
19081832{
1833   lisa_state *state = space->machine->driver_data<lisa_state>();
19091834   via6522_device *via_0 = space->machine->device<via6522_device>("via6522_0");
19101835   via6522_device *via_1 = space->machine->device<via6522_device>("via6522_1");
19111836   int answer=0;
r9699r9700
19421867         if (! (offset & 0x400))
19431868         {
19441869            /*if (ACCESSING_BITS_0_7)*/   /* Geez, who cares ? */
1945               answer = lisa_fdc_ram[offset & 0x03ff] & 0xff;   /* right ??? */
1870               answer = state->fdc_ram[offset & 0x03ff] & 0xff;   /* right ??? */
19461871         }
19471872      }
19481873      else
r9699r9700
19801905         break;
19811906
19821907      case 0x1:   /* Video Address Latch */
1983         answer = video_address_latch;
1908         answer = state->video_address_latch;
19841909         break;
19851910
19861911      case 0x2:   /* Memory Error Address Latch */
1987         answer = mem_err_addr_latch;
1912         answer = state->mem_err_addr_latch;
19881913         break;
19891914
19901915      case 0x3:   /* Status Register */
19911916         answer = 0;
1992         if (! parity_error_pending)
1917         if (! state->parity_error_pending)
19931918            answer |= 0x02;
1994         if (VTIR<=1)
1919         if (state->VTIR<=1)
19951920// GFE : needs to be in phase with Serial NUM
19961921         {
19971922            int time_in_frame = space->machine->primary_screen->vpos();
1998            if (lisa_features.has_mac_xl_video)
1923            if (state->features.has_mac_xl_video)
19991924            {
20001925               if ((time_in_frame >= 374) && (time_in_frame <= 392))   /* these values have not been tested */
20011926               {   /* if VSyncing, read ROM 2nd half ? */
20021927               }
20031928               else
20041929               {
2005                  VTIR=0;
1930                  state->VTIR=0;
20061931                  answer |= 0x04;
20071932               }
20081933            }
r9699r9700
20141939               }
20151940               else
20161941               {
2017                  VTIR=0;
1942                  state->VTIR=0;
20181943                  answer |= 0x04;
20191944               }
20201945            }
r9699r9700
20351960
20361961static WRITE16_HANDLER ( lisa_IO_w )
20371962{
1963   lisa_state *state = space->machine->driver_data<lisa_state>();
20381964   via6522_device *via_0 = space->machine->device<via6522_device>("via6522_0");
20391965   via6522_device *via_1 = space->machine->device<via6522_device>("via6522_1");
20401966
r9699r9700
20711997         if (! (offset & 0x0400))
20721998         {
20731999            if (ACCESSING_BITS_0_7)
2074               lisa_fdc_ram[offset & 0x03ff] = data & 0xff;
2000               state->fdc_ram[offset & 0x03ff] = data & 0xff;
20752001         }
20762002      }
20772003      else
r9699r9700
21052031
21062032      case 0x1:   /* Video Address Latch */
21072033         /*logerror("video address latch write offs=%X, data=%X\n", offset, data);*/
2108         COMBINE_DATA(& video_address_latch);
2109         videoram_ptr = ((UINT16 *)lisa_ram_ptr) + ((video_address_latch << 6) & 0xfc000);
2110         /*logerror("video address latch %X -> base address %X\n", video_address_latch,
2111                            (video_address_latch << 7) & 0x1f8000);*/
2034         COMBINE_DATA(& state->video_address_latch);
2035         state->videoram_ptr = ((UINT16 *)state->ram_ptr) + ((state->video_address_latch << 6) & 0xfc000);
2036         /*logerror("video address latch %X -> base address %X\n", state->video_address_latch,
2037                            (state->video_address_latch << 7) & 0x1f8000);*/
21122038         break;
21132039      }
21142040      break;
src/mess/machine/partner.c
r9699r9700
2323/* Driver initialization */
2424DRIVER_INIT( partner )
2525{
26   radio86_tape_value = 0x80;
26   partner_state *state = machine->driver_data<partner_state>();
27   state->tape_value = 0x80;
2728}
2829
2930static WRITE_LINE_DEVICE_HANDLER( partner_wd17xx_drq_w )
src/mess/video/z88.c
r9699r9700
155155***************************************************************************/
156156VIDEO_UPDATE( z88 )
157157{
158   //z88_state *state = screen->machine->driver_data<z88_state>();
158   z88_state *state = screen->machine->driver_data<z88_state>();
159159   int x,y;
160   unsigned char *ptr = z88_convert_address(screen->machine, z88_blink.sbf);
160   unsigned char *ptr = z88_convert_address(screen->machine, state->blink.sbf);
161161   unsigned char *stored_ptr = ptr;
162162   int pen0, pen1;
163163
r9699r9700
222222               if (ch & 0x0100)
223223               {
224224                  ch_index =ch & 0x0ff;   //(~0x0100);
225                  pCharGfx = z88_convert_address(screen->machine, z88_blink.hires1);
225                  pCharGfx = z88_convert_address(screen->machine, state->blink.hires1);
226226               }
227227               else
228228               {
229229                  ch_index = ch & 0x0ff;
230                  pCharGfx = z88_convert_address(screen->machine, z88_blink.hires0);
230                  pCharGfx = z88_convert_address(screen->machine, state->blink.hires0);
231231               }
232232
233233               pCharGfx += (ch_index<<3);
r9699r9700
245245            {
246246               ch_index = ch & (~0x01c0);
247247
248               pCharGfx = z88_convert_address(screen->machine, z88_blink.lores0);
248               pCharGfx = z88_convert_address(screen->machine, state->blink.lores0);
249249            }
250250            else
251251            {
252252               ch_index = ch;
253253
254               pCharGfx = z88_convert_address(screen->machine, z88_blink.lores1);
254               pCharGfx = z88_convert_address(screen->machine, state->blink.lores1);
255255            }
256256
257257            pCharGfx += (ch_index<<3);
src/mess/video/radio86.c
r9699r9700
3131   }
3232}
3333
34UINT8 mikrosha_font_page;
3534
3635I8275_DISPLAY_PIXELS(mikrosha_display_pixels)
3736{
37   radio86_state *state = device->machine->driver_data<radio86_state>();
3838   int i;
3939   bitmap_t *bitmap = device->machine->generic.tmpbitmap;
40   UINT8 *charmap = memory_region(device->machine, "gfx1") + (mikrosha_font_page & 1) * 0x400;
40   UINT8 *charmap = memory_region(device->machine, "gfx1") + (state->mikrosha_font_page & 1) * 0x400;
4141   UINT8 pixels = charmap[(linecount & 7) + (charcode << 3)] ^ 0xff;
4242   if (vsp) {
4343      pixels = 0;
src/mess/includes/z88.h
r9699r9700
3838
3939#define Z88_SNOOZE_TRIGGER 2
4040
41struct blink_hw
41typedef struct
4242{
4343   int z88_state;
4444   int pb[4];
r9699r9700
7373   /* tim3 = 256 minute counter */
7474   /* tim4 = 64k minute counter */
7575   int tim[5];
76};
76} blink_hw_t;
7777
7878
7979class z88_state : public driver_device
r9699r9700
8484
8585   int frame_number;
8686   int flash_invert;
87   blink_hw_t blink;
8788};
8889
8990
90/*----------- defined in drivers/z88.c -----------*/
91
92extern struct blink_hw z88_blink;
93
9491/*----------- defined in video/z88.c -----------*/
9592
9693extern PALETTE_INIT( z88 );
src/mess/includes/radio86.h
r9699r9700
1111#include "machine/i8257.h"
1212#include "video/i8275.h"
1313
14class radio86_state : public driver_device
15{
16public:
17   radio86_state(running_machine &machine, const driver_device_config_base &config)
18      : driver_device(machine, config) { }
19
20   UINT8 tape_value;
21   UINT8 mikrosha_font_page;
22   int keyboard_mask;
23   UINT8* radio_ram_disk;
24   UINT8 romdisk_lsb;
25   UINT8 romdisk_msb;
26   UINT8 disk_sel;
27};
28
29
1430/*----------- defined in drivers/radio86.c -----------*/
1531
1632INPUT_PORTS_EXTERN( radio86 );
r9699r9700
4359extern WRITE8_HANDLER ( radio86_pagesel );
4460extern const i8257_interface radio86_dma;
4561
46extern UINT8 radio86_tape_value;
4762
48extern void radio86_init_keyboard(void);
63extern void radio86_init_keyboard(running_machine *machine);
4964
5065
5166/*----------- defined in video/radio86.c -----------*/
5267
53extern UINT8 mikrosha_font_page;
54
5568extern I8275_DISPLAY_PIXELS(radio86_display_pixels);
5669extern I8275_DISPLAY_PIXELS(partner_display_pixels);
5770extern I8275_DISPLAY_PIXELS(mikrosha_display_pixels);
src/mess/includes/lisa.h
r9699r9700
1111
1212#include "machine/6522via.h"
1313
14/* lisa MMU segment regs */
15typedef struct real_mmu_entry
16{
17   UINT16 sorg;
18   UINT16 slim;
19} real_mmu_entry;
20
21/* MMU regs translated into a more efficient format */
22enum mmu_entry_t { RAM_stack_r, RAM_r, RAM_stack_rw, RAM_rw, IO, invalid, special_IO };
23
24typedef struct mmu_entry
25{
26   offs_t sorg;   /* (real_sorg & 0x0fff) << 9 */
27   mmu_entry_t type;   /* <-> (real_slim & 0x0f00) */
28   int slim;   /* (~ ((real_slim & 0x00ff) << 9)) & 0x01ffff */
29} mmu_entry;
30
31enum floppy_hardware_t
32{
33   twiggy,         /* twiggy drives (Lisa 1) */
34   sony_lisa2,      /* 3.5'' drive with LisaLite adapter (Lisa 2) */
35   sony_lisa210   /* 3.5'' drive with modified fdc hardware (Lisa 2/10, Mac XL) */
36};
37
38enum clock_mode_t
39{
40   clock_timer_disable = 0,
41   timer_disable = 1,
42   timer_interrupt = 2,   /* timer underflow generates interrupt */
43   timer_power_on = 3      /* timer underflow turns system on if it is off and gens interrupt */
44};         /* clock mode */
45
46/* clock registers */
47typedef struct _clock_regs_t
48{
49   long alarm;      /* alarm (20-bit binary) */
50   int years;      /* years (4-bit binary ) */
51   int days1;      /* days (BCD : 1-366) */
52   int days2;
53   int days3;
54   int hours1;      /* hours (BCD : 0-23) */
55   int hours2;
56   int minutes1;   /* minutes (BCD : 0-59) */
57   int minutes2;
58   int seconds1;   /* seconds (BCD : 0-59) */
59   int seconds2;
60   int tenths;      /* tenths of second (BCD : 0-9) */
61
62   int clock_write_ptr;   /* clock byte to be written next (-1 if clock write disabled) */
63
64   enum clock_mode_t clock_mode;
65} clock_regs_t;
66
67typedef struct _lisa_features_t
68{
69   unsigned int has_fast_timers : 1;   /* I/O board VIAs are clocked at 1.25 MHz (?) instead of .5 MHz (?) (Lisa 2/10, Mac XL) */
70                              /* Note that the beep routine in boot ROMs implies that
71                                        VIA clock is 1.25 times faster with fast timers than with
72                                        slow timers.  I read the schematics again and again, and
73                                        I simply don't understand : in one case the VIA is
74                                        connected to the 68k E clock, which is CPUCK/10, and in
75                                        another case, to a generated PH2 clock which is CPUCK/4,
76                                        with additionnal logic to keep it in phase with the 68k
77                                        memory cycle.  After hearing the beep when MacWorks XL
78                                        boots, I bet the correct values are .625 MHz and .5 MHz.
79                                        Maybe the schematics are wrong, and PH2 is CPUCK/8.
80                                        Maybe the board uses a 6522 variant with different
81                                        timings. */
82   floppy_hardware_t floppy_hardware;
83   unsigned int has_double_sided_floppy : 1;   /* true on lisa 1 and *hacked* lisa 2/10 / Mac XL */
84   unsigned int has_mac_xl_video : 1;   /* modified video for MacXL */
85} lisa_features_t;
86
87
88class lisa_state : public driver_device
89{
90public:
91   lisa_state(running_machine &machine, const driver_device_config_base &config)
92      : driver_device(machine, config) { }
93
94   UINT8 *fdc_rom;
95   UINT8 *fdc_ram;
96   UINT8 *ram_ptr;
97   UINT8 *rom_ptr;
98   UINT8 *videoROM_ptr;
99   int setup;
100   int seg;
101   real_mmu_entry real_mmu_regs[4][128];
102   mmu_entry mmu_regs[4][128];
103   int diag2;
104   int test_parity;
105   UINT16 mem_err_addr_latch;
106   int parity_error_pending;
107   int bad_parity_count;
108   UINT8 *bad_parity_table;
109   int VTMSK;
110   int VTIR;
111   UINT16 video_address_latch;
112   UINT16 *videoram_ptr;
113   int KBIR;
114   int FDIR;
115   int DISK_DIAG;
116   int MT1;
117   int PWM_floppy_motor_speed;
118   int model;
119   lisa_features_t features;
120   int COPS_Ready;
121   int COPS_command;
122   int fifo_data[8];
123   int fifo_size;
124   int fifo_head;
125   int fifo_tail;
126   int mouse_data_offset;
127   int COPS_force_unplug;
128   emu_timer *mouse_timer;
129   int hold_COPS_data;
130   int NMIcode;
131   clock_regs_t clock_regs;
132   int key_matrix[8];
133   int last_mx;
134   int last_my;
135   int frame_count;
136   int videoROM_address;
137};
138
139
14140/*----------- defined in machine/lisa.c -----------*/
15141
16extern UINT8 *lisa_fdc_rom;
17extern UINT8 *lisa_fdc_ram;
18
19142extern const via6522_interface lisa_via6522_0_intf;
20143extern const via6522_interface lisa_via6522_1_intf;
21144
src/mess/includes/partner.h
r9699r9700
1111#include "machine/i8257.h"
1212#include "machine/wd17xx.h"
1313
14class partner_state : public driver_device
14class partner_state : public radio86_state
1515{
1616public:
1717   partner_state(running_machine &machine, const driver_device_config_base &config)
18      : driver_device(machine, config) { }
18      : radio86_state(machine, config) { }
1919
2020   UINT8 mem_page;
2121   UINT8 win_mem_page;
src/mess/includes/orion.h
r9699r9700
77#ifndef ORION_H_
88#define ORION_H_
99
10#include "includes/radio86.h"
1011#include "machine/i8255a.h"
1112
12class orion_state : public driver_device
13class orion_state : public radio86_state
1314{
1415public:
1516   orion_state(running_machine &machine, const driver_device_config_base &config)
16      : driver_device(machine, config) { }
17      : radio86_state(machine, config) { }
1718
1819   UINT8 orion128_video_mode;
1920   UINT8 orion128_video_page;
src/mess/drivers/radio86.c
r9699r9700
346346
347347
348348/* Machine driver */
349static MACHINE_CONFIG_START( radio86, driver_device )
349static MACHINE_CONFIG_START( radio86, radio86_state )
350350   /* basic machine hardware */
351351   MDRV_CPU_ADD("maincpu",I8080, XTAL_16MHz / 9)
352352   MDRV_CPU_PROGRAM_MAP(radio86_mem)
src/mess/drivers/mikrosha.c
r9699r9700
1919#include "includes/radio86.h"
2020
2121
22class mikrosha_state : public driver_device
22class mikrosha_state : public radio86_state
2323{
2424public:
2525   mikrosha_state(running_machine &machine, const driver_device_config_base &config)
26      : driver_device(machine, config) { }
26      : radio86_state(machine, config) { }
2727
2828};
2929
src/mess/drivers/orion.c
r9699r9700
2323#include "formats/rk_cas.h"
2424#include "includes/orion.h"
2525#include "devices/messram.h"
26#include "includes/radio86.h"
2726
2827/* Address maps */
2928
src/mess/drivers/z88.c
r9699r9700
2020#include "devices/messram.h"
2121#include "devices/messram.h"
2222
23struct blink_hw z88_blink;
2423
25static void blink_reset(void)
24static void blink_reset(running_machine *machine)
2625{
27   memset(&z88_blink, 0, sizeof(struct blink_hw));
26   z88_state *state = machine->driver_data<z88_state>();
27   memset(&state->blink, 0, sizeof(state->blink));
2828
2929   /* rams is cleared on reset */
30   z88_blink.com &=~(1<<2);
31   z88_blink.sbf = 0;
32   z88_blink.z88_state = Z88_AWAKE;
30   state->blink.com &=~(1<<2);
31   state->blink.sbf = 0;
32   state->blink.z88_state = Z88_AWAKE;
3333
3434}
3535
3636
3737static void z88_interrupt_refresh(running_machine *machine)
3838{
39   z88_state *state = machine->driver_data<z88_state>();
3940   /* ints enabled? */
40   if ((z88_blink.ints & INT_GINT)!=0)
41   if ((state->blink.ints & INT_GINT)!=0)
4142   {
4243      /* yes */
4344
4445      /* other ints - except timer */
4546      if (
46         (((z88_blink.ints & z88_blink.sta) & 0x0fc)!=0) ||
47         (((z88_blink.ints>>1) & z88_blink.sta & STA_TIME)!=0)
47         (((state->blink.ints & state->blink.sta) & 0x0fc)!=0) ||
48         (((state->blink.ints>>1) & state->blink.sta & STA_TIME)!=0)
4849         )
4950      {
5051         logerror("set int\n");
r9699r9700
5758   cputag_set_input_line(machine, "maincpu", 0, CLEAR_LINE);
5859}
5960
60static void z88_update_rtc_interrupt(void)
61static void z88_update_rtc_interrupt(running_machine *machine)
6162{
62   z88_blink.sta &=~STA_TIME;
63   z88_state *state = machine->driver_data<z88_state>();
64   state->blink.sta &=~STA_TIME;
6365
6466   /* time interrupt enabled? */
65   if (z88_blink.ints & INT_TIME)
67   if (state->blink.ints & INT_TIME)
6668   {
6769      /* yes */
6870
6971      /* any ints occured? */
70      if ((z88_blink.tsta & 0x07)!=0)
72      if ((state->blink.tsta & 0x07)!=0)
7173      {
7274         /* yes, set time int */
73         z88_blink.sta |= STA_TIME;
75         state->blink.sta |= STA_TIME;
7476      }
7577   }
7678}
r9699r9700
7981
8082static TIMER_CALLBACK(z88_rtc_timer_callback)
8183{
84   z88_state *state = machine->driver_data<z88_state>();
8285   int refresh_ints = 0;
8386   static const char *const keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6", "LINE7" };
8487
8588   /* is z88 in snooze state? */
86   if (z88_blink.z88_state == Z88_SNOOZE)
89   if (state->blink.z88_state == Z88_SNOOZE)
8790   {
8891      int i;
8992      unsigned char data = 0x0ff;
r9699r9700
100103         logerror("Z88 wake up from snooze!\n");
101104
102105         /* wake up z88 */
103         z88_blink.z88_state = Z88_AWAKE;
106         state->blink.z88_state = Z88_AWAKE;
104107         /* column has gone low in snooze/coma */
105         z88_blink.sta |= STA_KEY;
108         state->blink.sta |= STA_KEY;
106109
107110         cpuexec_trigger(machine, Z88_SNOOZE_TRIGGER);
108111
r9699r9700
113116
114117
115118   /* hold clock at reset? - in this mode it doesn't update */
116   if ((z88_blink.com & (1<<4))==0)
119   if ((state->blink.com & (1<<4))==0)
117120   {
118121      /* update 5 millisecond counter */
119      z88_blink.tim[0]++;
122      state->blink.tim[0]++;
120123
121124      /* tick */
122      if ((z88_blink.tim[0]%10)==0)
125      if ((state->blink.tim[0]%10)==0)
123126      {
124127         /* set tick int has occured */
125         z88_blink.tsta |= RTC_TICK_INT;
128         state->blink.tsta |= RTC_TICK_INT;
126129         refresh_ints = 1;
127130      }
128131
129      if (z88_blink.tim[0]==200)
132      if (state->blink.tim[0]==200)
130133      {
131         z88_blink.tim[0] = 0;
134         state->blink.tim[0] = 0;
132135
133136         /* set seconds int has occured */
134         z88_blink.tsta |= RTC_SEC_INT;
137         state->blink.tsta |= RTC_SEC_INT;
135138         refresh_ints = 1;
136139
137         z88_blink.tim[1]++;
140         state->blink.tim[1]++;
138141
139         if (z88_blink.tim[1]==60)
142         if (state->blink.tim[1]==60)
140143         {
141144            /* set minutes int has occured */
142            z88_blink.tsta |=RTC_MIN_INT;
145            state->blink.tsta |=RTC_MIN_INT;
143146            refresh_ints = 1;
144147
145            z88_blink.tim[1]=0;
148            state->blink.tim[1]=0;
146149
147            z88_blink.tim[2]++;
150            state->blink.tim[2]++;
148151
149            if (z88_blink.tim[2]==256)
152            if (state->blink.tim[2]==256)
150153            {
151               z88_blink.tim[2] = 0;
154               state->blink.tim[2] = 0;
152155
153               z88_blink.tim[3]++;
156               state->blink.tim[3]++;
154157
155               if (z88_blink.tim[3]==256)
158               if (state->blink.tim[3]==256)
156159               {
157                  z88_blink.tim[3] = 0;
160                  state->blink.tim[3] = 0;
158161
159                  z88_blink.tim[4]++;
162                  state->blink.tim[4]++;
160163
161                  if (z88_blink.tim[4]==32)
164                  if (state->blink.tim[4]==32)
162165                  {
163                     z88_blink.tim[4] = 0;
166                     state->blink.tim[4] = 0;
164167                  }
165168               }
166169            }
r9699r9700
170173
171174   if (refresh_ints)
172175   {
173      z88_update_rtc_interrupt();
176      z88_update_rtc_interrupt(machine);
174177
175178      /* refresh */
176179      z88_interrupt_refresh(machine);
r9699r9700
229232
230233static void z88_refresh_memory_bank(running_machine *machine, int bank)
231234{
235   z88_state *state = machine->driver_data<z88_state>();
232236   void *read_addr;
233237   void *write_addr;
234238   unsigned long block;
r9699r9700
237241   assert(bank <= 3);
238242
239243   /* ram? */
240   if (z88_blink.mem[bank]>=0x020)
244   if (state->blink.mem[bank]>=0x020)
241245   {
242      block = z88_blink.mem[bank]-0x020;
246      block = state->blink.mem[bank]-0x020;
243247
244248      if (block >= 128)
245249      {
r9699r9700
253257   }
254258   else
255259   {
256      block = z88_blink.mem[bank] & 0x07;
260      block = state->blink.mem[bank] & 0x07;
257261
258262      /* in rom area, but rom not present */
259263      if (block>=8)
r9699r9700
276280      /* override setting for lower 8k of bank 0 */
277281
278282      /* enable rom? */
279      if ((z88_blink.com & (1<<2))==0)
283      if ((state->blink.com & (1<<2))==0)
280284      {
281285         /* yes */
282286         read_addr = memory_region(machine, "maincpu") + 0x010000;
r9699r9700
302306{
303307   memset(messram_get_ptr(machine->device("messram")), 0x0ff, messram_get_size(machine->device("messram")));
304308
305   blink_reset();
309   blink_reset(machine);
306310
307311   z88_refresh_memory_bank(machine, 0);
308312   z88_refresh_memory_bank(machine, 1);
r9699r9700
318322   AM_RANGE(0xc000, 0xffff) AM_READ_BANK("bank5") AM_WRITE_BANK("bank10")
319323ADDRESS_MAP_END
320324
321static void blink_pb_w(int offset, int data, int reg_index)
325static void blink_pb_w(running_machine *machine, int offset, int data, int reg_index)
322326{
327   z88_state *state = machine->driver_data<z88_state>();
323328    unsigned short addr_written = (offset & 0x0ff00) | (data & 0x0ff);
324329
325330   logerror("reg_index: %02x addr: %04x\n",reg_index,addr_written);
r9699r9700
331336
332337   case 0x00:
333338      {
334/**/            z88_blink.pb[0] = addr_written;
335            z88_blink.lores0 = ((addr_written & 0x01f)<<9) | ((addr_written & 0x01fe0)<<9);   // blink_pb_offset(-1, addr_written, 9);
336            logerror("lores0 %08x\n",z88_blink.lores0);
339/**/            state->blink.pb[0] = addr_written;
340            state->blink.lores0 = ((addr_written & 0x01f)<<9) | ((addr_written & 0x01fe0)<<9);   // blink_pb_offset(-1, addr_written, 9);
341            logerror("lores0 %08x\n",state->blink.lores0);
337342      }
338343      break;
339344
340345      case 0x01:
341346      {
342            z88_blink.pb[1] = addr_written;
343            z88_blink.lores1 = ((addr_written & 0x01f)<<12) | ((addr_written & 0x01fe0)<<12);   //blink_pb_offset(-1, addr_written, 12);
344            logerror("lores1 %08x\n",z88_blink.lores1);
347            state->blink.pb[1] = addr_written;
348            state->blink.lores1 = ((addr_written & 0x01f)<<12) | ((addr_written & 0x01fe0)<<12);   //blink_pb_offset(-1, addr_written, 12);
349            logerror("lores1 %08x\n",state->blink.lores1);
345350      }
346351      break;
347352
348353      case 0x02:
349354      {
350            z88_blink.pb[2] = addr_written;
351/**/            z88_blink.hires0 = ((addr_written & 0x01f)<<13) | ((addr_written & 0x01fe0)<<13);   //blink_pb_offset(-1, addr_written, 13);
352            logerror("hires0 %08x\n", z88_blink.hires0);
355            state->blink.pb[2] = addr_written;
356/**/            state->blink.hires0 = ((addr_written & 0x01f)<<13) | ((addr_written & 0x01fe0)<<13);   //blink_pb_offset(-1, addr_written, 13);
357            logerror("hires0 %08x\n", state->blink.hires0);
353358      }
354359      break;
355360
356361
357362      case 0x03:
358363      {
359            z88_blink.pb[3] = addr_written;
360            z88_blink.hires1 = ((addr_written & 0x01f)<<11) | ((addr_written & 0x01fe0)<<11);   //blink_pb_offset(-1, addr_written, 11);
364            state->blink.pb[3] = addr_written;
365            state->blink.hires1 = ((addr_written & 0x01f)<<11) | ((addr_written & 0x01fe0)<<11);   //blink_pb_offset(-1, addr_written, 11);
361366
362            logerror("hires1 %08x\n", z88_blink.hires1);
367            logerror("hires1 %08x\n", state->blink.hires1);
363368      }
364369      break;
365370
366371      case 0x04:
367372      {
368            z88_blink.sbr = addr_written;
373            state->blink.sbr = addr_written;
369374
370         z88_blink.sbf = ((addr_written & 0x01f)<<11) | ((addr_written & 0x01fe0)<<11);
371            logerror("%08x\n", z88_blink.sbf);
375         state->blink.sbf = ((addr_written & 0x01f)<<11) | ((addr_written & 0x01fe0)<<11);
376            logerror("%08x\n", state->blink.sbf);
372377
373378      }
374379      break;
r9699r9700
382387/* segment register write */
383388static WRITE8_HANDLER(blink_srx_w)
384389{
385   z88_blink.mem[offset] = data;
390   z88_state *state = space->machine->driver_data<z88_state>();
391   state->blink.mem[offset] = data;
386392
387393   z88_refresh_memory_bank(space->machine, offset);
388394}
r9699r9700
400406
401407static WRITE8_HANDLER(z88_port_w)
402408{
409   z88_state *state = space->machine->driver_data<z88_state>();
403410   running_device *speaker = space->machine->device("speaker");
404411   unsigned char port;
405412
r9699r9700
412419      case 0x072:
413420      case 0x073:
414421      case 0x074:
415         blink_pb_w(offset, data, port & 0x0f);
422         blink_pb_w(space->machine, offset, data, port & 0x0f);
416423         return;
417424
418425
r9699r9700
422429          logerror("tack w: %02x\n", data);
423430
424431         /* set acknowledge */
425         z88_blink.tack = data & 0x07;
432         state->blink.tack = data & 0x07;
426433         /* clear ints that have occured */
427         z88_blink.tsta &= ~z88_blink.tack;
434         state->blink.tsta &= ~state->blink.tack;
428435
429436         /* refresh ints */
430         z88_update_rtc_interrupt();
437         z88_update_rtc_interrupt(space->machine);
431438         z88_interrupt_refresh(space->machine);
432439      }
433440      return;
r9699r9700
438445          logerror("tmk w: %02x\n", data);
439446
440447         /* set new int mask */
441         z88_blink.tmk = data & 0x07;
448         state->blink.tmk = data & 0x07;
442449
443450         /* refresh ints */
444         z88_update_rtc_interrupt();
451         z88_update_rtc_interrupt(space->machine);
445452         z88_interrupt_refresh(space->machine);
446453      }
447454      return;
r9699r9700
452459
453460          logerror("com w: %02x\n", data);
454461
455         changed_bits = z88_blink.com^data;
456         z88_blink.com = data;
462         changed_bits = state->blink.com^data;
463         state->blink.com = data;
457464
458465         /* reset clock? */
459466         if ((data & (1<<4))!=0)
460467         {
461            z88_blink.tim[0] = (z88_blink.tim[1] = (z88_blink.tim[2] = (z88_blink.tim[3] = (z88_blink.tim[4] = 0))));
468            state->blink.tim[0] = (state->blink.tim[1] = (state->blink.tim[2] = (state->blink.tim[3] = (state->blink.tim[4] = 0))));
462469         }
463470
464471         /* SBIT controls speaker direct? */
r9699r9700
492499         /* set int enables */
493500          logerror("int w: %02x\n", data);
494501
495         z88_blink.ints = data;
496         z88_update_rtc_interrupt();
502         state->blink.ints = data;
503         z88_update_rtc_interrupt(space->machine);
497504         z88_interrupt_refresh(space->machine);
498505      }
499506      return;
r9699r9700
504511          logerror("ack w: %02x\n", data);
505512
506513         /* acknowledge ints */
507         z88_blink.ack = data & ((1<<6) | (1<<5) | (1<<3) | (1<<2));
514         state->blink.ack = data & ((1<<6) | (1<<5) | (1<<3) | (1<<2));
508515
509         z88_blink.ints &= ~z88_blink.ack;
510         z88_update_rtc_interrupt();
516         state->blink.ints &= ~state->blink.ack;
517         z88_update_rtc_interrupt(space->machine);
511518         z88_interrupt_refresh(space->machine);
512519      }
513520      return;
r9699r9700
529536
530537static  READ8_HANDLER(z88_port_r)
531538{
539   z88_state *state = space->machine->driver_data<z88_state>();
532540   unsigned char port;
533541
534542   port = offset & 0x0ff;
r9699r9700
536544   switch (port)
537545   {
538546      case 0x0b1:
539         z88_blink.sta &=~(1<<1);
540         logerror("sta r: %02x\n",z88_blink.sta);
541         return z88_blink.sta;
547         state->blink.sta &=~(1<<1);
548         logerror("sta r: %02x\n",state->blink.sta);
549         return state->blink.sta;
542550
543551
544552      case 0x0b2:
r9699r9700
550558         lines = offset>>8;
551559
552560         /* if set, reading the keyboard will put z88 into snooze */
553         if ((z88_blink.ints & INT_KWAIT)!=0)
561         if ((state->blink.ints & INT_KWAIT)!=0)
554562         {
555            z88_blink.z88_state = Z88_SNOOZE;
563            state->blink.z88_state = Z88_SNOOZE;
556564            /* spin cycles until rtc timer */
557565            cpu_spinuntil_trigger( space->machine->device("maincpu"), Z88_SNOOZE_TRIGGER);
558566
r9699r9700
591599
592600      /* read real time clock status */
593601      case 0x0b5:
594         z88_blink.tsta &=~0x07;
595         logerror("tsta r: %02x\n",z88_blink.tsta);
596         return z88_blink.tsta;
602         state->blink.tsta &=~0x07;
603         logerror("tsta r: %02x\n",state->blink.tsta);
604         return state->blink.tsta;
597605
598606      /* read real time clock counters */
599607      case 0x0d0:
600          logerror("tim0 r: %02x\n", z88_blink.tim[0]);
601         return z88_blink.tim[0] & 0x0ff;
608          logerror("tim0 r: %02x\n", state->blink.tim[0]);
609         return state->blink.tim[0] & 0x0ff;
602610      case 0x0d1:
603         logerror("tim1 r: %02x\n", z88_blink.tim[1]);
604         return z88_blink.tim[1] & 0x03f;
611         logerror("tim1 r: %02x\n", state->blink.tim[1]);
612         return state->blink.tim[1] & 0x03f;
605613      case 0x0d2:
606         logerror("tim2 r: %02x\n", z88_blink.tim[2]);
607         return z88_blink.tim[2] & 0x0ff;
614         logerror("tim2 r: %02x\n", state->blink.tim[2]);
615         return state->blink.tim[2] & 0x0ff;
608616      case 0x0d3:
609         logerror("tim3 r: %02x\n", z88_blink.tim[3]);
610         return z88_blink.tim[3] & 0x0ff;
617         logerror("tim3 r: %02x\n", state->blink.tim[3]);
618         return state->blink.tim[3] & 0x0ff;
611619      case 0x0d4:
612         logerror("tim4 r: %02x\n", z88_blink.tim[4]);
613         return z88_blink.tim[4] & 0x01f;
620         logerror("tim4 r: %02x\n", state->blink.tim[4]);
621         return state->blink.tim[4] & 0x01f;
614622
615623      default:
616624         break;
src/mess/drivers/lisa.c
r9699r9700
2929
3030static ADDRESS_MAP_START(lisa_fdc_map, ADDRESS_SPACE_PROGRAM, 8)
3131   ADDRESS_MAP_GLOBAL_MASK(0x1fff)   // only 8k of address space
32   AM_RANGE(0x0000, 0x03ff) AM_RAM   AM_BASE(&lisa_fdc_ram)            /* RAM (shared with 68000) */
32   AM_RANGE(0x0000, 0x03ff) AM_RAM   AM_BASE_MEMBER(lisa_state, fdc_ram)            /* RAM (shared with 68000) */
3333   AM_RANGE(0x0400, 0x07ff) AM_READWRITE(lisa_fdc_io_r, lisa_fdc_io_w)   /* disk controller (IWM and TTL logic) */
3434   AM_RANGE(0x0800, 0x0fff) AM_NOP
35   AM_RANGE(0x1000, 0x1fff) AM_ROM   AM_BASE(&lisa_fdc_rom)            /* ROM */
35   AM_RANGE(0x1000, 0x1fff) AM_ROM   AM_BASE_MEMBER(lisa_state, fdc_rom)            /* ROM */
3636   AM_RANGE(0x2000, 0xffff) AM_READWRITE(lisa_fdc_r, lisa_fdc_w)      /* handler for wrap-around */
3737ADDRESS_MAP_END
3838
3939static ADDRESS_MAP_START(lisa210_fdc_map, ADDRESS_SPACE_PROGRAM, 8)
4040   ADDRESS_MAP_GLOBAL_MASK(0x1fff)   // only 8k of address space
41   AM_RANGE(0x0000, 0x03ff) AM_RAM   AM_BASE(&lisa_fdc_ram)            /* RAM (shared with 68000) */
41   AM_RANGE(0x0000, 0x03ff) AM_RAM   AM_BASE_MEMBER(lisa_state, fdc_ram)            /* RAM (shared with 68000) */
4242   AM_RANGE(0x0400, 0x07ff) AM_NOP                              /* nothing, or RAM wrap-around ??? */
4343   AM_RANGE(0x0800, 0x0bff) AM_READWRITE(lisa_fdc_io_r, lisa_fdc_io_w)   /* disk controller (IWM and TTL logic) */
4444   AM_RANGE(0x0c00, 0x0fff) AM_NOP                              /* nothing, or IO port wrap-around ??? */
45   AM_RANGE(0x1000, 0x1fff) AM_ROM   AM_BASE(&lisa_fdc_rom)            /* ROM */
45   AM_RANGE(0x1000, 0x1fff) AM_ROM   AM_BASE_MEMBER(lisa_state, fdc_rom)            /* ROM */
4646   AM_RANGE(0x2000, 0xffff) AM_READWRITE(lisa_fdc_r, lisa_fdc_w)      /* handler for wrap-around */
4747ADDRESS_MAP_END
4848
r9699r9700
114114***************************************************************************/
115115
116116/* Lisa1 and Lisa 2 machine */
117static MACHINE_CONFIG_START( lisa, driver_device )
117static MACHINE_CONFIG_START( lisa, lisa_state )
118118   /* basic machine hardware */
119119   MDRV_CPU_ADD("maincpu", M68000, 5093760)        /* 20.37504 MHz / 4 */
120120   MDRV_CPU_PROGRAM_MAP(lisa_map)
src/mess/drivers/apogee.c
r9699r9700
1818#include "includes/radio86.h"
1919
2020
21class apogee_state : public driver_device
21class apogee_state : public radio86_state
2222{
2323public:
2424   apogee_state(running_machine &machine, const driver_device_config_base &config)
25      : driver_device(machine, config) { }
25      : radio86_state(machine, config) { }
2626
2727};
2828
src/mess/drivers/ti99_4p.c
r9699r9700
5555
5656#include "machine/tms9901.h"
5757#include "machine/tms9902.h"
58#include "audio/spchroms.h"
5958#include "machine/ti99/peribox.h"
6059
6160#include "devices/cassette.h"

Previous 15994 Revisions Next


© 1998-2018 The MESS Team