diff --git a/codeCore/src/prog8/code/target/cx16/CX16Zeropage.kt b/codeCore/src/prog8/code/target/cx16/CX16Zeropage.kt index ba83c3398..fdb890ed9 100644 --- a/codeCore/src/prog8/code/target/cx16/CX16Zeropage.kt +++ b/codeCore/src/prog8/code/target/cx16/CX16Zeropage.kt @@ -12,8 +12,12 @@ class CX16Zeropage(options: CompilationOptions) : Zeropage(options) { init { - if (options.floats && options.zeropage !in arrayOf(ZeropageType.BASICSAFE, ZeropageType.DONTUSE)) - throw InternalCompilerException("when floats are enabled, zero page type should be 'basicsafe' or 'dontuse'") + if (options.floats && options.zeropage !in arrayOf( + ZeropageType.FLOATSAFE, + ZeropageType.BASICSAFE, + ZeropageType.DONTUSE + )) + throw InternalCompilerException("when floats are enabled, zero page type should be 'floatsafe' or 'basicsafe' or 'dontuse'") // the addresses 0x02 to 0x21 (inclusive) are taken for sixteen virtual 16-bit api registers. @@ -26,6 +30,10 @@ class CX16Zeropage(options: CompilationOptions) : Zeropage(options) { free.addAll(0x22u..0x7fu) free.addAll(0xa9u..0xffu) } + ZeropageType.FLOATSAFE -> { + free.addAll(0x22u..0x7fu) + free.addAll(0xd4u..0xffu) + } ZeropageType.BASICSAFE -> { free.addAll(0x22u..0x7fu) } diff --git a/compiler/src/prog8/compiler/Compiler.kt b/compiler/src/prog8/compiler/Compiler.kt index c680e59d3..ae03fc38d 100644 --- a/compiler/src/prog8/compiler/Compiler.kt +++ b/compiler/src/prog8/compiler/Compiler.kt @@ -276,11 +276,6 @@ fun determineCompilationOptions(program: Program, compTarget: ICompilationTarget // error will be printed by the astchecker } - if (zpType == ZeropageType.FLOATSAFE && compTarget.name == Cx16Target.NAME) { - System.err.println("Warning: zp option floatsafe changed to basicsafe for cx16 target") - zpType = ZeropageType.BASICSAFE - } - val zpReserved = toplevelModule.statements .asSequence() .filter { it is Directive && it.directive == "%zpreserved" } diff --git a/docs/source/todo.rst b/docs/source/todo.rst index 12e4d43f5..f1e6c7927 100644 --- a/docs/source/todo.rst +++ b/docs/source/todo.rst @@ -3,8 +3,6 @@ TODO For next release ^^^^^^^^^^^^^^^^ -- x16: check new ZP free addresses https://github.com/commanderx16/x16-docs/commit/541f2ce9e61d1d0d0e157d7f52fe16bc0895e6f0 - and https://www.commanderx16.com/forum/index.php?/topic/363-keep-zero-page-empty-as-much-as-possible/#comment-18561 - x16: check additional FP lib changes https://github.com/commanderx16/x16-rom/commit/ae608673f0210953172d6837acfbb231d62ddbd1 and https://github.com/commanderx16/x16-docs/commit/21238aedc641da91df88e04c4ce9bf3324a3c12d - x16: check joystick support (petaxian, own stuff) because of api change in r39 kernal https://github.com/commanderx16/x16-docs/blob/master/Commander%20X16%20Programmer's%20Reference%20Guide.md#function-name-joystick_get