Added disassembly component.
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user