SHARE
TWEET

N64 SDK test

LuigiBlood Dec 24th, 2014 187 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // 64ddview Remade SDK
  2.  
  3. #include <ultra64.h>
  4. #include <PR/leo.h>
  5.  
  6. // Stacks, Message Queues and Buffers
  7. u64     bootStack[STACKSIZE/sizeof(u64)];
  8.  
  9. //static void   idle(void *);
  10. //static void   mainproc(void *);
  11.  
  12. static OSThread idleThread;
  13. static u64      idleThreadStack[STACKSIZE/sizeof(u64)];
  14.  
  15. static OSThread mainThread;
  16. static u64      mainThreadStack[STACKSIZE/sizeof(u64)];
  17. /*
  18. static OSThread leoThread;
  19. static u64      leoThreadStack[STACKSIZE/sizeof(u64)];
  20. */
  21. #define DISK_MSG_NUM 1
  22. OSMesgQueue     diskMsgQ;
  23. static OSMesg   diskMsgBuf[DISK_MSG_NUM];
  24.  
  25. OSMesgQueue     siMessageQ;
  26. OSMesg          siMessageBuf;
  27.  
  28. void boot(void)
  29. {
  30.         osInitialize();
  31.        
  32.         osCreateThread(&idleThread, 1, idle, (void *)0,
  33.                 idleThreadStack+STACKSIZE/sizeof(u64), 10);
  34.         osStartThread(&idleThread);
  35. }
  36.  
  37. static void idle(void)
  38. {
  39.         //init
  40.         // VI Manager
  41.         osCreateViManager(OS_PRIORITY_VIMGR);
  42.         osViSetMode(&osViModeTable[OS_VI_NTSC_LAN1]);
  43.        
  44.    osViBlack(1);
  45.    
  46.    osViSetSpecialFeatures( OS_VI_GAMMA_OFF | OS_VI_GAMMA_DITHER_OFF );
  47.    osViSetSpecialFeatures( OS_VI_DITHER_FILTER_ON );
  48.        
  49.         /* SI */
  50.    osCreateMesgQueue(&siMessageQ, &siMessageBuf, 1);
  51.    osSetEventMesg(OS_EVENT_SI, &siMessageQ, (OSMesg)1); /* SI */
  52.        
  53.         //Leo Manager (64DD)
  54.         LeoCJCreateLeoManager(OS_PRIORITY_LEOMGR, OS_PRIORITY_LEOMGR-1,
  55.                 *diskMsgBuf, DISK_MSG_NUM);
  56.        
  57.         //main Thread
  58.         osCreateThread(&mainThread, 3, mainproc, arg,
  59.         mainThreadStack+STACKSIZE/sizeof(u64), 10);
  60.    
  61.    osStartThread(&mainThread);
  62.        
  63.         //make this thread idle
  64.    osSetThreadPri(0, 0);
  65.  
  66.    for (;;);
  67. }
  68.  
  69. static void mainproc(void)
  70. {
  71.         //control
  72. }
  73. /*
  74. static void leoproc(void)
  75. {
  76.         //leo
  77. }
  78. */
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top