8x300: Apply address shift to program space

This commit is contained in:
AJR 2019-01-24 07:56:16 -05:00
parent bb0702d2d5
commit 2035fedd6e
6 changed files with 15 additions and 15 deletions

View File

@ -44,7 +44,7 @@ DEFINE_DEVICE_TYPE(N8X305, n8x305_cpu_device, "8x305", "Signetics 8X305")
n8x300_cpu_device::n8x300_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
: cpu_device(mconfig, type, tag, owner, clock)
, m_program_config("program", ENDIANNESS_BIG, 16, 14, 0)
, m_program_config("program", ENDIANNESS_BIG, 16, 13, -1)
, m_io_config("io", ENDIANNESS_BIG, 8, 9, 0)
, m_sc_callback(*this)
{
@ -154,7 +154,7 @@ void n8x300_cpu_device::device_resolve_objects()
void n8x300_cpu_device::device_start()
{
m_program = &space(AS_PROGRAM);
m_cache = m_program->cache<1, 0, ENDIANNESS_BIG>();
m_cache = m_program->cache<1, -1, ENDIANNESS_BIG>();
m_io = &space(AS_IO);
save_item(NAME(m_PC));
@ -229,8 +229,8 @@ void n8x300_cpu_device::device_start()
state_add( _8X300_OVF, "OVF", m_OVF).mask(0x01).formatstr("%01X");
state_add( _8X300_IVL, "IVL", m_IVL).mask(0xff).formatstr("%02X");
state_add( _8X300_IVR, "IVR", m_IVR).mask(0xff).formatstr("%02X");
state_add(STATE_GENPC, "GENPC", m_genPC).mask(0x3ffe).callimport().noshow();
state_add(STATE_GENPCBASE, "CURPC", m_genPC).mask(0x3ffe).callimport().noshow();
state_add(STATE_GENPC, "GENPC", m_genPC).mask(0x1fff).callimport().noshow();
state_add(STATE_GENPCBASE, "CURPC", m_genPC).mask(0x1fff).callimport().noshow();
set_icountptr(m_icount);
}
@ -246,12 +246,12 @@ void n8x300_cpu_device::state_import(const device_state_entry &entry)
{
case _8X300_PC:
m_AR = m_PC;
m_genPC = m_AR << 1;
m_genPC = m_AR;
m_increment_pc = true;
break;
case _8X300_AR:
m_genPC = m_AR << 1;
m_genPC = m_AR;
m_increment_pc = false;
break;
@ -284,7 +284,7 @@ void n8x300_cpu_device::execute_run()
uint8_t mask;
/* fetch the opcode */
m_genPC = m_AR << 1;
m_genPC = m_AR;
debugger_instruction_hook(m_genPC);
opcode = FETCHOP(m_genPC);

View File

@ -83,7 +83,7 @@ protected:
bool m_increment_pc;
address_space *m_program;
memory_access_cache<1, 0, ENDIANNESS_BIG> *m_cache;
memory_access_cache<1, -1, ENDIANNESS_BIG> *m_cache;
address_space *m_io;
devcb_write8 m_sc_callback; // Select Command (address latch)

View File

@ -43,7 +43,7 @@ bool n8x300_disassembler::is_src_rot(uint16_t opcode)
u32 n8x300_disassembler::opcode_alignment() const
{
return 2;
return 1;
}
offs_t n8x300_disassembler::disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer &params)
@ -51,7 +51,7 @@ offs_t n8x300_disassembler::disassemble(std::ostream &stream, offs_t pc, const d
unsigned startpc = pc;
uint16_t opcode = opcodes.r16(pc);
uint8_t inst = opcode >> 13;
pc+=2;
pc+=1;
// determine instruction
switch (inst)
@ -127,7 +127,7 @@ offs_t n8x300_disassembler::disassemble(std::ostream &stream, offs_t pc, const d
}
break;
case 0x07:
util::stream_format(stream, "JMP %04XH", (opcode & 0x1fff) << 1);
util::stream_format(stream, "JMP %04XH", (opcode & 0x1fff));
break;
}

View File

@ -445,7 +445,7 @@ void fs3216_state::clb_map(address_map &map)
void fs3216_state::wdcpu_prog_map(address_map &map)
{
map(0x000, 0x7ff).rom().region("wdcpu", 0);
map(0x0000, 0x03ff).rom().region("wdcpu", 0);
}
void fs3216_state::wdcpu_bank_map(address_map &map)

View File

@ -202,8 +202,8 @@ void wicat_state::video_io(address_map &map)
void wicat_state::wd1000_mem(address_map &map)
{
map(0x0000, 0x17ff).rom().region("wd3", 0x0000);
map(0x1800, 0x1fff).noprw();
map(0x0000, 0x0bff).rom().region("wd3", 0x0000);
map(0x0c00, 0x0fff).noprw();
}
void wicat_state::wd1000_io(address_map &map)

View File

@ -300,7 +300,7 @@ struct options
static const dasm_table_entry dasm_table[] =
{
{ "8x300", be, 0, []() -> util::disasm_interface * { return new n8x300_disassembler; } },
{ "8x300", be, -1, []() -> util::disasm_interface * { return new n8x300_disassembler; } },
{ "adsp21xx", le, -2, []() -> util::disasm_interface * { return new adsp21xx_disassembler; } },
{ "alpha", le, 0, []() -> util::disasm_interface * { return new alpha_disassembler; } },
{ "alpha8201", le, 0, []() -> util::disasm_interface * { return new alpha8201_disassembler; } },