mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-08-22 16:23:03 +02:00
Update to v093r11 release.
byuu says: Changelog: - GBA: SOUND_CTL_H is readable, fixes sound effects in Mario&Luigi Superstar Saga [Cydrak] (note: game is still unplayable due to other bugs) - phoenix/Windows: workaround for Win32 API ListView bug, fixes slot loading behavior - ruby: added udev driver for Linux with rumble support, and added rumble support to existing RawInput driver for XInput and DirectInput - ethos: added new "Rumble" mapping to GBA input assignment, use it to tell higan which controller to rumble (clear it to disable rumble) - GBA: Game Boy Player rumble is now fully emulated - core: added new normalized raw-color palette mode for Display Emulation shaders The way rumble was added to ethos was somewhat hackish. The support doesn't really exist in nall. I need to redesign the entire input system, but that's not a change I want to make so close to a release.
This commit is contained in:
@@ -45,6 +45,13 @@ uint8 APU::read(uint32 addr) {
|
||||
case 0x04000080: return sequencer.read(0);
|
||||
case 0x04000081: return sequencer.read(1);
|
||||
|
||||
//SOUND_CNT_H
|
||||
case 0x04000082:
|
||||
return (fifo[1].volume << 3) | (fifo[0].volume << 2) | (sequencer.volume << 0);
|
||||
case 0x04000083:
|
||||
return (fifo[1].timer << 6) | (fifo[1].lenable << 5) | (fifo[1].renable << 4)
|
||||
| (fifo[0].timer << 2) | (fifo[0].lenable << 1) | (fifo[0].renable << 0);
|
||||
|
||||
//NR52
|
||||
case 0x04000084: return sequencer.read(2);
|
||||
case 0x04000085: return 0u;
|
||||
|
@@ -129,17 +129,18 @@ Interface::Interface() {
|
||||
|
||||
{
|
||||
Device device{0, ID::Device, "Controller"};
|
||||
device.input.append({0, 0, "A" });
|
||||
device.input.append({1, 0, "B" });
|
||||
device.input.append({2, 0, "Select"});
|
||||
device.input.append({3, 0, "Start" });
|
||||
device.input.append({4, 0, "Right" });
|
||||
device.input.append({5, 0, "Left" });
|
||||
device.input.append({6, 0, "Up" });
|
||||
device.input.append({7, 0, "Down" });
|
||||
device.input.append({8, 0, "R" });
|
||||
device.input.append({9, 0, "L" });
|
||||
device.order = {6, 7, 5, 4, 1, 0, 9, 8, 2, 3};
|
||||
device.input.append({ 0, 0, "A" });
|
||||
device.input.append({ 1, 0, "B" });
|
||||
device.input.append({ 2, 0, "Select"});
|
||||
device.input.append({ 3, 0, "Start" });
|
||||
device.input.append({ 4, 0, "Right" });
|
||||
device.input.append({ 5, 0, "Left" });
|
||||
device.input.append({ 6, 0, "Up" });
|
||||
device.input.append({ 7, 0, "Down" });
|
||||
device.input.append({ 8, 0, "R" });
|
||||
device.input.append({ 9, 0, "L" });
|
||||
device.input.append({10, 3, "Rumble"});
|
||||
device.order = {6, 7, 5, 4, 1, 0, 9, 8, 2, 3, 10};
|
||||
this->device.append(device);
|
||||
}
|
||||
|
||||
|
@@ -54,11 +54,6 @@ void Player::frame() {
|
||||
}
|
||||
cpu.regs.irq.flag.serial = true;
|
||||
}
|
||||
|
||||
if(status.rumble) {
|
||||
//todo: support actual gamepad rumble; for now, color screen red during rumble
|
||||
for(unsigned n = 0; n < 240 * 160; n++) ppu.output[n] &= 0x001f;
|
||||
}
|
||||
}
|
||||
|
||||
optional<uint16> Player::keyinput() {
|
||||
@@ -87,6 +82,7 @@ void Player::write(uint8 byte, uint2 addr) {
|
||||
|
||||
if(addr == 3 && status.packet == 15) {
|
||||
status.rumble = (status.recv & 0xff) == 0x26; //on = 0x26, off = 0x04
|
||||
interface->inputRumble(0, 0, 10, status.rumble);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -6,7 +6,7 @@ Video video;
|
||||
|
||||
void Video::generate_palette(Emulator::Interface::PaletteMode mode) {
|
||||
for(unsigned color = 0; color < (1 << 15); color++) {
|
||||
if(mode == Emulator::Interface::PaletteMode::None) {
|
||||
if(mode == Emulator::Interface::PaletteMode::Literal) {
|
||||
palette[color] = color;
|
||||
continue;
|
||||
}
|
||||
@@ -15,11 +15,23 @@ void Video::generate_palette(Emulator::Interface::PaletteMode mode) {
|
||||
unsigned G = (color >> 5) & 31;
|
||||
unsigned R = (color >> 0) & 31;
|
||||
|
||||
if(mode == Emulator::Interface::PaletteMode::Channel) {
|
||||
R = image::normalize(R, 5, 16);
|
||||
G = image::normalize(G, 5, 16);
|
||||
B = image::normalize(B, 5, 16);
|
||||
palette[color] = interface->videoColor(color, 0, R, G, B);
|
||||
continue;
|
||||
}
|
||||
|
||||
if(mode == Emulator::Interface::PaletteMode::Standard) {
|
||||
R = R << 11 | R << 6 | R << 1 | R >> 4;
|
||||
G = G << 11 | G << 6 | G << 1 | G >> 4;
|
||||
B = B << 11 | B << 6 | B << 1 | B >> 4;
|
||||
} else {
|
||||
R = image::normalize(R, 5, 16);
|
||||
G = image::normalize(G, 5, 16);
|
||||
B = image::normalize(B, 5, 16);
|
||||
palette[color] = interface->videoColor(color, 0, R, G, B);
|
||||
continue;
|
||||
}
|
||||
|
||||
if(mode == Emulator::Interface::PaletteMode::Emulation) {
|
||||
R = curve[R];
|
||||
G = curve[G];
|
||||
B = curve[B];
|
||||
@@ -52,12 +64,14 @@ void Video::generate_palette(Emulator::Interface::PaletteMode mode) {
|
||||
G = (((4 * Gr + 2 * Gg + Gb) * 160) >> 14) + 32;
|
||||
B = (((4 * Br + 2 * Bg + Bb) * 160) >> 14) + 32;
|
||||
|
||||
R = R << 8 | R;
|
||||
G = G << 8 | G;
|
||||
B = B << 8 | B;
|
||||
R = image::normalize(R, 8, 16);
|
||||
G = image::normalize(G, 8, 16);
|
||||
B = image::normalize(B, 8, 16);
|
||||
palette[color] = interface->videoColor(color, 0, R, G, B);
|
||||
continue;
|
||||
}
|
||||
|
||||
palette[color] = interface->videoColor(color, R, G, B);
|
||||
palette[color] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user