19 #ifndef UTILS_H_DEFINED 20 #define UTILS_H_DEFINED 29 #include <ale_interface.hpp> 34 extern ALEInterface
ALE;
55 while (!f.compare_exchange_weak(old, old + d));
68 T
rotl(
const T x,
const int k) {
69 return (x << k) | (x >> (std::numeric_limits<T>::digits - k));
80 return c >= 0 && c <= 127;
111 std::vector<unsigned char>& screen42x32);
bool is7bit(int c)
Check if a value is written on 7 bits.
Definition: Utils.hpp:79
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:25
ALEInterface ALE
Definition: Utils.cpp:102
int secam_to_range_index(int i)
Transform a secam color value to a power of two.
Definition: Utils.cpp:33
vector< vector< string > > read_Config()
Store values extracted from the config file to a vector.
Definition: Utils.cpp:77
An implementation of Thread pool.
Definition: ThreadPool.h:51
Utils::ThreadPool thread_pool
Definition: Utils.cpp:23
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:56
void atomic_add(std::atomic< T > &f, T d)
Perform an atomic addition.
Definition: Utils.hpp:53
T rotl(const T x, const int k)
Rotate bytes to the left.
Definition: Utils.hpp:68
A set of useful method and class.
Definition: Random.cpp:27
void init_ALE()
Initialize the emulator from the config file.
Definition: Utils.cpp:104