Skip to content

Commit

Permalink
[eframe] Rename crate
Browse files Browse the repository at this point in the history
  • Loading branch information
marcellocordeiro committed Jan 21, 2024
1 parent ccf9abd commit d8a2762
Show file tree
Hide file tree
Showing 18 changed files with 50 additions and 12 deletions.
14 changes: 3 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/build
/target

# Created by https://www.toptal.com/developers/gitignore/api/swiftpackagemanager,xcode,macos
# Edit at https://www.toptal.com/developers/gitignore?templates=swiftpackagemanager,xcode,macos
# Created by https://www.toptal.com/developers/gitignore/api/macos,xcode
# Edit at https://www.toptal.com/developers/gitignore?templates=macos,xcode

### macOS ###
# General
Expand Down Expand Up @@ -37,14 +37,6 @@ Temporary Items
# iCloud generated files
*.icloud

### SwiftPackageManager ###
Packages
.build/
xcuserdata
DerivedData/
*.xcodeproj


### Xcode ###
## User settings
xcuserdata/
Expand All @@ -62,7 +54,7 @@ xcuserdata/
/*.gcno
**/xcshareddata/WorkspaceSettings.xcsettings

# End of https://www.toptal.com/developers/gitignore/api/swiftpackagemanager,xcode,macos
# End of https://www.toptal.com/developers/gitignore/api/macos,xcode

# Logs
logs
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ members = [
"core/gb-core-c",
"core/gb-core-wasm",
"core/gb-opcode-info",
"platform/eframe-rust",
"platform/eframe",
"platform/libretro",
"platform/sdl2-rust",
]
Expand Down
46 changes: 46 additions & 0 deletions core/gb-core/src/audio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,66 @@ impl Audio {
pub fn read(&self, address: u16) -> u8 {
match address {
// TODO: stubs for the DMG.

// Channel 1

// FF10 — NR10: Channel 1 sweep
0xFF10 => 0x80,

// FF11 — NR11: Channel 1 length timer & duty cycle
0xFF11 => 0xBF,

// FF12 — NR12: Channel 1 volume & envelope
0xFF12 => 0xF3,

// FF13 — NR13: Channel 1 period low [write-only]
0xFF13 => panic!("NR13 is write-only"),

// FF14 — NR14: Channel 1 period high & control
0xFF14 => 0xBF,

// Channel 2

// FF16 — NR21: Channel 2 length timer & duty cycle
0xFF16 => 0x3F,

// FF12 — NR22: Channel 2 volume & envelope
0xFF17 => 0x00,

// FF18 — NR23: Channel 2 period low [write-only]
0xFF18 => panic!("NR23 is write-only"),

// FF19 — NR24: Channel 2 period high & control
0xFF19 => 0xBF,

// Channel 3

// FF1A — NR30: Channel 3 DAC enable
0xFF1A => 0x7F,

// FF1B — NR31: Channel 3 length timer [write-only]
0xFF1B => panic!("NR31 is write-only"),

// FF1C — NR32: Channel 3 output level
0xFF1C => 0x9F,

// FF1D — NR33: Channel 3 period low [write-only]
0xFF1D => panic!("NR33 is write-only"),

// FF1E — NR34: Channel 3 period high & control
0xFF1E => 0xBF,

0xFF21 => 0x00,
0xFF22 => 0x00,
0xFF23 => 0xBF,

// FF24 — NR50: Master volume & VIN panning
0xFF24 => 0x77,

// FF25 — NR51: Sound panning
0xFF25 => 0xF3,

// FF26 — NR52: Audio master control
0xFF26 => 0xF1,

0xFF76 => {
Expand All @@ -51,6 +96,7 @@ impl Audio {
0x00
}

// _ => panic!("Invalid address"),
_ => 0xFF,
}
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit d8a2762

Please sign in to comment.