2021-12-29 21:09:00 +00:00
|
|
|
const std = @import("std");
|
2022-01-02 03:08:36 +00:00
|
|
|
const emu = @import("emu.zig");
|
2021-12-29 21:09:00 +00:00
|
|
|
|
|
|
|
const Scheduler = @import("scheduler.zig").Scheduler;
|
|
|
|
const Bus = @import("bus.zig").Bus;
|
2022-01-02 03:08:36 +00:00
|
|
|
const Arm7tdmi = @import("cpu.zig").Arm7tdmi;
|
2021-12-29 21:09:00 +00:00
|
|
|
|
|
|
|
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);
|
2022-01-02 03:08:36 +00:00
|
|
|
var cpu = Arm7tdmi.new(&scheduler, &bus);
|
2021-12-29 21:09:00 +00:00
|
|
|
|
|
|
|
while (true) {
|
|
|
|
emu.runFrame(&scheduler, &cpu, &bus);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
test "basic test" {
|
|
|
|
try std.testing.expectEqual(10, 3 + 7);
|
|
|
|
}
|