chore: update to latest builtin syntax

This commit is contained in:
2023-07-10 21:20:07 -05:00
parent 954fb279ad
commit d96c9c01ff
25 changed files with 679 additions and 684 deletions

View File

@@ -81,8 +81,8 @@ pub fn onToneSweepEvent(self: *Self, late: u64) void {
/// NR10, NR11, NR12
pub fn setSound1Cnt(self: *Self, value: u32) void {
self.setSound1CntL(@truncate(u8, value));
self.setSound1CntH(@truncate(u16, value >> 16));
self.setSound1CntL(@as(u8, @truncate(value)));
self.setSound1CntH(@as(u16, @truncate(value >> 16)));
}
/// NR10
@@ -111,14 +111,14 @@ pub fn sound1CntH(self: *const Self) u16 {
/// NR11, NR12
pub fn setSound1CntH(self: *Self, value: u16) void {
self.setNr11(@truncate(u8, value));
self.setNr12(@truncate(u8, value >> 8));
self.setNr11(@as(u8, @truncate(value)));
self.setNr12(@as(u8, @truncate(value >> 8)));
}
/// NR11
pub fn setNr11(self: *Self, value: u8) void {
self.duty.raw = value;
self.len_dev.timer = @as(u7, 64) - @truncate(u6, value);
self.len_dev.timer = @as(u7, 64) - @as(u6, @truncate(value));
}
/// NR12
@@ -134,8 +134,8 @@ pub fn sound1CntX(self: *const Self) u16 {
/// NR13, NR14
pub fn setSound1CntX(self: *Self, fs: *const FrameSequencer, value: u16) void {
self.setNr13(@truncate(u8, value));
self.setNr14(fs, @truncate(u8, value >> 8));
self.setNr13(@as(u8, @truncate(value)));
self.setNr14(fs, @as(u8, @truncate(value >> 8)));
}
/// NR13