Homebrew Homebrew Development

  • Thread starter Thread starter aliak11
  • Start date Start date
  • Views Views 1,475,692
  • Replies Replies 6,048
  • Likes Likes 54
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++)
 
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)
 
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!
 
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 :)
 
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.
 
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.
 
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.
 
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
 
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?
 
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?
 
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