mirror of
https://github.com/holub/mame
synced 2025-10-05 00:38:58 +03:00
ef9365.cpp: Fixed vertical characters and use assigned palette.
This commit is contained in:
parent
d6b22fa2c0
commit
759a835d63
@ -285,7 +285,7 @@ void ef9365_device::set_color_entry( int index, uint8_t r, uint8_t g, uint8_t b
|
|||||||
{
|
{
|
||||||
if( index < nb_of_colors )
|
if( index < nb_of_colors )
|
||||||
{
|
{
|
||||||
palette[index] = rgb_t(r, g, b);
|
m_palette->set_pen_color(index, rgb_t(r, g, b));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -309,27 +309,18 @@ void ef9365_device::set_color_filler( uint8_t color )
|
|||||||
|
|
||||||
void ef9365_device::device_start()
|
void ef9365_device::device_start()
|
||||||
{
|
{
|
||||||
int i;
|
|
||||||
|
|
||||||
m_irq_handler.resolve_safe();
|
m_irq_handler.resolve_safe();
|
||||||
|
|
||||||
m_busy_timer = timer_alloc(BUSY_TIMER);
|
m_busy_timer = timer_alloc(BUSY_TIMER);
|
||||||
|
|
||||||
m_videoram = &space(0);
|
m_videoram = &space(0);
|
||||||
m_current_color = 0x0F;
|
m_current_color = 0x00;
|
||||||
|
|
||||||
m_irq_vb = 0;
|
m_irq_vb = 0;
|
||||||
m_irq_lb = 0;
|
m_irq_lb = 0;
|
||||||
m_irq_rdy = 0;
|
m_irq_rdy = 0;
|
||||||
m_irq_state = 0;
|
m_irq_state = 0;
|
||||||
|
|
||||||
// Default palette : Black and white
|
|
||||||
palette[0] = rgb_t(0, 0, 0);
|
|
||||||
for( i = 1; i < 16 ; i++ )
|
|
||||||
{
|
|
||||||
palette[i] = rgb_t(255, 255, 255);
|
|
||||||
}
|
|
||||||
|
|
||||||
m_screen_out.allocate( bitplane_xres, screen().height() );
|
m_screen_out.allocate( bitplane_xres, screen().height() );
|
||||||
|
|
||||||
save_item(NAME(m_border));
|
save_item(NAME(m_border));
|
||||||
@ -547,7 +538,7 @@ void ef9365_device::plot(int x_pos,int y_pos)
|
|||||||
|
|
||||||
const static unsigned int vectortype_code[][8] =
|
const static unsigned int vectortype_code[][8] =
|
||||||
{
|
{
|
||||||
{0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // Continous drawing
|
{0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // Continuous drawing
|
||||||
{0x82,0x02,0x00,0x00,0x00,0x00,0x00,0x00}, // Dotted - 2 dots on, 2 dots off
|
{0x82,0x02,0x00,0x00,0x00,0x00,0x00,0x00}, // Dotted - 2 dots on, 2 dots off
|
||||||
{0x84,0x04,0x00,0x00,0x00,0x00,0x00,0x00}, // Dashed - 4 dots on, 4 dots off
|
{0x84,0x04,0x00,0x00,0x00,0x00,0x00,0x00}, // Dashed - 4 dots on, 4 dots off
|
||||||
{0x8A,0x02,0x82,0x02,0x00,0x00,0x00,0x00} // Dotted-Dashed - 10 dots on, 2 dots off, 2 dots on, 2 dots off
|
{0x8A,0x02,0x82,0x02,0x00,0x00,0x00,0x00} // Dotted-Dashed - 10 dots on, 2 dots off, 2 dots on, 2 dots off
|
||||||
@ -828,22 +819,21 @@ int ef9365_device::draw_character( unsigned char c, int block, int smallblock )
|
|||||||
{
|
{
|
||||||
if ( block || get_char_pix( c, x_char, ( (y_char_res - 1) - y_char ) ) )
|
if ( block || get_char_pix( c, x_char, ( (y_char_res - 1) - y_char ) ) )
|
||||||
{
|
{
|
||||||
if( m_registers[EF936X_REG_CTRL2] & 0x04) // Titled character ?
|
if( m_registers[EF936X_REG_CTRL2] & 0x04) // Tilted character
|
||||||
{
|
{
|
||||||
for(q = 0; q < q_factor; q++)
|
for(q = 0; q < q_factor; q++)
|
||||||
{
|
{
|
||||||
for(p = 0; p < p_factor; p++)
|
for(p = 0; p < p_factor; p++)
|
||||||
{
|
{
|
||||||
if( !(m_registers[EF936X_REG_CTRL2] & 0x08) )
|
if( !(m_registers[EF936X_REG_CTRL2] & 0x08) )
|
||||||
{ // Titled - Horizontal orientation
|
{ // Tilted - Horizontal orientation
|
||||||
plot(
|
plot(
|
||||||
x + ( (y_char*q_factor) + q ) + ( (x_char*p_factor) + p ),
|
x + ( (y_char*q_factor) + q ) + ( (x_char*p_factor) + p ),
|
||||||
y + ( (y_char*q_factor) + q )
|
y + ( (y_char*q_factor) + q )
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{ // Tilted - Vertical orientation
|
||||||
// Titled - Vertical orientation
|
|
||||||
plot(
|
plot(
|
||||||
x - ( (y_char*q_factor)+ q ),
|
x - ( (y_char*q_factor)+ q ),
|
||||||
y + ( (x_char*p_factor)+ p ) - ( ( ( (y_char_res - 1 ) - y_char) * q_factor ) + ( q_factor - q ) )
|
y + ( (x_char*p_factor)+ p ) - ( ( ( (y_char_res - 1 ) - y_char) * q_factor ) + ( q_factor - q ) )
|
||||||
@ -859,14 +849,14 @@ int ef9365_device::draw_character( unsigned char c, int block, int smallblock )
|
|||||||
for(p = 0; p < p_factor; p++)
|
for(p = 0; p < p_factor; p++)
|
||||||
{
|
{
|
||||||
if( !(m_registers[EF936X_REG_CTRL2] & 0x08) )
|
if( !(m_registers[EF936X_REG_CTRL2] & 0x08) )
|
||||||
{ // Normal - Horizontal orientation
|
{ // Normal - Horizontal orientation
|
||||||
plot(
|
plot(
|
||||||
x + ( (x_char*p_factor) + p ),
|
x + ( (x_char*p_factor) + p ),
|
||||||
y + ( (y_char*q_factor) + q )
|
y + ( (y_char*q_factor) + q )
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ // Normal - Vertical orientation
|
{ // Normal - Vertical orientation
|
||||||
plot(
|
plot(
|
||||||
x - ( (y_char*q_factor) + q ),
|
x - ( (y_char*q_factor) + q ),
|
||||||
y + ( (x_char*p_factor) + p )
|
y + ( (x_char*p_factor) + p )
|
||||||
@ -887,7 +877,7 @@ int ef9365_device::draw_character( unsigned char c, int block, int smallblock )
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
y = y + ( (x_char_res + 1 ) * p_factor ) ;
|
y = y + ( (x_char_res + 1 ) * p_factor ) ;
|
||||||
set_x_reg(y);
|
set_y_reg(y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -905,7 +895,7 @@ int ef9365_device::cycles_to_us(int cycles)
|
|||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// dump_bitplanes_word: Latch the bitplane words
|
// dump_bitplanes_word: Latch the bitplane words
|
||||||
// pointed by the x & y regiters
|
// pointed by the x & y registers
|
||||||
// (Memory read back function)
|
// (Memory read back function)
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
@ -1165,7 +1155,7 @@ void ef9365_device::ef9365_exec(uint8_t cmd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// screen_update: Framebuffer video ouput
|
// screen_update: Framebuffer video output
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
uint32_t ef9365_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
|
uint32_t ef9365_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
|
||||||
@ -1189,7 +1179,7 @@ uint32_t ef9365_device::screen_update(screen_device &screen, bitmap_rgb32 &bitma
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_screen_out.pix32(j, i) = palette[ color_index ];
|
m_screen_out.pix32(j, i) = m_palette->pen( color_index );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -106,7 +106,6 @@ private:
|
|||||||
uint8_t m_state; //status register
|
uint8_t m_state; //status register
|
||||||
uint8_t m_border[80]; //border color
|
uint8_t m_border[80]; //border color
|
||||||
|
|
||||||
rgb_t palette[256]; // 8 bitplanes max -> 256 colors max
|
|
||||||
int nb_of_bitplanes;
|
int nb_of_bitplanes;
|
||||||
int nb_of_colors;
|
int nb_of_colors;
|
||||||
int bitplane_xres;
|
int bitplane_xres;
|
||||||
|
Loading…
Reference in New Issue
Block a user