So i can just use printGUI in main.c? I mean printGUI + screenRender? I don't need to do it twice?
#include <3ds.h>
#include "app.h"
#include "input.h"
#include "rendering.h"
int main()
{
// Initialize services
srvInit();
aptInit();
hidInit(NULL);
gfxInit();
// Main loop
while (aptMainLoop())
{
//As nop90 suggested
getFB();
//Gets input (keys and touch)
getInput();
//Prints the GUI
printGUI();
//Do stuff
app();
//Jumps to the required mode (menu or paint) or exit
if (input & KEY_START || mode==5)
break;
// Flush and swap framebuffers
gfxFlushBuffers();
gfxSwapBuffers();
//Wait for VBlank
gspWaitForVBlank();
}
// Exit services
gfxExit();
hidExit();
aptExit();
srvExit();
return 0;
}
>> svcSignalEvent (0x18)
svcSignalEvent: handle=dadbb0d, resettype=3
>> svcSignalEvent (0x18)
svcSignalEvent: handle=dadbb0d, resettype=3
>> svcSignalEvent (0x18)
svcSignalEvent: handle=dadbb0d, resettype=3
>> svcSignalEvent (0x18)
svcSignalEvent: handle=dadbb0d, resettype=3
>> svcSignalEvent (0x18)
svcSignalEvent: handle=dadbb0d, resettype=3
>> svcSignalEvent (0x18)
svcSignalEvent: handle=dadbb0d, resettype=3
>> svcSignalEvent (0x18)
svcSignalEvent: handle=dadbb0d, resettype=3
>> svcSignalEvent (0x18)
svcSignalEvent: handle=dadbb0d, resettype=3
>> svcSignalEvent (0x18)
svcSignalEvent: handle=dadbb0d, resettype=3
>> svcSignalEvent (0x18)
svcSignalEvent: handle=dadbb0d, resettype=3
>> svcWaitSynchronization1 (0x24)
threads_IsThreadActive: Wait-list for thread 0:
threads_IsThreadActive: 0dadbb0d, type=event, waiting=false
>> svcWaitSynchronization1 (0x24)
threads_IsThreadActive: Wait-list for thread 1:
threads_IsThreadActive: 0dadbb01, type=event, waiting=true
threads_IsThreadActive: 0dadbb02, type=event, waiting=true
threads_Execute: Skipping thread 1..
threads_IsThreadActive: Wait-list for thread 2:
threads_IsThreadActive: 0dadbb09, type=event, waiting=true
threads_Execute: Skipping thread 2..
>> svcReleaseMutex (0x14)
>> svcGetSystemTick (0x28)
>> svcSendSyncRequest (0x32)
gsp_gpu_SyncRequest: FlushDataCache addr=14046500, size=00046500, h=ffff8001
>> svcSendSyncRequest (0x32)
gsp_gpu_SyncRequest: FlushDataCache addr=140c4e00, size=00038400, h=ffff8001
>> svcSendSyncRequest (0x32)
gsp_gpu_SyncRequest: SetBufferSwap screen=00000000
>> svcSendSyncRequest (0x32)
gsp_gpu_SyncRequest: SetBufferSwap screen=00000001
>> svcClearEvent (0x19)
>> svcWaitSynchronization1 (0x24)
threads_IsThreadActive: Wait-list for thread 1:
threads_IsThreadActive: 0dadbb01, type=event, waiting=true
threads_IsThreadActive: 0dadbb02, type=event, waiting=true
threads_Execute: Skipping thread 1..
threads_IsThreadActive: Wait-list for thread 2:
threads_IsThreadActive: 0dadbb09, type=event, waiting=false
threads_Switch: Thread switch 0->2 (0DADBAFB->0DADBB12)
>> svcClearEvent (0x19)
>> svcSignalEvent (0x18)
svcSignalEvent: handle=dadbb0d, resettype=3
>> svcSignalEvent (0x18)
svcSignalEvent: handle=dadbb0d, resettype=3
>> svcSignalEvent (0x18)
svcSignalEvent: handle=dadbb0d, resettype=3
>> svcSignalEvent (0x18)
svcSignalEvent: handle=dadbb0d, resettype=3
>> svcSignalEvent (0x18)
svcSignalEvent: handle=dadbb0d, resettype=3
>> svcSignalEvent (0x18)
svcSignalEvent: handle=dadbb0d, resettype=3
>> svcSignalEvent (0x18)
svcSignalEvent: handle=dadbb0d, resettype=3
>> svcSignalEvent (0x18)
svcSignalEvent: handle=dadbb0d, resettype=3
>> svcSignalEvent (0x18)
svcSignalEvent: handle=dadbb0d, resettype=3
>> svcSignalEvent (0x18)
svcSignalEvent: handle=dadbb0d, resettype=3
>> svcSignalEvent (0x18)
svcSignalEvent: handle=dadbb0d, resettype=3
>> svcSignalEvent (0x18)
svcSignalEvent: handle=dadbb0d, resettype=3
>> svcSignalEvent (0x18)
svcSignalEvent: handle=dadbb0d, resettype=3
>> svcSignalEvent (0x18)
svcSignalEvent: handle=dadbb0d, resettype=3
>> svcSignalEvent (0x18)
svcSignalEvent: handle=dadbb0d, resettype=3
>> svcWaitSynchronization1 (0x24)
threads_IsThreadActive: Wait-list for thread 0:
threads_IsThreadActive: 0dadbb0d, type=event, waiting=false
>> svcWaitSynchronization1 (0x24)
threads_IsThreadActive: Wait-list for thread 1:
threads_IsThreadActive: 0dadbb01, type=event, waiting=true
threads_IsThreadActive: 0dadbb02, type=event, waiting=true
threads_Execute: Skipping thread 1..
threads_IsThreadActive: Wait-list for thread 2:
threads_IsThreadActive: 0dadbb09, type=event, waiting=true
threads_Execute: Skipping thread 2..
>> svcReleaseMutex (0x14)
mem_Write8: trying to write8 unmapped addr 13fffffd, w=ee
arm11_Dump: Reg dump:
arm11_Dump: r00: 00000000 r01: 00000000 r02: 00000190 r03: 000000f0
arm11_Dump: r04: 000000a6 r05: 000000dd r06: 000000ee r07: 14000000
arm11_Dump: r08: fffffd2d r09: 000000dd r10: 000000a6 r11: 00118a04
arm11_Dump: r12: 13fffd30 r13: 0ffffed0 r14: 13fffd2d r15: 00101a80
arm11_Dump: current pc
arm11_Dump: current lr
arm11_Dump: 0FFFFED0 00163dec
arm11_Dump: 0FFFFED4 00118a04
arm11_Dump: 0FFFFED8 00000000
arm11_Dump: 0FFFFEDC 00118a30
arm11_Dump: 0FFFFEE0 000000ee
arm11_Dump: 0FFFFEE4 0010040c
arm11_Dump: 0FFFFEE8 000000a6
arm11_Dump: 0FFFFEEC 000000dd
arm11_Dump: 0FFFFEF0 000000ee
arm11_Dump: 0FFFFEF4 14000000
arm11_Dump: 0FFFFEF8 00000000
arm11_Dump: 0FFFFEFC 00000000
arm11_Dump: 0FFFFF00 3320726f
arm11_Dump: 0FFFFF04 4d205344
arm11_Dump: 0FFFFF08 206e6961
arm11_Dump: 0FFFFF0C 756e654d
arm11_Dump:
mem_Write8: trying to write8 unmapped addr 13fffffe, w=dd
arm11_Dump: Reg dump:
arm11_Dump: r00: 00000000 r01: 00000000 r02: 00000190 r03: 000000f0
arm11_Dump: r04: 000000a6 r05: 000000dd r06: 000000ee r07: 14000000
arm11_Dump: r08: fffffd2d r09: 000000dd r10: 000000a6 r11: 00118a04
arm11_Dump: r12: 13fffd30 r13: 0ffffed0 r14: 13fffd2d r15: 00101a84
arm11_Dump: current pc
arm11_Dump: current lr
arm11_Dump: 0FFFFED0 00163dec
arm11_Dump: 0FFFFED4 00118a04
arm11_Dump: 0FFFFED8 00000000
arm11_Dump: 0FFFFEDC 00118a30
arm11_Dump: 0FFFFEE0 000000ee
arm11_Dump: 0FFFFEE4 0010040c
arm11_Dump: 0FFFFEE8 000000a6
arm11_Dump: 0FFFFEEC 000000dd
arm11_Dump: 0FFFFEF0 000000ee
arm11_Dump: 0FFFFEF4 14000000
arm11_Dump: 0FFFFEF8 00000000
arm11_Dump: 0FFFFEFC 00000000
arm11_Dump: 0FFFFF00 3320726f
arm11_Dump: 0FFFFF04 4d205344
arm11_Dump: 0FFFFF08 206e6961
arm11_Dump: 0FFFFF0C 756e654d
arm11_Dump:
mem_Write8: trying to write8 unmapped addr 13ffffff, w=a6
arm11_Dump: Reg dump:
arm11_Dump: r00: 00000000 r01: 00000000 r02: 00000190 r03: 000000f0
arm11_Dump: r04: 000000a6 r05: 000000dd r06: 000000ee r07: 14000000
arm11_Dump: r08: fffffd2d r09: 000000dd r10: 000000a6 r11: 00118a04
arm11_Dump: r12: 13fffd30 r13: 0ffffed0 r14: 13fffd2d r15: 00101a88
arm11_Dump: current pc
arm11_Dump: current lr
arm11_Dump: 0FFFFED0 00163dec
arm11_Dump: 0FFFFED4 00118a04
arm11_Dump: 0FFFFED8 00000000
arm11_Dump: 0FFFFEDC 00118a30
arm11_Dump: 0FFFFEE0 000000ee
arm11_Dump: 0FFFFEE4 0010040c
arm11_Dump: 0FFFFEE8 000000a6
arm11_Dump: 0FFFFEEC 000000dd
arm11_Dump: 0FFFFEF0 000000ee
arm11_Dump: 0FFFFEF4 14000000
arm11_Dump: 0FFFFEF8 00000000
arm11_Dump: 0FFFFEFC 00000000
arm11_Dump: 0FFFFF00 3320726f
arm11_Dump: 0FFFFF04 4d205344
arm11_Dump: 0FFFFF08 206e6961
arm11_Dump: 0FFFFF0C 756e654d
arm11_Dump:
mem_Write8: trying to write8 unmapped addr 13fffffd, w=ee
arm11_Dump: Reg dump:
arm11_Dump: r00: 00000000 r01: 00000000 r02: 00000190 r03: 000000f0
arm11_Dump: r04: 000000a6 r05: 000000dd r06: 000000ee r07: 14000000
arm11_Dump: r08: fffffd2d r09: 000000dd r10: 000000a6 r11: 00118a04
arm11_Dump: r12: 13fffd30 r13: 0ffffed0 r14: 13fffd2d r15: 00101a80
arm11_Dump: current pc
arm11_Dump: current lr
arm11_Dump: 0FFFFED0 000000ff
arm11_Dump: 0FFFFED4 00000000
arm11_Dump: 0FFFFED8 00118a34
arm11_Dump: 0FFFFEDC 00118a30
arm11_Dump: 0FFFFEE0 000000ee
arm11_Dump: 0FFFFEE4 00100440
arm11_Dump: 0FFFFEE8 000000a6
arm11_Dump: 0FFFFEEC 000000dd
arm11_Dump: 0FFFFEF0 000000ee
arm11_Dump: 0FFFFEF4 14000000
arm11_Dump: 0FFFFEF8 00000000
arm11_Dump: 0FFFFEFC 00000000
arm11_Dump: 0FFFFF00 3320726f
arm11_Dump: 0FFFFF04 4d205344
arm11_Dump: 0FFFFF08 206e6961
arm11_Dump: 0FFFFF0C 756e654d
arm11_Dump:
mem_Write8: trying to write8 unmapped addr 13fffffe, w=dd
arm11_Dump: Reg dump:
arm11_Dump: r00: 00000000 r01: 00000000 r02: 00000190 r03: 000000f0
arm11_Dump: r04: 000000a6 r05: 000000dd r06: 000000ee r07: 14000000
arm11_Dump: r08: fffffd2d r09: 000000dd r10: 000000a6 r11: 00118a04
arm11_Dump: r12: 13fffd30 r13: 0ffffed0 r14: 13fffd2d r15: 00101a84
arm11_Dump: current pc
arm11_Dump: current lr
arm11_Dump: 0FFFFED0 000000ff
arm11_Dump: 0FFFFED4 00000000
arm11_Dump: 0FFFFED8 00118a34
arm11_Dump: 0FFFFEDC 00118a30
arm11_Dump: 0FFFFEE0 000000ee
arm11_Dump: 0FFFFEE4 00100440
arm11_Dump: 0FFFFEE8 000000a6
arm11_Dump: 0FFFFEEC 000000dd
arm11_Dump: 0FFFFEF0 000000ee
arm11_Dump: 0FFFFEF4 14000000
arm11_Dump: 0FFFFEF8 00000000
arm11_Dump: 0FFFFEFC 00000000
arm11_Dump: 0FFFFF00 3320726f
arm11_Dump: 0FFFFF04 4d205344
arm11_Dump: 0FFFFF08 206e6961
arm11_Dump: 0FFFFF0C 756e654d
arm11_Dump:
mem_Write8: trying to write8 unmapped addr 13ffffff, w=a6
arm11_Dump: Reg dump:
arm11_Dump: r00: 00000000 r01: 00000000 r02: 00000190 r03: 000000f0
arm11_Dump: r04: 000000a6 r05: 000000dd r06: 000000ee r07: 14000000
arm11_Dump: r08: fffffd2d r09: 000000dd r10: 000000a6 r11: 00118a04
arm11_Dump: r12: 13fffd30 r13: 0ffffed0 r14: 13fffd2d r15: 00101a88
arm11_Dump: current pc
arm11_Dump: current lr
arm11_Dump: 0FFFFED0 000000ff
arm11_Dump: 0FFFFED4 00000000
arm11_Dump: 0FFFFED8 00118a34
arm11_Dump: 0FFFFEDC 00118a30
arm11_Dump: 0FFFFEE0 000000ee
arm11_Dump: 0FFFFEE4 00100440
arm11_Dump: 0FFFFEE8 000000a6
arm11_Dump: 0FFFFEEC 000000dd
arm11_Dump: 0FFFFEF0 000000ee
arm11_Dump: 0FFFFEF4 14000000
arm11_Dump: 0FFFFEF8 00000000
arm11_Dump: 0FFFFEFC 00000000
arm11_Dump: 0FFFFF00 3320726f
arm11_Dump: 0FFFFF04 4d205344
arm11_Dump: 0FFFFF08 206e6961
arm11_Dump: 0FFFFF0C 756e654d
arm11_Dump:
>> svcGetSystemTick (0x28)
>> svcSendSyncRequest (0x32)
gsp_gpu_SyncRequest: FlushDataCache addr=14000000, size=00046500, h=ffff8001
>> svcSendSyncRequest (0x32)
gsp_gpu_SyncRequest: FlushDataCache addr=1408ca00, size=00038400, h=ffff8001
>> svcSendSyncRequest (0x32)
gsp_gpu_SyncRequest: SetBufferSwap screen=00000000
>> svcSendSyncRequest (0x32)
gsp_gpu_SyncRequest: SetBufferSwap screen=00000001
>> svcClearEvent (0x19)
>> svcWaitSynchronization1 (0x24)
nop90 Could you check my code: https://github.com/AlbertoSONIC/3DS_Paint I updated the repo. (Ignore the commented part inside app.c, i need it to move stuff)
How does linearFree works?
Is it possible to free only a first part of a buffer allocated with linearAlloc?
sprintf(buffer, " CLEAN ");
drawString(buffer, 1, 31, 255, 255, 255, screenTopLeft, GFX_LEFT);
drawString(buffer, 1, 31, 255, 255, 255, screenTopRight, GFX_LEFT);
printf("\x1b[15;19HHello World!");
Printf support was only recently added to ctrulib, so either way will work. Printf doesn't look the prettiest though since it's meant for basic console output.Guys could someone tell me what's the best way to print a text? 'cause i've been using this code since the beginning:
Code:sprintf(buffer, " CLEAN "); drawString(buffer, 1, 31, 255, 255, 255, screenTopLeft, GFX_LEFT); drawString(buffer, 1, 31, 255, 255, 255, screenTopRight, GFX_LEFT);
But the ctrulib example uses another way:
Code:printf("\x1b[15;19HHello World!");
Which is way cleaner and shorter. But is it better? I mean, is it fully functional like the old one? Can it print in different colors? Can i choose where to write it? (top or bottom screen)?
printf("\x1b[15;19HHello World!");
\x is the escape code for writing raw hex in a printf, so it inserts a 0x1b byte there in the string. It's probably for positioning or something, idk.The printf function added recently is weird.. What does "\x1b[15;19H" mean? Is it something standard? I've never seen printf functions like that. Can't we find a way to avoid writing this weird part everywtime?Code:printf("\x1b[15;19HHello World!");
3DS Banner Maker
Create custom banner and icon files for your 3ds homebrews. Today I introduce you to an improved version of SnailFace's Banner Maker made by me! It has many usefull changes:
Screenshot of Popups:
How to use:
- To replace icons: overwrite the .png in the either one of the 'ctpk' folders and click convert.bat to convert the images. Make sure image dimensions are the same as the folder indicates.
- To replace the banner: In the cbmd_banner folder, you have to overwrite the 256x128.png file with an image of your choice. Click convert.bat same as before. Transparency is supported.
- To replace the sound effect: Overwrite the example.bcwav file with one of your choice. .wav to bcwav conversion is not supported at this time.
- To change display text and setting flags: edit the variables in AppData.txt. Further instructions are inside this document.
Dependencies:
- To convert everything to .bin files: simply click BUILD.bat in the 3DS_Banner_Maker folder. Next place place these two files in your 3DSTemplate resource folder and compile as usual
Python 2, PIL Image libray (Python Image Library)
Xcution's CiTRUS application is no longer a dependancy
Download:
GitHub: https://github.com/AlbertoSONIC/3DS_Banner_Maker
Credits:
Snailface - Original Banner Maker's developer
AlbertoSONIC (me)