Previous 199869 Revisions Next

r41760 Tuesday 17th November, 2015 at 19:13:26 UTC by Carl
cga: treat as fixed sync monitor (nw)
[src/devices/bus/isa]cga.cpp cga.h

trunk/src/devices/bus/isa/cga.cpp
r250271r250272
183183   if (m_update_row_type == -1)
184184      return;
185185
186   y = m_y;
187   if(m_y >= bitmap.height())
188      return;
189
186190   switch (m_update_row_type)
187191   {
188192      case CGA_TEXT_INTEN:
r250271r250272
253257   MCFG_MC6845_UPDATE_ROW_CB(isa8_cga_device, crtc_update_row)
254258   MCFG_MC6845_OUT_HSYNC_CB(WRITELINE(isa8_cga_device, hsync_changed))
255259   MCFG_MC6845_OUT_VSYNC_CB(WRITELINE(isa8_cga_device, vsync_changed))
260   MCFG_MC6845_RECONFIGURE_CB(isa8_cga_device, reconfigure)
261   MCFG_VIDEO_SET_SCREEN(NULL)
256262MACHINE_CONFIG_END
257263
258264
r250271r250272
304310      m_cga_config(*this, "cga_config"), m_framecnt(0), m_mode_control(0), m_color_select(0),
305311      m_update_row_type(-1), m_chr_gen_base(nullptr), m_chr_gen(nullptr), m_vsync(0), m_hsync(0),
306312      m_vram_size( 0x4000 ), m_plantronics(0),
307      m_palette(*this, "palette")
313      m_palette(*this, "palette"),
314      m_screen(*this, "screen")
308315{
309316   m_chr_gen_offset[0] = m_chr_gen_offset[2] = 0x1800;
310317   m_chr_gen_offset[1] = m_chr_gen_offset[3] = 0x1000;
r250271r250272
319326      m_cga_config(*this, "cga_config"), m_framecnt(0), m_mode_control(0), m_color_select(0),
320327      m_update_row_type(-1), m_chr_gen_base(nullptr), m_chr_gen(nullptr), m_vsync(0), m_hsync(0),
321328      m_vram_size( 0x4000 ), m_plantronics(0),
322      m_palette(*this, "palette")
329      m_palette(*this, "palette"),
330      m_screen(*this, "screen")
323331{
324332   m_chr_gen_offset[0] = m_chr_gen_offset[2] = 0x1800;
325333   m_chr_gen_offset[1] = m_chr_gen_offset[3] = 0x1000;
r250271r250272
346354   /* Initialise the cga palette */
347355   int i;
348356
357
349358   for ( i = 0; i < CGA_PALETTE_SETS * 16; i++ )
350359   {
351360      m_palette->set_pen_color( i, cga_palette[i][0], cga_palette[i][1], cga_palette[i][2] );
r250271r250272
376385   save_item(NAME(m_hsync));
377386   save_item(NAME(m_vram));
378387   save_item(NAME(m_plantronics));
388   save_item(NAME(m_y));
379389}
380390
381391
r250271r250272
390400   m_vsync = 0;
391401   m_hsync = 0;
392402   m_color_select = 0;
403   m_y = 0;
393404   memset(m_palette_lut_2bpp, 0, sizeof(m_palette_lut_2bpp));
394405}
395406
r250271r250272
911922WRITE_LINE_MEMBER( isa8_cga_device::hsync_changed )
912923{
913924   m_hsync = state ? 1 : 0;
925   if(state && !m_vsync)
926   {
927      m_screen->update_now();
928      m_y++;
929   }
914930}
915931
916932
917933WRITE_LINE_MEMBER( isa8_cga_device::vsync_changed )
918934{
919   m_vsync = state ? 9 : 0;
920935   if ( state )
921936   {
922937      m_framecnt++;
923938   }
939   else
940   {
941      m_screen->reset_origin();
942      m_y = 0;
943   }
944   m_vsync = state ? 9 : 0;
924945}
925946
947MC6845_RECONFIGURE( isa8_cga_device::reconfigure )
948{
949   rectangle curvisarea = m_screen->visible_area();
950   m_screen->set_visible_area(visarea.min_x, visarea.max_x, curvisarea.min_y, curvisarea.max_y);
951}
926952
927953void isa8_cga_device::set_palette_luts(void)
928954{
r250271r250272
18931919
18941920const device_type ISA8_CGA_M24 = &device_creator<isa8_cga_m24_device>;
18951921
1922static MACHINE_CONFIG_DERIVED( m24, cga )
1923   MCFG_DEVICE_MODIFY(CGA_SCREEN_NAME)
1924   MCFG_SCREEN_RAW_PARAMS(XTAL_14_31818MHz,912,0,640,462,0,400)
1925   MCFG_DEVICE_MODIFY(CGA_MC6845_NAME)
1926   MCFG_MC6845_RECONFIGURE_CB(isa8_cga_m24_device, reconfigure)
1927MACHINE_CONFIG_END
1928
1929machine_config_constructor isa8_cga_m24_device::device_mconfig_additions() const
1930{
1931   return MACHINE_CONFIG_NAME( m24 );
1932}
18961933isa8_cga_m24_device::isa8_cga_m24_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
18971934      isa8_cga_device( mconfig, ISA8_CGA_M24, "Olivetti M24 CGA", tag, owner, clock, "cga_m24", __FILE__), m_mode2(0), m_index(0)
18981935{
r250271r250272
19061943   m_start_offset = 0;
19071944}
19081945
1946MC6845_RECONFIGURE( isa8_cga_m24_device::reconfigure )
1947{
1948   // just reconfigure the screen, the apb sets it to 256 lines rather than 400
1949   m_screen->configure(width, height, visarea, frame_period);
1950}
1951
19091952WRITE8_MEMBER( isa8_cga_m24_device::io_write )
19101953{
19111954   mc6845_device *mc6845 = subdevice<mc6845_device>(CGA_MC6845_NAME);
trunk/src/devices/bus/isa/cga.h
r250271r250272
6161   DECLARE_WRITE_LINE_MEMBER( hsync_changed );
6262   DECLARE_WRITE_LINE_MEMBER( vsync_changed );
6363   virtual UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
64
64   MC6845_RECONFIGURE(reconfigure);
6565public:
6666   int     m_framecnt;
6767
r250271r250272
6969   UINT8   m_color_select;  /* wo 0x3d9 */
7070   //UINT8   m_status;   //unused?     /* ro 0x3da */
7171
72   int     m_update_row_type;
72   int     m_update_row_type, m_y;
7373   UINT8   m_palette_lut_2bpp[4];
7474   offs_t  m_chr_gen_offset[4];
7575   UINT8   m_font_selection_mask;
r250271r250272
8383   UINT8   m_plantronics; /* This should be moved into the appropriate subclass */
8484   offs_t  m_start_offset;
8585   required_device<palette_device> m_palette;
86   required_device<screen_device> m_screen;
8687};
8788
8889// device type definition
r250271r250272
268269public:
269270   // construction/destruction
270271   isa8_cga_m24_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
272   virtual machine_config_constructor device_mconfig_additions() const;
271273   // optional information overrides
272274   //virtual const rom_entry *device_rom_region() const;
273275   virtual DECLARE_READ8_MEMBER( io_read );
274276   virtual DECLARE_WRITE8_MEMBER( io_write );
275277   virtual MC6845_UPDATE_ROW( crtc_update_row );
276278   MC6845_UPDATE_ROW( m24_gfx_1bpp_m24_update_row );
279   MC6845_RECONFIGURE(reconfigure);
277280protected:
278281   virtual void device_reset();
279282private:


Previous 199869 Revisions Next


© 1997-2024 The MAME Team