Previous 15994 Revisions Next

r12427 Sunday 31st July, 2011 at 21:51:44 UTC by R. Belmont
mac: Working NuBus. 2 working cards are available initially: the existing RasterOps board is now a proper NuBus device, and the Apple 4*8 Graphics Card is available for faster booting. [R. Belmont]
[src/mess/drivers]mac.c
[src/mess/includes]mac.h
[src/mess/machine]nubus.c nubus.h
[src/mess/video]mac.c nubus_48gc.c nubus_48gc.h nubus_cb264.c* nubus_cb264.h*

src/mess/machine/nubus.c
r12426r12427
3636{
3737}
3838
39void nubus_slot_device::static_set_nubus_slot(device_t &device, const char *tag, const char *slottag, const char *defslot)
39void nubus_slot_device::static_set_nubus_slot(device_t &device, const char *tag, const char *slottag)
4040{
4141   nubus_slot_device &nubus_card = dynamic_cast<nubus_slot_device &>(device);
4242   nubus_card.m_nubus_tag = tag;
4343   nubus_card.m_nubus_slottag = slottag;
44   nubus_card.m_nubus_defslot = defslot;
4544}
4645
4746//-------------------------------------------------
r12426r12427
5251{
5352   device_nubus_card_interface *dev = dynamic_cast<device_nubus_card_interface *>(get_card_device());
5453
55   if (dev) device_nubus_card_interface::static_set_nubus_tag(*dev, m_nubus_tag, m_nubus_slottag, m_nubus_defslot);
54   if (dev) device_nubus_card_interface::static_set_nubus_tag(*dev, m_nubus_tag, m_nubus_slottag);
5655}
5756
5857//**************************************************************************
r12426r12427
160159
161160void nubus_device::install_bank(offs_t start, offs_t end, offs_t mask, offs_t mirror, const char *tag, UINT8 *data)
162161{
162//   printf("install_bank: %s @ %x->%x mask %x mirror %x\n", tag, start, end, mask, mirror);
163163   m_maincpu = machine().device(m_cputag);
164164   address_space *space = m_maincpu->memory().space(AS_PROGRAM);
165165   space->install_readwrite_bank(start, end, mask, mirror, tag );
166166   memory_set_bankptr(machine(), tag, data);
167167}
168168
169void nubus_device::install_rom(device_t *dev, offs_t start, offs_t end, offs_t mask, offs_t mirror, const char *tag, const char *region)
169void nubus_device::set_irq_line(int slot, int state)
170170{
171   m_maincpu = machine().device(m_cputag);
172   astring tempstring;
173   address_space *space = m_maincpu->memory().space(AS_PROGRAM);
174   space->install_read_bank(start, end, mask, mirror, tag);
175   space->unmap_write(start, end, mask, mirror);
176   memory_set_bankptr(machine(), tag, machine().region(dev->subtag(tempstring, region))->base());
171   switch (slot)
172   {
173      case 0x9:   irq9_w(state);   break;
174      case 0xa:   irqa_w(state);   break;
175      case 0xb:   irqb_w(state);   break;
176      case 0xc:   irqc_w(state);   break;
177      case 0xd:   irqd_w(state);   break;
178      case 0xe:   irqe_w(state);   break;
179   }
177180}
178181
179182// interrupt request from nubus card
r12426r12427
213216{
214217}
215218
216void device_nubus_card_interface::static_set_nubus_tag(device_t &device, const char *tag, const char *slottag, const char *defslot)
219void device_nubus_card_interface::static_set_nubus_tag(device_t &device, const char *tag, const char *slottag)
217220{
218221   device_nubus_card_interface &nubus_card = dynamic_cast<device_nubus_card_interface &>(device);
219222   nubus_card.m_nubus_tag = tag;
220223   nubus_card.m_nubus_slottag = slottag;
221   nubus_card.m_nubus_defslot = defslot;
222224}
223225
224226void device_nubus_card_interface::set_nubus_device()
225227{
226228   // extract the slot number from the last digit of the slot tag
227229   int tlen = strlen(m_nubus_slottag);
228   m_slot = (m_nubus_slottag[tlen-1] - '9') + 9;
229230
231   if (m_nubus_slottag[tlen-1] == '9')
232   {
233      m_slot = (m_nubus_slottag[tlen-1] - '9') + 9;
234   }
235   else
236   {
237      m_slot = (m_nubus_slottag[tlen-1] - 'a') + 0xa;
238   }
239
230240   if (m_slot < 9 || m_slot > 0xe)
231241   {
232242      fatalerror("Slot %x out of range for Apple NuBus\n", m_slot);
r12426r12427
236246   m_nubus->add_nubus_card(this);
237247}
238248
239void device_nubus_card_interface::install_declaration_rom(const char *romregion)
249void device_nubus_card_interface::install_bank(offs_t start, offs_t end, offs_t mask, offs_t mirror, const char *tag, UINT8 *data)
240250{
241   char region_name[128];
251   char bank[256];
252
253   // append an underscore and the slot name to the bank so it's guaranteed unique
254   strcpy(bank, tag);
255   strcat(bank, "_");
256   strcat(bank, m_nubus_slottag);
257
258   m_nubus->install_bank(start, end, mask, mirror, bank, data);
259}
260
261void device_nubus_card_interface::install_declaration_rom(device_t *dev, const char *romregion)
262{
242263   bool inverted = false;
243264   UINT8 *newrom = NULL;
244265
245   sprintf(region_name, "%s:%s:%s", m_nubus_slottag, m_nubus_defslot, romregion);
266   astring tempstring;
267   UINT8 *rom = device().machine().region(dev->subtag(tempstring, romregion))->base();
268   UINT32 romlen = device().machine().region(dev->subtag(tempstring, romregion))->bytes();
246269
247   UINT8 *rom = device().machine().region(region_name)->base();
248   UINT32 romlen = device().machine().region(region_name)->bytes();
270//   printf("ROM length is %x, last bytes are %02x %02x\n", romlen, rom[romlen-2], rom[romlen-1]);
249271
250//   printf("ROM length is %x, last byte is %02x\n", romlen, rom[romlen-1]);
251
252272   UINT8 byteLanes = rom[romlen-1];
253273   // check if all bits are inverted
254274   if (rom[romlen-2] == 0xff)
r12426r12427
311331      case 0xc3:   // lanes 0, 1
312332         newrom = (UINT8 *)malloc(romlen*2);
313333         memset(newrom, 0, romlen*2);
314         for (int i = 0; i < romlen; i+=2)
334         for (int i = 0; i < romlen/2; i++)
315335         {
316            newrom[BYTE4_XOR_BE((i*4))] = rom[i];
317            newrom[BYTE4_XOR_BE((i*4)+1)] = rom[i+1];
336            newrom[BYTE4_XOR_BE((i*4)+0)] = rom[(i*2)];
337            newrom[BYTE4_XOR_BE((i*4)+1)] = rom[(i*2)+1];
318338         }
319         romlen *= 4;
339         romlen *= 2;
320340         break;
321341
322342      case 0x3c:   // lanes 2,3
323343         newrom = (UINT8 *)malloc(romlen*2);
324344         memset(newrom, 0, romlen*2);
325         for (int i = 0; i < romlen; i+=2)
345         for (int i = 0; i < romlen/2; i++)
326346         {
327            newrom[BYTE4_XOR_BE((i*4)+2)] = rom[i];
328            newrom[BYTE4_XOR_BE((i*4)+3)] = rom[i+1];
347            newrom[BYTE4_XOR_BE((i*4)+2)] = rom[(i*2)];
348            newrom[BYTE4_XOR_BE((i*4)+3)] = rom[(i*2)+1];
329349         }
330         romlen *= 4;
350         romlen *= 2;
331351         break;
332352
333353      default:
r12426r12427
350370   strcpy(bankname, "rom_");
351371   strcat(bankname, m_nubus_slottag);
352372   addr -= romlen;
353//   printf("Installing ROM bank [%s] at %08x\n", bankname, addr);
354   m_nubus->install_bank(addr, addr+romlen-1, addr+romlen-1, 0, bankname, newrom);
373//   printf("Installing ROM at %x\n", addr);
374   m_nubus->install_bank(addr, addr+romlen-1, 0, 0, bankname, newrom);
355375}
356376
src/mess/machine/nubus.h
r12426r12427
2626#define MCFG_NUBUS_SLOT_ADD(_nbtag, _tag, _slot_intf, _def_slot, _def_inp) \
2727    MCFG_DEVICE_ADD(_tag, NUBUS_SLOT, 0) \
2828   MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, _def_inp) \
29   nubus_slot_device::static_set_nubus_slot(*device, _nbtag, _tag, _def_slot); \
29   nubus_slot_device::static_set_nubus_slot(*device, _nbtag, _tag); \
3030
31#define MCFG_NUBUS_SLOT_REMOVE(_tag)    \
32    MCFG_DEVICE_REMOVE(_tag)
33
3134#define MCFG_NUBUS_ONBOARD_ADD(_nbtag, _tag, _dev_type, _def_inp) \
3235    MCFG_DEVICE_ADD(_tag, _dev_type, 0) \
3336   MCFG_DEVICE_INPUT_DEFAULTS(_def_inp) \
r12426r12427
5457   virtual void device_start();
5558
5659    // inline configuration
57    static void static_set_nubus_slot(device_t &device, const char *tag, const char *slottag, const char *defslot);
60    static void static_set_nubus_slot(device_t &device, const char *tag, const char *slottag);
5861protected:
5962   // configuration
60   const char *m_nubus_tag, *m_nubus_slottag, *m_nubus_defslot;
63   const char *m_nubus_tag, *m_nubus_slottag;
6164};
6265
6366// device type definition
r12426r12427
9093   void add_nubus_card(device_nubus_card_interface *card);
9194    void install_device(offs_t start, offs_t end, read32_delegate rhandler, write32_delegate whandler);
9295   void install_bank(offs_t start, offs_t end, offs_t mask, offs_t mirror, const char *tag, UINT8 *data);
93   void install_rom(device_t *dev, offs_t start, offs_t end, offs_t mask, offs_t mirror, const char *tag, const char *region);
96    void set_irq_line(int slot, int state);
9497
9598   DECLARE_WRITE_LINE_MEMBER( irq9_w );
9699   DECLARE_WRITE_LINE_MEMBER( irqa_w );
r12426r12427
138141
139142   void set_nubus_device();
140143
141    void install_declaration_rom(const char *romregion);
144    void install_declaration_rom(device_t *dev, const char *romregion);
145    void install_bank(offs_t start, offs_t end, offs_t mask, offs_t mirror, const char *tag, UINT8 *data);
142146
143147    UINT32 get_slotspace() { return 0xf0000000 | (m_slot<<24); }
144148    UINT32 get_super_slotspace() { return m_slot<<28; }
145149
146150    // inline configuration
147    static void static_set_nubus_tag(device_t &device, const char *tag, const char *slottag, const char *defslot);
151    static void static_set_nubus_tag(device_t &device, const char *tag, const char *slottag);
148152public:
149153   nubus_device  *m_nubus;
150    const char *m_nubus_tag, *m_nubus_slottag, *m_nubus_defslot;
154    const char *m_nubus_tag, *m_nubus_slottag;
151155    int m_slot;
152156   device_nubus_card_interface *m_next;
153157};
src/mess/includes/mac.h
r12426r12427
168168VIDEO_RESET(maceagle);
169169VIDEO_RESET(macsonora);
170170
171VIDEO_START( mac_cb264 );
172SCREEN_UPDATE( mac_cb264 );
173INTERRUPT_GEN( mac_cb264_vbl );
174
175171/*----------- defined in audio/mac.c -----------*/
176172
177173DECLARE_LEGACY_SOUND_DEVICE(MAC_SOUND, mac_sound);
r12426r12427
297293    // this is shared among all video setups with vram
298294   UINT32 *m_vram;
299295
300   UINT32 m_cb264_mode, m_cb264_vbl_disable, m_cb264_toggle;
301   UINT32 m_cb264_palette[256], m_cb264_colors[3], m_cb264_count, m_cb264_clutoffs;
302
303296   // Egret/Caboose/Cuda stuff
304297   UINT8 m_egregs[0x20];
305298
r12426r12427
352345
353346   DECLARE_READ16_MEMBER(mac_config_r);
354347
355   DECLARE_READ32_MEMBER( mac_cb264_r );
356   DECLARE_WRITE32_MEMBER( mac_cb264_w );
357   DECLARE_WRITE32_MEMBER( mac_cb264_ramdac_w );
358
359348    DECLARE_READ32_MEMBER(biu_r);
360349    DECLARE_WRITE32_MEMBER(biu_w);
361350    DECLARE_READ8_MEMBER(oss_r);
src/mess/video/nubus_cb264.c
r0r12427
1/***************************************************************************
2
3  RasterOps ColorBoard 264 NuBus video card emulation
4 
5  fixed resolution 640x480 NuBus video card, 1/4/8/16/24 bit color
6  1.5? MB of VRAM (tests up to 0x1fffff), Bt473 RAMDAC, and two custom gate arrays.
7
8  0xfsff6004 is color depth: 0 for 1bpp, 1 for 2bpp, 2 for 4bpp, 3 for 8bpp, 4 for 24bpp
9  0xfsff6014 is VBL ack: write 1 to ack
10  0xfsff603c is VBL disable: write 1 to disable, 0 to enable
11 
12***************************************************************************/
13
14#include "emu.h"
15#include "video/nubus_cb264.h"
16
17#define CB264_SCREEN_NAME   "cb264_screen"
18#define CB264_ROM_REGION      "cb264_rom"
19
20#define VRAM_SIZE   (0x200000)   // 2 megs, maxed out
21
22static SCREEN_UPDATE( cb264 );
23
24MACHINE_CONFIG_FRAGMENT( cb264 )
25   MCFG_SCREEN_ADD( CB264_SCREEN_NAME, RASTER)
26   MCFG_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
27   MCFG_SCREEN_UPDATE(cb264)
28   MCFG_SCREEN_RAW_PARAMS(25175000, 800, 0, 640, 525, 0, 480)
29   MCFG_SCREEN_SIZE(1024,768)
30   MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
31MACHINE_CONFIG_END
32
33ROM_START( cb264 )
34   ROM_REGION(0x4000, CB264_ROM_REGION, 0)
35   ROM_LOAD16_BYTE( "264-1915.bin", 0x000000, 0x002000, CRC(26c19ee5) SHA1(2b2853d04cc6b0258e85eccd23ebfd4f4f63a084) )
36   ROM_LOAD16_BYTE( "264-1914.bin", 0x000001, 0x002000, CRC(d5fbd5ad) SHA1(98d35ed3fb0bca4a9bee1cdb2af0d3f22b379386) )
37ROM_END
38
39//**************************************************************************
40//  GLOBAL VARIABLES
41//**************************************************************************
42
43const device_type NUBUS_CB264 = &device_creator<nubus_cb264_device>;
44
45
46//-------------------------------------------------
47//  machine_config_additions - device-specific
48//  machine configurations
49//-------------------------------------------------
50
51machine_config_constructor nubus_cb264_device::device_mconfig_additions() const
52{
53   return MACHINE_CONFIG_NAME( cb264 );
54}
55
56//-------------------------------------------------
57//  rom_region - device-specific ROM region
58//-------------------------------------------------
59
60const rom_entry *nubus_cb264_device::device_rom_region() const
61{
62   return ROM_NAME( cb264 );
63}
64
65//**************************************************************************
66//  LIVE DEVICE
67//**************************************************************************
68
69//-------------------------------------------------
70//  nubus_cb264_device - constructor
71//-------------------------------------------------
72
73nubus_cb264_device::nubus_cb264_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
74        device_t(mconfig, NUBUS_CB264, "NUBUS_CB264", tag, owner, clock),
75      device_nubus_card_interface(mconfig, *this),
76      device_slot_card_interface(mconfig, *this)
77{
78   m_shortname = "nb_cb264";
79}
80
81nubus_cb264_device::nubus_cb264_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) :
82        device_t(mconfig, type, name, tag, owner, clock),
83      device_nubus_card_interface(mconfig, *this),
84      device_slot_card_interface(mconfig, *this)
85{
86   m_shortname = "nb_cb264";
87}
88
89//-------------------------------------------------
90//  device_start - device-specific startup
91//-------------------------------------------------
92
93void nubus_cb264_device::device_start()
94{
95   UINT32 slotspace;
96
97   // set_nubus_device makes m_slot valid
98   set_nubus_device();
99   install_declaration_rom(this, CB264_ROM_REGION);
100
101   slotspace = get_slotspace();
102
103//   printf("[cb264 %p] slotspace = %x\n", this, slotspace);
104
105   m_vram = auto_alloc_array(machine(), UINT8, VRAM_SIZE);
106   install_bank(slotspace, slotspace+VRAM_SIZE-1, 0, 0, "bank_cb264", m_vram);
107
108   m_nubus->install_device(slotspace+0xff6000, slotspace+0xff60ff, read32_delegate(FUNC(nubus_cb264_device::cb264_r), this), write32_delegate(FUNC(nubus_cb264_device::cb264_w), this));
109   m_nubus->install_device(slotspace+0xff7000, slotspace+0xff70ff, read32_delegate(FUNC(nubus_cb264_device::cb264_ramdac_r), this), write32_delegate(FUNC(nubus_cb264_device::cb264_ramdac_w), this));
110}
111
112//-------------------------------------------------
113//  device_reset - device-specific reset
114//-------------------------------------------------
115
116void nubus_cb264_device::device_reset()
117{
118   m_cb264_toggle = 0;
119   m_cb264_count = 0;
120   m_cb264_clutoffs = 0;
121   m_cb264_vbl_disable = 1;
122   m_cb264_mode = 0;
123   memset(m_vram, 0, VRAM_SIZE);
124   memset(m_cb264_palette, 0, sizeof(m_cb264_palette));
125}
126
127/***************************************************************************
128
129  Monochrome Display Adapter (MDA) section
130
131***************************************************************************/
132
133static SCREEN_UPDATE( cb264 )
134{
135   UINT32 *scanline, *base;
136   int x, y;
137   nubus_cb264_device *card = downcast<nubus_cb264_device *>(screen->owner());
138   UINT8 pixels;
139
140   if (!card->m_cb264_vbl_disable)
141   {
142      card->m_nubus->set_irq_line(card->m_slot, ASSERT_LINE);
143   }
144
145   switch (card->m_cb264_mode)
146   {
147      case 0: // 1 bpp
148         for (y = 0; y < 480; y++)
149         {
150            scanline = BITMAP_ADDR32(bitmap, y, 0);
151            for (x = 0; x < 640/8; x++)
152            {
153               pixels = card->m_vram[(y * 1024) + (BYTE4_XOR_BE(x))];
154
155               *scanline++ = card->m_cb264_palette[pixels&0x80];
156               *scanline++ = card->m_cb264_palette[(pixels<<1)&0x80];
157               *scanline++ = card->m_cb264_palette[(pixels<<2)&0x80];
158               *scanline++ = card->m_cb264_palette[(pixels<<3)&0x80];
159               *scanline++ = card->m_cb264_palette[(pixels<<4)&0x80];
160               *scanline++ = card->m_cb264_palette[(pixels<<5)&0x80];
161               *scanline++ = card->m_cb264_palette[(pixels<<6)&0x80];
162               *scanline++ = card->m_cb264_palette[(pixels<<7)&0x80];
163            }
164         }
165         break;
166
167      case 1: // 2 bpp (3f/7f/bf/ff)
168         for (y = 0; y < 480; y++)
169         {
170            scanline = BITMAP_ADDR32(bitmap, y, 0);
171            for (x = 0; x < 640/4; x++)
172            {
173               pixels = card->m_vram[(y * 1024) + (BYTE4_XOR_BE(x))];
174
175               *scanline++ = card->m_cb264_palette[pixels&0xc0];
176               *scanline++ = card->m_cb264_palette[(pixels<<2)&0xc0];
177               *scanline++ = card->m_cb264_palette[(pixels<<4)&0xc0];
178               *scanline++ = card->m_cb264_palette[(pixels<<6)&0xc0];
179            }
180         }
181         break;
182
183      case 2: // 4 bpp
184         for (y = 0; y < 480; y++)
185         {
186            scanline = BITMAP_ADDR32(bitmap, y, 0);
187
188            for (x = 0; x < 640/2; x++)
189            {
190               pixels = card->m_vram[(y * 1024) + (BYTE4_XOR_BE(x))];
191
192               *scanline++ = card->m_cb264_palette[pixels&0xf0];
193               *scanline++ = card->m_cb264_palette[(pixels<<4)&0xf0];
194            }
195         }
196         break;
197
198      case 3: // 8 bpp
199         for (y = 0; y < 480; y++)
200         {
201            scanline = BITMAP_ADDR32(bitmap, y, 0);
202
203            for (x = 0; x < 640; x++)
204            {
205               pixels = card->m_vram[(y * 1024) + (BYTE4_XOR_BE(x))];
206               *scanline++ = card->m_cb264_palette[pixels];
207            }
208         }
209         break;
210
211      case 4:   // 24 bpp
212      case 7: // ???
213         {
214            UINT32 *vram32 = (UINT32 *)card->m_vram;
215
216            for (y = 0; y < 480; y++)
217            {
218               scanline = BITMAP_ADDR32(bitmap, y, 0);
219               base = &vram32[y * 1024];
220               for (x = 0; x < 640; x++)
221               {
222                  *scanline++ = *base++;
223               }
224            }
225         }
226         break;
227
228      default:
229         fatalerror("cb264: unknown video mode %d", card->m_cb264_mode);
230         break;
231
232   }
233
234   return 0;
235}
236
237WRITE32_MEMBER( nubus_cb264_device::cb264_w )
238{
239   switch (offset)
240   {
241      case 0x4/4:   // 0 = 1 bpp, 1 = 2bpp, 2 = 4bpp, 3 = 8bpp, 4 = 24bpp
242         m_cb264_mode = data;
243         break;
244
245      case 0x14/4:   // VBL ack
246         m_nubus->set_irq_line(m_slot, CLEAR_LINE);
247         break;
248
249      case 0x3c/4:   // VBL disable
250         m_cb264_vbl_disable = data;
251         break;
252
253      default:
254//          printf("cb264_w: %x to reg %x (mask %x PC %x)\n", data, offset*4, mem_mask, cpu_get_pc(&space->device()));
255         break;
256   }
257}
258
259READ32_MEMBER( nubus_cb264_device::cb264_r )
260{
261   switch (offset)
262   {
263      case 0x0c/4:
264      case 0x28/4:
265         break;
266
267      case 0x34/4:
268         m_cb264_toggle ^= 1;
269         return m_cb264_toggle;   // bit 0 is vblank?
270
271      default:
272         logerror("cb264_r: reg %x (mask %x PC %x)\n", offset*4, mem_mask, cpu_get_pc(&space.device()));
273         break;
274   }
275
276   return 0;
277}
278
279WRITE32_MEMBER( nubus_cb264_device::cb264_ramdac_w )
280{
281   switch (offset)
282   {
283      case 0:
284         m_cb264_clutoffs = data>>24;
285         m_cb264_count = 0;
286         break;
287
288      case 1:
289         m_cb264_colors[m_cb264_count++] = data>>24;
290
291         if (m_cb264_count == 3)
292         {
293            m_cb264_palette[m_cb264_clutoffs] = MAKE_RGB(m_cb264_colors[0], m_cb264_colors[1], m_cb264_colors[2]);
294            m_cb264_clutoffs++;
295            m_cb264_count = 0;
296         }
297         break;
298
299      default:
300//          printf("%x to unknown RAMDAC register @ %x\n", data, offset);
301         break;
302   }
303}
304
305READ32_MEMBER( nubus_cb264_device::cb264_ramdac_r )
306{
307   return 0;
308}
309
src/mess/video/mac.c
r12426r12427
174174   return 0;
175175}
176176
177/*
178    RasterOps ColorBoard 264: fixed resolution 640x480 NuBus video card, 1/4/8/16/24 bit color
179    1.5? MB of VRAM (tests up to 0x1fffff), Bt473 RAMDAC, and two custom gate arrays.
180
181        - 0xfsff6004 is color depth: 0 for 1bpp, 1 for 2bpp, 2 for 4bpp, 3 for 8bpp, 4 for 24bpp (resolution is fixed 640x480)
182        - 0xfsff6014 is VBL ack: write 1 to ack
183    - 0xfsff603c is VBL disable: write 1 to disable, 0 to enable
184*/
185
186VIDEO_START( mac_cb264 )
187{
188   mac_state *mac = machine.driver_data<mac_state>();
189
190   mac->m_cb264_toggle = 0;
191   mac->m_cb264_count = 0;
192   mac->m_cb264_clutoffs = 0;
193   mac->m_cb264_vbl_disable = 1;
194   mac->m_cb264_mode = 0;
195}
196
197// we do this here because SCREEN_UPDATE is called constantly when stepping in the debugger,
198// which makes it hard to get accurate timings (or escape the VIA2 IRQ handler)
199INTERRUPT_GEN( mac_cb264_vbl )
200{
201   mac_state *mac = device->machine().driver_data<mac_state>();
202
203   if (!mac->m_cb264_vbl_disable)
204   {
205      mac->nubus_slot_interrupt(0xe, 1);
206   }
207}
208
209SCREEN_UPDATE( mac_cb264 )
210{
211   UINT32 *scanline, *base;
212   int x, y;
213   mac_state *mac = screen->machine().driver_data<mac_state>();
214
215   switch (mac->m_cb264_mode)
216   {
217      case 0: // 1 bpp
218         {
219            UINT8 *vram8 = (UINT8 *)mac->m_vram;
220            UINT8 pixels;
221
222            for (y = 0; y < 480; y++)
223            {
224               scanline = BITMAP_ADDR32(bitmap, y, 0);
225               for (x = 0; x < 640/8; x++)
226               {
227                  pixels = vram8[(y * 1024) + (BYTE4_XOR_BE(x))];
228
229                  *scanline++ = mac->m_cb264_palette[pixels&0x80];
230                  *scanline++ = mac->m_cb264_palette[(pixels<<1)&0x80];
231                  *scanline++ = mac->m_cb264_palette[(pixels<<2)&0x80];
232                  *scanline++ = mac->m_cb264_palette[(pixels<<3)&0x80];
233                  *scanline++ = mac->m_cb264_palette[(pixels<<4)&0x80];
234                  *scanline++ = mac->m_cb264_palette[(pixels<<5)&0x80];
235                  *scanline++ = mac->m_cb264_palette[(pixels<<6)&0x80];
236                  *scanline++ = mac->m_cb264_palette[(pixels<<7)&0x80];
237               }
238            }
239         }
240         break;
241
242      case 1: // 2 bpp (3f/7f/bf/ff)
243         {
244            UINT8 *vram8 = (UINT8 *)mac->m_vram;
245            UINT8 pixels;
246
247            for (y = 0; y < 480; y++)
248            {
249               scanline = BITMAP_ADDR32(bitmap, y, 0);
250               for (x = 0; x < 640/4; x++)
251               {
252                  pixels = vram8[(y * 1024) + (BYTE4_XOR_BE(x))];
253
254                  *scanline++ = mac->m_cb264_palette[pixels&0xc0];
255                  *scanline++ = mac->m_cb264_palette[(pixels<<2)&0xc0];
256                  *scanline++ = mac->m_cb264_palette[(pixels<<4)&0xc0];
257                  *scanline++ = mac->m_cb264_palette[(pixels<<6)&0xc0];
258               }
259            }
260         }
261         break;
262
263      case 2: // 4 bpp
264         {
265            UINT8 *vram8 = (UINT8 *)mac->m_vram;
266            UINT8 pixels;
267
268            for (y = 0; y < 480; y++)
269            {
270               scanline = BITMAP_ADDR32(bitmap, y, 0);
271
272               for (x = 0; x < 640/2; x++)
273               {
274                  pixels = vram8[(y * 1024) + (BYTE4_XOR_BE(x))];
275
276                  *scanline++ = mac->m_cb264_palette[pixels&0xf0];
277                  *scanline++ = mac->m_cb264_palette[(pixels<<4)&0xf0];
278               }
279            }
280         }
281         break;
282
283      case 3: // 8 bpp
284         {
285            UINT8 *vram8 = (UINT8 *)mac->m_vram;
286            UINT8 pixels;
287
288            for (y = 0; y < 480; y++)
289            {
290               scanline = BITMAP_ADDR32(bitmap, y, 0);
291
292               for (x = 0; x < 640; x++)
293               {
294                  pixels = vram8[(y * 1024) + (BYTE4_XOR_BE(x))];
295                  *scanline++ = mac->m_cb264_palette[pixels];
296               }
297            }
298         }
299         break;
300
301      case 4:   // 24 bpp
302      case 7: // ???
303         for (y = 0; y < 480; y++)
304         {
305            scanline = BITMAP_ADDR32(bitmap, y, 0);
306            base = &mac->m_vram[y * 1024];
307            for (x = 0; x < 640; x++)
308            {
309               *scanline++ = *base++;
310            }
311         }
312         break;
313
314      default:
315         fatalerror("cb264: unknown video mode %d", mac->m_cb264_mode);
316         break;
317
318   }
319
320   return 0;
321}
322
323READ32_MEMBER( mac_state::mac_cb264_r )
324{
325   switch (offset)
326   {
327      case 0x0c/4:
328      case 0x28/4:
329         break;
330
331      case 0x34/4:
332         m_cb264_toggle ^= 1;
333         return m_cb264_toggle;   // bit 0 is vblank?
334
335      default:
336         logerror("cb264_r: reg %x (mask %x PC %x)\n", offset*4, mem_mask, cpu_get_pc(&space.device()));
337         break;
338   }
339
340   return 0;
341}
342
343WRITE32_MEMBER( mac_state::mac_cb264_w )
344{
345   switch (offset)
346   {
347      case 0x4/4:   // 0 = 1 bpp, 1 = 2bpp, 2 = 4bpp, 3 = 8bpp, 4 = 24bpp
348         m_cb264_mode = data;
349         break;
350
351      case 0x14/4:   // VBL ack
352         {
353            mac_state *mac = space.machine().driver_data<mac_state>();
354            mac->nubus_slot_interrupt(0xe, 0);
355         }
356         break;
357
358      case 0x3c/4:   // VBL disable
359         m_cb264_vbl_disable = data;
360         break;
361
362      default:
363//          printf("cb264_w: %x to reg %x (mask %x PC %x)\n", data, offset*4, mem_mask, cpu_get_pc(&space->device()));
364         break;
365   }
366}
367
368WRITE32_MEMBER( mac_state::mac_cb264_ramdac_w )
369{
370   switch (offset)
371   {
372      case 0:
373         m_cb264_clutoffs = data>>24;
374         m_cb264_count = 0;
375         break;
376
377      case 1:
378         m_cb264_colors[m_cb264_count++] = data>>24;
379
380         if (m_cb264_count == 3)
381         {
382            palette_set_color(space.machine(), m_cb264_clutoffs, MAKE_RGB(m_cb264_colors[0], m_cb264_colors[1], m_cb264_colors[2]));
383            m_cb264_palette[m_cb264_clutoffs] = MAKE_RGB(m_cb264_colors[0], m_cb264_colors[1], m_cb264_colors[2]);
384            m_cb264_clutoffs++;
385            m_cb264_count = 0;
386         }
387         break;
388
389      default:
390//          printf("%x to unknown RAMDAC register @ %x\n", data, offset);
391         break;
392   }
393}
394
395177// IIci/IIsi RAM-Based Video (RBV) and children: V8, Eagle, Spice, VASP, Sonora
396178
397179VIDEO_START( macrbv )
src/mess/video/nubus_cb264.h
r0r12427
1#pragma once
2
3#ifndef __NUBUS_CB264_H__
4#define __NUBUS_CB264_H__
5
6#include "emu.h"
7#include "machine/nubus.h"
8
9//**************************************************************************
10//  TYPE DEFINITIONS
11//**************************************************************************
12
13// ======================> nubus_cb264_device
14
15class nubus_cb264_device :
16      public device_t,
17      public device_nubus_card_interface,
18      public device_slot_card_interface
19{
20public:
21        // construction/destruction
22        nubus_cb264_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
23      nubus_cb264_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
24
25      // optional information overrides
26      virtual machine_config_constructor device_mconfig_additions() const;
27      virtual const rom_entry *device_rom_region() const;
28
29protected:
30        // device-level overrides
31        virtual void device_start();
32        virtual void device_reset();
33
34        DECLARE_READ32_MEMBER(cb264_r);
35        DECLARE_WRITE32_MEMBER(cb264_w);
36        DECLARE_READ32_MEMBER(cb264_ramdac_r);
37        DECLARE_WRITE32_MEMBER(cb264_ramdac_w);
38
39public:
40        UINT8 *m_vram;
41        UINT32 m_cb264_mode, m_cb264_vbl_disable, m_cb264_toggle;
42        UINT32 m_cb264_palette[256], m_cb264_colors[3], m_cb264_count, m_cb264_clutoffs;
43};
44
45
46// device type definition
47extern const device_type NUBUS_CB264;
48
49#endif  /* __NUBUS_CB264_H__ */
src/mess/video/nubus_48gc.c
r12426r12427
1010#define GC48_SCREEN_NAME   "48gc_screen"
1111#define GC48_ROM_REGION      "48gc_rom"
1212
13#define VRAM_SIZE   (0x200000)   // 2 megs, maxed out
14
1315static SCREEN_UPDATE( mac_48gc );
1416
1517MACHINE_CONFIG_FRAGMENT( macvideo_48gc )
r12426r12427
1719   MCFG_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
1820   MCFG_SCREEN_UPDATE( mac_48gc )
1921   MCFG_SCREEN_RAW_PARAMS(25175000, 800, 0, 640, 525, 0, 480)
22//   MCFG_SCREEN_SIZE(1152, 870)
23//   MCFG_SCREEN_VISIBLE_AREA(0, 1152-1, 0, 870-1)
24//   MCFG_SCREEN_REFRESH_RATE(75)
25//   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(1260))
2026MACHINE_CONFIG_END
2127
2228ROM_START( gc48 )
r12426r12427
8490
8591   // set_nubus_device makes m_slot valid
8692   set_nubus_device();
87   install_declaration_rom(GC48_ROM_REGION);
93   install_declaration_rom(this, GC48_ROM_REGION);
8894
8995   slotspace = get_slotspace();
9096
91   m_vram = auto_alloc_array(machine(), UINT8, 0x7ffff);
97//   printf("[4*8gc %p] slotspace = %x\n", this, slotspace);
98
99   m_vram = auto_alloc_array(machine(), UINT8, VRAM_SIZE);
100   install_bank(slotspace, slotspace+VRAM_SIZE-1, 0, 0, "bank_48gc", m_vram);
101
92102   m_nubus->install_device(slotspace+0x200000, slotspace+0x2003ff, read32_delegate(FUNC(nubus_48gc_device::mac_48gc_r), this), write32_delegate(FUNC(nubus_48gc_device::mac_48gc_w), this));
93   m_nubus->install_bank(slotspace, slotspace+0x7ffff, 0, 0x07000, "bank_48gc", m_vram);
94
95   m_toggle = 0;
96   m_clutoffs = 0;
97   m_count = 0;
98103}
99104
100105//-------------------------------------------------
r12426r12427
103108
104109void nubus_48gc_device::device_reset()
105110{
111   m_toggle = 0;
112   m_clutoffs = 0;
113   m_count = 0;
114   m_vbl_disable = 1;
115   m_stride = 80;
116   m_base = 0;
117   m_xres = 640;
118   m_yres = 480;
119   memset(m_vram, 0, VRAM_SIZE);
106120}
107121
108122/***************************************************************************
109123
110  Monochrome Display Adapter (MDA) section
124  Apple 4*8 Graphics Card section
111125
112126***************************************************************************/
113127
114128static SCREEN_UPDATE( mac_48gc )
115129{
116130   nubus_48gc_device *card = downcast<nubus_48gc_device *>(screen->owner());
117   UINT32 *scanline;
131   UINT32 *scanline, *base;
118132   int x, y;
119133   UINT8 *vram8 = (UINT8 *)card->m_vram;
120134   UINT8 pixels;
121//   UINT32 stride = card->m_registers[0xc/4]/4;
122135
136   if (!card->m_vbl_disable)
137   {
138      card->m_nubus->set_irq_line(card->m_slot, ASSERT_LINE);
139   }
140
123141   vram8 += 0xa00;
124142
125   for (y = 0; y < 480; y++)
143   switch (card->m_mode)
126144   {
127      scanline = BITMAP_ADDR32(bitmap, y, 0);
128      for (x = 0; x < 640/8; x++)
129      {
130         pixels = vram8[(y * 0x50) + (BYTE4_XOR_BE(x))];
145      case 0:   // 1bpp
146         for (y = 0; y < card->m_yres; y++)
147         {
148            scanline = BITMAP_ADDR32(bitmap, y, 0);
149            for (x = 0; x < card->m_xres/8; x++)
150            {
151               pixels = vram8[(y * card->m_stride) + (BYTE4_XOR_BE(x))];
131152
132         *scanline++ = card->m_palette[pixels&0x80];
133         *scanline++ = card->m_palette[(pixels<<1)&0x80];
134         *scanline++ = card->m_palette[(pixels<<2)&0x80];
135         *scanline++ = card->m_palette[(pixels<<3)&0x80];
136         *scanline++ = card->m_palette[(pixels<<4)&0x80];
137         *scanline++ = card->m_palette[(pixels<<5)&0x80];
138         *scanline++ = card->m_palette[(pixels<<6)&0x80];
139         *scanline++ = card->m_palette[(pixels<<7)&0x80];
140      }
153               *scanline++ = card->m_palette[(pixels>>7)&1];
154               *scanline++ = card->m_palette[(pixels>>6)&1];
155               *scanline++ = card->m_palette[(pixels>>5)&1];
156               *scanline++ = card->m_palette[(pixels>>4)&1];
157               *scanline++ = card->m_palette[(pixels>>3)&1];
158               *scanline++ = card->m_palette[(pixels>>2)&1];
159               *scanline++ = card->m_palette[(pixels>>1)&1];
160               *scanline++ = card->m_palette[pixels&1];
161            }
162         }
163         break;
164
165      case 1:   // 2bpp
166         for (y = 0; y < card->m_yres; y++)
167         {
168            scanline = BITMAP_ADDR32(bitmap, y, 0);
169            for (x = 0; x < card->m_xres/4; x++)
170            {
171               pixels = vram8[(y * card->m_stride) + (BYTE4_XOR_BE(x))];
172
173               *scanline++ = card->m_palette[(pixels>>6)&0x3];
174               *scanline++ = card->m_palette[(pixels>>4)&0x3];
175               *scanline++ = card->m_palette[(pixels>>2)&0x3];
176               *scanline++ = card->m_palette[pixels&3];
177            }
178         }
179         break;
180
181      case 2: // 4 bpp
182         for (y = 0; y < card->m_yres; y++)
183         {
184            scanline = BITMAP_ADDR32(bitmap, y, 0);
185
186            for (x = 0; x < card->m_xres/2; x++)
187            {
188               pixels = vram8[(y * card->m_stride) + (BYTE4_XOR_BE(x))];
189
190               *scanline++ = card->m_palette[(pixels>>4)&0xf];
191               *scanline++ = card->m_palette[pixels&0xf];
192            }
193         }
194         break;
195
196      case 3: // 8 bpp
197         for (y = 0; y < card->m_yres; y++)
198         {
199            scanline = BITMAP_ADDR32(bitmap, y, 0);
200
201            for (x = 0; x < card->m_xres; x++)
202            {
203               pixels = vram8[(y * card->m_stride) + (BYTE4_XOR_BE(x))];
204               *scanline++ = card->m_palette[pixels];
205            }
206         }
207         break;
208
209      case 4: // 24 bpp
210         for (y = 0; y < card->m_yres; y++)
211         {
212            scanline = BITMAP_ADDR32(bitmap, y, 0);
213            base = (UINT32 *)&card->m_vram[y * card->m_stride];
214            for (x = 0; x < card->m_xres; x++)
215            {
216               *scanline++ = *base++;
217            }
218         }
219         break;
141220   }
142221
143222   return 0;
r12426r12427
145224
146225WRITE32_MEMBER( nubus_48gc_device::mac_48gc_w )
147226{
148   printf("48gc_w: %08x to %x, mask %08x\n", data, offset*4, mem_mask);
227//   printf("48gc_w: %08x to %x, mask %08x\n", data, offset*4, mem_mask);
149228
150229   COMBINE_DATA(&m_registers[offset&0xff]);
151230
152231   switch (offset)
153232   {
154      case 0x80:   // DAC control
233      case 0x8/4:   // base
234//         printf("%x to base\n", data);
235         m_base = (data*2)<<4;
236         break;
237
238      case 0xc/4:   // stride
239//         printf("%x to stride\n", data);
240         // this value is in DWORDs for 1-8 bpp and, uhh, strange for 24bpp
241         if (m_mode < 4)
242         {
243            m_stride = data*4;
244         }
245         else
246         {
247            m_stride = (data*32)/3;
248         }
249         break;
250
251      case 0x200/4:   // DAC control
155252         m_clutoffs = data>>24;
156253         m_count = 0;
157254         break;
158255
159      case 0x81:   // DAC data
256      case 0x204/4:   // DAC data
160257         m_colors[m_count++] = data>>24;
161258
162259         if (m_count == 3)
r12426r12427
167264         }
168265         break;
169266
267      case 0x208/4:   // mode control
268         m_mode = (data>>3)&3;
269         if (m_mode == 3)   // this can be 8 or 24 bpp
270         {
271            // check pixel format for 24bpp
272            if (((data>>5)&3) == 0)
273            {
274               m_mode = 4;   // 24bpp
275            }
276         }
277//         printf("%02x to mode (m_mode = %d)\n", data, m_mode);
278         break;
279
280      case 0x13c/4:   // bit 1 = VBL disable (1=no interrupts)
281         m_vbl_disable = (data & 2) ? 1 : 0;
282         break;
283
284      case 0x148/4:   // write 1 here to clear interrupt
285         if (data == 1)
286         {
287            m_nubus->set_irq_line(m_slot, CLEAR_LINE);
288         }
289         break;
290
170291      default:
171292         break;
172293   }
r12426r12427
174295
175296READ32_MEMBER( nubus_48gc_device::mac_48gc_r )
176297{
177   printf("48gc_r: @ %x, mask %08x [PC=%x]\n", offset, mem_mask, cpu_get_pc(machine().device("maincpu")));
298//   printf("48gc_r: @ %x, mask %08x [PC=%x]\n", offset, mem_mask, cpu_get_pc(machine().device("maincpu")));
178299
179300   switch (offset)
180301   {
181302      case 0:
182303         return 0x0c00;   // sense 13" RGB for now
304//         return 0x0000;   // sense "RGB Kong" monitor
183305         break;
184306
185307      case 0x1c0/4:
src/mess/video/nubus_48gc.h
r12426r12427
1010//  TYPE DEFINITIONS
1111//**************************************************************************
1212
13// ======================> nubus_mda_device
13// ======================> nubus_48gc_device
1414
1515class nubus_48gc_device :
1616      public device_t,
r12426r12427
3636
3737public:
3838        UINT8  *m_vram;
39        UINT32 m_mode, m_vbl_disable, m_toggle;
39        UINT32 m_mode, m_vbl_disable, m_toggle, m_stride, m_base;
4040        UINT32 m_palette[256], m_colors[3], m_count, m_clutoffs;
4141        UINT32 m_registers[0x100];
42        int m_xres, m_yres;
4243};
4344
4445
src/mess/drivers/mac.c
r12426r12427
3838
3939#define ADDRESS_MAP_MODERN
4040
41//#define TEST_SLOT_CARD
42
4341#include "emu.h"
4442#include "cpu/m68000/m68000.h"
4543#include "cpu/powerpc/ppc.h"
r12426r12427
5654#include "sound/awacs.h"
5755#include "sound/cdda.h"
5856#include "video/nubus_48gc.h"
57#include "video/nubus_cb264.h"
5958#include "includes/mac.h"
6059
6160#define C7M   (7833600)
r12426r12427
629628   AM_RANGE(0x50014000, 0x50015fff) AM_DEVREADWRITE8("asc", asc_device, read, write, 0xffffffff) AM_MIRROR(0x00f00000)
630629   AM_RANGE(0x50016000, 0x50017fff) AM_READWRITE16(mac_iwm_r, mac_iwm_w, 0xffffffff) AM_MIRROR(0x00f00000)
631630   AM_RANGE(0x50040000, 0x50041fff) AM_READWRITE16(mac_via_r, mac_via_w, 0xffffffff) AM_MIRROR(0x00f00000)
632
633   // RasterOps 264 640x480 fixed-res color video card (8, 16, or 24 bit)
634   AM_RANGE(0xfe000000, 0xfe1fffff) AM_RAM   AM_BASE(m_vram) // supposed to be 1.5 megs of VRAM, but every other word?
635   AM_RANGE(0xfeff6000, 0xfeff60ff) AM_READWRITE( mac_cb264_r, mac_cb264_w )
636   AM_RANGE(0xfeff7000, 0xfeff7fff) AM_WRITE( mac_cb264_ramdac_w )
637   AM_RANGE(0xfeff8000, 0xfeffffff) AM_ROM AM_REGION("rops264", 0)
638631ADDRESS_MAP_END
639632
640633static ADDRESS_MAP_START(maciici_map, AS_PROGRAM, 32, mac_state )
r12426r12427
684677   AM_RANGE(0x5001a000, 0x5001bfff) AM_READWRITE8(oss_r, oss_w, 0xffffffff) AM_MIRROR(0x00f00000)
685678   AM_RANGE(0x50024000, 0x50027fff) AM_READ(buserror_r) AM_MIRROR(0x00f00000)   // must bus error on access here so ROM can determine we're an FMC
686679   AM_RANGE(0x50040000, 0x50041fff) AM_READWRITE16(mac_via_r, mac_via_w, 0xffffffff) AM_MIRROR(0x00f00000)
687
688   // RasterOps 264 640x480 fixed-res color video card (8, 16, or 24 bit)
689   AM_RANGE(0xfe000000, 0xfe1fffff) AM_RAM   AM_BASE(m_vram) // supposed to be 1.5 megs of VRAM, but every other word?
690   AM_RANGE(0xfeff6000, 0xfeff60ff) AM_READWRITE( mac_cb264_r, mac_cb264_w )
691   AM_RANGE(0xfeff7000, 0xfeff7fff) AM_WRITE( mac_cb264_ramdac_w )
692   AM_RANGE(0xfeff8000, 0xfeffffff) AM_ROM AM_REGION("rops264", 0)
693680ADDRESS_MAP_END
694681
695682// ROM detects the "Jaws" ASIC by checking for I/O space mirrored at 0x01000000 boundries
r12426r12427
812799};
813800
814801static SLOT_INTERFACE_START(mac_nubus_cards)
815#ifdef TEST_SLOT_CARD
816802   SLOT_INTERFACE("48gc", NUBUS_48GC)
817#endif
803   SLOT_INTERFACE("cb264", NUBUS_CB264)
818804SLOT_INTERFACE_END
819805
820806/***************************************************************************
r12426r12427
980966   /* basic machine hardware */
981967   MCFG_CPU_ADD("maincpu", M68020PMMU, C15M)
982968   MCFG_CPU_PROGRAM_MAP(macii_map)
983   MCFG_CPU_VBLANK_INT("screen", mac_cb264_vbl)
984969
985   MCFG_SCREEN_ADD("screen", RASTER)
986   // dot clock, htotal, hstart, hend, vtotal, vstart, vend
987   MCFG_SCREEN_RAW_PARAMS(25175000, 800, 0, 640, 525, 0, 480)
988
989    /* video hardware */
990   MCFG_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK)
991   MCFG_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
992   MCFG_SCREEN_SIZE(1024, 768)
993   MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
994   MCFG_SCREEN_UPDATE(mac_cb264)
995
996   MCFG_PALETTE_LENGTH(256)
997
998   MCFG_VIDEO_START(mac_cb264)
999
1000970   /* sound hardware */
1001971   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
1002972   MCFG_ASC_ADD("asc", C15M, ASC_TYPE_ASC, mac_asc_irq)
r12426r12427
1008978
1009979   /* devices */
1010980   MCFG_NUBUS_BUS_ADD("nubus", "maincpu", nubus_intf)
1011#ifdef TEST_SLOT_CARD
1012   MCFG_NUBUS_SLOT_ADD("nubus","nb9", mac_nubus_cards, "48gc", NULL)
1013#endif
981   MCFG_NUBUS_SLOT_ADD("nubus","nb9", mac_nubus_cards, "cb264", NULL)
982   MCFG_NUBUS_SLOT_ADD("nubus","nba", mac_nubus_cards, NULL, NULL)
983   MCFG_NUBUS_SLOT_ADD("nubus","nbb", mac_nubus_cards, NULL, NULL)
984   MCFG_NUBUS_SLOT_ADD("nubus","nbc", mac_nubus_cards, NULL, NULL)
985   MCFG_NUBUS_SLOT_ADD("nubus","nbd", mac_nubus_cards, NULL, NULL)
986   MCFG_NUBUS_SLOT_ADD("nubus","nbe", mac_nubus_cards, NULL, NULL)
987
1014988   MCFG_NCR5380_ADD("ncr5380", C7M, macplus_5380intf)
1015989
1016990   MCFG_IWM_ADD("fdc", mac_iwm_interface)
r12426r12427
10341008static MACHINE_CONFIG_DERIVED( maciihmu, macii )
10351009   MCFG_CPU_REPLACE("maincpu", M68020HMMU, C15M)
10361010   MCFG_CPU_PROGRAM_MAP(macii_map)
1037   MCFG_CPU_VBLANK_INT("screen", mac_cb264_vbl)
10381011MACHINE_CONFIG_END
10391012
10401013static MACHINE_CONFIG_START( maciifx, mac_state )
r12426r12427
10421015   /* basic machine hardware */
10431016   MCFG_CPU_ADD("maincpu", M68030, 40000000)
10441017   MCFG_CPU_PROGRAM_MAP(maciifx_map)
1045   MCFG_CPU_VBLANK_INT("screen", mac_cb264_vbl)
10461018
1047   MCFG_SCREEN_ADD("screen", RASTER)
1048   // dot clock, htotal, hstart, hend, vtotal, vstart, vend
1049   MCFG_SCREEN_RAW_PARAMS(25175000, 800, 0, 640, 525, 0, 480)
1050
1051        /* video hardware */
1052   MCFG_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK)
1053   MCFG_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
1054   MCFG_SCREEN_SIZE(1024, 768)
1055   MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
1056   MCFG_SCREEN_UPDATE(mac_cb264)
1057
1058   MCFG_PALETTE_LENGTH(256)
1059
1060   MCFG_VIDEO_START(mac_cb264)
1061
10621019   /* sound hardware */
10631020   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
10641021   MCFG_ASC_ADD("asc", C15M, ASC_TYPE_ASC, mac_asc_irq)
r12426r12427
10701027
10711028   /* devices */
10721029   MCFG_NUBUS_BUS_ADD("nubus", "maincpu", nubus_intf)
1030   MCFG_NUBUS_SLOT_ADD("nubus","nb9", mac_nubus_cards, "48gc", NULL)
1031   MCFG_NUBUS_SLOT_ADD("nubus","nba", mac_nubus_cards, NULL, NULL)
1032   MCFG_NUBUS_SLOT_ADD("nubus","nbb", mac_nubus_cards, NULL, NULL)
1033   MCFG_NUBUS_SLOT_ADD("nubus","nbc", mac_nubus_cards, NULL, NULL)
1034   MCFG_NUBUS_SLOT_ADD("nubus","nbd", mac_nubus_cards, NULL, NULL)
1035   MCFG_NUBUS_SLOT_ADD("nubus","nbe", mac_nubus_cards, NULL, NULL)
1036
10731037   MCFG_NCR5380_ADD("ncr5380", C7M, macplus_5380intf)
10741038
10751039   MCFG_IWM_ADD("fdc", mac_iwm_interface)
r12426r12427
11001064   MCFG_VIDEO_START(macv8)
11011065   MCFG_VIDEO_RESET(macrbv)
11021066
1103   MCFG_SCREEN_MODIFY("screen")
1067   MCFG_SCREEN_ADD("screen", RASTER)
1068   MCFG_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
1069   MCFG_SCREEN_RAW_PARAMS(25175000, 800, 0, 640, 525, 0, 480)
1070   MCFG_SCREEN_SIZE(1024,768)
1071   MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
11041072   MCFG_SCREEN_UPDATE(macrbvvram)
11051073
11061074   MCFG_RAM_MODIFY(RAM_TAG)
11071075   MCFG_RAM_DEFAULT_SIZE("2M")
11081076   MCFG_RAM_EXTRA_OPTIONS("4M,6M,8M,10M")
11091077
1078   MCFG_NUBUS_SLOT_REMOVE("nb9")
1079   MCFG_NUBUS_SLOT_REMOVE("nba")
1080   MCFG_NUBUS_SLOT_REMOVE("nbb")
1081   MCFG_NUBUS_SLOT_REMOVE("nbc")
1082   MCFG_NUBUS_SLOT_REMOVE("nbd")
1083   MCFG_NUBUS_SLOT_REMOVE("nbe")
11101084   MCFG_NUBUS_BUS_REMOVE("nubus")
11111085
11121086   MCFG_ASC_REPLACE("asc", C15M, ASC_TYPE_V8, mac_asc_irq)
r12426r12427
11621136   MCFG_SCREEN_UPDATE(macrbvvram)
11631137
11641138   MCFG_NUBUS_BUS_ADD("nubus", "maincpu", nubus_intf)
1139   MCFG_NUBUS_SLOT_ADD("nubus","nbc", mac_nubus_cards, NULL, NULL)
1140   MCFG_NUBUS_SLOT_ADD("nubus","nbd", mac_nubus_cards, NULL, NULL)
1141   MCFG_NUBUS_SLOT_ADD("nubus","nbe", mac_nubus_cards, NULL, NULL)
11651142
11661143   MCFG_RAM_MODIFY(RAM_TAG)
11671144   MCFG_RAM_DEFAULT_SIZE("4M")
r12426r12427
11811158   MCFG_SCREEN_UPDATE(macrbvvram)
11821159
11831160   MCFG_NUBUS_BUS_ADD("nubus", "maincpu", nubus_intf)
1161   MCFG_NUBUS_SLOT_ADD("nubus","nbc", mac_nubus_cards, NULL, NULL)
1162   MCFG_NUBUS_SLOT_ADD("nubus","nbd", mac_nubus_cards, NULL, NULL)
1163   MCFG_NUBUS_SLOT_ADD("nubus","nbe", mac_nubus_cards, NULL, NULL)
11841164
11851165   MCFG_RAM_MODIFY(RAM_TAG)
11861166   MCFG_RAM_DEFAULT_SIZE("4M")
r12426r12427
11911171
11921172   MCFG_CPU_REPLACE("maincpu", M68030, C15M)
11931173   MCFG_CPU_PROGRAM_MAP(macii_map)
1194   MCFG_CPU_VBLANK_INT("screen", mac_cb264_vbl)
11951174
11961175   MCFG_RAM_MODIFY(RAM_TAG)
11971176   MCFG_RAM_DEFAULT_SIZE("2M")
11981177   MCFG_RAM_EXTRA_OPTIONS("8M,32M,64M,96M,128M")
11991178MACHINE_CONFIG_END
12001179
1180static MACHINE_CONFIG_DERIVED( maciicx, maciix )   // IIcx is a IIx with only slots 9/a/b
1181   MCFG_NUBUS_SLOT_REMOVE("nbc")
1182   MCFG_NUBUS_SLOT_REMOVE("nbd")
1183   MCFG_NUBUS_SLOT_REMOVE("nbe")
1184MACHINE_CONFIG_END
1185
12011186static MACHINE_CONFIG_START( macse30, mac_state )
12021187
12031188   MCFG_CPU_ADD("maincpu", M68030, C15M)
r12426r12427
14161401
14171402   MCFG_PALETTE_LENGTH(256)
14181403
1404   // IIci only has slots c/d/e
1405   MCFG_NUBUS_SLOT_REMOVE("nb9")
1406   MCFG_NUBUS_SLOT_REMOVE("nba")
1407   MCFG_NUBUS_SLOT_REMOVE("nbb")
1408
14191409   MCFG_VIDEO_START(macrbv)
14201410   MCFG_VIDEO_RESET(macrbv)
14211411
1422   MCFG_SCREEN_MODIFY("screen")
1412   MCFG_SCREEN_ADD("screen", RASTER)
1413   MCFG_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
1414   MCFG_SCREEN_RAW_PARAMS(25175000, 800, 0, 640, 525, 0, 480)
14231415   MCFG_SCREEN_SIZE(640, 870)
14241416   MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
14251417   MCFG_SCREEN_UPDATE(macrbv)
r12426r12427
14381430
14391431   MCFG_PALETTE_LENGTH(256)
14401432
1433   MCFG_NUBUS_SLOT_REMOVE("nb9")
1434   MCFG_NUBUS_SLOT_REMOVE("nba")
1435   MCFG_NUBUS_SLOT_REMOVE("nbb")
1436   MCFG_NUBUS_SLOT_REMOVE("nbc")
1437   MCFG_NUBUS_SLOT_REMOVE("nbd")
1438   MCFG_NUBUS_SLOT_REMOVE("nbe")
1439   MCFG_NUBUS_BUS_REMOVE("nubus")
1440
14411441   MCFG_VIDEO_START(macrbv)
14421442   MCFG_VIDEO_RESET(macrbv)
14431443
1444   MCFG_SCREEN_MODIFY("screen")
1444   MCFG_SCREEN_ADD("screen", RASTER)
1445   MCFG_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
1446   MCFG_SCREEN_RAW_PARAMS(25175000, 800, 0, 640, 525, 0, 480)
14451447   MCFG_SCREEN_SIZE(640, 870)
14461448   MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
14471449   MCFG_SCREEN_UPDATE(macrbv)
r12426r12427
14851487   MCFG_NVRAM_HANDLER(mac)
14861488
14871489   /* devices */
1488   MCFG_NUBUS_BUS_ADD("nubus", "maincpu", nubus_intf)
1489
14901490   MCFG_NCR5380_ADD("ncr5380", C7M, macplus_5380intf)
14911491
14921492   MCFG_IWM_ADD("fdc", mac_iwm_interface)
r12426r12427
18251825   ROMX_LOAD( "9779d2c4.rom", 0x000000, 0x040000, CRC(4df6d054) SHA1(db6b504744281369794e26ba71a6e385cf6227fa), ROM_BIOS(1) )
18261826   ROM_SYSTEM_BIOS(1, "original", "rev. A")
18271827   ROMX_LOAD( "97851db6.rom", 0x000000, 0x040000, CRC(8c8b9d03) SHA1(5c264fe976f1e8495d364947c932a5e8309b4300), ROM_BIOS(2) )
1828
1829   // RasterOps "ColorBoard 264" NuBus video card
1830   ROM_REGION32_BE(0x8000, "rops264", 0)
1831   ROM_LOAD32_BYTE( "264-1914.bin", 0x000003, 0x002000, CRC(d5fbd5ad) SHA1(98d35ed3fb0bca4a9bee1cdb2af0d3f22b379386) )
1832   ROM_LOAD32_BYTE( "264-1915.bin", 0x000002, 0x002000, CRC(26c19ee5) SHA1(2b2853d04cc6b0258e85eccd23ebfd4f4f63a084) )
18331828ROM_END
18341829
18351830ROM_START( maciihmu )
r12426r12427
18381833   ROMX_LOAD( "9779d2c4.rom", 0x000000, 0x040000, CRC(4df6d054) SHA1(db6b504744281369794e26ba71a6e385cf6227fa), ROM_BIOS(1) )
18391834   ROM_SYSTEM_BIOS(1, "original", "rev. A")
18401835   ROMX_LOAD( "97851db6.rom", 0x000000, 0x040000, CRC(8c8b9d03) SHA1(5c264fe976f1e8495d364947c932a5e8309b4300), ROM_BIOS(2) )
1841
1842   // RasterOps "ColorBoard 264" NuBus video card
1843   ROM_REGION32_BE(0x8000, "rops264", 0)
1844   ROM_LOAD32_BYTE( "264-1914.bin", 0x000003, 0x002000, CRC(d5fbd5ad) SHA1(98d35ed3fb0bca4a9bee1cdb2af0d3f22b379386) )
1845   ROM_LOAD32_BYTE( "264-1915.bin", 0x000002, 0x002000, CRC(26c19ee5) SHA1(2b2853d04cc6b0258e85eccd23ebfd4f4f63a084) )
18461836ROM_END
18471837
18481838ROM_START( mac2fdhd )   // same ROM for II FDHD, IIx, IIcx, and SE/30
18491839   ROM_REGION32_BE(0x40000, "bootrom", 0)
18501840   ROM_LOAD( "97221136.rom", 0x000000, 0x040000, CRC(ce3b966f) SHA1(753b94351d94c369616c2c87b19d568dc5e2764e) )
1851
1852   // RasterOps "ColorBoard 264" NuBus video card
1853   ROM_REGION32_BE(0x8000, "rops264", 0)
1854   ROM_LOAD32_BYTE( "264-1914.bin", 0x000003, 0x002000, CRC(d5fbd5ad) SHA1(98d35ed3fb0bca4a9bee1cdb2af0d3f22b379386) )
1855   ROM_LOAD32_BYTE( "264-1915.bin", 0x000002, 0x002000, CRC(26c19ee5) SHA1(2b2853d04cc6b0258e85eccd23ebfd4f4f63a084) )
18561841ROM_END
18571842
18581843ROM_START( maciix )
18591844   ROM_REGION32_BE(0x40000, "bootrom", 0)
18601845   ROM_LOAD( "97221136.rom", 0x000000, 0x040000, CRC(ce3b966f) SHA1(753b94351d94c369616c2c87b19d568dc5e2764e) )
1861
1862   // RasterOps "ColorBoard 264" NuBus video card
1863   ROM_REGION32_BE(0x8000, "rops264", 0)
1864   ROM_LOAD32_BYTE( "264-1914.bin", 0x000003, 0x002000, CRC(d5fbd5ad) SHA1(98d35ed3fb0bca4a9bee1cdb2af0d3f22b379386) )
1865   ROM_LOAD32_BYTE( "264-1915.bin", 0x000002, 0x002000, CRC(26c19ee5) SHA1(2b2853d04cc6b0258e85eccd23ebfd4f4f63a084) )
18661846ROM_END
18671847
18681848ROM_START( maciicx )
18691849   ROM_REGION32_BE(0x40000, "bootrom", 0)
18701850   ROM_LOAD( "97221136.rom", 0x000000, 0x040000, CRC(ce3b966f) SHA1(753b94351d94c369616c2c87b19d568dc5e2764e) )
1871
1872   // RasterOps "ColorBoard 264" NuBus video card
1873   ROM_REGION32_BE(0x8000, "rops264", 0)
1874   ROM_LOAD32_BYTE( "264-1914.bin", 0x000003, 0x002000, CRC(d5fbd5ad) SHA1(98d35ed3fb0bca4a9bee1cdb2af0d3f22b379386) )
1875   ROM_LOAD32_BYTE( "264-1915.bin", 0x000002, 0x002000, CRC(26c19ee5) SHA1(2b2853d04cc6b0258e85eccd23ebfd4f4f63a084) )
18761851ROM_END
18771852
18781853ROM_START( macse30 )
r12426r12427
18861861ROM_START( maciifx )
18871862   ROM_REGION32_BE(0x80000, "bootrom", 0)
18881863   ROM_LOAD( "4147dd77.rom", 0x000000, 0x080000, CRC(ef441bbd) SHA1(9fba3d4f672a630745d65788b1d1119afa2c6728) )
1889
1890   // RasterOps "ColorBoard 264" NuBus video card
1891   ROM_REGION32_BE(0x8000, "rops264", 0)
1892   ROM_LOAD32_BYTE( "264-1914.bin", 0x000003, 0x002000, CRC(d5fbd5ad) SHA1(98d35ed3fb0bca4a9bee1cdb2af0d3f22b379386) )
1893   ROM_LOAD32_BYTE( "264-1915.bin", 0x000002, 0x002000, CRC(26c19ee5) SHA1(2b2853d04cc6b0258e85eccd23ebfd4f4f63a084) )
18941864ROM_END
18951865
18961866ROM_START( maciici )
r12426r12427
19941964COMP( 1988, maciix,   mac2fdhd, 0,   maciix,   macadb,   maciix,         "Apple Computer", "Macintosh IIx",  0 )
19951965COMP( 1989, macprtb,  0,        0,  macprtb,  macadb,   macprtb,     "Apple Computer", "Macintosh Portable", GAME_NOT_WORKING )
19961966COMP( 1989, macse30,  mac2fdhd, 0,   macse30,  macadb,   macse30,     "Apple Computer", "Macintosh SE/30",  0 )
1997COMP( 1989, maciicx,  mac2fdhd, 0,   maciix,   macadb,   maciicx,     "Apple Computer", "Macintosh IIcx",  0 )
1967COMP( 1989, maciicx,  mac2fdhd, 0,   maciicx,  macadb,   maciicx,     "Apple Computer", "Macintosh IIcx",  0 )
19981968COMP( 1989, maciici,  0,      0,   maciici,  maciici,  maciici,     "Apple Computer", "Macintosh IIci", 0 )
19991969COMP( 1990, maciifx,  0,      0,   maciifx,  macadb,   maciifx,      "Apple Computer", "Macintosh IIfx",  GAME_NOT_WORKING )
20001970COMP( 1990, macclasc, 0,      0,   macse,    macadb,   macclassic,     "Apple Computer", "Macintosh Classic",  0 )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team