fix(bus): fix confusion about which fastmem write table is for which write type
This commit is contained in:
parent
b8a5fb95c1
commit
d34893ba72
|
@ -88,8 +88,8 @@ pub fn init(self: *Self, allocator: Allocator, sched: *Scheduler, cpu: *Arm7tdmi
|
||||||
|
|
||||||
// Internal Display Memory behavious unusually on 8-bit reads
|
// Internal Display Memory behavious unusually on 8-bit reads
|
||||||
// so we have two different tables depending on whether there's an 8-bit read or not
|
// so we have two different tables depending on whether there's an 8-bit read or not
|
||||||
fillWriteTable(u8, self, left_write);
|
fillWriteTable(u32, self, left_write);
|
||||||
fillWriteTable(u32, self, right_write);
|
fillWriteTable(u8, self, right_write);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn deinit(self: *Self) void {
|
pub fn deinit(self: *Self) void {
|
||||||
|
@ -379,7 +379,7 @@ pub fn write(self: *Self, comptime T: type, unaligned_address: u32, value: T) vo
|
||||||
// We're doing some serious out-of-bounds open-bus writes, they do nothing though
|
// We're doing some serious out-of-bounds open-bus writes, they do nothing though
|
||||||
if (page > table_len) return;
|
if (page > table_len) return;
|
||||||
|
|
||||||
if (self.write_tables[@boolToInt(T == u32)][page]) |some_ptr| {
|
if (self.write_tables[@boolToInt(T == u8)][page]) |some_ptr| {
|
||||||
// We have a pointer to a page, cast the pointer to it's underlying type
|
// We have a pointer to a page, cast the pointer to it's underlying type
|
||||||
const Ptr = [*]T;
|
const Ptr = [*]T;
|
||||||
const alignment = @alignOf(std.meta.Child(Ptr));
|
const alignment = @alignOf(std.meta.Child(Ptr));
|
||||||
|
|
Loading…
Reference in New Issue