Homebrew Homebrew Development

AlbertoSONIC

Pasta Team Member
Member
Joined
Jun 27, 2014
Messages
927
Trophies
0
Age
52
Website
www.albertosonic.com
XP
1,396
Country
Italy
Python eh?

http://learnpythonthehardway.org/

Free version of the e-book if you prefer:

http://learnpythonthehardway.org/book/

Enjoy, it's also a recommended book by the r/programming subreddit, so I'm assuming it's pretty good.
I haven't read it myself, but I plan to read it to use as material to help teach my younger cousin programming in the future.

Anyway, enjoy, and also, that same guy has a book on C as well, might want to check it out. ;)
Thank you, really! You guys at GBATemp are awesome!
 

AlbertoSONIC

Pasta Team Member
Member
Joined
Jun 27, 2014
Messages
927
Trophies
0
Age
52
Website
www.albertosonic.com
XP
1,396
Country
Italy
I finally got it to work!
https://github.com/AlbertoSONIC/3DSBinaryConverter

But i'm having some graphical issue...

77ca3112ed74be3d2f613a52cc3f5175.jpg


How can i fix it? I really need help!

EDIT1: Plus, i need help for int --> char* conversion... Because it seems to crash once it reaches the result printing point.

EDIT2: Is there some way to increase font size?
 
  • Like
Reactions: gamesquest1

Relys

^(Software | Hardware) Exploit? Development.$
Member
Joined
Jan 5, 2007
Messages
878
Trophies
1
XP
1,239
Country
United States
I finally got it to work!
https://github.com/AlbertoSONIC/3DSBinaryConverter

But i'm having some graphical issue...


How can i fix it? I really need help!

Plus, i need help for int --> char* conversion...


It's probably because you're only writing to 1/2 framebuffers (and you're using a hardcoded addr as opposed to swaping with the gfx lib).

For int-->char just search for "itoa in c" function and port it over.
 

YourNerdyJoe

Active Member
Newcomer
Joined
Jul 18, 2014
Messages
41
Trophies
0
Age
26
Website
yournerdyjoe.github.io
XP
179
Country
United States
But i'm writing to the bottom screen...

All the screens have both a frontbuffer and backbuffer (sometimes I've seen it refered to as framebuffer 0/1).
What you do is write to the backbuffer then flip (or swap) the buffers to see it rendered to the screen.
If one of the buffers is blank then the screen flashes all weird.
 

AlbertoSONIC

Pasta Team Member
Member
Joined
Jun 27, 2014
Messages
927
Trophies
0
Age
52
Website
www.albertosonic.com
XP
1,396
Country
Italy
All the screens have both a frontbuffer and backbuffer (sometimes I've seen it refered to as framebuffer 0/1).
What you do is write to the backbuffer then flip (or swap) the buffers to see it rendered to the screen.
If one of the buffers is blank then the screen flashes all weird.
I'll see tomorrow... Good night guys!
 

AlbertoSONIC

Pasta Team Member
Member
Joined
Jun 27, 2014
Messages
927
Trophies
0
Age
52
Website
www.albertosonic.com
XP
1,396
Country
Italy
Guys i finally fixed almost everything (except a little framebuffer bug... )! I can only thank Relys for his code! I didn't copied it.. But it helped me a lot!


P.S. If someone could help me with that framebuffer bug i would appreciate his help...
40c6ed0d1dc63415c8a6ca8fb91ebcc4.jpg


As you can see, the inserted binary number isn't fully clear.

Also, i removed the github repo because it didn't want to sync. Now you can find all source code here: www.github.com/AlbertoSONIC/3DS_Binary_Decimal_Converter

I think that now this is a good code. Let me know your feedback!

Again, it wouldn't work without Relys 's help!
 

YoshiInAVoid

Banned!
Banned
Joined
Jan 10, 2011
Messages
560
Trophies
1
Website
google.com
XP
465
Country
Guys i finally fixed almost everything (except a little framebuffer bug... )! I can only thank Relys for his code! I didn't copied it.. But it helped me a lot!


P.S. If someone could help me with that framebuffer bug i would appreciate his help...
40c6ed0d1dc63415c8a6ca8fb91ebcc4.jpg


As you can see, the inserted binary number isn't fully clear.

Also, i removed the github repo because it didn't want to sync. Now you can find all source code here: www.github.com/AlbertoSONIC/3DS_Binary_Decimal_Converter

I think that now this is a good code. Let me know your feedback!
Good program. Source looks well written too. I have a minor suggestion for this line though:

Code:
converted += val[7] * 1 + val[6] * 2 + val[5] * 4 + val[4] * 8 + val[3] * 16 + val[2] * 32 + val[1] * 64 + val[0] * 128;

You should learn how to use the << operator.

n << 1 = n * 2
n << 2 = n * 4
n << 3 = n * 8
n << 4 = n * 16
n << 5 = n * 32
n << 6 = n * 64
n << 7 = n * 128
n << 8 = n * 256
etc...

Although the result is the same as multiplication, the << operator is slightly faster in most cases, and it just looks more correct when dealing with bits since that is it's intended purpose.
 

AlbertoSONIC

Pasta Team Member
Member
Joined
Jun 27, 2014
Messages
927
Trophies
0
Age
52
Website
www.albertosonic.com
XP
1,396
Country
Italy
Good program. Source looks well written too. I have a minor suggestion for this line though:

Code:
converted += val[7] * 1 + val[6] * 2 + val[5] * 4 + val[4] * 8 + val[3] * 16 + val[2] * 32 + val[1] * 64 + val[0] * 128;

You should learn how to use the << operator.

n << 1 = n * 2
n << 2 = n * 4
n << 3 = n * 8
n << 4 = n * 16
n << 5 = n * 32
n << 6 = n * 64
n << 7 = n * 128
n << 8 = n * 256
etc...

Although the result is the same as multiplication, the << operator is slightly faster in most cases, and it just looks more correct when dealing with bits since that is it's intended purpose.
So i have to replace every * with <<?
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
  • K3Nv2 @ K3Nv2:
    I'll reformat and have a 3tb raid0 m. 2 at least
    +1
  • K3Nv2 @ K3Nv2:
    Lmao that sold out fast
    +1
  • Veho @ Veho:
    Yeet the cat.
    +1
  • K3Nv2 @ K3Nv2:
    Good idea
    +1
  • The Real Jdbye @ The Real Jdbye:
    i thought everybody knew cocktails are like 75% ice
  • Veho @ Veho:
    Yeah but not like this.
  • Veho @ Veho:
    It's not like they're complaining that their Slurpee is 99% ice or something, but if the cocktail calls for "shot of vodka, shot of vermouth, shot of gin, shot of Campari, three shots of juice, squirt of lemon" and ends up being a thimbleful of booze, that's a problem.
  • The Real Jdbye @ The Real Jdbye:
    the funny thing is cocktails in norway are only allowed to have 1 20ml shot of booze
  • The Real Jdbye @ The Real Jdbye:
    so..... yeah
  • The Real Jdbye @ The Real Jdbye:
    we're used to only having a thimbleful of booze
  • Veho @ Veho:
    Booo.
  • The Real Jdbye @ The Real Jdbye:
    same thing if you want whisky on the rocks or something, you can't get a double
  • The Real Jdbye @ The Real Jdbye:
    but you could buy as many shots of whisky (or anything else) as you want and ask for a glass of ice and pour them in
  • The Real Jdbye @ The Real Jdbye:
    it's dumb
  • Veho @ Veho:
    Maybe.
  • Veho @ Veho:
    There was a comparison of the number of Ibuprofen poisonings before and after they limited the maximum dosage per box or per pill (i'll look that up). No limit on the number of boxes you can still buy as many as you want, so people argued it was pointless.
  • Veho @ Veho:
    But the number of (accidental) poisonings dropped because drinking an entire package of ibuprofen pills went from "I need a new liver" to "I need a new box of Ibuprofen".
  • Veho @ Veho:
    Here we have ketoprofen that used to be prescription-only because of the risk of toxic dosages, but then they halved the dose per pill and sell them in bottles of six pills apiece instead of twenty and it doesn't need a prescription any more. Yes you can buy more than one bottle but people simply don't.
  • Psionic Roshambo @ Psionic Roshambo:
    Usually accidentally overdose of ibuprofen here is from people taking like cold medicine then ibuprofen for a headache and the combination is over what they need
    Veho @ Veho: https://imgur.com/gallery/QQkYnQu