Previous 199869 Revisions Next

r18278 Thursday 4th October, 2012 at 10:52:43 UTC by Barry Rodewald
(MESS) Moved 8514/A and Mach8 implementations to separate devices.
Fixed uninitialised structs causing issues with SVGA and 8514/A devices in
debug builds.
[src/emu/video]pc_vga.c pc_vga.h
[src/mess/video]isa_svga_s3.c isa_svga_s3.h isa_vga_ati.c isa_vga_ati.h

trunk/src/emu/video/pc_vga.c
r18277r18278
7979#define VGA_START_ADDRESS (vga.crtc.start_addr)
8080#define VGA_LINE_LENGTH (vga.crtc.offset<<3)
8181
82#define IBM8514_LINE_LENGTH (m_vga->vga.crtc.offset << 3)
83
8284#define CHAR_WIDTH ((vga.sequencer.data[1]&1)?8:9)
8385
8486#define TEXT_COLUMNS (vga.crtc.horz_disp_end+1)
r18277r18278
118120const device_type GAMTOR_VGA = &device_creator<gamtor_vga_device>;
119121const device_type ATI_VGA = &device_creator<ati_vga_device>;
120122const device_type CIRRUS_VGA = &device_creator<cirrus_vga_device>;
123const device_type IBM8514A = &device_creator<ibm8514a_device>;
124const device_type MACH8 = &device_creator<mach8_device>;
121125
122126vga_device::vga_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
123127    : device_t(mconfig, type, name, tag, owner, clock)
r18277r18278
169173{
170174}
171175
176ibm8514a_device::ibm8514a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
177    : device_t(mconfig, IBM8514A, "IBM8514A", tag, owner, clock)
178{
179}
172180
181ibm8514a_device::ibm8514a_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
182    : device_t(mconfig, type, name, tag, owner, clock)
183{
184}
185
186mach8_device::mach8_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
187   : ibm8514a_device(mconfig, type, name, tag, owner, clock)
188{
189}
190
191mach8_device::mach8_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
192   : ibm8514a_device(mconfig, MACH8, "MACH8", tag, owner, clock)
193{
194}
195
173196void vga_device::device_start()
174197{
175198   memset(&vga, 0, sizeof(vga));
r18277r18278
191214   vga.memory   = auto_alloc_array_clear(machine(), UINT8, vga.svga_intf.vram_size);   
192215}
193216
217void svga_device::device_start()
218{
219   vga_device::device_start();
220   memset(&svga, 0, sizeof(svga));
221}
222
194223void cirrus_vga_device::device_start()
195224{
196225   memset(&vga, 0, sizeof(vga));
226   memset(&svga, 0, sizeof(svga));
197227
198228   int i;
199229   for (i = 0; i < 0x100; i++)
r18277r18278
212242   vga.memory   = auto_alloc_array_clear(machine(), UINT8, vga.svga_intf.vram_size);   
213243}
214244
245void ati_vga_device::device_start()
246{
247   svga_device::device_start();
248   memset(&ati, 0, sizeof(ati));
249   m_8514 = subdevice<mach8_device>("8514a");
250}
251
215252void s3_vga_device::device_start()
216253{
217   vga_device::device_start();   
254   svga_device::device_start();
255   memset(&s3, 0, sizeof(s3));
218256   int x;
219257   // Initialise hardware graphics cursor colours, Windows 95 doesn't touch the registers for some reason
220258   for(x=0;x<4;x++)
r18277r18278
222260      s3.cursor_fg[x] = 0xff;
223261      s3.cursor_bg[x] = 0x00;
224262   }
263   m_8514 = subdevice<ibm8514a_device>("8514a");
225264}
226265
266void tseng_vga_device::device_start()
267{
268   svga_device::device_start();
269   memset(&et4k, 0, sizeof(et4k));
270}
271
272void ibm8514a_device::device_start()
273{
274   memset(&ibm8514, 0, sizeof(ibm8514));
275}
276
277void ibm8514a_device::device_config_complete()
278{
279   if(m_vga_tag.len() != 0)
280   {
281      m_vga = machine().device<vga_device>(m_vga_tag);
282   }
283}
284
285void mach8_device::device_start()
286{
287   ibm8514a_device::device_start();
288   memset(&mach8, 0, sizeof(mach8));
289}
290
227291void vga_device::vga_vh_text(bitmap_rgb32 &bitmap, const rectangle &cliprect)
228292{
229293   UINT8 ch, attr;
r18277r18278
20142078MACHINE_CONFIG_END
20152079
20162080static MACHINE_CONFIG_FRAGMENT( ati_vga )
2081   MCFG_MACH8_ADD_OWNER("8514a")
20172082   MCFG_EEPROM_ADD("ati_eeprom",ati_eeprom_interface)
20182083MACHINE_CONFIG_END
20192084
2085static MACHINE_CONFIG_FRAGMENT( s3_764 )
2086   MCFG_8514A_ADD_OWNER("8514a")
2087MACHINE_CONFIG_END
2088
20202089//-------------------------------------------------
20212090//  machine_config_additions - device-specific
20222091//  machine configurations
r18277r18278
20272096   return MACHINE_CONFIG_NAME( ati_vga );
20282097}
20292098
2099machine_config_constructor s3_vga_device::device_mconfig_additions() const
2100{
2101   return MACHINE_CONFIG_NAME( s3_764 );
2102}
2103
20302104/******************************************
20312105
20322106Tseng ET4000k implementation
r18277r18278
26672741            break;
26682742         case 0x40:
26692743            s3.enable_8514 = data & 0x01;  // enable 8514/A registers (x2e8, x6e8, xae8, xee8)
2670            if(data & 0x01)
2671            {
2672               ibm8514.state = IBM8514_IDLE;
2673               ibm8514.gpbusy = false;
2674            }
26752744            break;
26762745/*
267727463d4h index 45h (R/W):  CR45 Hardware Graphics Cursor Mode
r18277r18278
29723041
29733042/* accelerated ports, TBD ... */
29743043
2975void ati_vga_device::ibm8514_write_fg(UINT32 offset)
3044void ibm8514a_device::ibm8514_write_fg(UINT32 offset)
29763045{
2977   UINT8 dst = vga.memory[offset];
3046   address_space& space = machine().device("maincpu")->memory().space(AS_PROGRAM);
3047   UINT8 dst = m_vga->mem_linear_r(space,offset,0xff);
29783048   UINT8 src = 0;
29793049
29803050   // check clipping rectangle
r18277r18278
29953065      break;
29963066   case 0x0060:
29973067      // video memory - presume the memory is sourced from the current X/Y co-ords
2998      src = vga.memory[((ibm8514.curr_y * VGA_LINE_LENGTH) + ibm8514.curr_x) % vga.svga_intf.vram_size];
3068      src = m_vga->mem_linear_r(space,((ibm8514.curr_y * IBM8514_LINE_LENGTH) + ibm8514.curr_x),0xff);
29993069      break;
30003070   }
30013071
r18277r18278
30033073   switch(ibm8514.fgmix & 0x000f)
30043074   {
30053075   case 0x0000:
3006      vga.memory[offset] = ~dst;
3076      m_vga->mem_linear_w(space,offset,~dst,0xff);
30073077      break;
30083078   case 0x0001:
3009      vga.memory[offset] = 0x00;
3079      m_vga->mem_linear_w(space,offset,0x00,0xff);
30103080      break;
30113081   case 0x0002:
3012      vga.memory[offset] = 0xff;
3082      m_vga->mem_linear_w(space,offset,0xff,0xff);
30133083      break;
30143084   case 0x0003:
30153085      // change nothing, pixel is unchanged
30163086      break;
30173087   case 0x0004:
3018      vga.memory[offset] = ~src;
3088      m_vga->mem_linear_w(space,offset,~src,0xff);
30193089      break;
30203090   case 0x0005:
3021      vga.memory[offset] = src ^ dst;
3091      m_vga->mem_linear_w(space,offset,src ^ dst,0xff);
30223092      break;
30233093   case 0x0006:
3024      vga.memory[offset] = ~(src ^ dst);
3094      m_vga->mem_linear_w(space,offset,~(src ^ dst),0xff);
30253095      break;
30263096   case 0x0007:
3027      vga.memory[offset] = src;
3097      m_vga->mem_linear_w(space,offset,src,0xff);
30283098      break;
30293099   case 0x0008:
3030      vga.memory[offset] = ~(src & dst);
3100      m_vga->mem_linear_w(space,offset,~(src & dst),0xff);
30313101      break;
30323102   case 0x0009:
3033      vga.memory[offset] = (~src) | dst;
3103      m_vga->mem_linear_w(space,offset,(~src) | dst,0xff);
30343104      break;
30353105   case 0x000a:
3036      vga.memory[offset] = src | (~dst);
3106      m_vga->mem_linear_w(space,offset,src | (~dst),0xff);
30373107      break;
30383108   case 0x000b:
3039      vga.memory[offset] = src | dst;
3109      m_vga->mem_linear_w(space,offset,src | dst,0xff);
30403110      break;
30413111   case 0x000c:
3042      vga.memory[offset] = src & dst;
3112      m_vga->mem_linear_w(space,offset,src & dst,0xff);
30433113      break;
30443114   case 0x000d:
3045      vga.memory[offset] = src & (~dst);
3115      m_vga->mem_linear_w(space,offset,src & (~dst),0xff);
30463116      break;
30473117   case 0x000e:
3048      vga.memory[offset] = (~src) & dst;
3118      m_vga->mem_linear_w(space,offset,(~src) & dst,0xff);
30493119      break;
30503120   case 0x000f:
3051      vga.memory[offset] = ~(src | dst);
3121      m_vga->mem_linear_w(space,offset,~(src | dst),0xff);
30523122      break;
30533123   }
30543124}
30553125
3056void ati_vga_device::ibm8514_write_bg(UINT32 offset)
3126void ibm8514a_device::ibm8514_write_bg(UINT32 offset)
30573127{
3058   UINT8 dst = vga.memory[offset];
3128   address_space& space = machine().device("maincpu")->memory().space(AS_PROGRAM);
3129   UINT8 dst = m_vga->mem_linear_r(space,offset,0xff);
30593130   UINT8 src = 0;
30603131
30613132   // check clipping rectangle
r18277r18278
30763147      break;
30773148   case 0x0060:
30783149      // video memory - presume the memory is sourced from the current X/Y co-ords
3079      src = vga.memory[((ibm8514.curr_y * VGA_LINE_LENGTH) + ibm8514.curr_x) % vga.svga_intf.vram_size];
3150      src = m_vga->mem_linear_r(space,((ibm8514.curr_y * IBM8514_LINE_LENGTH) + ibm8514.curr_x),0xff);
30803151      break;
30813152   }
30823153
r18277r18278
30843155   switch(ibm8514.bgmix & 0x000f)
30853156   {
30863157   case 0x0000:
3087      vga.memory[offset] = ~dst;
3158      m_vga->mem_linear_w(space,offset,~dst,0xff);
30883159      break;
30893160   case 0x0001:
3090      vga.memory[offset] = 0x00;
3161      m_vga->mem_linear_w(space,offset,0x00,0xff);
30913162      break;
30923163   case 0x0002:
3093      vga.memory[offset] = 0xff;
3164      m_vga->mem_linear_w(space,offset,0xff,0xff);
30943165      break;
30953166   case 0x0003:
30963167      // change nothing, pixel is unchanged
30973168      break;
30983169   case 0x0004:
3099      vga.memory[offset] = ~src;
3170      m_vga->mem_linear_w(space,offset,~src,0xff);
31003171      break;
31013172   case 0x0005:
3102      vga.memory[offset] = src ^ dst;
3173      m_vga->mem_linear_w(space,offset,src ^ dst,0xff);
31033174      break;
31043175   case 0x0006:
3105      vga.memory[offset] = ~(src ^ dst);
3176      m_vga->mem_linear_w(space,offset,~(src ^ dst),0xff);
31063177      break;
31073178   case 0x0007:
3108      vga.memory[offset] = src;
3179      m_vga->mem_linear_w(space,offset,src,0xff);
31093180      break;
31103181   case 0x0008:
3111      vga.memory[offset] = ~(src & dst);
3182      m_vga->mem_linear_w(space,offset,~(src & dst),0xff);
31123183      break;
31133184   case 0x0009:
3114      vga.memory[offset] = (~src) | dst;
3185      m_vga->mem_linear_w(space,offset,(~src) | dst,0xff);
31153186      break;
31163187   case 0x000a:
3117      vga.memory[offset] = src | (~dst);
3188      m_vga->mem_linear_w(space,offset,src | (~dst),0xff);
31183189      break;
31193190   case 0x000b:
3120      vga.memory[offset] = src | dst;
3191      m_vga->mem_linear_w(space,offset,src | dst,0xff);
31213192      break;
31223193   case 0x000c:
3123      vga.memory[offset] = src & dst;
3194      m_vga->mem_linear_w(space,offset,src & dst,0xff);
31243195      break;
31253196   case 0x000d:
3126      vga.memory[offset] = src & (~dst);
3197      m_vga->mem_linear_w(space,offset,src & (~dst),0xff);
31273198      break;
31283199   case 0x000e:
3129      vga.memory[offset] = (~src) & dst;
3200      m_vga->mem_linear_w(space,offset,(~src) & dst,0xff);
31303201      break;
31313202   case 0x000f:
3132      vga.memory[offset] = ~(src | dst);
3203      m_vga->mem_linear_w(space,offset,~(src | dst),0xff);
31333204      break;
31343205   }
31353206}
31363207
3137void ati_vga_device::ibm8514_write(UINT32 offset, UINT32 src)
3208void ibm8514a_device::ibm8514_write(UINT32 offset, UINT32 src)
31383209{
31393210   int data_size = 8;
31403211   UINT32 xfer = 0;
3212   address_space& space = machine().device("maincpu")->memory().space(AS_PROGRAM);
31413213
31423214   switch(ibm8514.pixel_control & 0x00c0)
31433215   {
r18277r18278
31803252         ibm8514.src_x = 0;
31813253      break;
31823254   case 0x00c0:  // use source plane
3183      if(vga.memory[(src) % vga.svga_intf.vram_size] != 0x00)
3255      if(m_vga->mem_linear_r(space,src,0xff) != 0x00)
31843256         ibm8514_write_fg(offset);
31853257      else
31863258         ibm8514_write_bg(offset);
r18277r18278
31983270            the major or independent axis).
31993271     0-13  (80x +) LINE PARAMETER/ERROR TERM. See above.
32003272 */
3201READ16_MEMBER(ati_vga_device::ibm8514_line_error_r)
3273READ16_MEMBER(ibm8514a_device::ibm8514_line_error_r)
32023274{
32033275   return ibm8514.line_errorterm;
32043276}
32053277
3206WRITE16_MEMBER(ati_vga_device::ibm8514_line_error_w)
3278WRITE16_MEMBER(ibm8514a_device::ibm8514_line_error_w)
32073279{
32083280   ibm8514.line_errorterm = data;
32093281   if(LOG_8514) logerror("8514/A: Line Parameter/Error Term write %04x\n",data);
r18277r18278
32303302            available, Fh for 9 words, 7 for 10 words, 3 for 11 words, 1 for
32313303            12 words and 0 for 13 words available.
32323304 */
3233READ16_MEMBER(ati_vga_device::ibm8514_gpstatus_r)
3305READ16_MEMBER(ibm8514a_device::ibm8514_gpstatus_r)
32343306{
32353307   UINT16 ret = 0x0000;
32363308
r18277r18278
32423314   return ret;
32433315}
32443316
3245void ati_vga_device::ibm8514_draw_vector(UINT8 len, UINT8 dir, bool draw)
3317void ibm8514a_device::ibm8514_draw_vector(UINT8 len, UINT8 dir, bool draw)
32463318{
32473319   UINT32 offset;
32483320   int x = 0;
32493321
32503322   while(x <= len)
32513323   {
3252      offset = (ibm8514.curr_y * VGA_LINE_LENGTH) + ibm8514.curr_x;
3324      offset = (ibm8514.curr_y * IBM8514_LINE_LENGTH) + ibm8514.curr_x;
32533325      if(draw)
32543326         ibm8514_write(offset,offset);
32553327      switch(dir)
r18277r18278
32873359   }
32883360}
32893361
3290READ16_MEMBER(s3_vga_device::s3_gpstatus_r)
3291{
3292   UINT16 ret = 0x0000;
3293
3294   //if(LOG_8514) logerror("S3: 9AE8 read\n");
3295   if(s3.enable_8514 != 0)
3296   {
3297      if(ibm8514.gpbusy == true)
3298         ret |= 0x0200;
3299      if(ibm8514.data_avail == true)
3300         ret |= 0x0100;
3301      return ret;
3302   }
3303   else
3304      return 0xffff;
3305}
3306
33073362/*
330833639AE8h W(W):  Drawing Command Register (CMD)
33093364bit     0  (911-928) ~RD/WT. Read/Write Data. If set VRAM write operations are
r18277r18278
33873442                rectangle, which is copied repeatably to the destination
33883443                rectangle.
33893444 */
3390WRITE16_MEMBER(ati_vga_device::ibm8514_cmd_w)
3445WRITE16_MEMBER(ibm8514a_device::ibm8514_cmd_w)
33913446{
33923447   int x,y;
33933448   int pattern_x,pattern_y;
r18277r18278
34023457   case 0x0000:  // NOP (for "Short Stroke Vectors")
34033458      ibm8514.state = IBM8514_IDLE;
34043459      ibm8514.gpbusy = false;
3405      if(LOG_8514) logerror("S3: Command (%04x) - NOP (Short Stroke Vector)\n",ibm8514.current_cmd);
3460      if(LOG_8514) logerror("8514/A: Command (%04x) - NOP (Short Stroke Vector)\n",ibm8514.current_cmd);
34063461      break;
34073462   case 0x2000:  // Line
34083463      ibm8514.state = IBM8514_IDLE;
r18277r18278
34133468         {
34143469            ibm8514.state = IBM8514_DRAWING_LINE;
34153470            ibm8514.data_avail = true;
3416            if(LOG_8514) logerror("S3: Command (%04x) - Vector Line (WAIT) %i,%i \n",ibm8514.current_cmd,ibm8514.curr_x,ibm8514.curr_y);
3471            if(LOG_8514) logerror("8514/A: Command (%04x) - Vector Line (WAIT) %i,%i \n",ibm8514.current_cmd,ibm8514.curr_x,ibm8514.curr_y);
34173472         }
34183473         else
34193474         {
34203475            ibm8514_draw_vector(ibm8514.rect_width,(data & 0x00e0) >> 5,(data & 0010) ? true : false);
3421            if(LOG_8514) logerror("S3: Command (%04x) - Vector Line - %i,%i \n",ibm8514.current_cmd,ibm8514.curr_x,ibm8514.curr_y);
3476            if(LOG_8514) logerror("8514/A: Command (%04x) - Vector Line - %i,%i \n",ibm8514.current_cmd,ibm8514.curr_x,ibm8514.curr_y);
34223477         }
34233478      }
34243479      else
r18277r18278
34323487         int count = 0;
34333488         INT16 temp;
34343489
3435         if(LOG_8514) logerror("S3: Command (%04x) - Line (Bresenham) - %i,%i  Axial %i, Diagonal %i, Error %i, Major Axis %i, Minor Axis %i\n",ibm8514.current_cmd,
3490         if(LOG_8514) logerror("8514/A: Command (%04x) - Line (Bresenham) - %i,%i  Axial %i, Diagonal %i, Error %i, Major Axis %i, Minor Axis %i\n",ibm8514.current_cmd,
34363491            ibm8514.curr_x,ibm8514.curr_y,ibm8514.line_axial_step,ibm8514.line_diagonal_step,ibm8514.line_errorterm,ibm8514.rect_width,ibm8514.rect_height);
34373492
34383493         if((data & 0x0040))
r18277r18278
34413496         }
34423497         for(;;)
34433498         {
3444            ibm8514_write(ibm8514.curr_x + (ibm8514.curr_y * VGA_LINE_LENGTH),ibm8514.curr_x + (ibm8514.curr_y * VGA_LINE_LENGTH));
3499            ibm8514_write(ibm8514.curr_x + (ibm8514.curr_y * IBM8514_LINE_LENGTH),ibm8514.curr_x + (ibm8514.curr_y * IBM8514_LINE_LENGTH));
34453500            if (count > ibm8514.rect_width) break;
34463501            count++;
34473502            if((err*2) > -dy)
r18277r18278
34643519         //ibm8514.gpbusy = true;  // DirectX 5 keeps waiting for the busy bit to be clear...
34653520         ibm8514.bus_size = (data & 0x0600) >> 9;
34663521         ibm8514.data_avail = true;
3467         if(LOG_8514) logerror("S3: Command (%04x) - Rectangle Fill (WAIT) %i,%i Width: %i Height: %i Colour: %08x\n",ibm8514.current_cmd,ibm8514.curr_x,
3522         if(LOG_8514) logerror("8514/A: Command (%04x) - Rectangle Fill (WAIT) %i,%i Width: %i Height: %i Colour: %08x\n",ibm8514.current_cmd,ibm8514.curr_x,
34683523               ibm8514.curr_y,ibm8514.rect_width,ibm8514.rect_height,ibm8514.fgcolour);
34693524         break;
34703525      }
3471      if(LOG_8514) logerror("S3: Command (%04x) - Rectangle Fill %i,%i Width: %i Height: %i Colour: %08x\n",ibm8514.current_cmd,ibm8514.curr_x,
3526      if(LOG_8514) logerror("8514/A: Command (%04x) - Rectangle Fill %i,%i Width: %i Height: %i Colour: %08x\n",ibm8514.current_cmd,ibm8514.curr_x,
34723527            ibm8514.curr_y,ibm8514.rect_width,ibm8514.rect_height,ibm8514.fgcolour);
34733528      off = 0;
3474      off += (VGA_LINE_LENGTH * ibm8514.curr_y);
3529      off += (IBM8514_LINE_LENGTH * ibm8514.curr_y);
34753530      off += ibm8514.curr_x;
34763531      for(y=0;y<=ibm8514.rect_height;y++)
34773532      {
34783533         for(x=0;x<=ibm8514.rect_width;x++)
34793534         {
34803535            if(data & 0x0020)  // source pattern is always based on current X/Y?
3481               ibm8514_write((off+x) % vga.svga_intf.vram_size,(off+x) % vga.svga_intf.vram_size);
3536               ibm8514_write((off+x) % m_vga->vga.svga_intf.vram_size,(off+x) % m_vga->vga.svga_intf.vram_size);
34823537            else
3483               ibm8514_write((off-x) % vga.svga_intf.vram_size,(off-x) % vga.svga_intf.vram_size);
3538               ibm8514_write((off-x) % m_vga->vga.svga_intf.vram_size,(off-x) % m_vga->vga.svga_intf.vram_size);
34843539            if(ibm8514.current_cmd & 0x0020)
34853540            {
34863541               ibm8514.curr_x++;
r18277r18278
35093564            }
35103565         }
35113566         if(data & 0x0080)
3512            off += VGA_LINE_LENGTH;
3567            off += IBM8514_LINE_LENGTH;
35133568         else
3514            off -= VGA_LINE_LENGTH;
3569            off -= IBM8514_LINE_LENGTH;
35153570      }
35163571      ibm8514.state = IBM8514_IDLE;
35173572      ibm8514.gpbusy = false;
35183573      break;
35193574   case 0xc000:  // BitBLT
3520      if(LOG_8514) logerror("S3: Command (%04x) - BitBLT from %i,%i to %i,%i  Width: %i  Height: %i\n",ibm8514.current_cmd,
3575      if(LOG_8514) logerror("8514/A: Command (%04x) - BitBLT from %i,%i to %i,%i  Width: %i  Height: %i\n",ibm8514.current_cmd,
35213576            ibm8514.curr_x,ibm8514.curr_y,ibm8514.dest_x,ibm8514.dest_y,ibm8514.rect_width,ibm8514.rect_height);
35223577      off = 0;
3523      off += (VGA_LINE_LENGTH * ibm8514.dest_y);
3578      off += (IBM8514_LINE_LENGTH * ibm8514.dest_y);
35243579      off += ibm8514.dest_x;
35253580      src = 0;
3526      src += (VGA_LINE_LENGTH * ibm8514.curr_y);
3581      src += (IBM8514_LINE_LENGTH * ibm8514.curr_y);
35273582      src += ibm8514.curr_x;
35283583      for(y=0;y<=ibm8514.rect_height;y++)
35293584      {
35303585         for(x=0;x<=ibm8514.rect_width;x++)
35313586         {
35323587            if(data & 0x0020)
3533               vga.memory[(off+x) % vga.svga_intf.vram_size] = vga.memory[(src+x) % vga.svga_intf.vram_size];
3588               m_vga->mem_linear_w(space,(off+x),m_vga->mem_linear_r(space,(src+x),0xff),0xff);
35343589            else
3535               vga.memory[(off-x) % vga.svga_intf.vram_size] = vga.memory[(src-x) % vga.svga_intf.vram_size];
3590               m_vga->mem_linear_w(space,(off-x),m_vga->mem_linear_r(space,(src-x),0xff),0xff);
35363591            if(ibm8514.current_cmd & 0x0020)
35373592            {
35383593               ibm8514.curr_x++;
r18277r18278
35623617         }
35633618         if(data & 0x0080)
35643619         {
3565            src += VGA_LINE_LENGTH;
3566            off += VGA_LINE_LENGTH;
3620            src += IBM8514_LINE_LENGTH;
3621            off += IBM8514_LINE_LENGTH;
35673622         }
35683623         else
35693624         {
3570            src -= VGA_LINE_LENGTH;
3571            off -= VGA_LINE_LENGTH;
3625            src -= IBM8514_LINE_LENGTH;
3626            off -= IBM8514_LINE_LENGTH;
35723627         }
35733628      }
35743629      ibm8514.state = IBM8514_IDLE;
35753630      ibm8514.gpbusy = false;
35763631      break;
35773632   case 0xe000:  // Pattern Fill
3578      if(LOG_8514) logerror("S3: Command (%04x) - Pattern Fill - source %i,%i  dest %i,%i  Width: %i Height: %i\n",ibm8514.current_cmd,
3633      if(LOG_8514) logerror("8514/A: Command (%04x) - Pattern Fill - source %i,%i  dest %i,%i  Width: %i Height: %i\n",ibm8514.current_cmd,
35793634            ibm8514.curr_x,ibm8514.curr_y,ibm8514.dest_x,ibm8514.dest_y,ibm8514.rect_width,ibm8514.rect_height);
35803635      off = 0;
3581      off += (VGA_LINE_LENGTH * ibm8514.dest_y);
3636      off += (IBM8514_LINE_LENGTH * ibm8514.dest_y);
35823637      off += ibm8514.dest_x;
35833638      src = 0;
3584      src += (VGA_LINE_LENGTH * ibm8514.curr_y);
3639      src += (IBM8514_LINE_LENGTH * ibm8514.curr_y);
35853640      src += ibm8514.curr_x;
35863641      if(data & 0x0020)
35873642         pattern_x = 0;
r18277r18278
36203675         if(data & 0x0080)
36213676         {
36223677            pattern_y++;
3623            src += VGA_LINE_LENGTH;
3678            src += IBM8514_LINE_LENGTH;
36243679            if(pattern_y >= 8)
36253680            {
36263681               pattern_y = 0;
3627               src -= (VGA_LINE_LENGTH * 8);  // move src pointer back to top of pattern
3682               src -= (IBM8514_LINE_LENGTH * 8);  // move src pointer back to top of pattern
36283683            }
3629            off += VGA_LINE_LENGTH;
3684            off += IBM8514_LINE_LENGTH;
36303685         }
36313686         else
36323687         {
36333688            pattern_y--;
3634            src -= VGA_LINE_LENGTH;
3689            src -= IBM8514_LINE_LENGTH;
36353690            if(pattern_y < 0)
36363691            {
36373692               pattern_y = 7;
3638               src += (VGA_LINE_LENGTH * 8);  // move src pointer back to bottom of pattern
3693               src += (IBM8514_LINE_LENGTH * 8);  // move src pointer back to bottom of pattern
36393694            }
3640            off -= VGA_LINE_LENGTH;
3695            off -= IBM8514_LINE_LENGTH;
36413696         }
36423697      }
36433698      ibm8514.state = IBM8514_IDLE;
r18277r18278
36463701   default:
36473702      ibm8514.state = IBM8514_IDLE;
36483703      ibm8514.gpbusy = false;
3649      if(LOG_8514) logerror("S3: Unknown command: %04x\n",data);
3704      if(LOG_8514) logerror("8514/A: Unknown command: %04x\n",data);
36503705   }
36513706}
36523707
3653WRITE16_MEMBER(s3_vga_device::s3_cmd_w)
3654{
3655   if(s3.enable_8514 != 0)
3656      ibm8514_cmd_w(space,offset,data,mem_mask);
3657}
36583708/*
365937098AE8h W(R/W):  Destination Y Position & Axial Step Constant Register
36603710               (DESTY_AXSTP)
r18277r18278
36673717     0-13  (80 x+) LINE PARAMETER AXIAL STEP CONSTANT. Se above
36683718
36693719 */
3670READ16_MEMBER(ati_vga_device::ibm8514_desty_r)
3720READ16_MEMBER(ibm8514a_device::ibm8514_desty_r)
36713721{
36723722   return ibm8514.line_axial_step;
36733723}
36743724
3675WRITE16_MEMBER(ati_vga_device::ibm8514_desty_w)
3725WRITE16_MEMBER(ibm8514a_device::ibm8514_desty_w)
36763726{
36773727   ibm8514.line_axial_step = data;
36783728   ibm8514.dest_y = data;
r18277r18278
36923742     0-13  (80x +) LINE PARAMETER DIAGONAL STEP CONSTANT. Se above
36933743
36943744 */
3695READ16_MEMBER(ati_vga_device::ibm8514_destx_r)
3745READ16_MEMBER(ibm8514a_device::ibm8514_destx_r)
36963746{
36973747   return ibm8514.line_diagonal_step;
36983748}
36993749
3700WRITE16_MEMBER(ati_vga_device::ibm8514_destx_w)
3750WRITE16_MEMBER(ibm8514a_device::ibm8514_destx_w)
37013751{
37023752   ibm8514.line_diagonal_step = data;
37033753   ibm8514.dest_x = data;
r18277r18278
37263776      9EE9h before execution starts. A single 16bit write will do.
37273777      If only one SSV is desired the other byte can be set to 0.
37283778 */
3729void ati_vga_device::ibm8514_wait_draw_ssv()
3779void ibm8514a_device::ibm8514_wait_draw_ssv()
37303780{
37313781   UINT8 len = ibm8514.wait_vector_len;
37323782   UINT8 dir = ibm8514.wait_vector_dir;
r18277r18278
37763826
37773827      if(ibm8514.state == IBM8514_DRAWING_SSV_1 || ibm8514.state == IBM8514_DRAWING_SSV_2)
37783828      {
3779         offset = (ibm8514.curr_y * VGA_LINE_LENGTH) + ibm8514.curr_x;
3829         offset = (ibm8514.curr_y * IBM8514_LINE_LENGTH) + ibm8514.curr_x;
37803830         if(draw)
37813831            ibm8514_write(offset,offset);
37823832         switch(dir)
r18277r18278
38143864   }
38153865}
38163866
3817void ati_vga_device::ibm8514_draw_ssv(UINT8 data)
3867void ibm8514a_device::ibm8514_draw_ssv(UINT8 data)
38183868{
38193869   UINT8 len = data & 0x0f;
38203870   UINT8 dir = (data & 0xe0) >> 5;
r18277r18278
38233873   ibm8514_draw_vector(len,dir,draw);
38243874}
38253875
3826READ16_MEMBER(ati_vga_device::ibm8514_ssv_r)
3876READ16_MEMBER(ibm8514a_device::ibm8514_ssv_r)
38273877{
38283878   return ibm8514.ssv;
38293879}
38303880
3831WRITE16_MEMBER(ati_vga_device::ibm8514_ssv_w)
3881WRITE16_MEMBER(ibm8514a_device::ibm8514_ssv_w)
38323882{
38333883   ibm8514.ssv = data;
38343884
r18277r18278
38563906   if(LOG_8514) logerror("8514/A: Short Stroke Vector write %04x\n",data);
38573907}
38583908
3859void ati_vga_device::ibm8514_wait_draw_vector()
3909void ibm8514a_device::ibm8514_wait_draw_vector()
38603910{
38613911   UINT8 len = ibm8514.wait_vector_len;
38623912   UINT8 dir = ibm8514.wait_vector_dir;
r18277r18278
38883938
38893939      if(ibm8514.state == IBM8514_DRAWING_LINE)
38903940      {
3891         offset = (ibm8514.curr_y * VGA_LINE_LENGTH) + ibm8514.curr_x;
3941         offset = (ibm8514.curr_y * IBM8514_LINE_LENGTH) + ibm8514.curr_x;
38923942         if(draw)
38933943            ibm8514_write(offset,offset);
38943944         switch(dir)
r18277r18278
39353985            independent axis). Must be positive.
39363986     0-11  (80x +) RECTANGLE WIDTH/LINE PARAMETER MAX. See above
39373987 */
3938READ16_MEMBER(ati_vga_device::ibm8514_width_r)
3988READ16_MEMBER(ibm8514a_device::ibm8514_width_r)
39393989{
39403990   return ibm8514.rect_width;
39413991}
39423992
3943WRITE16_MEMBER(ati_vga_device::ibm8514_width_w)
3993WRITE16_MEMBER(ibm8514a_device::ibm8514_width_w)
39443994{
39453995   ibm8514.rect_width = data & 0x1fff;
3946   if(LOG_8514) logerror("S3: Major Axis Pixel Count / Rectangle Width write %04x\n",data);
3996   if(LOG_8514) logerror("8514/A: Major Axis Pixel Count / Rectangle Width write %04x\n",data);
39473997}
39483998
3949READ16_MEMBER(ati_vga_device::ibm8514_currentx_r)
3999READ16_MEMBER(ibm8514a_device::ibm8514_currentx_r)
39504000{
39514001   return ibm8514.curr_x;
39524002}
39534003
3954WRITE16_MEMBER(ati_vga_device::ibm8514_currentx_w)
4004WRITE16_MEMBER(ibm8514a_device::ibm8514_currentx_w)
39554005{
39564006   ibm8514.curr_x = data;
39574007   ibm8514.prev_x = data;
39584008   if(LOG_8514) logerror("8514/A: Current X set to %04x (%i)\n",data,ibm8514.curr_x);
39594009}
39604010
3961READ16_MEMBER(ati_vga_device::ibm8514_currenty_r)
4011READ16_MEMBER(ibm8514a_device::ibm8514_currenty_r)
39624012{
39634013   return ibm8514.curr_y;
39644014}
39654015
3966WRITE16_MEMBER(ati_vga_device::ibm8514_currenty_w)
4016WRITE16_MEMBER(ibm8514a_device::ibm8514_currenty_w)
39674017{
39684018   ibm8514.curr_y = data;
39694019   ibm8514.prev_y = data;
39704020   if(LOG_8514) logerror("8514/A: Current Y set to %04x (%i)\n",data,ibm8514.curr_y);
39714021}
39724022
3973READ16_MEMBER(ati_vga_device::ibm8514_fgcolour_r)
4023READ16_MEMBER(ibm8514a_device::ibm8514_fgcolour_r)
39744024{
39754025   return ibm8514.fgcolour;
39764026}
39774027
3978WRITE16_MEMBER(ati_vga_device::ibm8514_fgcolour_w)
4028WRITE16_MEMBER(ibm8514a_device::ibm8514_fgcolour_w)
39794029{
39804030   ibm8514.fgcolour = data;
3981   if(LOG_8514) logerror("S3: Foreground Colour write %04x\n",data);
4031   if(LOG_8514) logerror("8514/A: Foreground Colour write %04x\n",data);
39824032}
39834033
3984READ16_MEMBER(ati_vga_device::ibm8514_bgcolour_r)
4034READ16_MEMBER(ibm8514a_device::ibm8514_bgcolour_r)
39854035{
39864036   return ibm8514.bgcolour;
39874037}
39884038
3989WRITE16_MEMBER(ati_vga_device::ibm8514_bgcolour_w)
4039WRITE16_MEMBER(ibm8514a_device::ibm8514_bgcolour_w)
39904040{
39914041   ibm8514.bgcolour = data;
3992   if(LOG_8514) logerror("S3: Background Colour write %04x\n",data);
4042   if(LOG_8514) logerror("8514/A: Background Colour write %04x\n",data);
39934043}
39944044
3995READ16_MEMBER(ati_vga_device::ibm8514_multifunc_r )
4045READ16_MEMBER(ibm8514a_device::ibm8514_multifunc_r )
39964046{
39974047   switch(ibm8514.multifunc_sel)
39984048   {
r18277r18278
40134063   }
40144064}
40154065
4016WRITE16_MEMBER(ati_vga_device::ibm8514_multifunc_w )
4066WRITE16_MEMBER(ibm8514a_device::ibm8514_multifunc_w )
40174067{
40184068   switch(data & 0xf000)
40194069   {
r18277r18278
41044154   }
41054155}
41064156
4107void ati_vga_device::ibm8514_wait_draw()
4157void ibm8514a_device::ibm8514_wait_draw()
41084158{
41094159   int x, data_size = 8;
41104160   UINT32 off;
r18277r18278
41174167   if(ibm8514.bus_size == 2)  // 32-bit
41184168      data_size = 32;
41194169   off = 0;
4120   off += (VGA_LINE_LENGTH * ibm8514.curr_y);
4170   off += (IBM8514_LINE_LENGTH * ibm8514.curr_y);
41214171   off += ibm8514.curr_x;
41224172   if(ibm8514.current_cmd & 0x02) // "across plane mode"
41234173   {
41244174      for(x=0;x<data_size;x++)
41254175      {
4126         ibm8514_write(off % vga.svga_intf.vram_size,off % vga.svga_intf.vram_size);
4176         ibm8514_write(off,off);
41274177         if(ibm8514.current_cmd & 0x0020)
41284178         {
41294179            off++;
r18277r18278
41934243      // "through plane" mode (single pixel)
41944244      for(x=0;x<data_size;x+=8)
41954245      {
4196         ibm8514_write(off % vga.svga_intf.vram_size,off % vga.svga_intf.vram_size);
4246         ibm8514_write(off,off);
41974247
41984248         if(ibm8514.current_cmd & 0x0020)
41994249         {
r18277r18278
42884338             2  BSS is Pixel Data from the PIX_TRANS register (E2E8h)
42894339             3  BSS is Bitmap Data (Source data from display buffer).
42904340 */
4291READ16_MEMBER(ati_vga_device::ibm8514_backmix_r)
4341READ16_MEMBER(ibm8514a_device::ibm8514_backmix_r)
42924342{
42934343   return ibm8514.bgmix;
42944344}
42954345
4296WRITE16_MEMBER(ati_vga_device::ibm8514_backmix_w)
4346WRITE16_MEMBER(ibm8514a_device::ibm8514_backmix_w)
42974347{
42984348   ibm8514.bgmix = data;
42994349   if(LOG_8514) logerror("8514/A: BG Mix write %04x\n",data);
43004350}
43014351
4302READ16_MEMBER(ati_vga_device::ibm8514_foremix_r)
4352READ16_MEMBER(ibm8514a_device::ibm8514_foremix_r)
43034353{
43044354   return ibm8514.fgmix;
43054355}
43064356
4307WRITE16_MEMBER(ati_vga_device::ibm8514_foremix_w)
4357WRITE16_MEMBER(ibm8514a_device::ibm8514_foremix_w)
43084358{
43094359   ibm8514.fgmix = data;
43104360   if(LOG_8514) logerror("8514/A: FG Mix write %04x\n",data);
43114361}
43124362
4313READ16_MEMBER(ati_vga_device::ibm8514_pixel_xfer_r)
4363READ16_MEMBER(ibm8514a_device::ibm8514_pixel_xfer_r)
43144364{
43154365   if(offset == 1)
43164366      return (ibm8514.pixel_xfer & 0xffff0000) >> 16;
r18277r18278
43184368      return ibm8514.pixel_xfer & 0x0000ffff;
43194369}
43204370
4321WRITE16_MEMBER(ati_vga_device::ibm8514_pixel_xfer_w)
4371WRITE16_MEMBER(ibm8514a_device::ibm8514_pixel_xfer_w)
43224372{
43234373   if(offset == 1)
43244374      ibm8514.pixel_xfer = (ibm8514.pixel_xfer & 0x0000ffff) | (data << 16);
r18277r18278
43644414
43654415WRITE8_MEMBER(s3_vga_device::mem_w)
43664416{
4417   ibm8514a_device* dev = get_8514();
43674418   // bit 4 of CR53 enables memory-mapped I/O
43684419   // 0xA0000-0xA7ffff maps to port 0xE2E8 (pixel transfer)
43694420   if(s3.cr53 & 0x10)
r18277r18278
43714422      if(offset < 0x8000)
43724423      {
43734424         // pass through to the pixel transfer register (DirectX 5 wants this)
4374         if(ibm8514.bus_size == 0)
4425         if(dev->ibm8514.bus_size == 0)
43754426         {
4376            ibm8514.pixel_xfer = (ibm8514.pixel_xfer & 0xffffff00) | data;
4377            ibm8514_wait_draw();
4427            dev->ibm8514.pixel_xfer = (dev->ibm8514.pixel_xfer & 0xffffff00) | data;
4428            dev->ibm8514_wait_draw();
43784429         }
4379         if(ibm8514.bus_size == 1)
4430         if(dev->ibm8514.bus_size == 1)
43804431         {
43814432            switch(offset & 0x0001)
43824433            {
43834434            case 0:
43844435            default:
4385               ibm8514.pixel_xfer = (ibm8514.pixel_xfer & 0xffffff00) | data;
4436               dev->ibm8514.pixel_xfer = (dev->ibm8514.pixel_xfer & 0xffffff00) | data;
43864437               break;
43874438            case 1:
4388               ibm8514.pixel_xfer = (ibm8514.pixel_xfer & 0xffff00ff) | (data << 8);
4389               ibm8514_wait_draw();
4439               dev->ibm8514.pixel_xfer = (dev->ibm8514.pixel_xfer & 0xffff00ff) | (data << 8);
4440               dev->ibm8514_wait_draw();
43904441               break;
43914442            }
43924443         }
4393         if(ibm8514.bus_size == 2)
4444         if(dev->ibm8514.bus_size == 2)
43944445         {
43954446            switch(offset & 0x0003)
43964447            {
43974448            case 0:
43984449            default:
4399               ibm8514.pixel_xfer = (ibm8514.pixel_xfer & 0xffffff00) | data;
4450               dev->ibm8514.pixel_xfer = (dev->ibm8514.pixel_xfer & 0xffffff00) | data;
44004451               break;
44014452            case 1:
4402               ibm8514.pixel_xfer = (ibm8514.pixel_xfer & 0xffff00ff) | (data << 8);
4453               dev->ibm8514.pixel_xfer = (dev->ibm8514.pixel_xfer & 0xffff00ff) | (data << 8);
44034454               break;
44044455            case 2:
4405               ibm8514.pixel_xfer = (ibm8514.pixel_xfer & 0xff00ffff) | (data << 16);
4456               dev->ibm8514.pixel_xfer = (dev->ibm8514.pixel_xfer & 0xff00ffff) | (data << 16);
44064457               break;
44074458            case 3:
4408               ibm8514.pixel_xfer = (ibm8514.pixel_xfer & 0x00ffffff) | (data << 24);
4409               ibm8514_wait_draw();
4459               dev->ibm8514.pixel_xfer = (dev->ibm8514.pixel_xfer & 0x00ffffff) | (data << 24);
4460               dev->ibm8514_wait_draw();
44104461               break;
44114462            }
44124463         }
r18277r18278
44164467      {
44174468      case 0x8100:
44184469      case 0x82e8:
4419         ibm8514.curr_y = (ibm8514.curr_y & 0xff00) | data;
4420         ibm8514.prev_y = (ibm8514.prev_y & 0xff00) | data;
4470         dev->ibm8514.curr_y = (dev->ibm8514.curr_y & 0xff00) | data;
4471         dev->ibm8514.prev_y = (dev->ibm8514.prev_y & 0xff00) | data;
44214472         break;
44224473      case 0x8101:
44234474      case 0x82e9:
4424         ibm8514.curr_y = (ibm8514.curr_y & 0x00ff) | (data << 8);
4425         ibm8514.prev_y = (ibm8514.prev_y & 0x00ff) | (data << 8);
4475         dev->ibm8514.curr_y = (dev->ibm8514.curr_y & 0x00ff) | (data << 8);
4476         dev->ibm8514.prev_y = (dev->ibm8514.prev_y & 0x00ff) | (data << 8);
44264477         break;
44274478      case 0x8102:
44284479      case 0x86e8:
4429         ibm8514.curr_x = (ibm8514.curr_x & 0xff00) | data;
4430         ibm8514.prev_x = (ibm8514.prev_x & 0xff00) | data;
4480         dev->ibm8514.curr_x = (dev->ibm8514.curr_x & 0xff00) | data;
4481         dev->ibm8514.prev_x = (dev->ibm8514.prev_x & 0xff00) | data;
44314482         break;
44324483      case 0x8103:
44334484      case 0x86e9:
4434         ibm8514.curr_x = (ibm8514.curr_x & 0x00ff) | (data << 8);
4435         ibm8514.prev_x = (ibm8514.prev_x & 0x00ff) | (data << 8);
4485         dev->ibm8514.curr_x = (dev->ibm8514.curr_x & 0x00ff) | (data << 8);
4486         dev->ibm8514.prev_x = (dev->ibm8514.prev_x & 0x00ff) | (data << 8);
44364487         break;
44374488      case 0x8108:
44384489      case 0x8ae8:
4439         ibm8514.line_axial_step = (ibm8514.line_axial_step & 0xff00) | data;
4440         ibm8514.dest_y = (ibm8514.dest_y & 0xff00) | data;
4490         dev->ibm8514.line_axial_step = (dev->ibm8514.line_axial_step & 0xff00) | data;
4491         dev->ibm8514.dest_y = (dev->ibm8514.dest_y & 0xff00) | data;
44414492         break;
44424493      case 0x8109:
44434494      case 0x8ae9:
4444         ibm8514.line_axial_step = (ibm8514.line_axial_step & 0x00ff) | ((data & 0x3f) << 8);
4445         ibm8514.dest_y = (ibm8514.dest_y & 0x00ff) | (data << 8);
4495         dev->ibm8514.line_axial_step = (dev->ibm8514.line_axial_step & 0x00ff) | ((data & 0x3f) << 8);
4496         dev->ibm8514.dest_y = (dev->ibm8514.dest_y & 0x00ff) | (data << 8);
44464497         break;
44474498      case 0x810a:
44484499      case 0x8ee8:
4449         ibm8514.line_diagonal_step = (ibm8514.line_diagonal_step & 0xff00) | data;
4450         ibm8514.dest_x = (ibm8514.dest_x & 0xff00) | data;
4500         dev->ibm8514.line_diagonal_step = (dev->ibm8514.line_diagonal_step & 0xff00) | data;
4501         dev->ibm8514.dest_x = (dev->ibm8514.dest_x & 0xff00) | data;
44514502         break;
44524503      case 0x810b:
44534504      case 0x8ee9:
4454         ibm8514.line_diagonal_step = (ibm8514.line_diagonal_step & 0x00ff) | ((data & 0x3f) << 8);
4455         ibm8514.dest_x = (ibm8514.dest_x & 0x00ff) | (data << 8);
4505         dev->ibm8514.line_diagonal_step = (dev->ibm8514.line_diagonal_step & 0x00ff) | ((data & 0x3f) << 8);
4506         dev->ibm8514.dest_x = (dev->ibm8514.dest_x & 0x00ff) | (data << 8);
44564507         break;
44574508      case 0x8118:
44584509      case 0x9ae8:
r18277r18278
44614512      case 0x8119:
44624513      case 0x9ae9:
44634514         s3.mmio_9ae8 = (s3.mmio_9ae8 & 0x00ff) | (data << 8);
4464         s3_cmd_w(space,0,s3.mmio_9ae8,0xffff);
4515         dev->ibm8514_cmd_w(space,0,s3.mmio_9ae8,0xffff);
44654516         break;
44664517      case 0x8120:
44674518      case 0xa2e8:
4468         ibm8514.bgcolour = (ibm8514.bgcolour & 0xff00) | data;
4519         dev->ibm8514.bgcolour = (dev->ibm8514.bgcolour & 0xff00) | data;
44694520         break;
44704521      case 0x8121:
44714522      case 0xa2e9:
4472         ibm8514.bgcolour = (ibm8514.bgcolour & 0x00ff) | (data << 8);
4523         dev->ibm8514.bgcolour = (dev->ibm8514.bgcolour & 0x00ff) | (data << 8);
44734524         break;
44744525      case 0x8124:
44754526      case 0xa6e8:
4476         ibm8514.fgcolour = (ibm8514.fgcolour & 0xff00) | data;
4527         dev->ibm8514.fgcolour = (dev->ibm8514.fgcolour & 0xff00) | data;
44774528         break;
44784529      case 0x8125:
44794530      case 0xa6e9:
4480         ibm8514.fgcolour = (ibm8514.fgcolour & 0x00ff) | (data << 8);
4531         dev->ibm8514.fgcolour = (dev->ibm8514.fgcolour & 0x00ff) | (data << 8);
44814532         break;
44824533      case 0xb6e8:
44834534      case 0x8134:
4484         ibm8514.bgmix = (ibm8514.bgmix & 0xff00) | data;
4535         dev->ibm8514.bgmix = (dev->ibm8514.bgmix & 0xff00) | data;
44854536         break;
44864537      case 0x8135:
44874538      case 0xb6e9:
4488         ibm8514.bgmix = (ibm8514.bgmix & 0x00ff) | (data << 8);
4539         dev->ibm8514.bgmix = (dev->ibm8514.bgmix & 0x00ff) | (data << 8);
44894540         break;
44904541      case 0x8136:
44914542      case 0xbae8:
4492         ibm8514.fgmix = (ibm8514.fgmix & 0xff00) | data;
4543         dev->ibm8514.fgmix = (dev->ibm8514.fgmix & 0xff00) | data;
44934544         break;
44944545      case 0x8137:
44954546      case 0xbae9:
4496         ibm8514.fgmix = (ibm8514.fgmix & 0x00ff) | (data << 8);
4547         dev->ibm8514.fgmix = (dev->ibm8514.fgmix & 0x00ff) | (data << 8);
44974548         break;
44984549      case 0x8138:
4499         ibm8514.scissors_top = (ibm8514.scissors_top & 0xff00) | data;
4550         dev->ibm8514.scissors_top = (dev->ibm8514.scissors_top & 0xff00) | data;
45004551         break;
45014552      case 0x8139:
4502         ibm8514.scissors_top = (ibm8514.scissors_top & 0x00ff) | (data << 8);
4553         dev->ibm8514.scissors_top = (dev->ibm8514.scissors_top & 0x00ff) | (data << 8);
45034554         break;
45044555      case 0x813a:
4505         ibm8514.scissors_left = (ibm8514.scissors_left & 0xff00) | data;
4556         dev->ibm8514.scissors_left = (dev->ibm8514.scissors_left & 0xff00) | data;
45064557         break;
45074558      case 0x813b:
4508         ibm8514.scissors_left = (ibm8514.scissors_left & 0x00ff) | (data << 8);
4559         dev->ibm8514.scissors_left = (dev->ibm8514.scissors_left & 0x00ff) | (data << 8);
45094560         break;
45104561      case 0x813c:
4511         ibm8514.scissors_bottom = (ibm8514.scissors_bottom & 0xff00) | data;
4562         dev->ibm8514.scissors_bottom = (dev->ibm8514.scissors_bottom & 0xff00) | data;
45124563         break;
45134564      case 0x813d:
4514         ibm8514.scissors_bottom = (ibm8514.scissors_bottom & 0x00ff) | (data << 8);
4565         dev->ibm8514.scissors_bottom = (dev->ibm8514.scissors_bottom & 0x00ff) | (data << 8);
45154566         break;
45164567      case 0x813e:
4517         ibm8514.scissors_right = (ibm8514.scissors_right & 0xff00) | data;
4568         dev->ibm8514.scissors_right = (dev->ibm8514.scissors_right & 0xff00) | data;
45184569         break;
45194570      case 0x813f:
4520         ibm8514.scissors_right = (ibm8514.scissors_right & 0x00ff) | (data << 8);
4571         dev->ibm8514.scissors_right = (dev->ibm8514.scissors_right & 0x00ff) | (data << 8);
45214572         break;
45224573      case 0x8140:
4523         ibm8514.pixel_control = (ibm8514.pixel_control & 0xff00) | data;
4574         dev->ibm8514.pixel_control = (dev->ibm8514.pixel_control & 0xff00) | data;
45244575         break;
45254576      case 0x8141:
4526         ibm8514.pixel_control = (ibm8514.pixel_control & 0x00ff) | (data << 8);
4577         dev->ibm8514.pixel_control = (dev->ibm8514.pixel_control & 0x00ff) | (data << 8);
45274578         break;
45284579      case 0x8146:
4529         ibm8514.multifunc_sel = (ibm8514.multifunc_sel & 0xff00) | data;
4580         dev->ibm8514.multifunc_sel = (dev->ibm8514.multifunc_sel & 0xff00) | data;
45304581         break;
45314582      case 0x8148:
4532         ibm8514.rect_height = (ibm8514.rect_height & 0xff00) | data;
4583         dev->ibm8514.rect_height = (dev->ibm8514.rect_height & 0xff00) | data;
45334584         break;
45344585      case 0x8149:
4535         ibm8514.rect_height = (ibm8514.rect_height & 0x00ff) | (data << 8);
4586         dev->ibm8514.rect_height = (dev->ibm8514.rect_height & 0x00ff) | (data << 8);
45364587         break;
45374588      case 0x814a:
4538         ibm8514.rect_width = (ibm8514.rect_width & 0xff00) | data;
4589         dev->ibm8514.rect_width = (dev->ibm8514.rect_width & 0xff00) | data;
45394590         break;
45404591      case 0x814b:
4541         ibm8514.rect_width = (ibm8514.rect_width & 0x00ff) | (data << 8);
4592         dev->ibm8514.rect_width = (dev->ibm8514.rect_width & 0x00ff) | (data << 8);
45424593         break;
45434594      case 0x8150:
4544         ibm8514.pixel_xfer = (ibm8514.pixel_xfer & 0xffffff00) | data;
4545         if(ibm8514.state == IBM8514_DRAWING_RECT)
4546            ibm8514_wait_draw();
4595         dev->ibm8514.pixel_xfer = (dev->ibm8514.pixel_xfer & 0xffffff00) | data;
4596         if(dev->ibm8514.state == IBM8514_DRAWING_RECT)
4597            dev->ibm8514_wait_draw();
45474598         break;
45484599      case 0x8151:
4549         ibm8514.pixel_xfer = (ibm8514.pixel_xfer & 0xffff00ff) | (data << 8);
4550         if(ibm8514.state == IBM8514_DRAWING_RECT)
4551            ibm8514_wait_draw();
4600         dev->ibm8514.pixel_xfer = (dev->ibm8514.pixel_xfer & 0xffff00ff) | (data << 8);
4601         if(dev->ibm8514.state == IBM8514_DRAWING_RECT)
4602            dev->ibm8514_wait_draw();
45524603         break;
45534604      case 0x8152:
4554         ibm8514.pixel_xfer = (ibm8514.pixel_xfer & 0xff00ffff) | (data << 16);
4555         if(ibm8514.state == IBM8514_DRAWING_RECT)
4556            ibm8514_wait_draw();
4605         dev->ibm8514.pixel_xfer = (dev->ibm8514.pixel_xfer & 0xff00ffff) | (data << 16);
4606         if(dev->ibm8514.state == IBM8514_DRAWING_RECT)
4607            dev->ibm8514_wait_draw();
45574608         break;
45584609      case 0x8153:
4559         ibm8514.pixel_xfer = (ibm8514.pixel_xfer & 0x00ffffff) | (data << 24);
4560         if(ibm8514.state == IBM8514_DRAWING_RECT)
4561            ibm8514_wait_draw();
4610         dev->ibm8514.pixel_xfer = (dev->ibm8514.pixel_xfer & 0x00ffffff) | (data << 24);
4611         if(dev->ibm8514.state == IBM8514_DRAWING_RECT)
4612            dev->ibm8514_wait_draw();
45624613         break;
45634614      case 0xbee8:
45644615         s3.mmio_bee8 = (s3.mmio_bee8 & 0xff00) | data;
45654616         break;
45664617      case 0xbee9:
45674618         s3.mmio_bee8 = (s3.mmio_bee8 & 0x00ff) | (data << 8);
4568         ibm8514_multifunc_w(space,0,s3.mmio_bee8,0xffff);
4619         dev->ibm8514_multifunc_w(space,0,s3.mmio_bee8,0xffff);
45694620         break;
45704621      default:
45714622         if(LOG_8514) logerror("S3: MMIO offset %05x write %02x\n",offset+0xa0000,data);
r18277r18278
48924943           This bit toggles every time a HSYNC pulse starts
48934944     3-15  Reserved(0)
48944945 */
4895READ16_MEMBER(ati_vga_device::ibm8514_status_r)
4946READ16_MEMBER(ibm8514a_device::ibm8514_status_r)
48964947{
4897   return vga_vblank() << 1;
4948   return m_vga->vga_vblank() << 1;
48984949}
48994950
4900WRITE16_MEMBER(ati_vga_device::ibm8514_htotal_w)
4951WRITE16_MEMBER(ibm8514a_device::ibm8514_htotal_w)
49014952{
49024953   ibm8514.htotal = data & 0x01ff;
49034954   //vga.crtc.horz_total = data & 0x01ff;
r18277r18278
49244975     8-11  CHIP_REV. Chip revision number.
49254976    12-15  (CT82c480) CHIP_ID. 0=CT 82c480.
49264977 */
4927READ16_MEMBER(ati_vga_device::ibm8514_substatus_r)
4978READ16_MEMBER(ibm8514a_device::ibm8514_substatus_r)
49284979{
49294980   // TODO:
4930   if(vga_vblank() != 0)  // not correct, but will do for now
4981   if(m_vga->vga_vblank() != 0)  // not correct, but will do for now
49314982      ibm8514.substatus |= 0x01;
49324983   return ibm8514.substatus;
49334984}
r18277r18278
49495000    12-13  CHPTEST. Used for chip testing.
49505001    14-15  Graphics Processor Control (GPCTRL).
49515002 */
4952WRITE16_MEMBER(ati_vga_device::ibm8514_subcontrol_w)
5003WRITE16_MEMBER(ibm8514a_device::ibm8514_subcontrol_w)
49535004{
49545005   ibm8514.subctrl = data;
49555006   ibm8514.substatus &= ~(data & 0x0f);  // reset interrupts
49565007//  if(LOG_8514) logerror("8514/A: Subsystem control write %04x\n",data);
49575008}
49585009
4959READ16_MEMBER(ati_vga_device::ibm8514_subcontrol_r)
5010READ16_MEMBER(ibm8514a_device::ibm8514_subcontrol_r)
49605011{
49615012   return ibm8514.subctrl;
49625013}
49635014
4964READ16_MEMBER(ati_vga_device::ibm8514_htotal_r)
5015READ16_MEMBER(ibm8514a_device::ibm8514_htotal_r)
49655016{
49665017   return ibm8514.htotal;
49675018}
49685019
4969READ16_MEMBER(ati_vga_device::ibm8514_vtotal_r)
5020READ16_MEMBER(ibm8514a_device::ibm8514_vtotal_r)
49705021{
49715022   return ibm8514.vtotal;
49725023}
49735024
4974WRITE16_MEMBER(ati_vga_device::ibm8514_vtotal_w)
5025WRITE16_MEMBER(ibm8514a_device::ibm8514_vtotal_w)
49755026{
49765027   ibm8514.vtotal = data;
49775028//  vga.crtc.vert_total = data;
49785029   if(LOG_8514) logerror("8514/A: Vertical total write %04x\n",data);
49795030}
49805031
4981READ16_MEMBER(ati_vga_device::ibm8514_vdisp_r)
5032READ16_MEMBER(ibm8514a_device::ibm8514_vdisp_r)
49825033{
49835034   return ibm8514.vdisp;
49845035}
49855036
4986WRITE16_MEMBER(ati_vga_device::ibm8514_vdisp_w)
5037WRITE16_MEMBER(ibm8514a_device::ibm8514_vdisp_w)
49875038{
49885039   ibm8514.vdisp = data;
49895040//  vga.crtc.vert_disp_end = data >> 3;
49905041   if(LOG_8514) logerror("8514/A: Vertical Displayed write %04x\n",data);
49915042}
49925043
4993READ16_MEMBER(ati_vga_device::ibm8514_vsync_r)
5044READ16_MEMBER(ibm8514a_device::ibm8514_vsync_r)
49945045{
49955046   return ibm8514.vsync;
49965047}
49975048
4998WRITE16_MEMBER(ati_vga_device::ibm8514_vsync_w)
5049WRITE16_MEMBER(ibm8514a_device::ibm8514_vsync_w)
49995050{
50005051   ibm8514.vsync = data;
50015052   if(LOG_8514) logerror("8514/A: Vertical Sync write %04x\n",data);
50025053}
50035054
5004READ16_MEMBER(ati_vga_device::mach8_ec0_r)
5055void ibm8514a_device::enabled()
50055056{
5057   ibm8514.state = IBM8514_IDLE;
5058   ibm8514.gpbusy = false;
5059}
5060
5061READ16_MEMBER(mach8_device::mach8_ec0_r)
5062{
50065063   return ibm8514.ec0;
50075064}
50085065
5009WRITE16_MEMBER(ati_vga_device::mach8_ec0_w)
5066WRITE16_MEMBER(mach8_device::mach8_ec0_w)
50105067{
50115068   ibm8514.ec0 = data;
50125069   if(LOG_8514) logerror("8514/A: Extended configuration 0 write %04x\n",data);
50135070}
50145071
5015READ16_MEMBER(ati_vga_device::mach8_ec1_r)
5072READ16_MEMBER(mach8_device::mach8_ec1_r)
50165073{
50175074   return ibm8514.ec1;
50185075}
50195076
5020WRITE16_MEMBER(ati_vga_device::mach8_ec1_w)
5077WRITE16_MEMBER(mach8_device::mach8_ec1_w)
50215078{
50225079   ibm8514.ec1 = data;
50235080   if(LOG_8514) logerror("8514/A: Extended configuration 1 write %04x\n",data);
50245081}
50255082
5026READ16_MEMBER(ati_vga_device::mach8_ec2_r)
5083READ16_MEMBER(mach8_device::mach8_ec2_r)
50275084{
50285085   return ibm8514.ec2;
50295086}
50305087
5031WRITE16_MEMBER(ati_vga_device::mach8_ec2_w)
5088WRITE16_MEMBER(mach8_device::mach8_ec2_w)
50325089{
50335090   ibm8514.ec2 = data;
50345091   if(LOG_8514) logerror("8514/A: Extended configuration 2 write %04x\n",data);
50355092}
50365093
5037READ16_MEMBER(ati_vga_device::mach8_ec3_r)
5094READ16_MEMBER(mach8_device::mach8_ec3_r)
50385095{
50395096   return ibm8514.ec3;
50405097}
50415098
5042WRITE16_MEMBER(ati_vga_device::mach8_ec3_w)
5099WRITE16_MEMBER(mach8_device::mach8_ec3_w)
50435100{
50445101   ibm8514.ec3 = data;
50455102   if(LOG_8514) logerror("8514/A: Extended configuration 3 write %04x\n",data);
50465103}
50475104
5048READ16_MEMBER(ati_vga_device::mach8_ext_fifo_r)
5105READ16_MEMBER(mach8_device::mach8_ext_fifo_r)
50495106{
50505107   return 0x00;  // for now, report all FIFO slots at free
50515108}
50525109
5053WRITE16_MEMBER(ati_vga_device::mach8_linedraw_index_w)
5110WRITE16_MEMBER(mach8_device::mach8_linedraw_index_w)
50545111{
5055   ati.linedraw = data & 0x07;
5112   mach8.linedraw = data & 0x07;
50565113   if(LOG_8514) logerror("Mach8: Line Draw Index write %04x\n",data);
50575114}
50585115
5059READ16_MEMBER(ati_vga_device::mach8_bresenham_count_r)
5116READ16_MEMBER(mach8_device::mach8_bresenham_count_r)
50605117{
50615118   return ibm8514.rect_width & 0x1fff;
50625119}
50635120
5064WRITE16_MEMBER(ati_vga_device::mach8_bresenham_count_w)
5121WRITE16_MEMBER(mach8_device::mach8_bresenham_count_w)
50655122{
50665123   ibm8514.rect_width = data & 0x1fff;
50675124   if(LOG_8514) logerror("Mach8: Bresenham count write %04x\n",data);
50685125}
50695126
5070WRITE16_MEMBER(ati_vga_device::mach8_linedraw_w)
5127READ16_MEMBER(mach8_device::mach8_linedraw_r)
50715128{
5129   return 0xff;
5130}
5131
5132WRITE16_MEMBER(mach8_device::mach8_linedraw_w)
5133{
50725134   // TODO: actually draw the lines
5073   switch(ati.linedraw)
5135   switch(mach8.linedraw)
50745136   {
50755137   case 0:  // Set current X
50765138      ibm8514.curr_x = data;
5077      ati.linedraw++;
5139      mach8.linedraw++;
50785140      break;
50795141   case 1:  // Set current Y
50805142      ibm8514.curr_y = data;
5081      ati.linedraw++;
5143      mach8.linedraw++;
50825144      break;
50835145   case 2:  // Line end X
50845146      ibm8514.curr_x = data;
5085      ati.linedraw++;
5147      mach8.linedraw++;
50865148      break;
50875149   case 3:  // Line end Y
50885150      ibm8514.curr_y = data;
5089      ati.linedraw = 2;
5151      mach8.linedraw = 2;
50905152      break;
50915153   case 4:  // Set current X
50925154      ibm8514.curr_x = data;
5093      ati.linedraw++;
5155      mach8.linedraw++;
50945156      break;
50955157   case 5:  // Set current Y
50965158      ibm8514.curr_y = data;
5097      ati.linedraw = 4;
5159      mach8.linedraw = 4;
50985160      break;
50995161   }
5100   logerror("ATI: Linedraw register write %04x, mode %i\n",data,ati.linedraw);
5162   logerror("ATI: Linedraw register write %04x, mode %i\n",data,mach8.linedraw);
51015163}
51025164
5103READ16_MEMBER(ati_vga_device::mach8_scratch0_r)
5165READ16_MEMBER(mach8_device::mach8_scratch0_r)
51045166{
5105   return ati.scratch0;
5167   return mach8.scratch0;
51065168}
51075169
5108WRITE16_MEMBER(ati_vga_device::mach8_scratch0_w)
5170WRITE16_MEMBER(mach8_device::mach8_scratch0_w)
51095171{
5110   ati.scratch0 = data;
5172   mach8.scratch0 = data;
51115173   if(LOG_8514) logerror("Mach8: Scratch Pad 0 write %04x\n",data);
51125174}
51135175
5114READ16_MEMBER(ati_vga_device::mach8_scratch1_r)
5176READ16_MEMBER(mach8_device::mach8_scratch1_r)
51155177{
5116   return ati.scratch1;
5178   return mach8.scratch1;
51175179}
51185180
5119WRITE16_MEMBER(ati_vga_device::mach8_scratch1_w)
5181WRITE16_MEMBER(mach8_device::mach8_scratch1_w)
51205182{
5121   ati.scratch1 = data;
5183   mach8.scratch1 = data;
51225184   if(LOG_8514) logerror("Mach8: Scratch Pad 1 write %04x\n",data);
51235185}
51245186
r18277r18278
51355197    9-15  ROM_LOCATION. If bit 2 and 3 are 0 the ROM will be at this location:
51365198           0: C000h, 1: C080h, 2: C100h, .. 127: FF80h (unlikely)
51375199 */
5138READ16_MEMBER(ati_vga_device::mach8_config1_r)
5200READ16_MEMBER(mach8_device::mach8_config1_r)
51395201{
51405202   return 0x0082;
51415203}
r18277r18278
51485210       3  WRITE_PER_BIT. Write masked VRAM operations supported if set
51495211       4  FLASH_ENA. Flash page writes supported if set
51505212 */
5151READ16_MEMBER(ati_vga_device::mach8_config2_r)
5213READ16_MEMBER(mach8_device::mach8_config2_r)
51525214{
51535215   return 0x0002;
51545216}
trunk/src/emu/video/pc_vga.h
r18277r18278
1818
1919class vga_device :  public device_t
2020{
21   friend class ibm8514a_device;
22
2123public:
2224    // construction/destruction
2325    vga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
r18277r18278
204206   void svga_vh_rgb24(bitmap_rgb32 &bitmap, const rectangle &cliprect);
205207   void svga_vh_rgb32(bitmap_rgb32 &bitmap, const rectangle &cliprect);
206208   virtual UINT8 pc_vga_choosevideomode();
209   virtual void device_start();
207210   struct
208211   {
209212      UINT8 bank_r,bank_w;
r18277r18278
217220private:
218221};
219222
220// ======================> tseng_vga_device
223// ======================> ibm8514_device
221224
222class tseng_vga_device :  public svga_device
225class ibm8514a_device :  public device_t
223226{
224227public:
225    // construction/destruction
226    tseng_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
228   ibm8514a_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
229   ibm8514a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
227230
228   virtual READ8_MEMBER(port_03b0_r);
229   virtual WRITE8_MEMBER(port_03b0_w);
230   virtual READ8_MEMBER(port_03c0_r);
231   virtual WRITE8_MEMBER(port_03c0_w);
232   virtual READ8_MEMBER(port_03d0_r);
233   virtual WRITE8_MEMBER(port_03d0_w);
234   virtual READ8_MEMBER(mem_r);
235   virtual WRITE8_MEMBER(mem_w);
231   void set_vga(const char* tag) { m_vga_tag.cpy(tag); }
232   void set_vga_owner() { m_vga = dynamic_cast<vga_device*>(owner()); }
236233
237protected:
234   void enabled();
238235
239private:
240   void tseng_define_video_mode();
241   UINT8 tseng_crtc_reg_read(UINT8 index);
242   void tseng_crtc_reg_write(UINT8 index, UINT8 data);
243   UINT8 tseng_seq_reg_read(UINT8 index);
244   void tseng_seq_reg_write(UINT8 index, UINT8 data);
245
246   struct
247   {
248      UINT8 reg_3d8;
249      UINT8 dac_ctrl;
250      UINT8 dac_state;
251      UINT8 horz_overflow;
252      UINT8 aux_ctrl;
253      bool ext_reg_ena;
254   }et4k;
255
256};
257
258
259// device type definition
260extern const device_type TSENG_VGA;
261
262// ======================> trident_vga_device
263
264class trident_vga_device :  public svga_device
265{
266public:
267    // construction/destruction
268    trident_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
269
270   virtual READ8_MEMBER(port_03c0_r);
271   virtual WRITE8_MEMBER(port_03c0_w);
272   virtual READ8_MEMBER(port_03d0_r);
273   virtual WRITE8_MEMBER(port_03d0_w);
274   virtual READ8_MEMBER(mem_r);
275   virtual WRITE8_MEMBER(mem_w);
276
277protected:
278
279private:
280   UINT8 trident_seq_reg_read(UINT8 index);
281   void trident_seq_reg_write(UINT8 index, UINT8 data);
282
283};
284
285
286// device type definition
287extern const device_type TRIDENT_VGA;
288
289
290// ======================> ati_vga_device
291
292class ati_vga_device :  public svga_device
293{
294public:
295    // construction/destruction
296    ati_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
297    ati_vga_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
298
299   virtual READ8_MEMBER(mem_r);
300   virtual WRITE8_MEMBER(mem_w);
301
302   // VGA registers
303   virtual READ8_MEMBER(port_03c0_r);
304   READ8_MEMBER(ati_port_ext_r);
305   WRITE8_MEMBER(ati_port_ext_w);
306
307   // TODO: move 8514/A registers to their own device
308236   READ16_MEMBER(ibm8514_gpstatus_r);
309237   WRITE16_MEMBER(ibm8514_cmd_w);
310238   READ16_MEMBER(ibm8514_line_error_r);
r18277r18278
345273   WRITE16_MEMBER(ibm8514_foremix_w);
346274   READ16_MEMBER(ibm8514_pixel_xfer_r);
347275   WRITE16_MEMBER(ibm8514_pixel_xfer_w);
348
349   // extra registers for the Mach8
350   READ16_MEMBER(mach8_ec0_r);
351   WRITE16_MEMBER(mach8_ec0_w);
352   READ16_MEMBER(mach8_ec1_r);
353   WRITE16_MEMBER(mach8_ec1_w);
354   READ16_MEMBER(mach8_ec2_r);
355   WRITE16_MEMBER(mach8_ec2_w);
356   READ16_MEMBER(mach8_ec3_r);
357   WRITE16_MEMBER(mach8_ec3_w);
358   READ16_MEMBER(mach8_ext_fifo_r);
359   WRITE16_MEMBER(mach8_linedraw_index_w);
360   READ16_MEMBER(mach8_bresenham_count_r);
361   WRITE16_MEMBER(mach8_bresenham_count_w);
362   WRITE16_MEMBER(mach8_linedraw_w);
363   READ16_MEMBER(mach8_scratch0_r);
364   WRITE16_MEMBER(mach8_scratch0_w);
365   READ16_MEMBER(mach8_scratch1_r);
366   WRITE16_MEMBER(mach8_scratch1_w);
367   READ16_MEMBER(mach8_config1_r);
368   READ16_MEMBER(mach8_config2_r);
369protected:
370   virtual machine_config_constructor device_mconfig_additions() const;
371276   void ibm8514_wait_draw();
372277   struct
373278   {
r18277r18278
418323      UINT8 wait_vector_count;
419324
420325   } ibm8514;
326protected:
327   virtual void device_start();
328   virtual void device_config_complete();
421329private:
422   void ati_define_video_mode();
423330   void ibm8514_draw_vector(UINT8 len, UINT8 dir, bool draw);
424331   void ibm8514_wait_draw_ssv();
425332   void ibm8514_draw_ssv(UINT8 data);
426333   void ibm8514_wait_draw_vector();
334   void ibm8514_write_fg(UINT32 offset);
335   void ibm8514_write_bg(UINT32 offset);
336   void ibm8514_write(UINT32 offset, UINT32 src);
337
338   vga_device* m_vga;  // for pass-through
339   astring m_vga_tag;  // pass-through device tag
340   UINT8* m_vram;  // the original 8514/A has it's own VRAM, but most VGA+8514 combination cards will have
341               // only one set of VRAM, so this will only be needed in standalone 8514/A cards
342   UINT32 m_vramsize;
343};
344
345// device type definition
346extern const device_type IBM8514A;
347
348#define MCFG_8514A_ADD(_tag, _param) \
349      MCFG_DEVICE_ADD(_tag, IBM8514A, 0) \
350      downcast<ibm8514a_device*>(device)->set_vga(_param);
351
352#define MCFG_8514A_ADD_OWNER(_tag) \
353      MCFG_DEVICE_ADD(_tag, IBM8514A, 0) \
354      downcast<ibm8514a_device*>(device)->set_vga_owner();
355
356
357class mach8_device :  public ibm8514a_device
358{
359public:
360   mach8_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
361   mach8_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
362
363   READ16_MEMBER(mach8_ec0_r);
364   WRITE16_MEMBER(mach8_ec0_w);
365   READ16_MEMBER(mach8_ec1_r);
366   WRITE16_MEMBER(mach8_ec1_w);
367   READ16_MEMBER(mach8_ec2_r);
368   WRITE16_MEMBER(mach8_ec2_w);
369   READ16_MEMBER(mach8_ec3_r);
370   WRITE16_MEMBER(mach8_ec3_w);
371   READ16_MEMBER(mach8_ext_fifo_r);
372   WRITE16_MEMBER(mach8_linedraw_index_w);
373   READ16_MEMBER(mach8_bresenham_count_r);
374   WRITE16_MEMBER(mach8_bresenham_count_w);
375   WRITE16_MEMBER(mach8_linedraw_w);
376   READ16_MEMBER(mach8_linedraw_r);
377   READ16_MEMBER(mach8_scratch0_r);
378   WRITE16_MEMBER(mach8_scratch0_w);
379   READ16_MEMBER(mach8_scratch1_r);
380   WRITE16_MEMBER(mach8_scratch1_w);
381   READ16_MEMBER(mach8_config1_r);
382   READ16_MEMBER(mach8_config2_r);
383protected:
384   virtual void device_start();
427385   struct
428386   {
429      UINT8 ext_reg[64];
430      UINT8 ext_reg_select;
431387      UINT16 scratch0;
432388      UINT16 scratch1;
433389      UINT16 linedraw;
390   } mach8;
391};
392
393// device type definition
394extern const device_type MACH8;
395
396#define MCFG_MACH8_ADD(_tag, _param) \
397      MCFG_DEVICE_ADD(_tag, MACH8, 0) \
398      downcast<mach8_device*>(device)->set_vga(_param);
399
400#define MCFG_MACH8_ADD_OWNER(_tag) \
401      MCFG_DEVICE_ADD(_tag, MACH8, 0) \
402      downcast<mach8_device*>(device)->set_vga_owner();
403
404// ======================> tseng_vga_device
405
406class tseng_vga_device :  public svga_device
407{
408public:
409    // construction/destruction
410    tseng_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
411
412   virtual READ8_MEMBER(port_03b0_r);
413   virtual WRITE8_MEMBER(port_03b0_w);
414   virtual READ8_MEMBER(port_03c0_r);
415   virtual WRITE8_MEMBER(port_03c0_w);
416   virtual READ8_MEMBER(port_03d0_r);
417   virtual WRITE8_MEMBER(port_03d0_w);
418   virtual READ8_MEMBER(mem_r);
419   virtual WRITE8_MEMBER(mem_w);
420
421protected:
422   virtual void device_start();
423
424private:
425   void tseng_define_video_mode();
426   UINT8 tseng_crtc_reg_read(UINT8 index);
427   void tseng_crtc_reg_write(UINT8 index, UINT8 data);
428   UINT8 tseng_seq_reg_read(UINT8 index);
429   void tseng_seq_reg_write(UINT8 index, UINT8 data);
430
431   struct
432   {
433      UINT8 reg_3d8;
434      UINT8 dac_ctrl;
435      UINT8 dac_state;
436      UINT8 horz_overflow;
437      UINT8 aux_ctrl;
438      bool ext_reg_ena;
439   }et4k;
440
441};
442
443
444// device type definition
445extern const device_type TSENG_VGA;
446
447// ======================> trident_vga_device
448
449class trident_vga_device :  public svga_device
450{
451public:
452    // construction/destruction
453    trident_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
454
455   virtual READ8_MEMBER(port_03c0_r);
456   virtual WRITE8_MEMBER(port_03c0_w);
457   virtual READ8_MEMBER(port_03d0_r);
458   virtual WRITE8_MEMBER(port_03d0_w);
459   virtual READ8_MEMBER(mem_r);
460   virtual WRITE8_MEMBER(mem_w);
461
462protected:
463
464private:
465   UINT8 trident_seq_reg_read(UINT8 index);
466   void trident_seq_reg_write(UINT8 index, UINT8 data);
467
468};
469
470
471// device type definition
472extern const device_type TRIDENT_VGA;
473
474
475// ======================> ati_vga_device
476
477class ati_vga_device :  public svga_device
478{
479public:
480    // construction/destruction
481    ati_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
482    ati_vga_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
483
484   virtual READ8_MEMBER(mem_r);
485   virtual WRITE8_MEMBER(mem_w);
486
487   // VGA registers
488   virtual READ8_MEMBER(port_03c0_r);
489   READ8_MEMBER(ati_port_ext_r);
490   WRITE8_MEMBER(ati_port_ext_w);
491
492   virtual machine_config_constructor device_mconfig_additions() const;
493
494   mach8_device* get_8514() { return m_8514; }
495protected:
496    virtual void device_start();
497private:
498   void ati_define_video_mode();
499   struct
500   {
501      UINT8 ext_reg[64];
502      UINT8 ext_reg_select;
434503   } ati;
435   void ibm8514_write_fg(UINT32 offset);
436   void ibm8514_write_bg(UINT32 offset);
437   void ibm8514_write(UINT32 offset, UINT32 src);
504   mach8_device* m_8514;
438505};
439506
440507// device type definition
r18277r18278
457524   virtual WRITE8_MEMBER(port_03d0_w);
458525   virtual READ8_MEMBER(mem_r);
459526   virtual WRITE8_MEMBER(mem_w);
460   
527
461528   virtual UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
462   
463   READ16_MEMBER(s3_gpstatus_r);
464   WRITE16_MEMBER(s3_cmd_w);
465   
529
530   virtual machine_config_constructor device_mconfig_additions() const;
531
532   ibm8514a_device* get_8514() { return m_8514; }
466533protected:
467534    // device-level overrides
468535    virtual void device_start();
r18277r18278
492559      UINT8 cursor_fg_ptr;
493560      UINT8 cursor_bg_ptr;
494561      UINT8 extended_dac_ctrl;
495   } s3;   
562   } s3;
496563private:
497564   UINT8 s3_crtc_reg_read(UINT8 index);
498565   void s3_define_video_mode(void);
499566   void s3_crtc_reg_write(UINT8 index, UINT8 data);
567   ibm8514a_device* m_8514;
500568};
501569
502
503570// device type definition
504571extern const device_type S3_VGA;
505572
r18277r18278
591658  ROM_LOAD("oakvga.bin", 0xc0000, 0x8000, CRC(318c5f43))
592659*/
593660
661
594662#endif /* PC_VGA_H */
595663
trunk/src/mess/video/isa_svga_s3.c
r18277r18278
7575   set_isa_device();
7676
7777   m_vga = subdevice<s3_vga_device>("vga");
78   
78   m_8514 = subdevice<ibm8514a_device>("vga:8514a");
79
7980   m_isa->install_rom(this, 0xc0000, 0xc7fff, 0, 0, "svga", "s3_764");
8081
8182   m_isa->install_device(0x03b0, 0x03bf, 0, 0, read8_delegate(FUNC(s3_vga_device::port_03b0_r),m_vga), write8_delegate(FUNC(s3_vga_device::port_03b0_w),m_vga));
8283   m_isa->install_device(0x03c0, 0x03cf, 0, 0, read8_delegate(FUNC(s3_vga_device::port_03c0_r),m_vga), write8_delegate(FUNC(s3_vga_device::port_03c0_w),m_vga));
8384   m_isa->install_device(0x03d0, 0x03df, 0, 0, read8_delegate(FUNC(s3_vga_device::port_03d0_r),m_vga), write8_delegate(FUNC(s3_vga_device::port_03d0_w),m_vga));
84   m_isa->install16_device(0x82e8, 0x82eb, 0, 0, read16_delegate(FUNC(s3_vga_device::ibm8514_currenty_r),m_vga), write16_delegate(FUNC(s3_vga_device::ibm8514_currenty_w),m_vga));
85   m_isa->install16_device(0x86e8, 0x86eb, 0, 0, read16_delegate(FUNC(s3_vga_device::ibm8514_currentx_r),m_vga), write16_delegate(FUNC(s3_vga_device::ibm8514_currentx_w),m_vga));
86   m_isa->install16_device(0x8ae8, 0x8aeb, 0, 0, read16_delegate(FUNC(s3_vga_device::ibm8514_desty_r),m_vga), write16_delegate(FUNC(s3_vga_device::ibm8514_desty_w),m_vga));
87   m_isa->install16_device(0x8ee8, 0x8eeb, 0, 0, read16_delegate(FUNC(s3_vga_device::ibm8514_destx_r),m_vga), write16_delegate(FUNC(s3_vga_device::ibm8514_destx_w),m_vga));
88   m_isa->install16_device(0x92e8, 0x92eb, 0, 0, read16_delegate(FUNC(s3_vga_device::ibm8514_line_error_r),m_vga), write16_delegate(FUNC(s3_vga_device::ibm8514_line_error_w),m_vga));
89   m_isa->install16_device(0x96e8, 0x96eb, 0, 0, read16_delegate(FUNC(s3_vga_device::ibm8514_width_r),m_vga), write16_delegate(FUNC(s3_vga_device::ibm8514_width_w),m_vga));
90   m_isa->install16_device(0x9ae8, 0x9aeb, 0, 0, read16_delegate(FUNC(s3_vga_device::s3_gpstatus_r),m_vga), write16_delegate(FUNC(s3_vga_device::s3_cmd_w),m_vga));
91   m_isa->install16_device(0x9ee8, 0x9eeb, 0, 0, read16_delegate(FUNC(s3_vga_device::ibm8514_ssv_r),m_vga), write16_delegate(FUNC(s3_vga_device::ibm8514_ssv_w),m_vga));
92   m_isa->install16_device(0xa2e8, 0xa2eb, 0, 0, read16_delegate(FUNC(s3_vga_device::ibm8514_bgcolour_r),m_vga), write16_delegate(FUNC(s3_vga_device::ibm8514_bgcolour_w),m_vga));
93   m_isa->install16_device(0xa6e8, 0xa6eb, 0, 0, read16_delegate(FUNC(s3_vga_device::ibm8514_fgcolour_r),m_vga), write16_delegate(FUNC(s3_vga_device::ibm8514_fgcolour_w),m_vga));
94   m_isa->install16_device(0xb6e8, 0xb6eb, 0, 0, read16_delegate(FUNC(s3_vga_device::ibm8514_backmix_r),m_vga), write16_delegate(FUNC(s3_vga_device::ibm8514_backmix_w),m_vga));
95   m_isa->install16_device(0xbae8, 0xbaeb, 0, 0, read16_delegate(FUNC(s3_vga_device::ibm8514_foremix_r),m_vga), write16_delegate(FUNC(s3_vga_device::ibm8514_foremix_w),m_vga));
96   m_isa->install16_device(0xbee8, 0xbeeb, 0, 0, read16_delegate(FUNC(s3_vga_device::ibm8514_multifunc_r),m_vga), write16_delegate(FUNC(s3_vga_device::ibm8514_multifunc_w),m_vga));
97   m_isa->install16_device(0xe2e8, 0xe2eb, 0, 0, read16_delegate(FUNC(s3_vga_device::ibm8514_pixel_xfer_r),m_vga), write16_delegate(FUNC(s3_vga_device::ibm8514_pixel_xfer_w),m_vga));
85   m_isa->install16_device(0x82e8, 0x82eb, 0, 0, read16_delegate(FUNC(ibm8514a_device::ibm8514_currenty_r),m_8514), write16_delegate(FUNC(ibm8514a_device::ibm8514_currenty_w),m_8514));
86   m_isa->install16_device(0x86e8, 0x86eb, 0, 0, read16_delegate(FUNC(ibm8514a_device::ibm8514_currentx_r),m_8514), write16_delegate(FUNC(ibm8514a_device::ibm8514_currentx_w),m_8514));
87   m_isa->install16_device(0x8ae8, 0x8aeb, 0, 0, read16_delegate(FUNC(ibm8514a_device::ibm8514_desty_r),m_8514), write16_delegate(FUNC(ibm8514a_device::ibm8514_desty_w),m_8514));
88   m_isa->install16_device(0x8ee8, 0x8eeb, 0, 0, read16_delegate(FUNC(ibm8514a_device::ibm8514_destx_r),m_8514), write16_delegate(FUNC(ibm8514a_device::ibm8514_destx_w),m_8514));
89   m_isa->install16_device(0x92e8, 0x92eb, 0, 0, read16_delegate(FUNC(ibm8514a_device::ibm8514_line_error_r),m_8514), write16_delegate(FUNC(ibm8514a_device::ibm8514_line_error_w),m_8514));
90   m_isa->install16_device(0x96e8, 0x96eb, 0, 0, read16_delegate(FUNC(ibm8514a_device::ibm8514_width_r),m_8514), write16_delegate(FUNC(ibm8514a_device::ibm8514_width_w),m_8514));
91   m_isa->install16_device(0x9ae8, 0x9aeb, 0, 0, read16_delegate(FUNC(ibm8514a_device::ibm8514_gpstatus_r),m_8514), write16_delegate(FUNC(ibm8514a_device::ibm8514_cmd_w),m_8514));
92   m_isa->install16_device(0x9ee8, 0x9eeb, 0, 0, read16_delegate(FUNC(ibm8514a_device::ibm8514_ssv_r),m_8514), write16_delegate(FUNC(ibm8514a_device::ibm8514_ssv_w),m_8514));
93   m_isa->install16_device(0xa2e8, 0xa2eb, 0, 0, read16_delegate(FUNC(ibm8514a_device::ibm8514_bgcolour_r),m_8514), write16_delegate(FUNC(ibm8514a_device::ibm8514_bgcolour_w),m_8514));
94   m_isa->install16_device(0xa6e8, 0xa6eb, 0, 0, read16_delegate(FUNC(ibm8514a_device::ibm8514_fgcolour_r),m_8514), write16_delegate(FUNC(ibm8514a_device::ibm8514_fgcolour_w),m_8514));
95   m_isa->install16_device(0xb6e8, 0xb6eb, 0, 0, read16_delegate(FUNC(ibm8514a_device::ibm8514_backmix_r),m_8514), write16_delegate(FUNC(ibm8514a_device::ibm8514_backmix_w),m_8514));
96   m_isa->install16_device(0xbae8, 0xbaeb, 0, 0, read16_delegate(FUNC(ibm8514a_device::ibm8514_foremix_r),m_8514), write16_delegate(FUNC(ibm8514a_device::ibm8514_foremix_w),m_8514));
97   m_isa->install16_device(0xbee8, 0xbeeb, 0, 0, read16_delegate(FUNC(ibm8514a_device::ibm8514_multifunc_r),m_8514), write16_delegate(FUNC(ibm8514a_device::ibm8514_multifunc_w),m_8514));
98   m_isa->install16_device(0xe2e8, 0xe2eb, 0, 0, read16_delegate(FUNC(ibm8514a_device::ibm8514_pixel_xfer_r),m_8514), write16_delegate(FUNC(ibm8514a_device::ibm8514_pixel_xfer_w),m_8514));
9899
99100   m_isa->install_memory(0xa0000, 0xbffff, 0, 0, read8_delegate(FUNC(s3_vga_device::mem_r),m_vga), write8_delegate(FUNC(s3_vga_device::mem_w),m_vga));
100101}
trunk/src/mess/video/isa_svga_s3.h
r18277r18278
3232        virtual void device_reset();
3333private:     
3434      s3_vga_device *m_vga;
35      ibm8514a_device *m_8514;
3536};
3637
3738
trunk/src/mess/video/isa_vga_ati.c
r18277r18278
7777   set_isa_device();
7878
7979   m_vga = subdevice<ati_vga_device>("vga");
80   m_8514 = subdevice<mach8_device>("vga:8514a");
8081   
8182   m_isa->install_rom(this, 0xc0000, 0xc7fff, 0, 0, "vga", "gfxultra");
8283
8384   m_isa->install_device(0x1ce, 0x1cf, 0, 0, read8_delegate(FUNC(ati_vga_device::ati_port_ext_r),m_vga), write8_delegate(FUNC(ati_vga_device::ati_port_ext_w),m_vga));
84   m_isa->install16_device(0x2e8, 0x2eb, 0, 0, read16_delegate(FUNC(ati_vga_device::ibm8514_status_r),m_vga), write16_delegate(FUNC(ati_vga_device::ibm8514_htotal_w),m_vga));
85   m_isa->install16_device(0x2e8, 0x2eb, 0, 0, read16_delegate(FUNC(mach8_device::ibm8514_status_r),m_8514), write16_delegate(FUNC(mach8_device::ibm8514_htotal_w),m_8514));
8586   m_isa->install_device(0x3b0, 0x3bf, 0, 0, read8_delegate(FUNC(ati_vga_device::port_03b0_r),m_vga), write8_delegate(FUNC(vga_device::port_03b0_w),m_vga));
8687   m_isa->install_device(0x3c0, 0x3cf, 0, 0, read8_delegate(FUNC(ati_vga_device::port_03c0_r),m_vga), write8_delegate(FUNC(vga_device::port_03c0_w),m_vga));
8788   m_isa->install_device(0x3d0, 0x3df, 0, 0, read8_delegate(FUNC(ati_vga_device::port_03d0_r),m_vga), write8_delegate(FUNC(vga_device::port_03d0_w),m_vga));
88   m_isa->install16_device(0x12e8, 0x12eb, 0, 0, read16_delegate(FUNC(ati_vga_device::ibm8514_vtotal_r),m_vga), write16_delegate(FUNC(ati_vga_device::ibm8514_vtotal_w),m_vga));
89   m_isa->install16_device(0x12ec, 0x12ef, 0, 0, read16_delegate(FUNC(ati_vga_device::mach8_config1_r),m_vga), write16_delegate());
90   m_isa->install16_device(0x16e8, 0x16eb, 0, 0, read16_delegate(FUNC(ati_vga_device::ibm8514_vdisp_r),m_vga), write16_delegate(FUNC(ati_vga_device::ibm8514_vdisp_w),m_vga));
91   m_isa->install16_device(0x16ec, 0x16ef, 0, 0, read16_delegate(FUNC(ati_vga_device::mach8_config2_r),m_vga), write16_delegate());
92   m_isa->install16_device(0x1ae8, 0x1aeb, 0, 0, read16_delegate(FUNC(ati_vga_device::ibm8514_vsync_r),m_vga), write16_delegate(FUNC(ati_vga_device::ibm8514_vsync_w),m_vga));
93   m_isa->install16_device(0x26e8, 0x26eb, 0, 0, read16_delegate(FUNC(ati_vga_device::ibm8514_htotal_r),m_vga),write16_delegate());
94   m_isa->install16_device(0x2ee8, 0x2eeb, 0, 0, read16_delegate(FUNC(ati_vga_device::ibm8514_subcontrol_r),m_vga),write16_delegate());
95   m_isa->install16_device(0x42e8, 0x42eb, 0, 0, read16_delegate(FUNC(ati_vga_device::ibm8514_substatus_r),m_vga), write16_delegate(FUNC(ati_vga_device::ibm8514_subcontrol_w),m_vga));
96   m_isa->install16_device(0x52e8, 0x52eb, 0, 0, read16_delegate(FUNC(ati_vga_device::mach8_ec0_r),m_vga), write16_delegate(FUNC(ati_vga_device::mach8_ec0_w),m_vga));
97   m_isa->install16_device(0x52ec, 0x52ef, 0, 0, read16_delegate(FUNC(ati_vga_device::mach8_scratch0_r),m_vga), write16_delegate(FUNC(ati_vga_device::mach8_scratch0_w),m_vga));
98   m_isa->install16_device(0x56e8, 0x56eb, 0, 0, read16_delegate(FUNC(ati_vga_device::mach8_ec1_r),m_vga), write16_delegate(FUNC(ati_vga_device::mach8_ec1_w),m_vga));
99   m_isa->install16_device(0x56ec, 0x56ef, 0, 0, read16_delegate(FUNC(ati_vga_device::mach8_scratch0_r),m_vga), write16_delegate(FUNC(ati_vga_device::mach8_scratch0_w),m_vga));
100   m_isa->install16_device(0x5ae8, 0x5aeb, 0, 0, read16_delegate(FUNC(ati_vga_device::mach8_ec2_r),m_vga), write16_delegate(FUNC(ati_vga_device::mach8_ec2_w),m_vga));
101   m_isa->install16_device(0x5ee8, 0x5eeb, 0, 0, read16_delegate(FUNC(ati_vga_device::mach8_ec3_r),m_vga), write16_delegate(FUNC(ati_vga_device::mach8_ec3_w),m_vga));
102   m_isa->install16_device(0x82e8, 0x82eb, 0, 0, read16_delegate(FUNC(ati_vga_device::ibm8514_currenty_r),m_vga), write16_delegate(FUNC(ati_vga_device::ibm8514_currenty_w),m_vga));
103   m_isa->install16_device(0x86e8, 0x86eb, 0, 0, read16_delegate(FUNC(ati_vga_device::ibm8514_currentx_r),m_vga), write16_delegate(FUNC(ati_vga_device::ibm8514_currentx_w),m_vga));
104   m_isa->install16_device(0x8ae8, 0x8aeb, 0, 0, read16_delegate(FUNC(ati_vga_device::ibm8514_desty_r),m_vga), write16_delegate(FUNC(ati_vga_device::ibm8514_desty_w),m_vga));
105   m_isa->install16_device(0x8ee8, 0x8eeb, 0, 0, read16_delegate(FUNC(ati_vga_device::ibm8514_destx_r),m_vga), write16_delegate(FUNC(ati_vga_device::ibm8514_destx_w),m_vga));
106   m_isa->install16_device(0x92e8, 0x92eb, 0, 0, read16_delegate(FUNC(ati_vga_device::ibm8514_line_error_r),m_vga), write16_delegate(FUNC(ati_vga_device::ibm8514_line_error_w),m_vga));
107   m_isa->install16_device(0x96e8, 0x96eb, 0, 0, read16_delegate(FUNC(ati_vga_device::ibm8514_width_r),m_vga), write16_delegate(FUNC(ati_vga_device::ibm8514_width_w),m_vga));
108   m_isa->install16_device(0x96ec, 0x96ef, 0, 0, read16_delegate(FUNC(ati_vga_device::mach8_bresenham_count_r),m_vga), write16_delegate(FUNC(ati_vga_device::mach8_bresenham_count_w),m_vga));
109   m_isa->install16_device(0x9ae8, 0x9aeb, 0, 0, read16_delegate(FUNC(ati_vga_device::ibm8514_gpstatus_r),m_vga), write16_delegate(FUNC(ati_vga_device::ibm8514_cmd_w),m_vga));
110   m_isa->install16_device(0x9aec, 0x9aef, 0, 0, read16_delegate(FUNC(ati_vga_device::mach8_ext_fifo_r),m_vga), write16_delegate(FUNC(ati_vga_device::mach8_linedraw_index_w),m_vga));
111   m_isa->install16_device(0x9ee8, 0x9eeb, 0, 0, read16_delegate(FUNC(ati_vga_device::ibm8514_ssv_r),m_vga), write16_delegate(FUNC(ati_vga_device::ibm8514_ssv_w),m_vga));
112   m_isa->install16_device(0xa2e8, 0xa2eb, 0, 0, read16_delegate(FUNC(ati_vga_device::ibm8514_bgcolour_r),m_vga), write16_delegate(FUNC(ati_vga_device::ibm8514_bgcolour_w),m_vga));
113   m_isa->install16_device(0xa6e8, 0xa6eb, 0, 0, read16_delegate(FUNC(ati_vga_device::ibm8514_fgcolour_r),m_vga), write16_delegate(FUNC(ati_vga_device::ibm8514_fgcolour_w),m_vga));
114   m_isa->install16_device(0xb6e8, 0xb6eb, 0, 0, read16_delegate(FUNC(ati_vga_device::ibm8514_backmix_r),m_vga), write16_delegate(FUNC(ati_vga_device::ibm8514_backmix_w),m_vga));
115   m_isa->install16_device(0xbae8, 0xbaeb, 0, 0, read16_delegate(FUNC(ati_vga_device::ibm8514_foremix_r),m_vga), write16_delegate(FUNC(ati_vga_device::ibm8514_foremix_w),m_vga));
116   m_isa->install16_device(0xbee8, 0xbeeb, 0, 0, read16_delegate(FUNC(ati_vga_device::ibm8514_multifunc_r),m_vga), write16_delegate(FUNC(ati_vga_device::ibm8514_multifunc_w),m_vga));
117   m_isa->install16_device(0xe2e8, 0xe2eb, 0, 0, read16_delegate(FUNC(ati_vga_device::ibm8514_pixel_xfer_r),m_vga), write16_delegate(FUNC(ati_vga_device::ibm8514_pixel_xfer_w),m_vga));
118   m_isa->install16_device(0xfeec, 0xfeef, 0, 0, read16_delegate(), write16_delegate(FUNC(ati_vga_device::mach8_linedraw_w),m_vga));
89   m_isa->install16_device(0x12e8, 0x12eb, 0, 0, read16_delegate(FUNC(mach8_device::ibm8514_vtotal_r),m_8514), write16_delegate(FUNC(mach8_device::ibm8514_vtotal_w),m_8514));
90   m_isa->install16_device(0x12ec, 0x12ef, 0, 0, read16_delegate(FUNC(mach8_device::mach8_config1_r),m_8514), write16_delegate());
91   m_isa->install16_device(0x16e8, 0x16eb, 0, 0, read16_delegate(FUNC(mach8_device::ibm8514_vdisp_r),m_8514), write16_delegate(FUNC(mach8_device::ibm8514_vdisp_w),m_8514));
92   m_isa->install16_device(0x16ec, 0x16ef, 0, 0, read16_delegate(FUNC(mach8_device::mach8_config2_r),m_8514), write16_delegate());
93   m_isa->install16_device(0x1ae8, 0x1aeb, 0, 0, read16_delegate(FUNC(mach8_device::ibm8514_vsync_r),m_8514), write16_delegate(FUNC(mach8_device::ibm8514_vsync_w),m_8514));
94   m_isa->install16_device(0x26e8, 0x26eb, 0, 0, read16_delegate(FUNC(mach8_device::ibm8514_htotal_r),m_8514),write16_delegate());
95   m_isa->install16_device(0x2ee8, 0x2eeb, 0, 0, read16_delegate(FUNC(mach8_device::ibm8514_subcontrol_r),m_8514),write16_delegate());
96   m_isa->install16_device(0x42e8, 0x42eb, 0, 0, read16_delegate(FUNC(mach8_device::ibm8514_substatus_r),m_8514), write16_delegate(FUNC(mach8_device::ibm8514_subcontrol_w),m_8514));
97   m_isa->install16_device(0x52e8, 0x52eb, 0, 0, read16_delegate(FUNC(mach8_device::mach8_ec0_r),m_8514), write16_delegate(FUNC(mach8_device::mach8_ec0_w),m_8514));
98   m_isa->install16_device(0x52ec, 0x52ef, 0, 0, read16_delegate(FUNC(mach8_device::mach8_scratch0_r),m_8514), write16_delegate(FUNC(mach8_device::mach8_scratch0_w),m_8514));
99   m_isa->install16_device(0x56e8, 0x56eb, 0, 0, read16_delegate(FUNC(mach8_device::mach8_ec1_r),m_8514), write16_delegate(FUNC(mach8_device::mach8_ec1_w),m_8514));
100   m_isa->install16_device(0x56ec, 0x56ef, 0, 0, read16_delegate(FUNC(mach8_device::mach8_scratch0_r),m_8514), write16_delegate(FUNC(mach8_device::mach8_scratch0_w),m_8514));
101   m_isa->install16_device(0x5ae8, 0x5aeb, 0, 0, read16_delegate(FUNC(mach8_device::mach8_ec2_r),m_8514), write16_delegate(FUNC(mach8_device::mach8_ec2_w),m_8514));
102   m_isa->install16_device(0x5ee8, 0x5eeb, 0, 0, read16_delegate(FUNC(mach8_device::mach8_ec3_r),m_8514), write16_delegate(FUNC(mach8_device::mach8_ec3_w),m_8514));
103   m_isa->install16_device(0x82e8, 0x82eb, 0, 0, read16_delegate(FUNC(mach8_device::ibm8514_currenty_r),m_8514), write16_delegate(FUNC(mach8_device::ibm8514_currenty_w),m_8514));
104   m_isa->install16_device(0x86e8, 0x86eb, 0, 0, read16_delegate(FUNC(mach8_device::ibm8514_currentx_r),m_8514), write16_delegate(FUNC(mach8_device::ibm8514_currentx_w),m_8514));
105   m_isa->install16_device(0x8ae8, 0x8aeb, 0, 0, read16_delegate(FUNC(mach8_device::ibm8514_desty_r),m_8514), write16_delegate(FUNC(mach8_device::ibm8514_desty_w),m_8514));
106   m_isa->install16_device(0x8ee8, 0x8eeb, 0, 0, read16_delegate(FUNC(mach8_device::ibm8514_destx_r),m_8514), write16_delegate(FUNC(mach8_device::ibm8514_destx_w),m_8514));
107   m_isa->install16_device(0x92e8, 0x92eb, 0, 0, read16_delegate(FUNC(mach8_device::ibm8514_line_error_r),m_8514), write16_delegate(FUNC(mach8_device::ibm8514_line_error_w),m_8514));
108   m_isa->install16_device(0x96e8, 0x96eb, 0, 0, read16_delegate(FUNC(mach8_device::ibm8514_width_r),m_8514), write16_delegate(FUNC(mach8_device::ibm8514_width_w),m_8514));
109   m_isa->install16_device(0x96ec, 0x96ef, 0, 0, read16_delegate(FUNC(mach8_device::mach8_bresenham_count_r),m_8514), write16_delegate(FUNC(mach8_device::mach8_bresenham_count_w),m_8514));
110   m_isa->install16_device(0x9ae8, 0x9aeb, 0, 0, read16_delegate(FUNC(mach8_device::ibm8514_gpstatus_r),m_8514), write16_delegate(FUNC(mach8_device::ibm8514_cmd_w),m_8514));
111   m_isa->install16_device(0x9aec, 0x9aef, 0, 0, read16_delegate(FUNC(mach8_device::mach8_ext_fifo_r),m_8514), write16_delegate(FUNC(mach8_device::mach8_linedraw_index_w),m_8514));
112   m_isa->install16_device(0x9ee8, 0x9eeb, 0, 0, read16_delegate(FUNC(mach8_device::ibm8514_ssv_r),m_8514), write16_delegate(FUNC(mach8_device::ibm8514_ssv_w),m_8514));
113   m_isa->install16_device(0xa2e8, 0xa2eb, 0, 0, read16_delegate(FUNC(mach8_device::ibm8514_bgcolour_r),m_8514), write16_delegate(FUNC(mach8_device::ibm8514_bgcolour_w),m_8514));
114   m_isa->install16_device(0xa6e8, 0xa6eb, 0, 0, read16_delegate(FUNC(mach8_device::ibm8514_fgcolour_r),m_8514), write16_delegate(FUNC(mach8_device::ibm8514_fgcolour_w),m_8514));
115   m_isa->install16_device(0xb6e8, 0xb6eb, 0, 0, read16_delegate(FUNC(mach8_device::ibm8514_backmix_r),m_8514), write16_delegate(FUNC(mach8_device::ibm8514_backmix_w),m_8514));
116   m_isa->install16_device(0xbae8, 0xbaeb, 0, 0, read16_delegate(FUNC(mach8_device::ibm8514_foremix_r),m_8514), write16_delegate(FUNC(mach8_device::ibm8514_foremix_w),m_8514));
117   m_isa->install16_device(0xbee8, 0xbeeb, 0, 0, read16_delegate(FUNC(mach8_device::ibm8514_multifunc_r),m_8514), write16_delegate(FUNC(mach8_device::ibm8514_multifunc_w),m_8514));
118   m_isa->install16_device(0xe2e8, 0xe2eb, 0, 0, read16_delegate(FUNC(mach8_device::ibm8514_pixel_xfer_r),m_8514), write16_delegate(FUNC(mach8_device::ibm8514_pixel_xfer_w),m_8514));
119   m_isa->install16_device(0xfeec, 0xfeef, 0, 0, read16_delegate(FUNC(mach8_device::mach8_linedraw_r),m_8514), write16_delegate(FUNC(mach8_device::mach8_linedraw_w),m_8514));
119120
120121   m_isa->install_memory(0xa0000, 0xbffff, 0, 0, read8_delegate(FUNC(ati_vga_device::mem_r),m_vga), write8_delegate(FUNC(ati_vga_device::mem_w),m_vga));
121122}
trunk/src/mess/video/isa_vga_ati.h
r18277r18278
3838        virtual void device_start();
3939        virtual void device_reset();
4040private:     
41      ati_vga_device *m_vga;     
41      ati_vga_device *m_vga;
42      mach8_device *m_8514;
4243};
4344
4445

Previous 199869 Revisions Next


© 1997-2024 The MAME Team