Original Post

As I’ve been hastily working on my competition entry the last few days, I’ve realized with some shame that I’ve had quite a lot of fun with all the resources available on this site, but I’ve never given anything back… So I was looking at the folder with all my VB coding stuff in it, and I realized that I have a bunch of simple demos that I wrote earlier this summer to help me relearn VB programming. With the number of new faces that seem to be appearing on this site and wondering how to start programming for Virtual Boy, I thought that someone might be able to put them to good use. There’s six in all, and they cover the “Hello World” calibration screen demo, animation, objects, bgmaps, and timer interrupts. Nothing groundbreaking, but I tried to comment them pretty well, so hopefully people who are wondering how to get started with VB programming will find them useful.

(And the forum isn’t letting me upload files again, so I had to host them on MediaFire... If someone else can attach them that would be great.)

  • This topic was modified 14 years ago by KR155E.
12 Replies

Cool, thanks!

If I get time to work on my project, this will help a lot. I only did very little VB programming, and that was a year ago probably, so this should help me get back into it quick. I am especially happy to see the timer demo, I have been meaning to look into timer interrupts for a while.

– Matt

This will definitely help me, thanks!

Great, those will definitely be worth some news coverage when I get home from the doctor later today.

For some reason the forum seems to have a problem with tar.gz files, so I repacked your demos in a rar file and attached them to your post.

ohh thanks! I’m starting to program for VB and will be of great help (soon I shall ask many questions, ejejeje)

(algún español que se anime a echarme una mano en la programación?, a mi lo que se me da bien realmente son los gráficos, gracias)

how do you open the demos
I tried to rename the makefile and the c file to .vb but no look
maybe you need a program to add the cod before viewing it?

akumie wrote:
how do you open the demos
I tried to rename the makefile and the c file to .vb but no look
maybe you need a program to add the cod before viewing it?

to operate in virtual boy need to be compiled with gccvb. The real value of the demos are to start in programming in virtual boy.

Sorry for my english!

akumie wrote:
how do you open the demos
I tried to rename the makefile and the c file to .vb but no look
maybe you need a program to add the cod before viewing it?

What’s your programming background, akumie? It sounds like you haven’t compiled any C before. If you’ve never done any programming, I don’t think that my demos are the best place to start… With that being said, to view the code you can open it in any text editor. (I use vim on Linux, Wordpad on Windows will do.) To run it in an emulator is an entirely different thing. You’ll need to get gccvb, then open a terminal, navigate to the folder of the demo you want and type “make” (Assuming you have make available to you, it’s available on Unix-like operating systems, or if you have Mingw/MSYS installed on Windows.) That will compile it into a .vb file which can then be run in mednafen or Reality Boy. (All of these demos were compiled using gccvb4, and tested in mednafen.)

I’m glad there’s been such a positive response! Let me know if anyone runs into problems with my code…

Thanks a lot! 🙂

Those demos help a lot

Salure wrote:
Thanks a lot! 🙂

Those demos help a lot

Tambien estas desarrollando algo?? creia que era el unico español que se animaba,jejeje!!

you also are developing something? thought it was the only Spanish that is encouraged, jejeje!!

Fwirt,

I want to thank you for posting some easy to read demos. I want to try my hand at making a game for the VB, or helping to make one.

I’m running an IBM Thinkpad 600E with Windows 2000 Professional. I went through the steps to set up the compiler (cygwin with the specified packages) and then copied the GCC into the /usr/local/ directory. I also made sure to copy the crt0.s file into the specified directory.

It should be noted that when I tried to manually compile the GCC from source, it exited with errors. I wasn’t sure how to proceed so I went ahead hoping for the best. I tried to run it again but there were a million files that I had to hit ‘y’ to so I gave up. Is it possible to clean out the build results without having to reinstall the packages?

The demos.rar was unzipped into my home directory and I made no modifications to that. The includes to the library seem to be pointing to the right relative path. I’ll try Fedora Core on another machine later.

I tried compiling the first demo ala make and the following errors come up.

v810-gcc -Wall -nodefaultlibs -mv810 -xc -o demo1.o demo1.c
In file included from ../libgccvb/affine.h:12,
from ../libgccvb/libgccvb.h:21,
from demo1.c:2:
../libgccvb/video.h:51: warning: `/*’ within comment
In file included from ../libgccvb/affine.h:12,
from ../libgccvb/libgccvb.h:21,
from demo1.c:2:
../libgccvb/video.h:31: warning: type defaults to `int’ in declaration of `VIP_R
EGS’
../libgccvb/video.h:31: conflicting types for `VIP_REGS’
../libgccvb/vip.h:37: previous declaration of `VIP_REGS’
../libgccvb/video.h:31: `b’ undeclared here (not in a function)
../libgccvb/video.h:31: warning: data definition has no type or storage class
../libgccvb/video.h:31: stray ‘\’ in program
../libgccvb/video.h:32: warning: type defaults to `int’ in declaration of `VIP_R
EGS’
../libgccvb/video.h:32: conflicting types for `VIP_REGS’
../libgccvb/video.h:31: previous declaration of `VIP_REGS’
../libgccvb/video.h:32: `c’ undeclared here (not in a function)
../libgccvb/video.h:53: parse error before `void’
../libgccvb/video.h: In function `vbFXFadeIn’:
../libgccvb/video.h:113: warning: implicit declaration of function `vbWaitFrame’

../libgccvb/video.h:114: stray ‘\’ in program
../libgccvb/video.h:114: stray ‘\’ in program
../libgccvb/video.h: In function `vbFXFadeOut’:
../libgccvb/video.h:123: stray ‘\’ in program
In file included from ../libgccvb/libgccvb.h:34,
from demo1.c:2:
../libgccvb/world.h: At top level:
../libgccvb/world.h:54: `n’ undeclared here (not in a function)
../libgccvb/world.h:54: warning: type defaults to `int’ in declaration of `WAM’
../libgccvb/world.h:54: size of array `WAM’ has non-integer type
../libgccvb/world.h:54: conflicting types for `WAM’
../libgccvb/video.h:22: previous declaration of `WAM’
../libgccvb/world.h:54: `gp’ undeclared here (not in a function)
../libgccvb/world.h:54: warning: data definition has no type or storage class
../libgccvb/world.h:54: stray ‘\’ in program
../libgccvb/world.h:55: `n’ undeclared here (not in a function)
../libgccvb/world.h:55: warning: type defaults to `int’ in declaration of `WAM’
../libgccvb/world.h:55: size of array `WAM’ has non-integer type
../libgccvb/world.h:55: redefinition of `WAM’
../libgccvb/world.h:54: `WAM’ previously defined here
../libgccvb/world.h:57: `gy’ undeclared here (not in a function)
../libgccvb/world.h:57: parse error before `WAM’
../libgccvb/world.h:57: stray ‘\’ in program
../libgccvb/world.h:58: `n’ undeclared here (not in a function)
../libgccvb/world.h:58: warning: type defaults to `int’ in declaration of `WAM’
../libgccvb/world.h:58: size of array `WAM’ has non-integer type
../libgccvb/world.h:58: redefinition of `WAM’
../libgccvb/world.h:55: `WAM’ previously defined here
../libgccvb/world.h:60: `my’ undeclared here (not in a function)
../libgccvb/world.h:60: parse error before `WAM’
../libgccvb/world.h:70: `tmp’ undeclared here (not in a function)
../libgccvb/world.h:70: warning: type defaults to `int’ in declaration of `WAM’
../libgccvb/world.h:70: variable `WAM’ has initializer but incomplete type
../libgccvb/world.h:70: conflicting types for `WAM’
../libgccvb/world.h:58: previous declaration of `WAM’
../libgccvb/world.h:70: `header’ undeclared here (not in a function)
../libgccvb/world.h:70: warning: data definition has no type or storage class
../libgccvb/world.h:71: `tmp’ undeclared here (not in a function)
../libgccvb/world.h:71: warning: type defaults to `int’ in declaration of `WAM’
../libgccvb/world.h:71: variable `WAM’ has initializer but incomplete type
../libgccvb/world.h:71: conflicting types for `WAM’
../libgccvb/world.h:70: previous declaration of `WAM’
../libgccvb/world.h:71: `gx’ undeclared here (not in a function)
../libgccvb/world.h:71: warning: data definition has no type or storage class
../libgccvb/world.h:72: `tmp’ undeclared here (not in a function)
../libgccvb/world.h:72: warning: type defaults to `int’ in declaration of `WAM’
../libgccvb/world.h:72: variable `WAM’ has initializer but incomplete type
../libgccvb/world.h:72: conflicting types for `WAM’
../libgccvb/world.h:71: previous declaration of `WAM’
../libgccvb/world.h:72: `gp’ undeclared here (not in a function)
../libgccvb/world.h:72: warning: data definition has no type or storage class
../libgccvb/world.h:73: `tmp’ undeclared here (not in a function)
../libgccvb/world.h:73: warning: type defaults to `int’ in declaration of `WAM’
../libgccvb/world.h:73: variable `WAM’ has initializer but incomplete type
../libgccvb/world.h:73: conflicting types for `WAM’
../libgccvb/world.h:72: previous declaration of `WAM’
../libgccvb/world.h:73: `gy’ undeclared here (not in a function)
../libgccvb/world.h:73: warning: data definition has no type or storage class
../libgccvb/world.h:74: `tmp’ undeclared here (not in a function)
../libgccvb/world.h:74: warning: type defaults to `int’ in declaration of `WAM’
../libgccvb/world.h:74: variable `WAM’ has initializer but incomplete type
../libgccvb/world.h:74: conflicting types for `WAM’
../libgccvb/world.h:73: previous declaration of `WAM’
../libgccvb/world.h:74: `mx’ undeclared here (not in a function)
../libgccvb/world.h:74: warning: data definition has no type or storage class
../libgccvb/world.h:75: `tmp’ undeclared here (not in a function)
../libgccvb/world.h:75: warning: type defaults to `int’ in declaration of `WAM’
../libgccvb/world.h:75: variable `WAM’ has initializer but incomplete type
../libgccvb/world.h:75: conflicting types for `WAM’
../libgccvb/world.h:74: previous declaration of `WAM’
../libgccvb/world.h:75: `mp’ undeclared here (not in a function)
../libgccvb/world.h:75: warning: data definition has no type or storage class
../libgccvb/world.h:76: `tmp’ undeclared here (not in a function)
../libgccvb/world.h:76: warning: type defaults to `int’ in declaration of `WAM’
../libgccvb/world.h:76: variable `WAM’ has initializer but incomplete type
../libgccvb/world.h:76: conflicting types for `WAM’
../libgccvb/world.h:75: previous declaration of `WAM’
../libgccvb/world.h:76: `my’ undeclared here (not in a function)
../libgccvb/world.h:76: warning: data definition has no type or storage class
../libgccvb/world.h:77: `tmp’ undeclared here (not in a function)
../libgccvb/world.h:77: warning: type defaults to `int’ in declaration of `WAM’
../libgccvb/world.h:77: variable `WAM’ has initializer but incomplete type
../libgccvb/world.h:77: conflicting types for `WAM’
../libgccvb/world.h:76: previous declaration of `WAM’
../libgccvb/world.h:77: `width’ undeclared here (not in a function)
../libgccvb/world.h:77: warning: data definition has no type or storage class
../libgccvb/world.h:78: `tmp’ undeclared here (not in a function)
../libgccvb/world.h:78: warning: type defaults to `int’ in declaration of `WAM’
../libgccvb/world.h:78: variable `WAM’ has initializer but incomplete type
../libgccvb/world.h:78: conflicting types for `WAM’
../libgccvb/world.h:77: previous declaration of `WAM’
../libgccvb/world.h:78: `height’ undeclared here (not in a function)
../libgccvb/world.h:78: warning: data definition has no type or storage class
../libgccvb/world.h:79: parse error before `}’
../libgccvb/misc.h:14: warning: `itoa’ defined but not used
make: *** [demo1.o] Error 1

Any help would be greatly appreciated.*/

fobbio,

Great to see a new dev’r on the scene! :thumpup:

Most of those errors stem from certain versions of the VB headers containing macro definitions that span multiple lines (using the “\” line-continuation character). For whatever reason, that was dropped from the pre-processor in newer GCC versions.

Just go through the headers and delete the backslashes and newlines to get the macro definitions on one line each.

That might be all you need, but, if not, at least you will be able to see the real errors 😉

I hope that helps.

Thank you kindly for the assist. Hope I’ll be able to return the favor.

 

Write a reply

You must be logged in to reply to this topic.