Thank you all for your feedback.
I guess I missed to point out in my original posting that I have added the dimX++ error deliberately to provoke contradicting error messages.
I understand now that
- the value a const variable in C may not necessarily be known at compile time
- SDCC does not check if in a specific case the value can be determined at compile time
I also understand that the C11 standard regards variable length arrays as optional only. However, this is not quite was I was looking for. In my case, it would have been already sufficient if the compiler would check if the value of the const variable can be determined at compile time. As it does not perform this check, it can consequently only throw an error.
As discussed, I will now use preprocessor directives instead.
Another question about the mapper segment compiling: is it possible to let the build script look in additional folders for the _s?_b? files? It looks like for the .c files they only work now in the root project folder, adding them to AddSources does not help.
The reason behind this is because I want to generate both the _s?_b? header and source files into a subfolder called 'generated', to keep them out of the other source files.
I think you can use ProjSegments
option in your project config to use segment in another directory.
ProjSegments = "subdir/segname"
should search for segname_s?_b?
files in /subdir/
folder.
I say 'should' because I can't test right now.
But all segments have to be in the same directory.
I have created a simple hello world program for DOS. However, I had to start this manually in openMSX as MSXgl always seems to start the C-BIOS generic MSX configurations which do not support disk drives. I have already tried to add manually a floppy interface extension but all I get is an error message in the emulator saying that C-BIOS can not execute BASIC. Is it possible to select a specific MSX computer for the emulator ? This way I could pick a model which includes a disk drive.
Thank you very much.
Just set EmulMachine = false;
in your project config and the Build tool will stop setting the machine at startup.
With openMSX we have no way to set the MSX generation (1, 2, 2+ and turbo R) except by forcing a specific machine (and as the vanilla version only include C-BIOS, this is the only available default option).
This did the trick, thank you very much !
I think you can use ProjSegments
option in your project config to use segment in another directory.
ProjSegments = "subdir/segname"
should search for segname_s?_b?
files in /subdir/
folder.
I say 'should' because I can't test right now.
But all segments have to be in the same directory.
That almost works. The files source files are indeed also generated in the subdir folder, however the linker can't find the .rel file because it is looking in that same subdir as well (while the .rel files are generated in the out folder). Tried as a workaround to generate the files to the out folder as well, but then the linker looks in the out/out/ folder for the .rel files.
I made a clean fix (using ProjSegments
to set directory and base name).
I have many changes in my pending list so I'll make more test tonight before pushing a new version on GitHub.
I'll let you know when it's ready.
@ToriHino ProjSegments="subdir/segname";
should works fine with the last version on GitHub (v0.9.8).
It is used now for s_arkos
and s_vgm
samples.
BTW, MSXgl got an official logo