Fusion C: 16x16 Sprites not showing on MSX1 real hardware in Screen 2

Page 1/5
| 2 | 3 | 4 | 5

By MattyT

Rookie (26)

MattyT's picture

12-11-2019, 10:43

Can anyone help with this one?
I am using Fusion C 1.2, a newbie to MSX, a veteran in C, writing a small game. It is working well in OpenMSX with the default MSX2 Philips NMS 8255.
It compiles to a com file. When I put it onto an SD card and into my MSX1 (Panasonic CF2700) with a MegaflashROM it works almost identically except my sprites aren't showing at all. I must be missing something about sprites for the MSX1.
The game is trying to use 1 single colour 16x16 sprite, shown double size, and 1 two colour (i.e. 2x) 16x16 sprites, on top of each other. No sprites seem to work.

I use static char arrays for the sprite pattern. (Drawn in the MSX Sprite Editor from Electric Adventures)
Here is the declaration for the single colour one
static const unsigned char wan_pattern0[] = {0b00000100,0b01111101,0b00010000,0b00010100,0b01111101,0b00010000,0b00010000,0b00010000};
static const unsigned char wan_pattern1[] = {0b00011100,0b01110001,0b01000011,0b00000110,0b00011000,0b00000000,0b00000000,0b000000000};
static const unsigned char wan_pattern2[] = {0b00010000,0b11110000,0b00000000,0b00001000,0b11111000,0b10010000,0b10010000,0b10010000};
static const unsigned char wan_pattern3[] = {0b10010000,0b10010010,0b00011110,0b00000000,0b00000000,0b00000000,0b00000000,0b0000000 };

I'm using Screen 2.

In my main loop I do this code:
SpriteReset();
SpriteDouble();
SetSpritePattern( 0, wan_pattern0,8 );
SetSpritePattern( 1, wan_pattern1,8 );
SetSpritePattern( 2, wan_pattern2,8 );
SetSpritePattern( 3, wan_pattern3,8 );
Sprite16();
PutSprite (0,0,120,63,15);

But the sprite doesn't display.
The code compiles to about 23Kb.
Any suggestions?

Login or register to post comments

By Wolverine_nl

Paragon (1160)

Wolverine_nl's picture

12-11-2019, 11:16

I have some other issues with the sprite functions in Fusion-C 1.20, will probably describe them lateron tonight when I am working on the project. Maybe it is a similair solution for your problem, untill now I love Fusion-C, just the unclear way sprites need to be setup, I was busy with multicolour sprites.

By Manuel

Ascended (19683)

Manuel's picture

12-11-2019, 13:33

Try it on the same hardware in emulation, may help to debug the issue.

By akumajo

Resident (43)

akumajo's picture

12-11-2019, 14:51

Manuel wrote:

Try it on the same hardware in emulation, may help to debug the issue.

(fortunately) The behavior is the same with openmsx. I tried with "-machine Panasonic_CF-2700_DE -ext msxdos2 -ext Panasonic_FS-FD1A". So the difference would come from the Fusion-C code.

I did not identify the problem, the TGS does contain the sprite form and the VDP1 register looks correct.

By MattyT

Rookie (26)

MattyT's picture

12-11-2019, 19:42

Trying under emulation for the same machine- Another MSX newbie question - I am attempting to run my code, which is compiled into the dsk directory starting up openMSX with
openMSX\openmsx.exe -machine Panasonic_CF-2700_DE -ext msxdos2 -ext Panasonic_FS-FD1A -diska dsk/
It only gets me into disk BASIC version 1.0
Is there a system call to get into Nextor?
CALL SYSTEM is giving me Illegal function call.
Or some other openMSX options to give me a MSX1 system with Nextor?

By Grauw

Ascended (10821)

Grauw's picture

12-11-2019, 19:57

MSX-DOS 2 does not support MSX1, that was a feature added in Nextor which is the evolution of DOS2.

I think the two easiest ways to get a running Nextor in openMSX are 1. by using the MegaFlashROM_SCC+_SD extension, or 2. by getting a standalone ROM file from here.

By akumajo

Resident (43)

akumajo's picture

12-11-2019, 21:20

MattyT wrote:

Trying under emulation for the same machine- Another MSX newbie question - I am attempting to run my code, which is compiled into the dsk directory starting up openMSX with
openMSX\openmsx.exe -machine Panasonic_CF-2700_DE -ext msxdos2 -ext Panasonic_FS-FD1A -diska dsk/
It only gets me into disk BASIC version 1.0
Is there a system call to get into Nextor?
CALL SYSTEM is giving me Illegal function call.
Or some other openMSX options to give me a MSX1 system with Nextor?

Use COMMAND.COM and MSXDOS.SYS files (DOS1) instead of DOS2 files and it will work*.

*launching the program, not displaying the sprites

By MattyT

Rookie (26)

MattyT's picture

13-11-2019, 06:51

Thanks. Yep I can now run as an MSX1 Panasonic CF-2000 and indeed am seeing the same problem in emulation as I am with the real hardware.
I'd suggest there is a bug in Fusion C vdp_sprites. It can be seen with the example 16x16_pixels_sprites.c provided in Fusion C 1.2 itself.
If I run that on a MSX2 Philips NMS 8255 in OpenMSX I get 4 small red shapes and a yellow hand going across the screen, (which are what is defined in the static char arrays) If I run it on the MSX1 under OpenMSX I get what looks likes character ROM, instead of the sprite. I get 2 smiley faces (one inverse) and a love heart in red, and a diamond, spade, club and dot in yellow going across the screen.
Yeah they're the first 8 characters of the international fonts - MSX fonts
I suppose I should read the Fusion C book and see who I can tell on the team who made it.

By ericb59

Paragon (1126)

ericb59's picture

13-11-2019, 07:35

Thank you for warming me about this problem.

If I understand, the sprites of your game are correctly showing, when your are testing on a MSX2, and are not showing on MSX1 ?

Which screen mode are you using ?

I think perhaps the problem comes with the sprite definition adresses inside Fusion-C.
I will check that.

By MattyT

Rookie (26)

MattyT's picture

13-11-2019, 08:06

Yep works perfectly on MSX2, and not on MSX1. Screen 2.

By akumajo

Resident (43)

akumajo's picture

13-11-2019, 14:47

On MSX1 the function "SetSpritePattern" ends by setting 'sprite pattern generator table' (VDP register #6) to 0000h instead of 3800h. It is not wanted but perhaps it is a succession of "OUT" too fast that causes the problem Question

workaround:
By adding VDPwrite(6,7); after the last SetSpritePattern, sprites will be displayed.

Page 1/5
| 2 | 3 | 4 | 5