// SPDX-FileCopyrightText: 2026 Jeffrey C. Ollie // // SPDX-License-Identifier: MIT //! A memory location in a 65816 recording, which is the same as one in a //! 65x02 recording except that the address is twenty-four bits wide. Its own //! type rather than the other made generic, for the same reason the cores are //! separate: the narrow type is what keeps an out-of-range address on the //! 8-bit side from being representable at all. const std = @import("std"); const json = @import("json.zig"); address: u24, value: u8, /// Parses a memory location, as an [address, value] pair. Read straight off /// the token stream, as in RAM.zig and for the same reason. pub fn jsonParse( alloc: std.mem.Allocator, source: anytype, options: std.json.ParseOptions, ) std.json.ParseError(@TypeOf(source.*))!@This() { _ = alloc; _ = options; try json.expect(source, .array_begin); const address = try json.number(source, u24); const value = try json.number(source, u8); try json.expect(source, .array_end); return .{ .address = address, .value = value }; }