Nop90 Posted June 18, 2019 Share Posted June 18, 2019 Using karri's template the most tedious thing is to update the lynx.cfg file every time the memory layout need to be tuned. I'm referring to the piece of configuration like the one here: SYMBOLS { __BLOCKSIZE__: value = 1024, type = export; # 1024 bytes / block __BOOTLDR__: type = import; __HEADERSIZE__: value = 64, type = export; __STARTOFDIRECTORY__: value = $CB, type = export; __DIRECTORYSIZE__: value = 13*8, type = export; __MEMORY_TOP__: value = $fff8, type = export; # Screen is just below the top vectors __SCREEN_SIZE__: value = 8160, type = export; __MEMORY_SCREEN1__: value = __MEMORY_TOP__ - __SCREEN_SIZE__, type = export; __MEMORY_SCREEN0__: value = __MEMORY_SCREEN1__ - __SCREEN_SIZE__, type = export; # Under the screen we put the C-stack __STACKSIZE__: value = $800, type = export; # 2K stack __MEMORY_STACK__: value = __MEMORY_SCREEN0__ - __STACKSIZE__, type = export; # Under the stack we must put the resident RAM segment __RAM_RESIDENT_SIZE__: value = $444b, type = export; __MEMORY_RAM__: value = __MEMORY_STACK__ - __RAM_RESIDENT_SIZE__, type = export; # Under the resident code we place the tunes __TUNES_SIZE__: value = $138f, type = export; __MEMORY_TUNES__: value = __MEMORY_RAM__ - __TUNES_SIZE__, type = export; # Modules start adress __MEMORY_MODULES__: value = $0200, type = export; __MODULES_SIZE__: value = __MEMORY_TUNES__ - __MEMORY_MODULES__, type = export; } It would be great to use a keyword AUTO for some of the modules size so that the linker can compile the related code block and use the final required size to complete the configuration. At the end, all the remaining memory will be used for the last block in the list (usually __MODULES_SIZE__) and if enough then the linking will complete, otherwise there will be the usual error message. Haveing a detailed report of all the blocks sizes (for both cases of success and error) will help the coder to decide what to shrink if needed. Do you think this could be doable? Link to comment Share on other sites More sharing options...
+karri Posted June 19, 2019 Share Posted June 19, 2019 (edited) Hard to say. I have not worked with the CL65. But Uz usually writes readable code so it may be worth to have a look. The bad thing is that compatibility with Olivers version would break. Perhaps this is something we should do for mainstream cc65? Edit: from what I have heard the compatibility may already be broken... Edited June 19, 2019 by karri second thougt Link to comment Share on other sites More sharing options...
Recommended Posts