Homebrew Homebrew Development

  • Thread starter Thread starter aliak11
  • Start date Start date
  • Views Views 1,474,989
  • Replies Replies 6,048
  • Likes Likes 54
I think the problem is that you can't exit to the home menu (without rebooting) with ninjhax. It is possible to run the code with ninjhax or use the service without crashing the game, but it will have no effect. Maybe if we could get access to the home menu that would be possible?
 
Is something wrong on 3DBrew GetSystemModel page (http://3dbrew.org/wiki/Cfg:GetSystemModel)?

Using this (from libctru):
Code:
Result CFGU_GetSystemModel(u8* model)
{
Result ret = 0;
u32 *cmdbuf = getThreadCommandBuffer();
cmdbuf[0] = 0x00050000;
if((ret = svcSendSyncRequest(CFGU_handle))!=0)return ret;
*model = (u8)cmdbuf[2];
return (Result)cmdbuf[1];
}

On a Old 3DS Model i get 189 as system model :/
 
Is something wrong on 3DBrew GetSystemModel page (http://3dbrew.org/wiki/Cfg:GetSystemModel)?

Using this (from libctru):

On a Old 3DS Model i get 189 as system model :/
Works fine for me:
Code:
gfxInitDefault();
initCfgu();
consoleInit(GFX_BOTTOM, NULL);
Result res;
u8 SystemModel = 7;
// Read the System Model from the config savegame.
res = CFGU_GetSystemModel(&SystemModel);
// Print return value and language code
printf("       Result: 0x%x\n", (int)res);
/*
0x0: No error
0xd8e007f7: CFGU not initialized
*/

printf("System code: %d\n", (int)SystemModel);
/*
0: Nintendo 3DS
1: Nintendo 3DS XL
2: New Nintendo 3DS
3: Nintendo 2DS
4: New Nintendo 3DS XL
*/
gfxFlushBuffers();
gfxSwapBuffers();

//Whatever code now comes

exitCfgu();
gfxExit();

This returns the right value when using an original 3ds and a new 3ds xl for me.
 
Code:
static int lua_model(lua_State *L) {
    int argc = lua_gettop(L);
    if(argc != 0 ) return luaL_error(L, "wrong number of arguments.");
    u8 model;
    CFGU_GetSystemModel(&model);
    lua_pushinteger(L,model);
    return 1;
}

This is what i'm doing (CFG:U service is initialized at lpp-3ds startup like other services) and i get 189 for an old 3DS. :/
 
Code:
static int lua_model(lua_State *L) {
    int argc = lua_gettop(L);
    if(argc != 0 ) return luaL_error(L, "wrong number of arguments.");
    u8 model;
    CFGU_GetSystemModel(&model);
    lua_pushinteger(L,model);
    return 1;
}

This is what i'm doing (CFG:U service is initialized at lpp-3ds startup like other services) and i get 189 for an old 3DS. :/
can you read the result of CFGU_GetSystemModel()?
 
Can we send notifications to the message applet with ninjhax? 3Dbrew says that ninjhax supports news:u services, but I guess ctrulib does not provide a function to use that? Has anyone actually done this yet?
 
Does anyone know how the 2DS and New 3DS control the wifi hardware via software? To elaborate, my original 3DS' wifi switch no longer works (i.e. sliding it up does nothing, it does not turn it on or off), so it'd be nice if we had a homebrew method of enabling or disabling the wifi power through software.
 
I just wanted to notify anybody that might be interested; I've been working on a 3DS GUI library for a little while now and it looks to be coming along nicely.
It is/will (be) extremely easy to use, for example: THIS code creates http://i.imgur.com/CjTUsSX.png

Its currently Closed-Source but will become Open-Source once I release Alpha1. If anyone is interested in helping hit me up :)
 
I'm not developer expert, but shouldn't it be better in a class instead of multiple standalone functions in the global namespace?
or prefix your functions with your library name (3DSui of example, 3DSui_createWindow(); ) .

a class would be better, like libwiigui.
again, I'm not the one working on it so I don't know what's best, it's just ideas and opinions.
 
I'm not developer expert, but shouldn't it be better in a class instead of multiple standalone functions in the global namespace?
or prefix your functions with your library name (3DSui of example, 3DSui_createWindow(); ) .

a class would be better, like libwiigui.
again, I'm not the one working on it so I don't know what's best, it's just ideas and opinions.

Im going to use namespaces in the future however, a uiWindow is currently a struct while a uiElement is a class :)
I could add you to the github if you want to take a look :)
 
Yes:
Code:
void gfxSetDoubleBuffering(gfxScreen_t screen, bool doubleBuffering);
Thanks, but I can't get it working correctly, do you know what is wrong with this code?

Code:
#include <3ds.h>

#include <stdio.h>

void drawPixelTopRGBFramebuffer(u8 *fb, int x, int y, u8 r, u8 g, u8 b) {
    y = 240 - y;
    x = x;
    u32 v = (y + x * 240) * 3;
    fb[v] = r;
    fb[v + 1] = g;
    fb[v + 2] = b;
}

int main(int argc, char **argv) {
    gfxInitDefault();
    
    gfxSetDoubleBuffering(GFX_TOP, false);
    gfxSetDoubleBuffering(GFX_BOTTOM, false);
    
    consoleInit(GFX_BOTTOM, NULL);
    
    gfxFlushBuffers();
    gfxSwapBuffers();
    
    printf("test"); // this text is mangled
    
    u8 *framebuffer = gfxGetFramebuffer(GFX_TOP, GFX_LEFT, NULL, NULL);
    
    int i = 0;
    for(i = 0; i < 10; i++) {
        drawPixelTopRGBFramebuffer(framebuffer, i, i, 255, 255, 255);
    }
    
    while(aptMainLoop()) {
        hidScanInput();
        
        u32 kDown = hidKeysDown();
        
        if(kDown & KEY_START) break;
        
        gspWaitForVBlank();
    }
    
    gfxExit();
    
    return 0;
}
 

Site & Scene News

Popular threads in this forum