chore: introduce zba-util
In an effort to reuse code between zba and zba-gdbstub, move common util code (like the SPSC Channel I implemented in this commit) in a new lib
This commit is contained in:
@@ -14,7 +14,6 @@ const SoundFifo = std.fifo.LinearFifo(u8, .{ .Static = 0x20 });
|
||||
|
||||
const getHalf = util.getHalf;
|
||||
const setHalf = util.setHalf;
|
||||
const intToBytes = util.intToBytes;
|
||||
|
||||
const log = std.log.scoped(.APU);
|
||||
|
||||
@@ -557,7 +556,7 @@ pub fn DmaSound(comptime kind: DmaSoundKind) type {
|
||||
pub fn push(self: *Self, value: u32) void {
|
||||
if (!self.enabled) self.enable();
|
||||
|
||||
self.fifo.write(&intToBytes(u32, value)) catch |e| log.err("{} Error: {}", .{ kind, e });
|
||||
self.fifo.write(std.mem.asBytes(&value)) catch |e| log.err("{} Error: {}", .{ kind, e });
|
||||
}
|
||||
|
||||
fn enable(self: *Self) void {
|
||||
|
Reference in New Issue
Block a user