Move the .fds check to ReadRomFile()
The filename is already beeing passed into ReadRomFile(), so just check it in there instead of requiring IsFds to be passed separately.
This commit is contained in:
parent
e1b9e195cb
commit
ccdb696c2d
|
|
@ -32,7 +32,7 @@ func main() {
|
|||
}
|
||||
|
||||
func run(args *Arguments) error {
|
||||
rom, err := fds.ReadRomFile(args.Input, filepath.Ext(args.Input) == ".fds")
|
||||
rom, err := fds.ReadRomFile(args.Input)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,18 +7,19 @@ import (
|
|||
"bufio"
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/sigurn/crc16"
|
||||
)
|
||||
|
||||
func ReadRomFile(filename string, IsFds bool) (*Rom, error) {
|
||||
func ReadRomFile(filename string) (*Rom, error) {
|
||||
file, err := os.Open(filename)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer file.Close()
|
||||
|
||||
blocks, err := ReadRomBlocks(file, IsFds)
|
||||
blocks, err := ReadRomBlocks(file, filepath.Ext(filename) == ".fds")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue