mirror of
https://github.com/DerKoun/bsnes-hd.git
synced 2024-05-31 18:38:07 -04:00
beta5
This commit is contained in:
parent
f4e0df6eaf
commit
6736243eeb
|
@ -20,7 +20,12 @@ auto Configuration::process(Markup::Node document, bool load) -> void {
|
|||
bind(boolean, "Hacks/PPU/NoSpriteLimit", hacks.ppu.noSpriteLimit);
|
||||
bind(natural, "Hacks/PPU/Mode7/Scale", hacks.ppu.mode7.scale);
|
||||
bind(boolean, "Hacks/PPU/Mode7/Perspective", hacks.ppu.mode7.perspective);
|
||||
bind(boolean, "Hacks/PPU/Mode7/Widescreen", hacks.ppu.mode7.widescreen);
|
||||
bind(natural, "Hacks/PPU/Mode7/Widescreen", hacks.ppu.mode7.widescreen);
|
||||
bind(natural, "Hacks/PPU/Mode7/Wsbg1", hacks.ppu.mode7.wsbg1);
|
||||
bind(natural, "Hacks/PPU/Mode7/Wsbg2", hacks.ppu.mode7.wsbg2);
|
||||
bind(natural, "Hacks/PPU/Mode7/Wsbg3", hacks.ppu.mode7.wsbg3);
|
||||
bind(natural, "Hacks/PPU/Mode7/Wsbg4", hacks.ppu.mode7.wsbg4);
|
||||
bind(boolean, "Hacks/PPU/Mode7/Wsobj", hacks.ppu.mode7.wsobj);
|
||||
bind(boolean, "Hacks/PPU/Mode7/Supersample", hacks.ppu.mode7.supersample);
|
||||
bind(boolean, "Hacks/PPU/Mode7/Mosaic", hacks.ppu.mode7.mosaic);
|
||||
bind(boolean, "Hacks/DSP/Fast", hacks.dsp.fast);
|
||||
|
|
|
@ -31,7 +31,12 @@ struct Configuration {
|
|||
struct Mode7 {
|
||||
uint scale = 1;
|
||||
bool perspective = true;
|
||||
bool widescreen = true;
|
||||
uint widescreen = 64;
|
||||
uint wsbg1 = 1;
|
||||
uint wsbg2 = 1;
|
||||
uint wsbg3 = 1;
|
||||
uint wsbg4 = 1;
|
||||
bool wsobj = false;
|
||||
bool supersample = false;
|
||||
bool mosaic = true;
|
||||
} mode7;
|
||||
|
|
|
@ -37,8 +37,16 @@ auto PPUfast::Line::renderBackground(PPUfast::IO::Background& self, uint source)
|
|||
uint mosaicPriority = 0;
|
||||
uint mosaicColor = 0;
|
||||
|
||||
int x = 0 - (hscroll & 7);
|
||||
while(x < width) {
|
||||
int ws = (int)ppufast.widescreen();
|
||||
if(ws > 0) {
|
||||
uint wsConf = ppufast.wsbg(source);
|
||||
if(((wsConf % 2) != 0) == (y < (((int)(wsConf / 2)) * 40))) {
|
||||
ws = 0;
|
||||
}
|
||||
}
|
||||
|
||||
int x = 0 - (hscroll & 7) - ws;
|
||||
while(x < (width + ws)) {
|
||||
uint hoffset = x + hscroll;
|
||||
uint voffset = y + vscroll;
|
||||
if(offsetPerTileMode) {
|
||||
|
@ -83,7 +91,7 @@ auto PPUfast::Line::renderBackground(PPUfast::IO::Background& self, uint source)
|
|||
tiledata += (voffset & 7 ^ mirrorY) << 3;
|
||||
|
||||
for(uint tileX = 0; tileX < 8; tileX++, x++) {
|
||||
if(x & width) continue; //x < 0 || x >= width
|
||||
if(x < -ws || x >= width + ws) continue; //if(x & width) continue; //x < 0 || x >= width
|
||||
if(!self.mosaicEnable || --mosaicCounter == 0) {
|
||||
mosaicCounter = 1 + io.mosaicSize;
|
||||
mosaicPalette = tiledata[tileX ^ mirrorX];
|
||||
|
@ -97,8 +105,11 @@ auto PPUfast::Line::renderBackground(PPUfast::IO::Background& self, uint source)
|
|||
if(!mosaicPalette) continue;
|
||||
|
||||
if(!hires) {
|
||||
if(self.aboveEnable && !windowAbove[x]) plotAbove(x, source, mosaicPriority, mosaicColor);
|
||||
if(self.belowEnable && !windowBelow[x]) plotBelow(x, source, mosaicPriority, mosaicColor);
|
||||
int wx = x;
|
||||
if (wx < 0) wx = 0;
|
||||
if (wx > 255) wx = 255;
|
||||
if(self.aboveEnable && !windowAbove[wx]) plotAbove(x, source, mosaicPriority, mosaicColor);
|
||||
if(self.belowEnable && !windowBelow[wx]) plotBelow(x, source, mosaicPriority, mosaicColor);
|
||||
} else {
|
||||
uint X = x >> 1;
|
||||
if(!ppufast.hd()) {
|
||||
|
|
|
@ -101,33 +101,33 @@ auto PPUfast::Line::directColor(uint paletteIndex, uint paletteColor) const -> u
|
|||
+ (paletteColor << 7 & 0x6000) + (paletteIndex << 10 & 0x1000); //B
|
||||
}
|
||||
|
||||
auto PPUfast::Line::plotAbove(uint x, uint source, uint priority, uint color) -> void {
|
||||
auto PPUfast::Line::plotAbove(int x, uint source, uint priority, uint color) -> void {
|
||||
if(ppufast.hd()) return plotHD(above, x, source, priority, color, false, false);
|
||||
if(priority > above[x].priority) above[x] = {source, priority, color};
|
||||
}
|
||||
|
||||
auto PPUfast::Line::plotBelow(uint x, uint source, uint priority, uint color) -> void {
|
||||
auto PPUfast::Line::plotBelow(int x, uint source, uint priority, uint color) -> void {
|
||||
if(ppufast.hd()) return plotHD(below, x, source, priority, color, false, false);
|
||||
if(priority > below[x].priority) below[x] = {source, priority, color};
|
||||
}
|
||||
|
||||
//todo: name these variables more clearly ...
|
||||
auto PPUfast::Line::plotHD(Pixel* pixel, uint x, uint source, uint priority, uint color, bool hires, bool subpixel) -> void {
|
||||
auto scale = ppufast.hdScale();
|
||||
pixel += ppufast.widescreen() * scale;
|
||||
auto PPUfast::Line::plotHD(Pixel* pixel, int x, uint source, uint priority, uint color, bool hires, bool subpixel) -> void {
|
||||
int scale = ppufast.hdScale();
|
||||
int wss = ppufast.widescreen() * scale;
|
||||
int xss = hires && subpixel ? scale / 2 : 0;
|
||||
int ys = ppufast.interlace() && ppufast.field() ? scale / 2 : 0;
|
||||
if(priority > pixel[x * scale + xss + ys * 256 * scale].priority) {
|
||||
if(priority > pixel[x * scale + xss + ys * 256 * scale + wss].priority) {
|
||||
Pixel p = {source, priority, color};
|
||||
int xsm = hires && !subpixel ? scale / 2 : scale;
|
||||
int ysm = ppufast.interlace() && !ppufast.field() ? scale / 2 : scale;
|
||||
for(int xs = xss; xs < xsm; xs++) {
|
||||
pixel[x * scale + xs + ys * 256 * scale] = p;
|
||||
pixel[x * scale + xs + ys * 256 * scale + wss] = p;
|
||||
}
|
||||
int size = sizeof(Pixel) * (xsm - xss);
|
||||
Pixel* source = &pixel[x * scale + xss + ys * 256 * scale];
|
||||
Pixel* source = &pixel[x * scale + xss + ys * 256 * scale + wss];
|
||||
for(int yst = ys + 1; yst < ysm; yst++) {
|
||||
memcpy(&pixel[x * scale + xss + yst * (256+2*ppufast.widescreen()) * scale], source, size);
|
||||
memcpy(&pixel[x * scale + xss + yst * (256+2*ppufast.widescreen()) * scale + wss], source, size);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,7 +28,8 @@ auto PPUfast::Line::renderObject(PPUfast::IO::Object& self) -> void {
|
|||
item.height = heights[self.baseSize];
|
||||
}
|
||||
|
||||
if(object.x > 256 && object.x + item.width - 1 < 512) continue;
|
||||
if(!ppufast.wsobj()
|
||||
&& object.x > 256 && object.x + item.width - 1 < 512) continue; //!! //#config
|
||||
uint height = item.height >> self.interlace;
|
||||
if((y >= object.y && y < object.y + height)
|
||||
|| (object.y + height >= 256 && y < (object.y + height & 255))
|
||||
|
@ -72,7 +73,7 @@ auto PPUfast::Line::renderObject(PPUfast::IO::Object& self) -> void {
|
|||
|
||||
for(uint tileX : range(tileWidth)) {
|
||||
uint objectX = x + (tileX << 3) & 511;
|
||||
if(x != 256 && objectX >= 256 && objectX + 7 < 512) continue;
|
||||
//if(x != 256 && objectX >= 256 && objectX + 7 < 512) continue;
|
||||
|
||||
ObjectTile tile{true};
|
||||
tile.x = objectX;
|
||||
|
@ -93,8 +94,8 @@ auto PPUfast::Line::renderObject(PPUfast::IO::Object& self) -> void {
|
|||
ppufast.io.obj.rangeOver |= itemCount > ppufast.ItemLimit;
|
||||
ppufast.io.obj.timeOver |= tileCount > ppufast.TileLimit;
|
||||
|
||||
uint8 palette[256];
|
||||
uint8 priority[256];
|
||||
uint8 palette[512];//
|
||||
uint8 priority[512];//
|
||||
|
||||
for(uint n : range(ppufast.TileLimit)) {
|
||||
const auto& tile = tiles[n];
|
||||
|
@ -105,21 +106,26 @@ auto PPUfast::Line::renderObject(PPUfast::IO::Object& self) -> void {
|
|||
uint mirrorX = tile.hflip ? 7 : 0;
|
||||
for(uint x : range(8)) {
|
||||
tileX &= 511;
|
||||
if(tileX < 256) {
|
||||
//if(tileX < 256) {
|
||||
if(uint color = tiledata[x ^ mirrorX]) {
|
||||
palette[tileX] = tile.palette + color;
|
||||
priority[tileX] = self.priority[tile.priority];
|
||||
}
|
||||
}
|
||||
//}
|
||||
tileX++;
|
||||
}
|
||||
}
|
||||
|
||||
for(uint x : range(256)) {
|
||||
int wsl = -((int)ppufast.widescreen());
|
||||
int wsr = 256 + ((int)ppufast.widescreen());
|
||||
for(uint x : range(512)) {//
|
||||
if(!priority[x]) continue;
|
||||
uint source = palette[x] < 192 ? Source::OBJ1 : Source::OBJ2;
|
||||
if(self.aboveEnable && !windowAbove[x]) plotAbove(x, source, priority[x], cgram[palette[x]]);
|
||||
if(self.belowEnable && !windowBelow[x]) plotBelow(x, source, priority[x], cgram[palette[x]]);
|
||||
int xc = x;//
|
||||
if(xc > 384) xc -= 512; // 256+256/2
|
||||
if(xc < wsl || xc >= wsr) continue;
|
||||
if(self.aboveEnable && !windowAbove[x]) plotAbove(xc, source, priority[x], cgram[palette[x]]);//
|
||||
if(self.belowEnable && !windowBelow[x]) plotBelow(xc, source, priority[x], cgram[palette[x]]);//
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -24,7 +24,15 @@ auto PPUfast::hdScale() const -> uint { return configuration.hacks.ppu.mode7.sca
|
|||
auto PPUfast::hdPerspective() const -> bool { return configuration.hacks.ppu.mode7.perspective; }
|
||||
auto PPUfast::hdSupersample() const -> bool { return configuration.hacks.ppu.mode7.supersample; }
|
||||
auto PPUfast::hdMosaic() const -> bool { return configuration.hacks.ppu.mode7.mosaic; }
|
||||
auto PPUfast::widescreen() const -> int { return configuration.hacks.ppu.mode7.widescreen ? 64 : 0; } // 64 / 0 #widescreenextension
|
||||
auto PPUfast::widescreen() const -> uint { return configuration.hacks.ppu.mode7.widescreen; } // 64 / 0 #widescreenextension
|
||||
auto PPUfast::wsbg(uint bg) const -> uint {
|
||||
if (bg == Source::BG1) return configuration.hacks.ppu.mode7.wsbg1;
|
||||
if (bg == Source::BG2) return configuration.hacks.ppu.mode7.wsbg2;
|
||||
if (bg == Source::BG3) return configuration.hacks.ppu.mode7.wsbg3;
|
||||
if (bg == Source::BG4) return configuration.hacks.ppu.mode7.wsbg4;
|
||||
return 0;
|
||||
}
|
||||
auto PPUfast::wsobj() const -> bool { return configuration.hacks.ppu.mode7.wsobj; }
|
||||
|
||||
PPUfast::PPUfast() {
|
||||
output = new uint32[2304 * 2304] + 72 * 2304; //overscan offset
|
||||
|
|
|
@ -16,7 +16,9 @@ struct PPUfast : Thread, PPUcounter {
|
|||
alwaysinline auto hdPerspective() const -> bool;
|
||||
alwaysinline auto hdSupersample() const -> bool;
|
||||
alwaysinline auto hdMosaic() const -> bool;
|
||||
alwaysinline auto widescreen() const -> int;
|
||||
alwaysinline auto widescreen() const -> uint;
|
||||
alwaysinline auto wsbg(uint bg) const -> uint;
|
||||
alwaysinline auto wsobj() const -> bool;
|
||||
|
||||
//ppu.cpp
|
||||
PPUfast();
|
||||
|
@ -275,9 +277,9 @@ public:
|
|||
auto pixel(uint x, Pixel above, Pixel below) const -> uint15;
|
||||
auto blend(uint x, uint y, bool halve) const -> uint15;
|
||||
alwaysinline auto directColor(uint paletteIndex, uint paletteColor) const -> uint15;
|
||||
alwaysinline auto plotAbove(uint x, uint source, uint priority, uint color) -> void;
|
||||
alwaysinline auto plotBelow(uint x, uint source, uint priority, uint color) -> void;
|
||||
alwaysinline auto plotHD(Pixel*, uint x, uint source, uint priority, uint color, bool hires, bool subpixel) -> void;
|
||||
alwaysinline auto plotAbove(int x, uint source, uint priority, uint color) -> void;
|
||||
alwaysinline auto plotBelow(int x, uint source, uint priority, uint color) -> void;
|
||||
alwaysinline auto plotHD(Pixel*, int x, uint source, uint priority, uint color, bool hires, bool subpixel) -> void;
|
||||
|
||||
//background.cpp
|
||||
auto renderBackground(PPUfast::IO::Background&, uint source) -> void;
|
||||
|
|
|
@ -253,7 +253,7 @@ auto Presentation::resizeViewport() -> void {
|
|||
uint layoutWidth = viewportLayout.geometry().width();
|
||||
uint layoutHeight = viewportLayout.geometry().height();
|
||||
|
||||
int widescreen = settings.emulator.hack.ppu.mode7.widescreen && settings.emulator.hack.ppu.mode7.scale > 1 ? 64 : 0; // 64 / 0 #widescreenextension
|
||||
uint widescreen = settings.emulator.hack.ppu.mode7.scale > 1 ? settings.emulator.hack.ppu.mode7.widescreen : 0; // 64 / 0 #widescreenextension
|
||||
uint width = (256+2*widescreen) * (settings.video.aspectCorrection && !widescreen ? 8.0 / 7.0 : 1.0);
|
||||
uint height = (settings.video.overscan ? 240.0 : 224.0);
|
||||
uint viewportWidth, viewportHeight;
|
||||
|
@ -303,7 +303,7 @@ auto Presentation::resizeWindow() -> void {
|
|||
if(fullScreen()) return;
|
||||
if(maximized()) setMaximized(false);
|
||||
|
||||
int widescreen = settings.emulator.hack.ppu.mode7.widescreen && settings.emulator.hack.ppu.mode7.scale > 1 ? 64 : 0; // 64 / 0 #widescreenextension
|
||||
int widescreen = settings.emulator.hack.ppu.mode7.scale > 1 ? settings.emulator.hack.ppu.mode7.widescreen : 0; // 64 / 0 #widescreenextension
|
||||
uint width = (256+2*widescreen) * (settings.video.aspectCorrection && !widescreen ? 8.0 / 7.0 : 1.0);
|
||||
uint height = (settings.video.overscan ? 240.0 : 224.0);
|
||||
uint multiplier = max(1, settings.video.multiplier);
|
||||
|
|
|
@ -14,6 +14,11 @@ auto Program::hackCompatibility() -> void {
|
|||
emulator->configure("Hacks/PPU/Mode7/Scale", settings.emulator.hack.ppu.mode7.scale);
|
||||
emulator->configure("Hacks/PPU/Mode7/Perspective", settings.emulator.hack.ppu.mode7.perspective);
|
||||
emulator->configure("Hacks/PPU/Mode7/Widescreen", settings.emulator.hack.ppu.mode7.widescreen);
|
||||
emulator->configure("Hacks/PPU/Mode7/Wsbg1", settings.emulator.hack.ppu.mode7.wsbg1);
|
||||
emulator->configure("Hacks/PPU/Mode7/Wsbg2", settings.emulator.hack.ppu.mode7.wsbg2);
|
||||
emulator->configure("Hacks/PPU/Mode7/Wsbg3", settings.emulator.hack.ppu.mode7.wsbg3);
|
||||
emulator->configure("Hacks/PPU/Mode7/Wsbg4", settings.emulator.hack.ppu.mode7.wsbg4);
|
||||
emulator->configure("Hacks/PPU/Mode7/Wsobj", settings.emulator.hack.ppu.mode7.wsobj);
|
||||
emulator->configure("Hacks/PPU/Mode7/Supersample", settings.emulator.hack.ppu.mode7.supersample);
|
||||
emulator->configure("Hacks/PPU/Mode7/Mosaic", settings.emulator.hack.ppu.mode7.mosaic);
|
||||
emulator->configure("Hacks/DSP/Fast", fastDSP);
|
||||
|
|
|
@ -72,18 +72,118 @@ auto EmulatorSettings::create() -> void {
|
|||
settings.emulator.hack.ppu.mode7.perspective = mode7Perspective.checked();
|
||||
emulator->configure("Hacks/PPU/Mode7/Perspective", settings.emulator.hack.ppu.mode7.perspective);
|
||||
});
|
||||
mode7Widescreen.setText("Widescreen").setChecked(settings.emulator.hack.ppu.mode7.widescreen).onToggle([&] {
|
||||
settings.emulator.hack.ppu.mode7.widescreen = mode7Widescreen.checked();
|
||||
emulator->configure("Hacks/PPU/Mode7/Widescreen", settings.emulator.hack.ppu.mode7.widescreen);
|
||||
presentation.resizeViewport();
|
||||
mode7Mosaic.setText("HD->SD Mosaic").setChecked(settings.emulator.hack.ppu.mode7.mosaic).onToggle([&] {
|
||||
settings.emulator.hack.ppu.mode7.mosaic = mode7Mosaic.checked();
|
||||
emulator->configure("Hacks/PPU/Mode7/Mosaic", settings.emulator.hack.ppu.mode7.mosaic);
|
||||
});
|
||||
mode7Supersample.setText("Supersample").setChecked(settings.emulator.hack.ppu.mode7.supersample).onToggle([&] {
|
||||
settings.emulator.hack.ppu.mode7.supersample = mode7Supersample.checked();
|
||||
emulator->configure("Hacks/PPU/Mode7/Supersample", settings.emulator.hack.ppu.mode7.supersample);
|
||||
});
|
||||
mode7Mosaic.setText("HD->SD Mosaic").setChecked(settings.emulator.hack.ppu.mode7.mosaic).onToggle([&] {
|
||||
settings.emulator.hack.ppu.mode7.mosaic = mode7Mosaic.checked();
|
||||
emulator->configure("Hacks/PPU/Mode7/Mosaic", settings.emulator.hack.ppu.mode7.mosaic);
|
||||
mode7WidescreenLabel.setText("Widescreen:");
|
||||
mode7Widescreen.append(ComboButtonItem().setText("none ").setProperty("adval", 0));
|
||||
mode7Widescreen.append(ComboButtonItem().setText("16:10").setProperty("adval", 40));
|
||||
mode7Widescreen.append(ComboButtonItem().setText("16:9 ").setProperty("adval", 64));
|
||||
mode7Widescreen.append(ComboButtonItem().setText(" 1.93").setProperty("adval", 80));
|
||||
mode7Widescreen.append(ComboButtonItem().setText(" 2.15").setProperty("adval", 104));
|
||||
mode7Widescreen.append(ComboButtonItem().setText("21:9 ").setProperty("adval", 120));
|
||||
mode7Widescreen.append(ComboButtonItem().setText(" 2.44").setProperty("adval", 136));
|
||||
for(uint n = 0; n < 7; n++) {
|
||||
if(mode7Widescreen.item(n).property("adval").natural() == settings.emulator.hack.ppu.mode7.widescreen)
|
||||
mode7Widescreen.item(n).setSelected();
|
||||
}
|
||||
mode7Widescreen.onChange([&] {
|
||||
settings.emulator.hack.ppu.mode7.widescreen = mode7Widescreen.selected().property("adval").natural();
|
||||
emulator->configure("Hacks/PPU/Mode7/Widescreen", settings.emulator.hack.ppu.mode7.widescreen);
|
||||
presentation.resizeViewport();
|
||||
});
|
||||
wsBG1Label.setText("BG1:");
|
||||
wsBG1.append(ComboButtonItem().setText(" off").setProperty("wsbgmode", 0));
|
||||
wsBG1.append(ComboButtonItem().setText(" on ").setProperty("wsbgmode", 1));
|
||||
wsBG1.append(ComboButtonItem().setText("< 40").setProperty("wsbgmode", 2));
|
||||
wsBG1.append(ComboButtonItem().setText("> 40").setProperty("wsbgmode", 3));
|
||||
wsBG1.append(ComboButtonItem().setText("< 80").setProperty("wsbgmode", 4));
|
||||
wsBG1.append(ComboButtonItem().setText("> 80").setProperty("wsbgmode", 5));
|
||||
wsBG1.append(ComboButtonItem().setText("<120").setProperty("wsbgmode", 6));
|
||||
wsBG1.append(ComboButtonItem().setText(">120").setProperty("wsbgmode", 7));
|
||||
wsBG1.append(ComboButtonItem().setText("<160").setProperty("wsbgmode", 8));
|
||||
wsBG1.append(ComboButtonItem().setText(">160").setProperty("wsbgmode", 9));
|
||||
wsBG1.append(ComboButtonItem().setText("<200").setProperty("wsbgmode", 10));
|
||||
wsBG1.append(ComboButtonItem().setText(">200").setProperty("wsbgmode", 11));
|
||||
for(uint n = 0; n < 12; n++) {
|
||||
if(wsBG1.item(n).property("wsbgmode").natural() == settings.emulator.hack.ppu.mode7.wsbg1)
|
||||
wsBG1.item(n).setSelected();
|
||||
}
|
||||
wsBG1.onChange([&] {
|
||||
settings.emulator.hack.ppu.mode7.wsbg1 = wsBG1.selected().property("wsbgmode").natural();
|
||||
emulator->configure("Hacks/PPU/Mode7/Wsbg1", settings.emulator.hack.ppu.mode7.wsbg1);
|
||||
});
|
||||
wsBG2Label.setText("BG2:");
|
||||
wsBG2.append(ComboButtonItem().setText(" off").setProperty("wsbgmode", 0));
|
||||
wsBG2.append(ComboButtonItem().setText(" on ").setProperty("wsbgmode", 1));
|
||||
wsBG2.append(ComboButtonItem().setText("< 40").setProperty("wsbgmode", 2));
|
||||
wsBG2.append(ComboButtonItem().setText("> 40").setProperty("wsbgmode", 3));
|
||||
wsBG2.append(ComboButtonItem().setText("< 80").setProperty("wsbgmode", 4));
|
||||
wsBG2.append(ComboButtonItem().setText("> 80").setProperty("wsbgmode", 5));
|
||||
wsBG2.append(ComboButtonItem().setText("<120").setProperty("wsbgmode", 6));
|
||||
wsBG2.append(ComboButtonItem().setText(">120").setProperty("wsbgmode", 7));
|
||||
wsBG2.append(ComboButtonItem().setText("<160").setProperty("wsbgmode", 8));
|
||||
wsBG2.append(ComboButtonItem().setText(">160").setProperty("wsbgmode", 9));
|
||||
wsBG2.append(ComboButtonItem().setText("<200").setProperty("wsbgmode", 10));
|
||||
wsBG2.append(ComboButtonItem().setText(">200").setProperty("wsbgmode", 11));
|
||||
for(uint n = 0; n < 12; n++) {
|
||||
if(wsBG2.item(n).property("wsbgmode").natural() == settings.emulator.hack.ppu.mode7.wsbg2)
|
||||
wsBG2.item(n).setSelected();
|
||||
}
|
||||
wsBG2.onChange([&] {
|
||||
settings.emulator.hack.ppu.mode7.wsbg2 = wsBG2.selected().property("wsbgmode").natural();
|
||||
emulator->configure("Hacks/PPU/Mode7/Wsbg2", settings.emulator.hack.ppu.mode7.wsbg2);
|
||||
});
|
||||
wsBG3Label.setText("BG3:");
|
||||
wsBG3.append(ComboButtonItem().setText(" off").setProperty("wsbgmode", 0));
|
||||
wsBG3.append(ComboButtonItem().setText(" on ").setProperty("wsbgmode", 1));
|
||||
wsBG3.append(ComboButtonItem().setText("< 40").setProperty("wsbgmode", 2));
|
||||
wsBG3.append(ComboButtonItem().setText("> 40").setProperty("wsbgmode", 3));
|
||||
wsBG3.append(ComboButtonItem().setText("< 80").setProperty("wsbgmode", 4));
|
||||
wsBG3.append(ComboButtonItem().setText("> 80").setProperty("wsbgmode", 5));
|
||||
wsBG3.append(ComboButtonItem().setText("<120").setProperty("wsbgmode", 6));
|
||||
wsBG3.append(ComboButtonItem().setText(">120").setProperty("wsbgmode", 7));
|
||||
wsBG3.append(ComboButtonItem().setText("<160").setProperty("wsbgmode", 8));
|
||||
wsBG3.append(ComboButtonItem().setText(">160").setProperty("wsbgmode", 9));
|
||||
wsBG3.append(ComboButtonItem().setText("<200").setProperty("wsbgmode", 10));
|
||||
wsBG3.append(ComboButtonItem().setText(">200").setProperty("wsbgmode", 11));
|
||||
for(uint n = 0; n < 12; n++) {
|
||||
if(wsBG3.item(n).property("wsbgmode").natural() == settings.emulator.hack.ppu.mode7.wsbg3)
|
||||
wsBG3.item(n).setSelected();
|
||||
}
|
||||
wsBG3.onChange([&] {
|
||||
settings.emulator.hack.ppu.mode7.wsbg3 = wsBG3.selected().property("wsbgmode").natural();
|
||||
emulator->configure("Hacks/PPU/Mode7/Wsbg3", settings.emulator.hack.ppu.mode7.wsbg3);
|
||||
});
|
||||
wsBG4Label.setText("BG4:");
|
||||
wsBG4.append(ComboButtonItem().setText(" off").setProperty("wsbgmode", 0));
|
||||
wsBG4.append(ComboButtonItem().setText(" on ").setProperty("wsbgmode", 1));
|
||||
wsBG4.append(ComboButtonItem().setText("< 40").setProperty("wsbgmode", 2));
|
||||
wsBG4.append(ComboButtonItem().setText("> 40").setProperty("wsbgmode", 3));
|
||||
wsBG4.append(ComboButtonItem().setText("< 80").setProperty("wsbgmode", 4));
|
||||
wsBG4.append(ComboButtonItem().setText("> 80").setProperty("wsbgmode", 5));
|
||||
wsBG4.append(ComboButtonItem().setText("<120").setProperty("wsbgmode", 6));
|
||||
wsBG4.append(ComboButtonItem().setText(">120").setProperty("wsbgmode", 7));
|
||||
wsBG4.append(ComboButtonItem().setText("<160").setProperty("wsbgmode", 8));
|
||||
wsBG4.append(ComboButtonItem().setText(">160").setProperty("wsbgmode", 9));
|
||||
wsBG4.append(ComboButtonItem().setText("<200").setProperty("wsbgmode", 10));
|
||||
wsBG4.append(ComboButtonItem().setText(">200").setProperty("wsbgmode", 11));
|
||||
for(uint n = 0; n < 12; n++) {
|
||||
if(wsBG4.item(n).property("wsbgmode").natural() == settings.emulator.hack.ppu.mode7.wsbg4)
|
||||
wsBG4.item(n).setSelected();
|
||||
}
|
||||
wsBG4.onChange([&] {
|
||||
settings.emulator.hack.ppu.mode7.wsbg4 = wsBG4.selected().property("wsbgmode").natural();
|
||||
emulator->configure("Hacks/PPU/Mode7/Wsbg4", settings.emulator.hack.ppu.mode7.wsbg4);
|
||||
});
|
||||
wsObj.setText("unsafe sprites").setChecked(settings.emulator.hack.ppu.mode7.wsobj).onToggle([&] {
|
||||
settings.emulator.hack.ppu.mode7.wsobj = wsObj.checked();
|
||||
emulator->configure("Hacks/PPU/Mode7/Wsobj", settings.emulator.hack.ppu.mode7.wsobj);
|
||||
});
|
||||
dspLabel.setText("DSP (audio)").setFont(Font().setBold());
|
||||
fastDSP.setText("Fast mode").setChecked(settings.emulator.hack.dsp.fast).onToggle([&] {
|
||||
|
@ -115,7 +215,12 @@ auto EmulatorSettings::updateConfiguration() -> void {
|
|||
emulator->configure("Hacks/PPU/NoSpriteLimit", noSpriteLimit.checked());
|
||||
emulator->configure("Hacks/PPU/Mode7/Scale", mode7Scale.selected().property("multiplier").natural());
|
||||
emulator->configure("Hacks/PPU/Mode7/Perspective", mode7Perspective.checked());
|
||||
emulator->configure("Hacks/PPU/Mode7/Widescreen", mode7Widescreen.checked());
|
||||
emulator->configure("Hacks/PPU/Mode7/Widescreen", mode7Widescreen.property("addval").natural());
|
||||
emulator->configure("Hacks/PPU/Mode7/Wsbg1", wsBG1.property("wsbgmode").natural());
|
||||
emulator->configure("Hacks/PPU/Mode7/Wsbg2", wsBG2.property("wsbgmode").natural());
|
||||
emulator->configure("Hacks/PPU/Mode7/Wsbg3", wsBG3.property("wsbgmode").natural());
|
||||
emulator->configure("Hacks/PPU/Mode7/Wsbg4", wsBG4.property("wsbgmode").natural());
|
||||
emulator->configure("Hacks/PPU/Mode7/Wsobj", wsObj.checked());
|
||||
emulator->configure("Hacks/PPU/Mode7/Supersample", mode7Supersample.checked());
|
||||
emulator->configure("Hacks/PPU/Mode7/Mosaic", mode7Mosaic.checked());
|
||||
emulator->configure("Hacks/DSP/Fast", fastDSP.checked());
|
||||
|
|
|
@ -99,7 +99,12 @@ auto Settings::process(bool load) -> void {
|
|||
bind(boolean, "Emulator/Hack/PPU/NoSpriteLimit", emulator.hack.ppu.noSpriteLimit);
|
||||
bind(natural, "Emulator/Hack/PPU/Mode7/Scale", emulator.hack.ppu.mode7.scale);
|
||||
bind(boolean, "Emulator/Hack/PPU/Mode7/Perspective", emulator.hack.ppu.mode7.perspective);
|
||||
bind(boolean, "Emulator/Hack/PPU/Mode7/Widescreen", emulator.hack.ppu.mode7.widescreen);
|
||||
bind(natural, "Emulator/Hack/PPU/Mode7/Widescreen", emulator.hack.ppu.mode7.widescreen);
|
||||
bind(natural, "Emulator/Hack/PPU/Mode7/Wsbg1", emulator.hack.ppu.mode7.wsbg1);
|
||||
bind(natural, "Emulator/Hack/PPU/Mode7/Wsbg2", emulator.hack.ppu.mode7.wsbg2);
|
||||
bind(natural, "Emulator/Hack/PPU/Mode7/Wsbg3", emulator.hack.ppu.mode7.wsbg3);
|
||||
bind(natural, "Emulator/Hack/PPU/Mode7/Wsbg4", emulator.hack.ppu.mode7.wsbg4);
|
||||
bind(natural, "Emulator/Hack/PPU/Mode7/Wsobj", emulator.hack.ppu.mode7.wsobj);
|
||||
bind(boolean, "Emulator/Hack/PPU/Mode7/Supersample", emulator.hack.ppu.mode7.supersample);
|
||||
bind(boolean, "Emulator/Hack/PPU/Mode7/Mosaic", emulator.hack.ppu.mode7.mosaic);
|
||||
bind(boolean, "Emulator/Hack/DSP/Fast", emulator.hack.dsp.fast);
|
||||
|
|
|
@ -81,9 +81,14 @@ struct Settings : Markup::Node {
|
|||
struct Mode7 {
|
||||
uint scale = 1;
|
||||
bool perspective = true;
|
||||
bool widescreen = true;
|
||||
bool supersample = false;
|
||||
bool mosaic = true;
|
||||
uint widescreen = 64;
|
||||
uint wsbg1 = 1;
|
||||
uint wsbg2 = 1;
|
||||
uint wsbg3 = 1;
|
||||
uint wsbg4 = 1;
|
||||
bool wsobj = false;
|
||||
} mode7;
|
||||
} ppu;
|
||||
struct DSP {
|
||||
|
@ -272,9 +277,20 @@ public:
|
|||
Label mode7ScaleLabel{&mode7Layout, Size{0, 0}};
|
||||
ComboButton mode7Scale{&mode7Layout, Size{0, 0}};
|
||||
CheckLabel mode7Perspective{&mode7Layout, Size{0, 0}};
|
||||
CheckLabel mode7Widescreen{&mode7Layout, Size{0, 0}};
|
||||
CheckLabel mode7Mosaic{&mode7Layout, Size{0, 0}};
|
||||
CheckLabel mode7Supersample{&mode7Layout, Size{0, 0}};
|
||||
CheckLabel mode7Mosaic{&mode7Layout, Size{0, 0}};
|
||||
HorizontalLayout widescreenLayout{&layout, Size{~0, 0}};
|
||||
Label mode7WidescreenLabel{&widescreenLayout, Size{0, 0}};
|
||||
ComboButton mode7Widescreen{&widescreenLayout, Size{0, 0}};
|
||||
Label wsBG1Label{&widescreenLayout, Size{0, 0}};
|
||||
ComboButton wsBG1{&widescreenLayout, Size{0, 0}};
|
||||
Label wsBG2Label{&widescreenLayout, Size{0, 0}};
|
||||
ComboButton wsBG2{&widescreenLayout, Size{0, 0}};
|
||||
Label wsBG3Label{&widescreenLayout, Size{0, 0}};
|
||||
ComboButton wsBG3{&widescreenLayout, Size{0, 0}};
|
||||
Label wsBG4Label{&widescreenLayout, Size{0, 0}};
|
||||
ComboButton wsBG4{&widescreenLayout, Size{0, 0}};
|
||||
CheckLabel wsObj{&widescreenLayout, Size{0, 0}};
|
||||
Label dspLabel{&layout, Size{~0, 0}, 2};
|
||||
HorizontalLayout dspLayout{&layout, Size{~0, 0}};
|
||||
CheckLabel fastDSP{&dspLayout, Size{0, 0}};
|
||||
|
|
Loading…
Reference in a new issue