Previous 15994 Revisions Next

r6123 Sunday 18th October, 2009 at 03:47:17 UTC by R. Belmont
[MAC] Various minor tweeks plus preliminary boot tone from models with the Apple Sound Chip.
[src/mess/drivers]mac.c
[src/mess/machine]mac.c

src/mess/machine/mac.c
r6122r6123
8787#else
8888#define LOG_VIA         0
8989#define LOG_RTC         0
90#define LOG_MAC_IWM      1
90#define LOG_MAC_IWM     
9191#define LOG_GENERAL      0
9292#define LOG_KEYBOARD   0
9393#define LOG_MEMORY      0
r6122r6123
175175// handle disk enable lines
176176void mac_fdc_set_enable_lines(const device_config *device,int enable_mask)
177177{
178   if (mac_model < MODEL_MAC_SE)
178   if (mac_model != MODEL_MAC_SE)
179179   {
180180      sony_set_enable_lines(device,enable_mask);
181181   }
r6122r6123
875875{
876876   int reg = (offset>>3) & 0xf;
877877
878   logerror("macplus_scsi_w: data %x offset %x mask %x\n", data, offset, mem_mask);
878//   logerror("macplus_scsi_w: data %x offset %x mask %x\n", data, offset, mem_mask);
879879
880880   if ((reg == 0) && (offset == 0x100))
881881   {
r6122r6123
889889{
890890   int reg = (offset>>3) & 0xf;
891891
892//   logerror("macplus_scsi_w: data %x offset %x mask %x\n", data, offset, mem_mask);
892//   logerror("macplus_scsi_w: data %x offset %x mask %x (PC=%x)\n", data, offset, mem_mask, cpu_get_pc(space->cpu));
893893
894894   if ((reg == 0) && (offset == 0x100))
895895   {
src/mess/drivers/mac.c
r6122r6123
4747#include "devices/harddriv.h"
4848#include "formats/ap_dsk35.h"
4949#include "devices/messram.h"
50#include "sound/dmadac.h"
5051
5152UINT32 *se30_vram;
5253
r6122r6123
5960   Verified to be only 8 bits wide by Apple documentation.
6061
6162   Registers:
62   0x800: CONTROL
63   0x801: ENABLE
64   0x802: MODE
63   0x800: VERSION
64   0x801: MODE
65   0x802: CONTROL
66   0x803: FIFO MODE (bit 0 = half, bit 1 = full?)
67   0x804: FIFO IRQ STATUS
68   0x805: WAVETABLE CONTROL
6569   0x806: VOLUME
66   0x807: CHAN
70   0x807: CLOCK RATE (0 = 22 kHz)
71   0x80a: PLAY REC A
6772*/
6873
6974static UINT8 mac_asc_regs[0x2000];
r6122r6123
7277{
7378//   logerror("ASC: Read @ %x (PC %x)\n", offset, cpu_get_pc(cputag_get_cpu(space->machine, "maincpu")));
7479
80   switch (offset)
81   {
82      case 0:   // VERSION
83         return 0;   // original ASC
84         break;
85
86      default:
87         break;
88   }
89
7590   return mac_asc_regs[offset];
7691}
7792
93static INT16 xfersamples[0x800];
94
7895static WRITE8_HANDLER(mac_asc_w)
7996{
97   static const device_config *dacs[2];
98   INT32 i;
99
80100//   logerror("ASC: %02x to %x (PC %x)\n", data, offset, cpu_get_pc(cputag_get_cpu(space->machine, "maincpu")));
81101
82102   mac_asc_regs[offset] = data;
103
104   switch (offset)
105   {
106      case 0x801:   // CONTROL
107         dacs[0] = devtag_get_device(space->machine, "ascal");
108         dacs[1] = devtag_get_device(space->machine, "ascar");
109
110         if (data == 2)   // boot ROM uses this mode
111         {
112            dmadac_set_frequency(&dacs[0], 1, 22255*2);
113            dmadac_set_frequency(&dacs[1], 1, 22255*2);
114            dmadac_enable(&dacs[0], 1, 1);
115            dmadac_enable(&dacs[1], 1, 1);
116         }
117         else if (data == 0) // stop
118         {
119            dmadac_enable(&dacs[0], 1, 0);
120            dmadac_enable(&dacs[1], 1, 0);
121         }
122         break;
123
124      case 0x7ff:
125         for (i = 0; i < 0x200; i++)
126         {
127            xfersamples[i] = (INT16)mac_asc_regs[i]<<8;
128         }
129
130         dmadac_transfer(&dacs[0], 1, 1, 1, 0x200, xfersamples);
131         dmadac_transfer(&dacs[1], 1, 1, 1, 0x200, xfersamples);
132         break;
133   }
83134}
84135
85136static READ32_HANDLER(mac_swim_r)
r6122r6123
105156   UINT32 *scanline, *base;
106157   int x, y;
107158
108   if (input_code_pressed(screen->machine, KEYCODE_G))
109   {
110      FILE *f;
111
112      f = fopen("vram.bin", "wb");
113      fwrite(cb264_vram, 0x300000, 1, f);
114      fclose(f);
115      printf("Dumped CB264 VRAM\n");
116   }
117
118159   if (cb264_mode == 0)
119160   {
120161      for (y = 0; y < 480; y++)
r6122r6123
347388   AM_RANGE(0x50f10000, 0x50f11fff) AM_READWRITE16(macplus_scsi_r, macii_scsi_w, 0xffffffff)
348389   AM_RANGE(0x50f12060, 0x50f12063) AM_READ(macii_scsi_drq_r)
349390   AM_RANGE(0x50f14000, 0x50f15fff) AM_READ8(mac_asc_r, 0xffffffff) AM_WRITE8(mac_asc_w, 0xffffffff)
350   AM_RANGE(0x50f16000, 0x50f17fff) AM_READ(mac_swim_r) AM_WRITENOP
391//   AM_RANGE(0x50f16000, 0x50f17fff) AM_READ(mac_swim_r) AM_WRITENOP
392   AM_RANGE(0x50f16000, 0x50f17fff) AM_READWRITE16(mac_iwm_r, mac_iwm_w, 0xffffffff)
351393
352394   AM_RANGE(0x50f40000, 0x50f41fff) AM_READWRITE16(mac_via_r, mac_via_w, 0xffffffff)   // mirror
353395
r6122r6123
403445   AM_RANGE(0x50f00000, 0x50f01fff) AM_READWRITE16(mac_via_r, mac_via_w, 0xffffffff)
404446   AM_RANGE(0x50f02000, 0x50f03fff) AM_READWRITE16(mac_via2_r, mac_via2_w, 0xffffffff)
405447   AM_RANGE(0x50f04000, 0x50f05fff) AM_READWRITE16(mac_scc_r, mac_scc_2_w, 0xffffffff)
448   AM_RANGE(0x50f06060, 0x50f06063) AM_READ(macii_scsi_drq_r)
406449
407450   AM_RANGE(0x50f10000, 0x50f11fff) AM_READWRITE16(macplus_scsi_r, macii_scsi_w, 0xffffffff)
408451   AM_RANGE(0x50f12060, 0x50f12063) AM_READ(macii_scsi_drq_r)
r6122r6123
552595   
553596   /* internal ram */
554597   MDRV_RAM_MODIFY("messram")
555   MDRV_RAM_DEFAULT_SIZE("1M")
598   MDRV_RAM_DEFAULT_SIZE("4M")
556599   MDRV_RAM_EXTRA_OPTIONS("512K,2M,2560K,4M")
557600MACHINE_DRIVER_END
558601
r6122r6123
565608   
566609   /* internal ram */
567610   MDRV_RAM_MODIFY("messram")
568   MDRV_RAM_DEFAULT_SIZE("1M")
611   MDRV_RAM_DEFAULT_SIZE("4M")
569612   MDRV_RAM_EXTRA_OPTIONS("2M,2560K,4M")
570613MACHINE_DRIVER_END
571614
r6122r6123
593636
594637   /* sound hardware */
595638   MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
639   MDRV_SOUND_ADD("ascal", DMADAC, 0)
640   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
641   MDRV_SOUND_ADD("ascar", DMADAC, 0)
642   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
643   MDRV_SOUND_ADD("ascbl", DMADAC, 0)
644   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
645   MDRV_SOUND_ADD("ascbr", DMADAC, 0)
646   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
596647
597648   /* nvram */
598649   MDRV_NVRAM_HANDLER(mac)
r6122r6123
662713             
663714   /* sound hardware */
664715   MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
716   MDRV_SOUND_ADD("ascal", DMADAC, 0)
717   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
718   MDRV_SOUND_ADD("ascar", DMADAC, 0)
719   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
720   MDRV_SOUND_ADD("ascbl", DMADAC, 0)
721   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
722   MDRV_SOUND_ADD("ascbr", DMADAC, 0)
723   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
665724
666725   /* nvram */
667726   MDRV_NVRAM_HANDLER(mac)
r6122r6123
9811040ROM_END
9821041
9831042/*    YEAR  NAME      PARENT    COMPAT  MACHINE   INPUT     INIT    CONFIG      COMPANY         FULLNAME */
984COMP( 1984, mac128k,  0,       0,   mac128k,  macplus,  mac128k512k, 0,   "Apple Computer",   "Macintosh 128k",  GAME_NOT_WORKING )
985COMP( 1984, mac512k,  mac128k,  0,   mac512ke, macplus,  mac128k512k, 0,   "Apple Computer",   "Macintosh 512k",  GAME_NOT_WORKING )
986COMP( 1986, mac512ke, macplus,  0,   mac512ke, macplus,  mac512ke,    0,   "Apple Computer",   "Macintosh 512ke", 0 )
987COMP( 1986, macplus,  0,      0,   macplus,  macplus,  macplus,    0,   "Apple Computer",   "Macintosh Plus",  0 )
988COMP( 1987, macse,    0,      0,   macse,    macplus,  macse,        0,      "Apple Computer",   "Macintosh SE",  0 )
989COMP( 1988, mac2fdhd, 0,      0,   mac2fdhd, macplus,  maciifdhd,    0,      "Apple Computer",   "Macintosh II (FDHD)",  GAME_NOT_WORKING )
990COMP( 1988, maciix,   mac2fdhd, 0,   maciix,   macplus,  maciix,        0,      "Apple Computer",   "Macintosh IIx",  GAME_NOT_WORKING )
1043COMP( 1984, mac128k,  0,    0,   mac128k,  macplus,  mac128k512k, 0,      "Apple Computer",   "Macintosh 128k",  GAME_NOT_WORKING )
1044COMP( 1984, mac512k,  mac128k,  0,   mac512ke, macplus,  mac128k512k, 0,      "Apple Computer",   "Macintosh 512k",  GAME_NOT_WORKING )
1045COMP( 1986, mac512ke, macplus,  0,   mac512ke, macplus,  mac512ke,    0,      "Apple Computer",   "Macintosh 512ke", 0 )
1046COMP( 1986, macplus,  0,   0,   macplus,  macplus,  macplus,    0,      "Apple Computer",   "Macintosh Plus",  0 )
1047COMP( 1987, macse,    0,   0,   macse,    macplus,  macse,    0,      "Apple Computer",   "Macintosh SE",  0 )
1048COMP( 1988, mac2fdhd, 0,   0,   mac2fdhd, macplus,  maciifdhd,    0,      "Apple Computer",   "Macintosh II (FDHD)",  GAME_NOT_WORKING )
1049COMP( 1988, maciix,   mac2fdhd, 0,   maciix,   macplus,  maciix,    0,      "Apple Computer",   "Macintosh IIx",  GAME_NOT_WORKING )
9911050COMP( 1989, macse30,  mac2fdhd, 0,   macse30,  macplus,  macse30,    0,      "Apple Computer",   "Macintosh SE/30",  GAME_NOT_WORKING )
9921051COMP( 1989, maciicx,  mac2fdhd, 0,   maciix,   macplus,  maciicx,    0,      "Apple Computer",   "Macintosh IIcx",  GAME_NOT_WORKING )
9931052COMP( 1989, maciici,  0,      0,   maciici,  macplus,  maciici,    0,    "Apple Computer",   "Macintosh IIci",  GAME_NOT_WORKING )
994COMP( 1990, macclasc, 0,      0,   macse,    macplus,  macclassic,    0,      "Apple Computer",   "Macintosh Classic",  GAME_NOT_WORKING )
1053COMP( 1990, macclasc, 0,      0,   macse,    macplus,  macclassic,    0,   "Apple Computer",   "Macintosh Classic",  GAME_NOT_WORKING )
9951054COMP( 1990, maclc,    0,      0,   maclc,    macplus,  maclc,        0,      "Apple Computer",   "Macintosh LC",  GAME_NOT_WORKING )
9961055COMP( 1990, maciisi,  0,      0,   maciisi,  macplus,  maciici,    0,   "Apple Computer",   "Macintosh IIsi",  GAME_NOT_WORKING )
9971056COMP( 1991, macclas2, 0,      0,   macclas2, macplus,  macclassic2, 0,       "Apple Computer",   "Macintosh Classic II",  GAME_NOT_WORKING )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team