summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/emu/bus/a2bus/a2ultraterm.c45
-rw-r--r--src/emu/bus/a2bus/a2ultraterm.h1
-rw-r--r--src/emu/bus/a2bus/a2videoterm.c34
-rw-r--r--src/emu/bus/a2bus/a2videoterm.h1
-rw-r--r--src/emu/bus/c64/xl80.c41
-rw-r--r--src/emu/bus/c64/xl80.h2
-rw-r--r--src/emu/bus/comx35/clm.c39
-rw-r--r--src/emu/bus/comx35/clm.h2
-rw-r--r--src/emu/bus/ecbbus/grip.c76
-rw-r--r--src/emu/bus/ecbbus/grip.h2
-rw-r--r--src/emu/bus/isa/aga.c233
-rw-r--r--src/emu/bus/isa/aga.h14
-rw-r--r--src/emu/bus/isa/cga.c289
-rw-r--r--src/emu/bus/isa/cga.h17
-rw-r--r--src/emu/bus/isa/mda.c141
-rw-r--r--src/emu/bus/isa/mda.h37
-rw-r--r--src/emu/bus/wangpc/lvc.c55
-rw-r--r--src/emu/bus/wangpc/lvc.h2
-rw-r--r--src/emu/bus/wangpc/mvc.c55
-rw-r--r--src/emu/bus/wangpc/mvc.h2
-rw-r--r--src/emu/video/mc6845.c182
-rw-r--r--src/emu/video/mc6845.h202
-rw-r--r--src/mame/drivers/4enlinea.c1
-rw-r--r--src/mame/drivers/4roses.c24
-rw-r--r--src/mame/drivers/5clown.c25
-rw-r--r--src/mame/drivers/albazg.c19
-rw-r--r--src/mame/drivers/amaticmg.c24
-rw-r--r--src/mame/drivers/amusco.c27
-rw-r--r--src/mame/drivers/aristmk4.c25
-rw-r--r--src/mame/drivers/avt.c24
-rw-r--r--src/mame/drivers/blitz.c24
-rw-r--r--src/mame/drivers/blitz68k.c84
-rw-r--r--src/mame/drivers/buster.c20
-rw-r--r--src/mame/drivers/calomega.c24
-rw-r--r--src/mame/drivers/carrera.c20
-rw-r--r--src/mame/drivers/chance32.c21
-rw-r--r--src/mame/drivers/coinmstr.c19
-rw-r--r--src/mame/drivers/docastle.c41
-rw-r--r--src/mame/drivers/flipjack.c20
-rw-r--r--src/mame/drivers/fortecar.c20
-rw-r--r--src/mame/drivers/funworld.c44
-rw-r--r--src/mame/drivers/gluck2.c24
-rw-r--r--src/mame/drivers/goldnpkr.c24
-rw-r--r--src/mame/drivers/hitpoker.c20
-rw-r--r--src/mame/drivers/jokrwild.c25
-rw-r--r--src/mame/drivers/jubilee.c24
-rw-r--r--src/mame/drivers/kingdrby.c36
-rw-r--r--src/mame/drivers/laserbas.c20
-rw-r--r--src/mame/drivers/luckgrln.c20
-rw-r--r--src/mame/drivers/magicfly.c24
-rw-r--r--src/mame/drivers/majorpkr.c24
-rw-r--r--src/mame/drivers/merit.c59
-rw-r--r--src/mame/drivers/miniboy7.c24
-rw-r--r--src/mame/drivers/mpu12wbk.c24
-rw-r--r--src/mame/drivers/mpu4dealem.c21
-rw-r--r--src/mame/drivers/murogem.c20
-rw-r--r--src/mame/drivers/nyny.c106
-rw-r--r--src/mame/drivers/othello.c31
-rw-r--r--src/mame/drivers/peplus.c35
-rw-r--r--src/mame/drivers/progolf.c20
-rw-r--r--src/mame/drivers/r2dtank.c58
-rw-r--r--src/mame/drivers/rgum.c19
-rw-r--r--src/mame/drivers/sanremo.c37
-rw-r--r--src/mame/drivers/slotcarn.c59
-rw-r--r--src/mame/drivers/snk6502.c30
-rw-r--r--src/mame/drivers/speedatk.c19
-rw-r--r--src/mame/drivers/spiders.c58
-rw-r--r--src/mame/drivers/ssingles.c120
-rw-r--r--src/mame/drivers/supercrd.c24
-rw-r--r--src/mame/drivers/tapatune.c72
-rw-r--r--src/mame/drivers/tmspoker.c23
-rw-r--r--src/mame/drivers/truco.c24
-rw-r--r--src/mame/drivers/twincobr.c4
-rw-r--r--src/mame/drivers/usgames.c20
-rw-r--r--src/mame/drivers/vcombat.c23
-rw-r--r--src/mame/drivers/vlc.c19
-rw-r--r--src/mame/drivers/wardner.c4
-rw-r--r--src/mame/includes/qix.h2
-rw-r--r--src/mame/includes/spiders.h3
-rw-r--r--src/mame/includes/twincobr.h2
-rw-r--r--src/mame/video/decodmd2.c35
-rw-r--r--src/mame/video/decodmd2.h1
-rw-r--r--src/mame/video/decodmd3.c44
-rw-r--r--src/mame/video/decodmd3.h1
-rw-r--r--src/mame/video/madalien.c20
-rw-r--r--src/mame/video/qix.c57
-rw-r--r--src/mame/video/twincobr.c19
-rw-r--r--src/mess/drivers/a6809.c23
-rw-r--r--src/mess/drivers/alphatro.c38
-rw-r--r--src/mess/drivers/amstrad.c21
-rw-r--r--src/mess/drivers/amust.c31
-rw-r--r--src/mess/drivers/applix.c36
-rw-r--r--src/mess/drivers/apricot.c35
-rw-r--r--src/mess/drivers/apricotp.c30
-rw-r--r--src/mess/drivers/b16.c21
-rw-r--r--src/mess/drivers/bbc.c14
-rw-r--r--src/mess/drivers/bigbord2.c36
-rw-r--r--src/mess/drivers/bml3.c47
-rw-r--r--src/mess/drivers/bw12.c29
-rw-r--r--src/mess/drivers/c128.c40
-rw-r--r--src/mess/drivers/camplynx.c63
-rw-r--r--src/mess/drivers/cbm2.c36
-rw-r--r--src/mess/drivers/dgn_beta.c7
-rw-r--r--src/mess/drivers/dim68k.c38
-rw-r--r--src/mess/drivers/ec65.c40
-rw-r--r--src/mess/drivers/einstein.c31
-rw-r--r--src/mess/drivers/fanucspmg.c34
-rw-r--r--src/mess/drivers/fp1100.c25
-rw-r--r--src/mess/drivers/fp6000.c20
-rw-r--r--src/mess/drivers/h19.c33
-rw-r--r--src/mess/drivers/hp9k.c19
-rw-r--r--src/mess/drivers/kaypro.c21
-rw-r--r--src/mess/drivers/lola8a.c31
-rw-r--r--src/mess/drivers/m20.c20
-rw-r--r--src/mess/drivers/mbc200.c25
-rw-r--r--src/mess/drivers/mbc55x.c7
-rw-r--r--src/mess/drivers/mbee.c96
-rw-r--r--src/mess/drivers/multi16.c22
-rw-r--r--src/mess/drivers/multi8.c22
-rw-r--r--src/mess/drivers/mx2178.c30
-rw-r--r--src/mess/drivers/myb3k.c21
-rw-r--r--src/mess/drivers/mycom.c34
-rw-r--r--src/mess/drivers/paso1600.c21
-rw-r--r--src/mess/drivers/pasopia.c31
-rw-r--r--src/mess/drivers/pasopia7.c24
-rw-r--r--src/mess/drivers/pet.c138
-rw-r--r--src/mess/drivers/pyl601.c71
-rw-r--r--src/mess/drivers/sapi1.c32
-rw-r--r--src/mess/drivers/smc777.c19
-rw-r--r--src/mess/drivers/super80.c20
-rw-r--r--src/mess/drivers/svi318.c20
-rw-r--r--src/mess/drivers/tavernie.c31
-rw-r--r--src/mess/drivers/trs80m2.c38
-rw-r--r--src/mess/drivers/tvc.c62
-rw-r--r--src/mess/drivers/v6809.c40
-rw-r--r--src/mess/drivers/victor9k.c31
-rw-r--r--src/mess/drivers/vk100.c35
-rw-r--r--src/mess/drivers/x1.c20
-rw-r--r--src/mess/drivers/x1twin.c20
-rw-r--r--src/mess/drivers/z100.c21
-rw-r--r--src/mess/drivers/zrt80.c33
-rw-r--r--src/mess/includes/abc80x.h3
-rw-r--r--src/mess/includes/amstrad.h7
-rw-r--r--src/mess/includes/bbc.h3
-rw-r--r--src/mess/includes/bw12.h1
-rw-r--r--src/mess/includes/cbm2.h2
-rw-r--r--src/mess/includes/dgn_beta.h6
-rw-r--r--src/mess/includes/einstein.h1
-rw-r--r--src/mess/includes/kaypro.h6
-rw-r--r--src/mess/includes/mbc55x.h4
-rw-r--r--src/mess/includes/mbee.h16
-rw-r--r--src/mess/includes/pc1512.h7
-rw-r--r--src/mess/includes/pet.h6
-rw-r--r--src/mess/includes/super80.h5
-rw-r--r--src/mess/includes/svi318.h5
-rw-r--r--src/mess/includes/trs80m2.h2
-rw-r--r--src/mess/includes/tvc.h2
-rw-r--r--src/mess/includes/v1050.h2
-rw-r--r--src/mess/includes/victor9k.h1
-rw-r--r--src/mess/machine/amstrad.c31
-rw-r--r--src/mess/machine/svi318.c7
-rw-r--r--src/mess/video/abc1600.c45
-rw-r--r--src/mess/video/abc1600.h2
-rw-r--r--src/mess/video/abc800.c36
-rw-r--r--src/mess/video/abc802.c39
-rw-r--r--src/mess/video/abc806.c54
-rw-r--r--src/mess/video/bbc.c70
-rw-r--r--src/mess/video/dgn_beta.c40
-rw-r--r--src/mess/video/kaypro.c15
-rw-r--r--src/mess/video/mbc55x.c30
-rw-r--r--src/mess/video/mbee.c59
-rw-r--r--src/mess/video/pc1512.c40
-rw-r--r--src/mess/video/pc8401a.c25
-rw-r--r--src/mess/video/pc_t1t.c301
-rw-r--r--src/mess/video/pc_t1t.h14
-rw-r--r--src/mess/video/super80.c23
-rw-r--r--src/mess/video/v1050.c31
177 files changed, 2122 insertions, 3958 deletions
diff --git a/src/emu/bus/a2bus/a2ultraterm.c b/src/emu/bus/a2bus/a2ultraterm.c
index eef9e997e63..5989ceae9bd 100644
--- a/src/emu/bus/a2bus/a2ultraterm.c
+++ b/src/emu/bus/a2bus/a2ultraterm.c
@@ -61,22 +61,6 @@ const device_type A2BUS_ULTRATERMENH = &device_creator<a2bus_ultratermenh_device
#define CT2_INVBIT7L (0x02)
#define CT2_HLBIT7L (0x01)
-static MC6845_UPDATE_ROW( ultraterm_update_row );
-
-static MC6845_INTERFACE( mc6845_mda_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of pixels per video memory address */
- NULL, /* begin_update */
- ultraterm_update_row, /* update_row */
- NULL, /* end_update */
- DEVCB_NULL, /* on_de_changed */
- DEVCB_NULL, /* on_cur_changed */
- DEVCB_NULL, /* on hsync changed */
- DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, a2bus_videx160_device, vsync_changed), /* on_vsync_changed */
- NULL
-};
static const rgb_t ultraterm_palette[4] =
{
@@ -91,7 +75,11 @@ MACHINE_CONFIG_FRAGMENT( a2ultraterm )
MCFG_SCREEN_RAW_PARAMS(CLOCK_LOW, 882, 0, 720, 370, 0, 350 )
MCFG_SCREEN_UPDATE_DEVICE( ULTRATERM_MC6845_NAME, mc6845_device, screen_update )
- MCFG_MC6845_ADD( ULTRATERM_MC6845_NAME, MC6845, ULTRATERM_SCREEN_NAME, CLOCK_LOW/9, mc6845_mda_intf)
+ MCFG_MC6845_ADD(ULTRATERM_MC6845_NAME, MC6845, ULTRATERM_SCREEN_NAME, CLOCK_LOW/9)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
+ MCFG_MC6845_UPDATE_ROW_CB(a2bus_videx160_device, crtc_update_row)
+ MCFG_MC6845_OUT_VSYNC_CB(WRITELINE(a2bus_videx160_device, vsync_changed))
MACHINE_CONFIG_END
ROM_START( a2ultraterm )
@@ -319,9 +307,8 @@ void a2bus_videx160_device::write_c800(address_space &space, UINT16 offset, UINT
}
}
-static MC6845_UPDATE_ROW( ultraterm_update_row )
+MC6845_UPDATE_ROW( a2bus_videx160_device::crtc_update_row )
{
- a2bus_videx160_device *uterm = downcast<a2bus_videx160_device *>(device->owner());
UINT32 *p = &bitmap.pix32(y);
UINT16 chr_base = ra;
int i;
@@ -329,38 +316,38 @@ static MC6845_UPDATE_ROW( ultraterm_update_row )
for ( i = 0; i < x_count; i++ )
{
UINT16 offset = ( ma + i );
- UINT8 chr = uterm->m_ram[ offset ];
- UINT8 data = uterm->m_chrrom[ chr_base + (chr * 16) ];
+ UINT8 chr = m_ram[ offset ];
+ UINT8 data = m_chrrom[ chr_base + (chr * 16) ];
UINT8 fg = 2;
UINT8 bg = 0;
UINT8 tmp;
// apply attributes
- if (!(uterm->m_ctrl2 & CT2_USEDIPS))
+ if (!(m_ctrl2 & CT2_USEDIPS))
{
// this set and bit 7 in char, highlight
- if ((uterm->m_ctrl2 & CT2_HLBIT7H) && (chr & 0x80))
+ if ((m_ctrl2 & CT2_HLBIT7H) && (chr & 0x80))
{
fg = 3;
bg = 0;
}
// this set and NOT bit 7 in char, highlight
- if ((uterm->m_ctrl2 & CT2_HLBIT7L) && (!(chr & 0x80)))
+ if ((m_ctrl2 & CT2_HLBIT7L) && (!(chr & 0x80)))
{
fg = 3;
bg = 0;
}
// this clear and bit 7 in char, lowlight
- if (!(uterm->m_ctrl2 & CT2_HLBIT7H) && (chr & 0x80))
+ if (!(m_ctrl2 & CT2_HLBIT7H) && (chr & 0x80))
{
fg = 1;
bg = 0;
}
// this clear and NOT bit 7 in char, lowlight
- if (!(uterm->m_ctrl2 & CT2_HLBIT7L) && (!(chr & 0x80)))
+ if (!(m_ctrl2 & CT2_HLBIT7L) && (!(chr & 0x80)))
{
fg = 1;
bg = 0;
@@ -368,7 +355,7 @@ static MC6845_UPDATE_ROW( ultraterm_update_row )
// invert last so invert + hilight/invert + lowlight are possible
// invert if char bit 7 is set
- if ((uterm->m_ctrl2 & CT2_INVBIT7H) && (chr & 0x80))
+ if ((m_ctrl2 & CT2_INVBIT7H) && (chr & 0x80))
{
tmp = fg;
fg = bg;
@@ -376,7 +363,7 @@ static MC6845_UPDATE_ROW( ultraterm_update_row )
}
// invert if char bit 7 is clear
- if ((uterm->m_ctrl2 & CT2_INVBIT7L) && (!(chr & 0x80)))
+ if ((m_ctrl2 & CT2_INVBIT7L) && (!(chr & 0x80)))
{
tmp = fg;
fg = bg;
@@ -386,7 +373,7 @@ static MC6845_UPDATE_ROW( ultraterm_update_row )
if ( i == cursor_x )
{
- if ( uterm->m_framecnt & 0x08 )
+ if ( m_framecnt & 0x08 )
{
data = 0xFF;
}
diff --git a/src/emu/bus/a2bus/a2ultraterm.h b/src/emu/bus/a2bus/a2ultraterm.h
index 4d6225f160a..7495db2eca3 100644
--- a/src/emu/bus/a2bus/a2ultraterm.h
+++ b/src/emu/bus/a2bus/a2ultraterm.h
@@ -29,6 +29,7 @@ public:
virtual machine_config_constructor device_mconfig_additions() const;
DECLARE_WRITE_LINE_MEMBER(vsync_changed);
+ MC6845_UPDATE_ROW(crtc_update_row);
UINT8 *m_rom, *m_chrrom;
UINT8 m_ram[256*16];
diff --git a/src/emu/bus/a2bus/a2videoterm.c b/src/emu/bus/a2bus/a2videoterm.c
index d347f42d490..947bb7a1aa4 100644
--- a/src/emu/bus/a2bus/a2videoterm.c
+++ b/src/emu/bus/a2bus/a2videoterm.c
@@ -47,29 +47,16 @@ const device_type A2BUS_AEVIEWMASTER80 = &device_creator<a2bus_aevm80_device>;
#define MDA_CLOCK 16257000
-static MC6845_UPDATE_ROW( videoterm_update_row );
-
-static MC6845_INTERFACE( mc6845_mda_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of pixels per video memory address */
- NULL, /* begin_update */
- videoterm_update_row, /* update_row */
- NULL, /* end_update */
- DEVCB_NULL, /* on_de_changed */
- DEVCB_NULL, /* on_cur_changed */
- DEVCB_NULL, /* on hsync changed */
- DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, a2bus_videx80_device, vsync_changed), /* on_vsync_changed */
- NULL
-};
-
MACHINE_CONFIG_FRAGMENT( a2videoterm )
MCFG_SCREEN_ADD( VIDEOTERM_SCREEN_NAME, RASTER) // 560x216? (80x24 7x9 characters)
MCFG_SCREEN_RAW_PARAMS(MDA_CLOCK, 882, 0, 720, 370, 0, 350 )
MCFG_SCREEN_UPDATE_DEVICE( VIDEOTERM_MC6845_NAME, mc6845_device, screen_update )
- MCFG_MC6845_ADD( VIDEOTERM_MC6845_NAME, MC6845, VIDEOTERM_SCREEN_NAME, MDA_CLOCK/9, mc6845_mda_intf)
+ MCFG_MC6845_ADD(VIDEOTERM_MC6845_NAME, MC6845, VIDEOTERM_SCREEN_NAME, MDA_CLOCK/9)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
+ MCFG_MC6845_UPDATE_ROW_CB(a2bus_videx80_device, crtc_update_row)
+ MCFG_MC6845_OUT_VSYNC_CB(WRITELINE(a2bus_videx80_device, vsync_changed))
MACHINE_CONFIG_END
ROM_START( a2videoterm )
@@ -347,10 +334,9 @@ void a2bus_videx80_device::write_c800(address_space &space, UINT16 offset, UINT8
}
}
-static MC6845_UPDATE_ROW( videoterm_update_row )
+MC6845_UPDATE_ROW( a2bus_videx80_device::crtc_update_row )
{
- a2bus_videx80_device *vterm = downcast<a2bus_videx80_device *>(device->owner());
- const rgb_t *palette = vterm->m_palette->palette()->entry_list_raw();
+ const rgb_t *palette = m_palette->palette()->entry_list_raw();
UINT32 *p = &bitmap.pix32(y);
UINT16 chr_base = ra; //( ra & 0x08 ) ? 0x800 | ( ra & 0x07 ) : ra;
int i;
@@ -358,14 +344,14 @@ static MC6845_UPDATE_ROW( videoterm_update_row )
for ( i = 0; i < x_count; i++ )
{
UINT16 offset = ( ma + i ) & 0x7ff;
- UINT8 chr = vterm->m_ram[ offset ];
- UINT8 data = vterm->m_chrrom[ chr_base + chr * 16 ];
+ UINT8 chr = m_ram[ offset ];
+ UINT8 data = m_chrrom[ chr_base + chr * 16 ];
UINT8 fg = 15;
UINT8 bg = 0;
if ( i == cursor_x )
{
- if ( vterm->m_framecnt & 0x08 )
+ if ( m_framecnt & 0x08 )
{
data = 0xFF;
}
diff --git a/src/emu/bus/a2bus/a2videoterm.h b/src/emu/bus/a2bus/a2videoterm.h
index 5043a6cafd8..50d2165dfe9 100644
--- a/src/emu/bus/a2bus/a2videoterm.h
+++ b/src/emu/bus/a2bus/a2videoterm.h
@@ -29,6 +29,7 @@ public:
virtual machine_config_constructor device_mconfig_additions() const;
DECLARE_WRITE_LINE_MEMBER(vsync_changed);
+ MC6845_UPDATE_ROW(crtc_update_row);
UINT8 *m_rom, *m_chrrom;
UINT8 m_ram[512*4];
diff --git a/src/emu/bus/c64/xl80.c b/src/emu/bus/c64/xl80.c
index a33504a2f1e..886368c810f 100644
--- a/src/emu/bus/c64/xl80.c
+++ b/src/emu/bus/c64/xl80.c
@@ -78,58 +78,36 @@ const rom_entry *c64_xl80_device::device_rom_region() const
}
//-------------------------------------------------
-// mc6845_interface crtc_intf
+// mc6845
//-------------------------------------------------
-void c64_xl80_device::crtc_update_row(mc6845_device *device, bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, int de, int hbp, int vbp, void *param)
+MC6845_UPDATE_ROW( c64_xl80_device::crtc_update_row )
{
const pen_t *pen = m_palette->pens();
-
+
for (int column = 0; column < x_count; column++)
{
UINT8 code = m_ram[((ma + column) & 0x7ff)];
UINT16 addr = (code << 3) | (ra & 0x07);
UINT8 data = m_char_rom->base()[addr & 0x7ff];
-
+
if (column == cursor_x)
{
data = 0xff;
}
-
+
for (int bit = 0; bit < 8; bit++)
{
int x = (column * 8) + bit;
int color = BIT(data, 7) && de;
-
+
bitmap.pix32(vbp + y, hbp + x) = pen[color];
-
+
data <<= 1;
}
}
}
-static MC6845_UPDATE_ROW( c64_xl80_update_row )
-{
- c64_xl80_device *xl80 = downcast<c64_xl80_device *>(device->owner());
- xl80->crtc_update_row(device,bitmap,cliprect,ma,ra,y,x_count,cursor_x,de,hbp,vbp,param);
-}
-
-static MC6845_INTERFACE( crtc_intf )
-{
- true,
- 0,0,0,0,
- 8,
- NULL,
- c64_xl80_update_row,
- NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- NULL
-};
-
-
//-------------------------------------------------
// GFXDECODE( c64_xl80 )
//-------------------------------------------------
@@ -154,7 +132,10 @@ static MACHINE_CONFIG_FRAGMENT( c64_xl80 )
MCFG_GFXDECODE_ADD("gfxdecode", "palette", c64_xl80)
MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
- MCFG_MC6845_ADD(HD46505SP_TAG, H46505, MC6845_SCREEN_TAG, XTAL_14_31818MHz, crtc_intf)
+ MCFG_MC6845_ADD(HD46505SP_TAG, H46505, MC6845_SCREEN_TAG, XTAL_14_31818MHz)
+ MCFG_MC6845_SHOW_BORDER_AREA(true)
+ MCFG_MC6845_CHAR_WIDTH(8)
+ MCFG_MC6845_UPDATE_ROW_CB(c64_xl80_device, crtc_update_row)
MACHINE_CONFIG_END
diff --git a/src/emu/bus/c64/xl80.h b/src/emu/bus/c64/xl80.h
index 29ccbca7fd5..711926b19ee 100644
--- a/src/emu/bus/c64/xl80.h
+++ b/src/emu/bus/c64/xl80.h
@@ -39,7 +39,7 @@ public:
virtual machine_config_constructor device_mconfig_additions() const;
// not really public
- void crtc_update_row(mc6845_device *device, bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, int de, int hbp, int vbp, void *param);
+ MC6845_UPDATE_ROW( crtc_update_row );
protected:
// device-level overrides
diff --git a/src/emu/bus/comx35/clm.c b/src/emu/bus/comx35/clm.c
index e48ba540fec..a0e5b3becdf 100644
--- a/src/emu/bus/comx35/clm.c
+++ b/src/emu/bus/comx35/clm.c
@@ -97,55 +97,33 @@ const rom_entry *comx_clm_device::device_rom_region() const
//-------------------------------------------------
-// mc6845_interface crtc_intf
+// mc6845
//-------------------------------------------------
-void comx_clm_device::crtc_update_row(mc6845_device *device, bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, int de, int hbp, int vbp, void *param)
+MC6845_UPDATE_ROW( comx_clm_device::crtc_update_row )
{
for (int column = 0; column < x_count; column++)
{
UINT8 code = m_video_ram[((ma + column) & 0x7ff)];
UINT16 addr = (code << 3) | (ra & 0x07);
UINT8 data = m_char_rom->base()[addr & 0x7ff];
-
+
if (BIT(ra, 3) && column == cursor_x)
{
data = 0xff;
}
-
+
for (int bit = 0; bit < 8; bit++)
{
int x = (column * 8) + bit;
-
+
bitmap.pix32(vbp + y, hbp + x) = m_palette->pen(BIT(data, 7) && de);
-
+
data <<= 1;
}
}
}
-static MC6845_UPDATE_ROW( comx_clm_update_row )
-{
- comx_clm_device *clm = downcast<comx_clm_device *>(device->owner());
- clm->crtc_update_row(device,bitmap,cliprect,ma,ra,y,x_count,cursor_x,de,hbp,vbp,param);
-}
-
-static MC6845_INTERFACE( crtc_intf )
-{
- true,
- 0,0,0,0,
- 8,
- NULL,
- comx_clm_update_row,
- NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- NULL
-};
-
-
//-------------------------------------------------
// GFXDECODE( comx_clm )
//-------------------------------------------------
@@ -170,7 +148,10 @@ static MACHINE_CONFIG_FRAGMENT( comx_clm )
MCFG_GFXDECODE_ADD("gfxdecode", "palette", comx_clm)
MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
- MCFG_MC6845_ADD(MC6845_TAG, MC6845, MC6845_SCREEN_TAG, XTAL_14_31818MHz/7, crtc_intf)
+ MCFG_MC6845_ADD(MC6845_TAG, MC6845, MC6845_SCREEN_TAG, XTAL_14_31818MHz/7)
+ MCFG_MC6845_SHOW_BORDER_AREA(true)
+ MCFG_MC6845_CHAR_WIDTH(8)
+ MCFG_MC6845_UPDATE_ROW_CB(comx_clm_device, crtc_update_row)
MACHINE_CONFIG_END
diff --git a/src/emu/bus/comx35/clm.h b/src/emu/bus/comx35/clm.h
index 180169bf03f..a79ef6ac043 100644
--- a/src/emu/bus/comx35/clm.h
+++ b/src/emu/bus/comx35/clm.h
@@ -38,7 +38,7 @@ public:
virtual machine_config_constructor device_mconfig_additions() const;
// not really public
- void crtc_update_row(mc6845_device *device, bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, int de, int hbp, int vbp, void *param);
+ MC6845_UPDATE_ROW( crtc_update_row );
protected:
// device-level overrides
diff --git a/src/emu/bus/ecbbus/grip.c b/src/emu/bus/ecbbus/grip.c
index a5741101f8c..af28cbfa57b 100644
--- a/src/emu/bus/ecbbus/grip.c
+++ b/src/emu/bus/ecbbus/grip.c
@@ -223,57 +223,47 @@ ADDRESS_MAP_END
//**************************************************************************
//-------------------------------------------------
-// mc6845_interface crtc_intf
+// mc6845
//-------------------------------------------------
-void grip_device::crtc_update_row(mc6845_device *device, bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, int de, int hbp, int vbp, void *param)
+MC6845_UPDATE_ROW( grip_device::crtc_update_row )
{
- int column, bit;
-
- for (column = 0; column < x_count; column++)
+ for (int column = 0; column < x_count; column++)
{
UINT16 address = (m_page << 12) | (((ma + column) & 0xfff) << 3) | (ra & 0x07);
UINT8 data = m_video_ram[address];
-
- for (bit = 0; bit < 8; bit++)
+
+ for (int bit = 0; bit < 8; bit++)
{
int x = (column * 8) + bit;
int color = (m_flash ? 0 : BIT(data, bit)) && de;
-
+
bitmap.pix32(vbp + y, hbp + x) = m_palette->pen(color);
}
}
}
-
-static MC6845_UPDATE_ROW( grip_update_row )
-{
- grip_device *grip = downcast<grip_device *>(device->owner());
-
- grip->crtc_update_row(device,bitmap,cliprect,ma,ra,y,x_count,cursor_x,de,hbp,vbp,param);
-}
/*
-static MC6845_UPDATE_ROW( grip5_update_row )
+MC6845_UPDATE_ROW( grip_device::grip5_update_row )
{
- grip5_state *state = device->machine().driver_data<grip5_state>();
- const rgb_t *palette = state->m_palette->palette()->entry_list_raw();
+ const rgb_t *palette = m_palette->palette()->entry_list_raw();
int column, bit;
for (column = 0; column < x_count; column++)
{
- UINT16 address = (state->m_dpage << 12) | (((ma + column) & 0xfff) << 3) | (ra & 0x07);
- UINT8 data = state->m_video_ram[address];
+ UINT16 address = (m_dpage << 12) | (((ma + column) & 0xfff) << 3) | (ra & 0x07);
+ UINT8 data = m_video_ram[address];
for (bit = 0; bit < 8; bit++)
{
int x = (column * 8) + bit;
- int color = state->m_flash ? 0 : BIT(data, bit);
+ int color = m_flash ? 0 : BIT(data, bit);
bitmap.pix32(y, x) = palette[color];
}
}
}
-static MC6845_ON_UPDATE_ADDR_CHANGED( grip5_update_addr_changed )
+MC6845_ON_UPDATE_ADDR_CHANGED( grip_device::grip5_addr_changed )
{
}
*/
@@ -286,38 +276,6 @@ static const speaker_interface speaker_intf =
speaker_levels
};
-static MC6845_INTERFACE( crtc_intf )
-{
- true,
- 0,0,0,0,
- 8,
- NULL,
- grip_update_row,
- NULL,
- DEVCB_DEVICE_LINE_MEMBER(Z80STI_TAG, z80sti_device, i1_w),
- DEVCB_DEVICE_LINE_MEMBER(Z80STI_TAG, z80sti_device, i2_w),
- DEVCB_NULL,
- DEVCB_NULL,
- NULL
-};
-/*
-
-static MC6845_INTERFACE( grip5_crtc_intf )
-{
- false,
- 0,0,0,0,
- 8,
- NULL,
- grip5_update_row,
- NULL,
- DEVCB_DEVICE_LINE_MEMBER(Z80STI_TAG, z80sti_device, i1_w),
- DEVCB_DEVICE_LINE_MEMBER(Z80STI_TAG, z80sti_device, i2_w),
- DEVCB_NULL,
- DEVCB_NULL,
- grip5_update_addr_changed
-};
-*/
-
//-------------------------------------------------
// I8255A interface
@@ -527,8 +485,14 @@ static MACHINE_CONFIG_FRAGMENT( grip )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
// devices
- MCFG_MC6845_ADD(MC6845_TAG, MC6845, SCREEN_TAG, XTAL_16MHz/4, crtc_intf)
-// MCFG_MC6845_ADD(HD6345_TAG, HD6345, SCREEN_TAG, XTAL_16MHz/4, grip5_crtc_intf)
+ MCFG_MC6845_ADD(MC6845_TAG, MC6845, SCREEN_TAG, XTAL_16MHz/4)
+ MCFG_MC6845_SHOW_BORDER_AREA(true)
+ MCFG_MC6845_CHAR_WIDTH(8)
+ MCFG_MC6845_UPDATE_ROW_CB(grip_device, crtc_update_row)
+ MCFG_MC6845_OUT_DE_CB(DEVWRITELINE(Z80STI_TAG, z80sti_device, i1_w))
+ MCFG_MC6845_OUT_CUR_CB(DEVWRITELINE(Z80STI_TAG, z80sti_device, i1_w))
+
+// MCFG_MC6845_ADD(HD6345_TAG, HD6345, SCREEN_TAG, XTAL_16MHz/4)
MCFG_DEVICE_ADD(I8255A_TAG, I8255A, 0)
MCFG_I8255_IN_PORTA_CB(READ8(grip_device, ppi_pa_r))
diff --git a/src/emu/bus/ecbbus/grip.h b/src/emu/bus/ecbbus/grip.h
index 026513c13c6..71eff97c8d2 100644
--- a/src/emu/bus/ecbbus/grip.h
+++ b/src/emu/bus/ecbbus/grip.h
@@ -66,7 +66,7 @@ public:
DECLARE_WRITE_LINE_MEMBER( write_centronics_busy );
DECLARE_WRITE_LINE_MEMBER( write_centronics_fault );
- void crtc_update_row(mc6845_device *device, bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, int de, int hbp, int vbp, void *param);
+ MC6845_UPDATE_ROW( crtc_update_row );
protected:
// device-level overrides
diff --git a/src/emu/bus/isa/aga.c b/src/emu/bus/isa/aga.c
index ec1ac365018..fc8c49d9605 100644
--- a/src/emu/bus/isa/aga.c
+++ b/src/emu/bus/isa/aga.c
@@ -12,6 +12,19 @@
#define AGA_SCREEN_NAME "screen"
#define AGA_MC6845_NAME "mc6845_aga"
+enum
+{
+ MDA_TEXT_INTEN = 0,
+ MDA_TEXT_BLINK,
+ CGA_TEXT_INTEN,
+ CGA_TEXT_INTEN_ALT,
+ CGA_TEXT_BLINK,
+ CGA_TEXT_BLINK_ALT,
+ CGA_GFX_1BPP,
+ CGA_GFX_2BPP,
+ CGA_GFX_4BPPL,
+ CGA_GFX_4BPPH
+};
static INPUT_PORTS_START( aga )
PORT_START( "cga_config" )
@@ -47,6 +60,7 @@ isa8_aga_device::isa8_aga_device(const machine_config &mconfig, const char *tag,
m_palette(*this, "palette"),
m_mc6845(*this, AGA_MC6845_NAME),
m_cga_config(*this, "cga_config"),
+ m_update_row_type(-1),
m_mda_mode_control(0),
m_mda_status(0),
m_cga_mode_control(0),
@@ -64,6 +78,7 @@ isa8_aga_device::isa8_aga_device(const machine_config &mconfig, device_type type
m_palette(*this, "palette"),
m_mc6845(*this, AGA_MC6845_NAME),
m_cga_config(*this, "cga_config"),
+ m_update_row_type(-1),
m_mda_mode_control(0),
m_mda_status(0),
m_cga_mode_control(0),
@@ -223,34 +238,47 @@ WRITE_LINE_MEMBER( isa8_aga_device::vsync_changed )
}
-
-
-
-static MC6845_UPDATE_ROW( aga_update_row )
+MC6845_UPDATE_ROW( isa8_aga_device::aga_update_row )
{
- isa8_aga_device *aga = downcast<isa8_aga_device *>(device->owner());
- if ( aga->m_update_row )
+ if (m_update_row_type == -1)
+ return;
+
+ switch (m_update_row_type)
{
- aga->m_update_row( device, bitmap, cliprect, ma, ra, y, x_count, cursor_x, de, hbp, vbp, param );
+ case MDA_TEXT_INTEN:
+ mda_text_inten_update_row(bitmap, cliprect, ma, ra, y, x_count, cursor_x, de, hbp, vbp);
+ break;
+ case MDA_TEXT_BLINK:
+ mda_text_blink_update_row(bitmap, cliprect, ma, ra, y, x_count, cursor_x, de, hbp, vbp);
+ break;
+ case CGA_TEXT_INTEN:
+ cga_text_inten_update_row(bitmap, cliprect, ma, ra, y, x_count, cursor_x, de, hbp, vbp);
+ break;
+ case CGA_TEXT_INTEN_ALT:
+ cga_text_inten_alt_update_row(bitmap, cliprect, ma, ra, y, x_count, cursor_x, de, hbp, vbp);
+ break;
+ case CGA_TEXT_BLINK:
+ cga_text_blink_update_row(bitmap, cliprect, ma, ra, y, x_count, cursor_x, de, hbp, vbp);
+ break;
+ case CGA_TEXT_BLINK_ALT:
+ cga_text_blink_alt_update_row(bitmap, cliprect, ma, ra, y, x_count, cursor_x, de, hbp, vbp);
+ break;
+ case CGA_GFX_1BPP:
+ cga_gfx_1bpp_update_row(bitmap, cliprect, ma, ra, y, x_count, cursor_x, de, hbp, vbp);
+ break;
+ case CGA_GFX_2BPP:
+ cga_gfx_2bpp_update_row(bitmap, cliprect, ma, ra, y, x_count, cursor_x, de, hbp, vbp);
+ break;
+ case CGA_GFX_4BPPL:
+ cga_gfx_4bppl_update_row(bitmap, cliprect, ma, ra, y, x_count, cursor_x, de, hbp, vbp);
+ break;
+ case CGA_GFX_4BPPH:
+ cga_gfx_4bpph_update_row(bitmap, cliprect, ma, ra, y, x_count, cursor_x, de, hbp, vbp);
+ break;
}
}
-static MC6845_INTERFACE( mc6845_aga_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 8, /* numbers of pixels per video memory address */
- NULL, /* begin_update */
- aga_update_row, /* update_row */
- NULL, /* end_update */
- DEVCB_NULL, /* on_de_changed */
- DEVCB_NULL, /* on_cur_changed */
- DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, isa8_aga_device, hsync_changed), /* on_hsync_changed */
- DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, isa8_aga_device, vsync_changed), /* on_vsync_changed */
- NULL
-};
-
MACHINE_CONFIG_FRAGMENT( pcvideo_aga )
MCFG_SCREEN_ADD( AGA_SCREEN_NAME, RASTER )
MCFG_SCREEN_RAW_PARAMS( XTAL_14_31818MHz,912,0,640,262,0,200 )
@@ -258,7 +286,12 @@ MACHINE_CONFIG_FRAGMENT( pcvideo_aga )
MCFG_PALETTE_ADD( "palette", /* CGA_PALETTE_SETS * 16*/ 65536 )
- MCFG_MC6845_ADD( AGA_MC6845_NAME, MC6845, AGA_SCREEN_NAME, XTAL_14_31818MHz/8, mc6845_aga_intf )
+ MCFG_MC6845_ADD(AGA_MC6845_NAME, MC6845, AGA_SCREEN_NAME, XTAL_14_31818MHz/8)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
+ MCFG_MC6845_UPDATE_ROW_CB(isa8_aga_device, aga_update_row)
+ MCFG_MC6845_OUT_HSYNC_CB(WRITELINE(isa8_aga_device, hsync_changed))
+ MCFG_MC6845_OUT_VSYNC_CB(WRITELINE(isa8_aga_device, vsync_changed))
MACHINE_CONFIG_END
machine_config_constructor isa8_aga_device::device_mconfig_additions() const
@@ -273,10 +306,10 @@ machine_config_constructor isa8_aga_device::device_mconfig_additions() const
*************************************/
/* colors need fixing in the mda_text_* functions ! */
-static MC6845_UPDATE_ROW( mda_text_inten_update_row ) {
- isa8_aga_device *aga = downcast<isa8_aga_device *>(device->owner());
- const rgb_t *palette = aga->m_palette->palette()->entry_list_raw();
- UINT8 *videoram = aga->m_videoram;
+MC6845_UPDATE_ROW( isa8_aga_device::mda_text_inten_update_row )
+{
+ const rgb_t *palette = m_palette->palette()->entry_list_raw();
+ UINT8 *videoram = m_videoram;
UINT32 *p = &bitmap.pix32(y);
UINT16 chr_base = ( ra & 0x08 ) ? 0x800 | ( ra & 0x07 ) : ra;
int i;
@@ -286,7 +319,7 @@ static MC6845_UPDATE_ROW( mda_text_inten_update_row ) {
UINT16 offset = ( ( ma + i ) << 1 ) & 0x0FFF;
UINT8 chr = videoram[ offset ];
UINT8 attr = videoram[ offset + 1 ];
- UINT8 data = aga->m_mda_chr_gen[ chr_base + chr * 8 ];
+ UINT8 data = m_mda_chr_gen[ chr_base + chr * 8 ];
UINT8 fg = ( attr & 0x08 ) ? 3 : 2;
UINT8 bg = 0;
@@ -334,10 +367,10 @@ static MC6845_UPDATE_ROW( mda_text_inten_update_row ) {
}
-static MC6845_UPDATE_ROW( mda_text_blink_update_row ) {
- isa8_aga_device *aga = downcast<isa8_aga_device *>(device->owner());
- UINT8 *videoram = aga->m_videoram;
- const rgb_t *palette = aga->m_palette->palette()->entry_list_raw();
+MC6845_UPDATE_ROW( isa8_aga_device::mda_text_blink_update_row )
+{
+ UINT8 *videoram = m_videoram;
+ const rgb_t *palette = m_palette->palette()->entry_list_raw();
UINT32 *p = &bitmap.pix32(y);
UINT16 chr_base = ( ra & 0x08 ) ? 0x800 | ( ra & 0x07 ) : ra;
int i;
@@ -347,7 +380,7 @@ static MC6845_UPDATE_ROW( mda_text_blink_update_row ) {
UINT16 offset = ( ( ma + i ) << 1 ) & 0x0FFF;
UINT8 chr = videoram[ offset ];
UINT8 attr = videoram[ offset + 1 ];
- UINT8 data = aga->m_mda_chr_gen[ chr_base + chr * 8 ];
+ UINT8 data = m_mda_chr_gen[ chr_base + chr * 8 ];
UINT8 fg = ( attr & 0x08 ) ? 3 : 2;
UINT8 bg = 0;
@@ -374,7 +407,7 @@ static MC6845_UPDATE_ROW( mda_text_blink_update_row ) {
if ( ( attr & 0x07 ) == 0x01 ) {
data = 0xFF;
}
- if ( ( attr & 0x80 ) && ( aga->m_framecnt & 0x40 ) ) {
+ if ( ( attr & 0x80 ) && ( m_framecnt & 0x40 ) ) {
data = 0x00;
}
}
@@ -396,10 +429,10 @@ static MC6845_UPDATE_ROW( mda_text_blink_update_row ) {
}
-static MC6845_UPDATE_ROW( cga_text_inten_update_row ) {
- isa8_aga_device *aga = downcast<isa8_aga_device *>(device->owner());
- UINT8 *videoram = aga->m_videoram;
- const rgb_t *palette = aga->m_palette->palette()->entry_list_raw();
+MC6845_UPDATE_ROW( isa8_aga_device::cga_text_inten_update_row )
+{
+ UINT8 *videoram = m_videoram;
+ const rgb_t *palette = m_palette->palette()->entry_list_raw();
UINT32 *p = &bitmap.pix32(y);
int i;
@@ -408,7 +441,7 @@ static MC6845_UPDATE_ROW( cga_text_inten_update_row ) {
UINT16 offset = ( ( ma + i ) << 1 ) & 0x3fff;
UINT8 chr = videoram[ offset ];
UINT8 attr = videoram[ offset +1 ];
- UINT8 data = aga->m_cga_chr_gen[ chr * 16 + ra ];
+ UINT8 data = m_cga_chr_gen[ chr * 16 + ra ];
UINT16 fg = attr & 0x0F;
UINT16 bg = ( attr >> 4 ) & 0x07;
@@ -427,10 +460,10 @@ static MC6845_UPDATE_ROW( cga_text_inten_update_row ) {
}
}
-static MC6845_UPDATE_ROW( cga_text_inten_alt_update_row ) {
- isa8_aga_device *aga = downcast<isa8_aga_device *>(device->owner());
- const rgb_t *palette = aga->m_palette->palette()->entry_list_raw();
- UINT8 *videoram = aga->m_videoram;
+MC6845_UPDATE_ROW( isa8_aga_device::cga_text_inten_alt_update_row )
+{
+ const rgb_t *palette = m_palette->palette()->entry_list_raw();
+ UINT8 *videoram = m_videoram;
UINT32 *p = &bitmap.pix32(y);
int i;
@@ -439,7 +472,7 @@ static MC6845_UPDATE_ROW( cga_text_inten_alt_update_row ) {
UINT16 offset = ( ( ma + i ) << 1 ) & 0x3fff;
UINT8 chr = videoram[ offset ];
UINT8 attr = videoram[ offset +1 ];
- UINT8 data = aga->m_cga_chr_gen[ chr * 16 + ra ];
+ UINT8 data = m_cga_chr_gen[ chr * 16 + ra ];
UINT16 fg = attr & 0x0F;
if ( i == cursor_x ) {
@@ -457,10 +490,10 @@ static MC6845_UPDATE_ROW( cga_text_inten_alt_update_row ) {
}
}
-static MC6845_UPDATE_ROW( cga_text_blink_update_row ) {
- isa8_aga_device *aga = downcast<isa8_aga_device *>(device->owner());
- const rgb_t *palette = aga->m_palette->palette()->entry_list_raw();
- UINT8 *videoram = aga->m_videoram;
+MC6845_UPDATE_ROW( isa8_aga_device::cga_text_blink_update_row )
+{
+ const rgb_t *palette = m_palette->palette()->entry_list_raw();
+ UINT8 *videoram = m_videoram;
UINT32 *p = &bitmap.pix32(y);
int i;
@@ -468,14 +501,14 @@ static MC6845_UPDATE_ROW( cga_text_blink_update_row ) {
UINT16 offset = ( ( ma + i ) << 1 ) & 0x3fff;
UINT8 chr = videoram[ offset ];
UINT8 attr = videoram[ offset +1 ];
- UINT8 data = aga->m_cga_chr_gen[ chr * 16 + ra ];
+ UINT8 data = m_cga_chr_gen[ chr * 16 + ra ];
UINT16 fg = attr & 0x0F;
UINT16 bg = (attr >> 4) & 0x07;
if ( i == cursor_x ) {
data = 0xFF;
} else {
- if ( ( attr & 0x80 ) && ( aga->m_framecnt & 0x10 ) ) {
+ if ( ( attr & 0x80 ) && ( m_framecnt & 0x10 ) ) {
data = 0x00;
}
}
@@ -491,10 +524,10 @@ static MC6845_UPDATE_ROW( cga_text_blink_update_row ) {
}
}
-static MC6845_UPDATE_ROW( cga_text_blink_alt_update_row ) {
- isa8_aga_device *aga = downcast<isa8_aga_device *>(device->owner());
- const rgb_t *palette = aga->m_palette->palette()->entry_list_raw();
- UINT8 *videoram = aga->m_videoram;
+MC6845_UPDATE_ROW( isa8_aga_device::cga_text_blink_alt_update_row )
+{
+ const rgb_t *palette = m_palette->palette()->entry_list_raw();
+ UINT8 *videoram = m_videoram;
UINT32 *p = &bitmap.pix32(y);
int i;
@@ -503,14 +536,14 @@ static MC6845_UPDATE_ROW( cga_text_blink_alt_update_row ) {
UINT16 offset = ( ( ma + i ) << 1 ) & 0x3fff;
UINT8 chr = videoram[ offset ];
UINT8 attr = videoram[ offset +1 ];
- UINT8 data = aga->m_cga_chr_gen[ chr * 16 + ra ];
+ UINT8 data = m_cga_chr_gen[ chr * 16 + ra ];
UINT16 fg = attr & 0x07;
UINT16 bg = 0;
if ( i == cursor_x ) {
data = 0xFF;
} else {
- if ( ( attr & 0x80 ) && ( aga->m_framecnt & 0x10 ) ) {
+ if ( ( attr & 0x80 ) && ( m_framecnt & 0x10 ) ) {
data = 0x00;
bg = ( attr >> 4 ) & 0x07;
}
@@ -527,10 +560,10 @@ static MC6845_UPDATE_ROW( cga_text_blink_alt_update_row ) {
}
}
-static MC6845_UPDATE_ROW( cga_gfx_4bppl_update_row ) {
- isa8_aga_device *aga = downcast<isa8_aga_device *>(device->owner());
- const rgb_t *palette = aga->m_palette->palette()->entry_list_raw();
- UINT8 *videoram = aga->m_videoram;
+MC6845_UPDATE_ROW( isa8_aga_device::cga_gfx_4bppl_update_row )
+{
+ const rgb_t *palette = m_palette->palette()->entry_list_raw();
+ UINT8 *videoram = m_videoram;
UINT32 *p = &bitmap.pix32(y);
int i;
@@ -553,10 +586,10 @@ static MC6845_UPDATE_ROW( cga_gfx_4bppl_update_row ) {
}
}
-static MC6845_UPDATE_ROW( cga_gfx_4bpph_update_row ) {
- isa8_aga_device *aga = downcast<isa8_aga_device *>(device->owner());
- UINT8 *videoram = aga->m_videoram;
- const rgb_t *palette = aga->m_palette->palette()->entry_list_raw();
+MC6845_UPDATE_ROW( isa8_aga_device::cga_gfx_4bpph_update_row )
+{
+ UINT8 *videoram = m_videoram;
+ const rgb_t *palette = m_palette->palette()->entry_list_raw();
UINT32 *p = &bitmap.pix32(y);
int i;
@@ -587,10 +620,10 @@ static MC6845_UPDATE_ROW( cga_gfx_4bpph_update_row ) {
}
}
-static MC6845_UPDATE_ROW( cga_gfx_2bpp_update_row ) {
- isa8_aga_device *aga = downcast<isa8_aga_device *>(device->owner());
- UINT8 *videoram = aga->m_videoram;
- const rgb_t *palette = aga->m_palette->palette()->entry_list_raw();
+MC6845_UPDATE_ROW( isa8_aga_device::cga_gfx_2bpp_update_row )
+{
+ UINT8 *videoram = m_videoram;
+ const rgb_t *palette = m_palette->palette()->entry_list_raw();
UINT32 *p = &bitmap.pix32(y);
int i;
@@ -599,26 +632,26 @@ static MC6845_UPDATE_ROW( cga_gfx_2bpp_update_row ) {
UINT16 offset = ( ( ( ma + i ) << 1 ) & 0x1fff ) | ( ( y & 1 ) << 13 );
UINT8 data = videoram[ offset ];
- *p = palette[aga->m_cga_palette_lut_2bpp[ ( data >> 6 ) & 0x03 ]]; p++;
- *p = palette[aga->m_cga_palette_lut_2bpp[ ( data >> 4 ) & 0x03 ]]; p++;
- *p = palette[aga->m_cga_palette_lut_2bpp[ ( data >> 2 ) & 0x03 ]]; p++;
- *p = palette[aga->m_cga_palette_lut_2bpp[ data & 0x03 ]]; p++;
+ *p = palette[m_cga_palette_lut_2bpp[ ( data >> 6 ) & 0x03 ]]; p++;
+ *p = palette[m_cga_palette_lut_2bpp[ ( data >> 4 ) & 0x03 ]]; p++;
+ *p = palette[m_cga_palette_lut_2bpp[ ( data >> 2 ) & 0x03 ]]; p++;
+ *p = palette[m_cga_palette_lut_2bpp[ data & 0x03 ]]; p++;
data = videoram[ offset+1 ];
- *p = palette[aga->m_cga_palette_lut_2bpp[ ( data >> 6 ) & 0x03 ]]; p++;
- *p = palette[aga->m_cga_palette_lut_2bpp[ ( data >> 4 ) & 0x03 ]]; p++;
- *p = palette[aga->m_cga_palette_lut_2bpp[ ( data >> 2 ) & 0x03 ]]; p++;
- *p = palette[aga->m_cga_palette_lut_2bpp[ data & 0x03 ]]; p++;
+ *p = palette[m_cga_palette_lut_2bpp[ ( data >> 6 ) & 0x03 ]]; p++;
+ *p = palette[m_cga_palette_lut_2bpp[ ( data >> 4 ) & 0x03 ]]; p++;
+ *p = palette[m_cga_palette_lut_2bpp[ ( data >> 2 ) & 0x03 ]]; p++;
+ *p = palette[m_cga_palette_lut_2bpp[ data & 0x03 ]]; p++;
}
}
-static MC6845_UPDATE_ROW( cga_gfx_1bpp_update_row ) {
- isa8_aga_device *aga = downcast<isa8_aga_device *>(device->owner());
- UINT8 *videoram = aga->m_videoram;
- const rgb_t *palette = aga->m_palette->palette()->entry_list_raw();
+MC6845_UPDATE_ROW( isa8_aga_device::cga_gfx_1bpp_update_row )
+{
+ UINT8 *videoram = m_videoram;
+ const rgb_t *palette = m_palette->palette()->entry_list_raw();
UINT32 *p = &bitmap.pix32(y);
- UINT8 fg = aga->m_cga_color_select & 0x0F;
+ UINT8 fg = m_cga_color_select & 0x0F;
int i;
if ( y == 0 ) logerror("cga_gfx_1bpp_update_row\n");
@@ -690,22 +723,22 @@ WRITE8_MEMBER ( isa8_aga_device::pc_aga_mda_w )
case 8:
m_mda_mode_control = data;
- switch( m_mda_mode_control & 0x2a ) {
+ switch (m_mda_mode_control & 0x2a)
+ {
case 0x08:
- m_update_row = mda_text_inten_update_row;
+ m_update_row_type = MDA_TEXT_INTEN;
break;
case 0x28:
- m_update_row = mda_text_blink_update_row;
+ m_update_row_type = MDA_TEXT_BLINK;
break;
default:
- m_update_row = NULL;
+ m_update_row_type = -1;
}
break;
}
}
}
-
READ8_MEMBER ( isa8_aga_device::pc_aga_cga_r )
{
UINT8 data = 0xFF;
@@ -774,51 +807,51 @@ WRITE8_MEMBER (isa8_aga_device:: pc_aga_cga_w )
break;
case 8:
m_cga_mode_control = data;
-
+
//logerror("mode set to %02X\n", m_cga_mode_control & 0x3F );
switch ( m_cga_mode_control & 0x3F ) {
case 0x08: case 0x09: case 0x0C: case 0x0D:
m_mc6845->set_hpixels_per_column( 8 );
- m_update_row = cga_text_inten_update_row;
+ m_update_row_type = CGA_TEXT_INTEN;
break;
case 0x0A: case 0x0B: case 0x2A: case 0x2B:
m_mc6845->set_hpixels_per_column( 8 );
if ( CGA_MONITOR == CGA_MONITOR_COMPOSITE ) {
- m_update_row = cga_gfx_4bppl_update_row;
+ m_update_row_type = CGA_GFX_4BPPL;
} else {
- m_update_row = cga_gfx_2bpp_update_row;
+ m_update_row_type = CGA_GFX_2BPP;
}
- break;
+ break;
case 0x0E: case 0x0F: case 0x2E: case 0x2F:
m_mc6845->set_hpixels_per_column( 8 );
- m_update_row = cga_gfx_2bpp_update_row;
+ m_update_row_type = CGA_GFX_2BPP;
break;
case 0x18: case 0x19: case 0x1C: case 0x1D:
m_mc6845->set_hpixels_per_column( 8 );
- m_update_row = cga_text_inten_alt_update_row;
+ m_update_row_type = CGA_TEXT_INTEN_ALT;
break;
case 0x1A: case 0x1B: case 0x3A: case 0x3B:
m_mc6845->set_hpixels_per_column( 8 );
if ( CGA_MONITOR == CGA_MONITOR_COMPOSITE ) {
- m_update_row = cga_gfx_4bpph_update_row;
+ m_update_row_type = CGA_GFX_4BPPH;
} else {
- m_update_row = cga_gfx_1bpp_update_row;
+ m_update_row_type = CGA_GFX_1BPP;
}
- break;
+ break;
case 0x1E: case 0x1F: case 0x3E: case 0x3F:
m_mc6845->set_hpixels_per_column( 16 );
- m_update_row = cga_gfx_1bpp_update_row;
+ m_update_row_type = CGA_GFX_1BPP;
break;
case 0x28: case 0x29: case 0x2C: case 0x2D:
m_mc6845->set_hpixels_per_column( 8 );
- m_update_row = cga_text_blink_update_row;
+ m_update_row_type = CGA_TEXT_BLINK;
break;
case 0x38: case 0x39: case 0x3C: case 0x3D:
m_mc6845->set_hpixels_per_column( 8 );
- m_update_row = cga_text_blink_alt_update_row;
+ m_update_row_type = CGA_TEXT_BLINK_ALT;
break;
default:
- m_update_row = NULL;
+ m_update_row_type = -1;
break;
}
diff --git a/src/emu/bus/isa/aga.h b/src/emu/bus/isa/aga.h
index 12568353e3a..e764458a087 100644
--- a/src/emu/bus/isa/aga.h
+++ b/src/emu/bus/isa/aga.h
@@ -56,12 +56,24 @@ public:
DECLARE_WRITE8_MEMBER( pc_aga_videoram_w );
DECLARE_READ8_MEMBER( pc_aga_videoram_r );
+ MC6845_UPDATE_ROW( aga_update_row );
+ MC6845_UPDATE_ROW( mda_text_inten_update_row );
+ MC6845_UPDATE_ROW( mda_text_blink_update_row );
+ MC6845_UPDATE_ROW( cga_text_inten_update_row );
+ MC6845_UPDATE_ROW( cga_text_inten_alt_update_row );
+ MC6845_UPDATE_ROW( cga_text_blink_update_row );
+ MC6845_UPDATE_ROW( cga_text_blink_alt_update_row );
+ MC6845_UPDATE_ROW( cga_gfx_4bppl_update_row );
+ MC6845_UPDATE_ROW( cga_gfx_4bpph_update_row );
+ MC6845_UPDATE_ROW( cga_gfx_2bpp_update_row );
+ MC6845_UPDATE_ROW( cga_gfx_1bpp_update_row );
+
required_device<palette_device> m_palette;
required_device<mc6845_device> m_mc6845;
required_ioport m_cga_config;
- mc6845_update_row_func m_update_row;
+ int m_update_row_type;
AGA_MODE m_mode;
UINT8 m_mda_mode_control;
UINT8 m_mda_status;
diff --git a/src/emu/bus/isa/cga.c b/src/emu/bus/isa/cga.c
index cd5557ee6b2..aa205c53e48 100644
--- a/src/emu/bus/isa/cga.c
+++ b/src/emu/bus/isa/cga.c
@@ -95,11 +95,26 @@ TODO:
if(VERBOSE_CGA>=N) \
{ \
if( M ) \
- logerror("%11.6f: %-24s",machine.time().as_double(),(char*)M ); \
+ logerror("%11.6f: %-24s",machine().time().as_double(),(char*)M ); \
logerror A; \
} \
} while (0)
+enum
+{
+ CGA_TEXT_INTEN = 0,
+ CGA_TEXT_INTEN_ALT,
+ CGA_TEXT_INTEN_CG,
+ CGA_TEXT_BLINK,
+ CGA_TEXT_BLINK_ALT,
+ CGA_TEXT_BLINK_SI,
+ CGA_GFX_1BPP,
+ CGA_GFX_2BPP,
+ CGA_GFX_4BPPL,
+ CGA_GFX_4BPPH,
+ PC1512_GFX_4BPP
+};
+
/***************************************************************************
Static declarations
@@ -161,30 +176,63 @@ INPUT_PORTS_END
#define CGA_CHIPSET_ATI 0x60 /* ATI (supports Plantronics) */
#define CGA_CHIPSET_PARADISE 0x80 /* Paradise (used in PC1640) */
-static MC6845_UPDATE_ROW( cga_update_row )
+MC6845_UPDATE_ROW( isa8_cga_device::crtc_update_row )
{
- isa8_cga_device *cga = downcast<isa8_cga_device *>(device->owner());
- if ( cga->m_update_row )
+ if (m_update_row_type == -1)
+ return;
+
+ switch (m_update_row_type)
{
- cga->m_update_row( device, bitmap, cliprect, ma, ra, y, x_count, cursor_x, de, hbp, vbp, param );
+ case CGA_TEXT_INTEN:
+ cga_text_inten_update_row(bitmap, cliprect, ma, ra, y, x_count, cursor_x, de, hbp, vbp);
+ break;
+ case CGA_TEXT_INTEN_ALT:
+ cga_text_inten_alt_update_row(bitmap, cliprect, ma, ra, y, x_count, cursor_x, de, hbp, vbp);
+ break;
+ case CGA_TEXT_INTEN_CG:
+ cga_text_inten_comp_grey_update_row(bitmap, cliprect, ma, ra, y, x_count, cursor_x, de, hbp, vbp);
+ break;
+ case CGA_TEXT_BLINK:
+ cga_text_blink_update_row(bitmap, cliprect, ma, ra, y, x_count, cursor_x, de, hbp, vbp);
+ break;
+ case CGA_TEXT_BLINK_ALT:
+ cga_text_blink_alt_update_row(bitmap, cliprect, ma, ra, y, x_count, cursor_x, de, hbp, vbp);
+ break;
+ case CGA_TEXT_BLINK_SI:
+ cga_text_blink_update_row_si(bitmap, cliprect, ma, ra, y, x_count, cursor_x, de, hbp, vbp);
+ break;
+ case CGA_GFX_1BPP:
+ cga_gfx_1bpp_update_row(bitmap, cliprect, ma, ra, y, x_count, cursor_x, de, hbp, vbp);
+ break;
+ case CGA_GFX_2BPP:
+ cga_gfx_2bpp_update_row(bitmap, cliprect, ma, ra, y, x_count, cursor_x, de, hbp, vbp);
+ break;
+ case CGA_GFX_4BPPL:
+ cga_gfx_4bppl_update_row(bitmap, cliprect, ma, ra, y, x_count, cursor_x, de, hbp, vbp);
+ break;
+ case CGA_GFX_4BPPH:
+ cga_gfx_4bpph_update_row(bitmap, cliprect, ma, ra, y, x_count, cursor_x, de, hbp, vbp);
+ break;
}
}
-static MC6845_INTERFACE( mc6845_cga_intf )
+MC6845_UPDATE_ROW( isa8_cga_pc1512_device::crtc_update_row )
{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 8, /* numbers of pixels per video memory address */
- NULL, /* begin_update */
- cga_update_row, /* update_row */
- NULL, /* end_update */
- DEVCB_NULL, /* on_de_changed */
- DEVCB_NULL, /* on_cur_changed */
- DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, isa8_cga_device, hsync_changed), /* on_hsync_changed */
- DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, isa8_cga_device, vsync_changed), /* on_vsync_changed */
- NULL
-};
+ if (m_update_row_type == -1)
+ return;
+
+ switch (m_update_row_type)
+ {
+ case PC1512_GFX_4BPP:
+ pc1512_gfx_4bpp_update_row(bitmap, cliprect, ma, ra, y, x_count, cursor_x, de, hbp, vbp);
+ break;
+ default:
+ isa8_cga_device::crtc_update_row(bitmap, cliprect, ma, ra, y, x_count, cursor_x, de, hbp, vbp);
+ break;
+ }
+}
+
#define CGA_HCLK (XTAL_14_31818MHz/8)
#define CGA_LCLK (XTAL_14_31818MHz/16)
@@ -197,7 +245,12 @@ static MACHINE_CONFIG_FRAGMENT( cga )
MCFG_PALETTE_ADD("palette", /* CGA_PALETTE_SETS * 16*/ 65536 )
- MCFG_MC6845_ADD(CGA_MC6845_NAME, MC6845, CGA_SCREEN_NAME, XTAL_14_31818MHz/8, mc6845_cga_intf)
+ MCFG_MC6845_ADD(CGA_MC6845_NAME, MC6845, CGA_SCREEN_NAME, XTAL_14_31818MHz/8)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
+ MCFG_MC6845_UPDATE_ROW_CB(isa8_cga_device, crtc_update_row)
+ MCFG_MC6845_OUT_HSYNC_CB(WRITELINE(isa8_cga_device, hsync_changed))
+ MCFG_MC6845_OUT_VSYNC_CB(WRITELINE(isa8_cga_device, vsync_changed))
MACHINE_CONFIG_END
@@ -247,6 +300,7 @@ isa8_cga_device::isa8_cga_device(const machine_config &mconfig, const char *tag,
device_t(mconfig, ISA8_CGA, "IBM Color/Graphics Monitor Adapter", tag, owner, clock, "cga", __FILE__),
device_isa8_card_interface(mconfig, *this),
m_cga_config(*this, "cga_config"),
+ m_update_row_type(-1),
m_vram_size( 0x4000 ),
m_palette(*this, "palette")
{
@@ -261,6 +315,7 @@ isa8_cga_device::isa8_cga_device(const machine_config &mconfig, device_type type
device_t(mconfig, type, name, tag, owner, clock, shortname, source),
device_isa8_card_interface(mconfig, *this),
m_cga_config(*this, "cga_config"),
+ m_update_row_type(-1),
m_vram_size( 0x4000 ),
m_palette(*this, "palette")
{
@@ -283,7 +338,6 @@ void isa8_cga_device::device_start()
set_isa_device();
m_vram.resize(m_vram_size);
- m_update_row = NULL;
m_isa->install_device(0x3d0, 0x3df, 0, 0, read8_delegate( FUNC(isa8_cga_device::io_read), this ), write8_delegate( FUNC(isa8_cga_device::io_write), this ) );
m_isa->install_bank(0xb8000, 0xb8000 + MIN(0x8000,m_vram_size) - 1, 0, m_vram_size & 0x4000, "bank_cga", m_vram);
@@ -320,7 +374,6 @@ void isa8_cga_device::device_start()
void isa8_cga_device::device_reset()
{
- m_update_row = NULL;
m_framecnt = 0;
m_mode_control = 0;
m_vsync = 0;
@@ -414,14 +467,12 @@ isa8_cga_superimpose_device::isa8_cga_superimpose_device(const machine_config &m
The character cell size is 16x8
***************************************************************************/
-static MC6845_UPDATE_ROW( cga_text_inten_update_row )
+MC6845_UPDATE_ROW( isa8_cga_device::cga_text_inten_update_row )
{
- isa8_cga_device *cga = downcast<isa8_cga_device *>(device->owner());
- UINT8 *videoram = &cga->m_vram[cga->m_start_offset];
+ UINT8 *videoram = &m_vram[m_start_offset];
UINT32 *p = &bitmap.pix32(y);
- const rgb_t *palette = cga->m_palette->palette()->entry_list_raw();
+ const rgb_t *palette = m_palette->palette()->entry_list_raw();
int i;
- running_machine &machine = device->machine();
if ( y == 0 ) CGA_LOG(1,"cga_text_inten_update_row",("\n"));
for ( i = 0; i < x_count; i++ )
@@ -429,11 +480,11 @@ static MC6845_UPDATE_ROW( cga_text_inten_update_row )
UINT16 offset = ( ( ma + i ) << 1 ) & 0x3fff;
UINT8 chr = videoram[ offset ];
UINT8 attr = videoram[ offset +1 ];
- UINT8 data = cga->m_chr_gen[ chr * 8 + ra ];
+ UINT8 data = m_chr_gen[ chr * 8 + ra ];
UINT16 fg = attr & 0x0F;
UINT16 bg = attr >> 4;
- if ( i == cursor_x && ( cga->m_framecnt & 0x08 ) )
+ if ( i == cursor_x && ( m_framecnt & 0x08 ) )
{
data = 0xFF;
}
@@ -455,14 +506,12 @@ static MC6845_UPDATE_ROW( cga_text_inten_update_row )
The character cell size is 16x8. Composite monitor, greyscale.
***************************************************************************/
-static MC6845_UPDATE_ROW( cga_text_inten_comp_grey_update_row )
+MC6845_UPDATE_ROW( isa8_cga_device::cga_text_inten_comp_grey_update_row )
{
- isa8_cga_device *cga = downcast<isa8_cga_device *>(device->owner());
- UINT8 *videoram = &cga->m_vram[cga->m_start_offset];
+ UINT8 *videoram = &m_vram[m_start_offset];
UINT32 *p = &bitmap.pix32(y);
- const rgb_t *palette = cga->m_palette->palette()->entry_list_raw();
+ const rgb_t *palette = m_palette->palette()->entry_list_raw();
int i;
- running_machine &machine = device->machine();
if ( y == 0 ) CGA_LOG(1,"cga_text_inten_update_row",("\n"));
for ( i = 0; i < x_count; i++ )
@@ -470,11 +519,11 @@ static MC6845_UPDATE_ROW( cga_text_inten_comp_grey_update_row )
UINT16 offset = ( ( ma + i ) << 1 ) & 0x3fff;
UINT8 chr = videoram[ offset ];
UINT8 attr = videoram[ offset +1 ];
- UINT8 data = cga->m_chr_gen[ chr * 8 + ra ];
+ UINT8 data = m_chr_gen[ chr * 8 + ra ];
UINT16 fg = 0x10 + ( attr & 0x0F );
UINT16 bg = 0x10 + ( ( attr >> 4 ) & 0x07 );
- if ( i == cursor_x && ( cga->m_framecnt & 0x08 ) )
+ if ( i == cursor_x && ( m_framecnt & 0x08 ) )
{
data = 0xFF;
}
@@ -495,14 +544,12 @@ static MC6845_UPDATE_ROW( cga_text_inten_comp_grey_update_row )
The character cell size is 16x8
***************************************************************************/
-static MC6845_UPDATE_ROW( cga_text_inten_alt_update_row )
+MC6845_UPDATE_ROW( isa8_cga_device::cga_text_inten_alt_update_row )
{
- isa8_cga_device *cga = downcast<isa8_cga_device *>(device->owner());
- UINT8 *videoram = &cga->m_vram[cga->m_start_offset];
+ UINT8 *videoram = &m_vram[m_start_offset];
UINT32 *p = &bitmap.pix32(y);
- const rgb_t *palette = cga->m_palette->palette()->entry_list_raw();
+ const rgb_t *palette = m_palette->palette()->entry_list_raw();
int i;
- running_machine &machine = device->machine();
if ( y == 0 ) CGA_LOG(1,"cga_text_inten_alt_update_row",("\n"));
for ( i = 0; i < x_count; i++ )
@@ -510,10 +557,10 @@ static MC6845_UPDATE_ROW( cga_text_inten_alt_update_row )
UINT16 offset = ( ( ma + i ) << 1 ) & 0x3fff;
UINT8 chr = videoram[ offset ];
UINT8 attr = videoram[ offset +1 ];
- UINT8 data = cga->m_chr_gen[ chr * 8 + ra ];
+ UINT8 data = m_chr_gen[ chr * 8 + ra ];
UINT16 fg = attr & 0x0F;
- if ( i == cursor_x && ( cga->m_framecnt & 0x08 ) )
+ if ( i == cursor_x && ( m_framecnt & 0x08 ) )
{
data = 0xFF;
}
@@ -535,14 +582,12 @@ static MC6845_UPDATE_ROW( cga_text_inten_alt_update_row )
The character cell size is 16x8
***************************************************************************/
-static MC6845_UPDATE_ROW( cga_text_blink_update_row )
+MC6845_UPDATE_ROW( isa8_cga_device::cga_text_blink_update_row )
{
- isa8_cga_device *cga = downcast<isa8_cga_device *>(device->owner());
- UINT8 *videoram = &cga->m_vram[cga->m_start_offset];
+ UINT8 *videoram = &m_vram[m_start_offset];
UINT32 *p = &bitmap.pix32(y);
- const rgb_t *palette = cga->m_palette->palette()->entry_list_raw();
+ const rgb_t *palette = m_palette->palette()->entry_list_raw();
int i;
- running_machine &machine = device->machine();
if ( y == 0 ) CGA_LOG(1,"cga_text_blink_update_row",("\n"));
for ( i = 0; i < x_count; i++ )
@@ -550,20 +595,20 @@ static MC6845_UPDATE_ROW( cga_text_blink_update_row )
UINT16 offset = ( ( ma + i ) << 1 ) & 0x3fff;
UINT8 chr = videoram[ offset ];
UINT8 attr = videoram[ offset +1 ];
- UINT8 data = cga->m_chr_gen[ chr * 8 + ra ];
+ UINT8 data = m_chr_gen[ chr * 8 + ra ];
UINT16 fg = attr & 0x0F;
UINT16 bg = (attr >> 4) & 0x07;
if ( i == cursor_x )
{
- if ( cga->m_framecnt & 0x08 )
+ if ( m_framecnt & 0x08 )
{
data = 0xFF;
}
}
else
{
- if ( ( attr & 0x80 ) && ( cga->m_framecnt & 0x10 ) )
+ if ( ( attr & 0x80 ) && ( m_framecnt & 0x10 ) )
{
data = 0x00;
}
@@ -580,14 +625,12 @@ static MC6845_UPDATE_ROW( cga_text_blink_update_row )
}
}
-static MC6845_UPDATE_ROW( cga_text_blink_update_row_si )
+MC6845_UPDATE_ROW( isa8_cga_device::cga_text_blink_update_row_si )
{
- isa8_cga_device *cga = downcast<isa8_cga_device *>(device->owner());
- UINT8 *videoram = &cga->m_vram[cga->m_start_offset];
+ UINT8 *videoram = &m_vram[m_start_offset];
UINT32 *p = &bitmap.pix32(y);
- const rgb_t *palette = cga->m_palette->palette()->entry_list_raw();
+ const rgb_t *palette = m_palette->palette()->entry_list_raw();
int i;
- running_machine &machine = device->machine();
if ( y == 0 ) CGA_LOG(1,"cga_text_blink_update_row",("\n"));
for ( i = 0; i < x_count; i++ )
@@ -595,21 +638,21 @@ static MC6845_UPDATE_ROW( cga_text_blink_update_row_si )
UINT16 offset = ( ( ma + i ) << 1 ) & 0x3fff;
UINT8 chr = videoram[ offset ];
UINT8 attr = videoram[ offset +1 ];
- UINT8 data = cga->m_chr_gen[ chr * 8 + ra ];
+ UINT8 data = m_chr_gen[ chr * 8 + ra ];
UINT16 fg = attr & 0x0F;
UINT16 bg = (attr >> 4) & 0x07;
UINT8 xi;
if ( i == cursor_x )
{
- if ( cga->m_framecnt & 0x08 )
+ if ( m_framecnt & 0x08 )
{
data = 0xFF;
}
}
else
{
- if ( ( attr & 0x80 ) && ( cga->m_framecnt & 0x10 ) )
+ if ( ( attr & 0x80 ) && ( m_framecnt & 0x10 ) )
{
data = 0x00;
}
@@ -633,14 +676,12 @@ static MC6845_UPDATE_ROW( cga_text_blink_update_row_si )
The character cell size is 16x8
***************************************************************************/
-static MC6845_UPDATE_ROW( cga_text_blink_alt_update_row )
+MC6845_UPDATE_ROW( isa8_cga_device::cga_text_blink_alt_update_row )
{
- isa8_cga_device *cga = downcast<isa8_cga_device *>(device->owner());
- UINT8 *videoram = &cga->m_vram[cga->m_start_offset];
+ UINT8 *videoram = &m_vram[m_start_offset];
UINT32 *p = &bitmap.pix32(y);
- const rgb_t *palette = cga->m_palette->palette()->entry_list_raw();
+ const rgb_t *palette = m_palette->palette()->entry_list_raw();
int i;
- running_machine &machine = device->machine();
if ( y == 0 ) CGA_LOG(1,"cga_text_blink_alt_update_row",("\n"));
for ( i = 0; i < x_count; i++ )
@@ -648,20 +689,20 @@ static MC6845_UPDATE_ROW( cga_text_blink_alt_update_row )
UINT16 offset = ( ( ma + i ) << 1 ) & 0x3fff;
UINT8 chr = videoram[ offset ];
UINT8 attr = videoram[ offset +1 ];
- UINT8 data = cga->m_chr_gen[ chr * 8 + ra ];
+ UINT8 data = m_chr_gen[ chr * 8 + ra ];
UINT16 fg = attr & 0x07;
UINT16 bg = 0;
if ( i == cursor_x )
{
- if ( cga->m_framecnt & 0x08 )
+ if ( m_framecnt & 0x08 )
{
data = 0xFF;
}
}
else
{
- if ( ( attr & 0x80 ) && ( cga->m_framecnt & 0x10 ) )
+ if ( ( attr & 0x80 ) && ( m_framecnt & 0x10 ) )
{
data = 0x00;
bg = ( attr >> 4 ) & 0x07;
@@ -682,14 +723,12 @@ static MC6845_UPDATE_ROW( cga_text_blink_alt_update_row )
/* The lo-res (320x200) graphics mode on a colour composite monitor */
-static MC6845_UPDATE_ROW( cga_gfx_4bppl_update_row )
+MC6845_UPDATE_ROW( isa8_cga_device::cga_gfx_4bppl_update_row )
{
- isa8_cga_device *cga = downcast<isa8_cga_device *>(device->owner());
- UINT8 *videoram = &cga->m_vram[cga->m_start_offset];
+ UINT8 *videoram = &m_vram[m_start_offset];
UINT32 *p = &bitmap.pix32(y);
- const rgb_t *palette = cga->m_palette->palette()->entry_list_raw();
+ const rgb_t *palette = m_palette->palette()->entry_list_raw();
int i;
- running_machine &machine = device->machine();
if ( y == 0 ) CGA_LOG(1,"cga_gfx_4bppl_update_row",("\n"));
for ( i = 0; i < x_count; i++ )
@@ -743,14 +782,12 @@ static const UINT8 yc_lut[16][8] =
};
#endif
-static MC6845_UPDATE_ROW( cga_gfx_4bpph_update_row )
+MC6845_UPDATE_ROW( isa8_cga_device::cga_gfx_4bpph_update_row )
{
- isa8_cga_device *cga = downcast<isa8_cga_device *>(device->owner());
- UINT8 *videoram = &cga->m_vram[cga->m_start_offset];
+ UINT8 *videoram = &m_vram[m_start_offset];
UINT32 *p = &bitmap.pix32(y);
- const rgb_t *palette = cga->m_palette->palette()->entry_list_raw();
+ const rgb_t *palette = m_palette->palette()->entry_list_raw();
int i;
- running_machine &machine = device->machine();
if ( y == 0 ) CGA_LOG(1,"cga_gfx_4bpph_update_row",("\n"));
@@ -788,14 +825,12 @@ static MC6845_UPDATE_ROW( cga_gfx_4bpph_update_row )
cga fetches 2 byte per mc6845 access.
***************************************************************************/
-static MC6845_UPDATE_ROW( cga_gfx_2bpp_update_row )
+MC6845_UPDATE_ROW( isa8_cga_device::cga_gfx_2bpp_update_row )
{
- isa8_cga_device *cga = downcast<isa8_cga_device *>(device->owner());
- UINT8 *videoram = &cga->m_vram[cga->m_start_offset];
+ UINT8 *videoram = &m_vram[m_start_offset];
UINT32 *p = &bitmap.pix32(y);
- const rgb_t *palette = cga->m_palette->palette()->entry_list_raw();
+ const rgb_t *palette = m_palette->palette()->entry_list_raw();
int i;
- running_machine &machine = device->machine();
if ( y == 0 ) CGA_LOG(1,"cga_gfx_2bpp_update_row",("\n"));
for ( i = 0; i < x_count; i++ )
@@ -803,17 +838,17 @@ static MC6845_UPDATE_ROW( cga_gfx_2bpp_update_row )
UINT16 offset = ( ( ( ma + i ) << 1 ) & 0x1fff ) | ( ( y & 1 ) << 13 );
UINT8 data = videoram[ offset ];
- *p = palette[cga->m_palette_lut_2bpp[ ( data >> 6 ) & 0x03 ]]; p++;
- *p = palette[cga->m_palette_lut_2bpp[ ( data >> 4 ) & 0x03 ]]; p++;
- *p = palette[cga->m_palette_lut_2bpp[ ( data >> 2 ) & 0x03 ]]; p++;
- *p = palette[cga->m_palette_lut_2bpp[ data & 0x03 ]]; p++;
+ *p = palette[m_palette_lut_2bpp[ ( data >> 6 ) & 0x03 ]]; p++;
+ *p = palette[m_palette_lut_2bpp[ ( data >> 4 ) & 0x03 ]]; p++;
+ *p = palette[m_palette_lut_2bpp[ ( data >> 2 ) & 0x03 ]]; p++;
+ *p = palette[m_palette_lut_2bpp[ data & 0x03 ]]; p++;
data = videoram[ offset+1 ];
- *p = palette[cga->m_palette_lut_2bpp[ ( data >> 6 ) & 0x03 ]]; p++;
- *p = palette[cga->m_palette_lut_2bpp[ ( data >> 4 ) & 0x03 ]]; p++;
- *p = palette[cga->m_palette_lut_2bpp[ ( data >> 2 ) & 0x03 ]]; p++;
- *p = palette[cga->m_palette_lut_2bpp[ data & 0x03 ]]; p++;
+ *p = palette[m_palette_lut_2bpp[ ( data >> 6 ) & 0x03 ]]; p++;
+ *p = palette[m_palette_lut_2bpp[ ( data >> 4 ) & 0x03 ]]; p++;
+ *p = palette[m_palette_lut_2bpp[ ( data >> 2 ) & 0x03 ]]; p++;
+ *p = palette[m_palette_lut_2bpp[ data & 0x03 ]]; p++;
}
}
@@ -825,15 +860,13 @@ static MC6845_UPDATE_ROW( cga_gfx_2bpp_update_row )
Even scanlines are from CGA_base + 0x0000, odd from CGA_base + 0x2000
***************************************************************************/
-static MC6845_UPDATE_ROW( cga_gfx_1bpp_update_row )
+MC6845_UPDATE_ROW( isa8_cga_device::cga_gfx_1bpp_update_row )
{
- isa8_cga_device *cga = downcast<isa8_cga_device *>(device->owner());
- UINT8 *videoram = &cga->m_vram[cga->m_start_offset];
+ UINT8 *videoram = &m_vram[m_start_offset];
UINT32 *p = &bitmap.pix32(y);
- const rgb_t *palette = cga->m_palette->palette()->entry_list_raw();
- UINT8 fg = cga->m_color_select & 0x0F;
+ const rgb_t *palette = m_palette->palette()->entry_list_raw();
+ UINT8 fg = m_color_select & 0x0F;
int i;
- running_machine &machine = device->machine();
if ( y == 0 ) CGA_LOG(1,"cga_gfx_1bpp_update_row",("\n"));
for ( i = 0; i < x_count; i++ )
@@ -952,53 +985,53 @@ void isa8_cga_device::mode_control_w(UINT8 data)
if ( m_mode_control & 0x04 )
{
/* Composite greyscale */
- m_update_row = cga_text_inten_comp_grey_update_row;
+ m_update_row_type = CGA_TEXT_INTEN_CG;
}
else
{
/* Composite colour */
- m_update_row = cga_text_inten_update_row;
+ m_update_row_type = CGA_TEXT_INTEN;
}
}
else
{
/* RGB colour */
- m_update_row = cga_text_inten_update_row;
+ m_update_row_type = CGA_TEXT_INTEN;
}
break;
case 0x0A: case 0x0B: case 0x2A: case 0x2B:
mc6845->set_hpixels_per_column( 8 );
if ( monitor == CGA_MONITOR_COMPOSITE )
{
- m_update_row = cga_gfx_4bppl_update_row;
+ m_update_row_type = CGA_GFX_4BPPL;
}
else
{
- m_update_row = cga_gfx_2bpp_update_row;
+ m_update_row_type = CGA_GFX_2BPP;
}
break;
case 0x0E: case 0x0F: case 0x2E: case 0x2F:
mc6845->set_hpixels_per_column( 8 );
- m_update_row = cga_gfx_2bpp_update_row;
+ m_update_row_type = CGA_GFX_2BPP;
break;
case 0x18: case 0x19: case 0x1C: case 0x1D:
mc6845->set_hpixels_per_column( 8 );
- m_update_row = cga_text_inten_alt_update_row;
+ m_update_row_type = CGA_TEXT_INTEN_ALT;
break;
case 0x1A: case 0x1B: case 0x3A: case 0x3B:
mc6845->set_hpixels_per_column( 16 );
if ( monitor == CGA_MONITOR_COMPOSITE )
{
- m_update_row = cga_gfx_4bpph_update_row;
+ m_update_row_type = CGA_GFX_4BPPH;
}
else
{
- m_update_row = cga_gfx_1bpp_update_row;
+ m_update_row_type = CGA_GFX_1BPP;
}
break;
case 0x1E: case 0x1F: case 0x3E: case 0x3F:
mc6845->set_hpixels_per_column( 16 );
- m_update_row = cga_gfx_1bpp_update_row;
+ m_update_row_type = CGA_GFX_1BPP;
break;
case 0x28: case 0x29: case 0x2C: case 0x2D:
mc6845->set_hpixels_per_column( 8 );
@@ -1007,26 +1040,26 @@ void isa8_cga_device::mode_control_w(UINT8 data)
if ( m_mode_control & 0x04 )
{
/* Composite greyscale */
- m_update_row = m_superimpose ? cga_text_blink_update_row_si : cga_text_blink_update_row;
+ m_update_row_type = m_superimpose ? CGA_TEXT_BLINK_SI : CGA_TEXT_BLINK;
}
else
{
/* Composite colour */
- m_update_row = m_superimpose ? cga_text_blink_update_row_si : cga_text_blink_update_row;
+ m_update_row_type = m_superimpose ? CGA_TEXT_BLINK_SI : CGA_TEXT_BLINK;
}
}
else
{
/* RGB colour */
- m_update_row = m_superimpose ? cga_text_blink_update_row_si : cga_text_blink_update_row;
+ m_update_row_type = m_superimpose ? CGA_TEXT_BLINK_SI : CGA_TEXT_BLINK;
}
break;
case 0x38: case 0x39: case 0x3C: case 0x3D:
mc6845->set_hpixels_per_column( 8 );
- m_update_row = cga_text_blink_alt_update_row;
+ m_update_row_type = CGA_TEXT_BLINK_ALT;
break;
default:
- m_update_row = NULL;
+ m_update_row_type = -1;
break;
}
@@ -1295,24 +1328,22 @@ WRITE8_MEMBER( isa8_cga_device::io_write )
//}
-static MC6845_UPDATE_ROW( pc1512_gfx_4bpp_update_row )
+MC6845_UPDATE_ROW( isa8_cga_pc1512_device::pc1512_gfx_4bpp_update_row )
{
- isa8_cga_pc1512_device *cga = downcast<isa8_cga_pc1512_device *>(device->owner());
- UINT8 *videoram = &cga->m_vram[cga->m_start_offset];
+ UINT8 *videoram = &m_vram[m_start_offset];
UINT32 *p = &bitmap.pix32(y);
- const rgb_t *palette = cga->m_palette->palette()->entry_list_raw();
+ const rgb_t *palette = m_palette->palette()->entry_list_raw();
UINT16 offset_base = ra << 13;
int j;
- running_machine &machine = device->machine();
if ( y == 0 ) CGA_LOG(1,"pc1512_gfx_4bpp_update_row",("\n"));
for ( j = 0; j < x_count; j++ )
{
UINT16 offset = offset_base | ( ( ma + j ) & 0x1FFF );
- UINT16 i = ( cga->m_color_select & 8 ) ? videoram[ isa8_cga_pc1512_device::vram_offset[3] | offset ] << 3 : 0;
- UINT16 r = ( cga->m_color_select & 4 ) ? videoram[ isa8_cga_pc1512_device::vram_offset[2] | offset ] << 2 : 0;
- UINT16 g = ( cga->m_color_select & 2 ) ? videoram[ isa8_cga_pc1512_device::vram_offset[1] | offset ] << 1 : 0;
- UINT16 b = ( cga->m_color_select & 1 ) ? videoram[ isa8_cga_pc1512_device::vram_offset[0] | offset ] : 0;
+ UINT16 i = ( m_color_select & 8 ) ? videoram[ isa8_cga_pc1512_device::vram_offset[3] | offset ] << 3 : 0;
+ UINT16 r = ( m_color_select & 4 ) ? videoram[ isa8_cga_pc1512_device::vram_offset[2] | offset ] << 2 : 0;
+ UINT16 g = ( m_color_select & 2 ) ? videoram[ isa8_cga_pc1512_device::vram_offset[1] | offset ] << 1 : 0;
+ UINT16 b = ( m_color_select & 1 ) ? videoram[ isa8_cga_pc1512_device::vram_offset[0] | offset ] : 0;
*p = palette[( ( i & 0x400 ) | ( r & 0x200 ) | ( g & 0x100 ) | ( b & 0x80 ) ) >> 7]; p++;
*p = palette[( ( i & 0x200 ) | ( r & 0x100 ) | ( g & 0x080 ) | ( b & 0x40 ) ) >> 6]; p++;
@@ -1364,45 +1395,45 @@ WRITE8_MEMBER( isa8_cga_pc1512_device::io_write )
{
case 0x08: case 0x09: case 0x0C: case 0x0D:
mc6845->set_hpixels_per_column( 8 );
- m_update_row = cga_text_inten_update_row;
+ m_update_row_type = CGA_TEXT_INTEN;
break;
case 0x0A: case 0x0B: case 0x2A: case 0x2B:
mc6845->set_hpixels_per_column( 8 );
if ( ( CGA_MONITOR ) == CGA_MONITOR_COMPOSITE )
{
- m_update_row = cga_gfx_4bppl_update_row;
+ m_update_row_type = CGA_GFX_4BPPL;
}
else
{
- m_update_row = cga_gfx_2bpp_update_row;
+ m_update_row_type = CGA_GFX_2BPP;
}
break;
case 0x0E: case 0x0F: case 0x2E: case 0x2F:
mc6845->set_hpixels_per_column( 8 );
- m_update_row = cga_gfx_2bpp_update_row;
+ m_update_row_type = CGA_GFX_2BPP;
break;
case 0x18: case 0x19: case 0x1C: case 0x1D:
mc6845->set_hpixels_per_column( 8 );
- m_update_row = cga_text_inten_alt_update_row;
+ m_update_row_type = CGA_TEXT_INTEN_ALT;
break;
case 0x1A: case 0x1B: case 0x3A: case 0x3B:
mc6845->set_hpixels_per_column( 8 );
- m_update_row = pc1512_gfx_4bpp_update_row;
+ m_update_row_type = PC1512_GFX_4BPP;
break;
case 0x1E: case 0x1F: case 0x3E: case 0x3F:
mc6845->set_hpixels_per_column( 16 );
- m_update_row = cga_gfx_1bpp_update_row;
+ m_update_row_type = CGA_GFX_1BPP;
break;
case 0x28: case 0x29: case 0x2C: case 0x2D:
mc6845->set_hpixels_per_column( 8 );
- m_update_row = cga_text_blink_update_row;
+ m_update_row_type = CGA_TEXT_BLINK;
break;
case 0x38: case 0x39: case 0x3C: case 0x3D:
mc6845->set_hpixels_per_column( 8 );
- m_update_row = cga_text_blink_alt_update_row;
+ m_update_row_type = CGA_TEXT_BLINK_ALT;
break;
default:
- m_update_row = NULL;
+ m_update_row_type = -1;
break;
}
break;
diff --git a/src/emu/bus/isa/cga.h b/src/emu/bus/isa/cga.h
index 52f54796fdd..4e088fd1b37 100644
--- a/src/emu/bus/isa/cga.h
+++ b/src/emu/bus/isa/cga.h
@@ -27,6 +27,18 @@ public:
isa8_cga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
isa8_cga_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
+ virtual MC6845_UPDATE_ROW( crtc_update_row );
+ MC6845_UPDATE_ROW( cga_text_inten_update_row );
+ MC6845_UPDATE_ROW( cga_text_inten_comp_grey_update_row );
+ MC6845_UPDATE_ROW( cga_text_inten_alt_update_row );
+ MC6845_UPDATE_ROW( cga_text_blink_update_row );
+ MC6845_UPDATE_ROW( cga_text_blink_update_row_si );
+ MC6845_UPDATE_ROW( cga_text_blink_alt_update_row );
+ MC6845_UPDATE_ROW( cga_gfx_4bppl_update_row );
+ MC6845_UPDATE_ROW( cga_gfx_4bpph_update_row );
+ MC6845_UPDATE_ROW( cga_gfx_2bpp_update_row );
+ MC6845_UPDATE_ROW( cga_gfx_1bpp_update_row );
+
// optional information overrides
virtual machine_config_constructor device_mconfig_additions() const;
virtual ioport_constructor device_input_ports() const;
@@ -55,7 +67,7 @@ public:
UINT8 m_color_select; /* wo 0x3d9 */
UINT8 m_status; /* ro 0x3da */
- mc6845_update_row_func m_update_row;
+ int m_update_row_type;
UINT8 m_palette_lut_2bpp[4];
offs_t m_chr_gen_offset[4];
UINT8 m_font_selection_mask;
@@ -118,6 +130,9 @@ public:
virtual ioport_constructor device_input_ports() const;
virtual const rom_entry *device_rom_region() const;
+ virtual MC6845_UPDATE_ROW( crtc_update_row );
+ MC6845_UPDATE_ROW( pc1512_gfx_4bpp_update_row );
+
protected:
// device-level overrides
virtual void device_start();
diff --git a/src/emu/bus/isa/mda.c b/src/emu/bus/isa/mda.c
index ce08169992c..dd96a7119fc 100644
--- a/src/emu/bus/isa/mda.c
+++ b/src/emu/bus/isa/mda.c
@@ -27,7 +27,7 @@
if(VERBOSE_MDA>=N) \
{ \
if( M ) \
- logerror("%11.6f: %-24s",device->machine().time().as_double(),(char*)M ); \
+ logerror("%11.6f: %-24s",machine().time().as_double(),(char*)M ); \
logerror A; \
} \
} while (0)
@@ -40,7 +40,12 @@ static const unsigned char mda_palette[4][3] =
{ 0x00,0xff,0x00 }
};
-static MC6845_UPDATE_ROW( mda_update_row );
+enum
+{
+ MDA_TEXT_INTEN = 0,
+ MDA_TEXT_BLINK,
+ HERCULES_GFX_BLINK
+};
/* F4 Character Displayer */
static const gfx_layout pc_16_charlayout =
@@ -75,21 +80,6 @@ static GFXDECODE_START( pcmda )
GFXDECODE_END
-static MC6845_INTERFACE( mc6845_mda_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 9, /* number of pixels per video memory address */
- NULL, /* begin_update */
- mda_update_row, /* update_row */
- NULL, /* end_update */
- DEVCB_NULL, /* on_de_changed */
- DEVCB_NULL, /* on_cur_changed */
- DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, isa8_mda_device, hsync_changed), /* on_hsync_changed */
- DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, isa8_mda_device, vsync_changed), /* on_vsync_changed */
- NULL
-};
-
WRITE_LINE_MEMBER(isa8_mda_device::pc_cpu_line)
{
m_isa->irq7_w(state);
@@ -103,7 +93,12 @@ MACHINE_CONFIG_FRAGMENT( pcvideo_mda )
MCFG_PALETTE_ADD( "palette", 4 )
- MCFG_MC6845_ADD( MDA_MC6845_NAME, MC6845, MDA_SCREEN_NAME, MDA_CLOCK/9, mc6845_mda_intf)
+ MCFG_MC6845_ADD(MDA_MC6845_NAME, MC6845, MDA_SCREEN_NAME, MDA_CLOCK/9)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(9)
+ MCFG_MC6845_UPDATE_ROW_CB(isa8_mda_device, crtc_update_row)
+ MCFG_MC6845_OUT_HSYNC_CB(WRITELINE(isa8_mda_device, hsync_changed))
+ MCFG_MC6845_OUT_VSYNC_CB(WRITELINE(isa8_mda_device, vsync_changed))
MCFG_GFXDECODE_ADD("gfxdecode", "palette", pcmda)
@@ -154,6 +149,7 @@ const rom_entry *isa8_mda_device::device_rom_region() const
isa8_mda_device::isa8_mda_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
device_t(mconfig, ISA8_MDA, "IBM Monochrome Display and Printer Adapter", tag, owner, clock, "isa_ibm_mda", __FILE__),
device_isa8_card_interface(mconfig, *this),
+ m_update_row_type(-1),
m_palette(*this, "palette")
{
}
@@ -161,6 +157,7 @@ isa8_mda_device::isa8_mda_device(const machine_config &mconfig, const char *tag,
isa8_mda_device::isa8_mda_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
device_t(mconfig, type, name, tag, owner, clock, shortname, source),
device_isa8_card_interface(mconfig, *this),
+ m_update_row_type(-1),
m_palette(*this, "palette")
{
}
@@ -190,7 +187,6 @@ void isa8_mda_device::device_start()
void isa8_mda_device::device_reset()
{
- m_update_row = NULL;
m_framecnt = 0;
m_mode_control = 0;
m_vsync = 0;
@@ -213,10 +209,9 @@ void isa8_mda_device::device_reset()
character codes 176 to 223.
***************************************************************************/
-static MC6845_UPDATE_ROW( mda_text_inten_update_row )
+MC6845_UPDATE_ROW( isa8_mda_device::mda_text_inten_update_row )
{
- isa8_mda_device *mda = downcast<isa8_mda_device *>(device->owner());
- const rgb_t *palette = mda->m_palette->palette()->entry_list_raw();
+ const rgb_t *palette = m_palette->palette()->entry_list_raw();
UINT32 *p = &bitmap.pix32(y);
UINT16 chr_base = ( ra & 0x08 ) ? 0x800 | ( ra & 0x07 ) : ra;
int i;
@@ -225,9 +220,9 @@ static MC6845_UPDATE_ROW( mda_text_inten_update_row )
for ( i = 0; i < x_count; i++ )
{
UINT16 offset = ( ( ma + i ) << 1 ) & 0x0FFF;
- UINT8 chr = mda->m_videoram[ offset ];
- UINT8 attr = mda->m_videoram[ offset + 1 ];
- UINT8 data = mda->m_chr_gen[ chr_base + chr * 8 ];
+ UINT8 chr = m_videoram[ offset ];
+ UINT8 attr = m_videoram[ offset + 1 ];
+ UINT8 data = m_chr_gen[ chr_base + chr * 8 ];
UINT8 fg = ( attr & 0x08 ) ? 3 : 2;
UINT8 bg = 0;
@@ -256,7 +251,7 @@ static MC6845_UPDATE_ROW( mda_text_inten_update_row )
break;
}
- if ( ( i == cursor_x && ( mda->m_framecnt & 0x08 ) ) || ( attr & 0x07 ) == 0x01 )
+ if ( ( i == cursor_x && ( m_framecnt & 0x08 ) ) || ( attr & 0x07 ) == 0x01 )
{
data = 0xFF;
}
@@ -287,10 +282,9 @@ static MC6845_UPDATE_ROW( mda_text_inten_update_row )
character codes 176 to 223.
***************************************************************************/
-static MC6845_UPDATE_ROW( mda_text_blink_update_row )
+MC6845_UPDATE_ROW( isa8_mda_device::mda_text_blink_update_row )
{
- isa8_mda_device *mda = downcast<isa8_mda_device *>(device->owner());
- const rgb_t *palette = mda->m_palette->palette()->entry_list_raw();
+ const rgb_t *palette = m_palette->palette()->entry_list_raw();
UINT32 *p = &bitmap.pix32(y);
UINT16 chr_base = ( ra & 0x08 ) ? 0x800 | ( ra & 0x07 ) : ra;
int i;
@@ -299,9 +293,9 @@ static MC6845_UPDATE_ROW( mda_text_blink_update_row )
for ( i = 0; i < x_count; i++ )
{
UINT16 offset = ( ( ma + i ) << 1 ) & 0x0FFF;
- UINT8 chr = mda->m_videoram[ offset ];
- UINT8 attr = mda->m_videoram[ offset + 1 ];
- UINT8 data = mda->m_chr_gen[ chr_base + chr * 8 ];
+ UINT8 chr = m_videoram[ offset ];
+ UINT8 attr = m_videoram[ offset + 1 ];
+ UINT8 data = m_chr_gen[ chr_base + chr * 8 ];
UINT8 fg = ( attr & 0x08 ) ? 3 : 2;
UINT8 bg = 0;
@@ -331,14 +325,14 @@ static MC6845_UPDATE_ROW( mda_text_blink_update_row )
if ( i == cursor_x )
{
- if ( mda->m_framecnt & 0x08 )
+ if ( m_framecnt & 0x08 )
{
data = 0xFF;
}
}
else
{
- if ( ( attr & 0x80 ) && ( mda->m_framecnt & 0x10 ) )
+ if ( ( attr & 0x80 ) && ( m_framecnt & 0x10 ) )
{
data = 0x00;
}
@@ -364,12 +358,36 @@ static MC6845_UPDATE_ROW( mda_text_blink_update_row )
}
-static MC6845_UPDATE_ROW( mda_update_row )
+MC6845_UPDATE_ROW( isa8_mda_device::crtc_update_row )
+{
+ if (m_update_row_type == -1)
+ return;
+
+ switch (m_update_row_type)
+ {
+ case MDA_TEXT_INTEN:
+ mda_text_inten_update_row(bitmap, cliprect, ma, ra, y, x_count, cursor_x, de, hbp, vbp);
+ break;
+ case MDA_TEXT_BLINK:
+ mda_text_blink_update_row(bitmap, cliprect, ma, ra, y, x_count, cursor_x, de, hbp, vbp);
+ break;
+ }
+}
+
+
+MC6845_UPDATE_ROW( isa8_hercules_device::crtc_update_row )
{
- isa8_mda_device *mda = downcast<isa8_mda_device *>(device->owner());
- if ( mda->m_update_row )
+ if (m_update_row_type == -1)
+ return;
+
+ switch (m_update_row_type)
{
- mda->m_update_row( device, bitmap, cliprect, ma, ra, y, x_count, cursor_x, de, hbp, vbp, param );
+ case HERCULES_GFX_BLINK:
+ hercules_gfx_update_row(bitmap, cliprect, ma, ra, y, x_count, cursor_x, de, hbp, vbp);
+ break;
+ default:
+ isa8_mda_device::crtc_update_row(bitmap, cliprect, ma, ra, y, x_count, cursor_x, de, hbp, vbp);
+ break;
}
}
@@ -400,13 +418,13 @@ WRITE8_MEMBER( isa8_mda_device::mode_control_w )
switch( m_mode_control & 0x2a )
{
case 0x08:
- m_update_row = mda_text_inten_update_row;
+ m_update_row_type = MDA_TEXT_INTEN;
break;
case 0x28:
- m_update_row = mda_text_blink_update_row;
+ m_update_row_type = MDA_TEXT_BLINK;
break;
default:
- m_update_row = NULL;
+ m_update_row_type = -1;
}
}
@@ -497,21 +515,6 @@ allow this.
The divder/pixels per 6845 clock is 9 for text mode and 16 for graphics mode.
*/
-static MC6845_INTERFACE( mc6845_hercules_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 9, /* number of pixels per video memory address */
- NULL, /* begin_update */
- mda_update_row, /* update_row */
- NULL, /* end_update */
- DEVCB_NULL, /* on_de_changed */
- DEVCB_NULL, /* on_cur_changed */
- DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, isa8_mda_device, hsync_changed), /* on_hsync_changed */
- DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, isa8_mda_device, vsync_changed), /* on_vsync_changed */
- NULL
-};
-
static GFXDECODE_START( pcherc )
GFXDECODE_ENTRY( "gfx1", 0x0000, pc_16_charlayout, 1, 1 )
GFXDECODE_END
@@ -523,7 +526,12 @@ MACHINE_CONFIG_FRAGMENT( pcvideo_hercules )
MCFG_PALETTE_ADD( "palette", 4 )
- MCFG_MC6845_ADD( HERCULES_MC6845_NAME, MC6845, HERCULES_SCREEN_NAME, MDA_CLOCK/9, mc6845_hercules_intf)
+ MCFG_MC6845_ADD(HERCULES_MC6845_NAME, MC6845, HERCULES_SCREEN_NAME, MDA_CLOCK/9)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(9)
+ MCFG_MC6845_UPDATE_ROW_CB(isa8_hercules_device, crtc_update_row)
+ MCFG_MC6845_OUT_HSYNC_CB(WRITELINE(isa8_mda_device, hsync_changed))
+ MCFG_MC6845_OUT_VSYNC_CB(WRITELINE(isa8_mda_device, vsync_changed))
MCFG_GFXDECODE_ADD("gfxdecode", "palette", pcherc)
@@ -613,17 +621,16 @@ void isa8_hercules_device::device_reset()
bit 7 being the leftmost.
***************************************************************************/
-static MC6845_UPDATE_ROW( hercules_gfx_update_row )
+MC6845_UPDATE_ROW( isa8_hercules_device::hercules_gfx_update_row )
{
- isa8_hercules_device *herc = downcast<isa8_hercules_device *>(device->owner());
- const rgb_t *palette = herc->m_palette->palette()->entry_list_raw();
+ const rgb_t *palette = m_palette->palette()->entry_list_raw();
UINT32 *p = &bitmap.pix32(y);
- UINT16 gfx_base = ( ( herc->m_mode_control & 0x80 ) ? 0x8000 : 0x0000 ) | ( ( ra & 0x03 ) << 13 );
+ UINT16 gfx_base = ( ( m_mode_control & 0x80 ) ? 0x8000 : 0x0000 ) | ( ( ra & 0x03 ) << 13 );
int i;
if ( y == 0 ) MDA_LOG(1,"hercules_gfx_update_row",("\n"));
for ( i = 0; i < x_count; i++ )
{
- UINT8 data = herc->m_videoram[ gfx_base + ( ( ma + i ) << 1 ) ];
+ UINT8 data = m_videoram[ gfx_base + ( ( ma + i ) << 1 ) ];
*p = palette[( data & 0x80 ) ? 2 : 0]; p++;
*p = palette[( data & 0x40 ) ? 2 : 0]; p++;
@@ -634,7 +641,7 @@ static MC6845_UPDATE_ROW( hercules_gfx_update_row )
*p = palette[( data & 0x02 ) ? 2 : 0]; p++;
*p = palette[( data & 0x01 ) ? 2 : 0]; p++;
- data = herc->m_videoram[ gfx_base + ( ( ma + i ) << 1 ) + 1 ];
+ data = m_videoram[ gfx_base + ( ( ma + i ) << 1 ) + 1 ];
*p = palette[( data & 0x80 ) ? 2 : 0]; p++;
*p = palette[( data & 0x40 ) ? 2 : 0]; p++;
@@ -657,17 +664,17 @@ WRITE8_MEMBER( isa8_hercules_device::mode_control_w )
switch( m_mode_control & 0x2a )
{
case 0x08:
- m_update_row = mda_text_inten_update_row;
+ m_update_row_type = MDA_TEXT_INTEN;
break;
case 0x28:
- m_update_row = mda_text_blink_update_row;
+ m_update_row_type = MDA_TEXT_BLINK;
break;
case 0x0A: /* Hercules modes */
case 0x2A:
- m_update_row = hercules_gfx_update_row;
+ m_update_row_type = HERCULES_GFX_BLINK;
break;
default:
- m_update_row = NULL;
+ m_update_row_type = -1;
}
mc6845->set_clock( m_mode_control & 0x02 ? MDA_CLOCK / 16 : MDA_CLOCK / 9 );
diff --git a/src/emu/bus/isa/mda.h b/src/emu/bus/isa/mda.h
index 2fc74d49265..71db33dc557 100644
--- a/src/emu/bus/isa/mda.h
+++ b/src/emu/bus/isa/mda.h
@@ -36,6 +36,10 @@ public:
WRITE_LINE_MEMBER(pc_cpu_line);
+ virtual MC6845_UPDATE_ROW( crtc_update_row );
+ MC6845_UPDATE_ROW( mda_text_inten_update_row );
+ MC6845_UPDATE_ROW( mda_text_blink_update_row );
+
protected:
// device-level overrides
virtual void device_start();
@@ -45,7 +49,7 @@ public:
UINT8 m_mode_control;
- mc6845_update_row_func m_update_row;
+ int m_update_row_type;
UINT8 *m_chr_gen;
UINT8 m_vsync;
UINT8 m_hsync;
@@ -64,26 +68,29 @@ class isa8_hercules_device :
public isa8_mda_device
{
public:
- // construction/destruction
- isa8_hercules_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
- // optional information overrides
- virtual machine_config_constructor device_mconfig_additions() const;
- virtual const rom_entry *device_rom_region() const;
+ // construction/destruction
+ isa8_hercules_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ // optional information overrides
+ virtual machine_config_constructor device_mconfig_additions() const;
+ virtual const rom_entry *device_rom_region() const;
- virtual DECLARE_READ8_MEMBER(io_read);
- virtual DECLARE_WRITE8_MEMBER(io_write);
- virtual DECLARE_READ8_MEMBER(status_r);
- virtual DECLARE_WRITE8_MEMBER(mode_control_w);
+ virtual DECLARE_READ8_MEMBER(io_read);
+ virtual DECLARE_WRITE8_MEMBER(io_write);
+ virtual DECLARE_READ8_MEMBER(status_r);
+ virtual DECLARE_WRITE8_MEMBER(mode_control_w);
+
+ virtual MC6845_UPDATE_ROW( crtc_update_row );
+ MC6845_UPDATE_ROW( hercules_gfx_update_row );
protected:
- // device-level overrides
- virtual void device_start();
- virtual void device_reset();
+ // device-level overrides
+ virtual void device_start();
+ virtual void device_reset();
private:
- // internal state
+ // internal state
public:
- UINT8 m_configuration_switch; //hercules
+ UINT8 m_configuration_switch; //hercules
};
diff --git a/src/emu/bus/wangpc/lvc.c b/src/emu/bus/wangpc/lvc.c
index d1f92667fe2..e3505180a39 100644
--- a/src/emu/bus/wangpc/lvc.c
+++ b/src/emu/bus/wangpc/lvc.c
@@ -51,29 +51,29 @@ const device_type WANGPC_LVC = &device_creator<wangpc_lvc_device>;
//-------------------------------------------------
-// mc6845_interface crtc_intf
+// mc6845
//-------------------------------------------------
-void wangpc_lvc_device::crtc_update_row(mc6845_device *device, bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, int de, int hbp, int vbp, void *param)
+MC6845_UPDATE_ROW( wangpc_lvc_device::crtc_update_row )
{
offs_t scroll_y = (((m_scroll >> 8) + 0x15) & 0xff) * 0x80;
-
+
if (OPTION_80_COL)
{
for (int column = 0; column < x_count; column++)
{
offs_t addr = scroll_y + (m_scroll & 0x3f) + ((ma / 80) * 0x480) + (((ra & 0x0f) << 7) | (column & 0x7f));
UINT16 data = m_video_ram[addr & 0x7fff];
-
+
for (int bit = 0; bit < 8; bit++)
{
int x = (column * 8) + bit;
int color = (BIT(data, 15) << 1) | BIT(data, 7);
-
+
if (column == cursor_x) color = 0x03;
-
+
bitmap.pix32(vbp + y, hbp + x) = de ? m_palette[color] : rgb_t::black;
-
+
data <<= 1;
}
}
@@ -82,35 +82,28 @@ void wangpc_lvc_device::crtc_update_row(mc6845_device *device, bitmap_rgb32 &bit
{
//offs_t addr = scroll_y + ((m_scroll & 0x3f) << 1) + ((ma / 40) * 0x480) + (((ra & 0x0f) << 7));
offs_t addr = scroll_y + ((m_scroll & 0x3f) << 1) + (y * 0x80);
-
+
for (int column = 0; column < x_count; column++)
{
UINT32 data = (m_video_ram[(addr + 1) & 0x7fff] << 16) | m_video_ram[addr & 0x7fff];
-
+
for (int bit = 0; bit < 8; bit++)
{
int x = (column * 8) + bit;
int color = (BIT(data, 31) << 3) | (BIT(data, 23) << 2) | (BIT(data, 15) << 1) | BIT(data, 7);
-
+
if (column == cursor_x) color = 0x03;
-
+
bitmap.pix32(vbp + y, hbp + x) = de ? m_palette[color] : rgb_t::black;
-
+
data <<= 1;
}
-
+
addr += 2;
}
}
}
-static MC6845_UPDATE_ROW( wangpc_lvc_update_row )
-{
- wangpc_lvc_device *lvc = downcast<wangpc_lvc_device *>(device->owner());
-
- lvc->crtc_update_row(device, bitmap, cliprect, ma, ra, y, x_count, cursor_x, de, hbp, vbp, param);
-}
-
WRITE_LINE_MEMBER( wangpc_lvc_device::vsync_w )
{
if (OPTION_VSYNC && state)
@@ -119,22 +112,6 @@ WRITE_LINE_MEMBER( wangpc_lvc_device::vsync_w )
}
}
-static MC6845_INTERFACE( crtc_intf )
-{
- true,
- 0,0,0,0,
- 8,
- NULL,
- wangpc_lvc_update_row,
- NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, wangpc_lvc_device, vsync_w),
- NULL
-};
-
-
//-------------------------------------------------
// MACHINE_CONFIG_FRAGMENT( wangpc_lvc )
//-------------------------------------------------
@@ -147,7 +124,11 @@ static MACHINE_CONFIG_FRAGMENT( wangpc_lvc )
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500))
MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_MC6845_ADD(MC6845_TAG, MC6845_1, SCREEN_TAG, XTAL_14_31818MHz/16, crtc_intf)
+ MCFG_MC6845_ADD(MC6845_TAG, MC6845_1, SCREEN_TAG, XTAL_14_31818MHz/16)
+ MCFG_MC6845_SHOW_BORDER_AREA(true)
+ MCFG_MC6845_CHAR_WIDTH(8)
+ MCFG_MC6845_UPDATE_ROW_CB(wangpc_lvc_device, crtc_update_row)
+ MCFG_MC6845_OUT_VSYNC_CB(WRITELINE(wangpc_lvc_device, vsync_w))
MACHINE_CONFIG_END
diff --git a/src/emu/bus/wangpc/lvc.h b/src/emu/bus/wangpc/lvc.h
index 8977ec0cbff..239f2f0d880 100644
--- a/src/emu/bus/wangpc/lvc.h
+++ b/src/emu/bus/wangpc/lvc.h
@@ -37,7 +37,7 @@ public:
virtual machine_config_constructor device_mconfig_additions() const;
// not really public
- void crtc_update_row(mc6845_device *device, bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, int de, int hbp, int vbp, void *param);
+ MC6845_UPDATE_ROW( crtc_update_row );
DECLARE_WRITE_LINE_MEMBER( vsync_w );
protected:
diff --git a/src/emu/bus/wangpc/mvc.c b/src/emu/bus/wangpc/mvc.c
index 81fa6d9ee57..2ee7b8c458e 100644
--- a/src/emu/bus/wangpc/mvc.c
+++ b/src/emu/bus/wangpc/mvc.c
@@ -66,34 +66,34 @@ const device_type WANGPC_MVC = &device_creator<wangpc_mvc_device>;
//-------------------------------------------------
-// mc6845_interface crtc_intf
+// mc6845
//-------------------------------------------------
-void wangpc_mvc_device::crtc_update_row(mc6845_device *device, bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, int de, int hbp, int vbp, void *param)
+MC6845_UPDATE_ROW( wangpc_mvc_device::crtc_update_row )
{
for (int sx = 0; sx < 50; sx++)
{
offs_t addr = (y * 50) + sx;
UINT16 data = m_bitmap_ram[addr];
-
+
for (int bit = 0; bit < 16; bit++)
{
int x = (sx * 16) + bit;
int color = BIT(data, 15) && de;
-
+
bitmap.pix32(vbp + y, hbp + x) = PALETTE_MVC[color];
-
+
data <<= 1;
}
}
-
+
for (int column = 0; column < x_count; column++)
{
UINT16 code = m_video_ram[((ma + column) & 0x7ff)];
UINT8 attr = code & 0xff;
-
+
UINT8 new_ra = ra + 1;
-
+
if (ATTR_SUPERSCRIPT)
{
new_ra = ra + 3;
@@ -102,35 +102,28 @@ void wangpc_mvc_device::crtc_update_row(mc6845_device *device, bitmap_rgb32 &bit
{
new_ra = ra;
}
-
+
offs_t addr = ((code >> 8) << 4) | (new_ra & 0x0f);
UINT16 data = m_char_ram[addr & 0xfff];
-
+
if ((column == cursor_x) || (!ra && ATTR_OVERSCORE) || ((ra == 9) && ATTR_UNDERSCORE))
{
data = 0xffff;
}
-
+
for (int bit = 0; bit < 10; bit++)
{
int x = (column * 10) + bit;
int color = ((BIT(data, 9) & !ATTR_BLANK) ^ ATTR_REVERSE);
-
+
if ((color | bitmap.pix32(vbp + y, hbp + x)) & ATTR_BOLD) color = 2;
if (color) bitmap.pix32(vbp + y, hbp + x) = de ? PALETTE_MVC[color] : rgb_t::black;
-
+
data <<= 1;
}
}
}
-static MC6845_UPDATE_ROW( wangpc_mvc_update_row )
-{
- wangpc_mvc_device *mvc = downcast<wangpc_mvc_device *>(device->owner());
-
- mvc->crtc_update_row(device, bitmap, cliprect, ma, ra, y, x_count, cursor_x, de, hbp, vbp, param);
-}
-
WRITE_LINE_MEMBER( wangpc_mvc_device::vsync_w )
{
if (OPTION_VSYNC && state)
@@ -139,22 +132,6 @@ WRITE_LINE_MEMBER( wangpc_mvc_device::vsync_w )
}
}
-static MC6845_INTERFACE( crtc_intf )
-{
- true,
- 0,0,0,0,
- 10,
- NULL,
- wangpc_mvc_update_row,
- NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, wangpc_mvc_device, vsync_w),
- NULL
-};
-
-
//-------------------------------------------------
// MACHINE_CONFIG_FRAGMENT( wangpc_mvc )
//-------------------------------------------------
@@ -167,7 +144,11 @@ static MACHINE_CONFIG_FRAGMENT( wangpc_mvc )
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500))
MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_MC6845_ADD(MC6845_TAG, MC6845_1, SCREEN_TAG, XTAL_14_31818MHz/16, crtc_intf)
+ MCFG_MC6845_ADD(MC6845_TAG, MC6845_1, SCREEN_TAG, XTAL_14_31818MHz/16)
+ MCFG_MC6845_SHOW_BORDER_AREA(true)
+ MCFG_MC6845_CHAR_WIDTH(10)
+ MCFG_MC6845_UPDATE_ROW_CB(wangpc_mvc_device, crtc_update_row)
+ MCFG_MC6845_OUT_VSYNC_CB(WRITELINE(wangpc_mvc_device, vsync_w))
MACHINE_CONFIG_END
diff --git a/src/emu/bus/wangpc/mvc.h b/src/emu/bus/wangpc/mvc.h
index 20fa6cfaec4..16cfaa8e978 100644
--- a/src/emu/bus/wangpc/mvc.h
+++ b/src/emu/bus/wangpc/mvc.h
@@ -37,7 +37,7 @@ public:
virtual machine_config_constructor device_mconfig_additions() const;
// not really public
- void crtc_update_row(mc6845_device *device, bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, int de, int hbp, int vbp, void *param);
+ MC6845_UPDATE_ROW( crtc_update_row );
DECLARE_WRITE_LINE_MEMBER( vsync_w );
protected:
diff --git a/src/emu/video/mc6845.c b/src/emu/video/mc6845.c
index 20a31ff9ba4..3f3789b9334 100644
--- a/src/emu/video/mc6845.c
+++ b/src/emu/video/mc6845.c
@@ -89,43 +89,35 @@ const device_type MOS8568 = &device_creator<mos8568_device>;
#define ATTR_ALTERNATE_CHARSET BIT(attr, 7)
-void mc6845_device::device_config_complete()
-{
- const mc6845_interface *intf = reinterpret_cast<const mc6845_interface *>(static_config());
-
- if ( intf != NULL )
- {
- *static_cast<mc6845_interface *>(this) = *intf;
- }
- else
- {
- m_show_border_area = false;
- m_visarea_adjust_min_x = 0;
- m_visarea_adjust_max_x = 0;
- m_visarea_adjust_min_y = 0;
- m_visarea_adjust_max_y = 0;
- m_hpixels_per_column = 0;
- m_begin_update = NULL;
- m_update_row = NULL;
- m_end_update = NULL;
- m_on_update_addr_changed = NULL;
- memset(&m_out_de_func, 0, sizeof(m_out_de_func));
- memset(&m_out_cur_func, 0, sizeof(m_out_cur_func));
- memset(&m_out_hsync_func, 0, sizeof(m_out_hsync_func));
- memset(&m_out_vsync_func, 0, sizeof(m_out_vsync_func));
- }
-}
-
-
mc6845_device::mc6845_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source)
: device_t(mconfig, type, name, tag, owner, clock, shortname, source),
- device_video_interface(mconfig, *this, false)
+ device_video_interface(mconfig, *this, false),
+ m_show_border_area(true),
+ m_visarea_adjust_min_x(0),
+ m_visarea_adjust_max_x(0),
+ m_visarea_adjust_min_y(0),
+ m_visarea_adjust_max_y(0),
+ m_hpixels_per_column(0),
+ m_out_de_cb(*this),
+ m_out_cur_cb(*this),
+ m_out_hsync_cb(*this),
+ m_out_vsync_cb(*this)
{
}
mc6845_device::mc6845_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, MC6845, "MC6845 CRTC", tag, owner, clock, "mc6845", __FILE__),
- device_video_interface(mconfig, *this, false)
+ device_video_interface(mconfig, *this, false),
+ m_show_border_area(true),
+ m_visarea_adjust_min_x(0),
+ m_visarea_adjust_max_x(0),
+ m_visarea_adjust_min_y(0),
+ m_visarea_adjust_max_y(0),
+ m_hpixels_per_column(0),
+ m_out_de_cb(*this),
+ m_out_cur_cb(*this),
+ m_out_hsync_cb(*this),
+ m_out_vsync_cb(*this)
{
}
@@ -138,7 +130,7 @@ void mc6845_device::device_post_load()
void mc6845_device::call_on_update_address(int strobe)
{
- if (m_on_update_addr_changed)
+ if (!m_on_update_addr_changed_cb.isnull())
m_upd_trans_timer->adjust(attotime::zero, (m_update_addr << 8) | strobe);
else
fatalerror("M6845: transparent memory mode without handler\n");
@@ -573,11 +565,11 @@ void mc6845_device::update_counters()
void mc6845_device::set_de(int state)
{
- if ( m_de != state )
+ if (m_de != state)
{
m_de = state;
- if ( m_de )
+ if (m_de)
{
/* If the upd_adr_timer was running, cancel it */
m_upd_adr_timer->adjust(attotime::never);
@@ -589,44 +581,37 @@ void mc6845_device::set_de(int state)
update_upd_adr_timer();
}
- if ( !m_res_out_de_func.isnull() )
- m_res_out_de_func( m_de );
+ m_out_de_cb(m_de);
}
}
void mc6845_device::set_hsync(int state)
{
- if ( m_hsync != state )
+ if (m_hsync != state)
{
m_hsync = state;
-
- if ( !m_res_out_hsync_func.isnull() )
- m_res_out_hsync_func( m_hsync );
+ m_out_hsync_cb(m_hsync);
}
}
void mc6845_device::set_vsync(int state)
{
- if ( m_vsync != state )
+ if (m_vsync != state)
{
m_vsync = state;
-
- if ( !m_res_out_vsync_func.isnull() )
- m_res_out_vsync_func( m_vsync );
+ m_out_vsync_cb(m_vsync);
}
}
void mc6845_device::set_cur(int state)
{
- if ( m_cur != state )
+ if (m_cur != state)
{
m_cur = state;
-
- if ( !m_res_out_cur_func.isnull() )
- m_res_out_cur_func( m_cur );
+ m_out_cur_cb(m_cur);
}
}
@@ -807,7 +792,7 @@ void mc6845_device::device_timer(emu_timer &timer, device_timer_id id, int param
int strobe = (param & 0xff);
/* call the callback function -- we know it exists */
- m_on_update_addr_changed(this, addr, strobe);
+ m_on_update_addr_changed_cb(addr, strobe);
if(!m_update_ready_bit && MODE_TRANSPARENT_BLANK)
{
@@ -928,7 +913,7 @@ void mc6845_device::update_cursor_state()
}
-UINT8 mc6845_device::draw_scanline(int y, bitmap_rgb32 &bitmap, const rectangle &cliprect, void *param)
+UINT8 mc6845_device::draw_scanline(int y, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
/* compute the current raster line */
UINT8 ra = y % (m_max_ras_addr + 1);
@@ -955,11 +940,11 @@ UINT8 mc6845_device::draw_scanline(int y, bitmap_rgb32 &bitmap, const rectangle
UINT8 cr = y / (m_max_ras_addr + 1);
UINT16 ma = (cr << 8) | cc;
- m_update_row(this, bitmap, cliprect, ma, ra, y, m_horiz_disp, cursor_x, de, hbp, vbp, param);
+ m_update_row_cb(bitmap, cliprect, ma, ra, y, m_horiz_disp, cursor_x, de, hbp, vbp);
}
else
{
- m_update_row(this, bitmap, cliprect, m_current_disp_addr, ra, y, m_horiz_disp, cursor_x, de, hbp, vbp, param);
+ m_update_row_cb(bitmap, cliprect, m_current_disp_addr, ra, y, m_horiz_disp, cursor_x, de, hbp, vbp);
}
/* update MA if the last raster address */
@@ -976,15 +961,11 @@ UINT32 mc6845_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap,
if (m_has_valid_parameters)
{
- UINT16 y;
-
- void *param = NULL;
-
- assert(m_update_row != NULL);
+ assert(m_update_row_cb.isnull() != NULL);
/* call the set up function if any */
- if (m_begin_update != NULL)
- param = m_begin_update(this, bitmap, cliprect);
+ if (!m_begin_update_cb.isnull())
+ m_begin_update_cb(bitmap, cliprect);
if (cliprect.min_y == 0)
{
@@ -993,14 +974,14 @@ UINT32 mc6845_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap,
}
/* for each row in the visible region */
- for (y = cliprect.min_y; y <= cliprect.max_y; y++)
+ for (UINT16 y = cliprect.min_y; y <= cliprect.max_y; y++)
{
- this->draw_scanline(y, bitmap, cliprect, param);
+ this->draw_scanline(y, bitmap, cliprect);
}
/* call the tear down function if any */
- if (m_end_update != NULL)
- m_end_update(this, bitmap, cliprect, param);
+ if (!m_end_update_cb.isnull())
+ m_end_update_cb(bitmap, cliprect);
}
else
{
@@ -1017,10 +998,16 @@ void mc6845_device::device_start()
assert(m_hpixels_per_column > 0);
/* resolve callbacks */
- m_res_out_de_func.resolve(m_out_de_func, *this);
- m_res_out_cur_func.resolve(m_out_cur_func, *this);
- m_res_out_hsync_func.resolve(m_out_hsync_func, *this);
- m_res_out_vsync_func.resolve(m_out_vsync_func, *this);
+ m_out_de_cb.resolve_safe();
+ m_out_cur_cb.resolve_safe();
+ m_out_hsync_cb.resolve_safe();
+ m_out_vsync_cb.resolve_safe();
+
+ /* bind delegates */
+ m_begin_update_cb.bind_relative_to(*owner());
+ m_update_row_cb.bind_relative_to(*owner());
+ m_end_update_cb.bind_relative_to(*owner());
+ m_on_update_addr_changed_cb.bind_relative_to(*owner());
/* create the timers */
m_line_timer = timer_alloc(TIMER_LINE);
@@ -1257,7 +1244,8 @@ void mos8563_device::device_start()
m_supports_status_reg_d7 = true;
m_update_ready_bit = 1;
- m_update_row = vdc_update_row;
+ // default update_row delegate
+ m_update_row_cb = mc6845_update_row_delegate(FUNC(mos8563_device::vdc_update_row), this);
m_char_blink_state = false;
m_char_blink_count = 0;
@@ -1318,19 +1306,14 @@ void mos8568_device::device_start()
void mc6845_device::device_reset()
{
/* internal registers other than status remain unchanged, all outputs go low */
- if ( !m_res_out_de_func.isnull() )
- m_res_out_de_func( FALSE );
+ m_out_de_cb(false);
- if ( !m_res_out_hsync_func.isnull() )
- m_res_out_hsync_func( FALSE );
+ m_out_hsync_cb(false);
- if ( !m_res_out_vsync_func.isnull() )
- m_res_out_vsync_func( FALSE );
+ m_out_vsync_cb(false);
- if ( ! m_line_timer->enabled( ) )
- {
- m_line_timer->adjust( attotime::from_ticks( m_horiz_char_total + 1, m_clock ) );
- }
+ if (!m_line_timer->enabled())
+ m_line_timer->adjust(attotime::from_ticks(m_horiz_char_total + 1, m_clock));
m_light_pen_latched = false;
@@ -1520,9 +1503,9 @@ void mos8563_device::update_cursor_state()
}
-UINT8 mos8563_device::draw_scanline(int y, bitmap_rgb32 &bitmap, const rectangle &cliprect, void *param)
+UINT8 mos8563_device::draw_scanline(int y, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
- UINT8 ra = mc6845_device::draw_scanline(y, bitmap, cliprect, param);
+ UINT8 ra = mc6845_device::draw_scanline(y, bitmap, cliprect);
if (ra == m_max_ras_addr)
m_current_disp_addr = (m_current_disp_addr + m_row_addr_incr) & 0x3fff;
@@ -1531,31 +1514,31 @@ UINT8 mos8563_device::draw_scanline(int y, bitmap_rgb32 &bitmap, const rectangle
}
-void mos8563_device::update_row(bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, int de, int hbp, int vbp, void *param)
+MC6845_UPDATE_ROW( mos8563_device::vdc_update_row )
{
const pen_t *pen = m_palette->pens();
-
+
ra += (m_vert_scroll & 0x0f);
ra &= 0x0f;
-
+
UINT8 cth = (m_horiz_char >> 4) + (HSS_DBL ? 0 : 1);
UINT8 cdh = (m_horiz_char & 0x0f) + (HSS_DBL ? 0 : 1);
UINT8 cdv = m_vert_char_disp;
-
+
for (int column = 0; column < x_count; column++)
{
UINT8 code = read_videoram(ma + column);
UINT8 attr = 0;
-
+
int fg = m_color >> 4;
int bg = m_color & 0x0f;
-
+
if (HSS_ATTR)
{
offs_t attr_addr = m_attribute_addr + ma + column;
attr = read_videoram(attr_addr);
}
-
+
if (HSS_TEXT)
{
if (HSS_ATTR)
@@ -1563,15 +1546,15 @@ void mos8563_device::update_row(bitmap_rgb32 &bitmap, const rectangle &cliprect,
fg = ATTR_FOREGROUND;
bg = ATTR_BACKGROUND;
}
-
+
if (VSS_RVS) code ^= 0xff;
-
+
for (int bit = 0; bit < cdh; bit++)
{
int x = (m_horiz_scroll & 0x0f) - cth + (column * cth) + bit;
if (x < 0) x = 0;
int color = BIT(code, 7) ? fg : bg;
-
+
bitmap.pix32(vbp + y, hbp + x) = pen[de ? color : 0];
}
}
@@ -1581,9 +1564,9 @@ void mos8563_device::update_row(bitmap_rgb32 &bitmap, const rectangle &cliprect,
{
fg = ATTR_COLOR;
}
-
+
offs_t font_addr;
-
+
if (m_max_ras_addr < 16)
{
font_addr = ((m_char_base_addr & 0xe0) << 8) | (ATTR_ALTERNATE_CHARSET << 12) | (code << 4) | (ra & 0x0f);
@@ -1592,33 +1575,26 @@ void mos8563_device::update_row(bitmap_rgb32 &bitmap, const rectangle &cliprect,
{
font_addr = ((m_char_base_addr & 0xc0) << 8) | (ATTR_ALTERNATE_CHARSET << 13) | (code << 5) | (ra & 0x1f);
}
-
+
UINT8 data = read_videoram(font_addr);
-
+
if (ra >= cdv) data = 0;
if (ATTR_UNDERLINE && (ra == m_underline_ras)) data = 0xff;
if (ATTR_BLINK && !m_char_blink_state) data = 0;
if (ATTR_REVERSE) data ^= 0xff;
if (column == cursor_x) data ^= 0xff;
if (VSS_RVS) data ^= 0xff;
-
+
for (int bit = 0; bit < cdh; bit++)
{
int x = (m_horiz_scroll & 0x0f) - cth + (column * cth) + bit;
if (x < 0) x = 0;
int color = BIT(data, 7) ? fg : bg;
-
+
bitmap.pix32(vbp + y, hbp + x) = pen[de ? color : 0];
-
+
if ((bit < 8) || !HSS_SEMI) data <<= 1;
}
}
}
}
-
-MC6845_UPDATE_ROW( mos8563_device::vdc_update_row )
-{
- mos8563_device *mos8563 = static_cast<mos8563_device *>(device);
-
- mos8563->update_row(bitmap, cliprect, ma, ra, y, x_count, cursor_x, de, hbp, vbp, param);
-}
diff --git a/src/emu/video/mc6845.h b/src/emu/video/mc6845.h
index 33e14a0b51f..40e0ca47b57 100644
--- a/src/emu/video/mc6845.h
+++ b/src/emu/video/mc6845.h
@@ -13,112 +13,73 @@
#include "emu.h"
-#define MC6845_INTERFACE(name) \
- const mc6845_interface (name) =
-
-#define MCFG_MC6845_ADD(_tag, _variant, _screen_tag, _clock, _config) \
+#define MCFG_MC6845_ADD(_tag, _variant, _screen_tag, _clock) \
MCFG_DEVICE_ADD(_tag, _variant, _clock) \
- MCFG_VIDEO_SET_SCREEN(_screen_tag) \
- MCFG_DEVICE_CONFIG(_config)
+ MCFG_VIDEO_SET_SCREEN(_screen_tag)
-#define MCFG_MOS8563_ADD(_tag, _screen_tag, _clock, _config, _map) \
+#define MCFG_MOS8563_ADD(_tag, _screen_tag, _clock, _map) \
MCFG_DEVICE_ADD(_tag, MOS8563, _clock) \
MCFG_VIDEO_SET_SCREEN(_screen_tag) \
- MCFG_DEVICE_CONFIG(_config) \
- MCFG_DEVICE_ADDRESS_MAP(AS_0, _map) \
- MCFG_SCREEN_ADD(_screen_tag, RASTER) \
- MCFG_SCREEN_REFRESH_RATE(60) \
- MCFG_SCREEN_SIZE(640, 200) \
- MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 200-1) \
- MCFG_SCREEN_UPDATE_DEVICE(_tag, mos8563_device, screen_update)
-
-#define MCFG_MOS8568_ADD(_tag, _screen_tag, _clock, _config, _map) \
+ MCFG_DEVICE_ADDRESS_MAP(AS_0, _map)
+
+#define MCFG_MOS8568_ADD(_tag, _screen_tag, _clock, _map) \
MCFG_DEVICE_ADD(_tag, MOS8568, _clock) \
MCFG_VIDEO_SET_SCREEN(_screen_tag) \
- MCFG_DEVICE_CONFIG(_config) \
- MCFG_DEVICE_ADDRESS_MAP(AS_0, _map) \
- MCFG_SCREEN_ADD(_screen_tag, RASTER) \
- MCFG_SCREEN_REFRESH_RATE(60) \
- MCFG_SCREEN_SIZE(640, 200) \
- MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 200-1) \
- MCFG_SCREEN_UPDATE_DEVICE(_tag, mos8568_device, screen_update)
-
-
-class mc6845_device;
-
-/* callback definitions */
-typedef void * (*mc6845_begin_update_func)(mc6845_device *device, bitmap_rgb32 &bitmap, const rectangle &cliprect);
-#define MC6845_BEGIN_UPDATE(name) void *name(mc6845_device *device, bitmap_rgb32 &bitmap, const rectangle &cliprect)
+ MCFG_DEVICE_ADDRESS_MAP(AS_0, _map)
-typedef void (*mc6845_update_row_func)(mc6845_device *device, bitmap_rgb32 &bitmap,
- const rectangle &cliprect, UINT16 ma, UINT8 ra,
- UINT16 y, UINT8 x_count, INT8 cursor_x, int de, int hbp, int vbp, void *param);
+#define MCFG_MC6845_SHOW_BORDER_AREA(_show) \
+ mc6845_device::set_show_border_area(*device, _show);
+#define MCFG_MC6845_VISAREA_ADJUST(_minx, _maxx, _miny, _maxy) \
+ mc6845_device::set_visarea_adjust(*device, _minx, _maxx, _miny, _maxy);
-#define MC6845_UPDATE_ROW(name) void name(mc6845_device *device, bitmap_rgb32 &bitmap, \
- const rectangle &cliprect, UINT16 ma, UINT8 ra, \
- UINT16 y, UINT8 x_count, INT8 cursor_x, int de, int hbp, int vbp, void *param)
+#define MCFG_MC6845_CHAR_WIDTH(_pixels) \
+ mc6845_device::set_char_width(*device, _pixels);
+#define MCFG_MC6845_BEGIN_UPDATE_CB(_class, _method) \
+ mc6845_device::set_begin_update_callback(*device, mc6845_begin_update_delegate(&_class::_method, #_class "::" #_method, downcast<_class *>(owner)));
-typedef void (*mc6845_end_update_func)(mc6845_device *device, bitmap_rgb32 &bitmap, const rectangle &cliprect, void *param);
-#define MC6845_END_UPDATE(name) void name(mc6845_device *device, bitmap_rgb32 &bitmap, const rectangle &cliprect, void *param)
-
-
-typedef void (*mc6845_on_update_addr_changed_func)(mc6845_device *device, int address, int strobe);
-#define MC6845_ON_UPDATE_ADDR_CHANGED(name) void name(mc6845_device *device, int address, int strobe)
-
-
-/* interface */
-struct mc6845_interface
-{
- bool m_show_border_area; /* visible screen area (false) active display (true) active display + blanking */
+#define MCFG_MC6845_UPDATE_ROW_CB(_class, _method) \
+ mc6845_device::set_update_row_callback(*device, mc6845_update_row_delegate(&_class::_method, #_class "::" #_method, downcast<_class *>(owner)));
- /* visible screen area adjustment */
- int m_visarea_adjust_min_x;
- int m_visarea_adjust_max_x;
- int m_visarea_adjust_min_y;
- int m_visarea_adjust_max_y;
+#define MCFG_MC6845_END_UPDATE_CB(_class, _method) \
+ mc6845_device::set_end_update_callback(*device, mc6845_end_update_delegate(&_class::_method, #_class "::" #_method, downcast<_class *>(owner)));
- int m_hpixels_per_column; /* number of pixels per video memory address */
+#define MCFG_MC6845_ADDR_CHANGED_CB(_class, _method) \
+ mc6845_device::set_on_update_addr_change_callback(*device, mc6845_on_update_addr_changed_delegate(&_class::_method, #_class "::" #_method, downcast<_class *>(owner)));
- /* if specified, this gets called before any pixel update,
- optionally return a pointer that will be passed to the
- update and tear down callbacks */
- mc6845_begin_update_func m_begin_update;
+#define MCFG_MC6845_OUT_DE_CB(_write) \
+ devcb = &mc6845_device::set_out_de_callback(*device, DEVCB2_##_write);
- /* this gets called for every row, the driver must output
- x_count * hpixels_per_column pixels.
- cursor_x indicates the character position where the cursor is, or -1
- if there is no cursor on this row */
- mc6845_update_row_func m_update_row;
+#define MCFG_MC6845_OUT_CUR_CB(_write) \
+ devcb = &mc6845_device::set_out_cur_callback(*device, DEVCB2_##_write);
- /* if specified, this gets called after all row updating is complete */
- mc6845_end_update_func m_end_update;
+#define MCFG_MC6845_OUT_HSYNC_CB(_write) \
+ devcb = &mc6845_device::set_out_hsync_callback(*device, DEVCB2_##_write);
- /* if specified, this gets called for every change of the disply enable pin (pin 18) */
- devcb_write_line m_out_de_func;
+#define MCFG_MC6845_OUT_VSYNC_CB(_write) \
+ devcb = &mc6845_device::set_out_vsync_callback(*device, DEVCB2_##_write);
- /* if specified, this gets called for every change of the cursor pin (pin 19) */
- devcb_write_line m_out_cur_func;
- /* if specified, this gets called for every change of the HSYNC pin (pin 39) */
- devcb_write_line m_out_hsync_func;
+/* callback definitions */
+typedef device_delegate<void (bitmap_rgb32 &bitmap, const rectangle &cliprect)> mc6845_begin_update_delegate;
+#define MC6845_BEGIN_UPDATE(name) void name(bitmap_rgb32 &bitmap, const rectangle &cliprect)
- /* if specified, this gets called for every change of the VSYNC pin (pin 40) */
- devcb_write_line m_out_vsync_func;
+typedef device_delegate<void (bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra,
+ UINT16 y, UINT8 x_count, INT8 cursor_x, int de, int hbp, int vbp)> mc6845_update_row_delegate;
+#define MC6845_UPDATE_ROW(name) void name(bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, \
+ UINT16 y, UINT8 x_count, INT8 cursor_x, int de, int hbp, int vbp)
- /* Called whenever the update address changes
- * For vblank/hblank timing strobe indicates the physical update.
- * vblank/hblank timing not supported yet! */
+typedef device_delegate<void (bitmap_rgb32 &bitmap, const rectangle &cliprect)> mc6845_end_update_delegate;
+#define MC6845_END_UPDATE(name) void name(bitmap_rgb32 &bitmap, const rectangle &cliprect)
- mc6845_on_update_addr_changed_func m_on_update_addr_changed;
-};
+typedef device_delegate<void (int address, int strobe)> mc6845_on_update_addr_changed_delegate;
+#define MC6845_ON_UPDATE_ADDR_CHANGED(name) void name(int address, int strobe)
class mc6845_device : public device_t,
- public device_video_interface,
- public mc6845_interface
+ public device_video_interface
{
friend class mc6845_1_device;
friend class r6545_1_device;
@@ -135,6 +96,27 @@ public:
mc6845_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
mc6845_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
+ static void set_show_border_area(device_t &device, bool show) { downcast<mc6845_device &>(device).m_show_border_area = show; }
+ static void set_visarea_adjust(device_t &device, int min_x, int max_x, int min_y, int max_y)
+ {
+ mc6845_device &dev = downcast<mc6845_device &>(device);
+ dev.m_visarea_adjust_min_x = min_x;
+ dev.m_visarea_adjust_max_x = max_x;
+ dev.m_visarea_adjust_min_y = min_y;
+ dev.m_visarea_adjust_max_y = max_y;
+ }
+ static void set_char_width(device_t &device, int pixels) { downcast<mc6845_device &>(device).m_hpixels_per_column = pixels; }
+
+ static void set_begin_update_callback(device_t &device, mc6845_begin_update_delegate callback) { downcast<mc6845_device &>(device).m_begin_update_cb = callback; }
+ static void set_update_row_callback(device_t &device, mc6845_update_row_delegate callback) { downcast<mc6845_device &>(device).m_update_row_cb = callback; }
+ static void set_end_update_callback(device_t &device, mc6845_end_update_delegate callback) { downcast<mc6845_device &>(device).m_end_update_cb = callback; }
+ static void set_on_update_addr_change_callback(device_t &device, mc6845_on_update_addr_changed_delegate callback) { downcast<mc6845_device &>(device).m_on_update_addr_changed_cb = callback; }
+
+ template<class _Object> static devcb2_base &set_out_de_callback(device_t &device, _Object object) { return downcast<mc6845_device &>(device).m_out_de_cb.set_callback(object); }
+ template<class _Object> static devcb2_base &set_out_cur_callback(device_t &device, _Object object) { return downcast<mc6845_device &>(device).m_out_cur_cb.set_callback(object); }
+ template<class _Object> static devcb2_base &set_out_hsync_callback(device_t &device, _Object object) { return downcast<mc6845_device &>(device).m_out_hsync_cb.set_callback(object); }
+ template<class _Object> static devcb2_base &set_out_vsync_callback(device_t &device, _Object object) { return downcast<mc6845_device &>(device).m_out_vsync_cb.set_callback(object); }
+
/* select one of the registers for reading or writing */
DECLARE_WRITE8_MEMBER( address_w );
@@ -181,7 +163,6 @@ public:
protected:
// device-level overrides
- virtual void device_config_complete();
virtual void device_start();
virtual void device_reset();
virtual void device_post_load();
@@ -194,11 +175,6 @@ protected:
bool m_supports_status_reg_d7;
bool m_supports_transparent;
- devcb_resolved_write_line m_res_out_de_func;
- devcb_resolved_write_line m_res_out_cur_func;
- devcb_resolved_write_line m_res_out_hsync_func;
- devcb_resolved_write_line m_res_out_vsync_func;
-
/* register file */
UINT8 m_horiz_char_total; /* 0x00 */
UINT8 m_horiz_disp; /* 0x01 */
@@ -262,7 +238,7 @@ protected:
emu_timer *m_light_pen_latch_timer;
emu_timer *m_upd_adr_timer;
emu_timer *m_upd_trans_timer;
-
+
/* computed values - do NOT state save these! */
/* These computed are used to define the screen parameters for a driver */
UINT16 m_horiz_pix_total;
@@ -290,7 +266,52 @@ protected:
void set_cur(int state);
void handle_line_timer();
virtual void update_cursor_state();
- virtual UINT8 draw_scanline(int y, bitmap_rgb32 &bitmap, const rectangle &cliprect, void *param);
+ virtual UINT8 draw_scanline(int y, bitmap_rgb32 &bitmap, const rectangle &cliprect);
+
+ /************************
+ interface CRTC - driver
+ ************************/
+
+ bool m_show_border_area; /* visible screen area (false) active display (true) active display + blanking */
+
+ /* visible screen area adjustment */
+ int m_visarea_adjust_min_x;
+ int m_visarea_adjust_max_x;
+ int m_visarea_adjust_min_y;
+ int m_visarea_adjust_max_y;
+
+ int m_hpixels_per_column; /* number of pixels per video memory address */
+
+ /* if specified, this gets called before any pixel update,
+ optionally return a pointer that will be passed to the
+ update and tear down callbacks */
+ mc6845_begin_update_delegate m_begin_update_cb;
+
+ /* this gets called for every row, the driver must output
+ x_count * hpixels_per_column pixels.
+ cursor_x indicates the character position where the cursor is, or -1
+ if there is no cursor on this row */
+ mc6845_update_row_delegate m_update_row_cb;
+
+ /* if specified, this gets called after all row updating is complete */
+ mc6845_end_update_delegate m_end_update_cb;
+
+ /* Called whenever the update address changes
+ * For vblank/hblank timing strobe indicates the physical update.
+ * vblank/hblank timing not supported yet! */
+ mc6845_on_update_addr_changed_delegate m_on_update_addr_changed_cb;
+
+ /* if specified, this gets called for every change of the disply enable pin (pin 18) */
+ devcb2_write_line m_out_de_cb;
+
+ /* if specified, this gets called for every change of the cursor pin (pin 19) */
+ devcb2_write_line m_out_cur_cb;
+
+ /* if specified, this gets called for every change of the HSYNC pin (pin 39) */
+ devcb2_write_line m_out_hsync_cb;
+
+ /* if specified, this gets called for every change of the VSYNC pin (pin 40) */
+ devcb2_write_line m_out_vsync_cb;
};
@@ -403,8 +424,7 @@ public:
inline UINT8 read_videoram(offs_t offset);
inline void write_videoram(offs_t offset, UINT8 data);
- void update_row(bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, int de, int hbp, int vbp, void *param);
- static MC6845_UPDATE_ROW( vdc_update_row );
+ MC6845_UPDATE_ROW( vdc_update_row );
protected:
// device-level overrides
@@ -442,7 +462,7 @@ protected:
int m_revision;
virtual void update_cursor_state();
- virtual UINT8 draw_scanline(int y, bitmap_rgb32 &bitmap, const rectangle &cliprect, void *param);
+ virtual UINT8 draw_scanline(int y, bitmap_rgb32 &bitmap, const rectangle &cliprect);
static const device_timer_id TIMER_BLOCK_COPY = 9;
diff --git a/src/mame/drivers/4enlinea.c b/src/mame/drivers/4enlinea.c
index c59726e114c..5e4e6ff3a79 100644
--- a/src/mame/drivers/4enlinea.c
+++ b/src/mame/drivers/4enlinea.c
@@ -295,7 +295,6 @@ void isa8_cga_4enlinea_device::device_start()
m_vram_size = 0x4000;
m_vram.resize(m_vram_size);
- m_update_row = NULL;
//m_isa->install_device(0x3bf, 0x3bf, 0, 0, NULL, write8_delegate( FUNC(isa8_cga_4enlinea_device::_4enlinea_mode_control_w), this ) );
m_isa->install_device(0x3d0, 0x3df, 0, 0, read8_delegate( FUNC(isa8_cga_4enlinea_device::_4enlinea_io_read), this ), write8_delegate( FUNC(isa8_cga_device::io_write), this ) );
m_isa->install_bank(0x8000, 0xbfff, 0, 0, "bank1", m_vram);
diff --git a/src/mame/drivers/4roses.c b/src/mame/drivers/4roses.c
index 30a384fd15b..6daf30633c4 100644
--- a/src/mame/drivers/4roses.c
+++ b/src/mame/drivers/4roses.c
@@ -358,28 +358,6 @@ static const ay8910_interface ay8910_intf =
};
-#if 0
-/************************
-* CRTC Interface *
-************************/
-
-static MC6845_INTERFACE( mc6845_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of pixels per video memory address */
- NULL, /* before pixel update callback */
- NULL, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_NULL, /* VSYNC callback */
- NULL /* update address callback */
-};
-#endif
-
-
/**************************
* Machine Drivers *
**************************/
@@ -408,7 +386,7 @@ static MACHINE_CONFIG_START( 4roses, _4roses_state )
MCFG_PALETTE_INIT_OWNER(_4roses_state,funworld)
MCFG_VIDEO_START_OVERRIDE(_4roses_state,funworld)
-// MCFG_MC6845_ADD("crtc", MC6845, "screen", MASTER_CLOCK/8, mc6845_intf) /* 2MHz, guess */
+// MCFG_MC6845_ADD("crtc", MC6845, "screen", MASTER_CLOCK/8) /* 2MHz, guess */
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mame/drivers/5clown.c b/src/mame/drivers/5clown.c
index 8e013209269..0276eac06ba 100644
--- a/src/mame/drivers/5clown.c
+++ b/src/mame/drivers/5clown.c
@@ -994,27 +994,6 @@ static GFXDECODE_START( fclown )
GFXDECODE_ENTRY( "gfx2", 0, tilelayout, 0, 16 )
GFXDECODE_END
-
-/***********************
-* CRTC Interface *
-***********************/
-
-static MC6845_INTERFACE( mc6845_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of pixels per video memory address */
- NULL, /* before pixel update callback */
- NULL, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_NULL, /* VSYNC callback */
- NULL /* update address callback */
-};
-
-
/*************************
* Sound Interfaces *
*************************/
@@ -1070,7 +1049,9 @@ static MACHINE_CONFIG_START( fclown, _5clown_state )
MCFG_PALETTE_ADD("palette", 256)
MCFG_PALETTE_INIT_OWNER(_5clown_state, _5clown)
- MCFG_MC6845_ADD("crtc", MC6845, "screen", MASTER_CLOCK/16, mc6845_intf) /* guess */
+ MCFG_MC6845_ADD("crtc", MC6845, "screen", MASTER_CLOCK/16) /* guess */
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mame/drivers/albazg.c b/src/mame/drivers/albazg.c
index d9a6975429b..79c5e4eb6d5 100644
--- a/src/mame/drivers/albazg.c
+++ b/src/mame/drivers/albazg.c
@@ -210,21 +210,6 @@ static const ay8910_interface ay8910_config =
DEVCB_NULL
};
-static MC6845_INTERFACE( mc6845_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of pixels per video memory address */
- NULL, /* before pixel update callback */
- NULL, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_NULL, /* VSYNC callback */
- NULL /* update address callback */
-};
-
/***************************************************************************************/
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, albazg_state )
@@ -394,7 +379,9 @@ static MACHINE_CONFIG_START( yumefuda, albazg_state )
MCFG_SCREEN_UPDATE_DRIVER(albazg_state, screen_update_yumefuda)
MCFG_SCREEN_PALETTE("palette")
- MCFG_MC6845_ADD("crtc", H46505, "screen", MASTER_CLOCK/16, mc6845_intf) /* hand tuned to get ~60 fps */
+ MCFG_MC6845_ADD("crtc", H46505, "screen", MASTER_CLOCK/16) /* hand tuned to get ~60 fps */
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
MCFG_GFXDECODE_ADD("gfxdecode", "palette", yumefuda )
MCFG_PALETTE_ADD("palette", 0x80)
diff --git a/src/mame/drivers/amaticmg.c b/src/mame/drivers/amaticmg.c
index 1afc5646020..657b7a54708 100644
--- a/src/mame/drivers/amaticmg.c
+++ b/src/mame/drivers/amaticmg.c
@@ -794,26 +794,6 @@ GFXDECODE_END
/************************************
-* CRTC Interface *
-************************************/
-
-static MC6845_INTERFACE( mc6845_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 4, /* number of pixels per video memory address */
- NULL, /* before pixel update callback */
- NULL, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_NULL, /* VSYNC callback */
- NULL /* update address callback */
-};
-
-
-/************************************
* Machine Start & Reset *
************************************/
@@ -866,7 +846,9 @@ static MACHINE_CONFIG_START( amaticmg, amaticmg_state )
MCFG_SCREEN_UPDATE_DRIVER(amaticmg_state, screen_update_amaticmg)
MCFG_SCREEN_PALETTE("palette")
- MCFG_MC6845_ADD("crtc", MC6845, "screen", CRTC_CLOCK, mc6845_intf)
+ MCFG_MC6845_ADD("crtc", MC6845, "screen", CRTC_CLOCK)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(4)
MCFG_GFXDECODE_ADD("gfxdecode", "palette", amaticmg)
diff --git a/src/mame/drivers/amusco.c b/src/mame/drivers/amusco.c
index ce14c156431..894480d2c8b 100644
--- a/src/mame/drivers/amusco.c
+++ b/src/mame/drivers/amusco.c
@@ -99,6 +99,7 @@ public:
DECLARE_READ8_MEMBER(mc6845_r);
DECLARE_WRITE8_MEMBER(mc6845_w);
DECLARE_WRITE16_MEMBER(vram_w);
+ MC6845_ON_UPDATE_ADDR_CHANGED(crtc_addr);
UINT32 screen_update_amusco(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(amusco_interrupt);
@@ -482,28 +483,11 @@ GFXDECODE_END
* CRTC Interface *
************************/
-MC6845_ON_UPDATE_ADDR_CHANGED(crtc_addr)
+MC6845_ON_UPDATE_ADDR_CHANGED(amusco_state::crtc_addr)
{
-// amusco_state *state = device->machine().driver_data<amusco_state>();
-// state->m_video_update_address = address;
+// m_video_update_address = address;
}
-static MC6845_INTERFACE( mc6845_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of pixels per video memory address */
- NULL, /* before pixel update callback */
- NULL, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_NULL, /* VSYNC callback */
- crtc_addr /* update address callback */
-};
-
-
INTERRUPT_GEN_MEMBER(amusco_state::amusco_vblank_irq)
{
device.execute().set_input_line_and_vector(0, HOLD_LINE, 0x80/4); // sets 0x665 to 0xff
@@ -545,7 +529,10 @@ static MACHINE_CONFIG_START( amusco, amusco_state )
MCFG_PALETTE_ADD("palette", 8)
MCFG_PALETTE_INIT_OWNER(amusco_state, amusco_palette_init)
- MCFG_MC6845_ADD("crtc", R6545_1, "screen", CRTC_CLOCK, mc6845_intf) /* guess */
+ MCFG_MC6845_ADD("crtc", R6545_1, "screen", CRTC_CLOCK) /* guess */
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
+ MCFG_MC6845_ADDR_CHANGED_CB(amusco_state, crtc_addr)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mame/drivers/aristmk4.c b/src/mame/drivers/aristmk4.c
index 7149f8f7453..52a2e57bfd6 100644
--- a/src/mame/drivers/aristmk4.c
+++ b/src/mame/drivers/aristmk4.c
@@ -1568,24 +1568,6 @@ static const ay8910_interface ay8910_config2 =
DEVCB_DRIVER_MEMBER(aristmk4_state,pbltlp_out) // Port B write - goes to lamps on the buttons x4 and light tower x4
};
-static MC6845_INTERFACE( mc6845_intf )
-{
- /* in fact is a mc6845 driving 4 pixels by memory address.
- that's why the big horizontal parameters */
-
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 4, /* number of pixels per video memory address */
- NULL, /* before pixel update callback */
- NULL, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_NULL, /* VSYNC callback */
- NULL /* update address callback */
-};
-
/* read m/c number */
READ8_MEMBER(aristmk4_state::pa1_r)
@@ -1724,7 +1706,12 @@ static MACHINE_CONFIG_START( aristmk4, aristmk4_state )
MCFG_PIA_CA2_HANDLER(WRITELINE(aristmk4_state, mkiv_pia_ca2))
MCFG_PIA_CB2_HANDLER(WRITELINE(aristmk4_state, mkiv_pia_cb2))
- MCFG_MC6845_ADD("crtc", C6545_1, "screen", MAIN_CLOCK/8, mc6845_intf) // TODO: type is unknown
+ MCFG_MC6845_ADD("crtc", C6545_1, "screen", MAIN_CLOCK/8) // TODO: type is unknown
+ /* in fact is a mc6845 driving 4 pixels by memory address.
+ that's why the big horizontal parameters */
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(4)
+
MCFG_MC146818_ADD( "rtc", XTAL_4_194304Mhz )
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mame/drivers/avt.c b/src/mame/drivers/avt.c
index 5f4aac83359..7cfcadeb0bd 100644
--- a/src/mame/drivers/avt.c
+++ b/src/mame/drivers/avt.c
@@ -847,26 +847,6 @@ static GFXDECODE_START( avt )
GFXDECODE_END
-/*******************************************
-* CRTC Interface *
-*******************************************/
-
-static MC6845_INTERFACE( mc6845_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of pixels per video memory address */
- NULL, /* before pixel update callback */
- NULL, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_NULL, /* VSYNC callback */
- NULL /* update address callback */
-};
-
-
/********************************************
* Sound Interfaces *
********************************************/
@@ -914,7 +894,9 @@ static MACHINE_CONFIG_START( avt, avt_state )
MCFG_PALETTE_ADD("palette", 8*16)
MCFG_PALETTE_INIT_OWNER(avt_state, avt)
- MCFG_MC6845_ADD("crtc", MC6845, "screen", CRTC_CLOCK, mc6845_intf) /* guess */
+ MCFG_MC6845_ADD("crtc", MC6845, "screen", CRTC_CLOCK) /* guess */
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mame/drivers/blitz.c b/src/mame/drivers/blitz.c
index 49d830b8a99..f6b2380c9f6 100644
--- a/src/mame/drivers/blitz.c
+++ b/src/mame/drivers/blitz.c
@@ -701,26 +701,6 @@ static GFXDECODE_START( megadpkr )
GFXDECODE_END
-/********************************************
-* CRTC Interface *
-********************************************/
-
-static MC6845_INTERFACE( mc6845_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of pixels per video memory address */
- NULL, /* before pixel update callback */
- NULL, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_NULL, /* VSYNC callback */
- NULL /* update address callback */
-};
-
-
/**********************************************************
* Discrete Sound Routines *
***********************************************************
@@ -787,7 +767,9 @@ static MACHINE_CONFIG_START( megadpkr, blitz_state )
MCFG_SCREEN_UPDATE_DRIVER(blitz_state, screen_update_megadpkr)
MCFG_SCREEN_PALETTE("palette")
- MCFG_MC6845_ADD("crtc", MC6845, "screen", CPU_CLOCK, mc6845_intf)
+ MCFG_MC6845_ADD("crtc", MC6845, "screen", CPU_CLOCK)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
MCFG_GFXDECODE_ADD("gfxdecode", "palette", megadpkr)
MCFG_PALETTE_ADD("palette", 256)
diff --git a/src/mame/drivers/blitz68k.c b/src/mame/drivers/blitz68k.c
index 999d00bcf9b..b281c124050 100644
--- a/src/mame/drivers/blitz68k.c
+++ b/src/mame/drivers/blitz68k.c
@@ -1647,10 +1647,6 @@ INPUT_PORTS_END
// R6845AP used for video sync signals only
-static MC6845_ON_UPDATE_ADDR_CHANGED(crtc_addr)
-{
-}
-
WRITE_LINE_MEMBER(blitz68k_state::crtc_vsync_irq1)
{
m_maincpu->set_input_line(1, state ? ASSERT_LINE : CLEAR_LINE);
@@ -1667,51 +1663,6 @@ WRITE_LINE_MEMBER(blitz68k_state::crtc_vsync_irq5)
}
-static MC6845_INTERFACE( mc6845_intf_irq1 )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 4, /* number of pixels per video memory address */ /* Horizontal Display programmed to 160 characters */
- NULL, /* before pixel update callback */
- NULL, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_DRIVER_LINE_MEMBER(blitz68k_state,crtc_vsync_irq1), /* VSYNC callback */
- crtc_addr /* update address callback */
-};
-
-static MC6845_INTERFACE( mc6845_intf_irq3 )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 4, /* number of pixels per video memory address */ /* Horizontal Display programmed to 160 characters */
- NULL, /* before pixel update callback */
- NULL, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_DRIVER_LINE_MEMBER(blitz68k_state,crtc_vsync_irq3), /* VSYNC callback */
- crtc_addr /* update address callback */
-};
-
-static MC6845_INTERFACE( mc6845_intf_irq5 )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 4, /* number of pixels per video memory address */ /* Horizontal Display programmed to 160 characters */
- NULL, /* before pixel update callback */
- NULL, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_DRIVER_LINE_MEMBER(blitz68k_state,crtc_vsync_irq5), /* VSYNC callback */
- crtc_addr /* update address callback */
-};
-
static ADDRESS_MAP_START( ramdac_map, AS_0, 8, blitz68k_state )
AM_RANGE(0x000, 0x3ff) AM_DEVREADWRITE("ramdac",ramdac_device,ramdac_pal_r,ramdac_rgb666_w)
ADDRESS_MAP_END
@@ -1802,7 +1753,10 @@ static MACHINE_CONFIG_START( cjffruit, blitz68k_state )
MCFG_SCREEN_VISIBLE_AREA(0, 512-1, 0, 256-8-1)
MCFG_SCREEN_UPDATE_DRIVER(blitz68k_state, screen_update_blitz68k)
- MCFG_MC6845_ADD("crtc", R6545_1, "screen", XTAL_22_1184MHz/8, mc6845_intf_irq1)
+ MCFG_MC6845_ADD("crtc", R6545_1, "screen", XTAL_22_1184MHz/8)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(4)
+ MCFG_MC6845_OUT_VSYNC_CB(WRITELINE(blitz68k_state, crtc_vsync_irq1))
MCFG_PALETTE_ADD("palette", 0x100)
@@ -1834,7 +1788,10 @@ static MACHINE_CONFIG_START( bankrob, blitz68k_state )
MCFG_SCREEN_VISIBLE_AREA(0, 512-1, 0+4, 256-1-4)
MCFG_SCREEN_UPDATE_DRIVER(blitz68k_state, screen_update_blitz68k)
- MCFG_MC6845_ADD("crtc", H46505, "screen", XTAL_11_0592MHz/4, mc6845_intf_irq3)
+ MCFG_MC6845_ADD("crtc", H46505, "screen", XTAL_11_0592MHz/4)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(4)
+ MCFG_MC6845_OUT_VSYNC_CB(WRITELINE(blitz68k_state, crtc_vsync_irq3))
MCFG_PALETTE_ADD("palette", 0x100)
@@ -1864,7 +1821,10 @@ static MACHINE_CONFIG_START( bankroba, blitz68k_state )
MCFG_SCREEN_VISIBLE_AREA(0, 512-1, 0+7, 256-1)
MCFG_SCREEN_UPDATE_DRIVER(blitz68k_state, screen_update_blitz68k)
- MCFG_MC6845_ADD("crtc", H46505, "screen", XTAL_11_0592MHz/4, mc6845_intf_irq5)
+ MCFG_MC6845_ADD("crtc", H46505, "screen", XTAL_11_0592MHz/4)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(4)
+ MCFG_MC6845_OUT_VSYNC_CB(WRITELINE(blitz68k_state, crtc_vsync_irq5))
MCFG_PALETTE_ADD("palette", 0x100)
@@ -1893,7 +1853,10 @@ static MACHINE_CONFIG_START( deucesw2, blitz68k_state )
MCFG_SCREEN_VISIBLE_AREA(0, 512-1, 0, 256-1)
MCFG_SCREEN_UPDATE_DRIVER(blitz68k_state, screen_update_blitz68k)
- MCFG_MC6845_ADD("crtc", R6545_1, "screen", XTAL_22_1184MHz/8, mc6845_intf_irq3)
+ MCFG_MC6845_ADD("crtc", R6545_1, "screen", XTAL_22_1184MHz/8)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(4)
+ MCFG_MC6845_OUT_VSYNC_CB(WRITELINE(blitz68k_state, crtc_vsync_irq3))
MCFG_PALETTE_ADD("palette", 0x100)
@@ -1924,7 +1887,10 @@ static MACHINE_CONFIG_START( dualgame, blitz68k_state )
MCFG_SCREEN_VISIBLE_AREA(0, 512-1, 0+4, 256-1-4)
MCFG_SCREEN_UPDATE_DRIVER(blitz68k_state, screen_update_blitz68k)
- MCFG_MC6845_ADD("crtc", H46505, "screen", XTAL_11_0592MHz/4, mc6845_intf_irq3)
+ MCFG_MC6845_ADD("crtc", H46505, "screen", XTAL_11_0592MHz/4)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(4)
+ MCFG_MC6845_OUT_VSYNC_CB(WRITELINE(blitz68k_state, crtc_vsync_irq3))
MCFG_PALETTE_ADD("palette", 0x100)
@@ -1953,7 +1919,10 @@ static MACHINE_CONFIG_START( hermit, blitz68k_state )
MCFG_SCREEN_VISIBLE_AREA(0, 512-1, 0+4, 256-1-4)
MCFG_SCREEN_UPDATE_DRIVER(blitz68k_state, screen_update_blitz68k)
- MCFG_MC6845_ADD("crtc", H46505, "screen", XTAL_22_1184MHz/8, mc6845_intf_irq1)
+ MCFG_MC6845_ADD("crtc", H46505, "screen", XTAL_22_1184MHz/8)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(4)
+ MCFG_MC6845_OUT_VSYNC_CB(WRITELINE(blitz68k_state, crtc_vsync_irq1))
MCFG_PALETTE_ADD("palette", 0x100)
@@ -1987,7 +1956,10 @@ static MACHINE_CONFIG_START( maxidbl, blitz68k_state )
MCFG_SCREEN_VISIBLE_AREA(0, 512-1, 0, 256-1)
MCFG_SCREEN_UPDATE_DRIVER(blitz68k_state, screen_update_blitz68k_noblit)
- MCFG_MC6845_ADD("crtc", H46505, "screen", XTAL_11_0592MHz/4, mc6845_intf_irq3)
+ MCFG_MC6845_ADD("crtc", H46505, "screen", XTAL_11_0592MHz/4)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(4)
+ MCFG_MC6845_OUT_VSYNC_CB(WRITELINE(blitz68k_state, crtc_vsync_irq3))
MCFG_PALETTE_ADD("palette", 0x100)
MCFG_RAMDAC_ADD("ramdac", ramdac_map, "palette")
diff --git a/src/mame/drivers/buster.c b/src/mame/drivers/buster.c
index 0a604631588..4a81948848e 100644
--- a/src/mame/drivers/buster.c
+++ b/src/mame/drivers/buster.c
@@ -312,21 +312,6 @@ static GFXDECODE_START( buster )
GFXDECODE_ENTRY( "gfx1", 0, tiles8x8_layout, 0, 1 )
GFXDECODE_END
-static MC6845_INTERFACE( mc6845_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of pixels per video memory address */
- NULL, /* before pixel update callback */
- NULL, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_NULL, /* VSYNC callback */
- NULL /* update address callback */
-};
-
PALETTE_INIT_MEMBER(buster_state, buster)
{
int i;
@@ -350,7 +335,10 @@ static MACHINE_CONFIG_START( buster, buster_state )
MCFG_SCREEN_VISIBLE_AREA(0, 256-1, 16, 256-16-1)
MCFG_SCREEN_UPDATE_DRIVER(buster_state, screen_update_buster)
MCFG_SCREEN_PALETTE("palette")
- MCFG_MC6845_ADD("crtc", MC6845, "screen", XTAL_3_579545MHz/4, mc6845_intf) //unknown clock / type
+
+ MCFG_MC6845_ADD("crtc", MC6845, "screen", XTAL_3_579545MHz/4) //unknown clock / type
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
MCFG_GFXDECODE_ADD("gfxdecode", "palette", buster)
MCFG_PALETTE_ADD("palette", 8)
diff --git a/src/mame/drivers/calomega.c b/src/mame/drivers/calomega.c
index dbd018c280a..031561bcbda 100644
--- a/src/mame/drivers/calomega.c
+++ b/src/mame/drivers/calomega.c
@@ -2600,26 +2600,6 @@ static const ay8910_interface sys906_ay8912_intf =
/*************************************************
-* CRTC Interface *
-*************************************************/
-
-static MC6845_INTERFACE( mc6845_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of pixels per video memory address */
- NULL, /* before pixel update callback */
- NULL, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_NULL, /* VSYNC callback */
- NULL /* update address callback */
-};
-
-
-/*************************************************
* Machine Drivers *
*************************************************/
@@ -2653,7 +2633,9 @@ static MACHINE_CONFIG_START( sys903, calomega_state )
MCFG_PALETTE_ADD("palette", 1024)
MCFG_PALETTE_INIT_OWNER(calomega_state, calomega)
- MCFG_MC6845_ADD("crtc", MC6845, "screen", CPU_CLOCK, mc6845_intf) /* 6845 @ CPU clock */
+ MCFG_MC6845_ADD("crtc", MC6845, "screen", CPU_CLOCK) /* 6845 @ CPU clock */
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mame/drivers/carrera.c b/src/mame/drivers/carrera.c
index e5221990640..94cf851fbf6 100644
--- a/src/mame/drivers/carrera.c
+++ b/src/mame/drivers/carrera.c
@@ -315,22 +315,6 @@ PALETTE_INIT_MEMBER(carrera_state, carrera)
}
-static MC6845_INTERFACE( mc6845_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of pixels per video memory address */
- NULL, /* before pixel update callback */
- NULL, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_NULL, /* VSYNC callback */
- NULL /* update address callback */
-};
-
-
static MACHINE_CONFIG_START( carrera, carrera_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", Z80, MASTER_CLOCK / 6)
@@ -347,7 +331,9 @@ static MACHINE_CONFIG_START( carrera, carrera_state )
MCFG_SCREEN_UPDATE_DRIVER(carrera_state, screen_update_carrera)
MCFG_SCREEN_PALETTE("palette")
- MCFG_MC6845_ADD("crtc", MC6845, "screen", MASTER_CLOCK / 16, mc6845_intf)
+ MCFG_MC6845_ADD("crtc", MC6845, "screen", MASTER_CLOCK / 16)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
MCFG_GFXDECODE_ADD("gfxdecode", "palette", carrera)
MCFG_PALETTE_ADD("palette", 32)
diff --git a/src/mame/drivers/chance32.c b/src/mame/drivers/chance32.c
index db869810ce1..e99d9bed0f9 100644
--- a/src/mame/drivers/chance32.c
+++ b/src/mame/drivers/chance32.c
@@ -440,22 +440,6 @@ void chance32_state::machine_reset()
}
-static MC6845_INTERFACE( mc6845_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 16, /* number of pixels per video memory address */
- NULL, /* before pixel update callback */
- NULL, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_NULL, /* VSYNC callback */
- NULL /* update address callback */
-};
-
-
static MACHINE_CONFIG_START( chance32, chance32_state )
/* basic machine hardware */
@@ -464,7 +448,6 @@ static MACHINE_CONFIG_START( chance32, chance32_state )
MCFG_CPU_IO_MAP(chance32_portmap)
MCFG_CPU_VBLANK_INT_DRIVER("screen", chance32_state, irq0_line_hold)
-
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(52.786)
@@ -475,7 +458,9 @@ static MACHINE_CONFIG_START( chance32, chance32_state )
MCFG_SCREEN_UPDATE_DRIVER(chance32_state, screen_update_chance32)
MCFG_SCREEN_PALETTE("palette")
- MCFG_MC6845_ADD("crtc", H46505, "screen", 12000000/16, mc6845_intf) /* 52.786 Hz (similar to Major Poker) */
+ MCFG_MC6845_ADD("crtc", H46505, "screen", 12000000/16) /* 52.786 Hz (similar to Major Poker) */
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(16)
MCFG_GFXDECODE_ADD("gfxdecode", "palette", chance32)
MCFG_PALETTE_ADD("palette", 0x800)
diff --git a/src/mame/drivers/coinmstr.c b/src/mame/drivers/coinmstr.c
index bc683fbcd55..f483ca33f1f 100644
--- a/src/mame/drivers/coinmstr.c
+++ b/src/mame/drivers/coinmstr.c
@@ -1448,21 +1448,6 @@ static const ay8910_interface ay8912_interface =
DEVCB_NULL
};
-static MC6845_INTERFACE( h46505_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of pixels per video memory address */
- NULL, /* before pixel update callback */
- NULL, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_NULL, /* VSYNC callback */
- NULL /* update address callback */
-};
-
static MACHINE_CONFIG_START( coinmstr, coinmstr_state )
MCFG_CPU_ADD("maincpu", Z80, CPU_CLOCK) // 7 MHz.
@@ -1493,7 +1478,9 @@ static MACHINE_CONFIG_START( coinmstr, coinmstr_state )
MCFG_GFXDECODE_ADD("gfxdecode", "palette", coinmstr)
MCFG_PALETTE_ADD("palette", 46*32*4)
- MCFG_MC6845_ADD("crtc", H46505, "screen", 14000000 / 16, h46505_intf)
+ MCFG_MC6845_ADD("crtc", H46505, "screen", 14000000 / 16)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mame/drivers/docastle.c b/src/mame/drivers/docastle.c
index 6c4fac61f8e..68f036e475f 100644
--- a/src/mame/drivers/docastle.c
+++ b/src/mame/drivers/docastle.c
@@ -551,35 +551,6 @@ static GFXDECODE_START( docastle )
GFXDECODE_END
-/*************************************
- *
- * 6845 CRTC interface
- *
- *************************************/
-
-/*
-The games program the CRTC for a width of 32 characters (256 pixels).
-However, the DE output from the CRTC is first ANDed with the NAND of
-MA1 through MA4, and then delayed by 8 pixel clocks; this effectively
-blanks the first 8 pixels and last 8 pixels of each line.
-*/
-
-static MC6845_INTERFACE( crtc_intf )
-{
- false, /* show border area */
- 8,-8,0,0, /* visarea adjustment */
- 8, /* number of pixels per video memory address */
- NULL, /* before pixel update callback */
- NULL, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_DRIVER_LINE_MEMBER(docastle_state, docastle_tint), /* HSYNC callback */
- DEVCB_NULL, /* VSYNC callback */
- NULL /* update address callback */
-};
-
-
/* Machine Drivers */
void docastle_state::machine_reset()
@@ -625,7 +596,17 @@ static MACHINE_CONFIG_START( docastle, docastle_state )
MCFG_CPU_VBLANK_INT_DRIVER("screen", docastle_state, nmi_line_pulse)
/* video hardware */
- MCFG_MC6845_ADD("crtc", H46505, "screen", XTAL_9_828MHz / 16, crtc_intf)
+ MCFG_MC6845_ADD("crtc", H46505, "screen", XTAL_9_828MHz / 16)
+ /*
+ The games program the CRTC for a width of 32 characters (256 pixels).
+ However, the DE output from the CRTC is first ANDed with the NAND of
+ MA1 through MA4, and then delayed by 8 pixel clocks; this effectively
+ blanks the first 8 pixels and last 8 pixels of each line.
+ */
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_VISAREA_ADJUST(8,-8,0,0)
+ MCFG_MC6845_CHAR_WIDTH(8)
+ MCFG_MC6845_OUT_HSYNC_CB(WRITELINE(docastle_state, docastle_tint))
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_RAW_PARAMS(XTAL_9_828MHz/2, 0x138, 8, 0x100-8, 0x108, 0, 0xc0) // from crtc
diff --git a/src/mame/drivers/flipjack.c b/src/mame/drivers/flipjack.c
index 71131fae0b7..73eb8b51171 100644
--- a/src/mame/drivers/flipjack.c
+++ b/src/mame/drivers/flipjack.c
@@ -423,22 +423,6 @@ static const ay8910_interface ay8910_config_2 =
DEVCB_NULL /* Port B write */
};
-static MC6845_INTERFACE( mc6845_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of pixels per video memory address */
- NULL, /* before pixel update callback */
- NULL, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_NULL, /* VSYNC callback */
- NULL /* update address callback */
-};
-
-
static const gfx_layout tilelayout =
{
@@ -493,7 +477,9 @@ static MACHINE_CONFIG_START( flipjack, flipjack_state )
MCFG_SCREEN_RAW_PARAMS(VIDEO_CLOCK, 0x188, 0, 0x100, 0x100, 0, 0xc0) // from crtc
MCFG_SCREEN_UPDATE_DRIVER(flipjack_state, screen_update_flipjack)
- MCFG_MC6845_ADD("crtc", HD6845, "screen", VIDEO_CLOCK/8, mc6845_intf)
+ MCFG_MC6845_ADD("crtc", HD6845, "screen", VIDEO_CLOCK/8)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
MCFG_GFXDECODE_ADD("gfxdecode", "palette", flipjack)
diff --git a/src/mame/drivers/fortecar.c b/src/mame/drivers/fortecar.c
index 18c143507e7..af596c8483d 100644
--- a/src/mame/drivers/fortecar.c
+++ b/src/mame/drivers/fortecar.c
@@ -526,22 +526,6 @@ static const ay8910_interface ay8910_config =
};
-static MC6845_INTERFACE( mc6845_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of pixels per video memory address */
- NULL, /* before pixel update callback */
- NULL, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_NULL, /* VSYNC callback */
- NULL /* update address callback */
-};
-
-
static ADDRESS_MAP_START( fortecar_map, AS_PROGRAM, 8, fortecar_state )
AM_RANGE(0x0000, 0xbfff) AM_ROM
AM_RANGE(0xc000, 0xc7ff) AM_ROM
@@ -699,7 +683,9 @@ static MACHINE_CONFIG_START( fortecar, fortecar_state )
MCFG_PALETTE_ADD("palette", 0x200)
MCFG_PALETTE_INIT_OWNER(fortecar_state, fortecar)
- MCFG_MC6845_ADD("crtc", MC6845, "screen", CRTC_CLOCK, mc6845_intf) /* 1.5 MHz, measured */
+ MCFG_MC6845_ADD("crtc", MC6845, "screen", CRTC_CLOCK) /* 1.5 MHz, measured */
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mame/drivers/funworld.c b/src/mame/drivers/funworld.c
index 02f1924b793..5a6d652b123 100644
--- a/src/mame/drivers/funworld.c
+++ b/src/mame/drivers/funworld.c
@@ -2867,41 +2867,6 @@ static const ay8910_interface funquiz_ay8910_intf =
DEVCB_DRIVER_MEMBER(funworld_state,funworld_lamp_b_w) /* portB out */
};
-/************************
-* CRTC Interface *
-************************/
-
-static MC6845_INTERFACE( mc6845_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 4, /* number of pixels per video memory address */
- NULL, /* before pixel update callback */
- NULL, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_NULL, /* VSYNC callback */
- NULL /* update address callback */
-};
-
-static MC6845_INTERFACE( magicrd2_mc6845_intf )
-{
- false, /* show border area */
- 0,-56,0,0, /* visarea adjustment */
- 4, /* number of pixels per video memory address */
- NULL, /* before pixel update callback */
- NULL, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_NULL, /* VSYNC callback */
- NULL /* update address callback */
-};
-
-
/********************************
* Machine Start & Reset *
********************************/
@@ -2957,7 +2922,9 @@ static MACHINE_CONFIG_START( fw1stpal, funworld_state )
MCFG_PALETTE_INIT_OWNER(funworld_state, funworld)
MCFG_VIDEO_START_OVERRIDE(funworld_state, funworld)
- MCFG_MC6845_ADD("crtc", MC6845, "screen", CRTC_CLOCK, mc6845_intf) /* 2MHz, veryfied on jollycrd & royalcrd */
+ MCFG_MC6845_ADD("crtc", MC6845, "screen", CRTC_CLOCK) /* 2MHz, veryfied on jollycrd & royalcrd */
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(4)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
@@ -2995,7 +2962,10 @@ static MACHINE_CONFIG_DERIVED( magicrd2, fw1stpal )
MCFG_VIDEO_START_OVERRIDE(funworld_state, magicrd2)
MCFG_DEVICE_REMOVE("crtc")
- MCFG_MC6845_ADD("crtc", MC6845, "screen", CRTC_CLOCK, magicrd2_mc6845_intf)
+ MCFG_MC6845_ADD("crtc", MC6845, "screen", CRTC_CLOCK)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_VISAREA_ADJUST(0, -56, 0, 0)
+ MCFG_MC6845_CHAR_WIDTH(4)
MCFG_SOUND_REPLACE("ay8910", AY8910, SND_CLOCK) /* 2MHz */
MCFG_SOUND_CONFIG(ay8910_intf)
diff --git a/src/mame/drivers/gluck2.c b/src/mame/drivers/gluck2.c
index 7280d77b1a1..2e14e67280a 100644
--- a/src/mame/drivers/gluck2.c
+++ b/src/mame/drivers/gluck2.c
@@ -503,26 +503,6 @@ static GFXDECODE_START( gluck2 )
GFXDECODE_END
-/********************************************
-* CRTC Interface *
-********************************************/
-
-static MC6845_INTERFACE( mc6845_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of pixels per video memory address */
- NULL, /* before pixel update callback */
- NULL, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_NULL, /* VSYNC callback */
- NULL /* update address callback */
-};
-
-
/*************************************************
* Sound Interfaces *
*************************************************/
@@ -572,7 +552,9 @@ static MACHINE_CONFIG_START( gluck2, gluck2_state )
MCFG_PALETTE_ADD("palette", 0x100)
MCFG_PALETTE_INIT_OWNER(gluck2_state, gluck2)
- MCFG_MC6845_ADD("crtc", MC6845, "screen", MASTER_CLOCK/16, mc6845_intf) /* guess */
+ MCFG_MC6845_ADD("crtc", MC6845, "screen", MASTER_CLOCK/16) /* guess */
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mame/drivers/goldnpkr.c b/src/mame/drivers/goldnpkr.c
index 539e38714b0..57f4431ab10 100644
--- a/src/mame/drivers/goldnpkr.c
+++ b/src/mame/drivers/goldnpkr.c
@@ -3526,26 +3526,6 @@ static GFXDECODE_START( wcrdxtnd )
GFXDECODE_ENTRY( "gfx15", 0, tilelayout, 0, 16 )
GFXDECODE_END
-/*******************************************
-* CRTC Interface *
-*******************************************/
-
-static MC6845_INTERFACE( mc6845_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of pixels per video memory address */
- NULL, /* before pixel update callback */
- NULL, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_NULL, /* VSYNC callback */
- NULL /* update address callback */
-};
-
-
/**********************************************************
* Discrete Sound Routines *
***********************************************************
@@ -3746,7 +3726,9 @@ static MACHINE_CONFIG_START( goldnpkr_base, goldnpkr_state )
MCFG_SCREEN_UPDATE_DRIVER(goldnpkr_state, screen_update_goldnpkr)
MCFG_SCREEN_PALETTE("palette")
- MCFG_MC6845_ADD("crtc", MC6845, "screen", CPU_CLOCK, mc6845_intf) /* 68B45 or 6845s @ CPU clock */
+ MCFG_MC6845_ADD("crtc", MC6845, "screen", CPU_CLOCK) /* 68B45 or 6845s @ CPU clock */
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
MCFG_GFXDECODE_ADD("gfxdecode", "palette", goldnpkr)
MCFG_PALETTE_ADD("palette", 256)
diff --git a/src/mame/drivers/hitpoker.c b/src/mame/drivers/hitpoker.c
index 1421aef3e75..17681857388 100644
--- a/src/mame/drivers/hitpoker.c
+++ b/src/mame/drivers/hitpoker.c
@@ -462,21 +462,6 @@ static GFXDECODE_START( hitpoker )
GFXDECODE_ENTRY( "gfx1", 0, hitpoker_layout_8bpp, 0, 8 )
GFXDECODE_END
-static MC6845_INTERFACE( mc6845_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of pixels per video memory address */
- NULL, /* before pixel update callback */
- NULL, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_NULL, /* VSYNC callback */
- NULL /* update address callback */
-};
-
static const ay8910_interface ay8910_config =
{
AY8910_LEGACY_OUTPUT,
@@ -511,12 +496,13 @@ static MACHINE_CONFIG_START( hitpoker, hitpoker_state )
MCFG_SCREEN_UPDATE_DRIVER(hitpoker_state, screen_update_hitpoker)
MCFG_SCREEN_PALETTE("palette")
- MCFG_MC6845_ADD("crtc", H46505, "screen", CRTC_CLOCK/2, mc6845_intf) /* hand tuned to get ~60 fps */
+ MCFG_MC6845_ADD("crtc", H46505, "screen", CRTC_CLOCK/2) /* hand tuned to get ~60 fps */
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
MCFG_GFXDECODE_ADD("gfxdecode", "palette", hitpoker)
MCFG_PALETTE_ADD("palette", 0x800)
-
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("aysnd", YM2149, 1500000)
diff --git a/src/mame/drivers/jokrwild.c b/src/mame/drivers/jokrwild.c
index 5e345780bd5..3bd3bdda21a 100644
--- a/src/mame/drivers/jokrwild.c
+++ b/src/mame/drivers/jokrwild.c
@@ -423,26 +423,6 @@ WRITE8_MEMBER(jokrwild_state::testb_w)
// printf("%02x B\n",data);
}
-/************************
-* CRTC Interface *
-************************/
-
-static MC6845_INTERFACE( mc6845_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of pixels per video memory address */
- NULL, /* before pixel update callback */
- NULL, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_NULL, /* VSYNC callback */
- NULL /* update address callback */
-};
-
-
/*************************
* Machine Drivers *
*************************/
@@ -479,8 +459,9 @@ static MACHINE_CONFIG_START( jokrwild, jokrwild_state )
MCFG_PALETTE_ADD("palette", 512)
MCFG_PALETTE_INIT_OWNER(jokrwild_state, jokrwild)
- MCFG_MC6845_ADD("crtc", MC6845, "screen", MASTER_CLOCK/16, mc6845_intf) /* guess */
-
+ MCFG_MC6845_ADD("crtc", MC6845, "screen", MASTER_CLOCK/16) /* guess */
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/jubilee.c b/src/mame/drivers/jubilee.c
index 33bbbdf82d9..9240bb9ae94 100644
--- a/src/mame/drivers/jubilee.c
+++ b/src/mame/drivers/jubilee.c
@@ -650,25 +650,6 @@ static GFXDECODE_START( jubileep ) /* 4 different graphics banks */
GFXDECODE_END
-/***********************
-* CRTC Interface *
-************************/
-
-static MC6845_INTERFACE( mc6845_intf )
-{
- false, /* show border area */
- 0, 0, 0, 0, /* visarea adjustment */
- 8, /* number of pixels per video memory address */
- NULL, /* before pixel update callback */
- NULL, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_NULL, /* VSYNC callback */
- NULL /* update address callback */
-};
-
/*************************
* Machine Drivers *
*************************/
@@ -693,8 +674,9 @@ static MACHINE_CONFIG_START( jubileep, jubilee_state )
MCFG_GFXDECODE_ADD("gfxdecode", "palette", jubileep)
MCFG_PALETTE_ADD("palette",8)
- MCFG_MC6845_ADD("crtc", MC6845, "screen", CRTC_CLOCK, mc6845_intf)
-
+ MCFG_MC6845_ADD("crtc", MC6845, "screen", CRTC_CLOCK)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/kingdrby.c b/src/mame/drivers/kingdrby.c
index 8574e0cb19b..00b7bed9eaa 100644
--- a/src/mame/drivers/kingdrby.c
+++ b/src/mame/drivers/kingdrby.c
@@ -20,6 +20,12 @@ TODO:
(but there isn't any title screen in the game?)
- Fix I/O in the 1986 bootleg version;
+MC6845 interface:
+ screen size: 384x272 registers 00 & 04. (value-1)
+ visible area: 256x224 registers 01 & 06.
+
+ the clocks are a guess, but is the only logical combination I found to get a reasonable vertical of ~53Hz.
+
============================================================================================
file : readme.txt
@@ -852,32 +858,6 @@ static GFXDECODE_START( cowrace )
GFXDECODE_ENTRY( "gfx2", 0x000000, layout8x8x2, 0x000, 0x80 )
GFXDECODE_END
-/**********************************************************************************************************
-*
-* MC6845 interface
-*
-* screen size: 384x272 registers 00 & 04. (value-1)
-* visible area: 256x224 registers 01 & 06.
-*
-* the clocks are a guess, but is the only logical combination I found to get a reasonable vertical of ~53Hz.
-*
-***********************************************************************************************************/
-
-static MC6845_INTERFACE( mc6845_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of pixels per video memory address */
- NULL, /* before pixel update callback */
- NULL, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_NULL, /* VSYNC callback */
- NULL /* update address callback */
-};
-
/*************************************
*
* Sound HW Config
@@ -1006,7 +986,9 @@ static MACHINE_CONFIG_START( kingdrby, kingdrby_state )
MCFG_SCREEN_UPDATE_DRIVER(kingdrby_state, screen_update_kingdrby)
MCFG_SCREEN_PALETTE("palette")
- MCFG_MC6845_ADD("crtc", MC6845, "screen", CLK_1/32, mc6845_intf) /* 53.333 Hz. guess */
+ MCFG_MC6845_ADD("crtc", MC6845, "screen", CLK_1/32) /* 53.333 Hz. guess */
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mame/drivers/laserbas.c b/src/mame/drivers/laserbas.c
index fa56410a667..d69c9cdd491 100644
--- a/src/mame/drivers/laserbas.c
+++ b/src/mame/drivers/laserbas.c
@@ -286,22 +286,6 @@ void laserbas_state::machine_reset()
m_count = 0;
}
-static MC6845_INTERFACE( mc6845_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of pixels per video memory address */
- NULL, /* before pixel update callback */
- NULL, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_NULL, /* VSYNC callback */
- NULL /* update address callback */
-};
-
-
static MACHINE_CONFIG_START( laserbas, laserbas_state )
MCFG_CPU_ADD("maincpu", Z80, 4000000)
@@ -329,7 +313,9 @@ static MACHINE_CONFIG_START( laserbas, laserbas_state )
MCFG_SCREEN_UPDATE_DRIVER(laserbas_state, screen_update_laserbas)
MCFG_SCREEN_PALETTE("palette")
- MCFG_MC6845_ADD("crtc", H46505, "screen", 3000000/4, mc6845_intf) /* unknown clock, hand tuned to get ~60 fps */
+ MCFG_MC6845_ADD("crtc", H46505, "screen", 3000000/4) /* unknown clock, hand tuned to get ~60 fps */
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
MCFG_PALETTE_ADD("palette", 32)
MCFG_PALETTE_FORMAT(RRRGGGBB)
diff --git a/src/mame/drivers/luckgrln.c b/src/mame/drivers/luckgrln.c
index f8790404396..857f04f75b4 100644
--- a/src/mame/drivers/luckgrln.c
+++ b/src/mame/drivers/luckgrln.c
@@ -975,21 +975,6 @@ static GFXDECODE_START( luckgrln )
GFXDECODE_ENTRY( "reels", 0, tiles8x32_layout, 0, 64 )
GFXDECODE_END
-static MC6845_INTERFACE( mc6845_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of pixels per video memory address */
- NULL, /* before pixel update callback */
- NULL, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_NULL, /* VSYNC callback */
- NULL /* update address callback */
-};
-
INTERRUPT_GEN_MEMBER(luckgrln_state::luckgrln_irq)
{
if(m_nmi_enable)
@@ -1002,7 +987,9 @@ static MACHINE_CONFIG_START( luckgrln, luckgrln_state )
MCFG_CPU_IO_MAP(portmap)
MCFG_CPU_VBLANK_INT_DRIVER("screen", luckgrln_state, luckgrln_irq)
- MCFG_MC6845_ADD("crtc", H46505, "screen", 6000000/4, mc6845_intf) /* unknown clock, hand tuned to get ~60 fps */
+ MCFG_MC6845_ADD("crtc", H46505, "screen", 6000000/4) /* unknown clock, hand tuned to get ~60 fps */
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
@@ -1015,7 +1002,6 @@ static MACHINE_CONFIG_START( luckgrln, luckgrln_state )
MCFG_GFXDECODE_ADD("gfxdecode", "palette", luckgrln)
MCFG_PALETTE_ADD("palette", 0x8000)
-
MCFG_SPEAKER_STANDARD_MONO("mono")
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/magicfly.c b/src/mame/drivers/magicfly.c
index 29b9cd186ec..25d23638338 100644
--- a/src/mame/drivers/magicfly.c
+++ b/src/mame/drivers/magicfly.c
@@ -917,26 +917,6 @@ static GFXDECODE_START( magicfly )
GFXDECODE_END
-/********************************************
-* CRTC Interface *
-********************************************/
-
-static MC6845_INTERFACE( mc6845_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of pixels per video memory address */
- NULL, /* before pixel update callback */
- NULL, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_NULL, /* VSYNC callback */
- NULL /* update address callback */
-};
-
-
/*********************************************
* Machine Drivers *
*********************************************/
@@ -963,7 +943,9 @@ static MACHINE_CONFIG_START( magicfly, magicfly_state )
MCFG_PALETTE_ADD("palette", 32)
MCFG_PALETTE_INIT_OWNER(magicfly_state, magicfly)
- MCFG_MC6845_ADD("crtc", MC6845, "screen", MASTER_CLOCK/16, mc6845_intf) /* guess */
+ MCFG_MC6845_ADD("crtc", MC6845, "screen", MASTER_CLOCK/16) /* guess */
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mame/drivers/majorpkr.c b/src/mame/drivers/majorpkr.c
index 83172f5a98e..b95c1beb344 100644
--- a/src/mame/drivers/majorpkr.c
+++ b/src/mame/drivers/majorpkr.c
@@ -1001,26 +1001,6 @@ static GFXDECODE_START( majorpkr )
GFXDECODE_END
-/***********************
-* CRTC Interface *
-***********************/
-
-static MC6845_INTERFACE( mc6845_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 16, /* number of pixels per video memory address */
- NULL, /* before pixel update callback */
- NULL, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_NULL, /* VSYNC callback */
- NULL /* update address callback */
-};
-
-
/*************************
* Machine Drivers *
*************************/
@@ -1046,7 +1026,9 @@ static MACHINE_CONFIG_START( majorpkr, majorpkr_state )
MCFG_GFXDECODE_ADD("gfxdecode", "palette", majorpkr)
MCFG_PALETTE_ADD("palette", 0x100 * 16)
- MCFG_MC6845_ADD("crtc", MC6845, "screen", CRTC_CLOCK, mc6845_intf) /* verified */
+ MCFG_MC6845_ADD("crtc", MC6845, "screen", CRTC_CLOCK) /* verified */
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(16)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mame/drivers/merit.c b/src/mame/drivers/merit.c
index f3a15912378..8e06b873f71 100644
--- a/src/mame/drivers/merit.c
+++ b/src/mame/drivers/merit.c
@@ -126,6 +126,8 @@ public:
DECLARE_DRIVER_INIT(dtrvwz5);
virtual void machine_start();
DECLARE_MACHINE_START(casino5);
+ MC6845_BEGIN_UPDATE(crtc_begin_update);
+ MC6845_UPDATE_ROW(crtc_update_row);
required_device<cpu_device> m_maincpu;
required_device<screen_device> m_screen;
};
@@ -237,46 +239,38 @@ WRITE8_MEMBER(merit_state::palette_w)
}
-static MC6845_BEGIN_UPDATE( begin_update )
+MC6845_BEGIN_UPDATE( merit_state::crtc_begin_update )
{
- merit_state *state = device->machine().driver_data<merit_state>();
- int i;
int dim, bit0, bit1, bit2;
- for (i=0; i < NUM_PENS; i++)
+ for (int i=0; i < NUM_PENS; i++)
{
dim = BIT(i,3) ? 255 : 127;
bit0 = BIT(i,0);
bit1 = BIT(i,1);
bit2 = BIT(i,2);
- state->m_pens[i] = rgb_t(dim*bit0, dim*bit1, dim*bit2);
+ m_pens[i] = rgb_t(dim*bit0, dim*bit1, dim*bit2);
}
-
- return state->m_pens;
}
-static MC6845_UPDATE_ROW( update_row )
+MC6845_UPDATE_ROW( merit_state::crtc_update_row )
{
- merit_state *state = device->machine().driver_data<merit_state>();
- UINT8 cx;
-
- pen_t *pens = (pen_t *)param;
UINT8 *gfx[2];
UINT16 x = 0;
int rlen;
- gfx[0] = state->memregion("gfx1")->base();
- gfx[1] = state->memregion("gfx2")->base();
- rlen = state->memregion("gfx2")->bytes();
+ gfx[0] = memregion("gfx1")->base();
+ gfx[1] = memregion("gfx2")->base();
+ rlen = memregion("gfx2")->bytes();
//ma = ma ^ 0x7ff;
- for (cx = 0; cx < x_count; cx++)
+ for (UINT8 cx = 0; cx < x_count; cx++)
{
int i;
- int attr = state->m_ram_attr[ma & 0x7ff];
+ int attr = m_ram_attr[ma & 0x7ff];
int region = (attr & 0x40) >> 6;
- int addr = ((state->m_ram_video[ma & 0x7ff] | ((attr & 0x80) << 1) | (state->m_extra_video_bank_bit)) << 4) | (ra & 0x0f);
+ int addr = ((m_ram_video[ma & 0x7ff] | ((attr & 0x80) << 1) | (m_extra_video_bank_bit)) << 4) | (ra & 0x0f);
int colour = (attr & 0x7f) << 3;
UINT8 *data;
@@ -296,8 +290,8 @@ static MC6845_UPDATE_ROW( update_row )
else
col |= 0x03;
- col = state->m_ram_palette[col & 0x3ff];
- bitmap.pix32(y, x) = pens[col ? col & (NUM_PENS-1) : (state->m_lscnblk ? 8 : 0)];
+ col = m_ram_palette[col & 0x3ff];
+ bitmap.pix32(y, x) = m_pens[col ? col & (NUM_PENS-1) : (m_lscnblk ? 8 : 0)];
x++;
}
@@ -317,21 +311,6 @@ WRITE_LINE_MEMBER(merit_state::vsync_changed)
m_maincpu->set_input_line(0, state ? ASSERT_LINE : CLEAR_LINE);
}
-static MC6845_INTERFACE( mc6845_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of pixels per video memory address */
- begin_update, /* before pixel update callback */
- update_row, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_DRIVER_LINE_MEMBER(merit_state,hsync_changed), /* HSYNC callback */
- DEVCB_DRIVER_LINE_MEMBER(merit_state,vsync_changed), /* VSYNC callback */
- NULL /* update address callback */
-};
-
WRITE8_MEMBER(merit_state::led1_w)
{
/* 5 button lamps player 1 */
@@ -1181,13 +1160,17 @@ static MACHINE_CONFIG_START( pitboss, merit_state )
MCFG_I8255_OUT_PORTC_CB(WRITE8(merit_state, misc_w))
/* video hardware */
-
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_RAW_PARAMS(PIXEL_CLOCK, 512, 0, 512, 256, 0, 256) /* temporary, CRTC will configure screen */
MCFG_SCREEN_UPDATE_DEVICE("crtc", mc6845_device, screen_update)
- MCFG_MC6845_ADD("crtc", MC6845, "screen", CRTC_CLOCK, mc6845_intf)
-
+ MCFG_MC6845_ADD("crtc", MC6845, "screen", CRTC_CLOCK)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
+ MCFG_MC6845_BEGIN_UPDATE_CB(merit_state, crtc_begin_update)
+ MCFG_MC6845_UPDATE_ROW_CB(merit_state, crtc_update_row)
+ MCFG_MC6845_OUT_HSYNC_CB(WRITELINE(merit_state, hsync_changed))
+ MCFG_MC6845_OUT_VSYNC_CB(WRITELINE(merit_state, vsync_changed))
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mame/drivers/miniboy7.c b/src/mame/drivers/miniboy7.c
index db662821882..a35549bf001 100644
--- a/src/mame/drivers/miniboy7.c
+++ b/src/mame/drivers/miniboy7.c
@@ -391,26 +391,6 @@ static GFXDECODE_START( miniboy7 )
GFXDECODE_END
-/**********************************
-* CRTC Interface *
-**********************************/
-
-static MC6845_INTERFACE( mc6845_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of pixels per video memory address */
- NULL, /* before pixel update callback */
- NULL, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_NULL, /* VSYNC callback */
- NULL /* update address callback */
-};
-
-
/***********************************
* Sound Interface *
***********************************/
@@ -454,7 +434,9 @@ static MACHINE_CONFIG_START( miniboy7, miniboy7_state )
MCFG_PALETTE_ADD("palette", 256)
MCFG_PALETTE_INIT_OWNER(miniboy7_state, miniboy7)
- MCFG_MC6845_ADD("crtc", MC6845, "screen", MASTER_CLOCK/12, mc6845_intf) /* guess */
+ MCFG_MC6845_ADD("crtc", MC6845, "screen", MASTER_CLOCK/12) /* guess */
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mame/drivers/mpu12wbk.c b/src/mame/drivers/mpu12wbk.c
index e902ae1995f..57445b630d5 100644
--- a/src/mame/drivers/mpu12wbk.c
+++ b/src/mame/drivers/mpu12wbk.c
@@ -491,26 +491,6 @@ static const ay8910_interface ay8910_config =
};
-/************************
-* CRTC Interface *
-************************/
-
-static MC6845_INTERFACE( mc6845_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 4, /* number of pixels per video memory address */
- NULL, /* before pixel update callback */
- NULL, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_NULL, /* VSYNC callback */
- NULL /* update address callback */
-};
-
-
/*************************
* Machine Drivers *
*************************/
@@ -537,7 +517,9 @@ static MACHINE_CONFIG_START( mpu12wbk, mpu12wbk_state )
MCFG_PALETTE_ADD("palette", 512)
MCFG_PALETTE_INIT_OWNER(mpu12wbk_state, mpu12wbk)
- MCFG_MC6845_ADD("crtc", MC6845, "screen", MASTER_CLOCK/4, mc6845_intf) /* guess */
+ MCFG_MC6845_ADD("crtc", MC6845, "screen", MASTER_CLOCK/4) /* guess */
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(4)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mame/drivers/mpu4dealem.c b/src/mame/drivers/mpu4dealem.c
index 13157853cb8..2b69ec3d60b 100644
--- a/src/mame/drivers/mpu4dealem.c
+++ b/src/mame/drivers/mpu4dealem.c
@@ -146,22 +146,6 @@ WRITE_LINE_MEMBER(mpu4dealem_state::dealem_vsync_changed)
*
*************************************/
-static MC6845_INTERFACE( hd6845_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of pixels per video memory address */
- NULL, /* before pixel update callback */
- NULL, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_DRIVER_LINE_MEMBER(mpu4dealem_state, dealem_vsync_changed), /* VSYNC callback */
- NULL /* update address callback */
-};
-
-
static ADDRESS_MAP_START( dealem_memmap, AS_PROGRAM, 8, mpu4dealem_state )
AM_RANGE(0x0000, 0x07ff) AM_RAM AM_SHARE("nvram")
@@ -236,7 +220,10 @@ static MACHINE_CONFIG_START( dealem, mpu4dealem_state )
MCFG_PALETTE_ADD("palette", 32)
MCFG_PALETTE_INIT_OWNER(mpu4dealem_state,dealem)
- MCFG_MC6845_ADD("crtc", HD6845, "screen", MPU4_MASTER_CLOCK / 4 / 8, hd6845_intf) /* HD68B45 */
+ MCFG_MC6845_ADD("crtc", HD6845, "screen", MPU4_MASTER_CLOCK / 4 / 8) /* HD68B45 */
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
+ MCFG_MC6845_OUT_VSYNC_CB(WRITELINE(mpu4dealem_state, dealem_vsync_changed))
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/murogem.c b/src/mame/drivers/murogem.c
index 5602bc6c7ae..8078fa06d40 100644
--- a/src/mame/drivers/murogem.c
+++ b/src/mame/drivers/murogem.c
@@ -236,21 +236,6 @@ UINT32 murogem_state::screen_update_murogem(screen_device &screen, bitmap_ind16
return 0;
}
-static MC6845_INTERFACE( mc6845_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of pixels per video memory address */
- NULL, /* before pixel update callback */
- NULL, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_NULL, /* VSYNC callback */
- NULL /* update address callback */
-};
-
static MACHINE_CONFIG_START( murogem, murogem_state )
/* basic machine hardware */
@@ -271,8 +256,9 @@ static MACHINE_CONFIG_START( murogem, murogem_state )
MCFG_PALETTE_ADD("palette", 0x100)
MCFG_PALETTE_INIT_OWNER(murogem_state, murogem)
-
- MCFG_MC6845_ADD("crtc", MC6845, "screen", 750000, mc6845_intf) /* ? MHz */
+ MCFG_MC6845_ADD("crtc", MC6845, "screen", 750000) /* ? MHz */
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mame/drivers/nyny.c b/src/mame/drivers/nyny.c
index 4abe2a18cf0..580dd33d359 100644
--- a/src/mame/drivers/nyny.c
+++ b/src/mame/drivers/nyny.c
@@ -140,17 +140,11 @@ public:
INTERRUPT_GEN_MEMBER(update_pia_1);
DECLARE_WRITE8_MEMBER(ic48_1_74123_output_changed);
inline void shift_star_generator( );
-};
-
-
-/*************************************
- *
- * Prototypes
- *
- *************************************/
-
-
+ MC6845_BEGIN_UPDATE(crtc_begin_update);
+ MC6845_UPDATE_ROW(crtc_update_row);
+ MC6845_END_UPDATE(crtc_end_update);
+};
/*************************************
@@ -252,31 +246,22 @@ WRITE_LINE_MEMBER(nyny_state::flipscreen_w)
}
-static MC6845_BEGIN_UPDATE( begin_update )
+MC6845_BEGIN_UPDATE( nyny_state::crtc_begin_update )
{
- nyny_state *state = device->machine().driver_data<nyny_state>();
/* create the pens */
- offs_t i;
-
- for (i = 0; i < NUM_PENS; i++)
+ for (offs_t i = 0; i < NUM_PENS; i++)
{
- state->m_pens[i] = rgb_t(pal1bit(i >> 0), pal1bit(i >> 1), pal1bit(i >> 2));
+ m_pens[i] = rgb_t(pal1bit(i >> 0), pal1bit(i >> 1), pal1bit(i >> 2));
}
-
- return state->m_pens;
}
-static MC6845_UPDATE_ROW( update_row )
+MC6845_UPDATE_ROW( nyny_state::crtc_update_row )
{
- nyny_state *state = device->machine().driver_data<nyny_state>();
- UINT8 cx;
- pen_t *pens = (pen_t *)param;
UINT8 x = 0;
- for (cx = 0; cx < x_count; cx++)
+ for (UINT8 cx = 0; cx < x_count; cx++)
{
- int i;
UINT8 data1, data2, color1, color2;
/* the memory is hooked up to the MA, RA lines this way */
@@ -285,19 +270,19 @@ static MC6845_UPDATE_ROW( update_row )
((ra << 5) & 0x00e0) |
((ma << 0) & 0x001f);
- if (state->m_flipscreen)
+ if (m_flipscreen)
offs = offs ^ 0x9fff;
- data1 = state->m_videoram1[offs];
- data2 = state->m_videoram2[offs];
- color1 = state->m_colorram1[offs] & 0x07;
- color2 = state->m_colorram2[offs] & 0x07;
+ data1 = m_videoram1[offs];
+ data2 = m_videoram2[offs];
+ color1 = m_colorram1[offs] & 0x07;
+ color2 = m_colorram2[offs] & 0x07;
- for (i = 0; i < 8; i++)
+ for (int i = 0; i < 8; i++)
{
UINT8 bit1, bit2, color;
- if (state->m_flipscreen)
+ if (m_flipscreen)
{
bit1 = BIT(data1, 7);
bit2 = BIT(data2, 7);
@@ -320,7 +305,7 @@ static MC6845_UPDATE_ROW( update_row )
else
color = bit2 ? color2 : 0;
- bitmap.pix32(y, x) = pens[color];
+ bitmap.pix32(y, x) = m_pens[color];
x += 1;
}
@@ -336,37 +321,29 @@ void nyny_state::shift_star_generator( )
}
-static MC6845_END_UPDATE( end_update )
+MC6845_END_UPDATE( nyny_state::crtc_end_update )
{
- nyny_state *state = device->machine().driver_data<nyny_state>();
-
/* draw the star field into the bitmap */
- int y;
+ UINT16 delay_counter = m_star_delay_counter;
- pen_t *pens = (pen_t *)param;
- UINT16 delay_counter = state->m_star_delay_counter;
-
- for (y = cliprect.min_y; y <= cliprect.max_y; y++)
+ for (int y = cliprect.min_y; y <= cliprect.max_y; y++)
{
- int x;
-
- for (x = cliprect.min_x; x <= cliprect.max_x; x++)
+ for (int x = cliprect.min_x; x <= cliprect.max_x; x++)
{
/* check if the star status */
- if (state->m_star_enable &&
- (bitmap.pix32(y, x) == pens[0]) &&
- ((state->m_star_shift_reg & 0x80ff) == 0x00ff) &&
- (((y & 0x01) ^ state->m_flipscreen) ^ (((x & 0x08) >> 3) ^ state->m_flipscreen)))
+ if (m_star_enable && (bitmap.pix32(y, x) == m_pens[0]) &&
+ ((m_star_shift_reg & 0x80ff) == 0x00ff) &&
+ (((y & 0x01) ^ m_flipscreen) ^ (((x & 0x08) >> 3) ^ m_flipscreen)))
{
- UINT8 color = ((state->m_star_shift_reg & 0x0100) >> 8) | /* R */
- ((state->m_star_shift_reg & 0x0400) >> 9) | /* G */
- ((state->m_star_shift_reg & 0x1000) >> 10); /* B */
+ UINT8 color = ((m_star_shift_reg & 0x0100) >> 8) | /* R */
+ ((m_star_shift_reg & 0x0400) >> 9) | /* G */
+ ((m_star_shift_reg & 0x1000) >> 10); /* B */
- bitmap.pix32(y, x) = pens[color];
+ bitmap.pix32(y, x) = m_pens[color];
}
if (delay_counter == 0)
- state->shift_star_generator();
+ shift_star_generator();
else
delay_counter = delay_counter - 1;
}
@@ -380,23 +357,6 @@ WRITE_LINE_MEMBER(nyny_state::display_enable_changed)
}
-static MC6845_INTERFACE( mc6845_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of pixels per video memory address */
- begin_update, /* before pixel update callback */
- update_row, /* row update callback */
- end_update, /* after pixel update callback */
- DEVCB_DRIVER_LINE_MEMBER(nyny_state,display_enable_changed), /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_NULL, /* VSYNC callback */
- NULL /* update address callback */
-};
-
-
-
/*************************************
*
* Audio system - CPU 1
@@ -671,7 +631,13 @@ static MACHINE_CONFIG_START( nyny, nyny_state )
MCFG_SCREEN_RAW_PARAMS(PIXEL_CLOCK, 256, 0, 256, 256, 0, 256) /* temporary, CRTC will configure screen */
MCFG_SCREEN_UPDATE_DEVICE("crtc", mc6845_device, screen_update)
- MCFG_MC6845_ADD("crtc", MC6845, "screen", CRTC_CLOCK, mc6845_intf)
+ MCFG_MC6845_ADD("crtc", MC6845, "screen", CRTC_CLOCK)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
+ MCFG_MC6845_BEGIN_UPDATE_CB(nyny_state, crtc_begin_update)
+ MCFG_MC6845_UPDATE_ROW_CB(nyny_state, crtc_update_row)
+ MCFG_MC6845_END_UPDATE_CB(nyny_state, crtc_end_update)
+ MCFG_MC6845_OUT_DE_CB(WRITELINE(nyny_state, display_enable_changed))
/* 74LS123 */
MCFG_DEVICE_ADD("ic48_1", TTL74123, 0)
diff --git a/src/mame/drivers/othello.c b/src/mame/drivers/othello.c
index 03f2bfdb99a..30367eb2b6b 100644
--- a/src/mame/drivers/othello.c
+++ b/src/mame/drivers/othello.c
@@ -102,22 +102,22 @@ public:
virtual void machine_start();
virtual void machine_reset();
DECLARE_PALETTE_INIT(othello);
+ MC6845_UPDATE_ROW(crtc_update_row);
};
-static MC6845_UPDATE_ROW( update_row )
+MC6845_UPDATE_ROW( othello_state::crtc_update_row )
{
- othello_state *state = device->machine().driver_data<othello_state>();
- const rgb_t *palette = state->m_palette->palette()->entry_list_raw();
+ const rgb_t *palette = m_palette->palette()->entry_list_raw();
int cx, x;
UINT32 data_address;
UINT32 tmp;
- const UINT8 *gfx = state->memregion("gfx")->base();
+ const UINT8 *gfx = memregion("gfx")->base();
for(cx = 0; cx < x_count; ++cx)
{
- data_address = ((state->m_videoram[ma + cx] + state->m_tile_bank) << 4) | ra;
+ data_address = ((m_videoram[ma + cx] + m_tile_bank) << 4) | ra;
tmp = gfx[data_address] | (gfx[data_address + 0x2000] << 8) | (gfx[data_address + 0x4000] << 16);
for(x = 0; x < TILE_WIDTH; ++x)
@@ -372,22 +372,6 @@ static INPUT_PORTS_START( othello )
INPUT_PORTS_END
-static MC6845_INTERFACE( h46505_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- TILE_WIDTH, /* number of pixels per video memory address */
- NULL, /* before pixel update callback */
- update_row, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_NULL, /* VSYNC callback */
- NULL /* update address callback */
-};
-
-
void othello_state::machine_start()
{
m_mc6845 = machine().device<mc6845_device>("crtc");
@@ -440,7 +424,10 @@ static MACHINE_CONFIG_START( othello, othello_state )
MCFG_PALETTE_ADD("palette", 0x10)
MCFG_PALETTE_INIT_OWNER(othello_state, othello)
- MCFG_MC6845_ADD("crtc", H46505, "screen", 1000000 /* ? MHz */, h46505_intf) /* H46505 @ CPU clock */
+ MCFG_MC6845_ADD("crtc", H46505, "screen", 1000000 /* ? MHz */) /* H46505 @ CPU clock */
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(TILE_WIDTH)
+ MCFG_MC6845_UPDATE_ROW_CB(othello_state, crtc_update_row)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mame/drivers/peplus.c b/src/mame/drivers/peplus.c
index 78f590d784c..643945dd111 100644
--- a/src/mame/drivers/peplus.c
+++ b/src/mame/drivers/peplus.c
@@ -279,6 +279,7 @@ public:
DECLARE_DRIVER_INIT(peplussb);
DECLARE_DRIVER_INIT(peplussbw);
TILE_GET_INFO_MEMBER(get_bg_tile_info);
+ MC6845_ON_UPDATE_ADDR_CHANGED(crtc_addr);
virtual void machine_reset();
virtual void video_start();
UINT32 screen_update_peplus(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
@@ -302,26 +303,6 @@ static const UINT16 id_023[8] = { 0x4a6c, 0x4a7b, 0x4a4b, 0x4a5a, 0x4a2b, 0x4a0a
#define SOUND_CLOCK ((MASTER_CLOCK)/12)
-/* prototypes */
-
-static MC6845_ON_UPDATE_ADDR_CHANGED(crtc_addr);
-
-static MC6845_INTERFACE( mc6845_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of pixels per video memory address */
- NULL, /* before pixel update callback */
- NULL, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_DRIVER_LINE_MEMBER(peplus_state,crtc_vsync), /* VSYNC callback */
- crtc_addr /* update address callback */
-};
-
-
/**************
* Memory Copy *
***************/
@@ -377,12 +358,12 @@ WRITE8_MEMBER(peplus_state::peplus_bgcolor_w)
/* ROCKWELL 6545 - Transparent Memory Addressing */
-static MC6845_ON_UPDATE_ADDR_CHANGED(crtc_addr)
+MC6845_ON_UPDATE_ADDR_CHANGED(peplus_state::crtc_addr)
{
- peplus_state *state = device->machine().driver_data<peplus_state>();
- state->m_vid_address = address;
+ m_vid_address = address;
}
+
WRITE8_MEMBER(peplus_state::peplus_crtc_mode_w)
{
/* Reset timing logic */
@@ -1350,9 +1331,13 @@ static MACHINE_CONFIG_START( peplus, peplus_state )
MCFG_PALETTE_ADD("palette", 16*16*2)
MCFG_PALETTE_INIT_OWNER(peplus_state, peplus)
- MCFG_MC6845_ADD("crtc", R6545_1, "screen", MC6845_CLOCK, mc6845_intf)
- MCFG_X2404P_ADD("i2cmem")
+ MCFG_MC6845_ADD("crtc", R6545_1, "screen", MC6845_CLOCK)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
+ MCFG_MC6845_ADDR_CHANGED_CB(peplus_state, crtc_addr)
+ MCFG_MC6845_OUT_VSYNC_CB(WRITELINE(peplus_state, crtc_vsync))
+ MCFG_X2404P_ADD("i2cmem")
// sound hardware
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mame/drivers/progolf.c b/src/mame/drivers/progolf.c
index ca070f59a16..3e1f3a9ffe5 100644
--- a/src/mame/drivers/progolf.c
+++ b/src/mame/drivers/progolf.c
@@ -378,22 +378,6 @@ static GFXDECODE_START( progolf )
GFXDECODE_END
-static MC6845_INTERFACE( mc6845_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of pixels per video memory address */
- NULL, /* before pixel update callback */
- NULL, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_NULL, /* VSYNC callback */
- NULL /* update address callback */
-
-};
-
PALETTE_INIT_MEMBER(progolf_state, progolf)
{
const UINT8 *color_prom = memregion("proms")->base();
@@ -446,7 +430,9 @@ static MACHINE_CONFIG_START( progolf, progolf_state )
MCFG_PALETTE_ADD("palette", 32*3)
MCFG_PALETTE_INIT_OWNER(progolf_state, progolf)
- MCFG_MC6845_ADD("crtc", MC6845, "screen", 3000000/4, mc6845_intf) /* hand tuned to get ~57 fps */
+ MCFG_MC6845_ADD("crtc", MC6845, "screen", 3000000/4) /* hand tuned to get ~57 fps */
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mame/drivers/r2dtank.c b/src/mame/drivers/r2dtank.c
index c74182aee7a..7289e3a1692 100644
--- a/src/mame/drivers/r2dtank.c
+++ b/src/mame/drivers/r2dtank.c
@@ -79,6 +79,8 @@ public:
DECLARE_WRITE8_MEMBER(pia_comp_w);
virtual void machine_start();
DECLARE_WRITE8_MEMBER(ttl74123_output_changed);
+ MC6845_BEGIN_UPDATE(crtc_begin_update);
+ MC6845_UPDATE_ROW(crtc_update_row);
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
};
@@ -276,32 +278,22 @@ WRITE_LINE_MEMBER(r2dtank_state::flipscreen_w)
}
-static MC6845_BEGIN_UPDATE( begin_update )
+MC6845_BEGIN_UPDATE( r2dtank_state::crtc_begin_update )
{
- r2dtank_state *state = device->machine().driver_data<r2dtank_state>();
/* create the pens */
- offs_t i;
-
- for (i = 0; i < NUM_PENS; i++)
+ for (offs_t i = 0; i < NUM_PENS; i++)
{
- state->m_pens[i] = rgb_t(pal1bit(i >> 2), pal1bit(i >> 1), pal1bit(i >> 0));
+ m_pens[i] = rgb_t(pal1bit(i >> 2), pal1bit(i >> 1), pal1bit(i >> 0));
}
-
- return state->m_pens;
}
-static MC6845_UPDATE_ROW( update_row )
+MC6845_UPDATE_ROW( r2dtank_state::crtc_update_row )
{
- r2dtank_state *state = device->machine().driver_data<r2dtank_state>();
- UINT8 cx;
-
- pen_t *pens = (pen_t *)param;
UINT8 x = 0;
- for (cx = 0; cx < x_count; cx++)
+ for (UINT8 cx = 0; cx < x_count; cx++)
{
- int i;
UINT8 data, fore_color;
/* the memory is hooked up to the MA, RA lines this way */
@@ -309,17 +301,17 @@ static MC6845_UPDATE_ROW( update_row )
((ra << 5) & 0x00e0) |
((ma << 0) & 0x001f);
- if (state->m_flipscreen)
+ if (m_flipscreen)
offs = offs ^ 0x1fff;
- data = state->m_videoram[offs];
- fore_color = (state->m_colorram[offs] >> 5) & 0x07;
+ data = m_videoram[offs];
+ fore_color = (m_colorram[offs] >> 5) & 0x07;
- for (i = 0; i < 8; i++)
+ for (int i = 0; i < 8; i++)
{
UINT8 bit, color;
- if (state->m_flipscreen)
+ if (m_flipscreen)
{
bit = data & 0x01;
data = data >> 1;
@@ -331,7 +323,7 @@ static MC6845_UPDATE_ROW( update_row )
}
color = bit ? fore_color : 0;
- bitmap.pix32(y, x) = pens[color];
+ bitmap.pix32(y, x) = m_pens[color];
x = x + 1;
}
@@ -347,23 +339,6 @@ WRITE_LINE_MEMBER(r2dtank_state::display_enable_changed)
}
-static MC6845_INTERFACE( mc6845_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of pixels per video memory address */
- begin_update, /* before pixel update callback */
- update_row, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_DRIVER_LINE_MEMBER(r2dtank_state,display_enable_changed), /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_NULL, /* VSYNC callback */
- NULL /* update address callback */
-};
-
-
-
/*************************************
*
* Memory handlers
@@ -503,7 +478,12 @@ static MACHINE_CONFIG_START( r2dtank, r2dtank_state )
MCFG_SCREEN_RAW_PARAMS(PIXEL_CLOCK, 256, 0, 256, 256, 0, 256) /* temporary, CRTC will configure screen */
MCFG_SCREEN_UPDATE_DEVICE("crtc", mc6845_device, screen_update)
- MCFG_MC6845_ADD("crtc", MC6845, "screen", CRTC_CLOCK, mc6845_intf)
+ MCFG_MC6845_ADD("crtc", MC6845, "screen", CRTC_CLOCK)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
+ MCFG_MC6845_BEGIN_UPDATE_CB(r2dtank_state, crtc_begin_update)
+ MCFG_MC6845_UPDATE_ROW_CB(r2dtank_state, crtc_update_row)
+ MCFG_MC6845_OUT_DE_CB(WRITELINE(r2dtank_state, display_enable_changed))
/* 74LS123 */
diff --git a/src/mame/drivers/rgum.c b/src/mame/drivers/rgum.c
index eb48db68b63..7e83db4c306 100644
--- a/src/mame/drivers/rgum.c
+++ b/src/mame/drivers/rgum.c
@@ -234,21 +234,6 @@ static GFXDECODE_START( rgum )
GFXDECODE_END
-static MC6845_INTERFACE( mc6845_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of pixels per video memory address */
- NULL, /* before pixel update callback */
- NULL, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_NULL, /* VSYNC callback */
- NULL /* update address callback */
-};
-
static const ay8910_interface ay8910_config =
{
AY8910_LEGACY_OUTPUT,
@@ -274,7 +259,9 @@ static MACHINE_CONFIG_START( rgum, rgum_state )
MCFG_SCREEN_UPDATE_DRIVER(rgum_state, screen_update_royalgum)
MCFG_SCREEN_PALETTE("palette")
- MCFG_MC6845_ADD("crtc", MC6845, "screen", 24000000/16, mc6845_intf) /* unknown clock & type, hand tuned to get ~50 fps (?) */
+ MCFG_MC6845_ADD("crtc", MC6845, "screen", 24000000/16) /* unknown clock & type, hand tuned to get ~50 fps (?) */
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
MCFG_DEVICE_ADD("ppi8255", I8255A, 0)
MCFG_I8255_IN_PORTA_CB(IOPORT("IN0"))
diff --git a/src/mame/drivers/sanremo.c b/src/mame/drivers/sanremo.c
index 3d1bbc20158..5843ca17b3d 100644
--- a/src/mame/drivers/sanremo.c
+++ b/src/mame/drivers/sanremo.c
@@ -332,35 +332,6 @@ static GFXDECODE_START( sanremo )
GFXDECODE_ENTRY( "gfx", 0, tilelayout, 0, 1 )
GFXDECODE_END
-
-/********************************************
-* CRTC Interface *
-********************************************/
-
-
-static const mc6845_interface mc6845_intf =
-/*
- *** MC6845 init ***
-
- Register: 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17
- Value: 0x45 0x30 0x36 0x0A 0x28 0x00 0x26 0x27 0x00 0x07 0x20 0x0B 0x00 0x00 0x00 0x00 0x00 0x00.
-
-*/
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of pixels per video memory address */
- NULL, /* before pixel update callback */
- NULL, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_NULL, /* VSYNC callback */
- NULL /* update address callback */
-};
-
-
/********************************************
* Sound Interface *
********************************************/
@@ -399,7 +370,13 @@ static MACHINE_CONFIG_START( sanremo, sanremo_state )
MCFG_SCREEN_UPDATE_DRIVER(sanremo_state, screen_update_sanremo)
MCFG_SCREEN_PALETTE("palette")
- MCFG_MC6845_ADD("crtc", MC6845, "screen", CRTC_CLOCK, mc6845_intf)
+ MCFG_MC6845_ADD("crtc", MC6845, "screen", CRTC_CLOCK)
+ // *** MC6845 init ***
+ //
+ // Register: 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17
+ // Value: 0x45 0x30 0x36 0x0A 0x28 0x00 0x26 0x27 0x00 0x07 0x20 0x0B 0x00 0x00 0x00 0x00 0x00 0x00.
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
MCFG_GFXDECODE_ADD("gfxdecode", "palette", sanremo)
MCFG_PALETTE_ADD("palette", 0x10)
diff --git a/src/mame/drivers/slotcarn.c b/src/mame/drivers/slotcarn.c
index 11683ce3001..d55d2915ad5 100644
--- a/src/mame/drivers/slotcarn.c
+++ b/src/mame/drivers/slotcarn.c
@@ -50,6 +50,8 @@ public:
DECLARE_WRITE8_MEMBER(palette_w);
DECLARE_WRITE_LINE_MEMBER(hsync_changed);
DECLARE_WRITE_LINE_MEMBER(vsync_changed);
+ MC6845_BEGIN_UPDATE(crtc_begin_update);
+ MC6845_UPDATE_ROW(crtc_update_row);
virtual void machine_start();
required_device<cpu_device> m_maincpu;
required_device<screen_device> m_screen;
@@ -87,49 +89,40 @@ WRITE8_MEMBER(slotcarn_state::palette_w)
}
-static MC6845_BEGIN_UPDATE( begin_update )
+MC6845_BEGIN_UPDATE( slotcarn_state::crtc_begin_update )
{
- slotcarn_state *state = device->machine().driver_data<slotcarn_state>();
- int i;
int dim, bit0, bit1, bit2;
- for (i=0; i < NUM_PENS; i++)
+ for (int i=0; i < NUM_PENS; i++)
{
dim = BIT(i,3) ? 255 : 127;
bit0 = BIT(i,0);
bit1 = BIT(i,1);
bit2 = BIT(i,2);
- state->m_pens[i] = rgb_t(dim*bit0, dim*bit1, dim*bit2);
+ m_pens[i] = rgb_t(dim*bit0, dim*bit1, dim*bit2);
}
-
- return state->m_pens;
}
-
-static MC6845_UPDATE_ROW( update_row )
+MC6845_UPDATE_ROW( slotcarn_state::crtc_update_row )
{
- slotcarn_state *state = device->machine().driver_data<slotcarn_state>();
int extra_video_bank_bit = 0; // not used?
int lscnblk = 0; // not used?
-
- UINT8 cx;
- pen_t *pens = (pen_t *)param;
UINT8 *gfx[2];
UINT16 x = 0;
int rlen;
- gfx[0] = state->memregion("gfx1")->base();
- gfx[1] = state->memregion("gfx2")->base();
- rlen = state->memregion("gfx2")->bytes();
+ gfx[0] = memregion("gfx1")->base();
+ gfx[1] = memregion("gfx2")->base();
+ rlen = memregion("gfx2")->bytes();
//ma = ma ^ 0x7ff;
- for (cx = 0; cx < x_count; cx++)
+ for (UINT8 cx = 0; cx < x_count; cx++)
{
int i;
- int attr = state->m_ram_attr[ma & 0x7ff];
+ int attr = m_ram_attr[ma & 0x7ff];
int region = (attr & 0x40) >> 6;
- int addr = ((state->m_ram_video[ma & 0x7ff] | ((attr & 0x80) << 1) | (extra_video_bank_bit)) << 4) | (ra & 0x0f);
+ int addr = ((m_ram_video[ma & 0x7ff] | ((attr & 0x80) << 1) | (extra_video_bank_bit)) << 4) | (ra & 0x0f);
int colour = (attr & 0x7f) << 3;
UINT8 *data;
@@ -149,8 +142,8 @@ static MC6845_UPDATE_ROW( update_row )
else
col |= 0x03;
- col = state->m_ram_palette[col & 0x3ff];
- bitmap.pix32(y, x) = pens[col ? col & (NUM_PENS-1) : (lscnblk ? 8 : 0)];
+ col = m_ram_palette[col & 0x3ff];
+ bitmap.pix32(y, x) = m_pens[col ? col & (NUM_PENS-1) : (lscnblk ? 8 : 0)];
x++;
}
@@ -170,22 +163,6 @@ WRITE_LINE_MEMBER(slotcarn_state::vsync_changed)
m_maincpu->set_input_line(0, state ? ASSERT_LINE : CLEAR_LINE);
}
-static MC6845_INTERFACE( mc6845_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of pixels per video memory address */
- begin_update, /* before pixel update callback */
- update_row, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_DRIVER_LINE_MEMBER(slotcarn_state,hsync_changed), /* HSYNC callback */
- DEVCB_DRIVER_LINE_MEMBER(slotcarn_state,vsync_changed), /* VSYNC callback */
- NULL /* update address callback */
-};
-
-
/*******************************
* Memory Map *
*******************************/
@@ -596,7 +573,13 @@ static MACHINE_CONFIG_START( slotcarn, slotcarn_state )
MCFG_SCREEN_RAW_PARAMS(PIXEL_CLOCK, 512, 0, 512, 256, 0, 256) /* temporary, CRTC will configure screen */
MCFG_SCREEN_UPDATE_DEVICE("crtc", mc6845_device, screen_update)
- MCFG_MC6845_ADD("crtc", MC6845, "screen", CRTC_CLOCK, mc6845_intf)
+ MCFG_MC6845_ADD("crtc", MC6845, "screen", CRTC_CLOCK)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
+ MCFG_MC6845_BEGIN_UPDATE_CB(slotcarn_state, crtc_begin_update)
+ MCFG_MC6845_UPDATE_ROW_CB(slotcarn_state, crtc_update_row)
+ MCFG_MC6845_OUT_HSYNC_CB(WRITELINE(slotcarn_state, hsync_changed))
+ MCFG_MC6845_OUT_VSYNC_CB(WRITELINE(slotcarn_state, vsync_changed))
MCFG_GFXDECODE_ADD("gfxdecode", "palette", slotcarn)
MCFG_PALETTE_ADD("palette", 0x400)
diff --git a/src/mame/drivers/snk6502.c b/src/mame/drivers/snk6502.c
index 472f5bec31f..9001a53cc2a 100644
--- a/src/mame/drivers/snk6502.c
+++ b/src/mame/drivers/snk6502.c
@@ -748,28 +748,6 @@ INTERRUPT_GEN_MEMBER(snk6502_state::snk6502_interrupt)
/*************************************
*
- * 6845 CRTC interface
- *
- *************************************/
-
-static MC6845_INTERFACE( mc6845_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of pixels per video memory address */
- NULL, /* before pixel update callback */
- NULL, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_NULL, /* VSYNC callback */
- NULL /* update address callback */
-};
-
-
-/*************************************
- *
* Machine initialisation
*
*************************************/
@@ -837,7 +815,9 @@ static MACHINE_CONFIG_START( sasuke, snk6502_state )
MCFG_PALETTE_INIT_OWNER(snk6502_state,satansat)
MCFG_VIDEO_START_OVERRIDE(snk6502_state,satansat)
- MCFG_MC6845_ADD("crtc", MC6845, "screen", MASTER_CLOCK / 16, mc6845_intf)
+ MCFG_MC6845_ADD("crtc", MC6845, "screen", MASTER_CLOCK / 16)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
MCFG_TIMER_DRIVER_ADD_PERIODIC("sasuke_timer", snk6502_state, sasuke_update_counter, attotime::from_hz(MASTER_CLOCK / 8))
@@ -911,7 +891,9 @@ static MACHINE_CONFIG_START( vanguard, snk6502_state )
MCFG_PALETTE_INIT_OWNER(snk6502_state,snk6502)
MCFG_VIDEO_START_OVERRIDE(snk6502_state,snk6502)
- MCFG_MC6845_ADD("crtc", MC6845, "screen", MASTER_CLOCK / 16, mc6845_intf)
+ MCFG_MC6845_ADD("crtc", MC6845, "screen", MASTER_CLOCK / 16)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
// sound hardware
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mame/drivers/speedatk.c b/src/mame/drivers/speedatk.c
index d24e2795c5c..5a871816bd6 100644
--- a/src/mame/drivers/speedatk.c
+++ b/src/mame/drivers/speedatk.c
@@ -285,21 +285,6 @@ static GFXDECODE_START( speedatk )
GFXDECODE_ENTRY( "gfx2", 0, charlayout_3bpp, 0, 32 )
GFXDECODE_END
-static MC6845_INTERFACE( mc6845_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of pixels per video memory address */
- NULL, /* before pixel update callback */
- NULL, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_NULL, /* VSYNC callback */
- NULL /* update address callback */
-};
-
WRITE8_MEMBER(speedatk_state::speedatk_output_w)
{
m_flip_scr = data & 0x80;
@@ -336,7 +321,9 @@ static MACHINE_CONFIG_START( speedatk, speedatk_state )
MCFG_SCREEN_UPDATE_DRIVER(speedatk_state, screen_update_speedatk)
MCFG_SCREEN_PALETTE("palette")
- MCFG_MC6845_ADD("crtc", H46505, "screen", MASTER_CLOCK/16, mc6845_intf) /* hand tuned to get ~60 fps */
+ MCFG_MC6845_ADD("crtc", H46505, "screen", MASTER_CLOCK/16) /* hand tuned to get ~60 fps */
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
MCFG_GFXDECODE_ADD("gfxdecode", "palette", speedatk)
MCFG_PALETTE_ADD("palette", 0x100)
diff --git a/src/mame/drivers/spiders.c b/src/mame/drivers/spiders.c
index 36ecdff41fc..9df460c2ac5 100644
--- a/src/mame/drivers/spiders.c
+++ b/src/mame/drivers/spiders.c
@@ -321,32 +321,22 @@ WRITE_LINE_MEMBER(spiders_state::flipscreen_w)
}
-static MC6845_BEGIN_UPDATE( begin_update )
+MC6845_BEGIN_UPDATE( spiders_state::crtc_begin_update )
{
- spiders_state *state = device->machine().driver_data<spiders_state>();
/* create the pens */
- offs_t i;
-
- for (i = 0; i < NUM_PENS; i++)
+ for (offs_t i = 0; i < NUM_PENS; i++)
{
- state->m_pens[i] = rgb_t(pal1bit(i >> 0), pal1bit(i >> 1), pal1bit(i >> 2));
+ m_pens[i] = rgb_t(pal1bit(i >> 0), pal1bit(i >> 1), pal1bit(i >> 2));
}
-
- return state->m_pens;
}
-static MC6845_UPDATE_ROW( update_row )
+MC6845_UPDATE_ROW( spiders_state::crtc_update_row )
{
- spiders_state *state = device->machine().driver_data<spiders_state>();
- UINT8 cx;
-
- pen_t *pens = (pen_t *)param;
UINT8 x = 0;
- for (cx = 0; cx < x_count; cx++)
+ for (UINT8 cx = 0; cx < x_count; cx++)
{
- int i;
UINT8 data1, data2, data3;
/* the memory is hooked up to the MA, RA lines this way */
@@ -354,18 +344,18 @@ static MC6845_UPDATE_ROW( update_row )
((ra << 5) & 0x00e0) |
((ma << 0) & 0x001f);
- if (state->m_flipscreen)
+ if (m_flipscreen)
offs = offs ^ 0x3fff;
- data1 = state->m_ram[0x0000 | offs];
- data2 = state->m_ram[0x4000 | offs];
- data3 = state->m_ram[0x8000 | offs];
+ data1 = m_ram[0x0000 | offs];
+ data2 = m_ram[0x4000 | offs];
+ data3 = m_ram[0x8000 | offs];
- for (i = 0; i < 8; i++)
+ for (int i = 0; i < 8; i++)
{
UINT8 color;
- if (state->m_flipscreen)
+ if (m_flipscreen)
{
color = ((data3 & 0x80) >> 5) |
((data2 & 0x80) >> 6) |
@@ -386,7 +376,7 @@ static MC6845_UPDATE_ROW( update_row )
data3 = data3 >> 1;
}
- bitmap.pix32(y, x) = pens[color];
+ bitmap.pix32(y, x) = m_pens[color];
x = x + 1;
}
@@ -402,23 +392,6 @@ WRITE_LINE_MEMBER(spiders_state::display_enable_changed)
}
-static MC6845_INTERFACE( mc6845_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of pixels per video memory address */
- begin_update, /* before pixel update callback */
- update_row, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_DRIVER_LINE_MEMBER(spiders_state,display_enable_changed), /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_NULL, /* VSYNC callback */
- NULL /* update address callback */
-};
-
-
-
/*************************************
*
* Graphics ROM access - see the
@@ -603,7 +576,12 @@ static MACHINE_CONFIG_START( spiders, spiders_state )
MCFG_SCREEN_RAW_PARAMS(PIXEL_CLOCK, 256, 0, 256, 256, 0, 256) /* temporary, CRTC will configure screen */
MCFG_SCREEN_UPDATE_DEVICE("crtc", mc6845_device, screen_update)
- MCFG_MC6845_ADD("crtc", MC6845, "screen", CRTC_CLOCK, mc6845_intf)
+ MCFG_MC6845_ADD("crtc", MC6845, "screen", CRTC_CLOCK)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
+ MCFG_MC6845_BEGIN_UPDATE_CB(spiders_state, crtc_begin_update)
+ MCFG_MC6845_UPDATE_ROW_CB(spiders_state, crtc_update_row)
+ MCFG_MC6845_OUT_DE_CB(WRITELINE(spiders_state, display_enable_changed))
/* 74LS123 */
diff --git a/src/mame/drivers/ssingles.c b/src/mame/drivers/ssingles.c
index bc8072b5393..e4c1a8a67c9 100644
--- a/src/mame/drivers/ssingles.c
+++ b/src/mame/drivers/ssingles.c
@@ -175,6 +175,8 @@ public:
DECLARE_DRIVER_INIT(ssingles);
virtual void video_start();
INTERRUPT_GEN_MEMBER(atamanot_irq);
+ MC6845_UPDATE_ROW(ssingles_update_row);
+ MC6845_UPDATE_ROW(atamanot_update_row);
required_device<cpu_device> m_maincpu;
};
@@ -191,114 +193,79 @@ static const UINT8 ssingles_colors[NUM_PENS*3]=
0x00,0x00,0x00, 0xff,0x00,0xff, 0x80,0x00,0x80, 0x40,0x00,0x40
};
-static MC6845_UPDATE_ROW( ssingles_update_row )
+MC6845_UPDATE_ROW( ssingles_state::ssingles_update_row )
{
- ssingles_state *state = device->machine().driver_data<ssingles_state>();
- int cx,x;
UINT32 tile_address;
- UINT16 cell,palette;
- UINT8 b0,b1;
- const UINT8 *gfx = state->memregion("gfx1")->base();
+ UINT16 cell, palette;
+ UINT8 b0, b1;
+ const UINT8 *gfx = memregion("gfx1")->base();
- for(cx=0;cx<x_count;++cx)
+ for (int cx = 0; cx < x_count; ++cx)
{
- int address=((ma>>1)+(cx>>1))&0xff;
+ int address = ((ma >> 1) + (cx >> 1)) & 0xff;
- cell=state->m_videoram[address]+(state->m_colorram[address]<<8);
+ cell = m_videoram[address] + (m_colorram[address] << 8);
- tile_address=((cell&0x3ff)<<4)+ra;
- palette=(cell>>10)&0x1c;
+ tile_address = ((cell & 0x3ff) << 4) + ra;
+ palette = (cell >> 10) & 0x1c;
- if(cx&1)
+ if (cx & 1)
{
- b0=gfx[tile_address+0x0000]; /* 9.bin */
- b1=gfx[tile_address+0x8000]; /* 11.bin */
+ b0 = gfx[tile_address + 0x0000]; /* 9.bin */
+ b1 = gfx[tile_address + 0x8000]; /* 11.bin */
}
else
{
- b0=gfx[tile_address+0x4000]; /* 10.bin */
- b1=gfx[tile_address+0xc000]; /* 12.bin */
+ b0 = gfx[tile_address + 0x4000]; /* 10.bin */
+ b1 = gfx[tile_address + 0xc000]; /* 12.bin */
}
- for(x=7;x>=0;--x)
+ for (int x = 7; x >= 0; --x)
{
- bitmap.pix32(y, (cx<<3)|(x)) = state->m_pens[palette+((b1&1)|((b0&1)<<1))];
- b0>>=1;
- b1>>=1;
+ bitmap.pix32(y, (cx << 3) | x) = m_pens[palette + ((b1 & 1) | ((b0 & 1) << 1))];
+ b0 >>= 1;
+ b1 >>= 1;
}
}
}
-static MC6845_UPDATE_ROW( atamanot_update_row )
+MC6845_UPDATE_ROW( ssingles_state::atamanot_update_row )
{
- ssingles_state *state = device->machine().driver_data<ssingles_state>();
- int cx,x;
UINT32 tile_address;
- UINT16 cell,palette;
- UINT8 b0,b1;
- const UINT8 *gfx = state->memregion("gfx1")->base();
+ UINT16 cell, palette;
+ UINT8 b0, b1;
+ const UINT8 *gfx = memregion("gfx1")->base();
- for(cx=0;cx<x_count;++cx)
+ for (int cx = 0; cx < x_count; ++cx)
{
- int address=((ma>>1)+(cx>>1))&0xff;
+ int address = ((ma >> 1) + (cx >> 1)) & 0xff;
- cell=state->m_videoram[address]+(state->m_colorram[address]<<8);
+ cell = m_videoram[address] + (m_colorram[address] << 8);
- tile_address=((cell&0x1ff)<<4)+ra;
- palette=(cell>>10)&0x1c;
+ tile_address = ((cell & 0x1ff) << 4) + ra;
+ palette = (cell >> 10) & 0x1c;
- if(cx&1)
+ if (cx & 1)
{
- b0=gfx[tile_address+0x0000]; /* 9.bin */
- b1=gfx[tile_address+0x4000]; /* 11.bin */
+ b0 = gfx[tile_address + 0x0000]; /* 9.bin */
+ b1 = gfx[tile_address + 0x4000]; /* 11.bin */
}
else
{
- b0=gfx[tile_address+0x2000]; /* 10.bin */
- b1=gfx[tile_address+0x6000]; /* 12.bin */
+ b0 = gfx[tile_address + 0x2000]; /* 10.bin */
+ b1 = gfx[tile_address + 0x6000]; /* 12.bin */
}
- for(x=7;x>=0;--x)
+ for (int x = 7; x >= 0; --x)
{
- bitmap.pix32(y, (cx<<3)|(x)) = state->m_pens[palette+((b1&1)|((b0&1)<<1))];
- b0>>=1;
- b1>>=1;
+ bitmap.pix32(y, (cx << 3) | x) = m_pens[palette + ((b1 & 1) | ((b0 & 1) << 1))];
+ b0 >>= 1;
+ b1 >>= 1;
}
}
}
-static MC6845_INTERFACE( ssingles_mc6845_intf )
-{
- false,
- 0,0,0,0,
- 8,
- NULL, /* before pixel update callback */
- ssingles_update_row, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_NULL, /* VSYNC callback */
- NULL /* update address callback */
-};
-
-static MC6845_INTERFACE( atamanot_mc6845_intf )
-{
- false,
- 0,0,0,0,
- 8,
- NULL, /* before pixel update callback */
- atamanot_update_row, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_NULL, /* VSYNC callback */
- NULL /* update address callback */
-};
-
-
WRITE8_MEMBER(ssingles_state::ssingles_videoram_w)
{
UINT8 *vram = memregion("vram")->base();
@@ -579,8 +546,10 @@ static MACHINE_CONFIG_START( ssingles, ssingles_state )
MCFG_GFXDECODE_ADD("gfxdecode", "palette", ssingles)
-
- MCFG_MC6845_ADD("crtc", MC6845, "screen", 1000000 /* ? MHz */, ssingles_mc6845_intf)
+ MCFG_MC6845_ADD("crtc", MC6845, "screen", 1000000 /* ? MHz */)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
+ MCFG_MC6845_UPDATE_ROW_CB(ssingles_state, ssingles_update_row)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
@@ -606,7 +575,10 @@ static MACHINE_CONFIG_DERIVED( atamanot, ssingles )
MCFG_DEVICE_REMOVE("crtc")
- MCFG_MC6845_ADD("crtc", MC6845, "screen", 1000000 /* ? MHz */, atamanot_mc6845_intf)
+ MCFG_MC6845_ADD("crtc", MC6845, "screen", 1000000 /* ? MHz */)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
+ MCFG_MC6845_UPDATE_ROW_CB(ssingles_state, atamanot_update_row)
MCFG_GFXDECODE_MODIFY("gfxdecode", atamanot)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/supercrd.c b/src/mame/drivers/supercrd.c
index d8e7b59f3da..a50ba81898c 100644
--- a/src/mame/drivers/supercrd.c
+++ b/src/mame/drivers/supercrd.c
@@ -404,26 +404,6 @@ static GFXDECODE_START( supercrd ) /* Adressing the first half of the palette *
GFXDECODE_END
-/************************
-* CRTC Interface *
-************************/
-
-//static MC6845_INTERFACE( mc6845_intf )
-//{
-// false,
-// 0,0,0,0, /* visarea adjustment */
-// 4, /* number of pixels per video memory address */
-// NULL, /* before pixel update callback */
-// NULL, /* row update callback */
-// NULL, /* after pixel update callback */
-// DEVCB_NULL, /* callback for display state changes */
-// DEVCB_NULL, /* callback for cursor state changes */
-// DEVCB_NULL, /* HSYNC callback */
-// DEVCB_NULL, /* VSYNC callback */
-// NULL /* update address callback */
-//};
-
-
/**************************
* Machine Drivers *
**************************/
@@ -454,7 +434,9 @@ static MACHINE_CONFIG_START( supercrd, supercrd_state )
MCFG_PALETTE_INIT_OWNER(supercrd_state, supercrd)
MCFG_VIDEO_START_OVERRIDE(supercrd_state, supercrd)
-// MCFG_MC6845_ADD("crtc", MC6845, "screen", MASTER_CLOCK/8, mc6845_intf)
+// MCFG_MC6845_ADD("crtc", MC6845, "screen", MASTER_CLOCK/8)
+// MCFG_MC6845_SHOW_BORDER_AREA(false)
+// MCFG_MC6845_CHAR_WIDTH(4)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mame/drivers/tapatune.c b/src/mame/drivers/tapatune.c
index 41e5c145aa9..26e91cd0c08 100644
--- a/src/mame/drivers/tapatune.c
+++ b/src/mame/drivers/tapatune.c
@@ -98,6 +98,9 @@ public:
DECLARE_WRITE8_MEMBER(bsmt_data_hi_w);
DECLARE_WRITE8_MEMBER(bsmt_reg_w);
DECLARE_READ8_MEMBER(special_r);
+
+ MC6845_BEGIN_UPDATE(crtc_begin_update);
+ MC6845_UPDATE_ROW(crtc_update_row);
};
@@ -140,50 +143,36 @@ void tapatune_state::machine_reset()
*
*************************************/
-const rgb_t* get_pens(tapatune_state *state)
+MC6845_BEGIN_UPDATE( tapatune_state::crtc_begin_update )
{
+ // Create the pens
for (UINT32 i = 0; i < 0x100; i++)
{
- int r = state->m_paletteram[3 * i + 0];
- int g = state->m_paletteram[3 * i + 1];
- int b = state->m_paletteram[3 * i + 2];
-
+ int r = m_paletteram[3 * i + 0];
+ int g = m_paletteram[3 * i + 1];
+ int b = m_paletteram[3 * i + 2];
+
r = pal6bit(r);
g = pal6bit(g);
b = pal6bit(b);
-
- state->m_pens[i] = rgb_t(r, g, b);
+
+ m_pens[i] = rgb_t(r, g, b);
}
-
- return state->m_pens;
-}
-
-
-static MC6845_BEGIN_UPDATE( begin_update )
-{
- tapatune_state *state = device->machine().driver_data<tapatune_state>();
-
- // Create the pens
- get_pens(state);
-
- return state->m_pens;
}
-static MC6845_UPDATE_ROW( update_row )
+MC6845_UPDATE_ROW( tapatune_state::crtc_update_row )
{
- tapatune_state *state = device->machine().driver_data<tapatune_state>();
UINT32 *dest = &bitmap.pix32(y);
- rgb_t *pens = (rgb_t *)param;
offs_t offs = (ma*2 + ra*0x40)*4;
- UINT8 *videoram = reinterpret_cast<UINT8 *>(state->m_videoram.target());
+ UINT8 *videoram = reinterpret_cast<UINT8 *>(m_videoram.target());
for (UINT32 x = 0; x < x_count*4; x++)
{
UINT8 pix = videoram[BYTE_XOR_BE(offs + x)];
- dest[2*x] = pens[((pix >> 4) & 0x0f)];
- dest[2*x + 1] = pens[(pix & 0x0f)];
+ dest[2*x] = m_pens[((pix >> 4) & 0x0f)];
+ dest[2*x + 1] = m_pens[(pix & 0x0f)];
}
}
@@ -507,28 +496,6 @@ INPUT_PORTS_END
/*************************************
*
- * 6845 interface
- *
- *************************************/
-
-static MC6845_INTERFACE( h46505_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 5, /* number of pixels per video memory address */
- begin_update,/* before pixel update callback */
- update_row, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_DRIVER_LINE_MEMBER(tapatune_state,crtc_vsync), /* VSYNC callback */
- NULL /* update address callback */
-};
-
-
-/*************************************
- *
* Machine driver
*
*************************************/
@@ -546,7 +513,14 @@ static MACHINE_CONFIG_START( tapatune, tapatune_state )
MCFG_QUANTUM_PERFECT_CPU("maincpu")
MCFG_NVRAM_ADD_0FILL("nvram")
- MCFG_MC6845_ADD("crtc", H46505, "screen", XTAL_24MHz / 16, h46505_intf)
+
+ MCFG_MC6845_ADD("crtc", H46505, "screen", XTAL_24MHz / 16)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(5)
+ MCFG_MC6845_BEGIN_UPDATE_CB(tapatune_state, crtc_begin_update)
+ MCFG_MC6845_UPDATE_ROW_CB(tapatune_state, crtc_update_row)
+ MCFG_MC6845_OUT_VSYNC_CB(WRITELINE(tapatune_state, crtc_vsync))
+
MCFG_TICKET_DISPENSER_ADD("ticket", attotime::from_msec(100), TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_LOW)
/* video hardware */
diff --git a/src/mame/drivers/tmspoker.c b/src/mame/drivers/tmspoker.c
index 885df998e85..4bfd4485867 100644
--- a/src/mame/drivers/tmspoker.c
+++ b/src/mame/drivers/tmspoker.c
@@ -545,25 +545,6 @@ static GFXDECODE_START( tmspoker )
GFXDECODE_END
-/***********************
-* CRTC Interface *
-************************/
-
-static MC6845_INTERFACE( mc6845_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of pixels per video memory address */
- NULL, /* before pixel update callback */
- NULL, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_NULL, /* VSYNC callback */
- NULL /* update address callback */
-};
-
/*************************
* Machine Drivers *
*************************/
@@ -588,7 +569,9 @@ static MACHINE_CONFIG_START( tmspoker, tmspoker_state )
MCFG_PALETTE_ADD("palette", 256)
MCFG_PALETTE_INIT_OWNER(tmspoker_state, tmspoker)
- MCFG_MC6845_ADD("crtc", MC6845, "screen", MASTER_CLOCK/4, mc6845_intf) /* guess */
+ MCFG_MC6845_ADD("crtc", MC6845, "screen", MASTER_CLOCK/4) /* guess */
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/truco.c b/src/mame/drivers/truco.c
index 774387e2930..f4db5d43691 100644
--- a/src/mame/drivers/truco.c
+++ b/src/mame/drivers/truco.c
@@ -406,26 +406,6 @@ INTERRUPT_GEN_MEMBER(truco_state::truco_interrupt)
/*******************************************
-* CRTC Interface *
-*******************************************/
-
-static MC6845_INTERFACE( mc6845_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 4, /* number of pixels per video memory address */
- NULL, /* before pixel update callback */
- NULL, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_NULL, /* VSYNC callback */
- NULL /* update address callback */
-};
-
-
-/*******************************************
* Machine Driver *
*******************************************/
@@ -458,7 +438,9 @@ static MACHINE_CONFIG_START( truco, truco_state )
MCFG_PALETTE_ADD("palette", 16)
MCFG_PALETTE_INIT_OWNER(truco_state, truco)
- MCFG_MC6845_ADD("crtc", MC6845, "screen", CRTC_CLOCK, mc6845_intf) /* Identified as UM6845 */
+ MCFG_MC6845_ADD("crtc", MC6845, "screen", CRTC_CLOCK) /* Identified as UM6845 */
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(4)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mame/drivers/twincobr.c b/src/mame/drivers/twincobr.c
index c2b7b66cb39..21c05b9af2d 100644
--- a/src/mame/drivers/twincobr.c
+++ b/src/mame/drivers/twincobr.c
@@ -677,7 +677,9 @@ static MACHINE_CONFIG_START( twincobr, twincobr_state )
MCFG_MACHINE_RESET_OVERRIDE(twincobr_state,twincobr)
/* video hardware */
- MCFG_MC6845_ADD("crtc", HD6845, "screen", XTAL_28MHz/8, twincobr_mc6845_intf) /* 3.5MHz measured on CLKin */
+ MCFG_MC6845_ADD("crtc", HD6845, "screen", XTAL_28MHz/8) /* 3.5MHz measured on CLKin */
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(2)
MCFG_TOAPLAN_SCU_ADD("scu", "palette", 31, 15)
diff --git a/src/mame/drivers/usgames.c b/src/mame/drivers/usgames.c
index 5352fe7eae5..264a5cce32d 100644
--- a/src/mame/drivers/usgames.c
+++ b/src/mame/drivers/usgames.c
@@ -212,22 +212,6 @@ static GFXDECODE_START( usgames )
GFXDECODE_END
-static MC6845_INTERFACE( mc6845_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of pixels per video memory address */
- NULL, /* before pixel update callback */
- NULL, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_NULL, /* VSYNC callback */
- NULL /* update address callback */
-};
-
-
static MACHINE_CONFIG_START( usg32, usgames_state )
/* basic machine hardware */
@@ -250,7 +234,9 @@ static MACHINE_CONFIG_START( usg32, usgames_state )
MCFG_PALETTE_ADD("palette", 2*256)
MCFG_PALETTE_INIT_OWNER(usgames_state, usgames)
- MCFG_MC6845_ADD("crtc", MC6845, "screen", XTAL_18MHz / 16, mc6845_intf)
+ MCFG_MC6845_ADD("crtc", MC6845, "screen", XTAL_18MHz / 16)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mame/drivers/vcombat.c b/src/mame/drivers/vcombat.c
index b1a82d5fa87..a156dc2715f 100644
--- a/src/mame/drivers/vcombat.c
+++ b/src/mame/drivers/vcombat.c
@@ -575,22 +575,6 @@ WRITE_LINE_MEMBER(vcombat_state::sound_update)
m_soundcpu->set_input_line(M68K_IRQ_1, state ? ASSERT_LINE : CLEAR_LINE);
}
-static MC6845_INTERFACE( mc6845_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 16, /* number of pixels per video memory address */
- NULL, /* before pixel update callback */
- NULL, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_DRIVER_LINE_MEMBER(vcombat_state,sound_update), /* HSYNC callback */
- DEVCB_NULL, /* VSYNC callback */
- NULL /* update address callback */
-};
-
-
static MACHINE_CONFIG_START( vcombat, vcombat_state )
MCFG_CPU_ADD("maincpu", M68000, XTAL_12MHz)
MCFG_CPU_PROGRAM_MAP(main_map)
@@ -621,7 +605,7 @@ static MACHINE_CONFIG_START( vcombat, vcombat_state )
MCFG_TLC34076_ADD("tlc34076", TLC34076_6_BIT)
/* Disabled for now as it can't handle multiple screens */
-// MCFG_MC6845_ADD("crtc", MC6845, "screen", 6000000 / 16, mc6845_intf)
+// MCFG_MC6845_ADD("crtc", MC6845, "screen", 6000000 / 16)
MCFG_DEFAULT_LAYOUT(layout_dualhsxs)
MCFG_SCREEN_ADD("screen", RASTER)
@@ -657,7 +641,10 @@ static MACHINE_CONFIG_START( shadfgtr, vcombat_state )
MCFG_TLC34076_ADD("tlc34076", TLC34076_6_BIT)
- MCFG_MC6845_ADD("crtc", MC6845, "screen", XTAL_20MHz / 4 / 16, mc6845_intf)
+ MCFG_MC6845_ADD("crtc", MC6845, "screen", XTAL_20MHz / 4 / 16)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(16)
+ MCFG_MC6845_OUT_HSYNC_CB(WRITELINE(vcombat_state, sound_update))
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_RAW_PARAMS(XTAL_20MHz / 4, 320, 0, 256, 277, 0, 224)
diff --git a/src/mame/drivers/vlc.c b/src/mame/drivers/vlc.c
index 5d678ca0d09..070f5c97dec 100644
--- a/src/mame/drivers/vlc.c
+++ b/src/mame/drivers/vlc.c
@@ -235,21 +235,6 @@ static const UINT8 pal35[256] = {
/******************** VIDEO SECTION ************************************/
/***************************************************************************/
-static MC6845_INTERFACE( mc6845_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of pixels per video memory address */
- NULL, /* before pixel update callback */
- NULL, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_NULL, /* VSYNC callback */
- NULL /* update address callback */
-};
-
static const gfx_layout charlayout =
{
/* Todo , just for sample */
@@ -627,7 +612,9 @@ static MACHINE_CONFIG_START( nevada, nevada_state )
MCFG_PALETTE_ADD("palette", 256)
MCFG_PALETTE_INIT_OWNER(nevada_state, nevada)
- MCFG_MC6845_ADD("crtc", MC6845, "screen", MC6845_CLOCK, mc6845_intf)
+ MCFG_MC6845_ADD("crtc", MC6845, "screen", MC6845_CLOCK)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
// sound hardware
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mame/drivers/wardner.c b/src/mame/drivers/wardner.c
index 2efed984aa5..4e681bf541d 100644
--- a/src/mame/drivers/wardner.c
+++ b/src/mame/drivers/wardner.c
@@ -394,7 +394,9 @@ static MACHINE_CONFIG_START( wardner, wardner_state )
MCFG_QUANTUM_TIME(attotime::from_hz(6000)) /* 100 CPU slices per frame */
/* video hardware */
- MCFG_MC6845_ADD("crtc", HD6845, "screen", XTAL_14MHz/4, twincobr_mc6845_intf) /* 3.5MHz measured on CLKin */
+ MCFG_MC6845_ADD("crtc", HD6845, "screen", XTAL_14MHz/4) /* 3.5MHz measured on CLKin */
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(2)
MCFG_TOAPLAN_SCU_ADD("scu", "palette", 32, 14)
diff --git a/src/mame/includes/qix.h b/src/mame/includes/qix.h
index 47aee496e10..c8779cc3834 100644
--- a/src/mame/includes/qix.h
+++ b/src/mame/includes/qix.h
@@ -136,6 +136,8 @@ public:
DECLARE_WRITE8_MEMBER(slither_coinctl_w);
DECLARE_WRITE_LINE_MEMBER(qix_pia_dint);
DECLARE_WRITE_LINE_MEMBER(qix_pia_sint);
+ MC6845_BEGIN_UPDATE(crtc_begin_update);
+ MC6845_UPDATE_ROW(crtc_update_row);
void set_pen(int offs);
int kram3_permut1(int idx, int value);
int kram3_permut2(int tbl_index, int idx, const UINT8 *xor_table);
diff --git a/src/mame/includes/spiders.h b/src/mame/includes/spiders.h
index 26636daad07..592fcec4b84 100644
--- a/src/mame/includes/spiders.h
+++ b/src/mame/includes/spiders.h
@@ -4,6 +4,7 @@
***************************************************************************/
#include "sound/discrete.h"
+#include "video/mc6845.h"
#define NUM_PENS (8)
@@ -39,6 +40,8 @@ public:
DECLARE_WRITE8_MEMBER(spiders_audio_a_w);
DECLARE_WRITE8_MEMBER(spiders_audio_b_w);
DECLARE_WRITE8_MEMBER(spiders_audio_ctrl_w);
+ MC6845_BEGIN_UPDATE(crtc_begin_update);
+ MC6845_UPDATE_ROW(crtc_update_row);
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
};
diff --git a/src/mame/includes/twincobr.h b/src/mame/includes/twincobr.h
index 4e76b54d907..085612aaca2 100644
--- a/src/mame/includes/twincobr.h
+++ b/src/mame/includes/twincobr.h
@@ -128,5 +128,3 @@ public:
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
};
-
-extern const mc6845_interface twincobr_mc6845_intf;
diff --git a/src/mame/video/decodmd2.c b/src/mame/video/decodmd2.c
index ca2ba7a20de..b10eaf52229 100644
--- a/src/mame/video/decodmd2.c
+++ b/src/mame/video/decodmd2.c
@@ -97,39 +97,23 @@ TIMER_DEVICE_CALLBACK_MEMBER(decodmd_type2_device::dmd_firq)
m_cpu->set_input_line(M6809_FIRQ_LINE, HOLD_LINE);
}
-MC6845_UPDATE_ROW( dmd_update_row )
+MC6845_UPDATE_ROW( decodmd_type2_device::crtc_update_row )
{
- decodmd_type2_device *state = downcast<decodmd_type2_device *>(device->owner());
- UINT8* RAM = state->m_ram->pointer();
- UINT8 x,dot,intensity;
+ UINT8 *RAM = m_ram->pointer();
+ UINT8 intensity;
UINT16 addr = (ma & 0xfc00) + ((ma & 0x100)<<2) + (ra << 4);
- for(x=0;x<128;x+=8)
+ for (int x = 0; x < 128; x += 8)
{
- for(dot=0;dot<8;dot++)
+ for (int dot = 0; dot < 8; dot++)
{
- intensity = ((RAM[addr] >> (7-dot) & 0x01) << 1) | (RAM[addr+0x200] >> (7-dot) & 0x01);
- bitmap.pix32(y,x+dot) = rgb_t(0x3f*intensity,0x2a*intensity,0x00);
+ intensity = ((RAM[addr] >> (7-dot) & 0x01) << 1) | (RAM[addr + 0x200] >> (7-dot) & 0x01);
+ bitmap.pix32(y, x + dot) = rgb_t(0x3f * intensity, 0x2a * intensity, 0x00);
}
addr++;
}
}
-MC6845_INTERFACE( decodmd2_6845_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of pixels per video memory address */
- NULL, /* begin_update */
- dmd_update_row, /* update_row */
- NULL, /* end_update */
- DEVCB_NULL, /* on_de_changed */
- DEVCB_NULL, /* on_cur_changed */
- DEVCB_NULL, /* on_hsync_changed */
- DEVCB_NULL, /* on_vsync_changed */
- NULL
-};
-
static ADDRESS_MAP_START( decodmd2_map, AS_PROGRAM, 8, decodmd_type2_device )
AM_RANGE(0x0000, 0x2fff) AM_RAMBANK("dmdram")
AM_RANGE(0x3000, 0x3000) AM_READWRITE(crtc_status_r,crtc_address_w)
@@ -149,7 +133,10 @@ static MACHINE_CONFIG_FRAGMENT( decodmd2 )
MCFG_TIMER_DRIVER_ADD_PERIODIC("firq_timer",decodmd_type2_device,dmd_firq,attotime::from_hz(80))
- MCFG_MC6845_ADD("dmd6845",MC6845,NULL,XTAL_8MHz / 8,decodmd2_6845_intf) // TODO: confirm clock speed
+ MCFG_MC6845_ADD("dmd6845", MC6845, NULL, XTAL_8MHz / 8) // TODO: confirm clock speed
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
+ MCFG_MC6845_UPDATE_ROW_CB(decodmd_type2_device, crtc_update_row)
MCFG_DEFAULT_LAYOUT(layout_lcd)
diff --git a/src/mame/video/decodmd2.h b/src/mame/video/decodmd2.h
index 57c96888c31..9855fa3041d 100644
--- a/src/mame/video/decodmd2.h
+++ b/src/mame/video/decodmd2.h
@@ -42,6 +42,7 @@ public:
DECLARE_READ8_MEMBER(status_r);
DECLARE_WRITE8_MEMBER(status_w);
TIMER_DEVICE_CALLBACK_MEMBER(dmd_firq);
+ MC6845_UPDATE_ROW(crtc_update_row);
static void static_set_gfxregion(device_t &device, const char *tag);
diff --git a/src/mame/video/decodmd3.c b/src/mame/video/decodmd3.c
index e02ad9f4939..b4133ae8da3 100644
--- a/src/mame/video/decodmd3.c
+++ b/src/mame/video/decodmd3.c
@@ -95,45 +95,29 @@ WRITE16_MEMBER( decodmd_type3_device::crtc_register_w )
}
}
-MC6845_UPDATE_ROW( dmd64_update_row )
+MC6845_UPDATE_ROW( decodmd_type3_device::crtc_update_row )
{
- decodmd_type3_device *state = downcast<decodmd_type3_device *>(device->owner());
- UINT8* RAM = state->m_ram->pointer();
- UINT8 x,dot,intensity;
+ UINT8 *RAM = m_ram->pointer();
+ UINT8 intensity;
UINT16 addr = ((ma & 0x7ff) << 2) | ((ra & 0x02) << 12);
addr += ((ra & 0x01) * 24);
- for(x=0;x<192;x+=16)
+ for (int x = 0; x < 192; x += 16)
{
- for(dot=0;dot<8;dot++)
+ for (int dot = 0; dot < 8; dot++)
{
- intensity = ((RAM[addr+1] >> (7-dot) & 0x01) << 1) | (RAM[addr+0x801] >> (7-dot) & 0x01);
- bitmap.pix32(y,x+dot) = rgb_t(0x3f*intensity,0x2a*intensity,0x00);
+ intensity = ((RAM[addr + 1] >> (7-dot) & 0x01) << 1) | (RAM[addr + 0x801] >> (7-dot) & 0x01);
+ bitmap.pix32(y, x + dot) = rgb_t(0x3f * intensity, 0x2a * intensity, 0x00);
}
- for(dot=8;dot<16;dot++)
+ for (int dot = 8; dot < 16; dot++)
{
- intensity = ((RAM[addr] >> (15-dot) & 0x01) << 1) | (RAM[addr+0x800] >> (15-dot) & 0x01);
- bitmap.pix32(y,x+dot) = rgb_t(0x3f*intensity,0x2a*intensity,0x00);
+ intensity = ((RAM[addr] >> (15-dot) & 0x01) << 1) | (RAM[addr + 0x800] >> (15-dot) & 0x01);
+ bitmap.pix32(y, x + dot) = rgb_t(0x3f * intensity, 0x2a * intensity, 0x00);
}
- addr+=2;
+ addr += 2;
}
}
-MC6845_INTERFACE( decodmd3_6845_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 16, /* number of pixels per video memory address */
- NULL, /* begin_update */
- dmd64_update_row, /* update_row */
- NULL, /* end_update */
- DEVCB_NULL, /* on_de_changed */
- DEVCB_NULL, /* on_cur_changed */
- DEVCB_NULL, /* on_hsync_changed */
- DEVCB_NULL, /* on_vsync_changed */
- NULL
-};
-
static ADDRESS_MAP_START( decodmd3_map, AS_PROGRAM, 16, decodmd_type3_device )
AM_RANGE(0x00000000, 0x000fffff) AM_ROMBANK("dmdrom")
AM_RANGE(0x00800000, 0x0080ffff) AM_RAMBANK("dmdram")
@@ -151,7 +135,10 @@ static MACHINE_CONFIG_FRAGMENT( decodmd3 )
MCFG_TIMER_DRIVER_ADD_PERIODIC("irq_timer",decodmd_type3_device,dmd_irq,attotime::from_hz(150))
- MCFG_MC6845_ADD("dmd6845",MC6845,NULL,XTAL_12MHz / 4,decodmd3_6845_intf) // TODO: confirm clock speed
+ MCFG_MC6845_ADD("dmd6845", MC6845, NULL, XTAL_12MHz / 4) // TODO: confirm clock speed
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(16)
+ MCFG_MC6845_UPDATE_ROW_CB(decodmd_type3_device, crtc_update_row)
MCFG_DEFAULT_LAYOUT(layout_lcd)
@@ -163,7 +150,6 @@ static MACHINE_CONFIG_FRAGMENT( decodmd3 )
MCFG_RAM_ADD(RAM_TAG)
MCFG_RAM_DEFAULT_SIZE("64K")
-
MACHINE_CONFIG_END
machine_config_constructor decodmd_type3_device::device_mconfig_additions() const
diff --git a/src/mame/video/decodmd3.h b/src/mame/video/decodmd3.h
index 9cbb1cdf4e5..e2085c2a2ab 100644
--- a/src/mame/video/decodmd3.h
+++ b/src/mame/video/decodmd3.h
@@ -34,6 +34,7 @@ public:
DECLARE_WRITE16_MEMBER(crtc_register_w);
DECLARE_READ16_MEMBER(crtc_status_r);
TIMER_DEVICE_CALLBACK_MEMBER(dmd_irq);
+ MC6845_UPDATE_ROW(crtc_update_row);
static void static_set_gfxregion(device_t &device, const char *tag);
diff --git a/src/mame/video/madalien.c b/src/mame/video/madalien.c
index a21008ba65b..05e8d6245f3 100644
--- a/src/mame/video/madalien.c
+++ b/src/mame/video/madalien.c
@@ -365,22 +365,6 @@ static GFXDECODE_START( madalien )
GFXDECODE_END
-static MC6845_INTERFACE( mc6845_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of pixels per video memory address */
- NULL, /* before pixel update callback */
- NULL, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_NULL, /* VSYNC callback */
- NULL /* update address callback */
-};
-
-
MACHINE_CONFIG_FRAGMENT( madalien_video )
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_RAW_PARAMS(PIXEL_CLOCK, 336, 0, 256, 288, 0, 256)
@@ -393,5 +377,7 @@ MACHINE_CONFIG_FRAGMENT( madalien_video )
MCFG_PALETTE_INIT_OWNER(madalien_state,madalien)
MCFG_VIDEO_START_OVERRIDE(madalien_state,madalien)
- MCFG_MC6845_ADD("crtc", MC6845, "screen", PIXEL_CLOCK / 8, mc6845_intf)
+ MCFG_MC6845_ADD("crtc", MC6845, "screen", PIXEL_CLOCK / 8)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
MACHINE_CONFIG_END
diff --git a/src/mame/video/qix.c b/src/mame/video/qix.c
index 9e53365b73e..88cb3a109ab 100644
--- a/src/mame/video/qix.c
+++ b/src/mame/video/qix.c
@@ -12,19 +12,6 @@
#include "cpu/m6809/m6809.h"
-
-/*************************************
- *
- * Static function prototypes
- *
- *************************************/
-
-static MC6845_BEGIN_UPDATE( begin_update );
-static MC6845_UPDATE_ROW( update_row );
-
-
-
-
/*************************************
*
* Start
@@ -272,37 +259,29 @@ void qix_state::set_pen(int offs)
*
*************************************/
-static MC6845_BEGIN_UPDATE( begin_update )
+MC6845_BEGIN_UPDATE( qix_state::crtc_begin_update )
{
- qix_state *state = device->machine().driver_data<qix_state>();
-
#if 0
// note the confusing bit order!
popmessage("self test leds: %d%d %d%d%d%d",BIT(leds,7),BIT(leds,5),BIT(leds,6),BIT(leds,4),BIT(leds,2),BIT(leds,3));
#endif
-
- return &(state->m_pens)[state->m_palette_bank << 8];
}
-static MC6845_UPDATE_ROW( update_row )
+MC6845_UPDATE_ROW( qix_state::crtc_update_row )
{
- qix_state *state = device->machine().driver_data<qix_state>();
UINT32 *dest = &bitmap.pix32(y);
- UINT16 x;
-
- pen_t *pens = (pen_t *)param;
+ pen_t *pens = &m_pens[m_palette_bank << 8];
/* the memory is hooked up to the MA, RA lines this way */
offs_t offs = ((ma << 6) & 0xf800) | ((ra << 8) & 0x0700);
- offs_t offs_xor = state->m_flip ? 0xffff : 0;
+ offs_t offs_xor = m_flip ? 0xffff : 0;
- for (x = 0; x < x_count * 8; x++)
- dest[x] = pens[state->m_videoram[(offs + x) ^ offs_xor]];
+ for (UINT16 x = 0; x < x_count * 8; x++)
+ dest[x] = pens[m_videoram[(offs + x) ^ offs_xor]];
}
-
/*************************************
*
* Memory handlers
@@ -387,29 +366,19 @@ ADDRESS_MAP_END
*
*************************************/
-static MC6845_INTERFACE( mc6845_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of pixels per video memory address */
- begin_update, /* before pixel update callback */
- update_row, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_DRIVER_LINE_MEMBER(qix_state,display_enable_changed), /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_DRIVER_LINE_MEMBER(qix_state,qix_vsync_changed), /* VSYNC callback */
- NULL /* update address callback */
-};
-
-
MACHINE_CONFIG_FRAGMENT( qix_video )
MCFG_CPU_ADD("videocpu", M6809, MAIN_CLOCK_OSC/4/4) /* 1.25 MHz */
MCFG_CPU_PROGRAM_MAP(qix_video_map)
MCFG_VIDEO_START_OVERRIDE(qix_state,qix)
- MCFG_MC6845_ADD("vid_u18", MC6845, "screen", QIX_CHARACTER_CLOCK, mc6845_intf)
+ MCFG_MC6845_ADD("vid_u18", MC6845, "screen", QIX_CHARACTER_CLOCK)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
+ MCFG_MC6845_BEGIN_UPDATE_CB(qix_state, crtc_begin_update)
+ MCFG_MC6845_UPDATE_ROW_CB(qix_state, crtc_update_row)
+ MCFG_MC6845_OUT_DE_CB(WRITELINE(qix_state, display_enable_changed))
+ MCFG_MC6845_OUT_VSYNC_CB(WRITELINE(qix_state, qix_vsync_changed))
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_RAW_PARAMS(QIX_CHARACTER_CLOCK*8, 0x148, 0, 0x100, 0x111, 0, 0x100) /* from CRTC */
diff --git a/src/mame/video/twincobr.c b/src/mame/video/twincobr.c
index 6999a0d7dbc..fa34c615f1c 100644
--- a/src/mame/video/twincobr.c
+++ b/src/mame/video/twincobr.c
@@ -16,25 +16,6 @@
#include "video/mc6845.h"
#include "includes/twincobr.h"
-
-/* 6845 used for video sync signals only */
-MC6845_INTERFACE( twincobr_mc6845_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 2, /* number of pixels per video memory address */ /* Horizontal Display programmed to 160 characters */
- NULL, /* before pixel update callback */
- NULL, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_NULL, /* VSYNC callback */
- NULL /* update address callback */
-};
-
-
-
/***************************************************************************
Callbacks for the TileMap code
***************************************************************************/
diff --git a/src/mess/drivers/a6809.c b/src/mess/drivers/a6809.c
index 55ac980a4e9..ca594096cb4 100644
--- a/src/mess/drivers/a6809.c
+++ b/src/mess/drivers/a6809.c
@@ -126,25 +126,6 @@ MACHINE_RESET_MEMBER( a6809_state, a6809)
m_via->write_pb7(0);
}
-static MC6845_UPDATE_ROW( a6809_update_row )
-{
-}
-
-static MC6845_INTERFACE( a6809_crtc6845_interface )
-{
- false,
- 0,0,0,0,
- 12,
- NULL,
- a6809_update_row,
- NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- NULL
-};
-
READ8_MEMBER( a6809_state::videoram_r )
{
offset += m_start_address;
@@ -266,7 +247,9 @@ static MACHINE_CONFIG_START( a6809, a6809_state )
MCFG_VIA6522_CB2_HANDLER(WRITELINE(a6809_state, cass_w))
MCFG_VIA6522_IRQ_HANDLER(DEVWRITELINE("maincpu", m6809e_device, irq_line))
- MCFG_MC6845_ADD("mc6845", MC6845, "screen", XTAL_4MHz / 2, a6809_crtc6845_interface)
+ MCFG_MC6845_ADD("mc6845", MC6845, "screen", XTAL_4MHz / 2)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(12)
MCFG_DEVICE_ADD("saa5050", SAA5050, 6000000)
MCFG_SAA5050_D_CALLBACK(READ8(a6809_state, videoram_r))
diff --git a/src/mess/drivers/alphatro.c b/src/mess/drivers/alphatro.c
index f167875ca75..626632b52f1 100644
--- a/src/mess/drivers/alphatro.c
+++ b/src/mess/drivers/alphatro.c
@@ -77,6 +77,7 @@ public:
DECLARE_PALETTE_INIT(alphatro);
TIMER_DEVICE_CALLBACK_MEMBER(timer_c);
TIMER_DEVICE_CALLBACK_MEMBER(timer_p);
+ MC6845_UPDATE_ROW(crtc_update_row);
required_shared_ptr<UINT8> m_p_videoram;
UINT8 *m_p_chargen;
UINT8 m_flashcnt;
@@ -154,12 +155,11 @@ void alphatro_state::video_start()
m_p_chargen = memregion("chargen")->base();
}
-static MC6845_UPDATE_ROW( alphatro_update_row )
+MC6845_UPDATE_ROW( alphatro_state::crtc_update_row )
{
- alphatro_state *state = device->machine().driver_data<alphatro_state>();
- const rgb_t *pens = state->m_palette->palette()->entry_list_raw();
- bool palette = BIT(state->ioport("CONFIG")->read(), 5);
- if (y==0) state->m_flashcnt++;
+ const rgb_t *pens = m_palette->palette()->entry_list_raw();
+ bool palette = BIT(ioport("CONFIG")->read(), 5);
+ if (y==0) m_flashcnt++;
bool inv;
UINT8 chr,gfx,attr,bg,fg;
UINT16 mem,x;
@@ -169,8 +169,8 @@ static MC6845_UPDATE_ROW( alphatro_update_row )
{
inv = (x == cursor_x);
mem = (ma + x) & 0x7ff;
- chr = state->m_p_videoram[mem];
- attr = state->m_p_videoram[mem | 0x800];
+ chr = m_p_videoram[mem];
+ attr = m_p_videoram[mem | 0x800];
fg = (palette) ? 8 : attr & 7; // amber or RGB
bg = (palette) ? 0 : (attr & 0x38) >> 3;
@@ -180,13 +180,13 @@ static MC6845_UPDATE_ROW( alphatro_update_row )
chr &= 0x7f;
}
- if (BIT(attr, 6) & BIT(state->m_flashcnt, 4)) // flashing
+ if (BIT(attr, 6) & BIT(m_flashcnt, 4)) // flashing
{
inv ^= 1;
}
/* get pattern of pixels for that character scanline */
- gfx = state->m_p_chargen[(chr<<4) | ra];
+ gfx = m_p_chargen[(chr<<4) | ra];
if (inv)
{
@@ -414,21 +414,6 @@ PALETTE_INIT_MEMBER(alphatro_state, alphatro)
}
-static MC6845_INTERFACE( alphatro_crtc6845_interface )
-{
- false,
- 0,0,0,0,
- 8,
- NULL,
- alphatro_update_row,
- NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- NULL
-};
-
TIMER_DEVICE_CALLBACK_MEMBER(alphatro_state::timer_c)
{
m_cass_data[3]++;
@@ -494,7 +479,10 @@ static MACHINE_CONFIG_START( alphatro, alphatro_state )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
/* Devices */
- MCFG_MC6845_ADD("crtc", MC6845, "screen", XTAL_12_288MHz / 8, alphatro_crtc6845_interface) // clk unknown
+ MCFG_MC6845_ADD("crtc", MC6845, "screen", XTAL_12_288MHz / 8) // clk unknown
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
+ MCFG_MC6845_UPDATE_ROW_CB(alphatro_state, crtc_update_row)
MCFG_DEVICE_ADD("usart", I8251, 0)
MCFG_I8251_TXD_HANDLER(WRITELINE(alphatro_state, txdata_callback))
diff --git a/src/mess/drivers/amstrad.c b/src/mess/drivers/amstrad.c
index 41d37f4fac9..2bb009279f4 100644
--- a/src/mess/drivers/amstrad.c
+++ b/src/mess/drivers/amstrad.c
@@ -875,7 +875,12 @@ static MACHINE_CONFIG_START( amstrad_nofdc, amstrad_state )
MCFG_PALETTE_ADD("palette", 32)
MCFG_PALETTE_INIT_OWNER(amstrad_state,amstrad_cpc)
- MCFG_MC6845_ADD( "mc6845", MC6845, NULL, XTAL_16MHz / 16, amstrad_mc6845_intf )
+ MCFG_MC6845_ADD("mc6845", MC6845, NULL, XTAL_16MHz / 16)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(16)
+ MCFG_MC6845_OUT_DE_CB(WRITELINE(amstrad_state, amstrad_de_changed))
+ MCFG_MC6845_OUT_HSYNC_CB(WRITELINE(amstrad_state, amstrad_hsync_changed))
+ MCFG_MC6845_OUT_VSYNC_CB(WRITELINE(amstrad_state, amstrad_vsync_changed))
MCFG_VIDEO_START_OVERRIDE(amstrad_state,amstrad)
@@ -961,7 +966,12 @@ static MACHINE_CONFIG_START( cpcplus, amstrad_state )
MCFG_PALETTE_ADD("palette", 4096)
MCFG_PALETTE_INIT_OWNER(amstrad_state,amstrad_plus)
- MCFG_MC6845_ADD( "mc6845", MC6845, NULL, XTAL_40MHz / 40, amstrad_plus_mc6845_intf )
+ MCFG_MC6845_ADD("mc6845", MC6845, NULL, XTAL_40MHz / 40)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(16)
+ MCFG_MC6845_OUT_DE_CB(WRITELINE(amstrad_state, amstrad_plus_de_changed))
+ MCFG_MC6845_OUT_HSYNC_CB(WRITELINE(amstrad_state, amstrad_plus_hsync_changed))
+ MCFG_MC6845_OUT_VSYNC_CB(WRITELINE(amstrad_state, amstrad_plus_vsync_changed))
MCFG_VIDEO_START_OVERRIDE(amstrad_state,amstrad)
@@ -1031,7 +1041,12 @@ static MACHINE_CONFIG_START( gx4000, amstrad_state )
MCFG_PALETTE_ADD("palette", 4096)
MCFG_PALETTE_INIT_OWNER(amstrad_state,amstrad_plus)
- MCFG_MC6845_ADD( "mc6845", MC6845, NULL, XTAL_40MHz / 40, amstrad_plus_mc6845_intf )
+ MCFG_MC6845_ADD("mc6845", MC6845, NULL, XTAL_40MHz / 40)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(16)
+ MCFG_MC6845_OUT_DE_CB(WRITELINE(amstrad_state, amstrad_plus_de_changed))
+ MCFG_MC6845_OUT_HSYNC_CB(WRITELINE(amstrad_state, amstrad_plus_hsync_changed))
+ MCFG_MC6845_OUT_VSYNC_CB(WRITELINE(amstrad_state, amstrad_plus_vsync_changed))
MCFG_VIDEO_START_OVERRIDE(amstrad_state,amstrad)
diff --git a/src/mess/drivers/amust.c b/src/mess/drivers/amust.c
index 3be6c0502df..7df7a17ac73 100644
--- a/src/mess/drivers/amust.c
+++ b/src/mess/drivers/amust.c
@@ -125,6 +125,7 @@ public:
DECLARE_WRITE8_MEMBER(port0d_w);
DECLARE_WRITE8_MEMBER(kbd_put);
INTERRUPT_GEN_MEMBER(irq_vs);
+ MC6845_UPDATE_ROW(crtc_update_row);
UINT8 *m_p_videoram;
const UINT8 *m_p_chargen;
required_device<palette_device> m_palette;
@@ -320,10 +321,9 @@ static GFXDECODE_START( amust )
GFXDECODE_ENTRY( "chargen", 0x0000, amust_charlayout, 0, 1 )
GFXDECODE_END
-MC6845_UPDATE_ROW( amust_update_row )
+MC6845_UPDATE_ROW( amust_state::crtc_update_row )
{
- amust_state *state = device->machine().driver_data<amust_state>();
- const rgb_t *palette = state->m_palette->palette()->entry_list_raw();
+ const rgb_t *palette = m_palette->palette()->entry_list_raw();
UINT8 chr,gfx,inv;
UINT16 mem,x;
UINT32 *p = &bitmap.pix32(y);
@@ -332,9 +332,9 @@ MC6845_UPDATE_ROW( amust_update_row )
{
inv = (x == cursor_x) ? 0xff : 0;
mem = (ma + x) & 0x7ff;
- chr = state->m_p_videoram[mem];
+ chr = m_p_videoram[mem];
if (ra < 8)
- gfx = state->m_p_chargen[(chr<<3) | ra] ^ inv;
+ gfx = m_p_chargen[(chr<<3) | ra] ^ inv;
else
gfx = inv;
@@ -350,21 +350,6 @@ MC6845_UPDATE_ROW( amust_update_row )
}
}
-static MC6845_INTERFACE( amust_crtc )
-{
- false,
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of dots per character */
- NULL,
- amust_update_row, /* handler to display a scanline */
- NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- NULL
-};
-
MACHINE_RESET_MEMBER( amust_state, amust )
{
m_p_chargen = memregion("chargen")->base();
@@ -415,7 +400,11 @@ static MACHINE_CONFIG_START( amust, amust_state )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
/* Devices */
- MCFG_MC6845_ADD("crtc", H46505, "screen", XTAL_14_31818MHz / 8, amust_crtc)
+ MCFG_MC6845_ADD("crtc", H46505, "screen", XTAL_14_31818MHz / 8)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
+ MCFG_MC6845_UPDATE_ROW_CB(amust_state, crtc_update_row)
+
MCFG_DEVICE_ADD("keybd", GENERIC_KEYBOARD, 0)
MCFG_GENERIC_KEYBOARD_CB(WRITE8(amust_state, kbd_put))
MCFG_UPD765A_ADD("fdc", false, true)
diff --git a/src/mess/drivers/applix.c b/src/mess/drivers/applix.c
index 6cea23d6ac3..0af94b4d305 100644
--- a/src/mess/drivers/applix.c
+++ b/src/mess/drivers/applix.c
@@ -132,6 +132,7 @@ public:
DECLARE_WRITE8_MEMBER( p3_write );
TIMER_DEVICE_CALLBACK_MEMBER(cass_timer);
DECLARE_DRIVER_INIT(applix);
+ MC6845_UPDATE_ROW(crtc_update_row);
UINT8 m_video_latch;
UINT8 m_pa;
virtual void machine_reset();
@@ -771,28 +772,27 @@ void applix_state::video_start()
{
}
-static MC6845_UPDATE_ROW( applix_update_row )
+MC6845_UPDATE_ROW( applix_state::crtc_update_row )
{
// The display is bitmapped. 2 modes are supported here, 320x200x16 and 640x200x4.
// Need to display a border colour.
// There is a monochrome mode, but no info found as yet.
- applix_state *state = device->machine().driver_data<applix_state>();
- const rgb_t *palette = state->m_palette->palette()->entry_list_raw();
+ const rgb_t *palette = m_palette->palette()->entry_list_raw();
UINT8 i;
UINT16 chr,x;
- UINT32 mem, vidbase = (state->m_video_latch & 15) << 14, *p = &bitmap.pix32(y);
+ UINT32 mem, vidbase = (m_video_latch & 15) << 14, *p = &bitmap.pix32(y);
for (x = 0; x < x_count; x++)
{
mem = vidbase + ma + x + (ra<<12);
- chr = state->m_base[mem];
+ chr = m_base[mem];
- if (BIT(state->m_pa, 3))
+ if (BIT(m_pa, 3))
// 640 x 200 x 4of16 mode
{
for (i = 0; i < 8; i++)
{
- *p++ = palette[state->m_palette_latch[chr>>14]];
+ *p++ = palette[m_palette_latch[chr>>14]];
chr <<= 2;
}
}
@@ -809,21 +809,6 @@ static MC6845_UPDATE_ROW( applix_update_row )
}
}
-static MC6845_INTERFACE( applix_crtc )
-{
- false, // should show a border
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of dots per character */
- NULL,
- applix_update_row, /* handler to display a scanline */
- NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_DRIVER_LINE_MEMBER(applix_state, vsync_w),
- NULL
-};
-
WRITE_LINE_MEMBER( applix_state::vsync_w )
{
m_via->write_ca2(state);
@@ -886,7 +871,12 @@ static MACHINE_CONFIG_START( applix, applix_state )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.50)
/* Devices */
- MCFG_MC6845_ADD("crtc", MC6845, "screen", 1875000, applix_crtc) // 6545
+ MCFG_MC6845_ADD("crtc", MC6845, "screen", 1875000) // 6545
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
+ MCFG_MC6845_UPDATE_ROW_CB(applix_state, crtc_update_row)
+ MCFG_MC6845_OUT_VSYNC_CB(WRITELINE(applix_state, vsync_w))
+
MCFG_DEVICE_ADD("via6522", VIA6522, 0)
MCFG_VIA6522_READPB_HANDLER(READ8(applix_state, applix_pb_r))
// in CB1 kbd clk
diff --git a/src/mess/drivers/apricot.c b/src/mess/drivers/apricot.c
index ab14bc15438..4d3521d11db 100644
--- a/src/mess/drivers/apricot.c
+++ b/src/mess/drivers/apricot.c
@@ -92,6 +92,8 @@ public:
DECLARE_WRITE_LINE_MEMBER( data_selector_dtr_w ) { m_data_selector_dtr = state; };
DECLARE_WRITE_LINE_MEMBER( data_selector_rts_w ) { m_data_selector_rts = state; };
+ MC6845_UPDATE_ROW( crtc_update_row );
+
virtual void machine_start();
int m_data_selector_dtr;
@@ -224,19 +226,18 @@ UINT32 apricot_state::screen_update_apricot(screen_device &screen, bitmap_rgb32
return 0;
}
-static MC6845_UPDATE_ROW( apricot_update_row )
+MC6845_UPDATE_ROW( apricot_state::crtc_update_row )
{
- apricot_state *state = device->machine().driver_data<apricot_state>();
- UINT8 *ram = state->m_ram->pointer();
- const pen_t *pen = state->m_palette->pens();
+ UINT8 *ram = m_ram->pointer();
+ const pen_t *pen = m_palette->pens();
int i, x;
- if (state->m_video_mode)
+ if (m_video_mode)
{
// text mode
for (i = 0; i < x_count; i++)
{
- UINT16 code = state->m_screen_buffer[(ma + i) & 0x7ff];
+ UINT16 code = m_screen_buffer[(ma + i) & 0x7ff];
UINT16 offset = ((code & 0x7ff) << 5) | (ra << 1);
UINT16 data = ram[offset + 1] << 8 | ram[offset];
int fill = 0;
@@ -260,22 +261,6 @@ static MC6845_UPDATE_ROW( apricot_update_row )
}
}
-static MC6845_INTERFACE( apricot_mc6845_intf )
-{
- false,
- 0,0,0,0,
- 10,
- NULL,
- apricot_update_row,
- NULL,
- DEVCB_DRIVER_LINE_MEMBER(apricot_state, apricot_mc6845_de),
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- NULL
-};
-
-
//**************************************************************************
// MACHINE EMULATION
//**************************************************************************
@@ -346,7 +331,11 @@ static MACHINE_CONFIG_START( apricot, apricot_state )
MCFG_PALETTE_ADD_MONOCHROME_GREEN_HIGHLIGHT("palette")
- MCFG_MC6845_ADD("ic30", MC6845, "screen", XTAL_15MHz / 10, apricot_mc6845_intf)
+ MCFG_MC6845_ADD("ic30", MC6845, "screen", XTAL_15MHz / 10)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(10)
+ MCFG_MC6845_UPDATE_ROW_CB(apricot_state, crtc_update_row)
+ MCFG_MC6845_OUT_DE_CB(WRITELINE(apricot_state, apricot_mc6845_de))
// sound hardware
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/apricotp.c b/src/mess/drivers/apricotp.c
index 5987e571f55..488b9986191 100644
--- a/src/mess/drivers/apricotp.c
+++ b/src/mess/drivers/apricotp.c
@@ -50,31 +50,6 @@ enum
// VIDEO
//**************************************************************************
-//-------------------------------------------------
-// mc6845_interface crtc_intf
-//-------------------------------------------------
-
-static MC6845_UPDATE_ROW( fp_update_row )
-{
-}
-
-
-static MC6845_INTERFACE( crtc_intf )
-{
- false,
- 0,0,0,0,
- 8,
- NULL,
- fp_update_row,
- NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- NULL
-};
-
-
void fp_state::video_start()
{
// allocate memory
@@ -529,7 +504,10 @@ static MACHINE_CONFIG_START( fp, fp_state )
MCFG_PALETTE_ADD("palette", 16)
MCFG_GFXDECODE_ADD("gfxdecode", "palette", act_f1)
- MCFG_MC6845_ADD(MC6845_TAG, MC6845, SCREEN_CRT_TAG, 4000000, crtc_intf)
+
+ MCFG_MC6845_ADD(MC6845_TAG, MC6845, SCREEN_CRT_TAG, 4000000)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
// sound hardware
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/b16.c b/src/mess/drivers/b16.c
index 3f725d39271..c6acf3922a6 100644
--- a/src/mess/drivers/b16.c
+++ b/src/mess/drivers/b16.c
@@ -255,22 +255,6 @@ void b16_state::machine_reset()
}
-
-static MC6845_INTERFACE( mc6845_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of pixels per video memory address */
- NULL, /* before pixel update callback */
- NULL, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_NULL, /* VSYNC callback */
- NULL /* update address callback */
-};
-
READ8_MEMBER(b16_state::memory_read_byte)
{
address_space& prog_space = m_maincpu->space(AS_PROGRAM);
@@ -300,7 +284,10 @@ static MACHINE_CONFIG_START( b16, b16_state )
MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 400-1)
MCFG_SCREEN_PALETTE("palette")
- MCFG_MC6845_ADD("crtc", H46505, "screen", XTAL_14_31818MHz/5, mc6845_intf) /* unknown clock, hand tuned to get ~60 fps */
+ MCFG_MC6845_ADD("crtc", H46505, "screen", XTAL_14_31818MHz/5) /* unknown clock, hand tuned to get ~60 fps */
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
+
MCFG_DEVICE_ADD("8237dma", AM9517A, XTAL_14_31818MHz/2)
MCFG_I8237_IN_MEMR_CB(READ8(b16_state, memory_read_byte))
MCFG_I8237_OUT_MEMW_CB(WRITE8(b16_state, memory_write_byte))
diff --git a/src/mess/drivers/bbc.c b/src/mess/drivers/bbc.c
index 617c6650ecf..10d83389261 100644
--- a/src/mess/drivers/bbc.c
+++ b/src/mess/drivers/bbc.c
@@ -688,7 +688,12 @@ static MACHINE_CONFIG_START( bbca, bbc_state )
MCFG_SAA5050_SCREEN_SIZE(40, 24, 40)
/* crtc */
- MCFG_MC6845_ADD("mc6845", MC6845, "screen", 2000000, bbc_mc6845_intf)
+ MCFG_MC6845_ADD("mc6845", MC6845, "screen", 2000000)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
+ MCFG_MC6845_UPDATE_ROW_CB(bbc_state, crtc_update_row)
+ MCFG_MC6845_OUT_VSYNC_CB(WRITELINE(bbc_state, bbc_vsync))
+
MCFG_VIDEO_START_OVERRIDE(bbc_state, bbca)
MCFG_DEFAULT_LAYOUT(layout_bbc)
@@ -909,7 +914,12 @@ static MACHINE_CONFIG_START( bbcm, bbc_state )
MCFG_SAA5050_SCREEN_SIZE(40, 24, 40)
/* crtc */
- MCFG_MC6845_ADD("mc6845", MC6845, "screen", 2000000, bbc_mc6845_intf)
+ MCFG_MC6845_ADD("mc6845", MC6845, "screen", 2000000)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
+ MCFG_MC6845_UPDATE_ROW_CB(bbc_state, crtc_update_row)
+ MCFG_MC6845_OUT_VSYNC_CB(WRITELINE(bbc_state, bbc_vsync))
+
MCFG_VIDEO_START_OVERRIDE(bbc_state, bbcm)
/* sound hardware */
diff --git a/src/mess/drivers/bigbord2.c b/src/mess/drivers/bigbord2.c
index 3b4c7c019df..c086110a74f 100644
--- a/src/mess/drivers/bigbord2.c
+++ b/src/mess/drivers/bigbord2.c
@@ -135,6 +135,7 @@ public:
DECLARE_WRITE8_MEMBER(memory_write_byte);
DECLARE_READ8_MEMBER(io_read_byte);
DECLARE_WRITE8_MEMBER(io_write_byte);
+ MC6845_UPDATE_ROW(crtc_update_row);
UINT8 *m_p_chargen; /* character ROM */
UINT8 *m_p_videoram; /* Video RAM */
UINT8 *m_p_attribram; /* Attribute RAM */
@@ -511,10 +512,9 @@ static GFXDECODE_START( bigbord2 )
GFXDECODE_ENTRY( "chargen", 0x0000, bigbord2_charlayout, 0, 1 )
GFXDECODE_END
-MC6845_UPDATE_ROW( bigbord2_update_row )
+MC6845_UPDATE_ROW( bigbord2_state::crtc_update_row )
{
- bigbord2_state *state = device->machine().driver_data<bigbord2_state>();
- const rgb_t *palette = state->m_palette->palette()->entry_list_raw();
+ const rgb_t *palette = m_palette->palette()->entry_list_raw();
UINT8 chr,gfx,inv;
UINT16 mem,x;
UINT32 *p = &bitmap.pix32(y);
@@ -523,11 +523,11 @@ MC6845_UPDATE_ROW( bigbord2_update_row )
{
inv=0;
mem = (ma + x) & 0x7ff;
- if (BIT(state->m_p_attribram[mem], 7)) inv^=0xff;
- chr = state->m_p_videoram[mem];
+ if (BIT(m_p_attribram[mem], 7)) inv^=0xff;
+ chr = m_p_videoram[mem];
/* get pattern of pixels for that character scanline */
- gfx = state->m_p_chargen[(chr<<4) | ra ] ^ inv;
+ gfx = m_p_chargen[(chr<<4) | ra ] ^ inv;
/* Display a scanline of a character */
*p++ = palette[BIT( gfx, 7 )];
@@ -541,22 +541,6 @@ MC6845_UPDATE_ROW( bigbord2_update_row )
}
}
-static MC6845_INTERFACE( bigbord2_crtc )
-{
- false,
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of dots per character */
- NULL,
- bigbord2_update_row, /* handler to display a scanline */
- NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_DRIVER_LINE_MEMBER(bigbord2_state, frame), // vsync
- NULL
-};
-
-
/* Machine Drivers */
#define MAIN_CLOCK XTAL_8MHz / 2
@@ -603,7 +587,13 @@ static MACHINE_CONFIG_START( bigbord2, bigbord2_state )
MCFG_MB8877x_ADD("fdc", XTAL_16MHz / 16)
MCFG_FLOPPY_DRIVE_ADD("fdc:0", bigbord2_floppies, "525dd", floppy_image_device::default_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("fdc:1", bigbord2_floppies, "525dd", floppy_image_device::default_floppy_formats)
- MCFG_MC6845_ADD("crtc", MC6845, SCREEN_TAG, XTAL_16MHz / 8, bigbord2_crtc)
+
+ MCFG_MC6845_ADD("crtc", MC6845, SCREEN_TAG, XTAL_16MHz / 8)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
+ MCFG_MC6845_UPDATE_ROW_CB(bigbord2_state, crtc_update_row)
+ MCFG_MC6845_OUT_VSYNC_CB(WRITELINE(bigbord2_state, frame))
+
MCFG_DEVICE_ADD(KEYBOARD_TAG, GENERIC_KEYBOARD, 0)
MCFG_GENERIC_KEYBOARD_CB(WRITE8(bigbord2_state, bigbord2_kbd_put))
diff --git a/src/mess/drivers/bml3.c b/src/mess/drivers/bml3.c
index 757af860c11..c4b22d6ea23 100644
--- a/src/mess/drivers/bml3.c
+++ b/src/mess/drivers/bml3.c
@@ -112,6 +112,8 @@ public:
DECLARE_READ8_MEMBER(bml3_f000_r); DECLARE_WRITE8_MEMBER(bml3_f000_w);
DECLARE_READ8_MEMBER(bml3_fff0_r); DECLARE_WRITE8_MEMBER(bml3_fff0_w);
+ MC6845_UPDATE_ROW(crtc_update_row);
+
UINT8 *m_p_videoram;
UINT8 *m_p_chargen;
UINT8 m_hres_reg;
@@ -589,10 +591,9 @@ static INPUT_PORTS_START( bml3 )
PORT_BIT(0xffe00000,IP_ACTIVE_HIGH,IPT_UNKNOWN)
INPUT_PORTS_END
-static MC6845_UPDATE_ROW( update_row )
+MC6845_UPDATE_ROW( bml3_state::crtc_update_row )
{
- bml3_state *state = device->machine().driver_data<bml3_state>();
- const rgb_t *palette = state->m_palette->palette()->entry_list_raw();
+ const rgb_t *palette = m_palette->palette()->entry_list_raw();
// The MB-6890 has a 5-bit colour RAM region. The meaning of the bits are:
// 0: blue
// 1: red
@@ -604,9 +605,9 @@ static MC6845_UPDATE_ROW( update_row )
bool reverse=0,graphic=0,lowres=0;
UINT16 mem=0;
- interlace = (state->m_crtc_vreg[8] & 3) ? 1 : 0;
- lowres = BIT(state->m_hres_reg, 6);
- bgcolor = state->m_hres_reg & 7;
+ interlace = (m_crtc_vreg[8] & 3) ? 1 : 0;
+ lowres = BIT(m_hres_reg, 6);
+ bgcolor = m_hres_reg & 7;
if (interlace)
{
@@ -624,11 +625,11 @@ static MC6845_UPDATE_ROW( update_row )
else
mem = (ma + x + ra * x_count/40 * 0x400 -0x400) & 0x3fff;
- color = state->m_p_videoram[mem|0x4000] & 7;
- reverse = BIT(state->m_p_videoram[mem|0x4000], 3) ^ (x == cursor_x);
- graphic = BIT(state->m_p_videoram[mem|0x4000], 4);
+ color = m_p_videoram[mem|0x4000] & 7;
+ reverse = BIT(m_p_videoram[mem|0x4000], 3) ^ (x == cursor_x);
+ graphic = BIT(m_p_videoram[mem|0x4000], 4);
- rawbits = state->m_p_videoram[mem];
+ rawbits = m_p_videoram[mem];
if (graphic)
{
@@ -653,12 +654,12 @@ static MC6845_UPDATE_ROW( update_row )
int tile_bank = BIT(rawbits, 7);
if (interlace)
{
- dots[0] = state->m_p_chargen[(tile_bank<<11)|(tile<<4)|(ra<<1)];
- dots[1] = state->m_p_chargen[(tile_bank<<11)|(tile<<4)|(ra<<1)|tile_bank];
+ dots[0] = m_p_chargen[(tile_bank<<11)|(tile<<4)|(ra<<1)];
+ dots[1] = m_p_chargen[(tile_bank<<11)|(tile<<4)|(ra<<1)|tile_bank];
}
else
{
- dots[0] = dots[1] = state->m_p_chargen[(tile<<4)|(ra<<1)|tile_bank];
+ dots[0] = dots[1] = m_p_chargen[(tile<<4)|(ra<<1)|tile_bank];
}
}
@@ -679,20 +680,6 @@ static MC6845_UPDATE_ROW( update_row )
}
}
-static MC6845_INTERFACE( mc6845_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of pixels per video memory address */
- NULL, /* before pixel update callback */
- update_row, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_NULL, /* VSYNC callback */
- NULL /* update address callback */
-};
TIMER_DEVICE_CALLBACK_MEMBER(bml3_state::keyboard_callback)
{
@@ -1000,7 +987,11 @@ static MACHINE_CONFIG_START( bml3_common, bml3_state )
/* Devices */
// CRTC clock should be synchronous with the CPU clock.
- MCFG_MC6845_ADD("crtc", H46505, "screen", CPU_CLOCK, mc6845_intf)
+ MCFG_MC6845_ADD("crtc", H46505, "screen", CPU_CLOCK)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
+ MCFG_MC6845_UPDATE_ROW_CB(bml3_state, crtc_update_row)
+
// fire once per scan of an individual key
// According to the service manual (p.65), the keyboard timer is driven by the horizontal video sync clock.
MCFG_TIMER_DRIVER_ADD_PERIODIC("keyboard_timer", bml3_state, keyboard_callback, attotime::from_hz(H_CLOCK/2))
diff --git a/src/mess/drivers/bw12.c b/src/mess/drivers/bw12.c
index 6d1031bbb2f..cb722ce969f 100644
--- a/src/mess/drivers/bw12.c
+++ b/src/mess/drivers/bw12.c
@@ -324,17 +324,16 @@ INPUT_PORTS_END
/* Video */
-static MC6845_UPDATE_ROW( bw12_update_row )
+MC6845_UPDATE_ROW( bw12_state::crtc_update_row )
{
- bw12_state *state = device->machine().driver_data<bw12_state>();
- const pen_t *pen = state->m_palette->pens();
+ const pen_t *pen = m_palette->pens();
int column, bit;
for (column = 0; column < x_count; column++)
{
- UINT8 code = state->m_video_ram[((ma + column) & BW12_VIDEORAM_MASK)];
+ UINT8 code = m_video_ram[((ma + column) & BW12_VIDEORAM_MASK)];
UINT16 addr = code << 4 | (ra & 0x0f);
- UINT8 data = state->m_char_rom->base()[addr & BW12_CHARROM_MASK];
+ UINT8 data = m_char_rom->base()[addr & BW12_CHARROM_MASK];
if (column == cursor_x)
{
@@ -354,21 +353,6 @@ static MC6845_UPDATE_ROW( bw12_update_row )
}
-static MC6845_INTERFACE( bw12_mc6845_interface )
-{
- true,
- 0,0,0,0,
- 8,
- NULL,
- bw12_update_row,
- NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- NULL
-};
-
/* PIA6821 Interface */
WRITE_LINE_MEMBER( bw12_state::write_centronics_busy )
@@ -564,7 +548,10 @@ static MACHINE_CONFIG_START( common, bw12_state )
MCFG_GFXDECODE_ADD("gfxdecode", "palette", bw12)
MCFG_PALETTE_ADD_MONOCHROME_AMBER("palette")
- MCFG_MC6845_ADD(MC6845_TAG, MC6845, SCREEN_TAG, XTAL_16MHz/8, bw12_mc6845_interface)
+ MCFG_MC6845_ADD(MC6845_TAG, MC6845, SCREEN_TAG, XTAL_16MHz/8)
+ MCFG_MC6845_SHOW_BORDER_AREA(true)
+ MCFG_MC6845_CHAR_WIDTH(8)
+ MCFG_MC6845_UPDATE_ROW_CB(bw12_state, crtc_update_row)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/c128.c b/src/mess/drivers/c128.c
index a0e351cd67a..63316484c3c 100644
--- a/src/mess/drivers/c128.c
+++ b/src/mess/drivers/c128.c
@@ -862,7 +862,7 @@ READ_LINE_MEMBER( c128_state::mmu_sense40_r )
//-------------------------------------------------
-// mc6845_interface vdc_intf
+// mc6845
//-------------------------------------------------
static GFXDECODE_START( c128 )
@@ -870,22 +870,6 @@ static GFXDECODE_START( c128 )
GFXDECODE_END
-static MC6845_INTERFACE( vdc_intf )
-{
- true,
- 0,0,0,0,
- 8,
- NULL,
- NULL,
- NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- NULL
-};
-
-
//-------------------------------------------------
// MOS8564_INTERFACE( vic_intf )
//-------------------------------------------------
@@ -1455,7 +1439,15 @@ static MACHINE_CONFIG_START( ntsc, c128_state )
MCFG_QUANTUM_PERFECT_CPU(M8502_TAG)
// video hardware
- MCFG_MOS8563_ADD(MOS8563_TAG, SCREEN_VDC_TAG, XTAL_16MHz, vdc_intf, vdc_videoram_map)
+ MCFG_MOS8563_ADD(MOS8563_TAG, SCREEN_VDC_TAG, XTAL_16MHz, vdc_videoram_map)
+ MCFG_MC6845_SHOW_BORDER_AREA(true)
+ MCFG_MC6845_CHAR_WIDTH(8)
+ MCFG_SCREEN_ADD(SCREEN_VDC_TAG, RASTER)
+ MCFG_SCREEN_REFRESH_RATE(60)
+ MCFG_SCREEN_SIZE(640, 200)
+ MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 200-1)
+ MCFG_SCREEN_UPDATE_DEVICE(MOS8563_TAG, mos8563_device, screen_update)
+
MCFG_DEVICE_ADD(MOS8564_TAG, MOS8564, XTAL_14_31818MHz*2/3.5)
MCFG_MOS6566_CPU(M8502_TAG)
MCFG_MOS6566_IRQ_CALLBACK(WRITELINE(c128_state, vic_irq_w))
@@ -1619,7 +1611,17 @@ static MACHINE_CONFIG_START( pal, c128_state )
MCFG_QUANTUM_PERFECT_CPU(M8502_TAG)
// video hardware
- MCFG_MOS8563_ADD(MOS8563_TAG, SCREEN_VDC_TAG, XTAL_16MHz, vdc_intf, vdc_videoram_map)
+ MCFG_MOS8563_ADD(MOS8563_TAG, SCREEN_VDC_TAG, XTAL_16MHz, vdc_videoram_map)
+ MCFG_MC6845_SHOW_BORDER_AREA(true)
+ MCFG_MC6845_CHAR_WIDTH(8)
+ MCFG_MC6845_SHOW_BORDER_AREA(true)
+ MCFG_MC6845_CHAR_WIDTH(8)
+ MCFG_SCREEN_ADD(SCREEN_VDC_TAG, RASTER)
+ MCFG_SCREEN_REFRESH_RATE(60)
+ MCFG_SCREEN_SIZE(640, 200)
+ MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 200-1)
+ MCFG_SCREEN_UPDATE_DEVICE(MOS8563_TAG, mos8563_device, screen_update)
+
MCFG_DEVICE_ADD(MOS8566_TAG, MOS8566, XTAL_17_734472MHz*2/4.5)
MCFG_MOS6566_CPU(M8502_TAG)
MCFG_MOS6566_IRQ_CALLBACK(WRITELINE(c128_state, vic_irq_w))
diff --git a/src/mess/drivers/camplynx.c b/src/mess/drivers/camplynx.c
index 38352c95bd5..cd5e9f32603 100644
--- a/src/mess/drivers/camplynx.c
+++ b/src/mess/drivers/camplynx.c
@@ -103,6 +103,8 @@ public:
DECLARE_DRIVER_INIT(lynx48k);
DECLARE_PALETTE_INIT(camplynx);
DECLARE_MACHINE_RESET(lynx128k);
+ MC6845_UPDATE_ROW(lynx48k_update_row);
+ MC6845_UPDATE_ROW(lynx128k_update_row);
required_device<palette_device> m_palette;
private:
virtual void video_start();
@@ -384,11 +386,10 @@ PALETTE_INIT_MEMBER(camplynx_state, camplynx)
}
}
-static MC6845_UPDATE_ROW( lynx48k_update_row )
+MC6845_UPDATE_ROW( camplynx_state::lynx48k_update_row )
{
- camplynx_state *state = device->machine().driver_data<camplynx_state>();
- UINT8 *RAM = device->machine().root_device().memregion("maincpu")->base();
- const rgb_t *palette = state->m_palette->palette()->entry_list_raw();
+ UINT8 *RAM = machine().root_device().memregion("maincpu")->base();
+ const rgb_t *palette = m_palette->palette()->entry_list_raw();
UINT8 r,g,b;
UINT32 x, *p = &bitmap.pix32(y);
@@ -409,11 +410,10 @@ static MC6845_UPDATE_ROW( lynx48k_update_row )
}
}
-static MC6845_UPDATE_ROW( lynx128k_update_row )
+MC6845_UPDATE_ROW( camplynx_state::lynx128k_update_row )
{
- camplynx_state *state = device->machine().driver_data<camplynx_state>();
- UINT8 *RAM = device->machine().root_device().memregion("maincpu")->base();
- const rgb_t *palette = state->m_palette->palette()->entry_list_raw();
+ UINT8 *RAM = machine().root_device().memregion("maincpu")->base();
+ const rgb_t *palette = m_palette->palette()->entry_list_raw();
UINT8 r,g,b;
UINT32 x, *p = &bitmap.pix32(y);
@@ -438,38 +438,6 @@ void camplynx_state::video_start()
{
}
-static MC6845_INTERFACE( lynx48k_crtc6845_interface )
-{
- false,
- 0,0,0,0,
- 8,
- NULL,
- lynx48k_update_row,
- NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- NULL
-};
-
-
-static MC6845_INTERFACE( lynx128k_crtc6845_interface )
-{
- false,
- 0,0,0,0, /* visarea adjustment */
- 8, /* dots per character */
- NULL,
- lynx128k_update_row, /* callback to display one scanline */
- NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_DRIVER_MEMBER(camplynx_state, lynx128k_irq), /* callback when cursor pin changes state */
- DEVCB_NULL,
- NULL
-};
-
-
static MACHINE_CONFIG_START( lynx48k, camplynx_state )
/* basic machine hardware */
@@ -492,8 +460,11 @@ static MACHINE_CONFIG_START( lynx48k, camplynx_state )
MCFG_SOUND_ADD("dac", DAC, 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.8)
- /* Devices */
- MCFG_MC6845_ADD("crtc", MC6845, "screen", XTAL_12MHz / 8 /*? dot clock divided by dots per char */, lynx48k_crtc6845_interface)
+ /* devices */
+ MCFG_MC6845_ADD("crtc", MC6845, "screen", XTAL_12MHz / 8 /*? dot clock divided by dots per char */)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
+ MCFG_MC6845_UPDATE_ROW_CB(camplynx_state, lynx48k_update_row)
MACHINE_CONFIG_END
static MACHINE_CONFIG_START( lynx128k, camplynx_state )
@@ -520,8 +491,12 @@ static MACHINE_CONFIG_START( lynx128k, camplynx_state )
MCFG_SOUND_ADD("dac", DAC, 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.8)
- /* Devices */
- MCFG_MC6845_ADD("crtc", MC6845, "screen", XTAL_12MHz / 8 /*? dot clock divided by dots per char */, lynx128k_crtc6845_interface)
+ /* devices */
+ MCFG_MC6845_ADD("crtc", MC6845, "screen", XTAL_12MHz / 8 /*? dot clock divided by dots per char */)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
+ MCFG_MC6845_UPDATE_ROW_CB(camplynx_state, lynx128k_update_row)
+ MCFG_MC6845_OUT_HSYNC_CB(WRITE8(camplynx_state, lynx128k_irq))
MACHINE_CONFIG_END
DRIVER_INIT_MEMBER(camplynx_state,lynx48k)
diff --git a/src/mess/drivers/cbm2.c b/src/mess/drivers/cbm2.c
index a06698a7bc5..78bcd9e6ec5 100644
--- a/src/mess/drivers/cbm2.c
+++ b/src/mess/drivers/cbm2.c
@@ -1102,21 +1102,20 @@ INPUT_PORTS_END
//**************************************************************************
//-------------------------------------------------
-// mc6845_interface crtc_intf
+// mc6845
//-------------------------------------------------
-static MC6845_UPDATE_ROW( crtc_update_row )
+MC6845_UPDATE_ROW( cbm2_state::crtc_update_row )
{
- cbm2_state *state = device->machine().driver_data<cbm2_state>();
- const pen_t *pen = state->m_palette->pens();
+ const pen_t *pen = m_palette->pens();
int x = 0;
for (int column = 0; column < x_count; column++)
{
- UINT8 code = state->m_video_ram[(ma + column) & 0x7ff];
- offs_t char_rom_addr = (ma & 0x1000) | (state->m_graphics << 11) | ((code & 0x7f) << 4) | (ra & 0x0f);
- UINT8 data = state->m_charom->base()[char_rom_addr & 0xfff];
+ UINT8 code = m_video_ram[(ma + column) & 0x7ff];
+ offs_t char_rom_addr = (ma & 0x1000) | (m_graphics << 11) | ((code & 0x7f) << 4) | (ra & 0x0f);
+ UINT8 data = m_charom->base()[char_rom_addr & 0xfff];
for (int bit = 0; bit < 9; bit++)
{
@@ -1126,27 +1125,11 @@ static MC6845_UPDATE_ROW( crtc_update_row )
bitmap.pix32(vbp + y, hbp + x++) = pen[color];
- if (bit < 8 || !state->m_graphics) data <<= 1;
+ if (bit < 8 || !m_graphics) data <<= 1;
}
}
}
-static MC6845_INTERFACE( crtc_intf )
-{
- true,
- 0,0,0,0,
- 9,
- NULL,
- crtc_update_row,
- NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- NULL
-};
-
-
//-------------------------------------------------
// vic2_interface vic_intf
//-------------------------------------------------
@@ -2254,7 +2237,10 @@ static MACHINE_CONFIG_START( cbm2lp_ntsc, cbm2_state )
MCFG_PALETTE_ADD_MONOCHROME_GREEN("palette")
- MCFG_MC6845_ADD(MC68B45_TAG, MC6845, SCREEN_TAG, XTAL_18MHz/9, crtc_intf)
+ MCFG_MC6845_ADD(MC68B45_TAG, MC6845, SCREEN_TAG, XTAL_18MHz/9)
+ MCFG_MC6845_SHOW_BORDER_AREA(true)
+ MCFG_MC6845_CHAR_WIDTH(9)
+ MCFG_MC6845_UPDATE_ROW_CB(cbm2_state, crtc_update_row)
// sound hardware
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/dgn_beta.c b/src/mess/drivers/dgn_beta.c
index c4a3a1f141f..7a744fe606d 100644
--- a/src/mess/drivers/dgn_beta.c
+++ b/src/mess/drivers/dgn_beta.c
@@ -327,7 +327,6 @@ static MACHINE_CONFIG_START( dgnbeta, dgn_beta_state )
MCFG_CPU_ADD(DMACPU_TAG, M6809E, DGNBETA_CPU_SPEED_HZ) /* 2 MHz */
MCFG_CPU_PROGRAM_MAP(dgnbeta_map)
-
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(DGNBETA_FRAMES_PER_SECOND)
@@ -375,7 +374,11 @@ static MACHINE_CONFIG_START( dgnbeta, dgn_beta_state )
MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(dgnbeta_floppy_interface)
- MCFG_MC6845_ADD("crtc", HD6845, "screen", XTAL_12_288MHz / 16, dgnbeta_crtc6845_interface) //XTAL is guessed
+ MCFG_MC6845_ADD("crtc", HD6845, "screen", XTAL_12_288MHz / 16) //XTAL is guessed
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(16) /*?*/
+ MCFG_MC6845_UPDATE_ROW_CB(dgn_beta_state, crtc_update_row)
+ MCFG_MC6845_OUT_VSYNC_CB(WRITELINE(dgn_beta_state, dgnbeta_vsync_changed))
/* internal ram */
MCFG_RAM_ADD(RAM_TAG)
diff --git a/src/mess/drivers/dim68k.c b/src/mess/drivers/dim68k.c
index af052b4c8bd..9c12fb1caff 100644
--- a/src/mess/drivers/dim68k.c
+++ b/src/mess/drivers/dim68k.c
@@ -66,6 +66,7 @@ public:
DECLARE_WRITE16_MEMBER( dim68k_video_high_w );
DECLARE_WRITE16_MEMBER( dim68k_video_reset_w );
DECLARE_WRITE8_MEMBER(kbd_put);
+ MC6845_UPDATE_ROW(crtc_update_row);
const UINT8 *m_p_chargen;
bool m_speaker_bit;
UINT8 m_video_control;
@@ -224,15 +225,14 @@ void dim68k_state::video_start()
}
// Text-only; graphics isn't emulated yet. Need to find out if hardware cursor is used.
-MC6845_UPDATE_ROW( dim68k_update_row )
+MC6845_UPDATE_ROW( dim68k_state::crtc_update_row )
{
- dim68k_state *state = device->machine().driver_data<dim68k_state>();
- const rgb_t *palette = state->m_palette->palette()->entry_list_raw();
+ const rgb_t *palette = m_palette->palette()->entry_list_raw();
UINT8 chr,gfx,x,xx,inv;
UINT16 chr16=0x2020; // set to spaces if screen is off
UINT32 *p = &bitmap.pix32(y);
- UINT8 screen_on = ~state->m_video_control & 4;
- UINT8 dot8 = ~state->m_video_control & 40;
+ UINT8 screen_on = ~m_video_control & 4;
+ UINT8 dot8 = ~m_video_control & 40;
// need to divide everything in half to cater for 16-bit reads
x_count /= 2;
@@ -242,14 +242,14 @@ MC6845_UPDATE_ROW( dim68k_update_row )
for (x = 0; x < x_count; x++)
{
if (screen_on)
- chr16 = state->m_ram[ma+x]; // reads 2 characters
+ chr16 = m_ram[ma+x]; // reads 2 characters
inv=0;
if (xx == cursor_x && screen_on) inv=0xff;
xx++;
chr = chr16>>8;
- gfx = state->m_p_chargen[(chr<<4) | ra] ^ inv ^ ((chr & 0x80) ? 0xff : 0);
+ gfx = m_p_chargen[(chr<<4) | ra] ^ inv ^ ((chr & 0x80) ? 0xff : 0);
*p++ = palette[BIT(gfx, 7)];
*p++ = palette[BIT(gfx, 6)];
*p++ = palette[BIT(gfx, 5)];
@@ -264,7 +264,7 @@ MC6845_UPDATE_ROW( dim68k_update_row )
xx++;
chr = chr16;
- gfx = state->m_p_chargen[(chr<<4) | ra] ^ inv ^ ((chr & 0x80) ? 0xff : 0);
+ gfx = m_p_chargen[(chr<<4) | ra] ^ inv ^ ((chr & 0x80) ? 0xff : 0);
*p++ = palette[BIT(gfx, 7)];
*p++ = palette[BIT(gfx, 6)];
*p++ = palette[BIT(gfx, 5)];
@@ -294,21 +294,6 @@ static GFXDECODE_START( dim68k )
GFXDECODE_ENTRY( "chargen", 0x0000, dim68k_charlayout, 0, 1 )
GFXDECODE_END
-static MC6845_INTERFACE( dim68k_crtc )
-{
- false,
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of dots per character - switchable 7 or 8 */
- NULL,
- dim68k_update_row, /* handler to display a scanline */
- NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- NULL
-};
-
static SLOT_INTERFACE_START( dim68k_floppies )
SLOT_INTERFACE( "525hd", FLOPPY_525_HD )
SLOT_INTERFACE_END
@@ -342,7 +327,12 @@ static MACHINE_CONFIG_START( dim68k, dim68k_state )
MCFG_UPD765A_ADD("fdc", true, true) // these options unknown
MCFG_FLOPPY_DRIVE_ADD("fdc:0", dim68k_floppies, "525hd", floppy_image_device::default_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("fdc:1", dim68k_floppies, "525hd", floppy_image_device::default_floppy_formats)
- MCFG_MC6845_ADD("crtc", MC6845, "screen", 1790000, dim68k_crtc)
+
+ MCFG_MC6845_ADD("crtc", MC6845, "screen", 1790000)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
+ MCFG_MC6845_UPDATE_ROW_CB(dim68k_state, crtc_update_row)
+
MCFG_DEVICE_ADD("keyboard", GENERIC_KEYBOARD, 0)
MCFG_GENERIC_KEYBOARD_CB(WRITE8(dim68k_state, kbd_put))
MACHINE_CONFIG_END
diff --git a/src/mess/drivers/ec65.c b/src/mess/drivers/ec65.c
index 73d12881606..978ffb25a8f 100644
--- a/src/mess/drivers/ec65.c
+++ b/src/mess/drivers/ec65.c
@@ -38,6 +38,7 @@ public:
}
DECLARE_WRITE8_MEMBER(kbd_put);
+ MC6845_UPDATE_ROW(crtc_update_row);
UINT8 *m_p_chargen;
required_device<via6522_device> m_via_0;
required_device<via6522_device> m_via_1;
@@ -118,10 +119,9 @@ void ec65_state::video_start()
m_p_chargen = memregion("chargen")->base();
}
-static MC6845_UPDATE_ROW( ec65_update_row )
+MC6845_UPDATE_ROW( ec65_state::crtc_update_row )
{
- ec65_state *state = device->machine().driver_data<ec65_state>();
- const rgb_t *palette = state->m_palette->palette()->entry_list_raw();
+ const rgb_t *palette = m_palette->palette()->entry_list_raw();
UINT8 chr,gfx,inv;
UINT16 mem,x;
UINT32 *p = &bitmap.pix32(y);
@@ -130,10 +130,10 @@ static MC6845_UPDATE_ROW( ec65_update_row )
{
inv = (x == cursor_x) ? 0xff : 0;
mem = (ma + x) & 0x7ff;
- chr = state->m_p_videoram[mem];
+ chr = m_p_videoram[mem];
/* get pattern of pixels for that character scanline */
- gfx = state->m_p_chargen[(chr<<4) | (ra & 0x0f)] ^ inv;
+ gfx = m_p_chargen[(chr<<4) | (ra & 0x0f)] ^ inv;
/* Display a scanline of a character */
*p++ = palette[BIT(gfx, 7)];
@@ -147,23 +147,6 @@ static MC6845_UPDATE_ROW( ec65_update_row )
}
}
-
-static MC6845_INTERFACE( ec65_crtc6845_interface )
-{
- false,
- 0,0,0,0,
- 8 /*?*/,
- NULL,
- ec65_update_row,
- NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- NULL
-};
-
-
/* F4 Character Displayer */
static const gfx_layout ec65_charlayout =
{
@@ -188,7 +171,6 @@ static MACHINE_CONFIG_START( ec65, ec65_state )
MCFG_CPU_ADD("maincpu",M6502, XTAL_4MHz / 4)
MCFG_CPU_PROGRAM_MAP(ec65_mem)
-
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
@@ -200,8 +182,10 @@ static MACHINE_CONFIG_START( ec65, ec65_state )
MCFG_GFXDECODE_ADD("gfxdecode", "palette", ec65)
MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
- MCFG_MC6845_ADD(MC6845_TAG, MC6845, "screen", XTAL_16MHz / 8, ec65_crtc6845_interface)
-
+ MCFG_MC6845_ADD(MC6845_TAG, MC6845, "screen", XTAL_16MHz / 8)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8) /*?*/
+ MCFG_MC6845_UPDATE_ROW_CB(ec65_state, crtc_update_row)
/* devices */
MCFG_DEVICE_ADD(PIA6821_TAG, PIA6821, 0)
@@ -225,7 +209,6 @@ static MACHINE_CONFIG_START( ec65k, ec65k_state )
MCFG_CPU_ADD("maincpu",G65816, XTAL_4MHz) // can use 4,2 or 1 MHz
MCFG_CPU_PROGRAM_MAP(ec65k_mem)
-
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
@@ -237,8 +220,9 @@ static MACHINE_CONFIG_START( ec65k, ec65k_state )
MCFG_GFXDECODE_ADD("gfxdecode", "palette", ec65)
MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
- MCFG_MC6845_ADD(MC6845_TAG, MC6845, "screen", XTAL_16MHz / 8, ec65_crtc6845_interface)
-
+ MCFG_MC6845_ADD(MC6845_TAG, MC6845, "screen", XTAL_16MHz / 8)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8) /*?*/
MACHINE_CONFIG_END
/* ROM definition */
diff --git a/src/mess/drivers/einstein.c b/src/mess/drivers/einstein.c
index 670c5894ab7..06067b70a53 100644
--- a/src/mess/drivers/einstein.c
+++ b/src/mess/drivers/einstein.c
@@ -99,17 +99,16 @@ READ8_MEMBER(einstein_state::einstein_80col_ram_r)
bit 12 jumper M004, this could be used to select two different character
sets.
*/
-static MC6845_UPDATE_ROW( einstein_6845_update_row )
+MC6845_UPDATE_ROW( einstein_state::crtc_update_row )
{
- einstein_state *einstein = device->machine().driver_data<einstein_state>();
- const rgb_t *palette = einstein->m_palette->palette()->entry_list_raw();
- UINT8 *data = einstein->m_region_gfx1->base();
+ const rgb_t *palette = m_palette->palette()->entry_list_raw();
+ UINT8 *data = m_region_gfx1->base();
UINT8 char_code, data_byte;
int i, x;
for (i = 0, x = 0; i < x_count; i++, x += 8)
{
- char_code = einstein->m_crtc_ram[(ma + i) & 0x07ff];
+ char_code = m_crtc_ram[(ma + i) & 0x07ff];
data_byte = data[(char_code << 3) + (ra & 0x07) + ((ra & 0x08) << 8)];
bitmap.pix32(y, x + 0) = palette[TMS9928A_PALETTE_SIZE + BIT(data_byte, 7)];
@@ -676,21 +675,6 @@ static const ay8910_interface einstein_ay_interface =
DEVCB_NULL
};
-static MC6845_INTERFACE( einstein_crtc6845_interface )
-{
- false,
- 0,0,0,0,
- 8,
- NULL,
- einstein_6845_update_row,
- NULL,
- DEVCB_DRIVER_LINE_MEMBER(einstein_state,einstein_6845_de_changed),
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- NULL
-};
-
/* F4 Character Displayer */
static const gfx_layout einstei2_charlayout =
{
@@ -721,7 +705,6 @@ static MACHINE_CONFIG_START( einstein, einstein_state )
MCFG_CPU_IO_MAP(einstein_io)
MCFG_CPU_CONFIG(einstein_daisy_chain)
-
/* this is actually clocked at the system clock 4 MHz, but this would be too fast for our
driver. So we update at 50Hz and hope this is good enough. */
MCFG_TIMER_DRIVER_ADD_PERIODIC("keyboard", einstein_state, einstein_keyboard_timer_callback, attotime::from_hz(50))
@@ -807,7 +790,11 @@ static MACHINE_CONFIG_DERIVED( einstei2, einstein )
/* 2 additional colors for the 80 column screen */
MCFG_PALETTE_ADD("palette", TMS9928A_PALETTE_SIZE + 2)
- MCFG_MC6845_ADD("crtc", MC6845, "80column", XTAL_X002 / 4, einstein_crtc6845_interface)
+ MCFG_MC6845_ADD("crtc", MC6845, "80column", XTAL_X002 / 4)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
+ MCFG_MC6845_UPDATE_ROW_CB(einstein_state, crtc_update_row)
+ MCFG_MC6845_OUT_DE_CB(WRITELINE(einstein_state, einstein_6845_de_changed))
MACHINE_CONFIG_END
diff --git a/src/mess/drivers/fanucspmg.c b/src/mess/drivers/fanucspmg.c
index be6d2d96dcb..77c96770213 100644
--- a/src/mess/drivers/fanucspmg.c
+++ b/src/mess/drivers/fanucspmg.c
@@ -547,6 +547,8 @@ public:
DECLARE_WRITE_LINE_MEMBER(tc_w);
DECLARE_WRITE_LINE_MEMBER(hrq_w);
+ MC6845_UPDATE_ROW(crtc_update_row);
+
DECLARE_DRIVER_INIT(fanucspmg);
UINT8 m_vram[24576];
@@ -765,23 +767,22 @@ WRITE8_MEMBER(fanucspmg_state::memory_write_byte)
return prog_space.write_byte(offset | (m_dma_page << 16), data);
}
-static MC6845_UPDATE_ROW( fanuc_update_row )
+MC6845_UPDATE_ROW( fanucspmg_state::crtc_update_row )
{
- fanucspmg_state *state = downcast<fanucspmg_state *>(device->owner());
UINT32 *p = &bitmap.pix32(y);
int i;
- UINT8 *chargen = state->m_chargen->base();
+ UINT8 *chargen = m_chargen->base();
for ( i = 0; i < x_count; i++ )
{
UINT16 offset = ( ma + i );
- if (state->m_video_ctrl & 0x02)
+ if (m_video_ctrl & 0x02)
{
if (offset <= 0x5ff)
{
- UINT8 chr = state->m_vram[offset + 0x600];
- UINT8 attr = state->m_vram[offset];
+ UINT8 chr = m_vram[offset + 0x600];
+ UINT8 attr = m_vram[offset];
UINT8 data = chargen[ chr + (ra * 256) ];
UINT32 fg = 0;
UINT32 bg = 0;
@@ -814,21 +815,6 @@ static MC6845_UPDATE_ROW( fanuc_update_row )
}
}
-static MC6845_INTERFACE( mc6845_fanuc_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of pixels per video memory address */
- NULL, /* begin_update */
- fanuc_update_row, /* update_row */
- NULL, /* end_update */
- DEVCB_NULL, /* on_de_changed */
- DEVCB_NULL, /* on_cur_changed */
- DEVCB_NULL, /* on hsync changed */
- DEVCB_DRIVER_LINE_MEMBER(fanucspmg_state, vsync_w), /* on vsync changed */
- NULL
-};
-
static SLOT_INTERFACE_START( fanuc_floppies )
SLOT_INTERFACE( "525dd", FLOPPY_525_DD )
SLOT_INTERFACE_END
@@ -882,7 +868,11 @@ static MACHINE_CONFIG_START( fanucspmg, fanucspmg_state )
MCFG_SCREEN_RAW_PARAMS(XTAL_15MHz, 640, 0, 512, 390, 0, 384 )
MCFG_SCREEN_UPDATE_DEVICE( CRTC_TAG, mc6845_device, screen_update )
- MCFG_MC6845_ADD( CRTC_TAG, HD6845, SCREEN_TAG, XTAL_8MHz/2, mc6845_fanuc_intf)
+ MCFG_MC6845_ADD( CRTC_TAG, HD6845, SCREEN_TAG, XTAL_8MHz/2)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
+ MCFG_MC6845_UPDATE_ROW_CB(fanucspmg_state, crtc_update_row)
+ MCFG_MC6845_OUT_VSYNC_CB(WRITELINE(fanucspmg_state, vsync_w))
MACHINE_CONFIG_END
/* ROM definition */
diff --git a/src/mess/drivers/fp1100.c b/src/mess/drivers/fp1100.c
index 22d49cf9e0b..ef89520ccd1 100644
--- a/src/mess/drivers/fp1100.c
+++ b/src/mess/drivers/fp1100.c
@@ -87,10 +87,6 @@ void fp1100_state::video_start()
{
}
-static MC6845_UPDATE_ROW( fp1100_update_row )
-{
-}
-
READ8_MEMBER( fp1100_state::fp1100_mem_r )
{
if(m_mem_bank == 0 && offset <= 0x8fff)
@@ -318,21 +314,6 @@ GFXDECODE_END
-static MC6845_INTERFACE( mc6845_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of pixels per video memory address */
- NULL, /* before pixel update callback */
- fp1100_update_row, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_NULL, /* VSYNC callback */
- NULL /* update address callback */
-};
-
INTERRUPT_GEN_MEMBER(fp1100_state::fp1100_vblank_irq)
{
if(irq_mask & 0x10)
@@ -362,8 +343,10 @@ static MACHINE_CONFIG_START( fp1100, fp1100_state )
MCFG_PALETTE_ADD("palette", 8)
MCFG_GFXDECODE_ADD("gfxdecode", "palette", fp1100)
- /* Devices */
- MCFG_MC6845_ADD("crtc", H46505, "screen", MAIN_CLOCK/2, mc6845_intf) /* hand tuned to get ~60 fps */
+ /* devices */
+ MCFG_MC6845_ADD("crtc", H46505, "screen", MAIN_CLOCK/2) /* hand tuned to get ~60 fps */
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
MACHINE_CONFIG_END
/* ROM definition */
diff --git a/src/mess/drivers/fp6000.c b/src/mess/drivers/fp6000.c
index 203fd119961..5eb0720b426 100644
--- a/src/mess/drivers/fp6000.c
+++ b/src/mess/drivers/fp6000.c
@@ -288,28 +288,12 @@ void fp6000_state::machine_reset()
{
}
-static MC6845_INTERFACE( mc6845_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of pixels per video memory address */
- NULL, /* before pixel update callback */
- NULL, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_NULL, /* VSYNC callback */
- NULL /* update address callback */
-};
-
static MACHINE_CONFIG_START( fp6000, fp6000_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", I8086, 16000000/2)
MCFG_CPU_PROGRAM_MAP(fp6000_map)
MCFG_CPU_IO_MAP(fp6000_io)
-
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
@@ -319,7 +303,9 @@ static MACHINE_CONFIG_START( fp6000, fp6000_state )
MCFG_SCREEN_UPDATE_DRIVER(fp6000_state, screen_update_fp6000)
MCFG_SCREEN_PALETTE("palette")
- MCFG_MC6845_ADD("crtc", H46505, "screen", 16000000/5, mc6845_intf) /* unknown clock, hand tuned to get ~60 fps */
+ MCFG_MC6845_ADD("crtc", H46505, "screen", 16000000/5) /* unknown clock, hand tuned to get ~60 fps */
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
MCFG_PALETTE_ADD("palette", 8)
// MCFG_PALETTE_INIT(black_and_white)
diff --git a/src/mess/drivers/h19.c b/src/mess/drivers/h19.c
index b823566fda2..df5b1815980 100644
--- a/src/mess/drivers/h19.c
+++ b/src/mess/drivers/h19.c
@@ -72,6 +72,7 @@ public:
DECLARE_READ8_MEMBER(h19_a0_r);
DECLARE_WRITE8_MEMBER(h19_c0_w);
DECLARE_WRITE8_MEMBER(h19_kbd_put);
+ MC6845_UPDATE_ROW(crtc_update_row);
required_shared_ptr<UINT8> m_p_videoram;
required_device<palette_device> m_palette;
UINT8 *m_p_chargen;
@@ -320,10 +321,9 @@ void h19_state::video_start()
m_p_chargen = memregion("chargen")->base();
}
-static MC6845_UPDATE_ROW( h19_update_row )
+MC6845_UPDATE_ROW( h19_state::crtc_update_row )
{
- h19_state *state = device->machine().driver_data<h19_state>();
- const rgb_t *palette = state->m_palette->palette()->entry_list_raw();
+ const rgb_t *palette = m_palette->palette()->entry_list_raw();
UINT8 chr,gfx;
UINT16 mem,x;
UINT32 *p = &bitmap.pix32(y);
@@ -333,7 +333,7 @@ static MC6845_UPDATE_ROW( h19_update_row )
UINT8 inv=0;
if (x == cursor_x) inv=0xff;
mem = (ma + x) & 0x7ff;
- chr = state->m_p_videoram[mem];
+ chr = m_p_videoram[mem];
if (chr & 0x80)
{
@@ -342,7 +342,7 @@ static MC6845_UPDATE_ROW( h19_update_row )
}
/* get pattern of pixels for that character scanline */
- gfx = state->m_p_chargen[(chr<<4) | ra] ^ inv;
+ gfx = m_p_chargen[(chr<<4) | ra] ^ inv;
/* Display a scanline of a character (8 pixels) */
*p++ = palette[BIT(gfx, 7)];
@@ -372,21 +372,6 @@ static const ins8250_interface h19_ace_interface =
};
-static MC6845_INTERFACE( h19_crtc6845_interface )
-{
- false,
- 0,0,0,0,
- 8 /*?*/,
- NULL,
- h19_update_row,
- NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_CPU_INPUT_LINE("maincpu", INPUT_LINE_NMI), // frame pulse
- NULL
-};
-
/* F4 Character Displayer */
static const gfx_layout h19_charlayout =
{
@@ -428,8 +413,14 @@ static MACHINE_CONFIG_START( h19, h19_state )
MCFG_GFXDECODE_ADD("gfxdecode", "palette", h19)
MCFG_PALETTE_ADD_MONOCHROME_GREEN("palette")
- MCFG_MC6845_ADD("crtc", MC6845, "screen", XTAL_12_288MHz / 8, h19_crtc6845_interface) // clk taken from schematics
+ MCFG_MC6845_ADD("crtc", MC6845, "screen", XTAL_12_288MHz / 8) // clk taken from schematics
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8) /*?*/
+ MCFG_MC6845_UPDATE_ROW_CB(h19_state, crtc_update_row)
+ MCFG_MC6845_OUT_VSYNC_CB(INPUTLINE("maincpu", INPUT_LINE_NMI)) // frame pulse
+
MCFG_INS8250_ADD( "ins8250", h19_ace_interface, XTAL_12_288MHz / 4) // 3.072mhz clock which gets divided down for the various baud rates
+
MCFG_DEVICE_ADD(KEYBOARD_TAG, GENERIC_KEYBOARD, 0)
MCFG_GENERIC_KEYBOARD_CB(WRITE8(h19_state, h19_kbd_put))
diff --git a/src/mess/drivers/hp9k.c b/src/mess/drivers/hp9k.c
index afb4dd9111c..19f612d7513 100644
--- a/src/mess/drivers/hp9k.c
+++ b/src/mess/drivers/hp9k.c
@@ -389,21 +389,6 @@ WRITE8_MEMBER( hp9k_state::kbd_put )
}
-static MC6845_INTERFACE( hp9k_mc6845_intf )
-{
- false,
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of dots per character */
- NULL,
- NULL, /* handler to display a scanline */
- NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- NULL
-};
-
static MACHINE_CONFIG_START( hp9k, hp9k_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu",M68000, XTAL_8MHz)
@@ -422,7 +407,9 @@ static MACHINE_CONFIG_START( hp9k, hp9k_state )
MCFG_GFXDECODE_ADD("gfxdecode", "palette", hp9k)
MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
- MCFG_MC6845_ADD( "mc6845", MC6845, "screen", XTAL_16MHz / 16, hp9k_mc6845_intf )
+ MCFG_MC6845_ADD("mc6845", MC6845, "screen", XTAL_16MHz / 16)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
MACHINE_CONFIG_END
/* ROM definition */
diff --git a/src/mess/drivers/kaypro.c b/src/mess/drivers/kaypro.c
index 55ce10b2e06..9e76d9acd30 100644
--- a/src/mess/drivers/kaypro.c
+++ b/src/mess/drivers/kaypro.c
@@ -148,21 +148,6 @@ static const z80_daisy_config kaypro2x_daisy_chain[] =
-static MC6845_INTERFACE( kaypro2x_crtc )
-{
- false,
- 0,0,0,0, /* visarea adjustment */
- 7, /* number of dots per character */
- NULL,
- kaypro2x_update_row, /* handler to display a scanline */
- NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- NULL
-};
-
//static WRITE_LINE_DEVICE_HANDLER( rx_tx_w )
//{
// downcast<z80sio_device *>(device)->rx_clock_in();
@@ -289,7 +274,11 @@ static MACHINE_CONFIG_START( kaypro2x, kaypro_state )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
/* devices */
- MCFG_MC6845_ADD("crtc", MC6845, "screen", 2000000, kaypro2x_crtc) /* comes out of ULA - needs to be measured */
+ MCFG_MC6845_ADD("crtc", MC6845, "screen", 2000000) /* comes out of ULA - needs to be measured */
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(7)
+ MCFG_MC6845_UPDATE_ROW_CB(kaypro_state, kaypro2x_update_row)
+
MCFG_QUICKLOAD_ADD("quickload", kaypro_state, kaypro, "com,cpm", 3)
MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer")
diff --git a/src/mess/drivers/lola8a.c b/src/mess/drivers/lola8a.c
index f07c94246c4..f3aae30c631 100644
--- a/src/mess/drivers/lola8a.c
+++ b/src/mess/drivers/lola8a.c
@@ -52,6 +52,7 @@ public:
DECLARE_WRITE_LINE_MEMBER(cass_w);
DECLARE_READ8_MEMBER(keyboard_r);
+ MC6845_UPDATE_ROW(crtc_update_row);
private:
UINT8 m_portb;
@@ -196,11 +197,10 @@ PALETTE_INIT_MEMBER(lola8a_state, lola8a)
}
}
-static MC6845_UPDATE_ROW( lola8a_update_row )
+MC6845_UPDATE_ROW( lola8a_state::crtc_update_row )
{
- lola8a_state *state = device->machine().driver_data<lola8a_state>();
- address_space &program = state->m_maincpu->space(AS_PROGRAM);
- const rgb_t *palette = state->m_palette->palette()->entry_list_raw();
+ address_space &program = m_maincpu->space(AS_PROGRAM);
+ const rgb_t *palette = m_palette->palette()->entry_list_raw();
for (int sx = 0; sx < x_count; sx++)
{
@@ -257,21 +257,6 @@ WRITE_LINE_MEMBER(lola8a_state::crtc_vsync)
m_maincpu->set_input_line(I8085_RST75_LINE, state? ASSERT_LINE : CLEAR_LINE);
}
-static MC6845_INTERFACE( hd46505sp_intf )
-{
- false,
- 0,0,0,0,
- 8,
- NULL,
- lola8a_update_row,
- NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_DRIVER_LINE_MEMBER(lola8a_state, crtc_vsync),
- NULL
-};
-
static const ay8910_interface psg_intf =
{
AY8910_LEGACY_OUTPUT,
@@ -302,7 +287,13 @@ static MACHINE_CONFIG_START( lola8a, lola8a_state )
MCFG_SCREEN_UPDATE_DEVICE(HD46505SP_TAG, hd6845_device, screen_update)
MCFG_SCREEN_SIZE(640, 480)
MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
- MCFG_MC6845_ADD(HD46505SP_TAG, HD6845, "screen", XTAL_8MHz / 8, hd46505sp_intf) // HD6845 == HD46505S
+
+ MCFG_MC6845_ADD(HD46505SP_TAG, HD6845, "screen", XTAL_8MHz / 8) // HD6845 == HD46505S
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
+ MCFG_MC6845_UPDATE_ROW_CB(lola8a_state, crtc_update_row)
+ MCFG_MC6845_OUT_VSYNC_CB(WRITELINE(lola8a_state, crtc_vsync))
+
MCFG_PALETTE_ADD("palette", 8)
MCFG_PALETTE_INIT_OWNER(lola8a_state, lola8a)
diff --git a/src/mess/drivers/m20.c b/src/mess/drivers/m20.c
index 483651821cf..ba13f0f1802 100644
--- a/src/mess/drivers/m20.c
+++ b/src/mess/drivers/m20.c
@@ -830,21 +830,6 @@ void m20_state::machine_reset()
}
-static MC6845_INTERFACE( mc6845_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 16, /* number of pixels per video memory address */
- NULL, /* before pixel update callback */
- NULL, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_NULL, /* VSYNC callback */
- NULL /* update address callback */
-};
-
WRITE_LINE_MEMBER(m20_state::kbd_rxrdy_int)
{
m_i8259->ir4_w(state);
@@ -922,7 +907,10 @@ static MACHINE_CONFIG_START( m20, m20_state )
MCFG_WD_FDC_INTRQ_CALLBACK(DEVWRITELINE("i8259", pic8259_device, ir0_w))
MCFG_FLOPPY_DRIVE_ADD("fd1797:0", m20_floppies, "5dd", m20_state::floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("fd1797:1", m20_floppies, "5dd", m20_state::floppy_formats)
- MCFG_MC6845_ADD("crtc", MC6845, "screen", PIXEL_CLOCK/8, mc6845_intf) /* hand tuned to get ~50 fps */
+
+ MCFG_MC6845_ADD("crtc", MC6845, "screen", PIXEL_CLOCK/8) /* hand tuned to get ~50 fps */
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(16)
MCFG_DEVICE_ADD("ppi8255", I8255A, 0)
diff --git a/src/mess/drivers/mbc200.c b/src/mess/drivers/mbc200.c
index 3d29a1c33c5..2e4fc087ac9 100644
--- a/src/mess/drivers/mbc200.c
+++ b/src/mess/drivers/mbc200.c
@@ -133,26 +133,6 @@ void mbc200_state::machine_start()
m_floppy1->floppy_drive_set_ready_state(1, 1);
}
-MC6845_UPDATE_ROW( mbc200_update_row )
-{
-}
-
-
-static MC6845_INTERFACE( mbc200_crtc )
-{
- false,
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of dots per character */
- NULL,
- mbc200_update_row, /* handler to display a scanline */
- NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- NULL
-};
-
void mbc200_state::video_start()
{
}
@@ -253,8 +233,9 @@ static MACHINE_CONFIG_START( mbc200, mbc200_state )
MCFG_GFXDECODE_ADD("gfxdecode", "palette", mbc200)
MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
-
- MCFG_MC6845_ADD("crtc", H46505, "screen", XTAL_8MHz / 4, mbc200_crtc) // HD46505SP
+ MCFG_MC6845_ADD("crtc", H46505, "screen", XTAL_8MHz / 4) // HD46505SP
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
MCFG_DEVICE_ADD("ppi8255_1", I8255, 0)
diff --git a/src/mess/drivers/mbc55x.c b/src/mess/drivers/mbc55x.c
index 0d2c1ab3056..5b2b4eae3ab 100644
--- a/src/mess/drivers/mbc55x.c
+++ b/src/mess/drivers/mbc55x.c
@@ -277,7 +277,12 @@ static MACHINE_CONFIG_START( mbc55x, mbc55x_state )
MCFG_I8255_IN_PORTC_CB(READ8(mbc55x_state, mbc55x_ppi_portc_r))
MCFG_I8255_OUT_PORTC_CB(WRITE8(mbc55x_state, mbc55x_ppi_portc_w))
- MCFG_MC6845_ADD(VID_MC6845_NAME, MC6845, SCREEN_TAG, XTAL_14_31818MHz/8, mb55x_mc6845_intf)
+ MCFG_MC6845_ADD(VID_MC6845_NAME, MC6845, SCREEN_TAG, XTAL_14_31818MHz/8)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
+ MCFG_MC6845_UPDATE_ROW_CB(mbc55x_state, crtc_update_row)
+ MCFG_MC6845_OUT_VSYNC_CB(WRITELINE(mbc55x_state, vid_hsync_changed))
+ MCFG_MC6845_OUT_HSYNC_CB(WRITELINE(mbc55x_state, vid_vsync_changed))
/* Backing storage */
MCFG_FD1793_ADD(FDC_TAG, mbc55x_wd17xx_interface )
diff --git a/src/mess/drivers/mbee.c b/src/mess/drivers/mbee.c
index a33b2d5fa86..ed543170355 100644
--- a/src/mess/drivers/mbee.c
+++ b/src/mess/drivers/mbee.c
@@ -660,67 +660,6 @@ static SLOT_INTERFACE_START( mbee_floppies )
SLOT_INTERFACE_END
-static MC6845_INTERFACE( mbee_crtc )
-{
- false,
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of dots per character */
- NULL,
- mbee_update_row, /* handler to display a scanline */
- NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- mbee_update_addr /* handler to process transparent mode */
-};
-
-
-static MC6845_INTERFACE( mbeeic_crtc )
-{
- false,
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of dots per character */
- NULL,
- mbeeic_update_row, /* handler to display a scanline */
- NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- mbee_update_addr /* handler to process transparent mode */
-};
-
-static MC6845_INTERFACE( mbeeppc_crtc )
-{
- false,
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of dots per character */
- NULL,
- mbeeppc_update_row, /* handler to display a scanline */
- NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- mbee_update_addr /* handler to process transparent mode */
-};
-
-static MC6845_INTERFACE( mbee256_crtc )
-{
- false,
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of dots per character */
- NULL,
- mbeeppc_update_row, /* handler to display a scanline */
- NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- mbee256_update_addr /* handler to process transparent mode */
-};
-
static const cassette_interface mbee_cassette_interface =
{
mbee_cassette_formats,
@@ -766,7 +705,12 @@ static MACHINE_CONFIG_START( mbee, mbee_state )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
/* devices */
- MCFG_MC6845_ADD("crtc", SY6545_1, "screen", XTAL_12MHz / 8, mbee_crtc)
+ MCFG_MC6845_ADD("crtc", SY6545_1, "screen", XTAL_12MHz / 8)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
+ MCFG_MC6845_UPDATE_ROW_CB(mbee_state, mbee_update_row)
+ MCFG_MC6845_ADDR_CHANGED_CB(mbee_state, mbee_update_addr)
+
MCFG_QUICKLOAD_ADD("quickload", mbee_state, mbee, "mwb,com,bee", 2)
MCFG_QUICKLOAD_ADD("quickload2", mbee_state, mbee_z80bin, "bin", 2)
@@ -817,7 +761,12 @@ static MACHINE_CONFIG_START( mbeeic, mbee_state )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
/* devices */
- MCFG_MC6845_ADD("crtc", SY6545_1, "screen", XTAL_13_5MHz / 8, mbeeic_crtc)
+ MCFG_MC6845_ADD("crtc", SY6545_1, "screen", XTAL_13_5MHz / 8)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
+ MCFG_MC6845_UPDATE_ROW_CB(mbee_state, mbeeic_update_row)
+ MCFG_MC6845_ADDR_CHANGED_CB(mbee_state, mbee_update_addr)
+
MCFG_QUICKLOAD_ADD("quickload", mbee_state, mbee, "mwb,com,bee", 2)
MCFG_QUICKLOAD_ADD("quickload2", mbee_state, mbee_z80bin, "bin", 2)
@@ -854,8 +803,13 @@ static MACHINE_CONFIG_DERIVED( mbeeppc, mbeeic )
MCFG_PALETTE_MODIFY("palette")
MCFG_PALETTE_ENTRIES(16)
MCFG_PALETTE_INIT_OWNER(mbee_state,mbeeppc)
+
MCFG_DEVICE_REMOVE("crtc")
- MCFG_MC6845_ADD("crtc", SY6545_1, "screen", XTAL_13_5MHz / 8, mbeeppc_crtc)
+ MCFG_MC6845_ADD("crtc", SY6545_1, "screen", XTAL_13_5MHz / 8)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
+ MCFG_MC6845_UPDATE_ROW_CB(mbee_state, mbeeppc_update_row)
+ MCFG_MC6845_ADDR_CHANGED_CB(mbee_state, mbee_update_addr)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( mbee56, mbeeic )
@@ -890,8 +844,13 @@ static MACHINE_CONFIG_DERIVED( mbee256, mbee128 )
MCFG_CPU_IO_MAP(mbee256_io)
MCFG_MACHINE_RESET_OVERRIDE(mbee_state, mbee256 )
MCFG_MC146818_ADD( "rtc", XTAL_32_768kHz )
+
MCFG_DEVICE_REMOVE("crtc")
- MCFG_MC6845_ADD("crtc", SY6545_1, "screen", XTAL_13_5MHz / 8, mbee256_crtc)
+ MCFG_MC6845_ADD("crtc", SY6545_1, "screen", XTAL_13_5MHz / 8)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
+ MCFG_MC6845_UPDATE_ROW_CB(mbee_state, mbeeppc_update_row)
+ MCFG_MC6845_ADDR_CHANGED_CB(mbee_state, mbee256_update_addr)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( mbeett, mbeeppc )
@@ -900,8 +859,13 @@ static MACHINE_CONFIG_DERIVED( mbeett, mbeeppc )
MCFG_CPU_IO_MAP(mbeett_io)
MCFG_MACHINE_RESET_OVERRIDE(mbee_state, mbeett )
MCFG_MC146818_ADD( "rtc", XTAL_32_768kHz )
+
MCFG_DEVICE_REMOVE("crtc")
- MCFG_MC6845_ADD("crtc", SY6545_1, "screen", XTAL_13_5MHz / 8, mbee256_crtc)
+ MCFG_MC6845_ADD("crtc", SY6545_1, "screen", XTAL_13_5MHz / 8)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
+ MCFG_MC6845_UPDATE_ROW_CB(mbee_state, mbeeppc_update_row)
+ MCFG_MC6845_ADDR_CHANGED_CB(mbee_state, mbee256_update_addr)
MACHINE_CONFIG_END
/* Unused roms:
diff --git a/src/mess/drivers/multi16.c b/src/mess/drivers/multi16.c
index d6cef937648..fb96621bf98 100644
--- a/src/mess/drivers/multi16.c
+++ b/src/mess/drivers/multi16.c
@@ -127,21 +127,6 @@ void multi16_state::machine_reset()
}
-static MC6845_INTERFACE( mc6845_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of pixels per video memory address */
- NULL, /* before pixel update callback */
- NULL, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_NULL, /* VSYNC callback */
- NULL /* update address callback */
-};
-
static MACHINE_CONFIG_START( multi16, multi16_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", I8086, 8000000)
@@ -160,8 +145,11 @@ static MACHINE_CONFIG_START( multi16, multi16_state )
MCFG_PALETTE_ADD("palette", 8)
- /* Devices */
- MCFG_MC6845_ADD("crtc", H46505, "screen", 16000000/5, mc6845_intf) /* unknown clock, hand tuned to get ~60 fps */
+ /* devices */
+ MCFG_MC6845_ADD("crtc", H46505, "screen", 16000000/5) /* unknown clock, hand tuned to get ~60 fps */
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
+
MCFG_PIC8259_ADD( "pic8259", INPUTLINE("maincpu", 0), GND, NULL )
MACHINE_CONFIG_END
diff --git a/src/mess/drivers/multi8.c b/src/mess/drivers/multi8.c
index 28f5ec2b586..3c01000b25e 100644
--- a/src/mess/drivers/multi8.c
+++ b/src/mess/drivers/multi8.c
@@ -560,21 +560,6 @@ static GFXDECODE_START( multi8 )
GFXDECODE_END
-static MC6845_INTERFACE( mc6845_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of pixels per video memory address */
- NULL, /* before pixel update callback */
- NULL, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_NULL, /* VSYNC callback */
- NULL /* update address callback */
-};
-
PALETTE_INIT_MEMBER(multi8_state, multi8)
{
UINT8 i;
@@ -676,9 +661,12 @@ static MACHINE_CONFIG_START( multi8, multi8_state )
MCFG_SOUND_ADD("beeper", BEEP, 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS,"mono",0.50)
- /* Devices */
+ /* devices */
MCFG_TIMER_DRIVER_ADD_PERIODIC("keyboard_timer", multi8_state, keyboard_callback, attotime::from_hz(240/32))
- MCFG_MC6845_ADD("crtc", H46505, "screen", XTAL_3_579545MHz/2, mc6845_intf) /* unknown clock, hand tuned to get ~60 fps */
+
+ MCFG_MC6845_ADD("crtc", H46505, "screen", XTAL_3_579545MHz/2) /* unknown clock, hand tuned to get ~60 fps */
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
MCFG_DEVICE_ADD("ppi8255_0", I8255, 0)
MCFG_I8255_IN_PORTA_CB(READ8(multi8_state, porta_r))
diff --git a/src/mess/drivers/mx2178.c b/src/mess/drivers/mx2178.c
index 6a46dc37c42..18fb00807dc 100644
--- a/src/mess/drivers/mx2178.c
+++ b/src/mess/drivers/mx2178.c
@@ -41,6 +41,7 @@ public:
DECLARE_READ8_MEMBER(keyin_r);
DECLARE_WRITE8_MEMBER(kbd_put);
DECLARE_WRITE_LINE_MEMBER(write_acia_clock);
+ MC6845_UPDATE_ROW(crtc_update_row);
const UINT8 *m_p_chargen;
required_shared_ptr<UINT8> m_p_videoram;
@@ -96,10 +97,9 @@ WRITE8_MEMBER( mx2178_state::kbd_put )
m_maincpu->set_input_line(0, HOLD_LINE);
}
-static MC6845_UPDATE_ROW( update_row )
+MC6845_UPDATE_ROW( mx2178_state::crtc_update_row )
{
- mx2178_state *state = device->machine().driver_data<mx2178_state>();
- const rgb_t *pens = state->m_palette->palette()->entry_list_raw();
+ const rgb_t *pens = m_palette->palette()->entry_list_raw();
UINT8 chr,gfx;
UINT16 mem,x;
UINT32 *p = &bitmap.pix32(y);
@@ -107,10 +107,10 @@ static MC6845_UPDATE_ROW( update_row )
for (x = 0; x < x_count; x++)
{
mem = (ma + x) & 0x7ff;
- chr = state->m_p_videoram[mem];
+ chr = m_p_videoram[mem];
/* get pattern of pixels for that character scanline */
- gfx = state->m_p_chargen[(chr<<4) | ra] ^ ((x == cursor_x) ? 0xff : 0);
+ gfx = m_p_chargen[(chr<<4) | ra] ^ ((x == cursor_x) ? 0xff : 0);
/* Display a scanline of a character (8 pixels) */
*p++ = pens[BIT(gfx, 7)];
@@ -124,21 +124,6 @@ static MC6845_UPDATE_ROW( update_row )
}
}
-static MC6845_INTERFACE( crtc_interface )
-{
- false,
- 0,0,0,0,
- 8,
- NULL,
- update_row,
- NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- NULL
-};
-
/* F4 Character Displayer */
static const gfx_layout mx2178_charlayout =
{
@@ -185,7 +170,10 @@ static MACHINE_CONFIG_START( mx2178, mx2178_state )
MCFG_PALETTE_ADD_MONOCHROME_GREEN("palette")
/* Devices */
- MCFG_MC6845_ADD("crtc", MC6845, "screen", 18869600 / 8, crtc_interface) // clk unknown
+ MCFG_MC6845_ADD("crtc", MC6845, "screen", 18869600 / 8) // clk unknown
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
+ MCFG_MC6845_UPDATE_ROW_CB(mx2178_state, crtc_update_row)
MCFG_DEVICE_ADD("acia", ACIA6850, 0)
diff --git a/src/mess/drivers/myb3k.c b/src/mess/drivers/myb3k.c
index fd64e59cb91..f90339d3400 100644
--- a/src/mess/drivers/myb3k.c
+++ b/src/mess/drivers/myb3k.c
@@ -233,22 +233,6 @@ static GFXDECODE_START( myb3k )
GFXDECODE_ENTRY( "ipl", 0x0000, myb3k_charlayout, 0, 1 )
GFXDECODE_END
-static MC6845_INTERFACE( mc6845_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of pixels per video memory address */
- NULL, /* before pixel update callback */
- NULL, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_NULL, /* VSYNC callback */
- NULL /* update address callback */
-};
-
-
static const wd17xx_interface myb3k_wd17xx_interface =
{
DEVCB_NULL,
@@ -291,7 +275,10 @@ static MACHINE_CONFIG_START( myb3k, myb3k_state )
MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
/* Devices */
- MCFG_MC6845_ADD("crtc", H46505, "screen", XTAL_3_579545MHz/4, mc6845_intf) /* unknown clock, hand tuned to get ~60 fps */
+ MCFG_MC6845_ADD("crtc", H46505, "screen", XTAL_3_579545MHz/4) /* unknown clock, hand tuned to get ~60 fps */
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
+
MCFG_MB8877_ADD("fdc", myb3k_wd17xx_interface ) //unknown type
MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(myb3k_floppy_interface)
MACHINE_CONFIG_END
diff --git a/src/mess/drivers/mycom.c b/src/mess/drivers/mycom.c
index f73dab885df..e275b06e37b 100644
--- a/src/mess/drivers/mycom.c
+++ b/src/mess/drivers/mycom.c
@@ -93,6 +93,7 @@ public:
DECLARE_DRIVER_INIT(mycom);
TIMER_DEVICE_CALLBACK_MEMBER(mycom_kbd);
DECLARE_WRITE8_MEMBER(mycom_rtc_w);
+ MC6845_UPDATE_ROW(crtc_update_row);
UINT8 *m_p_videoram;
UINT8 *m_p_chargen;
UINT8 m_0a;
@@ -130,22 +131,21 @@ void mycom_state::video_start()
m_p_chargen = memregion("chargen")->base();
}
-static MC6845_UPDATE_ROW( mycom_update_row )
+MC6845_UPDATE_ROW( mycom_state::crtc_update_row )
{
- mycom_state *state = device->machine().driver_data<mycom_state>();
- const rgb_t *palette = state->m_palette->palette()->entry_list_raw();
+ const rgb_t *palette = m_palette->palette()->entry_list_raw();
UINT8 chr,gfx=0,z;
UINT16 mem,x;
UINT32 *p = &bitmap.pix32(y);
- if (state->m_0a & 0x40)
+ if (m_0a & 0x40)
{
for (x = 0; x < x_count; x++) // lores pixels
{
UINT8 dbit=1;
if (x == cursor_x) dbit=0;
mem = (ma + x) & 0x7ff;
- chr = state->m_p_videoram[mem];
+ chr = m_p_videoram[mem];
z = ra / 3;
*p++ = palette[BIT( chr, z ) ? dbit: dbit^1];
*p++ = palette[BIT( chr, z ) ? dbit: dbit^1];
@@ -169,8 +169,8 @@ static MC6845_UPDATE_ROW( mycom_update_row )
gfx = inv; // some blank spacing lines
else
{
- chr = state->m_p_videoram[mem];
- gfx = state->m_p_chargen[(chr<<3) | ra] ^ inv;
+ chr = m_p_videoram[mem];
+ gfx = m_p_chargen[(chr<<3) | ra] ^ inv;
}
/* Display a scanline of a character */
@@ -339,21 +339,6 @@ static GFXDECODE_START( mycom )
GFXDECODE_ENTRY( "chargen", 0x0000, mycom_charlayout, 0, 1 )
GFXDECODE_END
-static MC6845_INTERFACE( mc6845_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of pixels per video memory address */
- NULL, /* before pixel update callback */
- mycom_update_row, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_NULL, /* VSYNC callback */
- NULL /* update address callback */
-};
-
WRITE8_MEMBER( mycom_state::mycom_04_w )
{
m_i_videoram = (m_i_videoram & 0x700) | data;
@@ -549,7 +534,10 @@ static MACHINE_CONFIG_START( mycom, mycom_state )
/* Manual states clock is 1.008mhz for 40 cols, and 2.016 mhz for 80 cols.
The CRTC is a HD46505S - same as a 6845. The start registers need to be readable. */
- MCFG_MC6845_ADD("crtc", MC6845, "screen", 1008000, mc6845_intf)
+ MCFG_MC6845_ADD("crtc", MC6845, "screen", 1008000)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
+ MCFG_MC6845_UPDATE_ROW_CB(mycom_state, crtc_update_row)
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/paso1600.c b/src/mess/drivers/paso1600.c
index a950482813f..3720c89acdf 100644
--- a/src/mess/drivers/paso1600.c
+++ b/src/mess/drivers/paso1600.c
@@ -271,21 +271,6 @@ static GFXDECODE_START( paso1600 )
GFXDECODE_END
-static MC6845_INTERFACE( mc6845_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of pixels per video memory address */
- NULL, /* before pixel update callback */
- NULL, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_NULL, /* VSYNC callback */
- NULL /* update address callback */
-};
-
void paso1600_state::machine_start()
{
}
@@ -333,8 +318,12 @@ static MACHINE_CONFIG_START( paso1600, paso1600_state )
// MCFG_PALETTE_INIT(black_and_white)
/* Devices */
- MCFG_MC6845_ADD("crtc", H46505, "screen", 16000000/4, mc6845_intf) /* unknown clock, hand tuned to get ~60 fps */
+ MCFG_MC6845_ADD("crtc", H46505, "screen", 16000000/4) /* unknown clock, hand tuned to get ~60 fps */
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
+
MCFG_PIC8259_ADD( "pic8259", INPUTLINE("maincpu", 0), GND, NULL )
+
MCFG_DEVICE_ADD("8237dma", AM9517A, 16000000/4)
MCFG_I8237_IN_MEMR_CB(READ8(paso1600_state, pc_dma_read_byte))
MCFG_I8237_OUT_MEMW_CB(WRITE8(paso1600_state, pc_dma_write_byte))
diff --git a/src/mess/drivers/pasopia.c b/src/mess/drivers/pasopia.c
index b9b7ca2e94a..e8a1a33123d 100644
--- a/src/mess/drivers/pasopia.c
+++ b/src/mess/drivers/pasopia.c
@@ -58,6 +58,7 @@ public:
DECLARE_READ8_MEMBER(mux_r);
DECLARE_READ8_MEMBER(keyb_r);
DECLARE_WRITE8_MEMBER(mux_w);
+ MC6845_UPDATE_ROW(crtc_update_row);
UINT8 m_hblank;
UINT16 m_vram_addr;
@@ -85,11 +86,10 @@ void pasopia_state::video_start()
{
}
-MC6845_UPDATE_ROW( pasopia_update_row )
+MC6845_UPDATE_ROW( pasopia_state::crtc_update_row )
{
- pasopia_state *state = device->machine().driver_data<pasopia_state>();
- const rgb_t *palette = state->m_palette->palette()->entry_list_raw();
- UINT8 *m_p_chargen = state->memregion("chargen")->base();
+ const rgb_t *palette = m_palette->palette()->entry_list_raw();
+ UINT8 *m_p_chargen = memregion("chargen")->base();
UINT8 chr,gfx,fg=7,bg=0; // colours need to be determined
UINT16 mem,x;
UINT32 *p = &bitmap.pix32(y);
@@ -99,7 +99,7 @@ MC6845_UPDATE_ROW( pasopia_update_row )
UINT8 inv=0;
if (x == cursor_x) inv=0xff;
mem = (ma + x) & 0xfff;
- chr = state->m_p_vram[mem];
+ chr = m_p_vram[mem];
/* get pattern of pixels for that character scanline */
gfx = m_p_chargen[(chr<<3) | ra] ^ inv;
@@ -253,21 +253,6 @@ WRITE8_MEMBER( pasopia_state::mux_w )
m_mux_data = data;
}
-static MC6845_INTERFACE( mc6845_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of pixels per video memory address */
- NULL, /* before pixel update callback */
- pasopia_update_row, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_NULL, /* VSYNC callback */
- NULL /* update address callback */
-};
-
static const gfx_layout p7_chars_8x8 =
{
8,8,
@@ -313,7 +298,6 @@ static MACHINE_CONFIG_START( pasopia, pasopia_state )
MCFG_CPU_IO_MAP(pasopia_io)
MCFG_CPU_CONFIG(pasopia_daisy)
-
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
@@ -325,7 +309,10 @@ static MACHINE_CONFIG_START( pasopia, pasopia_state )
MCFG_PALETTE_ADD("palette", 8)
/* Devices */
- MCFG_MC6845_ADD("crtc", H46505, "screen", XTAL_4MHz/4, mc6845_intf) /* unknown clock, hand tuned to get ~60 fps */
+ MCFG_MC6845_ADD("crtc", H46505, "screen", XTAL_4MHz/4) /* unknown clock, hand tuned to get ~60 fps */
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
+ MCFG_MC6845_UPDATE_ROW_CB(pasopia_state, crtc_update_row)
MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0)
MCFG_I8255_OUT_PORTA_CB(WRITE8(pasopia_state, vram_addr_lo_w))
diff --git a/src/mess/drivers/pasopia7.c b/src/mess/drivers/pasopia7.c
index c2631be19d8..77e4de73dc7 100644
--- a/src/mess/drivers/pasopia7.c
+++ b/src/mess/drivers/pasopia7.c
@@ -729,21 +729,6 @@ static GFXDECODE_START( pasopia7 )
GFXDECODE_ENTRY( "kanji", 0x00000, p7_chars_16x16, 0, 0x10 )
GFXDECODE_END
-static MC6845_INTERFACE( mc6845_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of pixels per video memory address */
- NULL, /* before pixel update callback */
- NULL, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_NULL, /* VSYNC callback */
- NULL /* update address callback */
-};
-
READ8_MEMBER( pasopia7_state::mux_r )
{
return m_mux_data;
@@ -998,7 +983,9 @@ static MACHINE_CONFIG_DERIVED( p7_raster, p7_base )
MCFG_PALETTE_INIT_OWNER(pasopia7_state,p7_raster)
MCFG_GFXDECODE_ADD("gfxdecode", "palette", pasopia7 )
- MCFG_MC6845_ADD("crtc", H46505, "screen", VDP_CLOCK, mc6845_intf) /* unknown clock, hand tuned to get ~60 fps */
+ MCFG_MC6845_ADD("crtc", H46505, "screen", VDP_CLOCK) /* unknown clock, hand tuned to get ~60 fps */
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
MACHINE_CONFIG_END
@@ -1016,7 +1003,10 @@ static MACHINE_CONFIG_DERIVED( p7_lcd, p7_base )
MCFG_PALETTE_INIT_OWNER(pasopia7_state,p7_lcd)
MCFG_GFXDECODE_ADD("gfxdecode", "palette", pasopia7 )
- MCFG_MC6845_ADD("crtc", H46505, "screen", LCD_CLOCK, mc6845_intf) /* unknown clock, hand tuned to get ~60 fps */
+ MCFG_MC6845_ADD("crtc", H46505, "screen", LCD_CLOCK) /* unknown clock, hand tuned to get ~60 fps */
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
+
MCFG_DEFAULT_LAYOUT( layout_lcd )
MACHINE_CONFIG_END
diff --git a/src/mess/drivers/pet.c b/src/mess/drivers/pet.c
index 40e3be08520..5baa372c11a 100644
--- a/src/mess/drivers/pet.c
+++ b/src/mess/drivers/pet.c
@@ -1071,22 +1071,19 @@ UINT32 pet_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, con
//-------------------------------------------------
-// MC6845_INTERFACE( crtc_intf )
+// MC6845 PET80
//-------------------------------------------------
-static MC6845_BEGIN_UPDATE( pet_begin_update )
+MC6845_BEGIN_UPDATE( pet_state::pet_begin_update )
{
bitmap.fill(rgb_t::black);
-
- return 0;
}
-static MC6845_UPDATE_ROW( pet80_update_row )
+MC6845_UPDATE_ROW( pet80_state::pet80_update_row )
{
- pet80_state *state = device->machine().driver_data<pet80_state>();
int x = 0;
- int char_rom_mask = state->m_char_rom->bytes() - 1;
- const pen_t *pen = state->m_palette->pens();
+ int char_rom_mask = m_char_rom->bytes() - 1;
+ const pen_t *pen = m_palette->pens();
hbp = 80;
for (int column = 0; column < x_count; column++)
@@ -1099,10 +1096,10 @@ static MC6845_UPDATE_ROW( pet80_update_row )
// even character
- lsd = state->m_video_ram[((ma + column) << 1) & 0x7ff];
+ lsd = m_video_ram[((ma + column) << 1) & 0x7ff];
- offs_t char_addr = (chr_option << 11) | (state->m_graphic << 10) | ((lsd & 0x7f) << 3) | rra;
- data = state->m_char_rom->base()[char_addr & char_rom_mask];
+ offs_t char_addr = (chr_option << 11) | (m_graphic << 10) | ((lsd & 0x7f) << 3) | rra;
+ data = m_char_rom->base()[char_addr & char_rom_mask];
for (int bit = 0; bit < 8; bit++, data <<= 1)
{
@@ -1112,10 +1109,10 @@ static MC6845_UPDATE_ROW( pet80_update_row )
// odd character
- lsd = state->m_video_ram[(((ma + column) << 1) + 1) & 0x7ff];
+ lsd = m_video_ram[(((ma + column) << 1) + 1) & 0x7ff];
- char_addr = (chr_option << 11) | (state->m_graphic << 10) | ((lsd & 0x7f) << 3) | rra;
- data = state->m_char_rom->base()[char_addr & char_rom_mask];
+ char_addr = (chr_option << 11) | (m_graphic << 10) | ((lsd & 0x7f) << 3) | rra;
+ data = m_char_rom->base()[char_addr & char_rom_mask];
for (int bit = 0; bit < 8; bit++, data <<= 1)
{
@@ -1125,32 +1122,16 @@ static MC6845_UPDATE_ROW( pet80_update_row )
}
}
-static MC6845_INTERFACE( crtc_intf )
-{
- true,
- 0,0,0,0,
- 2*8,
- pet_begin_update,
- pet80_update_row,
- NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_DEVICE_LINE_MEMBER(M6520_1_TAG, pia6821_device, cb1_w),
- NULL
-};
-
//-------------------------------------------------
-// MC6845_INTERFACE( pet40_crtc_intf )
+// MC6845 PET40
//-------------------------------------------------
-static MC6845_UPDATE_ROW( pet40_update_row )
+MC6845_UPDATE_ROW( pet_state::pet40_update_row )
{
- pet_state *state = device->machine().driver_data<pet_state>();
int x = 0;
- int char_rom_mask = state->m_char_rom->bytes() - 1;
- const pen_t *pen = state->m_palette->pens();
+ int char_rom_mask = m_char_rom->bytes() - 1;
+ const pen_t *pen = m_palette->pens();
hbp = 41;
for (int column = 0; column < x_count; column++)
@@ -1161,10 +1142,10 @@ static MC6845_UPDATE_ROW( pet40_update_row )
int invert = BIT(ma, 12);
int chr_option = BIT(ma, 13);
- lsd = state->m_video_ram[(ma + column) & 0x3ff];
+ lsd = m_video_ram[(ma + column) & 0x3ff];
- offs_t char_addr = (chr_option << 11) | (state->m_graphic << 10) | ((lsd & 0x7f) << 3) | rra;
- data = state->m_char_rom->base()[char_addr & char_rom_mask];
+ offs_t char_addr = (chr_option << 11) | (m_graphic << 10) | ((lsd & 0x7f) << 3) | rra;
+ data = m_char_rom->base()[char_addr & char_rom_mask];
for (int bit = 0; bit < 8; bit++, data <<= 1)
{
@@ -1174,32 +1155,16 @@ static MC6845_UPDATE_ROW( pet40_update_row )
}
}
-static MC6845_INTERFACE( pet40_crtc_intf )
-{
- true,
- 0,0,0,0,
- 8,
- pet_begin_update,
- pet40_update_row,
- NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_DEVICE_LINE_MEMBER(M6520_1_TAG, pia6821_device, cb1_w),
- NULL
-};
-
//-------------------------------------------------
-// MC6845_INTERFACE( cbm8296_crtc_intf )
+// MC6845 CBM8296
//-------------------------------------------------
-static MC6845_UPDATE_ROW( cbm8296_update_row )
+MC6845_UPDATE_ROW( pet80_state::cbm8296_update_row )
{
- pet80_state *state = device->machine().driver_data<pet80_state>();
int x = 0;
- int char_rom_mask = state->m_char_rom->bytes() - 1;
- const pen_t *pen = state->m_palette->pens();
+ int char_rom_mask = m_char_rom->bytes() - 1;
+ const pen_t *pen = m_palette->pens();
for (int column = 0; column < x_count; column++)
{
@@ -1213,10 +1178,10 @@ static MC6845_UPDATE_ROW( cbm8296_update_row )
// even character
- lsd = state->m_ram->pointer()[drma];
+ lsd = m_ram->pointer()[drma];
- offs_t char_addr = (chr_option << 11) | (state->m_graphic << 10) | ((lsd & 0x7f) << 3) | rra;
- data = state->m_char_rom->base()[char_addr & char_rom_mask];
+ offs_t char_addr = (chr_option << 11) | (m_graphic << 10) | ((lsd & 0x7f) << 3) | rra;
+ data = m_char_rom->base()[char_addr & char_rom_mask];
for (int bit = 0; bit < 8; bit++, data <<= 1)
{
@@ -1226,10 +1191,10 @@ static MC6845_UPDATE_ROW( cbm8296_update_row )
// odd character
- lsd = state->m_ram->pointer()[drma | 0x100];
+ lsd = m_ram->pointer()[drma | 0x100];
- char_addr = (chr_option << 11) | (state->m_graphic << 10) | ((lsd & 0x7f) << 3) | rra;
- data = state->m_char_rom->base()[char_addr & char_rom_mask];
+ char_addr = (chr_option << 11) | (m_graphic << 10) | ((lsd & 0x7f) << 3) | rra;
+ data = m_char_rom->base()[char_addr & char_rom_mask];
for (int bit = 0; bit < 8; bit++, data <<= 1)
{
@@ -1239,21 +1204,6 @@ static MC6845_UPDATE_ROW( cbm8296_update_row )
}
}
-static MC6845_INTERFACE( cbm8296_crtc_intf )
-{
- true,
- 0,0,0,0,
- 2*8,
- NULL,
- cbm8296_update_row,
- NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_DEVICE_LINE_MEMBER(M6520_1_TAG, pia6821_device, cb1_w),
- NULL
-};
-
//-------------------------------------------------
// SLOT_INTERFACE( cbm8296d_ieee488_devices )
@@ -1738,7 +1688,13 @@ static MACHINE_CONFIG_DERIVED( pet4032f, pet4000 )
MCFG_SCREEN_VISIBLE_AREA(0, 320 - 1, 0, 250 - 1)
MCFG_SCREEN_UPDATE_DEVICE(MC6845_TAG, mc6845_device, screen_update)
MCFG_DEVICE_REMOVE("sync_timer")
- MCFG_MC6845_ADD(MC6845_TAG, MC6845, SCREEN_TAG, XTAL_16MHz/16, pet40_crtc_intf)
+
+ MCFG_MC6845_ADD(MC6845_TAG, MC6845, SCREEN_TAG, XTAL_16MHz/16)
+ MCFG_MC6845_SHOW_BORDER_AREA(true)
+ MCFG_MC6845_CHAR_WIDTH(8)
+ MCFG_MC6845_BEGIN_UPDATE_CB(pet_state, pet_begin_update)
+ MCFG_MC6845_UPDATE_ROW_CB(pet_state, pet40_update_row)
+ MCFG_MC6845_OUT_VSYNC_CB(DEVWRITELINE(M6520_1_TAG, pia6821_device, cb1_w))
// sound hardware
MCFG_SPEAKER_STANDARD_MONO("mono")
@@ -1804,7 +1760,13 @@ static MACHINE_CONFIG_DERIVED( cbm4032f, cbm4000 )
MCFG_SCREEN_VISIBLE_AREA(0, 320 - 1, 0, 250 - 1)
MCFG_SCREEN_UPDATE_DEVICE(MC6845_TAG, mc6845_device, screen_update)
MCFG_DEVICE_REMOVE("sync_timer")
- MCFG_MC6845_ADD(MC6845_TAG, MC6845, SCREEN_TAG, XTAL_16MHz/16, pet40_crtc_intf)
+
+ MCFG_MC6845_ADD(MC6845_TAG, MC6845, SCREEN_TAG, XTAL_16MHz/16)
+ MCFG_MC6845_SHOW_BORDER_AREA(true)
+ MCFG_MC6845_CHAR_WIDTH(8)
+ MCFG_MC6845_BEGIN_UPDATE_CB(pet_state, pet_begin_update)
+ MCFG_MC6845_UPDATE_ROW_CB(pet_state, pet40_update_row)
+ MCFG_MC6845_OUT_VSYNC_CB(DEVWRITELINE(M6520_1_TAG, pia6821_device, cb1_w))
// sound hardware
MCFG_SPEAKER_STANDARD_MONO("mono")
@@ -1880,7 +1842,13 @@ static MACHINE_CONFIG_START( pet80, pet80_state )
MCFG_SCREEN_SIZE(640, 250)
MCFG_SCREEN_VISIBLE_AREA(0, 640 - 1, 0, 250 - 1)
MCFG_SCREEN_UPDATE_DEVICE(MC6845_TAG, mc6845_device, screen_update)
- MCFG_MC6845_ADD(MC6845_TAG, MC6845, SCREEN_TAG, XTAL_16MHz/16, crtc_intf)
+
+ MCFG_MC6845_ADD(MC6845_TAG, MC6845, SCREEN_TAG, XTAL_16MHz/16)
+ MCFG_MC6845_SHOW_BORDER_AREA(true)
+ MCFG_MC6845_CHAR_WIDTH(2*8)
+ MCFG_MC6845_BEGIN_UPDATE_CB(pet_state, pet_begin_update)
+ MCFG_MC6845_UPDATE_ROW_CB(pet80_state, pet80_update_row)
+ MCFG_MC6845_OUT_VSYNC_CB(DEVWRITELINE(M6520_1_TAG, pia6821_device, cb1_w))
MCFG_PALETTE_ADD_MONOCHROME_GREEN("palette")
@@ -2006,8 +1974,12 @@ static MACHINE_CONFIG_DERIVED_CLASS( cbm8296, pet80, cbm8296_state )
MCFG_PLS100_ADD(PLA1_TAG)
MCFG_PLS100_ADD(PLA2_TAG)
- MCFG_DEVICE_MODIFY(MC6845_TAG)
- MCFG_DEVICE_CONFIG(cbm8296_crtc_intf)
+ MCFG_DEVICE_REMOVE(MC6845_TAG)
+ MCFG_MC6845_ADD(MC6845_TAG, MC6845, SCREEN_TAG, XTAL_16MHz/16)
+ MCFG_MC6845_SHOW_BORDER_AREA(true)
+ MCFG_MC6845_CHAR_WIDTH(2*8)
+ MCFG_MC6845_UPDATE_ROW_CB(pet80_state, cbm8296_update_row)
+ MCFG_MC6845_OUT_VSYNC_CB(DEVWRITELINE(M6520_1_TAG, pia6821_device, cb1_w))
MCFG_DEVICE_MODIFY("ieee8")
MCFG_SLOT_DEFAULT_OPTION("c8250")
diff --git a/src/mess/drivers/pyl601.c b/src/mess/drivers/pyl601.c
index 26528a254c0..005928fd647 100644
--- a/src/mess/drivers/pyl601.c
+++ b/src/mess/drivers/pyl601.c
@@ -77,6 +77,8 @@ public:
DECLARE_WRITE8_MEMBER(led_w);
DECLARE_WRITE8_MEMBER(floppy_w);
DECLARE_READ8_MEMBER(floppy_r);
+ MC6845_UPDATE_ROW(pyl601_update_row);
+ MC6845_UPDATE_ROW(pyl601a_update_row);
UINT8 selectedline(UINT16 data);
required_device<speaker_sound_device> m_speaker;
required_device<upd765a_device> m_fdc;
@@ -383,19 +385,18 @@ void pyl601_state::video_start()
{
}
-static MC6845_UPDATE_ROW( pyl601_update_row )
+MC6845_UPDATE_ROW( pyl601_state::pyl601_update_row )
{
- pyl601_state *state = device->machine().driver_data<pyl601_state>();
- const rgb_t *palette = state->m_palette->palette()->entry_list_raw();
- UINT8 *charrom = state->memregion("chargen")->base();
+ const rgb_t *palette = m_palette->palette()->entry_list_raw();
+ UINT8 *charrom = memregion("chargen")->base();
int column, bit, i;
UINT8 data;
- if (BIT(state->m_video_mode, 5) == 0)
+ if (BIT(m_video_mode, 5) == 0)
{
for (column = 0; column < x_count; column++)
{
- UINT8 code = state->m_ram->pointer()[(((ma + column) & 0x0fff) + 0xf000)];
+ UINT8 code = m_ram->pointer()[(((ma + column) & 0x0fff) + 0xf000)];
code = ((code << 1) | (code >> 7)) & 0xff;
if (column == cursor_x-2)
data = 0xff;
@@ -416,7 +417,7 @@ static MC6845_UPDATE_ROW( pyl601_update_row )
{
for (i = 0; i < x_count; i++)
{
- data = state->m_ram->pointer()[(((ma + i) << 3) | (ra & 0x07)) & 0xffff];
+ data = m_ram->pointer()[(((ma + i) << 3) | (ra & 0x07)) & 0xffff];
for (bit = 0; bit < 8; bit++)
{
bitmap.pix32(y, (i * 8) + bit) = palette[BIT(data, 7)];
@@ -426,19 +427,18 @@ static MC6845_UPDATE_ROW( pyl601_update_row )
}
}
-static MC6845_UPDATE_ROW( pyl601a_update_row )
+MC6845_UPDATE_ROW( pyl601_state::pyl601a_update_row )
{
- pyl601_state *state = device->machine().driver_data<pyl601_state>();
- const rgb_t *palette = state->m_palette->palette()->entry_list_raw();
- UINT8 *charrom = state->memregion("chargen")->base();
+ const rgb_t *palette = m_palette->palette()->entry_list_raw();
+ UINT8 *charrom = memregion("chargen")->base();
int column, bit, i;
UINT8 data;
- if (BIT(state->m_video_mode, 5) == 0)
+ if (BIT(m_video_mode, 5) == 0)
{
for (column = 0; column < x_count; column++)
{
- UINT8 code = state->m_ram->pointer()[(((ma + column) & 0x0fff) + 0xf000)];
+ UINT8 code = m_ram->pointer()[(((ma + column) & 0x0fff) + 0xf000)];
data = charrom[((code << 4) | (ra & 0x07)) & 0xfff];
if (column == cursor_x)
data = 0xff;
@@ -457,7 +457,7 @@ static MC6845_UPDATE_ROW( pyl601a_update_row )
{
for (i = 0; i < x_count; i++)
{
- data = state->m_ram->pointer()[(((ma + i) << 3) | (ra & 0x07)) & 0xffff];
+ data = m_ram->pointer()[(((ma + i) << 3) | (ra & 0x07)) & 0xffff];
for (bit = 0; bit < 8; bit++)
{
bitmap.pix32(y, (i * 8) + bit) = palette[BIT(data, 7)];
@@ -469,36 +469,6 @@ static MC6845_UPDATE_ROW( pyl601a_update_row )
-static MC6845_INTERFACE( pyl601_crtc6845_interface )
-{
- false,
- 0,0,0,0,
- 8 /*?*/,
- NULL,
- pyl601_update_row,
- NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- NULL
-};
-
-static MC6845_INTERFACE( pyl601a_crtc6845_interface )
-{
- false,
- 0,0,0,0,
- 8 /*?*/,
- NULL,
- pyl601a_update_row,
- NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- NULL
-};
-
DRIVER_INIT_MEMBER(pyl601_state,pyl601)
{
memset(m_ram->pointer(), 0, 64 * 1024);
@@ -559,7 +529,6 @@ static MACHINE_CONFIG_START( pyl601, pyl601_state )
MCFG_CPU_PROGRAM_MAP(pyl601_mem)
MCFG_CPU_VBLANK_INT_DRIVER("screen", pyl601_state, pyl601_interrupt)
-
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(50)
@@ -576,7 +545,11 @@ static MACHINE_CONFIG_START( pyl601, pyl601_state )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
/* Devices */
- MCFG_MC6845_ADD("crtc", MC6845, "screen", XTAL_2MHz, pyl601_crtc6845_interface)
+ MCFG_MC6845_ADD("crtc", MC6845, "screen", XTAL_2MHz)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8) /* ? */
+ MCFG_MC6845_UPDATE_ROW_CB(pyl601_state, pyl601_update_row)
+
MCFG_UPD765A_ADD("upd765", true, true)
MCFG_FLOPPY_DRIVE_ADD("upd765:0", pyl601_floppies, "525hd", pyl601_state::floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("upd765:1", pyl601_floppies, "525hd", pyl601_state::floppy_formats)
@@ -592,8 +565,12 @@ static MACHINE_CONFIG_DERIVED( pyl601a, pyl601 )
MCFG_CPU_CLOCK( XTAL_2MHz)
MCFG_GFXDECODE_MODIFY("gfxdecode", pyl601a)
+
MCFG_DEVICE_REMOVE("crtc")
- MCFG_MC6845_ADD("crtc", MC6845, "screen", XTAL_2MHz, pyl601a_crtc6845_interface)
+ MCFG_MC6845_ADD("crtc", MC6845, "screen", XTAL_2MHz)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8) /* ? */
+ MCFG_MC6845_UPDATE_ROW_CB(pyl601_state, pyl601a_update_row)
MACHINE_CONFIG_END
/* ROM definition */
diff --git a/src/mess/drivers/sapi1.c b/src/mess/drivers/sapi1.c
index 1091b55501c..b41318516c4 100644
--- a/src/mess/drivers/sapi1.c
+++ b/src/mess/drivers/sapi1.c
@@ -73,6 +73,7 @@ public:
DECLARE_DRIVER_INIT(sapizps3b);
DECLARE_MACHINE_RESET(sapi1);
DECLARE_MACHINE_RESET(sapizps3);
+ MC6845_UPDATE_ROW(crtc_update_row);
UINT32 screen_update_sapi1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_sapi3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
private:
@@ -407,10 +408,9 @@ UINT32 sapi1_state::screen_update_sapi3(screen_device &screen, bitmap_ind16 &bit
return 0;
}
-static MC6845_UPDATE_ROW( update_row )
+MC6845_UPDATE_ROW( sapi1_state::crtc_update_row )
{
- sapi1_state *state = device->machine().driver_data<sapi1_state>();
- const rgb_t *palette = state->m_palette->palette()->entry_list_raw();
+ const rgb_t *palette = m_palette->palette()->entry_list_raw();
UINT8 chr,gfx,inv;
UINT16 mem,x;
UINT32 *p = &bitmap.pix32(y);
@@ -420,7 +420,7 @@ static MC6845_UPDATE_ROW( update_row )
inv = gfx = 0;
if (x == cursor_x) inv ^= 0xff;
mem = (2*(ma + x)) & 0xfff;
- chr = state->m_p_videoram[mem] & 0x3f;
+ chr = m_p_videoram[mem] & 0x3f;
if (ra < 8)
gfx = MHB2501[(chr<<3) | ra] ^ inv;
@@ -435,23 +435,6 @@ static MC6845_UPDATE_ROW( update_row )
}
}
-static MC6845_INTERFACE( mc6845_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 6, /* number of pixels per video memory address */
- NULL, /* before pixel update callback */
- update_row, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_NULL, /* VSYNC callback */
- NULL /* update address callback */
-};
-
-
-
/**************************************
Keyboard
@@ -598,7 +581,12 @@ static MACHINE_CONFIG_DERIVED( sapi3b, sapi3 )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(sapi3b_mem)
MCFG_CPU_IO_MAP(sapi3b_io)
- MCFG_MC6845_ADD("crtc", MC6845, "screen", 1008000, mc6845_intf) // guess
+
+ MCFG_MC6845_ADD("crtc", MC6845, "screen", 1008000) // guess
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(6)
+ MCFG_MC6845_UPDATE_ROW_CB(sapi1_state, crtc_update_row)
+
MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_UPDATE_DEVICE("crtc", mc6845_device, screen_update)
MCFG_SCREEN_NO_PALETTE
diff --git a/src/mess/drivers/smc777.c b/src/mess/drivers/smc777.c
index 199823d4dc3..b4637015beb 100644
--- a/src/mess/drivers/smc777.c
+++ b/src/mess/drivers/smc777.c
@@ -1003,21 +1003,6 @@ void smc777_state::machine_reset()
}
-static MC6845_INTERFACE( mc6845_intf )
-{
- true, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of pixels per video memory address */
- NULL, /* before pixel update callback */
- NULL, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_NULL, /* VSYNC callback */
- NULL /* update address callback */
-};
-
/* set-up SMC-70 mode colors */
PALETTE_INIT_MEMBER(smc777_state, smc777)
{
@@ -1096,7 +1081,9 @@ static MACHINE_CONFIG_START( smc777, smc777_state )
MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty)
- MCFG_MC6845_ADD("crtc", H46505, "screen", MASTER_CLOCK/2, mc6845_intf) /* unknown clock, hand tuned to get ~60 fps */
+ MCFG_MC6845_ADD("crtc", H46505, "screen", MASTER_CLOCK/2) /* unknown clock, hand tuned to get ~60 fps */
+ MCFG_MC6845_SHOW_BORDER_AREA(true)
+ MCFG_MC6845_CHAR_WIDTH(8)
MCFG_MB8876_ADD("fdc",smc777_mb8876_interface)
MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(smc777_floppy_interface)
diff --git a/src/mess/drivers/super80.c b/src/mess/drivers/super80.c
index 761ec55c3f3..4f6bc687157 100644
--- a/src/mess/drivers/super80.c
+++ b/src/mess/drivers/super80.c
@@ -656,21 +656,6 @@ static const cassette_interface super80_cassette_interface =
};
-static MC6845_INTERFACE( super80v_crtc )
-{
- false,
- 0,0,0,0, /* visarea adjustment */
- SUPER80V_DOTS, /* number of dots per character */
- NULL,
- super80v_update_row, /* handler to display a scanline */
- NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- NULL
-};
-
//-------------------------------------------------
// Z80DMA
//-------------------------------------------------
@@ -812,7 +797,10 @@ static MACHINE_CONFIG_START( super80v, super80_state )
MCFG_PALETTE_ADD("palette", 32)
MCFG_PALETTE_INIT_OWNER(super80_state,super80m)
- MCFG_MC6845_ADD("crtc", MC6845, "screen", MASTER_CLOCK / SUPER80V_DOTS, super80v_crtc)
+ MCFG_MC6845_ADD("crtc", MC6845, "screen", MASTER_CLOCK / SUPER80V_DOTS)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(SUPER80V_DOTS)
+ MCFG_MC6845_UPDATE_ROW_CB(super80_state, crtc_update_row)
MCFG_GFXDECODE_ADD("gfxdecode", "palette", super80v)
MCFG_DEFAULT_LAYOUT( layout_super80 )
diff --git a/src/mess/drivers/svi318.c b/src/mess/drivers/svi318.c
index 3abefa1d5cc..9b2f621e195 100644
--- a/src/mess/drivers/svi318.c
+++ b/src/mess/drivers/svi318.c
@@ -389,21 +389,6 @@ static MACHINE_CONFIG_DERIVED( svi328n, svi318n )
MACHINE_CONFIG_END
-static MC6845_INTERFACE( svi806_crtc6845_interface )
-{
- false,
- 0,0,0,0,
- 8 /*?*/,
- NULL,
- svi806_crtc6845_update_row,
- NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- NULL
-};
-
/* F4 Character Displayer */
static const gfx_layout svi328_charlayout =
{
@@ -460,7 +445,10 @@ static MACHINE_CONFIG_START( svi328_806, svi318_state )
MCFG_GFXDECODE_ADD("gfxdecode", "palette", svi328)
- MCFG_MC6845_ADD("crtc", MC6845, "svi806", XTAL_12MHz / 8, svi806_crtc6845_interface)
+ MCFG_MC6845_ADD("crtc", MC6845, "svi806", XTAL_12MHz / 8)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8) /* ? */
+ MCFG_MC6845_UPDATE_ROW_CB(svi318_state, crtc_update_row)
MCFG_VIDEO_START_OVERRIDE(svi318_state, svi328_806 )
diff --git a/src/mess/drivers/tavernie.c b/src/mess/drivers/tavernie.c
index 6dd97bb79e3..511201e2ed1 100644
--- a/src/mess/drivers/tavernie.c
+++ b/src/mess/drivers/tavernie.c
@@ -92,6 +92,7 @@ public:
DECLARE_MACHINE_RESET(cpu09);
DECLARE_MACHINE_RESET(ivg09);
DECLARE_WRITE_LINE_MEMBER(write_acia_clock);
+ MC6845_UPDATE_ROW(crtc_update_row);
const UINT8 *m_p_chargen;
optional_shared_ptr<UINT8> m_p_videoram;
@@ -206,10 +207,9 @@ WRITE8_MEMBER( tavernie_state::ds_w )
}
-static MC6845_UPDATE_ROW( update_row )
+MC6845_UPDATE_ROW( tavernie_state::crtc_update_row )
{
- tavernie_state *state = device->machine().driver_data<tavernie_state>();
- const rgb_t *palette = state->m_palette->palette()->entry_list_raw();
+ const rgb_t *palette = m_palette->palette()->entry_list_raw();
UINT8 chr,gfx=0;
UINT16 mem,x;
UINT32 *p = &bitmap.pix32(y);
@@ -223,8 +223,8 @@ static MC6845_UPDATE_ROW( update_row )
gfx = inv; // some blank spacing lines
else
{
- chr = state->m_p_videoram[mem];
- gfx = state->m_p_chargen[(chr<<4) | ra] ^ inv;
+ chr = m_p_videoram[mem];
+ gfx = m_p_chargen[(chr<<4) | ra] ^ inv;
}
/* Display a scanline of a character */
@@ -239,21 +239,6 @@ static MC6845_UPDATE_ROW( update_row )
}
}
-static MC6845_INTERFACE( mc6845_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of pixels per video memory address */
- NULL, /* before pixel update callback */
- update_row, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_NULL, /* VSYNC callback */
- NULL /* update address callback */
-};
-
READ8_MEMBER( tavernie_state::pa_r )
{
@@ -381,7 +366,11 @@ static MACHINE_CONFIG_DERIVED( ivg09, cpu09 )
/* Devices */
MCFG_DEVICE_ADD(KEYBOARD_TAG, GENERIC_KEYBOARD, 0)
MCFG_GENERIC_KEYBOARD_CB(WRITE8(tavernie_state, kbd_put))
- MCFG_MC6845_ADD("crtc", MC6845, "screen", 1008000, mc6845_intf) // unknown clock
+
+ MCFG_MC6845_ADD("crtc", MC6845, "screen", 1008000) // unknown clock
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
+ MCFG_MC6845_UPDATE_ROW_CB(tavernie_state, crtc_update_row)
MCFG_DEVICE_ADD("pia_ivg", PIA6821, 0)
MCFG_PIA_READPB_HANDLER(READ8(tavernie_state, pb_ivg_r))
diff --git a/src/mess/drivers/trs80m2.c b/src/mess/drivers/trs80m2.c
index 9f71593d172..86a7771774b 100644
--- a/src/mess/drivers/trs80m2.c
+++ b/src/mess/drivers/trs80m2.c
@@ -380,18 +380,17 @@ INPUT_PORTS_END
// VIDEO
//**************************************************************************
-static MC6845_UPDATE_ROW( trs80m2_update_row )
+MC6845_UPDATE_ROW( trs80m2_state::crtc_update_row )
{
- trs80m2_state *state = device->machine().driver_data<trs80m2_state>();
- const pen_t *pen = state->m_palette->pens();
+ const pen_t *pen = m_palette->pens();
int x = 0;
for (int column = 0; column < x_count; column++)
{
- UINT8 code = state->m_video_ram[(ma + column) & 0x7ff];
+ UINT8 code = m_video_ram[(ma + column) & 0x7ff];
offs_t address = ((code & 0x7f) << 4) | (ra & 0x0f);
- UINT8 data = state->m_char_rom->base()[address];
+ UINT8 data = m_char_rom->base()[address];
int dcursor = (column == cursor_x);
int drevid = BIT(code, 7);
@@ -427,21 +426,6 @@ WRITE_LINE_MEMBER( trs80m2_state::vsync_w )
}
}
-static MC6845_INTERFACE( mc6845_intf )
-{
- true,
- 0,0,0,0,
- 8,
- NULL,
- trs80m2_update_row,
- NULL,
- DEVCB_DRIVER_LINE_MEMBER(trs80m2_state, de_w),
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_DRIVER_LINE_MEMBER(trs80m2_state, vsync_w),
- NULL
-};
-
void trs80m2_state::video_start()
{
// allocate memory
@@ -734,7 +718,12 @@ static MACHINE_CONFIG_START( trs80m2, trs80m2_state )
MCFG_PALETTE_ADD_MONOCHROME_GREEN("palette")
- MCFG_MC6845_ADD(MC6845_TAG, MC6845, SCREEN_TAG, XTAL_12_48MHz/8, mc6845_intf)
+ MCFG_MC6845_ADD(MC6845_TAG, MC6845, SCREEN_TAG, XTAL_12_48MHz/8)
+ MCFG_MC6845_SHOW_BORDER_AREA(true)
+ MCFG_MC6845_CHAR_WIDTH(8)
+ MCFG_MC6845_UPDATE_ROW_CB(trs80m2_state, crtc_update_row)
+ MCFG_MC6845_OUT_DE_CB(WRITELINE(trs80m2_state, de_w))
+ MCFG_MC6845_OUT_VSYNC_CB(WRITELINE(trs80m2_state, vsync_w))
// devices
MCFG_FD1791x_ADD(FD1791_TAG, XTAL_8MHz/4)
@@ -819,7 +808,12 @@ static MACHINE_CONFIG_START( trs80m16, trs80m16_state )
MCFG_PALETTE_ADD_MONOCHROME_GREEN("palette")
- MCFG_MC6845_ADD(MC6845_TAG, MC6845, SCREEN_TAG, XTAL_12_48MHz/8, mc6845_intf)
+ MCFG_MC6845_ADD(MC6845_TAG, MC6845, SCREEN_TAG, XTAL_12_48MHz/8)
+ MCFG_MC6845_SHOW_BORDER_AREA(true)
+ MCFG_MC6845_CHAR_WIDTH(8)
+ MCFG_MC6845_UPDATE_ROW_CB(trs80m2_state, crtc_update_row)
+ MCFG_MC6845_OUT_DE_CB(WRITELINE(trs80m2_state, de_w))
+ MCFG_MC6845_OUT_VSYNC_CB(WRITELINE(trs80m2_state, vsync_w))
// devices
MCFG_FD1791x_ADD(FD1791_TAG, XTAL_8MHz/4)
diff --git a/src/mess/drivers/tvc.c b/src/mess/drivers/tvc.c
index 47230c3bb87..ead91f0c9e5 100644
--- a/src/mess/drivers/tvc.c
+++ b/src/mess/drivers/tvc.c
@@ -510,29 +510,28 @@ void tvc_state::machine_reset()
membank("bank2")->set_base(m_ram->pointer() + 0x4000);
}
-static MC6845_UPDATE_ROW( tvc_update_row )
+MC6845_UPDATE_ROW( tvc_state::crtc_update_row )
{
- tvc_state *state = device->machine().driver_data<tvc_state>();
- const rgb_t *palette = state->m_palette->palette()->entry_list_raw();
+ const rgb_t *palette = m_palette->palette()->entry_list_raw();
UINT32 *p = &bitmap.pix32(y);
- UINT8 *vram = state->memregion("vram")->base() + ((state->m_vram_bank & 0x30)<<10);
+ UINT8 *vram = memregion("vram")->base() + ((m_vram_bank & 0x30)<<10);
UINT16 offset = ((ma*4 + ra*0x40) & 0x3fff);
int i;
- switch(state->m_video_mode) {
+ switch(m_video_mode) {
case 0 :
// 2 colors mode
for ( i = 0; i < x_count; i++ )
{
UINT8 data = vram[offset + i];
- *p++ = palette[state->m_col[BIT(data,7)]];
- *p++ = palette[state->m_col[BIT(data,6)]];
- *p++ = palette[state->m_col[BIT(data,5)]];
- *p++ = palette[state->m_col[BIT(data,4)]];
- *p++ = palette[state->m_col[BIT(data,3)]];
- *p++ = palette[state->m_col[BIT(data,2)]];
- *p++ = palette[state->m_col[BIT(data,1)]];
- *p++ = palette[state->m_col[BIT(data,0)]];
+ *p++ = palette[m_col[BIT(data,7)]];
+ *p++ = palette[m_col[BIT(data,6)]];
+ *p++ = palette[m_col[BIT(data,5)]];
+ *p++ = palette[m_col[BIT(data,4)]];
+ *p++ = palette[m_col[BIT(data,3)]];
+ *p++ = palette[m_col[BIT(data,2)]];
+ *p++ = palette[m_col[BIT(data,1)]];
+ *p++ = palette[m_col[BIT(data,0)]];
}
break;
case 1 :
@@ -541,14 +540,14 @@ static MC6845_UPDATE_ROW( tvc_update_row )
for ( i = 0; i < x_count; i++ )
{
UINT8 data = vram[offset + i];
- *p++ = palette[state->m_col[BIT(data,3)*2 + BIT(data,7)]];
- *p++ = palette[state->m_col[BIT(data,3)*2 + BIT(data,7)]];
- *p++ = palette[state->m_col[BIT(data,2)*2 + BIT(data,6)]];
- *p++ = palette[state->m_col[BIT(data,2)*2 + BIT(data,6)]];
- *p++ = palette[state->m_col[BIT(data,1)*2 + BIT(data,5)]];
- *p++ = palette[state->m_col[BIT(data,1)*2 + BIT(data,5)]];
- *p++ = palette[state->m_col[BIT(data,0)*2 + BIT(data,4)]];
- *p++ = palette[state->m_col[BIT(data,0)*2 + BIT(data,4)]];
+ *p++ = palette[m_col[BIT(data,3)*2 + BIT(data,7)]];
+ *p++ = palette[m_col[BIT(data,3)*2 + BIT(data,7)]];
+ *p++ = palette[m_col[BIT(data,2)*2 + BIT(data,6)]];
+ *p++ = palette[m_col[BIT(data,2)*2 + BIT(data,6)]];
+ *p++ = palette[m_col[BIT(data,1)*2 + BIT(data,5)]];
+ *p++ = palette[m_col[BIT(data,1)*2 + BIT(data,5)]];
+ *p++ = palette[m_col[BIT(data,0)*2 + BIT(data,4)]];
+ *p++ = palette[m_col[BIT(data,0)*2 + BIT(data,4)]];
}
break;
default:
@@ -633,21 +632,6 @@ QUICKLOAD_LOAD_MEMBER( tvc_state,tvc64)
}
-static MC6845_INTERFACE( tvc_crtc6845_interface )
-{
- false,
- 0,0,0,0,
- 8 /*?*/,
- NULL,
- tvc_update_row,
- NULL,
- DEVCB_NULL,
- DEVCB_DRIVER_LINE_MEMBER(tvc_state, tvc_int_ff_set),
- DEVCB_NULL,
- DEVCB_NULL,
- NULL
-};
-
static const cassette_interface tvc_cassette_interface =
{
tvc64_cassette_formats,
@@ -679,7 +663,11 @@ static MACHINE_CONFIG_START( tvc, tvc_state )
MCFG_PALETTE_ADD( "palette", 16 )
MCFG_PALETTE_INIT_OWNER(tvc_state, tvc)
- MCFG_MC6845_ADD("crtc", MC6845, "screen", 3125000/2, tvc_crtc6845_interface) // clk taken from schematics
+ MCFG_MC6845_ADD("crtc", MC6845, "screen", 3125000/2) // clk taken from schematics
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8) /*?*/
+ MCFG_MC6845_UPDATE_ROW_CB(tvc_state, crtc_update_row)
+ MCFG_MC6845_OUT_CUR_CB(WRITELINE(tvc_state, tvc_int_ff_set))
/* internal ram */
MCFG_RAM_ADD(RAM_TAG)
diff --git a/src/mess/drivers/v6809.c b/src/mess/drivers/v6809.c
index a5eb5d31e3e..8d14abcd89a 100644
--- a/src/mess/drivers/v6809.c
+++ b/src/mess/drivers/v6809.c
@@ -90,6 +90,8 @@ public:
DECLARE_WRITE8_MEMBER(kbd_put);
DECLARE_WRITE_LINE_MEMBER(write_acia_clock);
DECLARE_MACHINE_RESET(v6809);
+ MC6845_UPDATE_ROW(crtc_update_row);
+ MC6845_ON_UPDATE_ADDR_CHANGED(crtc_update_addr);
UINT8 *m_p_videoram;
const UINT8 *m_p_chargen;
@@ -168,10 +170,9 @@ static GFXDECODE_START( v6809 )
GFXDECODE_ENTRY( "chargen", 0x0000, v6809_charlayout, 0, 1 )
GFXDECODE_END
-MC6845_UPDATE_ROW( v6809_update_row )
+MC6845_UPDATE_ROW( v6809_state::crtc_update_row )
{
- v6809_state *state = device->machine().driver_data<v6809_state>();
- const rgb_t *palette = state->m_palette->palette()->entry_list_raw();
+ const rgb_t *palette = m_palette->palette()->entry_list_raw();
UINT8 chr,gfx;
UINT16 mem,x;
UINT32 *p = &bitmap.pix32(y);
@@ -179,8 +180,8 @@ MC6845_UPDATE_ROW( v6809_update_row )
for (x = 0; x < x_count; x++)
{
mem = (ma + x) & 0x7ff;
- chr = state->m_p_videoram[mem];
- gfx = state->m_p_chargen[(chr<<4) | ra] ^ ((x == cursor_x) ? 0xff : 0);
+ chr = m_p_videoram[mem];
+ gfx = m_p_chargen[(chr<<4) | ra] ^ ((x == cursor_x) ? 0xff : 0);
/* Display a scanline of a character (8 pixels) */
*p++ = palette[BIT(gfx, 7)];
@@ -194,28 +195,12 @@ MC6845_UPDATE_ROW( v6809_update_row )
}
}
-MC6845_ON_UPDATE_ADDR_CHANGED( v6809_update_addr )
+MC6845_ON_UPDATE_ADDR_CHANGED( v6809_state::crtc_update_addr )
{
/* not sure what goes in here - parameters passed are device, address, strobe */
- v6809_state *state = device->machine().driver_data<v6809_state>();
- state->m_video_address = address & 0x7ff;
+ m_video_address = address & 0x7ff;
}
-static MC6845_INTERFACE( v6809_crtc )
-{
- false,
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of dots per character */
- NULL,
- v6809_update_row, /* handler to display a scanline */
- NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- v6809_update_addr /* handler to process transparent mode */
-};
-
WRITE8_MEMBER( v6809_state::videoram_w )
{
m_vidbyte = data;
@@ -341,8 +326,13 @@ static MACHINE_CONFIG_START( v6809, v6809_state )
MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
- /* Devices */
- MCFG_MC6845_ADD("crtc", SY6545_1, "screen", XTAL_16MHz / 8, v6809_crtc)
+ /* devices */
+ MCFG_MC6845_ADD("crtc", SY6545_1, "screen", XTAL_16MHz / 8)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
+ MCFG_MC6845_UPDATE_ROW_CB(v6809_state, crtc_update_row)
+ MCFG_MC6845_ADDR_CHANGED_CB(v6809_state, crtc_update_addr)
+
MCFG_DEVICE_ADD(KEYBOARD_TAG, GENERIC_KEYBOARD, 0)
MCFG_GENERIC_KEYBOARD_CB(WRITE8(v6809_state, kbd_put))
diff --git a/src/mess/drivers/victor9k.c b/src/mess/drivers/victor9k.c
index 00a3074c307..87e8122a879 100644
--- a/src/mess/drivers/victor9k.c
+++ b/src/mess/drivers/victor9k.c
@@ -256,7 +256,7 @@ INPUT_PORTS_END
//**************************************************************************
//-------------------------------------------------
-// MC6845_INTERFACE( hd46505s_intf )
+// MC6845
//-------------------------------------------------
#define CODE_NON_DISPLAY 0x1000
@@ -264,11 +264,10 @@ INPUT_PORTS_END
#define CODE_LOW_INTENSITY 0x4000
#define CODE_REVERSE_VIDEO 0x8000
-static MC6845_UPDATE_ROW( victor9k_update_row )
+MC6845_UPDATE_ROW( victor9k_state::crtc_update_row )
{
- victor9k_state *state = device->machine().driver_data<victor9k_state>();
- address_space &program = state->m_maincpu->space(AS_PROGRAM);
- const rgb_t *palette = state->m_palette->palette()->entry_list_raw();
+ address_space &program = m_maincpu->space(AS_PROGRAM);
+ const rgb_t *palette = m_palette->palette()->entry_list_raw();
if (BIT(ma, 13))
{
@@ -280,7 +279,7 @@ static MC6845_UPDATE_ROW( victor9k_update_row )
for (int sx = 0; sx < x_count; sx++)
{
- UINT16 code = (state->m_video_ram[video_ram_addr + 1] << 8) | state->m_video_ram[video_ram_addr];
+ UINT16 code = (m_video_ram[video_ram_addr + 1] << 8) | m_video_ram[video_ram_addr];
UINT32 char_ram_addr = (BIT(ma, 12) << 16) | ((code & 0xff) << 5) | (ra << 1);
UINT16 data = program.read_word(char_ram_addr);
@@ -305,20 +304,6 @@ WRITE_LINE_MEMBER(victor9k_state::vert_w)
m_pic->ir7_w(state);
}
-static MC6845_INTERFACE( hd46505s_intf )
-{
- true,
- 0,0,0,0,
- 10,
- NULL,
- victor9k_update_row,
- NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_DRIVER_LINE_MEMBER(victor9k_state, vert_w),
- NULL
-};
WRITE_LINE_MEMBER(victor9k_state::mux_serial_b_w)
@@ -906,7 +891,11 @@ static MACHINE_CONFIG_START( victor9k, victor9k_state )
MCFG_PALETTE_ADD_MONOCHROME_GREEN("palette")
- MCFG_MC6845_ADD(HD46505S_TAG, HD6845, SCREEN_TAG, 1000000, hd46505s_intf) // HD6845 == HD46505S
+ MCFG_MC6845_ADD(HD46505S_TAG, HD6845, SCREEN_TAG, 1000000) // HD6845 == HD46505S
+ MCFG_MC6845_SHOW_BORDER_AREA(true)
+ MCFG_MC6845_CHAR_WIDTH(10)
+ MCFG_MC6845_UPDATE_ROW_CB(victor9k_state, crtc_update_row)
+ MCFG_MC6845_OUT_VSYNC_CB(WRITELINE(victor9k_state, vert_w))
// sound hardware
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/vk100.c b/src/mess/drivers/vk100.c
index ad573f8e1c2..46272c8227a 100644
--- a/src/mess/drivers/vk100.c
+++ b/src/mess/drivers/vk100.c
@@ -244,6 +244,7 @@ public:
DECLARE_WRITE_LINE_MEMBER(i8251_txrdy_int);
DECLARE_WRITE_LINE_MEMBER(i8251_rts);
UINT8 vram_read();
+ MC6845_UPDATE_ROW(crtc_update_row);
void vram_write(UINT8 data);
protected:
@@ -964,7 +965,7 @@ void vk100_state::video_start()
m_ras_erase = memregion("ras_erase")->base();
}
-static MC6845_UPDATE_ROW( vk100_update_row )
+MC6845_UPDATE_ROW( vk100_state::crtc_update_row )
{
static const UINT32 colorTable[16] = {
0x000000, 0x0000FF, 0xFF0000, 0xFF00FF, 0x00FF00, 0x00FFFF, 0xFFFF00, 0xFFFFFF,
@@ -977,50 +978,38 @@ static MC6845_UPDATE_ROW( vk100_update_row )
* real address to 16-bit chunk a13 a12 a11 a10 a9 a8 a7 a6 a5 a4 a3 a2 a1 a0
* crtc input MA11 MA10 MA9 MA8 MA7 MA6 RA1 RA0 MA5 MA4 MA3 MA2 MA1 MA0
*/
- vk100_state *state = device->machine().driver_data<vk100_state>();
UINT16 EA = ((ma&0xfc0)<<2)|((ra&0x3)<<6)|(ma&0x3F);
// display the 64 different 12-bit-wide chunks
for (int i = 0; i < 64; i++)
{
- UINT16 block = state->m_vram[(EA<<1)+(2*i)+1] | (state->m_vram[(EA<<1)+(2*i)]<<8);
- UINT32 fgColor = (state->m_vgSOPS&0x08)?colorTable[(block&0xF000)>>12]:colorTable2[(block&0xF000)>>12];
- UINT32 bgColor = (state->m_vgSOPS&0x08)?colorTable[(state->m_vgSOPS&0xF0)>>4]:colorTable2[(state->m_vgSOPS&0xF0)>>4];
+ UINT16 block = m_vram[(EA<<1)+(2*i)+1] | (m_vram[(EA<<1)+(2*i)]<<8);
+ UINT32 fgColor = (m_vgSOPS&0x08)?colorTable[(block&0xF000)>>12]:colorTable2[(block&0xF000)>>12];
+ UINT32 bgColor = (m_vgSOPS&0x08)?colorTable[(m_vgSOPS&0xF0)>>4]:colorTable2[(m_vgSOPS&0xF0)>>4];
// display a 12-bit wide chunk
for (int j = 0; j < 12; j++)
{
- bitmap.pix32(y, (12*i)+j) = (((block&(0x0001<<j))?1:0)^(state->m_vgSOPS&1))?fgColor:bgColor;
+ bitmap.pix32(y, (12*i)+j) = (((block&(0x0001<<j))?1:0)^(m_vgSOPS&1))?fgColor:bgColor;
}
}
}
-static MC6845_INTERFACE( mc6845_intf )
-{
- false,
- 0,0,0,0,
- 12,
- NULL,
- vk100_update_row,
- NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_DRIVER_LINE_MEMBER(vk100_state, crtc_vsync),
- NULL
-};
-
static MACHINE_CONFIG_START( vk100, vk100_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", I8085A, XTAL_5_0688MHz)
MCFG_CPU_PROGRAM_MAP(vk100_mem)
MCFG_CPU_IO_MAP(vk100_io)
-
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_RAW_PARAMS(XTAL_45_6192Mhz/3, 882, 0, 720, 370, 0, 350 ) // fake screen timings for startup until 6845 sets real ones
MCFG_SCREEN_UPDATE_DEVICE( "crtc", mc6845_device, screen_update )
- MCFG_MC6845_ADD( "crtc", H46505, "screen", XTAL_45_6192Mhz/3/12, mc6845_intf)
+
+ MCFG_MC6845_ADD( "crtc", H46505, "screen", XTAL_45_6192Mhz/3/12)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(12)
+ MCFG_MC6845_UPDATE_ROW_CB(vk100_state, crtc_update_row)
+ MCFG_MC6845_OUT_VSYNC_CB(WRITELINE(vk100_state, crtc_vsync))
/* i8251 uart */
MCFG_DEVICE_ADD("i8251", I8251, 0)
diff --git a/src/mess/drivers/x1.c b/src/mess/drivers/x1.c
index abbc820e163..b2e93f6867c 100644
--- a/src/mess/drivers/x1.c
+++ b/src/mess/drivers/x1.c
@@ -1870,21 +1870,6 @@ WRITE8_MEMBER( x1_state::x1_portc_w )
m_cassette->output(BIT(data, 0) ? +1.0 : -1.0);
}
-static MC6845_INTERFACE( mc6845_intf )
-{
- true, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of pixels per video memory address */
- NULL, /* before pixel update callback */
- NULL, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_NULL, /* VSYNC callback */
- NULL /* update address callback */
-};
-
READ8_MEMBER(x1_state::memory_read_byte)
{
address_space& prog_space = m_maincpu->space(AS_PROGRAM);
@@ -2535,7 +2520,10 @@ static MACHINE_CONFIG_START( x1, x1_state )
MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
MCFG_SCREEN_UPDATE_DRIVER(x1_state, screen_update_x1)
- MCFG_MC6845_ADD("crtc", H46505, "screen", (VDP_CLOCK/48), mc6845_intf) //unknown divider
+ MCFG_MC6845_ADD("crtc", H46505, "screen", (VDP_CLOCK/48)) //unknown divider
+ MCFG_MC6845_SHOW_BORDER_AREA(true)
+ MCFG_MC6845_CHAR_WIDTH(8)
+
MCFG_PALETTE_ADD("palette", 0x10+0x1000)
MCFG_PALETTE_INIT_OWNER(x1_state,x1)
diff --git a/src/mess/drivers/x1twin.c b/src/mess/drivers/x1twin.c
index 913bf46de1a..273307e0211 100644
--- a/src/mess/drivers/x1twin.c
+++ b/src/mess/drivers/x1twin.c
@@ -79,21 +79,6 @@ static const wd17xx_interface x1_mb8877a_interface =
{FLOPPY_0, FLOPPY_1, FLOPPY_2, FLOPPY_3}
};
-static MC6845_INTERFACE( mc6845_intf )
-{
- false, /* show border area*/
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of pixels per video memory address */
- NULL, /* before pixel update callback */
- NULL, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_NULL, /* VSYNC callback */
- NULL /* update address callback */
-};
-
/*************************************
*
* Inputs
@@ -508,7 +493,10 @@ static MACHINE_CONFIG_START( x1twin, x1twin_state )
MCFG_SCREEN_RAW_PARAMS(PCE_MAIN_CLOCK/2, HUC6260_WPF, 70, 70 + 512 + 32, HUC6260_LPF, 14, 14+242)
MCFG_SCREEN_UPDATE_DRIVER(x1twin_state, screen_update_x1pce)
- MCFG_MC6845_ADD("crtc", H46505, "x1_screen", (VDP_CLOCK/48), mc6845_intf) //unknown divider
+ MCFG_MC6845_ADD("crtc", H46505, "x1_screen", (VDP_CLOCK/48)) //unknown divider
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
+
MCFG_PALETTE_ADD("palette", 0x10+0x1000)
MCFG_PALETTE_INIT_OWNER(x1twin_state,x1)
diff --git a/src/mess/drivers/z100.c b/src/mess/drivers/z100.c
index b146d33e2c2..67649a9388d 100644
--- a/src/mess/drivers/z100.c
+++ b/src/mess/drivers/z100.c
@@ -603,21 +603,6 @@ READ8_MEMBER( z100_state::get_slave_ack )
return 0;
}
-static MC6845_INTERFACE( mc6845_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 8, /* number of pixels per video memory address */
- NULL, /* before pixel update callback */
- NULL, /* row update callback */
- NULL, /* after pixel update callback */
- DEVCB_NULL, /* callback for display state changes */
- DEVCB_NULL, /* callback for cursor state changes */
- DEVCB_NULL, /* HSYNC callback */
- DEVCB_NULL, /* VSYNC callback */
- NULL /* update address callback */
-};
-
WRITE8_MEMBER( z100_state::video_pia_A_w )
{
/*
@@ -726,8 +711,10 @@ static MACHINE_CONFIG_START( z100, z100_state )
MCFG_PALETTE_ADD("palette", 8)
- /* Devices */
- MCFG_MC6845_ADD("crtc", MC6845, "screen", XTAL_14_31818MHz/8, mc6845_intf) /* unknown clock, hand tuned to get ~50/~60 fps */
+ /* devices */
+ MCFG_MC6845_ADD("crtc", MC6845, "screen", XTAL_14_31818MHz/8) /* unknown clock, hand tuned to get ~50/~60 fps */
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
MCFG_PIC8259_ADD( "pic8259_master", INPUTLINE("maincpu", 0), VCC, READ8(z100_state, get_slave_ack) )
MCFG_PIC8259_ADD( "pic8259_slave", DEVWRITELINE("pic8259_master", pic8259_device, ir3_w), GND, NULL )
diff --git a/src/mess/drivers/zrt80.c b/src/mess/drivers/zrt80.c
index ae669a6e373..9692961291d 100644
--- a/src/mess/drivers/zrt80.c
+++ b/src/mess/drivers/zrt80.c
@@ -48,6 +48,7 @@ public:
DECLARE_WRITE8_MEMBER(zrt80_30_w);
DECLARE_WRITE8_MEMBER(zrt80_38_w);
DECLARE_WRITE8_MEMBER(kbd_put);
+ MC6845_UPDATE_ROW(crtc_update_row);
const UINT8 *m_p_chargen;
required_shared_ptr<UINT8> m_p_videoram;
protected:
@@ -214,21 +215,20 @@ void zrt80_state::video_start()
m_p_chargen = memregion("chargen")->base();
}
-static MC6845_UPDATE_ROW( zrt80_update_row )
+MC6845_UPDATE_ROW( zrt80_state::crtc_update_row )
{
- zrt80_state *state = device->machine().driver_data<zrt80_state>();
- const rgb_t *palette = state->m_palette->palette()->entry_list_raw();
+ const rgb_t *palette = m_palette->palette()->entry_list_raw();
UINT8 chr,gfx,inv;
UINT16 mem,x;
UINT32 *p = &bitmap.pix32(y);
- UINT8 polarity = state->ioport("DIPSW1")->read() & 4 ? 0xff : 0;
+ UINT8 polarity = ioport("DIPSW1")->read() & 4 ? 0xff : 0;
for (x = 0; x < x_count; x++)
{
inv = polarity;
if (x == cursor_x) inv ^= 0xff;
mem = (ma + x) & 0x1fff;
- chr = state->m_p_videoram[mem];
+ chr = m_p_videoram[mem];
if BIT(chr, 7)
{
@@ -236,7 +236,7 @@ static MC6845_UPDATE_ROW( zrt80_update_row )
chr &= 0x7f;
}
- gfx = state->m_p_chargen[(chr<<4) | ra] ^ inv;
+ gfx = m_p_chargen[(chr<<4) | ra] ^ inv;
/* Display a scanline of a character */
*p++ = palette[BIT(gfx, 7)];
@@ -251,21 +251,6 @@ static MC6845_UPDATE_ROW( zrt80_update_row )
}
-static MC6845_INTERFACE( zrt80_crtc6845_interface )
-{
- false,
- 0,0,0,0,
- 8 /*?*/,
- NULL,
- zrt80_update_row,
- NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- NULL
-};
-
static const ins8250_interface zrt80_com_interface =
{
DEVCB_NULL,
@@ -322,7 +307,11 @@ static MACHINE_CONFIG_START( zrt80, zrt80_state )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
/* Devices */
- MCFG_MC6845_ADD("crtc", MC6845, "screen", XTAL_20MHz / 8, zrt80_crtc6845_interface)
+ MCFG_MC6845_ADD("crtc", MC6845, "screen", XTAL_20MHz / 8)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8) /*?*/
+ MCFG_MC6845_UPDATE_ROW_CB(zrt80_state, crtc_update_row)
+
MCFG_INS8250_ADD( "ins8250", zrt80_com_interface, 2457600 )
MCFG_DEVICE_ADD(KEYBOARD_TAG, GENERIC_KEYBOARD, 0)
MCFG_GENERIC_KEYBOARD_CB(WRITE8(zrt80_state, kbd_put))
diff --git a/src/mess/includes/abc80x.h b/src/mess/includes/abc80x.h
index eac46480de1..ac267a60bde 100644
--- a/src/mess/includes/abc80x.h
+++ b/src/mess/includes/abc80x.h
@@ -184,6 +184,7 @@ public:
void hr_update(bitmap_rgb32 &bitmap, const rectangle &cliprect);
DECLARE_DIRECT_UPDATE_MEMBER( direct_update_handler );
+ MC6845_UPDATE_ROW( abc800m_update_row );
};
@@ -248,6 +249,7 @@ public:
DECLARE_WRITE_LINE_MEMBER( mux80_40_w );
DECLARE_WRITE_LINE_MEMBER( vs_w );
DECLARE_DIRECT_UPDATE_MEMBER( direct_update_handler );
+ MC6845_UPDATE_ROW( abc802_update_row );
// cpu state
int m_lrs; // low RAM select
@@ -310,6 +312,7 @@ public:
DECLARE_WRITE_LINE_MEMBER( vs_w );
DECLARE_DIRECT_UPDATE_MEMBER( direct_update_handler );
DECLARE_PALETTE_INIT( abc806 );
+ MC6845_UPDATE_ROW( abc806_update_row );
// memory state
int m_keydtr; // keyboard DTR
diff --git a/src/mess/includes/amstrad.h b/src/mess/includes/amstrad.h
index 1010953c75e..ca53a4d7655 100644
--- a/src/mess/includes/amstrad.h
+++ b/src/mess/includes/amstrad.h
@@ -319,13 +319,6 @@ protected:
/*----------- defined in machine/amstrad.c -----------*/
-extern const mc6845_interface amstrad_mc6845_intf;
-extern const mc6845_interface amstrad_plus_mc6845_intf;
-
-
-
-
-
SLOT_INTERFACE_EXTERN(cpc_exp_cards);
SLOT_INTERFACE_EXTERN(cpcplus_exp_cards);
diff --git a/src/mess/includes/bbc.h b/src/mess/includes/bbc.h
index 62dbdd80dff..aa4bddbdd55 100644
--- a/src/mess/includes/bbc.h
+++ b/src/mess/includes/bbc.h
@@ -165,6 +165,8 @@ public:
DECLARE_DEVICE_IMAGE_LOAD_MEMBER( bbc_exp_rom );
DECLARE_DEVICE_IMAGE_LOAD_MEMBER( bbcm_cart );
+ MC6845_UPDATE_ROW(crtc_update_row);
+
private:
required_device<cpu_device> m_maincpu;
required_device<ram_device> m_ram;
@@ -419,7 +421,6 @@ public: // HACK FOR MC6845
/*----------- defined in machine/bbc.c -----------*/
-extern const mc6845_interface bbc_mc6845_intf;
extern const wd17xx_interface bbc_wd17xx_interface;
#endif /* BBC_H_ */
diff --git a/src/mess/includes/bw12.h b/src/mess/includes/bw12.h
index e0ff1e291d3..bbde95f7d5e 100644
--- a/src/mess/includes/bw12.h
+++ b/src/mess/includes/bw12.h
@@ -91,6 +91,7 @@ public:
DECLARE_READ_LINE_MEMBER( ay3600_shift_r );
DECLARE_READ_LINE_MEMBER( ay3600_control_r );
DECLARE_WRITE_LINE_MEMBER( ay3600_data_ready_w );
+ MC6845_UPDATE_ROW( crtc_update_row );
/* memory state */
int m_bank;
diff --git a/src/mess/includes/cbm2.h b/src/mess/includes/cbm2.h
index 25b2a411eb4..a94419e349d 100644
--- a/src/mess/includes/cbm2.h
+++ b/src/mess/includes/cbm2.h
@@ -214,6 +214,8 @@ public:
DECLARE_WRITE_LINE_MEMBER( user_irq_w );
+ MC6845_UPDATE_ROW( crtc_update_row );
+
DECLARE_QUICKLOAD_LOAD_MEMBER( cbmb );
// memory state
int m_dramon;
diff --git a/src/mess/includes/dgn_beta.h b/src/mess/includes/dgn_beta.h
index 5c81a5cc056..2b4ec244a6d 100644
--- a/src/mess/includes/dgn_beta.h
+++ b/src/mess/includes/dgn_beta.h
@@ -193,6 +193,7 @@ public:
// Page IO at FE00
DECLARE_READ8_MEMBER(dgn_beta_page_r);
DECLARE_WRITE8_MEMBER(dgn_beta_page_w);
+ MC6845_UPDATE_ROW(crtc_update_row);
/* WD2797 FDC */
DECLARE_READ8_MEMBER(dgnbeta_wd2797_r);
@@ -219,9 +220,4 @@ public:
extern const wd17xx_interface dgnbeta_wd17xx_interface;
-
-/*----------- defined in video/dgn_beta.c -----------*/
-
-extern const mc6845_interface dgnbeta_crtc6845_interface;
-
#endif /* DGN_BETA_H_ */
diff --git a/src/mess/includes/einstein.h b/src/mess/includes/einstein.h
index d0a60d6008f..10de7d0b019 100644
--- a/src/mess/includes/einstein.h
+++ b/src/mess/includes/einstein.h
@@ -130,6 +130,7 @@ public:
DECLARE_WRITE8_MEMBER(einstein_drsel_w);
DECLARE_WRITE_LINE_MEMBER(einstein_serial_transmit_clock);
DECLARE_WRITE_LINE_MEMBER(einstein_serial_receive_clock);
+ MC6845_UPDATE_ROW(crtc_update_row);
protected:
required_device<i8251_device> m_uart;
diff --git a/src/mess/includes/kaypro.h b/src/mess/includes/kaypro.h
index 3df7b63a470..f48df61d460 100644
--- a/src/mess/includes/kaypro.h
+++ b/src/mess/includes/kaypro.h
@@ -68,6 +68,7 @@ public:
DECLARE_WRITE_LINE_MEMBER(kaypro_interrupt);
DECLARE_READ8_MEMBER(kaypro_sio_r);
DECLARE_WRITE8_MEMBER(kaypro_sio_w);
+ MC6845_UPDATE_ROW(kaypro2x_update_row);
DECLARE_QUICKLOAD_LOAD_MEMBER(kaypro);
const UINT8 *m_p_chargen;
UINT8 m_mc6845_cursor[16];
@@ -110,8 +111,3 @@ UINT8 kay_kbd_d_r( running_machine &machine );
void kay_kbd_d_w( running_machine &machine, UINT8 data );
INPUT_PORTS_EXTERN( kay_kbd );
-
-
-/*----------- defined in video/kaypro.c -----------*/
-
-MC6845_UPDATE_ROW( kaypro2x_update_row );
diff --git a/src/mess/includes/mbc55x.h b/src/mess/includes/mbc55x.h
index 95d022fd77b..0f2beb080be 100644
--- a/src/mess/includes/mbc55x.h
+++ b/src/mess/includes/mbc55x.h
@@ -154,6 +154,7 @@ public:
DECLARE_READ8_MEMBER(mbc55x_kb_usart_r);
DECLARE_WRITE8_MEMBER(mbc55x_kb_usart_w);
DECLARE_DRIVER_INIT(mbc55x);
+ MC6845_UPDATE_ROW(crtc_update_row);
virtual void machine_start();
virtual void machine_reset();
virtual void video_start();
@@ -202,9 +203,6 @@ extern const wd17xx_interface mbc55x_wd17xx_interface;
/*----------- defined in video/mbc55x.c -----------*/
-extern const mc6845_interface mb55x_mc6845_intf;
-
-
#define RED 0
#define GREEN 1
#define BLUE 2
diff --git a/src/mess/includes/mbee.h b/src/mess/includes/mbee.h
index 039d8925d88..25147ee4e54 100644
--- a/src/mess/includes/mbee.h
+++ b/src/mess/includes/mbee.h
@@ -159,6 +159,12 @@ public:
void mbee_video_kbd_scan(int param);
UINT8 m_sy6545_cursor[16];
+ MC6845_UPDATE_ROW(mbee_update_row);
+ MC6845_UPDATE_ROW(mbeeic_update_row);
+ MC6845_UPDATE_ROW(mbeeppc_update_row);
+ MC6845_ON_UPDATE_ADDR_CHANGED(mbee_update_addr);
+ MC6845_ON_UPDATE_ADDR_CHANGED(mbee256_update_addr);
+
private:
size_t m_size;
UINT8 m_clock_pulse;
@@ -223,14 +229,4 @@ public:
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
};
-
-/*----------- defined in video/mbee.c -----------*/
-
-MC6845_UPDATE_ROW( mbee_update_row );
-MC6845_UPDATE_ROW( mbeeic_update_row );
-MC6845_UPDATE_ROW( mbeeppc_update_row );
-MC6845_ON_UPDATE_ADDR_CHANGED( mbee_update_addr );
-MC6845_ON_UPDATE_ADDR_CHANGED( mbee256_update_addr );
-
-
#endif /* MBEE_H_ */
diff --git a/src/mess/includes/pc1512.h b/src/mess/includes/pc1512.h
index 97eb96946f8..218a3d5599e 100644
--- a/src/mess/includes/pc1512.h
+++ b/src/mess/includes/pc1512.h
@@ -121,9 +121,9 @@ public:
int get_display_mode(UINT8 mode);
offs_t get_char_rom_offset();
int get_color(UINT8 data);
- void draw_alpha(bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, int de, int hbp, int vbp, void *param);
- void draw_graphics_1(bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, int de, int hbp, int vbp, void *param);
- void draw_graphics_2(bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, int de, int hbp, int vbp, void *param);
+ MC6845_UPDATE_ROW(draw_alpha);
+ MC6845_UPDATE_ROW(draw_graphics_1);
+ MC6845_UPDATE_ROW(draw_graphics_2);
DECLARE_READ8_MEMBER( video_ram_r );
DECLARE_WRITE8_MEMBER( video_ram_w );
@@ -171,6 +171,7 @@ public:
DECLARE_WRITE_LINE_MEMBER(write_centronics_perror);
DECLARE_WRITE_LINE_MEMBER(write_centronics_select);
DECLARE_WRITE_LINE_MEMBER(write_centronics_fault);
+ MC6845_UPDATE_ROW(crtc_update_row);
// system status register
int m_pit1;
diff --git a/src/mess/includes/pet.h b/src/mess/includes/pet.h
index 4f8c650ea62..95eafe61066 100644
--- a/src/mess/includes/pet.h
+++ b/src/mess/includes/pet.h
@@ -109,6 +109,9 @@ public:
DECLARE_MACHINE_START( pet40 );
DECLARE_MACHINE_RESET( pet40 );
+ MC6845_BEGIN_UPDATE( pet_begin_update );
+ MC6845_UPDATE_ROW( pet40_update_row );
+
UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
void check_interrupts();
@@ -206,6 +209,9 @@ public:
DECLARE_MACHINE_START( pet80 );
DECLARE_MACHINE_RESET( pet80 );
+
+ MC6845_UPDATE_ROW( pet80_update_row );
+ MC6845_UPDATE_ROW( cbm8296_update_row );
};
diff --git a/src/mess/includes/super80.h b/src/mess/includes/super80.h
index e5344e627a3..b378bda25b9 100644
--- a/src/mess/includes/super80.h
+++ b/src/mess/includes/super80.h
@@ -70,6 +70,7 @@ public:
DECLARE_VIDEO_START(super80v);
DECLARE_PALETTE_INIT(super80m);
DECLARE_QUICKLOAD_LOAD_MEMBER(super80);
+ MC6845_UPDATE_ROW(crtc_update_row);
UINT32 screen_update_super80(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_super80v(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
UINT32 screen_update_super80d(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
@@ -119,7 +120,3 @@ private:
optional_device<floppy_connector> m_floppy0;
optional_device<floppy_connector> m_floppy1;
};
-
-
-/*----------- defined in video/super80.c -----------*/
-MC6845_UPDATE_ROW( super80v_update_row );
diff --git a/src/mess/includes/svi318.h b/src/mess/includes/svi318.h
index 709c1c83e07..d01643e83c8 100644
--- a/src/mess/includes/svi318.h
+++ b/src/mess/includes/svi318.h
@@ -119,6 +119,8 @@ public:
DECLARE_DEVICE_IMAGE_UNLOAD_MEMBER(svi318_cart);
DECLARE_WRITE_LINE_MEMBER(write_centronics_busy);
+ MC6845_UPDATE_ROW(crtc_update_row);
+
required_device<z80_device> m_maincpu;
protected:
required_device<cassette_image_device> m_cassette;
@@ -156,7 +158,4 @@ protected:
extern const ins8250_interface svi318_ins8250_interface[2];
extern const wd17xx_interface svi_wd17xx_interface;
-MC6845_UPDATE_ROW( svi806_crtc6845_update_row );
-
-
#endif /* SVI318_H_ */
diff --git a/src/mess/includes/trs80m2.h b/src/mess/includes/trs80m2.h
index c588a85b8ae..94a85e36038 100644
--- a/src/mess/includes/trs80m2.h
+++ b/src/mess/includes/trs80m2.h
@@ -108,6 +108,8 @@ public:
DECLARE_WRITE_LINE_MEMBER( kb_clock_w );
DECLARE_WRITE8_MEMBER( kbd_w );
+ MC6845_UPDATE_ROW( crtc_update_row );
+
// memory state
int m_boot_rom;
int m_bank;
diff --git a/src/mess/includes/tvc.h b/src/mess/includes/tvc.h
index 66486027e9c..27fd7100a12 100644
--- a/src/mess/includes/tvc.h
+++ b/src/mess/includes/tvc.h
@@ -119,6 +119,8 @@ public:
DECLARE_QUICKLOAD_LOAD_MEMBER( tvc64);
+ MC6845_UPDATE_ROW(crtc_update_row);
+
tvcexp_slot_device * m_expansions[4];
UINT8 m_video_mode;
UINT8 m_keyline;
diff --git a/src/mess/includes/v1050.h b/src/mess/includes/v1050.h
index 7ec844c0a8c..429f032c38a 100644
--- a/src/mess/includes/v1050.h
+++ b/src/mess/includes/v1050.h
@@ -150,6 +150,8 @@ public:
DECLARE_WRITE_LINE_MEMBER(write_centronics_busy);
DECLARE_WRITE_LINE_MEMBER(write_centronics_perror);
+ MC6845_UPDATE_ROW(crtc_update_row);
+
protected:
virtual void machine_start();
virtual void machine_reset();
diff --git a/src/mess/includes/victor9k.h b/src/mess/includes/victor9k.h
index d2932ec3745..b8d5c9c4381 100644
--- a/src/mess/includes/victor9k.h
+++ b/src/mess/includes/victor9k.h
@@ -162,6 +162,7 @@ public:
DECLARE_WRITE_LINE_MEMBER( via6_irq_w );
DECLARE_WRITE_LINE_MEMBER( ssda_irq_w );
+ MC6845_UPDATE_ROW( crtc_update_row );
void ready0_cb(floppy_image_device *, int device);
int load0_cb(floppy_image_device *device);
diff --git a/src/mess/machine/amstrad.c b/src/mess/machine/amstrad.c
index a46a1a7303c..cb12927cba1 100644
--- a/src/mess/machine/amstrad.c
+++ b/src/mess/machine/amstrad.c
@@ -1079,37 +1079,6 @@ UINT32 amstrad_state::screen_update_amstrad(screen_device &screen, bitmap_ind16
}
-MC6845_INTERFACE( amstrad_mc6845_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 16, /* number of pixels per video memory address */
- NULL, /* begin_update */
- NULL, /* update_row */
- NULL, /* end_update */
- DEVCB_DRIVER_LINE_MEMBER(amstrad_state,amstrad_de_changed), /* on_de_changed */
- DEVCB_NULL, /* on_cur_changed */
- DEVCB_DRIVER_LINE_MEMBER(amstrad_state,amstrad_hsync_changed), /* on_hsync_changed */
- DEVCB_DRIVER_LINE_MEMBER(amstrad_state,amstrad_vsync_changed), /* on_vsync_changed */
- NULL
-};
-
-
-MC6845_INTERFACE( amstrad_plus_mc6845_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 16, /* number of pixels per video memory address */
- NULL, /* begin_update */
- NULL, /* update_row */
- NULL, /* end_update */
- DEVCB_DRIVER_LINE_MEMBER(amstrad_state,amstrad_plus_de_changed), /* on_de_changed */
- DEVCB_NULL, /* on_cur_changed */
- DEVCB_DRIVER_LINE_MEMBER(amstrad_state,amstrad_plus_hsync_changed), /* on_hsync_changed */
- DEVCB_DRIVER_LINE_MEMBER(amstrad_state,amstrad_plus_vsync_changed), /* on_vsync_changed */
- NULL
-};
-
/* traverses the daisy-chain of expansion devices, looking for the specified device */
static device_t* get_expansion_device(running_machine &machine, const char* tag)
{
diff --git a/src/mess/machine/svi318.c b/src/mess/machine/svi318.c
index d7a8e93f0b6..131e9cc7168 100644
--- a/src/mess/machine/svi318.c
+++ b/src/mess/machine/svi318.c
@@ -313,16 +313,15 @@ READ8_MEMBER(svi318_state::svi318_fdc_irqdrq_r)
return result;
}
-MC6845_UPDATE_ROW( svi806_crtc6845_update_row )
+MC6845_UPDATE_ROW( svi318_state::crtc_update_row )
{
- svi318_state *state = device->machine().driver_data<svi318_state>();
- const rgb_t *palette = state->m_palette->palette()->entry_list_raw();
+ const rgb_t *palette = m_palette->palette()->entry_list_raw();
int i;
for( i = 0; i < x_count; i++ )
{
int j;
- UINT8 data = state->m_svi.svi806_gfx[ state->m_svi.svi806_ram->u8(( ma + i ) & 0x7FF) * 16 + ra ];
+ UINT8 data = m_svi.svi806_gfx[ m_svi.svi806_ram->u8(( ma + i ) & 0x7FF) * 16 + ra ];
if ( i == cursor_x )
{
diff --git a/src/mess/video/abc1600.c b/src/mess/video/abc1600.c
index 85593b94b16..be4f5a8f355 100644
--- a/src/mess/video/abc1600.c
+++ b/src/mess/video/abc1600.c
@@ -127,7 +127,7 @@ const rom_entry *abc1600_mover_device::device_rom_region() const
//-------------------------------------------------
-// mc6845_interface crtc_intf
+// mc6845
//-------------------------------------------------
inline UINT16 abc1600_mover_device::get_crtca(UINT16 ma, UINT8 ra, UINT8 column)
@@ -161,58 +161,32 @@ inline UINT16 abc1600_mover_device::get_crtca(UINT16 ma, UINT8 ra, UINT8 column)
return (cr << 10) | ((ra & 0x0f) << 6) | ((cc << 1) & 0x3c);
}
-void abc1600_mover_device::crtc_update_row(device_t *device, bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, int de, int hbp, int vbp, void *param)
+MC6845_UPDATE_ROW(abc1600_mover_device::crtc_update_row)
{
int x = 0;
const pen_t *pen = m_palette->pens();
-
+
for (int column = 0; column < x_count; column += 2)
{
UINT16 dma = get_crtca(ma, ra, column);
-
+
// data is read out of video RAM in nibble mode by strobing CAS 4 times
for (int cas = 0; cas < 4; cas++)
{
UINT16 data = read_videoram(dma + cas);
-
+
for (int bit = 0; bit < 16; bit++)
{
int color = ((BIT(data, 15) ^ PIX_POL) && !BLANK) && de;
-
+
bitmap.pix32(vbp + y, hbp + x++) = pen[color];
-
+
data <<= 1;
}
}
}
}
-static MC6845_UPDATE_ROW( abc1600_update_row )
-{
- abc1600_mover_device *mover = downcast<abc1600_mover_device *>(device->owner());
- mover->crtc_update_row(device, bitmap, cliprect, ma, ra, y, x_count, cursor_x, de, hbp, vbp, param);
-}
-
-static MC6845_ON_UPDATE_ADDR_CHANGED( crtc_update )
-{
-}
-
-static MC6845_INTERFACE( crtc_intf )
-{
- true,
- 0,0,0,0,
- 32,
- NULL,
- abc1600_update_row,
- NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- crtc_update
-};
-
-
//-------------------------------------------------
// MACHINE_CONFIG_FRAGMENT( abc1600_mover )
//-------------------------------------------------
@@ -229,7 +203,10 @@ static MACHINE_CONFIG_FRAGMENT( abc1600_mover )
MCFG_PALETTE_ADD_MONOCHROME_GREEN("palette")
- MCFG_MC6845_ADD(SY6845E_TAG, SY6845E, SCREEN_TAG, XTAL_64MHz/32, crtc_intf)
+ MCFG_MC6845_ADD(SY6845E_TAG, SY6845E, SCREEN_TAG, XTAL_64MHz/32)
+ MCFG_MC6845_SHOW_BORDER_AREA(true)
+ MCFG_MC6845_CHAR_WIDTH(32)
+ MCFG_MC6845_UPDATE_ROW_CB(abc1600_mover_device, crtc_update_row)
MACHINE_CONFIG_END
diff --git a/src/mess/video/abc1600.h b/src/mess/video/abc1600.h
index 58bf6a2059d..126b195aaeb 100644
--- a/src/mess/video/abc1600.h
+++ b/src/mess/video/abc1600.h
@@ -54,7 +54,7 @@ public:
UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
- void crtc_update_row(device_t *device, bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, int de, int hbp, int vbp, void *param);
+ MC6845_UPDATE_ROW(crtc_update_row);
protected:
// device-level overrides
diff --git a/src/mess/video/abc800.c b/src/mess/video/abc800.c
index bceb3d57eb2..ee9fc3a19de 100644
--- a/src/mess/video/abc800.c
+++ b/src/mess/video/abc800.c
@@ -231,12 +231,10 @@ void abc800m_state::hr_update(bitmap_rgb32 &bitmap, const rectangle &cliprect)
// MC6845_UPDATE_ROW( abc800m_update_row )
//-------------------------------------------------
-static MC6845_UPDATE_ROW( abc800m_update_row )
+MC6845_UPDATE_ROW( abc800m_state::abc800m_update_row )
{
- abc800m_state *state = device->machine().driver_data<abc800m_state>();
-
int column;
- rgb_t fgpen = state->m_palette->pen(1);
+ rgb_t fgpen = m_palette->pen(1);
y += vbp;
@@ -244,8 +242,8 @@ static MC6845_UPDATE_ROW( abc800m_update_row )
{
int bit;
- UINT16 address = (state->m_char_ram[(ma + column) & 0x7ff] << 4) | (ra & 0x0f);
- UINT8 data = (state->m_char_rom->base()[address & 0x7ff] & 0x3f);
+ UINT16 address = (m_char_ram[(ma + column) & 0x7ff] << 4) | (ra & 0x0f);
+ UINT8 data = (m_char_rom->base()[address & 0x7ff] & 0x3f);
if (column == cursor_x)
{
@@ -270,26 +268,6 @@ static MC6845_UPDATE_ROW( abc800m_update_row )
//-------------------------------------------------
-// mc6845_interface crtc_intf
-//-------------------------------------------------
-
-static MC6845_INTERFACE( crtc_intf )
-{
- true,
- 0,0,0,0,
- ABC800_CHAR_WIDTH,
- NULL,
- abc800m_update_row,
- NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_DEVICE_LINE_MEMBER(Z80DART_TAG, z80dart_device, rib_w),
- NULL
-};
-
-
-//-------------------------------------------------
// SCREEN_UPDATE( abc800m )
//-------------------------------------------------
@@ -316,7 +294,11 @@ UINT32 abc800m_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap,
//-------------------------------------------------
MACHINE_CONFIG_FRAGMENT( abc800m_video )
- MCFG_MC6845_ADD(MC6845_TAG, MC6845, SCREEN_TAG, ABC800_CCLK, crtc_intf)
+ MCFG_MC6845_ADD(MC6845_TAG, MC6845, SCREEN_TAG, ABC800_CCLK)
+ MCFG_MC6845_SHOW_BORDER_AREA(true)
+ MCFG_MC6845_CHAR_WIDTH(ABC800_CHAR_WIDTH)
+ MCFG_MC6845_UPDATE_ROW_CB(abc800m_state, abc800m_update_row)
+ MCFG_MC6845_OUT_VSYNC_CB(DEVWRITELINE(Z80DART_TAG, z80dart_device, rib_w))
MCFG_SCREEN_ADD(SCREEN_TAG, RASTER)
MCFG_SCREEN_UPDATE_DRIVER(abc800m_state, screen_update)
diff --git a/src/mess/video/abc802.c b/src/mess/video/abc802.c
index a8dac53e8c3..667f8cfe931 100644
--- a/src/mess/video/abc802.c
+++ b/src/mess/video/abc802.c
@@ -14,7 +14,7 @@
// MC6845_UPDATE_ROW( abc802_update_row )
//-------------------------------------------------
-static MC6845_UPDATE_ROW( abc802_update_row )
+MC6845_UPDATE_ROW( abc802_state::abc802_update_row )
{
/*
@@ -55,8 +55,7 @@ static MC6845_UPDATE_ROW( abc802_update_row )
*/
- abc802_state *state = device->machine().driver_data<abc802_state>();
- const pen_t *pen = state->m_palette->pens();
+ const pen_t *pen = m_palette->pens();
int rf = 0, rc = 0, rg = 0;
@@ -64,7 +63,7 @@ static MC6845_UPDATE_ROW( abc802_update_row )
for (int column = 0; column < x_count; column++)
{
- UINT8 code = state->m_char_ram[(ma + column) & 0x7ff];
+ UINT8 code = m_char_ram[(ma + column) & 0x7ff];
UINT16 address = code << 4;
UINT8 ra_latch = ra;
UINT8 data;
@@ -76,7 +75,7 @@ static MC6845_UPDATE_ROW( abc802_update_row )
ra_latch = 0x0f;
}
- if ((state->m_flshclk && rf) || rc)
+ if ((m_flshclk && rf) || rc)
{
ra_latch = 0x0e;
}
@@ -86,7 +85,7 @@ static MC6845_UPDATE_ROW( abc802_update_row )
address |= 0x800;
}
- data = state->m_char_rom->base()[(address + ra_latch) & 0xfff];
+ data = m_char_rom->base()[(address + ra_latch) & 0xfff];
if (data & ABC802_ATE)
{
@@ -119,7 +118,7 @@ static MC6845_UPDATE_ROW( abc802_update_row )
{
data <<= 2;
- if (state->m_80_40_mux)
+ if (m_80_40_mux)
{
for (int bit = 0; bit < ABC800_CHAR_WIDTH; bit++)
{
@@ -176,26 +175,6 @@ WRITE_LINE_MEMBER( abc802_state::vs_w )
}
-//-------------------------------------------------
-// mc6845_interface crtc_intf
-//-------------------------------------------------
-
-static MC6845_INTERFACE( crtc_intf )
-{
- true,
- 0,0,0,0,
- ABC800_CHAR_WIDTH,
- NULL,
- abc802_update_row,
- NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_DRIVER_LINE_MEMBER(abc802_state, vs_w),
- NULL
-};
-
-
void abc802_state::video_start()
{
// register for state saving
@@ -223,7 +202,11 @@ UINT32 abc802_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap,
//-------------------------------------------------
MACHINE_CONFIG_FRAGMENT( abc802_video )
- MCFG_MC6845_ADD(MC6845_TAG, MC6845, SCREEN_TAG, ABC800_CCLK, crtc_intf)
+ MCFG_MC6845_ADD(MC6845_TAG, MC6845, SCREEN_TAG, ABC800_CCLK)
+ MCFG_MC6845_SHOW_BORDER_AREA(true)
+ MCFG_MC6845_CHAR_WIDTH(ABC800_CHAR_WIDTH)
+ MCFG_MC6845_UPDATE_ROW_CB(abc802_state, abc802_update_row)
+ MCFG_MC6845_OUT_VSYNC_CB(WRITELINE(abc802_state, vs_w))
MCFG_SCREEN_ADD(SCREEN_TAG, RASTER)
MCFG_SCREEN_UPDATE_DRIVER(abc802_state, screen_update)
diff --git a/src/mess/video/abc806.c b/src/mess/video/abc806.c
index 8132ae3d931..c83acf9e673 100644
--- a/src/mess/video/abc806.c
+++ b/src/mess/video/abc806.c
@@ -222,26 +222,25 @@ WRITE8_MEMBER( abc806_state::sso_w )
// MC6845_UPDATE_ROW( abc806_update_row )
//-------------------------------------------------
-static MC6845_UPDATE_ROW( abc806_update_row )
+MC6845_UPDATE_ROW( abc806_state::abc806_update_row )
{
- abc806_state *state = device->machine().driver_data<abc806_state>();
- const pen_t *pen = state->m_palette->pens();
+ const pen_t *pen = m_palette->pens();
// UINT8 old_data = 0xff;
int fg_color = 7;
int bg_color = 0;
int underline = 0;
int flash = 0;
- int e5 = state->m_40;
- int e6 = state->m_40;
+ int e5 = m_40;
+ int e6 = m_40;
int th = 0;
- y += state->m_sync + vbp;
+ y += m_sync + vbp;
for (int column = 0; column < x_count; column++)
{
- UINT8 data = state->m_char_ram[(ma + column) & 0x7ff];
- UINT8 attr = state->m_attr_ram[(ma + column) & 0x7ff];
+ UINT8 data = m_char_ram[(ma + column) & 0x7ff];
+ UINT8 attr = m_attr_ram[(ma + column) & 0x7ff];
UINT16 rad_addr;
UINT8 rad_data;
@@ -270,7 +269,7 @@ static MC6845_UPDATE_ROW( abc806_update_row )
e6 = BIT(attr, 1);
// read attributes from next byte
- attr = state->m_attr_ram[(ma + column + 1) & 0x7ff];
+ attr = m_attr_ram[(ma + column + 1) & 0x7ff];
if (attr != 0x00)
{
@@ -289,8 +288,8 @@ static MC6845_UPDATE_ROW( abc806_update_row )
bg_color = (attr >> 3) & 0x07;
underline = BIT(attr, 6);
flash = BIT(attr, 7);
- e5 = state->m_40;
- e6 = state->m_40;
+ e5 = m_40;
+ e6 = m_40;
}
if (column == cursor_x)
@@ -299,14 +298,14 @@ static MC6845_UPDATE_ROW( abc806_update_row )
}
else
{
- rad_addr = (e6 << 8) | (e5 << 7) | (flash << 6) | (underline << 5) | (state->m_flshclk << 4) | ra;
- rad_data = state->m_rad_prom->base()[rad_addr] & 0x0f;
+ rad_addr = (e6 << 8) | (e5 << 7) | (flash << 6) | (underline << 5) | (m_flshclk << 4) | ra;
+ rad_data = m_rad_prom->base()[rad_addr] & 0x0f;
rad_data = ra; // HACK because the RAD prom is not dumped yet
}
UINT16 chargen_addr = (th << 12) | (data << 4) | rad_data;
- UINT8 chargen_data = state->m_char_rom->base()[chargen_addr & 0xfff] << 2;
+ UINT8 chargen_data = m_char_rom->base()[chargen_addr & 0xfff] << 2;
int x = hbp + (column + 4) * ABC800_CHAR_WIDTH;
for (int bit = 0; bit < ABC800_CHAR_WIDTH; bit++)
@@ -393,26 +392,6 @@ WRITE_LINE_MEMBER( abc806_state::vs_w )
//-------------------------------------------------
-// mc6845_interface crtc_intf
-//-------------------------------------------------
-
-static MC6845_INTERFACE( crtc_intf )
-{
- true,
- 0,0,0,0,
- ABC800_CHAR_WIDTH,
- NULL,
- abc806_update_row,
- NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_DRIVER_LINE_MEMBER(abc806_state, hs_w),
- DEVCB_DRIVER_LINE_MEMBER(abc806_state, vs_w),
- NULL
-};
-
-
-//-------------------------------------------------
// hr_update - high resolution screen update
//-------------------------------------------------
@@ -523,7 +502,12 @@ PALETTE_INIT_MEMBER( abc806_state, abc806 )
//-------------------------------------------------
MACHINE_CONFIG_FRAGMENT( abc806_video )
- MCFG_MC6845_ADD(MC6845_TAG, MC6845, SCREEN_TAG, ABC800_CCLK, crtc_intf)
+ MCFG_MC6845_ADD(MC6845_TAG, MC6845, SCREEN_TAG, ABC800_CCLK)
+ MCFG_MC6845_SHOW_BORDER_AREA(true)
+ MCFG_MC6845_CHAR_WIDTH(ABC800_CHAR_WIDTH)
+ MCFG_MC6845_UPDATE_ROW_CB(abc806_state, abc806_update_row)
+ MCFG_MC6845_OUT_HSYNC_CB(WRITELINE(abc806_state, hs_w))
+ MCFG_MC6845_OUT_VSYNC_CB(WRITELINE(abc806_state, vs_w))
MCFG_SCREEN_ADD(SCREEN_TAG, RASTER)
MCFG_SCREEN_UPDATE_DRIVER(abc806_state, screen_update)
diff --git a/src/mess/video/bbc.c b/src/mess/video/bbc.c
index c3df043c574..f504a1df513 100644
--- a/src/mess/video/bbc.c
+++ b/src/mess/video/bbc.c
@@ -162,15 +162,14 @@ WRITE8_MEMBER(bbc_state::bbc_videoULA_w)
* BBC circuits controlled by 6845 Outputs
************************************************************************/
-static MC6845_UPDATE_ROW( vid_update_row )
+MC6845_UPDATE_ROW( bbc_state::crtc_update_row )
{
- bbc_state *state = device->machine().driver_data<bbc_state>();
- const rgb_t *palette = state->m_palette->palette()->entry_list_raw();
+ const rgb_t *palette = m_palette->palette()->entry_list_raw();
- if (state->m_videoULA_teletext_normal_select)
+ if (m_videoULA_teletext_normal_select)
{
- state->m_trom->lose_w(1);
- state->m_trom->lose_w(0);
+ m_trom->lose_w(1);
+ m_trom->lose_w(0);
for(int x_pos=0; x_pos<x_count; x_pos++)
{
@@ -180,22 +179,24 @@ static MC6845_UPDATE_ROW( vid_update_row )
if (((ma>>13)&1)==0)
{
- state->m_Teletext_Latch=0;
- } else {
- state->m_Teletext_Latch=(state->m_BBC_Video_RAM[state->calculate_video_address(ma+x_pos,ra)]);
+ m_Teletext_Latch=0;
+ }
+ else
+ {
+ m_Teletext_Latch=(m_BBC_Video_RAM[calculate_video_address(ma+x_pos,ra)]);
}
- state->m_trom->write((state->m_Teletext_Latch&0x3f)|(state->m_Teletext_Latch&0x40));
+ m_trom->write((m_Teletext_Latch&0x3f)|(m_Teletext_Latch&0x40));
- state->m_trom->f1_w(1);
- state->m_trom->f1_w(0);
+ m_trom->f1_w(1);
+ m_trom->f1_w(0);
for(int pixelno=0;pixelno<6;pixelno++)
{
- state->m_trom->tr6_w(1);
- state->m_trom->tr6_w(0);
+ m_trom->tr6_w(1);
+ m_trom->tr6_w(0);
- int col=state->m_trom->get_rgb() ^ ((x_pos==cursor_x) ? 7 : 0);
+ int col=m_trom->get_rgb() ^ ((x_pos==cursor_x) ? 7 : 0);
int r = BIT(col, 0) * 0xff;
int g = BIT(col, 1) * 0xff;
@@ -203,14 +204,14 @@ static MC6845_UPDATE_ROW( vid_update_row )
rgb_t rgb = rgb_t(r, g, b);
- bitmap.pix32(y, (x_pos*state->m_pixels_per_byte)+pixelno) = rgb;
+ bitmap.pix32(y, (x_pos*m_pixels_per_byte)+pixelno) = rgb;
}
}
if (ra == 18)
{
- state->m_trom->lose_w(1);
- state->m_trom->lose_w(0);
+ m_trom->lose_w(1);
+ m_trom->lose_w(0);
}
}
else
@@ -222,13 +223,13 @@ static MC6845_UPDATE_ROW( vid_update_row )
{
for(int x_pos=0; x_pos<x_count; x_pos++)
{
- int vmem=state->calculate_video_address(ma+x_pos,ra);
- unsigned char i=state->m_BBC_Video_RAM[vmem];
+ int vmem=calculate_video_address(ma+x_pos,ra);
+ unsigned char i=m_BBC_Video_RAM[vmem];
- for(int pixelno=0;pixelno<state->m_pixels_per_byte;pixelno++)
+ for(int pixelno=0;pixelno<m_pixels_per_byte;pixelno++)
{
- int col=state->m_videoULA_pallet_lookup[state->m_pixel_bits[i]] ^ ((x_pos==cursor_x) ? 7 : 0);
- bitmap.pix32(y, (x_pos*state->m_pixels_per_byte)+pixelno)=palette[col];
+ int col=m_videoULA_pallet_lookup[m_pixel_bits[i]] ^ ((x_pos==cursor_x) ? 7 : 0);
+ bitmap.pix32(y, (x_pos*m_pixels_per_byte)+pixelno)=palette[col];
i=(i<<1)|1;
}
}
@@ -237,9 +238,9 @@ static MC6845_UPDATE_ROW( vid_update_row )
{
for(int x_pos=0; x_pos<x_count; x_pos++)
{
- for(int pixelno=0;pixelno<state->m_pixels_per_byte;pixelno++)
+ for(int pixelno=0;pixelno<m_pixels_per_byte;pixelno++)
{
- bitmap.pix32(y, (x_pos*state->m_pixels_per_byte)+pixelno)=palette[7];
+ bitmap.pix32(y, (x_pos*m_pixels_per_byte)+pixelno)=palette[7];
}
}
}
@@ -251,25 +252,6 @@ WRITE_LINE_MEMBER(bbc_state::bbc_vsync)
m_trom->dew_w(state);
}
-
-MC6845_INTERFACE( bbc_mc6845_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 8, /* numbers of pixels per video memory address */
- NULL, /* begin_update */
- vid_update_row, /* update_row */
- NULL, /* end_update */
- DEVCB_NULL, /* on_de_changed */
- DEVCB_NULL, /* on_cur_changed */
- DEVCB_NULL, /* on_hsync_changed */
- DEVCB_DRIVER_LINE_MEMBER(bbc_state,bbc_vsync), /* on_vsync_changed */
- NULL
-};
-
-
-
-
/************************************************************************
* memory interface to BBC's 6845
************************************************************************/
diff --git a/src/mess/video/dgn_beta.c b/src/mess/video/dgn_beta.c
index 1dc294646e5..84a90cc0592 100644
--- a/src/mess/video/dgn_beta.c
+++ b/src/mess/video/dgn_beta.c
@@ -91,24 +91,23 @@ the access to the video memory is unclear to me at the moment.
#define GCtrlFS 0x20 /* labeled F/S, not yet sure of function Fast or Slow scan ? */
#define GCtrlAddrLines 0xC0 /* Top two address lines for text mode */
-#define IsTextMode (state->m_GCtrl & GCtrlChrGfx) ? 1 : 0 // Is this text mode ?
-#define IsGfx16 ((~state->m_GCtrl & GCtrlChrGfx) && (~state->m_GCtrl & GCtrlControl)) ? 1 : 0 // is this 320x256x16bpp mode
-#define IsGfx2 ((state->m_GCtrl & GCtrlHiLo) && (~state->m_GCtrl & GCtrlFS)) ? 1 : 0 // Is this a 2 colour mode
-#define SWChar (state->m_GCtrl & GCtrlSWChar)>>1 // Swchar bit
+#define IsTextMode (m_GCtrl & GCtrlChrGfx) ? 1 : 0 // Is this text mode ?
+#define IsGfx16 ((~m_GCtrl & GCtrlChrGfx) && (~m_GCtrl & GCtrlControl)) ? 1 : 0 // is this 320x256x16bpp mode
+#define IsGfx2 ((m_GCtrl & GCtrlHiLo) && (~m_GCtrl & GCtrlFS)) ? 1 : 0 // Is this a 2 colour mode
+#define SWChar (m_GCtrl & GCtrlSWChar)>>1 // Swchar bit
-static MC6845_UPDATE_ROW( dgnbeta_update_row )
+MC6845_UPDATE_ROW( dgn_beta_state::crtc_update_row )
{
- dgn_beta_state *state = device->machine().driver_data<dgn_beta_state>();
- const rgb_t *palette = state->m_palette->palette()->entry_list_raw();
- UINT8 *videoram = state->m_videoram;
+ const rgb_t *palette = m_palette->palette()->entry_list_raw();
+ UINT8 *videoram = m_videoram;
UINT32 *p = &bitmap.pix32(y);
int i;
if(IsTextMode)
{
- UINT8 *chr_gen = state->memregion("gfx1")->base();
+ UINT8 *chr_gen = memregion("gfx1")->base();
for ( i = 0; i < x_count; i++ )
{
- UINT32 offset = ( ( ma + i ) | ((state->m_GCtrl & GCtrlAddrLines)<<8)) << 1;
+ UINT32 offset = ( ( ma + i ) | ((m_GCtrl & GCtrlAddrLines)<<8)) << 1;
UINT8 chr = videoram[ offset ];
UINT8 attr = videoram[ offset +1 ];
@@ -122,7 +121,7 @@ static MC6845_UPDATE_ROW( dgnbeta_update_row )
int ULActive=(UnderLine && (ra==9) && ~SWChar);
/* Invert forground and background if flashing char and flash acive */
- int Invert=(FlashChar & state->m_FlashBit);
+ int Invert=(FlashChar & m_FlashBit);
/* Underline inverts flash */
if (ULActive)
@@ -215,7 +214,7 @@ static MC6845_UPDATE_ROW( dgnbeta_update_row )
{
for (Dot=0;Dot<16;Dot=Dot+1)
{
- Colour=state->m_ColourRAM[((Word&0x8000)>>15)];
+ Colour=m_ColourRAM[((Word&0x8000)>>15)];
*p = palette[Colour]; p++;
@@ -227,7 +226,7 @@ static MC6845_UPDATE_ROW( dgnbeta_update_row )
{
for (Dot=0;Dot<8;Dot++)
{
- Colour=state->m_ColourRAM[((Word&0x8000)>>14) | ((Word&0x80)>>7)];
+ Colour=m_ColourRAM[((Word&0x8000)>>14) | ((Word&0x80)>>7)];
*p = palette[Colour]; p++;
*p = palette[Colour]; p++;
@@ -256,21 +255,6 @@ WRITE_LINE_MEMBER(dgn_beta_state::dgnbeta_vsync_changed)
dgn_beta_frame_interrupt(state);
}
-MC6845_INTERFACE( dgnbeta_crtc6845_interface )
-{
- false,
- 0,0,0,0,
- 16 /*?*/,
- NULL,
- dgnbeta_update_row,
- NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_DRIVER_LINE_MEMBER(dgn_beta_state,dgnbeta_vsync_changed),
- NULL
-};
-
/* Set video control register from I28 port B, the control register is laid out as */
/* follows :- */
diff --git a/src/mess/video/kaypro.c b/src/mess/video/kaypro.c
index 8e415498cd5..d4845b1b682 100644
--- a/src/mess/video/kaypro.c
+++ b/src/mess/video/kaypro.c
@@ -131,10 +131,9 @@ UINT32 kaypro_state::screen_update_kaypro2x(screen_device &screen, bitmap_rgb32
Not sure how the attributes interact, for example does an underline blink? */
-MC6845_UPDATE_ROW( kaypro2x_update_row )
+MC6845_UPDATE_ROW( kaypro_state::kaypro2x_update_row )
{
- kaypro_state *state = device->machine().driver_data<kaypro_state>();
- const rgb_t *palette = state->m_palette->palette()->entry_list_raw();
+ const rgb_t *palette = m_palette->palette()->entry_list_raw();
UINT32 *p = &bitmap.pix32(y);
UINT16 x;
UINT8 gfx,fg,bg;
@@ -144,8 +143,8 @@ MC6845_UPDATE_ROW( kaypro2x_update_row )
UINT8 inv=0;
// if (x == cursor_x) inv=0xff; /* uncomment when mame fixed */
UINT16 mem = (ma + x) & 0x7ff;
- UINT8 chr = state->m_p_videoram[mem];
- UINT8 attr = state->m_p_videoram[mem | 0x800];
+ UINT8 chr = m_p_videoram[mem];
+ UINT8 attr = m_p_videoram[mem | 0x800];
if ((attr & 3) == 3)
{
@@ -171,18 +170,18 @@ MC6845_UPDATE_ROW( kaypro2x_update_row )
}
/* Take care of flashing characters */
- if ( (BIT(attr, 2)) & (BIT(state->m_framecnt, 3)) )
+ if ( (BIT(attr, 2)) & (BIT(m_framecnt, 3)) )
fg = bg;
/* process cursor */
if (x == cursor_x)
- inv ^= state->m_mc6845_cursor[ra];
+ inv ^= m_mc6845_cursor[ra];
/* get pattern of pixels for that character scanline */
if ( (ra == 15) & (BIT(attr, 3)) ) /* underline */
gfx = 0xff;
else
- gfx = state->m_p_chargen[(chr<<4) | ra ] ^ inv;
+ gfx = m_p_chargen[(chr<<4) | ra ] ^ inv;
/* Display a scanline of a character (8 pixels) */
*p++ = palette[BIT( gfx, 7 ) ? fg : bg];
diff --git a/src/mess/video/mbc55x.c b/src/mess/video/mbc55x.c
index bc48ae654d1..5d9eb0bc3be 100644
--- a/src/mess/video/mbc55x.c
+++ b/src/mess/video/mbc55x.c
@@ -71,7 +71,7 @@ give the leftmost column of the rectangle, the next four give the next column, a
#define DEBUG_LINES 1
#define DEBUG_VSYNC 2
-#define DEBUG_SET(flags) ((mstate->m_debug_video & (flags))==(flags))
+#define DEBUG_SET(flags) ((m_debug_video & (flags))==(flags))
static void video_debug(running_machine &machine, int ref, int params, const char *param[])
{
@@ -87,14 +87,13 @@ static void video_debug(running_machine &machine, int ref, int params, const cha
}
}
-static MC6845_UPDATE_ROW( vid_update_row )
+MC6845_UPDATE_ROW( mbc55x_state::crtc_update_row )
{
- mbc55x_state *mstate = device->machine().driver_data<mbc55x_state>();
- const rgb_t *palette = mstate->m_palette->palette()->entry_list_raw();
+ const rgb_t *palette = m_palette->palette()->entry_list_raw();
- UINT8 *ram = &mstate->m_ram->pointer()[0];
- UINT8 *red = &mstate->m_video_mem[RED_PLANE_OFFSET];
- UINT8 *blue = &mstate->m_video_mem[BLUE_PLANE_OFFSET];
+ UINT8 *ram = &m_ram->pointer()[0];
+ UINT8 *red = &m_video_mem[RED_PLANE_OFFSET];
+ UINT8 *blue = &m_video_mem[BLUE_PLANE_OFFSET];
UINT8 *green;
int offset;
UINT8 rpx,gpx,bpx;
@@ -106,7 +105,7 @@ static MC6845_UPDATE_ROW( vid_update_row )
UINT8 shifts;
UINT8 colour;
- switch(mstate->m_vram_page)
+ switch(m_vram_page)
{
case 4 : green=&ram[0x08000]; break;
case 5 : green=&ram[0x1C000]; break;
@@ -158,21 +157,6 @@ WRITE_LINE_MEMBER( mbc55x_state::vid_vsync_changed )
{
}
-MC6845_INTERFACE( mb55x_mc6845_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 8, /* numbers of pixels per video memory address */
- NULL, /* begin_update */
- vid_update_row, /* update_row */
- NULL, /* end_update */
- DEVCB_NULL, /* on_de_changed */
- DEVCB_NULL, /* on_cur_changed */
- DEVCB_DRIVER_LINE_MEMBER(mbc55x_state, vid_hsync_changed), /* on_hsync_changed */
- DEVCB_DRIVER_LINE_MEMBER(mbc55x_state, vid_vsync_changed), /* on_vsync_changed */
- NULL
-};
-
void mbc55x_state::video_start()
{
m_debug_video=0;
diff --git a/src/mess/video/mbee.c b/src/mess/video/mbee.c
index fdfd99cd5f3..c1a46682a85 100644
--- a/src/mess/video/mbee.c
+++ b/src/mess/video/mbee.c
@@ -149,7 +149,7 @@ WRITE8_MEMBER( mbee_state::mbeeppc_1c_w )
/* d7 extended graphics (1=allow attributes and pcg banks)
d5 bankswitch basic rom
d4 select attribute ram
- d3..d0 select state->m_videoram bank */
+ d3..d0 select m_videoram bank */
m_1c = data;
membank("basic")->set_entry(BIT(data, 5));
@@ -160,7 +160,7 @@ WRITE8_MEMBER( mbee_state::mbee256_1c_w )
/* d7 extended graphics (1=allow attributes and pcg banks)
d5 bankswitch basic rom
d4 select attribute ram
- d3..d0 select state->m_videoram bank */
+ d3..d0 select m_videoram bank */
m_1c = data;
}
@@ -401,22 +401,21 @@ UINT32 mbee_state::screen_update_mbee(screen_device &screen, bitmap_rgb32 &bitma
}
-MC6845_ON_UPDATE_ADDR_CHANGED( mbee_update_addr )
+MC6845_ON_UPDATE_ADDR_CHANGED( mbee_state::mbee_update_addr )
{
/* not sure what goes in here - parameters passed are device, address, strobe */
}
-MC6845_ON_UPDATE_ADDR_CHANGED( mbee256_update_addr )
+MC6845_ON_UPDATE_ADDR_CHANGED( mbee_state::mbee256_update_addr )
{
/* not used on 256TC */
}
/* monochrome bee */
-MC6845_UPDATE_ROW( mbee_update_row )
+MC6845_UPDATE_ROW( mbee_state::mbee_update_row )
{
- mbee_state *state = device->machine().driver_data<mbee_state>();
- const rgb_t *palette = state->m_palette->palette()->entry_list_raw();
+ const rgb_t *palette = m_palette->palette()->entry_list_raw();
UINT8 chr,gfx;
UINT16 mem,x;
UINT32 *p = &bitmap.pix32(y);
@@ -425,16 +424,16 @@ MC6845_UPDATE_ROW( mbee_update_row )
{
UINT8 inv=0;
mem = (ma + x) & 0x7ff;
- chr = state->m_p_videoram[mem];
+ chr = m_p_videoram[mem];
- state->mbee_video_kbd_scan(x+ma);
+ mbee_video_kbd_scan(x+ma);
/* process cursor */
if (x == cursor_x)
- inv ^= state->m_sy6545_cursor[ra]; // cursor scan row
+ inv ^= m_sy6545_cursor[ra]; // cursor scan row
/* get pattern of pixels for that character scanline */
- gfx = state->m_p_gfxram[(chr<<4) | ra] ^ inv;
+ gfx = m_p_gfxram[(chr<<4) | ra] ^ inv;
/* Display a scanline of a character (8 pixels) */
*p++ = palette[BIT(gfx, 7)];
@@ -449,30 +448,29 @@ MC6845_UPDATE_ROW( mbee_update_row )
}
/* prom-based colours */
-MC6845_UPDATE_ROW( mbeeic_update_row )
+MC6845_UPDATE_ROW( mbee_state::mbeeic_update_row )
{
- mbee_state *state = device->machine().driver_data<mbee_state>();
- const rgb_t *palette = state->m_palette->palette()->entry_list_raw();
+ const rgb_t *palette = m_palette->palette()->entry_list_raw();
UINT8 chr,gfx,fg,bg;
UINT16 mem,x,col;
- UINT16 colourm = (state->m_08 & 0x0e) << 7;
+ UINT16 colourm = (m_08 & 0x0e) << 7;
UINT32 *p = &bitmap.pix32(y);
for (x = 0; x < x_count; x++) // for each character
{
UINT8 inv=0;
mem = (ma + x) & 0x7ff;
- chr = state->m_p_videoram[mem];
- col = state->m_p_colorram[mem] | colourm; // read a byte of colour
+ chr = m_p_videoram[mem];
+ col = m_p_colorram[mem] | colourm; // read a byte of colour
- state->mbee_video_kbd_scan(x+ma);
+ mbee_video_kbd_scan(x+ma);
/* process cursor */
if (x == cursor_x)
- inv ^= state->m_sy6545_cursor[ra]; // cursor scan row
+ inv ^= m_sy6545_cursor[ra]; // cursor scan row
/* get pattern of pixels for that character scanline */
- gfx = state->m_p_gfxram[(chr<<4) | ra] ^ inv;
+ gfx = m_p_gfxram[(chr<<4) | ra] ^ inv;
fg = (col & 0x001f) | 64; // map to foreground palette
bg = (col & 0x07e0) >> 5; // and background palette
@@ -490,10 +488,9 @@ MC6845_UPDATE_ROW( mbeeic_update_row )
/* new colours & hires2 */
-MC6845_UPDATE_ROW( mbeeppc_update_row )
+MC6845_UPDATE_ROW( mbee_state::mbeeppc_update_row )
{
- mbee_state *state = device->machine().driver_data<mbee_state>();
- const rgb_t *palette = state->m_palette->palette()->entry_list_raw();
+ const rgb_t *palette = m_palette->palette()->entry_list_raw();
UINT8 gfx,fg,bg;
UINT16 mem,x,col,chr;
UINT32 *p = &bitmap.pix32(y);
@@ -502,12 +499,12 @@ MC6845_UPDATE_ROW( mbeeppc_update_row )
{
UINT8 inv=0;
mem = (ma + x) & 0x7ff;
- chr = state->m_p_videoram[mem];
- col = state->m_p_colorram[mem]; // read a byte of colour
+ chr = m_p_videoram[mem];
+ col = m_p_colorram[mem]; // read a byte of colour
- if (state->m_1c & 0x80) // are extended features enabled?
+ if (m_1c & 0x80) // are extended features enabled?
{
- UINT8 attr = state->m_p_attribram[mem];
+ UINT8 attr = m_p_attribram[mem];
if (chr & 0x80)
chr += ((attr & 15) << 7); // bump chr to its particular pcg definition
@@ -515,18 +512,18 @@ MC6845_UPDATE_ROW( mbeeppc_update_row )
if (attr & 0x40)
inv ^= 0xff; // inverse attribute
- if ((attr & 0x80) && (state->m_framecnt & 0x10)) // flashing attribute
+ if ((attr & 0x80) && (m_framecnt & 0x10)) // flashing attribute
chr = 0x20;
}
- state->mbee_video_kbd_scan(x+ma);
+ mbee_video_kbd_scan(x+ma);
/* process cursor */
if (x == cursor_x)
- inv ^= state->m_sy6545_cursor[ra]; // cursor scan row
+ inv ^= m_sy6545_cursor[ra]; // cursor scan row
/* get pattern of pixels for that character scanline */
- gfx = state->m_p_gfxram[(chr<<4) | ra] ^ inv;
+ gfx = m_p_gfxram[(chr<<4) | ra] ^ inv;
fg = col & 15; // map to foreground palette
bg = (col & 0xf0) >> 4; // and background palette
diff --git a/src/mess/video/pc1512.c b/src/mess/video/pc1512.c
index f51549967ca..39ae133f0a7 100644
--- a/src/mess/video/pc1512.c
+++ b/src/mess/video/pc1512.c
@@ -360,7 +360,7 @@ WRITE8_MEMBER( pc1512_state::vdu_w )
//-------------------------------------------------
-// mc6845_interface crtc_intf
+// mc6845
//-------------------------------------------------
int pc1512_state::get_display_mode(UINT8 mode)
@@ -394,7 +394,7 @@ offs_t pc1512_state::get_char_rom_offset()
return ((m_lk->read() >> 5) & 0x03) << 11;
}
-void pc1512_state::draw_alpha(bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, int de, int hbp, int vbp, void *param)
+MC6845_UPDATE_ROW( pc1512_state::draw_alpha )
{
offs_t char_rom_offset = get_char_rom_offset();
UINT32 *p = &bitmap.pix32(y + vbp, hbp);
@@ -463,7 +463,7 @@ int pc1512_state::get_color(UINT8 data)
return color;
};
-void pc1512_state::draw_graphics_1(bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, int de, int hbp, int vbp, void *param)
+MC6845_UPDATE_ROW( pc1512_state::draw_graphics_1 )
{
if (y > 199) return;
@@ -483,7 +483,7 @@ void pc1512_state::draw_graphics_1(bitmap_rgb32 &bitmap, const rectangle &clipre
}
}
-void pc1512_state::draw_graphics_2(bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, int de, int hbp, int vbp, void *param)
+MC6845_UPDATE_ROW( pc1512_state::draw_graphics_2 )
{
if (y > 199) return;
@@ -506,42 +506,25 @@ void pc1512_state::draw_graphics_2(bitmap_rgb32 &bitmap, const rectangle &clipre
}
}
-static MC6845_UPDATE_ROW( pc1512_update_row )
+MC6845_UPDATE_ROW( pc1512_state::crtc_update_row )
{
- pc1512_state *state = device->machine().driver_data<pc1512_state>();
-
- switch (state->get_display_mode(state->m_vdu_mode))
+ switch (get_display_mode(m_vdu_mode))
{
case ALPHA_40:
case ALPHA_80:
- state->draw_alpha(bitmap, cliprect, ma, ra, y, x_count, cursor_x, de, hbp, vbp, param);
+ draw_alpha(bitmap, cliprect, ma, ra, y, x_count, cursor_x, de, hbp, vbp);
break;
case GRAPHICS_1:
- state->draw_graphics_1(bitmap, cliprect, ma, ra, y, x_count, cursor_x, de, hbp, vbp, param);
+ draw_graphics_1(bitmap, cliprect, ma, ra, y, x_count, cursor_x, de, hbp, vbp);
break;
case GRAPHICS_2:
- state->draw_graphics_2(bitmap, cliprect, ma, ra, y, x_count, cursor_x, de, hbp, vbp, param);
+ draw_graphics_2(bitmap, cliprect, ma, ra, y, x_count, cursor_x, de, hbp, vbp);
break;
}
}
-static MC6845_INTERFACE( crtc_intf )
-{
- true,
- 0,0,0,0,
- 8,
- NULL,
- pc1512_update_row,
- NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- NULL
-};
-
void pc1512_state::video_start()
{
@@ -616,5 +599,8 @@ MACHINE_CONFIG_FRAGMENT( pc1512_video )
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500))
MCFG_SCREEN_REFRESH_RATE(50)
- MCFG_MC6845_ADD(AMS40041_TAG, AMS40041, SCREEN_TAG, XTAL_28_63636MHz/32, crtc_intf)
+ MCFG_MC6845_ADD(AMS40041_TAG, AMS40041, SCREEN_TAG, XTAL_28_63636MHz/32)
+ MCFG_MC6845_SHOW_BORDER_AREA(true)
+ MCFG_MC6845_CHAR_WIDTH(8)
+ MCFG_MC6845_UPDATE_ROW_CB(pc1512_state, crtc_update_row)
MACHINE_CONFIG_END
diff --git a/src/mess/video/pc8401a.c b/src/mess/video/pc8401a.c
index 2d2d0889d60..835854d50f6 100644
--- a/src/mess/video/pc8401a.c
+++ b/src/mess/video/pc8401a.c
@@ -49,27 +49,6 @@ static ADDRESS_MAP_START( pc8500_lcdc, AS_0, 8, pc8401a_state )
AM_RANGE(0x0000, 0x3fff) AM_RAM
ADDRESS_MAP_END
-/* MC6845 Interface */
-
-static MC6845_UPDATE_ROW( pc8441a_update_row )
-{
-}
-
-
-static MC6845_INTERFACE( pc8441a_mc6845_interface )
-{
- false,
- 0,0,0,0,
- 6,
- NULL,
- pc8441a_update_row,
- NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- NULL
-};
/* Machine Drivers */
@@ -115,5 +94,7 @@ MACHINE_CONFIG_FRAGMENT( pc8500_video )
MCFG_SCREEN_REFRESH_RATE(50)
MCFG_SCREEN_PALETTE("palette")
- MCFG_MC6845_ADD(MC6845_TAG, MC6845, CRT_SCREEN_TAG, 400000, pc8441a_mc6845_interface)
+ MCFG_MC6845_ADD(MC6845_TAG, MC6845, CRT_SCREEN_TAG, 400000)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(6)
MACHINE_CONFIG_END
diff --git a/src/mess/video/pc_t1t.c b/src/mess/video/pc_t1t.c
index 83211353910..54c232e94d7 100644
--- a/src/mess/video/pc_t1t.c
+++ b/src/mess/video/pc_t1t.c
@@ -13,6 +13,17 @@
#include "machine/pic8259.h"
#include "machine/ram.h"
+enum
+{
+ T1000_TEXT_INTEN = 0,
+ T1000_TEXT_BLINK,
+ T1000_GFX_1BPP,
+ T1000_GFX_2BPP,
+ T1000_GFX_4BPP,
+ T1000_GFX_2BPP_TGA,
+ PCJX_TEXT,
+ PCJR_GFX_2BPP_HIGH
+};
const device_type PCVIDEO_T1000 = &device_creator<pcvideo_t1000_device>;
@@ -32,6 +43,7 @@ pc_t1t_device::pc_t1t_device(const machine_config &mconfig, device_type type, co
m_chr_size(0),
m_ra_offset(0),
m_address_data_ff(0),
+ m_update_row_type(-1),
m_display_enable(0),
m_vsync(0),
m_palette_base(0),
@@ -55,7 +67,6 @@ pcvideo_pcjr_device::pcvideo_pcjr_device(const machine_config &mconfig, const ch
void pcvideo_t1000_device::device_start()
{
m_chr_gen = machine().root_device().memregion("gfx1")->base();
- m_update_row = NULL;
m_bank = 0;
m_chr_size = 1;
m_ra_offset = 256;
@@ -65,7 +76,6 @@ void pcvideo_t1000_device::device_start()
void pcvideo_pcjr_device::device_start()
{
m_chr_gen = machine().root_device().memregion("gfx1")->base();
- m_update_row = NULL;
m_bank = 0;
m_mode_control = 0x08;
m_chr_size = 8;
@@ -77,31 +87,12 @@ void pcvideo_pcjr_device::device_start()
}
-static MC6845_UPDATE_ROW( t1000_update_row );
-
-
/***************************************************************************
Static declarations
***************************************************************************/
-static MC6845_INTERFACE( mc6845_t1000_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 8, /* numbers of pixels per video memory address */
- NULL, /* begin_update */
- t1000_update_row, /* update_row */
- NULL, /* end_update */
- DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, pc_t1t_device, t1000_de_changed), /* on_de_changed */
- DEVCB_NULL, /* on_cur_changed */
- DEVCB_NULL, /* on_hsync_changed */
- DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, pcvideo_t1000_device, t1000_vsync_changed), /* on_vsync_changed */
- NULL,
-};
-
-
MACHINE_CONFIG_FRAGMENT( pcvideo_t1000 )
MCFG_SCREEN_ADD(T1000_SCREEN_NAME, RASTER)
MCFG_SCREEN_RAW_PARAMS(XTAL_14_31818MHz,912,0,640,262,0,200)
@@ -110,7 +101,12 @@ MACHINE_CONFIG_FRAGMENT( pcvideo_t1000 )
MCFG_PALETTE_ADD( "palette", 32 )
MCFG_PALETTE_INIT_OWNER(pc_t1t_device, pcjr)
- MCFG_MC6845_ADD(T1000_MC6845_NAME, MC6845, T1000_SCREEN_NAME, XTAL_14_31818MHz/8, mc6845_t1000_intf)
+ MCFG_MC6845_ADD(T1000_MC6845_NAME, MC6845, T1000_SCREEN_NAME, XTAL_14_31818MHz/8)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
+ MCFG_MC6845_UPDATE_ROW_CB(pc_t1t_device, crtc_update_row)
+ MCFG_MC6845_OUT_DE_CB(WRITELINE(pc_t1t_device, t1000_de_changed))
+ MCFG_MC6845_OUT_VSYNC_CB(WRITELINE(pcvideo_t1000_device, t1000_vsync_changed))
MACHINE_CONFIG_END
machine_config_constructor pcvideo_t1000_device::device_mconfig_additions() const
@@ -119,22 +115,6 @@ machine_config_constructor pcvideo_t1000_device::device_mconfig_additions() cons
}
-static MC6845_INTERFACE( mc6845_pcjr_intf )
-{
- false, /* show border area */
- 0,0,0,0, /* visarea adjustment */
- 8, /* numbers of pixels per video memory address */
- NULL, /* begin_update */
- t1000_update_row, /* update_row */
- NULL, /* end_update */
- DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, pc_t1t_device, t1000_de_changed), /* on_de_changed */
- DEVCB_NULL, /* on_cur_changed */
- DEVCB_NULL, /* on_hsync_changed */
- DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, pcvideo_pcjr_device, pcjr_vsync_changed), /* on_vsync_changed */
- NULL
-};
-
-
MACHINE_CONFIG_FRAGMENT( pcvideo_pcjr )
MCFG_SCREEN_ADD(T1000_SCREEN_NAME, RASTER)
MCFG_SCREEN_RAW_PARAMS(XTAL_14_31818MHz,912,0,640,262,0,200)
@@ -143,7 +123,12 @@ MACHINE_CONFIG_FRAGMENT( pcvideo_pcjr )
MCFG_PALETTE_ADD( "palette", 32 )
MCFG_PALETTE_INIT_OWNER(pc_t1t_device, pcjr)
- MCFG_MC6845_ADD(T1000_MC6845_NAME, MC6845, T1000_SCREEN_NAME, XTAL_14_31818MHz/16, mc6845_pcjr_intf)
+ MCFG_MC6845_ADD(T1000_MC6845_NAME, MC6845, T1000_SCREEN_NAME, XTAL_14_31818MHz/16)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
+ MCFG_MC6845_UPDATE_ROW_CB(pcvideo_pcjr_device, crtc_update_row)
+ MCFG_MC6845_OUT_DE_CB(WRITELINE(pc_t1t_device, t1000_de_changed))
+ MCFG_MC6845_OUT_VSYNC_CB(WRITELINE(pcvideo_pcjr_device, pcjr_vsync_changed))
MACHINE_CONFIG_END
machine_config_constructor pcvideo_pcjr_device::device_mconfig_additions() const
@@ -180,10 +165,9 @@ PALETTE_INIT_MEMBER( pc_t1t_device, pcjr )
}
-static MC6845_UPDATE_ROW( t1000_text_inten_update_row )
+MC6845_UPDATE_ROW( pc_t1t_device::t1000_text_inten_update_row )
{
- pc_t1t_device *t1t = downcast<pc_t1t_device *>(device->owner());
- const rgb_t *palette = t1t->m_palette->palette()->entry_list_raw();
+ const rgb_t *palette = m_palette->palette()->entry_list_raw();
UINT32 *p = &bitmap.pix32(y);
int i;
@@ -191,13 +175,13 @@ static MC6845_UPDATE_ROW( t1000_text_inten_update_row )
for ( i = 0; i < x_count; i++ )
{
UINT16 offset = ( ( ma + i ) << 1 ) & 0x3fff;
- UINT8 chr = t1t->m_displayram[ offset ];
- UINT8 attr = t1t->m_displayram[ offset +1 ];
- UINT8 data = t1t->m_chr_gen[ chr * t1t->m_chr_size + ra * t1t->m_ra_offset ];
- UINT16 fg = t1t->m_palette_base + ( attr & 0x0F );
- UINT16 bg = t1t->m_palette_base + ( ( attr >> 4 ) & 0x07 );
+ UINT8 chr = m_displayram[ offset ];
+ UINT8 attr = m_displayram[ offset +1 ];
+ UINT8 data = m_chr_gen[ chr * m_chr_size + ra * m_ra_offset ];
+ UINT16 fg = m_palette_base + ( attr & 0x0F );
+ UINT16 bg = m_palette_base + ( ( attr >> 4 ) & 0x07 );
- if ( i == cursor_x && ( t1t->m_pc_framecnt & 0x08 ) )
+ if ( i == cursor_x && ( m_pc_framecnt & 0x08 ) )
{
data = 0xFF;
}
@@ -214,32 +198,31 @@ static MC6845_UPDATE_ROW( t1000_text_inten_update_row )
}
-static MC6845_UPDATE_ROW( t1000_text_blink_update_row )
+MC6845_UPDATE_ROW( pc_t1t_device::t1000_text_blink_update_row )
{
- pc_t1t_device *t1t = downcast<pc_t1t_device *>(device->owner());
- const rgb_t *palette = t1t->m_palette->palette()->entry_list_raw();
+ const rgb_t *palette = m_palette->palette()->entry_list_raw();
UINT32 *p = &bitmap.pix32(y);
int i;
for ( i = 0; i < x_count; i++ )
{
UINT16 offset = ( ( ma + i ) << 1 ) & 0x3fff;
- UINT8 chr = t1t->m_displayram[ offset ];
- UINT8 attr = t1t->m_displayram[ offset +1 ];
- UINT8 data = t1t->m_chr_gen[ chr * t1t->m_chr_size + ra * t1t->m_ra_offset ];
- UINT16 fg = t1t->m_palette_base + ( attr & 0x0F );
- UINT16 bg = t1t->m_palette_base + ( ( attr >> 4 ) & 0x07 );
+ UINT8 chr = m_displayram[ offset ];
+ UINT8 attr = m_displayram[ offset +1 ];
+ UINT8 data = m_chr_gen[ chr * m_chr_size + ra * m_ra_offset ];
+ UINT16 fg = m_palette_base + ( attr & 0x0F );
+ UINT16 bg = m_palette_base + ( ( attr >> 4 ) & 0x07 );
if ( i == cursor_x )
{
- if ( t1t->m_pc_framecnt & 0x08 )
+ if ( m_pc_framecnt & 0x08 )
{
data = 0xFF;
}
}
else
{
- if ( ( attr & 0x80 ) && ( t1t->m_pc_framecnt & 0x10 ) )
+ if ( ( attr & 0x80 ) && ( m_pc_framecnt & 0x10 ) )
{
data = 0x00;
}
@@ -256,36 +239,35 @@ static MC6845_UPDATE_ROW( t1000_text_blink_update_row )
}
}
-static MC6845_UPDATE_ROW( pcjx_text_update_row )
+MC6845_UPDATE_ROW( pcvideo_pcjr_device::pcjx_text_update_row )
{
- pcvideo_pcjr_device *pcjx = downcast<pcvideo_pcjr_device *>(device->owner());
- const rgb_t *palette = pcjx->m_palette->palette()->entry_list_raw();
+ const rgb_t *palette = m_palette->palette()->entry_list_raw();
UINT32 *p = &bitmap.pix32(y);
int i;
for ( i = 0; i < x_count; i++ )
{
UINT16 offset = ( ( ma + i ) << 1 ) & 0x3fff;
- UINT8 chr = pcjx->m_displayram[ offset ];
- UINT8 attr = pcjx->m_displayram[ offset +1 ];
- UINT16 fg = pcjx->m_palette_base + ( attr & 0x07 );
- UINT16 bg = pcjx->m_palette_base + ( ( attr >> 4 ) & 0x07 );
+ UINT8 chr = m_displayram[ offset ];
+ UINT8 attr = m_displayram[ offset +1 ];
+ UINT16 fg = m_palette_base + ( attr & 0x07 );
+ UINT16 bg = m_palette_base + ( ( attr >> 4 ) & 0x07 );
UINT16 code = chr & 0x1f;
if((attr & 0x88) == 0x88)
{
- code = pcjx->m_displayram[ offset - 2 ] & 0x1f;
+ code = m_displayram[ offset - 2 ] & 0x1f;
code = (code << 8) + chr;
}
else if(attr & 0x80)
- code = (code << 8) + pcjx->m_displayram[ offset + 2 ];
+ code = (code << 8) + m_displayram[ offset + 2 ];
else
code = chr;
UINT8 data;
if(ra < 16)
- data = pcjx->m_jxkanji[code * 16 * 2 + (ra * 2) + ((attr & 8)?1:0)];
+ data = m_jxkanji[code * 16 * 2 + (ra * 2) + ((attr & 8)?1:0)];
else
- data = ((i == cursor_x) && (pcjx->m_pc_framecnt & 8)) ? 0xff: 0;
+ data = ((i == cursor_x) && (m_pc_framecnt & 8)) ? 0xff: 0;
*p = palette[( data & 0x80 ) ? fg : bg]; p++;
*p = palette[( data & 0x40 ) ? fg : bg]; p++;
@@ -298,12 +280,11 @@ static MC6845_UPDATE_ROW( pcjx_text_update_row )
}
}
-static MC6845_UPDATE_ROW( t1000_gfx_4bpp_update_row )
+MC6845_UPDATE_ROW( pc_t1t_device::t1000_gfx_4bpp_update_row )
{
- pc_t1t_device *t1t = downcast<pc_t1t_device *>(device->owner());
- const rgb_t *palette = t1t->m_palette->palette()->entry_list_raw();
+ const rgb_t *palette = m_palette->palette()->entry_list_raw();
UINT32 *p = &bitmap.pix32(y);
- UINT8 *vid = t1t->m_displayram + ( ra << 13 );
+ UINT8 *vid = m_displayram + ( ra << 13 );
int i;
for ( i = 0; i < x_count; i++ )
@@ -311,27 +292,26 @@ static MC6845_UPDATE_ROW( t1000_gfx_4bpp_update_row )
UINT16 offset = ( ( ma + i ) << 1 ) & 0x1fff;
UINT8 data = vid[ offset ];
- *p = palette[t1t->m_palette_base + t1t->m_reg.data[0x10 + ( data >> 4 )]]; p++;
- *p = palette[t1t->m_palette_base + t1t->m_reg.data[0x10 + ( data >> 4 )]]; p++;
- *p = palette[t1t->m_palette_base + t1t->m_reg.data[0x10 + ( data & 0x0F )]]; p++;
- *p = palette[t1t->m_palette_base + t1t->m_reg.data[0x10 + ( data & 0x0F )]]; p++;
+ *p = palette[m_palette_base + m_reg.data[0x10 + ( data >> 4 )]]; p++;
+ *p = palette[m_palette_base + m_reg.data[0x10 + ( data >> 4 )]]; p++;
+ *p = palette[m_palette_base + m_reg.data[0x10 + ( data & 0x0F )]]; p++;
+ *p = palette[m_palette_base + m_reg.data[0x10 + ( data & 0x0F )]]; p++;
data = vid[ offset + 1 ];
- *p = palette[t1t->m_palette_base + t1t->m_reg.data[0x10 + ( data >> 4 )]]; p++;
- *p = palette[t1t->m_palette_base + t1t->m_reg.data[0x10 + ( data >> 4 )]]; p++;
- *p = palette[t1t->m_palette_base + t1t->m_reg.data[0x10 + ( data & 0x0F )]]; p++;
- *p = palette[t1t->m_palette_base + t1t->m_reg.data[0x10 + ( data & 0x0F )]]; p++;
+ *p = palette[m_palette_base + m_reg.data[0x10 + ( data >> 4 )]]; p++;
+ *p = palette[m_palette_base + m_reg.data[0x10 + ( data >> 4 )]]; p++;
+ *p = palette[m_palette_base + m_reg.data[0x10 + ( data & 0x0F )]]; p++;
+ *p = palette[m_palette_base + m_reg.data[0x10 + ( data & 0x0F )]]; p++;
}
}
-static MC6845_UPDATE_ROW( t1000_gfx_2bpp_update_row )
+MC6845_UPDATE_ROW( pc_t1t_device::t1000_gfx_2bpp_update_row )
{
- pc_t1t_device *t1t = downcast<pc_t1t_device *>(device->owner());
- const rgb_t *palette = t1t->m_palette->palette()->entry_list_raw();
+ const rgb_t *palette = m_palette->palette()->entry_list_raw();
UINT32 *p = &bitmap.pix32(y);
- UINT8 *vid = t1t->m_displayram + ( ra << 13 );
+ UINT8 *vid = m_displayram + ( ra << 13 );
int i;
for ( i = 0; i < x_count; i++ )
@@ -339,27 +319,26 @@ static MC6845_UPDATE_ROW( t1000_gfx_2bpp_update_row )
UINT16 offset = ( ( ma + i ) << 1 ) & 0x1fff;
UINT8 data = vid[ offset ];
- *p = palette[t1t->m_palette_base + t1t->m_reg.data[ 0x10 + ( ( data >> 6 ) & 0x03 ) ]]; p++;
- *p = palette[t1t->m_palette_base + t1t->m_reg.data[ 0x10 + ( ( data >> 4 ) & 0x03 ) ]]; p++;
- *p = palette[t1t->m_palette_base + t1t->m_reg.data[ 0x10 + ( ( data >> 2 ) & 0x03 ) ]]; p++;
- *p = palette[t1t->m_palette_base + t1t->m_reg.data[ 0x10 + ( data & 0x03 ) ]]; p++;
+ *p = palette[m_palette_base + m_reg.data[ 0x10 + ( ( data >> 6 ) & 0x03 ) ]]; p++;
+ *p = palette[m_palette_base + m_reg.data[ 0x10 + ( ( data >> 4 ) & 0x03 ) ]]; p++;
+ *p = palette[m_palette_base + m_reg.data[ 0x10 + ( ( data >> 2 ) & 0x03 ) ]]; p++;
+ *p = palette[m_palette_base + m_reg.data[ 0x10 + ( data & 0x03 ) ]]; p++;
data = vid[ offset+1 ];
- *p = palette[t1t->m_palette_base + t1t->m_reg.data[ 0x10 + ( ( data >> 6 ) & 0x03 ) ]]; p++;
- *p = palette[t1t->m_palette_base + t1t->m_reg.data[ 0x10 + ( ( data >> 4 ) & 0x03 ) ]]; p++;
- *p = palette[t1t->m_palette_base + t1t->m_reg.data[ 0x10 + ( ( data >> 2 ) & 0x03 ) ]]; p++;
- *p = palette[t1t->m_palette_base + t1t->m_reg.data[ 0x10 + ( data & 0x03 ) ]]; p++;
+ *p = palette[m_palette_base + m_reg.data[ 0x10 + ( ( data >> 6 ) & 0x03 ) ]]; p++;
+ *p = palette[m_palette_base + m_reg.data[ 0x10 + ( ( data >> 4 ) & 0x03 ) ]]; p++;
+ *p = palette[m_palette_base + m_reg.data[ 0x10 + ( ( data >> 2 ) & 0x03 ) ]]; p++;
+ *p = palette[m_palette_base + m_reg.data[ 0x10 + ( data & 0x03 ) ]]; p++;
}
}
-static MC6845_UPDATE_ROW( pcjr_gfx_2bpp_high_update_row )
+MC6845_UPDATE_ROW( pcvideo_pcjr_device::pcjr_gfx_2bpp_high_update_row )
{
- pcvideo_pcjr_device *pcjr = downcast<pcvideo_pcjr_device *>(device->owner());
- const rgb_t *palette = pcjr->m_palette->palette()->entry_list_raw();
+ const rgb_t *palette = m_palette->palette()->entry_list_raw();
UINT32 *p = &bitmap.pix32(y);
- UINT8 *vid = pcjr->m_displayram + ( ra << 13 );
+ UINT8 *vid = m_displayram + ( ra << 13 );
int i;
for ( i = 0; i < x_count; i++ )
@@ -368,24 +347,23 @@ static MC6845_UPDATE_ROW( pcjr_gfx_2bpp_high_update_row )
UINT8 data0 = vid[ offset ];
UINT8 data1 = vid[ offset + 1 ];
- *p = palette[pcjr->m_palette_base + pcjr->m_reg.data[ 0x10 + ( ( ( data0 & 0x80 ) >> 7 ) | ( ( data1 & 0x80 ) >> 6 ) ) ]]; p++;
- *p = palette[pcjr->m_palette_base + pcjr->m_reg.data[ 0x10 + ( ( ( data0 & 0x40 ) >> 6 ) | ( ( data1 & 0x40 ) >> 5 ) ) ]]; p++;
- *p = palette[pcjr->m_palette_base + pcjr->m_reg.data[ 0x10 + ( ( ( data0 & 0x20 ) >> 5 ) | ( ( data1 & 0x20 ) >> 4 ) ) ]]; p++;
- *p = palette[pcjr->m_palette_base + pcjr->m_reg.data[ 0x10 + ( ( ( data0 & 0x10 ) >> 4 ) | ( ( data1 & 0x10 ) >> 3 ) ) ]]; p++;
- *p = palette[pcjr->m_palette_base + pcjr->m_reg.data[ 0x10 + ( ( ( data0 & 0x08 ) >> 3 ) | ( ( data1 & 0x08 ) >> 2 ) ) ]]; p++;
- *p = palette[pcjr->m_palette_base + pcjr->m_reg.data[ 0x10 + ( ( ( data0 & 0x04 ) >> 2 ) | ( ( data1 & 0x04 ) >> 1 ) ) ]]; p++;
- *p = palette[pcjr->m_palette_base + pcjr->m_reg.data[ 0x10 + ( ( ( data0 & 0x02 ) >> 1 ) | ( ( data1 & 0x02 ) ) ) ]]; p++;
- *p = palette[pcjr->m_palette_base + pcjr->m_reg.data[ 0x10 + ( ( ( data0 & 0x01 ) ) | ( ( data1 & 0x01 ) << 1 ) ) ]]; p++;
+ *p = palette[m_palette_base + m_reg.data[ 0x10 + ( ( ( data0 & 0x80 ) >> 7 ) | ( ( data1 & 0x80 ) >> 6 ) ) ]]; p++;
+ *p = palette[m_palette_base + m_reg.data[ 0x10 + ( ( ( data0 & 0x40 ) >> 6 ) | ( ( data1 & 0x40 ) >> 5 ) ) ]]; p++;
+ *p = palette[m_palette_base + m_reg.data[ 0x10 + ( ( ( data0 & 0x20 ) >> 5 ) | ( ( data1 & 0x20 ) >> 4 ) ) ]]; p++;
+ *p = palette[m_palette_base + m_reg.data[ 0x10 + ( ( ( data0 & 0x10 ) >> 4 ) | ( ( data1 & 0x10 ) >> 3 ) ) ]]; p++;
+ *p = palette[m_palette_base + m_reg.data[ 0x10 + ( ( ( data0 & 0x08 ) >> 3 ) | ( ( data1 & 0x08 ) >> 2 ) ) ]]; p++;
+ *p = palette[m_palette_base + m_reg.data[ 0x10 + ( ( ( data0 & 0x04 ) >> 2 ) | ( ( data1 & 0x04 ) >> 1 ) ) ]]; p++;
+ *p = palette[m_palette_base + m_reg.data[ 0x10 + ( ( ( data0 & 0x02 ) >> 1 ) | ( ( data1 & 0x02 ) ) ) ]]; p++;
+ *p = palette[m_palette_base + m_reg.data[ 0x10 + ( ( ( data0 & 0x01 ) ) | ( ( data1 & 0x01 ) << 1 ) ) ]]; p++;
}
}
-static MC6845_UPDATE_ROW( t1000_gfx_2bpp_tga_update_row )
+MC6845_UPDATE_ROW( pc_t1t_device::t1000_gfx_2bpp_tga_update_row )
{
- pc_t1t_device *t1t = downcast<pc_t1t_device *>(device->owner());
- const rgb_t *palette = t1t->m_palette->palette()->entry_list_raw();
+ const rgb_t *palette = m_palette->palette()->entry_list_raw();
UINT32 *p = &bitmap.pix32(y);
- UINT8 *vid = t1t->m_displayram + ( ra << 13 );
+ UINT8 *vid = m_displayram + ( ra << 13 );
int i;
if ( y == 0 ) logerror("t1000_gfx_2bpp_tga_update_row\n");
@@ -395,27 +373,26 @@ static MC6845_UPDATE_ROW( t1000_gfx_2bpp_tga_update_row )
UINT8 data = vid[ offset ];
UINT16 data2 = ( vid[ offset + 1 ] ) << 1;
- *p = palette[t1t->m_reg.data[ 0x10 + ( ( ( data2 & 0x100 ) | ( data & 0x80 ) ) >> 7 ) ]]; p++;
- *p = palette[t1t->m_reg.data[ 0x10 + ( ( ( data2 & 0x80 ) | ( data & 0x40 ) ) >> 6 ) ]]; p++;
- *p = palette[t1t->m_reg.data[ 0x10 + ( ( ( data2 & 0x40 ) | ( data & 0x20 ) ) >> 5 ) ]]; p++;
- *p = palette[t1t->m_reg.data[ 0x10 + ( ( ( data2 & 0x20 ) | ( data & 0x10 ) ) >> 4 ) ]]; p++;
+ *p = palette[m_reg.data[ 0x10 + ( ( ( data2 & 0x100 ) | ( data & 0x80 ) ) >> 7 ) ]]; p++;
+ *p = palette[m_reg.data[ 0x10 + ( ( ( data2 & 0x80 ) | ( data & 0x40 ) ) >> 6 ) ]]; p++;
+ *p = palette[m_reg.data[ 0x10 + ( ( ( data2 & 0x40 ) | ( data & 0x20 ) ) >> 5 ) ]]; p++;
+ *p = palette[m_reg.data[ 0x10 + ( ( ( data2 & 0x20 ) | ( data & 0x10 ) ) >> 4 ) ]]; p++;
- *p = palette[t1t->m_reg.data[ 0x10 + ( ( ( data2 & 0x10 ) | ( data & 0x08 ) ) >> 3 ) ]]; p++;
- *p = palette[t1t->m_reg.data[ 0x10 + ( ( ( data2 & 0x08 ) | ( data & 0x04 ) ) >> 2 ) ]]; p++;
- *p = palette[t1t->m_reg.data[ 0x10 + ( ( ( data2 & 0x04 ) | ( data & 0x02 ) ) >> 1 ) ]]; p++;
- *p = palette[t1t->m_reg.data[ 0x10 + ( ( data2 & 0x02 ) | ( data & 0x01 ) ) ]]; p++;
+ *p = palette[m_reg.data[ 0x10 + ( ( ( data2 & 0x10 ) | ( data & 0x08 ) ) >> 3 ) ]]; p++;
+ *p = palette[m_reg.data[ 0x10 + ( ( ( data2 & 0x08 ) | ( data & 0x04 ) ) >> 2 ) ]]; p++;
+ *p = palette[m_reg.data[ 0x10 + ( ( ( data2 & 0x04 ) | ( data & 0x02 ) ) >> 1 ) ]]; p++;
+ *p = palette[m_reg.data[ 0x10 + ( ( data2 & 0x02 ) | ( data & 0x01 ) ) ]]; p++;
}
}
-static MC6845_UPDATE_ROW( t1000_gfx_1bpp_update_row )
+MC6845_UPDATE_ROW( pc_t1t_device::t1000_gfx_1bpp_update_row )
{
- pc_t1t_device *t1t = downcast<pc_t1t_device *>(device->owner());
- const rgb_t *palette = t1t->m_palette->palette()->entry_list_raw();
+ const rgb_t *palette = m_palette->palette()->entry_list_raw();
UINT32 *p = &bitmap.pix32(y);
- UINT8 *vid = t1t->m_displayram + ( ra << 13 );
- UINT8 fg = t1t->m_palette_base + t1t->m_reg.data[0x11];
- UINT8 bg = t1t->m_palette_base + t1t->m_reg.data[0x10];
+ UINT8 *vid = m_displayram + ( ra << 13 );
+ UINT8 fg = m_palette_base + m_reg.data[0x11];
+ UINT8 bg = m_palette_base + m_reg.data[0x10];
int i;
if ( y == 0 ) logerror("t1000_gfx_1bpp_update_row\n");
@@ -446,13 +423,51 @@ static MC6845_UPDATE_ROW( t1000_gfx_1bpp_update_row )
}
}
+MC6845_UPDATE_ROW( pc_t1t_device::crtc_update_row )
+{
+ if (m_update_row_type == -1)
+ return;
+
+ switch (m_update_row_type)
+ {
+ case T1000_TEXT_INTEN:
+ t1000_text_inten_update_row(bitmap, cliprect, ma, ra, y, x_count, cursor_x, de, hbp, vbp);
+ break;
+ case T1000_TEXT_BLINK:
+ t1000_text_blink_update_row(bitmap, cliprect, ma, ra, y, x_count, cursor_x, de, hbp, vbp);
+ break;
+ case T1000_GFX_1BPP:
+ t1000_gfx_1bpp_update_row(bitmap, cliprect, ma, ra, y, x_count, cursor_x, de, hbp, vbp);
+ break;
+ case T1000_GFX_2BPP:
+ t1000_gfx_2bpp_update_row(bitmap, cliprect, ma, ra, y, x_count, cursor_x, de, hbp, vbp);
+ break;
+ case T1000_GFX_2BPP_TGA:
+ t1000_gfx_2bpp_tga_update_row(bitmap, cliprect, ma, ra, y, x_count, cursor_x, de, hbp, vbp);
+ break;
+ case T1000_GFX_4BPP:
+ t1000_gfx_4bpp_update_row(bitmap, cliprect, ma, ra, y, x_count, cursor_x, de, hbp, vbp);
+ break;
+ }
+}
+
-static MC6845_UPDATE_ROW( t1000_update_row )
+MC6845_UPDATE_ROW( pcvideo_pcjr_device::crtc_update_row )
{
- pc_t1t_device *t1t = downcast<pc_t1t_device *>(device->owner());
- if ( t1t->m_update_row )
+ if (m_update_row_type == -1)
+ return;
+
+ switch (m_update_row_type)
{
- t1t->m_update_row( device, bitmap, cliprect, ma, ra, y, x_count, cursor_x, de, hbp, vbp, param );
+ case PCJX_TEXT:
+ pcjx_text_update_row(bitmap, cliprect, ma, ra, y, x_count, cursor_x, de, hbp, vbp);
+ break;
+ case PCJR_GFX_2BPP_HIGH:
+ pcjr_gfx_2bpp_high_update_row(bitmap, cliprect, ma, ra, y, x_count, cursor_x, de, hbp, vbp);
+ break;
+ default:
+ pc_t1t_device::crtc_update_row(bitmap, cliprect, ma, ra, y, x_count, cursor_x, de, hbp, vbp);
+ break;
}
}
@@ -478,10 +493,10 @@ void pcvideo_t1000_device::mode_switch( void )
switch( m_mode_control & 0x3B )
{
case 0x08: case 0x09:
- m_update_row = t1000_text_inten_update_row;
+ m_update_row_type = T1000_TEXT_INTEN;
break;
case 0x28: case 0x29:
- m_update_row = t1000_text_blink_update_row;
+ m_update_row_type = T1000_TEXT_BLINK;
break;
case 0x0A: case 0x0B: case 0x2A: case 0x2B:
switch( m_bank & 0xc0 )
@@ -489,7 +504,7 @@ void pcvideo_t1000_device::mode_switch( void )
case 0x00:
case 0x40:
//logerror("t1t_gfx_2bpp - 1\n");
- m_update_row = t1000_gfx_2bpp_update_row;
+ m_update_row_type = T1000_GFX_2BPP;
if ( m_color_select )
{
m_reg.data[0x10] = 0x00;
@@ -508,7 +523,7 @@ void pcvideo_t1000_device::mode_switch( void )
case 0x80:
case 0xc0:
//logerror("t1t_gfx_4bpp\n");
- m_update_row = t1000_gfx_4bpp_update_row;
+ m_update_row_type = T1000_GFX_4BPP;
break;
}
break;
@@ -519,17 +534,17 @@ void pcvideo_t1000_device::mode_switch( void )
case 0x00:
case 0x40:
//logerror("t1t_gfx_1bpp\n");
- m_update_row = t1000_gfx_1bpp_update_row;
+ m_update_row_type = T1000_GFX_1BPP;
break;
case 0x80:
case 0xc0:
//logerror("t1t_gfx_2bpp - 2\n");
- m_update_row = t1000_gfx_2bpp_tga_update_row;
+ m_update_row_type = T1000_GFX_2BPP_TGA;
break;
}
break;
default:
- m_update_row = NULL;
+ m_update_row_type = -1;
break;
}
}
@@ -552,40 +567,40 @@ void pcvideo_pcjr_device::pc_pcjr_mode_switch()
case 0x08: /* 01x0x */
if(m_jxkanji)
{
- m_update_row = pcjx_text_update_row;
+ m_update_row_type = PCJX_TEXT;
break;
}
if ( m_reg.data[3] & 0x02 )
{
- m_update_row = t1000_text_blink_update_row;
+ m_update_row_type = T1000_TEXT_BLINK;
}
else
{
- m_update_row = t1000_text_inten_update_row;
+ m_update_row_type = T1000_TEXT_INTEN;
}
break;
case 0x0A: /* 01x1x */
/* By default use medium resolution mode */
- m_update_row = t1000_gfx_2bpp_update_row;
+ m_update_row_type = T1000_GFX_2BPP;
/* Check for high resolution mode */
if ( ( m_bank & 0xc0 ) == 0xc0 )
- m_update_row = pcjr_gfx_2bpp_high_update_row;
+ m_update_row_type = PCJR_GFX_2BPP_HIGH;
/* Check for 640x200 b/w 2 shades mode */
if ( ( m_reg.data[0] & 0x04 ) && ( m_reg.data[3] & 0x08 ) )
{
- m_update_row = t1000_gfx_1bpp_update_row;
+ m_update_row_type = T1000_GFX_1BPP;
}
break;
case 0x18: /* 11x0x - invalid?? */
- m_update_row = NULL;
+ m_update_row_type = -1;
break;
case 0x1A: /* 11x1x */
- m_update_row = t1000_gfx_4bpp_update_row;
+ m_update_row_type = T1000_GFX_4BPP;
break;
default:
- m_update_row = NULL;
+ m_update_row_type = -1;
break;
}
diff --git a/src/mess/video/pc_t1t.h b/src/mess/video/pc_t1t.h
index 8dd1b582b9e..9d4f2ebb02f 100644
--- a/src/mess/video/pc_t1t.h
+++ b/src/mess/video/pc_t1t.h
@@ -38,6 +38,14 @@ public:
DECLARE_WRITE_LINE_MEMBER( t1000_de_changed );
+ virtual MC6845_UPDATE_ROW( crtc_update_row );
+ MC6845_UPDATE_ROW( t1000_text_inten_update_row );
+ MC6845_UPDATE_ROW( t1000_text_blink_update_row );
+ MC6845_UPDATE_ROW( t1000_gfx_4bpp_update_row );
+ MC6845_UPDATE_ROW( t1000_gfx_2bpp_update_row );
+ MC6845_UPDATE_ROW( t1000_gfx_2bpp_tga_update_row );
+ MC6845_UPDATE_ROW( t1000_gfx_1bpp_update_row );
+
required_device<mc6845_device> m_mc6845;
UINT8 m_mode_control, m_color_select;
UINT8 m_status;
@@ -56,7 +64,7 @@ public:
UINT8 m_address_data_ff;
- mc6845_update_row_func m_update_row;
+ int m_update_row_type;
UINT8 m_display_enable;
UINT8 m_vsync;
UINT8 m_palette_base;
@@ -113,6 +121,10 @@ public:
UINT8 *m_jxkanji;
+ virtual MC6845_UPDATE_ROW( crtc_update_row );
+ MC6845_UPDATE_ROW( pcjx_text_update_row );
+ MC6845_UPDATE_ROW( pcjr_gfx_2bpp_high_update_row );
+
protected:
virtual machine_config_constructor device_mconfig_additions() const;
virtual void device_start();
diff --git a/src/mess/video/super80.c b/src/mess/video/super80.c
index 9376231384a..d67ee220cf0 100644
--- a/src/mess/video/super80.c
+++ b/src/mess/video/super80.c
@@ -357,10 +357,9 @@ UINT32 super80_state::screen_update_super80v(screen_device &screen, bitmap_rgb32
return 0;
}
-MC6845_UPDATE_ROW( super80v_update_row )
+MC6845_UPDATE_ROW( super80_state::crtc_update_row )
{
- super80_state *state = device->machine().driver_data<super80_state>();
- const rgb_t *palette = state->m_palette->palette()->entry_list_raw();
+ const rgb_t *palette = m_palette->palette()->entry_list_raw();
UINT8 chr,col,gfx,fg,bg=0;
UINT16 mem,x;
UINT32 *p = &bitmap.pix32(y);
@@ -370,21 +369,21 @@ MC6845_UPDATE_ROW( super80v_update_row )
UINT8 inv=0;
// if (x == cursor_x) inv=0xff; /* uncomment when mame fixed */
mem = (ma + x) & 0xfff;
- chr = state->m_p_videoram[mem];
+ chr = m_p_videoram[mem];
/* get colour or b&w */
fg = 5; /* green */
- if ((state->m_s_options & 0x60) == 0x60) fg = 15; /* b&w */
+ if ((m_s_options & 0x60) == 0x60) fg = 15; /* b&w */
- if (~state->m_s_options & 0x40)
+ if (~m_s_options & 0x40)
{
- col = state->m_p_colorram[mem]; /* byte of colour to display */
- fg = state->m_palette_index + (col & 0x0f);
- bg = state->m_palette_index + (col >> 4);
+ col = m_p_colorram[mem]; /* byte of colour to display */
+ fg = m_palette_index + (col & 0x0f);
+ bg = m_palette_index + (col >> 4);
}
/* if inverse mode, replace any pcgram chrs with inverse chrs */
- if ((!BIT(state->m_portf0, 4)) && (chr & 0x80)) // is it a high chr in inverse mode
+ if ((!BIT(m_portf0, 4)) && (chr & 0x80)) // is it a high chr in inverse mode
{
inv ^= 0xff; // invert the chr
chr &= 0x7f; // and drop bit 7
@@ -392,10 +391,10 @@ MC6845_UPDATE_ROW( super80v_update_row )
/* process cursor */
if (x == cursor_x)
- inv ^= state->m_mc6845_cursor[ra];
+ inv ^= m_mc6845_cursor[ra];
/* get pattern of pixels for that character scanline */
- gfx = state->m_p_pcgram[(chr<<4) | ra] ^ inv;
+ gfx = m_p_pcgram[(chr<<4) | ra] ^ inv;
/* Display a scanline of a character */
*p++ = palette[BIT(gfx, 7) ? fg : bg];
diff --git a/src/mess/video/v1050.c b/src/mess/video/v1050.c
index 1e357e9aeae..2154b01fb42 100644
--- a/src/mess/video/v1050.c
+++ b/src/mess/video/v1050.c
@@ -52,17 +52,15 @@ WRITE8_MEMBER( v1050_state::videoram_w )
/* MC6845 Interface */
-static MC6845_UPDATE_ROW( v1050_update_row )
+MC6845_UPDATE_ROW( v1050_state::crtc_update_row )
{
- v1050_state *state = device->machine().driver_data<v1050_state>();
-
int column, bit;
for (column = 0; column < x_count; column++)
{
UINT16 address = (((ra & 0x03) + 1) << 13) | ((ma & 0x1fff) + column);
- UINT8 data = state->m_video_ram[address & V1050_VIDEORAM_MASK];
- UINT8 attr = (state->m_attr & 0xfc) | (state->m_attr_ram[address] & 0x03);
+ UINT8 data = m_video_ram[address & V1050_VIDEORAM_MASK];
+ UINT8 attr = (m_attr & 0xfc) | (m_attr_ram[address] & 0x03);
for (bit = 0; bit < 8; bit++)
{
@@ -81,7 +79,7 @@ static MC6845_UPDATE_ROW( v1050_update_row )
/* display blank */
if (attr & V1050_ATTR_BLANK) color = 0;
- bitmap.pix32(vbp + y, hbp + x) = state->m_palette->pen(de ? color : 0);
+ bitmap.pix32(vbp + y, hbp + x) = m_palette->pen(de ? color : 0);
data <<= 1;
}
@@ -95,21 +93,6 @@ WRITE_LINE_MEMBER( v1050_state::crtc_vs_w )
set_interrupt(INT_VSYNC, state);
}
-static MC6845_INTERFACE( crtc_intf )
-{
- true,
- 0,0,0,0,
- 8,
- NULL,
- v1050_update_row,
- NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_DRIVER_LINE_MEMBER(v1050_state, crtc_vs_w),
- NULL
-};
-
/* Video Start */
void v1050_state::video_start()
@@ -124,7 +107,11 @@ void v1050_state::video_start()
/* Machine Drivers */
MACHINE_CONFIG_FRAGMENT( v1050_video )
- MCFG_MC6845_ADD(H46505_TAG, H46505, SCREEN_TAG, XTAL_15_36MHz/8, crtc_intf)
+ MCFG_MC6845_ADD(H46505_TAG, H46505, SCREEN_TAG, XTAL_15_36MHz/8)
+ MCFG_MC6845_SHOW_BORDER_AREA(true)
+ MCFG_MC6845_CHAR_WIDTH(8)
+ MCFG_MC6845_UPDATE_ROW_CB(v1050_state, crtc_update_row)
+ MCFG_MC6845_OUT_VSYNC_CB(WRITELINE(v1050_state, crtc_vs_w))
MCFG_SCREEN_ADD(SCREEN_TAG, RASTER)
MCFG_SCREEN_UPDATE_DEVICE(H46505_TAG, h46505_device, screen_update)