Homebrew Homebrew Development

  • Thread starter Thread starter aliak11
  • Start date Start date
  • Views Views 1,475,172
  • Replies Replies 6,048
  • Likes Likes 54
The main problem is that I don't know what u8* screen refers to. The one I used was referring to GFX_TOP.

EDIT: Nevermind it works fine. Just colors are messed up.
WVNany4.png
 
Last edited by UltiNaruto,
The main problem is that I don't know what u8* screen refers to. The one I used was referring to GFX_TOP.
Sorry, you can replace that variable since you used this:
u8* fb = gfxGetFramebuffer(screen, GFX_LEFT, NULL, NULL);
instead of screen use fb in the functions
 
Yeah I noticed this :)

--------------------- MERGED ---------------------------

here's the original background :
543okNX.png


400x240x32
and the blocks in are 20x20x32

--------------------- MERGED ---------------------------

I fixed background but blocks are still not good and the blocks renders down when I want to render a block out of screen.

--------------------- MERGED ---------------------------

I can release my game as of now but it has few graphics glitches :P
Tdx7oHW.png


EDIT:
I'm a complete idiot ...
https://gbatemp.net/threads/handy-functions-for-your-3ds-homebrews.376679/
 
Last edited by UltiNaruto,
Is there a way to set a video mode with pixels memory location following the X axis instead of the Y axis?

I remember to read something about this on 3dbrew long time ago, but can't find it anymore. Maybe I dreamed about it ... :lol:
 
Well the x and y axis aren't a problem anymore. And same for the PM I sent you.

Sorry, I missed your PM. Reading the forum from my smatphone sometime happens that notification are cleaned without noticing them.

For the x and y swapping, you mean using sf2dlib? I can't use it, I need to write directly on the fb two pixels at a time (using a bidimensional lookup color table) to boost a little the z26 emulator.
 
Well using the 2 pixels trick should be better. I'm doing this with 32 bits png. Though I don't use the alpha channel.
 
Well as I said I'll stick with the current drawImage function. But is it possible to get profile name?
I wanna use it for a high score table.
 
Well as I said I'll stick with the current drawImage function. But is it possible to get profile name?
I wanna use it for a high score table.
It's not supported in ctrulib, but if you know the memory location you could possibly use it.
 
Well I'll have to debug it then not sure of how I'll do though. Debugging ARM processor without ARM assembly knowledge is pure suicide xD
I only know x86 assembly... and a bit of x64
 
  • Like
Reactions: UltiNaruto
Thanks for the link I'll try this later I'm updating homebrews on my 3DS.

EDIT: I saw something like that in cfgu.h

EDIT2: This?
Code:
Result CFGU_GetConfigInfoBlk2(u32 size, u32 blkID, u8* outData);

EDIT3: That's the only example I could find.
https://github.com/smealum/ctrulib/blob/master/examples/get_system_language/source/main.c

EDIT4: Here's the function for those who needs this.

Code:
char * getProfileName()
{
    Result res;
    u8 * tempProfileName = (u8*)malloc(0x16);
    char * profileName = (char*)malloc(0x16/2);
    int i;
    for(i=0;i<(0x16/2);i++)
        profileName[i] = 0;
    res = CFGU_GetConfigInfoBlk2(0x1C, 0xA0000, tempProfileName);
    for(i=0;i<(0x16/2);i++)
    {
        profileName[i] = (char)((u16*)tempProfileName)[i];
    }
    return profileName;
}

EDIT5 :

Returns the length of the profile name and takes the profile name as out parameter

Code:
#include <3ds/types.h>

int getProfileName(char * profileName)
{
    Result res;
    u8 tempProfileName[0x16];
    int i;
    
    for(i=0;i<(0x16/2);i++)
        profileName[i] = 0;
    res = CFGU_GetConfigInfoBlk2(0x1C, 0xA0000, tempProfileName);
    if(res != 0)
        return -1;
    for(i=0;i<(0x16/2);i++)
        profileName[i] = (char)(tempProfileName[2*i] | tempProfileName[2*i+1] << 8);
    return strlen(profileName);
}
 
Last edited by UltiNaruto,
Is there any way to get the current date ?
Can't seem to find a function that would give it

Also, is it normal that svcGetSystemTick() returns 0 ?
 
  • Like
Reactions: UltiNaruto
time(NULL) gives the current timestamp.
You could write a function yourself to calculate the date
 

Site & Scene News

Popular threads in this forum