tmp: disable buggy window emulation
I'd like to merge my affine sprite impl into main, which will require merging a lot of the rewrites I did in this branch. My plan is to merge the buggy ppu window impl to main, but keep it disabled. This is technically a regression but the current impl barely worked anyways so....
This commit is contained in:
parent
f98a1700e0
commit
5aac04faf5
|
@ -839,16 +839,22 @@ pub const Ppu = struct {
|
||||||
const WindowBounds = enum { win0, win1, out };
|
const WindowBounds = enum { win0, win1, out };
|
||||||
|
|
||||||
fn windowBounds(self: *Self, x: u9, y: u8) ?WindowBounds {
|
fn windowBounds(self: *Self, x: u9, y: u8) ?WindowBounds {
|
||||||
const win0 = self.dispcnt.win_enable.read() & 1 == 1;
|
_ = y;
|
||||||
const win1 = (self.dispcnt.win_enable.read() >> 1) & 1 == 1;
|
_ = x;
|
||||||
const winObj = self.dispcnt.obj_win_enable.read();
|
_ = self;
|
||||||
|
// FIXME: Remove to enable PPU Window Emulation
|
||||||
|
return null;
|
||||||
|
|
||||||
if (!(win0 or win1 or winObj)) return null;
|
// const win0 = self.dispcnt.win_enable.read() & 1 == 1;
|
||||||
|
// const win1 = (self.dispcnt.win_enable.read() >> 1) & 1 == 1;
|
||||||
|
// const winObj = self.dispcnt.obj_win_enable.read();
|
||||||
|
|
||||||
if (win0 and self.win.inRange(0, x, y)) return .win0;
|
// if (!(win0 or win1 or winObj)) return null;
|
||||||
if (win1 and self.win.inRange(1, x, y)) return .win1;
|
|
||||||
|
|
||||||
return .out;
|
// if (win0 and self.win.inRange(0, x, y)) return .win0;
|
||||||
|
// if (win1 and self.win.inRange(1, x, y)) return .win1;
|
||||||
|
|
||||||
|
// return .out;
|
||||||
}
|
}
|
||||||
|
|
||||||
fn shouldDrawBackground(self: *Self, comptime layer: u2, bounds: ?WindowBounds, i: usize) bool {
|
fn shouldDrawBackground(self: *Self, comptime layer: u2, bounds: ?WindowBounds, i: usize) bool {
|
||||||
|
@ -1410,7 +1416,7 @@ fn shouldDrawSprite(bldcnt: io.BldCnt, scanline: *Scanline, x: u9) bool {
|
||||||
0b01 => {
|
0b01 => {
|
||||||
// BLD_ALPHA
|
// BLD_ALPHA
|
||||||
|
|
||||||
// We want to check if we're concerned aout the bottom layer first
|
// We want to check if we're concerned aout the bottom layer first
|
||||||
// because if so, the top layer already having a pixel is OK
|
// because if so, the top layer already having a pixel is OK
|
||||||
const btm_layers = bldcnt.layer_b.read();
|
const btm_layers = bldcnt.layer_b.read();
|
||||||
const is_btm_layer = (btm_layers >> 4) & 1 == 1;
|
const is_btm_layer = (btm_layers >> 4) & 1 == 1;
|
||||||
|
|
Loading…
Reference in New Issue