chore: remove unnecessary @as calls
This commit is contained in:
@@ -40,9 +40,7 @@ fn parseTitle(buf: []u8) [12]u8 {
|
||||
}
|
||||
|
||||
fn lookupMaker(slice: *const [2]u8) ?[]const u8 {
|
||||
const num = @as(u16, slice[1]) << 8 | @as(u16, slice[0]);
|
||||
|
||||
return switch (num) {
|
||||
return switch (std.mem.bytesToValue(u16, slice)) {
|
||||
0x3130 => "Nintendo",
|
||||
else => null,
|
||||
};
|
||||
|
||||
@@ -27,10 +27,10 @@ pub const Io = struct {
|
||||
|
||||
pub fn read32(self: *const Self, addr: u32) u32 {
|
||||
return switch (addr) {
|
||||
0x0400_0000 => @as(u32, self.dispcnt.raw),
|
||||
0x0400_0004 => @as(u32, self.dispstat.raw),
|
||||
0x0400_0006 => @as(u32, self.vcount.raw),
|
||||
0x0400_0200 => @as(u32, self.ie.raw),
|
||||
0x0400_0000 => self.dispcnt.raw,
|
||||
0x0400_0004 => self.dispstat.raw,
|
||||
0x0400_0006 => self.vcount.raw,
|
||||
0x0400_0200 => self.ie.raw,
|
||||
0x0400_0208 => @boolToInt(self.ime),
|
||||
else => std.debug.panic("[I/O:32] tried to read from {X:}", .{addr}),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user