(MESS) mbee : added choice of monochrome or colour, since the real machines could be purchased this way. (nw)

This commit is contained in:
Robbbert 2015-03-13 01:18:47 +11:00
parent f1419f6a95
commit 81c8255b20
3 changed files with 58 additions and 58 deletions

View File

@ -410,6 +410,12 @@ static INPUT_PORTS_START( mbee )
PORT_CONFNAME( 0x01, 0x01, "Autorun on Quickload")
PORT_CONFSETTING( 0x00, DEF_STR(No))
PORT_CONFSETTING( 0x01, DEF_STR(Yes))
// monochrome monitor could be used
PORT_CONFNAME( 0x30, 0x00, "Monitor type")
PORT_CONFSETTING( 0x00, "Colour")
PORT_CONFSETTING( 0x10, "Green")
PORT_CONFSETTING( 0x20, "Amber")
PORT_CONFSETTING( 0x30, "White")
// Wire links on motherboard
PORT_CONFNAME( 0xc0, 0x00, "PIO B7")
PORT_CONFSETTING( 0x00, "VS") // sync pulse to enable telcom clock
@ -427,6 +433,12 @@ static INPUT_PORTS_START( mbee128 )
PORT_CONFNAME( 0x01, 0x01, "Autorun on Quickload")
PORT_CONFSETTING( 0x00, DEF_STR(No))
PORT_CONFSETTING( 0x01, DEF_STR(Yes))
// monochrome monitor could be used
PORT_CONFNAME( 0x30, 0x00, "Monitor type")
PORT_CONFSETTING( 0x00, "Colour")
PORT_CONFSETTING( 0x10, "Green")
PORT_CONFSETTING( 0x20, "Amber")
PORT_CONFSETTING( 0x30, "White")
// Wire links on motherboard
PORT_CONFNAME( 0xc0, 0x40, "PIO B7")
PORT_CONFSETTING( 0x00, "VS") // sync pulse to enable telcom clock
@ -591,7 +603,7 @@ static const gfx_layout mbee_charlayout =
};
static GFXDECODE_START( mono )
GFXDECODE_ENTRY( "gfx", 0x0000, mbee_charlayout, 0, 1 )
GFXDECODE_ENTRY( "gfx", 0x0000, mbee_charlayout, 96, 1 )
GFXDECODE_END
static GFXDECODE_START( standard )
@ -634,7 +646,9 @@ static MACHINE_CONFIG_START( mbee, mbee_state )
MCFG_SCREEN_UPDATE_DRIVER(mbee_state, screen_update_mbee)
MCFG_GFXDECODE_ADD("gfxdecode", "palette", mono)
MCFG_PALETTE_ADD_MONOCHROME_AMBER("palette") // usually sold with amber or green monitor
MCFG_PALETTE_ADD("palette", 100)
MCFG_PALETTE_INIT_OWNER(mbee_state, standard)
MCFG_VIDEO_START_OVERRIDE(mbee_state, mono)
@ -649,7 +663,7 @@ static MACHINE_CONFIG_START( mbee, mbee_state )
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, mono_update_row)
MCFG_MC6845_UPDATE_ROW_CB(mbee_state, crtc_update_row)
MCFG_MC6845_ADDR_CHANGED_CB(mbee_state, crtc_update_addr)
MCFG_MC6845_OUT_VSYNC_CB(WRITELINE(mbee_state, crtc_vs))
@ -692,7 +706,7 @@ static MACHINE_CONFIG_START( mbeeic, mbee_state )
MCFG_GFXDECODE_ADD("gfxdecode", "palette", standard)
MCFG_PALETTE_ADD("palette", 96)
MCFG_PALETTE_ADD("palette", 100)
MCFG_PALETTE_INIT_OWNER(mbee_state, standard)
MCFG_VIDEO_START_OVERRIDE(mbee_state, standard)
@ -708,7 +722,7 @@ static MACHINE_CONFIG_START( mbeeic, mbee_state )
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, colour_update_row)
MCFG_MC6845_UPDATE_ROW_CB(mbee_state, crtc_update_row)
MCFG_MC6845_ADDR_CHANGED_CB(mbee_state, crtc_update_addr)
MCFG_MC6845_OUT_VSYNC_CB(WRITELINE(mbee_state, crtc_vs))
@ -738,7 +752,6 @@ static MACHINE_CONFIG_DERIVED( mbeeppc, mbeeic )
MCFG_VIDEO_START_OVERRIDE(mbee_state, premium)
MCFG_GFXDECODE_MODIFY("gfxdecode", premium)
MCFG_PALETTE_MODIFY("palette")
MCFG_PALETTE_ENTRIES(16)
MCFG_PALETTE_INIT_OWNER(mbee_state, premium)
MCFG_MC146818_ADD( "rtc", XTAL_32_768kHz )
MCFG_MC146818_IRQ_HANDLER(WRITELINE(mbee_state, rtc_irq_w))

View File

@ -105,14 +105,12 @@ public:
DECLARE_MACHINE_RESET(mbeett);
UINT32 screen_update_mbee(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
TIMER_CALLBACK_MEMBER(timer_newkb);
TIMER_CALLBACK_MEMBER(timer_boot);
DECLARE_QUICKLOAD_LOAD_MEMBER(mbee);
DECLARE_QUICKLOAD_LOAD_MEMBER(mbee_z80bin);
WRITE_LINE_MEMBER(rtc_irq_w);
WRITE_LINE_MEMBER(fdc_intrq_w);
WRITE_LINE_MEMBER(fdc_drq_w);
MC6845_UPDATE_ROW(mono_update_row);
MC6845_UPDATE_ROW(colour_update_row);
MC6845_UPDATE_ROW(crtc_update_row);
MC6845_ON_UPDATE_ADDR_CHANGED(crtc_update_addr);
required_device<palette_device> m_palette;

View File

@ -235,7 +235,6 @@ void mbee_state::oldkb_matrix_r(UINT16 offs)
if( keydown )
m_crtc->assert_light_pen_input(); //lpen_strobe
}
}
@ -291,14 +290,17 @@ VIDEO_START_MEMBER( mbee_state, mono )
{
m_p_videoram = memregion("videoram")->base();
m_p_gfxram = memregion("gfx")->base()+0x1000;
m_p_colorram = 0;
m_p_attribram = 0;
m_is_premium = 0;
}
VIDEO_START_MEMBER( mbee_state, standard )
{
m_p_videoram = memregion("videoram")->base();
m_p_colorram = memregion("colorram")->base();
m_p_gfxram = memregion("gfx")->base()+0x1000;
m_p_colorram = memregion("colorram")->base();
m_p_attribram = 0;
m_is_premium = 0;
}
@ -328,56 +330,26 @@ MC6845_ON_UPDATE_ADDR_CHANGED( mbee_state::crtc_update_addr )
}
/* monochrome bee */
MC6845_UPDATE_ROW( mbee_state::mono_update_row )
MC6845_UPDATE_ROW( mbee_state::crtc_update_row )
{
const rgb_t *palette = m_palette->palette()->entry_list_raw();
UINT8 chr,gfx;
UINT16 mem,x;
UINT32 *p = &bitmap.pix32(y);
for (x = 0; x < x_count; x++) // for each character
{
UINT8 inv=0;
mem = (ma + x) & 0x7ff;
chr = m_p_videoram[mem];
oldkb_scan(x+ma);
/* process cursor */
if (x == cursor_x)
inv ^= m_sy6545_cursor[ra]; // cursor scan row
/* get pattern of pixels for that character scanline */
gfx = m_p_gfxram[(chr<<4) | ra] ^ inv;
/* Display a scanline of a character (8 pixels) */
*p++ = palette[BIT(gfx, 7)];
*p++ = palette[BIT(gfx, 6)];
*p++ = palette[BIT(gfx, 5)];
*p++ = palette[BIT(gfx, 4)];
*p++ = palette[BIT(gfx, 3)];
*p++ = palette[BIT(gfx, 2)];
*p++ = palette[BIT(gfx, 1)];
*p++ = palette[BIT(gfx, 0)];
}
}
/* colour bee */
MC6845_UPDATE_ROW( mbee_state::colour_update_row )
{
const rgb_t *palette = m_palette->palette()->entry_list_raw();
UINT8 inv,attr,gfx,fg,bg,col;
UINT16 mem,x,chr;
// colours
UINT8 colourm = (m_08 & 0x0e) >> 1;
UINT8 monopal = (m_io_config->read() & 0x30) >> 4;
// if colour chosen on mono bee, default to amber
if (!monopal && !m_p_colorram)
monopal = 2;
UINT32 *p = &bitmap.pix32(y);
UINT8 inv, attr=0, gfx, fg=96+monopal, bg=96, col=0;
UINT16 mem, x, chr;
for (x = 0; x < x_count; x++) // for each character
{
inv = 0;
mem = (ma + x) & 0x7ff;
chr = m_p_videoram[mem];
col = m_p_colorram[mem]; // read a byte of colour
if BIT(m_1c, 7) // premium graphics enabled?
{
@ -403,15 +375,20 @@ MC6845_UPDATE_ROW( mbee_state::colour_update_row )
gfx = m_p_gfxram[(chr<<4) | ra] ^ inv;
// get colours
if (m_is_premium)
if (!monopal)
{
fg = col & 15;
bg = col >> 4;
}
else
{
fg = (col & 0x1f) | 64;
bg = ((col & 0xe0) >> 2) | colourm;
col = m_p_colorram[mem]; // read a byte of colour
if (m_is_premium)
{
fg = col & 15;
bg = col >> 4;
}
else
{
fg = (col & 0x1f) | 64;
bg = ((col & 0xe0) >> 2) | colourm;
}
}
/* Display a scanline of a character (8 pixels) */
@ -474,6 +451,12 @@ PALETTE_INIT_MEMBER( mbee_state, standard )
b = fglevel[(BIT(k, 0))|(BIT(k, 3)<<1)];
palette.set_pen_color(i|64, rgb_t(r, g, b));
}
// monochrome palette
palette.set_pen_color(96, rgb_t(0x00, 0x00, 0x00)); // black
palette.set_pen_color(97, rgb_t(0x00, 0xff, 0x00)); // green
palette.set_pen_color(98, rgb_t(0xf7, 0xaa, 0x00)); // amber
palette.set_pen_color(99, rgb_t(0xff, 0xff, 0xff)); // white
}
@ -501,4 +484,10 @@ PALETTE_INIT_MEMBER( mbee_state, premium )
b = BIT(i, 2) ? 0xff : 0;
palette.set_pen_color(i, rgb_t(r, g, b));
}
// monochrome palette
palette.set_pen_color(96, rgb_t(0x00, 0x00, 0x00)); // black
palette.set_pen_color(97, rgb_t(0x00, 0xff, 0x00)); // green
palette.set_pen_color(98, rgb_t(0xf7, 0xaa, 0x00)); // amber
palette.set_pen_color(99, rgb_t(0xff, 0xff, 0xff)); // white
}