Does Glass have a C cross-compiler too?
Nope, asm only
A Github was created. Please do explore it... and criticize it!
YOU CAN BET I'LL DO!! :-D
Thanks for creating the repo. Now I'd say the next steps would be:
1. Distribute the binary as a GitHub release instead of as a file hosted elsewhere. That not only makes the repository self-contained, it also allows you to include a nice changelog so that you don't have to create a new post here every time you make changes. Example: https://github.com/Konamiman/Nextor/releases/tag/v2.1.0-beta2
2. I guess you already plan to do that eventually but anyway I'll mention it: move the documentation from GDocs to a Markdown file inside the repository itself.
1. Distribute the binary as a GitHub (...)
2. (...) move the documentation from GDocs to a Markdown file inside the repository itself.
Both will be done!
Now, if I may ask you some (newbie) questions regarding your crt0s for MSX-DOS (I am working on the MSX-DOS template now):
1. Why must gsinit be in a _GSINIT area, which must be after the _DATA area? Why cant it be directly inside init? Is it just semantics?
2. Why did you pick 0xc000 to move the cmdline parsing routine (parloop and friends) to? What if the program is large enough to fill that area?
3. Why do you end the advanced crt0 with
call _main ;--- Step 4: Program termination. ; Termination code for DOS 2 was returned on L. ld c,#0x62 ;DOS 2 function for program termination (_TERM) ld b,l call 5 ;On DOS 2 this terminates; on DOS 1 this returns... ld c,#0x0 jp 5 ;...and then this one terminates ;(DOS 1 function for program termination).
and the simple crt0 with just
jp _main
?
Somehow the complete termination routine (and the exit code in b and l) does not apply to parameterless programs, or was it just your option to keep the simple version as simple as it gets?
Forgive me if these are to be a somewhat common knowledge. If they are answered somewhere else, I'd appreciate the reference.
best,
Thanks DamnedAngel, i have installed and followed the instructions and the example compiled perfect.
Just a question please, i am using Fusion-C and i have installed it in C:\MSX\Development\Libraries\Fusion-C
What file shoud i edit for the build process to found the libs, headers, includes, etc in this directory?
For the dirasdisk in openMSX i use a directory in: C:\MSX\Virtual-FDDs\openMSX_FDD-A
Is there a way to chante the output of the compiled bin file to that directory for example?
Thanks a lot for your work
Thanks DamnedAngel, i have installed and followed the instructions and the example compiled perfect.
\o/
Just a question please, i am using Fusion-C and i have installed it in C:\MSX\Development\Libraries\Fusion-C
What file shoud i edit for the build process to found the libs, headers, includes, etc in this directory?
Try this:
Inside your project in VS's solution exeplorer, open Make|Make.bat.
In lines 8 and 9 set (yes, this is still cumbersome, I have to make this customizable in the config files):
set MSX_DEV_PATH=C:\MSX\Development set MSX_LIB_PATH=%MSX_DEV_PATH%\Libraries
Now, inside Project Config|IncludeDirectories.txt, uncomment the line
[MSX_LIB_PATH]\Fusion-C\header
If needed, fix the path for matching your Fusion-C headers directory.
Include aldo whatever other entries you want to config you libs.
In Project Config|LibrarySources.txt, include whatever Fusion-C source files you want recompiled/reassembled every Rebuild action (if you are editing the source, include it in ApplicationSources.txt instead, and they will be recompiled/reassembled every Build action). Example:
[MSX_LIB_PATH]\Fusion-C\source\lib\keyboard.s [MSX_LIB_PATH]\Fusion-C\source\lib\setspritepattern.c
Lastly, if you are using Fusion-C REL files, include them in Project Config|RELs.txt:
[MSX_LIB_PATH]\Fusion-C\include\printf.rel
For the dirasdisk in openMSX i use a directory in: C:\MSX\Virtual-FDDs\openMSX_FDD-A
Is there a way to chante the output of the compiled bin file to that directory for example?
Again, there is , but in an ugly way.
Open again Make|Make.bat. Change the line 233 to match your desired output dir:
copy %1\objs\*.bin C:\MSX\Virtual-FDDs\openMSX_FDD-A
Thanks a lot for your work Smile
Code first, thank later!
Let me know of the outcome. Hope to have helped.
About the CRT0 for DOS you can refer to the one included in FUSION-C
It's the Konamiman's one, corrected by Eugeny Brychkov.
https://github.com/ericb59/Fusion-C-v1.2/tree/master/Working...
Check : crt0_msxdos.s
Hi ericb59,
Thanks for the tip!
I took a look at FUSION-C's version of crt0_msxdos.s and found out that Eugeny changed from
__pre_main: push de ld de,#_HEAP_start ld (_heap_top),de pop de
to
__pre_main: push hl ld hl,#_HEAP_start ld (_heap_top),hl pop hl
Indeed, that saves a byte (and 4 cycles). I have already updated the VS template code.
My question is: Is there any reason not to do that in crt0_msxdos_advanced.s as well? This one still uses de instead of hl.
best,
Hi ericb59,
I just realized that FUSION-C's advanced version of the MSX-DOS CRT0 code lacks the global variables initialization routine.
That potentially breaks programs that rely on initialied global variables. Is there a reason to have such code removed (Konimiman's original code does have the routine)?
.area _GSINIT gsinit:: ld bc,#l__INITIALIZER ld a,b or a,c jp z,gsinext ld de,#s__INITIALIZED ld hl,#s__INITIALIZER ldir gsinext: .area _GSFINAL ret
thanks!
You are right the expanded crt0 was not updated.
Have to do !
Eugeny made the modification because global variables were not initialized with original crt0
Well done, that looks already very workable. Looking forward to the support for DOS and ROM files as well.
Hi ToriHino, please check next post!