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
8d87d9ef
Verified
Commit
8d87d9ef
authored
2 years ago
by
João Magalhães
Browse files
Options
Downloads
Patches
Plain Diff
feat: support for waveform plotting
Also fixed small channel 3 issue
parent
8376919f
No related branches found
No related tags found
1 merge request
!20
Support for waveform plotting
Pipeline
#2405
passed
2 years ago
Stage: build
Stage: test
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
CHANGELOG.md
+2
-0
2 additions, 0 deletions
CHANGELOG.md
frontends/web/ts/gb.ts
+12
-0
12 additions, 0 deletions
frontends/web/ts/gb.ts
src/apu.rs
+13
-1
13 additions, 1 deletion
src/apu.rs
src/gb.rs
+25
-0
25 additions, 0 deletions
src/gb.rs
with
52 additions
and
1 deletion
CHANGELOG.md
+
2
−
0
View file @
8d87d9ef
...
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
...
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
### Added
*
Support for CGB flag parsing
*
Support for CGB flag parsing
*
Waveform plotting support
### Changed
### Changed
...
@@ -18,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
...
@@ -18,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
### Fixed
*
Major JoyPad issue with Action/Select read in register
*
Major JoyPad issue with Action/Select read in register
*
Small issue with channel 3 audio and DAC disable
## [0.7.2] - 2023-03-04
## [0.7.2] - 2023-03-04
...
...
This diff is collapsed.
Click to expand it.
frontends/web/ts/gb.ts
+
12
−
0
View file @
8d87d9ef
...
@@ -606,6 +606,18 @@ export class GameboyEmulator extends EmulatorBase implements Emulator {
...
@@ -606,6 +606,18 @@ export class GameboyEmulator extends EmulatorBase implements Emulator {
};
};
}
}
get
audioOutput
():
Record
<
string
,
number
>
{
const
output
=
this
.
gameBoy
?.
audio_all_output
();
if
(
!
output
)
return
{};
return
{
master
:
output
[
0
],
ch1
:
output
[
1
],
ch2
:
output
[
2
],
ch3
:
output
[
3
],
ch4
:
0
};
}
get
palette
():
string
|
undefined
{
get
palette
():
string
|
undefined
{
const
paletteObj
=
PALETTES
[
this
.
paletteIndex
];
const
paletteObj
=
PALETTES
[
this
.
paletteIndex
];
return
paletteObj
.
name
;
return
paletteObj
.
name
;
...
...
This diff is collapsed.
Click to expand it.
src/apu.rs
+
13
−
1
View file @
8d87d9ef
...
@@ -348,6 +348,18 @@ impl Apu {
...
@@ -348,6 +348,18 @@ impl Apu {
self
.ch1_output
+
self
.ch2_output
+
self
.ch3_output
self
.ch1_output
+
self
.ch2_output
+
self
.ch3_output
}
}
pub
fn
ch1_output
(
&
self
)
->
u8
{
self
.ch1_output
}
pub
fn
ch2_output
(
&
self
)
->
u8
{
self
.ch2_output
}
pub
fn
ch3_output
(
&
self
)
->
u8
{
self
.ch3_output
}
pub
fn
audio_buffer
(
&
self
)
->
&
VecDeque
<
u8
>
{
pub
fn
audio_buffer
(
&
self
)
->
&
VecDeque
<
u8
>
{
&
self
.audio_buffer
&
self
.audio_buffer
}
}
...
@@ -526,7 +538,7 @@ impl Apu {
...
@@ -526,7 +538,7 @@ impl Apu {
return
;
return
;
}
}
if
self
.ch3_enabled
{
if
self
.ch3_enabled
&&
self
.ch3_dac
{
let
wave_index
=
self
.ch3_position
>>
1
;
let
wave_index
=
self
.ch3_position
>>
1
;
let
mut
output
=
self
.wave_ram
[
wave_index
as
usize
];
let
mut
output
=
self
.wave_ram
[
wave_index
as
usize
];
output
=
if
(
self
.ch3_position
&
0x01
)
==
0x01
{
output
=
if
(
self
.ch3_position
&
0x01
)
==
0x01
{
...
...
This diff is collapsed.
Click to expand it.
src/gb.rs
+
25
−
0
View file @
8d87d9ef
...
@@ -189,6 +189,31 @@ impl GameBoy {
...
@@ -189,6 +189,31 @@ impl GameBoy {
buffer
buffer
}
}
pub
fn
audio_output
(
&
self
)
->
u8
{
self
.apu_i
()
.output
()
}
pub
fn
audio_all_output
(
&
self
)
->
Vec
<
u8
>
{
vec!
[
self
.audio_output
(),
self
.audio_ch1_output
(),
self
.audio_ch2_output
(),
self
.audio_ch3_output
(),
]
}
pub
fn
audio_ch1_output
(
&
self
)
->
u8
{
self
.apu_i
()
.ch1_output
()
}
pub
fn
audio_ch2_output
(
&
self
)
->
u8
{
self
.apu_i
()
.ch2_output
()
}
pub
fn
audio_ch3_output
(
&
self
)
->
u8
{
self
.apu_i
()
.ch3_output
()
}
pub
fn
cartridge_eager
(
&
mut
self
)
->
Cartridge
{
pub
fn
cartridge_eager
(
&
mut
self
)
->
Cartridge
{
self
.mmu
()
.rom
()
.clone
()
self
.mmu
()
.rom
()
.clone
()
}
}
...
...
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