#154689 - biolizard89 - Sun Apr 20, 2008 10:36 am
I have some hardware and libraries (Xport Botball Controller by Charmed Labs) which store an image in the GBA's VRAM (in Mode 3). I'm trying to get that data out of VRAM into an array so that I can process it without leaving it in VRAM and without having to wait for a blank to access it. Unfortunately, the memcpy is crashing my GBA.
My relevant code is:
I'm sure I'm doing something really stupid (I haven't programmed for GBA in several months, and I wasn't any good even then). If I need to post more code, I'd be happy to; just let me know what you need to see.
Anyone have a clue what could be wrong?
Thanks.
EDIT: Never mind, I seem to have been a total idiot and forgotten about large arrays defaulting to IWRAM. Disregard this post.
My relevant code is:
Code: |
#define VideoBuffer ((unsigned short *)0x6000000)
#define VCOUNT (*(volatile unsigned short *)0x04000006) #define vsync() while (VCOUNT != 160); unsigned short current_frame[160][240]; draw_camera_frame(0, 0); // Get the video from FPGA into VRAM vsync(); // We can't read VRAM until a VBlank // Works up to this point // Crashes at this point memcpy(current_frame, VideoBuffer, 160*240*2); // Get the video from VRAM into RAM |
I'm sure I'm doing something really stupid (I haven't programmed for GBA in several months, and I wasn't any good even then). If I need to post more code, I'd be happy to; just let me know what you need to see.
Anyone have a clue what could be wrong?
Thanks.
EDIT: Never mind, I seem to have been a total idiot and forgotten about large arrays defaulting to IWRAM. Disregard this post.