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 > devkitARM r20 - .cpp & emulator issues [Solved]

#117513 - JessTicular - Mon Feb 05, 2007 6:25 am

G'day,

I've just updated to devkitARM r20 (and libnds 20070127) and I wanted to update all my projects to compile under these new dev kits.

However, when I try to compile any C++ based (rather than C based) project, it crashes both Dualis and the Hardware.

As an example, the 'Combined Template' will compile and run perfectly under the new kits, but if you change the files to .cpp instead of .c, they then crash the Editor and Hardware. This did not happen under r19a.

Any Ideas?

Cheers,
Jess.
_________________
Nintendo DS & Dominos :: DS Dominos
http://jt0.org


Last edited by JessTicular on Mon Feb 05, 2007 2:30 pm; edited 2 times in total

#117527 - wintermute - Mon Feb 05, 2007 11:21 am

Just tried that here.

With .cpp the arm7 core of the combined template fails due to a difference in handling of enum types between C++ & C.

You can fix this by changing the parameter type of irqEnable in the libnds headers to u32 - this is what's being done in CVS currently, cast the parameter ( won't work when you update libnds again) or just enable the interrupts separately.

Tested the result in no$gba, dualis and hw. dualis doesn't crash here but doesn't quite work right ( this is due to the difference in IPC struct, much of which should have been removed long ago) , the others work fine.
_________________
devkitPro - professional toolchains at amateur prices
devkitPro IRC support
Personal Blog

#117528 - JessTicular - Mon Feb 05, 2007 11:34 am

Absolutely beautiful!

Thanks for that wintermute, like you said, it runs perfectly on Hardware, but a bit dodgy in Dualis, but I can live without that.

Cheers,
Jess.
_________________
Nintendo DS & Dominos :: DS Dominos
http://jt0.org

#117530 - MrD - Mon Feb 05, 2007 12:29 pm

Have you tried it under no$, Jess?
_________________
Not active on this forum. For Lemmings DS help see its website.

#117540 - JessTicular - Mon Feb 05, 2007 2:23 pm

Yep, No$GBA 2.3 runs the rom just fine.

DeSmuME 0.4.0 runs it, but with some quirks (almost identical to Dualis used to).

Dualis 20.3 crashes still.

DSEmu 0.4.10 crashes.

iDeaS 1008c crashes.

And, Hardware runs it like it should.

:)

[EDIT]
To clarify, I made the u32 change in libnds
[/EDIT]
_________________
Nintendo DS & Dominos :: DS Dominos
http://jt0.org

#117621 - Normmatt - Tue Feb 06, 2007 1:28 am

JessTicular wrote:

DeSmuME 0.4.0 runs it, but with some quirks (almost identical to Dualis used to).
[/EDIT]


Why are you running such an OLD version of DeSmuME, the latest is v0.6.0 and has many many improvements over 0.4.0

#117640 - JessTicular - Tue Feb 06, 2007 8:25 am

Because on http://www.desmume.com/, the latest version available is 0.4.0, is there anywhere else I should be looking for it?
_________________
Nintendo DS & Dominos :: DS Dominos
http://jt0.org

#117643 - Firon - Tue Feb 06, 2007 8:33 am

http://desmume.sourceforge.net/

#117646 - JessTicular - Tue Feb 06, 2007 9:27 am

Cheers,

But 0.6.0 runs with almost identical quirks :P
The main one being that it doesn't display Sprites properly.
_________________
Nintendo DS & Dominos :: DS Dominos
http://jt0.org

#117658 - nio101 - Tue Feb 06, 2007 11:34 am

Hello,

wintermute wrote:

You can fix this by changing the parameter type of irqEnable in the libnds headers to u32 - this is what's being done in CVS currently, cast the parameter ( won't work when you update libnds again) or just enable the interrupts separately.


I've been looking at http://devkitpro.cvs.sourceforge.net/devkitpro/libnds/include/nds/, but I couldn't find any fixed header...

Could you explain how to get the last cvs update, please ?

My combined .cpp project doesn't work anymore on dualis/desmume (no more stylus, quirks...)...

I need the dir functions provided by the last libfat working with r20, but I need my ROM to work on emulators too (can't debug code only on hardware).

As to you, will there be any lib fixes in the future, or will the emulators be updated for us to have a completed devkit/emulator toolchain ?

I need to take a decision to know if I have to come back to r19 and try some "dirent.h" solution...

Thanks for your answers...

#117660 - JessTicular - Tue Feb 06, 2007 1:04 pm

http://devkitpro.cvs.sourceforge.net/devkitpro/libnds/include/nds/interrupts.h?view=log
That's the latest version of the file you need to grab.

But, you can do it yourself - Simply change irqEnable(IRQ_MASK irq) in interrupts.h to irqEnable(uint32 irq)
_________________
Nintendo DS & Dominos :: DS Dominos
http://jt0.org

#117666 - nio101 - Tue Feb 06, 2007 2:08 pm

Thanks...

But even with this fix, I still have my problems with emulators and r20 :

Dualis : No more stylus...
desmume 0.6 : Stylus OK, but totally bugged extended background...
No$Gba : Stylus and ext. background OK, but no FAT emu (!)

Dualis doesn't seem to be updated anymore, but desmume is... I'll go and see if ext. background bugs are about to be fixed...?

Thanks.

#117668 - Mighty Max - Tue Feb 06, 2007 2:24 pm

We (the desmume cvs team) are allways happy to receive example homebrew nds files (good if sourcecode is included) which show how hardware acts different then the emulator.

This way we can properly locate a bug/missing feature and fix the issue.
_________________
GBAMP Multiboot

#117669 - JessTicular - Tue Feb 06, 2007 2:32 pm

nio101,

It's not surprising that the emulators are broken after such a large and new update has been released.

But, thankfully, we have developers like Mighty Max here who are trying to keep on top of things and make sure they work with all the latest binaries :)
_________________
Nintendo DS & Dominos :: DS Dominos
http://jt0.org

#117704 - GPFerror - Tue Feb 06, 2007 7:40 pm

use FCSR images appended to the .ds.gba, works in desmume and no$gba and probably a couple more emulators.

libfat has never worked for me in dualis, as soon as fatInitDefault() is called, dualis closes on me.

Troy(GPF)

#117721 - nio101 - Tue Feb 06, 2007 10:44 pm

Mighty Max wrote:
We (the desmume cvs team) are allways happy to receive example homebrew nds files (good if sourcecode is included) which show how hardware acts different then the emulator.

This way we can properly locate a bug/missing feature and fix the issue.


Great!

I'll then clean my code to keep only what's problematic, and I soon as I can, I'll post some example along with r20 sourcecode on http://desmume.sourceforge.net/forums/...

Greetings !

#117778 - nio101 - Wed Feb 07, 2007 10:35 am

Hello, the extended background example is there :
http://sourceforge.net/project/showfiles.php?group_id=186024&package_id=220479&release_id=484529

The relevant post is on http://desmume.sourceforge.net/forums/index.php?action=vthread&forum=1&topic=137

Thanks for your help!

EDIT : my MAIN_BG3 is defined as a BG_BMP8_512x512 background in the source code, but seems to be seen as a 1024x1024 background by Desmume (as stated in the Map Viewer)...
It could expain why this particular background is not drawn correctly ?