Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bank2page brr #1142

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ares/sfc/dsp/dsp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ struct DSP : Thread {
} noise;

struct BRR {
n8 bank;
n8 page;

n8 _bank;
n8 _page;
n8 _source;
n16 _address;
n16 _nextAddress;
Expand Down
2 changes: 1 addition & 1 deletion ares/sfc/dsp/memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ auto DSP::write(n7 address, n8 data) -> void {
for(u32 n : range(8)) voice[n].echo = data.bit(n);
break;
case 0x5d: //DIR
brr.bank = data;
brr.page = data;
break;
case 0x6d: //ESA
echo.bank = data;
Expand Down
4 changes: 2 additions & 2 deletions ares/sfc/dsp/misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ auto DSP::misc27() -> void {

auto DSP::misc28() -> void {
for(auto& v : voice) v._noise = v.noise, v._echo = v.echo;
brr._bank = brr.bank;
brr._page = brr.page;
}

auto DSP::misc29() -> void {
Expand All @@ -24,6 +24,6 @@ auto DSP::misc30() -> void {
//noise
if(counterPoll(noise.frequency)) {
s32 feedback = noise.lfsr << 13 ^ noise.lfsr << 14;
noise.lfsr = feedback & 0x4000 ^ noise.lfsr >> 1;
noise.lfsr = feedback & 0x4000 | noise.lfsr >> 1;
}
}
4 changes: 2 additions & 2 deletions ares/sfc/dsp/serialization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ auto DSP::serialize(serializer& s) -> void {
s(noise.frequency);
s(noise.lfsr);

s(brr.bank);
s(brr._bank);
s(brr.page);
s(brr._page);
s(brr._source);
s(brr._address);
s(brr._nextAddress);
Expand Down
2 changes: 1 addition & 1 deletion ares/sfc/dsp/voice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ inline auto DSP::voiceOutput(Voice& v, n1 channel) -> void {
}

auto DSP::voice1(Voice& v) -> void {
brr._address = (brr._bank << 8) + (brr._source << 2);
brr._address = (brr._page << 8) + (brr._source << 2);
brr._source = v.source;
}

Expand Down