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
e296c2a2
Verified
Commit
e296c2a2
authored
1 year ago
by
João Magalhães
Browse files
Options
Downloads
Patches
Plain Diff
chore: new WASM code fix
parent
771d1cb4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!25
Game Genie support
Pipeline
#2876
passed
1 year ago
Stage: build
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/genie.rs
+4
-0
4 additions, 0 deletions
src/genie.rs
src/rom.rs
+10
-12
10 additions, 12 deletions
src/rom.rs
with
14 additions
and
12 deletions
src/genie.rs
+
4
−
0
View file @
e296c2a2
...
@@ -3,7 +3,11 @@ use std::{
...
@@ -3,7 +3,11 @@ use std::{
fmt
::{
self
,
Display
,
Formatter
},
fmt
::{
self
,
Display
,
Formatter
},
};
};
#[cfg(feature
=
"wasm"
)]
use
wasm_bindgen
::
prelude
::
*
;
#[derive(Clone)]
#[derive(Clone)]
#[cfg_attr(feature
=
"wasm"
,
wasm_bindgen)]
pub
struct
GameGenie
{
pub
struct
GameGenie
{
/// Hash map that contains the complete set of Game Genie
/// Hash map that contains the complete set of Game Genie
/// codes that have been registered for the current ROM.
/// codes that have been registered for the current ROM.
...
...
This diff is collapsed.
Click to expand it.
src/rom.rs
+
10
−
12
View file @
e296c2a2
...
@@ -564,6 +564,16 @@ impl Cartridge {
...
@@ -564,6 +564,16 @@ impl Cartridge {
self
.ram_data
=
ram_data
;
self
.ram_data
=
ram_data
;
}
}
pub
fn
attach_genie
(
&
mut
self
,
game_genie
:
GameGenie
)
{
self
.game_genie
=
Some
(
game_genie
);
self
.handler
=
&
GAME_GENIE
;
}
pub
fn
detach_genie
(
&
mut
self
)
{
self
.game_genie
=
None
;
self
.handler
=
self
.mbc
;
}
pub
fn
description
(
&
self
,
column_length
:
usize
)
->
String
{
pub
fn
description
(
&
self
,
column_length
:
usize
)
->
String
{
let
name_l
=
format!
(
"{:width$}"
,
"Name"
,
width
=
column_length
);
let
name_l
=
format!
(
"{:width$}"
,
"Name"
,
width
=
column_length
);
let
type_l
=
format!
(
"{:width$}"
,
"Type"
,
width
=
column_length
);
let
type_l
=
format!
(
"{:width$}"
,
"Type"
,
width
=
column_length
);
...
@@ -586,18 +596,6 @@ impl Cartridge {
...
@@ -586,18 +596,6 @@ impl Cartridge {
}
}
}
}
impl
Cartridge
{
pub
fn
attach_genie
(
&
mut
self
,
game_genie
:
GameGenie
)
{
self
.game_genie
=
Some
(
game_genie
);
self
.handler
=
&
GAME_GENIE
;
}
pub
fn
detach_genie
(
&
mut
self
)
{
self
.game_genie
=
None
;
self
.handler
=
self
.mbc
;
}
}
impl
Default
for
Cartridge
{
impl
Default
for
Cartridge
{
fn
default
()
->
Self
{
fn
default
()
->
Self
{
Self
::
new
()
Self
::
new
()
...
...
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