(filename string, sram []byte)
| 216 | } |
| 217 | |
| 218 | func writeSRAM(filename string, sram []byte) error { |
| 219 | dir, _ := path.Split(filename) |
| 220 | if err := os.MkdirAll(dir, 0755); err != nil { |
| 221 | return err |
| 222 | } |
| 223 | file, err := os.Create(filename) |
| 224 | if err != nil { |
| 225 | return err |
| 226 | } |
| 227 | defer file.Close() |
| 228 | return binary.Write(file, binary.LittleEndian, sram) |
| 229 | } |
| 230 | |
| 231 | func readSRAM(filename string) ([]byte, error) { |
| 232 | file, err := os.Open(filename) |