Homebrew Homebrew Development

hippy dave

BBMB
Member
Joined
Apr 30, 2012
Messages
9,917
Trophies
2
XP
29,899
Country
United Kingdom
Hey guys, looking for the latest version of those drawing libs from Relys, I seem to have an old version. Newer link I found in the thread was dead. Any help, cheers!

Edit: nm, yoinked them from the 3DS Binary Converter git.
 

hippy dave

BBMB
Member
Joined
Apr 30, 2012
Messages
9,917
Trophies
2
XP
29,899
Country
United Kingdom
Um, so is anyone doing drawing (not 3d modelled stuff, just lines & circles etc) in 3d? Do we have good stereoscopic functions for that? I found nop's repository but the readme says the stereoscopic stuff is broken.
 

PieFace

Well-Known Member
Newcomer
Joined
Aug 4, 2014
Messages
59
Trophies
0
XP
167
Country
United States
Um, so is anyone doing drawing (not 3d modelled stuff, just lines & circles etc) in 3d? Do we have good stereoscopic functions for that? I found nop's repository but the readme says the stereoscopic stuff is broken.

When I screwed around with arm9 code a while back I manually drew two rectangles at different x coordinates for an okish looking 3d rectangle. You could probably make a function that takes an x value and draws the rectanges at an offset if you need something quickly
 

xem

Well-Known Member
Member
Joined
Nov 22, 2014
Messages
142
Trophies
0
Age
36
Location
Valbonne
XP
333
Country
France
In fact there is no "correct" bin file, everything depends on how you interpret the data in your homebrew.
For example, my img-to-bin converter isn't exactly compatible with smea's hbmenu's gfxDrawSprite().
(see discussion here: https://twitter.com/MasterofJP/status/537293707725537280)
If you have an idea on how i could fix that, though, it'd be great.
Same thing for the strange darkness of your bmp.
 

AlbertoSONIC

Pasta Team Member
Member
Joined
Jun 27, 2014
Messages
927
Trophies
0
Age
52
Website
www.albertosonic.com
XP
1,396
Country
Italy
In fact there is no "correct" bin file, everything depends on how you interpret the data in your homebrew.
For example, my img-to-bin converter isn't exactly compatible with smea's hbmenu's gfxDrawSprite().
(see discussion here: https://twitter.com/MasterofJP/status/537293707725537280)
If you have an idea on how i could fix that, though, it'd be great.
Same thing for the strange darkness of your bmp.
No gfxDraw support? That's not good. Thanks anyway!

Ah another thing, do you know how to draw a bigger text?
 

xem

Well-Known Member
Member
Joined
Nov 22, 2014
Messages
142
Trophies
0
Age
36
Location
Valbonne
XP
333
Country
France
what do you mean by bigger text? Afaik there is no native text display. You have to embed your alphabet into an image and use it letter by letter
I'm planning to do a tool / lib to help things like that though
 

Frozen_Fish

Well-Known Member
Member
Joined
May 31, 2007
Messages
156
Trophies
0
XP
273
Country
In fact there is no "correct" bin file, everything depends on how you interpret the data in your homebrew.
For example, my img-to-bin converter isn't exactly compatible with smea's hbmenu's gfxDrawSprite().
(see discussion here: https://twitter.com/MasterofJP/status/537293707725537280)
If you have an idea on how i could fix that, though, it'd be great.
Same thing for the strange darkness of your bmp.

From what I can tell, smea's method copies the image data directly into the chosen framebuffer, problem is the framebuffer goes (B,G,R) and the image data goes (R,G,B) so you get the Red and Blue channels swapped.
I wrote myself a crappy python script to swap the R and B in each triplet of bytes around in the bin file first, and that fixed things for me.
 

-pm-

Active Member
Newcomer
Joined
Feb 19, 2014
Messages
31
Trophies
1
XP
1,156
Country
Germany
Um, so is anyone doing drawing (not 3d modelled stuff, just lines & circles etc) in 3d? Do we have good stereoscopic functions for that? I found nop's repository but the readme says the stereoscopic stuff is broken.

I'd written a little drawing "library" for drawling lines, rects and circles, not very fast but with full ARGB-Support; I'll provide it when I'm home (around 8pm CET).
Maybe it may help you. It should be easy to adapt it for other uses, but do not expect to create a new 60fps Sonic the Hedgehog - blast processing was sold out, as it was just an experiment :)
 
  • Like
Reactions: hippy dave

seagal112

Well-Known Member
Newcomer
Joined
Apr 22, 2014
Messages
63
Trophies
0
Age
43
XP
418
Country
3dsxtool gives me 'unaligned relocation!' when compiling... but no more info. What does this means? anyone know? Thanks! :hateit:
 

minexew

ayy lmao
Member
Joined
Mar 16, 2013
Messages
228
Trophies
0
XP
284
Country
anjpgCy.png
 

-pm-

Active Member
Newcomer
Joined
Feb 19, 2014
Messages
31
Trophies
1
XP
1,156
Country
Germany
Sounds perfect, thanks!


https://github.com/pmedia/3ds-tool - here you are.

I'd planned to provide an rapid prototyping C++-Based OOP-Wrapper oriented on stable code with many features which are replaceable but then noticed how pointless it is or may be. At least I didn't noticed much sense, as it may be better to include such framework into ctrulib.

Anyway, as promised, it contains the rendercode for drawing lines, circles and rectangles.

Have a look: Code Header

Code should be easily transformed to ordinary C, as it didn't make much use of additional c++ features. Notice how my setpixel()-Routine even wraps the pixel order, as it reverse the vertical axis.

Video::drawCircle(Display dp, u16 tx, u16 ty, u16 r, u32 c)
dp is the constant value detemining which display shall be used (enum Display: DISPLAY_TOP, DISPLAY_TOP_LEFT, DISPLAY_TOP_RIGHT, DISPLAY_BOTTOM)
tx,ty is the center of the circle to be drawn
r is the radius of the circle, c the ARGB-Color (Means: White is 0xFFFFFFFF, Black is 0xFF000000, Red is 0xFFFF0000, Blue is 0xFF0000FF, Half Transparent Green would be 0x8000FF00)
drawCircleFilled and drawCircleBordered have the very much same parameters; ci is inner color, co outer color. Outline of the circle is always 1px, there is no anti aliasing.

drawLine(Display dp, u16 x1, u16 y1, u16 x2, u16 y2, u32 c)
draws a line on display dp from x1,y1 to x2,y2 in the ARGB-Color c

drawRect(Display dp, u16 x1, u16 y1, u16 x2, u16 y2, u32 c)
draws an (not filled) rectangle on display dp from x1,y1 to x2,y2 with border argb color c

drawRectFilled(Display dp, u16 x1, u16 y1, u16 x2, u16 y2, u32 c)
draws an (filled) rectangle on display dp from x1,y1 to x2,y2 with border argb color c

drawRectBordered(Display dp, u16 x1, u16 y1, u16 x2, u16 y2, u32 ci, u32 co)
draws an filled rectangle (color ci) with a 1px border in color co.

Any other methods of the class should be self-explaining like that, too. blendpixel can be used to draw gradientbased primitives as it calculates the blending between two colors.
Feel free to take the code out of there as it gives you the ability to draw basic primitives.

Code is based on algorithms described in wikipedia as documented in the code.


For the future, it may be better to have ports of libraries like Cairo as they are usually highly optimized. Have fun!
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • The Real Jdbye @ The Real Jdbye:
    i think only the red mario kart edition phat was v5
  • BigOnYa @ BigOnYa:
    A woman with no arms and no legs was sitting on a beach. A man comes along and the woman says, "I've never been hugged before." So the man feels bad and hugs her. She says "Well i've also never been kissed before." So he gives her a kiss on the cheek. She says "Well I've also never been fucked before." So the man picks her up, and throws her in the ocean and says "Now you're fucked."
    +2
  • BakerMan @ BakerMan:
    lmao
  • BakerMan @ BakerMan:
    anyways, we need to re-normalize physical media

    if i didn't want my games to be permanent, then i'd rent them
    +1
  • BigOnYa @ BigOnYa:
    Agreed, that why I try to buy all my games on disc, Xbox anyways. Switch games (which I pirate tbh) don't matter much, I stay offline 24/7 anyways.
    +1
  • AncientBoi @ AncientBoi:
    I don't pirate them, I Use Them :mellow:. Like I do @BigOnYa 's couch :tpi::evil::rofl2:
    +1
  • cearp @ cearp:
    @BakerMan - you can still "own" digital media, arguably easier and better than physical since you can make copies and backups, as much as you like.

    The issue is DRM
    +1
  • cearp @ cearp:
    You can buy drm free games / music / ebooks, and if you keep backups of your data (like documents and family photos etc), then you shouldn't lose the game. but with a disk, your toddler could put it in the toaster and there goes your $60

    :rofl2:
  • cearp @ cearp:
    still, I agree physical media is nice to have. just pointing out the issue is drm
    +1
  • rqkaiju2 @ rqkaiju2:
    i like physical media because it actually feels like you own it. thats why i plan on burning music to cds
  • cearp @ cearp:
    It's nice to not have to have a lot of physical things though, saves space
    +1
  • AncientBoi @ AncientBoi:
    Nor clothes 🤮 . Saves on time, soap, water and money having to wash them. :D
  • SylverReZ @ SylverReZ:
    @rqkaiju2, Physical media is a great source for archiving your data, none of that cloud storage shiz.
    +1
  • AncientBoi @ AncientBoi:
    [squeezes @SylverReZ onto a physical media, then archives you in my old stuff box] :tpi::rofl2::tpi:
    +1
  • BakerMan @ BakerMan:
    guys, should i change my pfp to one of these or keep it the same?
    iu

    iu

    (i guess i could change it to one of my other pfps too, but i just want to see what you guys think first)
  • SylverReZ @ SylverReZ:
    @BakerMan, Up to you.
  • BakerMan @ BakerMan:
    smug sonic time lmao
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    Chronic The HempHog
  • DilllyDabDharma @ DilllyDabDharma:
    I'm new! Hi!
  • cearp @ cearp:
    Welcome
    cearp @ cearp: Welcome