Previous 199869 Revisions Next

r36304 Saturday 7th March, 2015 at 16:14:27 UTC by hap
correct program counter sequence in debug view
[src/emu/cpu/hmcs40]hmcs40.h hmcs40d.c

trunk/src/emu/cpu/hmcs40/hmcs40.h
r244815r244816
8686
8787   // device_disasm_interface overrides
8888   virtual UINT32 disasm_min_opcode_bytes() const { return 2; }
89   virtual UINT32 disasm_max_opcode_bytes() const { return 2; }
89   virtual UINT32 disasm_max_opcode_bytes() const { return 2+1; }
9090   virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options);
9191   void state_string_export(const device_state_entry &entry, astring &string);
9292
trunk/src/emu/cpu/hmcs40/hmcs40d.c
r244815r244816
7575   0, 0
7676};
7777
78// next program counter in sequence (relative)
79static const INT8 s_next_pc[0x40] =
80{
81   1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
82   16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 32+1,
83   -32, -31, -30, -29, -28, -27, -26, -25, -24, -23, -22, -21, -20, -19, -18, -17,
84   -15, -14, -13, -12, -11, -10, -9, -8, -7, -6, -5, -4, -3, -2, -1, -1
85};
7886
87
7988static const UINT8 hmcs40_mnemonic[0x400] =
8089{
8190/*  0       1       2       3       4       5       6       7       8       9       A       B       C       D       E       F      */
r244815r244816
171180
172181CPU_DISASSEMBLE(hmcs40)
173182{
174   int pos = 0;
175   UINT16 op = (oprom[pos] | oprom[pos + 1] << 8) & 0x3ff;
176   pos++;
183   UINT16 op = (oprom[0] | oprom[1] << 8) & 0x3ff;
177184   char *dst = buffer;
178185   UINT8 instr = hmcs40_mnemonic[op];
179186   INT8 bits = s_bits[instr];
r244815r244816
201208      else
202209         dst += sprintf(dst, "%d", param);
203210   }
204
211   
212   int pos = s_next_pc[pc & 0x3f] & DASMFLAG_LENGTHMASK;
205213   return pos | s_flags[instr] | DASMFLAG_SUPPORTED;
206214}


Previous 199869 Revisions Next


© 1997-2024 The MAME Team