Skip to content

Commit

Permalink
Explicitly handle values of 0, -1, and ~(-1) in video_refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
JesseTG committed May 9, 2024
1 parent f560313 commit 70c249d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/libretro/drivers/environment/composite.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,10 +318,11 @@ def timing(self) -> TimingDriver | None:

@override
def video_refresh(self, data: c_void_p, width: int, height: int, pitch: int) -> None:
# Handle the constants and their equivalent ints, just to be safe
match data:
case FrameBufferSpecial.DUPE:
case FrameBufferSpecial.DUPE | 0 | None:
self._video.refresh(FrameBufferSpecial.DUPE, width, height, pitch)
case FrameBufferSpecial.HARDWARE:
case FrameBufferSpecial.HARDWARE | -1 | 18446744073709551615:
self._video.refresh(FrameBufferSpecial.HARDWARE, width, height, pitch)
case int() | c_void_p():
view = memoryview_at(data, pitch * height, readonly=True)
Expand Down

0 comments on commit 70c249d

Please sign in to comment.