Homebrew Homebrew Development

MeisterFenster

Well-Known Member
Member
Joined
Nov 18, 2014
Messages
168
Trophies
0
Age
28
XP
165
Country
Gambia, The
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?
 

Rinnegatamante

Well-Known Member
Member
Joined
Nov 24, 2014
Messages
3,162
Trophies
2
Age
29
Location
Bologna
Website
rinnegatamante.it
XP
4,857
Country
Italy
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 :/
 

Technicmaster0

Well-Known Member
Member
Joined
Oct 22, 2011
Messages
4,407
Trophies
2
Website
www.flashkarten.tk
XP
3,502
Country
Gambia, The
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.
 

Rinnegatamante

Well-Known Member
Member
Joined
Nov 24, 2014
Messages
3,162
Trophies
2
Age
29
Location
Bologna
Website
rinnegatamante.it
XP
4,857
Country
Italy
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. :/
 

Technicmaster0

Well-Known Member
Member
Joined
Oct 22, 2011
Messages
4,407
Trophies
2
Website
www.flashkarten.tk
XP
3,502
Country
Gambia, The
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()?
 

Rinnegatamante

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

MeisterFenster

Well-Known Member
Member
Joined
Nov 18, 2014
Messages
168
Trophies
0
Age
28
XP
165
Country
Gambia, The
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?
 

daxtsu

Well-Known Member
Member
Joined
Jun 9, 2007
Messages
5,627
Trophies
2
XP
5,194
Country
Antarctica
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.
 

filfat

CTO @ Nordcom Group Inc.
Member
Joined
Nov 24, 2012
Messages
1,261
Trophies
1
Location
Gothenburg, Sweden
Website
www.sweetsideofsweden.com
XP
1,749
Country
Sweden
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 :)
 

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
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.
 

filfat

CTO @ Nordcom Group Inc.
Member
Joined
Nov 24, 2012
Messages
1,261
Trophies
1
Location
Gothenburg, Sweden
Website
www.sweetsideofsweden.com
XP
1,749
Country
Sweden
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 :)
 

YoshiInAVoid

Banned!
Banned
Joined
Jan 10, 2011
Messages
560
Trophies
1
Website
google.com
XP
465
Country
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

General chit-chat
Help Users
  • No one is chatting at the moment.
    ZeroT21 @ ZeroT21: :lol: