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
40a7d70e
Verified
Commit
40a7d70e
authored
1 year ago
by
João Magalhães
Browse files
Options
Downloads
Patches
Plain Diff
chore: support for pending cycles
parent
706af2b1
No related branches found
No related tags found
1 merge request
!29
Support for Libretro
Pipeline
#3102
passed
1 year ago
Stage: build
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
frontends/libretro/src/lib.rs
+3
-2
3 additions, 2 deletions
frontends/libretro/src/lib.rs
with
3 additions
and
2 deletions
frontends/libretro/src/lib.rs
+
3
−
2
View file @
40a7d70e
...
...
@@ -30,6 +30,7 @@ use crate::consts::{REGION_NTSC, RETRO_API_VERSION};
static
mut
EMULATOR
:
Option
<
GameBoy
>
=
None
;
static
mut
KEY_STATES
:
Option
<
HashMap
<
RetroJoypad
,
bool
>>
=
None
;
static
mut
FRAME_BUFFER
:
[
u8
;
FRAME_BUFFER_RGB155_SIZE
]
=
[
0x00
;
FRAME_BUFFER_RGB155_SIZE
];
static
mut
PENDING_CYCLES
:
u32
=
0_u32
;
static
mut
ENVIRONMENT_CALLBACK
:
Option
<
extern
"C"
fn
(
u32
,
*
const
c_void
)
->
bool
>
=
None
;
static
mut
VIDEO_REFRESH_CALLBACK
:
Option
<
extern
"C"
fn
(
*
const
u8
,
c_uint
,
c_uint
,
usize
)
>
=
None
;
...
...
@@ -220,7 +221,7 @@ pub extern "C" fn retro_run() {
let
mut
last_frame
=
emulator
.ppu_frame
();
let
mut
counter_cycles
=
0_u32
;
let
mut
counter_cycles
=
unsafe
{
PENDING_CYCLES
}
;
let
cycle_limit
=
(
GameBoy
::
CPU_FREQ
as
f32
*
emulator
.multiplier
()
as
f32
/
GameBoy
::
VISUAL_FREQ
)
.round
()
as
u32
;
...
...
@@ -229,7 +230,7 @@ pub extern "C" fn retro_run() {
// limits the number of ticks to the typical number
// of cycles expected for the current logic cycle
if
counter_cycles
>=
cycle_limit
{
//pending_cycles
= counter_cycles - cycle_limit;
unsafe
{
PENDING_CYCLES
=
counter_cycles
-
cycle_limit
}
;
break
;
}
...
...
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