You are not logged in.
Lost Password?


Register To Post



 Bottom   Previous Topic   Next Topic

#1
VBDE/GCCVB issues
Posted on: 2016/12/28 23:23
VB Gamer
Joined 2007/4/14
Canada
30 Posts
Long Time User (10 Years)
I was experimenting in VBDE earlier today, trying to see if I could use my new FlashBoy to run my own code on actual Virtual Boy hardware. I only know the very basics of programming in C, so I started by modifying one of the more simple demo files.

I was able to get my code to compile, and it seems to run well in RealityBoy. When I flash to the FlashBoy and try to run it on the VirtualBoy, though, it's all... blinky. It looks like the mirrors aren't syncing properly with the LEDs, or something. The image is there, but it's strobing out of control, and there are vertical gaps.

I thought the problem might be with my code, so I compiled the first VBDE demo project (a static image of the PlanetVB logo) and flashed it. Same problem: I could make out the image, but it was strobing like crazy and interrupted by vertical gaps.

Just to be sure that the problem wasn't with my FlashBoy, I flashed it with a commercial rom. The commercial rom played perfectly.

Is this a common problem? Does anyone know how I might go about addressing it?
Top

#2
Re: VBDE/GCCVB issues
Posted on: 2016/12/29 9:57
Nintendoid!
Joined 2007/12/14
164 Posts
CoderLong Time User (10 Years) App Coder
Test and debug your code against Mednafen. Reality Boy is old and its emulation is not very accurate.
Top

#3
Re: VBDE/GCCVB issues
Posted on: 2016/12/29 21:50
VB Gamer
Joined 2007/4/14
Canada
30 Posts
Long Time User (10 Years)
Good advice, but I'm wondering if anyone has any insight into what's causing the underlying issue.

Even when I compile code that was written by other people (who actually know what they're doing), it still looks glitchy on my VB.

Is it possible VBDE isn't configured correctly?
Top

#4
Re: VBDE/GCCVB issues
Posted on: 2016/12/30 6:57
Nintendoid!
Joined 2007/12/14
164 Posts
CoderLong Time User (10 Years) App Coder
Could you post an example of some code you've recently tried that definitely causes glitches on hardware?
Top

#5
Re: VBDE/GCCVB issues
Posted on: 2016/12/30 18:29
VB Gamer
Joined 2007/4/14
Canada
30 Posts
Long Time User (10 Years)
Here's my code. It's a lightly modified version of one of the samples that comes packaged with VBDE. All it does is populate the displays with a bunch of red rectangles in a diagonal pattern. I made the charmap and bgmap using VIDE.

//Include library, charmap, charset
#include libgccvb.h
#include "testchmap.h"
#include "testchset.h"

int main()
{
//Initialize variables
int x = 30;
int y = 20;
int i = 30;

//Initial setup
vbDisplayOn();

//Copy tileset and tilemap into memory
copymem((void*)CharSeg0, (void*)testchset, 256*16);
copymem((void*)BGMap(0), (void*)testchmap, 450*16);

//Setup worlds
//(This uses structs to access world data, the old method using functions is commented out)
WA[31].head = (WRLD_ON|WRLD_OVR);
WA[31].w = 384;
WA[31].h = 224;
//vbSetWorld(31, (WRLD_LON|WRLD_OVR), 0, 0, 0, 0, 0, 0, 384, 224);

while(i > 20)
{
WA[i].head = (WRLD_ON|WRLD_OVR);
WA[i].w = 384;
WA[i].h = 224;
WA[i].gx = x;
WA[i].gy = y;
x = x + 30;
y = y + 20;
i--;
//vbSetWorld(30, (WRLD_RON|WRLD_OVR), 0, 0, 0, 0, 0, 224, 384, 224);
}

WA[20].head = WRLD_END;
//vbSetWorld(29, WRLD_END, 0, 0, 0, 0, 0, 0, 0, 0);

//Set brightness registers
vbDisplayShow();

//Main loop (Empty because we're done but don't want to reach the end)
for (;;){vbWaitFrame(0);}

return 0;
}
Top

#6
Re: VBDE/GCCVB issues
Posted on: 2016/12/30 22:09
PVB Elite
Joined 2008/12/28
Slovenia
607 Posts
Highscore Top ScoreHighscore Top ScoreCoderContributorTop10 Poster10+ Game RatingsLong Time User (8 Years) App CoderPVBCC 2010 EntryPVBCC 2013 Entry
The code looks OK. The symptoms you're describing sound like the column table is not initialized. VBDE's startup code should initialize it automatically (unless it doesn't do that anymore), but you can manually call vbSetColTable() and see whether that fixes the problem.
Top

#7
Re: VBDE/GCCVB issues
Posted on: 2016/12/30 22:25
VB Gamer
Joined 2007/4/14
Canada
30 Posts
Long Time User (10 Years)
That was it! It totally works now. I can't believe I developed Virtual Boy software. (Well, sort of.)

Thanks.
Top

 Top   Previous Topic   Next Topic


Register To Post