I'm experimenting with Screen 4 for a game but I'd like to be able to change the color palette for it. Is that possible via Fusion-C or would I need to create some assembly to do it? It appears that it's possible to do it in basic via color= but I'm not having much luck finding how to do it in the manual or github source.
I do not know if you have found the solution already, but perhaps this is what you where looking for:
SetColorPalette (char ColorNumber, char Red, char Green, char Blue)
Is there anyone who has tried to program the GFX9000 with fusion-c? As I am running into some challenges when doing so, so I do have some questions:
- I try to load multiple graphics and then switch to the other graphic, I always have a garbled screen. What I do is:
I switch to the correct screen mode:
G9SetScreenMode(G9MODE_B1,G9SCR0_16BIT,G9SCR0_XIM256,0,0);
And try to load the graphics with:
G9ReadG9B(File1,buffer,BUFSIZE,0,0,255) (this is correctly visible)
G9ReadG9B(File2,buffer,BUFSIZE,0,257,255) (should go to "page 2")
Then I try to copy the content from 0,257 with a size of 256*212 to 0,0 and I only get a garbled screen. I probably am doing something wrong, but do not see what exactly
- Is there anyone who is further improving the C-library for the GFX9000, as there are a lot of unfinished remarks in the code.
The GFX9000 code included in FUSION-C Need to be tested, debugged and improved ...
I hope someone with appropriate knowledge will do it someday ...
The GFX9000 code included in FUSION-C Need to be tested, debugged and improved ...
I hope someone with appropriate knowledge will do it someday ...
I hope so too!
Hi there,
I'm using graphic instructions in screen 7, drawing a line, say, from (0,0) to (511,211)
screen(7); Line(0,0,511,211, 4,0);
it seems it only goes half screen, like (255,211)... same result as:
Line(0,0,255,211, 4,0);
I've download Fusion-C 1.2 today and still having same problem with Screen 7. Both lines and circles are way off.
Another question I have how to make printf/scanf to support float %f parameters?
When you have garbled data on screen it's often because of the mask definition with gfx 9000, could be that you have something like an interleave set of pixels on the screen, isn't it ?
If you want me to help I can have a look and eventually report corrections to Eric if the lib is in cause, but I have more the impression that a VDP register is not set correctly when you are perfoming the copy operation.
@Klimchuk
Hi,
Thank you for reporting this problem.
You will be please to know, FUSION-C 2.0 is near to come, with lot of improvements and less bugs.
Before that, I suggest you to apply some patch to your Fusion-C 1.2 to fix issues.
1- Make a saved copy of your Fusion-C 1.2 Working directory, then Go to folder fusion-c/source/lib/
2 - Delete files:
vdp_graph2plus.c
vdp_graph2.s
circlefilled.c
circle.c
3 - Download this file,
http://www.ebsoft.fr/msx/fusion-c/Fusion-C1.2-Graphic-Patch.zip
decompress it and copy files from the different folders to your Fusion-c 1.2.
4 - Open Terminal / DOS, navigate to you source/lib folder, then re-compile the library with this command line:
./build_lib.sh (on MacOS) or build_lib.bat (on Windows)
5 - Try your code
If you have problems you can contact me by email.
Regards
Good news that Fusion-C 2.0 is near to come. I look forward to it!
It's been one of the main reasons for me to learn programming for MSX.
ericb59, if I can be of any help despite my shortcomings, feel free to contact me.
@ericb59
Thank you for quick reply. I've tried to use the patch but ended up with unusable com file. Perhaps some other changes are necessary. Will wait for Fusion-C 2.0
Could you please comment on float support in Fusion-C 1.2? Is there any way to make printf/scanf work with %f parameter?
Thanks
as far as I know, SDCC is not built with float support.
But i can be enabled, by recompiling the library with float support (See SDCC Manual for that)
Also, when this is done, you must use the original printf function (the one coming with SDCC) instead of the printf function coming with Fusion-C.