You are not logged in.
Lost Password?


Register To Post



 Bottom   Previous Topic   Next Topic

#11
Re: gccVB, getting started . . .
Posted on: 2008/1/1 8:56
PVB Elite
Joined 2003/7/25
USA
1507 Posts
PVBCC 1stCoderContributor#3 PosterHOTY09 EntryLong Time User (15 Years) App CoderPVBCC 2010 EntryPVBCC 2013 Entry
Yeah, the newest gccVB doesn't seem to like the common libgccvb.h because of those backslashes (they're used to continue the current line with what's on the next line). To fix it, just get rid of the backslashes and put the line below the \ on the same line as the #define (like: #define WORLD_GSET(n,gx,gp,gy) WAM[((n << 5) >> 1) + 1] = gx; WAM[((n << 5) >> 1) + 2] = gp; WAM[((n << 5) >> 1) + 3] = gy; ).

I'm sure there's a flag you can set to allow \'s, just like some compilers allow //'s for commenting a line, and others require /* */... never really looked into it though, so not sure what it is.

DogP
Top

#12
Re: gccVB, getting started . . .
Posted on: 2008/1/2 16:31
Nintendoid!
Joined 2006/3/15
Ecuador
234 Posts
PVBCC 3rdCoderLong Time User (13 Years)
The problem are the \ at the end of each statement, this is used in some (earlier? I don't remember well) implementations of C (ansi?) to concatenate various lines of code to get better code visibility. To solve that problem, just remove the \ character and put all the statement in a single line:

#define WORLD_GSET(n,gx,gp,gy) WAM[((n << 5) >> 1) + 1] = gx;WAM[((n << 5) >> 1) + 2] = gp;WAM[((n << 5) >> 1) + 3] = gy;

(all of the above is a single line of code)

instead of

#define WORLD_GSET(n,gx,gp,gy) WAM[((n << 5) >> 1) + 1] = gx;\
WAM[((n << 5) >> 1) + 2] = gp;\
WAM[((n << 5) >> 1) + 3] = gy;

Hope this helps

Jorgeche
Top

#13
Re: gccVB, getting started . . .
Posted on: 2008/1/2 16:33
Nintendoid!
Joined 2006/3/15
Ecuador
234 Posts
PVBCC 3rdCoderLong Time User (13 Years)
Ups, I didn't saw your post DogP.
Top

#14
Re: gccVB, getting started . . .
Posted on: 2008/1/21 21:11
Nintendoid!
Joined 2007/8/8
Great Britain
201 Posts
CoderContributorHOTY09 EntryLong Time User (12 Years) App Coder
Okay, using the old gccVB I've compiled a very simple program that displays a few characters on actual hardware. Woo!

However, when I compile exactly the same program with the new gccVB, the chars aren't displayed (but it does still work on an emu). Any ideas?

dasi
Top

#15
Re: gccVB, getting started . . .
Posted on: 2008/1/25 22:51
Nintendoid!
Joined 2007/8/8
Great Britain
201 Posts
CoderContributorHOTY09 EntryLong Time User (12 Years) App Coder
Hmm. Okay, I got it working.
Top

#16
Re: gccVB, getting started . . .
Posted on: 2008/2/20 3:16
VUE(xpert)
Joined 2006/9/29
USA
267 Posts
CoderLong Time User (13 Years) PVBCC 2010 3rd
Hey dasi, could you post your source code? Every time I try to compile an example, I keep getting loads of errors (even after I think I've fixed them all) and I want some code that I know will compile the right way. That way I can start figuring out how to program with a code example that actually works!
Top

#17
Re: gccVB, getting started . . .
Posted on: 2008/2/21 16:15
Nintendoid!
Joined 2007/8/8
Great Britain
201 Posts
CoderContributorHOTY09 EntryLong Time User (12 Years) App Coder
Hi Fwirt, try this. The libgccvb headers I'm using are in here. The program uses objects to display an image made up of 9 characters.



#include <include/video.h>
#include <include/mem.h>
#include <include/world.h>

const BYTE chBoo[] = {
    
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,
    
0x00,0x90,0x00,0xe4,0x00,0xa4,0x00,0xb9,    /*Char0*/
    
0x00,0x00,0x00,0x00,0x54,0x15,0xa9,0x6a,
    
0xff,0xff,0xff,0xff,0x7d,0xea,0x69,0xfa,    /*Char1*/
    
0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,
    
0x16,0x00,0x6f,0x00,0xbf,0x01,0xbf,0x01,    /*Char2*/
    
0x00,0xfd,0x40,0xfe,0x40,0xe6,0x40,0xb6,
    
0x7e,0x76,0x79,0x5a,0x54,0x5e,0x40,0x6e,    /*Char3*/
    
0x7d,0xff,0xff,0xef,0xff,0xdb,0x55,0xdb,
    
0x55,0xd7,0x55,0xe5,0xa5,0xf6,0xa9,0xf9,    /*Char4*/
    
0xff,0x06,0xff,0x06,0xff,0x06,0xaf,0x06,
    
0xff,0xbf,0xff,0x6f,0xff,0x16,0xab,0x05,    /*Char5*/
    
0x00,0x7d,0x00,0xb9,0x00,0xf4,0x00,0xe4,
    
0x00,0x90,0x00,0x40,0x00,0x00,0x00,0x00,    /*Char6*/
    
0xa9,0xfd,0x55,0xfe,0xab,0xff,0xff,0xff,
    
0xfe,0xaf,0xa9,0xaa,0x54,0x55,0x00,0x00,    /*Char7*/
    
0xaf,0x15,0xaf,0x7e,0xab,0x6e,0xaa,0x16,
    
0x6a,0x01,0x15,0x00,0x00,0x00,0x00,0x00,    /*Char8*/
};

const 
HWORD objBoo[] = {
    
144,0xC000,108,0,
    
152,0xC000,108,1,
    
160,0xC000,108,2,
    
144,0xC000,116,3,
    
152,0xC000,116,4,
    
160,0xC000,116,5,
    
144,0xC000,124,6,
    
152,0xC000,124,7,
    
160,0xC000,124,8
};


int main()
{
    
WA[31].head WRLD_ON WRLD_OBJ;

    
WA[30].head WRLD_END;

    
copymem((void*)CharSeg0, (void*)chBoo144); // 9 * 16 bytes

    
copymem((void*)OAMBase, (void*)objBoo72); // 9 * 8 bytes

    
VIP_REGS[SPT3] = 8;
    
VIP_REGS[SPT2] = -1;
    
VIP_REGS[SPT1] = -1;
    
VIP_REGS[SPT0] = -1;

    
vbDisplayOn();

    
vbDisplayShow();

    while(
1)
    {

        
vbWaitFrame(1);    
    }
}
Edited by dasi on 2008/2/21 17:33
Edited by dasi on 2008/2/21 17:36
Edited by dasi on 2008/2/21 17:58
Top

#18
Re: gccVB, getting started . . .
Posted on: 2008/2/22 5:22
VUE(xpert)
Joined 2006/9/29
USA
267 Posts
CoderLong Time User (13 Years) PVBCC 2010 3rd
There must be a problem with the compiler because I'm still getting errors. That's really annoying. I wonder what's going wrong... Oh well, I'll just keep being a VB fan, even if I can't write software for it (yet.)
Top

#19
Re: gccVB, getting started . . .
Posted on: 2008/2/22 8:33
Nintendoid!
Joined 2007/8/8
Great Britain
201 Posts
CoderContributorHOTY09 EntryLong Time User (12 Years) App Coder
What errors are you getting?
Top

#20
Re: gccVB, getting started . . .
Posted on: 2008/2/22 11:20
Administrator
Joined 2000/1/8
Germany
2515 Posts
Highscore Top10Highscore Top ScoreCoder#1 PosterHOTY09 1stLong Time User (15 Years) App Coder90+ Game Ratings
Quote:

Fwirt schrieb:
There must be a problem with the compiler because I'm still getting errors. That's really annoying. I wonder what's going wrong... Oh well, I'll just keep being a VB fan, even if I can't write software for it (yet.)


before giving up, better give an older version a try, like the second gccvb release. it is much easier to set up.
Top

 Top   Previous Topic   Next Topic


Register To Post