~shiny/gbcap

591b0ab82aa48e18a2c30fc297801b3666da6520 — Thomas Spurden 3 years ago 3869284
Fix a couple of off-by-one errors in the OUTPUT_DONE state

Would "leak" some lines on each frame and so eventually overflow the
buffer.
1 files changed, 3 insertions(+), 3 deletions(-)

M compress.py
M compress.py => compress.py +3 -3
@@ 304,15 304,15 @@ class CompressFrames(Module):
                    NextValue(full_lines, full_lines + 1)
                )
            ).Else(
                If(line_within_frame == frame_height - 1,
                If(last_line,
                    # Been keeping around MAX_Y_OFFSET extra lines from the previous
                    # frame but now it's the last line of the frame so can drop them
                    If(write_port.we,
                        NextValue(full_lines, full_lines - MAX_Y_OFFSET)
                    ).Else(
                        NextValue(full_lines, full_lines - MAX_Y_OFFSET + 1)
                        NextValue(full_lines, full_lines - MAX_Y_OFFSET - 1)
                    )
                ).Elif(line_within_frame > MAX_Y_OFFSET,
                ).Elif(line_within_frame >= MAX_Y_OFFSET,
                    # Keep MAX_Y_OFFSET extra lines from the previous frame for
                    # prediction
                    If(~write_port.we,