Skip to content

Commit 3a52728

Browse files
committed
Add Pro Action Replay MK3 cheat-cartridge emulation
Wraps the SNES core with the Datel MK3 BIOS for cheat entry, trainer and live cheat application: rtl/chip/mk3 (IO, mapper, intercept, NMI hook, SRAM, switch FSM, top wrapper) plus its qip hook, the Pocket package and chip32 loader, build/asset scripts, manuals, and a tag-triggered build & release workflow. Ships only this core; the agg23/srg320 RTL is retained for the build.
1 parent 621be93 commit 3a52728

42 files changed

Lines changed: 2628 additions & 282 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/FUNDING.yml‎

Lines changed: 0 additions & 2 deletions
This file was deleted.

‎.github/workflows/build.yml‎

Lines changed: 33 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -1,113 +1,56 @@
1-
################################################################################
2-
# How to create a tag to launch the workflow
3-
# git tag -a "0.1.0" -m "Release v0.1.0"
4-
# git push origin --tags
5-
################################################################################
6-
# WARNING: Make sure to set action permissions to max ("Read and write permissions")
7-
name: Build/Release
1+
# Build and release the core on a version tag.
2+
# git tag v0.2.1 && git push origin v0.2.1 -> release
3+
# git tag v0.2.1-beta && git push origin v0.2.1-beta -> pre-release
4+
# Repo setting: Actions -> Workflow permissions -> "Read and write".
5+
name: Build & Release
6+
87
on:
9-
workflow_dispatch:
108
push:
119
tags:
12-
- "[0-9]+.[0-9]+.[0-9]+*"
10+
- "v[0-9]+.[0-9]+.[0-9]+*"
11+
workflow_dispatch:
1312

1413
permissions:
1514
contents: write
1615

1716
jobs:
18-
synthesis:
17+
build:
1918
runs-on: ubuntu-latest
20-
strategy:
21-
matrix:
22-
core: ["main", "pal", "spc", "sa1gsu", "pal_sa1gsu"]
23-
2419
steps:
25-
- name: "🧰 Checkout Repository"
26-
uses: actions/checkout@v4
27-
28-
- name: "🧰 Checkout Packybara"
20+
- name: Checkout
2921
uses: actions/checkout@v4
30-
with:
31-
repository: "agg23/pocketpublish"
32-
path: ".github/publish"
3322

34-
- name: "🏗️ Compile design"
35-
shell: bash
23+
- name: Compile bitstream
3624
run: |
37-
map_value() {
38-
case "$1" in
39-
main)
40-
echo "ntsc"
41-
;;
42-
pal)
43-
echo "pal"
44-
;;
45-
spc)
46-
echo "ntsc_spc"
47-
;;
48-
sa1gsu)
49-
echo "ntsc_sa1gsu"
50-
;;
51-
pal_sa1gsu)
52-
echo "pal_sa1gsu"
53-
;;
54-
*)
55-
echo "Unknown input"
56-
;;
57-
esac
58-
}
59-
60-
build_type=$(map_value "${{ matrix.core }}")
61-
cmd="docker run --rm -v ${{ github.workspace }}:/build raetro/quartus:21.1 quartus_sh -t generate.tcl $build_type"
62-
echo "Running command: $cmd"
63-
eval $cmd
25+
docker run --rm -v "${{ github.workspace }}:/build" -w /build \
26+
raetro/quartus:21.1 \
27+
quartus_sh --flow compile projects/snes_pocket.qpf
28+
sudo chown -R "$USER" projects/output_files
6429
65-
- name: Upload failure artifact
66-
uses: actions/upload-artifact@v4
30+
- name: Upload logs on failure
6731
if: failure()
68-
with:
69-
name: failure_output_files
70-
path: projects/output_files/
71-
72-
- name: Reverse bitstream
73-
shell: bash
74-
run: |
75-
mkdir artifacts
76-
pip3 install -r .github/publish/requirements.txt
77-
python3 .github/publish/reverse.py projects/output_files/snes_pocket.rbf artifacts/snes_${{ matrix.core }}.rev
78-
79-
- name: Upload artifact
8032
uses: actions/upload-artifact@v4
8133
with:
82-
name: snes_${{ matrix.core }}
83-
path: artifacts/snes_${{ matrix.core }}.rev
84-
85-
packaging:
86-
runs-on: ubuntu-latest
87-
needs: synthesis
88-
env:
89-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
90-
steps:
91-
- name: "🧰 Checkout Repository"
92-
uses: actions/checkout@v4
34+
name: quartus-output
35+
path: projects/output_files/
9336

94-
- name: "🧰 Checkout Packybara"
95-
uses: actions/checkout@v4
37+
- name: Set up Python
38+
uses: actions/setup-python@v5
9639
with:
97-
repository: "agg23/pocketpublish"
98-
path: ".github/publish"
40+
python-version: "3.x"
9941

100-
- name: "Create folders"
42+
- name: Convert assets
10143
run: |
102-
pip3 install -r .github/publish/requirements.txt
103-
python3 .github/publish/create_folders.py
44+
python3 -m pip install --quiet pillow
45+
scripts/build-loader.sh
46+
scripts/build-icon-image.sh
10447
105-
- name: Download artifacts
106-
uses: actions/download-artifact@v4
107-
with:
108-
path: staging/Cores/agg23.SNES/
109-
merge-multiple: true
48+
- name: Package core
49+
run: scripts/build-release.sh
11050

111-
- name: "Release"
112-
run: |
113-
python3 .github/publish/release.py
51+
- name: Release
52+
uses: softprops/action-gh-release@v2
53+
with:
54+
files: release/*.zip
55+
prerelease: ${{ contains(github.ref_name, '-') }}
56+
generate_release_notes: true

‎.gitignore‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,6 @@ cr_ie_info.json
7373
!info.txt
7474
# ROMS Checklist
7575
!checklist.sha1
76-
!checklist.md5
76+
!checklist.md5
77+
# Local release staging
78+
/release/

‎README.md‎

Lines changed: 36 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,51 @@
1-
# SNES for Analogue Pocket
1+
# Pro Action Replay MK3 for Analogue Pocket
22

3-
Ported from the original core developed by [srg320](https://github.com/srg320) ([Patreon](https://www.patreon.com/srg320)). Latest upstream available at https://github.com/MiSTer-devel/SNES_MiSTer.
3+
A SNES core for the Analogue Pocket that emulates the Datel **Pro Action Replay
4+
MK3** cheat cartridge on top of [agg23's openFPGA SNES core](https://github.com/agg23/openfpga-SNES)
5+
(a port of [srg320's MiSTer SNES](https://github.com/MiSTer-devel/SNES_MiSTer)).
6+
The MK3 BIOS wraps a standard SNES ROM and provides the cartridge's cheat entry,
7+
trainer, and live cheat application.
48

5-
Please report any issues encountered to this repo. Most likely any problems are a result of my port, not the original core. Issues will be upstreamed as necessary.
9+
## Install
610

7-
> [!WARNING]
8-
>
9-
> Savestates/Memories/Sleep not supported
10-
>
11-
> Savestates/Memories/Sleep are not supported by any FPGA SNES core. Not this one, not the MiSTer core it's ported from, not the Analogue Super NT one.
12-
>
13-
> **Support for savestates will _not_ be coming** to any of these cores. Do not ask. If you would like to learn more, see [issue #59](https://github.com/agg23/openfpga-SNES/issues/59) and [this discussion on the MiSTer forums](https://misterfpga.org/viewtopic.php?t=4944).
11+
1. Extract the latest release ZIP to the root of your Pocket SD card.
12+
2. Place a verified 128 KB MK3 BIOS dump at
13+
`Assets/snes/timboettiger.Pro Action Replay/snes-pro-action-replay-mk3.bin`.
14+
The BIOS is proprietary Datel firmware and is not distributed here.
15+
3. Load any SNES ROM through the Pocket UI.
1416

15-
## Installation
17+
## Modes
1618

17-
### Easy mode
19+
The cartridge's 3-position switch is exposed as a core option:
1820

19-
I highly recommend the updater tools by [@mattpannella](https://github.com/mattpannella) and [@RetroDriven](https://github.com/RetroDriven). If you're running Windows, use [the RetroDriven GUI](https://github.com/RetroDriven/Pocket_Updater), or if you prefer the CLI, use [the mattpannella tool](https://github.com/mattpannella/pocket_core_autoupdate_net). Either of these will allow you to automatically download and install openFPGA cores onto your Analogue Pocket. Go donate to them if you can
21+
- **MK3 Menu** — boot into the BIOS for code entry (default)
22+
- **Cheats Active** — boot the game with cheats applied
23+
- **No Cheats** — boot the game unmodified
2024

21-
### Manual mode
22-
To install the core, copy the `Assets`, `Cores`, and `Platform` folders over to the root of your SD card. Please note that Finder on macOS automatically _replaces_ folders, rather than merging them like Windows does, so you have to manually merge the folders.
25+
## Documentation
2326

24-
## Usage
27+
The user manuals and the full reverse-engineering documentation live in the
28+
parent project: <https://github.com/timboettiger/action-replay-mk-iii>.
2529

26-
ROMs should be placed in `/Assets/snes/common`. Both headered and unheadered ROMs are now supported.
30+
## Build & release
2731

28-
## Features
32+
Pushing a version tag builds and publishes a release via GitHub Actions
33+
(`.github/workflows/build.yml`):
2934

30-
### Dock Support
35+
```
36+
git tag v0.2.1 && git push origin v0.2.1 # release
37+
git tag v0.2.1-beta && git push origin v0.2.1-beta # pre-release
38+
```
3139

32-
Core supports four players/controllers via the Analogue Dock. To enable four player mode, turn on `Use Multitap` setting.
40+
It compiles the bitstream (Quartus in Docker), converts the assets, packages the
41+
core, and attaches the ZIP to the release.
3342

34-
### Expansion Chips
43+
To build locally: compile `projects/snes_pocket.qpf` with Quartus, then run
44+
`scripts/build-release.sh`. Other helpers: `scripts/build-loader.sh` (chip32
45+
loader), and `scripts/build-icon-image.sh` / `scripts/build-platform-image.sh`
46+
(PNG to Pocket `.bin`).
3547

36-
All original expansion chips supported by MiSTer are also supported on the Pocket. The full list is:
48+
## Credits & licence
3749

38-
* SA-1 (Super Mario RPG)
39-
* Super FX/GSU-1/2 (Star Fox)
40-
* DSP (Super Mario Kart)
41-
* CX4 (Mega Man X 2)
42-
* S-DD1 (Star Ocean)
43-
* SPC7110 (Far East of Eden)
44-
* ST1010 (F1 Roc 2)
45-
* BSX (Satellaview)
46-
47-
The Super Game Boy, ST011 (Hayazashi Nidan Morita Shougi), and ST018 (Hayazashi Nidan Morita Shougi 2) are not supported in the MiSTer core, and therefore are not supported here. Additionally, the homebrew MSU expansion chip is not currently supported.
48-
49-
#### BSX
50-
51-
BSX ROMs must be patched to run without BIOS. The BSX BIOS is not currently supported
52-
53-
### Savestates/Memories/Sleep
54-
55-
> **Warning**: Not supported
56-
57-
Savestates/Memories/Sleep are not supported by any FPGA SNES core. Not this one, not the MiSTer core it's ported from, not the Analogue Super NT one.
58-
59-
**Support for savestates will _not_ be coming** to any of these cores. Do not ask. If you would like to learn more, see [issue #59](https://github.com/agg23/openfpga-SNES/issues/59) and [this discussion on the MiSTer forums](https://misterfpga.org/viewtopic.php?t=4944).
60-
61-
### Video
62-
63-
* `Square Pixels` - The internal resolution of the SNES is a 8:7 pixel aspect ratio (wide pixels), which roughly corresponds to what users would see on 4:3 display aspect ratio CRTs. Some games are designed to be displayed at 8:7 PAR (the core's default), and others at 1:1 PAR (square pixels). The `Square Pixels` option is provided to switch to a 1:1 pixel aspect ratio
64-
* `Pseudo Transparency` - Enable blending of adjacent pixels, used in some games to simulate transparency
65-
66-
### Turbo
67-
68-
* `CPU Turbo` - Applies a speed increase to the main SNES CPU. **NOTE:** This has different compatibility with different games. See the [MiSTer list of games](https://github.com/MiSTer-devel/SNES_MiSTer/blob/master/SNES_Turbo.md) that this feature works with
69-
* `SuperFX Turbo` - Applies a speed increase to the GSU (SuperFX) chip. Can be used in addition to the `CPU Turbo` option in games like Star Fox to maintain a higher frame rate.
70-
71-
### Controller Options
72-
73-
There are several options provided for selecting which type of controller the core will emulate.
74-
75-
* `Gamepad` - The standard SNES controller used with most games.
76-
* `Super Scope` - The Super Scope lightgun that's used with most lightgun games. See Lightguns for more details.
77-
* `Justifier` - The Justifier lightgun that's used with Lethal Enforcers. See Lightguns for more details.
78-
* `Mouse` - The SNES mouse that's used with Mario Paint and several other games. See SNES Mouse for more details.
79-
80-
### Lightguns
81-
82-
Core supports virtual lightguns by selecting the `Super Scope` or `Justifier` options under `Controller Options`. Most lightgun games user the Super Scope but Lethal Enforcers uses the Justifier. The crosshair can be controlled with the D-Pad or left joystick, using the A button to fire and the B button to reload. D-Pad aim sensitivity can be adjusted with the `D-Pad Aim Speed` setting.
83-
84-
**NOTE:** Joystick support for aiming only appears to work when a controller is paired over Bluetooth and not connected to the Analogue Dock directly by USB.
85-
86-
### SNES Mouse
87-
88-
Core supports a virtual SNES mouse by selecting `Mouse` under `Controller Options`. The mouse can be moved with the D-Pad or left joystick and left and right clicks can be performed by pressing the A and B buttons respectively. Mouse D-Pad movement sensitivity can be adjusted with the `D-Pad Aim Speed` setting.
89-
90-
**NOTE:** The dock firmware doesn't currently support a USB mouse.
50+
SNES core by srg320, openFPGA port by agg23, MK3 emulation by Tim Boettiger.
51+
GPL-3.0 — see `LICENSE`; redistributions must include source.

‎art/icon.png‎

2.01 KB
Loading

‎pkg/Cores/agg23.SNES/core.json‎

Lines changed: 0 additions & 47 deletions
This file was deleted.

‎pkg/Cores/agg23.SNES/data.json‎

Lines changed: 0 additions & 25 deletions
This file was deleted.

‎pkg/Cores/agg23.SNES/icon.bin‎

-2.53 KB
Binary file not shown.

‎pkg/Cores/agg23.SNES/info.txt‎

Lines changed: 0 additions & 5 deletions
This file was deleted.
-1.78 MB
Binary file not shown.

0 commit comments

Comments
 (0)