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
7e2c0881
Verified
Commit
7e2c0881
authored
2 years ago
by
João Magalhães
Browse files
Options
Downloads
Patches
Plain Diff
refactor: small set of fixes
parent
571f43d1
No related branches found
No related tags found
No related merge requests found
Pipeline
#1733
passed
2 years ago
Stage: build
Stage: test
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
frontends/web/nodemon.json
+1
-1
1 addition, 1 deletion
frontends/web/nodemon.json
frontends/web/ts/gb.ts
+18
-3
18 additions, 3 deletions
frontends/web/ts/gb.ts
with
19 additions
and
4 deletions
frontends/web/nodemon.json
+
1
−
1
View file @
7e2c0881
{
"ext"
:
"js,ts,jsx,tsx,mjs,json"
,
"ext"
:
"js,ts,jsx,tsx,mjs,
css,
json"
,
"ignore"
:
[
"dist"
,
".parcel-cache"
],
"ignoreRoot"
:
[
".git"
]
}
This diff is collapsed.
Click to expand it.
frontends/web/ts/gb.ts
+
18
−
3
View file @
7e2c0881
...
...
@@ -4,7 +4,8 @@ import {
Entry
,
Feature
,
PixelFormat
,
RomInfo
RomInfo
,
Size
}
from
"
emukit
"
;
import
{
PALETTES
,
PALETTES_MAP
}
from
"
./palettes
"
;
...
...
@@ -25,6 +26,10 @@ const LOGIC_HZ = 4194304;
const
VISUAL_HZ
=
59.7275
;
const
IDLE_HZ
=
10
;
const
DISPLAY_WIDTH
=
160
;
const
DISPLAY_HEIGHT
=
144
;
const
DISPLAY_SCALE
=
2
;
/**
* The rate at which the local storage RAM state flush
* operation is going to be performed, this value is the
...
...
@@ -285,7 +290,9 @@ export class GameboyEmulator extends EmulatorBase implements Emulator {
// in case a remote ROM loading operation has been
// requested then loads it from the remote origin
if
(
loadRom
)
{
({
name
:
romName
,
data
:
romData
}
=
await
this
.
fetchRom
(
romPath
));
({
name
:
romName
,
data
:
romData
}
=
await
GameboyEmulator
.
fetchRom
(
romPath
));
}
else
if
(
romName
===
null
||
romData
===
null
)
{
[
romName
,
romData
]
=
[
this
.
romName
,
this
.
romData
];
}
...
...
@@ -397,6 +404,14 @@ export class GameboyEmulator extends EmulatorBase implements Emulator {
return
PixelFormat
.
RGB
;
}
get
dimensions
():
Size
{
return
{
width
:
DISPLAY_WIDTH
,
height
:
DISPLAY_HEIGHT
,
scale
:
DISPLAY_SCALE
};
}
/**
* Returns the array buffer that contains the complete set of
* pixel data that is going to be drawn.
...
...
@@ -559,7 +574,7 @@ export class GameboyEmulator extends EmulatorBase implements Emulator {
this
.
gameBoy
?.
set_palette_colors_ws
(
palette
.
colors
);
}
private
async
fetchRom
(
private
static
async
fetchRom
(
romPath
:
string
):
Promise
<
{
name
:
string
;
data
:
Uint8Array
}
>
{
// extracts the name of the ROM from the provided
...
...
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