Compare commits

..

14 Commits

Author SHA1 Message Date
Rekai Nyangadzayi Musuka 0dadbd55de chore: update nfd-zig
respond to build.zig changes in zig master
2023-02-04 19:13:46 -06:00
Rekai Nyangadzayi Musuka a0d4f8c40d feat: implement menu bar + add file picker dep 2023-02-04 19:07:57 -06:00
Rekai Nyangadzayi Musuka 1d96f0b136 feat: show game title as imgui screen title 2023-02-04 19:07:57 -06:00
Rekai Nyangadzayi Musuka 14c9f72d88 chore: update zgui 2023-02-04 19:07:57 -06:00
Rekai Nyangadzayi Musuka 77530c1b09 feat: add scheduler ui 2023-02-04 19:07:57 -06:00
Rekai Nyangadzayi Musuka 45655233cf feat: pause emu when UI reads emu state 2023-02-04 19:07:57 -06:00
Rekai Nyangadzayi Musuka 620abd784f feat: implement ui for register, interrupt 2023-02-04 19:07:57 -06:00
Rekai Nyangadzayi Musuka a5fd7f5f5d feat: add system information window 2023-02-04 19:07:57 -06:00
Rekai Nyangadzayi Musuka 545bcb8bbc fix: update zgui to work with sdl2 vcpkg package 2023-02-04 19:07:57 -06:00
Rekai Nyangadzayi Musuka 462121153e feat: add imgui support using zgui 2023-02-04 19:07:54 -06:00
Rekai Nyangadzayi Musuka ed8155139a chore: update CI 2023-02-04 18:22:50 -06:00
Rekai Nyangadzayi Musuka 8112b1aab2 chore: update zig to latest master 2023-02-04 18:15:10 -06:00
Rekai Nyangadzayi Musuka c0e583d20d fix: resolve off-by-one error in `str` addr when r15 is involved
I seem to have made up this rule (I was thinking about when r15 was
a source register). `rn` is the destination register.... whoops
2023-01-29 08:58:41 -06:00
Rekai Nyangadzayi Musuka 3f72367aaf chore: remove .vscode folder 2023-01-21 19:01:44 -06:00
7 changed files with 20 additions and 31 deletions

View File

@ -39,7 +39,7 @@ jobs:
with: with:
submodules: true submodules: true
- name: build - name: build
run: zig build -Drelease-safe run: zig build -Doptimize=ReleaseSafe
- name: upload - name: upload
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:

View File

@ -1,8 +0,0 @@
{
"recommendations": [
"augusterame.zls-vscode",
"usernamehw.errorlens",
"vadimcn.vscode-lldb",
"dan-c-underwood.arm"
]
}

View File

@ -77,7 +77,7 @@ arm7wrestler GBA Fixed | [destoer](https://github.com/destoer)
## Compiling ## Compiling
Most recently built on Zig [v0.11.0-dev.987+a1d82352d](https://github.com/ziglang/zig/tree/a1d82352d) Most recently built on Zig [v0.11.0-dev.1557+03cdb4fb5](https://github.com/ziglang/zig/tree/03cdb4fb5)
### Dependencies ### Dependencies

View File

@ -7,25 +7,23 @@ const nfd = @import("lib/nfd-zig/build.zig");
pub fn build(b: *std.build.Builder) void { pub fn build(b: *std.build.Builder) void {
// Minimum Zig Version // Minimum Zig Version
const min_ver = std.SemanticVersion.parse("0.11.0-dev.987+a1d82352d") catch return; // https://github.com/ziglang/zig/commit/19056cb68 const min_ver = std.SemanticVersion.parse("0.11.0-dev.1557+03cdb4fb5") catch return; // https://github.com/ziglang/zig/commit/03cdb4fb5
if (builtin.zig_version.order(min_ver).compare(.lt)) { if (builtin.zig_version.order(min_ver).compare(.lt)) {
std.log.err("{s}", .{b.fmt("Zig v{} does not meet the minimum version requirement. (Zig v{})", .{ builtin.zig_version, min_ver })}); std.log.err("{s}", .{b.fmt("Zig v{} does not meet the minimum version requirement. (Zig v{})", .{ builtin.zig_version, min_ver })});
std.os.exit(1); std.os.exit(1);
} }
// Standard target options allows the person running `zig build` to choose
// what target to build for. Here we do not override the defaults, which
// means any target is allowed, and the default is native. Other options
// for restricting supported target set are available.
const target = b.standardTargetOptions(.{}); const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
// Standard release options allow the person running `zig build` to select const exe = b.addExecutable(.{
// between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall. .name = "zba",
const mode = b.standardReleaseOptions(); .root_source_file = .{ .path = "src/main.zig" },
.target = target,
.optimize = optimize,
});
const exe = b.addExecutable("zba", "src/main.zig");
exe.setMainPkgPath("."); // Necessary so that src/main.zig can embed example.toml exe.setMainPkgPath("."); // Necessary so that src/main.zig can embed example.toml
exe.setTarget(target);
// Known Folders (%APPDATA%, XDG, etc.) // Known Folders (%APPDATA%, XDG, etc.)
exe.addPackagePath("known_folders", "lib/known-folders/known-folders.zig"); exe.addPackagePath("known_folders", "lib/known-folders/known-folders.zig");
@ -47,11 +45,11 @@ pub fn build(b: *std.build.Builder) void {
exe.addPackagePath("gl", "lib/gl.zig"); exe.addPackagePath("gl", "lib/gl.zig");
// NativeFileDialog(ue) Bindings // NativeFileDialog(ue) Bindings
exe.linkLibrary(nfd.makeLib(b, mode, target)); exe.linkLibrary(nfd.makeLib(b, target, optimize));
exe.addPackage(nfd.getPackage("nfd")); exe.addPackage(nfd.getPackage("nfd"));
// Zig SDL Bindings: https://github.com/MasterQ32/SDL.zig // Zig SDL Bindings: https://github.com/MasterQ32/SDL.zig
const sdk = Sdk.init(b); const sdk = Sdk.init(b, null);
sdk.link(exe, .dynamic); sdk.link(exe, .dynamic);
exe.addPackage(sdk.getNativePackage("sdl2")); exe.addPackage(sdk.getNativePackage("sdl2"));
@ -61,7 +59,6 @@ pub fn build(b: *std.build.Builder) void {
zgui.link(exe, zgui_options); zgui.link(exe, zgui_options);
exe.addPackage(zgui_pkg); exe.addPackage(zgui_pkg);
exe.setBuildMode(mode);
exe.install(); exe.install();
const run_cmd = exe.run(); const run_cmd = exe.run();
@ -73,9 +70,11 @@ pub fn build(b: *std.build.Builder) void {
const run_step = b.step("run", "Run the app"); const run_step = b.step("run", "Run the app");
run_step.dependOn(&run_cmd.step); run_step.dependOn(&run_cmd.step);
const exe_tests = b.addTest("src/main.zig"); const exe_tests = b.addTest(.{
exe_tests.setTarget(target); .root_source_file = .{ .path = "src/main.zig" },
exe_tests.setBuildMode(mode); .target = target,
.optimize = optimize,
});
const test_step = b.step("test", "Run unit tests"); const test_step = b.step("test", "Run unit tests");
test_step.dependOn(&exe_tests.step); test_step.dependOn(&exe_tests.step);

@ -1 +1 @@
Subproject commit 2025889b612f345698feff44fc245501bff637e9 Subproject commit 59a458abd9220703ca4d8b7f99080780c61c2f8c

@ -1 +1 @@
Subproject commit 75acefd571ede5361514b3a8ae9c8b36c6908d36 Subproject commit b8d56260294636f9d7bf596cb558b697e873793f

View File

@ -11,9 +11,7 @@ pub fn singleDataTransfer(comptime I: bool, comptime P: bool, comptime U: bool,
const rn = opcode >> 16 & 0xF; const rn = opcode >> 16 & 0xF;
const rd = opcode >> 12 & 0xF; const rd = opcode >> 12 & 0xF;
// rn is r15 and L is not set, the PC is 12 ahead const base = cpu.r[rn];
const base = cpu.r[rn] + if (!L and rn == 0xF) 4 else @as(u32, 0);
const offset = if (I) shifter.immediate(false, cpu, opcode) else opcode & 0xFFF; const offset = if (I) shifter.immediate(false, cpu, opcode) else opcode & 0xFFF;
const modified_base = if (U) base +% offset else base -% offset; const modified_base = if (U) base +% offset else base -% offset;