Help with a small program?

Searinox
Posts: 10
Joined: Sun Sep 26, 2010 10:23 pm

Re: Help with a small program?

Post by Searinox » Wed Sep 29, 2010 11:46 am

Awareness yes, I do have it. However, this is literally the first time I've ever programmed on DS. I've also not operated with format decoding before.

zeromus
Posts: 212
Joined: Wed Mar 31, 2010 6:05 pm

Re: Help with a small program?

Post by zeromus » Wed Sep 29, 2010 10:38 pm

It's almost a beginner's exercise. Im sure you can manage it.

Searinox
Posts: 10
Joined: Sun Sep 26, 2010 10:23 pm

Re: Help with a small program?

Post by Searinox » Sun Oct 10, 2010 1:47 pm

Xenon provided coding for the 24bit bitmap loading and all is well now. However I'd like to take this one step further now...

I want to upgrade the app to be able to boot NDS slot-2 cartridges too. I have went back to woodrpg's source for that but I got stumped. There is still some stuff I don't get and I would like it if someone would explain it to me... The command that does this is "loadRom("slot2:/");".

Code: Select all

bool loadRom( const std::string & filename, u32 flags )
{    ALIGN(4) u8 filenameBuffer[MAX_FILENAME_LENGTH];
    memset( filenameBuffer, 0, MAX_FILENAME_LENGTH );
    memcpy( filenameBuffer, filename.c_str(), filename.length() );

    memcpy( (void *)0x023FA000, akloader_arm7_bin, akloader_arm7_bin_size );
    __NDSHeader->arm7executeAddress = 0x023FA000;

    // copy loader's arm9 code
    memcpy( (void *)0x023b0000, akloader_arm9_bin, akloader_arm9_bin_size );
    __NDSHeader->arm9executeAddress = 0x023b0000;

    //dbg_printf( "load done\n" );

    ELM_Unmount();

    resetAndLoop();

return true;}
I assume that the first three lines load the ROM into memory. What happens beyond that? From what I understand the relevant data is loaded into memory, then the execute address is directed to the code's entry point. The problem is the akloader_arm#_bin and its _size code. What is it loading exactly? Is a particular file or memory address loaded? Is this the part where it loads the ROM patcher? I would like to do without the acekard patcher. I don't need to load commercial ROMs.

zeromus
Posts: 212
Joined: Wed Mar 31, 2010 6:05 pm

Re: Help with a small program?

Post by zeromus » Mon Oct 11, 2010 10:27 pm

hope you brought a snorkel

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest