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
e4b3cf16
Verified
Commit
e4b3cf16
authored
1 year ago
by
João Magalhães
Browse files
Options
Downloads
Patches
Plain Diff
chore: added step_to operation
parent
b5b17094
No related branches found
No related tags found
1 merge request
!37
Improved support for PyBoy interface
Pipeline
#3691
passed
1 year ago
Stage: build
Stage: test
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/gb.rs
+11
-0
11 additions, 0 deletions
src/gb.rs
src/py.rs
+4
-0
4 additions, 0 deletions
src/py.rs
src/python/boytacean/boytacean.pyi
+1
-0
1 addition, 0 deletions
src/python/boytacean/boytacean.pyi
src/python/boytacean/gb.py
+3
-0
3 additions, 0 deletions
src/python/boytacean/gb.py
with
19 additions
and
0 deletions
src/gb.rs
+
11
−
0
View file @
e4b3cf16
...
@@ -499,6 +499,17 @@ impl GameBoy {
...
@@ -499,6 +499,17 @@ impl GameBoy {
cycles
cycles
}
}
pub
fn
step_to
(
&
mut
self
,
addr
:
u16
)
->
u32
{
let
mut
cycles
=
0u32
;
loop
{
cycles
+=
self
.clock
()
as
u32
;
if
self
.cpu_i
()
.pc
()
==
addr
{
break
;
}
}
cycles
}
pub
fn
key_press
(
&
mut
self
,
key
:
PadKey
)
{
pub
fn
key_press
(
&
mut
self
,
key
:
PadKey
)
{
self
.pad
()
.key_press
(
key
);
self
.pad
()
.key_press
(
key
);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/py.rs
+
4
−
0
View file @
e4b3cf16
...
@@ -76,6 +76,10 @@ impl GameBoy {
...
@@ -76,6 +76,10 @@ impl GameBoy {
self
.system
.next_frame
()
self
.system
.next_frame
()
}
}
pub
fn
step_to
(
&
mut
self
,
addr
:
u16
)
->
u32
{
self
.system
.step_to
(
addr
)
}
pub
fn
key_press
(
&
mut
self
,
key
:
u8
)
{
pub
fn
key_press
(
&
mut
self
,
key
:
u8
)
{
self
.system
.key_press
(
PadKey
::
from_u8
(
key
))
self
.system
.key_press
(
PadKey
::
from_u8
(
key
))
}
}
...
...
This diff is collapsed.
Click to expand it.
src/python/boytacean/boytacean.pyi
+
1
−
0
View file @
e4b3cf16
...
@@ -19,6 +19,7 @@ class GameBoy:
...
@@ -19,6 +19,7 @@ class GameBoy:
def
clock_m
(
self
,
count
:
int
)
->
int
:
...
def
clock_m
(
self
,
count
:
int
)
->
int
:
...
def
clocks
(
self
,
count
:
int
)
->
int
:
...
def
clocks
(
self
,
count
:
int
)
->
int
:
...
def
next_frame
(
self
)
->
int
:
...
def
next_frame
(
self
)
->
int
:
...
def
step_to
(
self
,
addr
:
int
)
->
int
:
...
def
key_press
(
self
,
key
:
int
):
...
def
key_press
(
self
,
key
:
int
):
...
def
key_lift
(
self
,
key
:
int
):
...
def
key_lift
(
self
,
key
:
int
):
...
def
frame_buffer
(
self
)
->
bytes
:
...
def
frame_buffer
(
self
)
->
bytes
:
...
...
...
This diff is collapsed.
Click to expand it.
src/python/boytacean/gb.py
+
3
−
0
View file @
e4b3cf16
...
@@ -110,6 +110,9 @@ This is a [Game Boy](https://en.wikipedia.org/wiki/Game_Boy) emulator built usin
...
@@ -110,6 +110,9 @@ This is a [Game Boy](https://en.wikipedia.org/wiki/Game_Boy) emulator built usin
self
.
_on_next_frame
()
self
.
_on_next_frame
()
return
cycles
return
cycles
def
step_to
(
self
,
addr
:
int
)
->
int
:
return
self
.
_system
.
step_to
(
addr
)
def
skip_frames
(
self
,
count
:
int
)
->
int
:
def
skip_frames
(
self
,
count
:
int
)
->
int
:
cycles
=
0
cycles
=
0
for
_
in
range
(
count
):
for
_
in
range
(
count
):
...
...
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