160 likes | 329 Views
Palib_PAFS NDSL 파일 시스템. 박진 수. PAFS. it’s just a different way to add files to your rom 4MB size limit…. PAFS. 필요한 파일들 PAFS.exe PAFS.log PAFS.bat 형식 : PAFS [NDS 파일 ] [ 폴더 ] [ 옵션 ]. EX) PAFS PAFS.ds.gba Files/ /silence PAFS PAFS.nds Files/ /silence. Files. PA_FSInit ();
E N D
PAFS • it’s just a different way to add files to your rom • 4MB size limit…
PAFS • 필요한 파일들 • PAFS.exe • PAFS.log • PAFS.bat • 형식 : PAFS [NDS파일] [폴더] [옵션] EX) PAFS PAFS.ds.gba Files/ /silence PAFS PAFS.nds Files/ /silence
Files • PA_FSInit(); • ROM의 파일을 읽어옴 • PA_PAFSFile(0) • 파일의 내용
Files • PA_FSFile[i].Name • 파일명 • PA_FSFile[i].Ext • 확장자 • PA_FSFile[i].Length • 크기 • PA_FSFile[i].FilePos • 파일포인터
Directory • PA_FSFolder[i].Name • 디렉토리명 • PA_FSFolder[i].Nfolders • 디렉토리안의디렉토리 수 • PA_FSFolder[i].Nfiles • 디렉토리안의 파일의 수
Directory u16 foldery = 6; // Where to write the folder names u16 indent = 0; void WriteFolders(u16 N){ // Recursive function to write the number of folders u16 Nfolder = N; PA_OutputText(1, indent, foldery, "%s : %d folders, %d files", PA_FSFolder[Nfolder].Name, PA_FSFolder[Nfolder].NFolders, PA_FSFolder[Nfolder].NFiles); foldery++; if (PA_FSFolder[Nfolder].NFolders > 0){ indent+=2; // Indents for the subfolders s32 k; for (k = 0; k < PA_FSFolder[Nfolder].NFolders; k++){ WriteFolders(PA_FSFolder[Nfolder].FirstFolder + k); } indent -= 2; } }
RAM • PAFS stored the files in the rom instead of the ram • first one being the 4MB maximum size for the rom • second being that you have to specify in your code how much memory you want to give to the user • If you don’t specify enough, it won’t work...
RAM • PA_FSRam(100000); • it tells PAFS how much memory you give him • PAFSStart = (char*)PA_FileSystem; • it means “PAFS starts in the ram...” • FSRamInit • It’s a special init to look for PAFS directly in the ram
libFAT • microSD -> FAT 16 • libFAT : read and write on a disc FAT
libFAT • fatInitDefault(); //Initialise fat library • Init FAT library • DIR_ITER* dir = diropen("/"); • dirnext(dir, filename, &st) • st.st_mode • File or Directory
libFAT • http://irmus.tistory.com/tag/NDS%20Homebrew
3D_Functions 박진수
PA_3D.h -> PA_3DSprites.h • This tutorial is out of date and does not work with the newest version of Palib • PA_3DSprites.h • Sprite 의 깊이 등의 3D 조정.
PA_Init3D(); • Uses Bg0, Init 3D • PA_Reset3DSprites(); • Init or Reset 3D Sprites • PA_3DCreateTex((void*)mollusk_Texture, 64, 64, TEX_256COL ); • Texture, Width, Height, Texture Format • TEX_256COL, TEX_16BITS • PA_Load3DSpritePal(0, (void*)mollusk_Pal); • Slot, Pallete • PA_3DCreateSpriteFromTex(1, gfx[1], 64, 64, 1, 96, 96); • Sprinte Number, Gfx, Width, Height, Pallete, X, Y • X, Y Sprite CENTER • PA_3DSetSpriteXY(0, Stylus.X, Stylus.Y) • Sprite Number, X, Y