Well it depends on your motivation. But if you decode png through code, you can then easily modify your image on your needs in case it's not perfect on first try.
C:\devkitPro\examples\3ds\graphics\gpu\gpusprites>make
ballsprites.png
vshader.v.pica
lodepng.c
arm-none-eabi-gcc -MMD -MP -MF /c/devkitPro/examples/3ds/graphics/gpu/gpusprites/build/lodepng.d -g -Wall -O2 -mword-relocations -fomit-frame-pointer -ffunction-sections -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft -I/c/devkitPro/examples/3ds/graphics/gpu/gpusprites/include -I/c/devkitPro/libctru/include -I/c/devkitPro/examples/3ds/graphics/gpu/gpusprites/build -DARM11 -D_3DS -c /c/devkitPro/examples/3ds/graphics/gpu/gpusprites/source/lodepng.c -o lodepng.o
main.c
arm-none-eabi-gcc -MMD -MP -MF /c/devkitPro/examples/3ds/graphics/gpu/gpusprites/build/main.d -g -Wall -O2 -mword-relocations -fomit-frame-pointer -ffunction-sections -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft -I/c/devkitPro/examples/3ds/graphics/gpu/gpusprites/include -I/c/devkitPro/libctru/include -I/c/devkitPro/examples/3ds/graphics/gpu/gpusprites/build -DARM11 -D_3DS -c /c/devkitPro/examples/3ds/graphics/gpu/gpusprites/source/main.c -o main.o
c:/devkitPro/examples/3ds/graphics/gpu/gpusprites/source/main.c: In function 'sceneInit':
c:/devkitPro/examples/3ds/graphics/gpu/gpusprites/source/main.c:137:10: error: redeclaration of 'i' with no linkage
for(int i = 0; i<width*height; i++) {
^
c:/devkitPro/examples/3ds/graphics/gpu/gpusprites/source/main.c:100:6: note: previous declaration of 'i' was here
int i;
^
c:/devkitPro/examples/3ds/graphics/gpu/gpusprites/source/main.c:137:2: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
for(int i = 0; i<width*height; i++) {
^
c:/devkitPro/examples/3ds/graphics/gpu/gpusprites/source/main.c:137:2: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code
make[1]: *** [main.o] Error 1
make: *** [build] Error 2
Code:C:\devkitPro\examples\3ds\graphics\gpu\gpusprites>make ballsprites.png vshader.v.pica lodepng.c arm-none-eabi-gcc -MMD -MP -MF /c/devkitPro/examples/3ds/graphics/gpu/gpusprites/build/lodepng.d -g -Wall -O2 -mword-relocations -fomit-frame-pointer -ffunction-sections -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft -I/c/devkitPro/examples/3ds/graphics/gpu/gpusprites/include -I/c/devkitPro/libctru/include -I/c/devkitPro/examples/3ds/graphics/gpu/gpusprites/build -DARM11 -D_3DS -c /c/devkitPro/examples/3ds/graphics/gpu/gpusprites/source/lodepng.c -o lodepng.o main.c arm-none-eabi-gcc -MMD -MP -MF /c/devkitPro/examples/3ds/graphics/gpu/gpusprites/build/main.d -g -Wall -O2 -mword-relocations -fomit-frame-pointer -ffunction-sections -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft -I/c/devkitPro/examples/3ds/graphics/gpu/gpusprites/include -I/c/devkitPro/libctru/include -I/c/devkitPro/examples/3ds/graphics/gpu/gpusprites/build -DARM11 -D_3DS -c /c/devkitPro/examples/3ds/graphics/gpu/gpusprites/source/main.c -o main.o c:/devkitPro/examples/3ds/graphics/gpu/gpusprites/source/main.c: In function 'sceneInit': c:/devkitPro/examples/3ds/graphics/gpu/gpusprites/source/main.c:137:10: error: redeclaration of 'i' with no linkage for(int i = 0; i<width*height; i++) { ^ c:/devkitPro/examples/3ds/graphics/gpu/gpusprites/source/main.c:100:6: note: previous declaration of 'i' was here int i; ^ c:/devkitPro/examples/3ds/graphics/gpu/gpusprites/source/main.c:137:2: error: 'for' loop initial declarations are only allowed in C99 or C11 mode for(int i = 0; i<width*height; i++) { ^ c:/devkitPro/examples/3ds/graphics/gpu/gpusprites/source/main.c:137:2: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code make[1]: *** [main.o] Error 1 make: *** [build] Error 2
Anyone mind shining some light onto the situation? :/
I still don't understand... I don't seem to get a .bin file when I build the 24bit-color example.if you want your image to output as .bin offline you should rather look at this then :
devKitPro\examples\3ds\graphics\bitmap\24bit-color
gpusprites example is tiled into 1/4th of the image and it's loading a .png on runtime.
float* vert_args = (float*)res; // Hacky way to iterate in vertex struct
printf("writing vertex at ptr 0x%X\n",vert_args);
fflush(stdout);
while (init_val < end_vert){
if (end_val > end_vert) end_val = end_vert;
strncpy(float_val, init_val, end_val - init_val);
float_val[end_val - init_val] = 0;
printf("inserting vert_val (idx %i): %s...",idx,float_val);
fflush(stdout);
vert_args[idx] = atof(float_val);
printf("done\n");
idx++;
init_val = end_val + 1;
while (init_val[0] == ' ') init_val++;
end_val = strstr(init_val," ");
}
searching for next vertex.. (vl: 0x53990 / vert : 0xA333838)
writing vertex at ptr 0xA333838
inserting vert_val (idx 3): 0.655716...
what about if(end_val >= end_vert) . I can see an exception raised due to stack overflow edit: or atof() failed to convert the value to float due to value not being numeric (ASCII does not represent a number)Is there some problem in the logic of this piece of code? I tried it on Citra and seems to work quite good most of the time (i want to make it work always) but on Windows i always get a stackdump trace:
Code:float* vert_args = (float*)res; // Hacky way to iterate in vertex struct printf("writing vertex at ptr 0x%X\n",vert_args); fflush(stdout); while (init_val < end_vert){ if (end_val > end_vert) end_val = end_vert; strncpy(float_val, init_val, end_val - init_val); float_val[end_val - init_val] = 0; printf("inserting vert_val (idx %i): %s...",idx,float_val); fflush(stdout); vert_args[idx] = atof(float_val); printf("done\n"); idx++; init_val = end_val + 1; while (init_val[0] == ' ') init_val++; end_val = strstr(init_val," "); }
In runtime i get this output before the crash:
Code:searching for next vertex.. (vl: 0x53990 / vert : 0xA333838) writing vertex at ptr 0xA333838 inserting vert_val (idx 3): 0.655716...
what about if(end_val >= end_vert) . I can see an exception raised due to stack overflow edit: or atof() failed to convert the value to float due to value not being numeric (ASCII does not represent a number)
Last I remember reading, no it's not yet.Is the Circle Pad Pro (for o3DS) compatible with homebrew ? At least with ctrulib ?
Seems legit.work in progress
and now to disappear and never post anything ever again
unknown GetPointer @ 0x00000000
DebugUtils::LookupTexture Unknown texture format: f