Not sure if this belongs here but I am having an issues with devkitpro and my gba program. I created a function in my `.h` file, which looks like this:
I know DMA is probably a better method, but I have no flippin' clue how to get that working. But here's the issue:
Calling
at the end of my main loop causes my shapes to draw at the exact same position every frame, and when I remove it they do move, but with extreme screen tearing, which leads me to believe the rectangles are not drawn/updated fast enough.
What should I do?
C:
void draw_rect_f(int x, int y, int w, int h, int color)
{
// Draw a filled rectangle
for (int i = 0; i < w; i++) {
for (int j = 0; j < h; j++) {
((unsigned short*)0x06000000)[(y + j) * 240 + x + i] = color;
}
}
}
I know DMA is probably a better method, but I have no flippin' clue how to get that working. But here's the issue:
Calling
Code:
VBlankIntrWait()
C++:
// ...
// Main loop
while (1) {
// Clear background
draw_rect_f(0, 0, 240, 160, rgb(200, 75, 75));
// Update snake
snake.update();
// Wait for vblank
VBlankIntrWait();
}
What should I do?