掌機 - Game Boy - C/C++ - Sound



參考資訊:
https://bgb.bircd.org/
https://github.com/mrombout/gbdk_playground
http://gbdk.sourceforge.net/doc/html/book01.html

暫存器



main.c

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <gb/gb.h>
#include <stdio.h>
 
void main(void)
{
    NR52_REG = 0x80;
    NR50_REG = 0x77;
    NR51_REG = 0xff;
 
    while (1) {
        NR10_REG = 0x16;
        NR11_REG = 0x40;
        NR12_REG = 0x73; 
        NR13_REG = 0x00;  
        NR14_REG = 0xc3;
        delay(100);
    }
}