Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
boytacean
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
João Magalhães
boytacean
Commits
0fa59770
Verified
Commit
0fa59770
authored
1 year ago
by
João Magalhães
Browse files
Options
Downloads
Patches
Plain Diff
chore: ordering of number
Also made Union more explicit, raises Python3 compatibility.
parent
96e51180
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!36
Support for Python
Pipeline
#3620
passed
1 year ago
Stage: build
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/python/boytacean/gb.py
+4
-4
4 additions, 4 deletions
src/python/boytacean/gb.py
with
4 additions
and
4 deletions
src/python/boytacean/gb.py
+
4
−
4
View file @
0fa59770
...
@@ -4,7 +4,7 @@ from glob import glob
...
@@ -4,7 +4,7 @@ from glob import glob
from
shutil
import
rmtree
from
shutil
import
rmtree
from
tempfile
import
mkdtemp
from
tempfile
import
mkdtemp
from
contextlib
import
contextmanager
from
contextlib
import
contextmanager
from
typing
import
Any
from
typing
import
Any
,
Union
from
PIL.Image
import
Image
,
frombytes
from
PIL.Image
import
Image
,
frombytes
...
@@ -28,9 +28,9 @@ class GameBoyMode(Enum):
...
@@ -28,9 +28,9 @@ class GameBoyMode(Enum):
class
GameBoy
:
class
GameBoy
:
_frame_index
:
int
=
0
_frame_index
:
int
=
0
_start_frame
:
int
|
None
_start_frame
:
Union
[
int
,
None
]
_frame_gap
:
int
_frame_gap
:
int
_capture_temp_dir
:
str
|
None
_capture_temp_dir
:
Union
[
str
,
None
]
def
__init__
(
def
__init__
(
self
,
self
,
...
@@ -195,7 +195,7 @@ This is a [Game Boy](https://en.wikipedia.org/wiki/Game_Boy) emulator built usin
...
@@ -195,7 +195,7 @@ This is a [Game Boy](https://en.wikipedia.org/wiki/Game_Boy) emulator built usin
def
_on_next_frame
(
self
):
def
_on_next_frame
(
self
):
if
self
.
_next_frame
!=
None
and
self
.
_frame_index
>=
self
.
_next_frame
:
if
self
.
_next_frame
!=
None
and
self
.
_frame_index
>=
self
.
_next_frame
:
self
.
_next_frame
=
self
.
_next_frame
+
self
.
_frame_gap
self
.
_next_frame
=
self
.
_next_frame
+
self
.
_frame_gap
self
.
save_image
(
f
"
{
self
.
_capture_temp_dir
}
/frame_
{
self
.
_frame_index
}
.png
"
)
self
.
save_image
(
f
"
{
self
.
_capture_temp_dir
}
/frame_
{
self
.
_frame_index
:
08
d
}
.png
"
)
def
_start_capture
(
self
,
fps
=
5
):
def
_start_capture
(
self
,
fps
=
5
):
self
.
_next_frame
=
self
.
_frame_index
+
self
.
_frame_gap
self
.
_next_frame
=
self
.
_frame_index
+
self
.
_frame_gap
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment