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
f95fd229
Verified
Commit
f95fd229
authored
1 year ago
by
João Magalhães
Browse files
Options
Downloads
Patches
Plain Diff
chore: new serial control
parent
1e30737e
No related branches found
No related tags found
1 merge request
!36
Support for Python
Pipeline
#3602
passed
1 year ago
Stage: build
Stage: test
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
examples/python/pocket.py
+1
-1
1 addition, 1 deletion
examples/python/pocket.py
src/py.rs
+8
-0
8 additions, 0 deletions
src/py.rs
src/python/boytacean/__init__.py
+9
-1
9 additions, 1 deletion
src/python/boytacean/__init__.py
with
18 additions
and
2 deletions
examples/python/pocket.py
+
1
−
1
View file @
f95fd229
...
...
@@ -3,7 +3,7 @@ from boytacean import GameBoy
FRAME_COUNT
=
12000
gb
=
GameBoy
(
apu_enabled
=
False
)
gb
=
GameBoy
(
apu_enabled
=
False
,
serial_enabled
=
False
)
gb
.
load
()
gb
.
load_rom
(
"
../../res/roms/demo/pocket.gb
"
)
start
=
time
()
...
...
This diff is collapsed.
Click to expand it.
src/py.rs
+
8
−
0
View file @
f95fd229
...
...
@@ -59,6 +59,14 @@ impl GameBoy {
pub
fn
set_apu_enabled
(
&
mut
self
,
value
:
bool
)
{
self
.system
.set_apu_enabled
(
value
);
}
pub
fn
serial_enabled
(
&
self
)
->
bool
{
self
.system
.serial_enabled
()
}
pub
fn
set_serial_enabled
(
&
mut
self
,
value
:
bool
)
{
self
.system
.set_serial_enabled
(
value
);
}
}
#[pymodule]
...
...
This diff is collapsed.
Click to expand it.
src/python/boytacean/__init__.py
+
9
−
1
View file @
f95fd229
...
...
@@ -4,10 +4,11 @@ from .boytacean import DISPLAY_WIDTH, DISPLAY_HEIGHT, GameBoy as GameBoyRust
class
GameBoy
:
def
__init__
(
self
,
apu_enabled
=
True
):
def
__init__
(
self
,
apu_enabled
=
True
,
serial_enabled
=
True
):
super
().
__init__
()
self
.
_system
=
GameBoyRust
()
self
.
_system
.
set_apu_enabled
(
apu_enabled
)
self
.
_system
.
set_serial_enabled
(
serial_enabled
)
def
load
(
self
):
self
.
_system
.
load
()
...
...
@@ -43,3 +44,10 @@ class GameBoy:
def
set_apu_enabled
(
self
,
value
:
bool
):
self
.
_system
.
set_apu_enabled
(
value
)
@property
def
serial_enabled
(
self
)
->
bool
:
return
self
.
_system
.
serial_enabled
()
def
set_serial_enabled
(
self
,
value
:
bool
):
self
.
_system
.
set_serial_enabled
(
value
)
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