19 #ifndef UTILS_H_DEFINED 20 #define UTILS_H_DEFINED 29 #include <ale_interface.hpp> 40 extern ALEInterface
ALE;
61 while (!f.compare_exchange_weak(old, old + d));
74 T
rotl(
const T x,
const int k) {
75 return (x << k) | (x >> (std::numeric_limits<T>::digits - k));
86 return c >= 0 && c <= 127;
117 std::vector<unsigned char>& screen42x32);
bool is7bit(int c)
Check if a value is written on 7 bits.
Definition: Utils.hpp:85
Sur-implementation of threading.
size_t ceilMultiple(size_t a, size_t b)
Calculate the closest value from a such that this new value is a multiple of b.
Definition: Utils.cpp:31
ALEInterface ALE
Definition: Utils.cpp:108
int secam_to_range_index(int i)
Transform a secam color value to a power of two.
Definition: Utils.cpp:39
vector< vector< string > > read_Config()
Store values extracted from the config file to a vector.
Definition: Utils.cpp:83
An implementation of Thread pool.
Definition: ThreadPool.h:57
Utils::ThreadPool thread_pool
Definition: Utils.cpp:29
void secam210x160_to_42x32(const std::vector< unsigned char > &screen, std::vector< unsigned char > &screen42x32)
Reduce the screen from 210x160 to 42x32.
Definition: Utils.cpp:62
void atomic_add(std::atomic< T > &f, T d)
Perform an atomic addition.
Definition: Utils.hpp:59
T rotl(const T x, const int k)
Rotate bytes to the left.
Definition: Utils.hpp:74
A set of useful method and class.
Definition: Random.cpp:33
void init_ALE()
Initialize the emulator from the config file.
Definition: Utils.cpp:110