Skip to content

Commit

Permalink
Fully replaces the CLI with a GUI version (#1)
Browse files Browse the repository at this point in the history
* Starts a GUI version

* pretty much finishes the screenshot section

* Tidy up some CSS & types

* core info page & read inventory json

* better info for non-installed cores

* update some things

* Shows an about screen which'll say if there's an update

* Improve the "suports" bit of the core info page & sort the screenshots by newest

* faster requests, better bubbles

* save scroll position of lists

* Adds a platform info bit

* fancy spinning 3D pocket

* improve 3d model a bit, zoom in a bit too

* last couple of tweaks to the model

* Check if it looks like a pocket & fix a first time setup warning

* start building out the more gainular core install process

* much better install system

* fix install window scroll

* enables turning off files from the install

* Shows if required files are missing, but doesn't yet offer to pull them down

* tidy up the recoil things a little

* more recoil tidy

* Now allows for installing required files

* adds a refresh button & misc bugfixing

* adds app icons, not great but they'll do

* start a thread checking for the pocket folder being removed

* bit of a tidy, move all the invokes into one place

* refactor zip install flow a little

* Can't believe that worked first time...

* A little bit cleaner & start progress bar earlier

* support installing arbitary things from dropped `.zip` files

* cooler install progress

* throw together a little screen for the "Games" tab

* read-only backup system

* ability to restore saves

* some QOL fixes

* handle save locations which aren't on the file system

* ts-ignore some stuff

* Tidy & add tauri workflows

* Update readme too

* Add a little more to the readme

* upload bundle artifact so I can have a look at it
  • Loading branch information
neil-morrison44 authored Nov 21, 2022
1 parent ef1f74f commit abb39ba
Show file tree
Hide file tree
Showing 138 changed files with 16,080 additions and 975 deletions.
44 changes: 29 additions & 15 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,39 @@ on:
types: [created]

jobs:
release:
name: release ${{ matrix.target }}
runs-on: ubuntu-latest
build-tauri:
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-pc-windows-gnu
archive: zip
- target: x86_64-unknown-linux-musl
archive: tar.gz tar.xz
- target: x86_64-apple-darwin
archive: zip
platform: [macos-latest, ubuntu-20.04, windows-latest]

runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@master
- name: Compile and release
uses: rust-build/[email protected]
- uses: actions/checkout@v2
- name: setup node
uses: actions/setup-node@v1
with:
node-version: 16
- name: install Rust stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-20.04'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf
- name: install app dependencies and build it
run: npm i && npm run build

- name: Get release
id: get_release
uses: bruceadams/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
RUSTTARGET: ${{ matrix.target }}
ARCHIVE_TYPES: ${{ matrix.archive }}
releaseId: ${{ steps.get_release.outputs.id }}
35 changes: 35 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: "test-on-pr"
on: [pull_request]

jobs:
test-tauri:
strategy:
fail-fast: false
matrix:
platform: [macos-latest, ubuntu-20.04, windows-latest]

runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v2
- name: setup node
uses: actions/setup-node@v1
with:
node-version: 16
- name: install Rust stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-20.04'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf
- name: install app dependencies and build it
run: npm i && npm run build
- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/upload-artifact@v3
with:
name: bundle
path: src-tauri/target/release/bundle/
35 changes: 23 additions & 12 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@
# Generated by Cargo
# will have compiled files and executables
/target/
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Cargo.lock
node_modules
dist
dist-ssr
*.local

# These are backup files generated by rustfmt
**/*.rs.bk
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?


# Added by cargo

/target
target
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["tauri-apps.tauri-vscode", "rust-lang.rust-analyzer"]
}
16 changes: 0 additions & 16 deletions Cargo.toml

This file was deleted.

51 changes: 22 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,34 @@
# pocket-sync
A tool for syncing the Analogue Pocket (initially with MiSTer)

[![asciicast](https://asciinema.org/a/VnRRsQj8BOikkHi3PKgo4OeWI.svg)](https://asciinema.org/a/VnRRsQj8BOikkHi3PKgo4OeWI?autoplay=1)
A Windows / Mac / Linx GUI to do _stuff_ with the Analogue Pocket.

![The Cores List](./readme_images/cores_list.png)

__WARNING__ this is a _very_ early release - please don't use it without having backed up your saves.
I recommend backing up via `zip -r saves_backup.zip saves` on the MiSTer & `zip -r saves_backup.zip Saves` on the Pocket.
Features:

- There's some inherent issues comparing last modified dates between different systems & with this you've got 3 (the Pocket, the MiSTer, and your PC) - so don't expect this to be accurate within a single day & I'd recommend against running the merge process twice in one day -- this might be fixed later if I can narrow down how the MiSTer, Pocket etc store timestamps.
- Browse & install cores
- Export corrected & upscalled screenshots
- Backup save files
- Quick links to open game file folders

- If you see a bunch of Pocket saves with the timestamp `2020-01-01 23:00:00 +00:00` they were probably saved on an older Pocket firmware that wasn't doing timestamps.
## Roadmap

- If there's a save which is _only_ on the MiSTer it'll be moved to the _root folder_ on the Pocket, if the rom's in a nested folder this'll mean the save won't get picked up.
### Soon

- Some cores do double duty on the MiSTer (e.g. `GAMEBOY` does GB & GBC), for these cores if there isn't a Pocket save already they'll be put somewhere (hopefully) sensible (`GameGear` might be an issue though since it's in with `SMS` on the MiSTer)
- Installing / Checking for firmware updates
- Hopefully get the saves backups working how I'd planned

- The ROM name must match _exactly_ for it to be picked up as a save, this might cause issues for NEOGEO.
### Longer term

## Usage
- Add back MiSTer save file sync (don't really want to touch it if there's a chance I'll clopper MiSTer files with a bunch of incompatiable Genesis saves)

- Grab the latest release for your OS from the releases section ->
- You'll probably need to jump through the "Unidentified Developer" thing (well, on Mac anyway)
- Your MiSTer will need to be on and have FTP enabled (on the default port, 21)
- (Probably a good time to back up your saves just incase)
- Run `./pocket-sync [path-to-pocket-SD-card] --host-mister [mister IP or hostname]`
- If you've changed the user / password on your MiSTer you'll need to use `--user-mister [name]` / `--password-mister [password]`
- It'll add a `pocket_sync.json` that (currently) just contains the timestamp of the last run so the program knows not to bother with things that've been synced already
- It'll merge the saves by these rules:
- If both devices have the save & they're both older than the last-run timestamp **skip**
- If only one device has the save, **copies it to both**
- If one device has a save newer than the last-run time & the other is older **copies newer over older**
- If both devices have saves newer than the last-run time **allows you to pick the Pocket save, the MiSTer save, or to skip**
## Roadmap
## FAQs

### Donations?

Nah, I'm alright - you should donate to the folks porting / building cores over though.

## Thanks to

- [x] CLI for syncing saves with a MiSTer over FTP
- [ ] GUI (Windows / Mac / Linux)
- [ ] Library browser / editor in GUI
- [ ] Auto-updating GUI
- [ ] Core Updater in GUI (maybe)
- [ ] GUI for core updator showing release notes etc
- [The OpenFPGA Cores Inventory supplies a bunch of the data used in the app](https://github.com/joshcampbell191/openfpga-cores-inventory)
- [This recreation of the Analogue OS font](https://github.com/AbFarid/analogue-os-font)
Binary file added app-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Pocket Sync</title>
</head>

<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
Loading

0 comments on commit abb39ba

Please sign in to comment.