From a8e0c141b0184d629504b9f0ee8dbc4fefb90934 Mon Sep 17 00:00:00 2001 From: Peter Fors Date: Sat, 24 May 2025 15:45:54 +0200 Subject: 3011fps --- cpu.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'cpu.c') diff --git a/cpu.c b/cpu.c index 74d253d..23825aa 100644 --- a/cpu.c +++ b/cpu.c @@ -5,12 +5,10 @@ // DO NOT ENABLE FOR NES!!!!! // #define ENABLE_DECIMAL_MODE -__attribute__((hot)) 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__((hot)) static inline void unpack_flags(struct cpu_state *cpu, uint8_t value) { cpu->n = (value >> 7) & 1; cpu->v = (value >> 6) & 1; @@ -20,7 +18,6 @@ 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; @@ -31,8 +28,7 @@ static void (*opcode_lut[256*2])(struct nes_state *) __attribute__((aligned(4096 #include "cpu_opcodes.c" #include "cpu_opcodes_ud.c" -__attribute__((hot)) -static inline void do_nmi(struct nes_state * restrict state) { +static inline void do_nmi(struct nes_state *state) { struct cpu_state * restrict cpu = &state->cpu; memory_read_dummy(state, cpu->pc); // T1: dummy read (fetch suppressed) @@ -51,8 +47,7 @@ static inline void do_nmi(struct nes_state * restrict state) { cpu->i = 1; } -__attribute__((hot)) -static inline void do_irq(struct nes_state * restrict state) { +static inline void do_irq(struct nes_state *state) { struct cpu_state * restrict cpu = &state->cpu; memory_read_dummy(state, cpu->pc); // T1: dummy read (fetch suppressed) @@ -71,8 +66,7 @@ static inline void do_irq(struct nes_state * restrict state) { cpu->i = 1; } -__attribute__((always_inline, hot)) -static inline void check_interrupts(struct nes_state * restrict state) { +static inline void check_interrupts(struct nes_state *state) { struct cpu_state * restrict cpu = &state->cpu; if(state->cpu.nmi_pending) { @@ -84,8 +78,7 @@ static inline void check_interrupts(struct nes_state * restrict state) { } } -__attribute__((hot)) -static void cpu_tick(struct nes_state *state) { +static inline void cpu_tick(struct nes_state *state) { struct cpu_state * restrict cpu = &state->cpu; check_interrupts(state); -- cgit v1.2.3