gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > Problem after upgrading to devkitARM 21

#143570 - Peter - Tue Oct 23, 2007 10:53 pm

I just upgraded through the automatic upater to devkitarm 21. Now every example (libnds, or my own project) I compile does only work on the actual hardware, but not in no$gba or ideas anymore.

Anyone with the same problem or is it just my setup (windows xp, 32bit) for whatever reason?
_________________
Kind Regards,
Peter

#143572 - tepples - Tue Oct 23, 2007 10:56 pm

Peter wrote:
I just upgraded through the automatic upater to devkitarm 21. Now every example (libnds, or my own project) I compile does only work on the actual hardware, but not in no$gba or ideas anymore.

If a program works on a Nintendo DS but fails on an emulator, it is because of a defect in the emulator. Wintermute does not design devkitARM or libnds to work around defects in emulators.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#143576 - Lick - Wed Oct 24, 2007 12:21 am

This is a serious problem since many developers test on emulators before testing on hardware. Though I do believe the problem lies with the emulators, so what can we, simple developers, do but wait?

BTW, it seems that DeSmuME (0.7.3) successfully runs the examples.
_________________
http://licklick.wordpress.com

#143578 - tepples - Wed Oct 24, 2007 12:39 am

Lick wrote:
so what can we, simple developers, do but wait?

I chose to only update MSYS and PN today, and then wait to update devkitARM and libnds until finishing the release cycle for each of the projects I maintain. By then the emulators should have caught up.

If your program is 2D-heavy (not 3D-heavy or CPU-heavy), make a port to Game Boy Advance; emulators for that are mature. Or make a port to SDL or Allegro and develop your game logic on the PC.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#143592 - Peter - Wed Oct 24, 2007 6:21 am

tepples wrote:
If a program works on a Nintendo DS but fails on an emulator, it is because of a defect in the emulator. Wintermute does not design devkitARM or libnds to work around defects in emulators.

Well, I just wanted to know if this occurs to other people too or just my setup which is somehow broken. I didn't say it's devkitarm's fault though.
_________________
Kind Regards,
Peter

#143594 - wintermute - Wed Oct 24, 2007 6:26 am

That's actually the one thing I didn't check before rolling the releases. I've broken my own no$gba too so you're definitely not the only one.

I'll have a dig through and see what changes caused it & let Martin know. It shouldn't be hard to find, no$ was running most of the examples just fine on Sunday so it's something very recent. This sort of thing is almost always some feature of the hardware that hasn't been emulated yet.
_________________
devkitPro - professional toolchains at amateur prices
devkitPro IRC support
Personal Blog

#143604 - mml - Wed Oct 24, 2007 12:06 pm

Ooh, 21 is out?! I know what I'm doing this weekend. :)

#143614 - Peter - Wed Oct 24, 2007 5:58 pm

Since I can't wait,I hacked together a command line applicaton that patches the output .nds image from devkitarm r21 to make it compatible with no$gba 2.5a.

I don't garantee that it works with every .nds file and I also don't know what I broke due to the changed instructions (some SPI stuff was it), but the examples i compiled on my computer worked fine after patching in no$.

So use at your own risk of course :)
download with source
EDIT: download link removed.
_________________
Kind Regards,
Peter


Last edited by Peter on Thu Oct 25, 2007 6:28 am; edited 2 times in total

#143617 - Lino - Wed Oct 24, 2007 6:54 pm

Does it work? Is it the incriminated asm code? If yes thanks again :).

Can you insert the link in your site? Please?

#143639 - Arialia - Wed Oct 24, 2007 10:50 pm

Thanks a lot Peter your program works fine :)

i had test someone of examples :

16bit_color_bmp.nds -> no$gba says me "no$gba needs a copy of the original GBA BIOS to execute BIOS Sound functions "
Mixed_Text_3D.nds -> ok
Picking.nds -> ok
Toon_Shading.nds -> ok
Watch.nds -> don't work multiple errors to difficult to describe .. sorry

[Edit]
remove batch code
_________________
My Dev blog - - Tutorial on libfat in french -- DSPhoto


Last edited by Arialia on Thu Oct 25, 2007 7:03 am; edited 1 time in total

#143641 - wintermute - Wed Oct 24, 2007 11:41 pm

Personally, I'd prefer it a great deal if this sort of thing did not become prevalent. I fail to understand why people feel the need to produce nasty little tools which encourage the treatment of symptoms rather than looking for the cause. As a toolchain maintainer, this sort of thing makes my life hell - I've lost count of the number of support issues I've dealt with over the years which turned out to be caused by the use of a tool or some other nasty little hack that has long since outlived it's period of "usefulness"

The problem in this case is a piece of initialisation code in the arm7 core used to put the sound hardware into a known state. It seems that this code breaks the emulators and should be fixed on their end.

As a temporary workaround you can rebuild the default arm7 core without the offending code. ndstool now uses the basic.arm7 file found in the libnds folder rather than embedded code to make it easier to replace.

The basicARM7 folder of the libnds source contains the relevant code. Just comment the line that reads

Code:

   writePowerManagement(PM_CONTROL_REG, ( readPowerManagement(PM_CONTROL_REG) & ~PM_SOUND_MUTE ) | PM_SOUND_AMP );


and recompile. This code is also found in the combined template so if you're using that then modify it too.

If you have trouble there's a pre-built basic.arm7 at http://devkitpro.sourceforge.net/basic.arm7 - just copy it into the libnds folder, replacing the one that's already there.
_________________
devkitPro - professional toolchains at amateur prices
devkitPro IRC support
Personal Blog

#143676 - Peter - Thu Oct 25, 2007 6:23 am

wintermute wrote:
As a toolchain maintainer, this sort of thing makes my life hell - I've lost count of the number of support issues I've dealt with over the years which turned out to be caused by the use of a tool or some other nasty little hack that has long since outlived it's period of "usefulness"

This was not my goal of course. I have removed the download link.
_________________
Kind Regards,
Peter

#143679 - Arialia - Thu Oct 25, 2007 6:55 am

Thanks Wintermute so me too i don't like using hack

I prefer your soluce but if this hack had been a little help to understand what happened for no$gba and other emulators it was a good hack :)

Thanks again Peter :)

Sorry for my bad english :/
_________________
My Dev blog - - Tutorial on libfat in french -- DSPhoto