gpsp/gpsp_config.h
David Guillen Fandos f597836abc Implement dual mode (arm/thumb) for RAM positions
(This is similar to 908fb8 but for memory regions)

Removes the weird offset encoding in favour of a metadata structure,
similar to what there was before. However this structure overlaps with
the cache ram itself and grows like a stack. This is to avoid wating
memory since most games only use a few blocks.
Simplify the "dual" block lookup routines too, since they are only an
extrypoint to the other two real modes.
2022-01-04 18:59:07 +01:00

27 lines
848 B
C

#ifndef GPSP_CONFIG_H
#define GPSP_CONFIG_H
/* Default ROM buffer size in megabytes (this is a maximum value!) */
#ifndef ROM_BUFFER_SIZE
#define ROM_BUFFER_SIZE 32
#endif
/* Cache sizes and their config knobs */
#if defined(SMALL_TRANSLATION_CACHE)
#define ROM_TRANSLATION_CACHE_SIZE (1024 * 1024 * 2)
#define RAM_TRANSLATION_CACHE_SIZE (1024 * 384)
#else
#define ROM_TRANSLATION_CACHE_SIZE (1024 * 1024 * 10)
#define RAM_TRANSLATION_CACHE_SIZE (1024 * 512)
#endif
/* Should be an upperbound to the maximum number of bytes a single JIT'ed
instruction can take. STM/LDM are tipically the biggest ones */
#define TRANSLATION_CACHE_LIMIT_THRESHOLD (1024 * 2)
/* Hash table size for ROM trans cache lookups */
#define ROM_BRANCH_HASH_BITS 16
#define ROM_BRANCH_HASH_SIZE (1 << ROM_BRANCH_HASH_BITS)
#endif