mirror of
https://github.com/sehugg/8bitworkshop.git
synced 2024-11-23 06:32:11 +00:00
21 lines
423 B
C
21 lines
423 B
C
|
|
||
|
|
||
|
#include "apu.h"
|
||
|
|
||
|
#include <string.h>
|
||
|
|
||
|
const unsigned char APUINIT[0x13] = {
|
||
|
0x30,0x08,0x00,0x00,
|
||
|
0x30,0x08,0x00,0x00,
|
||
|
0x80,0x00,0x00,0x00,
|
||
|
0x30,0x00,0x00,0x00,
|
||
|
0x00,0x00,0x00
|
||
|
};
|
||
|
|
||
|
void apu_init() {
|
||
|
// from https://wiki.nesdev.com/w/index.php/APU_basics
|
||
|
memcpy((void*)0x4000, APUINIT, sizeof(APUINIT));
|
||
|
APU.fcontrol = 0x40; // frame counter 5-step
|
||
|
APU.status = 0x0f; // turn on all channels except DMC
|
||
|
}
|