Does libdragon/newlib provide threads?

Discussion in 'Nintendo Game Development' started by jnmartin84, Nov 11, 2013.

  1. jnmartin84

    jnmartin84 Robust Member

    Joined:
    Nov 11, 2013
    Messages:
    236
    Likes Received:
    31
    Porting Wolf3D to N64: does libdragon/newlib provide threads?

    I am working on porting the Wolf3D source to N64 using libdragon and I am currently blocked at porting the sound code.

    It uses pthreads to spawn a thread to write out audio data.

    Does anyone know if libdragon provide threads of any kind, or would I need to implement that functionality?

    Thanks.

    - Jason
     
    Last edited: Nov 12, 2013
  2. jnmartin84

    jnmartin84 Robust Member

    Joined:
    Nov 11, 2013
    Messages:
    236
    Likes Received:
    31
    by the way, here's a screengrab from MESS, for those who may be interested

    View attachment 8398
     
  3. jnmartin84

    jnmartin84 Robust Member

    Joined:
    Nov 11, 2013
    Messages:
    236
    Likes Received:
    31
    I am attempting to re-work the sd_oss file to not use a thread for writing out audio data, but so far my executable hangs up before rendering the "PC-13" warning screen if I actually call the function. Still working through the sound module to see what I might be doing wrong.
     
  4. MyCrunkyBaby

    MyCrunkyBaby Rapidly Rising Member

    Joined:
    Mar 20, 2013
    Messages:
    85
    Likes Received:
    0
    Don't rewrite the sd_oss, chances are you'll have to write something to handle a replacement for the pthreads.
     
  5. jnmartin84

    jnmartin84 Robust Member

    Joined:
    Nov 11, 2013
    Messages:
    236
    Likes Received:
    31
    Well I am not rewriting sd_oss.c, I just took the SoundThread function and made it a standalone function that does one iteration and returns instead of running for "while(SD_Started)."

    The reason my port hangs up shortly after starting is because the second time it gets called, it tries to read memory from address 0 at the following line of code:

    "dat = *MusicData++;"

    Running out of patience to debug that at the moment, it is 3:10 AM and I have to be at the office in 5 hours, so off for the night.
     
sonicdude10
Draft saved Draft deleted
Insert every image as a...
  1.  0%

Share This Page