main.c
c:/devkitPro/programas/Nuevo1/source/main.c: In function 'main':
c:/devkitPro/programas/Nuevo1/source/main.c:11: warning: implicit declaration of function 'PA_InitSound'
c:/devkitPro/programas/Nuevo1/source/main.c:21:33: error: macro "PA_PlaySimpleSound" passed 2 arguments, but takes just 1
c:/devkitPro/programas/Nuevo1/source/main.c:21: error: 'PA_PlaySimpleSound' undeclared (first use in this function)
c:/devkitPro/programas/Nuevo1/source/main.c:21: error: (Each undeclared identifier is reported only once
c:/devkitPro/programas/Nuevo1/source/main.c:21: error: for each function it appears in.)
make[1]: *** [main.o] Error 1
make: *** [build] Error 2
// Includes
#include <PA9.h> // Include de las PA_Lib
#include "sonido.h" // Incluimos el sonido
// Funcion main
int main(int argc, char ** argv)
{
PA_Init(); // Iniciamos las PA_Lib
PA_InitVBL(); // Iniciamos VBL
PA_InitSound(); //Iniciamos sonido
// Bucle
while (1)
{
//Si pulsamos A...
if (Pad.Newpress.A)
{
PA_PlaySimpleSound(0, sonido);//...reproducimos el sonido
}
if (Pad.Newpress.B)//Si pulsamos B...
{
PA_StopSound(//...paramos el sonido...
0); //...que se reproduce en el canal 0
}
PA_WaitForVBL();
}
return 0;
} // Fin de main
main.c
c:/devkitPro/programas/Nuevo1/source/main.c: In function 'main':
c:/devkitPro/programas/Nuevo1/source/main.c:11: warning: implicit declaration of function 'PA_InitSound'
arm-eabi-g++ -g -mthumb-interwork -mno-fpu -L/C/devkitPro/palib/lib/lib -Wl -specs=ds_arm9.specs sonido.o main.o -L/C/devkitPro/palib/lib/lib -lpa9 -L/c/devkitPro/libnds/lib -lfat -lnds9 -ldswifi9 -o build.elf
main.o: In function `main':
c:/devkitPro/programas/Nuevo1/source/main.c:11: undefined reference to `PA_InitSound'
collect2: ld returned 1 exit status
make[1]: *** [/c/devkitPro/programas/Nuevo1/Nuevo1.elf] Error 1
make: *** [build] Error 2
PA_InitSound();
PA_InitASLibForSounds(AS_MODE_SURROUND | AS_MODE_16CH);
AS_SetDefaultSettings(AS_PCM_16BIT, 11025, AS_SURROUND);
ChangeLog PAlib escribió:Updated Oldies
--------------
[Installer] Updated the PAlib installer. All items are now optional and the root path is user-selectable.
[AS_Lib/Sound] Noda provided a new AS_Lib version and defines for EFS were removed. Using ASlib with EFSlib v2 now only requires including the efs_lib.c/.h files in your project.
[Sound] PA_InitASLibForSounds, PA_InitASLibForMP3 and PA_InitSound have been removed. You should now use the following methods to initialize AS_Lib in the mode you desire:
/* Init AS_Lib for mp3s */
PA_VBLFunctionInit(AS_SoundVBL); // easy way to make sure that AS_SoundVBL() is called every frame
AS_Init(AS_MODE_MP3 | AS_MODE_SURROUND | AS_MODE_16CH); // initializes AS_Lib
AS_SetDefaultSettings(AS_PCM_8BIT, 11025, AS_SURROUND); // or your preferred default sound settings
or
/* Init AS_Lib for sounds only */
AS_Init(AS_MODE_SURROUND | AS_MODE_16CH); // initializes AS_Lib
AS_SetDefaultSettings(AS_PCM_8BIT, 11025, AS_SURROUND); // or your preferred default sound settings
PA_PlaySimpleSound(sonido);
AS_Init(AS_MODE_SURROUND | AS_MODE_16CH); // initializes AS_Lib
AS_SetDefaultSettings(AS_PCM_8BIT, 11025, AS_SURROUND); // or your preferred default sound settings
// Includes
#include <PA9.h> // Include for PA_Lib
#include "sonido.h"
#include "gfx/all_gfx.c"
#include "gfx/all_gfx.h"
// Function: main()
int main(int argc, char ** argv)
{
PA_Init(); // Initializes PA_Lib
PA_InitVBL(); // Initializes a standard VBL
AS_Init(AS_MODE_SURROUND | AS_MODE_16CH); // initializes AS_Lib
AS_SetDefaultSettings(AS_PCM_8BIT, 11025, AS_SURROUND); // or your preferred default sound settings
PA_LoadSpritePal(0,0,(void*)sprite0_Pal);
PA_CreateSprite(0,0,(void*)boton_Sprite,OBJ_SIZE_32X32,1,0,0,0);
// Infinite loop to keep the program running
while (1)
{
if((Stylus.Held) && PA_StylusInZone(0, 0, 32, 32)){
PA_PlaySimpleSound(sonido);
PA_SetSpriteAnim(0,0,1);
}
if((Stylus.Released)){
PA_SetSpriteAnim(0,0,0);
PA_StopSound(0);
}
PA_WaitForVBL();
}
return 0;
} // End of main()