#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include "costable.h"
{
return costable[v&0x1FF];
}
void renderEffect()
{
static int cnt;
int i, j;
for(i=1;i<400;i++)
{
for(j=1;j<240;j++)
{
bufAdr[v]=(pcCos(i+cnt)+4096)/32;
bufAdr[v+1]=(pcCos(j-256+cnt)+4096)/64;
bufAdr[v+2]=(pcCos(i+128-cnt)+4096)/32;
}
}
cnt++;
}
int main(int argc, char** argv)
{
FILE *file = fopen("test.bin","rb");
if (file == NULL) goto exit;
fseek(file,0,SEEK_END);
off_t size = ftell(file);
fseek(file,0,SEEK_SET);
buffer=malloc(size);
if(!buffer)goto exit;
off_t bytesRead = fread(buffer,1,size,file);
fclose(file);
if(size!=bytesRead)goto exit;
{
renderEffect();
}
exit:
return 0;
}
bool aptMainLoop(void)
Main function which handles sleep mode and HOME/power buttons - call this at the beginning of every f...
void gfxInitDefault(void)
Initializes the LCD framebuffers with default parameters This is equivalent to calling:
void gfxSwapBuffersGpu(void)
Same as gfxSwapBuffers (formerly different).
u8 * gfxGetFramebuffer(gfxScreen_t screen, gfx3dSide_t side, u16 *width, u16 *height)
Retrieves the framebuffer of the specified screen to which graphics should be rendered.
@ GFX_BOTTOM
Bottom screen.
Definition: gfx.h:27
@ GFX_TOP
Top screen.
Definition: gfx.h:26
void gfxExit(void)
Deinitializes and frees the LCD framebuffers.
@ GFX_LEFT
Left eye framebuffer.
Definition: gfx.h:37
@ GSPGPU_EVENT_VBlank0
TODO.
Definition: gspgpu.h:56
void gspWaitForEvent(GSPGPU_Event id, bool nextEvent)
Waits for a GSPGPU event to occur.
@ KEY_B
B.
Definition: hid.h:13
#define keysHeld
Compatibility macro for hidKeysHeld.
Definition: hid.h:174
void hidScanInput(void)
Scans HID for input data.
uint8_t u8
would be nice if newlib had this already
Definition: types.h:21
uint16_t u16
16-bit unsigned integer
Definition: types.h:22
int32_t s32
32-bit signed integer
Definition: types.h:28
uint32_t u32
32-bit unsigned integer
Definition: types.h:23