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
73b75c56
Verified
Commit
73b75c56
authored
1 year ago
by
João Magalhães
Browse files
Options
Downloads
Patches
Plain Diff
chore: simplified code
parent
19ce9f0c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!29
Support for Libretro
Pipeline
#3051
failed
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
+12
-19
12 additions, 19 deletions
frontends/libretro/src/lib.rs
with
12 additions
and
19 deletions
frontends/libretro/src/lib.rs
+
12
−
19
View file @
73b75c56
#![allow(clippy::uninlined_format_args)]
use
std
::
os
::
raw
::{
c_char
,
c_void
};
use
std
::
os
::
raw
::{
c_char
,
c_void
,
c_uint
};
const
RETRO_API_VERSION
:
u32
=
1
;
...
...
@@ -43,10 +43,11 @@ pub struct retro_system_api {
#[no_mangle]
extern
"C"
fn
retro_get_system_info
(
info
:
*
mut
retro_system_info
)
{
println!
(
"retro_get_system_info"
);
unsafe
{
(
*
info
)
.library_name
=
"Boytacean
\0
"
.as_ptr
()
as
*
const
c_char
;
(
*
info
)
.library_version
=
"0.9.6
\0
"
.as_ptr
()
as
*
const
c_char
;
(
*
info
)
.valid_extensions
=
"gb
\0
gbc
\0
\0
"
.as_ptr
()
as
*
const
c_char
;
(
*
info
)
.library_version
=
"
v
0.9.6
\0
"
.as_ptr
()
as
*
const
c_char
;
(
*
info
)
.valid_extensions
=
"gb
|
gbc
\0
"
.as_ptr
()
as
*
const
c_char
;
(
*
info
)
.need_fullpath
=
false
;
(
*
info
)
.block_extract
=
false
;
}
...
...
@@ -61,26 +62,18 @@ extern "C" fn retro_set_environment(
// For example, you might handle system RAM allocation using this function
}
// Add other core functions here as needed
// Call this function to initialize the libretro core
#[no_mangle]
pub
extern
"C"
fn
retro_api_version
()
->
u32
{
pub
extern
"C"
fn
retro_api_version
()
->
c_uint
{
println!
(
"retro_api_version()"
);
RETRO_API_VERSION
}
// Define other core functions here as needed
// Add your Game Boy emulator code here
// ...
// Entry point for the libretro core
#[no_mangle]
pub
extern
"C"
fn
retro_init
()
{}
// Other libretro core functions
// ...
pub
extern
"C"
fn
retro_init
()
{
println!
(
"retro_init()"
);
}
// Entry point to deinitialize the libretro core
#[no_mangle]
pub
extern
"C"
fn
retro_deinit
()
{}
pub
extern
"C"
fn
retro_deinit
()
{
println!
(
"retro_deinit()"
);
}
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