Neither, He doesn't find good way to make a Floppy version, loading graphics from a floppy.
Perhaps it 's because of his own limitation about MSX understanding, or SDCC limitation... ?
I don't know SDCC very well, but I know that Nestor uses it to develop his applications, and he's doing fine working with files.
But, how is it easy (or not) making 64K ROM or MegaRom when programing with MSX-C ?
I don't know the details, but if this is very important to you then I can translate the relevant pages of the MSX-C manual. It will take me a few days. From what I can see, MSX-C itself doesn't handle slot switching, and you (or your friend) will have to write code to handle the page switching, detecting available memory, and to keep track of where the application assets are stored. If you're running under MSX-DOS2 this task becomes much easier, but then we're not talking about cartridge software.
How is it easy (or not) making floppy disk games (loading files) ? with or without MSX-DOS ?
Handling files in MSX-C is trivial. It's exactly the same as in standard C.
Yeah Nestor is using SDCC, perhaps he could help some with this topic
About manual, it should be really apreciate to get translated MSX specific parts of the manual. This is, the standar commands are not relevant since you can use any standar C manual, but specific MSX functions not. Clearly it should be a valious msx.org wiki content
@ericb59 Wellcome to MSX-C, let's try our best
Yes, JaviLM, if you can translate thoses parts, it will be verry interresting.
Not Sure I will jump into MSX-C, because all projects I can have are supposed to handle a lot of Data, and have to be stored on large MegaRom. I'm not sure MSX-C can be helpfull for that.
My first think is MSX-C is good to do small softwares, and 32K Roms.
Perhaps I will change my mind with more informations from JaviLM...
There is a way to put some part of code, and data (variables, arrays, probably not using malloc but I don't care) in a specific address like in ASM? For using pages or mappers manually is required to select the 16KB block and not split the data nor broke the code at switch. I guess so because C can make ROM.
Yes, it's easy. Just define variables to point to a memory location. For example, from the COLOR.C sample program that comes with MSX-C:
#define FORCLR (*(TINY *)0xf3e9) /* foreground color */ #define BAKCLR (*(TINY *)0xf3ea) /* background color */ #define BDRCLR (*(TINY *)0xf3eb) /* border color */
From this point on, you can refer to FORCLR, BAKCLR and BDRCLR as TINY variables (TINY is an 8-bit value in MSX-C), and these variables are located in memory addresses 0xF3E9, 0XF3EA and 0xF3EB, respectively. You can read/write these variables freely.
#define FORCLR (*(TINY *)0xf3e9) /* foreground color */ #define BAKCLR (*(TINY *)0xf3ea) /* background color */ #define BDRCLR (*(TINY *)0xf3eb) /* border color */
From this point on, you can refer to FORCLR, BAKCLR and BDRCLR as TINY variables (TINY is an 8-bit value in MSX-C), and these variables are located in memory addresses 0xF3E9, 0XF3EA and 0xF3EB, respectively. You can read/write these variables freely.
And since they are pointers, you can iterate through memory addresses , right? This is, you can upload arrays to one adress and iterate over them. A very interesting feature.
@ericb59 Really C is designed for big projects, it provides needed resources for it. I'm not sure how to make roms >32Kb using C, but nowadays there are other devices in MSX has hard disk (or SD cards). The idea I have is that you can make really big games in C using hard disk as RPGs, strategy, simulation, adventures... how about Monkey Island playable from hard disk?
#define FORCLR (*(TINY *)0xf3e9) /* foreground color */ #define BAKCLR (*(TINY *)0xf3ea) /* background color */ #define BDRCLR (*(TINY *)0xf3eb) /* border color */
From this point on, you can refer to FORCLR, BAKCLR and BDRCLR as TINY variables (TINY is an 8-bit value in MSX-C), and these variables are located in memory addresses 0xF3E9, 0XF3EA and 0xF3EB, respectively. You can read/write these variables freely.
And since they are pointers, you can iterate through memory addresses , right? This is, you can upload arrays to one adress and iterate over them. A very interesting feature.
Yes, these obey standard pointer arithmetic. In this example we have three pointers to TINY values, but they could have been pointers to, say, structs representing characters in a game, or bullets flying towards your ship...
For some msx-c examples also have a look at: https://github.com/sndpl/msx-c-intro This repo contains the source code of the second MSX-C book (green cover).
For some msx-c examples also have a look at: https://github.com/sndpl/msx-c-intro This repo contains the source code of the second MSX-C book (green cover).
Great input, thanks for the url. Let's see if a community of MSX-C programmers is created ;)
There is a way to put some part of code, and data (variables, arrays, probably not using malloc but I don't care) in a specific address like in ASM? For using pages or mappers manually is required to select the 16KB block and not split the data nor broke the code at switch. I guess so because C can make ROM.
Yes, it's easy. Just define variables to point to a memory location. For example, from the COLOR.C sample program that comes with MSX-C:
#define FORCLR (*(TINY *)0xf3e9) /* foreground color */ #define BAKCLR (*(TINY *)0xf3ea) /* background color */ #define BDRCLR (*(TINY *)0xf3eb) /* border color */
From this point on, you can refer to FORCLR, BAKCLR and BDRCLR as TINY variables (TINY is an 8-bit value in MSX-C), and these variables are located in memory addresses 0xF3E9, 0XF3EA and 0xF3EB, respectively. You can read/write these variables freely.
That's right!
Then I think only is needed to place the code in specific address, probably is in the part of the manual talking about making ROM. Using memory mappers (computers with >64KB RAM) is pretty easy to handle the 16KB block and pages so there is no problem about that point.
Please fight the babel.
The question is not only what C to use, but what C to write.
A C that every compiler is asked to translate.
Is that even more ado, no, I am actualy trying to make things easy.
But ROM, DOS, BASIC environment, one CP/M compiler vs SDCC, that alone makes six combinations of babel.
@AxelStone, you wanted to make a game, right?
maybe the "hello world" app for the MSX game coder should be this:
di(); out(0x99, 15); out (0x99,128 + 7); ei();
it makes the border color 15. getting the machine to do something, some first feedback.
based on the out() that can do the vertical roll register and blitter command engine and everything,
on every compiler.
so the first thing an MSX C should have is to make the z80 available:
void di(); void ei(); void halt(); void out(char port, char n); char in(char port); void* otir(char port, unsigned char count, void *p); /*returnvalue must be the slided pointer*/ void* otir29(char port, unsigned char count, void *p); /*for MSX1 VDP , 29 cycles*/ void* inir(char port, unsigned char count, void *p); void* inir29(char port, unsigned char count, void *p);
Let me know in case anywhere there is an in() out() that is specified different.
The otir() can be made based on out() when one has nothing else at hands.
when JaviLM has sprites based on vpoke(), when you got an out() then in 5 minutes you can get his vpoke.
"his" vpoke:
the exact function signature of vpoke() is not so clear,
e.g. how to handle the 128k vram vpoke on a 16bit 64k C.
things get easy when it is based on a compatible out().