kinski
04/10/2006, 15h22
Hello,
J'ai envie de poursuivre mon projet Wonderboy sur NDS plutot que sur GBA, et je fais quelques petits essais avec paLib.
Probleme; je suis incapable d'afficher correctement une map... Si vous voyez qqchose qui deconne dans mon code, ca me dépannerait bien!
main.c
#include <PA9.h>
#include "gfx/all_gfx.c"
#include "gfx/all_gfx.h"
int main(int argc, char ** argv) {
PA_Init();
PA_InitVBL();
PA_LoadPAGfxLargeBg(0, 3, map1);
PA_InitText(1,0);
s32 scrollx = 0;
s32 scrolly = 0;
while (1) {
scrollx += (Pad.Held.Right - Pad.Held.Left)*4;
scrolly += (Pad.Held.Down - Pad.Held.Up)*4;
PA_LargeScrollXY(0,3, scrollx, scrolly);
PA_OutputText(1,1,1,"X=%d Y=%d", scrollx, scrolly);
PA_WaitForVBL();
}
return 0;
}
all_gfx.h
//Gfx converted using Mollusk's PAGfxConverter
//This file contains all the .h, for easier inclusion in a project
// Background files :
extern const int map1_Width, map1_Height;
extern const unsigned short map1_Map[53040]; // Pal : map1_Pal
extern const unsigned char map1_Tiles[37056]; // Pal : map1_Pal
// Palette files :
extern const unsigned short map1_Pal[29];
Resultat :( : grosbug.nds (http://kinskifromfrance.free.fr/nds/LargeMaps2.nds)
Merci par avance :)
J'ai envie de poursuivre mon projet Wonderboy sur NDS plutot que sur GBA, et je fais quelques petits essais avec paLib.
Probleme; je suis incapable d'afficher correctement une map... Si vous voyez qqchose qui deconne dans mon code, ca me dépannerait bien!
main.c
#include <PA9.h>
#include "gfx/all_gfx.c"
#include "gfx/all_gfx.h"
int main(int argc, char ** argv) {
PA_Init();
PA_InitVBL();
PA_LoadPAGfxLargeBg(0, 3, map1);
PA_InitText(1,0);
s32 scrollx = 0;
s32 scrolly = 0;
while (1) {
scrollx += (Pad.Held.Right - Pad.Held.Left)*4;
scrolly += (Pad.Held.Down - Pad.Held.Up)*4;
PA_LargeScrollXY(0,3, scrollx, scrolly);
PA_OutputText(1,1,1,"X=%d Y=%d", scrollx, scrolly);
PA_WaitForVBL();
}
return 0;
}
all_gfx.h
//Gfx converted using Mollusk's PAGfxConverter
//This file contains all the .h, for easier inclusion in a project
// Background files :
extern const int map1_Width, map1_Height;
extern const unsigned short map1_Map[53040]; // Pal : map1_Pal
extern const unsigned char map1_Tiles[37056]; // Pal : map1_Pal
// Palette files :
extern const unsigned short map1_Pal[29];
Resultat :( : grosbug.nds (http://kinskifromfrance.free.fr/nds/LargeMaps2.nds)
Merci par avance :)