1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-16 22:28:57 +00:00

Attempted further to improve memory model guesswork. With many further improvements to make...

This commit is contained in:
Thomas Harte 2016-09-08 21:09:37 -04:00
parent 27fedaf892
commit a5b17932ca

View File

@ -83,6 +83,8 @@ void StaticAnalyser::Commodore::AddTargets(
if(is_basic) if(is_basic)
{ {
target.loadingCommand = "LOAD\"\",1,0\nRUN\n"; target.loadingCommand = "LOAD\"\",1,0\nRUN\n";
// make a first guess based on loading address
switch(files.front().starting_address) switch(files.front().starting_address)
{ {
case 0x1001: case 0x1001:
@ -94,6 +96,21 @@ void StaticAnalyser::Commodore::AddTargets(
target.vic20.memory_model = Vic20MemoryModel::EightKB; target.vic20.memory_model = Vic20MemoryModel::EightKB;
break; break;
} }
// An unexpanded machine has 3583 bytes free for BASIC;
// a 3kb expanded machine has 6655 bytes free.
// we'll be relocating though, so up size if necessary
size_t file_size = files.front().data.size();
if(file_size > 6655)
{
target.vic20.memory_model = Vic20MemoryModel::ThirtyTwoKB;
}
else if(file_size > 3583)
{
if(target.vic20.memory_model == Vic20MemoryModel::Unexpanded)
target.vic20.memory_model = Vic20MemoryModel::EightKB;
}
} }
else else
{ {