From ae04f5aee8326f849cf68c9a42ad4726edf5c437 Mon Sep 17 00:00:00 2001 From: Irmen de Jong Date: Sun, 23 Feb 2025 10:21:55 +0100 Subject: [PATCH] %option romable now disables floating point support because if it's your code that is running in the rom bank you can't have the floating point routines available there --- .idea/misc.xml | 2 +- compiler/src/prog8/compiler/Compiler.kt | 3 +++ docs/source/todo.rst | 2 -- examples/test.p8 | 1 + 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index 6068b1bb1..b39a585dd 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -22,7 +22,7 @@ - + \ No newline at end of file diff --git a/compiler/src/prog8/compiler/Compiler.kt b/compiler/src/prog8/compiler/Compiler.kt index 8f948443d..1b67a1c4e 100644 --- a/compiler/src/prog8/compiler/Compiler.kt +++ b/compiler/src/prog8/compiler/Compiler.kt @@ -336,6 +336,9 @@ fun parseMainModule(filepath: Path, errors.err("BASIC launcher requires output type PRG", program.toplevelModule.position) } + if(compilerOptions.romable && compilerOptions.floats) + errors.err("When ROMable code is selected, floating point support is not available", program.toplevelModule.position) + errors.report() return Triple(program, compilerOptions, importedFiles) diff --git a/docs/source/todo.rst b/docs/source/todo.rst index e4a5a18a1..f3c8bd3b9 100644 --- a/docs/source/todo.rst +++ b/docs/source/todo.rst @@ -1,8 +1,6 @@ TODO ==== -- disable floating point support for %option romable ? (because if it's your code that is running in the rom bank you can't have the floating point routines available there) - ... diff --git a/examples/test.p8 b/examples/test.p8 index 173a7c123..a449030de 100644 --- a/examples/test.p8 +++ b/examples/test.p8 @@ -1,3 +1,4 @@ +%import textio %zeropage basicsafe %option no_sysinit, romable