Homebrew Homebrew Development

nop90

Well-Known Member
Member
Joined
Jan 11, 2014
Messages
1,556
Trophies
0
Location
Rome
XP
3,136
Country
Italy
yes only once, but before screenRender, then printGUI.

And rename screenRender in getFB or something similar. Or as i said before, merge it in printGui.
 

AlbertoSONIC

Pasta Team Member
Member
Joined
Jun 27, 2014
Messages
927
Trophies
0
Age
52
Website
www.albertosonic.com
XP
1,396
Country
Italy
nop90 Alright this is my main.c now:
Code:
#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;
}

It prints what it has to print then it crashes back to the homescreen... This is the 3dmoo log:
>> 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)
 

Rinnegatamante

Well-Known Member
Member
Joined
Nov 24, 2014
Messages
3,162
Trophies
2
Age
29
Location
Bologna
Website
rinnegatamante.it
XP
4,858
Country
Italy

nop90

Well-Known Member
Member
Joined
Jan 11, 2014
Messages
1,556
Trophies
0
Location
Rome
XP
3,136
Country
Italy
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)

ok, i'll do it later.

Edit:

I looked the code fastly, later iI'll check it. But I noticed that you are using my old drawing functions that I wrote for the first barebone homebrew experiments a year ago (in Te3DS for example).

Now you can use std c libraries. For example you can clear (to black, or white) the screen with a single memset call. I'll give you some hint in PM as soon as I have time (maybe tomorrow)
 
  • Like
Reactions: AlbertoSONIC

nop90

Well-Known Member
Member
Joined
Jan 11, 2014
Messages
1,556
Trophies
0
Location
Rome
XP
3,136
Country
Italy
How does linearFree works?

Is it possible to free only a first part of a buffer allocated with linearAlloc?

AFAIK no if you don't want to rewrite the memory allocator functions.

With linearRealloc you can resize a memory block mantaining only the first part. But usually in C it's tricky: the allocator allocates new memory, copies the first part in the new allocated memory, than frees the old block and finally returns the new memory pointer

You could do somethin similar allocating new memory and copying the last part. Then you can free the original memory.
 
  • Like
Reactions: Rinnegatamante

spinal_cord

Knows his stuff
Member
Joined
Jul 21, 2007
Messages
3,227
Trophies
1
Age
43
Location
somewhere
Website
spinalcode.co.uk
XP
3,434
Country
Has anyone here had any experience with the C64 emulator called Frodo? I'm attempting to port the nds version to the 3DS and getting as far as cycle 63, linecount 15 before the thing is crashing out on me.

Can anyone offer any assistance?

source

Thanks in advance.
 

AlbertoSONIC

Pasta Team Member
Member
Joined
Jun 27, 2014
Messages
927
Trophies
0
Age
52
Website
www.albertosonic.com
XP
1,396
Country
Italy
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)?
 

shinyquagsire23

SALT/Sm4sh Leak Guy
Member
Joined
Nov 18, 2012
Messages
1,977
Trophies
2
Age
26
Location
Las Vegas
XP
3,765
Country
United States
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 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.
 
  • Like
Reactions: AlbertoSONIC

xem

Well-Known Member
Member
Joined
Nov 22, 2014
Messages
142
Trophies
0
Age
36
Location
Valbonne
XP
333
Country
France
The printf function added recently is weird.
Code:
printf("\x1b[15;19HHello World!");
. 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?
 

shinyquagsire23

SALT/Sm4sh Leak Guy
Member
Joined
Nov 18, 2012
Messages
1,977
Trophies
2
Age
26
Location
Las Vegas
XP
3,765
Country
United States
The printf function added recently is weird.
Code:
printf("\x1b[15;19HHello World!");
. 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?
\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.
 

Cyan

GBATemp's lurking knight
Former Staff
Joined
Oct 27, 2002
Messages
23,749
Trophies
4
Age
46
Location
Engine room, learning
XP
15,662
Country
France

Smariter

Active Member
Newcomer
Joined
Dec 23, 2014
Messages
29
Trophies
0
Age
55
XP
111
Country
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:
27zhkl1.png



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.
  • 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
Dependencies:
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)

Hello, I want to replace the image in a retail game banner,what should I do?
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    K3Nv2 @ K3Nv2: https://youtube.com/shorts/4M3E1Lz6l9E?si=fSYNJxYTa0czXVow