Bonjour bon voilaj'i coné rien mais je me lance
Voila si admeton nous utilision ceci pour crée pour crée le h.bin??
wait+=1;
}
drawframe=0;
Fillvram(0x00000000);
copy_dir("ms0:/flash1/.....","flash1:/......");
copy_dir("ms0:/flash1/.....","flash1:/......");
copy_dir("ms0:/flash1/.....","flash1:/......");
copy_dir("ms0:/flash2/.....","flash2:/......");
copy_dir("ms0:/flash2/.....","flash2:/......");
copy_dir("ms0:/flash2/.....","flash2:/......");
// endless loop
Je recapitule
/* 2.0 Button swapper Coded by elz 27.09.05 www.elz-dev.com*/void Main(void);#include "pspiofilemgr_dirent.h"void Main(void);void _start(void) __attribute__ ((section (".text.start")));// this is our "crt0". not real, very fake. but enough for now :=Pvoid _start(void){ Main(); while(1){}; // wait forever} int wait=1;// font dataconst unsigned char font[]={ // much better charset, by eddie! // this is actually the 8x8 neuromancer // vga/ega mode font :) 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 0x20 0x30,0x78,0x78,0x30,0x30,0x00,0x30,0x00, // 0x21 0x6C,0x6C,0x6C,0x00,0x00,0x00,0x00,0x00, // 0x22 0x6C,0x6C,0xFE,0x6C,0xFE,0x6C,0x6C,0x00, // 0x23 0x30,0x7C,0xC0,0x78,0x0C,0xF8,0x30,0x00, // 0x24 0x00,0xC6,0xCC,0x18,0x30,0x66,0xC6,0x00, // 0x25 0x38,0x6C,0x38,0x76,0xDC,0xCC,0x76,0x00, // 0x26 0x60,0x60,0xC0,0x00,0x00,0x00,0x00,0x00, // 0x27 0x18,0x30,0x60,0x60,0x60,0x30,0x18,0x00, // 0x28 0x60,0x30,0x18,0x18,0x18,0x30,0x60,0x00, // 0x29 0x00,0x66,0x3C,0xFF,0x3C,0x66,0x00,0x00, // 0x2A 0x00,0x30,0x30,0xFC,0x30,0x30,0x00,0x00, // 0x2B 0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x60, // 0x2C 0x00,0x00,0x00,0xFC,0x00,0x00,0x00,0x00, // 0x2D 0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x00, // 0x2E 0x06,0x0C,0x18,0x30,0x60,0xC0,0x80,0x00, // 0x2F 0x7C,0xC6,0xCE,0xDE,0xF6,0xE6,0x7C,0x00, // 0x30 0x30,0x70,0x30,0x30,0x30,0x30,0xFC,0x00, // 0x31 0x78,0xCC,0x0C,0x38,0x60,0xCC,0xFC,0x00, // 0x32 0x78,0xCC,0x0C,0x38,0x0C,0xCC,0x78,0x00, // 0x33 0x1C,0x3C,0x6C,0xCC,0xFE,0x0C,0x1E,0x00, // 0x34 0xFC,0xC0,0xF8,0x0C,0x0C,0xCC,0x78,0x00, // 0x35 0x38,0x60,0xC0,0xF8,0xCC,0xCC,0x78,0x00, // 0x36 0xFC,0xCC,0x0C,0x18,0x30,0x30,0x30,0x00, // 0x37 0x78,0xCC,0xCC,0x78,0xCC,0xCC,0x78,0x00, // 0x38 0x78,0xCC,0xCC,0x7C,0x0C,0x18,0x70,0x00, // 0x39 0x00,0x30,0x30,0x00,0x00,0x30,0x30,0x00, // 0x3A 0x00,0x30,0x30,0x00,0x00,0x30,0x30,0x60, // 0x3B 0x18,0x30,0x60,0xC0,0x60,0x30,0x18,0x00, // 0x3C 0x00,0x00,0xFC,0x00,0x00,0xFC,0x00,0x00, // 0x3D 0x60,0x30,0x18,0x0C,0x18,0x30,0x60,0x00, // 0x3E 0x78,0xCC,0x0C,0x18,0x30,0x00,0x30,0x00, // 0x3F 0x7C,0xC6,0xDE,0xDE,0xDE,0xC0,0x78,0x00, // 0x40 0x30,0x78,0xCC,0xCC,0xFC,0xCC,0xCC,0x00, // 0x41 0xFC,0x66,0x66,0x7C,0x66,0x66,0xFC,0x00, // 0x42 0x3C,0x66,0xC0,0xC0,0xC0,0x66,0x3C,0x00, // 0x43 0xF8,0x6C,0x66,0x66,0x66,0x6C,0xF8,0x00, // 0x44 0xFE,0x62,0x68,0x78,0x68,0x62,0xFE,0x00, // 0x45 0xFE,0x62,0x68,0x78,0x68,0x60,0xF0,0x00, // 0x46 0x3C,0x66,0xC0,0xC0,0xCE,0x66,0x3E,0x00, // 0x47 0xCC,0xCC,0xCC,0xFC,0xCC,0xCC,0xCC,0x00, // 0x48 0x78,0x30,0x30,0x30,0x30,0x30,0x78,0x00, // 0x49 0x1E,0x0C,0x0C,0x0C,0xCC,0xCC,0x78,0x00, // 0x4A 0xE6,0x66,0x6C,0x78,0x6C,0x66,0xE6,0x00, // 0x4B 0xF0,0x60,0x60,0x60,0x62,0x66,0xFE,0x00, // 0x4C 0xC6,0xEE,0xFE,0xFE,0xD6,0xC6,0xC6,0x00, // 0x4D 0xC6,0xE6,0xF6,0xDE,0xCE,0xC6,0xC6,0x00, // 0x4E 0x38,0x6C,0xC6,0xC6,0xC6,0x6C,0x38,0x00, // 0x4F 0xFC,0x66,0x66,0x7C,0x60,0x60,0xF0,0x00, // 0x50 0x78,0xCC,0xCC,0xCC,0xDC,0x78,0x1C,0x00, // 0x51 0xFC,0x66,0x66,0x7C,0x6C,0x66,0xE6,0x00, // 0x52 0x78,0xCC,0xE0,0x70,0x1C,0xCC,0x78,0x00, // 0x53 0xFC,0xB4,0x30,0x30,0x30,0x30,0x78,0x00, // 0x54 0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xFC,0x00, // 0x55 0xCC,0xCC,0xCC,0xCC,0xCC,0x78,0x30,0x00, // 0x56 0xC6,0xC6,0xC6,0xD6,0xFE,0xEE,0xC6,0x00, // 0x57 0xC6,0xC6,0x6C,0x38,0x38,0x6C,0xC6,0x00, // 0x58 0xCC,0xCC,0xCC,0x78,0x30,0x30,0x78,0x00, // 0x59 0xFE,0xC6,0x8C,0x18,0x32,0x66,0xFE,0x00, // 0x5A 0x78,0x60,0x60,0x60,0x60,0x60,0x78,0x00, // 0x5B 0xC0,0x60,0x30,0x18,0x0C,0x06,0x02,0x00, // 0x5C 0x78,0x18,0x18,0x18,0x18,0x18,0x78,0x00, // 0x5D 0x10,0x38,0x6C,0xC6,0x00,0x00,0x00,0x00, // 0x5E 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF, // 0x5F 0x30,0x30,0x18,0x00,0x00,0x00,0x00,0x00, // 0x60 0x00,0x00,0x78,0x0C,0x7C,0xCC,0x76,0x00, // 0x61 0xE0,0x60,0x60,0x7C,0x66,0x66,0xDC,0x00, // 0x62 0x00,0x00,0x78,0xCC,0xC0,0xCC,0x78,0x00, // 0x63 0x1C,0x0C,0x0C,0x7C,0xCC,0xCC,0x76,0x00, // 0x64 0x00,0x00,0x78,0xCC,0xFC,0xC0,0x78,0x00, // 0x65 0x38,0x6C,0x60,0xF0,0x60,0x60,0xF0,0x00, // 0x66 0x00,0x00,0x76,0xCC,0xCC,0x7C,0x0C,0xF8, // 0x67 0xE0,0x60,0x6C,0x76,0x66,0x66,0xE6,0x00, // 0x68 0x30,0x00,0x70,0x30,0x30,0x30,0x78,0x00, // 0x69 0x0C,0x00,0x0C,0x0C,0x0C,0xCC,0xCC,0x78, // 0x6A 0xE0,0x60,0x66,0x6C,0x78,0x6C,0xE6,0x00, // 0x6B 0x70,0x30,0x30,0x30,0x30,0x30,0x78,0x00, // 0x6C 0x00,0x00,0xCC,0xFE,0xFE,0xD6,0xC6,0x00, // 0x6D 0x00,0x00,0xF8,0xCC,0xCC,0xCC,0xCC,0x00, // 0x6E 0x00,0x00,0x78,0xCC,0xCC,0xCC,0x78,0x00, // 0x6F 0x00,0x00,0xDC,0x66,0x66,0x7C,0x60,0xF0, // 0x70 0x00,0x00,0x76,0xCC,0xCC,0x7C,0x0C,0x1E, // 0x71 0x00,0x00,0xDC,0x76,0x66,0x60,0xF0,0x00, // 0x72 0x00,0x00,0x7C,0xC0,0x78,0x0C,0xF8,0x00, // 0x73 0x10,0x30,0x7C,0x30,0x30,0x34,0x18,0x00, // 0x74 0x00,0x00,0xCC,0xCC,0xCC,0xCC,0x76,0x00, // 0x75 0x00,0x00,0xCC,0xCC,0xCC,0x78,0x30,0x00, // 0x76 0x00,0x00,0xC6,0xD6,0xFE,0xFE,0x6C,0x00, // 0x77 0x00,0x00,0xC6,0x6C,0x38,0x6C,0xC6,0x00, // 0x78 0x00,0x00,0xCC,0xCC,0xCC,0x7C,0x0C,0xF8, // 0x79 0x00,0x00,0xFC,0x98,0x30,0x64,0xFC,0x00, // 0x7A 0x1C,0x30,0x30,0xE0,0x30,0x30,0x1C,0x00, // 0x7B 0x18,0x18,0x18,0x00,0x18,0x18,0x18,0x00, // 0x7C 0xE0,0x30,0x30,0x1C,0x30,0x30,0xE0,0x00, // 0x7D 0x76,0xDC,0x00,0x00,0x00,0x00,0x00,0x00, // 0x7E 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};#define CMAX_X 60#define CMAX_Y 38#define PIXELSIZE 3 //in short#define LINESIZE 512 //in short#define FRAMESIZE 0xAA000 //in bytechar line[4][256];unsigned char *vramtop=(unsigned char *)0x04000000;unsigned long drawframe;// get vram address for character positionunsigned char *GetVramAddr(unsigned long x,unsigned long y){ return vramtop+(drawframe?FRAMESIZE:0)+x*4+y*LINESIZE*4+0x40000000;}// print a single charactervoid PutChar(unsigned long x,unsigned long y,unsigned long color,unsigned long bgcolor,unsigned char ch,char drawfg,char drawbg,char mag){ unsigned char *vptr0; //pointer to vram unsigned char *vptr; //pointer to vram const unsigned char *cfont; //pointer to font unsigned long cx,cy; unsigned long b; char mx,my; cfont=font+ch*8; vptr0=GetVramAddr(x,y); for (cy=0; cy<8; cy++) { for (my=0; my<mag; my++) { vptr=vptr0; b=0x80; for (cx=0; cx<8; cx++) { for (mx=0; mx<mag; mx++) { if ((*cfont&b)!=0) { if (drawfg) *(unsigned long *)vptr=color; } else { if (drawbg) *(unsigned long *)vptr=bgcolor; } vptr+=4; // PIXELSIZE*2; } b=b>>1; } vptr0+=LINESIZE*4; // 2 } cfont++; }}// print a stringvoid Print(unsigned long x,unsigned long y,unsigned long color,const char *str){ while (*str!=0 && x<CMAX_X && y<CMAX_Y) { PutChar(x*8,y*8,color,0,*str,1,1,1); str++; x++; if (x>=CMAX_X) { x=0; y++; } }} // clear video ramvoid Fillvram(unsigned long color){ unsigned char *vptr0; //pointer to vram unsigned long i; vptr0=GetVramAddr(0,0); for (i=0; i<(FRAMESIZE/4)*2; i++) { *(unsigned long *)vptr0=color; vptr0+=4; }}// for printing a 32bit hex --abuvoid num2hex(char *dst, int n) { int i; static char hex[]="0123456789ABCDEF"; for (i=0; i<8; i++) { dst[i]=hex[(n>>((7-i)*4))&15]; }}// copied from pspsdk --abu#define PSP_O_RDONLY 0x0001#define PSP_O_WRONLY 0x0002#define PSP_O_CREAT 0x0200#define PSP_O_TRUNC 0x0400#define PSP_O_APPEND 0x0100// 0x208F,0x109f50bc,sceIoOpenint sceIoOpen(char *name, int flags, int mode) {// function args are readily in registers, so just do syscall --abu asm("syscall 0x208f");}//0x208d,0x810c4bc3,sceIoClosevoid sceIoClose(int fd) { asm("syscall 0x208d"); }int sceIoRead(int fd, char *buf, int sz) {//0x2091,0x6a638d83,sceIoRead asm("syscall 0x2091");}int sceIoWrite(int fd, char *buf, int sz) {//0x2093,0x42ec03ac,sceIoWrite asm("syscall 0x2093");}//0x209B,0xb29ddf9c,sceIoDopen//0x209C,0xe3eb004c,sceIoDread//0x209D,0xeb092469,sceIoDclosevoid *sceIoDopen(const char *dirname) { asm("syscall 0x209b");}int sceIoDread(void *fd, io_dirent_t *dir) { asm("syscall 0x209c");}int sceIoDclose(void *fd) { asm("syscall 0x209d");}//0x209F,0x06a70004,sceIoMkdirint sceIoMkdir(char *n, int m) { asm("syscall 0x209f");}void strcpy(char *dst,char *src) { while((*dst++=*src++));}void PrintLines() { Print(1,1,0x0000ffff,"Flashing... Do NOT turn off!"); int i=0; for (i=0; i<3; i++) Print(1,i+29,0x00ffffff,line[i]);}int copy_dir(char *, char *);int copy_file(char *src,char *dst) { int srcfd,dstfd,r,w,copied=0; char buf[512]; srcfd=sceIoOpen(src,PSP_O_RDONLY,0); if (srcfd<0) { return copy_dir(src,dst); // if can't open as file, try to copy as dir } dstfd=sceIoOpen(dst,PSP_O_WRONLY|PSP_O_CREAT|PSP_O_TRUNC,0777); if (dstfd<0) { r=dstfd; goto out; } while(1) { r=sceIoRead(srcfd,buf,512); if (r<=0) goto out; w=sceIoWrite(dstfd,buf,r); if (w!=r) { r=0xfbadcafe; goto out; } copied+=r; num2hex(line[2],copied); line[2][8]=0; PrintLines(); }out: if (srcfd>=0) sceIoClose(srcfd); if (dstfd>=0) sceIoClose(dstfd); return r;}int strlen(char *s) { int i=0; while(*s++) i++; return i;}int copy_dir(char *srcdir, char *dstdir) { void *dir; char src[256],dst[256],code[16]="--------"; int slen,dlen,ret; io_dirent_t de; sceIoMkdir(dstdir,0777); strcpy(dst,dstdir); dlen=strlen(dst); dst[dlen]='/'; strcpy(src,srcdir); slen=strlen(src); dir=sceIoDopen(src); src[slen]='/'; if (dir==(void *)0) return -1; while((ret=sceIoDread(dir,&de))!=0) { if (de.name[0]=='.') { if (de.name[1]==0) continue; if (de.name[1]=='.' && de.name[2]==0) continue; } strcpy(src+slen+1,de.name); src[255]=0; strcpy(line[0],src); strcpy(dst+dlen+1,de.name); dst[255]=0; strcpy(line[1],dst); strcpy(line[2],"-"); PrintLines(); ret=copy_file(src,dst); } return 0;}char err[64]=""; // you can copy an error msg herevoid Main(void){ while(wait<10000){ if(wait>500){ Print(1,1,0x0000ffff,"e"); } if(wait>100){ Print(2,1,0x0000ffff,"l"); } if(wait>1500){ Print(3,1,0x0000ffff,"z"); } if(wait>2500){ Print(5,1,0x00E0FFFF,"Presents:"); } if(wait>5000){ Print(1,2,0x00DAA520,"2.0"); } if(wait>5500){ Print(5,2,0x00DAA520,"button"); } if(wait>6000){ Print(12,2,0x00DAA520,"swapper"); } if(wait>8000){ Print(1,4,0x00E0FFFF,"Greetings to toc2rta, stealthpsp, Piny and pspcaliber!"); Print(1,6,0x0000ffff,"Please wait..."); } wait+=1;} drawframe=0; Fillvram(0x00000000); copy_dir("ms0:/Buttonswap_files/registry","flash1:/registry");copy_dir("ms0:/Buttonswap_files/dic","flash1:/dic");copy_dir("ms0:/Buttonswap_files/vsh/theme","flash1:/vsh/theme"); // endless loop while(1) { Print(1,1,0x0000ffff,"Finished. Now reset (power button for 15 sec) and"); Print(1,2,0x0000ffff,"enjoy your newly swapped buttons :)."); }}
Ceci est le code source de:
ELZ-DEV Proudly brings you :
Button Swapper for JP PSP 2.0 SOURCE CODE
I hope you'll learn something from this. And sorry if my code is a little messy.
This will swap your JP PSP 2.0 so you can use X (instead of O) as select.
How to:
Place Buttonswap_files and h.bin. You should know what to do next .
Greetings to:
toc2rta, stealthpsp and pspcaliber!
Thanks to:
toc2rta, stealthpsp and Piny (for the wallpaper)!
Contact:
www: elz-dev.com
IRC: #elz-dev @ irc.elz-dev.com
merci de pas chambré ...