Original Post

I am currently working on packaging up a complete, portable Virtual Boy development environment (“VBDE”) for Windows. Only download, unzip and start working, no installation, no hassle. It comes in the form of an editor (Notepad++) with shortcuts for compiling, running with Reality Boy or Mednafen and flashing to a FlashBoy. Also included will be example code which can be used as a starting base for new projects.

VBDE currently consists of:
– Cygwin with gccVB 2.95
– a portable Notepad++, with a few plugins and custom shortcuts
– a collection of development tools
– example code

Thank yous go to thunderstruck for helping me with tying this thing together. πŸ™‚

I got this working on my machine, but still need to do some tests to see if it really is portable. πŸ˜› If so, I will make a preview version available soon.

Hopefully, this project will finally end all the confusion newcomers to VB programming have to face and make setting up a development environment as easy as downloading and unzipping. Also, I hope the included example/base code can be used to hold a standardized library. A point to collect all the useful bits and bytes which are currently scattered in countless private versions of libgccvb, to give developers the best possible tools at hand to create amazing new homebrews for out beloved Virtual Boy.

66 Replies

D’oh! I guess I should have looked at how the .vbh is used before posting… That’s kind of a round-about way to do it, but oh well, whatever works, right?

Once again, great work, KR155E! :thumpup:

Yeah, I am doing it like thunderstruck said. Reading the header information from the vbh file and writing it to the ROM using vbid after compiling. vbid can be found in the tools directory, that’s why I removed it from the compiler directory.

So, the vbh file works differently than the earlier vbh format, which contained the complete header, including reset vector and stuff. The new one only has the plain header information that can be fed into vbid. We might rename the file format to prevent confusion?

Hi, I just found this website and your VBDE. It’s pretty cool you guys have created a framework for making virtual boy homebrews.
I’m taking a couple of computer science classes this summer where we’ll be focusing on system’s programming with assembly and general hardware related topics. Making a virtual boy game might help enrich my studies.
So how might I get started developing VB projects? (besides VBDE, which downloaded and installed quite easily!)
I see there are a few tools out there for imaging and header files and I’m not sure how to use much of that. I’m pretty proficient with C already so I feel like I’m up for the challnge.

Hey,

VirtualBoy programming can be a little bit tricky in the beginning but as soon as you understood the basic system it is relativity simple. This is mainly caused by the fact, that the guys around here all already figured out the complicate stuff.

You can find demos and homebrews including the sources on this site, which I felt was a good starting point. There are also some helpful tutorials. The developer forum is also full of useful information.

Usually the projects are based on the libgccvb, which is an c library that allows relativity simple access to all of the VB functions. Unfortunately, there different versions of this lib featuring different improvements. You will find a version you can start with in one of the demos.

If you want to try out your stuff on Hardware, you will need a FashBoy Plus. There is a thread in this forum that explains how to get one. Otherwise you can use an emulator like Mednafen or RealityBoy.

If you have any questions about the coding itself just ask in the developer forum. Also feel free to contact me directly. I may not be an expert, but a least I produced something that people keep calling a VirtualBoy game.

AS a side node: I am pretty close to publishing the next and hopefully final iteration of GameHero. As soon as I am happy with the results I am going to publish the code as well. I will have to write comments into the code, though.

Cheers
thunder

I tried to update all my projects to compile under VBDE and had no problems with VUE Snake. With Blox 2, however, I got the following errors:

c:/vbde/gccvb/bin/../lib/gcc/v810/4.4.2/../../../../v810/bin/ld.exe: section .vb vectors loaded at [071ffde0,071fffff] overlaps section .data loaded at [071fbd04,071ffe73]
C:\Users\Chris\AppData\Local\Temp\ccFPkqQc.o: In function `adjustment’:
blox2.c:(.text+0x3ae0): undefined reference to `memcpy’
blox2.c:(.text+0x3ae4): undefined reference to `memcpy’
blox2.c:(.text+0x3b08): undefined reference to `memcpy’
blox2.c:(.text+0x3b0c): undefined reference to `memcpy’
blox2.c:(.text+0x3b30): undefined reference to `memcpy’
C:\Users\Chris\AppData\Local\Temp\ccFPkqQc.o:blox2.c:(.text+0x3b34): more undefined references to `memcpy’ follow
collect2: ld returned 1 exit status
make.exe: *** [blox2.o] Error 1

Seems the linker script has problems with trying to squeeze too much stuff into the ROM or something? Blox 2 indeed almost completely uses up its 16MBits, but I never had problems from that before. Any idea?

I am having the exact same problem with GameHero. I don’t use vbde though. That’s why I did all of the ram saving. To have more place for music.

Hi. Try compiling with the linker script and crt0 attached to this post. This should fix the overlapping sections error.

These files indeed fix the overlapping sections error. πŸ™‚ The other errors remain, though, and some new ones are introduced:

c:/vbde/gccvb/bin/../lib/gcc/v810/4.4.2/../../../../v810/lib/crt0.o: In function `start’:
(.text+0xa): undefined reference to `_gp’
c:/vbde/gccvb/bin/../lib/gcc/v810/4.4.2/../../../../v810/lib/crt0.o: In function `start’:
(.text+0xe): undefined reference to `_gp’
c:/vbde/gccvb/bin/../lib/gcc/v810/4.4.2/../../../../v810/lib/crt0.o: In function `DummyLoop’:
(.text+0x2e): undefined reference to `_data_start’
c:/vbde/gccvb/bin/../lib/gcc/v810/4.4.2/../../../../v810/lib/crt0.o: In function `DummyLoop’:
(.text+0x32): undefined reference to `_data_start’
C:\Users\Chris\AppData\Local\Temp\cc5OAVhM.o: In function `adjustment’:
blox2.c:(.text+0x3ae0): undefined reference to `memcpy’
blox2.c:(.text+0x3ae4): undefined reference to `memcpy’
blox2.c:(.text+0x3b08): undefined reference to `memcpy’
blox2.c:(.text+0x3b0c): undefined reference to `memcpy’
blox2.c:(.text+0x3b30): undefined reference to `memcpy’
C:\Users\Chris\AppData\Local\Temp\cc5OAVhM.o:blox2.c:(.text+0x3b34): more undefined references to `memcpy’ follow
collect2: ld returned 1 exit status
make.exe: *** [blox2.o] Error 1

I don’t think you’re using the fixed linker script, or you wouldn’t be getting the undefined reference errors to __gp and __data_start. In your makefile specify the linker script you want the linker to use with the -T option, e.g. -Tpath/vb.ld.

I’m not sure why you’re getting the undefined references to memcpy. Are you including string.h in blox2.c?

I am able get rid of the errors and get Blox 2 to compile if I comment out a few small portions of the code. I can’t explain to myself what’s causing the memcpy error, but I am now much closer to finding the problem. πŸ™‚

EDIT: Here’s the line that causes the memcpy problem. It’s used to define a button code sequence. I don’t see anything wrong with it:

u16 classic[] = {2050, 2050, 1026, 1026, 34, 18, 34, 18, 6, 10, 8194}; /* LU, LU, LD, LD, LT, RT, LT, RT, A, B, Sel */

EDIT2: Got that solved, thanks to dasi! πŸ™‚

  • This reply was modified 11 years, 8 months ago by KR155E.
  • This reply was modified 11 years, 8 months ago by KR155E.

Just out of curoisity. Was it because you did not reference the mem.c file in your Makefile?

thunderstruck schrieb:
Just out of curoisity. Was it because you did not reference the mem.c file in your Makefile?

No. I don’t know why it did not work, but I simply had to declare the array as a global constant to make it work.

Here’s preview 3 of VBDE!

It includes some things contributed by thunderstruck, like the VIDE shortcut or a newer crt0. Other changes include:

– Projects now only contain the user’s code and ROM header information. Everything else, like libgccvb and a default makefile have been abstracted away to be shared by all projects

– Many additions to the “PVB Framework”, which provides the user with a higher level infrastructure to build new projects upon. For example: Adjustment and Precaution screens, multilingual text output including ISO 8859-1 (umlauts!) support, an abstraction to handle button presses, timer and system setup functions

Download: http://www.planetvb.com/content/vbde_preview3.7z

P.S. I also tried to include the vbJAEngine and MarioVB sources, but did not yet get those to compile. If someone smarter (and less lazy) than me could give it a try, this would be great! πŸ˜€

  • This reply was modified 11 years, 6 months ago by KR155E.

Oh, another idea that just popped into my head: wouldn’t it be cool to have a script which checks our server for updates and, in case there is a newer version, downloads and extracts it to c:/vbde, thus updating the local installation? A simple batch file calling cURL and 7-Zip should do the job.

KR155E wrote:
Oh, another idea that just popped into my head: wouldn’t it be cool to have a script which checks our server for updates and, in case there is a newer version, downloads and extracts it to c:/vbde, thus updating the local installation? A simple batch file calling cURL and 7-Zip should do the job.

There are actually tools that can build a web-installer including stuff like automatically download latest, create shortcuts and so on… I can’t remember the name right now… have to check when I’m at work.

Here’s Preview Release 4.

– Updated Notepad++ to latest
– Custom button bar!
– VBDE icon
– Some more cleanups

http://www.planetvb.com/content/vbde_preview4.7z

KR155E wrote:
Here’s Preview Release 4.

– Updated Notepad++ to latest
– Custom button bar!
– VBDE icon
– Some more cleanups

http://www.planetvb.com/content/vbde_preview4.7z

Just in case you would like to have an installer: http://teejee2008.wordpress.com/7-zip-sfx-maker/

Wow, this is awesome! Looks like I’ll finally upgrade from gccVB 1.0.

Here’s a modified version of build.bat (I call it “mbuild.bat”) that can be used standalone from the command line, for those who already have an IDE set up. To use it, CD to C:\vbde\system and execute it with “MBUILD PATH\ NAME”.

—————————————-

@ECHO OFF

:: SET ENVIRONMENT VARIABLES (only for this batch file; do not affect the whole system)
SETLOCAL
SET PATH=%PATH%;C:\vbde\gccvb\make-3.81-bin\bin\;C:\vbde\gccvb\bin;C:\vbde\tools\rom\vbid-1.0-win;C:\vbde\libs\libgccvb
:: The libgccvb in gccVB 1.0 is incompatible with the one in VBDE. Remove the first part if you’re not upgrading from it.
SET C_INCLUDE_PATH=C:\gccvb\include;C:\vbde\libs\libgccvb;C:\vbde\libs\pvbfw;C:\vbde\libs\vbjaengine

:: CHANGE TO PROJECT DIRECTORY
PUSHD %1

:: PRE-CLEAN
IF EXIST %2.vb DEL %2.vb
IF EXIST %2_pad.vb DEL %2_pad.vb

:: COMPILE
make.exe -f C:\vbde\libs\makefile TARGET=%2 –quiet

:: SET ROM HEADER
SETLOCAL EnableDelayedExpansion
FOR /f “tokens=* delims= ” %%a in (%2.vbh) do (
SET /a N+=1
SET v!N!=%%a
)
vbid.exe %2.vb “!v4!” – !v6! !v8! !v10! > NUL

:: POST-CLEAN
DEL %2.o

:: CHANGE TO PREVIOUS DIRECTORY
POPD

Finally made the switch to the new vbde. All of a sudden all of my interrupt code that wasn’t working now works. You have no idea how much frustration this just saved me. Great job!

I was forced to give it a try yesterday. I like hoe you organized everything and the custom button bar is great. Good job.

 

Write a reply

You must be logged in to reply to this topic.