Previous 199869 Revisions Next

r33563 Thursday 27th November, 2014 at 16:28:38 UTC by Olivier Galibert
vii/unsp cleanups for cowering (nw)
[src/emu/cpu/unsp]unsp.c unspdasm.c
[src/mess/drivers]vii.c

trunk/src/emu/cpu/unsp/unsp.c
r242074r242075
1616
1717unsp_device::unsp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1818   : cpu_device(mconfig, UNSP, "u'nSP", tag, owner, clock, "unsp", __FILE__)
19   , m_program_config("program", ENDIANNESS_BIG, 16, 23, 0)
19   , m_program_config("program", ENDIANNESS_BIG, 16, 23, -1)
2020{
2121}
2222
r242074r242075
100100
101101void unsp_device::unimplemented_opcode(UINT16 op)
102102{
103   fatalerror("UNSP: unknown opcode %04x at %04x\n", op, UNSP_LPC << 1);
103   fatalerror("UNSP: unknown opcode %04x at %04x\n", op, UNSP_LPC);
104104}
105105
106106/*****************************************************************************/
107107
108108UINT16 unsp_device::READ16(UINT32 address)
109109{
110   return m_program->read_word(address << 1);
110   return m_program->read_word(address<<1);
111111}
112112
113113void unsp_device::WRITE16(UINT32 address, UINT16 data)
114114{
115   m_program->write_word(address << 1, data);
115   m_program->write_word(address<<1, data);
116116}
117117
118118/*****************************************************************************/
r242074r242075
152152   switch (entry.index())
153153   {
154154      case UNSP_PC:
155         m_debugger_temp = UNSP_LPC << 1;
155         m_debugger_temp = UNSP_LPC;
156156         break;
157157
158158      case STATE_GENPC:
159         m_debugger_temp = UNSP_LPC << 1;
159         m_debugger_temp = UNSP_LPC;
160160         break;
161161   }
162162}
r242074r242075
166166   switch (entry.index())
167167   {
168168      case UNSP_PC:
169         UNSP_REG(PC) = (m_debugger_temp & 0x0001fffe) >> 1;
170         UNSP_REG(SR) = (UNSP_REG(SR) & 0xffc0) | ((m_debugger_temp & 0x007e0000) >> 17);
169         UNSP_REG(PC) = m_debugger_temp & 0x0000ffff;
170         UNSP_REG(SR) = (UNSP_REG(SR) & 0xffc0) | ((m_debugger_temp & 0x003f0000) >> 16);
171171         break;
172172   }
173173}
r242074r242075
230230
231231   while (m_icount > 0)
232232   {
233      debugger_instruction_hook(this, UNSP_LPC<<1);
234
233      debugger_instruction_hook(this, UNSP_LPC);
235234      op = READ16(UNSP_LPC);
236235
237236      UNSP_REG(PC)++;
trunk/src/emu/cpu/unsp/unspdasm.c
r242074r242075
5353
5454/*****************************************************************************/
5555
56#define UNSP_DASM_OK ((2 * (OP2X ? 2 : 1)) | DASMFLAG_SUPPORTED)
56#define UNSP_DASM_OK ((OP2X ? 2 : 1) | DASMFLAG_SUPPORTED)
5757
5858CPU_DISASSEMBLE( unsp )
5959{
r242074r242075
6868
6969   if(OP0 < 0xf && OPA == 0x7 && OP1 < 2)
7070   {
71      print("%s %04x", jmp[OP0], OP1 ? (pc - OPIMM*2) : (pc + OPIMM*2));
71      print("%s %04x", jmp[OP0], OP1 ? (pc - OPIMM + 1) : (pc + OPIMM + 1));
7272      return UNSP_DASM_OK;
7373   }
7474
trunk/src/mess/drivers/vii.c
r242074r242075
663663   static const char *const gpioregs[] = { "GPIO Data Port", "GPIO Buffer Port", "GPIO Direction Port", "GPIO Attribute Port", "GPIO IRQ/Latch Port" };
664664   static const char gpioports[] = { 'A', 'B', 'C' };
665665
666   offset -= 0x500;
667
668666   UINT16 val = m_io_regs[offset];
669667
670668   switch(offset)
r242074r242075
738736
739737   UINT16 temp = 0;
740738
741   offset -= 0x500;
742
743739   switch(offset)
744740   {
745741      case 0x00: // GPIO special function select
r242074r242075
901897}
902898
903899static ADDRESS_MAP_START( vii_mem, AS_PROGRAM, 16, vii_state )
904   AM_RANGE( 0x000000, 0x004fff ) AM_RAM AM_SHARE("p_ram")
905   AM_RANGE( 0x005000, 0x0051ff ) AM_READWRITE(video_r, video_w)
906   AM_RANGE( 0x005200, 0x0055ff ) AM_RAM AM_SHARE("p_rowscroll")
907   AM_RANGE( 0x005600, 0x0057ff ) AM_RAM AM_SHARE("p_palette")
908   AM_RANGE( 0x005800, 0x005fff ) AM_RAM AM_SHARE("p_spriteram")
909   AM_RANGE( 0x006000, 0x006fff ) AM_READWRITE(audio_r, audio_w)
910   AM_RANGE( 0x007000, 0x007fff ) AM_READWRITE(io_r,    io_w)
911   AM_RANGE( 0x008000, 0x7fffff ) AM_READ(rom_r)
900   AM_RANGE( 0x000000, 0x0027ff ) AM_RAM AM_SHARE("p_ram")
901   AM_RANGE( 0x002800, 0x0028ff ) AM_READWRITE(video_r, video_w)
902   AM_RANGE( 0x002900, 0x002aff ) AM_RAM AM_SHARE("p_rowscroll")
903   AM_RANGE( 0x002b00, 0x002bff ) AM_RAM AM_SHARE("p_palette")
904   AM_RANGE( 0x002c00, 0x002fff ) AM_RAM AM_SHARE("p_spriteram")
905   AM_RANGE( 0x003000, 0x0037ff ) AM_READWRITE(audio_r, audio_w)
906   AM_RANGE( 0x003d00, 0x003eff ) AM_READWRITE(io_r,    io_w)
907   AM_RANGE( 0x004000, 0x3fffff ) AM_READ(rom_r)
912908ADDRESS_MAP_END
913909
914910static INPUT_PORTS_START( vii )


Previous 199869 Revisions Next


© 1997-2024 The MAME Team