What resolution are the sprites that I might be making? Also the colors would be (0, 0, 0), (85, 0, 0), (170, 0, 0) and (255, 0, 0). Right? I could try making a few samples.
Sorry for the delay, I moved up to my X61 tablet. The screen on this one is a bit brighter.
I moved over to lower case.
DogP wrote:
Compiler:
What’s the latest version, any problems, how to install, creating makefiles, etc?Code NOT in .h files
-While maybe it doesn’t matter, it has always bothered me that we include .h files, which has the code in it, rather than just function prototypes, and compiling the library source files seperately.
I’ve got a question on this one. I’m trying to make a simple tetris game to get started. I made a source file and a corresponding C file for managing the board state. You know has player gone over the top, space occupied that stuff. Tetris.C has my main function in there with some test screen code in it, nothing fancy. Just to get started.
Here’s my makefile:
#The name of the file which contains main, without the file suffix TARGET=Tetris .PHONY: all clean all: $(TARGET).vb clean: rm $(TARGET).vb Board.o $(TARGET).o $(TARGET).vb: $(TARGET).o $(TARGET).o: v810-gcc -Wall -nodefaultlibs -mv810 -xc -o Board.o Board.C v810-gcc -Wall -nodefaultlibs -mv810 -xc -o $(TARGET).o $(TARGET).C v810-objcopy -S -O binary $(TARGET).o $(TARGET).vb
Here’s what I get out of the compiler.
v810-gcc -Wall -mv810 -xc -o Board.o Board.C /usr/local/v810/lib/crt0.o: In function `loop_intclear': /usr/local/v810/lib/crt0.o(.text+0x190): undefined reference to `main' /usr/local/v810/lib/crt0.o(.text+0x194): undefined reference to `main' collect2: ld returned 1 exit status make: *** [Tetris.o] Error 1
Are these errors in concert with the current state of the GCC NVC 2.95 Precompiled or is it just me. Btw I put the updated crt0.o in the specified directory.
I’m getting started with 2.95 precompiled NVC.
Thank you kindly for the assist. Hope I’ll be able to return the favor.
This game looks like a lot of fun. I hope you have good luck with this one. I could be able to help with graphics and some programming.
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.*/
I’m looking at least to get a bit of expirience for VB Coding. Did this project get started?
I’m not much for graphics but I’ve been a programmer for over three years on C# and C++ but have no problems working with C.
DogP wrote:
I’d like an adjustable threshold for the map constructor… basically if I input a BMP w/ 4 colors, I’d like those 4 colors to be black through bright red (either automatically or manually selecting the threshold), instead of having to adjust the colors in the original BMP until it detects the 4 colors like I want.I’ll try to think of other stuff, but that’s one I’ve run into a few times.
DogP
What are the four colors it will detect?
- This reply was modified 15 years, 4 months ago by vbman.
On mine I can use any USB cable. But one thing to note, it may not ALWAYS work. Try closing out the program, disconnecting the USB from the computer and try again a few times. Mine almost never flashes correctly the first time. I usually need three or four tries or a reboot to get it to work.
Sounds really cool. I didn’t know that modifying a Wii game was possible. Great work!
Maybe we could do something like Wario Ware. We could come up with a spec for the design and each person tries to come up with a full microgame in a day. Then we could string the whole load into a full image.
Thank you both kindly for your help.
RunnerPack, I did try to find it on my own. I downloaded the source code for some of the homebrew games to see if I could find something there, but couldn’t get it working.
DanB, Thanks a lot, that’s just I was hoping for in simplicity.
I couldn’t get it working, so I went to GCCVB and am using the make.bat with success so far.
- This reply was modified 15 years, 11 months ago by vbman.
Thank you very much for putting up the source code for your demonstration. The style is good and gives me ideas about where it could be taken.
One thing I would like to ask about is the size of the sprite, is that the actual size of what it was on the SNES or a reduced resolution made to make some things easier? My poor eyesight cannot even make Chrono out on the screen.
As far as your C coding style, I’d like to give a few tips. First this depends wholly on how you approached the program, if you decided just to do it quick and dirty because it’s a simple demo, then my tips may not apply too much.
The first thing I noticed is that you have a very large main() function, you may want to break up the operations into discreet functions that can be re-used as needed. This helps from a readability standpoint as well as or identifying and fixing problems. It is difficult to fix a problem if you have identical code in multiple places.
Secondly, you may wish to consider using fewer multiplies if you can avoid them. Replace them with bit shifts (if multiplying or dividing by a power of two) or by adding to an accumulator with each loop iteration. The Virtual Boy is a low power device. Multiply instructions are extremely expensive when compared with addition, so if you can get away with an add instead, do it.
The play dynamics of that game are pretty simple, but there’s a lot of math required to do that type of motion.
My previous post may have been hasty. I did a bit of research about the origins of C++ and found some interesting things.
The creator of C++ Bjarne Stroustrup designed this language in 1983 in AT&T labs. One would assume that he would be testing it out at that time to verify the theories that he had. Commercially available programs for PCs using this style appeared earlier than 1987. Memory for those machines varied widely, some having less than the VB and others, like my father’s Tandy 1000 in 1988 had as much as 640KB.
It’s worth noting, that those machines also had to run DOS in the background which is comparatively memory expensive compared with the TRON variant that the Virtual Boy runs. DOS can eat up as much as 384 KB of memory.
In SAMS Teach Yourself Wireless Java With J2ME In 21 Days, they give a specification for the CLDC profile for use with J2ME. In part the CLDC requires a 16 Bit CPU with 160 KB memory available to Java. Now this takes into account the interpreter, which is not cheap with regard to memory. It looks pretty possible. The J2ME specification does not diminish the language features ie Inheritance, Polymorphism, Abstract Base Classes (ABCs) and others.
I can’t be sure that C++ would run well on it, but given the historical precedence described above it may not be as bad as we think. I’ll try and come up with some kind of benchmark and test it out. It’s worth a shot at least. Assembler would be the best for performance, but not all code segments need to be in Assembler for it to function effectively. Only about 15 to 20% of the Linux Kernel by volume is Assembler.
That’s good to know. I’m just getting started, mind. Currently I’m designing a headband to play the Virtual Boy on the 4 hour bus ride each day (back and forth to work.) I’m using Disney key chains, the cloth is pretty thick and I’m hoping it will work well. I’ll put up pictures when it’s completed.
With the job I’m at now, I demo’ed my thesis for my BS in Math, it’s a tree that can be rotated in three dimensions. Pretty rudimentary but I did get hired, so it must have been pretty good. For that interview, I strategically placed a Master’s level book so they would see it when I was getting at my developer’s journal.
Showing that the interest and motivation is there is quite important in an interview, aids like that reinforce the message. Like your current job, according to my supervisor, I was hired solely because of my dedication and interest.
I’ll have to try and get that version of GCC onto my ThinkPad to get started. I wanted to first try and get David Tucker’s guide memorized. I’d prefer to handle the low level stuff at one end, but have the flexibility to do high level stuff like Polymorphism as well.
The concept of virtual methods really makes a lot of things possible beyond simple tasks. With that, a Mario that inherits from sprite could manage how it’s going to move, die and so forth. A spiny or turtle could determine their actions as well. The Object Oriented Paradigm simplifies the debugging and testing aspects quite a bit. In SMB, some turtles (green shells) can not go beyond the ledge they are on. Others (red) could go past the edge to fall to a lower platform or into a pit. Of course if implemented in VB both would have to be red.
Plus, I get extra experience with the OOP stuff I need for work, while doing something fun!
- This reply was modified 15 years, 12 months ago by vbman.
Does Reality Boy or some other Emulator inform the developer if they have exceeded that 64 KB limit? Or rather might there be a symptom to indicate this? I doubt it would flash OUT OF MEMORY on the screen, but just flaking out wouldn’t tell you much.
Of course you are correct, when I did programming for GBA, I would use the cartridge mostly for demonstrations and such. I wanted the same thing for the Virtual Boy. I used the Emulator for most of the development process. Of course, if I hit some major milestone, the cart would be used in celebration.
It never hurts though if you’re going up for a job to bring a demonstration of your previous work in case the prospective employer wishes to see it.
Thanks for the information. I’m hoping to start working with the VB since the Flashboy came out. I wanted to do so when David Tucker first put up his development information, but couldn’t because of the need for a reprogrammable cartridge.
I am very happy to hear that GCC 2.95 will support C++ coding structures. However, with 64 KB of memory (as stated in David Tucker’s Programmer’s Manual), things will be very tight from a software design point with those structures in mind. This does not take into account advanced engine design (physics, polygon rendering) or even the graphics manipulation end of things.
Wikipedia states that the Virtual Boy comes with 1 MB of RAM. Is there any method of verifying this claim’s validity? 1 MB may not seem like much, but it’s quite a bit more room to work in compared to 64 KB.