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
19cd89f0
Verified
Commit
19cd89f0
authored
2 years ago
by
João Magalhães
Browse files
Options
Downloads
Patches
Plain Diff
feat: rom extension format
parent
a2d3171a
No related branches found
No related tags found
No related merge requests found
Pipeline
#1498
passed
2 years ago
Stage: build
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
examples/web/index.ts
+4
-1
4 additions, 1 deletion
examples/web/index.ts
examples/web/react/app.tsx
+8
-3
8 additions, 3 deletions
examples/web/react/app.tsx
with
12 additions
and
4 deletions
examples/web/index.ts
+
4
−
1
View file @
19cd89f0
...
...
@@ -338,7 +338,6 @@ class GameboyEmulator extends EmulatorBase implements Emulator {
this
.
trigger
(
"
booted
"
);
}
// @todo remove this method, or at least most of it
async
register
()
{
await
Promise
.
all
([
this
.
registerKeys
()]);
}
...
...
@@ -410,6 +409,10 @@ class GameboyEmulator extends EmulatorBase implements Emulator {
return
"
https://gitlab.stage.hive.pt/joamag/boytacean/-/blob/master/CHANGELOG.md
"
;
}
get
romExts
():
string
[]
{
return
[
"
gb
"
];
}
get
pixelFormat
():
PixelFormat
{
return
PixelFormat
.
RGB
;
}
...
...
This diff is collapsed.
Click to expand it.
examples/web/react/app.tsx
+
8
−
3
View file @
19cd89f0
...
...
@@ -130,6 +130,12 @@ export interface Emulator extends ObservableI {
*/
get
engine
():
string
|
null
;
/**
* The complete set of file extensions that this emulator
* supports.
*/
get
romExts
():
string
[];
/**
* The pixel format of the emulator's display
* image buffer (eg: RGB).
...
...
@@ -363,9 +369,8 @@ export const App: FC<AppProps> = ({
};
const
onFile
=
async
(
file
:
File
)
=>
{
// @todo must make this more flexible and not just
// Game Boy only (using the emulator interface)
if
(
!
file
.
name
.
endsWith
(
"
.gb
"
))
{
const
fileExtension
=
file
.
name
.
split
(
"
.
"
).
pop
()
??
""
;
if
(
!
emulator
.
romExts
.
includes
(
fileExtension
))
{
showToast
(
`This is probably not a
${
emulator
.
device
}
ROM file!`
,
true
...
...
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