Homebrew Homebrew Development

Crewman

Active Member
Newcomer
Joined
May 9, 2013
Messages
42
Trophies
0
Age
44
XP
142
Country
Gambia, The
I would use a for loop for the conversation of the single bits.

Then you could do the following:

const int MAXBITS=8;
int val[MAXBITS];

.
.
.

//If normal state, take input
if (bit < MAXBITS) ....

.
.
.

void conversion()
{
for(int i=0;i<MAXBITS;i++)
 

bobmcjr

Well-Known Member
Member
Joined
Apr 26, 2013
Messages
1,156
Trophies
1
XP
3,215
Country
United States
If you're doing bit shifting, you may as well do bitwise ORing instead of adding.
Instead of (n<<2)+(n<<3)+(n<<4)
do
(n<<2)|(n<<3)|(n<<4)

(| is the character on the key with backslash)
 

AlbertoSONIC

Pasta Team Member
Member
Joined
Jun 27, 2014
Messages
927
Trophies
0
Age
52
Website
www.albertosonic.com
XP
1,396
Country
Italy
Yes it is but you can combine it like this:

for(int i=0;i<MAXBITS;i++)
{
result |= n<<i;
}

Now if you want your program to convert 16 bits you just set MAXBITS to 16.
This will make the program more flexible

"3DS Binary Decimal Converter" updated with new conversione method (for + <<). Thanks to Crewman and YoshiInAVoid !

Updated repo's link in my signature!
 

AlbertoSONIC

Pasta Team Member
Member
Joined
Jun 27, 2014
Messages
927
Trophies
0
Age
52
Website
www.albertosonic.com
XP
1,396
Country
Italy
you should take a look at the compiled elf. gcc will optimize in exactly that way for you. the multiplication may already be converted to shifts.

Just like with linux kernel compiling?

Anyway: graphical glitches fixed, black screen after going back to homebrew from main menu fixed, some texts moved. Now i think that everything is fixed. Sources updated, link in my signature :)
 

AlbertoSONIC

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

KennyMckormick

Banned!
Banned
Joined
Oct 4, 2014
Messages
126
Trophies
0
Age
44
XP
48
Country
United States
I was thinking. How difficult would it be to create a homebrew file/save manager. I think it would be great if we can sync our saves across different 3ds consoles without the need of using a PC to manually copy the saves.
 

Reisyukaku

Onii-sama~
Developer
Joined
Feb 11, 2014
Messages
1,534
Trophies
2
Website
reisyukaku.org
XP
5,422
Country
United States
I was thinking. How difficult would it be to create a homebrew file/save manager. I think it would be great if we can sync our saves across different 3ds consoles without the need of using a PC to manually copy the saves.
Then create it.
Thats easier said than done, by far.
 

Gadorach

Electronics Engineering Technologist
Member
Joined
Jan 22, 2014
Messages
970
Trophies
0
Location
Canada
XP
956
Country
Canada
Thats easier said than done, by far.
Pretty much would need to code up an FTP server/manager and have it identify and transfer files between two connected units. As no one has released a PoC for FTP on the 3DS, the bulk of the work would need to be done on that before this would be feasible. I'm not even sure that CTRUlib supports networking just yet, so we'd have to hold on for that first.
 

Reisyukaku

Onii-sama~
Developer
Joined
Feb 11, 2014
Messages
1,534
Trophies
2
Website
reisyukaku.org
XP
5,422
Country
United States
Pretty much would need to code up an FTP server/manager and have it identify and transfer files between two connected units. As no one has released a PoC for FTP on the 3DS, the bulk of the work would need to be done on that before this would be feasible. I'm not even sure that CTRUlib supports networking just yet, so we'd have to hold on for that first.
Well I wasn't even thinking about that, but just getting the xorpad for a save is a pain.. assuming you just want sharing between gateway devices, that's easier.. that reminds me, I decompiled cyber gadget software and was gonna implement save sharing.. it's not high on my priorities atm tho
 

PieFace

Well-Known Member
Newcomer
Joined
Aug 4, 2014
Messages
59
Trophies
0
XP
157
Country
United States
Anyone know how to do division and modulus on arm9?
I am getting a linker error with:
Code:
undefined reference to '__aeabi_idivmod'
undefined reference to '__aeabi_idiv'
I poked around in the math header files in devkitarm but couldn't find any mention of either.
I am aware that arm does not have a divison instruction, but there still should be a simple way with c right?
 

CalebW

Fellow Temper
Member
Joined
Jun 29, 2012
Messages
638
Trophies
0
Location
Texas
XP
545
Country
United States
Anyone know how to do division and modulus on arm9?
I am getting a linker error with:
Code:
undefined reference to '__aeabi_idivmod'
undefined reference to '__aeabi_idiv'
I poked around in the math header files in devkitarm but couldn't find any mention of either.
I am aware that arm does not have a divison instruction, but there still should be a simple way with c right?
Just do a 1.0/3?
 

nop90

Well-Known Member
Member
Joined
Jan 11, 2014
Messages
1,556
Trophies
0
Location
Rome
XP
3,136
Country
Italy
Most of the times you can avoid integer divisions and modules with some tricks, but if you absolutely need them, you can search an implementation on internet and define them.

Just a little example I used time ago:

Code:
unsigned long long __aeabi_uidiv (unsigned long long numerator, unsigned long long denominator)
    {
    unsigned long long result;
    result = 0;
    while ((numerator-denominator)>denominator)
    {
    result++;
    numerator -=denominator;
    }
    return result;
  }
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    OctoAori20 @ OctoAori20: Nice nice-