Initial Commit

This commit is contained in:
2021-12-29 15:09:00 -06:00
commit 5b3b81e4dc
12 changed files with 564 additions and 0 deletions

25
src/main.zig Normal file
View File

@@ -0,0 +1,25 @@
const std = @import("std");
const Scheduler = @import("scheduler.zig").Scheduler;
const Bus = @import("bus.zig").Bus;
const ARM7TDMI = @import("cpu.zig").ARM7TDMI;
const emu = @import("emu.zig");
pub fn main() anyerror!void {
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
const alloc = gpa.allocator();
// defer gpa.deinit();
var bus = try Bus.withPak(alloc, "./bin/demo/beeg/beeg.gba");
var scheduler = Scheduler.new(alloc);
var cpu = ARM7TDMI.new(&scheduler, &bus);
while (true) {
emu.runFrame(&scheduler, &cpu, &bus);
}
}
test "basic test" {
try std.testing.expectEqual(10, 3 + 7);
}