This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub inline fn BIOSRegisterRamReset(flags: RamResetFlags) void { | |
biosCall(1, @bitCast(u8, flags)); | |
} | |
pub inline fn biosCall(comptime call: u8, params: u8) void { | |
const assembly = comptime blk: { | |
const fmt = @import("std").fmt; | |
var buffer:[64] u8 = undefined; | |
break :blk fmt.bufPrint(buffer[0..], "movs r0, r1\nswi {}", .{call}) catch unreachable; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub fn fromFile(allocator: *Allocator, filePath: []const u8) !Bitmap { | |
var result = init(allocator); | |
var absolutePath = try path.resolve(allocator, &[_][]const u8{filePath}); | |
defer allocator.free(absolutePath); | |
var file = try fs.openFileAbsolute(absolutePath, File.OpenFlags{}); | |
defer file.close(); | |
var fileInStream = file.inStream(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Builder = @import("std").build.Builder; | |
pub fn build(b: *Builder) void { | |
const mode = b.standardReleaseOptions(); | |
const exe = b.addExecutable("Win32MessageBoxTest", "src/main.zig"); | |
exe.setBuildMode(mode); | |
exe.install(); | |
const run_cmd = exe.run(); | |
run_cmd.step.dependOn(b.getInstallStep()); |