⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.c

📁 NDS 游戏开发入门实例代码 字符显示 简易入门使用
💻 C
字号:
// Includes
#include <PA9.h>       // Include for PA_Lib

#include <stdio.h>  // standard lib for texts...

char text[200];

// Function: main()
int main(int argc, char ** argv)
{
	PA_Init();    // Initializes PA_Lib
	PA_InitVBL(); // Initializes a standard VBL
	

	
	PA_Init16cBg(0, 3); 	PA_Init16cBg(1, 3);  // 16 color background init with default colors for text
	


	
	// Infinite loop to keep the program running
	while (1)
	{
		sprintf(text,  // string to use
					"%02d/%02d/%02d", PA_RTC.Day, PA_RTC.Month, PA_RTC.Year);  // String to transform
		PA_16cText(0, 10, 20, 255, 40, text, 1, 3, 100);  // Display the text transformed :)

	// And the time...
		sprintf(text,  "%02d:%02d  %02d seconds", PA_RTC.Hour, PA_RTC.Minutes, PA_RTC.Seconds);
		PA_16cText(0, 10, 40, 255, 60, text, 1, 3, 100);	// Display the text transformed :)

		PA_WaitForVBL();
		PA_16cErase(0);
	}
	
	return 0;
} // End of main()

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -