View unanswered posts | View active topics It is currently Thu Aug 28, 2014 12:05 am



Reply to topic  [ 7 posts ] 
 libnds IPC - gone? 
Author Message

Joined: Tue Apr 13, 2010 10:39 pm
Posts: 3
Hi all,

A friend and I are working on taking up development of the seemingly abandoned DScent project (DS port of Descent). We grabbed the latest source we could find and tried to compile it. Unfortunately, the code makes use of some things which are now gone in more recent libnds versions. For instance, the "IPC" struct. What's not clear here is what the upgrade path is for those that make use of the IPC struct. Can someone point me to a before-and-after example or something? Or at least to what API -should- be used?


Tue Apr 13, 2010 10:44 pm
Profile
User avatar

Joined: Tue Feb 02, 2010 12:43 am
Posts: 33
If you look at the examples that come with libnds for audio and input you'll see how the library works now. Those are the things the IPC structure was used for. Initiation and some other variable names have also changed.

I agree that its frustrating looking at old code. Most of the code I have from completed 2d tiled projects doesn't compile. You'll have to port your project to the new interface if you want to take over old code.

I'm not a expert on the process myself. I'm still a newbie.

_________________
Deadening 2


Wed Apr 14, 2010 4:22 am
Profile
Site Admin

Joined: Tue Aug 09, 2005 3:21 am
Posts: 1135
Location: UK
It really depends on what was being done with the old IPC struct - fwiw, this was always slated for deprecation and should never have been public in the first place. If at all possible the best place to start is to remove the custom arm7 code and rework the project for arm9 only.

If you can provide some code snppets it might be easier to suggest replacements.

_________________
devkitPro IRC support
Personal Blog


Wed Apr 14, 2010 3:36 pm
Profile ICQ WWW

Joined: Tue Apr 13, 2010 10:39 pm
Posts: 3
Well, here's the function I'm dealing with at the moment:
Code:
void VcountHandler (void)
{
   static int lastbut = -1;
   uint16 but = 0, x = 0, y = 0, xpx = 0, ypx = 0, z1 = 0, z2 = 0;

   but = REG_KEYXY;

   if (!( (but ^ lastbut) & (1 << 6)))
   {
       touchReadXY ( &tempPos );

      if (tempPos.rawx == 0 || tempPos.rawy == 0)
      {
         but |= (1 <<6);
         lastbut = but;
      }
      else
      {
         x = tempPos.rawx;
         y = tempPos.rawy;
         xpx = tempPos.px;
         ypx = tempPos.py;
         z1 = tempPos.z1;
         z2 = tempPos.z2;
      }
   }
   else
   {
      lastbut = but;
      but |= (1 << 6);
   }
   if (but & (1 << 7))
      needSleep = 1;

   if (vcount == 80)
      first = tempPos;
   else
   {
      if (abs (xpx - first.px) > 10 || abs (ypx - first.py) > 10 || (but & (1 << 6)))
      {
         but |= (1 << 6);
         lastbut = but;
      }
      else
      {
         IPC->mailBusy = 1;
         IPC->touchX = x;
         IPC->touchY = y;
         IPC->touchXpx = xpx;
         IPC->touchYpx = ypx;
         IPC->touchZ1 = z1;
         IPC->touchZ2 = z2;
         IPC->mailBusy = 0;
      }
   }
   IPC->buttons = but;
   vcount ^= (80 ^ 130);
   SetYtrigger (vcount);
}


Incidentally, to resolve another problem in the same file, what's the replacement for "SOUND_CR = SOUND_ENABLE | SOUND_VOL (0x7F);"? Just "powerOn(PM_SOUND_AMP);"?


Wed Apr 14, 2010 10:39 pm
Profile

Joined: Tue Apr 13, 2010 10:39 pm
Posts: 3
WinterMute wrote:
If at all possible the best place to start is to remove the custom arm7 code and rework the project for arm9 only.

Don't you have to have both the ARM7 and ARM9 working in tandem to implement WiFi support in applications? Because that's the next step after debugging this thing.


Wed Apr 14, 2010 10:41 pm
Profile
User avatar

Joined: Fri Jul 11, 2008 8:49 pm
Posts: 222
Location: The Netherlands
you need the arm7 to use wifi, but the default arm7 binary has DSwifi included, so you can just use the default arm7 binary and DSwifi.

WinterMute wrote:
project for arm9 only.


you might want to rename that to "project that uses the default arm7 binary", to make it less ambiguous.

_________________
my blog:
http://vuurrobin.100webcustomers.com/


Thu Apr 15, 2010 12:15 am
Profile WWW

Joined: Tue Jun 09, 2009 5:13 am
Posts: 21
As far as I could see, there was no special-cases in the code you posted above. That was all basic input code and is well handled by the default ARM7 core. You just have to change your ARM9 side to work with it, and that's should be well documented in the nice input examples. Regarding the sound stuff, my take is that you should throw your sound support out and just rewrite it using maxmod or something that's compatible with the new toolchain.

_________________
http://www.collectingsmiles.com/colors & http://www.collectingsmiles.com/hyena


Wed May 05, 2010 4:53 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 7 posts ] 

Who is online

Users browsing this forum: Baidu [Spider], GcoMember and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
  Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.
Get devkitPro at SourceForge.net. Fast, secure and Free Open Source software downloads