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 > IRQ issues (was: Which versions of libnds/DevKitArm)

#59922 - bluescrn - Sat Nov 05, 2005 4:40 pm

I've just reinstalled my dev env, with all the latest everything... Got the samples building, and some running, but can't get the 3D samples (in particular, textured_cube) to run on hardware...

Now I remember last time I set it up (about 3-4 months ago?) ndslib was a bit broken, and I had to roll back a couple of files from CVS and rebuild my own... but I was expecting that'd be all fixed by now?

I don't think it's just my install - the textured_cube sample has been confirmed not to work on hardware by another coder.

(edit - key input problem was swiWaitForVBlank() hanging on emulators)


Last edited by bluescrn on Sat Nov 05, 2005 5:16 pm; edited 2 times in total

#59925 - crudhacker - Sat Nov 05, 2005 5:03 pm

bluescrn wrote:
- Key input doesn't seem to work in the emulators (bg_rotation, in both Dualis and iDeaS)


DS emulators are still kind of new and have bugs. Its best to run homebrew stuff on the real hardware(DS)
_________________
MKDS friend code-
051599-251600
PM me so i can add u

crack this encrypted message-
BNSRIAYTNEDCLTFJQEZGNWDXHO
key- skip first letter then skip 2,3 till 4 then go back down

#59926 - bluescrn - Sat Nov 05, 2005 5:14 pm

My problems seem interrupt related... I'd forgot that swiWaitForVBlank() doesn't work on emulators - I'd previously used this instead:

#define REG_VCOUNT (*(vu16*)0x4000006)
while(REG_VCOUNT!=192);
while(REG_VCOUNT==192);


But with the latest libnds, it seems to be the cause of problems with the textured_cube sample *on hardware* - if I remove the swiWaitForVblank(), then it works....

#59927 - dovoto - Sat Nov 05, 2005 6:14 pm

How are you booting the examples? Is the nehe example or one of the others?

All of the nehe work for me on hardware using flashme and a flashcart but I have had one other person complain about the same issue. If you could give me a bit more detail it would be appreciated.
_________________
www.drunkencoders.com

#59937 - bluescrn - Sat Nov 05, 2005 7:55 pm

dovoto wrote:
How are you booting the examples? Is the nehe example or one of the others?

All of the nehe work for me on hardware using flashme and a flashcart but I have had one other person complain about the same issue. If you could give me a bit more detail it would be appreciated.


I just tried a random NeHe sample now (Lesson10), and it worked with no modifications.

I was trying the older samples, in particular the Drunken Coders 'textured_cube', which I knew used to work... So it doesn't look like there's a real problem, just that that sample might need updating for recent versions of libnds?

I'm currently using WifiMe to boot the samples

#59940 - dovoto - Sat Nov 05, 2005 8:08 pm

hmm...i think i will just delete examples covered by nehe code...thanks for that
_________________
www.drunkencoders.com

#59998 - LOst? - Sun Nov 06, 2005 4:32 am

bluescrn wrote:
I've just reinstalled my dev env, with all the latest everything... Got the samples building, and some running, but can't get the 3D samples (in particular, textured_cube) to run on hardware...


I have a simular problem. I can only get my 3D app to run on hardware if I keep some code I am not using, and don't try to add anything. once I have changed anything in my code, no matter what it is, I get white screens on the real hardware. Works in emulator though. I wonder what this is all about? I have a version of libnds that dates back to the summer of 2005.

I just tried "Simple Tri" on my PassMe and Flashcart, and this code (unmodified example) failed to boot and gave me white screens:
Code:

#include <NDS.h>


int main()
{   
   
   float rotateX = 0.0;
   float rotateY = 0.0;

   powerON(POWER_ALL);

   //set mode 0, enable BG0 and set it to 3D
   videoSetMode(MODE_0_3D);

   //irqs are nice
   irqInitHandler(irqDefaultHandler);
   irqSet(IRQ_VBLANK, 0);

   //this should work the same as the normal gl call
   glViewPort(0,0,255,191);
   
   glClearColor(0,0,0);
   glClearDepth(0x7FFF);
   
   
   
   while(1)      
   {
      glReset();
   
      //any floating point gl call is being converted to fixed prior to being implemented
      gluPerspective(35, 256.0 / 192.0, 0.1, 40);

      gluLookAt(   0.0, 0.0, 1.0,      //camera possition
               0.0, 0.0, 0.0,      //look at
               0.0, 1.0, 0.0);      //up

      glPushMatrix();

      //move it away from the camera
      glTranslate3f32(0, 0, floatof32(-1));
            
      glRotateX(rotateX);
      glRotateY(rotateY);
      
      
      glMatrixMode(GL_MODELVIEW);



      //not a real gl function and will likely change
      glPolyFmt(POLY_ALPHA(31) | POLY_CULL_NONE);

      if(!(KEYS & KEY_UP)) rotateX += 3;
      if(!(KEYS & KEY_DOWN)) rotateX -= 3;
      if(!(KEYS & KEY_LEFT)) rotateY += 3;
      if(!(KEYS & KEY_RIGHT)) rotateY -= 3;
      

      //draw the obj
      glBegin(GL_TRIANGLE);
         
         glColor3b(31,0,0);
         glVertex3v16(intov16(-1),intov16(-1),0);

         glColor3b(0,31,0);
         glVertex3v16(intov16(1), intov16(-1), 0);

         glColor3b(0,0,31);
         glVertex3v16(intov16(0), intov16(1), 0);
         
      glEnd();
      
      glPopMatrix(1);
         
      glFlush();

      //swi seems to be broken, will let you know when i get this POS figured out   
      //swiWaitForVBlank();
   }

   return 0;
}//end main

This code has worked before. I wonder what my problem is? Any guesses?


EDIT: It sure has nothing to do about the code. I change it all over, and it still won't boot. May be the side of the ROM file, or may have something to do with the Makefile settings. I really don't know. If I remove all OpenGL functions, it boots up correctly, but if I add just one random OpenGL function, GAME OVER!
_________________
Exceptions are fun

#60026 - Didou - Sun Nov 06, 2005 11:11 am

Hi,

I experimented asimilar problem in ReboNDS. It appeared to me that I had to replace

Code:
irqSet(IRQ_VBLANK, 0);


by

Code:
void vblank_handler ()
{
}

irqInit () ;
  irqSet (IRQ_VBLANK, vblank_handler) ;


I do not even call
Code:
irqInitHandler(irqDefaultHandler);


And then it works fine. You can grab my sources on my code-page (http://francois.pessaux.neuf.fr/creations.html

-- Didou

#60033 - LOst? - Sun Nov 06, 2005 3:07 pm

I am downloading devkitARM r17 and the newest libNDS. I might get futher with them, or I may kill all my old projects by updating.


EDIT:
Didou, thank you! That solved the problem. At least what I have tested so far. And now I can use swiWaitForVBlank(); while using 3D, which will save battery time. Nice!
_________________
Exceptions are fun

#60195 - LOst? - Mon Nov 07, 2005 11:56 pm

Well, I still get white screen as soon as I try to add something. It's so irritating. Even when I delete the added things, I can sometimes get it to work, which already worked before.

So I guess I have to upload something that doesn't work so that people can analyse it.
EDIT: Made a thread about the problem.
_________________
Exceptions are fun