Previous 199869 Revisions Next

r18635 Sunday 21st October, 2012 at 02:38:29 UTC by R. Belmont
(MESS) Mac updates: [R. Belmont]
- Fixed some glitches with the SE/30's built-in video
- Added preliminary infrastructure for LC and '030-type processor-direct slots
- Support for SE/30 processor-direct slot version of RasterOps Colorboard 264
[src/mess/drivers]mac.c
[src/mess/machine]nubus.c
[src/mess/video]mac.c pds30_cb264.c* pds30_cb264.h*

trunk/src/mess/machine/nubus.c
r18634r18635
297297
298298void device_nubus_card_interface::set_nubus_device()
299299{
300   // extract the slot number from the last digit of the slot tag
301   int tlen = strlen(m_nubus_slottag);
300    if (!strncmp(m_nubus_slottag, "pds030", 6))
301    {
302        m_slot = 0x9;   // '030 PDS slots phantom slot as NuBus slots $9, $A, and $B
303    }
304    else if (!strncmp(m_nubus_slottag, "lcpds", 6))
305    {
306        m_slot = 0xe;   // LC PDS slots phantom slot as NuBus slot $E
307    }
308    else
309    {
310        // extract the slot number from the last digit of the slot tag
311        int tlen = strlen(m_nubus_slottag);
302312
303   if (m_nubus_slottag[tlen-1] == '9')
304   {
305      m_slot = (m_nubus_slottag[tlen-1] - '9') + 9;
306   }
307   else
308   {
309      m_slot = (m_nubus_slottag[tlen-1] - 'a') + 0xa;
310   }
313        if (m_nubus_slottag[tlen-1] == '9')
314        {
315            m_slot = (m_nubus_slottag[tlen-1] - '9') + 9;
316        }
317        else
318        {
319            m_slot = (m_nubus_slottag[tlen-1] - 'a') + 0xa;
320        }
321    }
311322
312323   if (m_slot < 9 || m_slot > 0xe)
313324   {
trunk/src/mess/video/pds30_cb264.c
r0r18635
1/***************************************************************************
2
3  RasterOps ColorBoard 264/SE30 video card emulation
4 
5***************************************************************************/
6
7#include "emu.h"
8#include "video/pds30_cb264.h"
9
10#define CB264SE30_SCREEN_NAME "cb264_screen"
11#define CB264SE30_ROM_REGION  "cb264_rom"
12
13#define VRAM_SIZE   (0x200000)
14
15MACHINE_CONFIG_FRAGMENT( cb264se30 )
16   MCFG_SCREEN_ADD( CB264SE30_SCREEN_NAME, RASTER)
17   MCFG_SCREEN_UPDATE_DEVICE(DEVICE_SELF, nubus_cb264se30_device, screen_update)
18   MCFG_SCREEN_RAW_PARAMS(25175000, 800, 0, 640, 525, 0, 480)
19   MCFG_SCREEN_SIZE(1024,768)
20   MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
21MACHINE_CONFIG_END
22
23ROM_START( cb264se30 )
24   ROM_REGION(0x8000, CB264SE30_ROM_REGION, 0)
25    ROM_LOAD( "0002-2019_10-02-90.bin", 0x000000, 0x008000, CRC(5b5b2fab) SHA1(0584deb38b402718f2abef456b0035b34fddb473) )  // EPROM label "264/30 V1.3 0002-2019 10/02/90"
26ROM_END
27
28//**************************************************************************
29//  GLOBAL VARIABLES
30//**************************************************************************
31
32const device_type PDS030_CB264SE30 = &device_creator<nubus_cb264se30_device>;
33
34
35//-------------------------------------------------
36//  machine_config_additions - device-specific
37//  machine configurations
38//-------------------------------------------------
39
40machine_config_constructor nubus_cb264se30_device::device_mconfig_additions() const
41{
42   return MACHINE_CONFIG_NAME( cb264se30 );
43}
44
45//-------------------------------------------------
46//  rom_region - device-specific ROM region
47//-------------------------------------------------
48
49const rom_entry *nubus_cb264se30_device::device_rom_region() const
50{
51   return ROM_NAME( cb264se30 );
52}
53
54//**************************************************************************
55//  LIVE DEVICE
56//**************************************************************************
57
58//-------------------------------------------------
59//  nubus_cb264se30_device - constructor
60//-------------------------------------------------
61
62nubus_cb264se30_device::nubus_cb264se30_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
63        device_t(mconfig, PDS030_CB264SE30, "RasterOps Colorboard 264/SE30", tag, owner, clock),
64      device_nubus_card_interface(mconfig, *this)
65{
66   m_shortname = "pd3_c264";
67}
68
69nubus_cb264se30_device::nubus_cb264se30_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) :
70        device_t(mconfig, type, name, tag, owner, clock),
71      device_nubus_card_interface(mconfig, *this)
72{
73   m_shortname = "pd3_c264";
74}
75
76//-------------------------------------------------
77//  device_start - device-specific startup
78//-------------------------------------------------
79
80void nubus_cb264se30_device::device_start()
81{
82   UINT32 slotspace;
83
84   // set_nubus_device makes m_slot valid
85   set_nubus_device();
86   install_declaration_rom(this, CB264SE30_ROM_REGION);
87
88   slotspace = get_slotspace();
89
90//  printf("[cb264se30 %p] slotspace = %x\n", this, slotspace);
91
92   m_vram = auto_alloc_array(machine(), UINT8, VRAM_SIZE);
93   m_vram32 = (UINT32 *)m_vram;
94
95   m_nubus->install_device(slotspace, slotspace+VRAM_SIZE-1, read32_delegate(FUNC(nubus_cb264se30_device::vram_r), this), write32_delegate(FUNC(nubus_cb264se30_device::vram_w), this));
96   m_nubus->install_device(slotspace+0xf00000, slotspace+0xfeffff, read32_delegate(FUNC(nubus_cb264se30_device::cb264se30_r), this), write32_delegate(FUNC(nubus_cb264se30_device::cb264se30_w), this));
97
98   m_timer = timer_alloc(0, NULL);
99   m_screen = NULL;   // can we look this up now?
100}
101
102//-------------------------------------------------
103//  device_reset - device-specific reset
104//-------------------------------------------------
105
106void nubus_cb264se30_device::device_reset()
107{
108   m_count = 0;
109   m_clutoffs = 0;
110   m_vbl_disable = 1;
111   m_mode = 4;
112   memset(m_vram, 0, VRAM_SIZE);
113   memset(m_palette, 0, sizeof(m_palette));
114
115   m_palette[0] = MAKE_RGB(255, 255, 255);
116   m_palette[0x80] = MAKE_RGB(0, 0, 0);
117}
118
119
120void nubus_cb264se30_device::device_timer(emu_timer &timer, device_timer_id tid, int param, void *ptr)
121{
122   if (!m_vbl_disable)
123   {
124      raise_slot_irq();
125   }
126
127   m_timer->adjust(m_screen->time_until_pos(479, 0), 0);
128}
129
130/***************************************************************************
131
132  CB264 section
133
134***************************************************************************/
135
136UINT32 nubus_cb264se30_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
137{
138   UINT32 *scanline;
139   int x, y;
140   UINT8 pixels, *vram;
141
142   // first time?  kick off the VBL timer
143   if (!m_screen)
144   {
145      m_screen = &screen;
146      m_timer->adjust(m_screen->time_until_pos(479, 0), 0);
147   }
148
149   vram = m_vram + (8*1024);
150
151   switch (m_mode)
152   {
153      case 0: // 1 bpp?
154         for (y = 0; y < 480; y++)
155         {
156            scanline = &bitmap.pix32(y);
157            for (x = 0; x < 640/8; x++)
158            {
159               pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
160
161                    *scanline++ = m_palette[(pixels&0x80)];
162                    *scanline++ = m_palette[((pixels<<1)&0x80)];
163                    *scanline++ = m_palette[((pixels<<2)&0x80)];
164                    *scanline++ = m_palette[((pixels<<3)&0x80)];
165                    *scanline++ = m_palette[((pixels<<4)&0x80)];
166                    *scanline++ = m_palette[((pixels<<5)&0x80)];
167                    *scanline++ = m_palette[((pixels<<6)&0x80)];
168                    *scanline++ = m_palette[((pixels<<7)&0x80)];
169            }
170         }
171         break;
172
173      case 1: // 2 bpp
174         for (y = 0; y < 480; y++)
175         {
176            scanline = &bitmap.pix32(y);
177            for (x = 0; x < 640/4; x++)
178            {
179               pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
180
181               *scanline++ = m_palette[(pixels&0xc0)];
182               *scanline++ = m_palette[((pixels<<2)&0xc0)];
183               *scanline++ = m_palette[((pixels<<4)&0xc0)];
184               *scanline++ = m_palette[((pixels<<6)&0xc0)];
185            }
186         }
187         break;
188
189      case 2: // 4 bpp
190         for (y = 0; y < 480; y++)
191         {
192            scanline = &bitmap.pix32(y);
193
194            for (x = 0; x < 640/2; x++)
195            {
196               pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
197
198               *scanline++ = m_palette[(pixels&0xf0)];
199               *scanline++ = m_palette[((pixels&0x0f)<<4)];
200            }
201         }
202         break;
203
204      case 3: // 8 bpp
205         for (y = 0; y < 480; y++)
206         {
207            scanline = &bitmap.pix32(y);
208
209            for (x = 0; x < 640; x++)
210            {
211               pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
212               *scanline++ = m_palette[pixels];
213            }
214         }
215         break;
216
217        case 4:   // 24 bpp
218            {
219                UINT32 *vram32 = (UINT32 *)m_vram;
220                UINT32 *base;
221
222                for (y = 0; y < 480; y++)
223                {
224                    scanline = &bitmap.pix32(y);
225                    base = &vram32[y * 1024];
226                    for (x = 0; x < 640; x++)
227                    {
228                        *scanline++ = *base++;
229                    }
230                }
231            }
232            break;
233
234      default:
235         fatalerror("cb264se30: unknown video mode %d\n", m_mode);
236         break;
237   }
238   return 0;
239}
240
241WRITE32_MEMBER( nubus_cb264se30_device::cb264se30_w )
242{
243    switch (offset)
244   {
245        case 0x38003:         // mode
246//            if (data != 0x08000000) printf("%08x to mode\n", data);
247         switch (data & 0xff000000)
248         {
249            case 0x38000000:
250               m_mode = 0;
251               break;
252
253            case 0x39000000:
254               m_mode = 1;
255               break;
256
257            case 0x3a000000:
258               m_mode = 2;
259               break;
260
261                case 0x3b000000:
262                    m_mode = 3;
263                    break;
264
265            case 0x3f000000:
266               m_mode = 4;
267               break;
268         }
269         break;
270
271        case 0x38000:
272            if (mem_mask == 0xff000000)
273            {
274        //          printf("%08x to DAC control (PC=%x)\n", data, space.device().safe_pc());
275                    m_clutoffs = (data>>24)&0xff;
276            }
277            else if (mem_mask == 0x0000ff00)
278            {
279                    m_colors[m_count++] = (data>>8) & 0xff;
280
281                    if (m_count == 3)
282                    {
283//                        printf("RAMDAC: color %02x = %02x %02x %02x (PC=%x)\n", m_clutoffs, m_colors[0], m_colors[1], m_colors[2], space.device().safe_pc() );
284                        m_palette[m_clutoffs] = MAKE_RGB(m_colors[0], m_colors[1], m_colors[2]);
285                        m_clutoffs++;
286                        if (m_clutoffs > 255)
287                        {
288                            m_clutoffs = 0;
289                        }
290                        m_count = 0;
291                    }
292            }
293         break;
294
295        case 0x2c017:   // VBL control
296            if (data & 0x06000000)
297            {
298                m_vbl_disable = 0;
299                lower_slot_irq();
300            }
301            else
302            {
303                m_vbl_disable = 1;
304            }
305         break;
306
307      default:
308//            printf("cb264se30_w: %08x @ %x, mask %08x (PC=%x)\n", data, offset, mem_mask, space.device().safe_pc());
309         break;
310   }
311}
312
313READ32_MEMBER( nubus_cb264se30_device::cb264se30_r )
314{
315   return 0;
316}
317
318WRITE32_MEMBER( nubus_cb264se30_device::vram_w )
319{
320   COMBINE_DATA(&m_vram32[offset]);
321}
322
323READ32_MEMBER( nubus_cb264se30_device::vram_r )
324{
325   return m_vram32[offset];
326}
trunk/src/mess/video/pds30_cb264.h
r0r18635
1#pragma once
2
3#ifndef __NUBUS_CB264SE30_H__
4#define __NUBUS_CB264SE30_H__
5
6#include "emu.h"
7#include "machine/nubus.h"
8
9//**************************************************************************
10//  TYPE DEFINITIONS
11//**************************************************************************
12
13// ======================> nubus_cb264se30_device
14
15class nubus_cb264se30_device :
16      public device_t,
17      public device_nubus_card_interface
18{
19public:
20        // construction/destruction
21        nubus_cb264se30_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
22      nubus_cb264se30_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
23
24      // optional information overrides
25      virtual machine_config_constructor device_mconfig_additions() const;
26      virtual const rom_entry *device_rom_region() const;
27
28      UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
29protected:
30        // device-level overrides
31        virtual void device_start();
32        virtual void device_reset();
33        virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
34
35        DECLARE_READ32_MEMBER(cb264se30_r);
36        DECLARE_WRITE32_MEMBER(cb264se30_w);
37        DECLARE_READ32_MEMBER(vram_r);
38        DECLARE_WRITE32_MEMBER(vram_w);
39
40public:
41        UINT8 *m_vram;
42        UINT32 *m_vram32;
43        UINT32 m_mode, m_vbl_disable, m_toggle;
44        UINT32 m_palette[256], m_colors[3], m_count, m_clutoffs;
45        screen_device *m_screen;
46        emu_timer *m_timer;
47};
48
49
50// device type definition
51extern const device_type PDS030_CB264SE30;
52
53#endif  /* __NUBUS_CB264SE30_H__ */
trunk/src/mess/video/mac.c
r18634r18635
114114   int y, x, b;
115115
116116   video_base = m_screen_buffer ? 0x8000 : 0;
117    video_base += (MAC_H_VIS/8);
117118   video_ram = (const UINT16 *) &m_vram[video_base/4];
118119
119120   for (y = 0; y < MAC_V_VIS; y++)
trunk/src/mess/drivers/mac.c
r18634r18635
6969#include "video/nubus_wsportrait.h"
7070#include "machine/nubus_asntmc3b.h"
7171#include "video/nubus_m2video.h"
72#include "video/pds30_cb264.h"
7273#include "includes/mac.h"
7374#include "mac.lh"
7475
r18634r18635
664665   AM_RANGE(0x50040000, 0x50041fff) AM_READWRITE16(mac_via_r, mac_via_w, 0xffffffff) AM_MIRROR(0x00f00000)   // mirror
665666
666667   AM_RANGE(0xfe000000, 0xfe00ffff) AM_RAM   AM_SHARE("vram")
668    AM_RANGE(0xfee00000, 0xfee0ffff) AM_RAM AM_SHARE("vram") AM_MIRROR(0x000f0000)
667669   AM_RANGE(0xfeffe000, 0xfeffffff) AM_ROM AM_REGION("se30vrom", 0x0)
668670ADDRESS_MAP_END
669671
r18634r18635
857859   SLOT_INTERFACE("enetnb", NUBUS_APPLEENET)   /* Apple NuBus Ethernet */
858860SLOT_INTERFACE_END
859861
862static SLOT_INTERFACE_START(mac_pds030_cards)
863    SLOT_INTERFACE("cb264", PDS030_CB264SE30)
864SLOT_INTERFACE_END
865
860866/***************************************************************************
861867    MACHINE DRIVERS
862868***************************************************************************/
r18634r18635
12851291   MCFG_SCSIDEV_ADD("scsi:harddisk2", SCSIHD, SCSI_ID_5)
12861292   MCFG_NCR5380_ADD("scsi:ncr5380", C7M, macplus_5380intf)
12871293
1294   MCFG_NUBUS_BUS_ADD("pds", "maincpu", nubus_intf)
1295   MCFG_NUBUS_SLOT_ADD("pds","pds030", mac_pds030_cards, NULL, NULL)
1296
12881297   MCFG_SWIM_ADD("fdc", mac_iwm_interface)
12891298   MCFG_LEGACY_FLOPPY_SONY_2_DRIVES_ADD(mac_floppy_interface)
12901299

Previous 199869 Revisions Next


© 1997-2024 The MAME Team