Okay, I installed Cygwin, downloaded vb_v810_gcc_03.tar.gz, unzipped the files in c:\cygwin\home\dasi\vb_v810_gcc_03, and ran ./make_v810.sh. Everything built successfully.
What do I need to do next?
dasi
Begin to code!… just kidding… you should try one of the multiples homebrewn demos from the games section and modify it’s code to understand how the VB display graphics… read the unofficial VB programmer’s manual from David Tucker’s site, and be a little patient while I release my sprite engine by the next month, which I hope will make a lot easier to develop games for the VB…
jorgeche
It’s almost done… I have a very special demo about a game I hope everyone here will get excited of.
I’m fixing some bugs right now.
jorgeche
Since I finally have access to fast enough internet, I downloaded gccVB, and right now I’m downloading and installing cygwin… Maybe I’ll actually be able to start coding for VB soon!
Okay, I’ve run into a problem. After building gccVB, I downloaded the mariofly demo source (actually, I already had it) and tried to compile it with
$ v810-gcc mariofly.c -o mario.vb
but I keep getting errors. Specifically, I got lots of parse errors, and errors about misplaced “/”s. I tried to fix the errors, but as soon as I opened the source file, I realized that I didn’t see any “/”s in the file. Help!?
P.S. I’ve also tried compiling simon, but ran into a similar problem. Any suggestions? Am I doing something wrong or is there something wrong with the input files/compiler? I’ve programmed in Visual Basic and I know a little bit of C, but I haven’t done that much with compiled languages so I’m kinda clueless. 😛
mario flying demo was written for vecc. i can’t think of any source code written for gccvb other than the demos that came with the gccvb release before that one. we really need a well documented gccvb code sample for beginners, i think i should spend some hours on that…
Thanks KR155E. I’ll try looking at the demos that came with the previous release. I really want to try writing some software for VB, the only problem is getting started. 😛
Sorry for double-posting. I don’t know if this will help, but I think I found the code that gccVB is having trouble with. I’m not familiar with this part of C syntax, so I don’t know why the code is written like this, but v810-gcc ‘s problems seem to focus around these lines:
#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;
#define WORLD_MSET(n,mx,mp,my) WAM[((n << 5) >> 1) + 4] = mx;\
WAM[((n << 5) >> 1) + 5] = mp;\
WAM[((n << 5) >> 1) + 6] = my;
#define WORLD_SIZE(n,w,h) WAM[((n << 5) >> 1) + 7] = w;\
WAM[((n << 5) >> 1) + 8] = h;
#define SET_BRIGHT(a,b,c) VIP_REGS[BRTA]=a; \
VIP_REGS[BRTB]=b; \
VIP_REGS[BRTC]=c;
GccVB doesn’t seem to recognize the backslashes (\) as correct syntax. However, I don’t know anything else about this problem. These problems are found in libgccvb.h, which is required by many VB programs. Is there any way to rewrite this code to work with gccVB? (It looks like it was made to work with gccVB, so why doesn’t it?)
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
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
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
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! 😛
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 #include 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*)chBoo, 144); // 9 * 16 bytes copymem((void*)OAMBase, (void*)objBoo, 72); // 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); } }
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.)
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.
How to install gccVB 2007/03/26
Install Cygwin with with make, gcc, flex, patch, tar, gzip, autoconf, gperf, and bison. Extract vb_v810_gcc_03.tar.gz. In the cygwin bash shell run:
./make_v810.sh
. . .
Next, download and compile crt0.s like so:
v810-as -o crt0.o crt0.s
and copy crt0.o to cygwin/usr/local/v810/lib.
Finally, get the libgccvb headers from here.
. . .
How to use gccVB with Microsoft Visual Studio / Visual C++ Express Edition
Install MSYS. In Visual C++, in Tools/Options go to Projects and Solutions/VC++ Directories, and add msys/bin and cygwin/usr/local/bin.
Start a new Makefile Project. Enter name and location. Leave ‘Create directory for solution’ unchecked. Click OK.
In the next dialog enter:
Build command line:
make -f makefile.mak build 2>&1 | sed -e ‘s/\(.[a-zA-Z]\+\):\([0-9]\+\):/\1(\2):/’
Clean command line:
make -f makefile.mak clean
- This reply was modified 16 years, 10 months ago by dasi.
- This reply was modified 16 years, 9 months ago by dasi.
- This reply was modified 16 years, 9 months ago by dasi.
- This reply was modified 16 years, 9 months ago by dasi.
- This reply was modified 16 years, 9 months ago by dasi.
- This reply was modified 16 years, 9 months ago by dasi.
- This reply was modified 16 years, 9 months ago by dasi.