Hello,
I was looking to build the Mario VB 3.0.1 source to the game, since I can’t find that version anywhere. I have been able to find 3.0.0 game.
I have downloaded and installed cygwin, and downloaded the latest gccVB 2.95 Pre-compiled version. But I am lost as what to do next?
Do I copy the contents of the gccVB into the cygwin folder? Where do I place the source code for Mario VB 3.0.1 then?
and from cygwin do I just do a makefile that is with the Mario VB?
I am familiar with C and C++ but haven’t coded anything recently. Although I am looking to jump back into it.
Thanks!
When I create a makefile with:
all: v810-gcc -T /usr/local/v810/lib/vb.ld -O -I. demo.c -o demo.elf v810-objcopy -O binary demo.elf demo.vb
I get the following error when I try to compile demo.c:
“makefile:2: *** missing separator. Stop.”
Any ideas?
Also, what happened to the “snowball wars” source? The link from the VBJAengine page just redirects to the technical demo page.
Vaughanabe13 wrote:
When I create a makefile with:all: v810-gcc -T /usr/local/v810/lib/vb.ld -O -I. demo.c -o demo.elf v810-objcopy -O binary demo.elf demo.vbI get the following error when I try to compile demo.c:
“makefile:2: *** missing separator. Stop.”Any ideas?
Makefiles are sensitive to indentation. It has to be:
all: <-tab->v810-gcc -T /usr/local/v810/lib/vb.ld -O -I. demo.c -o demo.elf <-tab->v810-objcopy -O binary demo.elf demo.vb
Also, this is such an overly simplified makefile, you may as well just go with a shell script…
Try this one instead:
http://www.planetvb.com/modules/newbb/viewtopic.php?post_id=5825#forumpost5825
It even handles #include’ed files automatically.
One year ago, I did a bit of work on the Mario VB code. Basically fixed all the sprites, added some new ones, remodeled the demo level and added Goombas. I was experimenting with several things like text boxes or screen transitions, but did not get those done – found it quite hard to fully understand how to use the engine.
I stopped working when I noticed that back layers are not scrolling smoothly. Told Jorge about the flawed calculation and he said there was not a simple solution. Instead he wanted to rewrite the entire engine since I also gave him a lot of other input. Unfortunately, it has been quiet since then.
Attached is my last version from May ’09, it also includes a compiled version in the output folder if you just want to have a quick look.
ok, thanks for the help. I’m still seeing an error when I try to build jorgeache’s 3.0.1 build, but when I try KRE115E’s it works just fine.
RunnerPack wrote:
Vaughanabe13 wrote:
When I create a makefile with:all: v810-gcc -T /usr/local/v810/lib/vb.ld -O -I. demo.c -o demo.elf v810-objcopy -O binary demo.elf demo.vbI get the following error when I try to compile demo.c:
“makefile:2: *** missing separator. Stop.”Any ideas?
Makefiles are sensitive to indentation. It has to be:
all: <-tab->v810-gcc -T /usr/local/v810/lib/vb.ld -O -I. demo.c -o demo.elf <-tab->v810-objcopy -O binary demo.elf demo.vbAlso, this is such an overly simplified makefile, you may as well just go with a shell script…
Try this one instead:
http://www.planetvb.com/modules/newbb/viewtopic.php?post_id=5825#forumpost5825
It even handles #include’ed files automatically.
Sweet, thanks!
Vaughanabe13 wrote:
Sweet, thanks!
Just fulfilling my duties as “Search Engine Liaison” 😛 😉
The script is not working. It’s giving me a ton of errors in the “libgccvb.h” file. Most of the warnings/errors are something involving “WAM”
What kind of directory structure should I use with this makefile? I feel like I don’t have my folder set up right. Right now I just have all the .h and .c files in a folder called “source”
Vaughanabe13 wrote:
The script is not working. It’s giving me a ton of errors in the “libgccvb.h” file. Most of the warnings/errors are something involving “WAM”
That’s not the fault of the makefile. You probably just got some code that’s made for a different version of libgccvb. In some versions, the world attributes are accessed with macros, and in the newer one(s), they’re accessed with an array of structs.
For one of (if not the) latest libgccvb’s, I would get the code for one of the 2008 compo entries (MK Virtual Circuit is a good choice, but try as many as you can; they might each have something you want to use).
Also, (and this goes for everyone!) always post actual error messages whenever possible. It makes it much easier to help.
What kind of directory structure should I use with this makefile? I feel like I don’t have my folder set up right. Right now I just have all the .h and .c files in a folder called “source”
That’s (almost) entirely up to you. The makefile (tries to) compile every .C file in the folder from which it’s run, but those C files can #include files from anywhere. You can even add an include search path at the proper place in the makefile and use #include’s
I haven’t worked with makefiles long enough to know all the tricks like importing other makefiles and compiling in multiple directories, but feel free to “upgrade” the makefile and post your changes! 😀
The reason I didn’t post the errors was because A)There were a ton of them and B) I couldn’t copy/paste text from cygwin and I was too lazy to figure out a way around that or to type it out manually.
No, that makefile won’t be able to find source .c files unless they are in one of the directories mentioned in the makefile (or you have to add another one). I just don’t understand why the makefile tries to create a directory tree at the end. It always creates a folder called “.make-devel” or something like that. I’m not sure if that’s supposed to be a backup, since it would be a hidden directory in linux, but in Windows obviously it shows up, and therefore it’s annoying.
I didn’t know there were multiple versions of libgccvb.h. That must be the problem then.
Vaughanabe13 wrote:
The reason I didn’t post the errors was because A)There were a ton of them and B) I couldn’t copy/paste text from cygwin and I was too lazy to figure out a way around that or to type it out manually.
Weird… I’ve never had a problem copying out of cygwin. In fact, whenever I select something, it gets copied automatically. Are you running XP, Vista, 7? Maybe you need to tweak the properties of the shell window. Mine has “QuickEdit Mode” and “Insert Mode” both checked.
No, that makefile won’t be able to find source .c files unless they are in one of the directories mentioned in the makefile (or you have to add another one).
Yeah, that’s kinda what I said 😛
I just don’t understand why the makefile tries to create a directory tree at the end. It always creates a folder called “.make-devel” or something like that. I’m not sure if that’s supposed to be a backup, since it would be a hidden directory in linux, but in Windows obviously it shows up, and therefore it’s annoying.
That’s where it puts the compiled object files, instead of cluttering up the source directory (which I find more annoying than one extra dotted directory, but to each his own). You should be able to change that easily enough. You could also make it hidden in Explorer (unless you’ve set it to show hidden files, like I have ;-)) You could even make the final elf and vb binaries end up in the source dir, or anywhere else for that matter.
As mentioned in the other thread, the makefile is a little generic right now. I didn’t come up with it, but it serves my present needs, so I haven’t seen the need to modify it much (although I have tweaked my copy a bit…)
I didn’t know there were multiple versions of libgccvb.h. That must be the problem then.
Yep, it’s been one of the major stumbling blocks for beginning VB programmers. I’m definitely going to focus on solving that after this compo ends and before the next one starts 😉
RunnerPack wrote:
Vaughanabe13 wrote:
The reason I didn’t post the errors was because A)There were a ton of them and B) I couldn’t copy/paste text from cygwin and I was too lazy to figure out a way around that or to type it out manually.Weird… I’ve never had a problem copying out of cygwin. In fact, whenever I select something, it gets copied automatically. Are you running XP, Vista, 7? Maybe you need to tweak the properties of the shell window. Mine has “QuickEdit Mode” and “Insert Mode” both checked.
I enabled QuickEdit and now I can at least select text (before I couldn’t select anything with my mouse). It doesn’t copy automatically and the shortcut keys don’t work either, but I just figured out I can use the right click menu of the shell to copy. So here is the long error I’m getting:
Creating object file for source/demo…
In file included from source/demo.c:81:
source/libgccvb.h:131: `n’ undeclared here (not in a function)
source/libgccvb.h:131: warning: type defaults to `int’ in declaration of `WAM’
source/libgccvb.h:131: size of array `WAM’ has non-integer type
source/libgccvb.h:131: conflicting types for `WAM’
source/libgccvb.h:42: previous declaration of `WAM’
source/libgccvb.h:131: `gp’ undeclared here (not in a function)
source/libgccvb.h:131: warning: data definition has no type or storage class
source/libgccvb.h:131: stray ‘\’ in program
source/libgccvb.h:132: `n’ undeclared here (not in a function)
source/libgccvb.h:132: warning: type defaults to `int’ in declaration of `WAM’
source/libgccvb.h:132: size of array `WAM’ has non-integer type
source/libgccvb.h:132: redefinition of `WAM’
source/libgccvb.h:131: `WAM’ previously defined here
source/libgccvb.h:132: `gy’ undeclared here (not in a function)
source/libgccvb.h:132: warning: data definition has no type or storage class
source/libgccvb.h:134: `n’ undeclared here (not in a function)
source/libgccvb.h:134: warning: type defaults to `int’ in declaration of `WAM’
source/libgccvb.h:134: size of array `WAM’ has non-integer type
source/libgccvb.h:134: redefinition of `WAM’
source/libgccvb.h:132: `WAM’ previously defined here
source/libgccvb.h:134: `mp’ undeclared here (not in a function)
source/libgccvb.h:134: warning: data definition has no type or storage class
source/libgccvb.h:134: stray ‘\’ in program
source/libgccvb.h:135: `n’ undeclared here (not in a function)
source/libgccvb.h:135: warning: type defaults to `int’ in declaration of `WAM’
source/libgccvb.h:135: size of array `WAM’ has non-integer type
source/libgccvb.h:135: redefinition of `WAM’
source/libgccvb.h:134: `WAM’ previously defined here
source/libgccvb.h:135: `my’ undeclared here (not in a function)
source/libgccvb.h:135: warning: data definition has no type or storage class
source/libgccvb.h:137: `n’ undeclared here (not in a function)
source/libgccvb.h:137: warning: type defaults to `int’ in declaration of `WAM’
source/libgccvb.h:137: size of array `WAM’ has non-integer type
source/libgccvb.h:137: redefinition of `WAM’
source/libgccvb.h:135: `WAM’ previously defined here
source/libgccvb.h:137: `h’ undeclared here (not in a function)
source/libgccvb.h:137: warning: data definition has no type or storage class
source/libgccvb.h:352: warning: type defaults to `int’ in declaration of `VIP_RE
GS’
source/libgccvb.h:352: conflicting types for `VIP_REGS’
source/libgccvb.h:40: previous declaration of `VIP_REGS’
source/libgccvb.h:352: `b’ undeclared here (not in a function)
source/libgccvb.h:352: warning: data definition has no type or storage class
source/libgccvb.h:352: stray ‘\’ in program
source/libgccvb.h:353: warning: type defaults to `int’ in declaration of `VIP_RE
GS’
source/libgccvb.h:353: conflicting types for `VIP_REGS’
source/libgccvb.h:352: previous declaration of `VIP_REGS’
source/libgccvb.h:353: `c’ undeclared here (not in a function)
source/libgccvb.h:353: warning: data definition has no type or storage class
make: *** [.make-devel/source/demo.o] Error 1
So what’s the [abbreviated] story of the multiple versions of libgccvb.h? Is the code for the demo.c program making some calls that are no longer acceptable? Basically all I’m trying to do is get a demo program to compile so I can mess around with it. I figured the demo.c program was a good one since it’s so simple, but I can’t even get that working, and I have no clue which version of libgccvb.h I need. I’m just using the one that was included with the demo.c zip.
Ohhhhh… Those errors are from the change in compiler version. It seems the new version (3.x and/or 4.x) doesn’t like lines in #defines being wrapped by adding a backslash at the end. Just remove the backslashes and extra whitespace and put the contents of each #define on a single line.
The short version of the libgccvb.h story is as follows:
A formal committee was never convened to make a standard, so all the code that was discovered, developed, etc. early on was traded between various VB hackers until it was eventually decided to “slap something together” and distribute it with the (then, “state-of-the-art”) GCC 2.95-based compiler/tools (which started life as an NEC PCFX compiler, BTW).
However, since there was no central repository (until PlanetVB, but even then, there was no impetus to keep it updated), as more and more was discovered/developed, each hacker tended to cobble together his own version of the “library”, which he would then have to distribute along with anything he shared, since it wouldn’t compile with the “standard” file. Most of the files are very similar, but there have been a few major changes/additions (like the aforementioned WAM/WA change).
The End 😉
There have been many attempts to start another, more standardized library (and keep it up to date this time… for real!), but so far, nothing has materialized…
In addition to the libgccvb.h story, there is also a “crt0.o” story, but it’s much shorter and only really interesting to history buffs (like the Bound High Civil War Reenactment Society), so don’t worry about it 😉
- This reply was modified 14 years, 2 months ago by RunnerPack.
RunnerPack wrote:
Ohhhhh… Those errors are from the change in compiler version. It seems the new version (3.x and/or 4.x) doesn’t like lines in #defines being wrapped by adding a backslash at the end. Just remove the backslashes and extra whitespace and put the contents of each #define on a single line.
Got it, I fixed those problems. Now a new problem:
“Creating object file for source/demo…
Linking demo.
/usr/local/v810/bin/ld: cannot open linker script file lib/vb.ld: No such file o
r directory
collect2: ld returned 1 exit status
make: *** [output/main.elf] Error 1”
I verified that the vb.ld file is not in that directory or anywhere on my hard drive. There is a “ld.exe” file though…
I just realized I don’t have one, either. I’m using (and suggest you use) dasi’s build of the 2.95 version. I think it has the linker script built-in.
Besides this new issue, there’s also some problem with (one of?) the newer versions generating inefficient function calling code. BTW, what version are you using? (v810-gcc –version)
Newer isn’t always better! 😀
I’m using version 2.95.2 because that’s what you guys told me to use. Where is Dasi’s version then?
Vaughanabe13 wrote:
I’m using version 2.95.2 because that’s what you guys told me to use. Where is Dasi’s version then?
If it’s not the latest one available from http://gccvb.planetvb.com/ I don’t know where to find it. I just remember trying to compile 2.95 from source using cygwin (which then was using GCC 3.4, or something, I think) and it didn’t work, and I got a pre-compiled version somewhere (directly from dasi?) that I just had to extract to my C:\cygwin\usr folder.
Try leaving off the entire “-T” switch from the gcc command.
My ld.exe (aka v810-ld.exe) has a CRC32 of 22d5469c.
(v810-)gcc.exe’s is ce056a7b.
(If you don’t have a crc/hash generator, I suggest: http://beeblebrox.org/hashtab/)
Confirming that “2.95 (Precompiled NVC Version)” on http://gccvb.planetvb.com/ is Dasi’s.
KR155E wrote:
Confirming that “2.95 (Precompiled NVC Version)” on http://gccvb.planetvb.com/ is Dasi’s.
I can’t figure out what’s going on with the linker script, and I guess now I can’t even compile MarioVB anymore, so I have no clue what the problem is and what I screwed up between now and a few days ago.
Vaughn, I never could compile MarioVB 3.0.1 either, when I used the 3.0.0 source I was able to built it just fine. Then KR155E shared his version of MarioVB which also compiled just fine.