Homebrew How do I display an image on the top screen of the 3DS (new or not) in high quality? [C++]

Momoro

The Dark One
OP
Member
Joined
Oct 7, 2019
Messages
111
Trophies
0
Age
45
XP
194
Country
United States
I've been dabbling in making mini 3DS C++ video games / homebrew apps, and it's been a blast. (For some reason, Switch just isn't as fun for me.)

But, I've been having some trouble with displaying images.

I would like to display my logo image on the upper / top screen, but I have no idea how to do this in C++ for 3DS.

Any help? Thanks!
 
D

Deleted User

Guest
When you figure out you photo issue, perhaps you could make a homebrew to convert BMP files to JPEG files? Also a homebrew to compress folders to ZIP? Would be very nice.
 
  • Like
Reactions: 3DScool

sup3rgh0st

Top Tier Ghost
Member
Joined
Apr 22, 2010
Messages
456
Trophies
1
XP
2,717
Country
United States
You probably want to use a library like SDL to handle that pretty easily. However if you're committed to rolling your own code, another route is to have your images in saved as some kind of uncompressed bitmap (.bmp) file format and just copy the color values into the frame buffer.

This code is like 5 years old now so things may have changed, but you can grab the top and bottom frame buffers and write to them as you wish.
Code:
u8* fbTop = gfxGetFramebuffer(GFX_TOP, GFX_LEFT, NULL, NULL);
u8* fbBottom = gfxGetFramebuffer(GFX_BOTTOM, GFX_LEFT, NULL, NULL);

paint_pixel(fbTop, 10, 10, 255, 255, 255);
Code:
// FrameBuffer, XPos, YPos, R,G,B
void paint_pixel(u8* fb, u16 x, u16 y, u8 red, u8 green, u8 blue) {
	if ((x>=400) || (x<0)) {return;}
	if ((y>=240) || (y<0)) {return;}
	
	fb[3*(y+x*240)] = blue;
	fb[3*(y+x*240)+1] = green;
	fb[3*(y+x*240)+2] = red;
}
 
Last edited by sup3rgh0st, , Reason: Code Snippit

Momoro

The Dark One
OP
Member
Joined
Oct 7, 2019
Messages
111
Trophies
0
Age
45
XP
194
Country
United States
You probably want to use a library like SDL to handle that pretty easily. However if you're committed to rolling your own code, another route is to have your images in saved as some kind of uncompressed bitmap (.bmp) file format and just copy the color values into the frame buffer.

This code is like 5 years old now so things may have changed, but you can grab the top and bottom frame buffers and write to them as you wish.
Code:
u8* fbTop = gfxGetFramebuffer(GFX_TOP, GFX_LEFT, NULL, NULL);
u8* fbBottom = gfxGetFramebuffer(GFX_BOTTOM, GFX_LEFT, NULL, NULL);

paint_pixel(fbTop, 10, 10, 255, 255, 255);
Code:
// FrameBuffer, XPos, YPos, R,G,B
void paint_pixel(u8* fb, u16 x, u16 y, u8 red, u8 green, u8 blue) {
    if ((x>=400) || (x<0)) {return;}
    if ((y>=240) || (y<0)) {return;}
   
    fb[3*(y+x*240)] = blue;
    fb[3*(y+x*240)+1] = green;
    fb[3*(y+x*240)+2] = red;
}

Hmm! Thanks :)

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

When you figure out you photo issue, perhaps you could make a homebrew to convert BMP files to JPEG files? Also a homebrew to compress folders to ZIP? Would be very nice.

Unless you need it for 3ds homebrew, just find an online converter, e.g. "bmp to jpeg online"
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • BigOnYa
  • BakerMan
    I rather enjoy a life of taking it easy. I haven't reached that life yet though.
  • Veho @ Veho:
    But you still don't know what it was?
  • Veho @ Veho:
    Has he had seizures before?
  • The Real Jdbye @ The Real Jdbye:
    apparently stress can cause seizures, my brother had one during a test once
  • The Real Jdbye @ The Real Jdbye:
    never had one before that, and never had one since
  • Redleviboy123 @ Redleviboy123:
    Question about game texture chanching Do i need an own game id?
  • The Real Jdbye @ The Real Jdbye:
    @Veho for those that want to
    experience being sonic the hedgehog
  • Veho @ Veho:
    Ah, you mean
    furries.
    +1
  • The Real Jdbye @ The Real Jdbye:
    well, sonic fans are a whole separate thing from furries
  • The Real Jdbye @ The Real Jdbye:
    like bronys
  • The Real Jdbye @ The Real Jdbye:
    sonic porn is too weird even for me
  • Dumpflam @ Dumpflam:
    bruh
  • Dumpflam @ Dumpflam:
    guys how do i delete a post
  • The Real Jdbye @ The Real Jdbye:
    you don't
  • The Real Jdbye @ The Real Jdbye:
    you can report it and request deletion
  • BakerMan @ BakerMan:
    Also, no, that was his first time having a seizure, and hopefully the last
    +1
  • K3Nv2 @ K3Nv2:
    Ea play raised priced to $6 a month lol
  • BigOnYa @ BigOnYa:
    Same with uremum, she's now $2 a month
    +1
  • K3Nv2 @ K3Nv2:
    Also seizures come and and go they don't have an off switch like that it all depends
  • BakerMan @ BakerMan:
    alright guys, who would win, sonic or goku?
  • BigOnYa @ BigOnYa:
    Knuckles
  • BakerMan @ BakerMan:
    knuckles vs broly could also be a good one tbh
    +1
  • BigOnYa @ BigOnYa:
    Bakerman vs. Wario
  • BigOnYa @ BigOnYa:
    Announcer - "Ok folks we have a good fight today, Bakerman takes on Wario. This should be a good fight. Wait...why is bakerman undressing?"
    BigOnYa @ BigOnYa: Announcer - "Ok folks we have a good fight today, Bakerman takes on Wario. This should be a good...