MSX FUSION-C, Talking about bugs, errors, mistakes

Страница 22/24
15 | 16 | 17 | 18 | 19 | 20 | 21 | | 23 | 24

By raymond

Champion (511)

Аватар пользователя raymond

23-12-2020, 18:26

Nice! Fusion-C is getting better and better!

By ToriHino

Paladin (699)

Аватар пользователя ToriHino

23-12-2020, 19:56

ericb59 wrote:

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) ... Big smile

Don't worry Wink Waiting patiently for the coming update...

By raymond

Champion (511)

Аватар пользователя raymond

05-01-2021, 19:54

yustmenl wrote:

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?

By yustmenl

Rookie (28)

Аватар пользователя yustmenl

05-01-2021, 20:03

hope someone can help!

By aoineko

Master (148)

Аватар пользователя aoineko

06-01-2021, 01:21

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à! Smile

See https://www.msx.org/wiki/The_OR_Color for more details on how to combine colors efficiently.

By Bengalack

Champion (384)

Аватар пользователя Bengalack

30-01-2021, 12:19

Is there a way to get Fusion-C to work with newer versions of SDCC? Problem is "printf".

SDCC 4.0 is around one year old now. No new official version is released, but in the snapshots several nasty bugs have been fixed (just found another one today, which also is fixed in the snaphot-builds).

I do not have the total oveview of how this works. But, once we use fusion-C, there is one or more functions that is provided, which makes things pop up on screen. At least _putchar. This is nice. Problem now, is that this simple code:

#include 
void main(void) 
{
	printf( "Hello all, %d, %x, &s, %l", 5, 0x10, "jalla", 938393829 );
}

Being compiled using tool in "Working Folder" in "MSX_Fusion-C_V1.2", like this:

SDCC --code-loc 0x178 --data-loc 0x0 --disable-warning 196 -mz80 --no-std-crt0 --opt-code-size fusion.lib -L fusion-c\lib\ fusion-c\include\crt0_msxdos_advanced.rel test3.c

Gives these warnings:

?ASlink-Warning-Undefined Global '__uitoa' referenced by module 'printf'
?ASlink-Warning-Undefined Global '__ultoa' referenced by module 'printf'
?ASlink-Warning-Undefined Global '__itoa' referenced by module 'printf'
?ASlink-Warning-Undefined Global '__ltoa' referenced by module 'printf'

And makes code that does not work. Result is this:

A>test3
Hello all,
A>

By Bengalack

Champion (384)

Аватар пользователя Bengalack

30-01-2021, 12:56

BTW: related to the previous post. If I ignore Fusion-C, in the compiling (providing the crt0 "manually"), like this:

sdasz80 -o -s -w crt0_msx_dos.rel crt0_msx_dos.s
SDCC --code-loc 0x178 -mz80 --no-std-crt0 crt0_msx_dos.rel test3.c

There is no output at all at runtime, and no complaining during compilation. So I think there is some magic done by Fusion-C and putchar, that need some careful examination Smile

By ericb59

Paragon (1046)

Аватар пользователя ericb59

04-02-2021, 09:34

Hello,

You can use SDCC 4.0 or any new SDCC build with Fusion-C.
But you must remove from the SDCC library some of the console's function that are not compatible with MSX.
getchar, putchar, printf...
Fusion-c 's library includes compatible versions of theses function.
Please refer to the Fusion-c Quick manual, and see chapter "Customise the SDCC Default Library" to know how to remove the the incompatible functions from the default SDCC library.
This is the same process for SDCC 4.0 or any other Version. Perhaps just the folder where the default library is installed may change.

By Bengalack

Champion (384)

Аватар пользователя Bengalack

09-02-2021, 18:11

Ok, so ericb59 confirmed that there is indeed an issue with

SDCC 4.0.7 on windows and Fusion-C

For some reason Eric gets it to work on Mac. So, if anyone has the snapshot build (4.0.7 nowadays) working with "plain printf" on WINDOWS, please let us know. http://sdcc.sourceforge.net/snap.php

There are at least 3-4 bugs in 4.0 which I bump into in my current build, that are fixed in the newer versions. Such bug-search/handling takes a lot of time, and introduces crappy workarounds. Can't wait to use the new versions, as the code size is smaller too. Which is very welcome.

By aoineko

Master (148)

Аватар пользователя aoineko

09-02-2021, 20:15

In the SDCC 4.0.7 manual (http://sdcc.sourceforge.net/doc/sdccman.pdf) there is this change log:

Quote:

• In 4.0.3, _itoa, _uitoa, _ltoa, _ultoa were renamed to __itoa, __uitoa, __ltoa, __ultoa

So I suppose you just have to rename those functions wherever they are used.

Страница 22/24
15 | 16 | 17 | 18 | 19 | 20 | 21 | | 23 | 24