DSTwo Reset code sample files

Discussion in 'Supercard' started by Pong20302000, Jun 14, 2010.

Jun 14, 2010
  1. Pong20302000
    OP

    Member Pong20302000 making notes on everything

    Joined:
    Sep 8, 2009
    Messages:
    8,076
    Location:
    One's inner self
    Country:
    Japan


  2. alidsl

    Member alidsl I am now a lurker

    Joined:
    May 27, 2009
    Messages:
    2,823
    Location:
    Kanto - Pallet Town
    Country:
    United Kingdom
    Wait... so how is this different
     
  3. Matt140

    Member Matt140 GBAtemp Fan

    Joined:
    Mar 1, 2009
    Messages:
    345
    Location:
    England
    Country:
    United Kingdom
    It shows developers how to implement soft resetting on the DS2... I think [​IMG].
     
  4. alidsl

    Member alidsl I am now a lurker

    Joined:
    May 27, 2009
    Messages:
    2,823
    Location:
    Kanto - Pallet Town
    Country:
    United Kingdom
    Thanks, I guess I won't be using this then [​IMG]
     
  5. Pong20302000
    OP

    Member Pong20302000 making notes on everything

    Joined:
    Sep 8, 2009
    Messages:
    8,076
    Location:
    One's inner self
    Country:
    Japan
    i said not for the average user [​IMG]
     
  6. alidsl

    Member alidsl I am now a lurker

    Joined:
    May 27, 2009
    Messages:
    2,823
    Location:
    Kanto - Pallet Town
    Country:
    United Kingdom
    I guess i'll have to use it then [​IMG]
     
  7. DiscostewSM

    Member DiscostewSM GBAtemp Psycho!

    Joined:
    Feb 10, 2009
    Messages:
    4,799
    Location:
    Sacramento, California
    Country:
    United States
    Excluding the actual implementation into a project, the code is different. Most likely to be compatible with the current toolkit being used.
     
  8. OrGoN3

    Member OrGoN3 GBAtemp Advanced Fan

    Joined:
    Apr 23, 2007
    Messages:
    993
    Country:
    United States
  9. Stormwave

    Member Stormwave GBAtemp Regular

    Joined:
    Apr 22, 2010
    Messages:
    223
    Country:
    United Kingdom
    Has anybody managed to get this to work? I managed to compile it by fixing some of the bugs (powerON and powerOFF renaming, etc). But when trying to load the nds file through DS_GAME or Moonshell2 I just get two white screens rather than an actual reset. Any thoughts?
     
  10. DeltaBurnt

    Member DeltaBurnt I'm bored

    Joined:
    Feb 21, 2009
    Messages:
    3,353
    Location:
    Where intellect matters
    Country:
    United States
    I thought this code was something you put in the homebrew source to allow soft-reset/real time menu. So it's supposed to allow you to make your own "reset2desktop.nds"?
     
  11. Stormwave

    Member Stormwave GBAtemp Regular

    Joined:
    Apr 22, 2010
    Messages:
    223
    Country:
    United Kingdom
    Aye, thats the idea. I can't get it to work though (trying it out on it's own first, then I was going to write a class for my other projects). The program is compiling fine, and as far as I can tell, it's working. It just doesn't actually reset :/
     
  12. DeltaBurnt

    Member DeltaBurnt I'm bored

    Joined:
    Feb 21, 2009
    Messages:
    3,353
    Location:
    Where intellect matters
    Country:
    United States
    What is it set to reset to?
     
  13. Stormwave

    Member Stormwave GBAtemp Regular

    Joined:
    Apr 22, 2010
    Messages:
    223
    Country:
    United Kingdom
    It's supposed to reset to "_dstwo/dstwo.nds" as far as I can tell. The actual loader code appears to be compiled into the "reset_patch.bin" file. That file is then loaded into the ARM7 memory and the program execution is reset to it. That reset_patch.bin then, I presume, reboots to "_dstwo/dstwo.nds". As follows:

    memcpy( (char *)0x23fc000,reset_patch_bin,reset_patch_bin_size );
    runreset=(void(*)(void))0x23fc000;
    runreset();

    Obviously, since it's precompiled, it's hard to know if the problem is with their code or my own. I'm using most of the sample file exactly as it was distributed, the only changes are changes I had to make to allow it to compile (I changed PowerON and PowerOFF to PowerOn and PowerOff, I removed the SOUND_CR=0 line, and changed the ARM9 Makefile slightly). I can't imagine any of those changes preventing it from working, but I might be wrong. Which is why I was wondering if anyone else had got it working.

    -Edit-

    Forgot, I also had to edit out the "clr_cache(&resetAndLoop,0x1000);" line. I'm not sure what the purpose of that is, but it was preventing me from compiling.
     
  14. DeltaBurnt

    Member DeltaBurnt I'm bored

    Joined:
    Feb 21, 2009
    Messages:
    3,353
    Location:
    Where intellect matters
    Country:
    United States
    Hmm...well if it was their code that was wrong then reset2desktop.nds shouldn't work.

    Maybe what you're using to compile the source is what's causing the problems, and thus you editing them causes the reset to not function properly.
     
  15. Stormwave

    Member Stormwave GBAtemp Regular

    Joined:
    Apr 22, 2010
    Messages:
    223
    Country:
    United Kingdom
    Aye, I thought about that as a possibility. As far as I am aware this is supposed to compile with DevkitPro and libnds, however the incorrectly spelt PowerON etc presumably means a version different to the one I'm using (the latest version I think). The main functions I'm altering have replacements in one way or another, the only thing thats really getting me is this error:

    c:/users/andy/documents/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.4.2/../../../../arm-eabi/lib/thumb/ds_arm9_crt0.o: In function `CIDLoop':
    (.init+0x1b8): undefined reference to `__vectors_lma'
    c:/users/andy/documents/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.4.2/../../../../arm-eabi/lib/thumb/ds_arm9_crt0.o: In function `CIDLoop':
    (.init+0x1bc): undefined reference to `__vectors_start'
    c:/users/andy/documents/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.4.2/../../../../arm-eabi/lib/thumb/ds_arm9_crt0.o: In function `CIDLoop':
    (.init+0x1c0): undefined reference to `__vectors_end'

    Which happens when the "spec" files are included. I've no idea what these are for though, so I removed the -spec reference in the Makefile to get it to compile. Perhaps thats the problem?
     
  16. DeltaBurnt

    Member DeltaBurnt I'm bored

    Joined:
    Feb 21, 2009
    Messages:
    3,353
    Location:
    Where intellect matters
    Country:
    United States
    Possibly. Was there any comment in the source code as to why they were needed? If there wasn't I would email/PM the supercard team and ask them about it.
     
  17. spinal_cord

    Member spinal_cord Knows his stuff

    Joined:
    Jul 21, 2007
    Messages:
    2,871
    Location:
    somewhere
    Country:
    United Kingdom
    I might be looking at this the wrong way, but dstwo.nds is just a plain .nds file. Why not just load it through the chishm's loader?
     
  18. Stormwave

    Member Stormwave GBAtemp Regular

    Joined:
    Apr 22, 2010
    Messages:
    223
    Country:
    United Kingdom
    I'd tried a few other methods beforehand, like bootlib etc. Not tried Chishm's though (wasn't aware of it), any idea where I can get hold of that? Is that what you use for DScovered etc?

    That would certainly fix the problem [​IMG]
     
  19. spinal_cord

    Member spinal_cord Knows his stuff

    Joined:
    Jul 21, 2007
    Messages:
    2,871
    Location:
    somewhere
    Country:
    United Kingdom
    chishm's code was used in hbmenu I think... http://wiki.devkitpro.org/index.php/Homebrew_Menu
    The one I used is way out of date now though, its from 2007ish, it works reasonably well, it just doesn't pass argv or soft-reset, but I don't feel the need for soft-reset if the cards firmware is a plain .nds file, just load it.
     
  20. Stormwave

    Member Stormwave GBAtemp Regular

    Joined:
    Apr 22, 2010
    Messages:
    223
    Country:
    United Kingdom
    Ah right, I did try the hbmenu earlier. I downloaded the latest version from the svn and tried to compile it. I can't remember what went wrong now, I didn't really persist with it. I've still got it, so I'll have a look back into using that to boot it.
     

Share This Page