Previous 199869 Revisions Next

r32062 Thursday 11th September, 2014 at 10:43:29 UTC by Barry Rodewald
trident: added DAC command register, so that we can tell when in a 15 or 16 bit mode.
[src/emu/bus/isa]trident.c trident.h

trunk/src/emu/bus/isa/trident.c
r32061r32062
2929void trident_vga_device::device_reset()
3030{
3131   svga_device::device_reset();
32   svga.id = 0xd3;  // identifies at TGUI9660XGi (closest known to the 9680)
32   svga.id = 0xd3;  // identifies at TGUI9660XGi
33   tri.revision = 0x01;  // revision identifies as TGUI9680
3334   tri.new_mode = false;  // start up in old mode
35   tri.dac_active = false;
3436}
3537
38UINT16 trident_vga_device::offset()
39{
40   UINT16 off = svga_device::offset();
41   return off;
42}
43
3644void trident_vga_device::trident_define_video_mode()
3745{
3846   int divisor = 1;
r32061r32062
7482   {
7583   case 0:
7684   default: if(!(tri.pixel_depth & 0x10)) svga.rgb8_en = 1; break;
77   case 1:  svga.rgb16_en = 1; break; // for 15 or 16 bit modes, can we tell the difference?
85   case 1:  if((tri.dac & 0xf0) == 0x30) svga.rgb16_en = 1; else svga.rgb15_en = 1; break;
7886   case 2:  svga.rgb32_en = 1; break;
7987   }
8088
r32061r32062
93101   {
94102      switch(index)
95103      {
104         case 0x09:
105            res = tri.revision;
106            break;
96107         case 0x0b:
97108            res = svga.id;
98109            tri.new_mode = true;
r32061r32062
125136
126137void trident_vga_device::trident_seq_reg_write(UINT8 index, UINT8 data)
127138{
139   //logerror("Trident SR%02X: %s mode write %02x\n",index,tri.new_mode ? "new" : "old",data);
128140   if(index <= 0x04)
129141   {
130142      vga.sequencer.data[vga.sequencer.index] = data;
r32061r32062
205217}
206218void trident_vga_device::trident_crtc_reg_write(UINT8 index, UINT8 data)
207219{
220   //logerror("Trident CR%02X: write %02x\n",index,data);
208221   if(index <= 0x18)
209222   {
210223      crtc_reg_write(index,data);
r32061r32062
254267
255268void trident_vga_device::trident_gc_reg_write(UINT8 index, UINT8 data)
256269{
270   //logerror("Trident GC%02X: write %02x\n",index,data);
257271   if(index <= 0x0d)
258272      gc_reg_write(index,data);
259273   else
r32061r32062
287301      case 0x05:
288302         res = trident_seq_reg_read(vga.sequencer.index);
289303         break;
304      case 0x06:
305         tri.dac_count++;
306         if(tri.dac_count > 3)
307            tri.dac_active = true;
308         if(tri.dac_active)
309            res = tri.dac;
310         else
311            res = vga_device::port_03c0_r(space,offset,mem_mask);
312         break;
313      case 0x07:
314      case 0x08:
315      case 0x09:
316         tri.dac_active = false;
317         tri.dac_count = 0;
318         res = vga_device::port_03c0_r(space,offset,mem_mask);
319         break;
290320      case 0x0f:
291321         res = trident_gc_reg_read(vga.gc.index);
292322         break;
r32061r32062
305335      case 0x05:
306336         trident_seq_reg_write(vga.sequencer.index,data);
307337         break;
338      case 0x06:
339         if(tri.dac_active)
340         {
341            tri.dac = data;  // DAC command register
342            tri.dac_active = false;
343            tri.dac_count = 0;
344            trident_define_video_mode();
345         }
346         else
347            vga_device::port_03c0_w(space,offset,data,mem_mask);
348         break;
349      case 0x07:
350      case 0x08:
351      case 0x09:
352         tri.dac_active = false;
353         tri.dac_count = 0;
354         vga_device::port_03c0_w(space,offset,data,mem_mask);
355         break;
308356      case 0x0f:
309357         trident_gc_reg_write(vga.gc.index,data);
310358         break;
trunk/src/emu/bus/isa/trident.h
r32061r32062
2222   virtual WRITE8_MEMBER(port_03d0_w);
2323   virtual READ8_MEMBER(mem_r);
2424   virtual WRITE8_MEMBER(mem_w);
25   virtual UINT16 offset();
2526protected:
2627   virtual void device_start();
2728   virtual void device_reset();
r32061r32062
3637      UINT8 gc0e;
3738      UINT8 gc0f;
3839      UINT8 cr1f;
40      UINT8 dac;
3941      bool new_mode;
4042      bool port_3c3;
4143      UINT8 clock;
4244      UINT8 pixel_depth;
45      UINT8 revision;
46      bool dac_active;
47      UINT8 dac_count;
4348   } tri;
4449private:
4550   UINT8 trident_seq_reg_read(UINT8 index);

Previous 199869 Revisions Next


© 1997-2024 The MAME Team