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,650
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
  • TwoSpikedHands @ TwoSpikedHands:
    yall im torn... ive been hacking away at tales of phantasia GBA (the USA version) and have so many documents of reverse engineering i've done
  • TwoSpikedHands @ TwoSpikedHands:
    I just found out that the EU version is better in literally every way, better sound quality, better lighting, and there's even a patch someone made to make the text look nicer
  • TwoSpikedHands @ TwoSpikedHands:
    Do I restart now using what i've learned on the EU version since it's a better overall experience? or do I continue with the US version since that is what ive been using, and if someone decides to play my hack, it would most likely be that version?
  • Sicklyboy @ Sicklyboy:
    @TwoSpikedHands, I'll preface this with the fact that I know nothing about the game, but, I think it depends on what your goals are. Are you trying to make a definitive version of the game? You may want to refocus your efforts on the EU version then. Or, are you trying to make a better US version? In which case, the only way to make a better US version is to keep on plugging away at that one ;)
  • Sicklyboy @ Sicklyboy:
    I'm not familiar with the technicalities of the differences between the two versions, but I'm wondering if at least some of those differences are things that you could port over to the US version in your patch without having to include copyrighted assets from the EU version
  • TwoSpikedHands @ TwoSpikedHands:
    @Sicklyboy I am wanting to fully change the game and bend it to my will lol. I would like to eventually have the ability to add more characters, enemies, even have a completely different story if i wanted. I already have the ability to change the tilemaps in the US version, so I can basically make my own map and warp to it in game - so I'm pretty far into it!
  • TwoSpikedHands @ TwoSpikedHands:
    I really would like to make a hack that I would enjoy playing, and maybe other people would too. swapping to the EU version would also mean my US friends could not legally play it
  • TwoSpikedHands @ TwoSpikedHands:
    I am definitely considering porting over some of the EU features without using the actual ROM itself, tbh that would probably be the best way to go about it... but i'm sad that the voice acting is so.... not good on the US version. May not be a way around that though
  • TwoSpikedHands @ TwoSpikedHands:
    I appreciate the insight!
  • The Real Jdbye @ The Real Jdbye:
    @TwoSpikedHands just switch, all the knowledge you learned still applies and most of the code and assets should be the same anyway
  • The Real Jdbye @ The Real Jdbye:
    and realistically they wouldn't

    be able to play it legally anyway since they need a ROM and they probably don't have the means to dump it themselves
  • The Real Jdbye @ The Real Jdbye:
    why the shit does the shitbox randomly insert newlines in my messages
  • Veho @ Veho:
    It does that when I edit a post.
  • Veho @ Veho:
    It inserts a newline in a random spot.
  • The Real Jdbye @ The Real Jdbye:
    never had that i don't think
  • Karma177 @ Karma177:
    do y'all think having an sd card that has a write speed of 700kb/s is a bad idea?
    trying to restore emunand rn but it's taking ages... (also when I finished the first time hekate decided to delete all my fucking files :wacko:)
  • The Real Jdbye @ The Real Jdbye:
    @Karma177 that sd card is 100% faulty so yes, its a bad idea
  • The Real Jdbye @ The Real Jdbye:
    even the slowest non-sdhc sd cards are a few MB/s
  • Karma177 @ Karma177:
    @The Real Jdbye it hasn't given me any error trying to write things on it so I don't really think it's faulty (pasted 40/50gb+ folders and no write errors)
  • DinohScene @ DinohScene:
    run h2testw on it
    +1
  • DinohScene @ DinohScene:
    when SD cards/microSD write speeds drop below a meg a sec, they're usually on the verge of dying
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    Samsung SD format can sometimes fix them too
  • Purple_Heart @ Purple_Heart:
    yes looks like an faulty sd
  • Purple_Heart @ Purple_Heart:
    @Psionic Roshambo i may try that with my dead sd cards
    Purple_Heart @ Purple_Heart: @Psionic Roshambo i may try that with my dead sd cards