mc6847: Fixed text display with external rom: fixes spc1000 and phc25

This commit is contained in:
Robbbert 2014-01-27 06:40:05 +00:00
parent 5495d321c4
commit cbc57d6b71
2 changed files with 28 additions and 4 deletions

View File

@ -382,6 +382,23 @@ protected:
}
}
// template function for external bytes
template<int bits_per_pixel, int xscale>
ATTR_FORCE_INLINE void emit_extbytes(const UINT8 *data, int length, pixel_t *RESTRICT pixels, UINT16 color_base, const pixel_t *RESTRICT palette)
{
for (int i = 0; i < length; i++)
{
for (int j = 0; j < (8 / bits_per_pixel); j++)
{
for (int k = 0; k < xscale; k++)
{
UINT16 color = color_base + BIT(data[i], 7-j);
pixels[(i * (8 / bits_per_pixel) + j) * xscale + k] = palette[color];
}
}
}
}
// template function for emitting samples
template<int xscale>
UINT32 emit_mc6847_samples(UINT8 mode, const UINT8 *data, int length, pixel_t *RESTRICT pixels, const pixel_t *RESTRICT palette,
@ -429,7 +446,7 @@ protected:
for (int i = 0; i < length; i++)
{
UINT8 byte = get_char_rom(machine(), data[i], y % 12) ^ (mode & MODE_INV ? 0xFF : 0x00);
emit_graphics<2, xscale * 2>(&byte, 1, &pixels[i * 8], (mode & MODE_CSS) ? 14 : 12, palette);
emit_extbytes<1, xscale>(&byte, 1, &pixels[i * 8], (mode & MODE_CSS) ? 14 : 12, palette);
}
result = length * 8 * xscale;
}

View File

@ -224,8 +224,6 @@ void apf_state::machine_reset()
{
m_portb = 0;
m_ca2 = 0;
m_crtc->gm1_w(1);
m_crtc->gm2_w(1);
if (m_cass) // apfimag only
m_cass->change_state(CASSETTE_MOTOR_DISABLED, CASSETTE_MASK_MOTOR);
@ -542,7 +540,16 @@ static const mc6847_interface apf_mc6847_intf =
"screen",
DEVCB_DRIVER_MEMBER(apf_state, videoram_r),
DEVCB_NULL,
DEVCB_DEVICE_LINE_MEMBER("pia0", pia6821_device, cb1_w)
DEVCB_DEVICE_LINE_MEMBER("pia0", pia6821_device, cb1_w),
DEVCB_NULL, /* AG */
DEVCB_LINE_VCC, /* GM2 */
DEVCB_LINE_VCC, /* GM1 */
DEVCB_NULL, /* GM0 */
DEVCB_NULL, /* CSS */
DEVCB_NULL, /* AS */
DEVCB_LINE_GND, /* INTEXT */
DEVCB_NULL, /* INV */
};
static MACHINE_CONFIG_START( apfm1000, apf_state )