From 6439d303a8c479ee633307a5622901545fd899b5 Mon Sep 17 00:00:00 2001 From: Aaron Culliney Date: Sun, 15 Feb 2015 18:39:37 -0800 Subject: [PATCH] Misc build tweaks --- src/cpu-supp.c | 42 ++++++++++++----------------------------- src/cpu.h | 1 + src/video_util/glUtil.h | 3 +++ 3 files changed, 16 insertions(+), 30 deletions(-) diff --git a/src/cpu-supp.c b/src/cpu-supp.c index 0cfdbd8b..e08d9937 100644 --- a/src/cpu-supp.c +++ b/src/cpu-supp.c @@ -580,68 +580,50 @@ uint8_t cpu65__opcycles[256] = { }; // NOTE: currently this is a conversion table between i386 flags <-> 6502 P register -static void initialize_code_tables() -{ - for (unsigned i = 0; i < 256; i++) - { +static void init_flags_conversion_tables(void) { + for (unsigned i = 0; i < 256; i++) { unsigned char val = 0; - if (i & C_Flag) - { + if (i & C_Flag) { val |= C_Flag_6502; } - if (i & X_Flag) - { + if (i & X_Flag) { val |= X_Flag_6502; } - if (i & I_Flag) - { + if (i & I_Flag) { val |= I_Flag_6502; } - if (i & V_Flag) - { + if (i & V_Flag) { val |= V_Flag_6502; } - if (i & B_Flag) - { + if (i & B_Flag) { val |= B_Flag_6502; } - if (i & D_Flag) - { + if (i & D_Flag) { val |= D_Flag_6502; } - if (i & Z_Flag) - { + if (i & Z_Flag) { val |= Z_Flag_6502; } - if (i & N_Flag) - { + if (i & N_Flag) { val |= N_Flag_6502; } -#if defined(__i386__) || defined(__x86_64__) - cpu65_flags_encode[ i ] = val/* | 0x20 WTF?*/; + cpu65_flags_encode[ i ] = val; cpu65_flags_decode[ val ] = i; -#elif defined(__arm__) -# error TODO FIXME proper map of ARM processor flags -#elif defined(__aarch64__) -# error soon ... -#else -# error unknown machine architecture -#endif } } void cpu65_init(void) { - initialize_code_tables(); + init_flags_conversion_tables(); cpu65__signal = 0; cpu65_pc = 0x0; cpu65_ea = 0x0; diff --git a/src/cpu.h b/src/cpu.h index e6c90e43..9ec44409 100644 --- a/src/cpu.h +++ b/src/cpu.h @@ -97,6 +97,7 @@ void cpu65_trace_checkpoint(void); # define Z_Flag 0x40 /* 6502 Zero */ # define N_Flag 0x80 /* 6502 Negative */ #elif defined(__arm__) +// VCZN positions match positions of shifted status register # define V_Flag 0x1 # define C_Flag 0x2 # define Z_Flag 0x4 diff --git a/src/video_util/glUtil.h b/src/video_util/glUtil.h index f3ac2f00..a301f461 100644 --- a/src/video_util/glUtil.h +++ b/src/video_util/glUtil.h @@ -26,6 +26,9 @@ #elif defined(USE_GL3W) # include # include +#elif defined(ANDROID) +# include +# include #else # define GLEW_STATIC # include