You are not logged in.
Lost Password?


Register To Post



 Bottom   Previous Topic   Next Topic

#21
Re: Flash memory filling
Posted on: 2007/5/18 18:03
PVB Elite
Joined 2003/7/25
USA
1507 Posts
PVBCC 1stCoderContributor#3 PosterHOTY09 EntryLong Time User (15 Years) App CoderPVBCC 2010 EntryPVBCC 2013 Entry
Cool, yeah... I'm not sure whether this is the cause of your problem, I just remember having a similar weird problem when one of my programs got too large and that ended up being the cause. I just remembered about something though... not sure if RB does it, but I know in RD you can put a watch on a memory range... maybe you can watch 5010000 to 5FFFFFF and run your program, then you'll know whether it's going out of bounds.

And I'm not sure what your recursion does, but if you're not careful you can definitely eat up the stack REALLY quickly.

DogP
Top

#22
Re: Flash memory filling
Posted on: 2007/5/18 20:48
Nintendoid!
Joined 2006/3/15
Ecuador
239 Posts
PVBCC 3rdCoderLong Time User (14 Years)
Just for the shake of posting... just kidding, I'm pretty sure now that the stack grows down...

void main(){
int i;
int j;
}

i's address: 0x0500FFA4
j's address: 0x0500FFA0

Still more difficult to know how much the stack grows... :-(
Top

#23
Re: Flash memory filling
Posted on: 2007/5/18 21:06
PVB Elite
Joined 2003/7/25
USA
1507 Posts
PVBCC 1stCoderContributor#3 PosterHOTY09 EntryLong Time User (15 Years) App CoderPVBCC 2010 EntryPVBCC 2013 Entry
Oh yeah... you're right... since the local variables are on the stack, the size will grow down... or up, depending whether you're talking CS or EE :P (some draw memory with higher addresses at the top of the drawing, others draw it at the bottom). So yeah, if you use too much memory, you'll overwrite your static memory, and then go into the 04XXXXXX memory space (unless they start the stack at 05FFFFFF which would also work because memory only decodes the lower 16 bits). Maybe you should declare an initialized global variable and keep checking it to make sure it hasn't been modified (either in your running program, or put a watch on that memory location in the emulator). Or you could just log all WRAM access in the emulator and check the log to make sure it looks right.

DogP
Top

#24
Re: Flash memory filling
Posted on: 2007/5/18 21:07
Nintendoid!
Joined 2006/3/15
Ecuador
239 Posts
PVBCC 3rdCoderLong Time User (14 Years)
No, indeed, I have avoided recursion, I just tried it almost 6 months ago and remember that it didn't link, but now it links... just made a test, I was forced to drop any recursion in the design stage... and better I did. :-). I will check that in RD tonight. Wrote to David to see if he has an idea.
Top

#25
Re: Flash memory filling
Posted on: 2007/5/18 22:26
Nintendoid!
Joined 2006/3/15
Ecuador
239 Posts
PVBCC 3rdCoderLong Time User (14 Years)
Running out of ideas... declared this:

int global;
void main();{
.
.
.
}

global has and address 0x0500008... and no change of its value... never...

I will check those outputs from RD tonight, thanks for all your help DogP.
Top

#26
Re: Flash memory filling
Posted on: 2007/5/21 14:04
Nintendoid!
Joined 2006/3/15
Ecuador
239 Posts
PVBCC 3rdCoderLong Time User (14 Years)
In an strange turn around it worked again!... now I see that the problem was not memory related, I don't know why, but I've managed to make the ROM work again by calling this function in the game's main loop:

void verify(int i){
//turn on the display
vbDisplayOn();
//setup column table
vbSetColTable();
//this just puts WRLD_ON on layer 31
vbActivateWorldShow();
//set brigth
vbFXFadeIn(FADEDELAY);
}
//game's main loop
while(true){
GameEngine_handleInput(&gameEngine);
GameEngine_update(&gameEngine);
GameEngine_render(&gameEngine);
//this is the function
verify();
}

I can't figure it out why that exact combination makes it work, and why if I put the call before the infinite loop it doesn't.

Now, all those functions are called in the gameEngine's initialization, and after loading a game world.

Thanks again for your support.
Top

#27
Re: Flash memory filling
Posted on: 2007/5/21 17:42
PVB Elite
Joined 2003/7/25
USA
1507 Posts
PVBCC 1stCoderContributor#3 PosterHOTY09 EntryLong Time User (15 Years) App CoderPVBCC 2010 EntryPVBCC 2013 Entry
Cool... glad you got it figured out!

DogP
Top

#28
Re: Flash memory filling
Posted on: 2007/5/22 12:03
Administrator
Joined 2000/1/8
Germany
2544 Posts
Highscore Top10Highscore Top ScoreCoder#1 PosterHOTY09 1stLong Time User (15 Years) App Coder90+ Game Ratings
good news! thanks from me as well, pat. ;D
Top

#29
Re: Flash memory filling
Posted on: 2007/11/7 4:44

Joined 2007/11/7
-1 Posts
Long Time User (12 Years)
I wish the Virtual Boy had more RAM lol
Top

#30
Re: Flash memory filling
Posted on: 2007/11/7 4:44

Joined 2007/11/7
-1 Posts
Long Time User (12 Years)
Confusing
Top

 Top   Previous Topic   Next Topic


Register To Post