video/bfm_dm01.cpp: Convert back to using outputs and update layouts.

Outputs no longer require string formatting and hash lookups, and only
changes to output values result in notifications.  Performance is
better than before.  We never had any kind of post-processing to make
the "alternate pixels" screen bitmap look like a DMD, and the bilinear
scaling looked awful.
This commit is contained in:
Vas Crabb 2020-09-10 04:28:37 +10:00
parent 8a5d4df2f7
commit d464d6caeb
13 changed files with 9389 additions and 38686 deletions

View File

@ -6,10 +6,29 @@
</rect>
</element>
<element name="dotmatrixdot">
<dotmatrixdot>
<color red="1.0" green="0.12" blue="0.12" />
</dotmatrixdot>
</element>
<group name="dmd">
<repeat count="21">
<param name="s" start="0" increment="65" />
<param name="y" start="0" increment="1" />
<repeat count="65">
<param name="n" start="~s~" increment="1" />
<param name="x" start="0" increment="1" />
<element name="dotmatrix~n~" ref="dotmatrixdot" state="0">
<bounds x="~x~" y="~y~" width="1" height="1" />
</element>
</repeat>
</repeat>
</group>
<view name="main">
<screen tag="dm01:dmd">
<group ref="dmd">
<bounds x="149" y="0" width="102" height="42"/>
</screen>
</group>
<element ref="dmd_background" blend="add">
<bounds x="149" y="0" width="102" height="42"/>
</element>

View File

@ -179,7 +179,7 @@ Didact MD6802 layout
</group>
<group name="keyboard">
<backdrop element="pcb_color"><bounds left="0" top="0" right="289" bottom="327"/></backdrop>
<element ref="pcb_color"><bounds left="0" top="0" right="289" bottom="327"/></element>
<element ref="text_md6802_kb"><bounds x="20" y="10" width="112" height="8" /></element>
<element ref="text_terminal"><bounds x="10" y="208" width="26" height="6" /></element>
@ -271,7 +271,7 @@ Didact MD6802 layout
</group>
<group name="cpuboard">
<backdrop element="pcb_color"><bounds left="0" top="0" right="390" bottom="242"/></backdrop>
<element ref="pcb_color"><bounds left="0" top="0" right="390" bottom="242"/></element>
<element ref="text_md6802_cpu"><bounds x="25" y="22" width="8" height="75" /><orientation rotate="90" /></element>
<group ref="eurofem"><bounds x="267" y="12" height="228" width="24" /><orientation rotate="90" /></group>
@ -321,7 +321,7 @@ Didact MD6802 layout
</group>
<group name="breadboard">
<backdrop element="bb_color"><bounds left="0" top="0" right="1300" bottom="3720"/></backdrop>
<element ref="bb_color"><bounds left="0" top="0" right="1300" bottom="3720"/></element>
<repeat count="47">
<param name="y" start="400" increment="62" />
<param name="yh" start="405" increment="62" />
@ -373,7 +373,7 @@ Didact MD6802 layout
</group>
<view name="Base Artwork">
<backdrop element="black"><bounds left="0" top="0" right="1211" bottom="551"/></backdrop>
<bounds left="0" top="0" right="1211" bottom="551"/>
<group ref="keyboard"><bounds x="0" y="31" width="400" height="450" /></group>
<group ref="cpuboard"><bounds x="405" y="92" width="540" height="338" /></group>
<group ref="breadboard"><bounds x="951" y="0" width="191" height="551" /></group>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -60,13 +60,12 @@ DEFINE_DEVICE_TYPE(BFM_DM01, bfm_dm01_device, "bfm_dm01", "BFM Dotmatrix 01")
bfm_dm01_device::bfm_dm01_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, BFM_DM01, tag, owner, clock),
m_matrixcpu(*this, "matrix"),
m_screen(*this, "dmd"),
m_palette(*this, "palette_lcd"),
m_data_avail(0),
m_control(0),
m_xcounter(0),
m_busy(0),
m_comdata(0),
m_dotmatrix(*this, "dotmatrix%u", 0U),
m_busy_cb(*this)
{
for (auto & elem : m_segbuffer)
@ -82,12 +81,7 @@ bfm_dm01_device::bfm_dm01_device(const machine_config &mconfig, const char *tag,
void bfm_dm01_device::device_start()
{
if(!m_screen->started())
throw device_missing_dependencies();
if(!m_palette->started())
throw device_missing_dependencies();
m_dotmatrix.resolve();
m_busy_cb.resolve_safe();
save_item(NAME(m_data_avail));
@ -96,16 +90,9 @@ void bfm_dm01_device::device_start()
save_item(NAME(m_busy));
save_item(NAME(m_comdata));
for (int i = 0; i < 65; i++)
save_item(NAME(m_segbuffer), i);
save_item(NAME(m_segbuffer));
for (int i = 0; i < BYTES_PER_ROW; i++)
save_item(NAME(m_scanline), i);
m_screen->register_screen_bitmap(m_tmpbitmap);
m_palette->set_pen_color(0, rgb_t(0, 0, 0)); // background
m_palette->set_pen_color(1, rgb_t(15, 1, 1)); // off dot
m_palette->set_pen_color(2, rgb_t(255, 31, 31)); // on dot
save_item(NAME(m_scanline));
}
@ -126,7 +113,7 @@ void bfm_dm01_device::device_reset()
///////////////////////////////////////////////////////////////////////////
int bfm_dm01_device::read_data(void)
int bfm_dm01_device::read_data()
{
int data = m_comdata;
@ -182,12 +169,12 @@ void bfm_dm01_device::mux_w(uint8_t data)
{
g_profiler.start(PROFILER_USER2);
if ( m_xcounter < BYTES_PER_ROW )
if (m_xcounter < BYTES_PER_ROW)
{
m_scanline[m_xcounter] = data;
m_xcounter++;
}
if ( m_xcounter == 9 )
if (m_xcounter == 9)
{
int row = ((0xFF^data) & 0x7C) >> 2; // 7C = 000001111100
m_scanline[8] &= 0x80;//filter all other bits
@ -210,14 +197,9 @@ void bfm_dm01_device::mux_w(uint8_t data)
p++;
}
uint16_t* pix = &m_tmpbitmap.pix16(row*2);
uint16_t* pix2 = &m_tmpbitmap.pix16((row*2)+1);
for (int pos=0;pos<65;pos++)
for (int pos = 0; pos < 65; pos++)
{
pix[0 + (pos * 2)] = m_segbuffer[(pos)]+1;
pix[1 + (pos * 2)] = 0;
pix2[0 + (pos * 2)] = 0;
pix2[1 + (pos * 2)] = 0;
m_dotmatrix[pos + (65 * row)] = m_segbuffer[pos];
}
}
}
@ -262,7 +244,7 @@ uint8_t bfm_dm01_device::unknown_r()
void bfm_dm01_device::unknown_w(uint8_t data)
{
m_matrixcpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE ); //?
m_matrixcpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE); //?
}
///////////////////////////////////////////////////////////////////////////
@ -278,14 +260,6 @@ void bfm_dm01_device::bfm_dm01_memmap(address_map &map)
}
uint32_t bfm_dm01_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
copybitmap(bitmap, m_tmpbitmap, 0, 0, 0, 0, cliprect);
return 0;
}
INTERRUPT_GEN_MEMBER( bfm_dm01_device::nmi_line_assert )
{
m_matrixcpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
@ -296,16 +270,6 @@ void bfm_dm01_device::device_add_mconfig(machine_config &config)
MC6809(config, m_matrixcpu, 8000000); // MC68B09CP (clock unknown)
m_matrixcpu->set_addrmap(AS_PROGRAM, &bfm_dm01_device::bfm_dm01_memmap);
m_matrixcpu->set_periodic_int(FUNC(bfm_dm01_device::nmi_line_assert), attotime::from_hz(1500)); /* generate 1500 NMI's per second ?? what is the exact freq?? */
PALETTE(config, m_palette).set_entries(3);
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
m_screen->set_refresh_hz(60);
m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0));
m_screen->set_size(65*2, 21*2);
m_screen->set_visarea(0, 65*2-1, 0, 21*2-1);
m_screen->set_screen_update(FUNC(bfm_dm01_device::screen_update));
m_screen->set_palette(m_palette);
}
///////////////////////////////////////////////////////////////////////////

View File

@ -17,7 +17,6 @@ class bfm_dm01_device : public device_t
{
public:
bfm_dm01_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
~bfm_dm01_device() {}
auto busy_callback() { return m_busy_cb.bind(); }
@ -44,8 +43,6 @@ private:
static constexpr unsigned BYTES_PER_ROW = 9;
required_device<cpu_device> m_matrixcpu;
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
// internal state
int m_data_avail;
@ -57,15 +54,12 @@ private:
uint8_t m_scanline[BYTES_PER_ROW];
uint8_t m_comdata;
output_finder<65 * 21> m_dotmatrix;
devcb_write_line m_busy_cb;
int read_data(void);
bitmap_ind16 m_tmpbitmap;
int read_data();
INTERRUPT_GEN_MEMBER(nmi_line_assert);
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
};
DECLARE_DEVICE_TYPE(BFM_DM01, bfm_dm01_device)