Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 28 additions & 2 deletions src/devices/cpu/t11/t11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,39 @@ void t11_device::WBYTE(int addr, int data)

int t11_device::RWORD(int addr)
{
return m_program.read_word(addr & 0xfffe);
if (addr < 0160000)
return m_program.read_word(addr & 0xfffe);
else // accessing I/O page
{
auto flags = m_program.lookup_read_word_flags(addr);
if (!flags)
return m_program.read_word(addr & 0xfffe);
else if (flags & UNALIGNED_WORD)
return m_program.read_word_unaligned(addr);
else if (flags & UNALIGNED_BYTE)
return m_program.read_byte(addr);
Comment on lines +150 to +151
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this path actually work? It looks like it causes it to always do a byte access, even if the address is word-aligned.

else
return m_program.read_word(addr & 0xfffe);
}
}


void t11_device::WWORD(int addr, int data)
{
m_program.write_word(addr & 0xfffe, data);
if (addr < 0160000)
m_program.write_word(addr & 0xfffe, data);
else // accessing I/O page
{
auto flags = m_program.lookup_write_word_flags(addr);
if (!flags)
m_program.write_word(addr & 0xfffe, data);
else if (flags & UNALIGNED_WORD)
m_program.write_word_unaligned(addr, data);
else if (flags & UNALIGNED_BYTE)
m_program.write_byte(addr, data);
else
m_program.write_word(addr & 0xfffe, data);
}
}


Expand Down
4 changes: 4 additions & 0 deletions src/devices/cpu/t11/t11.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ class t11_device : public cpu_device
static constexpr uint8_t POWER_FAIL = PF_LINE;
static constexpr uint8_t BUS_ERROR = 8;

// memory flags
static constexpr uint16_t UNALIGNED_BYTE = 1;
static constexpr uint16_t UNALIGNED_WORD = 2;

// construction/destruction
t11_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);

Expand Down
Loading