Homebrew Homebrew Development

yodamerlin

Bok bok.
Member
Joined
Apr 1, 2014
Messages
322
Trophies
0
XP
1,050
Country
United Kingdom
at least now you can fix the behavior and display.
If you want, I can test it on my console.

Well, here's the compiled version. There is one thing that doesn't work on the emulator and that's the wave part.

I think I am almost there.
Currently I get this error:
hPSNuNV.png

I typed "make" in cmd, and it shows the appropriate message:
"make: *** No targets specified and no makefile found. Stop."

What am I missing? Python seems to be installed correctly, Netbeans configured properly, and ENV VARS all good to go (though I could be wrong).

I'd assume it is just as the error states, there is no makefile. What are you trying to compile?
 

Attachments

  • wave.zip
    71.3 KB · Views: 165

Rinnegatamante

Well-Known Member
Member
Joined
Nov 24, 2014
Messages
3,162
Trophies
2
Age
29
Location
Bologna
Website
rinnegatamante.it
XP
4,857
Country
Italy
Mmhhh i don't know why it doesn't work, it seems all wav settings are right :/
This is the wav file i used for the sample script: http://rinnegatamante.netsons.org/blood.wav

(To extract wav files i used for my samples i used ffmpeg)

It seems i found a bug in my openWav function (i was using an old version of my interpreter for my tests where header was read statically and not dinamically so i hadn't see this mistake :/ )... Try this,replace this:


Code:
    pos=pos+jump;

With this:
Code:
    pos=pos+4+jump;

Remember to use only mono wav files, stereo wav audio will be broken for now, i'm working to add stereo support.
 

Cyan

GBATemp's lurking knight
Former Staff
Joined
Oct 27, 2002
Messages
23,749
Trophies
4
Age
45
Location
Engine room, learning
XP
15,648
Country
France
Well, here's the compiled version. There is one thing that doesn't work on the emulator and that's the wave part.
Press A stops the movement instead of making it slow.

The cubes are moving very fast and are very spaced from each others.
maybe that's why you don't see the "wave", each dots are moving too fast to see them on screen?

collision detection is working.
 

yodamerlin

Bok bok.
Member
Joined
Apr 1, 2014
Messages
322
Trophies
0
XP
1,050
Country
United Kingdom
Press A stops the movement instead of making it slow.

The cubes are moving very fast and are very spaced from each others.
maybe that's why you don't see the "wave", each dots are moving too fast to see them on screen?

collision detection is working.
They move 2 pixels each frame. I think there are 60 frames per second byt I think this is too much for wave.
 

xem

Well-Known Member
Member
Joined
Nov 22, 2014
Messages
142
Trophies
0
Age
36
Location
Valbonne
XP
333
Country
France
Goodnight sirs,
Can someone tell me the (technical) reason why on new 3DS, homebrews can't have sound yet, and if we can keep hope for sound working on new 3DS in the future?
Thanks!
 

CalebW

Fellow Temper
Member
Joined
Jun 29, 2012
Messages
638
Trophies
0
Location
Texas
XP
545
Country
United States
I get
Code:
src/arm11/armemu.o: In function `ARMul_Emulate32':
/home/caleb/Github/3dmoo/src/arm11/armemu.c:451: undefined reference to `gdb_memio'
/home/caleb/Github/3dmoo/src/arm11/armemu.c:451: undefined reference to `gdb_memio'
/home/caleb/Github/3dmoo/src/arm11/armemu.c:453: undefined reference to `gdb_memio'
/home/caleb/Github/3dmoo/src/arm11/armemu.c:453: undefined reference to `gdb_memio'
/home/caleb/Github/3dmoo/src/arm11/armemu.c:461: undefined reference to `gdb_memio'
src/arm11/armemu.o:/home/caleb/Github/3dmoo/src/arm11/armemu.c:461: more undefined references to `gdb_memio' follow
collect2: error: ld returned 1 exit status
make: *** [test] Error 1
when trying to compile 3dmoo...anybody know what the issue is?
 

Agent Moose

Well-Known Member
Member
Joined
Dec 6, 2014
Messages
407
Trophies
0
Age
33
XP
552
Country
United States
It seems i found a bug in my openWav function (i was using an old version of my interpreter for my tests where header was read statically and not dinamically so i hadn't see this mistake :/ )... Try this,replace this:


Code:
    pos=pos+jump;

With this:
Code:
    pos=pos+4+jump;

Remember to use only mono wav files, stereo wav audio will be broken for now, i'm working to add stereo support.
I changed that in my sound test file and it still froze. And blargSNES' sound works for me, so I'm going to try taking a look at the source sometime.
Code:
#include <string.h>

#include <3ds.h>

u8* audiobuf;

int main()
{
    // Initialize services
    srvInit();
    aptInit();
    hidInit(NULL);
    gfxInit();
    fsInit();
    CSND_initialize(NULL);
    //gfxSet3D(true); // uncomment if using stereoscopic 3D
    
    
    u64 size;
    u32 magic, samplerate, bytesRead, jump, chunk=0x00000000;
    u32 pos = 16;
    const char *file_tbo = "/canary.wav";
    Handle fileHandle;
    
    //Open wav file
    FS_archive sdmcArchive=(FS_archive){ARCH_SDMC, (FS_path){PATH_EMPTY, 1, (u8*)""}};
    FS_path filePath=FS_makePath(PATH_CHAR, file_tbo);
    Result ret=FSUSER_OpenFileDirectly(NULL, &fileHandle, sdmcArchive, filePath, FS_OPEN_READ, FS_ATTRIBUTE_NONE);
    FSFILE_Read(fileHandle, &bytesRead, 0, &magic, 4);
    if (magic == 0x46464952){
        while (chunk != 0x61746164){
            FSFILE_Read(fileHandle, &bytesRead, pos, &jump, 4);
            pos=pos+4+jump;
            FSFILE_Read(fileHandle, &bytesRead, pos, &chunk, 4);
            pos=pos+4;
        }
        FSFILE_GetSize(fileHandle, &size);
        audiobuf = (u8*)linearAlloc(size-(pos+4));
        FSFILE_Read(fileHandle, &bytesRead, 24, &samplerate, 4);
        FSFILE_Read(fileHandle, &bytesRead, pos+4, audiobuf, size-(pos+4));
    }
    FSFILE_Close(fileHandle);

    // Main loop
    while (aptMainLoop())
    {
        gspWaitForVBlank();
        hidScanInput();

        u32 kDown = hidKeysDown();
        if (kDown & KEY_START){
            break;
        };
        
        //Start wav file
        if(hidKeysUp() & KEY_A){
            CSND_playsound(0x8, CSND_LOOP_DISABLE, CSND_ENCODING_PCM16, samplerate, (u32*)audiobuf, NULL, size-(pos+4), 2, 0);
        };
        
        // Flush and swap framebuffers
        gfxFlushBuffers();
        gfxSwapBuffers();
    }
    linearFree(audiobuf);
    CSND_shutdown();
    svcCloseHandle(fileHandle);
    // Exit services
    fsExit();
    gfxExit();
    hidExit();
    aptExit();
    srvExit();
    return 0;
}
 

Rinnegatamante

Well-Known Member
Member
Joined
Nov 24, 2014
Messages
3,162
Trophies
2
Age
29
Location
Bologna
Website
rinnegatamante.it
XP
4,857
Country
Italy
I changed that in my sound test file and it still froze. And blargSNES' sound works for me, so I'm going to try taking a look at the source sometime.
Code:
#include <string.h>
 
#include <3ds.h>
 
u8* audiobuf;
 
int main()
{
    // Initialize services
    srvInit();
    aptInit();
    hidInit(NULL);
    gfxInit();
    fsInit();
    CSND_initialize(NULL);
    //gfxSet3D(true); // uncomment if using stereoscopic 3D
 
 
    u64 size;
    u32 magic, samplerate, bytesRead, jump, chunk=0x00000000;
    u32 pos = 16;
    const char *file_tbo = "/canary.wav";
    Handle fileHandle;
 
    //Open wav file
    FS_archive sdmcArchive=(FS_archive){ARCH_SDMC, (FS_path){PATH_EMPTY, 1, (u8*)""}};
    FS_path filePath=FS_makePath(PATH_CHAR, file_tbo);
    Result ret=FSUSER_OpenFileDirectly(NULL, &fileHandle, sdmcArchive, filePath, FS_OPEN_READ, FS_ATTRIBUTE_NONE);
    FSFILE_Read(fileHandle, &bytesRead, 0, &magic, 4);
    if (magic == 0x46464952){
        while (chunk != 0x61746164){
            FSFILE_Read(fileHandle, &bytesRead, pos, &jump, 4);
            pos=pos+4+jump;
            FSFILE_Read(fileHandle, &bytesRead, pos, &chunk, 4);
            pos=pos+4;
        }
        FSFILE_GetSize(fileHandle, &size);
        audiobuf = (u8*)linearAlloc(size-(pos+4));
        FSFILE_Read(fileHandle, &bytesRead, 24, &samplerate, 4);
        FSFILE_Read(fileHandle, &bytesRead, pos+4, audiobuf, size-(pos+4));
    }
    FSFILE_Close(fileHandle);
 
    // Main loop
    while (aptMainLoop())
    {
        gspWaitForVBlank();
        hidScanInput();
 
        u32 kDown = hidKeysDown();
        if (kDown & KEY_START){
            break;
        };
     
        //Start wav file
        if(hidKeysUp() & KEY_A){
            CSND_playsound(0x8, CSND_LOOP_DISABLE, CSND_ENCODING_PCM16, samplerate, (u32*)audiobuf, NULL, size-(pos+4), 2, 0);
        };
     
        // Flush and swap framebuffers
        gfxFlushBuffers();
        gfxSwapBuffers();
    }
    linearFree(audiobuf);
    CSND_shutdown();
    svcCloseHandle(fileHandle);
    // Exit services
    fsExit();
    gfxExit();
    hidExit();
    aptExit();
    srvExit();
    return 0;
}

Add this before playsound:
Code:
GSPGPU_FlushDataCache(NULL, audiobuf, size-(pos+4));

Does exist some kind of limitation for FSFILE_Read function? I'm working to reproduce stereo wav files but it seems this cycle never end, if i comment the FSFILE_Read calls, it ends fine):
Code:
wav_file->audiobuf = (u8*)linearAlloc((size-(pos+4))/2);
    wav_file->audiobuf2 = (u8*)linearAlloc((size-(pos+4))/2);
    wav_file->size = (size-(pos+4))/2;
    u16 bytepersample;
    int sample;
    FSFILE_Read(fileHandle, &bytesRead, 32, &bytepersample, 2);
    bytepersample = bytepersample / 2;
    int i = pos+4;
    int j = 0;
    while (i < size){
    FSFILE_Read(fileHandle, &bytesRead, i, &sample, bytepersample);
    wav_file->audiobuf[j] = sample;
    i=i+bytepersample;
    FSFILE_Read(fileHandle, &bytesRead, i, &sample, bytepersample);
    wav_file->audiobuf2[j] = sample;
    i=i+bytepersample;
    j=j+bytepersample;
    }
 

ichichfly

Well-Known Member
Member
Joined
Sep 23, 2009
Messages
619
Trophies
1
XP
1,075
Country
Gambia, The
I get
Code:
src/arm11/armemu.o: In function `ARMul_Emulate32':
/home/caleb/Github/3dmoo/src/arm11/armemu.c:451: undefined reference to `gdb_memio'
/home/caleb/Github/3dmoo/src/arm11/armemu.c:451: undefined reference to `gdb_memio'
/home/caleb/Github/3dmoo/src/arm11/armemu.c:453: undefined reference to `gdb_memio'
/home/caleb/Github/3dmoo/src/arm11/armemu.c:453: undefined reference to `gdb_memio'
/home/caleb/Github/3dmoo/src/arm11/armemu.c:461: undefined reference to `gdb_memio'
src/arm11/armemu.o:/home/caleb/Github/3dmoo/src/arm11/armemu.c:461: more undefined references to `gdb_memio' follow
collect2: error: ld returned 1 exit status
make: *** [test] Error 1
when trying to compile 3dmoo...anybody know what the issue is?
try to compile it without the GDB stub
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    SylverReZ @ SylverReZ: https://www.youtube.com/watch?v=hke2YUirpf4 +1