Problem with MSXBIOS.H in MSX-c

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

By Jipe

Paragon (1552)

Jipe's picture

04-11-2015, 17:21

i'm not a C user but on a real MSX for making a box you must use screen 2
screen 0 ans screen 1 are text mode

By sp4

Master (214)

sp4's picture

04-11-2015, 17:31

I wrote:

#include stdio.h
#include glib.h

int main()
{
     screen(2);
     boxline(10,10,100,100,16,PSET);
     return 0;
}

but I obtained the same messages:

in  "main" calls "screen" : 1st argument conflict
in  "main" calls "boxline" : 5st argument conflict

Why this problem?

By Sylvester

Hero (563)

Sylvester's picture

04-11-2015, 19:13

try:

#include <stdio.h>
#include <glib.h>

int main()
{
  screen((TINY)2);
  ginit();
  color((TINY)15,(TINY)0,(TINY)0);
  cls();
  boxline(10,10,100,100,(TINY)6,PSET);

  getchar();
  screen((TINY)0);
  return 0;
}

By Sylvester

Hero (563)

Sylvester's picture

04-11-2015, 19:14

also read http://www.msx.org/forum/msx-talk/development/msx-c-qa-offic... it contains some nice examples.

By sp4

Master (214)

sp4's picture

04-11-2015, 20:17

It work !!
Now I want to know what number of screen() I have to put for display both the graphic objects and the words.
Do you know that ?

By anonymous

incognito ergo sum (116)

anonymous's picture

05-11-2015, 08:31

sp4 wrote:

I gift:

/*screen(0);*/
boxline(10,10,100,100,15,PSET);

and I obtained the follow messages:

in  "main" calls "boxline" : 5th argument conflict

Why this problem?

The last two parameters of boxline() are of type TINY. When you pass numeric values in MSX-C they're always passed as ints by default. Cast the value used for the fifth parameter like this:

boxline(10,10,100,100,(TINY)15,PSET);

By anonymous

incognito ergo sum (116)

anonymous's picture

05-11-2015, 08:33

sp4 wrote:

I wrote:

[...]
     screen(2);
[...]

but I obtained the same messages:

in  "main" calls "screen" : 1st argument conflict
in  "main" calls "boxline" : 5st argument conflict

Why this problem?

Here you have to cast the parameter as well:

    screen((TINY)2);

By sp4

Master (214)

sp4's picture

05-11-2015, 18:02

My code now is this:

#include 
#include 

int main()
{
        screen((TINY)2);
        ginit();
        color((TINY)15,(TINY)0,(TINY)0);
        boxline(10,10,20,20,(TINY)15,PSET);
        putspr((TINY)0,50,50,(TINY)2,(TINY)1);
        return 0;
}

When I run the xtetris.com I obtain than the sprite doesn't appair.
Why?

By Jipe

Paragon (1552)

Jipe's picture

05-11-2015, 18:30

in basic you must declare the datas off sprite
i think you have no datas

By Sylvester

Hero (563)

Sylvester's picture

05-11-2015, 18:38

It's like Jipe said, what sprite would you expect since you didn't declare one Smile

Have a look at the game examples at https://github.com/sndpl/msx-c-intro/

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