10000 Add `.pbp` support to ludo by bagelbyheart · Pull Request #521 · libretro/ludo · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add .pbp support to ludo #521

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 18 additions & 13 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: CD

on:
workflow_dispatch:
types: [created]
release:
types: [created]

Expand All @@ -12,10 +14,10 @@ jobs:
build_linux_wayland_x86_64:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-go@v3
- uses: actions/setup-go@v4
with:
go-version: '1.19.5'
- run: echo "VERSION=$(echo ${{ github.event.release.tag_name }} | cut -c 2-)" >> $GITHUB_ENV
Expand All @@ -36,10 +38,10 @@ jobs:
build_linux_wayland_arm:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-go@v3
- uses: actions/setup-go@v4
with:
go-version: '1.19.5'
- run: echo "VERSION=$(echo ${{ github.event.release.tag_name }} | cut -c 2-)" >> $GITHUB_ENV
Expand Down Expand Up @@ -72,10 +74,10 @@ jobs:
build_linux_x11_x86_64:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-go@v3
- uses: actions/setup-go@v4
with:
go-version: '1.19.5'
- run: echo "VERSION=$(echo ${{ github.event.release.tag_name }} | cut -c 2-)" >> $GITHUB_ENV
Expand All @@ -96,10 +98,10 @@ jobs:
build_linux_x11_arm:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-go@v3
- uses: actions/setup-go@v4
with:
go-version: '1.19.5'
- run: echo "VERSION=$(echo ${{ github.event.release.tag_name }} | cut -c 2-)" >> $GITHUB_ENV
Expand Down Expand Up @@ -132,10 +134,10 @@ jobs:
build_osx:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-go@v3
- uses: actions/setup-go@v4
with:
go-version: '1.19.5'
- run: echo "VERSION=$(echo ${{ github.event.release.tag_name }} | cut -c 2-)" >> $GITHUB_ENV
Expand Down Expand Up @@ -166,22 +168,25 @@ jobs:
build_windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-go@v3
- uses: actions/setup-go@v4
with:
go-version: '1.19.5'
- run: echo "VERSION=$(echo ${{ github.event.release.tag_name }} | cut -c 2-)" >> $GITHUB_ENV
- run: choco install wget make hashdeep --ignore-checksums
- run: wget --no-check-certificate http://www.openal-soft.org/openal-binaries/openal-soft-1.21.0-bin.zip
- run: wget https://github.com/electron/rcedit/releases/download/v1.1.1/rcedit-x64.exe
- run: curl -L -o mingw64.zip https://github.com/brechtsanders/winlibs_mingw/releases/download/13.2.0posix-17.0.6-11.0.1-ucrt-r5/winlibs-x86_64-posix-seh-gcc-13.2.0-llvm-17.0.6-mingw-w64ucrt-11.0.1-r5.zip
- run: unzip mingw64.zip
- run: 7z x openal-soft-1.21.0-bin.zip -o/c/
- run: echo "CGO_CFLAGS=-I/c/openal-soft-1.21.0-bin/include/" >> $GITHUB_ENV
- run: echo "CGO_LDFLAGS=-L/c/openal-soft-1.21.0-bin/libs/Win64/" >> $GITHUB_ENV
- run: cp /c/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/bin/libwinpthread-1.dll .
- run: cp "mingw64/bin/libwinpthread-1.dll" .
- run: cp /c/openal-soft-1.21.0-bin/bin/Win64/soft_oal.dll OpenAL32.dll
- run: cp /c/Windows/System32/VCRUNTIME140.dll .
- run: PATH="/c/mingw64/bin:$PATH"
- run: mkdir -p ./Ludo-Windows-x86_64-${VERSION}/
- run: cp *.dll ./Ludo-Windows-x86_64-${VERSION}/
- run: OS=Windows ARCH=x86_64 VERSION=$VERSION make zip
Expand Down
31 changes: 18 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: CI

on:
workflow_dispatch:
branches: [master]
push:
branches: [master]
pull_request:
Expand All @@ -14,10 +16,10 @@ jobs:
build_linux_wayland_x86_64:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-go@v3
- uses: actions/setup-go@v4
with:
go-version: '1.19.5'
- run: echo "/home/runner/go/bin" >> $GITHUB_PATH
Expand All @@ -33,10 +35,10 @@ jobs:
build_linux_wayland_arm:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-go@v3
- uses: actions/setup-go@v4
with:
go-version: '1.19.5'
- run: sudo apt update -q
Expand All @@ -58,10 +60,10 @@ jobs:
build_linux_x11_x86_64:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-go@v3
- uses: actions/setup-go@v4
with:
go-version: '1.19.5'
- run: echo "/home/runner/go/bin" >> $GITHUB_PATH
Expand All @@ -77,10 +79,10 @@ jobs:
build_linux_x11_arm:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-go@v3
- uses: actions/setup-go@v4
with:
go-version: '1.19.5'
- run: sudo apt update -q
Expand All @@ -102,10 +104,10 @@ jobs:
build_osx:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-go@v3
- uses: actions/setup-go@v4
with:
go-version: '1.19.5'
- run: echo "/Users/runner/go/bin" >> $GITHUB_PATH
Expand All @@ -120,20 +122,23 @@ jobs:
build_windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-go@v3
- uses: actions/setup-go@v4
with:
go-version: '1.19.5'
- run: echo "/c/Users/runneradmin/go/bin" >> $GITHUB_PATH
- run: go install honnef.co/go/tools/cmd/staticcheck@latest
- run: choco install wget --ignore-checksums
- run: curl -L -o mingw64.zip https://github.com/brechtsanders/winlibs_mingw/releases/download/13.2.0posix-17.0.6-11.0.1-ucrt-r5/winlibs-x86_64-posix-seh-gcc-13.2.0-llvm-17.0.6-mingw-w64ucrt-11.0.1-r5.zip
- run: unzip mingw64.zip
- run: wget --no-check-certificate http://www.openal-soft.org/openal-binaries/openal-soft-1.21.0-bin.zip
- run: 7z x openal-soft-1.21.0-bin.zip -o/c/
- run: echo "CGO_CFLAGS=-I/c/openal-soft-1.21.0-bin/include/" >> $GITHUB_ENV
- run: echo "CGO_LDFLAGS=-L/c/openal-soft-1.21.0-bin/libs/Win64/" >> $GITHUB_ENV
- run: cp /c/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/bin/libwinpthread-1.dll .
- run: cp "mingw64/bin/libwinpthread-1.dll" .
- run: PATH="/c/mingw64/bin:$PATH"
- run: go get .
#- run: go test -v -race ./...
#- run: go vet ./...
Expand Down
1 change: 1 addition & 0 deletions core/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ func unarchiveGame(filename string) (string, int64, error) {
extPrefered := make(map[string]int)
extPrefered[".cue"] = 1
extPrefered[".m3u"] = 2
extPrefered[".pbp"] = 3

err = archiver.Walk(filename, func(f archiver.File) error {
fname := f.Name()
Expand Down
11 changes: 7 additions & 4 deletions dat/dat.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,13 @@ func (db *DB) FindByROMName(romPath string, romName string, crc uint32, games ch
continue
}
// If the checksums match
if romName == game.ROMs[0].Name {
game.Path = romPath
game.System = system
games <- game
for _, ROM := range game.ROMs {
if romName == ROM.Name {
game.Path = romPath
game.System = system
games <- game
}
// element is the element from someSlice for where we are
}
}
wg.Done()
Expand Down
5 changes: 5 additions & 0 deletions menu/scene_playlist.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ func buildPlaylist(path string) Scene {
for _, game := range playlists.Playlists[path] {
game := game // needed for callbackOK
strippedName, tags := extractTags(game.Name)
if strings.Contains(game.Name, "Disc") {
re := regexp.MustCompile(`\((Disc [1-9]?)\)`)
match := re.FindStringSubmatch(game.Name)
strippedName = strippedName + " (" + match[1] + ")"
}
list.children = append(list.children, entry{
label: strippedName,
gameName: game.Name,
Expand Down
7 changes: 4 additions & 3 deletions menu/scene_tabs.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package menu
import (
"fmt"
"os"
"os/user"
//"os/user"
"sort"

"github.com/libretro/ludo/audio"
Expand All @@ -15,6 +15,7 @@ import (
"github.com/libretro/ludo/state"
"github.com/libretro/ludo/utils"
"github.com/libretro/ludo/video"
"github.com/libretro/ludo/settings"
colorful "github.com/lucasb-eyer/go-colorful"

"github.com/tanema/gween"
Expand Down Expand Up @@ -63,8 +64,8 @@ func buildTabs() Scene {
subLabel: "Scan your collection",
icon: "add",
callbackOK: func() {
usr, _ := user.Current()
menu.Push(buildExplorer(usr.HomeDir, nil,
//usr, _ := user.Current()
menu.Push(buildExplorer(settings.Current.FileDirectory, nil,
func(path string) {
scanner.ScanDir(path, refreshTabs)
},
Expand Down
3 changes: 1 addition & 2 deletions scanner/scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"path/filepath"
"strconv"
"strings"

"github.com/libretro/ludo/dat"
ntf "github.com/libretro/ludo/notifications"
"github.com/libretro/ludo/playlists"
Expand Down Expand Up @@ -131,7 +130,7 @@ func Scan(dir string, roms []string, games chan (dat.Game), n *ntf.Notification)
}
}
z.Close()
case ".cue":
case ".cue", ".pbp", ".m3u":
// Look for a matching game entry in the database
state.DB.FindByROMName(f, filepath.Base(f), 0, games)
n.Update(ntf.Info, strconv.Itoa(i)+"/"+strconv.Itoa(len(roms))+" "+f)
Expand Down
1 change: 1 addition & 0 deletions settings/defau CF7A lts.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ func defaultSettings() Settings {
"SNK - Neo Geo Pocket": "mednafen_ngp_libretro",
"Sony - PlayStation": playstationCore,
},
FileDirectory: xdg.DataHome,
CoresDirectory: "./cores",
AssetsDirectory: "./assets",
DatabaseDirectory: "./database",
Expand Down
1 change: 1 addition & 0 deletions settings/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ type Settings struct {

CoreForPlaylist map[string]string `hide:"always" toml:"core_for_playlist"`

FileDirectory string `hide:"ludos" toml:"files_dir" label:"Files Directory" fmt:"%s" widget:"dir"`
CoresDirectory string `hide:"ludos" toml:"cores_dir" label:"Cores Directory" fmt:"%s" widget:"dir"`
AssetsDirectory string `hide:"ludos" toml:"assets_dir" label:"Assets Directory" fmt:"%s" widget:"dir"`
DatabaseDirectory string `hide:"ludos" toml:"database_dir" label:"Database Directory" fmt:"%s" widget:"dir"`
Expand Down
0