devkitpro

在GBA上写光线追踪:自制GBA库 lib_hl 汇总

三世轮回 提交于 2020-04-15 11:25:11
【推荐阅读】微服务还能火多久?>>> 写个自己的GBA库 上篇文章(待写)介绍了GBA的硬件,例如寄存器、内存、中断等,其中很多寄存器可以说是GBA的遥控器,要使用GBA的硬件功能,就是要和这些寄存器打交道。 怎么打交道呢?这些寄存器都有地址,在C语言中可以转成指针来读写。为了方便使用,我们需要先写一个GBA库,库里应该有: 这个库需要定义GBA的各种功能寄存器,这样我们就可以通过设定寄存器来控制GBA。 各段内存地址的定义,这样我们才能将图像,音频等数据放到正确的地方 内置系统函数的定义,方便调用GBA的BIOS里自带的系统函数 常用数学运算库,图形音频处理库,压缩解压库等等功能。 其实这些库在任天堂公司开发GBA之初就提供给开发者了,但因为商业性质没有公开。有民间GBA开发爱好者也编写了库,在你的devkitPro安装后,目录里的/ libgba 和/ libtonc 就分别是devkitPro和tonc教材作者写的GBA库。 不过我就喜欢自己造轮子,所以就从写GBA库开始学GBA吧。大概现在还在玩GBA的人也都是我这种爱搞底层、爱捣鼓的家伙。 事实上因为GBA的特性已经在手册上写得清清楚楚,所以自己写个库确实不难, 这篇文章是我的GBA库—— lib_hl的索引。 数学库 部分包括这些内容: 基础类型定义 定点数定义和运算 基础数学函数库 矢量,矩阵运算库 硬件

Adding split-screen multiplayer to c++ game

时光怂恿深爱的人放手 提交于 2019-12-13 05:19:49
问题 I am coding for the NDS in c++ with libnds, but this question is not NDS-Specific. I currently have a text-based game in which the top screen just displays a logo, and you play on the bottom screen. So I want to add a type of single-DS multiplayer in which one player plays on the top screen, and the other on the bottom. I dont have a problem with setting up the text engine with both screens, I just need to find a method of efficiently coding in multiplayer. Below I wrote a summary or

Drawing an image on subscreen of nds

坚强是说给别人听的谎言 提交于 2019-12-10 15:18:24
问题 I am totally new to libdns. I try to change the sample Graphics\Backgrounds\256_color_bmp to display the background on the subscreen. Here is my code. Do you have any idea what is missing to display hey_typBitmap on the subscreen? I already managed to display the new image on the top screen. #include <nds.h> #include <stdio.h> #include "drunkenlogo.h" #include "hey_typ.h" int main(void) { videoSetMode(MODE_5_2D); vramSetBankA(VRAM_A_MAIN_BG_0x06000000); videoSetModeSub(MODE_5_2D);

Tutorials for Wii programming [closed]

假如想象 提交于 2019-12-04 07:23:15
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . I have a Nintendo Wii, and I've got devkitpro working to load some simple programs. The example source code that I've been able to

Simpler way to set multiple array slots to one value

筅森魡賤 提交于 2019-12-03 22:34:24
I'm coding in C++ , and I have the following code: int array[30]; array[9] = 1; array[5] = 1; array[14] = 1; array[8] = 2; array[15] = 2; array[23] = 2; array[12] = 2; //... Is there a way to initialize the array similar to the following? int array[30]; array[9,5,14] = 1; array[8,15,23,12] = 2; //... Note: In the actual code, there can be up to 30 slots that need to be set to one value. aaronman This function will help make it less painful. void initialize(int * arr, std::initializer_list<std::size_t> list, int value) { for (auto i : list) { arr[i] = value; } } Call it like this. initialize