Remove nes implementation so that we can implement it in a better way from scratch.

This commit is contained in:
2026-08-27 00:04:59 +02:00
parent 60a6364625
commit 425ebe0938
47 changed files with 0 additions and 7116 deletions
-64
View File
@@ -1,64 +0,0 @@
const types = @import("types.zig");
const Mirroring = types.Mirroring;
const Axrom = @This();
prg_bank_select: u8 = 0,
mirroring_select: u1 = 0,
prg_bank_count: usize,
pub fn init(
prg_size: usize,
) Axrom {
return .{
.prg_bank_count = prg_size / 0x8000,
};
}
pub fn cpuMapRead(
self: *const Axrom,
address: u16,
) ?usize {
if (address < 0x8000) return null;
const offset = @as(usize, address - 0x8000);
const bank = @as(usize, self.prg_bank_select & 0x07) % self.prg_bank_count;
return bank * 0x8000 + offset;
}
pub fn cpuWrite(
self: *Axrom,
address: u16,
value: u8,
) void {
if (address >= 0x8000) {
self.prg_bank_select = value & 0x07;
self.mirroring_select = @truncate((value >> 4) & 1);
}
}
pub fn ppuMapRead(
_: *const Axrom,
address: u16,
) ?usize {
if (address >= 0x2000) return null;
return address;
}
pub fn ppuMapWrite(
_: *const Axrom,
address: u16,
) ?usize {
if (address >= 0x2000) return null;
return address;
}
pub fn mirroring(
self: *const Axrom,
) Mirroring {
return if (self.mirroring_select == 0) .single_screen_lower else .single_screen_upper;
}
pub fn irqAsserted(_: *const Axrom) bool {
return false;
}