Commit Graph

8 Commits

Author SHA1 Message Date
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
David Guillen Fandos 3f012afcda Make ROM hash table mechanism 64 bit compatible. 2021-10-30 22:54:51 +02:00
David Guillen Fandos b431a8a4b6 Merge stub arena into ROM cache for simplicity. 2021-09-09 19:06:15 +02:00
David Guillen Fandos 75e67bffc2 Add support for RS90 2021-07-23 18:50:44 +02:00
David Guillen Fandos a77c1c9171 Add overridable memory config knob for low-mem platforms 2021-07-21 00:23:10 +02:00
David Guillen Fandos 84cd7b2934 Rewrite ROM buffer allocation
This improves the existing on-demand ROM paging and also breaks down ROM
buffers into 1MB blocks for platforms with memory fragmentation issues.

Fixed some potential RTC reg issue in said platforms too.
Fixed page pinning on interpreter (would crash due to LRU evictions).
2021-07-14 01:20:30 +02:00
David Guillen Fandos 3144d9e277 Rework ram block ptrs to remove second indirection table.
This removes ram_block_ptrs and encodes the pointer directly in the
block tag. Saves ~256KB at no performance cost.
Drawback is that it limits the ram cache size to 512KB (we were using
768KB before). Should not be a problem since most games use less than
32KB of cache anyway.

Fixed ARM routines accordingly.
2021-07-08 21:29:48 +02:00
David Guillen Fandos ff510e7f7a Move caches to stub files to get around gcc 10
Seems that using the __atribute__ magic for sections is not the best way
of doing this, since it injects some default atributtes that collide
with the user defined ones. Using assembly is far easier in this case.

Reworked definitions a bit to make it easier to import from assembly.
Also wrapped stuff around macros for easy and less verbose
implementation of the symbol prefix issue.
2021-03-23 20:02:44 +01:00