Skip to content

Commit

Permalink
beta9
Browse files Browse the repository at this point in the history
  • Loading branch information
DerKoun committed Aug 15, 2019
1 parent 2a322e5 commit 92a49dd
Show file tree
Hide file tree
Showing 16 changed files with 321 additions and 87 deletions.
19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,21 @@ Extending the scenes to the left and right, without distorting them. Works for m
- **Demo video**: *Chrono Trigger* ending credits: [Beyond Time](https://www.youtube.com/watch?v=YE1gp6BWilg) by *retroprez* (youtube)
- **Demo video**: *Chrono Trigger* ending credits: [Float Away](https://www.youtube.com/watch?v=Ss49vVbULOQ) by *retroprez* (youtube)

### more to come
### True color

Color calculation are done at true color instead of the SNES color depth (3*8 instead of 3*5 bit). With the optional line color smoothing color "steps" turn into actual gradients (without influencing the sharpness of the artwork).

### Other high resolution features

For example higher color depth and interpolation for the colors blending that help the sense of depth.
Smother color gradients and window effect, not limited by the original resolution or integer precision.

### plus some non-HD related features

like the ability to disable background layers, sprites and window effects for screenshots for wallpapers or soft crop to zoom in, leaving maps or static art off the sides of the screen.

### more to come

Feel free to suggest features. Please remember that this fork focuses on HD and visual output.


## Help Wanted
Expand Down Expand Up @@ -128,6 +135,14 @@ Settings for sprites/objects.

The x-coordinate used as fallback for "*ignore window*". (defaults to 128 (the center))

### Line color HD

The amount of neighboring lines used to smooth color gradients that are applied to the frame, e.g. to improve perspective Mode 7 effects, by fading to dark for the "far away" top. "*0*" disables this smoothing. The default is "*4*".

### Window HD

The amount of neighboring lines used to smooth Window effects, like iris transitions, shadows or spell effects. "*0*" disables smoothing and is the default. (*This feature is considered a preview, as the lines at the top and bottom of effects are currently not entirely HD and it, in general, is not that well tested. Please let me know about any games/scenes/effects that work noticeable badly or well*)

### Soft crop

Allows widths at the four edges of the image to be declared uninteresting. So when sizing and placing the image, especially in fullscreen, they can overflow the screen, allowing the significant parts of the image to be larger. So to focus on the top part of "*Super Mario Kart*" set "*bottom*" to 130 and "*top*" to 0. Further tweaking based on your monitor AR and liking may be required.
Expand Down
22 changes: 22 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
version: '{build}'

image:
- Visual Studio 2017
- Ubuntu1804

install:
- cmd: set PATH=%PATH%;C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin
- sh: sudo apt-get update && sudo apt-get -y install build-essential libgtk2.0-dev libpulse-dev mesa-common-dev libgtksourceview2.0-dev libcairo2-dev libsdl2-dev libxv-dev libao-dev libopenal-dev libudev-dev

build_script:
- cmd: mingw32-make -j 4 -C bsnes
- sh: make -j 4 -C bsnes

after_build:
- cmd: cd bsnes/out && 7z a ../../bsnes_hd.zip bsnes.exe
- sh: cd bsnes/out && 7z a ../../bsnes_hd.zip bsnes

test: off

artifacts:
- path: bsnes_hd_build.zip
15 changes: 9 additions & 6 deletions bsnes/emulator/video/video.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ auto Video::removeSprite(shared_pointer<Sprite> sprite) -> bool {
return false;
}

auto Video::processColor(uint15 color, uint4 displayBrightness) const -> uint32 {
return color == 0 ? (uint32)0 : palette[color | (displayBrightness << 15)];
}

auto Video::refresh(uint32* input, uint pitch, uint width, uint height) -> void {
if(this->width != width || this->height != height) {
delete buffer;
Expand All @@ -124,20 +128,19 @@ auto Video::refresh(uint32* input, uint pitch, uint width, uint height) -> void
auto output = buffer;
pitch >>= 2; //bytes to words

for(uint y : range(height)) {
if(pitch == width) {
memory::copy<uint32>(output, input, width * height);
} else for(uint y : range(height)) {
auto source = input + y * pitch;
auto target = output + y * width;

if(!effects.interframeBlending) {
for(uint x : range(width)) {
auto color = palette[*source++];
*target++ = color;
}
memory::copy<uint32>(target, source, width);
} else {
uint32 mask = depth == 30 ? 0x40100401 : 0x01010101;
for(uint x : range(width)) {
auto a = *target;
auto b = palette[*source++];
auto b = *source++;
*target++ = (a + b - ((a ^ b) & mask)) >> 1;
}
}
Expand Down
2 changes: 2 additions & 0 deletions bsnes/emulator/video/video.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ struct Video {

auto refresh(uint32* input, uint pitch, uint width, uint height) -> void;

/*alwaysinline*/ auto processColor(uint15 color, uint4 displayBrightness) const -> uint32;

private:
Interface* interface = nullptr;
vector<shared_pointer<Sprite>> sprites;
Expand Down
2 changes: 2 additions & 0 deletions bsnes/sfc/interface/configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ auto Configuration::process(Markup::Node document, bool load) -> void {
bind(natural, "Hacks/PPU/Mode7/Wsobj", hacks.ppu.mode7.wsobj);
bind(natural, "Hacks/PPU/Mode7/Igwin", hacks.ppu.mode7.igwin);
bind(natural, "Hacks/PPU/Mode7/Igwinx", hacks.ppu.mode7.igwinx);
bind(natural, "Hacks/PPU/Mode7/BgGrad", hacks.ppu.mode7.bgGrad);
bind(natural, "Hacks/PPU/Mode7/WindRad", hacks.ppu.mode7.windRad);
bind(natural, "Hacks/PPU/Mode7/WsMode", hacks.ppu.mode7.wsMode);
bind(natural, "Hacks/PPU/Mode7/WsBgCol", hacks.ppu.mode7.wsBgCol);
bind(natural, "Hacks/PPU/Mode7/UnintrMode", hacks.ppu.mode7.unintrMode);
Expand Down
2 changes: 2 additions & 0 deletions bsnes/sfc/interface/configuration.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ struct Configuration {
uint wsobj = 0;
uint igwin = 1;
uint igwinx = 128;
uint bgGrad = 4;
uint windRad = 0;
uint wsMode = 1;
uint wsBgCol = 1;
uint unintrMode = 1;
Expand Down
4 changes: 2 additions & 2 deletions bsnes/sfc/ppu-fast/background.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ auto PPUfast::Line::renderBackground(PPUfast::IO::Background& self, uint source)
if(self.belowEnable && !windowBelow[ppufast.winXad(X, true)]) plotBelow(X, source, mosaicPriority, mosaicColor);
}
} else {
if(self.aboveEnable && !windowAbove[ppufast.winXad(X, false)]) plotHD(above, X, source, mosaicPriority, mosaicColor, true, x & 1);
if(self.belowEnable && !windowBelow[ppufast.winXad(X, true)]) plotHD(below, X, source, mosaicPriority, mosaicColor, true, x & 1);
if(self.aboveEnable && !windowAbove[ppufast.winXad(X, false)]) plotHD(above, X, source, mosaicPriority, Emulator::video.processColor(mosaicColor, io.displayBrightness), true, x & 1);
if(self.belowEnable && !windowBelow[ppufast.winXad(X, true)]) plotHD(below, X, source, mosaicPriority, Emulator::video.processColor(mosaicColor, io.displayBrightness), true, x & 1);
}
}
}
Expand Down

0 comments on commit 92a49dd

Please sign in to comment.