summaryrefslogtreecommitdiff
path: root/cpu.c
diff options
context:
space:
mode:
Diffstat (limited to 'cpu.c')
-rw-r--r--cpu.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/cpu.c b/cpu.c
index 34d5bed..ec7b5ec 100644
--- a/cpu.c
+++ b/cpu.c
@@ -5,12 +5,12 @@
// REMOVE FOR NES!!!!!
// #define ENABLE_DECIMAL_MODE
-__attribute__((always_inline))
+__attribute__((hot, always_inline))
static inline uint8_t pack_flags(struct cpu_state *cpu) {
return (cpu->n << 7) | (cpu->v << 6) | (1 << 5) | (cpu->d << 3) | (cpu->i << 2) | (cpu->z << 1) | cpu->c;
}
-__attribute__((always_inline))
+__attribute__((hot, always_inline))
static inline void unpack_flags(struct cpu_state *cpu, uint8_t value) {
cpu->n = (value >> 7) & 1;
cpu->v = (value >> 6) & 1;
@@ -20,6 +20,7 @@ static inline void unpack_flags(struct cpu_state *cpu, uint8_t value) {
cpu->c = value & 1;
}
+__attribute__((hot))
static inline void update_zn(struct cpu_state *cpu, uint8_t result) {
cpu->z = (result == 0);
cpu->n = (result & 0x80) != 0;