Added disassembly component.

This commit is contained in:
2026-06-18 07:40:23 +02:00
parent 19f4593e0e
commit 350a26d1b9
5 changed files with 207 additions and 32 deletions
+3 -3
View File
@@ -5,13 +5,13 @@ package machine
import "core:log"
import "core:os"
load_rom :: proc(s: ^System, file_path: string) -> os.Error {
load_rom :: proc(s: ^System, file_path: string) -> (int, os.Error) {
log.info("Loading rom from file")
data, read_err := os.read_entire_file(file_path, context.allocator)
if read_err != os.ERROR_NONE {
log.errorf("failed to read rom %v", read_err)
return read_err
return 0, read_err
}
defer delete(data)
@@ -21,5 +21,5 @@ load_rom :: proc(s: ^System, file_path: string) -> os.Error {
log.infof("First few bytes: %X %X %X %X", s.memory[0x200], s.memory[0x201], s.memory[0x202], s.memory[0x203])
return nil
return len(data), nil
}