diff --git a/compiler/res/prog8lib/cx16/gfx2.p8 b/compiler/res/prog8lib/cx16/gfx2.p8 index 764fd2362..60f7b40a9 100644 --- a/compiler/res/prog8lib/cx16/gfx2.p8 +++ b/compiler/res/prog8lib/cx16/gfx2.p8 @@ -204,8 +204,6 @@ gfx2 { ; You must also have called text_charset() first to select and prepare the character set to use. ; NOTE: in monochrome (1bpp) screen modes, x position is currently constrained to mulitples of 8 ! uword chardataptr - ubyte cy222 ; TODO why not removed by compiler??? - ubyte cb222 ; TODO why not removed by compiler??? when active_mode { 0, 128 -> { ; 1-bitplane modes diff --git a/compiler/res/prog8lib/diskio.p8 b/compiler/res/prog8lib/diskio.p8 index 8555e3e35..5342fd5eb 100644 --- a/compiler/res/prog8lib/diskio.p8 +++ b/compiler/res/prog8lib/diskio.p8 @@ -75,7 +75,9 @@ io_error: ; -- fill the array 'name_ptrs' with (pointers to) the names of the files requested. ubyte[256] names_buffer ubyte[256] names_buffer1 ; to store a bit more names + ; TODO names_buffer = memory("filenames", 512) uword buf_ptr = &names_buffer + names_buffer1[0] = 0 ; TODO force array to exist ubyte files_found = 0 if lf_start_list(drivenumber, pattern, suffixmatch) { while lf_next_entry() { diff --git a/compiler/src/prog8/optimizer/CallGraph.kt b/compiler/src/prog8/optimizer/CallGraph.kt index 7b65aad54..9ec36df8b 100644 --- a/compiler/src/prog8/optimizer/CallGraph.kt +++ b/compiler/src/prog8/optimizer/CallGraph.kt @@ -117,12 +117,9 @@ class CallGraph(private val program: Program) : IAstVisitor { } override fun visit(decl: VarDecl) { - if (decl.autogeneratedDontRemove || decl.definingModule().isLibraryModule) { - // make sure autogenerated vardecls are in the used symbols and are never removed as 'unused' + if (decl.autogeneratedDontRemove || decl.datatype==DataType.STRUCT) addNodeAndParentScopes(decl) - } - - if (decl.datatype == DataType.STRUCT) + else if(decl.parent is Block && decl.definingModule().isLibraryModule) addNodeAndParentScopes(decl) super.visit(decl) diff --git a/docs/source/todo.rst b/docs/source/todo.rst index ff58174f8..af68cc74d 100644 --- a/docs/source/todo.rst +++ b/docs/source/todo.rst @@ -2,7 +2,6 @@ TODO ==== -- why are unused vars not removed in gfx2 module - hoist all variable declarations up to the subroutine scope *before* even the constant folding takes place (to avoid undefined symbol errors when referring to a variable from another nested scope in the subroutine) - make it possible to use cpu opcodes such as 'nop' as variable names by prefixing all asm vars with something such as '_' - option to load the built-in library files from a directory instead of the embedded ones (for easier library development/debugging) diff --git a/examples/cx16/imageviewer/iff_module.p8 b/examples/cx16/imageviewer/iff_module.p8 index a67064c7d..b6992f8e3 100644 --- a/examples/cx16/imageviewer/iff_module.p8 +++ b/examples/cx16/imageviewer/iff_module.p8 @@ -4,6 +4,7 @@ %import diskio iff_module { + ; TODO uword cmap = memory("palette", 768) ubyte[256] cmap ubyte[256] cmap1 ubyte[256] cmap2 diff --git a/examples/test.p8 b/examples/test.p8 index 4abe395b7..98009e197 100644 --- a/examples/test.p8 +++ b/examples/test.p8 @@ -1,17 +1,19 @@ -%import test_stack -%import textio +;%import test_stack +;%import textio +%import gfx2 %zeropage basicsafe %option no_sysinit main { sub start () { - txt.lowercase() - txt.print_ub(txt.width()) - txt.chrout('\n') - txt.print_ub(txt.height()) - txt.chrout('\n') - test_stack.test() +; txt.lowercase() +; txt.print_ub(txt.width()) +; txt.chrout('\n') +; txt.print_ub(txt.height()) +; txt.chrout('\n') + gfx2.text(0,0,2, "sdafsdf") +; test_stack.test() } }