summaryrefslogtreecommitdiffstatshomepage
path: root/src/mess/drivers/pyl601.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mess/drivers/pyl601.c')
-rw-r--r--src/mess/drivers/pyl601.c71
1 files changed, 24 insertions, 47 deletions
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 */