Werthorga

CONF_GetNickName example

Sep 24th, 2025
19
0
5 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.94 KB | Source Code | 0 0
  1. #include <gccore.h>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4.  
  5. static void *fb = 0;
  6. static GXRModeObj *rmode;
  7. bool close = false;
  8.  
  9. int main ()
  10. {
  11.    
  12.     char nickname[10];
  13.    
  14.     VIDEO_Init();
  15.     // init gamecube controllers
  16.     PAD_Init();
  17.    
  18.     rmode = VIDEO_GetPreferredMode(NULL);
  19.     fb = MEM_K0_TO_K1(SYS_AllocateFramebuffer(rmode));
  20.    
  21.     console_init(fb,20,20,rmode->fbWidth,rmode->xfbHeight,rmode->fbWidth*VI_DISPLAY_PIX_SZ);
  22.    
  23.     VIDEO_Configure(rmode);
  24.     VIDEO_SetNextFramebuffer(fb);
  25.     VIDEO_SetBlack(false);
  26.     VIDEO_Flush();
  27.     VIDEO_WaitVSync();
  28.    
  29.     // actually get the nickname
  30.     CONF_GetNickName((u8*)nickname);
  31.    
  32.     printf("\x1b[2;0H");
  33.     printf("I know your Wii's name...\n");
  34.     // print it out
  35.     printf("%s !!!\n", nickname);
  36.     printf("Feel scared now?\n");
  37.    
  38.     while(!close)
  39.     {
  40.         PAD_ScanPads();
  41.         if (PAD_ButtonsDown(0) & PAD_BUTTON_START) close = true;
  42.        
  43.         VIDEO_WaitVSync();
  44.     }
  45.    
  46.     VIDEO_SetBlack(true);
  47.     VIDEO_Flush();
  48.     exit(0);
  49.    
  50. }
Advertisement
Add Comment
Please, Sign In to add comment