mirror of
https://github.com/holub/mame
synced 2025-04-24 17:30:55 +03:00
v550: Add keyboard dump [Al Kossow]
scn2674: Add optional second space and associated buffers for attribute RAM (nw)
This commit is contained in:
parent
444f2ccd78
commit
58a1355b6f
@ -79,16 +79,22 @@ scn2674_device::scn2674_device(const machine_config &mconfig, device_type type,
|
||||
, m_double{0, 0}
|
||||
, m_spl{false, false}
|
||||
, m_dbl1(0)
|
||||
, m_buffer(0), m_linecounter(0), m_address(0), m_start1change(0)
|
||||
, m_char_buffer(0), m_attr_buffer(0)
|
||||
, m_linecounter(0), m_address(0), m_start1change(0)
|
||||
, m_scanline_timer(nullptr)
|
||||
, m_space_config("videoram", ENDIANNESS_LITTLE, 8, 16, 0, address_map_constructor(), address_map_constructor(FUNC(scn2674_device::scn2674_vram), this))
|
||||
, m_char_space(nullptr), m_attr_space(nullptr)
|
||||
, m_char_space_config("charram", ENDIANNESS_LITTLE, 8, 16, 0, address_map_constructor(), address_map_constructor(FUNC(scn2674_device::scn2674_vram), this))
|
||||
, m_attr_space_config("attrram", ENDIANNESS_LITTLE, 8, 16, 0, address_map_constructor(), address_map_constructor(FUNC(scn2674_device::scn2674_vram), this))
|
||||
{
|
||||
}
|
||||
|
||||
device_memory_interface::space_config_vector scn2674_device::memory_space_config() const
|
||||
{
|
||||
return space_config_vector {
|
||||
std::make_pair(0, &m_space_config)
|
||||
return has_configured_map(1) ? space_config_vector {
|
||||
std::make_pair(0, &m_char_space_config),
|
||||
std::make_pair(1, &m_attr_space_config)
|
||||
} : space_config_vector {
|
||||
std::make_pair(0, &m_char_space_config)
|
||||
};
|
||||
}
|
||||
|
||||
@ -100,6 +106,10 @@ void scn2674_device::device_start()
|
||||
m_scanline_timer = timer_alloc(TIMER_SCANLINE);
|
||||
screen().register_screen_bitmap(m_bitmap);
|
||||
|
||||
m_char_space = &space(0);
|
||||
if (m_attr_space != nullptr)
|
||||
m_attr_space = &space(1);
|
||||
|
||||
save_item(NAME(m_address));
|
||||
save_item(NAME(m_linecounter));
|
||||
save_item(NAME(m_screen1_address));
|
||||
@ -146,7 +156,9 @@ void scn2674_device::device_start()
|
||||
save_item(NAME(m_double));
|
||||
save_item(NAME(m_spl));
|
||||
save_item(NAME(m_dbl1));
|
||||
save_item(NAME(m_buffer));
|
||||
save_item(NAME(m_char_buffer));
|
||||
if (m_attr_space != nullptr)
|
||||
save_item(NAME(m_attr_buffer));
|
||||
save_item(NAME(m_start1change));
|
||||
}
|
||||
|
||||
@ -195,7 +207,7 @@ void scn2674_device::device_reset()
|
||||
m_double[0] = m_double[1] = 0;
|
||||
m_spl[0] = m_spl[1] = false;
|
||||
m_dbl1 = 0;
|
||||
m_buffer = 0;
|
||||
m_char_buffer = m_attr_buffer = 0;
|
||||
m_linecounter = 0;
|
||||
m_IR_pointer = 0;
|
||||
m_address = 0;
|
||||
@ -580,16 +592,16 @@ void scn2674_device::write_interrupt_mask(bool enabled, uint8_t bits)
|
||||
|
||||
LOGMASKED(LOG_INTR, "%s: %s interrupts %02x by mask\n", machine().describe_context(), enabled ? "Enable" : "Disable", bits);
|
||||
|
||||
if (BIT(bits, 0))
|
||||
LOGMASKED(LOG_INTR, "Split 2 IRQ %s%s\n", BIT(changed_bits, 0) ? "" : "already ", enabled ? "enabled" : "disabled");
|
||||
if (BIT(bits, 1))
|
||||
LOGMASKED(LOG_INTR, "Ready IRQ %s%s\n", BIT(changed_bits, 1) ? "" : "already ", enabled ? "enabled" : "disabled");
|
||||
if (BIT(bits, 2))
|
||||
LOGMASKED(LOG_INTR, "Split 1 IRQ %s%s\n", BIT(changed_bits, 2) ? "" : "already ", enabled ? "enabled" : "disabled");
|
||||
if (BIT(bits, 3))
|
||||
LOGMASKED(LOG_INTR, "Line Zero IRQ %s%s\n", BIT(changed_bits, 3) ? "" : "already ", enabled ? "enabled" : "disabled");
|
||||
if (BIT(bits, 4))
|
||||
LOGMASKED(LOG_INTR, "V-Blank IRQ %s%s\n", BIT(changed_bits, 4) ? "" : "already ", enabled ? "enabled" : "disabled");
|
||||
if (BIT(changed_bits, 0))
|
||||
LOGMASKED(LOG_INTR, "Split 2 IRQ %s\n", enabled ? "enabled" : "disabled");
|
||||
if (BIT(changed_bits, 1))
|
||||
LOGMASKED(LOG_INTR, "Ready IRQ %s\n", enabled ? "enabled" : "disabled");
|
||||
if (BIT(changed_bits, 2))
|
||||
LOGMASKED(LOG_INTR, "Split 1 IRQ %s\n", enabled ? "enabled" : "disabled");
|
||||
if (BIT(changed_bits, 3))
|
||||
LOGMASKED(LOG_INTR, "Line Zero IRQ %s\n", enabled ? "enabled" : "disabled");
|
||||
if (BIT(changed_bits, 4))
|
||||
LOGMASKED(LOG_INTR, "V-Blank IRQ %s\n", enabled ? "enabled" : "disabled");
|
||||
}
|
||||
|
||||
void scn2674_device::write_delayed_command(uint8_t data)
|
||||
@ -603,19 +615,25 @@ void scn2674_device::write_delayed_command(uint8_t data)
|
||||
{
|
||||
case 0xa4:
|
||||
// read at pointer address
|
||||
m_buffer = space().read_byte(m_screen2_address);
|
||||
m_char_buffer = m_char_space->read_byte(m_screen2_address);
|
||||
if (m_attr_space != nullptr)
|
||||
m_attr_buffer = m_attr_space->read_byte(m_screen2_address);
|
||||
LOGMASKED(LOG_COMMAND, "%s: DELAYED read at pointer address %02x\n", machine().describe_context(), data);
|
||||
break;
|
||||
|
||||
case 0xa2:
|
||||
// write at pointer address
|
||||
space().write_byte(m_screen2_address, m_buffer);
|
||||
m_char_space->write_byte(m_screen2_address, m_char_buffer);
|
||||
if (m_attr_space != nullptr)
|
||||
m_attr_space->write_byte(m_screen2_address, m_attr_buffer);
|
||||
LOGMASKED(LOG_COMMAND, "%s: DELAYED write at pointer address %02x\n", machine().describe_context(), data);
|
||||
break;
|
||||
|
||||
case 0xa6: // used by the Octopus
|
||||
// write at pointer address
|
||||
space().write_byte(m_display_pointer_address, m_buffer);
|
||||
m_char_space->write_byte(m_display_pointer_address, m_char_buffer);
|
||||
if (m_attr_space != nullptr)
|
||||
m_attr_space->write_byte(m_display_pointer_address, m_char_buffer);
|
||||
LOGMASKED(LOG_COMMAND, "%s: DELAYED write at display pointer address %02x\n", machine().describe_context(), data);
|
||||
break;
|
||||
|
||||
@ -627,19 +645,25 @@ void scn2674_device::write_delayed_command(uint8_t data)
|
||||
|
||||
case 0xac:
|
||||
// read at cursor address
|
||||
m_buffer = space().read_byte(m_cursor_address);
|
||||
m_char_buffer = m_char_space->read_byte(m_cursor_address);
|
||||
if (m_attr_space != nullptr)
|
||||
m_attr_buffer = m_attr_space->read_byte(m_cursor_address);
|
||||
LOGMASKED(LOG_COMMAND, "%s: DELAYED read at cursor address %02x\n", machine().describe_context(), data);
|
||||
break;
|
||||
|
||||
case 0xaa:
|
||||
// write at cursor address
|
||||
space().write_byte(m_cursor_address, m_buffer);
|
||||
m_char_space->write_byte(m_cursor_address, m_char_buffer);
|
||||
if (m_attr_space != nullptr)
|
||||
m_attr_space->write_byte(m_cursor_address, m_attr_buffer);
|
||||
LOGMASKED(LOG_COMMAND, "%s: DELAYED write at cursor address %02x\n", machine().describe_context(), data);
|
||||
break;
|
||||
|
||||
case 0xad:
|
||||
// read at cursor address + increment
|
||||
m_buffer = space().read_byte(m_cursor_address);
|
||||
m_char_buffer = m_char_space->read_byte(m_cursor_address);
|
||||
if (m_attr_space != nullptr)
|
||||
m_attr_buffer = m_attr_space->read_byte(m_cursor_address);
|
||||
m_cursor_address++;
|
||||
LOGMASKED(LOG_COMMAND, "%s: DELAYED read at cursor address+increment %02x\n", machine().describe_context(), data);
|
||||
break;
|
||||
@ -647,7 +671,9 @@ void scn2674_device::write_delayed_command(uint8_t data)
|
||||
case 0xab:
|
||||
case 0xaf: // LSI Octopus sends command 0xAF
|
||||
// write at cursor address + increment
|
||||
space().write_byte(m_cursor_address, m_buffer);
|
||||
m_char_space->write_byte(m_cursor_address, m_char_buffer);
|
||||
if (m_attr_space != nullptr)
|
||||
m_attr_space->write_byte(m_cursor_address, m_attr_buffer);
|
||||
m_cursor_address++;
|
||||
LOGMASKED(LOG_COMMAND, "%s: DELAYED write at cursor address+increment %02x\n", machine().describe_context(), data);
|
||||
break;
|
||||
@ -656,8 +682,14 @@ void scn2674_device::write_delayed_command(uint8_t data)
|
||||
// write from cursor address to pointer address
|
||||
// TODO: transfer only during blank
|
||||
for (i = m_cursor_address; i != m_screen2_address; i = ((i + 1) & 0xffff))
|
||||
space().write_byte(i, m_buffer);
|
||||
space().write_byte(i, m_buffer); // get the last
|
||||
{
|
||||
m_char_space->write_byte(i, m_char_buffer);
|
||||
if (m_attr_space != nullptr)
|
||||
m_attr_space->write_byte(i, m_attr_buffer);
|
||||
}
|
||||
m_char_space->write_byte(i, m_char_buffer); // get the last
|
||||
if (m_attr_space != nullptr)
|
||||
m_attr_space->write_byte(i, m_attr_buffer);
|
||||
m_cursor_address = m_screen2_address;
|
||||
LOGMASKED(LOG_COMMAND, "%s: DELAYED write from cursor address to pointer address %02x\n", machine().describe_context(), data);
|
||||
break;
|
||||
@ -671,8 +703,14 @@ void scn2674_device::write_delayed_command(uint8_t data)
|
||||
// write from cursor address to pointer address
|
||||
// TODO: transfer only during blank
|
||||
for (i = m_cursor_address; i != m_display_pointer_address; i = (i + 1) & 0xffff)
|
||||
space().write_byte(i, m_buffer);
|
||||
space().write_byte(i, m_buffer); // get the last
|
||||
{
|
||||
m_char_space->write_byte(i, m_char_buffer);
|
||||
if (m_attr_space != nullptr)
|
||||
m_attr_space->write_byte(i, m_attr_buffer);
|
||||
}
|
||||
m_char_space->write_byte(i, m_char_buffer); // get the last
|
||||
if (m_attr_space != nullptr)
|
||||
m_attr_space->write_byte(i, m_attr_buffer);
|
||||
m_cursor_address = m_display_pointer_address;
|
||||
LOGMASKED(LOG_COMMAND, "%s: DELAYED write from cursor address to pointer address %02x\n", machine().describe_context(), data);
|
||||
break;
|
||||
@ -983,7 +1021,7 @@ void scn2674_device::device_timer(emu_timer &timer, device_timer_id id, int para
|
||||
if (!charrow)
|
||||
{
|
||||
uint16_t addr = m_screen2_address;
|
||||
uint16_t line = space().read_word(addr);
|
||||
uint16_t line = m_char_space->read_word(addr);
|
||||
m_screen1_address = line;
|
||||
if (m_double_ht_wd)
|
||||
{
|
||||
@ -1017,7 +1055,8 @@ void scn2674_device::device_timer(emu_timer &timer, device_timer_id id, int para
|
||||
i * m_hpixels_per_column,
|
||||
m_linecounter,
|
||||
tilerow,
|
||||
space().read_byte(address),
|
||||
m_char_space->read_byte(address),
|
||||
m_attr_space != nullptr ? m_attr_space->read_byte(address) : 0,
|
||||
address,
|
||||
(charrow >= m_cursor_first_scanline) && (charrow <= m_cursor_last_scanline) && cursor_on,
|
||||
dw != 0,
|
||||
|
@ -15,7 +15,7 @@
|
||||
#define MCFG_SCN2672_DRAW_CHARACTER_CALLBACK_OWNER(_class, _method) \
|
||||
downcast<scn2672_device &>(*device).set_display_callback(scn2672_device::draw_character_delegate(&_class::_method, #_class "::" #_method, this));
|
||||
|
||||
#define SCN2672_DRAW_CHARACTER_MEMBER(_name) void _name(bitmap_rgb32 &bitmap, int x, int y, uint8_t linecount, uint8_t charcode, uint16_t address, uint8_t cursor, uint8_t dw, uint8_t lg, uint8_t ul, uint8_t blink)
|
||||
#define SCN2672_DRAW_CHARACTER_MEMBER(_name) void _name(bitmap_rgb32 &bitmap, int x, int y, uint8_t linecount, uint8_t charcode, uint8_t attrcode, uint16_t address, bool cursor, bool dw, bool lg, bool ul, bool blink)
|
||||
|
||||
|
||||
#define MCFG_SCN2674_INTR_CALLBACK(_intr) \
|
||||
@ -27,7 +27,7 @@
|
||||
#define MCFG_SCN2674_DRAW_CHARACTER_CALLBACK_OWNER(_class, _method) \
|
||||
downcast<scn2674_device &>(*device).set_display_callback(scn2674_device::draw_character_delegate(&_class::_method, #_class "::" #_method, this));
|
||||
|
||||
#define SCN2674_DRAW_CHARACTER_MEMBER(_name) void _name(bitmap_rgb32 &bitmap, int x, int y, uint8_t linecount, uint8_t charcode, uint16_t address, uint8_t cursor, uint8_t dw, uint8_t lg, uint8_t ul, uint8_t blink)
|
||||
#define SCN2674_DRAW_CHARACTER_MEMBER(_name) void _name(bitmap_rgb32 &bitmap, int x, int y, uint8_t linecount, uint8_t charcode, uint8_t attrcode, uint16_t address, bool cursor, bool dw, bool lg, bool ul, bool blink)
|
||||
|
||||
|
||||
class scn2674_device : public device_t,
|
||||
@ -37,7 +37,7 @@ class scn2674_device : public device_t,
|
||||
public:
|
||||
scn2674_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
typedef device_delegate<void (bitmap_rgb32 &bitmap, int x, int y, uint8_t linecount, uint8_t charcode, uint16_t address, uint8_t cursor, uint8_t dw, uint8_t lg, uint8_t ul, uint8_t blink)> draw_character_delegate;
|
||||
typedef device_delegate<void (bitmap_rgb32 &bitmap, int x, int y, uint8_t linecount, uint8_t charcode, uint8_t attrcode, uint16_t address, bool cursor, bool dw, bool lg, bool ul, bool blink)> draw_character_delegate;
|
||||
|
||||
// static configuration
|
||||
template <class Object> devcb_base &set_intr_callback(Object &&cb) { return m_intr_cb.set_callback(std::forward<Object>(cb)); }
|
||||
@ -46,8 +46,10 @@ public:
|
||||
|
||||
DECLARE_READ8_MEMBER( read );
|
||||
DECLARE_WRITE8_MEMBER( write );
|
||||
DECLARE_READ8_MEMBER( buffer_r ) { return m_buffer; }
|
||||
DECLARE_WRITE8_MEMBER( buffer_w ) { m_buffer = data; }
|
||||
DECLARE_READ8_MEMBER( buffer_r ) { return m_char_buffer; }
|
||||
DECLARE_WRITE8_MEMBER( buffer_w ) { m_char_buffer = data; }
|
||||
DECLARE_READ8_MEMBER( attr_buffer_r ) { return m_attr_buffer; }
|
||||
DECLARE_WRITE8_MEMBER( attr_buffer_w ) { m_attr_buffer = data; }
|
||||
|
||||
uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
|
||||
|
||||
@ -109,7 +111,8 @@ protected:
|
||||
uint8_t m_double[2];
|
||||
bool m_spl[2];
|
||||
uint8_t m_dbl1;
|
||||
uint8_t m_buffer;
|
||||
uint8_t m_char_buffer;
|
||||
uint8_t m_attr_buffer;
|
||||
int m_linecounter;
|
||||
uint16_t m_address;
|
||||
int m_start1change;
|
||||
@ -129,7 +132,10 @@ protected:
|
||||
|
||||
draw_character_delegate m_display_cb;
|
||||
emu_timer *m_scanline_timer;
|
||||
const address_space_config m_space_config;
|
||||
address_space *m_char_space;
|
||||
address_space *m_attr_space;
|
||||
const address_space_config m_char_space_config;
|
||||
const address_space_config m_attr_space_config;
|
||||
enum
|
||||
{
|
||||
TIMER_SCANLINE
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include "emu.h"
|
||||
//include "bus/rs232/rs232.h"
|
||||
#include "cpu/z80/z80.h"
|
||||
#include "cpu/mcs48/mcs48.h"
|
||||
#include "machine/com8116.h"
|
||||
#include "machine/input_merger.h"
|
||||
#include "machine/nvram.h"
|
||||
@ -42,7 +43,8 @@ private:
|
||||
|
||||
void mem_map(address_map &map);
|
||||
void io_map(address_map &map);
|
||||
void pvtc_map(address_map &map);
|
||||
void pvtc_char_map(address_map &map);
|
||||
void pvtc_attr_map(address_map &map);
|
||||
|
||||
virtual void machine_start() override;
|
||||
|
||||
@ -74,10 +76,15 @@ void v550_state::io_map(address_map &map)
|
||||
map(0x50, 0x50).w("brg2", FUNC(com8116_device::stt_str_w));
|
||||
map(0x60, 0x67).rw("pvtc", FUNC(scn2672_device::read), FUNC(scn2672_device::write));
|
||||
map(0x70, 0x70).rw("pvtc", FUNC(scn2672_device::buffer_r), FUNC(scn2672_device::buffer_w));
|
||||
map(0x71, 0x71).noprw(); // TODO: attribute buffer
|
||||
map(0x71, 0x71).rw("pvtc", FUNC(scn2672_device::attr_buffer_r), FUNC(scn2672_device::attr_buffer_w));
|
||||
}
|
||||
|
||||
void v550_state::pvtc_map(address_map &map)
|
||||
void v550_state::pvtc_char_map(address_map &map)
|
||||
{
|
||||
map(0x0000, 0x0fff).ram();
|
||||
}
|
||||
|
||||
void v550_state::pvtc_attr_map(address_map &map)
|
||||
{
|
||||
map(0x0000, 0x0fff).ram();
|
||||
}
|
||||
@ -122,12 +129,15 @@ MACHINE_CONFIG_START(v550_state::v550)
|
||||
brg2.fr_handler().set("usart", FUNC(i8251_device::write_txc));
|
||||
brg2.fr_handler().append("usart", FUNC(i8251_device::write_rxc));
|
||||
|
||||
MCFG_DEVICE_ADD("kbdmcu", I8049, 4'608'000)
|
||||
|
||||
MCFG_SCREEN_ADD("screen", RASTER)
|
||||
MCFG_SCREEN_RAW_PARAMS(16'248'600, 918, 0, 720, 295, 0, 272)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(v550_state, screen_update)
|
||||
|
||||
MCFG_DEVICE_ADD("pvtc", SCN2672, 1'805'400)
|
||||
MCFG_DEVICE_ADDRESS_MAP(0, pvtc_map)
|
||||
MCFG_DEVICE_ADDRESS_MAP(0, pvtc_char_map)
|
||||
MCFG_DEVICE_ADDRESS_MAP(0, pvtc_attr_map)
|
||||
MCFG_SCN2672_CHARACTER_WIDTH(9)
|
||||
MCFG_SCN2672_INTR_CALLBACK(INPUTLINE("maincpu", INPUT_LINE_NMI))
|
||||
MCFG_VIDEO_SET_SCREEN("screen")
|
||||
@ -145,6 +155,9 @@ ROM_START( v550 )
|
||||
|
||||
ROM_REGION(0x1000, "chargen", 0)
|
||||
ROM_LOAD("e242-085_r03_u97.bin", 0x0000, 0x1000, CRC(8a491cee) SHA1(d8a9546a7dd2ffc0a5e54524ee16068dde56975c))
|
||||
|
||||
ROM_REGION(0x0800, "kbdmcu", 0)
|
||||
ROM_LOAD("v550kb.bin", 0x0000, 0x0800, CRC(d11d19a3) SHA1(2d88202d0548e934800f07667c8d13a3762b12fa))
|
||||
ROM_END
|
||||
|
||||
COMP( 1982, v550, 0, 0, v550, v550, v550_state, empty_init, "Visual Technology", "Visual 550", MACHINE_IS_SKELETON )
|
||||
|
Loading…
Reference in New Issue
Block a user