@@ -36,45 +36,50 @@ DEFINE_DEVICE_TYPE(PCVIDEO_PCJR, pcvideo_pcjr_device, "pcjr_graphics", "
3636pc_t1t_device::pc_t1t_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) :
3737 device_t(mconfig, type, tag, owner, clock),
3838 device_video_interface(mconfig, *this ),
39- m_mc6845(*this , T1000_MC6845_NAME),
39+ m_chr_gen(*this , finder_base::DUMMY_TAG),
40+ m_mc6845(*this , " mc6845_t1000" ),
41+ m_palette(*this ," palette" ),
42+ m_ram(*this , " :" RAM_TAG),
43+ m_vram(*this , " vram" ),
4044 m_mode_control(0 ),
4145 m_color_select(0 ),
4246 m_status(0 ),
4347 m_bank(0 ),
4448 m_pc_framecnt(0 ),
4549 m_displayram(nullptr ),
46- m_chr_gen(nullptr ),
4750 m_chr_size(0 ),
4851 m_ra_offset(0 ),
4952 m_address_data_ff(0 ),
5053 m_update_row_type(-1 ),
5154 m_display_enable(0 ),
5255 m_vsync(0 ),
53- m_palette_base(0 ),
54- m_palette(*this ," palette" ),
55- m_ram(*this , " :" RAM_TAG),
56- m_vram(*this , " vram" )
56+ m_palette_base(0 )
5757{
5858}
5959
60- pcvideo_t1000_device::pcvideo_t1000_device (const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
61- : pc_t1t_device(mconfig, PCVIDEO_T1000, tag, owner, clock)
60+ pcvideo_t1000_device::pcvideo_t1000_device (const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
61+ pc_t1t_device(mconfig, PCVIDEO_T1000, tag, owner, clock)
6262{
6363}
6464
65- pcvideo_pcjr_device::pcvideo_pcjr_device (const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
66- : pc_t1t_device(mconfig, PCVIDEO_PCJR, tag, owner, clock),
67- m_pic8259 (*this , " :pic8259 " ),
65+ pcvideo_pcjr_device::pcvideo_pcjr_device (const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
66+ pc_t1t_device(mconfig, PCVIDEO_PCJR, tag, owner, clock),
67+ m_vsync_cb (*this ),
6868 m_jxkanji(nullptr )
6969{
7070}
7171
7272
73- void pcvideo_t1000_device ::device_start ()
73+ void pc_t1t_device ::device_start ()
7474{
75- if (!m_ram->started ())
75+ if (!m_ram->started ())
7676 throw device_missing_dependencies ();
77- m_chr_gen = machine ().root_device ().memregion (" gfx1" )->base ();
77+ }
78+
79+ void pcvideo_t1000_device::device_start ()
80+ {
81+ pc_t1t_device::device_start ();
82+
7883 m_bank = 0 ;
7984 m_chr_size = 1 ;
8085 m_ra_offset = 256 ;
@@ -84,9 +89,8 @@ void pcvideo_t1000_device::device_start()
8489
8590void pcvideo_pcjr_device::device_start ()
8691{
87- if (!m_ram->started ())
88- throw device_missing_dependencies ();
89- m_chr_gen = machine ().root_device ().memregion (" gfx1" )->base ();
92+ pc_t1t_device::device_start ();
93+
9094 m_bank = 0 ;
9195 m_mode_control = 0x08 ;
9296 m_chr_size = 8 ;
@@ -120,7 +124,7 @@ void pcvideo_t1000_device::device_add_mconfig(machine_config &config)
120124{
121125 screen_device &screen (SCREEN (config, T1000_SCREEN_NAME, SCREEN_TYPE_RASTER));
122126 screen.set_raw (XTAL (14'318'181 ),912 ,0 ,640 ,262 ,0 ,200 );
123- screen.set_screen_update (T1000_MC6845_NAME , FUNC (mc6845_device::screen_update));
127+ screen.set_screen_update (m_mc6845 , FUNC (mc6845_device::screen_update));
124128
125129 PALETTE (config, m_palette, FUNC (pcvideo_t1000_device::pcjr_palette), 32 );
126130
@@ -140,7 +144,7 @@ void pcvideo_pcjr_device::device_add_mconfig(machine_config &config)
140144{
141145 screen_device &screen (SCREEN (config, T1000_SCREEN_NAME, SCREEN_TYPE_RASTER));
142146 screen.set_raw (XTAL (14'318'181 ), 912 , 0 , 640 , 262 , 0 , 200 );
143- screen.set_screen_update (T1000_MC6845_NAME , FUNC (mc6845_device::screen_update));
147+ screen.set_screen_update (m_mc6845 , FUNC (mc6845_device::screen_update));
144148
145149 PALETTE (config, m_palette, FUNC (pcvideo_pcjr_device::pcjr_palette), 32 );
146150
@@ -194,7 +198,7 @@ MC6845_UPDATE_ROW( pc_t1t_device::t1000_text_inten_update_row )
194198 uint16_t offset = ( ( ma + i ) << 1 ) & 0x3fff ;
195199 uint8_t chr = m_displayram[ offset ];
196200 uint8_t attr = m_displayram[ offset +1 ];
197- uint8_t data = m_chr_gen[ chr * m_chr_size + ra * m_ra_offset ];
201+ uint8_t data = m_chr_gen[chr * m_chr_size + ra * m_ra_offset];
198202 uint16_t fg = m_palette_base + ( attr & 0x0F );
199203 uint16_t bg = m_palette_base + ( ( attr >> 4 ) & 0x07 );
200204
@@ -225,7 +229,7 @@ MC6845_UPDATE_ROW( pc_t1t_device::t1000_text_blink_update_row )
225229 uint16_t offset = ( ( ma + i ) << 1 ) & 0x3fff ;
226230 uint8_t chr = m_displayram[ offset ];
227231 uint8_t attr = m_displayram[ offset +1 ];
228- uint8_t data = m_chr_gen[ chr * m_chr_size + ra * m_ra_offset ];
232+ uint8_t data = m_chr_gen[chr * m_chr_size + ra * m_ra_offset];
229233 uint16_t fg = m_palette_base + ( attr & 0x0F );
230234 uint16_t bg = m_palette_base + ( ( attr >> 4 ) & 0x07 );
231235
@@ -929,7 +933,7 @@ void pcvideo_pcjr_device::write(offs_t offset, uint8_t data)
929933 case 12 :
930934 break ;
931935 case 15 :
932- if (m_jxkanji)
936+ if (m_jxkanji)
933937 pc_pcjx_bank_w (data);
934938 else
935939 pc_pcjr_bank_w (data);
@@ -943,9 +947,9 @@ void pcvideo_pcjr_device::write(offs_t offset, uint8_t data)
943947
944948uint8_t pc_t1t_device::read (offs_t offset)
945949{
946- int data = 0xff ;
950+ int data = 0xff ;
947951
948- switch ( offset )
952+ switch ( offset)
949953 {
950954 case 0 : case 2 : case 4 : case 6 :
951955 /* return last written mc6845 address value here? */
@@ -1002,15 +1006,15 @@ void pcvideo_pcjr_device::de_changed(int state)
10021006void pcvideo_t1000_device::t1000_vsync_changed (int state)
10031007{
10041008 m_vsync = state ? 8 : 0 ;
1005- if ( state )
1009+ if (state)
10061010 {
10071011 m_pc_framecnt++;
10081012 }
10091013}
10101014
10111015void pcvideo_t1000_device::disable_w (int state)
10121016{
1013- if (state)
1017+ if (state)
10141018 m_vram->set_bank (8 );
10151019 else
10161020 bank_w (m_bank);
@@ -1020,9 +1024,9 @@ void pcvideo_t1000_device::disable_w(int state)
10201024void pcvideo_pcjr_device::pcjr_vsync_changed (int state)
10211025{
10221026 m_vsync = state ? 8 : 0 ;
1023- if ( state )
1027+ if (state)
10241028 {
10251029 m_pc_framecnt++;
10261030 }
1027- m_pic8259-> ir5_w (state);
1031+ m_vsync_cb (state);
10281032}
0 commit comments