Previous 199869 Revisions Next

r18795 Wednesday 31st October, 2012 at 12:50:18 UTC by Miodrag Milanović
initial support for Wyse-700 graphics card based on findings of John Elliott (no whatsnew)
[src/mess/drivers]at.c
[src/mess/video]isa_cga.c isa_cga.h

trunk/src/mess/video/isa_cga.c
r18794r18795
683683   m_chr_gen_offset[0] = m_chr_gen_offset[2] = 0x1800;
684684   m_chr_gen_offset[1] = m_chr_gen_offset[3] = 0x1000;
685685   m_font_selection_mask = 0x01;
686   m_start_offset = 0;
686687}
687688
688689isa8_cga_device::isa8_cga_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) :
r18794r18795
693694   m_chr_gen_offset[0] = m_chr_gen_offset[2] = 0x1800;
694695   m_chr_gen_offset[1] = m_chr_gen_offset[3] = 0x1000;
695696   m_font_selection_mask = 0x01;
697   m_start_offset = 0;
696698}
697699
698700
r18794r18795
887889static MC6845_UPDATE_ROW( cga_text_inten_update_row )
888890{
889891   isa8_cga_device   *cga  = downcast<isa8_cga_device *>(device->owner());
890   UINT8 *videoram = cga->m_vram;
892   UINT8 *videoram = cga->m_vram + cga->m_start_offset;
891893   UINT32  *p = &bitmap.pix32(y);
892894   const rgb_t *palette = palette_entry_list_raw(bitmap.palette());
893895   int i;
r18794r18795
928930static MC6845_UPDATE_ROW( cga_text_inten_comp_grey_update_row )
929931{
930932   isa8_cga_device *cga  = downcast<isa8_cga_device *>(device->owner());
931   UINT8 *videoram = cga->m_vram;
933   UINT8 *videoram = cga->m_vram + cga->m_start_offset;
932934   UINT32  *p = &bitmap.pix32(y);
933935   const rgb_t *palette = palette_entry_list_raw(bitmap.palette());
934936   int i;
r18794r18795
968970static MC6845_UPDATE_ROW( cga_text_inten_alt_update_row )
969971{
970972   isa8_cga_device *cga  = downcast<isa8_cga_device *>(device->owner());
971   UINT8 *videoram = cga->m_vram;
973   UINT8 *videoram = cga->m_vram + cga->m_start_offset;
972974   UINT32  *p = &bitmap.pix32(y);
973975   const rgb_t *palette = palette_entry_list_raw(bitmap.palette());
974976   int i;
r18794r18795
10081010static MC6845_UPDATE_ROW( cga_text_blink_update_row )
10091011{
10101012   isa8_cga_device *cga  = downcast<isa8_cga_device *>(device->owner());
1011   UINT8 *videoram = cga->m_vram;
1013   UINT8 *videoram = cga->m_vram + cga->m_start_offset;
10121014   UINT32  *p = &bitmap.pix32(y);
10131015   const rgb_t *palette = palette_entry_list_raw(bitmap.palette());
10141016   int i;
r18794r18795
10531055static MC6845_UPDATE_ROW( cga_text_blink_update_row_si )
10541056{
10551057   isa8_cga_device *cga  = downcast<isa8_cga_device *>(device->owner());
1056   UINT8 *videoram = cga->m_vram;
1058   UINT8 *videoram = cga->m_vram + cga->m_start_offset;
10571059   UINT32  *p = &bitmap.pix32(y);
10581060   const rgb_t *palette = palette_entry_list_raw(bitmap.palette());
10591061   int i;
r18794r18795
11061108static MC6845_UPDATE_ROW( cga_text_blink_alt_update_row )
11071109{
11081110   isa8_cga_device *cga  = downcast<isa8_cga_device *>(device->owner());
1109   UINT8 *videoram = cga->m_vram;
1111   UINT8 *videoram = cga->m_vram + cga->m_start_offset;
11101112   UINT32  *p = &bitmap.pix32(y);
11111113   const rgb_t *palette = palette_entry_list_raw(bitmap.palette());
11121114   int i;
r18794r18795
11551157static MC6845_UPDATE_ROW( cga_gfx_4bppl_update_row )
11561158{
11571159   isa8_cga_device *cga  = downcast<isa8_cga_device *>(device->owner());
1158   UINT8 *videoram = cga->m_vram;
1160   UINT8 *videoram = cga->m_vram + cga->m_start_offset;
11591161   UINT32  *p = &bitmap.pix32(y);
11601162   const rgb_t *palette = palette_entry_list_raw(bitmap.palette());
11611163   int i;
r18794r18795
12141216static MC6845_UPDATE_ROW( cga_gfx_4bpph_update_row )
12151217{
12161218   isa8_cga_device *cga  = downcast<isa8_cga_device *>(device->owner());
1217   UINT8 *videoram = cga->m_vram;
1219   UINT8 *videoram = cga->m_vram + cga->m_start_offset;
12181220   UINT32  *p = &bitmap.pix32(y);
12191221   const rgb_t *palette = palette_entry_list_raw(bitmap.palette());
12201222   int i;
r18794r18795
12591261static MC6845_UPDATE_ROW( cga_gfx_2bpp_update_row )
12601262{
12611263   isa8_cga_device *cga  = downcast<isa8_cga_device *>(device->owner());
1262   UINT8 *videoram = cga->m_vram;
1264   UINT8 *videoram = cga->m_vram + cga->m_start_offset;
12631265   UINT32  *p = &bitmap.pix32(y);
12641266   const rgb_t *palette = palette_entry_list_raw(bitmap.palette());
12651267   int i;
r18794r18795
12961298static MC6845_UPDATE_ROW( cga_gfx_1bpp_update_row )
12971299{
12981300   isa8_cga_device *cga  = downcast<isa8_cga_device *>(device->owner());
1299   UINT8 *videoram = cga->m_vram;
1301   UINT8 *videoram = cga->m_vram + cga->m_start_offset;
13001302   UINT32  *p = &bitmap.pix32(y);
13011303   const rgb_t *palette = palette_entry_list_raw(bitmap.palette());
13021304   UINT8   fg = cga->m_color_select & 0x0F;
r18794r18795
17981800static MC6845_UPDATE_ROW( pc1512_gfx_4bpp_update_row )
17991801{
18001802   isa8_cga_pc1512_device *cga  = downcast<isa8_cga_pc1512_device *>(device->owner());
1801   UINT8 *videoram = cga->m_vram;
1803   UINT8 *videoram = cga->m_vram + cga->m_start_offset;
18021804   UINT32  *p = &bitmap.pix32(y);
18031805   const rgb_t *palette = palette_entry_list_raw(bitmap.palette());
18041806   UINT16   offset_base = ra << 13;
r18794r18795
20332035   membank("bank1")->set_base(m_vram + isa8_cga_pc1512_device::vram_offset[0]);
20342036}
20352037
2038void isa8_wyse700_device::change_resolution(UINT8 mode)
2039{
2040   int width = 0, height = 0;
2041   if (mode & 2) {
2042      machine().root_device().membank("bank_wy1")->set_base(m_vram + 0x10000);
2043   } else {
2044      machine().root_device().membank("bank_wy1")->set_base(m_vram);
2045   }
2046   if ((m_control & 0xf0) == (mode & 0xf0)) return;
2047   
2048   switch(mode & 0xf0) {
2049      case 0xc0: width = 1280; height = 800; break;
2050      case 0xa0: width = 1280; height = 400; break;
2051      case 0x80: width = 640; height = 400; break;
2052      case 0x00: width = 640; height = 400; break; // unhandled
2053   }
2054   rectangle visarea(0, width-1, 0, height-1);         
2055   subdevice<screen_device>(CGA_SCREEN_NAME)->configure(width, height, visarea, HZ_TO_ATTOSECONDS(60));
2056
2057}
2058
2059WRITE8_MEMBER( isa8_wyse700_device::io_write )
2060{
2061   switch (offset)
2062   {
2063   case 0xd:
2064      m_bank_offset = data;
2065      break;
2066
2067   case 0xe:
2068      m_bank_base = data;
2069      break;
2070
2071   case 0xf:
2072      change_resolution(data);
2073      m_control = data;
2074      break;
2075   default:
2076      isa8_cga_device::io_write(space, offset,data);
2077      break;
2078   }
2079}
2080
2081
2082READ8_MEMBER( isa8_wyse700_device::io_read )
2083{
2084   UINT8 data;
2085
2086   switch (offset)
2087   {
2088   case 0xd:
2089      data = m_bank_offset;
2090      break;
2091
2092   case 0xe:
2093      data = m_bank_base;
2094      break;
2095
2096   case 0xf:
2097      data = m_control;
2098      break;
2099   default:
2100      data = isa8_cga_device::io_read(space, offset);
2101      break;
2102   }
2103   return data;
2104}
2105
2106
2107const device_type ISA8_WYSE700 = &device_creator<isa8_wyse700_device>;
2108
2109
2110//-------------------------------------------------
2111//  isa8_wyse700_device - constructor
2112//-------------------------------------------------
2113
2114isa8_wyse700_device::isa8_wyse700_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
2115      isa8_cga_device( mconfig, ISA8_WYSE700, "Wyse 700", tag, owner, clock )
2116{
2117   m_vram_size = 0x20000;
2118   m_start_offset = 0x18000;   
2119}
2120
2121
2122const rom_entry *isa8_wyse700_device::device_rom_region() const
2123{
2124   return ROM_NAME( cga );
2125}
2126
2127//-------------------------------------------------
2128//  device_start - device-specific startup
2129//-------------------------------------------------
2130
2131void isa8_wyse700_device::device_start()
2132{
2133   isa8_cga_device::device_start();
2134
2135   m_isa->install_device(0x3d0, 0x3df, 0, 0, read8_delegate( FUNC(isa8_wyse700_device::io_read), this ), write8_delegate( FUNC(isa8_wyse700_device::io_write), this ) );
2136   m_isa->install_bank(0xa0000, 0xaffff, 0, 0, "bank_wy1", m_vram);
2137   m_isa->install_bank(0xb0000, 0xbffff, 0, 0, "bank_cga", m_vram + 0x10000);
2138}
2139
2140void isa8_wyse700_device::device_reset()
2141{
2142   isa8_cga_device::device_reset();
2143   m_control = 0;
2144   m_bank_offset = 0;
2145   m_bank_base = 0;
2146}
2147
2148UINT32 isa8_wyse700_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
2149{
2150   if (m_control & 0x08) {
2151      const rgb_t *palette = palette_entry_list_raw(bitmap.palette());
2152      UINT8 fg = m_color_select & 0x0F;
2153      UINT32 addr = 0;
2154      for (int y = 0; y < 800; y++) {
2155         UINT8 *src = m_vram + addr;
2156
2157         if (y & 1) {
2158            src += 0x10000;
2159            addr += 160;
2160         }
2161
2162         for (int x = 0; x < (1280 / 8); x++) {
2163            UINT8 val = src[x];
2164
2165            for (int i = 0; i < 8; i++) {
2166               bitmap.pix32(y,x*8+i) = (val & 0x80) ? palette[fg] : palette[0x00];
2167               val <<= 1;
2168            }
2169         }
2170      }
2171   } else {
2172      return isa8_cga_device::screen_update(screen, bitmap, cliprect);
2173   }
2174   return 0;
2175}
trunk/src/mess/video/isa_cga.h
r18794r18795
4848   DECLARE_WRITE8_MEMBER( char_ram_write );
4949   DECLARE_WRITE_LINE_MEMBER( hsync_changed );
5050   DECLARE_WRITE_LINE_MEMBER( vsync_changed );
51   UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
51   virtual UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
5252
5353public:
5454   int      m_framecnt;
r18794r18795
7070   bool   m_superimpose;
7171   UINT8   m_p3df;   /* This should be moved into the appropriate subclass */
7272   UINT8   m_plantronics; /* This should be moved into the appropriate subclass */
73   offs_t   m_start_offset;
7374};
7475
7576// device type definition
r18794r18795
182183// device type definition
183184extern const device_type ISA8_CGA_PC1512;
184185
186// ======================> isa8_wyse700_device
185187
188class isa8_wyse700_device :
189        public isa8_cga_device
190{
191public:
192    // construction/destruction
193    isa8_wyse700_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
194    // optional information overrides
195   virtual const rom_entry *device_rom_region() const;
196   virtual void device_config_complete() { m_shortname = "wyse700"; }
197
198protected:
199   // device-level overrides
200   virtual void device_start();
201   virtual void device_reset();
202
203public:
204   virtual DECLARE_READ8_MEMBER( io_read );
205   virtual DECLARE_WRITE8_MEMBER( io_write );
206   virtual UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
207   void change_resolution(UINT8 mode);
208   
209   UINT8 m_bank_offset;
210   UINT8 m_bank_base;
211   UINT8 m_control;
212};
213
214// device type definition
215extern const device_type ISA8_WYSE700;
216
186217#endif  /* __ISA_CGA_H__ */
187218
trunk/src/mess/drivers/at.c
r18794r18795
349349   // ISA 8 bit
350350   SLOT_INTERFACE("mda", ISA8_MDA)
351351   SLOT_INTERFACE("cga", ISA8_CGA)
352   SLOT_INTERFACE("wyse700", ISA8_WYSE700)
352353   SLOT_INTERFACE("ega", ISA8_EGA)
353354   SLOT_INTERFACE("vga", ISA8_VGA)
354355   SLOT_INTERFACE("svga_et4k", ISA8_SVGA_ET4K)

Previous 199869 Revisions Next


© 1997-2024 The MAME Team