mirror of
https://github.com/holub/mame
synced 2025-10-06 09:00:04 +03:00
myb3k.cpp: Graphics mode 0 corrected to reality, it is a 640x200 8 color/tones mode despite what service manual says
This commit is contained in:
parent
8d2a81806a
commit
fb97900bde
@ -294,7 +294,7 @@ MC6845_UPDATE_ROW( myb3k_state::crtc_update_row )
|
||||
{
|
||||
/* The 6845 is not programmed to get 80 character modes or 400 pixels width but this is managed by external circuitry that selects
|
||||
the apropriate pixelclock based on the video mode latch at i/o address 0x04. This callback always get x_count set to 40 */
|
||||
uint8_t row_length = (m_vmode & 0x02) || (m_vmode == 0 && (m_pal == &m_mpal)) ? x_count * 2 : x_count;
|
||||
uint8_t row_length = (m_vmode & 0x02) || (m_vmode == 0) ? x_count * 2 : x_count;
|
||||
for (int x_pos = 0; x_pos < row_length; x_pos++)
|
||||
{
|
||||
uint16_t page = (m_portc & PC1_SETPAGE) ? 0x8000 : 0;
|
||||
@ -308,19 +308,16 @@ MC6845_UPDATE_ROW( myb3k_state::crtc_update_row )
|
||||
}
|
||||
else
|
||||
{
|
||||
//uint32_t pdat;
|
||||
switch (m_vmode)
|
||||
{
|
||||
case 0:
|
||||
// Color connector doing 320x200, 40x25 characters, 8 grey tones
|
||||
if ((m_io_monitor->read() & 1) == 0)
|
||||
{
|
||||
uint32_t rowstart = (((x_pos + ma) * 32 + ra) & 0x7fff) + page;
|
||||
uint32_t rowstart = (((x_pos + ma * 2) * 16 + ra) & 0x7fff) + page;
|
||||
uint32_t pdat = ((m_vram[rowstart + 0] & 0xff) << 16); // Green 8 bits
|
||||
pdat |= ((m_vram[rowstart + 8] & 0xf0) << 8); // Red upper 4 bits
|
||||
pdat |= ((m_vram[rowstart + 8] & 0x0f) << 4); // Blue upper 4 bits
|
||||
pdat |= ((m_vram[rowstart + 24] & 0xf0) << 4); // Red lower 4 bits
|
||||
pdat |= ((m_vram[rowstart + 24] & 0x0f) << 0); // Blue lower 4 bits
|
||||
pdat |= ((m_vram[rowstart + 8] & 0xf0) << 8); // Red upper 4 bits
|
||||
pdat |= ((m_vram[rowstart + 8] & 0x0f) << 4); // Blue upper 4 bits
|
||||
pdat |= ((m_vram[rowstart + 8] & 0xf0) << 4); // Red lower 4 bits
|
||||
pdat |= ((m_vram[rowstart + 8] & 0x0f) << 0); // Blue lower 4 bits
|
||||
for (int pxl = 0; pxl < 8; pxl++)
|
||||
{
|
||||
uint16_t pind = 0;
|
||||
@ -330,27 +327,10 @@ MC6845_UPDATE_ROW( myb3k_state::crtc_update_row )
|
||||
((pdat & (0x000080 >> pxl)) ? 0x01 : 0x00) );
|
||||
|
||||
/* Check if we are in a cursor and create cursor if so */
|
||||
pind ^= ((cursor_x != -1 && x_pos == cursor_x && ra == 7) ? 7 : 0);
|
||||
//pind ^= ((cursor_x != -1 && x_pos == cursor_x && ra == 7) ? 7 : 0);
|
||||
|
||||
/* Create the grey scale */
|
||||
bitmap.pix32(y, ( x_pos * 8) + pxl) = rgb_t(m_mpal[pind & 0x07].g(),m_mpal[pind & 0x07].g(),m_mpal[pind & 0x07].g());
|
||||
}
|
||||
}
|
||||
else // Monochrome connector doing 640x200, 80x25, b&w
|
||||
{
|
||||
uint32_t rowstart = (((x_pos + ma * 2) * 16 + ra) & 0x7fff) + page;
|
||||
uint16_t pdat = m_vram[rowstart];
|
||||
for (int pxl = 0; pxl < 8; pxl++)
|
||||
{
|
||||
if ((pdat & (0x80 >> pxl)) != 0)
|
||||
{
|
||||
//bitmap.pix32(y, ( x_pos * 8) + pxl) = (*m_pal)[0x07];
|
||||
bitmap.pix32(y, ( x_pos * 8) + pxl) = m_mpal[0x07];
|
||||
}
|
||||
else
|
||||
{
|
||||
bitmap.pix32(y, ( x_pos * 8) + pxl) = rgb_t::black();
|
||||
}
|
||||
bitmap.pix32(y, ( x_pos * 8) + pxl) = (*m_pal)[pind & 0x07];
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -468,17 +448,9 @@ WRITE8_MEMBER( myb3k_state::myb3k_video_mode_w )
|
||||
m_vmode = data;
|
||||
switch (data & 7)
|
||||
{
|
||||
case 0:
|
||||
if ((m_io_monitor->read() & 1) == 0)
|
||||
{
|
||||
LOGVMOD(" - Color display 320x200 on 40x25 8 grey tones\n");
|
||||
rectangle rect(0, 320 - 1, 0, 200 - 1);
|
||||
m_screen->configure(320, 200, rect, HZ_TO_ATTOSECONDS(50));
|
||||
break;
|
||||
}
|
||||
else // Monochrome connector selected?
|
||||
{
|
||||
LOGVMOD(" - Monochrome 640x200 on 80x25 \n");
|
||||
case 0: // Disambiguity between reality and the service manual. Reality is 640x200 in 8 color or tones!
|
||||
{
|
||||
LOGVMOD(" - 640x200 on 80x25 \n");
|
||||
rectangle rect(0, 640 - 1, 0, 200 - 1);
|
||||
m_screen->configure(640, 200, rect, HZ_TO_ATTOSECONDS(50));
|
||||
break;
|
||||
@ -689,23 +661,10 @@ INPUT_CHANGED_MEMBER(myb3k_state::monitor_changed)
|
||||
if ((m_io_monitor->read() & 1) == 1)
|
||||
{
|
||||
m_pal = &m_mpal;
|
||||
if ((m_vmode & 7) == 0)
|
||||
{
|
||||
LOGVMOD(" - Monochrome 640x200 on 80x25 \n");
|
||||
rectangle rect(0, 640 - 1, 0, 200 - 1);
|
||||
m_screen->configure(640, 200, rect, HZ_TO_ATTOSECONDS(50));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pal = &m_cpal;
|
||||
if ((m_vmode & 7) == 0)
|
||||
{
|
||||
m_pal = &m_mpal;
|
||||
LOGVMOD(" - Color display 320x200 on 40x25 8 grey tones\n");
|
||||
rectangle rect(0, 320 - 1, 0, 200 - 1);
|
||||
m_screen->configure(320, 200, rect, HZ_TO_ATTOSECONDS(50));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -781,7 +740,7 @@ void myb3k_state::machine_reset()
|
||||
m_vmode = 0;
|
||||
m_portc = 0;
|
||||
memset(m_dma_page, 0, sizeof(m_dma_page));
|
||||
m_pal = &m_mpal;
|
||||
m_pal = (m_io_monitor-> read() & 1) == 1 ? &m_mpal : &m_cpal;
|
||||
}
|
||||
|
||||
void myb3k_state::select_dma_channel(int channel, bool state)
|
||||
|
Loading…
Reference in New Issue
Block a user