#include #include #include #include #include #include "emu.h" cpu_t cpu; static inline bool carry(void) { fatal("carry() not supported yet"); } #define swb16(x) bswap_16(x) #define swb32(x) bswap_32(x) static inline uint32_t reg(uint8_t n) { return cpu.gpr[n]; } static inline uint32_t reg0(uint8_t n) { if (n == 0) return 0; return cpu.gpr[n]; } static inline uint32_t ext8(int8_t n) { return (n << 24) >> 24; } static inline uint32_t ext16(int16_t n) { return (n << 16) >> 16; } static bool getcr(uint8_t bit) { bit = 31 - bit; /* note PowerPC bit numbering */ return cpu.cr & (1<