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
2463f23e
Verified
Commit
2463f23e
authored
2 years ago
by
João Magalhães
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' into joamag/color
parents
11f7f1b1
5102df98
No related branches found
No related tags found
1 merge request
!16
Support for Game Boy Color (CGB) 😎🖍️
Pipeline
#1630
passed
2 years ago
Stage: build
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
README.md
+2
-1
2 additions, 1 deletion
README.md
frontends/web/index.ts
+1
-1
1 addition, 1 deletion
frontends/web/index.ts
src/ppu.rs
+2
-2
2 additions, 2 deletions
src/ppu.rs
src/rom.rs
+14
-14
14 additions, 14 deletions
src/rom.rs
with
19 additions
and
18 deletions
README.md
+
2
−
1
View file @
2463f23e
...
...
@@ -57,8 +57,9 @@ You can use some GET parameters to control the initial behaviour of the emulator
| Parameter | Type | Description |
| ------------ | ------- | ---------------------------------------------------------------------------------------------- |
|
`rom_url`
| String | The URL from which the initial ROM is going to be loaded, should support CORS. |
|
`url`
| String | The same as
`url`
.
|
|
`url`
| String | The same as
`
rom_
url`
. |
|
`fullscreen`
| Boolean | If the emulator should start in fullscreen mode. |
|
`fs`
| Boolean | The same as
`fullscreen`
. |
|
`debug`
| Boolean | If the "debugger" should start visible. |
|
`keyboard`
| Boolean | If the on screen keyboard should start visible. |
|
`palette`
| String | The name of the palette to be set at startup( eg:
`christmas`
,
`hogwards`
,
`mariobros`
, etc.). |
...
...
This diff is collapsed.
Click to expand it.
frontends/web/index.ts
+
1
−
1
View file @
2463f23e
...
...
@@ -17,7 +17,7 @@ const BACKGROUNDS = [
const
params
=
new
URLSearchParams
(
window
.
location
.
search
);
const
romUrl
=
params
.
get
(
"
rom_url
"
)
??
params
.
get
(
"
url
"
)
??
undefined
;
const
fullscreen
=
[
"
1
"
,
"
true
"
,
"
True
"
].
includes
(
params
.
get
(
"
fullscreen
"
)
??
""
params
.
get
(
"
fullscreen
"
)
??
params
.
get
(
"
fs
"
)
??
""
);
const
debug
=
[
"
1
"
,
"
true
"
,
"
True
"
].
includes
(
params
.
get
(
"
debug
"
)
??
""
);
const
keyboard
=
[
"
1
"
,
"
true
"
,
"
True
"
].
includes
(
...
...
This diff is collapsed.
Click to expand it.
src/ppu.rs
+
2
−
2
View file @
2463f23e
...
...
@@ -940,10 +940,10 @@ impl Ppu {
/// This method should be called whenever the palette indexes
/// are changed.
fn
compute_palette
(
palette
:
&
mut
Palette
,
palette_colors
:
&
Palette
,
value
:
u8
)
{
for
index
in
0
..
PALETTE_SIZE
{
for
(
index
,
palette_item
)
in
palette
.iter_mut
()
.enumerate
()
{
let
color_index
:
usize
=
(
value
as
usize
>>
(
index
*
2
))
&
3
;
match
color_index
{
0
..=
3
=>
palette
[
index
]
=
palette_colors
[
color_index
],
0
..=
3
=>
*
palette
_item
=
palette_colors
[
color_index
],
color_index
=>
panic!
(
"Invalid palette color index {:04x}"
,
color_index
),
}
}
...
...
This diff is collapsed.
Click to expand it.
src/rom.rs
+
14
−
14
View file @
2463f23e
...
...
@@ -412,20 +412,20 @@ impl Cartridge {
}
pub
fn
has_battery
(
&
self
)
->
bool
{
match
self
.rom_type
()
{
RomType
::
Mbc1RamBattery
=>
true
,
RomType
::
Mbc
2
Battery
=>
true
,
RomType
::
RomRam
Battery
=>
true
,
RomType
::
Mmm01
RamBattery
=>
true
,
RomType
::
M
bc3TimerBattery
=>
true
,
RomType
::
Mbc3Timer
Ram
Battery
=>
true
,
RomType
::
Mbc3RamBattery
=>
true
,
RomType
::
Mbc
5
RamBattery
=>
true
,
RomType
::
Mbc5R
umbleR
amBattery
=>
true
,
RomType
::
Mbc
7Sensor
RumbleRamBattery
=>
true
,
RomType
::
HuC1
RamBattery
=>
true
,
_
=>
false
,
}
return
matches!
(
self
.rom_type
()
,
RomType
::
Mbc
1Ram
Battery
|
RomType
::
Mbc2
Battery
|
RomType
::
Rom
RamBattery
|
RomType
::
M
mm01RamBattery
|
RomType
::
Mbc3TimerBattery
|
RomType
::
Mbc3
Timer
RamBattery
|
RomType
::
Mbc
3
RamBattery
|
RomType
::
Mbc5RamBattery
|
RomType
::
Mbc
5
RumbleRamBattery
|
RomType
::
Mbc7SensorRumble
RamBattery
|
RomType
::
HuC1RamBattery
);
}
pub
fn
ram_data_eager
(
&
self
)
->
Vec
<
u8
>
{
...
...
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