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,411
Trophies
2
Website
www.flashkarten.tk
XP
3,527
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,411
Trophies
2
Website
www.flashkarten.tk
XP
3,527
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.
  • BigOnYa @ BigOnYa:
    Biomutant looks cool tho, may have to try that
  • Quincy @ Quincy:
    Usually when such a big title leaks the Temp will be the first to report about it (going off of historical reports here, Pokemon SV being the latest one I can recall seeing pop up here)
  • K3Nv2 @ K3Nv2:
    I still like how a freaking mp3 file hacks webos all that security defeated by text yet again
  • BigOnYa @ BigOnYa:
    They have simulators for everything nowdays, cray cray. How about a sim that shows you playing the Switch.
  • K3Nv2 @ K3Nv2:
    That's called yuzu
    +1
  • BigOnYa @ BigOnYa:
    I want a 120hz 4k tv but crazy how more expensive the 120hz over the 60hz are. Or even more crazy is the price of 8k's.
  • K3Nv2 @ K3Nv2:
    No real point since movies are 30fps
  • BigOnYa @ BigOnYa:
    Not a big movie buff, more of a gamer tbh. And Series X is 120hz 8k ready, but yea only 120hz 4k games out right now, but thinking of in the future.
  • K3Nv2 @ K3Nv2:
    Mostly why you never see TV manufacturers going post 60hz
  • BigOnYa @ BigOnYa:
    I only watch tv when i goto bed, it puts me to sleep, and I have a nas drive filled w my fav shows so i can watch them in order, commercial free. I usually watch Married w Children, or South Park
  • K3Nv2 @ K3Nv2:
    Stremio ruined my need for nas
  • BigOnYa @ BigOnYa:
    I stream from Nas to firestick, one on every tv, and use Kodi. I'm happy w it, plays everything. (I pirate/torrent shows/movies on pc, and put on nas)
  • K3Nv2 @ K3Nv2:
    Kodi repost are still pretty popular
  • BigOnYa @ BigOnYa:
    What the hell is Kodi reposts? what do you mean, or "Wut?" -xdqwerty
  • K3Nv2 @ K3Nv2:
    Google them basically web crawlers to movie sites
  • BigOnYa @ BigOnYa:
    oh you mean the 3rd party apps on Kodi, yea i know what you mean, yea there are still a few cool ones, in fact watched the new planet of the apes movie other night w wifey thru one, was good pic surprisingly, not a cam
  • BigOnYa @ BigOnYa:
    Damn, only $2.06 and free shipping. Gotta cost more for them to ship than $2.06
  • BigOnYa @ BigOnYa:
    I got my Dad a firestick for Xmas and showed him those 3rd party sites on Kodi, he loves it, all he watches anymore. He said he has got 3 letters from AT&T already about pirating, but he says f them, let them shut my internet off (He wants out of his AT&T contract anyways)
  • K3Nv2 @ K3Nv2:
    That's where stremio comes to play never got a letter about it
  • BigOnYa @ BigOnYa:
    I just use a VPN, even give him my login and password so can use it also, and he refuses, he's funny.
  • BigOnYa @ BigOnYa:
    I had to find and get him an old style flip phone even without text, cause thats what he wanted. No text, no internet, only phone calls. Old, old school.
    K3Nv2 @ K3Nv2: @BigOnYa...