Skip to content

Commit

Permalink
Merge branch 'master' into kivutar/newdesign
Browse files Browse the repository at this point in the history
  • Loading branch information
kivutar committed Sep 22, 2021
2 parents 0aa96cd + 0b1f90a commit 9f95e3d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ ludo.exe:
cores/%_libretro.dylib cores/%_libretro.dll cores/%_libretro.so:
mkdir -p cores
@if [ $(basename $(@F)) = swanstation_libretro ]; then\
wget -c https://github.com/kivutar/swanstation/releases/download/v2021-08-01/swanstation-$(OS)-$(ARCH).zip -O $@.zip;\
wget -c https://github.com/kivutar/swanstation/releases/download/v2021-09-22/swanstation-$(OS)-$(ARCH).zip -O $@.zip;\
else\
wget -c $(BUILDBOTURL)/$(@F).zip -O $@.zip;\
fi
Expand Down Expand Up @@ -92,7 +92,7 @@ dmg: empty.dmg $(APP).app
hdiutil attach empty.dmg -noautoopen -quiet -mountpoint wc
rm -rf wc/$(APP).app
ditto -rsrc $(APP).app wc/$(APP).app
ln -s /Applications wc/Applications
ln -sf /Applications wc/Applications
WC_DEV=`hdiutil info | grep wc | grep "Apple_HFS" | awk '{print $$1}'` && hdiutil detach $$WC_DEV -quiet -force
rm -f $(BUNDLENAME)-*.dmg
hdiutil convert empty.dmg -quiet -format UDZO -imagekey zlib-level=9 -o $(BUNDLENAME).dmg
Expand Down
12 changes: 8 additions & 4 deletions scanner/scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ func Scan(dir string, roms []string, games chan (dat.Game), n *ntf.Notification)
for _, rom := range z.File {
romExt := filepath.Ext(rom.Name)
// these 4 systems might have headered or headerless roms and need special logic
if romExt == ".nes" || romExt == ".a78" || romExt == ".lnx" || romExt == ".fds" {
crc, crcHeaderless, err := checksumHeaderless(rom, headerSizes[romExt])
if headerSize, ok := headerSizes[romExt]; ok {
crc, crcHeaderless, err := checksumHeaderless(rom, headerSize)
if err != nil {
n.Update(ntf.Error, err.Error())
continue
Expand Down Expand Up @@ -163,8 +163,12 @@ func Scan(dir string, roms []string, games chan (dat.Game), n *ntf.Notification)
n.Update(ntf.Error, err.Error())
continue
}
CRC32 := crc32.ChecksumIEEE(bytes)
state.DB.FindByCRC(f, utils.FileName(f), CRC32, games)
crc := crc32.ChecksumIEEE(bytes)
state.DB.FindByCRC(f, utils.FileName(f), crc, games)
if headerSize, ok := headerSizes[ext]; ok {
crcHeaderless := crc32.ChecksumIEEE(bytes[headerSize:])
state.DB.FindByCRC(f, utils.FileName(f), crcHeaderless, games)
}
if n != nil {
n.Update(ntf.Info, strconv.Itoa(i)+"/"+strconv.Itoa(len(roms))+" "+f)
}
Expand Down

0 comments on commit 9f95e3d

Please sign in to comment.