Was trying to convert an elf to cia.. i trimmed the elf and then it was saying something about elf text area not found
Was trying to convert an elf to cia.. i trimmed the elf and then it was saying something about elf text area not found
look for:
include $(DEVKITARM)/3ds_rules
add the following line underneath it:
include $(DEVKITARM)/3ds_rules2
look for:
all : $(OUTPUT).3dsx $(OUTPUT).smdh
change to:
all : $(OUTPUT).3dsx $(OUTPUT).smdh $(OUTPUT).3ds $(OUTPUT).cia
Ah thanks! that helped a ton.. game didnt work properly but its a step closer lol.. and i did strip the elf (which i see your rules set does anyways)-snip-
Is something changed in CSND module with the last ctrulib version?
I found a bug in my WAV stream function which i never saw with oldest ctrulib :/
void FillImageRect(int x1,int x2,int y1,int y2,u32 color,int screen){
if (x1 > x2){
int temp_x = x1;
x1 = x2;
x2 = temp_x;
}
if (y1 > y2){
int temp_y = y1;
y1 = y2;
y2 = temp_y;
}
int base_y = y1;
while (x1 <= x2){
while (y1 <= y2){
DrawImagePixel(x1,y1,color,(Bitmap*)screen);
y1++;
}
y1 = base_y;
x1++;
}
}
void FillAlphaImageRect(int x1,int x2,int y1,int y2,u32 color,int screen,u8 alpha){
if (x1 > x2){
int temp_x = x1;
x1 = x2;
x2 = temp_x;
}
if (y1 > y2){
int temp_y = y1;
y1 = y2;
y2 = temp_y;
}
int base_y = y1;
while (x1 <= x2){
while (y1 <= y2){
DrawAlphaImagePixel(x1,y1,color,(Bitmap*)screen,alpha);
y1++;
}
y1 = base_y;
x1++;
}
}
void FillScreenRect(int x1,int x2,int y1,int y2,u32 color,int screen,int side){
u8* buffer;
if (screen == 0){
if (side == 0) buffer = TopLFB;
else buffer = TopRFB;
}else if (screen == 1) buffer = BottomFB;
if (x1 > x2){
int temp_x = x1;
x1 = x2;
x2 = temp_x;
}
if (y1 > y2){
int temp_y = y1;
y1 = y2;
y2 = temp_y;
}
int base_y = y1;
while (x1 <= x2){
while (y1 <= y2){
DrawPixel(buffer,x1,y1,color);
y1++;
}
y1 = base_y;
x1++;
}
}
void FillAlphaScreenRect(int x1,int x2,int y1,int y2,u32 color,int screen,int side,u8 alpha){
u8* buffer;
if (screen == 0){
if (side == 0) buffer = TopLFB;
else buffer = TopRFB;
}else if (screen == 1) buffer = BottomFB;
if (x1 > x2){
int temp_x = x1;
x1 = x2;
x2 = temp_x;
}
if (y1 > y2){
int temp_y = y1;
y1 = y2;
y2 = temp_y;
}
int base_y = y1;
while (x1 <= x2){
while (y1 <= y2){
DrawAlphaPixel(buffer,x1,y1,color,alpha);
y1++;
}
y1 = base_y;
x1++;
}
}
void DrawScreenText(int x, int y, char* str, u32 color, int screen,int side){
u8* buffer;
if (screen == 0){
if (side == 0) buffer = TopLFB;
else buffer = TopRFB;
}else if (screen == 1) buffer = BottomFB;
unsigned short* ptr;
unsigned short glyphsize;
int i, cx, cy;
for (i = 0; str[i] != '\0'; i++)
{
if (str[i] < 0x21)
{
x += 6;
continue;
}
u16 ch = str[i];
if (ch > 0x7E) ch = 0x7F;
ptr = &font[(ch-0x20) << 4];
glyphsize = ptr[0];
if (!glyphsize)
{
x += 6;
continue;
}
x++;
for (cy = 0; cy < 12; cy++)
{
unsigned short val = ptr[4+cy];
for (cx = 0; cx < glyphsize; cx++)
{
if (val & (1 << cx))
DrawPixel(buffer, x+cx, y+cy, color);
}
}
x += glyphsize;
x++;
}
}
void DrawAlphaScreenText(int x, int y, char* str, u32 color, int screen,int side,u8 alpha){
u8* buffer;
if (screen == 0){
if (side == 0) buffer = TopLFB;
else buffer = TopRFB;
}else if (screen == 1) buffer = BottomFB;
unsigned short* ptr;
unsigned short glyphsize;
int i, cx, cy;
for (i = 0; str[i] != '\0'; i++)
{
if (str[i] < 0x21)
{
x += 6;
continue;
}
u16 ch = str[i];
if (ch > 0x7E) ch = 0x7F;
ptr = &font[(ch-0x20) << 4];
glyphsize = ptr[0];
if (!glyphsize)
{
x += 6;
continue;
}
x++;
for (cy = 0; cy < 12; cy++)
{
unsigned short val = ptr[4+cy];
for (cx = 0; cx < glyphsize; cx++)
{
if (val & (1 << cx))
DrawAlphaPixel(buffer, x+cx, y+cy, color, alpha);
}
}
x += glyphsize;
x++;
}
}
void DrawAlphaImageText(int x, int y, char* str, u32 color, int screen, u8 alpha){
unsigned short* ptr;
unsigned short glyphsize;
int i, cx, cy;
for (i = 0; str[i] != '\0'; i++)
{
if (str[i] < 0x21)
{
x += 6;
continue;
}
u16 ch = str[i];
if (ch > 0x7E) ch = 0x7F;
ptr = &font[(ch-0x20) << 4];
glyphsize = ptr[0];
if (!glyphsize)
{
x += 6;
continue;
}
x++;
for (cy = 0; cy < 12; cy++)
{
unsigned short val = ptr[4+cy];
for (cx = 0; cx < glyphsize; cx++)
{
if (val & (1 << cx))
DrawAlphaImagePixel(x+cx, y+cy, color, (Bitmap*)screen, alpha);
}
}
x += glyphsize;
x++;
}
}
void DrawImageText(int x, int y, char* str, u32 color, int screen){
unsigned short* ptr;
unsigned short glyphsize;
int i, cx, cy;
for (i = 0; str[i] != '\0'; i++)
{
if (str[i] < 0x21)
{
x += 6;
continue;
}
u16 ch = str[i];
if (ch > 0x7E) ch = 0x7F;
ptr = &font[(ch-0x20) << 4];
glyphsize = ptr[0];
if (!glyphsize)
{
x += 6;
continue;
}
x++;
for (cy = 0; cy < 12; cy++)
{
unsigned short val = ptr[4+cy];
for (cx = 0; cx < glyphsize; cx++)
{
if (val & (1 << cx))
DrawImagePixel(x+cx, y+cy, color, (Bitmap*)screen);
}
}
x += glyphsize;
x++;
}
}
Handle fileHandle;
FS_archive sdmcArchive=(FS_archive){ARCH_SDMC, (FS_path){PATH_EMPTY, 1, (u8*)""}};
FS_path filePath=FS_makePath(PATH_CHAR, "/test.txt");
FSUSER_DeleteFile(fileHandle,sdmcArchive,filePath);
svcCloseHandle(fileHandle);
Does someone know why FSUSER_DeleteFile doesn't work for me?
Code:Handle fileHandle; FS_archive sdmcArchive=(FS_archive){ARCH_SDMC, (FS_path){PATH_EMPTY, 1, (u8*)""}}; FS_path filePath=FS_makePath(PATH_CHAR, "/test.txt"); FSUSER_DeleteFile(fileHandle,sdmcArchive,filePath); svcCloseHandle(fileHandle);
Same issue with RenameDir,RenameFile,DeleteDirectory :/
fsInit(); // probably this is in the beginning of your main func
...
FSUSER_OpenArchive(NULL, &sdmcArchive);
/* Simple BMPV Encoder by Rinnegatamante */
#include <stdio.h>
#include <sys/types.h>
#include <dirent.h>
#include <string.h>
#include <stdlib.h>
int main(int argc,char *argv[]){
FILE* output = fopen("output.bmpv", "w");
fwrite("BMPV",1,4,output);
DIR* temp = opendir("./temp");
char* p;
unsigned long width = 0;
unsigned long height = 0;
unsigned long framerate = atoi(argv[1]);
unsigned long samplerate;
unsigned short bytepersample;
unsigned short audiotype;
unsigned long audiosize;
struct dirent *file;
while (file = readdir(temp)){
char* name = file->d_name;
if (strcmp(name,"audio.wav") == 0){
FILE* input_audio = fopen("./temp/audio.wav","r");
fseek(input_audio, 22, SEEK_SET);
fread(&audiotype, 2, 1, input_audio);
fread(&samplerate, 2, 1, input_audio);
fseek(input_audio, 32, SEEK_SET);
fread(&bytepersample, 2, 1, input_audio);
fseek(input_audio, 16, SEEK_SET);
unsigned long chunk = 0;
unsigned long jump = 0;
while (chunk != 0x61746164){
fread(&jump, 4, 1, input_audio);
fseek(input_audio,jump,SEEK_CUR);
fread(&chunk, 4, 1, input_audio);
}
int read_start = ftell(input_audio) + 4;
fseek(input_audio, 0, SEEK_END);
int size = ftell(input_audio);
audiosize = size - read_start;
char* audio_buffer = (char*)malloc(audiosize);
fseek(input_audio, read_start, SEEK_SET);
fread(audio_buffer, 1, audiosize, input_audio);
fclose(input_audio);
}
else if (strcmp(name,".") == 0) continue;
else if (strcmp(name,"..") == 0) continue;
else{
char* filename;
strcpy(filename,"./temp/");
strcat(filename,name);
FILE* input_frame = fopen(filename,"r");
if (width == 0){
fseek(input_frame,0x12,SEEK_SET);
fread(&width, 4, 1, input_frame);
fread(&height, 4, 1, input_frame);
fwrite(&framerate, 4, 1, output);
fwrite(&width, 4, 1, output);
fwrite(&height, 4, 1, output);
fwrite(&audiotype, 2, 1, output);
fwrite(&bytepersample, 2, 1, output);
fwrite(&samplerate, 4, 1, output);
fwrite(&audiosize, 4, 1, output);
fwrite(&audio_buffer, audiosize, 1, output);
}
char* buffer = (char*)malloc(width*height*3);
fseek(input_frame,0x36,SEEK_SET);
fread(buffer, 1, width*height*3, input_frame);
fclose(input_frame);
fwrite(buffer,1, width*height*3, output);
free(buffer);
}
}
fclose(output);
}
Exception: STATUS_ACCESS_VIOLATION at rip=0018016ADA7
rax=0000000000000000 rbx=000000000022AAF0 rcx=0000000000000001
rdx=0000000000000000 rsi=00000001801C905F rdi=000000000022AB38
r8 =0000000000000000 r9 =000000000000000A r10=0000000000230000
r11=000000010040112E r12=0000000000000001 r13=0000000000000000
r14=0000000000000000 r15=000000000022AB38
rbp=000000000022AA70 rsp=000000000022A968
program=C:\Users\Alessio\Desktop\vid2bmpv\a.exe, pid 7480, thread main
cs=0033 ds=002B es=002B fs=0053 gs=002B ss=002B
Stack trace:
Frame Function Args
0000022AA70 0018016ADA7 (00600028CB0, 00600043D38, 0000022AAF0, 00600028CB0)
0000022AA70 00180164D91 (0000022D6C0, 001802BF600, 0000022AA38, 00180174D30)
0000022AA70 00100401155 (0000022AAF0, FF0700010302FF00, 00180048270, 00180047410)
0000022AB90 001800482E1 (00000000000, 00000000000, 00000000000, 00000000000)
00000000000 0018004619B (31000000000000, 30003900370039, 30003000310031, 00000000031)
00000000000 001800462F4 (00000000000, 00000000000, 00000000000, 00000000000)
00000000000 00100401551 (00000000000, 00000000000, 00000000000, 00000000000)
00000000000 00100401010 (00000000000, 00000000000, 00000000000, 00000000000)
00000000000 00076AE59ED (00000000000, 00000000000, 00000000000, 00000000000)
00000000000 00076D1C541 (00000000000, 00000000000, 00000000000, 00000000000)
End of stack trace
Well, ninjhax uses a hb service that smea somehow added...Hey guys, I was wondering if it was technically possible to have background running homebrews, like services.
It'd be really useful, but I can't find any infos on google. Asking anyway.
It's not related to 3DS programming directly but i'm having a little problem writing a cmd executable, i get a stackdump caused by my access to argv (if i comment framerate line, i get no stackdump error).
Here's my source:
Code:/* Simple BMPV Encoder by Rinnegatamante */ ...
Does someone knows how to solve?
#include <stdio.h>
#include <sys/types.h>
#include <dirent.h>
#include <string.h>
#include <stdlib.h>
int main(int argc,char *argv[]){
unsigned long framerate = atoi(argv[1]);
printf("%i", framerate);
}
Any possibility of being able to change your primary Mii into a "Special Mii"? Ya know, the one's with the gold pants? Would be cool to Streetpass people, and it say "You found a special Mii!" on their screen for your avatar.
offset = ???
memcpy(buffer+offset, result->pixels, result->width*result->height*3);