-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c337cd5
commit 6b60850
Showing
12 changed files
with
115 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
.vs/ | ||
.vscode/ | ||
build/ | ||
*.DS_Store | ||
cmake-build-debug/ | ||
.idea/ | ||
src/.vscode/ | ||
CMakeSettings.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#include "sound.h" | ||
#include "types.h" | ||
|
||
APU::APU() | ||
{ | ||
mMap = nullptr; | ||
|
||
} | ||
|
||
void APU::test() | ||
{ | ||
for (int i = 0; i < 0x20; i++) | ||
{ | ||
printf("------------------------ at register FF%d: %d\n\n", i, mMap->readMemory(0xff10 + i) ); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
#pragma once | ||
#include "types.h" | ||
#include "mmap.h" | ||
#include <stdio.h> | ||
#include <SDL.h> | ||
|
||
|
||
class MasterController | ||
{ | ||
|
||
}; | ||
|
||
class PulseChannel | ||
{ | ||
private: | ||
// https://gbdev.io/pandocs/Audio_Registers.html | ||
|
||
// NRx0 | ||
Byte sweepPace; | ||
Byte sweepChange; | ||
Byte sweepSlope; | ||
|
||
// NRx1 | ||
Byte waveDuty; | ||
Byte lengthTimer; | ||
|
||
// NRx2 | ||
Byte envelopeVolume; | ||
Byte envelopeDirection; | ||
Byte envelopeSweepPace; | ||
|
||
// Nrx3 | ||
// needs 11 bits - 3 bits from NRX4 + 8 bits from NRx3 | ||
Word periodValue; | ||
|
||
// NRx4 | ||
bool trigger; | ||
bool soundLengthEnable; | ||
|
||
|
||
|
||
}; | ||
|
||
class WaveChannel | ||
{ | ||
private: | ||
|
||
}; | ||
|
||
class NoiseChannel | ||
{ | ||
private: | ||
|
||
}; | ||
|
||
|
||
class APU | ||
{ | ||
private: | ||
// memory map | ||
MemoryMap* mMap; | ||
|
||
PulseChannel* channel1; | ||
PulseChannel* channel2; | ||
|
||
// WaveChannel* channel3; | ||
|
||
// NoiseChannel* channel4; | ||
|
||
public: | ||
APU(); | ||
void setMemoryMap(MemoryMap* m){ mMap = m; } | ||
void test(); | ||
}; |
Binary file not shown.
Binary file not shown.
Binary file not shown.