Skip to content

Commit

Permalink
dc-armwrestler needs the romfont to be correctly initialized. skip_bi…
Browse files Browse the repository at this point in the history
…os doesn't handle it. Re-enable HLE syscalls for binaries for now.

Fixes #37
  • Loading branch information
Senryoku committed Jul 16, 2024
1 parent 44ef3f2 commit 91d8bd9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,10 @@ pub fn main() !void {
}

if (binary_path) |path| {
dc.skip_bios(false);
// FIXME: I'd rather be using LLE syscalls here,
// but at least the ROM font one requires some initialization
// and won't work if the boot ROM is skipped.
dc.skip_bios(true);

var bin_file = try std.fs.cwd().openFile(path, .{});
defer bin_file.close();
Expand Down
2 changes: 1 addition & 1 deletion src/sh4.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1063,7 +1063,7 @@ pub const SH4 = struct {
P4Register.TCNT0 => return @constCast(self).p4_register_addr(T, virtual_addr).*,
else => {
if (!(virtual_addr & 0xFF000000 == 0xFF000000 or virtual_addr & 0xFF000000 == 0x1F000000) or !(virtual_addr & 0b0000_0000_0000_0111_1111_1111_1000_0000 == 0)) {
sh4_log.warn(termcolor.yellow(" Invalid Read({any}) to P4 register @{X:0>8}"), .{ T, virtual_addr });
sh4_log.warn(termcolor.yellow(" [{X:0>8}] Invalid Read({any}) to P4 register @{X:0>8}"), .{ self.pc, T, virtual_addr });
return 0;
}
sh4_log.debug(" Read({any}) to P4 register @{X:0>8} {s} = 0x{X}", .{ T, virtual_addr, P4.getP4RegisterName(virtual_addr), @constCast(self).p4_register_addr(T, virtual_addr).* });
Expand Down

0 comments on commit 91d8bd9

Please sign in to comment.