diff options
author | Sven Schnelle <svens@stackframe.org> | 2018-06-23 17:39:20 +0200 |
---|---|---|
committer | Olivier Galibert <galibert@pobox.com> | 2018-06-23 17:39:20 +0200 |
commit | e7c798da50b6e4ccdbcb97f0c3e2b46321186706 (patch) | |
tree | 35333221e7108d02470ee6feb830be9c659beb35 /src/devices/bus | |
parent | ec51f04e72f5c5e911ab101ee0e4a347a5613604 (diff) |
Topcat improvements (#3663)
* topcat: fix register accesses
* nereid: mask register address bits
* topcat: don't override contents before window move
depending on the direction of the window move, we must start
at the other end with move, otherwise we overwrite the data
before it is moved.
Signed-off-by: Sven Schnelle <svens@stackframe.org>
* topcat: Fix cursor handling
Old cursor handling hat a few problems:
- Changed VRAM contents which doesn't happen on real hardware
- Destroyed Image content on the line where the cursor is show
- Window mover copied the cursor
Signed-off-by: Sven Schnelle <svens@stackframe.org>
* fix spacing
Signed-off-by: Sven Schnelle <svens@stackframe.org>
Diffstat (limited to 'src/devices/bus')
-rw-r--r-- | src/devices/bus/hp_dio/hp98543.cpp | 18 | ||||
-rw-r--r-- | src/devices/bus/hp_dio/hp98543.h | 4 | ||||
-rw-r--r-- | src/devices/bus/hp_dio/hp98544.cpp | 20 | ||||
-rw-r--r-- | src/devices/bus/hp_dio/hp98544.h | 4 |
4 files changed, 37 insertions, 9 deletions
diff --git a/src/devices/bus/hp_dio/hp98543.cpp b/src/devices/bus/hp_dio/hp98543.cpp index 25a98439351..b43a4734e0b 100644 --- a/src/devices/bus/hp_dio/hp98543.cpp +++ b/src/devices/bus/hp_dio/hp98543.cpp @@ -154,10 +154,24 @@ WRITE16_MEMBER(dio16_98543_device::vram_w) uint32_t dio16_98543_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { + int startx[TOPCAT_COUNT], starty[TOPCAT_COUNT]; + int endx[TOPCAT_COUNT], endy[TOPCAT_COUNT]; + + for (int i = 0; i < TOPCAT_COUNT; i++) + m_topcat[i]->get_cursor_pos(&startx[i], &starty[i], &endx[i], &endy[i]); + for (int y = 0; y < m_v_pix; y++) { uint32_t *scanline = &bitmap.pix32(y); - for (int x = 0; x < m_h_pix; x++) - *scanline++ = m_nereid->map_color(m_vram[y * m_h_pix + x]); + + for (int x = 0; x < m_h_pix; x++) { + uint8_t tmp = m_vram[y * m_h_pix + x]; + for (int i = 0; i < TOPCAT_COUNT; i++) { + if (y >= starty[i] && y <= endy[i] && x >= startx[i] && x <= endx[i]) { + tmp |= 1 << i; + } + } + *scanline++ = m_nereid->map_color(tmp); + } } return 0; } diff --git a/src/devices/bus/hp_dio/hp98543.h b/src/devices/bus/hp_dio/hp98543.h index 0f7110f3787..aa78139ae83 100644 --- a/src/devices/bus/hp_dio/hp98543.h +++ b/src/devices/bus/hp_dio/hp98543.h @@ -27,7 +27,9 @@ public: DECLARE_READ16_MEMBER(vram_r); DECLARE_WRITE16_MEMBER(vram_w); - required_device_array<topcat_device, 4> m_topcat; + static constexpr int TOPCAT_COUNT = 4; + + required_device_array<topcat_device, TOPCAT_COUNT> m_topcat; required_device<nereid_device> m_nereid; uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); diff --git a/src/devices/bus/hp_dio/hp98544.cpp b/src/devices/bus/hp_dio/hp98544.cpp index db790a89977..5112ace8781 100644 --- a/src/devices/bus/hp_dio/hp98544.cpp +++ b/src/devices/bus/hp_dio/hp98544.cpp @@ -128,11 +128,19 @@ WRITE16_MEMBER(dio16_98544_device::rom_w) uint32_t dio16_98544_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - for (int y = 0; y < 768; y++) { - uint32_t *scanline = &bitmap.pix32(y); - for (int x = 0; x < 1024; x++) - *scanline++ = m_vram[y * 1024 + x] ? rgb_t(255,255,255) : rgb_t(0, 0, 0); - } - return 0; + int startx, starty, endx, endy; + + m_topcat->get_cursor_pos(&startx, &starty, &endx, &endy); + + for (int y = 0; y < m_v_pix; y++) { + uint32_t *scanline = &bitmap.pix32(y); + for (int x = 0; x < 1024; x++) { + uint8_t tmp = m_vram[y * m_h_pix + x]; + if (y >= starty && y <= endy && x >= startx && x <= endx) + tmp |= 0xff; + *scanline++ = tmp ? rgb_t(255,255,255) : rgb_t(0, 0, 0); + } + } + return 0; } diff --git a/src/devices/bus/hp_dio/hp98544.h b/src/devices/bus/hp_dio/hp98544.h index c153cfcbcc3..91139bc5dc5 100644 --- a/src/devices/bus/hp_dio/hp98544.h +++ b/src/devices/bus/hp_dio/hp98544.h @@ -40,6 +40,10 @@ public: virtual const tiny_rom_entry *device_rom_region() const override; virtual space_config_vector memory_space_config() const override; private: + + static constexpr int m_v_pix = 768; + static constexpr int m_h_pix = 1024; + const address_space_config m_space_config; void map(address_map &map); |