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:
Rekai Nyangadzayi Musuka 2022-12-17 09:53:40 -04:00
parent f98a1700e0
commit 5aac04faf5
1 changed files with 14 additions and 8 deletions

View File

@ -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 {