summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author Robbbert <pac0446@bigpond.net.au>2016-05-09 00:55:21 +1000
committer Robbbert <pac0446@bigpond.net.au>2016-05-09 00:55:21 +1000
commite6bd4f678a3c134c5ccec2b0034e0073230e1466 (patch)
tree881d8b762352fa283aae8652daefee5949ad0d22 /src
parente4d5ac12d3201fc3202925c4dd36b026c6536570 (diff)
Super80: fixed regression from 2 months ago.
Diffstat (limited to 'src')
-rw-r--r--src/mame/drivers/super80.cpp68
-rw-r--r--src/mame/video/super80.cpp89
2 files changed, 83 insertions, 74 deletions
diff --git a/src/mame/drivers/super80.cpp b/src/mame/drivers/super80.cpp
index 901828b0b91..88c5b5041be 100644
--- a/src/mame/drivers/super80.cpp
+++ b/src/mame/drivers/super80.cpp
@@ -317,6 +317,26 @@ ADDRESS_MAP_END
/**************************** DIPSWITCHES, KEYBOARD, HARDWARE CONFIGURATION ****************************************/
+ /* Enhanced options not available on real hardware */
+static INPUT_PORTS_START( super80_cfg )
+ PORT_START("CONFIG")
+ PORT_CONFNAME( 0x01, 0x01, "Autorun on Quickload")
+ PORT_CONFSETTING( 0x00, DEF_STR(No))
+ PORT_CONFSETTING( 0x01, DEF_STR(Yes))
+ PORT_CONFNAME( 0x02, 0x02, "2 MHz always")
+ PORT_CONFSETTING( 0x02, DEF_STR(No))
+ PORT_CONFSETTING( 0x00, DEF_STR(Yes))
+ PORT_CONFNAME( 0x04, 0x04, "Screen on always")
+ PORT_CONFSETTING( 0x04, DEF_STR(No))
+ PORT_CONFSETTING( 0x00, DEF_STR(Yes))
+ PORT_CONFNAME( 0x08, 0x08, "Cassette Speaker")
+ PORT_CONFSETTING( 0x08, DEF_STR(On))
+ PORT_CONFSETTING( 0x00, DEF_STR(Off))
+ PORT_CONFNAME( 0x60, 0x40, "Colour")
+ PORT_CONFSETTING( 0x60, "White")
+ PORT_CONFSETTING( 0x40, "Green")
+INPUT_PORTS_END
+
static INPUT_PORTS_START( super80 )
PORT_START("DSW")
PORT_BIT( 0xf, 0xf, IPT_UNUSED )
@@ -405,21 +425,7 @@ static INPUT_PORTS_START( super80 )
PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("0") PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CHAR(' ')
PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("LOCK") PORT_CODE(KEYCODE_CAPSLOCK) PORT_CHAR(0x80) // port_char doesn't work, no equivalent key
PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("(Up)") PORT_CODE(KEYCODE_UP) PORT_CHAR(UCHAR_MAMEKEY(UP))
-
- /* Enhanced options not available on real hardware */
- PORT_START("CONFIG")
- PORT_CONFNAME( 0x01, 0x01, "Autorun on Quickload")
- PORT_CONFSETTING( 0x00, DEF_STR(No))
- PORT_CONFSETTING( 0x01, DEF_STR(Yes))
- PORT_CONFNAME( 0x02, 0x02, "2 MHz always")
- PORT_CONFSETTING( 0x02, DEF_STR(No))
- PORT_CONFSETTING( 0x00, DEF_STR(Yes))
- PORT_CONFNAME( 0x04, 0x04, "Screen on always")
- PORT_CONFSETTING( 0x04, DEF_STR(No))
- PORT_CONFSETTING( 0x00, DEF_STR(Yes))
- PORT_CONFNAME( 0x08, 0x08, "Cassette Speaker")
- PORT_CONFSETTING( 0x08, DEF_STR(On))
- PORT_CONFSETTING( 0x00, DEF_STR(Off))
+ PORT_INCLUDE( super80_cfg )
INPUT_PORTS_END
static INPUT_PORTS_START( super80d )
@@ -510,21 +516,7 @@ static INPUT_PORTS_START( super80d )
PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("0") PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CHAR(' ')
PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("LOCK") PORT_CODE(KEYCODE_CAPSLOCK) PORT_CHAR(0x80) // port_char doesn't work, no equivalent key
PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("(Up)") PORT_CODE(KEYCODE_UP) PORT_CHAR(UCHAR_MAMEKEY(UP))
-
- /* Enhanced options not available on real hardware */
- PORT_START("CONFIG")
- PORT_CONFNAME( 0x01, 0x01, "Autorun on Quickload")
- PORT_CONFSETTING( 0x00, DEF_STR(No))
- PORT_CONFSETTING( 0x01, DEF_STR(Yes))
- PORT_CONFNAME( 0x02, 0x02, "2 MHz always")
- PORT_CONFSETTING( 0x02, DEF_STR(No))
- PORT_CONFSETTING( 0x00, DEF_STR(Yes))
- PORT_CONFNAME( 0x04, 0x04, "Screen on always")
- PORT_CONFSETTING( 0x04, DEF_STR(No))
- PORT_CONFSETTING( 0x00, DEF_STR(Yes))
- PORT_CONFNAME( 0x08, 0x08, "Cassette Speaker")
- PORT_CONFSETTING( 0x08, DEF_STR(On))
- PORT_CONFSETTING( 0x00, DEF_STR(Off))
+ PORT_INCLUDE( super80_cfg )
INPUT_PORTS_END
static INPUT_PORTS_START( super80m )
@@ -537,7 +529,7 @@ static INPUT_PORTS_START( super80m )
PORT_CONFSETTING( 0x10, DEF_STR(No))
PORT_CONFSETTING( 0x00, DEF_STR(Yes))
PORT_CONFNAME( 0x60, 0x40, "Colour")
- PORT_CONFSETTING( 0x60, "MonoChrome")
+ PORT_CONFSETTING( 0x60, "White")
PORT_CONFSETTING( 0x40, "Green")
PORT_CONFSETTING( 0x00, "Composite")
PORT_CONFSETTING( 0x20, "RGB")
@@ -551,13 +543,10 @@ static INPUT_PORTS_START( super80v )
INPUT_PORTS_END
static INPUT_PORTS_START( super80r )
- PORT_INCLUDE( super80v )
+ PORT_INCLUDE( super80d )
PORT_MODIFY("CONFIG")
PORT_BIT( 0x16, 0x16, IPT_UNUSED )
- PORT_CONFNAME( 0x60, 0x40, "Colour")
- PORT_CONFSETTING( 0x60, "MonoChrome")
- PORT_CONFSETTING( 0x40, "Green")
INPUT_PORTS_END
@@ -701,13 +690,14 @@ static MACHINE_CONFIG_START( super80, super80_state )
MCFG_Z80PIO_OUT_PA_CB(WRITE8(super80_state, pio_port_a_w))
MCFG_Z80PIO_IN_PB_CB(READ8(super80_state,pio_port_b_r))
- MCFG_SCREEN_ADD_MONOCHROME("screen", RASTER, rgb_t::green)
+ MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(48.8)
MCFG_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART)
MCFG_SCREEN_UPDATE_DRIVER(super80_state, screen_update_super80)
MCFG_SCREEN_PALETTE("palette")
- MCFG_PALETTE_ADD_MONOCHROME("palette")
+ MCFG_PALETTE_ADD("palette", 32)
+ MCFG_PALETTE_INIT_OWNER(super80_state,super80m)
MCFG_GFXDECODE_ADD("gfxdecode", "palette", super80)
MCFG_DEFAULT_LAYOUT( layout_super80 )
@@ -764,10 +754,6 @@ static MACHINE_CONFIG_DERIVED( super80m, super80 )
MCFG_GFXDECODE_MODIFY("gfxdecode", super80m)
- MCFG_PALETTE_MODIFY("palette")
- MCFG_PALETTE_ENTRIES(32)
- MCFG_PALETTE_INIT_OWNER(super80_state,super80m)
-
MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_UPDATE_DRIVER(super80_state, screen_update_super80m)
MCFG_SCREEN_VBLANK_DRIVER(super80_state, screen_eof_super80m)
diff --git a/src/mame/video/super80.cpp b/src/mame/video/super80.cpp
index fc209ddaeb8..c71ebd8ca8c 100644
--- a/src/mame/video/super80.cpp
+++ b/src/mame/video/super80.cpp
@@ -66,14 +66,22 @@ void super80_state::screen_eof_super80m(screen_device &screen, bool state)
UINT32 super80_state::screen_update_super80(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- UINT8 y,ra,chr=32,gfx,screen_on=0;
+ UINT8 y,ra,chr=32,gfx,screen_on=0,fg=0,options=m_io_config->read();
UINT16 sy=0,ma=m_vidpg,x;
output().set_value("cass_led",BIT(m_portf0, 5));
- if ((BIT(m_portf0, 2)) | (!BIT(m_io_config->read(), 2))) /* bit 2 of port F0 is high, OR user turned on config switch */
+ if ((BIT(m_portf0, 2)) | (!BIT(options, 2))) /* bit 2 of port F0 is high, OR user turned on config switch */
screen_on++;
+ if (screen_on)
+ {
+ if BIT(options, 5)
+ fg = 15; /* b&w */
+ else
+ fg = 5; /* green */
+ }
+
for (y = 0; y < 16; y++)
{
for (ra = 0; ra < 10; ra++)
@@ -89,14 +97,14 @@ UINT32 super80_state::screen_update_super80(screen_device &screen, bitmap_ind16
gfx = m_p_chargen[(chr<<4) | ((ra & 8) >> 3) | ((ra & 7) << 1)];
/* Display a scanline of a character */
- *p++ = BIT(gfx, 7);
- *p++ = BIT(gfx, 6);
- *p++ = BIT(gfx, 5);
- *p++ = BIT(gfx, 4);
- *p++ = BIT(gfx, 3);
- *p++ = BIT(gfx, 2);
- *p++ = BIT(gfx, 1);
- *p++ = BIT(gfx, 0);
+ *p++ = BIT(gfx, 7) ? fg : 0;
+ *p++ = BIT(gfx, 6) ? fg : 0;
+ *p++ = BIT(gfx, 5) ? fg : 0;
+ *p++ = BIT(gfx, 4) ? fg : 0;
+ *p++ = BIT(gfx, 3) ? fg : 0;
+ *p++ = BIT(gfx, 2) ? fg : 0;
+ *p++ = BIT(gfx, 1) ? fg : 0;
+ *p++ = BIT(gfx, 0) ? fg : 0;
}
}
ma+=32;
@@ -106,14 +114,22 @@ UINT32 super80_state::screen_update_super80(screen_device &screen, bitmap_ind16
UINT32 super80_state::screen_update_super80d(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- UINT8 y,ra,chr=32,gfx,screen_on=0;
+ UINT8 y,ra,chr=32,gfx,screen_on=0,fg=0,options=m_io_config->read();
UINT16 sy=0,ma=m_vidpg,x;
output().set_value("cass_led",BIT(m_portf0, 5));
- if ((BIT(m_portf0, 2)) | (!BIT(m_io_config->read(), 2))) /* bit 2 of port F0 is high, OR user turned on config switch */
+ if ((BIT(m_portf0, 2)) | (!BIT(options, 2))) /* bit 2 of port F0 is high, OR user turned on config switch */
screen_on++;
+ if (screen_on)
+ {
+ if BIT(options, 5)
+ fg = 15; /* b&w */
+ else
+ fg = 5; /* green */
+ }
+
for (y = 0; y < 16; y++)
{
for (ra = 0; ra < 10; ra++)
@@ -129,14 +145,14 @@ UINT32 super80_state::screen_update_super80d(screen_device &screen, bitmap_ind16
gfx = m_p_chargen[((chr & 0x7f)<<4) | ((ra & 8) >> 3) | ((ra & 7) << 1)] ^ ((chr & 0x80) ? 0xff : 0);
/* Display a scanline of a character */
- *p++ = BIT(gfx, 7);
- *p++ = BIT(gfx, 6);
- *p++ = BIT(gfx, 5);
- *p++ = BIT(gfx, 4);
- *p++ = BIT(gfx, 3);
- *p++ = BIT(gfx, 2);
- *p++ = BIT(gfx, 1);
- *p++ = BIT(gfx, 0);
+ *p++ = BIT(gfx, 7) ? fg : 0;
+ *p++ = BIT(gfx, 6) ? fg : 0;
+ *p++ = BIT(gfx, 5) ? fg : 0;
+ *p++ = BIT(gfx, 4) ? fg : 0;
+ *p++ = BIT(gfx, 3) ? fg : 0;
+ *p++ = BIT(gfx, 2) ? fg : 0;
+ *p++ = BIT(gfx, 1) ? fg : 0;
+ *p++ = BIT(gfx, 0) ? fg : 0;
}
}
ma+=32;
@@ -146,14 +162,22 @@ UINT32 super80_state::screen_update_super80d(screen_device &screen, bitmap_ind16
UINT32 super80_state::screen_update_super80e(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- UINT8 y,ra,chr=32,gfx,screen_on=0;
+ UINT8 y,ra,chr=32,gfx,screen_on=0,fg=0,options=m_io_config->read();
UINT16 sy=0,ma=m_vidpg,x;
output().set_value("cass_led",BIT(m_portf0, 5));
- if ((BIT(m_portf0, 2)) | (!BIT(m_io_config->read(), 2))) /* bit 2 of port F0 is high, OR user turned on config switch */
+ if ((BIT(m_portf0, 2)) | (!BIT(options, 2))) /* bit 2 of port F0 is high, OR user turned on config switch */
screen_on++;
+ if (screen_on)
+ {
+ if BIT(options, 5)
+ fg = 15; /* b&w */
+ else
+ fg = 5; /* green */
+ }
+
for (y = 0; y < 16; y++)
{
for (ra = 0; ra < 10; ra++)
@@ -169,14 +193,14 @@ UINT32 super80_state::screen_update_super80e(screen_device &screen, bitmap_ind16
gfx = m_p_chargen[(chr<<4) | ((ra & 8) >> 3) | ((ra & 7) << 1)];
/* Display a scanline of a character */
- *p++ = BIT(gfx, 7);
- *p++ = BIT(gfx, 6);
- *p++ = BIT(gfx, 5);
- *p++ = BIT(gfx, 4);
- *p++ = BIT(gfx, 3);
- *p++ = BIT(gfx, 2);
- *p++ = BIT(gfx, 1);
- *p++ = BIT(gfx, 0);
+ *p++ = BIT(gfx, 7) ? fg : 0;
+ *p++ = BIT(gfx, 6) ? fg : 0;
+ *p++ = BIT(gfx, 5) ? fg : 0;
+ *p++ = BIT(gfx, 4) ? fg : 0;
+ *p++ = BIT(gfx, 3) ? fg : 0;
+ *p++ = BIT(gfx, 2) ? fg : 0;
+ *p++ = BIT(gfx, 1) ? fg : 0;
+ *p++ = BIT(gfx, 0) ? fg : 0;
}
}
ma+=32;
@@ -186,9 +210,8 @@ UINT32 super80_state::screen_update_super80e(screen_device &screen, bitmap_ind16
UINT32 super80_state::screen_update_super80m(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- UINT8 y,ra,chr=32,gfx,screen_on=0;
+ UINT8 y,ra,chr=32,gfx,screen_on=0,col,bg=0,fg=0,options=m_io_config->read();
UINT16 sy=0,ma=m_vidpg,x;
- UINT8 col, bg=0, fg=0, options=m_io_config->read();
/* get selected character generator */
UINT8 cgen = m_current_charset ^ ((options & 0x10)>>4); /* bit 0 of port F1 and cgen config switch */
@@ -200,7 +223,7 @@ UINT32 super80_state::screen_update_super80m(screen_device &screen, bitmap_ind16
if (screen_on)
{
- if ((options & 0x60) == 0x60)
+ if BIT(options, 5)
fg = 15; /* b&w */
else
fg = 5; /* green */