Nice! Fusion-C is getting better and better!
Hello all,
I know I know I have been promising Fusion-c version 1.3 for months now.
To forgive me, I want to tell you that the next version will now be able to compile ROMs (Firstly 32k and 48K) ...
Don't worry Waiting patiently for the coming update...
I finaly got a sprite on screen after some time outs in coding.
but is it possible in fusion c to use OR with sprites to get multi collored sprites?
I would like to know as well, did you receive an answer?
hope someone can help!
This is not specific to Fusion-C, but if you know the address of your Sprite Attribute Table, it's very easy to use OR color with any VRAM write functions.
For your first sprite (number N), you need to copy 8 or 16 bytes of color (depending on the size of your sprite) to the address: SprtiteAttributeTable - 0x200 + 16 * N
. One byte per sprite line. Color is a 4-bits palette index (0 to 15) stored in a byte.
The value -0x200
corresponds to the address offset of the Sprite Color Table in VRAM from the Sprite Attribute Table (this is a constant value for the Sprite Mode 2 of the MSX2).
For your second sprite (number M, with M > N), you must also copy 8 or 16 bytes of color to the address: SprtiteAttributeTable - 0x200 + 16 * M
.
But this time, the color will be 0x40 + your 4-bit color palette index. The 0x40 (CC flag) indicates that you are using OR.
Place your two sprites at the same place... and voilà!
See https://www.msx.org/wiki/The_OR_Color for more details on how to combine colors efficiently.