Schrijver
| C compiler??
|
MSi msx user Berichten: 44 | Geplaatst: 24 Januari 2005, 12:49   |
Hi Everybody!
Does anybody know if there is a good C compiler on MSX? I used to code in ASM (in the early days of UMF/ROM... ), but since i left the MSX development, i continued on C language on PC (dos/windows).
Unfortunately my ASM knowledge has left my brain ;-)
If there is one, is it good(fast) enough to code demo's or games with, or does it have too much limitations?
thnx!
Roald
|
|
manuel msx guru Berichten: 3531 | Geplaatst: 24 Januari 2005, 12:53   |
There are several, but they are not generating utlimately fast code of course. I'm not sure if they can be used to program any raster effects or interrupt driven stuff.
I myself have used the following combo: Hi-Tech C compiler for CP/M, run by a CP/M emulator under Linux. Editing done with VIM, preprocessing with gcc, testing in openMSX. If you want to know more, let me know.
There's also SDCC (free software), which can produce Z80 code and ASCII-C for MSX.
And probably even more.
|
|
DarQ msx professional Berichten: 837 | Geplaatst: 24 Januari 2005, 14:47   |
im curious, how many (and how good) libraries are there?
|
|
MSi msx user Berichten: 44 | Geplaatst: 24 Januari 2005, 15:04   |
Quote:
| im curious, how many (and how good) libraries are there?
|
i think that is the biggest problem... or not?? does anybody know what libraries are available? |
|
DarQ msx professional Berichten: 837 | Geplaatst: 24 Januari 2005, 15:40   |
its not that cool to write every lib you need yourself for a demo...
or you must have a lot of spare time
|
|
The_Engineer msx user Berichten: 39 | Geplaatst: 24 Januari 2005, 15:46   |
Quote:
| I myself have used the following combo: Hi-Tech C compiler for CP/M, run by a CP/M emulator under Linux. Editing done with VIM, preprocessing with gcc, testing in openMSX. If you want to know more, let me know.
There's also SDCC (free software), which can produce Z80 code and ASCII-C for MSX.
And probably even more.
|
Manuel, I guess you made some MSX-DOS utilities with the gcc-setup described above? Without any difficult graphic stuff (because of a lack of libraries)?
I tried the SDCC package, but after disassembling my hllwrld.c, I decided not to continue with that assembler! The only two general purpose registers it knows are A and HL and all variables / calculations are done via the stack... You'll need to do a lot of work to have SDCC generate some usefull (fast and compact) code.
IIRC there is another tread about SDCC and someone is currently creating libraries for the MSX. |
|
Sonic_aka_T
 msx guru Berichten: 2269 | Geplaatst: 24 Januari 2005, 15:53   |
Willem: Your asm skills were pretty darn solid, if I remember correctly...  Why bother with C at all? Nothing wrong with a little oldskool action!  |
|
The_Engineer msx user Berichten: 39 | Geplaatst: 24 Januari 2005, 18:11   |
Quote:
| Willem: Your asm skills were pretty darn solid, if I remember correctly...  Why bother with C at all? Nothing wrong with a little oldskool action! 
|
@Sonic_aka_T: (hi Toob) ASM is great if you are doing games and fast stuff, but if you want to create some parser of any kind, ASM is hell (or you need a good library of subroutines).
Furthermore, it would be nice if one could code the non-real time parts (like file IO, gfx setup e.d.) in C and the real-time stuff (like interrupt handlers and game code) in ASM. I remember that Jan van Valburg used to work like this (Gianna Sisters, Retaliator). He even put his main.c file on the Retaliator disk to show how he coded.
Jeroen Smael also told me he should have had parts of the FD maincode in C and other parts in ASM (inline). That would really help with reading/upgrading the code in the new millenium.
On topic again: I think that Hitech C is the best way to go with the usage of inline assembly. Hitech does support this and the version on the MCCM CDs has an extensive manual on how to create libraries and stuff.
|
|
MSi msx user Berichten: 44 | Geplaatst: 24 Januari 2005, 21:44   |
Quote:
|
On topic again: I think that Hitech C is the best way to go with the usage of inline assembly. Hitech does support this and the version on the MCCM CDs has an extensive manual on how to create libraries and stuff.
|
Thanx!
does anybody know where to download it? |
|
HansO msx addict Berichten: 375 | Geplaatst: 24 Januari 2005, 21:54   |
|
|
karloch
 msx addict Berichten: 417 | Geplaatst: 24 Januari 2005, 22:25   |
The version at Hisoft webpage is 3.09 for CP/M. There is a version patched somehow for MSX-DOS 1 (still with no folder support), the 3.10. Maybe that you can find that at Funet.
I like C so much, but what C is lacking in MSX is libs. Hitech-C only provides with the standard ones. Airam (a spanish user) developed a pair of basic graphics libs for V9938 and V9990 (GFX9000), but they only work in the MS-DOS version of Hitech-C.
Another C library available is the one that Néstor Soriano released a month ago: a lib to use InterNestor Lite and code Internet applications in C. Although it was developed for SDCC, it should work with Hitech-C.
I don't know any more libraries for C. Maybe that people thinking in C at MSX should try PASCAL as it plenty of libs to do anything, and there is a very good compiler.
|
|
HansO msx addict Berichten: 375 | Geplaatst: 24 Januari 2005, 22:38   |
Quote:
| The version at Hisoft webpage is 3.09 for CP/M. There is a version patched somehow for MSX-DOS 1 (still with no folder support), the 3.10. Maybe that you can find that at Funet.
|
Yea, its on funet. But also un the Uzix download page! Pierre Gielen started the work on MSX-DOS version and libraries.
Quote:
| I don't know any more libraries for C. Maybe that people thinking in C at MSX should try PASCAL as it plenty of libs to do anything, and there is a very good compiler.
|
Yup, Turbo Pascal 3 and 3.3 and all those include files are great!
Its my favorite for MSX hybrid development.
There is also MSX C V1.0 and 1.1 by ASCII. Not the most standard version of C, but a version especially for MSX-DOS (2). |
|
manuel msx guru Berichten: 3531 | Geplaatst: 24 Januari 2005, 23:26   |
We used Pierre Gielens libraries indeed. They are pretty complete and easy to extend. They are on FUNet, AFAIK. We were able to make a normal graphical game with it.  |
|
MicroTech msx lover Berichten: 122 | Geplaatst: 25 Januari 2005, 09:29   |
Quote:
| Does anybody know if there is a good C compiler on MSX? I used to code in ASM (in the early days of UMF/ROM... ), but since i left the MSX development, i continued on C language on PC (dos/windows).
|
Hi Roald,
I use Ascii MSX C v1.2, I don't know the other C compilers so I can't make comparisons but I can tell you in short what I find good and bad in this compiler.
Good 
- generates very fast and efficent code (take a look at 3D-CUBE in download section: that's 98% C + 2% ASM)
- produces assembly output of compiled code which can be modified or just only taken as example to "look how it works"
- based on M80 and L80 so you can link together C, ASM or whatever .REL module
- libraries (with source) available (take a look at http://home.wanadoo.nl/fvu/Projects/Msx/Web/msx.htm to get an idea)
Bad 
- function prototypes must be K&R style
- no float support, only 8 and 16 bits variables (with math library you get also 32 bits long)
- care must taken when passing arguments to functions, I don't know if function parameter checking works correctly, I simply don't use it
I say that Ascii C is sometimes a bit particular but once you learn how to work with it it can give satisfaction.
Quote:
|
Unfortunately my ASM knowledge has left my brain ;-)
|
I think asm programming is like going by bike... once you learn you never forget, you must simply try a little and everything will return to your memory.
Hope this can be useful
MicroTech
|
|
MSi msx user Berichten: 44 | Geplaatst: 25 Januari 2005, 12:47   |
ok thanks everybody for the information! i'm going to check everything out and see what version works best for me!!
|
|
|
|
|