#44279 - Kris_Allen - Tue May 31, 2005 5:21 pm
Hiya,
I know this has probably been posted a lot already but I've got this blank screen problem. I've read a few other posts, and the FAQ, but still can't seem to solve the problem.
Here's my code. I've been using the headers that come with the PERN tutorial, but for the sake of pasting here I'm just plucking out the definitions that I'm using. I'm also using pretty much the same code from the tutorial.
This is my compile batch file:
Compiling works fine, and as you can see I haven't forgotten the thumb/interwork options.
Any ideas?
Thanks,
Kris.
Edit: Well, that's odd. I switched to DevKitAdv out of curiosity and changed my batch to this:
... And now it works fine!! Why is this?
I know this has probably been posted a lot already but I've got this blank screen problem. I've read a few other posts, and the FAQ, but still can't seem to solve the problem.
Here's my code. I've been using the headers that come with the PERN tutorial, but for the sake of pasting here I'm just plucking out the definitions that I'm using. I'm also using pretty much the same code from the tutorial.
Code: |
typedef unsigned char u8; typedef unsigned short u16; typedef unsigned long u32; typedef volatile unsigned char vu8; typedef volatile unsigned short vu16; typedef volatile unsigned long vu32; #define VideoBuffer ((u16*)0x6000000) #define SCREEN_WIDTH 240 #define SCREEN_HEIGHT 160 #define BIT(n) (1<<(n)) #define BG0_ENABLE BIT(0x8) #define BG1_ENABLE BIT(0x9) #define BG2_ENABLE BIT(0xA) #define BG3_ENABLE BIT(0xB) #define OBJ_ENABLE BIT(0xC) #define SetMode(mode) REG_DISPCNT = (mode) #define REG_DISPCNT (*(vu32*)0x4000000) #define RGB16(r,g,b) ((r)|((g)<<5)|((b)<<10)) //-------------- int main() { unsigned char x,y; SetMode(3 | BG2_ENABLE); for(x = 0; x < SCREEN_WIDTH; x++) { for(y = 0; y < SCREEN_HEIGHT; y++) { VideoBuffer [x+y*SCREEN_WIDTH] = RGB16(31,0,0); } } while(1) { } } |
This is my compile batch file:
Code: |
set PATH=d:\dev\gba\devkitarm\bin\ arm-elf-gcc -Wall -mthumb -mthumb-interwork -specs=gba_mb.specs test.cpp -o test.elf arm-elf-objcopy -v -O binary test.elf test.gba gbafix test.gba pause |
Compiling works fine, and as you can see I haven't forgotten the thumb/interwork options.
Any ideas?
Thanks,
Kris.
Edit: Well, that's odd. I switched to DevKitAdv out of curiosity and changed my batch to this:
Code: |
@echo off set PATH=d:\dev\gba\devkitadv\bin\ arm-agb-elf-gcc -Wall -mthumb -mthumb-interwork test.cpp -o test.elf arm-agb-elf-objcopy -v -O binary test.elf test.gba del test.elf pause |
... And now it works fine!! Why is this?