GP32 Displaying Picture On Mrmirko's


Arda

Member
Joined
Jul 16, 2003
Messages
142
Location
istanbul
Website
arda.kisafilm.org
I'm really a newbie. I cannot really figure those pointer stuff, but I'm working on them and I understand that C is a pointer language. Now,

Code:
extern const unsigned short _ay[76800];  // 320x240x16bit bitmap 

...
...

  framebuffer1 = (u16*)  FRAMEBUFFER;                // 0x0C7B4000
  background   = (u16*) malloc (320*240);   // Allocate memory for background 
  for (x=0;x<320*240;x++) background[x]=_ay[x];  // fill background with  _ay image
  gp_DMA0Memcopy(background,framebuffer1,320*240);  // Copy image to buffer?

 gp_SetScreen(framebuffer1,16); // set screen
  gp_ButtonInit();
  gp_SetCpuSpeed(66);
   gp_SetView(framebuffer1);   // set lcd memory location

I'm using above code, I guess it has to display the picture on screen, but all I got is blank white screen(Tested only on geepee). Image appears if I use for..next and gp_SetPixel16 to poke all bytes manually to framebuffer1.

What's wrong? what is the fastest way of displaying full sceen bitmap?
 

mr.mirko

Certified Guru
Joined
Nov 24, 2003
Messages
471
Location
Germany
Website
mirkoroller.de
Arda posted on Mar 14 2004 at 02:25 PM said:
I'm really a newbie. I cannot really figure those pointer stuff, but I'm working on them and I understand that C is a pointer language. Now,

Code:
extern const unsigned short _ay[76800];  // 320x240x16bit bitmap 

...
...

  framebuffer1 = (u16*)  FRAMEBUFFER;                // 0x0C7B4000
  background   = (u16*) malloc (320*240);   // Allocate memory for background 
  for (x=0;x<320*240;x++) background[x]=_ay[x];  // fill background with  _ay image
  gp_DMA0Memcopy(background,framebuffer1,320*240);  // Copy image to buffer?

 gp_SetScreen(framebuffer1,16); // set screen
  gp_ButtonInit();
  gp_SetCpuSpeed(66);
   gp_SetView(framebuffer1);   // set lcd memory location

I'm using above code, I guess it has to display the picture on screen, but all I got is blank white screen(Tested only on geepee). Image appears if I use for..next and gp_SetPixel16 to poke all bytes manually to framebuffer1.

What's wrong? what is the fastest way of displaying full sceen bitmap?
gp_DMA0Memcopy(background,framebuffer1,320*240); // Copy image to buffer?
Yes, but its not working with geepee, try it on real gp32.

If you are using geepee, you can not use the dma copy, its not emulated :(
 
Last edited by a moderator:

Zap

Still Fresh
Joined
Feb 25, 2004
Messages
92
I tried something like that, but my image isnt showing up properly :l

Else you could use the sprite function, gp_SpritePut iirc
 
Top