diff options
Diffstat (limited to 'src/devices/video/tms9928a.cpp')
-rw-r--r-- | src/devices/video/tms9928a.cpp | 53 |
1 files changed, 26 insertions, 27 deletions
diff --git a/src/devices/video/tms9928a.cpp b/src/devices/video/tms9928a.cpp index c068d8b4ce8..bc31b1b1db9 100644 --- a/src/devices/video/tms9928a.cpp +++ b/src/devices/video/tms9928a.cpp @@ -52,11 +52,11 @@ DEFINE_DEVICE_TYPE(EFO90501, efo90501_device, "efo90501", "EFO90501 VDP") */ void tms9928a_device::memmap(address_map &map) { - if (!has_configured_map(0)) - map(0x0000, 0x3fff).ram(); + map.global_mask(0x3fff); + map(0x0000, 0x3fff).ram(); } -tms9928a_device::tms9928a_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, uint16_t horz_total, bool is_50hz, bool is_reva, bool is_99) +tms9928a_device::tms9928a_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, bool is_50hz, bool is_reva, bool is_99) : device_t(mconfig, type, tag, owner, clock) , device_memory_interface(mconfig, *this) , device_palette_interface(mconfig, *this) @@ -64,11 +64,10 @@ tms9928a_device::tms9928a_device(const machine_config &mconfig, device_type type , m_vram_size(0) , m_out_int_line_cb(*this) , m_out_gromclk_cb(*this) - , m_total_horz(horz_total) , m_50hz(is_50hz) , m_reva(is_reva) , m_99(is_99) - , m_space_config("vram", ENDIANNESS_BIG, 8, 14, 0, address_map_constructor(FUNC(tms9928a_device::memmap), this)) + , m_space_config("vram", ENDIANNESS_BIG, 8, 14, 0, address_map_constructor(), address_map_constructor(FUNC(tms9928a_device::memmap), this)) { } @@ -83,57 +82,57 @@ void tms9928a_device::device_config_complete() if (!screen().refresh_attoseconds()) { if (m_50hz) - screen().set_raw(clock() / 2, m_total_horz, HORZ_DISPLAY_START - 12, HORZ_DISPLAY_START + 256 + 12, + screen().set_raw(clock() / 2, TOTAL_HORZ, HORZ_DISPLAY_START - 12, HORZ_DISPLAY_START + 256 + 12, TOTAL_VERT_PAL, VERT_DISPLAY_START_PAL - 12, VERT_DISPLAY_START_PAL + 192 + 12); else - screen().set_raw(clock() / 2, m_total_horz, HORZ_DISPLAY_START - 12, HORZ_DISPLAY_START + 256 + 12, + screen().set_raw(clock() / 2, TOTAL_HORZ, HORZ_DISPLAY_START - 12, HORZ_DISPLAY_START + 256 + 12, TOTAL_VERT_NTSC, VERT_DISPLAY_START_NTSC - 12, VERT_DISPLAY_START_NTSC + 192 + 12); } } tms9928a_device::tms9928a_device( const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : tms9928a_device(mconfig, TMS9928A, tag, owner, clock, 342, false, true, true) + : tms9928a_device(mconfig, TMS9928A, tag, owner, clock, false, true, true) { } tms9129_device::tms9129_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : tms9928a_device(mconfig, TMS9129, tag, owner, clock, 342, true, true, false) + : tms9928a_device(mconfig, TMS9129, tag, owner, clock, true, true, false) { } tms9918_device::tms9918_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : tms9928a_device(mconfig, TMS9918, tag, owner, clock, 342, false, false, true) + : tms9928a_device(mconfig, TMS9918, tag, owner, clock, false, false, true) { } tms9918a_device::tms9918a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : tms9928a_device(mconfig, TMS9918A, tag, owner, clock, 342, false, true, true) + : tms9928a_device(mconfig, TMS9918A, tag, owner, clock, false, true, true) { } tms9118_device::tms9118_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : tms9928a_device(mconfig, TMS9118, tag, owner, clock, 342, false, true, false) + : tms9928a_device(mconfig, TMS9118, tag, owner, clock, false, true, false) { } tms9128_device::tms9128_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : tms9928a_device(mconfig, TMS9128, tag, owner, clock, 342, false, true, false) + : tms9928a_device(mconfig, TMS9128, tag, owner, clock, false, true, false) { } tms9929_device::tms9929_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : tms9928a_device(mconfig, TMS9929, tag, owner, clock, 342, true, false, true) + : tms9928a_device(mconfig, TMS9929, tag, owner, clock, true, false, true) { } tms9929a_device::tms9929a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : tms9928a_device(mconfig, TMS9929A, tag, owner, clock, 342, true, true, true) + : tms9928a_device(mconfig, TMS9929A, tag, owner, clock, true, true, true) { } efo90501_device::efo90501_device( const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : tms9928a_device(mconfig, EFO90501, tag, owner, clock, 346, true, true, true) + : tms9928a_device(mconfig, EFO90501, tag, owner, clock, true, true, true) { } @@ -144,7 +143,7 @@ device_memory_interface::space_config_vector tms9928a_device::memory_space_confi }; } -uint8_t tms9928a_device::read(offs_t offset) +READ8_MEMBER( tms9928a_device::read ) { uint8_t value = 0; @@ -156,7 +155,7 @@ uint8_t tms9928a_device::read(offs_t offset) return value; } -void tms9928a_device::write(offs_t offset, uint8_t data) +WRITE8_MEMBER( tms9928a_device::write ) { if ((offset & 1) == 0) vram_write(data); @@ -166,10 +165,10 @@ void tms9928a_device::write(offs_t offset, uint8_t data) u8 tms9928a_device::vram_read() { - uint8_t data = m_ReadAhead; - // prevent debugger from changing the address base - if (machine().side_effects_disabled()) return data; + if (machine().side_effects_disabled()) return 0; + + uint8_t data = m_ReadAhead; m_ReadAhead = m_vram_space->read_byte(m_Addr); m_Addr = (m_Addr + 1) & (m_vram_size - 1); @@ -193,10 +192,10 @@ void tms9928a_device::vram_write(u8 data) u8 tms9928a_device::register_read() { - uint8_t data = m_StatusReg; - // prevent debugger from changing the internal state - if (machine().side_effects_disabled()) return data; + if (machine().side_effects_disabled()) return 0; + + uint8_t data = m_StatusReg; m_StatusReg = m_FifthSprite; check_interrupt(); @@ -372,7 +371,7 @@ void tms9928a_device::device_timer(emu_timer &timer, device_timer_id id, int par if ( y < 0 || y >= 192 || ! (m_Regs[1] & 0x40) ) { /* Draw backdrop colour */ - for ( int i = 0; i < m_total_horz; i++ ) + for ( int i = 0; i < TOTAL_HORZ; i++ ) p[i] = pen(BackColour); /* vblank is set at the last cycle of the first inactive line */ @@ -651,7 +650,7 @@ void tms9928a_device::device_timer(emu_timer &timer, device_timer_id id, int par } /* Right border */ - for ( int i = HORZ_DISPLAY_START + 256; i < m_total_horz; i++ ) + for ( int i = HORZ_DISPLAY_START + 256; i < TOTAL_HORZ; i++ ) p[i] = pen(BackColour); } @@ -735,7 +734,7 @@ void tms9928a_device::device_start() m_vram_space = &space(AS_DATA); /* back bitmap */ - m_tmpbmp.allocate(m_total_horz, TOTAL_VERT_PAL); + m_tmpbmp.allocate(TOTAL_HORZ, TOTAL_VERT_PAL); m_line_timer = timer_alloc(TIMER_LINE); m_gromclk_timer = timer_alloc(GROMCLK); |