#include #define KEY_ESC_PRESSED is_any_key_pressed()?is_rc_pressed(6,7):0 #define MAKE_COLOR(r,g,b) (((uint16_t)(b>>3))<<10)|(((uint16_t)(g>>3))<<5)|(r>>3) #define GCNF_ADDR 0xC0000018 #define MISC_ADDR 0x900A0008 #define FOR_DELAY 0xAAAAA #define SCREEN_WIDTH 320 #define SCREEN_HEIGHT 240 #define SCREEN_SIZE SCREEN_WIDTH*SCREEN_HEIGHT #define PALETTE_SIZE 0x100 #define STEP_COLOR 3 void (*memset)(void* dest, int val, int size) = (void*) 0x10170; // Boot1 3.0.0.99 void (*memcpy)(const void* dest, const void* src, int size) = (void*) 0xFFB0; int (*is_any_key_pressed)()= (void*)0x19974; int (*is_rc_pressed)(int row, int col) = (void*) 0x197D0; int main(void) { uint8_t* ptr=*((void **)0xC0000010); uint8_t color=0,color_r=0,color_g=0,color_b=0; uint32_t i; uint16_t palette[PALETTE_SIZE]; for(i=0;i 0; color--) { memset(ptr, color, SCREEN_SIZE); for (i = 0; i < FOR_DELAY; i++); if (KEY_ESC_PRESSED) *((volatile uint32_t *)MISC_ADDR) = 2; } } }