mirror of
https://github.com/freewilll/apple2-go.git
synced 2025-01-22 23:30:46 +00:00
5d1c25a724
Basic memory management has been implemented since $c100-$cfff needs flipping with soft switches during Apple //e boot. All memory reads & writes now go through the MMU. Memory is also dynamically allocated and associated with the CPU state.
25 lines
345 B
Go
25 lines
345 B
Go
package utils
|
|
|
|
import (
|
|
"compress/gzip"
|
|
"io/ioutil"
|
|
"os"
|
|
)
|
|
|
|
func ReadMemoryFromGzipFile(filename string) (data []byte, err error) {
|
|
f, err := os.Open(filename)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
reader, err := gzip.NewReader(f)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
defer reader.Close()
|
|
|
|
data, err = ioutil.ReadAll(reader)
|
|
|
|
return
|
|
}
|