More cleanup changes for the remapping. All machine-init functions now call mem_top_remap themselves, this is no longer inherited. machine_at_*_remap_init() functions removed.

As an initial test, added remap to the NEAT - that works.
This commit is contained in:
waltje
2018-08-20 20:06:22 -04:00
parent ed871b3c27
commit 3be39f9792
10 changed files with 48 additions and 68 deletions

View File

@@ -12,7 +12,7 @@
* the DYNAMIC_TABLES=1 enables this. Will eventually go
* away, either way...
*
* Version: @(#)mem.c 1.0.16 2018/08/20
* Version: @(#)mem.c 1.0.17 2018/08/20
*
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com>
@@ -1763,22 +1763,23 @@ mem_init(void)
}
static void
mem_remap_top(int max_size)
void
mem_remap_top(int kb)
{
uint32_t start = (mem_size >= 1024) ? mem_size : 1024;
int size = mem_size - 640;
pclog("MEM: remapping top %iKB (mem=%i)\n", max_size, mem_size);
pclog("MEM: remapping top %iKB (mem=%i)\n", kb, mem_size);
if (mem_size <= 640) return;
if (size > max_size)
size = max_size;
if (size > kb)
size = kb;
mem_set_mem_state(start * 1024, size * 1024,
MEM_READ_INTERNAL | MEM_WRITE_INTERNAL);
mem_mapping_set_addr(&ram_remapped_mapping, start * 1024, size * 1024);
#if 0
//FIXME: was this a typo for mem_remapped_mapping? --FvK
mem_mapping_set_exec(&ram_split_mapping, ram + (start * 1024));
#endif
@@ -1786,20 +1787,6 @@ pclog("MEM: remapping top %iKB (mem=%i)\n", max_size, mem_size);
}
void
mem_remap_top_256k(void)
{
mem_remap_top(256);
}
void
mem_remap_top_384k(void)
{
mem_remap_top(384);
}
void
mem_reset_page_blocks(void)
{