#8397 - DiscoStew - Wed Jul 09, 2003 5:27 pm
I am totally stressed out because of this.
I'm working with large maps, and what I'm trying to do is whenever a background moves off by 8 pixels, it reloads the map correctly and resets the background coordinates. It all works fine and dandy, but when I use the WaitForVsync function, the program runs faster than it should (I trying to achieve 60fps to make it run smooth), so then I tried a Pern Project example on large maps which instead uses something like this...
while(!(REG_DISPSTAT & 1));//wait for vblank
//redraw the entire map...bit slow but thats okay
BlitBG(bg0map,testMap.layers[0].data,testMap.layers[0].w,(x>>3),(y>>3));
REG_BG0VOFS = y & 7;
REG_BG0HOFS = x & 7;
while((REG_DISPSTAT & 1));//Make sure VBLANK is over so our game does run faster than 60 frames per second
Note: I am not using his BlitBG function, since it does that every single frame.
I'm reloading everytime the screen is off by 8 pixels (1 tile).
I'm not sure exactly what he's doing here, but I tried it, and now the top 1/4 of the screen is jittering when I move the background. During this frustration, I came up with using the VBlank interupt so that when the screen is done drawing, it will interupt my code to where it can check and reload the map. Now here is where my problem is...
I'm using VS 6.0 and the GBA AppWizard (which I finally got working after having to change a few things in its MAK file that it creates). I have additional headers and source files that have that consist of my map functions. I use both linkers and headers from The Pern Project for my program.
My problem is that through building a program, it makes its "interupt.o" file before the "test.o" file (where my main entry point is located), which then requires me to include the necessary header/source files, since my map functions are separate. Because of this, I thought that since that is done first, commenting out those includes from my main file would work, but my program states that the specific variables/functions are undeclared. But when I remove the comments, the program states that there are multiple instances of each variable/function. It's driving me nuts!
So, my question is, how can I call a external function from interupt.cpp that is being included in the main source file if interupt.cpp is being compiled first? OR, How can I prevent VS 6.0 from creating the interupt.o before compiling test.o? I've checked the MAK file on this, and I don't see anything about it. Please help....
If what I'm saying is not clear, please ask me. thx
_________________
DS - It's all about DiscoStew
I'm working with large maps, and what I'm trying to do is whenever a background moves off by 8 pixels, it reloads the map correctly and resets the background coordinates. It all works fine and dandy, but when I use the WaitForVsync function, the program runs faster than it should (I trying to achieve 60fps to make it run smooth), so then I tried a Pern Project example on large maps which instead uses something like this...
while(!(REG_DISPSTAT & 1));//wait for vblank
//redraw the entire map...bit slow but thats okay
BlitBG(bg0map,testMap.layers[0].data,testMap.layers[0].w,(x>>3),(y>>3));
REG_BG0VOFS = y & 7;
REG_BG0HOFS = x & 7;
while((REG_DISPSTAT & 1));//Make sure VBLANK is over so our game does run faster than 60 frames per second
Note: I am not using his BlitBG function, since it does that every single frame.
I'm reloading everytime the screen is off by 8 pixels (1 tile).
I'm not sure exactly what he's doing here, but I tried it, and now the top 1/4 of the screen is jittering when I move the background. During this frustration, I came up with using the VBlank interupt so that when the screen is done drawing, it will interupt my code to where it can check and reload the map. Now here is where my problem is...
I'm using VS 6.0 and the GBA AppWizard (which I finally got working after having to change a few things in its MAK file that it creates). I have additional headers and source files that have that consist of my map functions. I use both linkers and headers from The Pern Project for my program.
My problem is that through building a program, it makes its "interupt.o" file before the "test.o" file (where my main entry point is located), which then requires me to include the necessary header/source files, since my map functions are separate. Because of this, I thought that since that is done first, commenting out those includes from my main file would work, but my program states that the specific variables/functions are undeclared. But when I remove the comments, the program states that there are multiple instances of each variable/function. It's driving me nuts!
So, my question is, how can I call a external function from interupt.cpp that is being included in the main source file if interupt.cpp is being compiled first? OR, How can I prevent VS 6.0 from creating the interupt.o before compiling test.o? I've checked the MAK file on this, and I don't see anything about it. Please help....
If what I'm saying is not clear, please ask me. thx
_________________
DS - It's all about DiscoStew