Skip to content

Commit

Permalink
chore(cartridge): Change mapper fields from byte to uint8
Browse files Browse the repository at this point in the history
  • Loading branch information
gabe565 committed Aug 24, 2024
1 parent 152ef6e commit 640d1f7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cmd/gonesutil/ls/entry.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func newEntry(file string, cart *cartridge.Cartridge) *entry {
type entry struct {
Path string `json:"path" yaml:"path"`
Name string `json:"name" yaml:"name"`
Mapper byte `json:"mapper" yaml:"mapper"`
Mapper uint8 `json:"mapper" yaml:"mapper"`
Mirror string `json:"mirror" yaml:"mirror"`
Battery bool `json:"battery" yaml:"battery"`
Hash string `json:"hash" yaml:"hash"`
Expand Down
4 changes: 2 additions & 2 deletions internal/cartridge/cartridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ type Cartridge struct {
prg []byte
CHR []byte `msgpack:"alias:Chr"`
SRAM []byte `msgpack:"alias:Sram"`
Mapper byte `msgpack:"-"`
Submapper byte `msgpack:"-"`
Mapper uint8 `msgpack:"-"`
Submapper uint8 `msgpack:"-"`
Mirror Mirror
Battery bool `msgpack:"-"`
}
Expand Down
4 changes: 2 additions & 2 deletions internal/cartridge/ines.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ type iNESFileHeader struct {
_ [7]byte
}

func (i iNESFileHeader) Mapper() byte {
func (i iNESFileHeader) Mapper() uint8 {
return i.Control[1]&0xF0 | i.Control[0]>>4
}

Expand All @@ -43,7 +43,7 @@ func (i iNESFileHeader) NESv2() bool {
return i.Control[1]&0xC == 0x8
}

func (i iNESFileHeader) Submapper() byte {
func (i iNESFileHeader) Submapper() uint8 {
return i.Control[2] >> 4
}

Expand Down

0 comments on commit 640d1f7

Please sign in to comment.