diff --git a/source/quickerNES/core/cpu.cpp b/source/quickerNES/core/cpu.cpp index af12954..37632aa 100644 --- a/source/quickerNES/core/cpu.cpp +++ b/source/quickerNES/core/cpu.cpp @@ -222,10 +222,6 @@ uint8_t clock_table [256] = { 3,5,2,8,4,4,6,6,2,4,2,7,4,4,7,7 // F }; -// This optimization is only possible with the GNU compiler -- MSVC does not allow function alignment -#ifdef __GNUC__ -__attribute__((optimize("align-functions=1024"))) -#endif Cpu::result_t Cpu::run ( nes_time_t end ) { set_end_time_( end ); @@ -1175,7 +1171,6 @@ end: r.status = temp; } - this->clock_count = clock_count; r.pc = pc; r.sp = GET_SP(); r.a = a; diff --git a/source/quickerNES/core/cpu.hpp b/source/quickerNES/core/cpu.hpp index 4b2a798..60930b4 100644 --- a/source/quickerNES/core/cpu.hpp +++ b/source/quickerNES/core/cpu.hpp @@ -84,7 +84,12 @@ class Cpu result_badop // unimplemented/illegal instruction }; + // This optimization is only possible with the GNU compiler -- MSVC does not allow function alignment +#if defined(__GNUC__) || defined(__clang__) + result_t run(nes_time_t end_time) __attribute__((aligned(1024))); +#else result_t run(nes_time_t end_time); +#endif nes_time_t time() const { return clock_count; }