diff options
Diffstat (limited to 'src/mame/video/bfm_dm01.cpp')
-rw-r--r-- | src/mame/video/bfm_dm01.cpp | 56 |
1 files changed, 10 insertions, 46 deletions
diff --git a/src/mame/video/bfm_dm01.cpp b/src/mame/video/bfm_dm01.cpp index 6ff69ebdfc5..20737c5229d 100644 --- a/src/mame/video/bfm_dm01.cpp +++ b/src/mame/video/bfm_dm01.cpp @@ -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); - - for (int i = 0; i < BYTES_PER_ROW; i++) - save_item(NAME(m_scanline), i); + save_item(NAME(m_segbuffer)); - 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); } /////////////////////////////////////////////////////////////////////////// |