- Joined
- Nov 24, 2014
- Messages
- 3,162
- Trophies
- 2
- Age
- 29
- Location
- Bologna
- Website
- rinnegatamante.it
- XP
- 4,857
- Country
Stdio is just a wrapper around FS. I imagine it would depend on the mode.Is a file openable through FS and stdio both at the same time?
Stdio is just a wrapper around FS. I imagine it would depend on the mode.
The current release and the git version of ctrulib already call sdmcInit for you. So you do not need to call it yourself. They also protect against multiple init calls so it will not hurt to call it multiple times. Are you using a really old version of ctrulib?Seems to partially work if i use sdmcInit() just before using fopen but if i use sdmcInit at homebrew startup, it seems fopen fails to open any file. :/
The current release and the git version of ctrulib already call sdmcInit for you. So you do not need to call it yourself. They also protect against multiple init calls so it will not hurt to call it multiple times. Are you using a really old version of ctrulib?
#include <string.h>
#include <malloc.h>
#include <inttypes.h>
#include <stdio.h>
#include <3ds.h>
int main(int argc, char** argv) {
gfxInitDefault();
consoleInit(GFX_TOP, NULL);
fsInit();
Handle nandHandle;
Handle cardHandle;
Handle nandROHandle;
Handle nandRWHandle;
Handle bossHandle;
FS_archive CARD1 = (FS_archive){ARCH_CARD_SPIFS, (FS_path){PATH_WCHAR, 2, "/"}};
FS_archive rawNAND = (FS_archive){0x567890AF, (FS_path){PATH_WCHAR, 2, "/"}};
FS_archive NAND_RO = (FS_archive){ARCH_NAND_RO, (FS_path){PATH_EMPTY, 1, (u8*)""}};
FS_archive NAND_RW = (FS_archive){ARCH_NAND_RW, (FS_path){PATH_EMPTY, 1, (u8*)""}};
u32 extdata_archive_lowpathdata[3] = {mediatype_SDMC, 0x00000000 , 0};
FS_archive BOSS = (FS_archive){ARCH_BOSS_EXTDATA, (FS_path){PATH_BINARY, 0xC, (u8*)extdata_archive_lowpathdata}};
//Result NandAccess = FSUSER_OpenArchive(&nandHandle, &CARD1);
//Result CardAccess = FSUSER_OpenArchive(&cardHandle, &CARD1);
while (aptMainLoop()){
printf("Check access privileges...\n\n");
gfxFlushBuffers();
gfxSwapBuffers();
gspWaitForVBlank();
printf("RAW NAND: ");
Result rawNandAccess = FSUSER_OpenArchive(&nandHandle, &rawNAND);
if (!rawNandAccess) printf("OK!\n");
else printf("Error: 0x%X\n",rawNandAccess);
printf("RAW CARD1: ");
Result CardAccess = FSUSER_OpenArchive(&cardHandle, &CARD1);
if (!CardAccess) printf("OK!\n");
else printf("Error: 0x%X\n",CardAccess);
printf("NAND: R: ");
Result nandROAccess = FSUSER_OpenArchive(&nandROHandle, &NAND_RO);
if (!nandROAccess) printf("OK!");
else printf("Error: 0x%X",nandROAccess);
printf(" W: ");
Result nandRWAccess = FSUSER_OpenArchive(&nandRWHandle, &NAND_RW);
if (!nandRWAccess) printf("OK!\n");
else printf("Error: 0x%X\n",nandRWAccess);
printf("BOSS Extdata: ");
Result BOSSAccess = FSUSER_OpenArchive(&bossHandle, &BOSS);
if (!BOSSAccess) printf("OK!\n");
else printf("Error: 0x%X\n",BOSSAccess);
gfxFlushBuffers();
gfxSwapBuffers();
gspWaitForVBlank();
for (;;){
hidScanInput();
if (hidKeysDown() & KEY_A) break;
}
break;
}
fsExit();
gfxExit();
return 0;
}
Any reason you are holding out on updating ctrulib? The csnd stuff is not that different.
; -----------------------------------------------------------------------------
; Copyright 2014 StapleButter
;
; This file is part of blargSnes.
;
; blargSnes is free software: you can redistribute it and/or modify it under
; the terms of the GNU General Public License as published by the Free
; Software Foundation, either version 3 of the License, or (at your option)
; any later version.
;
; blargSnes is distributed in the hope that it will be useful, but WITHOUT ANY
; WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
; FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License along
; with blargSnes. If not, see http://www.gnu.org/licenses/.
; -----------------------------------------------------------------------------
; setup constants
.const c5, 0.0, 0.0, 0.0, 1.0
; setup outmap
.out o0, result.position, 0xF
.out o1, result.color, 0xF
.out o2, result.texcoord0, 0x3
; setup uniform map (not required)
.uniform c0, c3, projMtx
.vsh vmain, end_vmain
.gsh gmain, end_gmain
;code
vmain:
mov r1, v0 (0x4)
mov r1, c5 (0x3)
; result.pos = projMtx * in.pos
dp4 o0, c0, r1 (0x0)
dp4 o0, c1, r1 (0x1)
dp4 o0, c2, r1 (0x2)
dp4 o0, c3, r1 (0x3)
; result.texcoord = in.texcoord
mov o1, v1 (0x5)
end
nop
end_vmain:
gmain:
; turn two vertices into a rectangle
; setemit: vtxid, primemit, winding
; v0 = vertex 0, position
; v1 = vertex 0, texcoord
; v2 = vertex 1, position
; v3 = vertex 1, texcoord
; x1 y1
setemit vtx0, false, false
mov o0, v0 (0x5)
mov o1, c5 (0x8)
mov o2, v1 (0x5)
emit
; x2 y1
setemit vtx1, false, false
mov o0, v2 (0x6)
mov o0, v0 (0x7)
mov o1, c5 (0x8)
mov o2, v1 (0x6)
mov o2, v3 (0x7)
emit
; x1 y2
setemit vtx2, true, false
mov o0, v0 (0x6)
mov o0, v2 (0x7)
mov o1, c5 (0x8)
mov o2, v3 (0x6)
mov o2, v1 (0x7)
emit
; x2 y2
setemit vtx0, true, true
mov o0, v2 (0x5)
mov o1, c5 (0x8)
mov o2, v3 (0x5)
emit
end
nop
end_gmain:
;operand descriptors
.opdesc x___, xyzw, xyzw ; 0x0
.opdesc _y__, xyzw, xyzw ; 0x1
.opdesc __z_, xyzw, xyzw ; 0x2
.opdesc ___w, xyzw, xyzw ; 0x3
.opdesc xyz_, xyzw, xyzw ; 0x4
.opdesc xyzw, xyzw, xyzw ; 0x5
.opdesc x_zw, xyzw, xyzw ; 0x6
.opdesc _y__, yyyw, xyzw ; 0x7
.opdesc xyzw, wwww, wwww ; 0x8
What was the value being generated?
Are you using system ticks or ostimer for tracking sound position? I found that I had quite a bit of drift using that. I switched to using csndGetState. It returns the position in the loop. So it requires accumulating the difference over time to get an absolute position but I resolved the drift issue for me.
depending on the sound issues might not be easily heard. your audio and video seem to think the time is different. Did you verify that the end times agree for sound and video? Are you doing anything special when things get behind to sync back up?I'm using ostimer.
Audiobuffer for both Vorbis and PCM16 audiocodec are reproduced perfectly without any noise, overlap, etc...
echo vid2jpgv - JPGV Encoder
echo -----------------------
set /p input= "Insert input filename: "
set /p fps= "Insert framerate: "
set /p chn= "Insert audiochannels number: "
set /p res= "Insert resolution (HEIGHTxWIDTH): "
set /p smp= "Insert samplerate (Default: 44100): "
set /p ac= "Insert audiocodec (1 = PCM16, 2 = Vorbis): "
set /p vq= "Insert video quality (1 = HQ, 2 = LQ): "
echo Starting video extraction through ffmpeg, please wait...
IF %vq%==1 ffmpeg -i %input% -r %fps% -qscale:v 2 -vf "transpose=1" -s %res% "temp\output%%1d.jpg"
IF %vq%==2 ffmpeg -i %input% -r %fps% -vf "transpose=1" -s %res% "temp\output%%1d.jpg"
echo Starting audio extraction through ffmpeg, please wait...
IF %ac%==1 ffmpeg -i %input% -acodec pcm_s16le -ac %chn% -ar %smp% temp\audio.wav
IF %ac%==2 ffmpeg -i %input% -acodec: libvorbis -ac %chn% -ar %smp% -vn temp\audio.ogg
echo Starting video encoding, please wait...
jpgv_encoder.exe %fps%
echo Deleting temp files...
del /q ".\temp\*.*"
echo Video converted successfully, you'll find an output.jpgv file...
set /p dummy= "Press ENTER to exit"