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
0cc09f02
Verified
Commit
0cc09f02
authored
1 year ago
by
João Magalhães
Browse files
Options
Downloads
Patches
Plain Diff
chore: improved access to name and version
parent
27500c52
No related branches found
No related tags found
1 merge request
!31
System state save
Pipeline
#3218
failed
1 year ago
Stage: build
Stage: test
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
frontends/libretro/src/lib.rs
+3
-4
3 additions, 4 deletions
frontends/libretro/src/lib.rs
frontends/sdl/src/main.rs
+4
-4
4 additions, 4 deletions
frontends/sdl/src/main.rs
src/state.rs
+0
-1
0 additions, 1 deletion
src/state.rs
with
7 additions
and
9 deletions
frontends/libretro/src/lib.rs
+
3
−
4
View file @
0cc09f02
...
@@ -5,11 +5,10 @@ pub mod consts;
...
@@ -5,11 +5,10 @@ pub mod consts;
use
boytacean
::{
use
boytacean
::{
debugln
,
debugln
,
gb
::{
AudioProvider
,
GameBoy
},
gb
::{
AudioProvider
,
GameBoy
},
gen
::{
NAME
,
VERSION
},
info
::{
name
,
version
},
pad
::
PadKey
,
pad
::
PadKey
,
ppu
::{
DISPLAY_HEIGHT
,
DISPLAY_WIDTH
,
FRAME_BUFFER_SIZE
,
XRGB8888_SIZE
},
ppu
::{
DISPLAY_HEIGHT
,
DISPLAY_WIDTH
,
FRAME_BUFFER_SIZE
,
XRGB8888_SIZE
},
rom
::
Cartridge
,
rom
::
Cartridge
,
util
::
capitalize
,
};
};
use
consts
::{
use
consts
::{
REGION_NTSC
,
RETRO_API_VERSION
,
RETRO_DEVICE_ID_JOYPAD_A
,
RETRO_DEVICE_ID_JOYPAD_B
,
REGION_NTSC
,
RETRO_API_VERSION
,
RETRO_DEVICE_ID_JOYPAD_A
,
RETRO_DEVICE_ID_JOYPAD_B
,
...
@@ -174,8 +173,8 @@ pub extern "C" fn retro_reset() {
...
@@ -174,8 +173,8 @@ pub extern "C" fn retro_reset() {
#[no_mangle]
#[no_mangle]
pub
unsafe
extern
"C"
fn
retro_get_system_info
(
info
:
*
mut
RetroSystemInfo
)
{
pub
unsafe
extern
"C"
fn
retro_get_system_info
(
info
:
*
mut
RetroSystemInfo
)
{
debugln!
(
"retro_get_system_info()"
);
debugln!
(
"retro_get_system_info()"
);
(
*
info
)
.library_name
=
format!
(
"{}
\0
"
,
capitalize
(
NAME
))
.as_ptr
()
as
*
const
c_char
;
(
*
info
)
.library_name
=
format!
(
"{}
\0
"
,
name
(
))
.as_ptr
()
as
*
const
c_char
;
(
*
info
)
.library_version
=
format!
(
"v{}
\0
"
,
VERSION
)
.as_ptr
()
as
*
const
c_char
;
(
*
info
)
.library_version
=
format!
(
"v{}
\0
"
,
version
()
)
.as_ptr
()
as
*
const
c_char
;
(
*
info
)
.valid_extensions
=
"gb|gbc
\0
"
.as_ptr
()
as
*
const
c_char
;
(
*
info
)
.valid_extensions
=
"gb|gbc
\0
"
.as_ptr
()
as
*
const
c_char
;
(
*
info
)
.need_fullpath
=
false
;
(
*
info
)
.need_fullpath
=
false
;
(
*
info
)
.block_extract
=
false
;
(
*
info
)
.block_extract
=
false
;
...
...
This diff is collapsed.
Click to expand it.
frontends/sdl/src/main.rs
+
4
−
4
View file @
0cc09f02
...
@@ -9,13 +9,13 @@ use audio::Audio;
...
@@ -9,13 +9,13 @@ use audio::Audio;
use
boytacean
::{
use
boytacean
::{
devices
::{
printer
::
PrinterDevice
,
stdout
::
StdoutDevice
},
devices
::{
printer
::
PrinterDevice
,
stdout
::
StdoutDevice
},
gb
::{
AudioProvider
,
GameBoy
,
GameBoyMode
},
gb
::{
AudioProvider
,
GameBoy
,
GameBoyMode
},
gen
::{
NAME
,
VERSION
},
info
::{
name
,
version
},
pad
::
PadKey
,
pad
::
PadKey
,
ppu
::
PaletteInfo
,
ppu
::
PaletteInfo
,
rom
::
Cartridge
,
rom
::
Cartridge
,
serial
::{
NullDevice
,
SerialDevice
},
serial
::{
NullDevice
,
SerialDevice
},
state
::
save_state_file
,
state
::
save_state_file
,
util
::{
capitalize
,
replace_ext
,
write_file
},
util
::{
replace_ext
,
write_file
},
};
};
use
chrono
::
Utc
;
use
chrono
::
Utc
;
use
clap
::
Parser
;
use
clap
::
Parser
;
...
@@ -95,7 +95,7 @@ impl Emulator {
...
@@ -95,7 +95,7 @@ impl Emulator {
unlimited
:
options
.unlimited
.unwrap_or
(
false
),
unlimited
:
options
.unlimited
.unwrap_or
(
false
),
sdl
:
None
,
sdl
:
None
,
audio
:
None
,
audio
:
None
,
title
:
format!
(
"{} v{}"
,
capitalize
(
NAME
),
VERSION
),
title
:
format!
(
"{} v{}"
,
name
(),
version
()
),
rom_path
:
String
::
from
(
"invalid"
),
rom_path
:
String
::
from
(
"invalid"
),
ram_path
:
String
::
from
(
"invalid"
),
ram_path
:
String
::
from
(
"invalid"
),
logic_frequency
:
GameBoy
::
CPU_FREQ
,
logic_frequency
:
GameBoy
::
CPU_FREQ
,
...
@@ -826,7 +826,7 @@ fn main() {
...
@@ -826,7 +826,7 @@ fn main() {
game_boy
.load
(
!
args
.no_boot
);
game_boy
.load
(
!
args
.no_boot
);
// prints the current version of the emulator (informational message)
// prints the current version of the emulator (informational message)
println!
(
"========= {} =========
\n
{}"
,
capitalize
(
NAME
),
game_boy
);
println!
(
"========= {} =========
\n
{}"
,
name
(
),
game_boy
);
// creates a new generic emulator structure then starts
// creates a new generic emulator structure then starts
// both the video and audio sub-systems, loads default
// both the video and audio sub-systems, loads default
...
...
This diff is collapsed.
Click to expand it.
src/state.rs
+
0
−
1
View file @
0cc09f02
...
@@ -7,7 +7,6 @@ use std::{
...
@@ -7,7 +7,6 @@ use std::{
use
crate
::{
use
crate
::{
gb
::
GameBoy
,
gb
::
GameBoy
,
info
::{
name
,
version
},
info
::{
name
,
version
},
util
::
capitalize
,
};
};
pub
trait
Serialize
{
pub
trait
Serialize
{
...
...
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