From 2cb1bf834ae3cdecf91987bec167763b4a4cb08e Mon Sep 17 00:00:00 2001 From: Rekai Musuka Date: Fri, 21 Oct 2022 05:12:16 -0300 Subject: [PATCH] chore: dont use std.mem.bytesToValue the stdlib accounts for endianness, which isn't something we want. --- src/bus/GamePak.zig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bus/GamePak.zig b/src/bus/GamePak.zig index 4ab9bf2..1697b90 100644 --- a/src/bus/GamePak.zig +++ b/src/bus/GamePak.zig @@ -40,7 +40,8 @@ fn parseTitle(buf: []u8) [12]u8 { } fn lookupMaker(slice: *const [2]u8) ?[]const u8 { - return switch (std.mem.bytesToValue(u16, slice)) { + const id = @as(u16, slice[1]) << 8 | @as(u16, slice[0]); + return switch (id) { 0x3130 => "Nintendo", else => null, };