Guest User

DS MSYS2 err dompe

a guest
Sep 10th, 2019
78
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Here's the source code;
  2. //---------------------------------------------------------------------------------
  3. #include <nds.h>
  4.  
  5. #include <stdio.h>
  6.  
  7.  
  8. //Include the font header generated by grit
  9. #include "font.h"
  10.  
  11. //---------------------------------------------------------------------------------
  12. int main(void) {
  13. //---------------------------------------------------------------------------------
  14.  
  15. const int tile_base = 0;
  16. const int map_base = 20;
  17.  
  18. videoSetModeSub(MODE_0_2D);
  19. vramSetBankC(VRAM_C_SUB_BG);
  20.  
  21. PrintConsole *console = consoleInit(0,0, BgType_Text4bpp, BgSize_T_256x256, map_base, tile_base, false, false);
  22.  
  23. consoleInit(&topScreen);
  24.  
  25. ConsoleFont font;
  26.  
  27. font.gfx = (u16*)fontTiles;
  28. font.pal = (u16*)fontPal;
  29. font.numChars = 95;
  30. font.numColors = fontPalLen / 2;
  31. font.bpp = 4;
  32. font.asciiOffset = 32;
  33. font.convertSingleColor = false;
  34.  
  35. consoleSetFont(console, &font);
  36.  
  37.  
  38. consoleSelect(&topScreen);
  39. iprintf(" ~ReadMii~ [Ver. 1.0]\n");
  40. iprintf(" Last edited on: 9/8/2019\n");
  41. iprintf(" About the DS Download Station:\n");
  42. iprintf(" After you turn off you system,\n");
  43. iprintf(" Or return to the HOME Menu, you\n");
  44. iprintf(" will need to download the\n");
  45. iprintf(" content again. Also, any Games,\n");
  46. iprintf(" Apps, or other content won't be\n");
  47. iprintf(" able to save. \n");
  48. while(1) {
  49.  
  50. swiWaitForVBlank();
  51. scanKeys();
  52.  
  53. int keys = keysDown();
  54.  
  55. if(keys & KEY_START) break;
  56.  
  57. }
  58.  
  59. return 0;
  60. }
  61.  
  62. and here's what msys2 barfs up when I try to compile it:
  63.  
  64. main.c
  65. arm-none-eabi-gcc -MMD -MP -MF /c/DS_Brew_Projects/DSDL_ReadMii/build/main.d -g -Wall -O2 -march=armv5te -mtune=arm946e-s -fomit-frame-pointer -ffast-math -mthumb -mthumb-interwork -I/c/DS_Brew_Projects/DSDL_ReadMii/include -I/opt/devkitpro/libnds/include -I/c/DS_Brew_Projects/DSDL_ReadMii/build -DARM9 -c /c/DS_Brew_Projects/DSDL_ReadMii/source/main.c -o main.o
  66. C:/DS_Brew_Projects/DSDL_ReadMii/source/main.c: In function 'main':
  67. C:/DS_Brew_Projects/DSDL_ReadMii/source/main.c:22:18: error: 'topScreen' undeclared (first use in this function)
  68. 22 | consoleInit(&topScreen);
  69. | ^~~~~~~~~
  70. C:/DS_Brew_Projects/DSDL_ReadMii/source/main.c:22:18: note: each undeclared identifier is reported only once for each function it appears in
  71. C:/DS_Brew_Projects/DSDL_ReadMii/source/main.c:22:5: error: too few arguments to function 'consoleInit'
  72. 22 | consoleInit(&topScreen);
  73. | ^~~~~~~~~~~
  74. In file included from C:/devkitPro/libnds/include/nds.h:257,
  75. from C:/DS_Brew_Projects/DSDL_ReadMii/source/main.c:2:
  76. C:/devkitPro/libnds/include/nds/arm9/console.h:220:15: note: declared here
  77. 220 | PrintConsole* consoleInit(PrintConsole* console, int layer, BgType type, BgSize size, int mapBase, int tileBase, bool mainDisplay, bool loadGraphics);
  78. | ^~~~~~~~~~~
  79. make[1]: *** [/opt/devkitpro/devkitARM/base_rules:85: main.o] Error 1
  80. make: *** [Makefile:110: build] Error 2
RAW Paste Data Copied