Tealion
Still Fresh
Here is some simple code to plot a simple circle if anybody wants to know, using Mr.Mirkos SDK
Enjoy!!
Code:
#include "gp32.h"
#include <math.h>
#define SCREENHEIGHT 320
#define SCREENWIDTH 240
#define BLACK 0x0000
#define WHITE 0xFFFF
/*Globals*/
unsigned short *framebuffer;
/*Prototypes*/
void DrawCircle(int shift_x, int shift_y, int vectorlength);
/*===================================================*/
int main()
{
int x, int vectlength = 50;
framebuffer = (u16*) FRAMEBUFFER;
gp_SetScreen(framebuffer,16);
gp_ButtonInit();
gp_SetCpuSpeed(66);
/*clear screen*/
for (x=0;x<320*240;x++)
framebuffer[x]=WHITE;
/*scrres 320x240 half for centering*/
DrawCircle(SCREENHEIGHT/2,SCREENWIDTH/2,vectlength);
/*infinate loop until A button pressed*/
while (1)
if ( gp_ButtonResult()&BA) gp_Reset();
return 0;
}
/*===================================================*/
void DrawCircle(int shift_x, int shift_y, int vectorlength)
{
int x,y;
float angle = 0.0;
float angle_stepsize = 0.1;
while( angle < 2*PI)
{
x = vectorlength * cos(angle);
y = vectorlength * sin(angle);
gp_SetPixel16(x+shift_x, y+shift_y, BLACK, framebuffer);
angle += angle_stepsize;
}
}
Enjoy!!