Previous 15994 Revisions Next

r3636 Thursday 27th November, 2008 at 12:17:02 UTC by Miodrag Milanović
[APPLE][MAC] Enabled, Lisa is broken
[src/mess]mess.mak messdriv.c
[src/mess/devices]sonydriv.c
[src/mess/includes]apple2.h apple3.h
[src/mess/machine]apple1.c apple2.c apple2gs.c apple3.c applefdc.c lisa.c mac.c mockngbd.c ncr5380.c
[src/mess/video]apple2gs.c apple3.c

src/mess/video/apple2gs.c
r3635r3636
2121   apple2_video_start(machine, apple2gs_slowmem, 0x20000, 0, 8);
2222   apple2gs_legacy_gfx = auto_bitmap_alloc(560, 192, BITMAP_FORMAT_INDEXED16);
2323
24   state_save_register_item("BORDERCLR", 0, apple2gs_bordercolor);
24   state_save_register_item("BORDERCLR", NULL, 0, apple2gs_bordercolor);
2525}
2626
2727
src/mess/video/apple3.c
r3635r3636
3939static UINT32 *hgr_map;
4040
4141
42void apple3_write_charmem(void)
42void apple3_write_charmem(running_machine *machine)
4343{
44   const address_space* space = cpu_get_address_space(machine->cpu[0],ADDRESS_SPACE_PROGRAM);
4445   static const UINT32 screen_hole_map[] =
4546   {
4647      0x478, 0x4f8, 0x578, 0x5f8, 0x678, 0x6f8, 0x778, 0x7f8
src/mess/includes/apple3.h
r3635r3636
3838
3939VIDEO_START( apple3 );
4040VIDEO_UPDATE( apple3 );
41void apple3_write_charmem(void);
41void apple3_write_charmem(running_machine *machine);
4242
4343
4444#endif /* APPLE3_H_ */
src/mess/includes/apple2.h
r3635r3636
112112struct _apple2_meminfo
113113{
114114   UINT32 read_mem;
115   read8_machine_func read_handler;
115   read8_space_func read_handler;
116116   UINT32 write_mem;
117   write8_machine_func write_handler;
117   write8_space_func write_handler;
118118};
119119
120120typedef struct _apple2_memmap_entry apple2_memmap_entry;
src/mess/messdriv.c
r3635r3636
236236   DRIVER( nc200 )      /* 19?? NC200                              */
237237
238238   /* APPLE */
239//128u4   DRIVER( apple1 )   /* Jul 1976 Apple 1                           */
240//128u4   DRIVER( apple2 )   /* Apr 1977 Apple ][                        */
241//128u4   DRIVER( apple2p )   /* Jun 1979 Apple ][+                        */
242//128u4   DRIVER( apple2jp )   /* ??? ???? Apple ][j+                        */
243//128u4   DRIVER( apple2e )   /* Jan 1983 Apple //128u4e                        */
244//128u4   DRIVER( apple2ee )   /* Mar 1985 Apple //128u4e Enhanced                  */
245//128u4   DRIVER( apple2ep )   /* Jan 1987 Apple //128u4e Platinum                  */
246//128u4   DRIVER( apple2c )   /* Apr 1984 Apple //128u4c                        */
247//128u4   DRIVER( apple2c0 )   /* ??? 1985 Apple //128u4c (3.5 ROM)                  */
248//128u4   DRIVER( apple2c3 )   /* Sep 1986 Apple //128u4c (Original Mem. Exp.)         */
249//128u4   DRIVER( apple2c4 )   /* ??? 198? Apple //128u4c (rev 4)                  */
250//128u4   DRIVER( apple2cp )   /* Sep 1988 Apple //128u4c+                        */
251//128u4   DRIVER( apple2g0 )   /* Sep 1986 Apple IIgs ROM00                  */
252//128u4   DRIVER( apple2g1 )   /* Sep 1987 Apple IIgs ROM01                  */
253//128u4   DRIVER( apple2gs )   /* Aug 1989 Apple IIgs ROM03                  */
254//128u4   DRIVER( apple3 )   /* May 1980 Apple //128u4/                        */
255                  /* Dec 1983 Apple //128u4/+                        */
256//128u4   DRIVER( ace100 )   /* ??? 1982 Franklin Ace 100                  */
257//128u4   DRIVER( laser128 )   /* ??? 1987 Laser 128                        */
258//128u4   DRIVER( las128ex )   /* ??? 1987 Laser 128 EX                     */
259//128u4   DRIVER( las3000 )   /* ??? 1983 Laser 3000                        */
260//128u4   DRIVER( ivelultr )   /* Ivasim Ivel Ultra                        */
239   DRIVER( apple1 )   /* Jul 1976 Apple 1                           */
240   DRIVER( apple2 )   /* Apr 1977 Apple ][                        */
241   DRIVER( apple2p )   /* Jun 1979 Apple ][+                        */
242   DRIVER( apple2jp )   /* ??? ???? Apple ][j+                        */
243   DRIVER( apple2e )   /* Jan 1983 Apple //128u4e                        */
244   DRIVER( apple2ee )   /* Mar 1985 Apple //128u4e Enhanced                  */
245   DRIVER( apple2ep )   /* Jan 1987 Apple //128u4e Platinum                  */
246   DRIVER( apple2c )   /* Apr 1984 Apple //128u4c                        */
247   DRIVER( apple2c0 )   /* ??? 1985 Apple //128u4c (3.5 ROM)                  */
248   DRIVER( apple2c3 )   /* Sep 1986 Apple //128u4c (Original Mem. Exp.)         */
249   DRIVER( apple2c4 )   /* ??? 198? Apple //128u4c (rev 4)                  */
250   DRIVER( apple2cp )   /* Sep 1988 Apple //128u4c+                        */
251   DRIVER( apple2g0 )   /* Sep 1986 Apple IIgs ROM00                  */
252   DRIVER( apple2g1 )   /* Sep 1987 Apple IIgs ROM01                  */
253   DRIVER( apple2gs )   /* Aug 1989 Apple IIgs ROM03                  */
254   DRIVER( apple3 )   /* May 1980 Apple //128u4/                        */
255               /* Dec 1983 Apple //128u4/+                        */
256   DRIVER( ace100 )   /* ??? 1982 Franklin Ace 100                  */
257   DRIVER( laser128 )   /* ??? 1987 Laser 128                        */
258   DRIVER( las128ex )   /* ??? 1987 Laser 128 EX                     */
259   DRIVER( las3000 )   /* ??? 1983 Laser 3000                        */
260   DRIVER( ivelultr )   /* Ivasim Ivel Ultra                        */
261261
262262/*
263263 * Lisa              January          1983
264264 * Lisa 2              January          1984
265265 * Macintosh XL        January          1985
266266 */
267//128u4   DRIVER( lisa2 )      /* 1984 Apple Lisa 2                        */
268//128u4   DRIVER( lisa210 )   /* 1984 Apple Lisa 2/10                        */
269//128u4   DRIVER( macxl )      /* 1984 Apple Macintosh XL                     */
267   DRIVER( lisa2 )      /* 1984 Apple Lisa 2                        */
268   DRIVER( lisa210 )   /* 1984 Apple Lisa 2/10                        */
269   DRIVER( macxl )      /* 1984 Apple Macintosh XL                     */
270270/*
271271 * Macintosh         January            1984
272272 * Macintosh 512k      July?            1984
r3635r3636
275275 * Macintosh SE         March            1987
276276 * Macintosh II         March            1987
277277 */
278//128u4    DRIVER( mac128k )   /* 1984 Apple Macintosh                        */
279//128u4   DRIVER( mac512k )   /* 1985 Apple Macintosh 512k                  */
280//128u4   DRIVER( mac512ke )   /* 1986 Apple Macintosh 512ke                  */
281//128u4   DRIVER( macplus )   /* 1986 Apple Macintosh Plus                  */
282//128u4   DRIVER( macse )      /* 1987 Apple Macintosh SE                     */
283//128u4   DRIVER( macclasc )   /* 1990 Apple Macintosh Classic                  */
278    DRIVER( mac128k )   /* 1984 Apple Macintosh                        */
279   DRIVER( mac512k )   /* 1985 Apple Macintosh 512k                  */
280   DRIVER( mac512ke )   /* 1986 Apple Macintosh 512ke                  */
281   DRIVER( macplus )   /* 1986 Apple Macintosh Plus                  */
282   DRIVER( macse )      /* 1987 Apple Macintosh SE                     */
283   DRIVER( macclasc )   /* 1990 Apple Macintosh Classic                  */
284284
285285   /* ATARI */
286286/*
src/mess/machine/applefdc.c
r3635r3636
183183   fdc->mode = 0x1F;   /* default value needed by Lisa 2 - no, I don't know if it is true */
184184
185185   /* register save states */
186   state_save_register_item("applefdc", 0, fdc->write_byte);
187   state_save_register_item("applefdc", 0, fdc->lines);
188   state_save_register_item("applefdc", 0, fdc->mode);
189   state_save_register_item("applefdc", 0, fdc->handshake_hack);
186   state_save_register_item("applefdc", NULL, 0, fdc->write_byte);
187   state_save_register_item("applefdc", NULL, 0, fdc->lines);
188   state_save_register_item("applefdc", NULL, 0, fdc->mode);
189   state_save_register_item("applefdc", NULL, 0, fdc->handshake_hack);
190190}
191191
192192
src/mess/machine/mockngbd.c
r3635r3636
131131
132132      default:
133133         if (LOG_MOCKINGBOARD)
134            logerror("mockingboard_r unmapped, offset: %02x, pc: %04x\n", offset, (unsigned) cpunum_get_reg(0, REG_PC));
134            logerror("mockingboard_r unmapped, offset: %02x, pc: %04x\n", offset, (unsigned) cpu_get_reg(device->machine->cpu[0], REG_PC));
135135         break;
136136   }
137137   return 0x00;
r3635r3636
145145
146146WRITE8_DEVICE_HANDLER(mockingboard_w)
147147{
148   const address_space* space = cpu_get_address_space(device->machine->cpu[0],ADDRESS_SPACE_PROGRAM);
148149   mockingboard_token *token = get_token(device);
149150
150151   if (LOG_MOCKINGBOARD)
r3635r3636
162163            case 0x04: /* make inactive */
163164               break;
164165            case 0x06: /* write data */
165               ay8910_write_port_0_w(device->machine, 0, token->latch0);
166               ay8910_write_port_0_w(space, 0, token->latch0);
166167               break;
167168            case 0x07: /* set register */
168               ay8910_control_port_0_w(device->machine, 0, token->latch0);
169               ay8910_control_port_0_w(space, 0, token->latch0);
169170               break;
170171         }
171172         break;
r3635r3636
187188            case 0x04: /* make inactive */
188189               break;
189190            case 0x06: /* write data */
190               ay8910_write_port_1_w(device->machine, 0, token->latch1);
191               ay8910_write_port_1_w(space, 0, token->latch1);
191192               break;
192193            case 0x07: /* set register */
193               ay8910_control_port_1_w(device->machine, 0, token->latch1);
194               ay8910_control_port_1_w(space, 0, token->latch1);
194195               break;
195196         }
196197         break;
src/mess/machine/apple3.c
r3635r3636
118118
119119static READ8_HANDLER( apple3_c0xx_r )
120120{
121   const device_config *fdc = device_list_find_by_tag(machine->config->devicelist,
121   const device_config *fdc = device_list_find_by_tag(space->machine->config->devicelist,
122122      APPLEFDC,
123123      "fdc");
124124   UINT8 result = 0xFF;
r3635r3636
180180         break;
181181
182182      case 0xDB:
183         apple3_write_charmem();
183         apple3_write_charmem(space->machine);
184184         break;
185185
186186      case 0xE0: case 0xE1: case 0xE2: case 0xE3:
r3635r3636
194194      case 0xF1:
195195      case 0xF2:
196196      case 0xF3:
197         result = acia_6551_r(machine, offset & 0x03);
197         result = acia_6551_r(space, offset & 0x03);
198198         break;
199199   }
200200   return result;
r3635r3636
204204
205205static WRITE8_HANDLER( apple3_c0xx_w )
206206{
207   const device_config *fdc = device_list_find_by_tag(machine->config->devicelist,
207   const device_config *fdc = device_list_find_by_tag(space->machine->config->devicelist,
208208      IWM,
209209      "fdc");
210210   switch(offset)
r3635r3636
244244         break;
245245
246246      case 0xDB:
247         apple3_write_charmem();
247         apple3_write_charmem(space->machine);
248248         break;
249249
250250      case 0xE0: case 0xE1: case 0xE2: case 0xE3:
r3635r3636
258258      case 0xF1:
259259      case 0xF2:
260260      case 0xF3:
261         acia_6551_w(machine, offset & 0x03, data);
261         acia_6551_w(space, offset & 0x03, data);
262262         break;
263263   }
264264}
265265
266266INTERRUPT_GEN( apple3_interrupt )
267267{
268   via_set_input_ca2(machine, 1, (AY3600_keydata_strobe_r() & 0x80) ? 1 : 0);
269   via_set_input_cb1(machine, 1, video_screen_get_vblank(machine->primary_screen));
270   via_set_input_cb2(machine, 1, video_screen_get_vblank(machine->primary_screen));
268   via_set_input_ca2(device->machine, 1, (AY3600_keydata_strobe_r() & 0x80) ? 1 : 0);
269   via_set_input_cb1(device->machine, 1, video_screen_get_vblank(device->machine->primary_screen));
270   via_set_input_cb2(device->machine, 1, video_screen_get_vblank(device->machine->primary_screen));
271271}
272272
273273
r3635r3636
287287
288288
289289
290static void apple3_setbank(int mame_bank, UINT16 bank, offs_t offset)
290static void apple3_setbank(running_machine *machine,int mame_bank, UINT16 bank, offs_t offset)
291291{
292292   UINT8 *ptr;
293293
294294   ptr = apple3_bankaddr(bank, offset);
295   memory_set_bankptr(mame_bank, ptr);
295   memory_set_bankptr(machine, mame_bank, ptr);
296296
297297   if (LOG_MEMORY)
298298   {
r3635r3636
338338{
339339   UINT16 bank;
340340   UINT8 page;
341   const address_space* space = cpu_get_address_space(machine->cpu[0],ADDRESS_SPACE_PROGRAM);
341342
342343   if (LOG_MEMORY)
343344   {
344345      logerror("apple3_update_memory(): via_0_b=0x%02x via_1_a=0x0x%02x\n", via_0_b, via_1_a);
345346   }
346347
347   cpunum_set_clock(machine, 0, (via_0_a & 0x80) ? 1000000 : 2000000);
348   cpu_set_clock(machine->cpu[0], (via_0_a & 0x80) ? 1000000 : 2000000);
348349
349350   /* bank 2 (0100-01FF) */
350351   if (!(via_0_a & 0x04))
r3635r3636
370371      bank = ~0;
371372      page = 0x01;
372373   }
373   apple3_setbank(2, bank, ((offs_t) page) * 0x100);
374   apple3_setbank(machine,2, bank, ((offs_t) page) * 0x100);
374375
375376   /* bank 3 (0200-1FFF) */
376   apple3_setbank(3, ~0, 0x0200);
377   apple3_setbank(machine,3, ~0, 0x0200);
377378
378379   /* bank 4 (2000-9FFF) */
379   apple3_setbank(4, via_1_a, 0x0000);
380   apple3_setbank(machine,4, via_1_a, 0x0000);
380381
381382   /* bank 5 (A000-BFFF) */
382   apple3_setbank(5, ~0, 0x2000);
383   apple3_setbank(machine,5, ~0, 0x2000);
383384
384385   /* install bank 8 (C000-CFFF) */
385386   if (via_0_a & 0x40)
386387   {
387      memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xC000, 0xC0FF, 0, 0, apple3_c0xx_r);
388      memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xC000, 0xC0FF, 0, 0, apple3_c0xx_w);
388      memory_install_read8_handler(space, 0xC000, 0xC0FF, 0, 0, apple3_c0xx_r);
389      memory_install_write8_handler(space, 0xC000, 0xC0FF, 0, 0, apple3_c0xx_w);
389390   }
390391   else
391392   {
392      memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xC000, 0xC0FF, 0, 0, SMH_BANK8);
393      memory_install_read8_handler(space, 0xC000, 0xC0FF, 0, 0, SMH_BANK8);
393394      if (via_0_a & 0x08)
394         memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xC000, 0xC0FF, 0, 0, SMH_UNMAP);
395         memory_install_write8_handler(space, 0xC000, 0xC0FF, 0, 0, SMH_UNMAP);
395396      else
396         memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xC000, 0xC0FF, 0, 0, SMH_BANK8);
397      apple3_setbank(8, ~0, 0x4000);
397         memory_install_write8_handler(space, 0xC000, 0xC0FF, 0, 0, SMH_BANK8);
398      apple3_setbank(machine,8, ~0, 0x4000);
398399   }
399400
400401   /* install bank 9 (C100-C4FF) */
401402   if (via_0_a & 0x40)
402403   {
403      memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xC100, 0xC4FF, 0, 0, SMH_NOP);
404      memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xC100, 0xC4FF, 0, 0, SMH_NOP);
404      memory_install_read8_handler(space, 0xC100, 0xC4FF, 0, 0, SMH_NOP);
405      memory_install_write8_handler(space, 0xC100, 0xC4FF, 0, 0, SMH_NOP);
405406   }
406407   else
407408   {
408      memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xC100, 0xC4FF, 0, 0, SMH_BANK9);
409      memory_install_read8_handler(space, 0xC100, 0xC4FF, 0, 0, SMH_BANK9);
409410      if (via_0_a & 0x08)
410         memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xC100, 0xC4FF, 0, 0, SMH_UNMAP);
411         memory_install_write8_handler(space, 0xC100, 0xC4FF, 0, 0, SMH_UNMAP);
411412      else
412         memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xC100, 0xC4FF, 0, 0, SMH_BANK9);
413      apple3_setbank(9, ~0, 0x4100);
413         memory_install_write8_handler(space, 0xC100, 0xC4FF, 0, 0, SMH_BANK9);
414      apple3_setbank(machine,9, ~0, 0x4100);
414415   }
415416
416417   /* install bank 10 (C500-C7FF) */
417   memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xC500, 0xC7FF, 0, 0, SMH_BANK10);
418   memory_install_read8_handler(space, 0xC500, 0xC7FF, 0, 0, SMH_BANK10);
418419   if (via_0_a & 0x08)
419      memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xC500, 0xC7FF, 0, 0, SMH_UNMAP);
420      memory_install_write8_handler(space, 0xC500, 0xC7FF, 0, 0, SMH_UNMAP);
420421   else
421      memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xC500, 0xC7FF, 0, 0, SMH_BANK10);
422   apple3_setbank(10, ~0, 0x4500);
422      memory_install_write8_handler(space, 0xC500, 0xC7FF, 0, 0, SMH_BANK10);
423   apple3_setbank(machine,10, ~0, 0x4500);
423424
424425   /* install bank 11 (C800-CFFF) */
425426   if (via_0_a & 0x40)
426427   {
427      memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xC800, 0xCFFF, 0, 0, SMH_NOP);
428      memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xC800, 0xCFFF, 0, 0, SMH_NOP);
428      memory_install_read8_handler(space, 0xC800, 0xCFFF, 0, 0, SMH_NOP);
429      memory_install_write8_handler(space, 0xC800, 0xCFFF, 0, 0, SMH_NOP);
429430   }
430431   else
431432   {
432      memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xC800, 0xCFFF, 0, 0, SMH_BANK11);
433      memory_install_read8_handler(space, 0xC800, 0xCFFF, 0, 0, SMH_BANK11);
433434      if (via_0_a & 0x08)
434         memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xC800, 0xCFFF, 0, 0, SMH_UNMAP);
435         memory_install_write8_handler(space, 0xC800, 0xCFFF, 0, 0, SMH_UNMAP);
435436      else
436         memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xC800, 0xCFFF, 0, 0, SMH_BANK11);
437      apple3_setbank(11, ~0, 0x4800);
437         memory_install_write8_handler(space, 0xC800, 0xCFFF, 0, 0, SMH_BANK11);
438      apple3_setbank(machine,11, ~0, 0x4800);
438439   }
439440
440441   /* install bank 6 (D000-EFFF) */
441   memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xD000, 0xEFFF, 0, 0, SMH_BANK6);
442   memory_install_read8_handler(space, 0xD000, 0xEFFF, 0, 0, SMH_BANK6);
442443   if (via_0_a & 0x08)
443      memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xD000, 0xEFFF, 0, 0, SMH_UNMAP);
444      memory_install_write8_handler(space, 0xD000, 0xEFFF, 0, 0, SMH_UNMAP);
444445   else
445      memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xD000, 0xEFFF, 0, 0, SMH_BANK6);
446   apple3_setbank(6, ~0, 0x5000);
446      memory_install_write8_handler(space, 0xD000, 0xEFFF, 0, 0, SMH_BANK6);
447   apple3_setbank(machine,6, ~0, 0x5000);
447448
448449   /* install bank 7 (F000-FFFF) */
449   memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xF000, 0xFFFF, 0, 0, SMH_BANK7);
450   memory_install_read8_handler(space, 0xF000, 0xFFFF, 0, 0, SMH_BANK7);
450451   if (via_0_a & 0x09)
451      memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xF000, 0xFFFF, 0, 0, SMH_UNMAP);
452      memory_install_write8_handler(space, 0xF000, 0xFFFF, 0, 0, SMH_UNMAP);
452453   else
453      memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xF000, 0xFFFF, 0, 0, SMH_BANK7);
454      memory_install_write8_handler(space, 0xF000, 0xFFFF, 0, 0, SMH_BANK7);
454455   if (via_0_a & 0x01)
455      memory_set_bankptr(7, memory_region(machine, "main"));
456      memory_set_bankptr(machine,7, memory_region(machine, "main"));
456457   else
457      apple3_setbank(7, ~0, 0x7000);
458      apple3_setbank(machine,7, ~0, 0x7000);
458459
459460   /* reinstall VIA handlers */
460   memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xFFD0, 0xFFDF, 0, 0, via_0_r);
461   memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xFFD0, 0xFFDF, 0, 0, via_0_w);
462   memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xFFE0, 0xFFEF, 0, 0, via_1_r);
463   memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xFFE0, 0xFFEF, 0, 0, via_1_w);
461   memory_install_read8_handler(space, 0xFFD0, 0xFFDF, 0, 0, via_0_r);
462   memory_install_write8_handler(space, 0xFFD0, 0xFFDF, 0, 0, via_0_w);
463   memory_install_read8_handler(space, 0xFFE0, 0xFFEF, 0, 0, via_1_r);
464   memory_install_write8_handler(space, 0xFFE0, 0xFFEF, 0, 0, via_1_w);
464465}
465466
466467
r3635r3636
479480static READ8_HANDLER(apple3_via_1_in_a) { return ~0; }
480481static READ8_HANDLER(apple3_via_1_in_b) { return ~0; }
481482
482static WRITE8_HANDLER(apple3_via_0_out_a) { apple3_via_out(machine, &via_0_a, data); }
483static WRITE8_HANDLER(apple3_via_0_out_b) { apple3_via_out(machine, &via_0_b, data); }
484static WRITE8_HANDLER(apple3_via_1_out_a) { apple3_via_out(machine, &via_1_a, data); }
485static WRITE8_HANDLER(apple3_via_1_out_b) { apple3_via_out(machine, &via_1_b, data); }
483static WRITE8_HANDLER(apple3_via_0_out_a) { apple3_via_out(space->machine, &via_0_a, data); }
484static WRITE8_HANDLER(apple3_via_0_out_b) { apple3_via_out(space->machine, &via_0_b, data); }
485static WRITE8_HANDLER(apple3_via_1_out_a) { apple3_via_out(space->machine, &via_1_a, data); }
486static WRITE8_HANDLER(apple3_via_1_out_b) { apple3_via_out(space->machine, &via_1_b, data); }
486487
487488static void apple2_via_1_irq_func(running_machine *machine, int state)
488489{
r3635r3636
621622   else if (addr != (UINT8 *) ~0)
622623      result = *addr;
623624   else
624      result = memory_region(machine, "main")[offset % memory_region_length(machine, "main")];
625      result = memory_region(space->machine, "main")[offset % memory_region_length(space->machine, "main")];
625626   return result;
626627}
627628
r3635r3636
647648   if ((address & 0xFF00) == 0x0000)
648649   {
649650      opptr = apple3_get_zpa_addr(address);
650      opbase->mask = ~0;
651      direct->mask = ~0;
651652      direct->raw = direct->decrypted = opptr - address;
652      opbase->mem_min = address;
653      opbase->mem_max = address;
653      direct->min = address;
654      direct->max = address;
654655      address = ~0;
655656   }
656657   return address;
r3635r3636
729730   via_1_irq = 0;
730731   apple3_update_memory(machine);
731732
732   memory_set_direct_update_handler(0, apple3_opbase);
733   memory_set_direct_update_handler(cpu_get_address_space(machine->cpu[0],ADDRESS_SPACE_PROGRAM), apple3_opbase);
733734
734735   /* the Apple /// does some weird tricks whereby it monitors the SYNC pin
735736    * on the CPU to check for indexed instructions and directs them to
736737    * different memory locations */
737   cpunum_set_info_fct(0, CPUINFO_PTR_M6502_READINDEXED_CALLBACK, (genf *) apple3_indexed_read);
738   cpunum_set_info_fct(0, CPUINFO_PTR_M6502_WRITEINDEXED_CALLBACK, (genf *) apple3_indexed_write);
738   cpu_set_info_fct(machine->cpu[0], CPUINFO_PTR_M6502_READINDEXED_CALLBACK, (genf *) apple3_indexed_read);
739   cpu_set_info_fct(machine->cpu[0], CPUINFO_PTR_M6502_WRITEINDEXED_CALLBACK, (genf *) apple3_indexed_write);
739740}
src/mess/machine/ncr5380.c
r3635r3636
9494   int reg = offset & 7;
9595
9696   if (VERBOSE)
97      logerror("NCR5380: %02x to %s (reg %d) [PC=%x]\n", data, wnames[reg], reg, activecpu_get_pc());
97      logerror("NCR5380: %02x to %s (reg %d) [PC=%x]\n", data, wnames[reg], reg, cpu_get_pc(space->machine->cpu[0]));
9898
9999   switch( reg )
100100   {
r3635r3636
354354   }
355355
356356   if (VERBOSE)
357      logerror("NCR5380: read %s (reg %d) = %02x [PC=%x]\n", rnames[reg], reg, rv, activecpu_get_pc());
357      logerror("NCR5380: read %s (reg %d) = %02x [PC=%x]\n", rnames[reg], reg, rv, cpu_get_pc(space->machine->cpu[0]));
358358
359359   return rv;
360360}
r3635r3636
375375      SCSIAllocInstance( interface->scsidevs->devices[i].scsiClass, &devices[interface->scsidevs->devices[i].scsiID], interface->scsidevs->devices[i].diskregion );
376376   }
377377
378   state_save_register_item_array("ncr5380", 0, n5380_Registers);
379   state_save_register_item_array("ncr5380", 0, n5380_Command);
380   state_save_register_item_array("ncr5380", 0, n5380_Data);
381   state_save_register_item("ncr5380", 0, last_id);
382   state_save_register_item("ncr5380", 0, cmd_ptr);
383   state_save_register_item("ncr5380", 0, d_ptr);
384   state_save_register_item("ncr5380", 0, d_limit);
378   state_save_register_item_array("ncr5380", NULL, 0, n5380_Registers);
379   state_save_register_item_array("ncr5380", NULL, 0, n5380_Command);
380   state_save_register_item_array("ncr5380", NULL, 0, n5380_Data);
381   state_save_register_item("ncr5380", NULL, 0, last_id);
382   state_save_register_item("ncr5380", NULL, 0, cmd_ptr);
383   state_save_register_item("ncr5380", NULL, 0, d_ptr);
384   state_save_register_item("ncr5380", NULL, 0, d_limit);
385385}
386386
387387void ncr5380_exit( const struct NCR5380interface *interface )
src/mess/machine/apple2gs.c
r3635r3636
795795   int scanline;
796796
797797   // make sure we're in the 65816's context
798   cpuintrf_push_context(0);
798   cpu_push_context(machine->cpu[0]);
799799
800800   scanline = video_screen_get_vpos(machine->primary_screen);
801801   video_screen_update_partial(machine->primary_screen, scanline);
r3635r3636
831831
832832      /* call Apple II interrupt handler */
833833      if ((video_screen_get_vpos(machine->primary_screen) % 8) == 7)
834         apple2_interrupt(machine, 0);
834         apple2_interrupt(machine->cpu[0]);
835835   }
836836
837837   timer_adjust_oneshot(apple2gs_scanline_timer, video_screen_get_time_until_pos(machine->primary_screen, (scanline+1)%262, 0), 0);
838838
839   cpuintrf_pop_context();
839   cpu_pop_context();
840840}
841841
842842
r3635r3636
866866         }
867867         else
868868         {
869            sndglu_dummy_read = es5503_reg_0_r(machine, sndglu_addr);
869            sndglu_dummy_read = es5503_reg_0_r(space, sndglu_addr);
870870         }
871871
872872         if (sndglu_ctrl & 0x20)   // auto-increment
r3635r3636
905905         }
906906         else
907907         {
908            es5503_reg_0_w(machine, sndglu_addr, data);
908            es5503_reg_0_w(space, sndglu_addr, data);
909909         }
910910
911911         if (sndglu_ctrl & 0x20)   // auto-increment
r3635r3636
965965   switch(offset)
966966   {
967967      case 0x19:   /* C019 - RDVBLBAR */
968         result = (video_screen_get_vpos(machine->primary_screen) >= (192+BORDER_TOP)) ? 0x80 : 0x00;
968         result = (video_screen_get_vpos(space->machine->primary_screen) >= (192+BORDER_TOP)) ? 0x80 : 0x00;
969969         break;
970970
971971      case 0x22:   /* C022 - TBCOLOR */
r3635r3636
978978         break;
979979
980980      case 0x24:   /* C024 - MOUSEDATA */
981         result = adb_read_mousedata(machine);
981         result = adb_read_mousedata(space->machine);
982982         break;
983983
984984      case 0x25:   /* C025 - KEYMODREG */
r3635r3636
10061006         break;
10071007
10081008      case 0x2E:   /* C02E - VERTCNT */
1009         result = apple2gs_get_vpos(machine) >> 1;
1009         result = apple2gs_get_vpos(space->machine) >> 1;
10101010         break;
10111011
10121012      case 0x2F:   /* C02F - HORIZCNT */
1013         result = video_screen_get_hpos(machine->primary_screen) / 11;
1013         result = video_screen_get_hpos(space->machine->primary_screen) / 11;
10141014         if (result > 0)
10151015         {
10161016            result += 0x40;
10171017         }
10181018
1019         if (apple2gs_get_vpos(machine) & 1)
1019         if (apple2gs_get_vpos(space->machine) & 1)
10201020         {
10211021            result |= 0x80;
10221022         }
r3635r3636
10461046      case 0x39:   /* C039 - SCCAREG */
10471047      case 0x3A:   /* C03A - SCCBDATA */
10481048      case 0x3B:   /* C03B - SCCADATA */
1049         scc = device_list_find_by_tag(machine->config->devicelist, SCC8530, "scc");
1049         scc = device_list_find_by_tag(space->machine->config->devicelist, SCC8530, "scc");
10501050         result = scc_r(scc, offset & 0x03);
10511051         break;
10521052
r3635r3636
10541054      case 0x3D:   /* C03D - SOUNDDATA */
10551055      case 0x3E:   /* C03E - SOUNDADRL */
10561056      case 0x3F:   /* C03F - SOUNDADRH */
1057         result = gssnd_r(machine, offset & 0x03);
1057         result = gssnd_r(space, offset & 0x03);
10581058         break;
10591059
10601060      case 0x41:   /* C041 - INTEN */
r3635r3636
10791079      case 0x74: case 0x75: case 0x76: case 0x77:
10801080      case 0x78: case 0x79: case 0x7a: case 0x7b:
10811081      case 0x7c: case 0x7d: case 0x7e: case 0x7f:
1082         offset |= (memory_region_length(machine, "main") - 1) & ~0x3FFF;
1083         result = memory_region(machine, "main")[offset];
1082         offset |= (memory_region_length(space->machine, "main") - 1) & ~0x3FFF;
1083         result = memory_region(space->machine, "main")[offset];
10841084         break;
10851085
10861086      case 0x21:   /* C021 - MONOCOLOR */
r3635r3636
10881088         result = 0x00;
10891089
10901090      default:
1091         result = apple2_c0xx_r(machine, offset);
1091         result = apple2_c0xx_r(space, offset);
10921092         break;
10931093   }
10941094
r3635r3636
11301130         break;
11311131
11321132      case 0x26:   /* C026 - DATAREG */
1133         adb_write_datareg(machine, data);
1133         adb_write_datareg(space->machine, data);
11341134         break;
11351135
11361136      case 0x27:   /* C027 - KMSTATUS */
r3635r3636
11471147
11481148      case 0x2D:   /* C02D - SLTROMSEL */
11491149         apple2gs_sltromsel = data;
1150         apple2_update_memory(machine);
1150         apple2_update_memory(space->machine);
11511151         break;
11521152
11531153      case 0x31:   /* C031 - DISKREG */
1154         apple2_iwm_setdiskreg(machine, data);
1154         apple2_iwm_setdiskreg(space->machine, data);
11551155         break;
11561156
11571157      case 0x32:   /* C032 - SCANINT */
1158         apple2gs_set_scanint(machine, data);
1158         apple2gs_set_scanint(space->machine, data);
11591159         break;
11601160
11611161      case 0x33:   /* C033 - CLOCKDATA */
r3635r3636
11731173         if (apple2gs_shadow != data)
11741174         {
11751175            apple2gs_shadow = data;
1176            apple2_update_memory(machine);
1176            apple2_update_memory(space->machine);
11771177         }
11781178         break;
11791179
11801180      case 0x36:   /* C036 - CYAREG */
11811181         apple2gs_cyareg = data & ~0x20;
1182         cpunum_set_clock(machine, 0, (data & 0x80) ? APPLE2GS_14M/5 : APPLE2GS_7M/7);
1182         cpu_set_clock(space->machine->cpu[0], (data & 0x80) ? APPLE2GS_14M/5 : APPLE2GS_7M/7);
11831183         break;
11841184
11851185      case 0x38:   /* C038 - SCCBREG */
11861186      case 0x39:   /* C039 - SCCAREG */
11871187      case 0x3A:   /* C03A - SCCBDATA */
11881188      case 0x3B:   /* C03B - SCCADATA */
1189         scc = device_list_find_by_tag(machine->config->devicelist, SCC8530, "scc");
1189         scc = device_list_find_by_tag(space->machine->config->devicelist, SCC8530, "scc");
11901190         scc_w(scc, offset & 0x03, data);
11911191         break;
11921192
r3635r3636
11941194      case 0x3D:   /* C03D - SOUNDDATA */
11951195      case 0x3E:   /* C03E - SOUNDADRL */
11961196      case 0x3F:   /* C03F - SOUNDADRH */
1197         gssnd_w(machine, offset & 0x03, data);
1197         gssnd_w(space, offset & 0x03, data);
11981198         break;
11991199
12001200      case 0x41:   /* C041 - INTEN */
12011201         apple2gs_inten = data & 0x1F;
12021202         if ((apple2gs_inten & 0x10) == 0x00)
1203            apple2gs_remove_irq(machine, IRQ_INTEN_QSECOND);
1203            apple2gs_remove_irq(space->machine, IRQ_INTEN_QSECOND);
12041204         if ((apple2gs_inten & 0x08) == 0x00)
1205            apple2gs_remove_irq(machine, IRQ_INTEN_VBL);
1205            apple2gs_remove_irq(space->machine, IRQ_INTEN_VBL);
12061206         break;
12071207
12081208      case 0x47:   /* C047 - CLRVBLINT */
12091209         apple2gs_intflag &= ~0x18;
1210         apple2gs_remove_irq(machine, IRQ_INTEN_QSECOND);
1211         apple2gs_remove_irq(machine, IRQ_INTEN_VBL);
1210         apple2gs_remove_irq(space->machine, IRQ_INTEN_QSECOND);
1211         apple2gs_remove_irq(space->machine, IRQ_INTEN_VBL);
12121212         break;
12131213
12141214      case 0x68:   /* C068 - STATEREG */
1215         apple2_setvar(machine,
1215         apple2_setvar(space->machine,
12161216            ((data & 0x80) ? VAR_ALTZP : 0) |
12171217            ((data & 0x40) ? VAR_PAGE2 : 0) |
12181218            ((data & 0x20) ? VAR_RAMRD : 0) |
r3635r3636
12241224         break;
12251225
12261226      default:
1227         apple2_c0xx_w(machine, offset, data);
1227         apple2_c0xx_w(space, offset, data);
12281228         break;
12291229   }
12301230}
r3635r3636
13111311         {
13121312            int color = (offset - 0x19e00) >> 1;
13131313
1314            palette_set_color_rgb(machine, color + 16,
1314            palette_set_color_rgb(space->machine, color + 16,
13151315               ((apple2gs_slowmem[0x19E00 + (color * 2) + 1] >> 0) & 0x0F) * 17,
13161316               ((apple2gs_slowmem[0x19E00 + (color * 2) + 0] >> 4) & 0x0F) * 17,
13171317               ((apple2gs_slowmem[0x19E00 + (color * 2) + 0] >> 0) & 0x0F) * 17);
r3635r3636
15411541   }
15421542   else if ((address & 0x000F00) == 0x000000)
15431543   {
1544      result = apple2gs_c0xx_r(machine, address);
1544      result = apple2gs_c0xx_r(cpu_get_address_space(machine->cpu[0],ADDRESS_SPACE_PROGRAM), address);
15451545   }
15461546   else
15471547   {
r3635r3636
15671567   }
15681568   else if ((address & 0x000F00) == 0x000000)
15691569   {
1570      apple2gs_c0xx_w(machine, address, data);
1570      apple2gs_c0xx_w(cpu_get_address_space(machine->cpu[0],ADDRESS_SPACE_PROGRAM), address, data);
15711571   }
15721572   else
15731573   {
r3635r3636
15941594      else if ((address & 0x000F00) == 0x000000)
15951595      {
15961596         if (((address & 0xFF) >= 0x71) && ((address & 0xFF) <= 0x7F))
1597            opptr = apple2gs_getslotmem(machine, address);
1597            opptr = apple2gs_getslotmem(space->machine, address);
15981598      }
15991599      else
16001600      {
16011601         slot = (address & 0x000F00) / 0x100;
16021602
16031603         if ((slot > 7) || ((apple2gs_sltromsel & (1 << slot)) == 0))
1604            opptr = apple2gs_getslotmem(machine, address);
1604            opptr = apple2gs_getslotmem(space->machine, address);
16051605      }
16061606
16071607      if (opptr != NULL)
16081608      {
1609         opbase->mask = ~0;
1609         direct->mask = ~0;
16101610         direct->raw = direct->decrypted = opptr - address;
1611         opbase->mem_min = address;
1612         opbase->mem_max = address;
1611         direct->min = address;
1612         direct->max = address;
16131613         address = ~0;
16141614      }
16151615   }
r3635r3636
16181618
16191619
16201620
1621static READ8_HANDLER( apple2gs_00Cxxx_r ) { return apple2gs_xxCxxx_r(machine, offset | 0x00C000); }
1622static READ8_HANDLER( apple2gs_01Cxxx_r ) { return apple2gs_xxCxxx_r(machine, offset | 0x01C000); }
1623static READ8_HANDLER( apple2gs_E0Cxxx_r ) { return apple2gs_xxCxxx_r(machine, offset | 0xE0C000); }
1624static READ8_HANDLER( apple2gs_E1Cxxx_r ) { return apple2gs_xxCxxx_r(machine, offset | 0xE1C000); }
1621static READ8_HANDLER( apple2gs_00Cxxx_r ) { return apple2gs_xxCxxx_r(space->machine, offset | 0x00C000); }
1622static READ8_HANDLER( apple2gs_01Cxxx_r ) { return apple2gs_xxCxxx_r(space->machine, offset | 0x01C000); }
1623static READ8_HANDLER( apple2gs_E0Cxxx_r ) { return apple2gs_xxCxxx_r(space->machine, offset | 0xE0C000); }
1624static READ8_HANDLER( apple2gs_E1Cxxx_r ) { return apple2gs_xxCxxx_r(space->machine, offset | 0xE1C000); }
16251625
1626static WRITE8_HANDLER( apple2gs_00Cxxx_w) { apple2gs_xxCxxx_w(machine, offset | 0x00C000, data); }
1627static WRITE8_HANDLER( apple2gs_01Cxxx_w) { apple2gs_xxCxxx_w(machine, offset | 0x01C000, data); }
1628static WRITE8_HANDLER( apple2gs_E0Cxxx_w) { apple2gs_xxCxxx_w(machine, offset | 0xE0C000, data); }
1629static WRITE8_HANDLER( apple2gs_E1Cxxx_w) { apple2gs_xxCxxx_w(machine, offset | 0xE1C000, data); }
1626static WRITE8_HANDLER( apple2gs_00Cxxx_w) { apple2gs_xxCxxx_w(space->machine, offset | 0x00C000, data); }
1627static WRITE8_HANDLER( apple2gs_01Cxxx_w) { apple2gs_xxCxxx_w(space->machine, offset | 0x01C000, data); }
1628static WRITE8_HANDLER( apple2gs_E0Cxxx_w) { apple2gs_xxCxxx_w(space->machine, offset | 0xE0C000, data); }
1629static WRITE8_HANDLER( apple2gs_E1Cxxx_w) { apple2gs_xxCxxx_w(space->machine, offset | 0xE1C000, data); }
16301630
16311631static WRITE8_HANDLER( apple2gs_Exxxxx_w )
16321632{
16331633   apple2gs_slowmem[offset] = data;
16341634}
16351635
1636static WRITE8_HANDLER( apple2gs_E004xx_w ) { apple2gs_Exxxxx_w(machine, offset + 0x00400, data); }
1637static WRITE8_HANDLER( apple2gs_E02xxx_w ) { apple2gs_Exxxxx_w(machine, offset + 0x02000, data); }
1638static WRITE8_HANDLER( apple2gs_E104xx_w ) { apple2gs_Exxxxx_w(machine, offset + 0x10400, data); }
1639static WRITE8_HANDLER( apple2gs_E12xxx_w ) { apple2gs_Exxxxx_w(machine, offset + 0x12000, data); }
1636static WRITE8_HANDLER( apple2gs_E004xx_w ) { apple2gs_Exxxxx_w(space, offset + 0x00400, data); }
1637static WRITE8_HANDLER( apple2gs_E02xxx_w ) { apple2gs_Exxxxx_w(space, offset + 0x02000, data); }
1638static WRITE8_HANDLER( apple2gs_E104xx_w ) { apple2gs_Exxxxx_w(space, offset + 0x10400, data); }
1639static WRITE8_HANDLER( apple2gs_E12xxx_w ) { apple2gs_Exxxxx_w(space, offset + 0x12000, data); }
16401640
16411641static WRITE8_HANDLER( apple2gs_slowmem_w )
16421642{
r3635r3636
16461646   {
16471647      int color = (offset - 0x19e00) >> 1;
16481648
1649      palette_set_color_rgb(machine, color + 16,
1649      palette_set_color_rgb(space->machine, color + 16,
16501650         ((apple2gs_slowmem[0x19E00 + (color * 2) + 1] >> 0) & 0x0F) * 17,
16511651         ((apple2gs_slowmem[0x19E00 + (color * 2) + 0] >> 4) & 0x0F) * 17,
16521652         ((apple2gs_slowmem[0x19E00 + (color * 2) + 0] >> 0) & 0x0F) * 17);
r3635r3636
16561656
16571657static void apple2gs_setup_memory(running_machine *machine)
16581658{
1659   const address_space* space = cpu_get_address_space(machine->cpu[0],ADDRESS_SPACE_PROGRAM);
16591660   offs_t begin, end;
16601661   apple2_memmap_config cfg;
16611662
r3635r3636
16631664   apple2gs_slowmem = auto_malloc(128*1024);
16641665   memset(apple2gs_slowmem, 0, 128*1024);
16651666
1666   state_save_register_item_array("APPLE2GS_SLOWMEM", 0, apple2gs_slowmem);
1667   state_save_register_item_array("APPLE2GS_SLOWMEM", NULL, 0, apple2gs_slowmem);
16671668
16681669   /* install expanded memory */
1669   memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x010000, mess_ram_size - 1, 0, 0, SMH_BANK1);
1670   memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x010000, mess_ram_size - 1, 0, 0, SMH_BANK1);
1671   memory_set_bankptr(1, mess_ram + 0x010000);
1670   memory_install_read8_handler(space, 0x010000, mess_ram_size - 1, 0, 0, SMH_BANK1);
1671   memory_install_write8_handler(space, 0x010000, mess_ram_size - 1, 0, 0, SMH_BANK1);
1672   memory_set_bankptr(machine,1, mess_ram + 0x010000);
16721673
16731674   /* install hi memory */
1674   memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe00000, 0xe1ffff, 0, 0, SMH_BANK2);
1675   memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe00000, 0xe1ffff, 0, 0, apple2gs_slowmem_w);
1676   memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe00400, 0xe007ff, 0, 0, apple2gs_E004xx_w);
1677   memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe02000, 0xe03fff, 0, 0, apple2gs_E02xxx_w);
1678   memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe10400, 0xe107ff, 0, 0, apple2gs_E104xx_w);
1679   memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe12000, 0xe13fff, 0, 0, apple2gs_E12xxx_w);
1680   memory_set_bankptr(2, apple2gs_slowmem);
1675   memory_install_read8_handler(space, 0xe00000, 0xe1ffff, 0, 0, SMH_BANK2);
1676   memory_install_write8_handler(space, 0xe00000, 0xe1ffff, 0, 0, apple2gs_slowmem_w);
1677   memory_install_write8_handler(space, 0xe00400, 0xe007ff, 0, 0, apple2gs_E004xx_w);
1678   memory_install_write8_handler(space, 0xe02000, 0xe03fff, 0, 0, apple2gs_E02xxx_w);
1679   memory_install_write8_handler(space, 0xe10400, 0xe107ff, 0, 0, apple2gs_E104xx_w);
1680   memory_install_write8_handler(space, 0xe12000, 0xe13fff, 0, 0, apple2gs_E12xxx_w);
1681   memory_set_bankptr(machine,2, apple2gs_slowmem);
16811682
16821683   /* install alternate ROM bank */
16831684   begin = 0x1000000 - memory_region_length(machine, "main");
16841685   end = 0xffffff;
1685   memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, begin, end, 0, 0, SMH_BANK3);
1686   memory_set_bankptr(3, memory_region(machine, "main"));
1686   memory_install_read8_handler(space, begin, end, 0, 0, SMH_BANK3);
1687   memory_set_bankptr(machine,3, memory_region(machine, "main"));
16871688
16881689   /* install new xxC000-xxCFFF handlers */
1689   memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x00c000, 0x00cfff, 0, 0, apple2gs_00Cxxx_r);
1690   memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x00c000, 0x00cfff, 0, 0, apple2gs_00Cxxx_w);
1691   memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x01c000, 0x01cfff, 0, 0, apple2gs_01Cxxx_r);
1692   memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x01c000, 0x01cfff, 0, 0, apple2gs_01Cxxx_w);
1693   memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe0c000, 0xe0cfff, 0, 0, apple2gs_E0Cxxx_r);
1694   memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe0c000, 0xe0cfff, 0, 0, apple2gs_E0Cxxx_w);
1695   memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe1c000, 0xe1cfff, 0, 0, apple2gs_E1Cxxx_r);
1696   memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe1c000, 0xe1cfff, 0, 0, apple2gs_E1Cxxx_w);
1697   memory_set_direct_update_handler(0, apple2gs_opbase);
1690   memory_install_read8_handler(space, 0x00c000, 0x00cfff, 0, 0, apple2gs_00Cxxx_r);
1691   memory_install_write8_handler(space, 0x00c000, 0x00cfff, 0, 0, apple2gs_00Cxxx_w);
1692   memory_install_read8_handler(space, 0x01c000, 0x01cfff, 0, 0, apple2gs_01Cxxx_r);
1693   memory_install_write8_handler(space, 0x01c000, 0x01cfff, 0, 0, apple2gs_01Cxxx_w);
1694   memory_install_read8_handler(space, 0xe0c000, 0xe0cfff, 0, 0, apple2gs_E0Cxxx_r);
1695   memory_install_write8_handler(space, 0xe0c000, 0xe0cfff, 0, 0, apple2gs_E0Cxxx_w);
1696   memory_install_read8_handler(space, 0xe1c000, 0xe1cfff, 0, 0, apple2gs_E1Cxxx_r);
1697   memory_install_write8_handler(space, 0xe1c000, 0xe1cfff, 0, 0, apple2gs_E1Cxxx_w);
1698   memory_set_direct_update_handler(space, apple2gs_opbase);
16981699
16991700   /* install aux memory writes (for shadowing) */
1700   memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x010400, 0x0107FF, 0, 0, apple2gs_aux0400_w);
1701   memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x012000, 0x013FFF, 0, 0, apple2gs_aux2000_w);
1702   memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x014000, 0x019FFF, 0, 0, apple2gs_aux4000_w);
1701   memory_install_write8_handler(space, 0x010400, 0x0107FF, 0, 0, apple2gs_aux0400_w);
1702   memory_install_write8_handler(space, 0x012000, 0x013FFF, 0, 0, apple2gs_aux2000_w);
1703   memory_install_write8_handler(space, 0x014000, 0x019FFF, 0, 0, apple2gs_aux4000_w);
17031704
17041705   /* setup the Apple II memory system */
17051706   memset(&cfg, 0, sizeof(cfg));
r3635r3636
17411742   apple2_init_common(machine);
17421743
17431744   /* set up Apple IIgs vectoring */
1744   cpunum_set_info_fct(0, CPUINFO_PTR_G65816_READVECTOR_CALLBACK, (genf *) apple2gs_read_vector);
1745   cpu_set_info_fct(machine->cpu[0], CPUINFO_PTR_G65816_READVECTOR_CALLBACK, (genf *) apple2gs_read_vector);
17451746
17461747   /* setup globals */
17471748   apple2gs_cur_slot6_image = NULL;
r3635r3636
17921793   /* save state stuff.  note that the driver takes care of docram. */
17931794   state_save_register_global_array(mess_ram);
17941795
1795   state_save_register_item("NEWVIDEO", 0, apple2gs_newvideo);
1796   state_save_register_item("NEWVIDEO", NULL, 0, apple2gs_newvideo);
17961797
1797   state_save_register_item("VGCINT", 0, apple2gs_vgcint);
1798   state_save_register_item("LANGSEL", 0, apple2gs_langsel);
1799   state_save_register_item("SLTROMSEL", 0, apple2gs_sltromsel);
1800   state_save_register_item("CYAREG", 0, apple2gs_cyareg);
1801   state_save_register_item("INTEN", 0, apple2gs_inten);
1802   state_save_register_item("INTFLAG", 0, apple2gs_intflag);
1803   state_save_register_item("SHADOW", 0, apple2gs_shadow);
1804   state_save_register_item("PENDIRQ", 0, apple2gs_pending_irqs);
1805   state_save_register_item("MX", 0, apple2gs_mouse_x);
1806   state_save_register_item("MY", 0, apple2gs_mouse_y);
1807   state_save_register_item("MDX", 0, apple2gs_mouse_dx);
1808   state_save_register_item("MDY", 0, apple2gs_mouse_dy);
1798   state_save_register_item("VGCINT", NULL,0, apple2gs_vgcint);
1799   state_save_register_item("LANGSEL", NULL,0, apple2gs_langsel);
1800   state_save_register_item("SLTROMSEL", NULL,0, apple2gs_sltromsel);
1801   state_save_register_item("CYAREG", NULL,0, apple2gs_cyareg);
1802   state_save_register_item("INTEN", NULL,0, apple2gs_inten);
1803   state_save_register_item("INTFLAG", NULL,0, apple2gs_intflag);
1804   state_save_register_item("SHADOW", NULL,0, apple2gs_shadow);
1805   state_save_register_item("PENDIRQ", NULL,0, apple2gs_pending_irqs);
1806   state_save_register_item("MX", NULL,0, apple2gs_mouse_x);
1807   state_save_register_item("MY", NULL,0, apple2gs_mouse_y);
1808   state_save_register_item("MDX", NULL,0, apple2gs_mouse_dx);
1809   state_save_register_item("MDY", NULL,0, apple2gs_mouse_dy);
18091810
1810   state_save_register_item("CLKDATA", 0, clock_data);
1811   state_save_register_item("CLKCTRL", 0, clock_control);
1812   state_save_register_item("CLKRD", 0, clock_read);
1813   state_save_register_item("CLKREG1", 0, clock_reg1);
1814   state_save_register_item("CLKCURTIME", 0, clock_curtime);
1815   state_save_register_item("CLKCURTIMEINT", 0, clock_curtime_interval);
1816   state_save_register_item("CLKMODE", 0, clock_mode);
1811   state_save_register_item("CLKDATA", NULL,0, clock_data);
1812   state_save_register_item("CLKCTRL", NULL,0, clock_control);
1813   state_save_register_item("CLKRD", NULL,0, clock_read);
1814   state_save_register_item("CLKREG1", NULL,0, clock_reg1);
1815   state_save_register_item("CLKCURTIME", NULL,0, clock_curtime);
1816   state_save_register_item("CLKCURTIMEINT", NULL,0, clock_curtime_interval);
1817   state_save_register_item("CLKMODE", NULL,0, clock_mode);
18171818   state_save_register_global_array(clock_bram);
18181819
18191820   state_save_register_global_array(adb_memory);
18201821   state_save_register_global_array(adb_command_bytes);
18211822   state_save_register_global_array(adb_response_bytes);
1822   state_save_register_item("ADB", 0, adb_state);
1823   state_save_register_item("ADB", 0, adb_command);
1824   state_save_register_item("ADB", 0, adb_mode);
1825   state_save_register_item("ADB", 0, adb_kmstatus);
1826   state_save_register_item("ADB", 0, adb_latent_result);
1827   state_save_register_item("ADB", 0, adb_command_length);
1828   state_save_register_item("ADB", 0, adb_command_pos);
1829   state_save_register_item("ADB", 0, adb_response_length);
1830   state_save_register_item("ADB", 0, adb_response_pos);
1831   state_save_register_item("ADB", 0, adb_address_keyboard);
1832   state_save_register_item("ADB", 0, adb_address_mouse);
1823   state_save_register_item("ADB", NULL,0, adb_state);
1824   state_save_register_item("ADB", NULL,0, adb_command);
1825   state_save_register_item("ADB", NULL,0, adb_mode);
1826   state_save_register_item("ADB", NULL,0, adb_kmstatus);
1827   state_save_register_item("ADB", NULL,0, adb_latent_result);
1828   state_save_register_item("ADB", NULL,0, adb_command_length);
1829   state_save_register_item("ADB", NULL,0, adb_command_pos);
1830   state_save_register_item("ADB", NULL,0, adb_response_length);
1831   state_save_register_item("ADB", NULL,0, adb_response_pos);
1832   state_save_register_item("ADB", NULL,0, adb_address_keyboard);
1833   state_save_register_item("ADB", NULL,0, adb_address_mouse);
18331834
1834   state_save_register_item("SNDGLUCTRL", 0, sndglu_ctrl);
1835   state_save_register_item("SNDGLUADDR", 0, sndglu_addr);
1836   state_save_register_item("SNDGLUDUMMYRD", 0, sndglu_dummy_read);
1835   state_save_register_item("SNDGLUCTRL", NULL,0, sndglu_ctrl);
1836   state_save_register_item("SNDGLUADDR", NULL,0, sndglu_addr);
1837   state_save_register_item("SNDGLUDUMMYRD", NULL,0, sndglu_dummy_read);
18371838}
src/mess/machine/mac.c
r3635r3636
114114static WRITE8_HANDLER(mac_adb_via_out_cb2);
115115static WRITE8_HANDLER(mac_via_out_cb2);
116116static void mac_via_irq(running_machine *machine, int state);
117static offs_t mac_dasm_override(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
117static offs_t mac_dasm_override(const device_config *device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
118118
119119static const struct via6522_interface mac_via6522_intf =
120120{
r3635r3636
182182static void mac_install_memory(running_machine *machine, offs_t memory_begin, offs_t memory_end,
183183   offs_t memory_size, void *memory_data, int is_rom, int bank)
184184{
185   const address_space* space = cpu_get_address_space(machine->cpu[0],ADDRESS_SPACE_PROGRAM);
185186   offs_t memory_mask;
186   read16_machine_func rh;
187   write16_machine_func wh;
187   read16_space_func rh;
188   write16_space_func wh;
188189
189190   memory_size = MIN(memory_size, (memory_end + 1 - memory_begin));
190191   memory_mask = memory_size - 1;
191192
192   rh = (read16_machine_func) (FPTR)bank;
193   wh = is_rom ? SMH_UNMAP : (write16_machine_func) (FPTR)bank;
193   rh = (read16_space_func) (FPTR)bank;
194   wh = is_rom ? SMH_UNMAP : (write16_space_func) (FPTR)bank;
194195
195   memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, memory_begin,
196   memory_install_read16_handler(space, memory_begin,
196197      memory_end, memory_mask, 0, rh);
197   memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, memory_begin,
198   memory_install_write16_handler(space, memory_begin,
198199      memory_end, memory_mask, 0, wh);
199200
200   memory_set_bankptr(bank, memory_data);
201   memory_set_bankptr(machine,bank, memory_data);
201202
202203   if (LOG_MEMORY)
203204   {
r3635r3636
783784      reg = R5380_CURDATA_DTACK;
784785   }
785786
786   return ncr5380_r(machine, reg)<<8;
787   return ncr5380_r(space, reg)<<8;
787788}
788789
789790WRITE16_HANDLER ( macplus_scsi_w )
r3635r3636
795796      reg = R5380_OUTDATA_DTACK;
796797   }
797798
798   ncr5380_w(machine, reg, data);
799   ncr5380_w(space, reg, data);
799800}
800801
801802static void mac_scsi_irq(running_machine *machine, int state)
r3635r3636
850851
851852READ16_HANDLER ( mac_scc_r )
852853{
853   const device_config *scc = device_list_find_by_tag(machine->config->devicelist, SCC8530, "scc");
854   const device_config *scc = device_list_find_by_tag(space->machine->config->devicelist, SCC8530, "scc");
854855   UINT16 result;
855856
856857   result = scc_r(scc, offset);
r3635r3636
861862
862863WRITE16_HANDLER ( mac_scc_w )
863864{
864   const device_config *scc = device_list_find_by_tag(machine->config->devicelist, SCC8530, "scc");
865   const device_config *scc = device_list_find_by_tag(space->machine->config->devicelist, SCC8530, "scc");
865866   scc_w(scc, offset, (UINT8) data);
866867}
867868
r3635r3636
12171218    */
12181219
12191220   UINT16 result = 0;
1220   const device_config *fdc = device_list_find_by_tag(machine->config->devicelist,
1221   const device_config *fdc = device_list_find_by_tag(space->machine->config->devicelist,
12211222      IWM,
12221223      "fdc");
12231224
r3635r3636
12301231
12311232WRITE16_HANDLER ( mac_iwm_w )
12321233{
1233   const device_config *fdc = device_list_find_by_tag(machine->config->devicelist,
1234   const device_config *fdc = device_list_find_by_tag(space->machine->config->devicelist,
12341235      IWM,
12351236      "fdc");
12361237
r3635r3636
15421543   int val = 0;
15431544
15441545   /* video beam in display (! VBLANK && ! HBLANK basically) */
1545   if (video_screen_get_vpos(machine->primary_screen) >= MAC_V_VIS)
1546   if (video_screen_get_vpos(space->machine->primary_screen) >= MAC_V_VIS)
15461547      val |= 0x40;
15471548
15481549   if (has_adb())
r3635r3636
15601561         val |= 0x20;
15611562      if (mouse_bit_x)   /* Mouse X2 */
15621563         val |= 0x10;
1563      if ((input_port_read(machine, "MOUSE0") & 0x01) == 0)
1564      if ((input_port_read(space->machine, "MOUSE0") & 0x01) == 0)
15641565         val |= 0x08;
15651566   }
15661567   if (rtc_data_out)
r3635r3636
15891590    * possibly later models), overlay was set on reset, but cleared on the
15901591    * first access to the ROM. */
15911592   if (mac_model < MODEL_MAC_SE)
1592      set_memory_overlay(machine, (data & 0x10) >> 4);
1593      set_memory_overlay(space->machine, (data & 0x10) >> 4);
15931594}
15941595
15951596static WRITE8_HANDLER(mac_via_out_b)
r3635r3636
16321633
16331634   if (LOG_VIA)
16341635      logerror("mac_via_r: offset=0x%02x\n", offset);
1635   data = via_0_r(machine, offset);
1636   data = via_0_r(space, offset);
16361637
16371638   return (data & 0xff) | (data << 8);
16381639}
r3635r3636
16461647      logerror("mac_via_w: offset=0x%02x data=0x%08x\n", offset, data);
16471648
16481649   if (ACCESSING_BITS_8_15)
1649      via_0_w(machine, offset, (data >> 8) & 0xff);
1650      via_0_w(space, offset, (data >> 8) & 0xff);
16501651}
16511652
16521653
r3635r3636
17121713   {
17131714      if ((address >= 0x400000) && (address <= 0x4fffff))
17141715      {
1715         set_memory_overlay(machine, 0);      // kill the overlay
1716         set_memory_overlay(space->machine, 0);      // kill the overlay
17161717         mac_overlay = -1;
17171718      }
17181719   }
r3635r3636
17401741      // classic will fail RAM test and try to boot appletalk if RAM is not all zero
17411742      memset(mess_ram, 0, mess_ram_size);
17421743
1743      memory_set_direct_update_handler(0, overlay_opbaseoverride);
1744      memory_set_direct_update_handler(cpu_get_address_space(machine->cpu[0],ADDRESS_SPACE_PROGRAM), overlay_opbaseoverride);
17441745      mac_overlay = 1;
17451746   }
17461747
r3635r3636
17601761
17611762   inquiry_timeout = timer_alloc(inquiry_timeout_func, NULL);
17621763
1763   cpuintrf_set_dasm_override(0, mac_dasm_override);
1764   cpu_set_dasm_override(machine->cpu[0], mac_dasm_override);
17641765
17651766   /* save state stuff */
17661767   state_save_register_global(mac_overlay);
r3635r3636
18631864{
18641865   int scanline;
18651866
1866   cpuintrf_push_context(0);
1867   cpu_push_context(machine->cpu[0]);
18671868
18681869   mac_sh_updatebuffer();
18691870
r3635r3636
18771878
18781879   timer_adjust_oneshot(mac_scanline_timer, video_screen_get_time_until_pos(machine->primary_screen, (scanline+1) % MAC_V_TOTAL, 0), 0);
18791880
1880   cpuintrf_pop_context();
1881   cpu_pop_context();
18811882}
18821883
18831884
r3635r3636
27082709
27092710
27102711
2711static offs_t mac_dasm_override(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram)
2712static offs_t mac_dasm_override(const device_config *device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram)
27122713{
27132714   UINT16 opcode;
27142715   unsigned result = 0;
src/mess/machine/lisa.c
r3635r3636
222222
223223   /*if (RSIR)
224224      // serial interrupt
225      cpunum_set_input_line_and_vector(machine, 0, M68K_IRQ_6, ASSERT_LINE, M68K_INT_ACK_AUTOVECTOR);
225      cpu_set_input_line_and_vector(machine->cpu[0], M68K_IRQ_6, ASSERT_LINE, M68K_INT_ACK_AUTOVECTOR);
226226   else if (int0)
227227      // external interrupt
228      cpunum_set_input_line_and_vector(machine, 0, M68K_IRQ_5, ASSERT_LINE, M68K_INT_ACK_AUTOVECTOR);
228      cpu_set_input_line_and_vector(machine->cpu[0], M68K_IRQ_5, ASSERT_LINE, M68K_INT_ACK_AUTOVECTOR);
229229   else if (int1)
230230      // external interrupt
231      cpunum_set_input_line_and_vector(machine, 0, M68K_IRQ_4, ASSERT_LINE, M68K_INT_ACK_AUTOVECTOR);
231      cpu_set_input_line_and_vector(machine->cpu[0], M68K_IRQ_4, ASSERT_LINE, M68K_INT_ACK_AUTOVECTOR);
232232   else if (int2)
233233      // external interrupt
234      cpunum_set_input_line_and_vector(machine, 0, M68K_IRQ_3, ASSERT_LINE, M68K_INT_ACK_AUTOVECTOR);
234      cpu_set_input_line_and_vector(machine->cpu[0], M68K_IRQ_3, ASSERT_LINE, M68K_INT_ACK_AUTOVECTOR);
235235   else*/ if (KBIR)
236236      /* COPS VIA interrupt */
237      cpunum_set_input_line_and_vector(machine, 0, M68K_IRQ_2, ASSERT_LINE, M68K_INT_ACK_AUTOVECTOR);
237      cpu_set_input_line_and_vector(machine->cpu[0], M68K_IRQ_2, ASSERT_LINE, M68K_INT_ACK_AUTOVECTOR);
238238   else if (FDIR || VTIR)
239239      /* floppy disk or VBl */
240      cpunum_set_input_line_and_vector(machine, 0, M68K_IRQ_1, ASSERT_LINE, M68K_INT_ACK_AUTOVECTOR);
240      cpu_set_input_line_and_vector(machine->cpu[0], M68K_IRQ_1, ASSERT_LINE, M68K_INT_ACK_AUTOVECTOR);
241241   else
242242      /* clear all interrupts */
243      cpunum_set_input_line_and_vector(machine, 0, M68K_IRQ_1, CLEAR_LINE, M68K_INT_ACK_AUTOVECTOR);
243      cpu_set_input_line_and_vector(machine->cpu[0], M68K_IRQ_1, CLEAR_LINE, M68K_INT_ACK_AUTOVECTOR);
244244}
245245
246246static void set_parity_error_pending(running_machine *machine, int value)
r3635r3636
250250   parity_error_pending = value;
251251   if (parity_error_pending)
252252   {
253      cpunum_set_input_line_and_vector(machine, 0, M68K_IRQ_7, ASSERT_LINE, M68K_INT_ACK_AUTOVECTOR);
253      cpu_set_input_line_and_vector(machine->cpu[0], M68K_IRQ_7, ASSERT_LINE, M68K_INT_ACK_AUTOVECTOR);
254254   }
255255   else
256256   {
r3635r3636
261261   if ((! parity_error_pending) && value)
262262   {
263263      parity_error_pending = 1;
264      cpunum_set_input_line_and_vector(machine, 0, M68K_IRQ_7, PULSE_LINE, M68K_INT_ACK_AUTOVECTOR);
264      cpu_set_input_line_and_vector(machine->cpu[0], M68K_IRQ_7, PULSE_LINE, M68K_INT_ACK_AUTOVECTOR);
265265   }
266266   else if (parity_error_pending && (! value))
267267   {
r3635r3636
781781   /*logerror("COPS CA2 line state : %d\n", val);*/
782782
783783   /*logerror("COPS_via_out_ca2 : trying to send data to VIA\n");*/
784   COPS_send_data_if_possible(machine);
784   COPS_send_data_if_possible(space->machine);
785785}
786786
787787/*
r3635r3636
814814static WRITE8_HANDLER(COPS_via_out_b)
815815{
816816   /* pull-up */
817   data |= (~ via_read(machine, 0, VIA_DDRA)) & 0x01;
817   data |= (~ via_read(space->machine, 0, VIA_DDRA)) & 0x01;
818818
819819   if (data & 0x01)
820820   {
821821      if (COPS_force_unplug)
822822      {
823823         COPS_force_unplug = 0;
824         plug_keyboard(machine);
824         plug_keyboard(space->machine);
825825      }
826826   }
827827   else
r3635r3636
829829      if (! COPS_force_unplug)
830830      {
831831         COPS_force_unplug = 1;
832         unplug_keyboard(machine);
832         unplug_keyboard(space->machine);
833833         //reset_COPS();
834834      }
835835   }
r3635r3636
949949         }
950950         else
951951         {   /* system ROMs */
952            opbase->mask = 0xffffff;
952            direct->mask = 0xffffff;
953953            direct->raw = direct->decrypted = lisa_rom_ptr - (address & 0xffc000);
954            opbase->mem_min = (address & 0xffc000);
955            opbase->mem_max = (address & 0xffc000) + 0x003fff;
954            direct->min = (address & 0xffc000);
955            direct->max = (address & 0xffc000) + 0x003fff;
956956            /*logerror("ROM (setup mode)\n");*/
957957         }
958958
r3635r3636
961961
962962   }
963963
964   if (cpunum_get_reg(0, M68K_SR) & 0x2000)
964   if (cpu_get_reg(space->machine->cpu[0], M68K_SR) & 0x2000)
965965      /* supervisor mode -> force register file 0 */
966966      the_seg = 0;
967967
r3635r3636
981981            /* out of segment limits : bus error */
982982            logerror("illegal opbase address%lX\n", (long) address);
983983         }
984         opbase->mask = 0xffffff;
984         direct->mask = 0xffffff;
985985         direct->raw = direct->decrypted = lisa_ram_ptr + mapped_address - address;
986         opbase->mem_min = (address & 0xffc000);
987         opbase->mem_max = (address & 0xffc000) + 0x003fff;
986         direct->min = (address & 0xffc000);
987         direct->max = (address & 0xffc000) + 0x003fff;
988988         /*logerror("RAM\n");*/
989989         break;
990990
r3635r3636
997997         break;
998998
999999      case special_IO:
1000         opbase->mask = 0xffffff;
1000         direct->mask = 0xffffff;
10011001         direct->raw = direct->decrypted = lisa_rom_ptr + (mapped_address & 0x003fff) - address;
1002         opbase->mem_min = (address & 0xffc000);
1003         opbase->mem_max = (address & 0xffc000) + 0x003fff;
1002         direct->min = (address & 0xffc000);
1003         direct->max = (address & 0xffc000) + 0x003fff;
10041004         /*logerror("ROM\n");*/
10051005         break;
10061006      }
r3635r3636
11251125
11261126   videoROM_ptr = memory_region(machine, "gfx1");
11271127
1128   memory_set_direct_update_handler(0, lisa_OPbaseoverride);
1129   memory_set_direct_update_handler(1, lisa_fdc_OPbaseoverride);
1128   memory_set_direct_update_handler(cpu_get_address_space(machine->cpu[0],ADDRESS_SPACE_PROGRAM), lisa_OPbaseoverride);
1129   memory_set_direct_update_handler(cpu_get_address_space(machine->cpu[1],ADDRESS_SPACE_PROGRAM), lisa_fdc_OPbaseoverride);
11301130
1131   cpunum_set_info_fct(0, CPUINFO_PTR_M68K_RESET_CALLBACK, (genf *)/*lisa_reset_instr_callback*/NULL);
1131   cpu_set_info_fct(machine->cpu[0], CPUINFO_PTR_M68K_RESET_CALLBACK, (genf *)/*lisa_reset_instr_callback*/NULL);
11321132
11331133   /* init MMU */
11341134
r3635r3636
11631163   via_set_clock(1, lisa_features.has_fast_timers ? 1250000 : 500000);   /* one of these values must be wrong : see note after description of the has_fast_timers field */
11641164
11651165   via_reset();
1166   COPS_via_out_ca2(machine, 0, 0);   /* VIA core forgets to do so */
1166   COPS_via_out_ca2(cpu_get_address_space(machine->cpu[0],ADDRESS_SPACE_PROGRAM), 0, 0);   /* VIA core forgets to do so */
11671167
11681168   /* initialize floppy */
11691169   {
r3635r3636
11961196                     0x80,   /* RESET code */
11971197                     0xFC   /* timer time-out */
11981198                  };
1199                  COPS_queue_data(machine, cmd, 2);
1199                  COPS_queue_data(device->machine, cmd, 2);
12001200
12011201                  clock_regs.alarm = 0xfffffL;
12021202               }
r3635r3636
12631263
12641264   /* set VBI */
12651265   if (VTMSK)
1266      set_VTIR(machine, 1);
1266      set_VTIR(device->machine, 1);
12671267   else
1268      set_VTIR(machine, 0);
1268      set_VTIR(device->machine, 0);
12691269   
12701270   /* do keyboard scan */
1271   scan_keyboard(machine);
1271   scan_keyboard(device->machine);
12721272}
12731273
12741274/*
r3635r3636
13341334READ8_HANDLER ( lisa_fdc_io_r )
13351335{
13361336   int answer=0;
1337   const device_config *fdc = device_list_find_by_tag(machine->config->devicelist,
1337   const device_config *fdc = device_list_find_by_tag(space->machine->config->devicelist,
13381338      IWM,
13391339      "fdc");
13401340
r3635r3636
13451345      break;
13461346
13471347   case 1:   /* TTL glue */
1348      lisa_fdc_ttl_glue_access(machine, offset);
1348      lisa_fdc_ttl_glue_access(space->machine, offset);
13491349      answer = 0;   /* ??? */
13501350      break;
13511351
r3635r3636
13631363
13641364WRITE8_HANDLER ( lisa_fdc_io_w )
13651365{
1366   const device_config *fdc = device_list_find_by_tag(machine->config->devicelist,
1366   const device_config *fdc = device_list_find_by_tag(space->machine->config->devicelist,
13671367      IWM,
13681368      "fdc");
13691369
r3635r3636
13741374      break;
13751375
13761376   case 1:   /* TTL glue */
1377      lisa_fdc_ttl_glue_access(machine, offset);
1377      lisa_fdc_ttl_glue_access(space->machine, offset);
13781378      break;
13791379
13801380   case 2:   /* writes the PWM register */
r3635r3636
13981398         if (! (offset & 0x0400))
13991399            return lisa_fdc_ram[offset & 0x03ff];
14001400         else
1401            return lisa_fdc_io_r(machine, offset & 0x03ff);
1401            return lisa_fdc_io_r(space, offset & 0x03ff);
14021402      else
14031403         return 0;   /* ??? */
14041404   }
r3635r3636
14141414         if (! (offset & 0x0800))
14151415            return lisa_fdc_ram[offset & 0x03ff];
14161416         else
1417            return lisa_fdc_io_r(machine, offset & 0x03ff);
1417            return lisa_fdc_io_r(space, offset & 0x03ff);
14181418      else
14191419         return 0;   /* ??? */
14201420   }
r3635r3636
14311431         if (! (offset & 0x0400))
14321432            lisa_fdc_ram[offset & 0x03ff] = data;
14331433         else
1434            lisa_fdc_io_w(machine, offset & 0x03ff, data);
1434            lisa_fdc_io_w(space, offset & 0x03ff, data);
14351435      }
14361436   }
14371437}
r3635r3636
14451445         if (! (offset & 0x0800))
14461446            lisa_fdc_ram[offset & 0x03ff] = data;
14471447         else
1448            lisa_fdc_io_w(machine, offset & 0x03ff, data);
1448            lisa_fdc_io_w(space, offset & 0x03ff, data);
14491449      }
14501450   }
14511451}
r3635r3636
14961496      }
14971497   }
14981498
1499   if (cpunum_get_reg(0, M68K_SR) & 0x2000)
1499   if (cpu_get_reg(space->machine->cpu[0], M68K_SR) & 0x2000)
15001500      /* supervisor mode -> force register file 0 */
15011501      the_seg = 0;
15021502
r3635r3636
15261526               && (bad_parity_table[address >> 3] & (0x3 << (address & 0x7))))
15271527         {
15281528            mem_err_addr_latch = address >> 5;
1529            set_parity_error_pending(machine, 1);
1529            set_parity_error_pending(space->machine, 1);
15301530         }
15311531         break;
15321532
r3635r3636
15431543               && (bad_parity_table[address >> 3] & (0x3 << (address & 0x7))))
15441544         {
15451545            mem_err_addr_latch = address >> 5;
1546            set_parity_error_pending(machine, 1);
1546            set_parity_error_pending(space->machine, 1);
15471547         }
15481548         break;
15491549
15501550      case IO:
1551         answer = lisa_IO_r(machine, (address & 0x00ffff) >> 1, mem_mask);
1551         answer = lisa_IO_r(space, (address & 0x00ffff) >> 1, mem_mask);
15521552         break;
15531553
15541554      case invalid:      /* unmapped segment */
r3635r3636
15681568            /* problem : due to collisions with video, timings of the LISA CPU
15691569            are slightly different from timings of a bare 68k */
15701570            /* so we use a kludge... */
1571            int time_in_frame = video_screen_get_vpos(machine->primary_screen);
1571            int time_in_frame = video_screen_get_vpos(space->machine->primary_screen);
15721572            static int videoROM_address = 0;
15731573
15741574            /* the BOOT ROM only reads 56 bits, so there must be some wrap-around for
r3635r3636
15961596               if ((time_in_frame >= 364) && (time_in_frame <= 375))
15971597               {
15981598                  answer = videoROM_ptr[videoROM_address|0x80] << 8;
1599              logerror("reading1 %06X=%04x PC=%06x time=%d\n", address, answer,safe_activecpu_get_pc(),time_in_frame);
1599              logerror("reading1 %06X=%04x PC=%06x time=%d\n", address, answer,safe_cpu_get_pc(space->machine->cpu[0]),time_in_frame);
16001600               }
16011601               else
16021602               {
16031603                  answer = videoROM_ptr[videoROM_address] << 8;
1604              logerror("reading2 %06X=%04x PC=%06x time=%d\n", address, answer,safe_activecpu_get_pc(),time_in_frame);
1604              logerror("reading2 %06X=%04x PC=%06x time=%d\n", address, answer,safe_cpu_get_pc(space->machine->cpu[0]),time_in_frame);
16051605               }
16061606            }
16071607
r3635r3636
16991699      }
17001700   }
17011701
1702   if (cpunum_get_reg(0, M68K_SR) & 0x2000)
1702   if (cpu_get_reg(space->machine->cpu[0], M68K_SR) & 0x2000)
17031703      /* supervisor mode -> force register file 0 */
17041704      the_seg = 0;
17051705
r3635r3636
17921792         break;
17931793
17941794      case IO:
1795         lisa_IO_w(machine, (address & 0x00ffff) >> 1, data, mem_mask);
1795         lisa_IO_w(space, (address & 0x00ffff) >> 1, data, mem_mask);
17961796         break;
17971797
17981798      case RAM_stack_r:   /* read-only */
r3635r3636
18611861      seg &= ~2;
18621862      break;
18631863   case 0x0010:   /* SETUP register SET */
1864       logerror("setup SET PC=%x\n", safe_activecpu_get_pc());
1864       logerror("setup SET PC=%x\n", safe_cpu_get_pc(machine->cpu[0]));
18651865      setup = 1;
18661866      break;
18671867   case 0x0012:   /* SETUP register RESET */
1868       logerror("setup UNSET PC=%x\n", safe_activecpu_get_pc());
1868       logerror("setup UNSET PC=%x\n", safe_cpu_get_pc(machine->cpu[0]));
18691869      setup = 0;
18701870      break;
18711871   case 0x001A:   /* Enable Vertical Retrace Interrupt */
1872       logerror("enable retrace PC=%x\n", safe_activecpu_get_pc());
1872       logerror("enable retrace PC=%x\n", safe_cpu_get_pc(machine->cpu[0]));
18731873      VTMSK = 1;
18741874      break;
18751875   case 0x0018:   /* Disable Vertical Retrace Interrupt */
1876       logerror("disable retrace PC=%x\n", safe_activecpu_get_pc());
1876       logerror("disable retrace PC=%x\n", safe_cpu_get_pc(machine->cpu[0]));
18771877      VTMSK = 0;
18781878      set_VTIR(machine, 2);
18791879      break;
r3635r3636
19431943         case 2:   /* parallel port */
19441944            /* 1 VIA located at 0xD901 */
19451945            if (ACCESSING_BITS_0_7)
1946               return via_read(machine, 1, (offset >> 2) & 0xf);
1946               return via_read(space->machine, 1, (offset >> 2) & 0xf);
19471947            break;
19481948
19491949         case 3:   /* keyboard/mouse cops via */
19501950            /* 1 VIA located at 0xDD81 */
19511951            if (ACCESSING_BITS_0_7)
1952               return via_read(machine, 0, offset & 0xf);
1952               return via_read(space->machine, 0, offset & 0xf);
19531953            break;
19541954         }
19551955      }
r3635r3636
19601960      switch ((offset & 0x0C00) >> 10)
19611961      {
19621962      case 0x0:   /* cpu board control */
1963         cpu_board_control_access(machine, offset & 0x03ff);
1963         cpu_board_control_access(space->machine, offset & 0x03ff);
19641964         break;
19651965
19661966      case 0x1:   /* Video Address Latch */
r3635r3636
19781978         if (VTIR<=1)
19791979// GFE : needs to be in phase with Serial NUM
19801980         {
1981            int time_in_frame = video_screen_get_vpos(machine->primary_screen);
1981            int time_in_frame = video_screen_get_vpos(space->machine->primary_screen);
19821982            if (lisa_features.has_mac_xl_video)
19831983            {
19841984               if ((time_in_frame >= 374) && (time_in_frame <= 392))   /* these values have not been tested */
r3635r3636
20072007         else
20082008                  answer |= 0x04;
20092009         /* huh... we need to emulate some other bits */
2010          logerror("read status PC=%x val=%x\n", safe_activecpu_get_pc(),answer);
2010          logerror("read status PC=%x val=%x\n", safe_cpu_get_pc(space->machine->cpu[0]),answer);
20112011
20122012         break;
20132013      }
r3635r3636
20652065
20662066         case 2:   /* paralel port */
20672067            if (ACCESSING_BITS_0_7)
2068               via_write(machine, 1, (offset >> 2) & 0xf, data & 0xff);
2068               via_write(space->machine, 1, (offset >> 2) & 0xf, data & 0xff);
20692069            break;
20702070
20712071         case 3:   /* keyboard/mouse cops via */
20722072            if (ACCESSING_BITS_0_7)
2073               via_write(machine, 0, offset & 0xf, data & 0xff);
2073               via_write(space->machine, 0, offset & 0xf, data & 0xff);
20742074            break;
20752075         }
20762076      }
r3635r3636
20812081      switch ((offset & 0x0C00) >> 10)
20822082      {
20832083      case 0x0:   /* cpu board control */
2084         cpu_board_control_access(machine, offset & 0x03ff);
2084         cpu_board_control_access(space->machine, offset & 0x03ff);
20852085         break;
20862086
20872087      case 0x1:   /* Video Address Latch */
src/mess/machine/apple1.c
r3635r3636
145145
146146DRIVER_INIT( apple1 )
147147{
148   const address_space* space = cpu_get_address_space(machine->cpu[0],ADDRESS_SPACE_PROGRAM);
148149   /* Set up the handlers for MESS's dynamically-sized RAM. */
149   memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM,
150   memory_install_read8_handler(space,
150151                         0x0000, mess_ram_size - 1, 0, 0, SMH_BANK1);
151   memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM,
152   memory_install_write8_handler(space,
152153                          0x0000, mess_ram_size - 1, 0, 0, SMH_BANK1);
153   memory_set_bankptr(1, mess_ram);
154   memory_set_bankptr(machine,1, mess_ram);
154155
155156   pia_config(0, &apple1_pia0);
156157
r3635r3636
262263   for (addr = start_addr, snapptr = snapbuf + SNAP_HEADER_LEN;
263264       addr <= end_addr;
264265       addr++, snapptr++)
265      memory_write_byte(space, addr, *snapptr);
266      memory_write_byte(cpu_get_address_space(image->machine->cpu[0],ADDRESS_SPACE_PROGRAM), addr, *snapptr);
266267
267268   return INIT_PASS;
268269}
r3635r3636
416417      write.  Thus the write delay depends on the cursor position and
417418      where the display is in the refresh cycle. */
418419   if (!data)
419      timer_set(apple1_vh_dsp_time_to_ready(machine), NULL, 0, apple1_dsp_ready_start);
420      timer_set(apple1_vh_dsp_time_to_ready(space->machine), NULL, 0, apple1_dsp_ready_start);
420421}
421422
422423static TIMER_CALLBACK(apple1_dsp_ready_start)
r3635r3636
509510
510511READ8_HANDLER( apple1_cassette_r )
511512{
512   cassette_toggle_output(machine);
513   cassette_toggle_output(space->machine);
513514
514515   if (offset <= 0x7f)
515516   {
r3635r3636
535536      /* (Don't try putting a non-zero "noise threshhold" here,
536537         because it can cause tape header bits on real cassette
537538         images to be misread as data bits.) */
538      if (cassette_input(cassette_device_image(machine)) > 0.0)
539      if (cassette_input(cassette_device_image(space->machine)) > 0.0)
539540         return memory_read_byte(space, 0xc100 + (offset & ~1));
540541      else
541542         return memory_read_byte(space, 0xc100 + offset);
r3635r3636
551552      However, we still have to handle writes, since they may be done
552553      by user code. */
553554
554   cassette_toggle_output(machine);
555   cassette_toggle_output(space->machine);
555556}
src/mess/machine/apple2.c
r3635r3636
101101
102102void apple2_update_memory(running_machine *machine)
103103{
104   const address_space* space = cpu_get_address_space(machine->cpu[0],ADDRESS_SPACE_PROGRAM);
104105   int i, bank, rbank, wbank;
105106   int full_update = 0;
106107   apple2_meminfo meminfo;
107   read8_machine_func rh;
108   write8_machine_func wh;
108   read8_space_func rh;
109   write8_space_func wh;
109110   offs_t begin, end_r, end_w;
110111   UINT8 *rbase, *wbase, *rom, *slot_ram;
111112   UINT32 rom_length, slot_length, offset;
r3635r3636
145146         rbank = (bank_disposition != A2MEM_IO) ? bank : 0;
146147         begin = apple2_mem_config.memmap[i].begin;
147148         end_r = apple2_mem_config.memmap[i].end;
148         rh = (read8_machine_func) (STATIC_BANK1 + (FPTR)(rbank - 1));
149         rh = (read8_space_func) (STATIC_BANK1 + (FPTR)(rbank - 1));
149150
150151         LOG(("apple2_update_memory():  Updating RD {%06X..%06X} [#%02d] --> %08X\n",
151152            begin, end_r, rbank, meminfo.read_mem));
r3635r3636
194195
195196         /* install the actual handlers */
196197         if (begin <= end_r)
197            memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, begin, end_r, 0, 0, rh);
198            memory_install_read8_handler(space, begin, end_r, 0, 0, rh);
198199
199200         /* did we 'go past the end?' */
200201         if (end_r < apple2_mem_config.memmap[i].end)
201            memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, end_r + 1, apple2_mem_config.memmap[i].end, 0, 0, SMH_NOP);
202            memory_install_read8_handler(space, end_r + 1, apple2_mem_config.memmap[i].end, 0, 0, SMH_NOP);
202203
203204         /* set the memory bank */
204205         if (rbase)
205206         {
206            memory_set_bankptr(rbank, rbase);
207            memory_set_bankptr(machine, rbank, rbase);
207208         }
208209
209210         /* record the current settings */
r3635r3636
225226            wbank = 0;
226227         begin = apple2_mem_config.memmap[i].begin;
227228         end_w = apple2_mem_config.memmap[i].end;
228         wh = (write8_machine_func) (STATIC_BANK1 + (FPTR)(wbank - 1));
229         wh = (write8_space_func) (STATIC_BANK1 + (FPTR)(wbank - 1));
229230
230231         LOG(("apple2_update_memory():  Updating WR {%06X..%06X} [#%02d] --> %08X\n",
231232            begin, end_w, wbank, meminfo.write_mem));
r3635r3636
269270
270271         /* install the actual handlers */
271272         if (begin <= end_w)
272            memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, begin, end_w, 0, 0, wh);
273            memory_install_write8_handler(space, begin, end_w, 0, 0, wh);
273274
274275         /* did we 'go past the end?' */
275276         if (end_w < apple2_mem_config.memmap[i].end)
276            memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, end_w + 1, apple2_mem_config.memmap[i].end, 0, 0, SMH_NOP);
277            memory_install_write8_handler(space, end_w + 1, apple2_mem_config.memmap[i].end, 0, 0, SMH_NOP);
277278
278279         /* set the memory bank */
279280         if (wbase)
280281         {
281            memory_set_bankptr(wbank, wbase);
282            memory_set_bankptr(machine, wbank, wbase);
282283         }
283284
284285         /* record the current settings */
r3635r3636
304305
305306READ8_HANDLER(apple2_c0xx_r)
306307{
307   static const read8_machine_func handlers[] =
308   static const read8_space_func handlers[] =
308309   {
309310      apple2_c00x_r,
310311      apple2_c01x_r,
r3635r3636
325326   {
326327      /* normal handler */
327328      if (handlers[offset / 0x10])
328         result = handlers[offset / 0x10](machine, offset % 0x10);
329         result = handlers[offset / 0x10](space, offset % 0x10);
329330   }
330331   else
331332   {
r3635r3636
333334      slotnum = (offset - 0x80) / 0x10;
334335
335336      /* now identify the device */
336      slotdevice = apple2_slot(machine, slotnum);
337      slotdevice = apple2_slot(space->machine, slotnum);
337338
338339      /* and if we can, read from the slot */
339340      if (slotdevice != NULL)
r3635r3636
346347
347348WRITE8_HANDLER(apple2_c0xx_w)
348349{
349   static const write8_machine_func handlers[] =
350   static const write8_space_func handlers[] =
350351   {
351352      apple2_c00x_w,
352353      apple2_c01x_w,
r3635r3636
366367   {
367368      /* normal handler */
368369      if (handlers[offset / 0x10])
369         handlers[offset / 0x10](machine, offset % 0x10, data);
370         handlers[offset / 0x10](space, offset % 0x10, data);
370371   }
371372   else
372373   {
r3635r3636
374375      slotnum = (offset - 0x80) / 0x10;
375376
376377      /* now identify the device */
377      slotdevice = apple2_slot(machine, slotnum);
378      slotdevice = apple2_slot(space->machine, slotnum);
378379
379380      /* and if we can, write to the slot */
380381      if (slotdevice != NULL)
r3635r3636
569570
570571void apple2_setvar(running_machine *machine, UINT32 val, UINT32 mask)
571572{
572   LOG(("apple2_setvar(): val=0x%06x mask=0x%06x pc=0x%04x\n", val, mask, (unsigned int) cpunum_get_reg(0, REG_PC)));
573   LOG(("apple2_setvar(): val=0x%06x mask=0x%06x pc=0x%04x\n", val, mask, (unsigned int) cpu_get_reg(machine->cpu[0], REG_PC)));
573574
574575   assert((val & mask) == val);
575576
r3635r3636
628629
629630   // video scanner data
630631   //
631   i = activecpu_gettotalcycles() % kClocksPerVSync; // cycles into this VSync
632   i = cpu_get_total_cycles(Machine->cpu[0]) % kClocksPerVSync; // cycles into this VSync
632633
633634   // machine state switches
634635   //
r3635r3636
775776
776777   profiler_mark(PROFILER_A2INT);
777778
778   scanline = video_screen_get_vpos(machine->primary_screen);
779   scanline = video_screen_get_vpos(device->machine->primary_screen);
779780
780781   if (scanline > 190)
781782   {
r3635r3636
784785         irq_freq = 1;
785786
786787      if (irq_freq)
787         cpu_set_input_line(machine->cpu[0], M6502_IRQ_LINE, PULSE_LINE);
788         cpu_set_input_line(device->machine->cpu[0], M6502_IRQ_LINE, PULSE_LINE);
788789   }
789790
790   video_screen_update_partial(machine->primary_screen, scanline);
791   video_screen_update_partial(device->machine->primary_screen, scanline);
791792
792793   profiler_mark(PROFILER_END);
793794}
r3635r3636
870871{
871872   UINT32 mask;
872873   mask = 1 << (offset / 2);
873   apple2_setvar(machine, (offset & 1) ? mask : 0, mask);
874   apple2_setvar(space->machine, (offset & 1) ? mask : 0, mask);
874875}
875876
876877
r3635r3636
897898      case 0x06:         result |= (a2 & VAR_ALTZP)      ? 0x80 : 0x00;   break;
898899      case 0x07:         result |= (a2 & VAR_SLOTC3ROM)   ? 0x80 : 0x00;   break;
899900      case 0x08:         result |= (a2 & VAR_80STORE)   ? 0x80 : 0x00;   break;
900      case 0x09:         result |= !video_screen_get_vblank(machine->primary_screen)      ? 0x80 : 0x00;   break;
901      case 0x09:         result |= !video_screen_get_vblank(space->machine->primary_screen)      ? 0x80 : 0x00;   break;
901902      case 0x0A:         result |= (a2 & VAR_TEXT)      ? 0x80 : 0x00;   break;
902903      case 0x0B:         result |= (a2 & VAR_MIXED)      ? 0x80 : 0x00;   break;
903904      case 0x0C:         result |= (a2 & VAR_PAGE2)      ? 0x80 : 0x00;   break;
r3635r3636
932933
933934READ8_HANDLER( apple2_c02x_r )
934935{
935   apple2_c02x_w(machine, offset, 0);
936   apple2_c02x_w(space, offset, 0);
936937   return apple2_getfloatingbusvalue();
937938}
938939
r3635r3636
947948   switch(offset)
948949   {
949950      case 0x08:
950         apple2_setvar(machine, (a2 & VAR_ROMSWITCH) ^ VAR_ROMSWITCH, VAR_ROMSWITCH);
951         apple2_setvar(space->machine, (a2 & VAR_ROMSWITCH) ^ VAR_ROMSWITCH, VAR_ROMSWITCH);
951952         break;
952953   }
953954}
r3635r3636
979980
980981WRITE8_HANDLER ( apple2_c03x_w )
981982{
982   apple2_c03x_r(machine, offset);
983   apple2_c03x_r(space, offset);
983984}
984985
985986
r3635r3636
997998      offset ^= 1;
998999
9991000   mask = 0x100 << (offset / 2);
1000   apple2_setvar(machine, (offset & 1) ? mask : 0, mask);
1001   apple2_setvar(space->machine, (offset & 1) ? mask : 0, mask);
10011002   return apple2_getfloatingbusvalue();
10021003}
10031004
r3635r3636
10091010
10101011WRITE8_HANDLER ( apple2_c05x_w )
10111012{
1012   apple2_c05x_r(machine, offset);
1013   apple2_c05x_r(space, offset);
10131014}
10141015
10151016
r3635r3636
10251026   {
10261027      case 0x01:
10271028         /* Open-Apple/Joystick button 0 */
1028         result = apple2_pressed_specialkey(machine, SPECIALKEY_BUTTON0);
1029         result = apple2_pressed_specialkey(space->machine, SPECIALKEY_BUTTON0);
10291030         break;
10301031      case 0x02:
10311032         /* Closed-Apple/Joystick button 1 */
1032         result = apple2_pressed_specialkey(machine, SPECIALKEY_BUTTON1);
1033         result = apple2_pressed_specialkey(space->machine, SPECIALKEY_BUTTON1);
10331034         break;
10341035      case 0x03:
10351036         /* Joystick button 2. Later revision motherboards connected this to SHIFT also */
1036         result = apple2_pressed_specialkey(machine, SPECIALKEY_BUTTON2);
1037         result = apple2_pressed_specialkey(space->machine, SPECIALKEY_BUTTON2);
10371038         break;
10381039      case 0x04:
10391040         /* X Joystick 1 axis */
r3635r3636
10741075
10751076   if (offset == 0)
10761077   {
1077      joystick_x1_time = attotime_to_double(timer_get_time()) + x_calibration * input_port_read(machine, "joystick_1_x");
1078      joystick_y1_time = attotime_to_double(timer_get_time()) + y_calibration * input_port_read(machine, "joystick_1_y");
1079      joystick_x2_time = attotime_to_double(timer_get_time()) + x_calibration * input_port_read(machine, "joystick_2_x");
1080      joystick_y2_time = attotime_to_double(timer_get_time()) + y_calibration * input_port_read(machine, "joystick_2_y");
1078      joystick_x1_time = attotime_to_double(timer_get_time()) + x_calibration * input_port_read(space->machine, "joystick_1_x");
1079      joystick_y1_time = attotime_to_double(timer_get_time()) + y_calibration * input_port_read(space->machine, "joystick_1_y");
1080      joystick_x2_time = attotime_to_double(timer_get_time()) + x_calibration * input_port_read(space->machine, "joystick_2_x");
1081      joystick_y2_time = attotime_to_double(timer_get_time()) + y_calibration * input_port_read(space->machine, "joystick_2_y");
10811082   }
10821083   return 0;
10831084}
r3635r3636
10901091
10911092WRITE8_HANDLER ( apple2_c07x_w )
10921093{
1093   apple2_c07x_r(machine, offset);
1094   apple2_c07x_r(space, offset);
10941095}
10951096
10961097
src/mess/mess.mak
r3635r3636
374374   $(MESSOBJ)/amstrad.a \
375375   $(MESSOBJ)/apexc.a \
376376   $(MESSOBJ)/apf.a \
377   $(MESSOBJ)/apple.a \
377378   $(MESSOBJ)/aquarius.a \
378379   $(MESSOBJ)/ascii.a \
379380   $(MESSOBJ)/b2m.a \
r3635r3636
419420   $(MESSOBJ)/shared.a \
420421   $(MESSOBJ)/vtech.a \
421422
422#   $(MESSOBJ)/apple.a \
423423#   $(MESSOBJ)/arcadia.a \
424424#   $(MESSOBJ)/at.a \
425425#   $(MESSOBJ)/atari.a \
src/mess/devices/sonydriv.c
r3635r3636
264264   if (LOG_SONY_EXTRA)
265265   {
266266      logerror("sony_status(): action=%d pc=0x%08x%s\n",
267         action, (int) activecpu_get_pc(), sony_floppy_enable ? "" : " (no drive enabled)");
267         action, (int) cpu_get_pc(Machine->cpu[0]), sony_floppy_enable ? "" : " (no drive enabled)");
268268   }
269269
270270   if ((! sony_enable2()) && sony_floppy_enable)
r3635r3636
319319            result = floppy_get_heads_per_disk(flopimg_get_image(cur_image)) - 1;
320320         break;
321321      case 0x0a:   /* At track 0: 0=track zero 1=not track zero */
322         logerror("sony_status(): reading Track 0 pc=0x%08x\n", (int) activecpu_get_pc());
322         logerror("sony_status(): reading Track 0 pc=0x%08x\n", (int) cpu_get_pc(Machine->cpu[0]));
323323         if (cur_image)
324324            result = floppy_drive_get_flag_state(cur_image, FLOPPY_DRIVE_HEAD_AT_TRACK_0) ? 0 : 1;
325325         else
r3635r3636
375375   if (LOG_SONY)
376376   {
377377      logerror("sony_doaction(): action=%d pc=0x%08x%s\n",
378         action, (int) activecpu_get_pc(), (sony_floppy_enable) ? "" : " (MOTOR OFF)");
378         action, (int) cpu_get_pc(Machine->cpu[0]), (sony_floppy_enable) ? "" : " (MOTOR OFF)");
379379   }
380380
381381   if (sony_floppy_enable)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team