Previous 15994 Revisions Next

r9316 Monday 4th October, 2010 at 23:06:40 UTC by R. Belmont
[MAC] Fixed IIcx booting, fixed IIci 256 color mode, more PMU improvements.
[docs]messnew.txt
[src/mess/drivers]mac.c
[src/mess/machine]mac.c

src/mess/machine/mac.c
r9315r9316
23422342   timer_adjust_oneshot(mac->pmu_send_timer, attotime_make(0, ATTOSECONDS_IN_USEC(200)), 0);
23432343}
23442344
2345// 900c74, 901ba4, 901bd8
23462345static void pmu_exec(mac_state *mac)
23472346{
23482347   mac->pm_sptr = 0;   // clear send pointer
r9315r9316
23632362            {
23642363               mac->rtc_ram[mac->pm_cmd[2] + i] = mac->pm_cmd[4+i];
23652364            }
2365         }
2366         break;
23662367
2367            // no reply?
2368      case 0x39:   // read first 20 bytes of PRAM
2369         {
2370            int i;
2371
2372            mac->pm_out[0] = 20;
2373            for (i = 0; i < 20; i++)
2374            {
2375               mac->pm_out[1 + i] = mac->rtc_ram[i];
2376            }
2377            mac->pm_slen = 21;
2378            timer_adjust_oneshot(mac->pmu_send_timer, attotime_make(0, ATTOSECONDS_IN_USEC(200)), 0);
23682379         }
2380         break;
23692381
23702382      case 0x3a:   // read extended PRAM byte(s).  cmd[2] = address, cmd[3] = length
23712383         if ((mac->pm_cmd[2] + mac->pm_cmd[3]) < 0x100)
r9315r9316
23822394         }
23832395         break;
23842396
2397      case 0x68:   // read battery/charger level
2398         pmu_one_byte_reply(mac, 1);
2399         break;
2400
23852401      case 0x78:   // read interrupt flag
23862402         pmu_one_byte_reply(mac, 0);
23872403         break;
r9315r9316
25392555      case MODEL_MAC_PORTABLE:
25402556      case MODEL_MAC_PB100:
25412557         #if LOG_ADB
2542         printf("Read PM data %x\n", mac->pm_data_recv);
2558//         printf("Read PM data %x\n", mac->pm_data_recv);
25432559         #endif
25442560         return mac->pm_data_recv;
25452561
r9315r9316
25862602   if (mac->mac_model >= MODEL_MAC_PORTABLE && mac->mac_model <= MODEL_MAC_PB100)
25872603   {
25882604//      printf("Read VIA B: PM_ACK %x\n", mac->pm_ack);
2589      val = 0x80 | mac->pm_ack;   // SCC wait/request
2605      val = 0x80 | 0x04 | mac->pm_ack;   // SCC wait/request (bit 2 must be set at 900c1a or startup tests always fail)
25902606   }
25912607   else
25922608   {
r9315r9316
26372653   if (mac->mac_model >= MODEL_MAC_PORTABLE && mac->mac_model <= MODEL_MAC_PB100)
26382654   {
26392655      #if LOG_ADB
2640      printf("%02x to PM\n", data);
2656//      printf("%02x to PM\n", data);
26412657      #endif
26422658      mac->pm_data_send = data;
26432659      return;
r9315r9316
27042720            }
27052721         }
27062722      }
2707      if (!(data & 1) && (mac->pm_req & 1))
2723      else if (!(data & 1) && (mac->pm_req & 1))
27082724      {
27092725         if (mac->pm_state == 0)
27102726         {
r9315r9316
27202736            mac->pm_slen--;
27212737            mac->pm_ack |= 2;   // raise ACK to indicate available byte
27222738            #if LOG_ADB
2723            printf("PM: sending byte %02x\n", mac->pm_data_recv);
2739            printf("PM: 68k asserted /REQ, sending byte %02x\n", mac->pm_data_recv);
27242740            #endif
27252741
27262742            // another byte to send?
r9315r9316
27312747            else
27322748            {
27332749               mac->pm_state = 0;   // back to receive state
2750               timer_adjust_oneshot(mac->pmu_send_timer, attotime_never, 0);
27342751            }
27352752         }
27362753      }
2754
27372755      mac->pm_req = data & 1;
27382756      return;
27392757   }
r9315r9316
29823000      adb_reset(mac);
29833001   }
29843002
2985   if (mac->mac_model >= MODEL_MAC_PLUS)
2986   {
2987//      ncr5380_scan_devices(machine->device("ncr5380"));
2988   }
2989
29903003   if ((mac->mac_model == MODEL_MAC_SE) || (mac->mac_model == MODEL_MAC_CLASSIC))
29913004   {
29923005      mac_set_sound_buffer(machine->device("custom"), 1);
r9315r9316
29963009   }
29973010
29983011   scsi_interrupt = 0;
2999   mac->mac_nubus_irq_state = 0xff;
3000   if (machine->device<cpu_device>("maincpu")->debug()) {
3012   if (machine->device<cpu_device>("maincpu")->debug())
3013   {
30013014      machine->device<cpu_device>("maincpu")->debug()->set_dasm_override(mac_dasm_override);
30023015   }
30033016
r9315r9316
30053018   mac->mac_scsiirq_enable = 0;
30063019   mac->mac_via2_vbl = 0;
30073020   mac->mac_se30_vbl_enable = 0;
3008   mac->mac_nubus_irq_state = 0;
3021   mac->mac_nubus_irq_state = 0xff;
30093022   mac->keyboard_reply = 0;
30103023   mac->kbd_comm = 0;
30113024   mac->kbd_receive = 0;
src/mess/drivers/mac.c
r9315r9316
8686   rbv_regs[2] = 0xff;
8787}
8888
89static VIDEO_UPDATE( macrbv )
89// do this here - VIDEO_UPDATE is called each scanline when stepping in the
90// debugger, which means you can't escape the VIA2 IRQ handler
91static INTERRUPT_GEN( mac_rbv_vbl )
9092{
91   UINT32 *scanline;
92   int x, y;
93
9493   rbv_regs[2] &= ~0x40;   // set vblank signal
9594
9695   if ((rbv_regs[0x12] & 0x40) && (rbv_ier & 0x2))
9796   {
9897      rbv_ifr |= 0x82;
99      mac_set_via2_interrupt(screen->machine, 1);
98      mac_set_via2_interrupt(device->machine, 1);
10099   }
100}
101101
102static VIDEO_UPDATE( macrbv )
103{
104   UINT32 *scanline;
105   int x, y;
106
102107   switch (rbv_regs[0x10] & 7)
103108   {
104109      case 0:   // 1bpp
r9315r9316
166171         }
167172      }
168173      break;
174
175      case 3: // 8bpp
176      {
177         UINT8 *vram8 = (UINT8 *)messram_get_ptr(screen->machine->device("messram"));
178         UINT8 pixels;
179         
180         for (y = 0; y < 480; y++)
181         {
182            scanline = BITMAP_ADDR32(bitmap, y, 0);
183
184            for (x = 0; x < 640; x++)
185            {
186               pixels = vram8[(y * 640) + (BYTE4_XOR_BE(x))];
187               *scanline++ = rbv_palette[pixels];
188            }
189         }
190      }
169191   }
170192
171193   return 0;
r9315r9316
256278{
257279   if (offset < 0x100)
258280   {
259//      if ((offset != 3) && (offset != 0x12)) printf("rbv_w: %02x to offset %x (PC=%x)\n", data, offset, cpu_get_pc(space->cpu));
281//      if (offset == 0x10) printf("rbv_w: %02x to offset %x (PC=%x)\n", data, offset, cpu_get_pc(space->cpu));
260282      switch (offset)
261283      {
262284         case 0x03:
r9315r9316
265287            break;
266288
267289         case 0x10:
268            rbv_immed10wr = 1;
290            if (data != 0)
291            {
292               rbv_immed10wr = 1;
293            }
269294            rbv_regs[offset] = data;
270295            break;
271296
r9315r9316
531556   return 0;
532557}
533558
559static READ16_HANDLER(mac_config_r)
560{
561   return 0xffff;   // not sure what this does
562}
563
534564/***************************************************************************
535565    ADDRESS MAPS
536566***************************************************************************/
r9315r9316
559589   AM_RANGE(0xf90000, 0xf9ffff) AM_READWRITE(macplus_scsi_r, macplus_scsi_w)
560590   AM_RANGE(0xfa8000, 0xfaffff) AM_RAM   // VRAM
561591   AM_RANGE(0xfb0000, 0xfbffff) AM_READWRITE8(mac_asc_r, mac_asc_w, 0xffff)
592   AM_RANGE(0xfc0000, 0xfcffff) AM_READ(mac_config_r)
562593   AM_RANGE(0xfd0000, 0xfdffff) AM_READWRITE(mac_scc_r, mac_scc_2_w)
563594   AM_RANGE(0xfffff0, 0xffffff) AM_READWRITE(mac_autovector_r, mac_autovector_w)
564595ADDRESS_MAP_END
r9315r9316
869900
870901   /* internal ram */
871902   MDRV_RAM_ADD("messram")
872   MDRV_RAM_DEFAULT_SIZE("2M")
873   MDRV_RAM_EXTRA_OPTIONS("2M,4M,6M,8M")
903   MDRV_RAM_DEFAULT_SIZE("1M")
904   MDRV_RAM_EXTRA_OPTIONS("1M,3M,5M,7M,9M")
874905
875906MACHINE_CONFIG_END
876907
r9315r9316
10601091
10611092   MDRV_CPU_REPLACE("maincpu", M68030, 25000000)
10621093   MDRV_CPU_PROGRAM_MAP(maciici_map)
1094   MDRV_CPU_VBLANK_INT("screen", mac_rbv_vbl)
10631095
10641096   MDRV_PALETTE_LENGTH(256)
10651097
docs/messnew.txt
r9315r9316
6767
6868- [HECTOR] Added initial support for DISK II unit [JJ Stacino]
6969
70- [MAC] Macintosh IIci now boots, promoted to working [R. Belmont]
71
72- [MAC] Improvements to PMU and Egret MCU emulation. [R. Belmont]
73
7074- [MBEE] Added Chess rom. [Robbbert]
7175
7276- [PSION] Added support for datapack images [Sandro Ronco]

Previous 15994 Revisions Next


© 1998-2018 The MESS Team