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 > Dualis glCallList problems? Try this....

#103713 - DiscoStew - Sun Sep 24, 2006 1:48 am

Unless my computer just sucks, I don't think I'm the only one that is having problems when trying to run a display list in Dualis. Symptoms I've seen ranged from both screens flickering to even just nothing showing up on the 3D screen. I have no hardware to allow me to test on my own DS, and Ideas doesn't seem to have a Z-buffer to show what the object would really look like, or even run at 60FPS. I've been using ikaris's Maya exporter, but haven't been able to get anything displayed in Dualis.

Luckly, it seemed that drawing the scene manually works in Dualis, so I decided to try and just take the display list, and do the commands for each manually, and I'm glad I did, for now I have a way of making my objects render.

This code is just a method for getting around having to use glCallList, but it is NOT a replacement. Not only is it unoptimized and slow since it's doing things manually, but it isn't even complete, and I have only been doing tests with objects I make in Maya and using ikaris's exporter, which only exports certain attributes of the objects. If you know how each of the commands work, then it should be easy enough to add to what I have. If your display list has other commands that this function isn't doing, you will need to add those commands yourself, or you will run into problems with this.

Code:
void InterpretDisplayList(u32* list)
{
   u32 CurCommandList = 0;
   u32 CommandCheck = 0;
   u32 count = *list++;
   u32 CommandList = 0;
   while (count > 0)
   {
      CurCommandList = *list++;
      CommandCheck = 0;
      for(CommandList = 0; CommandList < 4; CommandList++, CommandCheck += 8)
      {
         u32 CurCommand = ((CurCommandList >> CommandCheck) & 0x000000FF);
         switch (CurCommand)
         {
         case 0:                  //FIFO_NOP
            break;
         case 32:               //FIFO_COLOR
            GFX_COLOR = *list++;
            count--;
            break;
         case 33:               //FIFO_NORMAL
            GFX_NORMAL = *list++;
            count--;
            break;
         case 34:               //FIFO_TEX_COORD
            GFX_TEX_COORD = *list++;
            count--;
            break;
         case 35:               //FIFO_VERTEX16:
            GFX_VERTEX16 = *list++;
            GFX_VERTEX16 = *list++;
            count -= 2;
            break;
         case 64:               //FIFO_BEGIN
            GFX_BEGIN = *list++;
            count--;
            break;
         case 65:               //FIFO_END
            GFX_END = 0;
            break;
         }
      }
      count--;
   }
   return;
}

Again, it is NOT a replacement for glCallList, but rather just a temporary workaround if you having the same troubles as I am. And please don't point out problems in my code, like it being sloppy and such, because it wasn't my intention to make it look good or organized. I just wanted it working.
_________________
DS - It's all about DiscoStew

#103762 - Sausage Boy - Sun Sep 24, 2006 12:40 pm

NOP support (among other things, possibly) is broken in dualis.
_________________
"no offense, but this is the gayest game ever"