/** * Emulator Native Features ID opcode interception. */ unsigned long OpCode_NatFeat_ID(uae_u32 opcode) { Uint32 stack = Regs[REG_A7] + SIZE_LONG; /* skip return address */ Uint16 SR = M68000_GetSR(); if (NatFeat_ID(stack, &(Regs[REG_D0]))) { m68k_incpc(2); regs.ir = regs.irc; get_word_prefetch(2); } return 4 * CYCLE_UNIT / 2; }
/** * Emulator Native Features call opcode interception. */ unsigned long OpCode_NatFeat_Call(uae_u32 opcode) { Uint32 stack = Regs[REG_A7] + SIZE_LONG; /* skip return address */ Uint16 SR = M68000_GetSR(); bool super; super = ((SR & SR_SUPERMODE) == SR_SUPERMODE); if (NatFeat_Call(stack, super, &(Regs[REG_D0]))) { CpuDoNOP (); } return 4; }
/** * Emulator Native Features call opcode interception. */ unsigned long OpCode_NatFeat_Call(uae_u32 opcode) { Uint32 stack = Regs[REG_A7] + SIZE_LONG; /* skip return address */ Uint16 SR = M68000_GetSR(); bool super; super = ((SR & SR_SUPERMODE) == SR_SUPERMODE); if (NatFeat_Call(stack, super, &(Regs[REG_D0]))) { m68k_incpc(2); regs.ir = regs.irc; get_word_prefetch(2); } return 4 * CYCLE_UNIT / 2; }
/** * Parse unsigned register/symbol/number value and set it to "number" * and the number base used for parsing to "base". * Return how many characters were parsed or zero for error. */ static int getValue(const char *str, Uint32 *number, int *base, bool bForDsp) { char name[64]; const char *end; Uint32 mask, *addr; int len; for (end = str; *end == '_' || isalnum(*end); end++); len = end-str; if (len >= (int)sizeof(name)) { fprintf(stderr, "ERROR: symbol name at '%s' too long (%d chars)\n", str, len); return 0; } memcpy(name, str, len); name[len] = '\0'; *base = 0; /* no base (e.g. variable) */ /* internal Hatari variable? */ if (BreakCond_GetHatariVariable(name, number)) { return len; } if (bForDsp) { int regsize = DSP_GetRegisterAddress(name, &addr, &mask); /* DSP register or symbol? */ switch (regsize) { case 16: *number = (*((Uint16*)addr) & mask); return len; case 32: *number = (*addr & mask); return len; default: if (Symbols_GetDspAddress(SYMTYPE_ALL, name, number)) { return len; } } } else { /* a special case CPU register? */ if (strcasecmp(name, "PC") == 0) { *number = M68000_GetPC(); return len; } if (strcasecmp(name, "SR") == 0) { *number = M68000_GetSR(); return len; } /* a normal CPU register or symbol? */ if (DebugCpu_GetRegisterAddress(name, &addr)) { *number = *addr; return len; } if (Symbols_GetCpuAddress(SYMTYPE_ALL, name, number)) { return len; } } /* none of above, assume it's a number */ return getNumber(str, number, base); }